Commit Graph

19120 Commits

Author SHA1 Message Date
Joel Dahl
f2907a755d Separate comments from the license text. 2009-05-27 18:13:15 +00:00
Andrew Thompson
f72c0c2e5c Remove empty dir. 2009-05-27 16:44:43 +00:00
Andrew Thompson
84c5da4c4e move ng_ubt_var.h back to its original place 2009-05-27 16:34:08 +00:00
Andrew Thompson
3671d9d810 move ng_ubt.c back to its original place 2009-05-27 16:33:08 +00:00
Andrew Thompson
d434bfe44a move ubtbcmfw.c back to its original place 2009-05-27 16:32:05 +00:00
Stacey Son
2f98b86b92 Change from using vm_map_delete() to vm_map_remove().
Approved by:	gnn (mentor)
Obtained from:	kib
2009-05-27 16:20:46 +00:00
Adrian Chadd
d76e4550e9 Clear IFF_DRV_OACTIVE if at least one TX xen/mbuf ring slot has been freed. 2009-05-27 13:59:17 +00:00
Adrian Chadd
7c66482c29 Enforce that there are actually enough xenbus TX ring descriptors available
before attempting to queue the packet.
2009-05-27 06:04:38 +00:00
Adrian Chadd
3fb28bbb67 Comment tidyup; comment where the next explicit check should
appear.
2009-05-27 05:37:04 +00:00
Weongyo Jeong
f58ca84122 ports urtw(4) for USB2. Additionally it supports a 8187B chipset weakly
that it needs more stabilization.
2009-05-27 03:57:38 +00:00
Adrian Chadd
a4ec37f59e Ensure that there are enough TX mbuf ring slots available before beginning
to dequeue a packet.

The tx path was trying to ensure that enough Xenbus TX ring slots existed but
it didn't check to see whether the mbuf TX ring slots were also available.
They get freed in xn_txeof() which occurs after transmission, rather than earlier
on in the process. (The same happens under Linux too.)

Due to whatever reason (CPU use, scheduling, memory constraints, whatever) the
mbuf TX ring may not have enough slots free and would allocate slot 0. This is
used as the freelist head pointer to represent "free" mbuf TX ring slots; setting
this to an actual mbuf value rather than an id crashes the code.

This commit introduces some basic code to track the TX mbuf ring use and then
(hopefully!) ensures that enough slots are free in said TX mbuf ring before it
enters the actual work loop.

A few notes:

* Similar logic needs to be introduced to check there are enough actual slots
  available in the xenbuf TX ring. There's some logic which is invoked earlier
  but it doesn't hard-check against the number of available ring slots.
  Its trivial to do; I'll do it in a subsequent commit.

* As I've now commented in the source, it is likely possible to deadlock the
  driver under certain conditions where the rings aren't receiving any changes
  (which I should enumerate) and thus Xen doesn't send any further software
  interrupts. I need to make sure that the timer(s) are running right and
  the queues are periodically kicked.

PR:		134926
2009-05-27 02:49:08 +00:00
Adrian Chadd
2d8fae9867 Do the invariant check before the mbuf is dereferenced. 2009-05-27 01:56:37 +00:00
Adrian Chadd
c099cafa14 Flesh out some inline documentation which hopefully reflect the intended
reality of these functions.
2009-05-27 01:54:26 +00:00
Adrian Chadd
0e6993e4a7 Add in some INVARIANT checks in the TX mbuf descriptor "freelist" management code.
Slot 0 must always remain "free" and be a pointer to the first free entry in the
mbuf descriptor list. It is thus an error to have code allocate or push slot 0
back into the list.
2009-05-27 01:45:23 +00:00
Stacey Son
00a5db46de Add the ksyms(4) pseudo driver. The ksyms driver allows a process to
get a quick snapshot of the kernel's symbol table including the symbols
from any loaded modules (the symbols are all merged into one symbol
table).  Unlike like other implementations, this ksyms driver maps
memory in the process memory space to store the snapshot at the time
/dev/ksyms is opened.  It also checks to see if the process has already
a snapshot open and won't allow it to open /dev/ksyms it again until it
closes first.  This prevents kernel and process memory from being
exhausted.  Note that /dev/ksyms is used by the lockstat(1) command.

