Commit Graph

21200 Commits

Author SHA1 Message Date
Hans Petter Selasky
f3aa3ca3d8 - Add more USB devices to usbdevs and rename some previously unknown ones.
- Add more USB mass storage quirks.

Submitted by: Dmitry Luhtionov
PR: usb/149934, usb/143045
Approved by:    thompsa (mentor)
2010-10-14 22:06:52 +00:00
Marius Strobl
a55fb8a458 Add a NetBSD-compatible mii_attach(), which is intended to eventually
replace mii_phy_probe() altogether. Compared to the latter the advantages
of mii_attach() are:
- intended to be called multiple times in order to attach PHYs in multiple
  passes (f.e. in order to only use sub-ranges of the 0 to MII_NPHY - 1
  range)
- being able to pass along the capability mask from the NIC to the PHY
  drivers
- being able to specify at which address (phyloc) to probe for a PHY
  (instead of always probing at all addresses from 0 to MII_NPHY - 1)
- being able to specify which PHY instance (offloc) to attach
- being able to pass along MIIF_* flags from the NIC to the PHY drivers
  (f.e. as required to indicated to the PHY drivers that flow control is
  supported by the NIC driver, which actually is the motivation for this
  change).

While at it, I used the opportunity to get rid of some hacks in mii(4)
like miibus_probe() generally doing work besides sheer probing and the
"EVIL HACK" (which will vanish entirely along with mii_phy_probe()) by
passing the struct ifnet pointer via an argument of mii_attach() as well
as to fix some resource leaks in mii(4) in case something fails.
Commits which will update the PHY drivers to honor the MII flags passed
down from the NIC drivers and take advantage of mii_attach() to get rid
of certain types of hacks in NIC and PHY drivers as well as a conversion
of the remaining uses of mii_phy_probe() will follow shortly.

Reviewed by:	jhb, yongari
Obtained from:	NetBSD (partially)
2010-10-14 22:01:40 +00:00
Hans Petter Selasky
e781dd4fbb Add more USB device IDs to supported list of devices.
Submitted by:	Nick Hibma
PR:	usb/149900
Approved by:    thompsa (mentor)
2010-10-14 21:53:42 +00:00
Hans Petter Selasky
7ee713e89e Fix forwarding of Line Register Status changes to TTY layer.
PR: usb/149675
Approved by:    thompsa (mentor)
2010-10-14 21:45:41 +00:00
Hans Petter Selasky
f7d8cf85e3 Remove unused EHCI register definition.
Define reserved EHCI register.

Approved by:    thompsa (mentor)
2010-10-14 21:41:08 +00:00
Hans Petter Selasky
53e0bf6e70 Revert most of r197682 (EHCI Hardware BUG workaround). Implement
proper solution which is to not use the TERMINATE pointer, but rather
link to a halted TD. The initial fix was due to a misunderstanding
about how the EHCI hardware works. Thanks to Alan Stern for clearing
this up. This patch can increase mass storage read performance
significantly when the IRQ rate is less than 8000 IRQ/s.

Approved by:    thompsa (mentor)
2010-10-14 21:38:06 +00:00
Marius Strobl
4d0056a865 Just like xmphy(4) this driver doesn't use any of the generic subroutines
so there's no need to fill mii_{ext,}capabilities either.
2010-10-14 21:30:13 +00:00
Hans Petter Selasky
59c9250333 Avoid using endless retransmission at EHCI hardware level, hence this hide
errors from the applications. Only use endless retransmission while in the
non-addressed state on a High-Speed device.

Approved by:    thompsa (mentor)
2010-10-14 21:26:06 +00:00
Hans Petter Selasky
1678e1358b Correct EHCI root HUB interface descriptor.
Approved by:    thompsa (mentor)
2010-10-14 21:18:18 +00:00
Hans Petter Selasky
b494261c69 Correct EHCI port register read.
Approved by:    thompsa (mentor)
2010-10-14 21:14:33 +00:00
Hans Petter Selasky
6001d01180 - Add more USB devices to usbdevs and rename some previously unknown ones.
- Add more USB mass storage quirks.

Submitted by: Dmitry Luhtionov
PR: usb/149934, usb/143045
Approved by:    thompsa (mentor)
2010-10-14 21:09:37 +00:00
Hans Petter Selasky
51fd3d75fe - Add support for LibUSB in 32-bit compatibility mode.
Approved by:    thompsa (mentor)
2010-10-14 20:38:18 +00:00
Rui Paulo
ea7303d127 Revert r213765. This is required because our build infrastructure uses
the host lex instead of the lex built during buildworld. I will MFC the
lex changes soon and in a few weeks this I'll commit again r213765.
2010-10-14 19:19:19 +00:00
Pyun YongHyeon
96486faa6e Make sure to not use stale ip/tcp header pointers. The ip/tcp
header parser uses m_pullup(9) to get access to mbuf chain.
m_pullup(9) can allocate new mbuf chain and free old one if the
space left in the mbuf chain is not enough to hold requested
contiguous bytes. Previously drivers can use stale ip/tcp header
pointer if m_pullup(9) returned new mbuf chain.

