summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_sisreg.h
Commit message (Collapse)AuthorAgeFilesLines
* Convert sis(4) to use its own watchdog procedure.delphij2007-02-241-0/+1
| | | | Submitted by: Florian C. Smeets <flo kasimir com>
* Consistently use if_printf() only in interface methods: if_start,glebius2006-09-151-1/+1
| | | | | | | | | | if_ioctl, if_watchdog, etc, or in functions that are used by these methods only. In all other cases use device_printf(). This also fixes several panics, when if_printf() is called before softc->ifp was initialized. Submitted by: Alex Lyashkov <umka sevcity.net>
* Small fixes to sis(4):jhb2005-09-261-1/+0
| | | | | | | | | | | | | | - Remove sis_unit and use device_printf() and if_printf() instead. - Use callout_init_mtx() for the callout. - Remove spls. - Fix locking for ifmedia to happen in the ifmedia handlers rather than in sis_ioctl(). - Log an error message if we fail to allocate any resources. Perform cleanup if we fail to allocate any resources so that we don't leave a mutex hanging around. Tested by: Jason Tsai jason dot tsai at newcyberian dot com (1-4) MFC after: 3 days
* Use the new bus_space/resource convenience functions.phk2005-09-241-4/+1
|
* Move code macros from if_sis*reg*.h to if_sis.*c*phk2005-09-201-16/+0
|
* Stop embedding struct ifnet at the top of driver softcs. Instead thebrooks2005-06-101-1/+1
| | | | | | | | | | | | | | | | | | | | struct ifnet or the layer 2 common structure it was embedded in have been replaced with a struct ifnet pointer to be filled by a call to the new function, if_alloc(). The layer 2 common structure is also allocated via if_alloc() based on the interface type. It is hung off the new struct ifnet member, if_l2com. This change removes the size of these structures from the kernel ABI and will allow us to better manage them as interfaces come and go. Other changes of note: - Struct arpcom is no longer referenced in normal interface code. Instead the Ethernet address is accessed via the IFP2ENADDR() macro. To enforce this ac_enaddr has been renamed to _ac_enaddr. - The second argument to ether_ifattach is now always the mac address from driver private storage rather than sometimes being ac_enaddr. Reviewed by: sobomax, sam
* Revert local experiment which leaked into commit.phk2005-01-071-1/+1
|
* Fix compilation of DEVICE_POLLING code.phk2005-01-071-1/+1
|
* /* -> /*- for license, minor formatting changesimp2005-01-071-1/+1
|
* If we get an interrupt and the interface is down, return before wephk2005-01-071-0/+1
| | | | | grab the lock. This should help a tiny bit on machines where unused if_sis interfaces share IRQ.
* Instead of keeping track of the index into the receive ring use the alreadyphk2005-01-041-1/+1
| | | | implemented "sis_nextdesc" pointer to keep a pointer instead.
* Forget about the sis_list_data and sis_ring_data structures and embeddphk2005-01-041-25/+12
| | | | | | | their fields directly in the softc structure. This is a no-op which shortens most of the affected source lines by N * 10 characters.
* Vastly improve performance of IRQ handling on stopped interfaces withphk2003-12-251-0/+1
| | | | | | | | | | | | | | | | this driver by introducing a flag saying we already stopped the device. On my Soekris net4801, this took a ping -i 0.001 from spending 80% of time in interrupt handling to 10% (approx numbers). This was a particular problem for the net4801 because the tree interfaces share the same interrupt, but it would be a problem for any configuration where an unused if_sis interface shares an interrupt with a busy device. Other drivers may have similar problems. Thanks to: Luigi
* Drop the driver lock around calls to if_input to avoid a LOR whensam2003-11-141-0/+1
| | | | | | | | the packets are immediately returned for sending (e.g. when bridging or packet forwarding). There are more efficient ways to do this but for now use the least intrusive approach. Reviewed by: imp, rwatson
* change timer to MPSAFEsam2003-09-051-1/+1
| | | | Sponsored by: FreeBSD Foundation
* Examine and record the Silicon Revision Register on NS parts.phk2003-09-031-1/+11
| | | | | | | | | | | | | | 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.
* Erm, my previous commit was wrong and sis_tick() was only called each timecognet2003-07-221-0/+1
| | | | | | | | | | 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
* Fix typo in an unused macro.mux2003-01-291-1/+1
|
* Add PCI revision number for 630A and 900B. Enable parity error detectionmbr2003-01-281-0/+4
| | | | | | | | | | 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
* Make newer integrated SiS900 cards working.mbr2003-01-101-0/+9
| | | | | | | | | | | 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-0/+21
| | | | | | | | | | 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-1/+4
| | | | | | | | | 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
* Make sure that if_timer does not get reset if there are packetsluigi2002-06-301-1/+1
| | | | | | | | | | | 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
* Use ETHER_CRC_LEN instead of SIS_CRC_SIZEluigi2002-02-071-2/+1
| | | | Suggested-by: Archie, Doug Ambrisko
* Fix a bug in the driver -- the chip will always include the CRCluigi2002-02-071-1/+2
| | | | | | | in the received packet size, but the upper level routines want the length without it. Reported-by: Doug Ambrisko, ambrisko@freebsd.org
* Fix support for 630ET support. We don't need the Linux part to set theambrisko2002-02-061-1/+1
| | | | | | | mii access mode. Fix the device ID and make it read the mac via sis_read_mac. Reviewed by: imp MFC after: 1 week
* Add support for newer integrated SiS 900 controllers on the 635 and 735wpaul2002-01-121-0/+8
| | | | | | | 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
* Patch up some existing style bugs and some that crept in with thepeter2001-12-151-1/+1
| | | | DEVICE_POLLING stuff.
* Device Polling code for -current.luigi2001-12-141-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix a bug in the driver -- under load, the receive unit could becomeluigi2001-11-271-1/+2
| | | | | | | | | idle and the driver would not detect the event, requiring userland to cycle the interface to bring it up again. The fix consists in adding SIS_IMR_RX_IDLE to the interrupt mask and add a command in sis_intr() to restart the receiver when this happens. While at it, make the test of status bits more efficient.
* Convert the if_sis and if_rl drivers to use the bus_dma API instead ofwpaul2001-08-151-6/+17
| | | | | | | | | | calling vtophys() and contigmalloc()/contigfree() directly. Hopefully, I have shaken out all of the problems with busdma on the alpha now. (Everything seems to work as expected.) Also, change the max RX DMA limit to 1024 bytes instead of "unlimited," as the latter seems not to work correctly on the alpha that I tested. (At 100Mbps, all attempts to receive frames yield RX errors.)
* Big round of minor updates:wpaul2001-02-211-0/+5
| | | | | | | | | | | | | | - Use pci_get_powerstate()/pci_set_powerstate() in all the other drivers that need them so we don't have to fiddle with the PCI power management registers directly. - Use pci_enable_busmaster()/pci_enable_io() to turn on busmastering and PIO/memory mapped accesses. - Add support to the RealTek driver for the D-Link DFE-530TX+ which has a RealTek 8139 with its own PCI ID. (Submitted by Jason Wright) - Have the SiS 900/National DP83815 driver be sure to disable PME mode in sis_reset(). This apparently fixes a problem on some motherboards where the DP83815 chip fails to receive packets. (Submitted by Chuck McCrobie <mccrobie@cablespeed.com>)
* Change and clean the mutex lock interface.bmilekic2001-02-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mtx_enter(lock, type) becomes: mtx_lock(lock) for sleep locks (MTX_DEF-initialized locks) mtx_lock_spin(lock) for spin locks (MTX_SPIN-initialized) similarily, for releasing a lock, we now have: mtx_unlock(lock) for MTX_DEF and mtx_unlock_spin(lock) for MTX_SPIN. We change the caller interface for the two different types of locks because the semantics are entirely different for each case, and this makes it explicitly clear and, at the same time, it rids us of the extra `type' argument. The enter->lock and exit->unlock change has been made with the idea that we're "locking data" and not "entering locked code" in mind. Further, remove all additional "flags" previously passed to the lock acquire/release routines with the exception of two: MTX_QUIET and MTX_NOSWITCH The functionality of these flags is preserved and they can be passed to the lock/unlock routines by calling the corresponding wrappers: mtx_{lock, unlock}_flags(lock, flag(s)) and mtx_{lock, unlock}_spin_flags(lock, flag(s)) for MTX_DEF and MTX_SPIN locks, respectively. Re-inline some lock acq/rel code; in the sleep lock case, we only inline the _obtain_lock()s in order to ensure that the inlined code fits into a cache line. In the spin lock case, we inline recursion and actually only perform a function call if we need to spin. This change has been made with the idea that we generally tend to avoid spin locks and that also the spin locks that we do have and are heavily used (i.e. sched_lock) do recurse, and therefore in an effort to reduce function call overhead for some architectures (such as alpha), we inline recursion for this case. Create a new malloc type for the witness code and retire from using the M_DEV type. The new type is called M_WITNESS and is only declared if WITNESS is enabled. Begin cleaning up some machdep/mutex.h code - specifically updated the "optimized" inlined code in alpha/mutex.h and wrote MTX_LOCK_SPIN and MTX_UNLOCK_SPIN asm macros for the i386/mutex.h as we presently need those. Finally, caught up to the interface changes in all sys code. Contributors: jake, jhb, jasone (in no particular order)
* Apply patch to add support for the intergrated ethernet in the SiS630Ewpaul2001-02-091-0/+7
| | | | | | | | | | chipset. The MAC address is stored in the APC CMOS RAM and we have to commit trememdous evil in order to read it. The code to do this is only activated on the i386 platform. Thanks to Cameron Grant for providing access to a test box for me to tinker with. This will fix the problem where the sis driver ends up with a station address of 00:00:00:00:00:00 on boards that use the 630E chipset.
* First round of converting network drivers from spls to mutexes. Thiswpaul2000-10-131-0/+4
| | | | | | | | takes care of all the 10/100 and gigE PCI drivers that I've done. Next will be the wireless drivers, then the USB ones. I may pick up some stragglers along the way. I'm sort of playing this by ear: if anyone spots any places where I've screwed up horribly, please let me know.
* Fix up the sis driver, largely to improve the NatSemi DP83815 support:wpaul2000-08-221-2/+15
| | | | | | | | | | | | | | | | | | | | | | | - Modify the driver to poll the link state and positively set the MAC to full or half duplex as needed. Previously, it was possible for the MAC to remain in half duplex even though the PHY had negotiated full duplex with its link partner, which would result in bursty performance. - Program some of the NatSemi's registers as specified by the datasheet. The manual says these are necessary for "optimum perofrmance," though a couple of them are marked as reserved in the register map. *shrug* - Select the TX DMA burst size correctly for 10 and 100mbps modes. Previously I was using 64 bytes in both modes, which worked in 100mbps mode, but resulting in spotty performance in 10mbps. 32 bytes works much better; without this change, the natsemi chip yields piss poor performance at 10mbps. With these fixes, the NatSemi chip finally performs to my satisfaction. I should be merging the support for this controller into -stable shortly. Phew.
* Add support for the National Semiconductor DP83815 fast ethernetwpaul2000-07-061-0/+32
| | | | | | | | | | | | | | | controller chip. This chip is currently being used on the NetGear FA312-TX adapter, which I guess is a replacement for the FA310-TX (PNIC-based). I added support for this chip by modifying the sis driver since the SiS 900 and the NS DP83815 have almost the same programming interface (the RX filter programming and PHY access methods are different, but the general configuration, DMA scheme and register layout are identical). I would have had this done a lot sooner, but getting the damn MAC address out of the EEPROM proved to be more complicated than expected.
* This commit adds driver support for the Silicon Integrated Systemswpaul1999-09-051-0/+404
SiS 900 and SiS 7016 PCI fast ethernet chipsets. Full manuals for the SiS chips can be found at www.sis.com.tw. This is a fairly simple chipset. The receiver uses a 128-bit multicast hash table and single perfect entry for the station address. Transmit and receive DMA and FIFO thresholds are easily tuneable. Documentation is pretty decent and performance is not bad, even on my crufty 486. This driver uses newbus and miibus and is supported on both the i386 and alpha architectures.
OpenPOWER on IntegriCloud