Commit Graph

2815 Commits

Author SHA1 Message Date
Hans Petter Selasky
0f92e529e1 Add new USB ID.
Approved by:    re (kib)
MFC after:      1 week
PR:		usb/159836
2011-08-20 14:21:32 +00:00
Hans Petter Selasky
9465dbeb5c Add sysctl to not reset the device on clear stall failures, to
temporarily mitigate problems with VMs.

Approved by:    re (kib)
MFC after:      1 week
2011-08-19 09:01:34 +00:00
Hans Petter Selasky
2ffd5fdcc4 Use synchronous device destruction instead of asynchronous, so that a new
device having the same name like a previous one is not created before the old
one is gone. This fixes some panics due to asserts in the devfs code which
were added recently.

Approved by:    re (kib)
MFC after:      1 week
2011-08-11 11:30:21 +00:00
Alexander Motin
477a63a864 Do not block zero report ID. It is correct value for devices with single
ID. This fixes USB_SET_IMMED call (synchronous operation) of the uhid(4)
driver on devices with single report ID.

Reviewed by:	hselasky
Approved by:	re (kib)
MFC after:	1 week
2011-08-09 08:11:26 +00:00
Alexander Motin
7ea00a6866 Make ums(4) driver more picky, not attaching to "mouses" with absolute
coordinates, such as digitizers and touch-screens, leaving these devices
to uhid(4) and user-level. Specially patched xf86-input-mouse driver can
handle them, that isn't done and can't be done properly with ums(4)
because of mouse(4) protocol limitations.

Approved by:	re (kib)
2011-07-29 20:38:06 +00:00
Hans Petter Selasky
14bd1ee52c Add new USB ID to u3g driver.
Approved by:	re (kib)
Submitted by:	Nick Hibma
MFC after:	3 days
2011-07-21 06:55:43 +00:00
Hans Petter Selasky
25abfdf02f Only the USB root HUB thread is allowed to attach and detach drivers
to and from USB devices. Remove related DEVMETHOD() lines from USB
drivers.

Reported by:	YongHyeon PYUN
MFC after:	3 days
2011-07-18 12:03:58 +00:00
Ed Schouten
78d4d8eeb2 Restore binary compatibility for GIO_KEYMAP and PIO_KEYMAP.
Back in 2009 I changed the ABI of the GIO_KEYMAP and PIO_KEYMAP ioctls
to support wide characters. I created a patch to add ABI compatibility
for the old calls, but I didn't get any feedback to that.

It seems now people are upgrading from 8 to 9 they experience this
issue, so add it anyway.
2011-07-17 08:19:19 +00:00
Hans Petter Selasky
f6bd103ef0 Fix for VirtualBox 4.x and other virtual machines that fail
to generate a port reset change event.

MFC after:	1 weeks
2011-07-16 12:50:30 +00:00
Pyun YongHyeon
14ae1fa4cf Add initial support for AX88772B USB Fast Ethernet. AX88772B
supports IPv4/IPv6 checksum offloading and VLAN tag insertion/
stripping as well as WOL.  Because uether does not provide a way
to announce driver specific offload capabilities to upper stack,
checksum offloading support needs more work and will be done in
future.
Special thanks to ASIX for donating sample hardware.

H/W donated by:	ASIX Electronics
Reviewed by:	hselasky
2011-07-14 17:19:00 +00:00
Hans Petter Selasky
2b6ce80c82 Fix for dump after shutdown with USB keyboard plugged in. It appears that the
system timer is stopped during shutdown and that the pause() statement in ukbd
causes infinite hang in this regard. The fix is to use mi_switch() instead of
pause() to do the required task switch to ensure that the required USB processes
get executed.

Reported by:	Mike_Karels@mcafee.com
MFC after:	1 week
2011-07-13 21:07:50 +00:00
Hans Petter Selasky
5863e1bc8c Remove reviewed line from copyright header.
Suggested by:	joel @
2011-07-09 20:16:52 +00:00
Hans Petter Selasky
49901133a1 Add new USB 3G driver.
Submitted by:	PseudoCylon <moonlightakkiy@yahoo.ca>
MFC after:	14 days
2011-07-08 10:58:56 +00:00
Hans Petter Selasky
e92091ad3d Make the USB keyboard driver more HID compliant.
Try to auto-detect keyboards which should use the BOOT protocol.

MFC after:	2 weeks
2011-07-04 07:37:28 +00:00
Bjoern A. Zeeb
a34c6aeb85 Tag mbufs of all incoming frames or packets with the interface's FIB
setting (either default or if supported as set by SIOCSIFFIB, e.g.
from ifconfig).

