aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/msk
Commit message (Collapse)AuthorAgeFilesLines
...
* It seems PCI_OUR_REG_[1-5] registers are not mapped on PCIPyun YongHyeon2010-03-141-10/+10
| | | | | | | | | | | | | | | 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 MFC after: 1 week Notes: svn path=/head/; revision=205161
* Implement Rx checksum offloading for Yukon EC, Yukon Ultra,Pyun YongHyeon2010-03-122-47/+204
| | | | | | | | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=205091
* Remove taskqueue based interrupt handling. After r204541 msk(4)Pyun YongHyeon2010-03-022-155/+26
| | | | | | | | | | | | | 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=/head/; revision=204545
* Implement rudimentary interrupt moderation with programmablePyun YongHyeon2010-03-012-20/+23
| | | | | | | | | | | | | | | | | | | | 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=/head/; revision=204541
* Make sure to enable flow-control only if established link isPyun YongHyeon2010-03-011-14/+11
| | | | | | | | | | | 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=/head/; revision=204540
* Properly sync status LEs after processing.Pyun YongHyeon2010-03-011-9/+2
| | | | Notes: svn path=/head/; revision=204539
* Remove trailing white spaces.Pyun YongHyeon2010-02-261-4/+4
| | | | Notes: svn path=/head/; revision=204367
* Allocate single MSI message. msk(4) used to allocate 2 MSI messagesPyun YongHyeon2010-02-262-46/+15
| | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=204366
* Don't hardcod register offset to set PCIe max read request size.Pyun YongHyeon2010-02-262-29/+20
| | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=204365
* Optimize inserting LE for TX checksum computation. Controller doesPyun YongHyeon2010-02-262-10/+17
| | | | | | | | | | | 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. Notes: svn path=/head/; revision=204363
* Add TSO support on VLANs. Controller requires VLAN hardware taggingPyun YongHyeon2010-02-261-6/+11
| | | | | | | to make TSO work over VLANs. Notes: svn path=/head/; revision=204362
* Reuse the configured LE for VLAN if new LE was created for TSO.Pyun YongHyeon2010-02-261-1/+1
| | | | | | | | Only old controllers need to create new LE for TSO. This change makes TSO work over VLANs. Notes: svn path=/head/; revision=204361
* Correct inversed programming of ethernet hardware address onPyun YongHyeon2010-02-201-10/+16
| | | | | | | | | big-endian architecture. Submitted by: C. Jayachandran <c.jayachandran at gmail dot com> (initial version) Notes: svn path=/head/; revision=204146
* Yukon Ultra2 has 126MHz clock.Pyun YongHyeon2010-01-221-1/+1
| | | | Notes: svn path=/head/; revision=202827
* s/Mhz/MHz/gPyun YongHyeon2010-01-221-8/+8
| | | | | | | Submitted by: N.J. Mann <njm <> njm dot me dot uk > Notes: svn path=/head/; revision=202826
* It seems generation of link state change of e1000phy(4) is notPyun YongHyeon2009-11-171-0/+2
| | | | | | | | | | | | | 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=/head/; revision=199413
* Add preliminary Yukon Ultra 2 support(88E8057). The controllerPyun YongHyeon2009-11-072-2/+15
| | | | | | | | | looks very similar to Yukon EC Ultra. Tested by: kalin m ( kalin <> el dot net ) Notes: svn path=/head/; revision=199012
* Take a step towards removing if_watchdog/if_timer. Don't explicitly setJohn Baldwin2009-11-061-2/+0
| | | | | | | | | | if_watchdog/if_timer to NULL/0 when initializing an ifnet. if_alloc() sets those members to NULL/0 already. (Missed this driver in the earlier commit.) Notes: svn path=/head/; revision=198999
* It's normal to see Rx FIFO overruns under high network load andPyun YongHyeon2009-11-061-3/+1
| | | | | | | | | | | 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=/head/; revision=198997
* Remove unnecessary header file.Pyun YongHyeon2009-11-061-1/+0
| | | | Notes: svn path=/head/; revision=198996
* - Add support for Marvell Yukon 88E8042 device.Ulf Lilleengen2009-10-252-0/+3
| | | | | | | | Submitted by: Mario Lobo <mlobo -at- digiart.art.br> Approved by: yongari Notes: svn path=/head/; revision=198475
* Add DGE-560SX(Yukon XL) to the supported device list. Many thanksPyun YongHyeon2009-09-282-0/+3
| | | | | | | | to "Eugene Perevyazko <john <> dnepro dot net>" who kindly gave remote access to system with DGE-560SX. Notes: svn path=/head/; revision=197592
* Add workaround for Yukon XL which has hardware bug that can't flushPyun YongHyeon2009-09-281-3/+8
| | | | | | | FIFO. Notes: svn path=/head/; revision=197591
* Add hack to pass controller specific information to phy driver.Pyun YongHyeon2009-09-282-15/+25
| | | | | | | | | | | | 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=/head/; revision=197590
* Fix MIB statistics clear routine. This should fix alignment errors on sparc64.Pyun YongHyeon2009-09-281-1/+1
| | | | | | | Reported by: Garrett Damore < gdamore <> opensolaris dot org > Notes: svn path=/head/; revision=197589
* Revert previous commit and add myself to the list of people who shouldPoul-Henning Kamp2009-09-081-0/+5
| | | | | | | know better than to commit with a cat in the area. Notes: svn path=/head/; revision=196970
* Add necessary include.Poul-Henning Kamp2009-09-081-5/+0
| | | | Notes: svn path=/head/; revision=196969
* Use if_maddr_rlock()/if_maddr_runlock() rather than IF_ADDR_LOCK()/Robert Watson2009-06-261-2/+2
| | | | | | | | | | | | | | | | IF_ADDR_UNLOCK() across network device drivers when accessing the per-interface multicast address list, if_multiaddrs. This will allow us to change the locking strategy without affecting our driver programming interface or binary interface. For two wireless drivers, remove unnecessary locking, since they don't actually access the multicast address list. Approved by: re (kib) MFC after: 6 weeks Notes: svn path=/head/; revision=195049
* Add Yukon Extreme device ids, 88E8071 and 88E8072.Pyun YongHyeon2009-06-022-3/+9
| | | | | | | | While I'm here correct description of 88E8070. 88E8070 is Yukon Extreme and have gigabit PHY. Notes: svn path=/head/; revision=193299
* Add Rx checksum offloading support for Yukon FE+ and Yukon Extreme.Pyun YongHyeon2009-06-022-8/+67
| | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=193298
* Add frame parser capability of Yukon FE+ and Yukon Extreme. WithPyun YongHyeon2009-06-022-13/+47
| | | | | | | | | | | | | | | | | | | | | | 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=/head/; revision=193294
* Add preliminary Yukon Extreme support and register definitions.Pyun YongHyeon2009-06-022-34/+198
| | | | | | | | | | | | | | | | | | | | | | | | 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 ) Notes: svn path=/head/; revision=193293
* Correct controller description for 88E8035, 88E8036, 88E8038 andPyun YongHyeon2009-05-251-4/+4
| | | | | | | 88E8039. These are fast ethernet controllers. Notes: svn path=/head/; revision=192742
* Simplify SIOCSIFFLAGS handler.Pyun YongHyeon2009-05-251-12/+8
| | | | Notes: svn path=/head/; revision=192740
* Be consistent with other capability checking.Pyun YongHyeon2009-05-251-7/+8
| | | | Notes: svn path=/head/; revision=192739
* Don't reinitialize controller when interface is already running.Pyun YongHyeon2009-05-251-1/+9
| | | | Notes: svn path=/head/; revision=192738
* If interface is not UP, don't return media status.Pyun YongHyeon2009-05-251-0/+4
| | | | Notes: svn path=/head/; revision=192737
* Add device ids for Yukon FE+(88E8040, 88E8040T, 88E8048 and 88E8070).Pyun YongHyeon2009-05-252-1/+13
| | | | Notes: svn path=/head/; revision=192736
* Add workaround for Yukon FE+ A0. This controller is known to havePyun YongHyeon2009-05-252-11/+52
| | | | | | | | | | | | | | | | | | | | 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 ) Notes: svn path=/head/; revision=192735
* Add preliminary Yukon FE+ support and register definitions.Pyun YongHyeon2009-05-252-4/+20
| | | | | | | | | | | | | | | | | 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=/head/; revision=192734
* Explicitly reset GMAC Controls and initialize GM_GP_CTRL register.Pyun YongHyeon2009-05-251-10/+8
| | | | | | | | | | 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=/head/; revision=192731
* Disable HW WOL for Yukon EC Ultra. While I'm here use switchPyun YongHyeon2009-05-251-11/+15
| | | | | | | | statement over if-else statement. This change will make it easy to add newer Yukon controllers. Notes: svn path=/head/; revision=192728
* Explicitly check resolved speed/duplex. Just checking IFM_ACTIVEPyun YongHyeon2009-05-251-8/+24
| | | | | | | | | | | 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. Notes: svn path=/head/; revision=192727
* Add support for newer descriptor format. This format is used onPyun YongHyeon2009-05-252-12/+29
| | | | | | | Yukon FE+, Yukon Extreme and Yukon Supreme. Notes: svn path=/head/; revision=192726
* Oops, add missing ~ operator.Pyun YongHyeon2009-05-251-1/+1
| | | | Notes: svn path=/head/; revision=192725
* Caller already hold a driver lock in mii callback, assert it.Pyun YongHyeon2009-05-251-1/+1
| | | | Notes: svn path=/head/; revision=192724
* Rather than checking every chip revision, introduce more flags toPyun YongHyeon2009-05-252-29/+33
| | | | | | | | | | | | | | | 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). Notes: svn path=/head/; revision=192723
* Correctly return the result of mii_mediachg(). Previously it alwaysPyun YongHyeon2009-05-251-2/+3
| | | | | | | used to return success. Notes: svn path=/head/; revision=192720
* Use bit definition to represent MSI and detach state instead ofPyun YongHyeon2009-05-252-6/+6
| | | | | | | using separate variables in softc. Notes: svn path=/head/; revision=192719
* Use bit definition to represent link state, device suspend insteadPyun YongHyeon2009-05-252-13/+15
| | | | | | | of using separate variables in softc. Notes: svn path=/head/; revision=192718