summaryrefslogtreecommitdiffstats
path: root/sys/pci
Commit message (Collapse)AuthorAgeFilesLines
* Various fixes to make de(4) not panic after ru@'s IF_LLADDR() changes:jhb2005-11-212-30/+22
| | | | | | | | | | | | | | | - Don't call tulip_addr_filter() to reset the RX address filter in tulip_reset() since that gets called before ether_ifattach(). Just call it in tulip_init_locked(). - Use be16dec() and le16dec() to parse MAC addresses when programming the RX filter. - Let ether_ioctl() handle SIOCSIFMTU since we were doing the exact same thing with the added bonus that we leaked the driver lock if the MTU was > ETHERMTU in the homerolled version. This part will be MFC'd. Clue from: wpaul (1) Stolen from: marcel (2 via patch for dc(4)) MFC after: 1 week
* 0xb1881106 seems to be an AGP bridge and some BIOSes incorrectly handlejkim2005-11-141-16/+72
| | | | | the bridge. Therefore, we give the same treatment as we did for nForce3-250 and ULi chipsets. VIA AGPv3 code was copied from agp_via.c.
* - Store pointer to the link-level address right in "struct ifnet"ru2005-11-1112-37/+37
| | | | | | | | | | rather than in ifindex_table[]; all (except one) accesses are through ifp anyway. IF_LLADDR() works faster, and all (except one) ifaddr_byindex() users were converted to use ifp->if_addr. - Stop storing a (pointer to) Ethernet address in "struct arpcom", and drop the IFP2ENADDR() macro; all users have been converted to use IF_LLADDR() instead.
* Catch up with IFP2ENADDR() type change (array -> pointer).ru2005-11-112-3/+3
|
* - Use callout_*() to manage the callout and make it MPSAFE.jhb2005-10-312-16/+11
| | | | | | | - Fix locking in detach(), we only need to lock across vr_stop(). Tested by: Mike Tancsa mike at sentex dot net MFC after: 1 week
* Add the device ID for the VIA VT8235 south bridge.jhb2005-10-311-0/+7
| | | | | | | PR: kern/62438 Submitted by: FUJIMOTO Kou fujimoto at j dot dendai dot ac dot jp Tested by: Oliver Fromme olli at secnetix dot de MFC after: 1 week
* Some of the VIA pm and propm devices are actually the same device as thejhb2005-10-311-1/+38
| | | | | | | | | | | | | | | | | PCI-ISA bridge. Thus, when viapm0 or viapropm0 attaches, isab0 dosen't attach so there is no isa0 bus hung off of that bridge. In the non-ACPI case, legacy0 will add an isa0 anyway as a fail-safe, but ACPI assumes that any ISA bus will be enumerated via a bridge. To fix this, call isab_attach() to attach an isa0 ISA child bus device if the pm or propm device we are probing is a PCI-ISA bridge. Both drivers now have to implement the bus_if interface via the generic methods for resource allocation, etc. to work. Also, we now add 2 new ISA bus drivers that attach to viapm and viapropm devices. PR: kern/87363 Reported by: Oliver Fromme olli at secnetix dot de Tested by: glebius MFC after: 1 week
* Remove forgotten, no longer needed WB_UNLOCK() from the end wb_ioctl().wpaul2005-10-281-2/+0
| | | | | | | | | | | | With this change, the driver tests good (at least on i386): wb0: <Winbond W89C840F 10/100BaseTX> port 0xb800-0xb87f mem 0xe6800000-0xe680007f irq 12 at device 10.0 on pci0 miibus1: <MII bus> on wb0 amphy0: <Am79C873 10/100 media interface> on miibus1 amphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto wb0: Ethernet address: 00:00:e8:18:2a:02 wb0: link state changed to DOWN wb0: link state changed to UP
* Fixup locking and mark MPSAFE.jhb2005-10-272-44/+61
| | | | | | | | | | | | | | - Add locked variants of init() and start(). - Use callout_*() to manage callout. - Test IFF_DRV_RUNNING rather than IFF_UP in wb_intr() to see if we are still active when an interrupt comes in. I couldn't find any of these cards anywhere to test on myself, and google turns up references to FreeBSD and OpenBSD manpages for this driver when trying to locate a card that way. I'm not sure anyone actually uses these cards with FreeBSD. Tested by: NO ONE (despite repeated requests)
* - Use if_printf() and device_printf() and remove vr_unit from the softc.jhb2005-10-272-53/+44
| | | | | | I had to initialize the ifnet a bit earlier in attach so that the if_printf()'s in vr_reset() didn't explode with a page fault. - Use M_ZERO with contigmalloc() rather than an explicit bzero.
* Replace FreeBSD 3.x syntax (controller miibus0) with 4.x syntaximp2005-10-228-8/+8
| | | | (device miibus) in time for 7.0 :-)
* Remove dc after repo copy.imp2005-10-182-5088/+0
|
* 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
OpenPOWER on IntegriCloud