Commit Graph

2596 Commits

Author SHA1 Message Date
Nick Hibma
c175c7deff Add the switch config for the XS Stick.
It speaks AT commands on 2 out of 3 serial ports, but it has not been
verified to work at all speaking PPP yet.
2010-11-13 20:45:16 +00:00
Hans Petter Selasky
876cab6fc2 Fix compiler warnings.
Submitted by:	Alexander Best (arundel)
Approved by:	thompsa (mentor)
2010-11-13 19:26:45 +00:00
Nick Hibma
0ea0127a4d Add a man page for usb_quirk module, plus references in other man pages,
and updated comments in the usb_quirk.h header file.

The main purpose of this is to expose the quirks for ejecting 3G
modules. usb_modeswitch in Linux does a great job of collecting
information on these, and with the quirks module people can try out the
modeswitch config file entries on FreeBSD, hence the SCSI strings in the
man page.

MFC after:	2 weeks
2010-11-10 23:45:44 +00:00
Nick Hibma
e7702e9e1b Allow specification of eject method through quirks, so people can test
drive eject methods before supplying patches.
2010-11-10 18:41:38 +00:00
Nick Hibma
96a6480a53 Bugfix: Set the bit that marks a device number in use.
This would cause a panic when disconnecting the second serial device.

Submitted by:	Lucius Windschuh
2010-11-07 15:36:07 +00:00
Bernhard Schmidt
a7c6aabdc3 Instead of using the AMRR ratectl algo as default for drivers which have
the IEEE80211_C_RATECTL flag set, default to NONE for all drivers. Only if
a driver calls ieee80211_ratectl_init() check if the NONE algo is still
selected and try to use AMRR in that case. Drivers are still free to use
any other algo by calling ieee80211_ratectl_set() prior to the
ieee80211_ratectl_init() call.

After this change it is now safe to assume that a ratectl algo is always
available and selected, which renders the IEEE80211_C_RATECTL flag pretty
much useless. Therefore revert r211314 and 211546.

Reviewed by:	rpaulo
MFC after:	2 weeks
2010-11-06 18:17:20 +00:00
Nick Hibma
b38fd2d93c Bugfix: In rev 213509 Alexander committed a duplicate ID for ZTE STOR
based devices (QUALCOMMINC 0x2000). He made it use SCSI eject instead of
ZTE STOR eject. This prevented my ZTE MF626 dongle from switching.

- Apply both eject methods for ZTE STOR based devices. Works on my as
  well as mav's device.
- Remove the duplicate.
- Sort the usbdevs entries for Qualcomm so this won't happen again.
- Add bootverbose message displaying the fact that we are ejecting (and
  how).

Reviewed by:	mav
MFC after:	2 weeks
2010-11-05 21:17:55 +00:00
Nick Hibma
6416c259d4 Implement ucom_set_pnpinfo_usb() providing ttyname and port number
information through devd. My E220 now produces the notification (1 line):

	+u3g0 at bus=1 hubaddr=1 port=0 devaddr=2 interface=0 \
	vendor=0x12d1 product=0x1003 devclass=0x00 devsubclass=0x00 \
	sernum="" release=0x0000 intclass=0xff intsubclass=0xff \
	ttyname=U0 ttyports=2 on uhub0

Note: serial/ufoma and net/uhso still provide port number and tty name
(uhso only) information through sysctls, which should now be removed.

Reviewed by:	hpselasky
2010-11-05 19:12:48 +00:00
Nick Hibma
761481dc63 - Remove an unused entry from the softc (only used in a debugging printf).
- Fix the loop count on detach (causing a panic on detaching a serial
  dongle).
- Increase a buffer in case some driver want extra long tty device names
  (postfixing the purpose of the tty for example, e.g. u3g.ppp).
2010-11-05 09:06:23 +00:00
Nick Hibma
0834ed4757 Bugfix: Move the 'at <location string' to the beginning of the attach
notification. devd would stop evaluating at 'at' (not '<k>=<v>') and
hence prevent 'port=X' (and 'bus=<"on" string>) from making it into the
environment for the devd action.

Reviewed by:	hselasky
MFC after:	2 weeks
2010-11-05 08:30:16 +00:00
Nick Hibma
6df3eebb63 Don't terminate the notification with \n. This is done in
usb_device.c:devctl_notify_f().
2010-11-04 21:06:36 +00:00
Hans Petter Selasky
cbb75751a7 Add code to warm reset a USB 3.0 port.
Approved by:	thompsa (mentor)
2010-11-04 19:24:21 +00:00
Hans Petter Selasky
d74698ca2e Add new USB quirk.
Submitted by:	Dmitry Luhtionov
Approved by:	thompsa (mentor)
2010-11-04 19:05:35 +00:00
Nick Hibma
015bb88ff2 - Simplify the way unit/subunit allocation is done in ucom.
- hw.usb.ucom.cons_unit is now split into
  hw.usb.ucom.cons_unit/...cons_subunit.

Note: The tunable/sysctl hw.usb.ucom.cons_unit needs to be reviewed if

a) a console was defined a USB serial devices, and a USB device with
more than 1 subunit is present, and this device is attached before the
device functioning as a console

or

b) a console was defined on a USB device with more than 1 subunit

Reviewed by:	hps
MFC after:	2 weeks
2010-11-03 21:50:49 +00:00
Hans Petter Selasky
8908d48d82 Clean up leftover USB device ID after r213856. This fixes:
options USB_VERBOSE

