Commit Graph

2349 Commits

Author SHA1 Message Date
Weongyo Jeong
941da6d392 fixes a TX hang that could be possible to happen when the trasfers are
in the high speed that some drivers don't call if_start callback after
marking ~IFF_DRV_OACTIVE.

MFC after:	3 days
2009-10-14 20:30:27 +00:00
Weongyo Jeong
db63fc93cc fixes a TX hang bug that it could happen when if_start callback didn't
be restarted by full of the output queue.

MFC after:	3 days
Tested by:	bsduser <bsd at acd.homelinux.org>
2009-10-14 20:09:09 +00:00
Hiroki Sato
aea0c7f367 Fix the 106/109 USB Japanese keyboard "underscore" issue.
Sun Type 6 USB keyboard support added in rev 1.46 conflicted with
some scan codes used in Japanese keyboards because the scan code
conversion routine was ambiguous for the overlapped codes.

PR:		ports/134005
Submitted by:	YAMASHIRO Jun
2009-10-12 19:19:08 +00:00
Weongyo Jeong
f8b51ca5e9 updates device entries supported with the product name not magic numbers
and sorts entries.  WUSB54GCV2 is added.

Obtained from:	OpenBSD
2009-10-04 23:30:08 +00:00
Andrew Thompson
c8a14b9124 EHCI Hardware BUG workaround
The EHCI HW can use the qtd_next field instead of qtd_altnext when a short
packet is received. This contradicts what is stated in the EHCI datasheet.
Also the total-bytes field in the status field of the following TD gets
corrupted upon reception of a short packet!  We work this around in software by
not queueing more than one job/TD at a time of up to 16Kbytes! The bug has been
seen on multiple INTEL based EHCI chips.  Other vendors have not been tested
yet.

- Applications using /dev/usb/X.Y.Z, where Z is non-zero are affected, but not
  applications using LibUSB v0.1, v1.2 and v2.0.
- Mass Storage (umass) is affected.

Submitted by:	Hans Petter Selasky
MFC after:	3 days
2009-10-01 18:37:16 +00:00
Andrew Thompson
585b13f2cb Add back endpoint swap detection that was disabled in an earlier driver
conversion.

Submitted by:	Hans Petter Selasky
2009-09-28 08:18:14 +00:00
Andrew Thompson
7747063b8f Add new FTDI IDs.
Submitted by:	Maks Verver, Arrigo Marchiori
2009-09-28 08:15:26 +00:00
Andrew Thompson
655dc9d00a Add experimental support for usb serial console and polled mode during DDB.
Submitted by:	Hans Petter Selasky
2009-09-28 08:13:50 +00:00
Andrew Thompson
063e119dcd Add a config number quirk for the ELSA_MODEM1
Submitted by:	Stefan Bethke
2009-09-28 08:09:11 +00:00
Andrew Thompson
adedd2deb5 add more device IDs
Reported by:	Mike Tancsa
Submitted by:	Hans Petter Selasky
2009-09-28 08:07:20 +00:00
Andrew Thompson
87832c5e33 Allow setting of MAC address for AXE based ethernet adapters.
Submitted by:	yongari
2009-09-28 08:05:14 +00:00
Andrew Thompson
3ac526e01e Increase the rx buffer size to 16384 bytes, this increases RX performance from
50Mbps to 220Mbps on PLANEX GU-1000T.

Submitted by:	yongari
2009-09-28 08:03:52 +00:00
Andrew Thompson
a4fcd5cae9 - Remove SAMSUNG_YP_U2 now that it is in the cam layer
- Add quirk from Tobias Grosser for Western Mypassword

Submitted by:	Hans Petter Selasky
2009-09-28 08:00:17 +00:00
Andrew Thompson
30c257f8ae MFp4
Add new usbdev entries for Marvell, FTDI, Option and Western.
2009-09-28 07:57:23 +00:00
Andrew Thompson
4076dd2309 Add basic support for USB Network Control Model (NCM) v1.0 to if_cdce.c.
http://www.usb.org/developers/devclass_docs/NCM10.zip

