summaryrefslogtreecommitdiffstats
path: root/sys/pci
Commit message (Collapse)AuthorAgeFilesLines
* Set all of the "optimum performance" PHY registers for the 15D parts asjhb2008-07-301-10/+8
| | | | | | | | | well as the 15C since it seems to be required in practice. The Linux natsemi.c driver mostly does this as well. PR: kern/112179 Submitted by: Mark Willson mark - hydrus org uk MFC after: 1 week
* SIS_SETBIT() already does a read/modify/write operation, so there isn'tjhb2008-07-301-2/+1
| | | | | | a reason to read the register twice. MFC after: 1 week
* Add driver support for RTL8102E and RTL8102EL which is the secondyongari2008-07-091-0/+2
| | | | | | | | | generation of RTL810x PCIe fast ethernet controller. Note, Tx/Rx descriptor format is different from that of first generation of RTL8101E series. Jumbo frame is not supported for RTL810x family. Tested by: NAGATA Shinya ( maya AT negeta DOT com )
* Add a new RTL8169 variant, 8169SB(L)/8110SB(L).yongari2008-07-021-0/+1
| | | | | Reported by: nork Tested by: nork
* Add basic support for RTL8168C, RTL8168CP, RTL8111C and RTL8111CP.yongari2008-07-021-0/+24
| | | | | | | | | | | | | | | | ATM Tx/Rx checksum offload is supported but TSO and jumbo frame is not yet supported. Because these newer controllers use different descriptor formats, a flag RL_FLAG_DESCV2 flag was introduced to handle that case in Tx/Rx handler. Also newer controllers seems to require to not touch 'enable Tx/Rx bit' in RL_CPLUS_CMD register so don't blindly try to set that bits. Note, it seems that there is still power-saving related issue where driver fails to attach PHY. Rebooting seems to fix that issue but number of required reboots varys. Many thanks to users that helped during developement. I really appreciate their patient and test/feedbacks.
* Instead of allocating variables for each events/hardware flags, useyongari2008-07-021-2/+6
| | | | | | | | | a dedicated flag that represents controller capabilities/events. This will simplify many part of code that requires different workaround for each controller revisions and will enhance readability. While I'm here move PHY wakeup code up before mii_phy_probe() which seems to help to wake PHY in some cases.
* Switch to memory space register mapping over IO space. If thatyongari2008-07-021-0/+2
| | | | mapping fails fall back to traditional IO space access.
* Add support for VT8237 ISA bridge.gonzo2008-06-221-0/+7
| | | | | PR: kern/120714 Event: Bugathon#5
* Add the SMB functionality for the MCP65 chipset I happen tojoerg2008-06-181-0/+3
| | | | have in my new motherboard.
* Add another 8139D variant.remko2008-06-162-0/+3
| | | | | | | PR: 124622 Submitted by: Evgeny Zhirnov <jirnov at gmail dot com> Approved by: imp (mentor, implicit) MFC after: 3 days
* - Use bus_foo() rather than bus_space_foo() and remove bus space tag/handlejhb2008-06-065-33/+13
| | | | | | from softc. - Mark interrupt handlers MPSAFE as these drivers have been locked for a while.
* Remove unused 'xl_unit' member from softc.jhb2008-05-282-2/+0
|
* - Set sc->dev to the new-bus device_t so all the device_printf()s work.jhb2008-05-121-1/+3
| | | | | | | - Add a missing newline to a printf. MFC after: 1 week Submitted by: Andriy Gapon avg <> icyb.net.ua
* It seems that RealTek 8129/8139 chip reports invalid length ofyongari2008-04-101-3/+5
| | | | | | | | | | | | | | | | received frame under certain conditions. wpaul said the length 0xfff0 is special meaning that indicates hardware is in the process of copying a packet into host memory. But it seems there are other cases that hardware is busy or stuck in bad situation even if the received frame length is not 0xfff0. To work-around this condition, add a check that verifys that recevied frame length is in valid range. If received length is out of range reinitialize hardware to recover from stuck condition. Reported by: Mike Tancsa ( mike AT sentex DOT net ) Tested by: Mike Tancsa Obtained from: OpenBSD MFC after: 1 week
* Padding more bytes than necessary one broke another variants ofyongari2008-03-311-0/+6
| | | | | | | | PCIe RealTek chips. Only pad IP packets if the payload is less than 28 bytes. Obtained from: NetBSD PR: kern/122221
* Replaced the misleading uses of a historical artefact M_TRYWAIT with M_WAIT.ru2008-03-251-26/+5
| | | | | | | | | | Removed dead code that assumed that M_TRYWAIT can return NULL; it's not true since the advent of MBUMA. Reviewed by: arch There are ongoing disputes as to whether we want to switch to directly using UMA flags M_WAITOK/M_NOWAIT for mbuf(9) allocation.
* - Take advantage of bus_dmamap_load_mbuf_sg(9).marius2008-03-242-94/+71
| | | | | | | | | | | | | | | - Take advantage of m_collapse(9). - Sync with other NIC drivers and prepend a TX mbuf if the first attempt to load it fails with an error other than EFBIG and stop trying instead of freeing it and keeping on trying to enqueue more mbufs. Also ensure the driver queue isn't empty before trying to enqueue mbufs in order to reduce locking operations. - In xl_ifmedia_upd() add a missing XL_UNLOCK(). [1] - Const'ify the xl_devs array. - Remove an outdated comment. PR: 113406 [1] MFC after: 1 month
* For MSI capable hardwares, enable MSI enable bit in RL_CFG2yongari2008-03-231-0/+1
| | | | | register. If MSI was disabled by hw.re.msi_disable tunable expliclty clear the MSI enable bit.
* vr(4) was repocopied to src/sys/dev/vr.yongari2008-03-112-2125/+0
|
* Don't map memory/IO resource in device probe and just use PCIyongari2008-03-031-41/+18
| | | | | | vendor/revision/sub device id of the hardware to probe it. This is the same way as NetBSD does and it enhances readabilty a lot.
* Don't allow jumbo frame on 8139C+ controller.yongari2008-03-031-0/+2
| | | | While I'm here add a check for minimal MTU length.
* Implement WOL.yongari2008-03-031-1/+39
| | | | Tested by: Fabian Keil ( freebsd-listen AT fabienkeli DOT de )
* Give MEXTADD() another argument to make both void pointers to thephk2008-02-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | free function controlable, instead of passing the KVA of the buffer storage as the first argument. Fix all conventional users of the API to pass the KVA of the buffer as the first argument, to make this a no-op commit. Likely break the only non-convetional user of the API, after informing the relevant committer. Update the mbuf(9) manual page, which was already out of sync on this point. Bump __FreeBSD_version to 800016 as there is no way to tell how many arguments a CPP macro needs any other way. This paves the way for giving sendfile(9) a way to wait for the passed storage to have been accessed before returning. This does not affect the memory layout or size of mbufs. Parental oversight by: sam and rwatson. No MFC is anticipated.
* Add copyrights.ru2008-01-212-0/+52
| | | | PR: 119136
* sf(4) was repocopied to src/sys/dev/sf.yongari2008-01-212-2663/+0
|
* Overhaul re(4).yongari2008-01-151-23/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Increased number of Rx/Tx descriptors to 256 for 8169 GigEs because it's hard to push the hardware to the limit with default 64 descriptors. TSO requires large number of Tx descriptors to pass a full sized TCP segment(65535 bytes IP packet) to hardware. Previously it consumed 32 Tx descriptors, assuming MCLBYTES DMA segment size, to send the TCP segment which means re(4) couldn't queue more than two full sized IP packets. For 8139C+ it still uses 64 Rx/Tx descriptors due to its hardware limitations. With this changes there are (very) small waste of memory for 8139C+ users but I don't think it would affect 8139C+ users for most cases. o Various bus_dma(9) fixes. - The hardware supports DAC so allow 64bit DMA operations. - Removed BUS_DMA_ALLOC_NOW flag. - Increased DMA segment size to 4096 from MCLBYTES because TSO consumes too many descriptors with MCLBYTES DMA segment size. - Tx/Rx side bus_dmamap_load_mbuf_sg(9) support. With these changes the code is more readable than previous one and got a (slightly) better performance as it doesn't need to pass/ decode arguments to/from callback function. - Removed unnecessary callback function re_dmamap_desc() and nuked rl_dmaload_arg structure which was used in the callback. - Additional protection for DMA map load failure. In case of failure reuse current map instead of returning a bogus DMA map. - Deferred DMA map unloading/sync operation for maximum performance until we really need to load new DMA map. If we happen to reuse current map(e.g. input error) there is no need to sync/unload/load again. - The number of allowable Tx DMA segments for a mbuf chains are now 32 instead of magic nseg value. If the number of available Tx descriptors are short enough to send highly fragmented mbuf chains an optimized re_defrag() is called to collapse mbuf chains which is supposed to be much faster than m_defrag(9). re_defrag() was borrowed from ath(4). - Separated Rx/Tx DMA tag from a common DMA tag such that Rx DMA tag correctly uses DMA maps that were created with DMA alignment restriction(8bytes alignments). Tx DMA tag does not have such alignment limitation. - Added additional sanity checks for DMA ring map load failure. - Added additional spare Rx DMA map for graceful handling of Rx DMA map load failure. - Fixed misused bus_dmamap_sync(9) and added missing bus_dmamap_sync(9) in re_encap()/re_txeof()/re_rxeof(). o Enabled TSO again as re(4) have reasonable number of Tx descriptors. o Don't touch DMA address of a Tx descriptor in re_txeof(). It's not needed. o Fix incorrect update of if_ierrors counter. For Rx buffer shortage it should update if_qdrops as the buffer is reused. o Added checks for unsupported H/W revisions and return ENXIO for these hardwares. This is required to remove resource allocation code in re_probe as other drivers do in device probe routine. o Modified descriptor index manipulation macros as it's now possible to have different number of descriptors for Rx/Tx. o In re_start, to save a lock operation, use IFQ_DRV_IS_EMPTY before trying to invoke IFQ_DRV_DEQUEUE. Also don't blindly call re_encap since we already know the number of available Tx descriptors in advance. o Removed RL_TX_DESC_THLD which was used to reserve RL_TX_DESC_THLD descriptors in Tx path. There is no such a limitation mentioned in 8139C+/8169/8110/8168/8101/8111 datasheet and it seems to work ok without reserving RL_TX_DESC_THLD descriptors. o Fix a comment for RL_GTXSTART. The register is 8bits register. o Added comments for 8169/8139C+ hardware restrictions on descriptors. o Removed forward declaration for "struct rl_softc", it's not needed. o Added a new structure rl_txdesc for Tx descriptor managements and a structure rl_rxdesc for Rx descriptor managements. o Removed unused member variable rl_intlock in driver softc. There are still several unused member variables which are supposed to be used to access hardware statistics counters. But it seems that accessing hardware counters were not implemented yet.
* Add another RTL8168 revision 3 which is found on RTL8111-GR Gigabityongari2007-12-081-0/+1
| | | | | | | | | Ethernet Controller. Multicast filtering wasn't tested and needs more expore. While I'm here change complex if statements with switch statement which would improve readability. Reported by: Abdullah Ibn Hamad Al-Marri < wearabnet AT yahoo DOT ca > Tested by: Abdullah Ibn Hamad Al-Marri < wearabnet AT yahoo DOT ca >
* Remove XRPU driver, after asking all the users.phk2007-12-011-268/+0
|
* Add the FNW3603TX Planex NIC.remko2007-11-262-0/+7
| | | | | | | PR: 76081 Approved by: imp (mentor) Submitted by: umi at pocke dot org MFC After: 3 days
* Fix function prototype for device_shutdown method.yongari2007-11-225-11/+19
|
* Move the agp(4) driver from sys/pci to sys/dev/agp. __FreeBSD_version wasjhb2007-11-1214-5891/+0
| | | | | | | | | bumped to 800004 to note the change though userland apps should not be affected since they use <sys/agpio.h> rather than the headers in sys/dev/agp. Discussed with: anholt Repocopy by: simon
* Add SMB support for the MCP61 chipset.remko2007-11-101-0/+3
| | | | | | PR: 108830 Submitted by: Edwin Mons <freebsd at edwinm dot ik dot nu> Approbed by: imp (mentor)
* Split agp_generic_detach() up into two routines: agp_free_cdev() destroysjhb2007-10-3011-38/+39
| | | | | | | | | /dev/agpgart and agp_free_res() frees resources like the BAR for the aperture. Splitting this up lets chipset-specific detach routines manipulate the aperture during their detach routines without panicing. MFC after: 1 week Reviewed by: anholt
* Oops, convert a tsleep() to a msleep() that was missed when adding lockingjhb2007-10-151-1/+1
| | | | | | to this driver. Reported by: Michael Butler : imb of protected-networks net
* Spelling fix for interupt -> interruptkevlo2007-10-122-3/+3
|
* Not all VIA Rhine chips support 256 register space. So touchingyongari2007-10-121-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | VR_STICKHW register would result in unexpected results on these hardwares. wpaul said the following for the issue. The vr_attach() routine unconditionally does this for all supported chips: /* * Windows may put the chip in suspend mode when it * shuts down. Be sure to kick it in the head to wake it * up again. */ VR_CLRBIT(sc, VR_STICKHW, (VR_STICKHW_DS0|VR_STICKHW_DS1)); The problem is, the VR_STICKHW register is not valid on all Rhine devices. The VT86C100A chip, which is present on the D-Link DFE-530TX boards, doesn't support power management, and its register space is only 128 bytes wide. The VR_STICKHW register offset falls outside this range. This may go unnoticed in most scenarios, but if you happen to have another PCI device in your system which is assigned the register space immediately after that of the Rhine, the vr(4) driver will incorrectly stomp it. In my case, the BIOS on my test board decided to put the register space for my PRO/100 ethernet board right next to the Rhine, and the Rhine driver ended up clobbering the IMR register of the PRO/100 device. (Long story short: the board kept locking up on boot. Took me the better part of the morning suss out why.) The strictly correct thing to do would be to check the PCI config space to make sure the device supports the power management capability and only write to the VR_STICKHW register if it does. Instead of inspecting chip revision numbers for the availability of VR_STICKHW register, check the existence of power management capability of the hardware as wpaul suggested. Reported by: wpaul Suggested by: wpaul OK'ed by: jhb
* - Add the device ID for the VIA VT3324 (CX700) chipset.kevlo2007-09-211-21/+83
| | | | | | - Set and Get aperture size correctly for VIA's AGP3 chipsets. Approved by: re (kensmith)
* Add the PCI id for the Intel 7221's integrated graphics controller. It isalc2007-09-151-0/+2
| | | | | | | | similar to a 915G. Approved by: re (kensmith) Reviewed by: anholt MFC after: 3 weeks
* Remove the now-unused NET_{LOCK,UNLOCK,ASSERT}_GIANT() macros, whichrwatson2007-08-061-2/+0
| | | | | | | | | | | | | | | previously conditionally acquired Giant based on debug.mpsafenet. As that has now been removed, they are no longer required. Removing them significantly simplifies error-handling in the socket layer, eliminated quite a bit of unwinding of locking in error cases. While here clean up the now unneeded opt_net.h, which previously was used for the NET_WITH_GIANT kernel option. Clean up some related gotos for consistency. Reviewed by: bz, csjp Tested by: kris Approved by: re (kensmith)
* Add the device ID for the VIA CX700 chipset.kevlo2007-08-021-2/+9
| | | | Approved by: re (hrs)
* Add MSI support.yongari2007-07-242-10/+13
| | | | | | | | | | | | Ever since switching to adaptive polling re(4) occasionally spews watchdog timeouts on systems with MSI capability. This change is minimal one for supporting MSI and re(4) also needs MSIX support for RTL8111C in future. Because softc structure of re(4) is shared with rl(4), rl(4) was touched to use the modified softc. Reported by: cnst Tested by: cnst Approved by: re (kensmith)
* Add support for G965/Q965/GM965/GME965/GME945 AGP.anholt2007-07-134-230/+387
| | | | | | | | | | | | | | | | | | | | | | | | | | This adds a function to agp.c to set the aperture resource ID if it's not the usual AGP_APBASE. Previously, agp.c had been assuming AGP_APBASE, which resulted in incorrect agp_info, and contortions by agp_i810.c to work around it. This also adds functions to agp.c for default AGP_GET_APERTURE() and AGP_SET_APERTURE(), which return the aperture resource size and disallow aperture size changes. Moving to these for our AGP drivers will likely result in stability improvements. This should fix 855-class aperture size detection. Additionally, refuse to attach agp_i810 when some RAM is above 4GB and the GART can't reference memory that high. This should be very rare. The correct solution would be bus_dma conversion for agp, which is beyond the scope of this change. Other AGP drivers could likely use this change as well. G33/Q35/Q33 AGP support is also included, but disconnected by default due to lack of testing. PR: kern/109724 (855 aperture issue) Submitted by: FUJIMOTO Kou<fujimoto@j.dendai.ac.jp> Approved by: re (hrs)
* re(4) devices requires an external EEPROM. Depending on models ityongari2007-07-061-0/+2
| | | | | | | | | | | | | | | | | | | would be 93C46(1Kbit) or 93C56(2Kbit). One of differences between them is number of address lines required to access the EEPROM. For example, 93C56 EEPROM needs 8 address lines to read/write data. If 93C56 recevied premature end of required number of serial clock(CLK) to set OP code/address of EEPROM, the result would be unexpected behavior. Previously it tried to detect 93C46, which requires 6 address lines, and then assumed it would be 93C56 if read data was not expected value. However, this approach didn't work in some models/situations as 93C56 requries 8 address lines to access its data. In order to fix it, change EEPROM probing order such that 93C56 is detected reliably. While I'm here change hard-coded address line numbers with defined constant to enhance readability. PR: 112710 Approved by: re (mux)
* Prepare for future integration between CAM and newbus. xpt_bus_registerscottl2007-06-171-1/+1
| | | | | | | now takes a device_t to be the parent of the bus that is being created. Most SIMs have been updated with a reasonable argument, but a few exceptions just pass NULL for now. This argument isn't used yet and the newbus integration likely won't be ready until after 7.0-RELEASE.
* The mac address must be written a word length at a time, it was having no ↵thompsa2007-06-151-2/+4
| | | | | | effect before. MFC after: 1 week
* Where I previously removed calls to kdb_enter(), now remove include ofrwatson2007-05-291-1/+0
| | | | | | kdb.h. Pointed out by: bde
* Implement assert() in ncr.c using KASSERT() rather than explicitly testingrwatson2007-05-271-6/+1
| | | | the assertion and then calling kdb_enter().
* tl(4) appears to support long frames.yar2007-05-091-0/+2
| | | | Tested by: Peter Jeremy <peterjeremy at optushome dot com dot au>
* Add VLAN capability.phk2007-04-232-1/+2
| | | | Submitted by: Slawa Olhovchenkov <slw@zxy.spb.ru>
* Remove the old software bit-banging MII interface, we started usingphk2007-04-221-167/+1
| | | | the Rhines shiftregisters in four years ago (1.60).
OpenPOWER on IntegriCloud