aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/msk
Commit message (Collapse)AuthorAgeFilesLines
* MFC r198999:Pyun YongHyeon2012-01-091-2/+0
| | | | | | | | | Take a step towards removing if_watchdog/if_timer. Don't explicitly set if_watchdog/if_timer to NULL/0 when initializing an ifnet. if_alloc() sets those members to NULL/0 already. Notes: svn path=/stable/7/; revision=229880
* MFC r212378:Pyun YongHyeon2012-01-091-2/+2
| | | | | | | | Catch up to rename of the constant for the Master Data Parity Error bit in the PCI status register. Notes: svn path=/stable/7/; revision=229878
* MFC r228717:Pyun YongHyeon2012-01-091-2/+2
| | | | | | | | Increase wait time for OP_TCPSTART command processing. It seems 100us is not enough to ensure prefetch unit work. Notes: svn path=/stable/7/; revision=229876
* MFC r227582:Pyun YongHyeon2012-01-042-67/+177
| | | | | | | | | | | | | | | | | | | | | | | | | Enable 64bit DMA addressing support for all msk(4) controllers. Unnecessarily complex LE format used on Marvell controller was main reason not to enable 64bit DMA addressing in driver. If high 32bit address of DMA address of TX/RX buffer is changed, driver has to generate a new LE. In TX path, driver will keep track of lastly used high 32bit address of DMA address and generate a new LE whenever it sees high address change in the DMA address. In RX path, driver will always use two LEs to specify 64bit DMA address of RX buffer. If the high 32bit address of DMA address of RX buffer is the same as previous DMA address of RX buffer, driver does not have to use two LEs but driver will use two LEs for simplicity in RX ring management. One of draw back for switching to 64bit DMA addressing is that the large amount of LEs are used to specify 64bit DMA address such that number of available LEs for TX/RX buffers are considerably reduced. To mitigate the issue, increase number of available LEs from 256 to 384 for TX and from 256 to 512 for RX. For 32bit architectures, msk(4) does not use 64bit DMA addressing to save resources. Notes: svn path=/stable/7/; revision=229526
* 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 r222269:Pyun YongHyeon2011-06-221-16/+17
| | | | | | | style(9) Notes: svn path=/stable/7/; revision=223401
* MFC r222230:Pyun YongHyeon2011-06-222-4/+28
| | | | | | | Add initial support for Marvell 88E8055/88E8075 Yukon Supreme. Notes: svn path=/stable/7/; revision=223399
* MFC r222219,222221,222223,222226-222227,222231,222516:Pyun YongHyeon2011-06-222-77/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge all relevant changes from HEAD to fix long standing instability issues of msk(4). To get desired effect of this merge, cold restarting is required because incorrectly programmed registers are not reset to default value. PR: kern/114631, kern/116853, kern/139093, kern/144206, kern/147824, kern/151169, kern/154591, kern/155636, kern/156493 r222219: Do not blindly clear entire GPHY control register. It seems some bits of the register is used for other purposes such that clearing these bits resulted in unexpected results such as corrupted RX frames or missing LE status updates. For old controllers like Yukon EC it had no effect but it caused all kind of troubles on Yukon Supreme. This change shall improve stability of controllers like Yukon Ultra, Ultra2, Extreme, Optima and Supreme. r222221: Rework store and forward configuration of TX MAC FIFO. Basically it enables store and forward mode except for jumbo frame on Yukon Ultra. r222223: Do not configure RAM registers for controllers that do not have them. These registers are defined only for Yukon XL, Yukon EC and Yukon FE. r222226: Make sure to enable all clocks before accessing registers. Releasing PHY from power down/COMA is done after enabling all clocks. While I'm here remove unnecessary controller reset. r222227: Do not touch ASF related register for controllers that do not have these registers. Also disable Watchdog of ASF microcontroller. r222231: When MTU is changed, check whether driver should be reinitialized or not. If reinitialized is required, clear driver running flag. r222516: Correctly check MAC running status before disabling TX/RX MACs. Notes: svn path=/stable/7/; revision=223397
* MFC r205091,216860:Pyun YongHyeon2011-06-222-47/+204
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r205091: Implement Rx checksum offloading for Yukon EC, Yukon Ultra, Yukon FE and Yukon Ultra2. These controllers provide very simple checksum computation mechanism and it requires additional pseudo header checksum computation in upper stack. Even though I couldn't see much performance difference with/without Rx checksum offloading it may help notebook based controllers. Actually controller can compute two checksum value by giving different starting position of checksum computation on received frame. However, for long time, Marvell's checksum offloading engine have been known to have several silicon bugs so don't blindly trust computed partial checksum value. Instead, compute partial checksum twice by giving the same checksum computation position and compare the result. If the value is different it's clear indication of hardware bug. This configuration lose IP checksum offloading capability but I think it's better to take safe route. Note, Rx checksum offloading for Yukon XL was still disabled due to known silicon bug. r216860: Fix endianness bug introduced in r205091. After controller updates control word in a RX LE, driver converts it to host byte order. The checksum value in the control word is stored in big endian form by controller. r205091 didn't account for the host byte order conversion such that the checksum value was incorrectly interpreted on big endian architectures which in turn made all TCP/UDP frames dropped. Make RX checksum offload work on any architectures by swapping the checksum value. Reported by: Sreekanth M. ( kanthms <> netlogicmicro dot com ) Tested by: Sreekanth M. ( kanthms <> netlogicmicro dot com ) Notes: svn path=/stable/7/; revision=223395
* MFC: r214608, r215297(partial), r215713Marius Strobl2010-11-261-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Flesh out the generic IEEE 802.3 annex 31B full duplex flow control support in mii(4): - Merge generic flow control advertisement (which can be enabled by passing by MIIF_DOPAUSE to mii_attach(9)) and parsing support from NetBSD into mii_physubr.c and ukphy_subr.c. Unlike as in NetBSD, IFM_FLOW isn't implemented as a global option via the "don't care mask" but instead as a media specific option this. This has the following advantages: o allows flow control advertisement with autonegotiation to be turned on and off via ifconfig(8) with the default typically being off (though MIIF_FORCEPAUSE has been added causing flow control to be always advertised, allowing to easily MFC this changes for drivers that previously used home-grown support for flow control that behaved that way without breaking POLA) o allows to deal with PHY drivers where flow control advertisement with manual selection doesn't work or at least isn't implemented, like it's the case with brgphy(4), e1000phy(4) and ip1000phy(4), by setting MIIF_NOMANPAUSE o the available combinations of media options are readily available from the `ifconfig -m` output - Add IFM_FLOW to IFM_SHARED_OPTION_DESCRIPTIONS and IFM_ETH_RXPAUSE and IFM_ETH_TXPAUSE to IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS so these are understood by ifconfig(8). o Make the master/slave support in mii(4) actually usable: - Change IFM_ETH_MASTER from being implemented as a global option via the "don't care mask" to a media specific one as it actually is only applicable to IFM_1000_T to date. - Let mii_phy_setmedia() set GTCR_MAN_MS in IFM_1000_T slave mode to actually configure manually selected slave mode (like we also do in the PHY specific implementations). - Add IFM_ETH_MASTER to IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS so it is understood by ifconfig(8). o Switch bge(4), bce(4), msk(4), nfe(4) and stge(4) along with brgphy(4), e1000phy(4) and ip1000phy(4) to use the generic flow control support instead of home-grown solutions via IFM_FLAGs. This includes changing these PHY drivers and smcphy(4) to no longer unconditionally advertise support for flow control but only if the selected media has IFM_FLOW set (or MIIF_FORCEPAUSE is set) and implemented for these media variants, i.e. typically only for copper. o Switch brgphy(4), ciphy(4), e1000phy(4) and ip1000phy(4) to report and set IFM_1000_T master mode via IFM_ETH_MASTER instead of via IFF_LINK0 and some IFM_FLAGn. o Switch brgphy(4) to add at least the the supported copper media based on the contents of the BMSR via mii_phy_add_media() instead of hardcoding them. The latter approach seems to have developed historically, besides causing unnecessary code duplication it was also undesirable because brgphy_mii_phy_auto() already based the capability advertisement on the contents of the BMSR though. o Let brgphy(4) set IFM_1000_T master mode on all supported PHY and not just BCM5701. Apparently this was a misinterpretation of a workaround in the Linux tg3 driver; BCM5701 seem to require RGPHY_1000CTL_MSE and BRGPHY_1000CTL_MSC to be set when configuring autonegotiation but this doesn't mean we can't set these as well on other PHYs for manual media selection. o Let ukphy_status() report IFM_1000_T master mode via IFM_ETH_MASTER so IFM_1000_T master mode support now is generally available with all PHY drivers. o Don't let e1000phy(4) set master/slave bits for IFM_1000_SX as it's not applicable there. Reviewed by: yongari (plus additional testing) Obtained from: NetBSD (partially), OpenBSD (partially) Unlike as in head, bge(4), bce(4), msk(4), nfe(4) and stge(4) are changed to set MIIF_FORCEPAUSE in stable/7 so they continue to always advertise support of flow control and brgphy(4), ciphy(4), e1000phy(4) as well as ip1000phy(4) are changed to still also accept IFF_LINK0 in addition to the master media option for setting master mode, both in order to not violate POLA. Notes: svn path=/stable/7/; revision=215879
* MFC: r213893, r213908, r214566, r214605, r214846Marius Strobl2010-11-071-11/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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 r207622-207623,207638Pyun YongHyeon2010-05-101-10/+9
| | | | | | | | | | | | | | | | | | | | | | r207622: Drop driver lock before exiting from interrupt handler. r207623: Make sure to check whether driver is running before processing received frames. Also check driver has valid ifp pointer before calling msk_stop() in device_shutdown handler. While I'm here remove unnecessary accesses to interrupt mask registers in device_shutdown handler because driver puts the controller into reset state. With these changes, msk(4) now survive from heavy RX traffic(1byte UDP frame) while reboot is in progress. r207638: When VLAN hardware tagging is disabled, make sure to disable VLAN checksum offloading as well as TSO over VLAN. Notes: svn path=/stable/7/; revision=207886
* MFC r207445:Pyun YongHyeon2010-05-062-3/+23
| | | | | | | | | Add basic support for Marvell 88E8059 Yukon Optima. Tested by: James LaLagna < jameslalagna <> gmail dot com > Notes: svn path=/stable/7/; revision=207722
* MFC r207409,207442:Pyun YongHyeon2010-05-062-4/+11
| | | | | | | | | | | | | | | | | | | | | | r207409: Both RX_GMF_LP_THR and RX_GMF_UP_THR must be 16 bits register. If it is 8bits register then RX FIFO size can't exceed 2KB which is not true for almost all Yukon II controller. r207442: Disable non-ASF packet flushing on Yukon Extreme as vendor's driver does. Without this change, Yukon Extreme seems to generate lots of RX FIFO overruns even though controller has available RX buffers. These excessive RX FIFO overruns generated lots of pause frames which in turn killed devices plugged into switch. It seems there is still occasional RX frame corruption on Yukon Extreme but this change seems to fix the pause frame storm. Reported by: jhb Tested by: jhb Notes: svn path=/stable/7/; revision=207720
* MFC r206876:Pyun YongHyeon2010-04-261-24/+24
| | | | | | | | | 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 r206364:Pyun YongHyeon2010-04-141-1/+4
| | | | | | | | | | | | | | | Partial revert r204545. Just relying on status LE ownership of status block seems to cause poor performance. Always read current status index register first and then check status ownership as we had before. Accessing status index register seems to trigger immediate status update if controller have pending status updates. Reported by: Andre Albsmeier <Andre.Albsmeier <> siemens dot com> Tested by: Andre Albsmeier <Andre.Albsmeier <> siemens dot com> Notes: svn path=/stable/7/; revision=206576
* MFC r205161:Pyun YongHyeon2010-03-241-10/+10
| | | | | | | | | | | | | | | It seems PCI_OUR_REG_[1-5] registers are not mapped on PCI configuration space on Yukon Ultra(88E8056) such that accesses to these registers were NOPs which in turn make msk(4) instable on this controller. Use indirect access method to access PCI_OUR_REG_[1-5] registers. This should fix a long standing instability bug which prevented msk(4) working on Yukon Ultra. Special thanks to koitsu who gave me remote access to his system. PR: kern/114631, kern/116853 Notes: svn path=/stable/7/; revision=205618
* MFC r204545:Pyun YongHyeon2010-03-242-155/+26
| | | | | | | | | | | | | | Remove taskqueue based interrupt handling. After r204541 msk(4) does not generate excessive interrupts any more so we don't need to have two copies of interrupt handler. While I'm here remove two STAT_PUT_IDX register accesses in LE status event handler. After r204539 msk(4) always sync status LEs so there is no need to resort to reading STAT_PUT_IDX register to know the end of status LE processing. Just trust status LE's ownership bit. Notes: svn path=/stable/7/; revision=205614
* MFC r204541:Pyun YongHyeon2010-03-242-20/+23
| | | | | | | | | | | | | | | | | | | | | Implement rudimentary interrupt moderation with programmable countdown timer register. The timer resolution may vary among controllers but the value would be represented by core clock cycles. msk(4) will automatically computes number of required clock cycles from given micro-seconds unit. The default interrupt holdoff timer value is 100us which will ensure less than 10k interrupts under load. The timer value can be changed with dev.mskc.0.int_holdoff sysctl node. Note, the interrupt moderation is shared resource on dual-port controllers so you can't use separate interrupt moderation value for each port. This means we can't stop interrupt moderation in driver stop routine. Also have msk_tick() reclaim transmitted Tx buffers as safety belt. With this change there is no need to check missing Tx completion interrupt in watchdog handler, so remove it. Notes: svn path=/stable/7/; revision=205610
* MFC r204363,204365-204367,204539-204540:Pyun YongHyeon2010-03-232-112/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r204363: Optimize inserting LE for TX checksum computation. Controller does not require checksum LE configuration if checksum start and write position is the same as before. So keep track last checksum start and write position and insert new LE whenever the position is changed. This reduces number of LEs used in TX path as well as slightly enhance TX performance. r204365: Don't hardcod register offset to set PCIe max read request size. The register offset is not valid on 88E8072 controller. Also don't blindly increase max read request size to 4096, instead, use 2048 which seems to be more sane value and only change the value if the hardware default size(512) was used on that register. For PCIX controllers, use system defined constant rather than using magic value. While I'm here stop showing negotiated link width. r204366: Allocate single MSI message. msk(4) used to allocate 2 MSI messages for controllers like 88E8053 which reports two MSI messages. Because we don't get anything useful things with 2 MSI messages, allocating 1 MSI message would be more sane approach. While I'm here, enable MSI for dual-port controllers too. Because status block is shared for dual-port controllers, I don't think msk(4) will encounter problem for using MSI on dual-port controllers. r204367: Remove trailing white spaces. r204539: Properly sync status LEs after processing. r204540: Make sure to enable flow-control only if established link is full-duplex. Previously msk(4) used to allow flow-control on 1000baseT half-duplex media. Also GMAC pause is enabled if link partner is capable of handling it. While I'm here use IFM_OPTIONS instead of using IFM_GMASK to check optional flags of link. Notes: svn path=/stable/7/; revision=205543
* MFC r204361-204362:Pyun YongHyeon2010-03-231-7/+12
| | | | | | | | | | | | | | r204361: Reuse the configured LE for VLAN if new LE was created for TSO. Only old controllers need to create new LE for TSO. This change makes TSO work over VLANs. r204362: Add TSO support on VLANs. Controller requires VLAN hardware tagging to make TSO work over VLANs. Notes: svn path=/stable/7/; revision=205540
* MFC r202826-202827,204146Pyun YongHyeon2010-03-181-18/+24
| | | | | | | | | | | | | | | | | | | r202826: s/Mhz/MHz/g Submitted by: N.J. Mann <njm <> njm dot me dot uk > r202827: Yukon Ultra2 has 125MHz clock. r204146: Correct inversed programming of ethernet hardware address on big-endian architecture. Submitted by: C. Jayachandran <c.jayachandran at gmail dot com> (initial version) Notes: svn path=/stable/7/; revision=205293
* MFC r199413:Pyun YongHyeon2009-11-291-0/+2
| | | | | | | | | | | | | | It seems generation of link state change of e1000phy(4) is not reliable on some Marvell PHYs. If msk(4) know it still does not have established link check whether msk(4) missed the link state change by looking into polled link state. Reported by: Mel Flynn < mel.flynn+fbsd.current <> mailing.thruhere dot net >, Gleb Kurtsou <gleb.kurtsou <> gmail dot com > Tested by: Gleb Kurtsou <gleb.kurtsou <> gmail dot com > Notes: svn path=/stable/7/; revision=199943
* MFC r198475:Pyun YongHyeon2009-11-292-0/+3
| | | | | | | - Add support for Marvell Yukon 88E8042 device. Notes: svn path=/stable/7/; revision=199937
* MFC r199012:Pyun YongHyeon2009-11-292-2/+15
| | | | | | | | | | Add preliminary Yukon Ultra 2 support(88E8057). The controller looks very similar to Yukon EC Ultra. Tested by: kalin m ( kalin <> el dot net ) Notes: svn path=/stable/7/; revision=199935
* MFC 198996-198997.Pyun YongHyeon2009-11-291-4/+1
| | | | | | | | | | | | | | | | r198996: Remove unnecessary header file. r198997: It's normal to see Rx FIFO overruns under high network load and showing the message creates other side-effects. Remove the Rx FIFO overrun message in interrupt handler. msk(4) should recover from the FIFO overruns without any user intervention. Users can still check the Rx FIFO overrun counter from MAC MIB statistics maintained in driver(dev.msk.0.stats.rx.overflows). Notes: svn path=/stable/7/; revision=199933
* MFC 197592.Pyun YongHyeon2009-11-292-0/+3
| | | | | | | | | Add DGE-560SX(Yukon XL) to the supported device list. Many thanks to "Eugene Perevyazko <john <> dnepro dot net>" who kindly gave remote access to system with DGE-560SX. Notes: svn path=/stable/7/; revision=199921
* MFC 197591.Pyun YongHyeon2009-11-291-3/+8
| | | | | | | | Add workaround for Yukon XL which has hardware bug that can't flush FIFO. Notes: svn path=/stable/7/; revision=199919
* MFC 197590.Pyun YongHyeon2009-11-292-15/+25
| | | | | | | | | | | | | Add hack to pass controller specific information to phy driver. Unlike most other PHYs there is no easy way to know which media type the PHY supports on Marvell PHYs. MIIF_HAVEFIBER flags is now passed via bus-specific instance variable of a device. While I'm here add 88E1112 specific work around to set SIGDET polarity low. Many thanks "Eugene Perevyazko <john <> dnepro dot net>" who kindly gave remote access to system with DGE-560SX. Notes: svn path=/stable/7/; revision=199917
* MFC 197589.Pyun YongHyeon2009-11-291-1/+1
| | | | | | | | | Fix MIB statistics clear routine. This should fix alignment errors on sparc64. Reported by: Garrett Damore < gdamore <> opensolaris dot org > Notes: svn path=/stable/7/; revision=199915
* MFC r193298-193299:Pyun YongHyeon2009-06-182-11/+76
| | | | | | | | | | | | | | | | | | | | | r193298: Add Rx checksum offloading support for Yukon FE+ and Yukon Extreme. These controllers use newer descriptor format and the new descriptor format uses status LE to indicate the status of checksum. Rx checksummed value used in previous controllers were very cryptic and I failed to understand how to use them. In addition most controllers in previous generations had Rx checksum offloading bug. While I'm here introduce a MSK_FLAG_NORX_CSUM flag to bypass checking Rx checksum offloading as Yukon FE+ A0 has status LE bug. r193299: Add Yukon Extreme device ids, 88E8071 and 88E8072. While I'm here correct description of 88E8070. 88E8070 is Yukon Extreme and have gigabit PHY. Notes: svn path=/stable/7/; revision=194423
* MFC r193293-193294:Pyun YongHyeon2009-06-182-46/+244
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r193293: Add preliminary Yukon Extreme support and register definitions. Yukon Extreme uses new descriptor format for TSO and has Tx frame parser which greatly reduces CPU cycles spent in computing TCP/UDP payload offset calculation in Tx checksum offloading path. The new descriptor format also removed TCP/UDP payload computation for TSO which in turn results in better TSO performance. It seems Yukon Extreme has a lot of new (unknown) features but only basic offloading is supported at this time. So far there are two known issues. o Sometimes Rx overrun errors happen when pulling data over gigabit link. Running over 100Mbps seem to ok. o Ethernet hardware address shows all-zeroed value on 88E8070. Assigning ethernet address with ifconfig is necessary to make it work. Support for Yukon Extreme is not perfect but it would be better than having a non-working device. Special thanks to jbh who fixed several bugs of initial patch. Tested by: jhb, Warren Block ( wblock <> wonkity dot com ) r193294: Add frame parser capability of Yukon FE+ and Yukon Extreme. With this feature hardware automatically computes TCP/UDP payload offset. Introduce MSK_FLAG_AUTOTX_CSUM to mark the capability. Yukon Extreme B0 revision is known to have a silicon for the feature so disable it. Yukon Extreme B0 still can do Tx checksum offloading but CPU have to compute TCP/UDP payload offset. To enable traditional checksum offloading, disable automatic Tx checksum calculation capability. Yukon Extreme A0 revision could not use store-and-forward mode for jumbo frames(silicon bug) so disable Tx checksum offloading for jumbo frames. I believe controllers that have MSK_FLAG_AUTOTX_CSUM capability or new descriptor format do not have Tx checksum offload bug so disable checksum offloading workaround for for short frames. Tested by: jhb, Warren Block ( wblock <> wonkity dot com ) Notes: svn path=/stable/7/; revision=194422
* MFC r192735-192740,192742:Pyun YongHyeon2009-06-182-36/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add workaround for Yukon FE+ A0. This controller is known to have severe silicon bugs that can't handle VLAN hardware tagging as well as status LE writeback bug. The status LE writeback bug is so critical we can't trust status word of received frame. To accept frames on Yukon FE+ A0 msk(4) just do minimal check for received frames and pass them to upper stack. This means msk(4) can pass corrupted frames to upper layer. You have been warned! Also I supposed RX_GMF_FL_THR to be 32bits register but Linux driver treated it as 16bit register so follow their leads. At least this does not seem to break msk(4) on Yukon FE+. Tested by: bz, Tanguy Bouzeloc ( the.zauron <> gmail dot com ) Bruce Cran ( bruce <> cran dot org dot uk ) Michael Reifenberger ( mike <> reifenberger dot com ) Stephen Montgomery-Smith ( stephen <> missouri dot edu ) r192736: Add device ids for Yukon FE+(88E8040, 88E8040T, 88E8048 and 88E8070). r192737: If interface is not UP, don't return media status. r192738: Don't reinitialize controller when interface is already running. r192739: Be consistent with other capability checking. r192740: Simplify SIOCSIFFLAGS handler. r192742: Correct controller description for 88E8035, 88E8036, 88E8038 and 88E8039. These are fast ethernet controllers. Notes: svn path=/stable/7/; revision=194421
* MFC r192734:Pyun YongHyeon2009-06-182-4/+20
| | | | | | | | | | | | | | | | | | Add preliminary Yukon FE+ support and register definitions. Yukon FE+ is fast ethernet controller and uses new descriptor format. Since I don't have this controller, the support code was written from guess and various feedback from enthusiastic users. Thanks to all users who patiently tested my initial patches. Special thanks to Tanguy Bouzeloc who fixed critical bug of initial patch. Tested by: bz, Tanguy Bouzeloc ( the.zauron <> gmail dot com ) Bruce Cran ( bruce <> cran dot org dot uk ) Michael Reifenberger ( mike <> reifenberger dot com ) Stephen Montgomery-Smith ( stephen <> missouri dot edu ) Notes: svn path=/stable/7/; revision=194420
* MFC r192723-192728,192731Pyun YongHyeon2009-06-182-72/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r192723: Rather than checking every chip revision, introduce more flags to mark controller's capability. Controllers that have jumbo frame support sets MSK_FLAG_JUMBO, and controllers that does not support checksum offloading for jumbo frames will set MSK_FLAG_JUMBO_NOCSUM. For Fast Ethernet controllers it will set MSK_FLAG_FASTETHER and it would be used in link state handling. While here, disable Tx checksum offloading if jumbo frame is used on controllers that does not have Tx checksum offloading capability for jumbo frame(e.g. Yukon EC Ultra). r192724: Caller already hold a driver lock in mii callback, assert it. r192725: Add missing ~ operator. r192726: Add support for newer descriptor format. This format is used on Yukon FE+, Yukon Extreme and Yukon Supreme. r192727: Explicitly check resolved speed/duplex. Just checking IFM_ACTIVE does not guarantee established link. Also 1000baseT link report for fast ethernet controller is not valid one so make sure gigabit link is allowed for this controller. Whenever we lost link, check whether Rx/Tx MACs were enabled. If both MAC are not active, do not try to disable it again. r192728: Disable HW WOL for Yukon EC Ultra. While I'm here use switch statement over if-else statement. This change will make it easy to add newer Yukon controllers. r192731: Explicitly reset GMAC Controls and initialize GM_GP_CTRL register. The GM_GP_CTRL register may have stale content from previous link information so clearing it will make hardware update the register correctly when it established a valid link. While I'm here remove stale comment. Notes: svn path=/stable/7/; revision=194419
* MFC r192716,192718-192720Pyun YongHyeon2009-06-182-40/+27
| | | | | | | | | | | | | | | | | | | | | r192716: Remove link handling taskqueue and use mii callback directly. While I'm here also checks driver running state. r192718: Use bit definition to represent link state, device suspend instead of using separate variables in softc. r192719: Use bit definition to represent MSI and detach state instead of using separate variables in softc. r192720: Correctly return the result of mii_mediachg(). Previously it always used to return success. Notes: svn path=/stable/7/; revision=194418
* MFC r190314:Pyun YongHyeon2009-06-071-42/+16
| | | | | | | | | | | | Togging ALLMULTI does not require controller reset so have Rx filtering handle this. Introduce a new function msk_rxfilter that handles Rx filter configuration and multicast setup as well as promiscuous mode. This simplifies code a lot. Promiscuous mode always have preference to any other Rx filtering so don't disable the mode when ALLMULTI is set. Notes: svn path=/stable/7/; revision=193614
* MFC r190407:Pyun YongHyeon2009-03-301-1/+1
| | | | | | | | | Fix typo. Approved by: re (Ken Smith) Notes: svn path=/stable/7/; revision=190539
* MFC r187325:Pyun YongHyeon2009-03-192-9/+354
| | | | | | | | | | Add hardware MAC statistics support. Also added some reserved statistics register definition. Users can get current MAC statistics from dev.msk.%d.stats sysctl node(%d is unit number of a device). Notes: svn path=/stable/7/; revision=190013
* MFC r187208:Pyun YongHyeon2009-02-092-302/+159
| | | | | | | | | | | | | | | | | | | | | | | | | Remove local jumbo locator and switch to UMA backed page allocator for jumbo frame. o Nuke unneeded jlist lock which was used to protect jumbo buffer management in local allocator. o Added a new tunable hw.mskc.jumbo_disable to disable jumbo frame support for the driver. The tunable could be set for systems that do not need to use jumbo frames and it would save (9K * number of Rx descriptors) bytes kernel memory. o Jumbo buffer allocation failure is no longer critical error for the operation of msk(4). If msk(4) encounter the allocation failure it just disables jumbo frame support and continues to work without your intervention. Using local allocator had several drawbacks such as requirement of large amount of continuous kernel memory and fixed (small) number of available buffers. The need for large continuous memory resulted in failure of loading driver with kldload on running systems. Also small number of buffer used in local allocator showed poor performance for some applications. Notes: svn path=/stable/7/; revision=188364
* MFC r187207:Pyun YongHyeon2009-02-091-5/+2
| | | | | | | | Correct frame length argument of in_cksum_skip. While I'm here remove intermediate variable csum. Notes: svn path=/stable/7/; revision=188363
* MFC r185244Pyun YongHyeon2009-02-091-1/+1
| | | | | | | | Save the value read from TX queue CSR, so we don't test against a stale one. Notes: svn path=/stable/7/; revision=188362
* MFC r183485-183486Pyun YongHyeon2009-02-091-1/+15
| | | | | | | | | | | | | r183485: Always pullup mbuf prior to accessing TCP header. This should fix occasional Tx checksum corruption issue. r183486: If mbuf is not writable get a writable copy before invoking m_pullup(9). Notes: svn path=/stable/7/; revision=188361
* MFC r183346Pyun YongHyeon2009-02-092-7/+62
| | | | | | | | | | | | | | | | Add another hardware bug workaround for Yukon II controllers that have hardware ram buffer. The silicon bug seem to be triggered by pause frames if receive buffer is not aligned on FIFO word(8 bytes). To workaround the issue, make sure to align Rx buffers on 8 bytes. Unfortunately this workaround requires yet another Rx fixup for strict alignment architecture machines to align IP header. For newer hardwares that lacks ram buffer may not have this bug so check number of available ram buffer size to see the existence of ram buffer. Notes: svn path=/stable/7/; revision=188360
* MFC: if_msk.c 1.30, if_msk.c 1.31 to RELENG_7Pyun YongHyeon2008-03-181-4/+8
| | | | | | | | | | | | To overcome hardware checksum offload bug msk(4) used to compute TCP/UDP checksum in driver for short frames. For frames that requires hardware VLAN tag insertion, the checksum offload trick does not work due to changes of checksum offset in mbuf after the VLAN tag. Disable hardware checksum offload for VLAN interface to fix the bug. Notes: svn path=/stable/7/; revision=177333
* MFC: if_msk.c 1.29, if_mskreg.h 1.12 to RELENG_7Pyun YongHyeon2008-03-182-2/+6
| | | | | | | | | | | | Workaround GMAC hardware hang of Yukon II on the receipt of pause frames. This bug seems to happen on certain hardware model/revision (e.g. 88E8053) but it's not identified which hardwares are affected. Revision 1.4 of if_mskreg.h was not enough to workaround the bug. To workaround it, inrease GMAC FIFO threshold by one FIFO word to flush received pause frames. Notes: svn path=/stable/7/; revision=177331
* MFC: if_npe.c 1.8, if_gem.c 1.47, if_msk.c 1.27, if_nfe.c 1.25, if_wpi.c 1.6Pyun YongHyeon2008-03-181-88/+1
| | | | | | | | | | - Retire npe_defrag(), gem_defrag(), msk_defrag(), nfe_defrag(), and re_defrag() and use m_collapse() instead. - Replace a reference to ath_defrag() in a comment in if_wpi.c with m_collapse(). Notes: svn path=/stable/7/; revision=177330
* MFC: Fix function prototype for device_shutdown method.Pyun YongHyeon2008-03-131-2/+3
| | | | Notes: svn path=/stable/7/; revision=177136
* MFC if_msk.c rev 1.24 to RELENG_7.Pyun YongHyeon2008-02-031-8/+27
| | | | | | | | | Add MSI support for 88E8058(Yukon EC Ultra). Unlike other Yukon II family 88E8058 supports only one MSI message. Teach msk(4) to handle that case. Notes: svn path=/stable/7/; revision=175930
* MFC if_msk.c rev 1.23, if_mskreg.h 1.10 to RELENG_7.Pyun YongHyeon2008-02-032-0/+3
| | | | | | | | | | | | Add device id for 88E8058(Yukon EC Ultra) which is found on 3rd generation MacBooks. Unfortunately 88E8058 supports one MSI message so msk(4) needs more generic way to handle the MSI capability. PR: 118110 Notes: svn path=/stable/7/; revision=175926