summaryrefslogtreecommitdiffstats
path: root/sys/pci
Commit message (Collapse)AuthorAgeFilesLines
* Only allow the sk(4) driver to attach to revision 2 of the LinkSys EG1032jhb2005-10-143-2/+33
| | | | | | | | cards and teach the re(4) driver to attach to revision 3 cards. Submitted by: Fredrik Lindberg fli+freebsd-current at shapeshifter dot se MFC after: 2 weeks Reviewed by: imp, mdodd
* In detach method, move if_free() after bus_teardown_intr().ru2005-10-1311-22/+32
|
* Mark sk(4) as capable of handling extended VLAN frames. NICsyar2005-10-111-0/+6
| | | | | | | | | based on XMAC II chip should be ready for this in their initial mode of operation, and Yukon-based NICs are configured so by the driver. PR: kern/79998 MFC after: 1 month
* - Don't pollute opt_global.h with DEVICE_POLLING and introduceglebius2005-10-057-0/+28
| | | | | | | | | opt_device_polling.h - Include opt_device_polling.h into appropriate files. - Embrace with HAVE_KERNEL_OPTION_HEADERS the include in the files that can be compiled as loadable modules. Reviewed by: bde
* Big polling(4) cleanup.glebius2005-10-017-243/+295
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Axe poll in trap. o Axe IFF_POLLING flag from if_flags. o Rework revision 1.21 (Giant removal), in such a way that poll_mtx is not dropped during call to polling handler. This fixes problem with idle polling. o Make registration and deregistration from polling in a functional way, insted of next tick/interrupt. o Obsolete kern.polling.enable. Polling is turned on/off with ifconfig. Detailed kern_poll.c changes: - Remove polling handler flags, introduced in 1.21. The are not needed now. - Forget and do not check if_flags, if_capenable and if_drv_flags. - Call all registered polling handlers unconditionally. - Do not drop poll_mtx, when entering polling handlers. - In ether_poll() NET_LOCK_GIANT prior to locking poll_mtx. - In netisr_poll() axe the block, where polling code asks drivers to unregister. - In netisr_poll() and ether_poll() do polling always, if any handlers are present. - In ether_poll_[de]register() remove a lot of error hiding code. Assert that arguments are correct, instead. - In ether_poll_[de]register() use standard return values in case of error or success. - Introduce poll_switch() that is a sysctl handler for kern.polling.enable. poll_switch() goes through interface list and enabled/disables polling. A message that kern.polling.enable is deprecated is printed. Detailed driver changes: - On attach driver announces IFCAP_POLLING in if_capabilities, but not in if_capenable. - On detach driver calls ether_poll_deregister() if polling is enabled. - In polling handler driver obtains its lock and checks IFF_DRV_RUNNING flag. If there is no, then unlocks and returns. - In ioctl handler driver checks for IFCAP_POLLING flag requested to be set or cleared. Driver first calls ether_poll_[de]register(), then obtains driver lock and [dis/en]ables interrupts. - In interrupt handler driver checks IFCAP_POLLING flag in if_capenable. If present, then returns.This is important to protect from spurious interrupts. Reviewed by: ru, sam, jhb
* - Use if_printf() and device_printf() in re(4) and remove rl_unit fromjhb2005-09-292-19/+12
| | | | | | | | | | | | | | | | the softc. - Use callout_init_mtx() and rather than timeout/untimeout in both rl(4) and re(4). - Fix locking for ifmedia by locking the driver in the ifmedia handlers rather than in the miibus functions. (re(4) didn't lock the mii stuff at all!) - Fix some locking in re_ioctl(). Note: the two drivers share the same softc declared in if_rlreg.h, so they had to be change simultaneously. MFC after: 1 week Tested by: several on rl(4), none on re(4)
* Use if_printf() and device_printf().jhb2005-09-291-90/+92
|
* Typo.jhb2005-09-291-1/+1
|
* - Add a work-around for nForce3-250. Aperture base address encoded in misc.jkim2005-09-272-8/+175
| | | | | | | | | | | | | | | | | control register and AGP bridge seems to be inconsistent with some BIOS. Instead of relying on BIOS settings, we just take the initial aperture size and encode them for both miscellaneous control register and AGP bridge. Some idea was borrowed from agp_nvidia.c. - Add preliminary ULi M1689 chipset support. The idea was taken from Linux because hardware and documentation are unavailable. Not tested. - Add more VIA chipset PCI IDs taken from Linux driver. Approved by: anholt (mentor) Tested by: Adam Gregoire <ebola at psychoholics dot org> Ganael Laplanche <ganael.laplanche at martymac dot com> K Wieland <kwieland at wustl dot edu>
* Remove bridge(4) from the tree. if_bridge(4) is a full functionalmlaier2005-09-271-2/+0
| | | | | | | | replacement and has additional features which make it superior. Discussed on: -arch Reviewed by: thompsa X-MFC-after: never (RELENG_6 as transition period)
* Small fixes to sis(4):jhb2005-09-262-44/+33
| | | | | | | | | | | | | | - 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-242-43/+18
|
* Move code macros from if_sis*reg*.h to if_sis.*c*phk2005-09-202-16/+16
|
* Add a new AGP driver for ATI IGP chipsets. The driver is based on reading ofanholt2005-09-172-0/+398
| | | | | | | | | the Linux driver, since specs are unavailable. Many thanks to Adam Kirchhoff for multiple useful testing cycles, and Ralf Wostrack for the final fix to get it working. PR: i386/75251 Submitted by: anholt
* Fix agp_nvidia.c to behave more like the linux driver, fixing DRI on Radeonanholt2005-09-161-11/+20
| | | | | | | | | | | | 9200 according to one responder. The primary issue was not setting some bits to say that the entries were active, but also fix one place where some memory wasn't being used as volatile as it should. While here, change some use of ffs to a relatively short case statement, to make it more obvious what's going on. PR: kern/71638, kern/72372, kern/71547? Submitted by: Andrew J. Caines <A.J.Caines@halplant.com>, Robin Schoonover <end@endif.cjb.net>, Jason Henson <jason@ec.rr.com>
* Fix "struct ifnet" leaks when attach() fails in the middle, e.g.ru2005-09-1612-29/+25
| | | | | | when mii_phy_probe() or bus_setup_intr() fails. For drivers that call their detach() in this case, call if_free() there to cover this case too.
* When bus_alloc_resource_any() fails, dc_detach() is called and itkeramida2005-09-151-5/+11
| | | | | | | | | | attempts to deallocate busdma tags and resources that haven't been allocated yet, causing a panic every time a dc interface fails to attach. Fix by checking that we really have something to dealloc before calling bus_dma*() functions. Approved by: jhb MFC after: 1 week
* - Fixup locking and mark MPSAFE.jhb2005-09-152-51/+58
| | | | | | | | - Use callout_init_mtx() and static callouts rather than timeout(). - m_getcl() in one place to simplify the code. Tested by: Gavin Atkinson gavin dot atkinson at ury dot york dot ac dot uk MFC after: 1 week
* Fixed "Memory modified after free" panic in rl_detach() dueru2005-09-141-4/+3
| | | | | | to rl_stop() accessing already freed "struct ifnet". Fixed LOR between rl mutex and some ACPI mutex in rl_detach().
* Use if_printf() and device_printf() for printf's and remove the unit numberjhb2005-08-312-20/+15
| | | | | | from the softc. MFC after: 3 days
* Various locking fixes and mark MPSAFE:jhb2005-08-302-60/+95
| | | | | | | | | | | - Add locked variants of start(), init(), ifmedia_upd(), and poll() and stop recursing on the driver lock. - Add locking to ifmedia_upd() and ifmedia_sts(). - Use callout_*() instead of timeout/untimeout. - Fix locking in ioctl(). Tested by: Bob Bishop rb at gid dot co dot uk MFC after: 3 days
* Better commentimp2005-08-291-1/+4
|
* Fix another instance of old info re: miibusimp2005-08-291-1/+1
|
* Fix obsolete comment.imp2005-08-291-1/+1
| | | | MFC After: 2 days
* - Use m_defrag() instead of homerolling our own variantjhb2005-08-261-68/+55
| | | | | | | | | | | | | | | tulip_mbuf_compress(). If we fail to allocate a new mbuf to copy the data into, put the mbuf back in the driver's send queue so that we can retry it later rather than throwing the packet away. - Use m_devget() instead of doing it inline ourselves in the TULIP_COPY_RXDATA case. If we fail to allocate an mbuf to copy the data into, don't forget about the original mbuf cluster. The old code would lose the pointer and leak the cluster in that case. Now it doesn't lose it but always sticks the original rx buffer back into the receive ring after trying to copy the data out and send it up the stack. Also, if we fail to allocate a new mbuf to copy the data into, log an input error. Also, don't combine the priming case with the received-a-packet case to make the code flow a bit clearer and easier to follow.
* - Remove non-bus-dma code.jhb2005-08-252-456/+134
| | | | | | | | - Remove form feed characters. - Fixup style of function declarations. - Assume that an mbuf cluster is big enough to hold an ethernet frame. (This should really be using m_defrag(), but this diff is just simple changes for now.)
* Major rototill of this driver to add FreeBSD bus-dma support:jhb2005-08-252-529/+774
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Allocate arrays of metadata for the descriptors in the rx and tx rings and change the ring pointers to walk the metadata array rather than the actual descriptor rings. Each metadata object contains a pointer to its descriptor, a pointer to any associated mbuf, and a pointer to the associated bus_dmamap_t in the bus_dma case. The mbuf pointers replace the tulip_txq and tulip_rxq local ifqueue's in the softc. - Add lots of KTR trace entries using a local KTR_TULIP level which defaults to 0, but can be changed to KTR_DEV at the top of the file when debugging. - Rename tulip_init(), tulip_start(), tulip_ifinit(), and tulip_ifstart() to tulip_init_locked(), tulip_start_locked(), tulip_init(), and tulip_start(), respectively, to match the convention in other drivers. - Add a TULIP_SP_MAC() macro to encode two bytes of the MAC address into the setup buffer and use that in place of lots of BYTE_ORDER #ifdef's. Also, remove an incorrect XXX comment I added earlier, the driver was correct (at least it does the same thing dc(4) does). TULIP_SP_MAC was shamelessly copied from DC_SP_MAC() in dc(4). - Remove the #ifdef'd NetBSD bus-dma code and replace it with FreeBSD bus-dma code that not only compiles but even works at runtime. - Use callout_init_mtx() instead of just callout_init(). - Correct the various wrapper macros for bus_dmamap_sync() for the rx and tx buffers to only ask for the sync ops that they actually need. - Tidy the #ifdef TULIP_COPY_RXDATA code by expanding an #ifdef a bit so it becomes easier to read at the expense of a couple of duplicated lines of code. Also, use m_getcl() to get an mbuf cluster rather than MGETHDR() followed by MCLGET(). - Maintain the ring free (ri_free) count for the rx ring metadata since we no longer have tulip_rxq.ifq_len around to indicate how many mbuf's are currently in the rx ring. - Add code to teardown bus_dma resources when attach fails and generally fixup attach to do a better job of cleaning up when it fails. This gets us a good bit closer to possibly having a detach method someday and making this driver an unloadable module. - Add some functions that can be called from ddb to dump the state of a descriptor ring and to dump the state of an individual descriptor. - Various comment grammer and spelling fixes. I have bus-dma turned on by default, but I've left the non-bus-dma code around so that it can be turned off to aid in debugging should any problems turn up later on. I'll be removing the non-bus-dma code in a subsequent commit.
* 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
|
OpenPOWER on IntegriCloud