Reported by:	Andrew Boyer (aboyer <> averesystems dot com)
MFC after:	10 days
2010-10-14 18:31:40 +00:00
Pyun YongHyeon
cb2f3e7f9b Backout r204230. TX mbuf parser for VLAN is still required to
enable TX checksum offloading if VLAN hardware tagging is disabled.
2010-10-14 17:57:52 +00:00
Pyun YongHyeon
39d76ed635 It seems some multi-port dc(4) controllers shares SROM of the first
port such that reading station address from second port always
returned 0xFF:0xFF:0xFF:0xFF:0xFF:0xFF Unfortunately it seems there
is no easy way to know whether SROM is shared or not. Workaround
the issue by traversing dc(4) device list and see whether we're
using second port and use station address of controller 0 as base
station address of second port.

PR:		kern/79262
MFC after:	2 weeks
2010-10-14 17:22:38 +00:00
Matthew D Fleming
3f237b0b0c Support firmware download. 2010-10-14 16:44:44 +00:00
Matthew D Fleming
13ac67a784 Re-work the internals of adding items to the driver's scatter-gather
list.  Use the new internals to simplify adding transaction context
elements, and in future diffs, more complicated SGLs.
2010-10-14 16:44:05 +00:00
Pyun YongHyeon
7ed3f0f0e8 Fix a regression introduced in r213710. r213710 removed the use of
auto polling such that it made all controllers obtain link status
information from the state of the LNKRDY input signal. Broadcom
recommends disabling auto polling such that driver should rely on
PHY interrupts for link status change indications. Unfortunately it
seems some controllers(BCM5703, BCM5704 and BCM5705) have PHY
related issues so Linux took other approach to workaround it.
bge(4) didn't follow that and it used to enable auto polling to
workaround it. Restore this old behavior for BCM5700 family
controllers and BCM5705 to use auto polling. For BCM5700 and
BCM5701, it seems it does not need to enable auto polling but I
restored it for safety.
Special thanks to marius who tried lots of patches with patience.

Reported by:	marius
Tested by:	marius
2010-10-13 22:29:48 +00:00
Hans Petter Selasky
7e05daae8f USB network (NCM driver):
- correct the ethernet payload remainder which
must be post-offseted by -14 bytes instead of
0 bytes. This is not very clearly defined in the
NCM specification.
- add development feature about limiting the
maximum datagram count in each NCM payload.
- zero-pad alignment data
- add TX-interval tuning sysctl

Approved by:    thompsa (mentor)
2010-10-13 22:04:55 +00:00
Pyun YongHyeon
d4f5240abd Add more checks for resolved link speed in bge_miibus_statchg().
Link UP state could be reported first before actual completion of
auto-negotiation. This change makes bge(4) reprogram BGE_MAC_MODE,
BGE_TX_MODE and BGE_RX_MODE register only after controller got a
valid link.
2010-10-13 21:53:37 +00:00
Hans Petter Selasky
d751769d2c USB Network:
- Add new driver for iPhone tethering
- Supports the iPhone 3G/3GS/4G ethernet protocol

Approved by:    thompsa (mentor)
2010-10-13 21:36:42 +00:00
Hans Petter Selasky
fb78ea8bd1 USB WLAN:
- Add new device ID

PR:	usb/150989
Approved by:    thompsa (mentor)
2010-10-13 20:56:54 +00:00
Hans Petter Selasky
d58bfbb688 USB network (UHSO):
- Correct network interface flags.

PR:	usb/149039
Submitted by:	Fredrik Lindberg
Approved by:    thompsa (mentor)
2010-10-13 20:51:06 +00:00
Hans Petter Selasky
3b6f59eeaa Correct some root HUB descriptor fields in multiple controller drivers.
Remove an unused structure.

Approved by:    thompsa (mentor)
2010-10-13 20:37:19 +00:00
Rui Paulo
3065282fdb Revert r213793. 2010-10-13 17:38:23 +00:00
Rui Paulo
eab0cdc504 Don't do a logical AND of the result of strcmp() with a constant.
Found with:	clang
2010-10-13 17:17:50 +00:00
Jung-uk Kim
1debbf5d79 Clean up unused headers. 2010-10-13 17:06:25 +00:00
Jung-uk Kim
e41724b279 Remove acpi_bus_number() completely. It had to be removed in r212761.
Pointed out by:	jhb
2010-10-13 16:30:41 +00:00
Rui Paulo
30aa84b727 Pass a format string to make_dev(). 2010-10-13 14:41:52 +00:00
Rui Paulo
577fedb6b1 Fix a brain-o: wrong case statement semantics.
Found with:	clang
2010-10-13 14:39:54 +00:00
Rui Paulo
a6d8c83fd9 WPA_CSE_WEP104 was being incorrectly checked.
Found with:	clang
2010-10-13 14:37:52 +00:00
Rui Paulo
1d90e6b224 Mark acpi_bus_number() as __unused. This allows clang to this file
without any warnings.
2010-10-13 11:38:24 +00:00
Rui Paulo
cd1fa5bd4d Explicitly tell the compiler that we don't care about the return value
of kbdd_ioctl().
2010-10-13 11:37:12 +00:00
Rui Paulo
c42a2be28f Define YY_NO_INPUT. This makes aicasm buildable by clang with Werror
turned on.
2010-10-13 10:33:01 +00:00
Jung-uk Kim
ac731af567 Use AcpiReset() from ACPICA instead of rolling our own, which is actually
incomplete.  If FADT says the register is available, enable the capability
by default.  Remove the previous default value from acpi(4).
2010-10-13 00:21:53 +00:00
Pyun YongHyeon
a4431eba57 Protect bge(4) from accessing invalid NIC internal memory regions
on BCM5906.

