aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/age
Commit message (Collapse)AuthorAgeFilesLines
* MFC r226478:Pyun YongHyeon2011-12-311-1/+1
| | | | | | | | | | | | Close a race where SIOCGIFMEDIA ioctl get inconsistent link status. Because driver is accessing a common MII structure in mii_pollstat(), updating user supplied structure should be done before dropping a driver lock. Reported by: Karim (fodillemlinkarimi <> gmail dot com) Notes: svn path=/stable/7/; revision=229059
* MFC: r221407 (partial)Marius Strobl2011-09-111-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | - Let mii_phy_add_media() also announce the support of IFM_NONE. - Add a PHY-specific reset routine is for lxtphy(4) which disables MII interrupts. - Remove redundant checks in NIC drivers for mii->mii_instance not being zero before calling the reset routines because as soon as one PHY driver attaches mii->mii_instance is incremented and we hardly can end up in their media change callbacks etc if no PHY driver has attached as mii_attach() would have failed in that case and not attach a miibus(4) instance. - Convert the mebers of the MII data structure to unsigned where appropriate. This is partly inspired by NetBSD/OpenBSD. - Add MIIF_NOMANPAUSE and mii_phy_flowstatus() calls to drivers that weren't explicitly converted to support flow control before. It's unclear whether flow control actually works with these but typically it should and their net behavior should be more correct with these changes in place than without if the MAC driver sets MIIF_DOPAUSE. Obtained from: NetBSD (partially) Notes: svn path=/stable/7/; revision=225490
* MFC r220249,220252:Pyun YongHyeon2011-04-081-3/+9
| | | | | | | | | | | | | | | | | r220249: 64bit DMA caused data corruption. Unfortunately there is no known workaround to use 64bit DMA. Disable 64bit DMA on Attansic L1 controller. Tested by: Yamagi Burmeister (lists <> yamagi dot org) r220252: Partially revert r184106. RX buffer ring also needs bus_dmamap_sync(). Tested by: Yamagi Burmeister (lists <> yamagi dot org) Notes: svn path=/stable/7/; revision=220458
* MFC r216925,217331,217349,217542:Pyun YongHyeon2011-02-022-18/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | r216925: Add a 'locked' variant of the foo_start() routine and call it directly from interrupt handlers and watchdog routines instead of queueing a task to call foo_start(). r217331: Make sure to invoke unlocked foo_start since the taskqueue does not hold a driver lock. This should fix a regression introduced in r216925. r217349: Forgot to remove unlock of the driver lock from age_start_locked() when converting it to a locked variant. r217542: Fix some bugs in my last set of changes to ale(4): - Remove extra unlock from end of ale_start_locked(). - Expand scope of locking in interrupt handler. - Move ether_ifdetach() earlier and retire now-unneeded DETACH flag. Tested by: Aryeh Friedman Notes: svn path=/stable/7/; revision=218199
* MFC: r213893, r213908, r214566, r214605, r214846Marius Strobl2010-11-071-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Convert the PHY drivers to honor the mii_flags passed down and convert the NIC drivers as well as the PHY drivers to take advantage of the mii_attach() introduced in r213878 (MFC'ed to stable/8 in r214685) to get rid of certain hacks. For the most part these were: - Artificially limiting miibus_{read,write}reg methods to certain PHY addresses; we now let mii_attach() only probe the PHY at the desired address(es) instead. - PHY drivers setting MIIF_* flags based on the NIC driver they hang off from, partly even based on grabbing and using the softc of the parent; we now pass these flags down from the NIC to the PHY drivers via mii_attach(). This got us rid of all such hacks except those of brgphy() in combination with bce(4) and bge(4), which is way beyond what can be expressed with simple flags. While at it, I took the opportunity to change the NIC drivers to pass up the error returned by mii_attach() (previously by mii_phy_probe()) and unify the error message used in this case where and as appropriate as mii_attach() actually can fail for a number of reasons, not just because of no PHY(s) being present at the expected address(es). Reviewed by: jhb, yongari Notes: svn path=/stable/7/; revision=214910
* MFC r213844:Pyun YongHyeon2010-10-241-0/+1
| | | | | | | | | | | | | | Make sure to not use stale ip/tcp header pointers. The ip/tcp header parser uses m_pullup(9) to get access to mbuf chain. m_pullup(9) can allocate new mbuf chain and free old one if the space left in the mbuf chain is not enough to hold requested contiguous bytes. Previously drivers can use stale ip/tcp header pointer if m_pullup(9) returned new mbuf chain. Reported by: Andrew Boyer (aboyer <> averesystems dot com) Notes: svn path=/stable/7/; revision=214296
* MFC r211768:Pyun YongHyeon2010-09-241-1/+9
| | | | | | | | | Remove unnecessary controller reinitialization. PR: kern/87506 Notes: svn path=/stable/7/; revision=213134
* MFC r206876:Pyun YongHyeon2010-04-261-15/+13
| | | | | | | | | With r206844, CSUM_TCP is also set for CSUM_TSO case. Modify drivers to take into account for the change. Basically CSUM_TSO should be checked before checking CSUM_TCP. Notes: svn path=/stable/7/; revision=207237
* MFC r204377:Pyun YongHyeon2010-03-231-22/+9
| | | | | | | | | Add TSO support on VLANs. While I'm here remove unnecessary check of VLAN hardware checksum offloading. vlan(4) already takes care of this. Notes: svn path=/stable/7/; revision=205554
* MFC 197627.Pyun YongHyeon2009-11-291-1/+1
| | | | | | | | | | Fix multicast handling. All Atheros controllers use big-endian form in computing multicast hash. PR: kern/139137 Notes: svn path=/stable/7/; revision=199927
* MFC r192418:Pyun YongHyeon2009-06-071-12/+0
| | | | | | | | pci(4) handles PCIM_CMD_INTxDIS so there is no need to poke this bit in driver. Notes: svn path=/stable/7/; revision=193612
* MFC r190499:Pyun YongHyeon2009-05-202-134/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | o Don't access VPD even if hardware advertised the capability. It seems that some revision of controller hang while accessing the VPD. Because VPD access routine are unused, nuke it. o Let TWSI reload EEPROM if VPD capability is detected. Reloading EEPROM will also set ethernet address so age(4) now reads AGE_PAR0 and AGE_PAR1 register to get ethernet address. This removes a lot of hack and enhance readability a lot. o Double PHY reset timeout as it takes more time to take PHY out of power-saving state. o Explicitly check power-saving state by checking undocumented PHY registers. If link is not up, poke undocumented registers to take PHY out of power-saving state. This is the same way what Linux does. On resume, make sure to wake up PHY. o Don't rely on auto-clearing feature of master reset bit, just wait 1ms and check idle status of MAC. o Add PCI device revision information in bootverbose mode. This should fix occasional controller hang in device attach phase. Reported by: barbara < barbara.xxx1975 at libero DOT it > Tested by: barbara < barbara.xxx1975 at libero DOT it > Notes: svn path=/stable/7/; revision=192413
* MFC r190303:Pyun YongHyeon2009-05-201-1/+1
| | | | | | | | Fix inversed logic. pci_find_extcap() returns 0 when it finds specified capability. Notes: svn path=/stable/7/; revision=192412
* MFC r184743:Pyun YongHyeon2009-01-121-7/+7
| | | | | | | | | | Remove informational messages left. These messages were intended to show up in verbose boot mode. Reported by: pluknet ( pluknet<> gmail DOT com ) Notes: svn path=/stable/7/; revision=187088
* MFC r184107:Pyun YongHyeon2009-01-121-2/+0
| | | | | | | Remove unused age_txdq Notes: svn path=/stable/7/; revision=187087
* MFC r184106:Pyun YongHyeon2009-01-121-6/+0
| | | | | | | No need to sync descriptors twice in age_rxintr() Notes: svn path=/stable/7/; revision=187086
* MFC r181717:Pyun YongHyeon2009-01-121-1/+1
| | | | | | | Fix a typo: jme -> age Notes: svn path=/stable/7/; revision=187085
* MFC r180580.Pyun YongHyeon2008-07-241-2/+2
| | | | | | | | | | Use DELAY() instead of pause if waiting time is less than 1ms. This will fix driver hang if hz < 1000. Pointed out by: thompsa Notes: svn path=/stable/7/; revision=180770
* MFC r179653Pyun YongHyeon2008-07-101-1/+1
| | | | | | | Fix typo in comment. Notes: svn path=/stable/7/; revision=180417
* MFC r179100Pyun YongHyeon2008-07-103-0/+4284
Add age(4), a driver for Attansic/Atheros L1 gigabit ethernet controller. L1 has several threshold/timer registers and they seem to require careful tuned parameters to get best performance. Datasheet for L1 is not available to open source driver writers so age(4) focus on stability and correctness of basic Tx/Rx operation. ATM the performance of age(4) is far from optimal which in turn means there are mis-programmed registers or incorrectly configured registers. Currently age(4) supports all known hardware assistance including - MSI support. - TCP Segmentation Offload. - Hardware VLAN tag insertion/stripping. - TCP/UDP checksum offload. - Interrupt moderation. - Hardware statistics counter support. - Jumbo frame support. - WOL support. L1 gigabit ethernet controller is mainly found on ASUS motherboards. Note, it seems that there are other variants of hardware as known as L2(Fast ethernet) and newer gigabit ethernet (AR81xx) from Atheros. These are not supported by age(4) and requires a seperate driver. Big thanks to all people who reported feedback or tested patches. Tested by: kevlo, bsam, Francois Ranchin < fyr AT fyrou DOT net > Thomas Nystroem < thn AT saeab DOT se > Roman Pogosyan < asternetadmin AT gmail DOT com > Derek Tattersal < dlt AT mebtel DOT net > Oliver Seitz < karlkiste AT yahoo DOT com > Notes: svn path=/stable/7/; revision=180403