Submitted by:	Alexander V. Chernikov (melifaro ipfw.ru)
Reviewed by:	julian
MFC after:	2 weeks
2011-07-03 16:08:38 +00:00
Hans Petter Selasky
4944c3a882 Introduce a quirk for broken USB MIDI hardware instead of limiting performance
in general.

MFC after:	1 week
2011-07-03 13:27:23 +00:00
Hans Petter Selasky
34e5f64b49 Fix for "nomatch" event for ums and ukbd drivers when uhid is loaded.
MFC after:	3 days
2011-07-02 20:58:33 +00:00
Kevin Lo
ee6eac62f7 Remove duplicate header includes 2011-06-28 08:36:48 +00:00
Gavin Atkinson
16169457f0 The SMCWUSBG is a zyd(4) device, not an uath(4) device. Remove from the
latter.

It appears that the addition to uath(4) came in through PR kern/135009,
which had tested another device, the SMCWUSBTG2, successfully with uath(4)
and included the SMCWUSBG as it "has the same chipset".  I can find no
other evidence that these two do actually share the same chipset.  Moreover,
Linux treats the SMCWUSBG as a zyd(4) device also.

This reverts r223537.

Discussed with:	hselasky, kevlo
MFC after:	1 week
2011-06-26 11:37:24 +00:00
Hans Petter Selasky
1d63770b39 - Export the USB device ID format to userspace tools.
MFC after:	14 days
2011-06-25 15:51:44 +00:00
Hans Petter Selasky
4c8ffb2300 - Remove duplicate USB ID.
MFC after:	3 days
2011-06-25 15:46:24 +00:00
Hans Petter Selasky
9c916c627f - Export more USB device ID's.
- Update bus_auto.conf accordingly.

MFC after:	3 days
2011-06-24 22:01:56 +00:00
Hans Petter Selasky
9cfbe3e76b - Export more USB device ID's.
MFC after:	3 days
2011-06-24 19:32:29 +00:00
Hans Petter Selasky
d43ffe9465 - Ensure that we get all the required nomatch devd events.
MFC after:	3 days
2011-06-24 19:02:56 +00:00
Hans Petter Selasky
a6b6015063 - Move execution of event handlers into the probe and attach function so that
dynamically loaded device drivers get a chance to run their event hooks.

- Decouple the USB suspend and resume lock from witness. It produces some
false warnings due to reusing the lock name among multiple devices.

MFC after:	3 days
2011-06-24 18:14:43 +00:00
Hans Petter Selasky
d16e5e1a84 - Export the URIO USB device ID's.
- Add checks for configuration and interface index.

MFC after:	3 days
2011-06-24 18:11:55 +00:00
Hans Petter Selasky
e71c21385e - Add additional information to the PnP info of USB HUBs children which
is now required by bus_autoconf.
- Allow interface class matching even if device class is vendor specific.
- Update bus_autoconf tool to not generate system and subsystem match lines
  for the nomatch event.

PR:		misc/157903
MFC after:	14 days
2011-06-24 04:16:06 +00:00
Hans Petter Selasky
f1a16106b6 - Move all USB device ID arrays into so-called sections,
sorted according to the mode which they support:
	host, device or dual mode
- Add generic tool to extract these data:
	tools/bus_autoconf

Discussed with:	imp
Suggested by:	Robert Millan <rmh@debian.org>
PR:		misc/157903
MFC after:	14 days
2011-06-24 02:30:02 +00:00
Hans Petter Selasky
df142785d5 - Add some comments about the origin of some USB descriptors.
MFC after:	7 days
2011-06-23 10:35:45 +00:00
Hans Petter Selasky
399e6543b2 - Add more USB templates for various USB device classes
- Add basic template support for USB 3.0
- Export definition of template sysctl numbers through usb_ioctl.h

MFC after:	7 days
2011-06-23 07:54:03 +00:00
Gavin Atkinson
95db0bf798 Use USB_VENDOR_OVISLINK define rather than the vendor ID.
PR:		usb/158142
Submitted by:	Robert Millan <rmh debian.org>
MFC after:	1 week
2011-06-22 22:08:55 +00:00
Hans Petter Selasky
842014b127 Add new USB ID to UDAV driver.
Submitted by:	Luiz Gustavo S. Costa <lgcosta@pfsense.org>
MFC after:	7 days
2011-06-19 08:34:10 +00:00
Hans Petter Selasky
2906af23b8 Reset clear-stall error counter before setting up the USB control transfers.
MFC after:	14 days
2011-06-06 22:03:09 +00:00
Hans Petter Selasky
9eb0d7025d Improve enumeration of Low- and Full-speed devices connected through a
High-speed USB HUB by resetting the transaction translator (TT)
before trying re-enumeration. Also when clear-stall fails multiple times
try a re-enumeration.