Submitted by:	Lucius Windschuh
Approved by:	thompsa (mentor)
2010-11-03 07:51:33 +00:00
Hans Petter Selasky
8427ed847d Add support for setting per-interface PnP information.
Submitted by:	Nick Hibma
Approved by:	thompsa (mentor)
2010-10-27 17:38:05 +00:00
Nathan Whitehorn
495ed64c16 The EHCI_CAPLENGTH and EHCI_HCIVERSION registers are actually sub-registers
within the first 4 bytes of the EHCI memory space. For controllers that
use big-endian MMIO, reading them with 1- and 2-byte reads would then
return the wrong values. Instead, read the combined register with a 4-byte
read and mask out the interesting quantities.
2010-10-25 15:51:43 +00:00
Hans Petter Selasky
8bb77249db Add possibility to generate devctl notifications regardless of UGEN presence.
Submitted by:  Nick Hibma
Approved by:    thompsa (mentor)
2010-10-22 20:13:45 +00:00
Alexander Motin
0aa99d33b5 Allow umass to use bigger transactions for USB 3.0 devices. It is less
important for USB 2.0 devices and some of them reported to have problems
with large transactions. But USB 3.0 benchmarks show that limited number
of transactions per second on USB makes impossible to reach high transfer
speeds without using bigger transactions.

On my tests this change allows to read up to 220MB/s from USB-attached SSD
(at block size of 256-512KB), comparing to only 113MB/s without it.

Reviewed by:	hselasky
2010-10-16 19:29:37 +00:00
Marius Strobl
d6c65d276e Converted the remainder of the NIC drivers to use the mii_attach()
introduced in r213878 instead of mii_phy_probe(). Unlike r213893 these
are only straight forward conversions though.

Reviewed by:	yongari
2010-10-15 15:00:30 +00:00
Hans Petter Selasky
e11ad60db2 Add new USB device IDs to the list of supported devices.
PR:	usb/151043
Approved by:    thompsa (mentor)
2010-10-14 22:14:55 +00:00
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
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
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
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
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
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
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
Ed Maste
2c7dee3bf5 In r207768 I silenced a console warning from rum(4). There was legitimate
opposition to the change, since really we need to implement missing
functionality in drivers or the 802.3 layer.

For now, restore a reminder message for a missing rum_update_mcast, but
print it only once.
2010-10-08 01:03:30 +00:00
Alexander Motin
7be95fbbf9 Add ID for Vodafone (ZTE) Mobile Broadband K3565-Z modem.
Reviewed by:	hselasky
2010-10-07 09:07:48 +00:00
Gleb Smirnoff
a4cd76e4a2 Remove extra assignment. 2010-10-06 14:29:50 +00:00
Gleb Smirnoff
fb7a4d496b Add support to Alcatel/TCTMobile X080S USB 3G modem. The device needs
special eject command to reappear as modem. It also requires DIR_IN flag
in the command message, so we supply some dummy data along with the command.

Feedback from X080S owners appreciated. I have not a pure Alcatel/TCTMobile
device, but another one under "Svyaznoy" (Связной) brand, and I didn't yet
managed to get it working. It is successfully recognized, it responds to
AT commands, but it shuts up right after successfull CONNECT response.

Reviewed by:	hps
2010-10-06 14:29:00 +00:00
Hans Petter Selasky
c791ca5046 Print out correct USB connection speed for USB 3.0 mass storage devices.
Approved by:    thompsa (mentor)
2010-10-04 23:30:44 +00:00
Pyun YongHyeon
ad05f0993c RX buffer allocation failure is not an input error. Controller
successfully received a frame but we failed to pass it to upper
stack due to lack of resources. So update if_iqdrops counter
instead of updating if_ierrors counter.
2010-10-04 23:25:38 +00:00
Pyun YongHyeon
402215616a Don't count input error twice. uether_rxbuf() already updated that
counter.
2010-10-04 23:19:31 +00:00
Hans Petter Selasky
963169b4af This commit adds full support for USB 3.0 devices in host and device
mode in the USB core.  The patch mostly consists of updating the USB
HUB code to support USB 3.0 HUBs. This patch also add some more USB
controller methods to support more active-alike USB controllers like
the XHCI which needs to be informed about various device state events.

USB 3.0 HUBs are not tested yet, due to lack of hardware, but are
believed to work.

After this update the initial device descriptor is only read twice
when we know that the bMaxPacketSize is too small for a single packet
transfer of this descriptor.

Approved by:    thompsa (mentor)
2010-10-04 23:18:05 +00:00
Hans Petter Selasky
2ecb4e919f Add missing #if's
Approved by:    thompsa (mentor)
2010-10-04 22:50:08 +00:00
Hans Petter Selasky
b64cf89faf Add more strict USB string filtering.
Approved by:    thompsa (mentor)
2010-10-04 22:45:17 +00:00
Hans Petter Selasky
8f9750b7fd Serialise USB re-enumeration with the USB explore thread.
This patch can solve problems when multiple USB devices are
re-enumerated at the same time on the same bus.

Approved by:    thompsa (mentor)
2010-10-04 22:21:30 +00:00
Hans Petter Selasky
ce4092bda4 Correct IOCTL return code.
Approved by:    thompsa (mentor)
2010-10-04 22:04:22 +00:00