Reviewed by:	gallatin kib (freebsd-arch)
Approved by:	gnn (mentor)
2009-05-26 21:39:09 +00:00
Andrew Thompson
3e8739762f Unifdef __NetBSD__ here, the usb stack as a whole doesnt support NetBSD and it
obsfucates the code.
2009-05-26 21:20:42 +00:00
Andrew Thompson
2b85e080e3 Do not forcefully close the write transfer when closing the tty, it needs to
run to completion and drain the tty queue.
2009-05-26 17:06:36 +00:00
Ed Schouten
927a7c4ffb Unbreak bktr(4). 2009-05-26 12:01:37 +00:00
Benjamin Close
92e839c638 Free the memory correctly in the error case
Submitted by:	frtzkatz at yahoo.com
Approved by:	sam
MFC after:	1 month
2009-05-26 03:56:56 +00:00
Mark Murray
84e17f8297 There is rubbish here
It is time to take it out
Now it is cleaner
2009-05-25 22:50:11 +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
745ef56af2 Add driver support for 88E3016 PHY which is found on Marvell Yukon
FE+ controller. Due to the severe silicon bugs for Yukon FE+,
88E3016 seems to require more workarounds. However I'm not sure
whether the workaround is PHY specific or only applicable to Yukon
FE+. The datasheet for the PHY is publicly available but it lacks
several details for the workaround used in this change. The
workaround information was obtained from Linux. Many thanks to
Yukon FE+ users who helped me add 88E3016 support.

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 02:36:29 +00:00
Pyun YongHyeon
2c56cee9e4 Do not ignore NEXT Page capability of auto-negotiation
advertisement register. Some PHYs such as 88E3016 requires NEXT
Page capability to establish valid link. Also set protocol selector
field which is read only but it makes the intention clearer.
2009-05-25 02:05:00 +00:00
Pyun YongHyeon
c404d8f55a Don't read unnecessary PHY registers. Speed/duplex resolution bit
is valid only for auto-negotiation case so check the bit if we know
auto-negotiation is active. While I'm here explicitly checks
current speed with speed mask and set IFM_NONE if resolved speed
is unknown.
2009-05-25 01:56:19 +00:00
Pyun YongHyeon
5536a3c5bb Report current link state while auto-negotiation is in progress. 2009-05-25 01:45:28 +00:00
Pyun YongHyeon
f98d7df237 Use mii_phy_add_media() and remove usage of local macro ADD. Also
checks extended status register to see whether the PHY is fast
ethernet or not. This removes a lot of checks for specific PHY
models and it makes easy to add more PHYs to e1000phy(4).

While I'm here remove setting mii_anegticks as it is set with
mii_phy_add_media().
2009-05-25 01:41:05 +00:00
Pyun YongHyeon
767fb36c3a NVIDIA MCP controllers have no Rx buffer alignment restrictions.
Remove PAGE_SIZE alignment used in Rx buffer DMA tag creation. The
alignment restriction was used in old local jumbo allocator and
nfe(4) switched to UMA backed page allocator for jumbo frame.

This change should fix jumbo buffer allocation failure.

Reported by:	Pascal Braun ( pascal.braun <> continum dot net )
2009-05-25 00:56:01 +00:00
George V. Neville-Neil
7529967798 Partial reversion of previous commit. The CXGB_SHUTDOWN flag does NOT
need to be inverted when doing an ifconfig down of an interface.

Pointed out by:	Navdeep Parhar
MFC after: 1 week
2009-05-22 18:26:47 +00:00
George V. Neville-Neil
c2009a4c90 Fix a possible panic cxgb_controller_attach() routine that would occur
only if prepping the adapter failed.

Slight adjustment to comments.

Fix a bug whereby downing the interface didn't preven it from
processing packets.

Submitted by:	Navdeep Parhar
MFC after:	1 week
2009-05-22 15:06:03 +00:00
Andrew Thompson
fe45987e99 Don't clear last usage when a new HID item is found, it improves parsing of
Apple keyboard HID descriptors.

Submitted by:	Hans Petter Selasky
2009-05-21 17:55:18 +00:00
Andrew Thompson
a688f49162 Remove README.TXT as the info is in usb(4). 2009-05-21 17:48:41 +00:00
Andrew Thompson
df05202dd5 Add Sharp WILLCOM03 ipaq and Option GTHSDPA 3g device ids.
Submitted by:	Hans Petter Selasky
2009-05-21 17:47:27 +00:00