Tested by:	Buganini < buganini <> gmail dot com >
2010-10-12 19:31:25 +00:00
Matthew D Fleming
45b40ad0da Always set cm_complete_data before calling mps_config_complete().
Reviewed by:	ken
2010-10-12 19:24:29 +00:00
Pyun YongHyeon
5e2f96bf69 Fix a regression introduced in r213495. r213495 disabled mini
receive producer ring only for BCM5700. It was believed that
BCM5700 with external SSRAM is the only controller that supports
mini ring but it seems all BCM570[0-4] requires to disable mini
receive producer ring. Otherwise, it caused unexpected RX DMA
error or watchdog timeouts.

Reported by:	marius, Steve Kargl <sgk <> troutmask dot apl dot washington dot edu>
Tested by:	marius, Steve Kargl <sgk <> troutmask dot apl dot washington dot edu>
2010-10-12 19:22:03 +00:00
Andriy Gapon
5ff14fa9b4 acpi_ec: changes in communication with hardware
Short description of the changes:
- attempt to retry some commands for which it is possible (read, query)
- always make a short sleep before checking EC status in polled mode
- periodically poll EC status in interrupt mode
- change logic for detecting broken interrupt delivery and falling back
  to polled mode
- check that EC is ready for input before starting a new command, wait
  if necessary

This commit is based on the original patch by David Naylor.

PR:		kern/150517
Submitted by:	David Naylor <naylor.b.david@gmail.com>
Reviewed by:	jkim
MFC after:	3 weeks
2010-10-12 17:53:01 +00:00
Bernhard Schmidt
40668dc52b Fix monitor mode which is implemented by doing a firmware scan. This
is a port of stable/6, seems like the code got lost during the
background scan changes in r170530.

Pointed out by:	danfe
MFC after:	2 weeks
2010-10-12 16:52:13 +00:00
Joel Dahl
4e33fc946d Small grammar nit in a printf message. 2010-10-12 11:05:32 +00:00
Gleb Smirnoff
19f5434963 We already have dummy receive buffer in sc->buffer.
Suggested by:	hselasky
2010-10-12 09:41:42 +00:00
Pyun YongHyeon
66151edf96 The IFF_DRV_RUNNING flag is set at the end of bge_init_locked. But
before setting the flag, interrupt was already enabled such that
interrupt handler could be run before setting IFF_DRV_RUNNING flag.
This can lose initial link state change interrupt which in turn
make bge(4) think that it still does not have valid link. Fix this
race by protecting the taskqueue with a driver lock.
While I'm here move reenabling interrupt code after handling of link
state chage.

Reviewed by:	davidch
2010-10-11 23:07:12 +00:00
Pyun YongHyeon
6ede2cfa12 Remove one last reference of BGE_MI_MODE register for auto polling.
Previously bge(4) always enabled auto polling for non-BGE_FLAG_TBI
controllers. With this change, auto polling is not used anymore so
polling through mii(4) was introduced.

Reviewed by:	davidch
2010-10-11 22:56:23 +00:00
Matthew D Fleming
d95f15e7aa Re-work the internal user ioctl command table, and support the FW_UPLOAD
command.

Reviewed by:	ken (previous version)
2010-10-11 22:44:15 +00:00
Matthew D Fleming
452909d7d9 Add function prototypes for static functions.
Requested by:	ken
2010-10-11 22:44:05 +00:00
Matthew D Fleming
01095e3bf1 Fix a memory leak and locking inconsistency in mps(4) ioctl handling.
Check copyin(9) for error and sanity check the length before copyin.

Reviewed by:	ken
2010-10-11 21:38:31 +00:00
Matthew D Fleming
5ef9804274 Fix up the COMPAT_FREEBSD32 ioctl logic for mps(4).
Reviewed by:	ken
2010-10-11 21:26:24 +00:00
Pyun YongHyeon
f95779d97e Do not setup interrupt endpoint for axe(4).
It seems axe(4) controllers support interrupt endpoint such that
enabling interrupt endpoint generates about 1000 interrupts/sec.
Controllers transfer 8 bytes data through interrupt endpoint and
the data include link UP/DOWN state as well as some PHY related
information. Previously axe(4) didn't use the transferred data and
didn't even try to read the data. Because axe(4) counts on mii(4)
to detect link state changes there is no need to use interrupt
endpoint here.

This change fixes generation of unnecessary interrupts which was
seen when interface is brought to UP.

No objections from:	hselasky
2010-10-11 19:20:53 +00:00