Suggested by:	Trevor Blackwell
MFC after:	14 days
2011-06-06 21:45:09 +00:00
Hans Petter Selasky
884a2a6996 Rename recently added USB serial driver.
Suggested by:	YongHyeon PYUN
MFC after:	7 days
2011-06-04 20:40:24 +00:00
Pyun YongHyeon
082b754397 Poke correct GPIO pins for newer axe(4) controllers with Marvell
PHY. Newer models seem to use different LED mode that requires
enabling both GPIO1 and GPIO2.

Tested by:	marcel
2011-06-01 18:42:44 +00:00
Hans Petter Selasky
0c38ca8cf4 Add support for new USB serial driver.
Submitted by:	Lev Serebryakov, lev @
MFC after:	14 days
2011-06-01 17:58:27 +00:00
Andriy Gapon
cd10bffa61 usb: change to one-pass probing of device drivers
This brings USB bus more in line with how newbus is supposed to be used.
Also, because of the two-pass probing the following message was produced
by devd in default configuration when almost any USB device was
connected:
	Unknown USB device: vendor <> product <> bus <>
This should be fixed now.

Note that many USB device drivers pass some information from probe
method to attach method via ivars.  For this to continue working we rely
on the fact that the subr_bus code calls probe method of a winning driver
again before calling its attach method in the case where multiple
drivers claim to support a device.  This is done because device
description is set in successful probe methods and we want to get a correct
device description from a winning driver.  So now this logic is re-used
for setting ivars too.

Reviewed by:	hselasky
MFC after:	1 month
2011-05-18 07:40:12 +00:00
Ruslan Ermilov
934d7bccdb Renamed PCI_INTERFACE_XHCI to PCIP_SERIALBUS_USB_XHCI and moved it
to <dev/pci/pcireg.h>.

Reviewed by:	hselasky
MFC after:	3 days
2011-05-17 11:23:43 +00:00
Hans Petter Selasky
e1f3a66f15 Add new USB ID's.
Submitted by:	Jim Bryant
MFC after:	3 days
2011-05-14 12:16:09 +00:00
Bruce M Simpson
459d19e0fa Add VID for Simtec Electronics.
Add PID for Simtec Electronics EntropyKey, a hardware random number generator.
2011-05-10 02:38:44 +00:00
Hans Petter Selasky
afa524e6cf Cleanup usb_notify_addq_compat(). It should not
be needed any more.

