summaryrefslogtreecommitdiffstats
path: root/sys/pci
Commit message (Collapse)AuthorAgeFilesLines
* Various fixups to locking:jhb2005-08-182-49/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | - Remove a lot of superfluous locking during attach. There is no need to lock access to the driver until some other thread has a way of getting to it. For ethernet drivers the other ways include registering an interrupt handler via bus_setup_intr(), calling ether_ifattach() to hook into the network stack, and kicking off a callout-driven timer via callout_reset(). - Use callout_* rather than timeout/untimeout. - Break out of xl_rxeof() if IFF_DRV_RUNNING is clear after ifp->if_input returns to handle the case where the interface was stopped while we were passing a packet up the stack. Don't call xl_rxeof() in xl_rxeof_task() unless IFF_DRV_RUNNING is set. With these fixes in place, any outstanding task will gracefully terminate as soon as it gets a chance to run after the interface has been stopped via xl_stop(). As a result, taskqueue_drain() is no longer required in xl_stop(). The task is still drained in detach() however to make sure that detach() can safely destroy the driver mutex at the end of the function. - Lock the driver lock in the ifmedia callouts and don't lock across ifmedia_ioctl() in xl_ioctl(). Note: glebius came up with most of (3) as well independently. I took a rather roundabout way of arriving at the same conclusion. MFC after: 3 days
* Fixup locking and mark MPSAFE:jhb2005-08-181-70/+77
| | | | | | | | | | | | | - Add locked versions of start and init. The SRM_MEDIA code in dc_init() stayed in dc_init() instead of moving to dc_init_locked() to make the locking saner. - Use callout_init_mtx(). - Fixup locking in detach and ioctl. - Lock the driver in the ifmedia callouts. - Don't recurse on the driver lock. - De-spl. MFC after: 3 days
* Fixup locking for sf(4) and mark MPSAFE:jhb2005-08-182-53/+83
| | | | | | | | | | | | - Add locked variants of start, init, and ifmedia_upd. - Use callout_* instead of timeout/untimeout. - Don't recurse on the driver lock. - Fixup locking in ioctl. - Lock the driver lock in the ifmedia handlers rather than across ifmedia_ioctl(). Tested by: brueffer MFC after: 3 days
* - Use htole32() instead of using bswap32() conditional on #if BYTE_ORDER.jhb2005-08-171-19/+8
| | | | | | | - Don't set IFF_ALLMULTI in our ifnet's if_flags if we end up allowing all multicast due to limits in the MAC receive filters in hardware. Requested by: rwatson (2)
* Remove the unused TULIP_CSR_{READ,WRITE}BYTE macros.jhb2005-08-171-9/+0
|
* Use callout_init_mtx() to simplify the stats callout.jhb2005-08-171-8/+2
| | | | MFC after: 3 days
* Use device_printf() and if_printf() and remove ste_unit from the softc.jhb2005-08-172-24/+19
|
* * Solve "No PHY found" problem for more Yukon Lite variants.bz2005-08-131-25/+61
| | | | | | | * Catch a bus attach error. * Improve locking. MFC after: 6 days
* Use device_printf() and if_printf() and remove dc_unit from softc.jhb2005-08-102-36/+31
|
* Use if_printf() and device_printf() and axe sf_unit from the softc as ajhb2005-08-102-21/+16
| | | | result.
* Call tulip_start() rather than tulip_ifstart() from the interrupt handlerjhb2005-08-091-1/+1
| | | | | | | to avoid recursing on the driver lock. Not sure why my test box didn't catch this earlier. MFC after: 3 days
* Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE andrwatson2005-08-0913-133/+138
| | | | | | | | | | | | | | IFF_DRV_RUNNING, as well as the move from ifnet.if_flags to ifnet.if_drv_flags. Device drivers are now responsible for synchronizing access to these flags, as they are in if_drv_flags. This helps prevent races between the network stack and device driver in maintaining the interface flags field. Many __FreeBSD__ and __FreeBSD_version checks maintained and continued; some less so. Reviewed by: pjd, bz MFC after: 7 days
* Fix up the locking in pcn(4) and mark it MPSAFE.jhb2005-08-052-36/+60
| | | | | | | | | | | | | - Add locked versions of the init() and start() methods. - Use callout_*() rather than timeout(). - Make the driver lock non-recursive. - Push down locking in detach() and ioctl(). - Fix the tick routine to bail if the interface has been stopped and use callout_drain() in detach() after the call to stop(). - Lock the driver lock in the ifmedia handlers. Tested by: Ketrien I. Saihr-Kesenchedra ketrien at error404.nls.net MFC after: 1 week
* Recognize D-Link DGE-528(T) Gigabit as an re(4) device.tobez2005-08-051-0/+5
| | | | | | Submitted by: Andrus Nomm <andrus@members.ee> PR: 76780 MFC After: 1 week
* Modify device drivers supporting multicast addresses to lock if_addr_mtxrwatson2005-08-0313-0/+36
| | | | | | | | over iteration of their multicast address lists when synchronizing the hardware address filter with the network stack-maintained list. Problem reported by: Ed Maste (emaste at phaedrus dot sandvine dot ca> MFC after: 1 week
* - Use callout_*() rather than timeout() to periodically poll the media.jhb2005-07-272-40/+156
| | | | | | | | | - Add locking to protect the softc and mark this driver as MP safe. There are still some edge cases with multiport cards that need more locking work. MFC after: 1 week Tested on: alpha
* Fix a typo in the name of the dmamap for a bus_dmamap_sync().jhb2005-07-271-1/+1
| | | | MFC after: 3 days
* The 575A doesn't have funcregs in memio. So don't claim that it does.imp2005-07-271-3/+8
| | | | | | | This gets my 575A card probing. Card provided by: James Flemer MFC After: 3 days
* - Use the PCIR_BAR() macro rather than hardcoding rids.jhb2005-07-211-8/+4
| | | | | - Use pci_enable_busmaster() rather than fiddling with the PCI command register directly.
* Don't set if_start to tulip_ifstart all over the place. It is alreadyjhb2005-07-211-6/+0
| | | | | | set in tulip_attach() and its value is never changed, so all the extra sets are redundant. I'm guessing that at some point in time de(4) had an alternate start routine, but that hasn't been true in recent history.
* Remove conditional code that has largely rotted that is also not on byjhb2005-07-212-233/+13
| | | | | | | | | default: - TULIP_NEED_FASTTIMEOUT - tulip_fasttimeout() wasn't called anywhere - BIG_PACKET - only worked on i386 anyway - TULIP_USE_SOFTINTR - doesn't compile and was never updated to handle new netisr registration - non-FreeBSD code
* Use get_cyclecount() rather than hardcoding rdtsc and rpcc in asm for i386jhb2005-07-211-20/+2
| | | | and alpha, respectively.
* Fix a typo and some whitespace nits.jhb2005-07-211-5/+3
|
* NET_LOCK_GIANT() when entering network code.glebius2005-07-131-0/+2
| | | | | Pointy hat to: glebius Reported by: rodrigc
* ALTQify ste(4).mlaier2005-07-081-6/+8
| | | | | Requested and tested by: <nike_d at cytexbg dot com> Approved by: re (scottl)
* Fix ifnet fallout in if_ti.scottl2005-07-071-8/+7
| | | | | Reviewed by: brooks Approved by: re
* Make the initialization in the AGPv3 case match that of Linux. Fixes hangs onanholt2005-06-261-8/+28
| | | | | | | X startup with DRI enabled, with a v3-capable card. Tested by: Tom McLaughlin <tmclaugh@sdf.lonestar.org> Approved by: re (scottl)
* Move if_alloc() up so it's before mii_phy_probe().brooks2005-06-113-18/+21
|
* Stop embedding struct ifnet at the top of driver softcs. Instead thebrooks2005-06-1027-395/+481
| | | | | | | | | | | | | | | | | | | | 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
* Remove bus_{mem,p}io.h and related code for a micro-optimization on i386nyan2005-05-2916-31/+0
| | | | | | and amd64. The optimization is a trivial on recent machines. Reviewed by: -arch (imp, marcel, dfr)
* Calling xl_rxeof() at the end of xl_start_locked() leads to recursionglebius2005-05-202-1/+20
| | | | | | | | | in case of IP fast forwarding. Enqueue a taskqueue(9) task instead of calling xl_rxeof() directly. Reported & tested by: Slava Alpatov Reviewed by: wpaul MFC after: 1 week
* Deal with failed malloc calls[1].bz2005-04-251-0/+22
| | | | | | | | | While there also check for failed device_add_child calls. Found by: Coventry Analysis tool[1]. Submitted by: sam[1] Approved by: pjd (mentor) MFC after: 1 week
* Fix newer Xircom CBE2-100 cards that were reportingimp2005-04-181-13/+14
| | | | | | | | dc0: MII without any PHY! We have to enable the connection to the MII first. Doing so fixes the problem cards without breaking the older, working cards. Bad card provided by: deischen
* Invert conditional and use continue to reduce nesting.mdodd2005-04-131-16/+16
|
* Add nForce3-250.obrien2005-04-081-0/+2
|
* nVidia AGP chipsets beyond nForce2 are AMD64-specific.obrien2005-04-022-1/+3
| | | | | | So move the AGP support to there. Submitted by: Jung-uk Kim <jkim@niksun.com>
* If resource allocation fails, we could wind up freeing the cdev without itscottl2005-03-311-1/+2
| | | | | | being allocated. Add a simple check for this. Submitted by: yongari
* Bring rev 1.31 to the AMD64 platform.obrien2005-03-281-3/+7
| | | | | | | | This adds support for the SiS intergrated NIC on some Athlon64 motherboards. The MAC address is stored in the APC CMOS RAM and this fixes the sis driver ending up with a 00:00:00:00:00:00 MAC address. Submitted by: Stasys Smailys <ssmailys@komvista.lt>
* deal with malloc failure when setting up the multicast filtersam2005-03-261-0/+4
| | | | Noticed by: Coverity Prevent analysis tool
* handle malloc failure and sk_vpd_prodname potentially being null forsam2005-03-261-5/+8
| | | | | | | other reasons Noticed by: Coverity Prevent analysis tool Reviewed by: bz, jmg
* xl(4) meets polling(4). Hardware for this work kindly provided byru2005-03-262-0/+122
| | | | | | Eric Masson. MFC after: 3 weeks
* Start the process of modernizing the Tigon driver by using busdma for thescottl2005-03-212-21/+92
| | | | | descriptor and configuration data. Thanks to Martin Nilsson for providing hardware.
* Do not try to free non allocated memory in error case.bz2005-03-172-13/+61
| | | | | | | | | | | | | | | | Do our best to plug some memory leaks (VPD data, jumbo memory buffer,...). Log if we cannot free because memory still in use[1]. Change locking to avoid ''acquiring duplicate lock of same type: "network driver"'' and potential deadlock. Also seems to fix LOR #063. [1] This change does not solve problems if buffers are still in use when unloading if_sk.ko. There is ongoing work which will address jumbogram allocations in a more general way. PR: kern/75677 (with changes, no mii fixes in here) Tested by: net, Antoine Brodin (slightly different version) Approved by: rwatson (mentor) MFC after: 5 days
* * Lower interrupt moderation timer 200->100.bz2005-03-172-1/+65
| | | | | | | | Obtained from: NetBSD if_sk.c rev. 1.11 * Make interrupt moderation configurable via sysctl/tuneable. PR: kern/41220 Approved by: rwatson (mentor)
* * Improve chip identification.bz2005-03-172-32/+142
| | | | | | | | | | | Obtained from: NetBSD if_sk.c rev. 1.11 * Take PHY out of reset for Yukon Lite Rev. A3. Submitted by: postings on net@ in thread "skc0: no PHY found", 2005-02-22 Tested by: net Approved by: rwatson (mentor) MFC after: 5 days
* * When adding/deleting multicast addresses, only whack the address filterbz2005-03-171-6/+15
| | | | | | | | | | | | | | | | if the interface is marked RUNNING. Obtained from: NetBSD if_sk.c rev. 1.12 * Don't initialize the card (and start an autonegotiation) every time the IP address changes. Makes 'dhclient sk0' invocations way faster and more consistant. i.e. one DHCPREQUEST elicits the DHCPACK. Obtained from: OpenBSD if_sk.c rev. 1.56 * Additional locking changes in sk_ioctl. PR: kern/61296 should see improvements by the last two. Approved by: rwatson (mentor) MFC after: 5 days
* Bugger, wiped out a needed comma in the previous commit.scottl2005-03-091-1/+1
|
* The DC driver asks for an alignment of PAGE_SIZE for data buffers, but alsoscottl2005-03-081-3/+3
| | | | | | | | | | asks that each buffer be (2048 * 256) bytes long. I suspect that alignment isn't a real requirement since busdma only recently started honoring it. The size is also bogus. Fix both of these and stop busdma from trying to exhaust the system memory pool with bounce pages. Submitted by: Kevin Oberman MFC After: 7 days
* Add device id for the Ali M1671 host to AGP bridge.cognet2005-02-271-0/+2
|
* Add back 'n' that went missing in last commitimp2005-02-251-1/+1
|
OpenPOWER on IntegriCloud