Commit Graph

77 Commits

Author SHA1 Message Date
Pyun YongHyeon
76202a1601 Add preliminary Yukon Ultra 2 support(88E8057). The controller
looks very similar to Yukon EC Ultra.

Tested by:	 kalin m ( kalin <> el dot net )
2009-11-07 01:14:09 +00:00
John Baldwin
f802264db1 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.

(Missed this driver in the earlier commit.)
2009-11-06 20:07:16 +00:00
Pyun YongHyeon
ff08021657 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).
2009-11-06 18:51:05 +00:00
Pyun YongHyeon
56964c4c9f Remove unnecessary header file. 2009-11-06 18:36:09 +00:00
Ulf Lilleengen
0e0ed74fcc - Add support for Marvell Yukon 88E8042 device.
Submitted by:	Mario Lobo <mlobo -at- digiart.art.br>
Approved by:	yongari
2009-10-25 21:46:38 +00:00
Pyun YongHyeon
60d3251abb 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.
2009-09-28 21:11:31 +00:00
Pyun YongHyeon
cde64af338 Add workaround for Yukon XL which has hardware bug that can't flush
FIFO.
2009-09-28 21:07:19 +00:00
Pyun YongHyeon
fcb62a8b01 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.
2009-09-28 21:03:28 +00:00
Pyun YongHyeon
40d7192b1c Fix MIB statistics clear routine. This should fix alignment errors on sparc64.
Reported by:	Garrett Damore < gdamore <> opensolaris dot org >
2009-09-28 20:03:37 +00:00
Poul-Henning Kamp
6778431478 Revert previous commit and add myself to the list of people who should
know better than to commit with a cat in the area.
2009-09-08 13:19:05 +00:00
Poul-Henning Kamp
b34421bf9c Add necessary include. 2009-09-08 13:16:55 +00:00
Robert Watson
eb956cd041 Use if_maddr_rlock()/if_maddr_runlock() rather than IF_ADDR_LOCK()/
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
2009-06-26 11:45:06 +00:00
Pyun YongHyeon
a56fe1f085 Add Yukon Extreme device ids, 88E8071 and 88E8072.
While I'm here correct description of 88E8070. 88E8070 is Yukon
Extreme and have gigabit PHY.
2009-06-02 05:08:57 +00:00
Pyun YongHyeon
efb74172a5 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.
2009-06-02 04:59:29 +00:00
Pyun YongHyeon
ebb25bfab5 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 )
2009-06-02 04:35:44 +00:00
Pyun YongHyeon
daf292270b 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 )
2009-06-02 04:00:17 +00:00
Pyun YongHyeon
f972d4c6fb Correct controller description for 88E8035, 88E8036, 88E8038 and
88E8039. These are fast ethernet controllers.
2009-05-25 08:26:39 +00:00
Pyun YongHyeon
b7e1e144e9 Simplify SIOCSIFFLAGS handler. 2009-05-25 08:02:05 +00:00
Pyun YongHyeon
98e02aebef Be consistent with other capability checking. 2009-05-25 07:59:30 +00:00
Pyun YongHyeon
89e2266651 Don't reinitialize controller when interface is already running. 2009-05-25 07:56:14 +00:00
Pyun YongHyeon
6f5a0d1f39 If interface is not UP, don't return media status. 2009-05-25 07:50:14 +00:00
Pyun YongHyeon
1290998502 Add device ids for Yukon FE+(88E8040, 88E8040T, 88E8048 and 88E8070). 2009-05-25 07:48:00 +00:00
Pyun YongHyeon
224003b7ba 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 )
2009-05-25 07:31:18 +00:00
Pyun YongHyeon
61708f4cb2 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 )
2009-05-25 07:06:10 +00:00
Pyun YongHyeon
e6e23ffecb 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.
2009-05-25 06:39:48 +00:00
Pyun YongHyeon
846e6d79e5 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.
2009-05-25 06:29:02 +00:00
Pyun YongHyeon
6c4d62e1d6 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.
2009-05-25 06:19:36 +00:00
Pyun YongHyeon
262e9dcf36 Add support for newer descriptor format. This format is used on
Yukon FE+, Yukon Extreme and Yukon Supreme.
2009-05-25 06:09:18 +00:00
Pyun YongHyeon
40d6bed8a7 Oops, add missing ~ operator. 2009-05-25 04:27:12 +00:00
Pyun YongHyeon
4b76fe63d9 Caller already hold a driver lock in mii callback, assert it. 2009-05-25 04:25:08 +00:00
Pyun YongHyeon
e2b166039a 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).
2009-05-25 04:22:27 +00:00
Pyun YongHyeon
325c534e4a Correctly return the result of mii_mediachg(). Previously it always
used to return success.
2009-05-25 03:53:12 +00:00
Pyun YongHyeon
7a76e8a489 Use bit definition to represent MSI and detach state instead of
using separate variables in softc.
2009-05-25 03:49:43 +00:00
Pyun YongHyeon
ab7df1e420 Use bit definition to represent link state, device suspend instead
of using separate variables in softc.
2009-05-25 03:42:33 +00:00
Pyun YongHyeon
19585f4549 Remove link handling taskqueue and use mii callback directly. While
I'm here also checks driver running state.
2009-05-25 03:24:47 +00:00
Pyun YongHyeon
79dd979a7d Fix typo. 2009-03-25 07:05:23 +00:00
Pyun YongHyeon
6d6588a152 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.
2009-03-23 05:46:28 +00:00
Pyun YongHyeon
3a91ee716b 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).
2009-01-16 08:06:55 +00:00
Pyun YongHyeon
85b340cb24 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.
2009-01-14 05:08:52 +00:00
Pyun YongHyeon
f9ad2b2f3c Correct frame length argument of in_cksum_skip. While I'm here
remove intermediate variable csum.

