summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_sis.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove duplicate FBSDID's, move others to their right place.obrien2003-11-141-4/+3
|
* Try to create some sort of consistency in how the routings to find theobrien2003-11-131-11/+10
| | | | | | | multicast hash are written. There are still two distinct algorithms used, and there actually isn't any reason each driver should have its own copy of this function as they could all share one copy of it (if it grew an additional argument).
* Replace the if_name and if_unit members of struct ifnet with new membersbrooks2003-10-311-2/+1
| | | | | | | | | | | | | if_xname, if_dname, and if_dunit. if_xname is the name of the interface and if_dname/unit are the driver name and instance. This change paves the way for interface renaming and enhanced pseudo device creation and configuration symantics. Approved By: re (in principle) Reviewed By: njl, imp Tested On: i386, amd64, sparc64 Obtained From: NetBSD (if_xname)
* mark interrupt handlers MPSAFEsam2003-10-291-1/+1
|
* Fix m_head handling in sis_encap so that the correct mbuf is always handedsilby2003-10-191-9/+8
| | | | to BPF_MTAP.
* change timer to MPSAFEsam2003-09-051-4/+4
| | | | Sponsored by: FreeBSD Foundation
* Examine and record the Silicon Revision Register on NS parts.phk2003-09-031-2/+27
| | | | | | | | | | | | | | We can't update the device description in attach (why not ?), so we device_print() what we find. Conditionalize the short cable fix on this being older than rev 16A. Call device_printf() when we apply short cable fix. Include interrupt hold-off setting for rev 16+ under "#ifdef notyet" The device_printf()'s will go under bootverbose once the various issues have settled a bit.
* Prefer new location of pci include files (which have only been in theimp2003-08-221-2/+2
| | | | | tree for two or more years now), except in a few places where there's code to be compatible with older versions of FreeBSD.
* "short cable" fix for DP8315sam2003-08-191-0/+23
| | | | | Derived from: netbsd and tech note at soekris web site MFC after: 1 week
* Use the BUS_DMA_ZERO flag.mux2003-07-271-6/+3
|
* Erm, my previous commit was wrong and sis_tick() was only called each timecognet2003-07-221-1/+5
| | | | | | | | | | sis_ioctl() was called, so one had to use ifconfig each time the cable got plugged in to be able to use the connection. Do it a better way now, add a "in_tick" field in the softc structure, call timeout() in sis_tick() and don't call it in sis_init() if in_tick is non-zero. Reported by: Landmark Networks Pointy hat to: cognet
* Due to extreme bogusness in the pci bus layer, these drivers wereimp2003-07-031-2/+2
| | | | | | | | | forced to do slightly bogus power state manipulation. However, this is one of those features that is preventing further progress, so mark them as BURN_BIRDGES like I did for the drivers in sys/dev/... This, like the other change, are a no-op unless you have BURN_BRIDGES in your kernel.
* Mega busdma API commit.scottl2003-07-011-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | Add two new arguments to bus_dma_tag_create(): lockfunc and lockfuncarg. Lockfunc allows a driver to provide a function for managing its locking semantics while using busdma. At the moment, this is used for the asynchronous busdma_swi and callback mechanism. Two lockfunc implementations are provided: busdma_lock_mutex() performs standard mutex operations on the mutex that is specified from lockfuncarg. dftl_lock() is a panic implementation and is defaulted to when NULL, NULL are passed to bus_dma_tag_create(). The only time that NULL, NULL should ever be used is when the driver ensures that bus_dmamap_load() will not be deferred. Drivers that do not provide their own locking can pass busdma_lock_mutex,&Giant args in order to preserve the former behaviour. sparc64 and powerpc do not provide real busdma_swi functions, so this is largely a noop on those platforms. The busdma_swi on is64 is not properly locked yet, so warnings will be emitted on this platform when busdma callback deferrals happen. If anyone gets panics or warnings from dflt_lock() being called, please let me know right away. Reviewed by: tmm, gibbs
* Use __FBSDID().obrien2003-06-111-2/+0
|
* Don't call timeout() in sis_tick(), this is done earlier by mii_tick(), and itcognet2003-05-061-4/+0
| | | | | | | | leads to a panic at unload time, as we own 2 instances of callout and untimeout() only one. Will I'm there, remove a call to callout_handler_init(), one is enough. Reviewed by: wpaul
* Use newly minted device_is_attached rather than device_is_alive to seeimp2003-04-211-1/+1
| | | | | | | | | if attach succeeded. device_is_alive just tells us that probe succeeded. Since we were using it to do things like detach net interfaces, this caused problems when there were errors in the attach routine. Symptoms of problem reported by: martin blapp
* Revise attach/detach resource cleanupnjl2003-04-171-6/+15
| | | | | | | | | | | | | | | - Unconditionally call *_stop() if device is in the tree. This is to prevent callouts from happening after the device is gone. Checks for bus_child_present() should be added in the future to keep from touching potentially non-existent hardware in *_detach(). Found by iedowse@. - Always check for and free miibus children, even if the device is not in the tree since some failure cases could have gotten here. - Call ether_ifdetach() in the irq setup failure case - ti(4), xl(4): move ifmedia_init() calls to the beginning of attach so that ifmedia_removeall() can be unconditionally called on detach. There is no way to detect whether ifmedia has been initialized without using a separate variable (as tl(4) does). - Add comments to indicate assumptions of code path
* Remove an unused variable so this compiles again.jhb2003-04-161-1/+0
|
* - Don't call pci_enable_io() in drivers (unless needed for resume).mdodd2003-04-161-17/+0
| | | | | - Don't test memory/port status and emit an error message; the PCI bus code will do this now.
* - Express hard dependencies on bus (pci, isa, pccard) andmdodd2003-04-151-1/+3
| | | | | | | | network layer (ether). - Don't abuse module names to facilitate ifconfig module loading; such abuse isn't really needed. (And if we do need type information associated with a module then we should make it explicit and not use hacks.)
* Use __FBSDID rather than rcsid[].obrien2003-04-031-5/+3
|
* Add missing ()'s so that these drivers all compile again.jhb2003-03-311-1/+1
| | | | | Noticed by: jake Tested on: i386 (compile)
* Clean up locking and resource management for pci/if_*njl2003-03-311-88/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Remove locking of the softc in the attach method, instead depending on bus_setup_intr being at the end of attach (delaying interrupt enable until after ether_ifattach is called) - Call *_detach directly in the error case of attach, depending on checking in detach to only free resources that were allocated. This puts all resource freeing in one place, avoiding thinkos that lead to memory leaks. - Add bus_child_present check to calls to *_stop in the detach method to be sure hw is present before touching its registers. - Remove bzero softc calls since device_t should do this for us. - dc: move interrupt allocation back where it was before. It was unnecessary to move it. This reverts part of 1.88 - rl: move irq allocation before ether_ifattach. Problems might have been caused by allocating the irq after enabling interrupts on the card. - rl: call rl_stop before ether_ifdetach - sf: call sf_stop before ether_ifdetach - sis: add missed free of sis_tag - sis: check errors from tag creation - sis: move dmamem_alloc and dmamap_load to happen at same time as tag creation - sk: remove duplicate initialization of sk_dev - ste: add missed bus_generic_detach - ti: call ti_stop before ether_ifdetach - ti: add missed error setting in ti_rdata alloc failure - vr: add missed error setting in I/O, memory mapping cases - xl: add missed error setting in I/O, memory mapping cases - xl: remove multi-level goto on attach failure - xl: move dmamem_alloc and dmamap_load to happen at same time as tag creation - Calls to free(9) are unconditional because it is valid to call free with a null pointer. Reviewed by: imp, mdodd
* Have sis_encap use m_defrag if:silby2003-03-291-1/+25
| | | | | | | | | | | | | | | 1. The chain passed in is > 31 fragments long or 2. The chain will not fit in the remaining descriptors without defragmentation. This is slightly less clear than other network drivers because the sis chips share one descriptor list for all packets, it seems. Before this change, a > 127 fragment chain would get stuck in the IFQUEUE permanently, bringing all network traffic to a halt. MFC after: 2 weeks
* Back out M_* changes, per decision of the TRB.imp2003-02-191-1/+1
| | | | Approved by: trb
* Add PCI revision number for 630A and 900B. Enable parity error detectionmbr2003-01-281-19/+82
| | | | | | | | | | on 900B and 635(A). Re-add the enhanced PHY access register method again for older chipsets, they do not seem to work with all old chips. Reviewed by: phk MFC after: 7 days
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-1/+1
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Make newer integrated SiS900 cards working.mbr2003-01-101-2/+27
| | | | | | | | | | | Allow to read EEPROM from LAN. It is shared between a 1394 controller and the NIC and each time we access it, we need to set SIS_EECMD_REQ. Idea from: linux driver source Reviewed by: luoqi Obtained from: linux driver source (idea)
* Sis no longer implements the enhanced phy controlmbr2003-01-101-53/+241
| | | | | | | | | | register, and phy has to be directly accessed via mdio. Patch converted to CURRENT from STABLE. Submitted by: luoqi Reviewed by: luoqi (again) MFC after: 2 weeks
* SIS_CFG_EDB_MASTER_EN indicates the EDB bus is used instead ofmbr2003-01-101-2/+10
| | | | | | | | | the PCI bus. When this bit is set, the Max DMA Burst Size for TX/RX DMA should be no larger than 64 bytes. Reviewed by: luoqi Obtained from: (idea from linux driver source) MFC after: 2 weeks
* Correct a harmless problem when creating the DMA tagmux2002-12-131-1/+1
| | | | | | | | used to map mbufs. The maximum size should be MCLBYTES and not SIS_TX_LIST_SZ. This is probably a typo in the original commit. Tested by: cognet
* o track either_ifattach/ether_ifdetach API changessam2002-11-141-11/+8
| | | | | | | | | | | o use if_input for input packet processing o don't strip the Ethernet header for input packets o use BPF_* macros bpf tapping o call ether_ioctl to handle default ioctl case o track vlan changes Reviewed by: many Approved by: re
* Be consistent about functions being static.phk2002-10-161-1/+1
| | | | Spotted by: FlexeLint.
* Put return values from functions on a line by themselves.alfred2002-08-231-36/+72
| | | | Ok'd previously by: wpaul
* Remove the SIS_LOCK/SIS_UNLOCK from sis_attach(). It makes WITNESSphk2002-08-191-3/+0
| | | | barf and there seem to be little room for contention during attach.
* Increase size of ifnet.if_flags from 16 bits (short) to 32 bits (int). To avoidsobomax2002-08-181-3/+3
| | | | | | | breaking application ABI use unused ifreq.ifru_flags[1] for upper 16 bits in SIOCSIFFLAGS and SIOCGIFFLAGS ioctl's. Reviewed by: -hackers, -net
* Use new interface for ether_input().luigi2002-08-071-13/+4
| | | | | | | Remove some unnecessary assignments to mbuf fields in sis_newbuf(), the "length" fields are of no use while the mbuf is in the receive ring. MFC after: 3 days
* Use m_getcl() to allocate mbuf+cluster for the receive ring.luigi2002-08-041-25/+9
| | | | | | | Remove the sis_quick variable, as it was there for testing purposes only. MFC after: 3 days
* Make sure that if_timer does not get reset if there are packetsluigi2002-06-301-18/+10
| | | | | | | | | | | still queued for transmission. This should solve the problem of the device stalling on transmissions if some link event prevents transmission. There are other drivers which have the same problem and need to be fixed in the same way. MFC after: 3 days
* Change callers of mtx_init() to pass in an appropriate lock type name. Injhb2002-04-041-1/+2
| | | | | | | most cases NULL is passed, but in some cases such as network driver locks (which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used. Tested on: i386, alpha, sparc64
* Remove __P.alfred2002-03-201-51/+46
|
* Fix support for 630ET support. We don't need the Linux part to set theambrisko2002-02-061-10/+3
| | | | | | | mii access mode. Fix the device ID and make it read the mac via sis_read_mac. Reviewed by: imp MFC after: 1 week
* Fix mind-o: compare sc->sis_rev instead of 'command' when trying towpaul2002-01-141-1/+1
| | | | decide how to read the station address.
* Add support for newer integrated SiS 900 controllers on the 635 and 735wpaul2002-01-121-5/+46
| | | | | | | motherboard chipsets. We need to force the chip to reload its MAC address into the receive filter, and enable software access mode for the PHY. PR: kern/33294
* Fix access-after-free bug added in revision 1.31.archie2001-12-151-4/+5
| | | | | Detected by: INVARIANTS MFC after: 2 days
* Patch up some existing style bugs and some that crept in with thepeter2001-12-151-1/+2
| | | | DEVICE_POLLING stuff.
* Device Polling code for -current.luigi2001-12-141-1/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Non-SMP, i386-only, no polling in the idle loop at the moment. To use this code you must compile a kernel with options DEVICE_POLLING and at runtime enable polling with sysctl kern.polling.enable=1 The percentage of CPU reserved to userland can be set with sysctl kern.polling.user_frac=NN (default is 50) while the remainder is used by polling device drivers and netisr's. These are the only two variables that you should need to touch. There are a few more parameters in kern.polling but the default values are adequate for all purposes. See the code in kern_poll.c for more details on them. Polling in the idle loop will be implemented shortly by introducing a kernel thread which does the job. Until then, the amount of CPU dedicated to polling will never exceed (100-user_frac). The equivalent (actually, better) code for -stable is at http://info.iet.unipi.it/~luigi/polling/ and also supports polling in the idle loop. NOTE to Alpha developers: There is really nothing in this code that is i386-specific. If you move the 2 lines supporting the new option from sys/conf/{files,options}.i386 to sys/conf/{files,options} I am pretty sure that this should work on the Alpha as well, just that I do not have a suitable test box to try it. If someone feels like trying it, I would appreciate it. NOTE to other developers: sure some things could be done better, and as always I am open to constructive criticism, which a few of you have already given and I greatly appreciated. However, before proposing radical architectural changes, please take some time to possibly try out this code, or at the very least read the comments in kern_poll.c, especially re. the reason why I am using a soft netisr and cannot (I believe) replace it with a simple timeout. Quick description of files touched by this commit: sys/conf/files.i386 new file kern/kern_poll.c sys/conf/options.i386 new option sys/i386/i386/trap.c poll in trap (disabled by default) sys/kern/kern_clock.c initialization and hardclock hooks. sys/kern/kern_intr.c minor swi_net changes sys/kern/kern_poll.c the bulk of the code. sys/net/if.h new flag sys/net/if_var.h declaration for functions used in device drivers. sys/net/netisr.h NETISR_POLL sys/dev/fxp/if_fxp.c sys/dev/fxp/if_fxpvar.h sys/pci/if_dc.c sys/pci/if_dcreg.h sys/pci/if_sis.c sys/pci/if_sisreg.h device driver modifications
* MFS (merge from stable): rev 1.13.4.13, fix ordering of IFF_RUNNING mods.peter2001-12-071-2/+3
| | | | | | The reason we are required to commit to -current first is so that later MFC's do not risk the loss of existing bug fixes. Even if this was not strictly required in -current, it should still be fixed there too.
* Add VLAN support.jhay2001-12-051-0/+11
| | | | MFC after: 7 days
* Remove error messages on mbuf allocation failures, nowluigi2001-12-041-6/+1
| | | | | | this is done more safely in kern/subr_mbuf.c Two-days'-delay-thanks-to: @home shutting down service
OpenPOWER on IntegriCloud