summaryrefslogtreecommitdiff
path: root/sys/dev/msk
Commit message (Collapse)AuthorAgeFilesLines
* 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
* MFC if_msk.c rev 1.22, if_mskreg.h 1.9 to RELENG_7.Pyun YongHyeon2008-02-032-22/+16
| | | | | | | | | | | | | | | | | Make phy respond only at address 0. This makes phy driver attached only at address 0 which is supposed to be the only valid phy address on Marvell PHY. The more correct solution would be masking PHY address ranges allowable in PHY probe routine. Unfortunately, FreeBSD has no way to retrict the PHY address ranges or to pass special flags to PHY driver. This change assumes that PHY hardwares attached to msk(4) would be Marvell made 88E11xx PHY. With this changes the phantom phys attached on 88E8036(Yukon FE) should disappear. Notes: svn path=/stable/7/; revision=175924
* MFC if_msk.c rev 1.21 to RELENG_7.Pyun YongHyeon2008-02-031-38/+12
| | | | | | | | | | | | o Don't hardcode that Yukon FE has 16KB SRAM. In fact, Yukon FE has only 4KB SRAM. o Rework setting Tx/Rx RAM buffer size. Give receiver 2/3 of memory and round it down to the multiple of 1024. The RAM buffer size of Yukon II should be multiple of 1024. This fixes bogus RAM buffer configuration used in Yukon FE. Notes: svn path=/stable/7/; revision=175922
* MFC if_msk.c rev 1.20, if_mskreg.h rev. 1.8 to RELENG_7Pyun YongHyeon2008-02-032-88/+8
| | | | | | | | | | | | | | Drop maintaing hardware feature(bug) lists for Yukon II. We don't have publicly available datasheet for Yukon II and don't know what bug/workaround exist for the specific hardware revision. Also I don't think the vendor will release hardware errata in near future. The hardware feature lists were not used at all except setting water mark registers. Since msk(4) should know exact chip model/revision number to decide which hardware capability could be used the extra feature lists were redundant. Notes: svn path=/stable/7/; revision=175920
* MFC if_msk.c rev 1.19, if_mskreg.h rev. 1.7 to RELENG_7Pyun YongHyeon2008-02-032-19/+37
| | | | | | | | | | | | | | | | | Various fixes for EC Ultra. o Enable jumbo frame support for EC Ultra and disable jumbo frame for FE. o Enable store and forward mode for standard MTU sized frame. o Enable TSO for EC Ultra. However TSO/checksum offload is disabled for jumbo frame case. Because EC Ultra can't use store and forward mode for jumbo frame TSO/checksum offload is not available. o Adjust Tx GMAC almost empty threshold value and add a jumbo frame water mark. The maic value was obtained from Marvell's sk98lin driver. o Fix EC Ultra chip revision number. Notes: svn path=/stable/7/; revision=175916
* MFC rev 1.6 msk.4Remko Lodder2007-12-082-0/+3
| | | | | | | | | | | | | | | | | MFC rev 1.26 if_msk.c MFC rev 1.11 if_mskreg.h Bring in support for: Marvell Yukon 8039 PR: 118401 Submitted by: Skip Ford <skip at menantico dot com> Approved by: imp (mentor), yongari MFC After: 3 days Approved by: re (kensmith), imp (mentor, implicit) Notes: svn path=/stable/7/; revision=174445
* Add legacy interrupt handler which would be more appropriate forPyun YongHyeon2007-07-201-9/+90
| | | | | | | | | | | | | | | | interrupt that is shared with other devices(e.g. USB) in system and provide a new tunable "hw.msk.legacy_intr" to activate the legacy interrupt handler. Setting the tunable automatically disables MSI for msk(4). Previously msk(4) used adoptive polling with taskqueue(9) as all msk(4) hardwares I know supports MSI. However, there are cases that MSI couldn't be used on some hardwares due to bugs in MSI implementatins. Tested by: Li-Lun Wang < llwang AT infor DOT org > Approved by: re (kensmith) Notes: svn path=/head/; revision=171509
* The maximum size of the sum of all segment lengths in a given DMA mappingPyun YongHyeon2007-06-121-1/+1
| | | | | | | | | should be 65535 + link layer headers. Pointed out by: gallatin Notes: svn path=/head/; revision=170604
* Increase a maximum segment size of DMA to 4096. Previously it usedPyun YongHyeon2007-06-112-2/+4
| | | | | | | | | | | MCLBYTES for the segment size but it used too many Tx descriptors in TSO case. While I'm here adjust maximum size of the sum of all segment lengths in a given DMA mapping to 65535, the maximum size, in bytes, of a IP packet. Notes: svn path=/head/; revision=170523
* Disable automatic IP ID increment. Due to a hardware bug the automaticPyun YongHyeon2007-06-111-15/+0
| | | | | | | | IP ID increment in TSO case generated corrupted IP packets. This change brings back TSO capability. Notes: svn path=/head/; revision=170522
* Work around GMAC hardware hang bug.Pyun YongHyeon2007-04-251-1/+0
| | | | | | | | | | | It seems that valid pause frames(Tx flow control) cause GMAC to hang such that it resulted in watchdog timeout. As a work around don't flush Rx MAC FIFO if we've received pause frames. Tested by: Harald Schmalzbauer (h DOT schmalzbauer AT omnisec DOT de) Notes: svn path=/head/; revision=169035
* Disable TSO support.Pyun YongHyeon2007-04-251-0/+8
| | | | | | | | | | | | | | | Under certain circumtances, if TSO is active, Yukon II generates corrupted IP packets. All corrupted IP packets I noticed were the the last segmented packet in a TSO request. The corrupted packet resulted in retransmission of the damaged packet which in turn decreased network performance dramatically. Unfortunately it seems that there is no way to workaround this bug as TSO is completely handled in hardware. Disable TSO until we find a working workaround or a new silicon revision that doesn't have this hardware bug. Notes: svn path=/head/; revision=169034
* Fix TCP header size calculation logic which is used for settingPyun YongHyeon2007-04-251-1/+1
| | | | | | | TSO MTU. Notes: svn path=/head/; revision=169033
* Add work around for hardware Tx checksum offload bug in Yukon II.Pyun YongHyeon2007-04-111-5/+25
| | | | | | | | | | | | | | | | | | Yukon II generated corrupted TCP checksum for short TCP packets that's less than 60 bytes in size(e.g. window probe packet, pure ACK packet etc). Padding the frame with zeros to make the frame minimum ethernet frame size didn't work at all. Instead of dropping Tx checksum offload support we calculate TCP checksum with S/W method when we encounter short TCP frames. Fortunately it seems that short UDP datagrams appear to be handled correctly by Yukon II. While I'm here simplify ethernet/VLAN header size calculation logic. PR: 111384 Notes: svn path=/head/; revision=168608
* If we've encountered unrecognized chipset don't access hardwarePyun YongHyeon2007-04-061-2/+2
| | | | | | | | | | | | anymore. Previously it tried to access interrupt register to disable interrupts which could result in hang if the hardware was not properly initialized by system BIOS/ACPI. Tested by: Benjamin Hansmann (benjamin.hansmann AT rub dot de) MFC after: 3 days Notes: svn path=/head/; revision=168408
* Catch up the rest of the drivers with the ether_vlan_mtap modifications.Christian S.J. Peron2007-03-041-1/+1
| | | | | | | | | | | | | If these drivers are setting M_VLANTAG because they are stripping the layer 2 802.1Q headers, then they need to be re-inserting them so any bpf(4) peers can properly decode them. It should be noted that this is compiled tested only. MFC after: 3 weeks Notes: svn path=/head/; revision=167190
* o break newbus api: add a new argument of type driver_filter_t toPaolo Pisati2007-02-231-4/+5
| | | | | | | | | | | | | | | | bus_setup_intr() o add an int return code to all fast handlers o retire INTR_FAST/IH_FAST For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current Reviewed by: many Approved by: re@ Notes: svn path=/head/; revision=166901
* Unbreak non-H/W VLAN extraction case.Pyun YongHyeon2007-02-151-2/+4
| | | | | | | | | | | | | | | Unlike other GigEs Yukon II always set VLAN bit when it detects VLAN tagged packet regardless of H/W VLAN processing configuration state. So it need to check IFCAP_VLAN_HWTAGGING bit to know whether driver is configured to take advantage of H/W VLAN processing. If H/W VLAN processing was disabled don't adjust received packet length such that subsequent validation logic works for software VLAN processing. Reported by: bms Tested by: bms Notes: svn path=/head/; revision=166737
* Remove duplicated legacy SYS_RES_IRQ resources assignment.Pyun YongHyeon2007-01-091-3/+1
| | | | | | | Noticed by: jhb Notes: svn path=/head/; revision=165907
* Fix a typo which blindly enabled TSO capability without respect toPyun YongHyeon2007-01-081-1/+1
| | | | | | | chip type. Notes: svn path=/head/; revision=165884
* Don't rely on GM_GP_CTRL register contents when mii(4) layer reportsPyun YongHyeon2007-01-081-19/+14
| | | | | | | | | | | | | | link state changes. Instead, build new speed/duplex/flow-control settings from the values reported from PHY. This should fix speed/duplex/flow-control mismatches between GMAC and PHY which resulted in very poor Rx performance due to lots of out-of-order packet delivery. Reported by: Arno J. Klaassen <arno AT heho DOT snv DOT jussieu DOT fr> Tested by: Arno J. Klaassen <arno AT heho DOT snv DOT jussieu DOT fr> Notes: svn path=/head/; revision=165883
* Initialize legacy SYS_RES_IRQ resources before attempting to use MSI.Pyun YongHyeon2007-01-081-0/+1
| | | | | | | | | | | This fixes legacy SYS_RES_IRQ resource allocation failure when MSI is disabled. Reported by: rrs Tested by: rrs Notes: svn path=/head/; revision=165880
* Piggyback watchdog timer handling with msk_tick which is called everyPyun YongHyeon2006-12-292-13/+9
| | | | | | | | hz. This will result in slightly faster Tx processing as it does not need lock operations for callouts in msk_start/msk_txeof. Notes: svn path=/head/; revision=165613
* Fix interrupt handling on a dual port card. Previously it ignoredPyun YongHyeon2006-12-291-10/+6
| | | | | | | | | | the second port interrupt if the first port was in down state. Since I don't have a dual port card it's just guess work. Noticed by: jhb Notes: svn path=/head/; revision=165612
* Fix MSI support. Now it correctly allocates SYS_RES_IRQ resourcesPyun YongHyeon2006-12-292-27/+55
| | | | | | | | | | on Yukon II which reports it can handle two messages. Submitted by: jhb Tested by: bms Notes: svn path=/head/; revision=165611
* Add msk(4), a driver for Marvell/SysKonnect Yukon II Gigabit EthernetPyun YongHyeon2006-12-132-0/+6444
controller. Due to lack of documentation, this driver is based on the code from sk(4) and Marvell's myk(4) driver for FreeBSD. I've also adopted the OpenBSD interface name, msk(4) in order to reduce naming differences between BSDs. The msk(4) driver supports the following Gigabit Ethernet adapters. o SysKonnect SK-9Sxx Gigabit Ethernet o SysKonnect SK-9Exx Gigabit Ethernet o Marvell Yukon 88E8021CU Gigabit Ethernet o Marvell Yukon 88E8021 SX/LX Gigabit Ethernet o Marvell Yukon 88E8022CU Gigabit Ethernet o Marvell Yukon 88E8022 SX/LX Gigabit Ethernet o Marvell Yukon 88E8061CU Gigabit Ethernet o Marvell Yukon 88E8061 SX/LX Gigabit Ethernet o Marvell Yukon 88E8062CU Gigabit Ethernet o Marvell Yukon 88E8062 SX/LX Gigabit Ethernet o Marvell Yukon 88E8035 Gigabit Ethernet o Marvell Yukon 88E8036 Gigabit Ethernet o Marvell Yukon 88E8038 Gigabit Ethernet o Marvell Yukon 88E8050 Gigabit Ethernet o Marvell Yukon 88E8052 Gigabit Ethernet o Marvell Yukon 88E8053 Gigabit Ethernet o Marvell Yukon 88E8055 Gigabit Ethernet o Marvell Yukon 88E8056 Gigabit Ethernet o D-Link 550SX Gigabit Ethernet o D-Link 560T Gigabit Ethernet Unlike OpenBSD/NetBSD msk(4), the msk(4) driver supports all hardware features including TCP/UDP checksum offload for transmit, MSI, TCP segmentation offload(TSO), hardware VLAN tag stripping/insertion, and jumbo frames(up to 9022 bytes). The only unsupported hardware feature except RLMT is Rx checksum offload which I don't know how to make it work reliably. Known Issues: It seems msk(4) does not work on the second port of dual port NIC. (The first port works without problems.) Thanks to Marvell for releasing the BSD licensed myk(4) driver and thanks to all users helped fixing bugs. Tested by: bz, philip, bms, YAMAMOTO Shigeru < shigeru AT iij DOT ad DOT jp >, Dmitry Pryanishnikov < dmitry AT atlantis DOT dp DOT ua >, Jia-Shiun Li < jiashiun AT gmail DOT com >, David Duchscher < daved AT tamu DOT edu >, Arno J. Klaassen < arno AT heho DOT snv DOT jussieu DOT fr>, Nicolae Namolovan < adrenalinup AT gmail DOT com>, Andre Guibert de Bruet < andy AT siliconlandmark DOT com > current ML Tested on: i386, amd64 Notes: svn path=/head/; revision=165138