Reported by:	Kim Culhan < w8hdkim <> gmail DOT com >
Tested by:	Kim Culhan < w8hdkim <> gmail DOT com >
2009-01-14 04:47:04 +00:00
Pyun YongHyeon
e48163252e Save the value read from TX queue CSR, so we don't test against a
stale one.

Submitted by:	sephe
2008-11-24 02:21:50 +00:00
Pyun YongHyeon
ad415775a1 If mbuf is not writable get a writable copy before invoking
m_pullup(9).

Tested by:	Garrett Cooper < yanefbsd <at> gmail dot com >
2008-09-30 04:52:30 +00:00
Pyun YongHyeon
925da971b8 Always pullup mbuf prior to accessing TCP header.
This should fix occasional Tx checksum corruption issue.

Reported by:	Garrett Cooper < yanefbsd <at> gmail dot com >
Tested by:	Garrett Cooper < yanefbsd <at> gmail dot com >
2008-09-30 04:47:49 +00:00
Pyun YongHyeon
83c04c93b6 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.

Reported by:	Ian Freislich (ianf <at> clue dot co dot za), das
Tested by:	Ian Freislich (ianf <at> clue dot co dot za)
2008-09-25 07:31:45 +00:00
Pyun YongHyeon
2b71cf8696 Move comments block 1 line up to remark on the setting
if_capabilities. This would make comments clear.

Suggested by:	yar
2008-03-11 02:39:52 +00:00
Pyun YongHyeon
06ff094490 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.

Reported by:	Christopher Cowart < ccowart AT rescomp DOT berkeley DOT edu >
Tested by:	Christopher Cowart < ccowart AT rescomp DOT berkeley DOT edu >
MFC after:	5 days
2008-03-07 04:55:58 +00:00
Pyun YongHyeon
d5d601648c 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.

Reported by:	das, Kirill Nuzhdin < kirill.nuzhdin AT rad dot chem dot msu dot ru >
Tested by:	das, Kirill Nuzhdin
2008-02-29 03:38:12 +00:00
Poul-Henning Kamp
cf827063a9 Give MEXTADD() another argument to make both void pointers to the
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.
2008-02-01 19:36:27 +00:00
John Baldwin
304a4c6fb1 - 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().
2008-01-17 23:37:47 +00:00
Remko Lodder
28d34c0e95 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
2007-12-05 09:41:58 +00:00