MFC after:	7 days
2011-05-08 08:22:11 +00:00
Hans Petter Selasky
4ad5f8c23f Add new USB ID.
Submitted by:	Dmitry Luhtionov
MFC after:	7 days
2011-05-07 16:32:59 +00:00
Marius Strobl
3fcb7a5365 - Remove attempts to implement setting of BMCR_LOOP/MIIF_NOLOOP
(reporting IFM_LOOP based on BMCR_LOOP is left in place though as
  it might provide useful for debugging). For most mii(4) drivers it
  was unclear whether the PHYs driven by them actually support
  loopback or not. Moreover, typically loopback mode also needs to
  be activated on the MAC, which none of the Ethernet drivers using
  mii(4) implements. Given that loopback media has no real use (and
  obviously hardly had a chance to actually work) besides for driver
  development (which just loopback mode should be sufficient for
  though, i.e one doesn't necessary need support for loopback media)
  support for it is just dropped as both NetBSD and OpenBSD already
  did quite some time ago.
- Let mii_phy_add_media() also announce the support of IFM_NONE.
- Restructure the PHY entry points to use a structure of entry points
  instead of discrete function pointers, and extend this to include
  a "reset" entry point. Make sure any PHY-specific reset routine is
  always used, and provide one for lxtphy(4) which disables MII
  interrupts (as is done for a few other PHYs we have drivers for).
  This includes changing NIC drivers which previously just called the
  generic mii_phy_reset() to now actually call the PHY-specific reset
  routine, which might be crucial in some cases. While at it, the
  redundant checks in these NIC drivers for mii->mii_instance not being
  zero before calling the reset routines were removed because as soon
  as one PHY driver attaches mii->mii_instance is incremented and we
  hardly can end up in their media change callbacks etc if no PHY driver
  has attached as mii_attach() would have failed in that case and not
  attach a miibus(4) instance.
  Consequently, NIC drivers now no longer should call mii_phy_reset()
  directly, so it was removed from EXPORT_SYMS.
- Add a mii_phy_dev_attach() as a companion helper to mii_phy_dev_probe().
  The purpose of that function is to perform the common steps to attach
  a PHY driver instance and to hook it up to the miibus(4) instance and to
  optionally also handle the probing, addition and initialization of the
  supported media. So all a PHY driver without any special requirements
  has to do in its bus attach method is to call mii_phy_dev_attach()
  along with PHY-specific MIIF_* flags, a pointer to its PHY functions
  and the add_media set to one. All PHY drivers were updated to take
  advantage of mii_phy_dev_attach() as appropriate. Along with these
  changes the capability mask was added to the mii_softc structure so
  PHY drivers taking advantage of mii_phy_dev_attach() but still
  handling media on their own do not need to fiddle with the MII attach
  arguments anyway.
- Keep track of the PHY offset in the mii_softc structure. This is done
  for compatibility with NetBSD/OpenBSD.
- Keep track of the PHY's OUI, model and revision in the mii_softc
  structure. Several PHY drivers require this information also after
  attaching and previously had to wrap their own softc around mii_softc.
  NetBSD/OpenBSD also keep track of the model and revision on their
  mii_softc structure. All PHY drivers were updated to take advantage
  as appropriate.
- Convert the mebers of the MII data structure to unsigned where
  appropriate. This is partly inspired by NetBSD/OpenBSD.
- According to IEEE 802.3-2002 the bits actually have to be reversed
  when mapping an OUI to the MII ID registers. All PHY drivers and
  miidevs where changed as necessary. Actually this now again allows to
  largely share miidevs with NetBSD, which fixed this problem already
  9 years ago. Consequently miidevs was synced as far as possible.
- Add MIIF_NOMANPAUSE and mii_phy_flowstatus() calls to drivers that
  weren't explicitly converted to support flow control before. It's
  unclear whether flow control actually works with these but typically
  it should and their net behavior should be more correct with these
  changes in place than without if the MAC driver sets MIIF_DOPAUSE.

Obtained from:	NetBSD (partially)
Reviewed by:	yongari (earlier version), silence on arch@ and net@
2011-05-03 19:51:29 +00:00
Kevin Lo
f620e64d23 Guard against default ni_chan
PR: kern/144642
Submitted by: Arthur Hartwig <a_hartwig at fastmaildot fm>
2011-04-29 06:28:29 +00:00
John Baldwin
41b1c25960 Trim some additional unnecessary <linker_set.h> includes.
MFC after:	1 week
2011-04-28 17:59:33 +00:00
Hans Petter Selasky
4309793b64 The maximum NCM frame size must be so that it
will generate a short terminated USB transfer if
the maximum NCM frame size is greater than what
the driver can handle.

Reported by:	Matthias Benesch
MFC after:	7 days
Approved by:	thompsa (mentor)
2011-04-26 19:40:37 +00:00
Hans Petter Selasky
ea719ede02 Fix for missing EHCI datatoggle change case.
Reported by:	Mike Tancsa
MFC after:	3 days
Approved by:	thompsa (mentor)
2011-04-26 18:50:35 +00:00
Hans Petter Selasky
b0a5e05f62 We don't need to call EOWRITE4(sc, EHCI_USBINTR, 0) directly from each EHCI
bus driver at detach, hence ehci_detach() does exactly this since r199718.

Submitted by:	Luiz Otavio O Souza
MFC after:	7 days
Approved by:	thompsa (mentor)
2011-04-12 07:49:11 +00:00
Alexander Motin
669d9046a9 Rework change made at r203146. Instead of reporting all wire errors as
SCSI status errors to CAM (that was wrong, as it too often turned retriable
wire errors into non-retriable REQUEST SENSE errors), do it only for STALL
errors on control pipe of the CBI devices. STALL on control pipe is just
a one of the ways to report error for CBI devices.

PR:		usb/150401, usb/154593.
Reviewed by:	hselasky
MFC after:	1 week
2011-04-11 08:23:27 +00:00
Hans Petter Selasky
6c352e994c - Fix for missing event if a libUSB USB transfer is started and
stopped rapidly in succession.

Reported by:	J.R. Oldroyd
MFC after:	7 days
Approved by:	thompsa (mentor)
2011-04-03 20:22:49 +00:00
Hans Petter Selasky
3ea3537594 - Correct EHCI interrupt disabling at detach.
Submitted by:	Luiz Otavio O Souza
MFC after:	7 days
Approved by:	thompsa (mentor)
2011-04-03 20:17:49 +00:00
Hans Petter Selasky
31a1169186 - Improvements to USB PF solution
- Add more fields for USB device and host mode
- Add more information to USB PF header so that decoding
  can easily be done by software analyzer tools like
  Wireshark.
- Optimise usbdump to display USB streams in text format
  more efficiently.
- Software using USB PF must be recompiled after
  this commit, due to structure changes.

MFC after:	7 days
Approved by:	thompsa (mentor)
2011-04-03 20:03:45 +00:00
Kevin Lo
329f91ff62 - Minor style(9) cleanup
- Make functions static
2011-04-01 03:27:55 +00:00
Hans Petter Selasky
46873d15b1 Fix initialisation order with regard to debug prints.
Reported by:	Luiz Otavio O Souza
MFC after:	14 days
Approved by:	thompsa (mentor)
2011-03-25 10:11:21 +00:00
Kevin Lo
bf9d222b88 Fix panic while associating access point.
While here, add the SMC SMCWUSB-G
2011-03-25 05:01:13 +00:00
Hans Petter Selasky
996c27355c Fix typo.
Reported by:	Garrett Cooper
MFC after:	14 days
Approved by:	thompsa (mentor)
2011-03-24 07:59:21 +00:00
Hans Petter Selasky
ca794e7847 Comply with style(9).
Reported by:	gavin
MFC after:	14 days
Approved by:	thompsa (mentor)
2011-03-23 19:41:44 +00:00
Hans Petter Selasky
b635069c09 - Do not output the trailing newline to the HID
report descriptor information, sysctl utility
  will show it for us.
- Modify sysctl node description to make it more
  understanable.

Found by:	Alexander Best <arundel@freebsd.org>
Submitted by:	Eygene Ryabinkin <rea@freebsd.org>
MFC after:	14 days
Approved by:	thompsa (mentor)
2011-03-21 21:34:12 +00:00
Hans Petter Selasky
dbe63d3a27 - Bugfix: Fix a EHCI hardware race, where the hardware computed data toggle
value is updated after that we read it in the queue-head. This patch can
fix problems with BULK timeouts. The issue was found on a Nvidia chipset.

MFC after:	14 days
Approved by:	thompsa (mentor)
2011-03-21 21:16:25 +00:00
Hans Petter Selasky
56b57046f4 - Bugfix: Root HUBs do not support re-enumeration.
MFC after:	14 days
Approved by:	thompsa (mentor)
2011-03-08 08:02:39 +00:00
Daichi GOTO
f1168f9929 Add the Buffalo (Melco Inc.) WLI-UC-G301N
PR:		usb/155229
Submitted by:	Yoshiaki UCHIKAWA
MFC after:	1 week
2011-03-04 07:01:45 +00:00
Hans Petter Selasky
5b8c2f8165 - Remove dependency to ucom from ulpt.
MFC after:	14 days
Approved by:	thompsa (mentor)
2011-03-03 10:25:41 +00:00
Hans Petter Selasky
1c49736857 - Add support for software pre-scaling of ISOCHRONOUS transfers.
MFC after:	14 days
Approved by:	thompsa (mentor)
2011-02-28 17:23:15 +00:00
Hans Petter Selasky
ccac019af4 - Correct USB 3.0 wire-speed to 5.0Gbps
MFC after:	3 days
Approved by:	thompsa (mentor)
2011-02-26 09:28:52 +00:00
Hans Petter Selasky
25b74dab1d - Add support for some non-standard USB MIDI devices from Roland, by
means of allowing vendor specific interface class for audio and MIDI devices.
- Add new quirks for this. The vendor and product list in OpenBSD's
dev/usb/umidi_quirks.c was used as reference.

MFC after:	14 days
Approved by:	thompsa (mentor)
2011-02-24 09:13:47 +00:00
Rebecca Cran
6bccea7c2b Fix typos - remove duplicate "the".
PR:	bin/154928
Submitted by:	Eitan Adler <lists at eitanadler.com>
MFC after: 	3 days
2011-02-21 09:01:34 +00:00
Hans Petter Selasky
733b53df69 Add more udav device ID's.
Submitted by:	Rick van der Zwet <info@rickvanderzwet.nl>
MFC after:	7 days
Approved by:	thompsa (mentor)
2011-02-19 22:53:50 +00:00
Hans Petter Selasky
26fdf1e8b6 - Fix build of manual page and inclusion of mos driver into kernel config file.
- Fix style compliancy by wrapping some long lines in if_mos.c

Approved by:	thompsa (mentor)
2011-02-17 07:39:53 +00:00
Hans Petter Selasky
1ee72beb56 Fix build breakage in if_mos.c when USB_DEBUG option is set.
Approved by:	thompsa (mentor)
2011-02-16 09:26:56 +00:00
Hans Petter Selasky
b2dce55fe9 Add support for new USB to ethernet controller:
Moschip MCS7730/MCS7830

Submitted by:	Rick van der Zwet <info@rickvanderzwet.nl>
Approved by:	thompsa (mentor)
2011-02-16 08:33:30 +00:00
Hans Petter Selasky
f417369bdd * Fix page fault caused by referring freed node.
While updating Tx stats, already freed node could be referred and cause
page fault. To avoid such panic, spool Tx stats in driver's softc. Then,
on every ratectl interval, grab node though ieee80211_iterate_nodes() and
update ratectl stats.

* Simplify some code in run_iter_func().

* Fix typo

* Use memset instead of bzero (hselasky @)

PR:		kern/153938
Submitted by:	PseudoCylon <moonlightakkiy@yahoo.ca>
Approved by:	thompsa (mentor)
2011-02-14 08:14:06 +00:00
Bernhard Schmidt
e7d14e9bcc Rework beacon handling re-enable run_updateslot().
Drivers which rely on net80211 to create the beacon need to call
ieee80211_beacon_update() on iv_update_beacon() calls. This is required
that certain bits, e.g. TIM, get updated. A call to ieee80211_beacon_alloc()
is not enough because it does not care about flags which can only change
during runtime. By design a beacon is supposed to be allocated only once
while moving into RUN state.

To handle all possible calls to iv_update_beacon() the run_updateslot()
function has been revived and run_updateprot() has been added.
run_updateslot() handles slot time changes and run_updateprot() changes
to protection, both can change while nodes associate/leave.

Submitted by:	Alexander Zagrebin <alex at zagrebin.ru>,
		PseudoCylon <moonlightakkiy atyahoo.ca>
MFC after:	3 weeks
2011-02-09 18:09:27 +00:00
Hans Petter Selasky
8833442863 Minor cleanup:
- use device_printf() instead of printf() to give more accurate warnings.
 - use memcpy() instead of bcopy().
 - add missing #if's for non-FreeBSD compilation.

Approved by:	thompsa (mentor)
2011-02-09 08:01:45 +00:00
Marcel Moolenaar
6a9f4949fb Improve the error interrupt handler. In particular, read the
error address on a decoding error to unlatch it and to allow
us to print a better diagnostics message. This also has the
side effect of clearing the condition, which prevents an
interrupt storm.
2011-02-08 22:16:29 +00:00
Nick Hibma
3b8227640a Curitel UM150 needs a quirk to stop it from detaching straight after
attach (resetting actually).

Submitted by:	Oleg Nauman
MFC after:	1 week
2011-02-07 22:37:27 +00:00
Hans Petter Selasky
a153864056 Fix for detection of MTK 3329 GPS USB devices.
Submitted by:	Mykhaylo Yehorov
PR:		usb/153929
Approved by:	thompsa (mentor)
2011-02-03 18:25:55 +00:00
Nick Hibma
b531de0b14 New ID for the Novatel MC547
PR:		154127
Submitted by:	Mike Tancsa
MFC after:	1 day
2011-02-01 22:26:06 +00:00
Hans Petter Selasky
0c8f4683ec Use correct kernel types for all fields in USB PF code and headers.
Approved by:	thompsa (mentor)
2011-02-01 10:25:48 +00:00
Hans Petter Selasky
99f017d21b Add more sanity checks for USB_HOST_ALIGN input values. Re-factor existing
checks for readability.

Approved by:	thompsa (mentor)
2011-01-24 17:38:37 +00:00
Hans Petter Selasky
d8d1becfdd Allow USB_HOST_ALIGN to be configured at compile time. This patch is
necessary for MIPS based RouterStation Pro board and maybe other MIPS
based boards as well.

Submitted by:	Milan Obuch
Approved by:	thompsa (mentor)
2011-01-22 13:52:23 +00:00
Nick Hibma
0223e98a7e Add another ID for the ZTE MF190 Surf Stick
Submitted by:	nagilum
MFC after:	1 day
2011-01-20 13:02:54 +00:00
Hans Petter Selasky
8be0933446 Make USB packet filtering code optional.
Approved by:	thompsa (mentor)
2011-01-18 21:18:51 +00:00
Matthew D Fleming
5bc0787f29 Specify a CTLTYPE_FOO so that a future sysctl(8) change does not need
to rely on the format string.
2011-01-18 21:14:23 +00:00
Bernhard Schmidt
bd56e71b4b Pull ieee80211_ratectl_node_init() calls from drivers into net80211.
This fixes hostap mode for at least ral(4) and run(4), because there is
no sufficient call into drivers which could be used initialize the node
related ratectl variables.

MFC after:	3 days
2011-01-17 20:15:15 +00:00
Hans Petter Selasky
c1338c65d6 - Add support for 64-byte contexts to XHCI driver.
- Remove some dead code.
- Fixed one instance of missing endian conversion.

Approved by:	thompsa (mentor)
2011-01-13 20:03:55 +00:00
John Baldwin
6a9736a878 Use software interrupt priorities for USB kthreads instead of hardware
interrupt priorities.

Reviewed by:	hps
MFC after:	2 weeks
2011-01-13 14:15:36 +00:00
Matthew D Fleming
6dc7dc9a3e sysctl(9) cleanup checkpoint: amd64 GENERIC builds cleanly.
Commit the rest of the devices.
2011-01-12 19:53:56 +00:00
Gavin Atkinson
01a8f075a2 Improve or fix some comments. No functional change.
MFC after:	1 week
2011-01-11 19:05:55 +00:00
John Baldwin
58ccf5b41c Remove unneeded includes of <sys/linker_set.h>. Other headers that use
it internally contain nested includes.

Reviewed by:	bde
2011-01-11 13:59:06 +00:00
Gavin Atkinson
c6ac426dd8 Add support for the Zeagle N2iTion3 Dive Computer to uplcom(4). This brings
the list of supported devices in sync with kernel.org git revision
f36ecd5de93e4c85a9e3d25100c6e233155b12e5, and OpenBSD uplcom.c r1.54
2011-01-09 17:40:04 +00:00
Gavin Atkinson
8f3ce105d2 Sync the list of devices supported by uslcom(4) with Linux, bringing in
all new devices added between our r211022 and their git revision
93ad03d60b5b18897030038234aa2ebae8234748

Also correct a Foxconn entry.

MFC after:	1 week
2011-01-09 17:10:06 +00:00
John Baldwin
c305730dc0 Remove bogus usage of INTR_FAST. "Fast" interrupts are now indicated by
registering a filter handler rather than a threaded handler.  Also remove
a bogus use of INTR_MPSAFE for a filter.
2011-01-06 21:08:06 +00:00
Gavin Atkinson
635c945768 Support the Uniform Industrial Corp (UIC) MSR206 Magnetic Card Reader.
MFC after:	1 week
2011-01-06 19:17:29 +00:00
Pyun YongHyeon
65c12bf571 r184610 changed the way how TX frames are handled on AX88178 and
AX88772 controllers. ASIX added a new feature for AX88178/AX88772
controllers which allows combining multiple TX frames into a single
big frame. This was to overcome one of USB limitation where it
can't generate more than 8k interrupts/sec which in turn means USB
ethernet controllers can not send more than 8k packets per second.
Using ASIX's feature greatly enhanced TX performance(more than 3~4
times) compared to 7.x driver. However it seems r184610 removed
boundary checking for buffered frames which in turn caused
instability issues under certain conditions. In addition, using
ASIX's feature triggered another issue which made USB controller
hang under certain conditions. Restarting ethernet controller
didn't help under this hang condition and unplugging and replugging
the controller was the only solution. I believe there is a silicon
bug in TX frame combining feature on AX88178/AX88772 controllers.

