summaryrefslogtreecommitdiffstats
path: root/sys/pci
Commit message (Collapse)AuthorAgeFilesLines
* Use the copy of the card's MAC address saved in tulip_enaddr() in the softcjhb2005-12-221-3/+12
| | | | | | | if we need a valid MAC address (for probing the media for example) before ether_ifattach() has been called since IF_LLADDR() is NULL then. Tested by: tisco
* Drivers for AMD-8111 and NVIDIA nForce2/3/4 SMBus 2.0 controllers.ru2005-12-212-0/+1077
|
* Use ETHER_ADDR_LEN rather than hardcoding 6.jhb2005-12-211-1/+1
|
* - Use PCIR_BAR() macro for the BAR for the aperture.jhb2005-12-201-7/+1
| | | | | - Axe macros used for walking PCI capabilities list. We now ask the PCI bus to find caps for us rather than doing it in the drm and agp drivers.
* - Bump FreeBSD version for the hostb(4) and vgapci(4) drivers as well asjhb2005-12-201-36/+4
| | | | | | | | | the addition of pci_find_extcap(). - Change the drm drivers to attach to vgapci. This is #ifdef'd so the code can be shared across branches. - Use pci_find_extcap() to look for AGP and PCIE capabilities in drm. - GC all the drmsub stuff for i810/i830/i915. The agp and drm devices are now both children of vgapci.
* Change the various AGP drivers that attach to the Host-PCI bridge device tojhb2005-12-208-16/+8
| | | | | | | | | attach to the hostb driver instead. This means that agp can now be loaded at runtime (in theory at least). Also, the drivers no longer have to explicity call device_verbose() to cancel out any earlier calls to device_quiet() by the hostb(4) driver (this shows a limitation in new-bus, drivers really shouldn't be doing device_quiet() until they know they are going to drive that device, i.e. in attach).
* Change the agp_find_device() to return the first agp device that has beenjhb2005-12-201-2/+11
| | | | attached to a driver rather than always returning agp0.
* Don't map the AGP aperture into contiguous KVA. The various graphicsjhb2005-12-202-4/+1
| | | | | | | | drivers already map sections into KVA as needed anyway. Note that this will probably break the nvidia driver, but I will coordinate to get that fixed. MFC after: 2 weeks
* Destroy the /dev device before destroying the mutex or releasing resourcesjhb2005-12-201-1/+2
| | | | | | rather than afterwards. MFC after: 1 week
* Use pci_find_extcap() to search for AGP capabilities (PCIY_AGP).jhb2005-12-201-25/+4
|
* Backout pseudo nForce2/3/4 support. These devices (as well asru2005-12-161-160/+25
| | | | | | | | | | | | | | AMD-8111 SMBus 2.0 controller) are all SMBus 2.0 controllers, and need another implementation of SMBus access methods, while this driver supports AMD-756 SMBus 1.0 controller and clones, including AMD-8111 SMBus 1.0 controller. Tested by: Vladimir Timofeev (0x006410de), mezz (0x008410de), ru (0x00d410de) All of us got the same(!) nonsense when running ``mbmon -S'', repeated every four rows.
* Fix PCI ID of the AMD-8111 System Management controller so it matchesru2005-12-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SMBus 1.0 and not SMBus 2.0. AMD-8111 hub (datasheet is publically available) implements both SMBus 2.0 (a separate PCI device) and SMBus 1.0 (a subfunction of the System Management Controller device with the base I/O address is accessible through the CSR 0x58). This driver only supports AMD-756 SMBus 1.0 compatible devices. With the patched sysutils/xmbmon port (to also fix PCI ID and to enable smb(4) support), I now get: pciconf: none0@pci0:7:2: class=0x0c0500 card=0x746a1022 chip=0x746a1022 rev=0x02 hdr=0x00 vendor = 'Advanced Micro Devices (AMD)' device = 'AMD-8111 SMBus 2.0 Controller' class = serial bus subclass = SMBus amdpm0@pci0:7:3: class=0x068000 card=0x746b1022 chip=0x746b1022 rev=0x05 hdr=0x00 vendor = 'Advanced Micro Devices (AMD)' device = 'AMD-8111 ACPI System Management Controller' class = bridge dmesg: amdpm0: <AMD 756/766/768/8111 Power Management Controller> port 0x10e0-0x10ff at device 7.3 on pci0 smbus0: <System Management Bus> on amdpm0 # mbmon -A -d Summary of Detection: * SMB monitor(s)[ioctl:AMD8111]: ** Winbond Chip W83627HF/THF/THF-A found at slave address: 0x50. ** Analog Dev. Chip ADM1027 found at slave address: 0x5C. * ISA monitor(s): ** Winbond Chip W83627HF/THF/THF-A found. I think the confusion comes from the fact that nobody really tried SMBus with xmbmon :-), since sysutils/xmbmon port doesn't come with SMBus support enabled, neither in FreeBSD 4, nor in later versions, so mbmon(1) was just showing the values from the Winbond sensors accessible through the ISA I/O method (mbmon -I), for me anyway. On my test machine, the amdpm(4) didn't even attach due to I/O port allocation failure (who knows what the hell it read from CSR 0x58 of the SMBus 2.0 device :-), which isn't in the CSR space). I've also checked that lm_sensors.org uses correct PCI ID for SMBus 1.0 of AMD-8111: i2c-amd756.c: {PCI_VENDOR_ID_AMD, 0x746B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AMD8111 }, This driver is analogous to our amdpm.c which supports SMBus 1.0 AMD-756 and compatible devices, including SMBus 1.0 on AMD-8111. i2c-amd8111.c: { 0x1022, 0x746a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, This driver is analogous to nForce-2/3/4, i2c-nforce2.c, which supports SMBus 2.0, and which our amdpm.c does NOT support (SMBus 2.0 uses a different, ACPI-unified, API to talk to SMBus). At least I know for sure it doesn't work with my nForce3. :-) (The xmbmon port will be fixed to correct the PCI ID too and to enable the smb(4) support.)
* Add support for the nForce2/3/4 SMBus controllers which all contain twojhb2005-12-141-25/+160
| | | | | | | SMBus busses. Because of limitations in smbus_if.m, the second smbus is attached to an amdpm1 device that is a child of amdpm0. Submitted by: Artemiev Igor ai (at) bmc dot brk dot ru
* The if_ti Tigon I/II driver has moved to /sys/dev/tiscottl2005-12-104-14450/+0
|
* Fix -Wundef from compiling the amd64 LINT.ru2005-12-041-4/+4
|
* Add support for i915 GMCH AGP. This diff is a combination of work by myselfanholt2005-12-022-31/+160
| | | | | | | | | | | and some fixes from Motomichi Matsuzaki. Testing involved many people, but the final, successful testing was from rwatson who endured several rounds of "it crashes at XYZ stage" "oh, please correct this typo and try again." The Linux driver, and to a small extent the limited specs, were both used as a reference for how to program the chipset. PR: kern/80396 Submitted by: Martin Mersberger
* Fix the type of "eaddr" to guarantee the required alignment.ru2005-12-011-8/+8
| | | | Suggested by: marcel
* Byte copy IF_LLADDR() on stack to align it to be safe for typecasts.ru2005-11-302-21/+20
| | | | Tested by: jhb
* Add support for the i855GM, tested by an r300 user.anholt2005-11-291-1/+6
|
* 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().
OpenPOWER on IntegriCloud