Submitted by:	Hans Petter Selasky
2009-09-28 07:53:55 +00:00
Andrew Thompson
a872528155 Add extra safety locking when clobbering xfer->flags_int.started in start and
stop functions, because xfer->flags_int is also updated by the USB controller,
under the controller lock.

Submitted by:	Hans Petter Selasky
2009-09-28 07:46:22 +00:00
Andrew Thompson
35e0e60378 Correct buffer sizes used so that they match. The old code could give the
impression that a overflow situation existed but was not possible.

Reported by:	kib
Submitted by:	Hans Petter Selasky
2009-09-28 07:42:59 +00:00
Andrew Thompson
7a918edff2 Add support for USB language selection.
PR:		usb/138563
Reported by:	Bruce Cran
Submitted by:	Hans Petter Selasky
2009-09-28 07:41:17 +00:00
Andrew Thompson
a9e267575b Fix NULL-pointer dereference in usb_endpoint_foreach().
PR:		usb/138389
Submitted by:	Patroklos Argyroudis at census, inc
2009-09-28 07:39:51 +00:00
Andrew Thompson
3bfbd845ff Add support for ChipHead 341 serial port adapter.
Submitted by:	Hans Petter Selasky
2009-09-28 07:32:11 +00:00
Andrew Thompson
33ea13230a Clear all interrupts rather than just SETUP packet.
Submitted by:	Hans Petter Selasky
2009-09-28 07:10:32 +00:00
Andrew Thompson
2094ecda08 Simplify logic around setting EHCI_QH_DTC and expand some htohc32(temp.sc, 0)
statements to zero.

Submitted by:	Hans Petter Selasky
2009-09-28 07:09:17 +00:00
Andrew Thompson
6450e5babf Import two PCI quirks from Linux
- Add quirk for ATI SB600 and SB700 to free SMB controller
 - Correct schedule sleep time to 10us on the VIA ehci controller

Reported by:	Dorian B<FC>ttner, Andriy Gapon
Submitted by:	Hans Petter Selasky
2009-09-28 07:06:47 +00:00
Andrew Thompson
d88688c7da MFp4 @ 168387
- clean up USB detach logic. There seems to be some problems detaching multiple
  USB HUBs connected in series from the root.

- after this patch the rule is:
  1) Always use device_detach() on the USB HUB first.
  2) Never just device_delete_child() on the USB HUB, because that function
  will traverse to all the device leaves and free them first, and then the USB
  stack will free the devices twice which doesn't work very well.

- make sure the did DMA delay gets set after the timeout has elapsed to make
  logic more clear. There is no functional difference.

Submitted by:	Hans Petter Selasky
2009-09-28 07:01:54 +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
Edward Tomasz Napierala
c977dd609b Make umass(4) pass device USB serial number to CAM, making it possible
to e.g. retrieve it using camcontrol(8).