To address these issues, reintroduce the boundary checking for both
AX88178 and AX88772 after copying a frame to USB buffer and do not
use ASIX's multiple frame combining feature. Instead, use USB
controller's multi-frame transmit capability to enhance TX
performance as suggested by Hans[1].
This should fix a long standing axe(4) instability issues reported
on AX88772 and AX88178 controllers. While I'm here remove
unnecessary TX frame length check since upper stack always
guarantee the size of a frame to be less than MCLBYTES.

Special thanks to Derrick Brashear who tried numerous patches
during last 4 months and waited real fix with patience. Without
this enthusiastic support, patience and H/W donation I couldn't fix
it since I was not able to trigger the issue on my box.

Suggested by:	hselasky [1]
Tested by:	Derrick Brashear (shadow <> gmail dot com>
H/W donated by:	Derrick Brashear (shadow <> gmail dot com>
PR:		usb/140883
2010-12-08 01:24:05 +00:00
Weongyo Jeong
6e3cb00068 Introduces IFF_CANTCONFIG interface flag to point that the interface
isn't configurable in a meaningful way.  This is for ifconfig(8) or
other tools not to change code whenever IFT_USB-like interfaces are
registered at the interface list.

Reviewed by:	brooks
No objections:	gavin, jkim
2010-12-07 20:23:47 +00:00
Hans Petter Selasky
0e777d8457 Re-add a status check which sneaked out during r214804.
This change can fix some USB error messages showing up
during bootup.

MFC after:	3 days
Approved by:	thompsa (mentor)
2010-12-07 08:20:20 +00:00
Weongyo Jeong
b172e30376 Explicitly UP and DOWN the usbus interfaces (IFT_USB) when it's attached
or detached.  Normally it should be changed through user land ioctl(2)
system calls but it looks there's no apps for USB and no need.

With this patch, libpcap would detect the usbus interfaces correctly and
tcpdump(1) could dump the USB packets into PCAP format with -w option.
However it couldn't print the output to console because there's no
printer-routine at tcpdump(1).
2010-12-01 03:51:06 +00:00
Hans Petter Selasky
02c4024199 We need to define a cdev variable associated with each USB device,
hence existing applications like webcamd are expecting that.
This problem was introduced by SVN change 214221 where cdev=
was replaced by ugen= by accident. Solve this problem by
redefining cdev= in devd notifications.

MFC after 3 days.

Approved by:	thompsa (mentor)
2010-11-30 08:25:57 +00:00
MIHIRA Sanpei Yoshiro
54de08a963 Add new device ids.
Buffalo (Melco Inc.) WLI-UC-G

PR:		141777
2010-11-29 15:08:18 +00:00
Gavin Atkinson
f6fa0b2b95 Support the Falcom Twist USB GSM/GPRS modem in uftdi(4)
PR:		usb/151862
Submitted by:	Alessandro de Manzano <demanzano dqmicro.it>
MFC after:	1 week
2010-11-29 08:17:44 +00:00
Pyun YongHyeon
45b0a3494d Add initial AX88772A support.
H/W donated by:	Derrick Brashear (shadow <> gmail dot com)
2010-11-28 01:56:44 +00:00
Pyun YongHyeon
8c09fbe458 Introduce new macro AXE_IS_178_FAMILY and AXE_IS_772. Include
AX88772A and AX88772B for future extension. While here add TX
buffer size for 178 family controllers.
2010-11-28 01:43:28 +00:00
Pyun YongHyeon
ff5fbbc49b Do full controller initialization in axe_reset() for controllers
that require special configuration from EEPROM. This will put
controllers into known sane state.
2010-11-28 01:16:37 +00:00
Pyun YongHyeon
d743bdd2f6 Make sure to change to currently selected media. 2010-11-28 01:03:06 +00:00
Pyun YongHyeon
0369b60472 Do not reinitialize controller if it's already running. 2010-11-28 01:00:39 +00:00
Pyun YongHyeon
675c1ae83d Move axe_reset() to axe_init(). 2010-11-28 00:57:48 +00:00
Pyun YongHyeon
6dd81ec722 Apply GPIO configuration for all CICADA PHYs.
While I'm here show selected phymode to ease of debugging.
2010-11-28 00:52:02 +00:00
Weongyo Jeong
b443638277 Removes a unused function `usb_bus_find'. 2010-11-25 22:56:26 +00:00
Weongyo Jeong
fe1c24e3d6 Handles the unit number correctly that the previous commit had a problem
(wrong unit number for a host controller) when the module is load /
unloaded repeatly.  Attaching the USB pf is moved to usbus device's
attach.

Pointed by:	yongari
2010-11-25 03:30:43 +00:00
Weongyo Jeong
537e254f0a Assigning the unit number for each interfaces could not use ubus->parent
because it could differ depending on the host controller type.  It could
lead the duplicate unit number assignment.
2010-11-25 03:02:53 +00:00
Weongyo Jeong
10798b4875 Fixes a compiler warning when it's compiled with INVARIANTS.
Pointy hat to:	me
2010-11-24 21:43:36 +00:00
Weongyo Jeong
e376f9c3e7 Removes all duplicated code with BPF that it's greatly simplified and
take all benefits whenever BPF code is improved.

Pointed by:	jkim
Reviewed by:	thompsa
2010-11-24 19:11:32 +00:00
Weongyo Jeong
3c0efe7424 Fixes a kernel crash when usb module is reloaded after unload that it
didn't destroy the cdev properly.

Pointy hat to:	me
Reported by:	Brandon Gooch <jamesbrandongooch at gmail dot com>, jkim
2010-11-23 20:23:25 +00:00
Nick Hibma
294fe04afc Make the Huawei E1820 work (Emile Coetzee).
Shorten the descriptive strings for Huawei devices. The vendor or
operator name should not be included in the device name.

Submitted by:	Emile Coetzee
MFC after:	3 days
2010-11-23 08:15:14 +00:00
Weongyo Jeong
18ec652552 Adds a USB packet filter feature to the stack that it could capture
packets which go through each USB host controllers.  Its implementations
are almost based on BPF code and very similar with it except it's
little bit customized for USB packet only.  The userland program
usbdump(8) would be committed soon.

Discussed with:	hps, thompsa, yongari
2010-11-22 01:11:28 +00:00
Kevin Lo
7dc246bc0f Remove unused struct rue_type 2010-11-15 06:04:25 +00:00
Andrew Thompson
fcc8d2e17b Add the Sierra MC8700. 2010-11-15 02:27:01 +00:00
Dima Dorfman
b2e7926915 Add a special INIT product ID used by some models of the HUAWEI
K3765 datacard. After ejecting this device, it reappears using
the normal K3765 ID. It does not switch automatically

Reviewed by:	n_hibma
Obtained from:	OpenBSD
MFC after:	2 weeks
2010-11-14 23:05:57 +00:00
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