Reviewed by:	scottl, hps (earlier version)
Obtained from:	Wheel Sp. z o.o. (http://www.wheel.pl)
2009-09-04 09:57:03 +00:00
Weongyo Jeong
a6b8e0e915 fix a TX issue on big endian machines like powerpc or sparc64. Now
zyd(4) should work on all architectures.

Obtained from:	OpenBSD
2009-09-04 05:28:09 +00:00
Andrew Thompson
51e8c0d6c6 It is possible for all the kthreads to exit (hci modules unloaded) which in
turn ends our usb process. This means the proc pointer becomes invalid and will
panic if a new kthread is added. Count the number of threads and clear the proc
pointer on the last one.

Suggested by:	julian
MFC after:	3 days
2009-08-25 16:59:55 +00:00
Alfred Perlstein
cb18f7d12b - Patch to allow USB controller to resume operation after
being polled.

         - Remove the need for Giant from the USB HUB driver.

         - Leave device unconfigured instead of disabling the USB port
           when Huawei Autoinstall disk detection triggers. This should
           fix problems that the Huawei device is not detected after
           Autoinstall eject is issued.
         - Reported by: Nikolay Antsiferov

         - Fix memory use after free race for USB character devices.
         - Reported by: Lucius Windschuh

         - Factor out the enumeration lock into three functions to make the
         coming newbus lock conversion more easy.
          - usbd_enum_lock
          - usbd_enum_unlock
          - usbd_enum_is_locked

Submitted by:	hps
2009-08-24 05:05:38 +00:00
Alfred Perlstein
a5508450dc Remove redundant locking.
Submitted by:	hps
2009-08-24 05:03:59 +00:00
Alfred Perlstein
f2db024fe6 Add a reminder comment to optimize bus_dmamap_sync calls.
Submitted by:	hps
2009-08-24 05:03:30 +00:00
Alfred Perlstein
77c33ae7cc Add mass storage quirks.
PR:             usb/137138,usb/137226,usb/137789,usb/135372

Submitted by:	hps
2009-08-24 05:02:36 +00:00
Alfred Perlstein
40675d1a70 - fix uvisor support, mostly correct buffer sizes used.
- correct device info flag for SONY Cli NR70V

Reported by: Marc Fonvieille
Submitted by:	hps
2009-08-24 05:01:40 +00:00
Alfred Perlstein
ec1201a2c9 - Fix false positive uipaq probe
Reported by: Alexander Motin <mav@freebsd.org>

Submitted by:	hps
2009-08-24 05:01:06 +00:00
Alfred Perlstein
9739167c64 - fix CDC ethernet matching order so that the match flags get correct.
Reported by: Juergen Lock

Submitted by:	hps
2009-08-24 05:00:33 +00:00
Alfred Perlstein
069f9a8bd6 We used force all of the GPIO pins low first and then
enable the ones we want. This has been changed to better
match the ADMtek's reference design to avoid setting the
power-down configuration line of the PHY at the same time
it is reset.

Submitted by:	John Hood via hps
2009-08-24 05:00:07 +00:00
Alfred Perlstein
03a7d05c2d - FIFO's are always opened separately in read and write
direction even if the actual device is opened for read and
        write. Fix fflags check so that the UFM and URIO drivers work.
Reported by: Krassimir Slavchev

Submitted by:	hps
2009-08-24 04:59:09 +00:00
Alfred Perlstein
247549d145 - patch for cordump slowdown. Avoid using DELAY(1000) when no
keys are pressed.
        - Reported by: Various people

        - add sysctl to disable keyboard led control request
        - Reported by: Yoshihiro Ota

        - Save system CPU usage: Patch to stop keyboard timer when no
        keys are pressed.

Submitted by:	hps
MFC after:	3 days
2009-08-24 04:58:42 +00:00
Alfred Perlstein
34b4872224 - allow disabling "root_mount_hold()" by
setting a sysctl/tunable at boot
        - remove some redundant initial explore code

Submitted by:	hps
2009-08-24 04:58:11 +00:00
John Baldwin
a56fe095f0 Temporarily revert the new-bus locking for 8.0 release. It will be
reintroduced after HEAD is reopened for commits by re@.

Approved by:	re (kib), attilio
2009-08-20 19:17:53 +00:00
Rafal Jaworowski
35d01728c6 Fix USB cache sync operations for platforms with non-coherent DMA.
- usb_pc_cpu_invalidate() is called between [consecutive] reads from a device,
  so a sequence of BUS_DMASYNC_POSTREAD and _PREREAD should be used. Note we
  cannot use or'ed shorthand ( _POSTREAD | _PREREAD) for BUS_DMASYNC flags, as
  the low level bus dma sync operation is implementation dependent and we
  cannot assume the required order of operations to be guaranteed.

- usb_pc_cpu_flush() is called before writing to a device, so
  BUS_DMASYNC_PREWRITE should be used.

Submitted by:	Grzegorz Bernacki
Reviewed by:	HPS, arm@, usb@ ML
Tested by:	HPS, Mike Tancsa
Approved by:	re (kib)
Obtained from:	Semihalf
2009-08-19 14:39:08 +00:00
Andrew Thompson
532b195250 Change the usb workers from kernel processes to threads, this is mostly a
cosmetic change to reduce cruft in the proc table.

Also change the idle wait message to `-` like how taskqueues are.

Reviewed by:	julian
Approved by:	re (kib)
2009-08-16 14:13:55 +00:00
Attilio Rao
444b91868b Make the newbus subsystem Giant free by adding the new newbus sxlock.
The newbus lock is responsible for protecting newbus internIal structures,
device states and devclass flags. It is necessary to hold it when all
such datas are accessed. For the other operations, softc locking should
ensure enough protection to avoid races.

Newbus lock is automatically held when virtual operations on the device
and bus are invoked when loading the driver or when the suspend/resume
take place. For other 'spourious' operations trying to access/modify
the newbus topology, newbus lock needs to be automatically acquired and
dropped.

For the moment Giant is also acquired in some key point (modules subsystem)
in order to avoid problems before the 8.0 release as module handlers could
make assumptions about it. This Giant locking should go just after
the release happens.

Please keep in mind that the public interface can be expanded in order
to provide more support, if there are really necessities at some point
and also some bugs could arise as long as the patch needs a bit of
further testing.

Bump __FreeBSD_version in order to reflect the newbus lock introduction.

Reviewed by:    ed, hps, jhb, imp, mav, scottl
No answer by:   ariff, thompsa, yongari
Tested by:      pho,
                G. Trematerra <giovanni dot trematerra at gmail dot com>,
                Brandon Gooch <jamesbrandongooch at gmail dot com>
Sponsored by:   Yahoo! Incorporated
Approved by:	re (ksmith)
2009-08-02 14:28:40 +00:00
Weongyo Jeong
aa7eaa2fb6 fixes a typo for DWA120 device ID.
Reported by:	Alexander Kuznetsov <skritku at gmail.com>
Approved by:	re (kib)
2009-07-30 18:53:06 +00:00
Alfred Perlstein
9e90dc16ba Missed this file for r195963:
USB core:
  - add support for defragging of written device data.
  - improve handling of alternate settings in device side mode.
  - correct return value from usbd_get_no_alts() function.
  - reported by: HPS
  - P4 ID: 166156, 166168

  - report USB device release information to devd and pnpinfo.
  - reported by: MIHIRA Sanpei Yoshiro
  - P4 ID: 166221

Submitted by:	hps
Approved by:	re
2009-07-30 00:57:54 +00:00
Alfred Perlstein
65c7bc9cbf USB CORE - Improve HID parsing
See PR description for more info. Patch is
implemented differently than suggested, but
having the same result.

PR:     usb/137188

Submitted by:	hps
Approved by:	re
2009-07-30 00:17:08 +00:00
Alfred Perlstein
bf3254f22e USB CORE - compat Linux:
- Patch request from Tim Borgeaud:
- add automatic locking
- add refcount for killing URB's

Submitted by:	hps
Approved by:	re
2009-07-30 00:16:50 +00:00
Alfred Perlstein
a0c61406ad USB controller:
- allow disabling "root_mount_hold()" by setting "hw.usb.no_boot_wait" sysctl

Submitted by:	hps
Approved by:	re
2009-07-30 00:16:32 +00:00
Alfred Perlstein
4743e6da52 ULPT:
- add conditional printer status checking
- P4 ID: 166176

Submitted by:	hps
Approved by:	re
2009-07-30 00:16:06 +00:00