Commit Graph

1677 Commits

Author SHA1 Message Date
Ian Dowse
9145721957 Use a different task queue for host controller and peripheral driver
tasks. Since the host controllers rely on tasks to process transfer
timeouts, if a synchronous transfer from a driver was invoked from
a task and timed out, it would never complete because the single
task thread was stuck performing the synchronous transfer so couldn't
process the timeout.

This affected the axe, udav and ural drivers.

Problem hardware provided by:	guido
2006-10-19 01:15:58 +00:00
Florent Thoumie
f45164d8b1 Add a USB umass(4) quirk for Panasonic KXL-840AN CD-R drive.
PR:		usb/81073
Submitted by:	James E. Flemer <jflemer@alum.rpi.edu>
MFC after:	3 days
2006-10-07 20:08:37 +00:00
Florent Thoumie
bff4edd817 Add a USB quirk for CMOTECH CDMA USB modem.
PR:		usb/97948
Submitted by:	Alexei Volkov <kot@kotzone.ru>
MFC after:	3 days
2006-10-07 19:42:45 +00:00
Florent Thoumie
b804b1868e Add a USB quirk for Motorola A41x/V32x USB phones.
PR:		usb/97512
Submitted by:	Mark Diekhans <markd@kermodei.com>
MFC after:	3 days
2006-10-07 19:27:53 +00:00
Florent Thoumie
bd4029713f Add support for Novatech NV902 wireless NIC in ural(4).
PR:		usb/102852
Submitted by:	Jonathan Fosburgh <jonathan@fosburgh.org>
MFC after:	3 days
2006-10-07 18:18:40 +00:00
Florent Thoumie
774b7afefb Add support for Epson Stylus CX4200 in uscanner(4).
PR:		usb/102851
Submitted by:	Jonathan Fosburgh <jonathan@fosburgh.org>
MFC after:	3 days
2006-10-07 18:09:27 +00:00
Florent Thoumie
cfa3f4d8ab Add support for Psion Gold Port Ethernet USB NIC.
PR:		usb/102296
Submitted by:	Volker <volker@vwsoft.com>
MFC after:	3 days
2006-10-07 18:03:39 +00:00
Florent Thoumie
d25cbeac2c Add support for Netgear FA101 ethernet USB NIC.
PR:		usb/102286
Submitted by:	Volker <volker@vwsoft.com>
MFC after:	3 days
2006-10-07 17:58:50 +00:00
Florent Thoumie
be1bd380c5 Add a quirk for the Belkin FC6550-AVR UPS.
PR:		usb/102260
Submitted by:	David Grochowski <grocho98@students.rowan.edu>
MFC after:	3 days
2006-10-07 17:47:16 +00:00
Florent Thoumie
0c56f2bcd6 Add support for Familiar Linux powered iPaq handhelds to cdce(4).
PR:		usb/103865
Submitted by:	Alexey Roslyakov <internetworking@mail.ru>
MFC after:	3 days
2006-10-07 17:35:37 +00:00
Florent Thoumie
6d28d23bb9 Add quirk for Logitech iFeel MouseMan USB mouse.
PR:		usb/101066
Submitted by:	Heiko Przybyl <zuxez@uni.de>
MFC after:	3 days
2006-10-07 17:16:48 +00:00
Florent Thoumie
da9b42184b - Add support for Epson USB Scanners (3590 [1] and 4990 [2]).
- Add entries in the uscanner.4 man page (along with missing 3500).

PR:		usb/100957 [1], usb/100992 [2]
Submitted by:	Jim Teresco <terescoj@teresco.org> [1],
		Walter C. Pelissero <walter.pelissero@iesy.net> [2]
MFC after:	3 days
2006-10-07 16:00:59 +00:00
Ian Dowse
dff926577b Fix compile in non-debug case. 2006-10-03 08:38:08 +00:00
Ian Dowse
9c63c3f400 When changing the device address and max packet size in usbd_new_device(),
close and re-open the default pipe instead of relying on the host
controller driver to notice the changes. Remove the unreliable code
that attempted to update these fields while the pipe was active.
This fixes a case where the hardware could cache and continue to
use the old address, resulting in a "getting first desc failed"
error.

PR:		usb/103167
2006-10-03 01:13:26 +00:00
Ian Dowse
a55e16f4f7 Don't attempt to insert the transfer in an error case where it has
already been inserted.
2006-10-03 01:04:11 +00:00
Ruslan Ermilov
1997f96b85 Ignore the UKBD_DFLT_KEYMAP option when compiling as a module.
The parallel LINT build sometimes broke if kernel-depend wasn't
fast enough in generating ukbdmap.h.  If someone thinks this
option would still be useful for the module, a proper fix is
to add the code generating ukbdmap.h into modules/ukbd/Makefile
and backing this change out.
2006-10-02 16:02:41 +00:00
Ruslan Ermilov
9fddcc6661 Fix our ioctl(2) implementation when the argument is "int". New
ioctls passing integer arguments should use the _IOWINT() macro.
This fixes a lot of ioctl's not working on sparc64, most notable
being keyboard/syscons ioctls.

Full ABI compatibility is provided, with the bonus of fixing the
handling of old ioctls on sparc64.

Reviewed by:	bde (with contributions)
Tested by:	emax, marius
MFC after:	1 week
2006-09-27 19:57:02 +00:00
Olivier Houchard
b098674792 Use usbd_clear_endpoint_stall_async() when clearing endpoint stalls in
an interrupt context.

Obtained from:	NetBSD
MFC after:	1 week
2006-09-22 12:45:42 +00:00
Tom Rhodes
16b392d51d Yank FreeBSD specific code out from under ifdef.
Remove compatibility ifdefs.

Reviewed/Ok'ed by:	imp
2006-09-10 15:20:39 +00:00
Warner Losh
2deae8fa2f More removing compatibility macros.
md5 still the same.

"Dave, stop.  I feel my mind slipping away." -- hal
2006-09-07 00:06:42 +00:00
Warner Losh
730503190d Only include FreeBSD defines. This file is slated to go to the happy
hunting ground in the sky.

Also, remove the #defines OBE.
2006-09-06 23:49:36 +00:00
Warner Losh
56635f6bd3 s/Static/static/g
s/device_ptr_t/device_t/g

No md5 changes in the .o's

# Note to the md5 tracking club: $FreeBSD$ changes md5 after every commit
# so you need to checkout -kk to get $FreeBSD$ instead of the actual value
# of the keyword.
2006-09-06 23:44:25 +00:00
Warner Losh
f455418269 More antideclarification.
md5 still the same after all these years (and after -g was removed).
2006-09-06 23:29:53 +00:00
Warner Losh
da271ed509 Remove the portibility layer goo.
Produces the same .o as before.

md5 by: /sbin/md5
2006-09-06 21:53:28 +00:00
John-Mark Gurney
378f231e7d add a newbus method for obtaining the bus's bus_dma_tag_t... This is
required by arches like sparc64 (not yet implemented) and sun4v where there
are seperate IOMMU's for each PCI bus...  For all other arches, it will
end up returning NULL, which makes it a no-op...

Convert a few drivers (the ones we've been working w/ on sun4v) to the
new convection...  Eventually all drivers will need to replace the parent
tag of NULL, w/ bus_get_dma_tag(dev), though dev is usually different for
each driver, and will require hand inspection...

Reviewed by:	scottl (earlier version)
2006-09-03 00:27:42 +00:00
Warner Losh
5657c870dc Don't put a ; after while (0)
Submitted by:	jmg
2006-08-17 22:42:56 +00:00
Bruce M Simpson
d180698897 Add identifier for the Epson CX3650 all-in-one scanner function.
This enables the scanner function on these devices to be detected
and probed by uscanner(4), but only when ulpt is not loaded.

PR:		usb/92462
Submitted by:	Friedrich Volkmann
MFC after:	30 days
2006-08-06 12:01:42 +00:00
Sam Leffler
4350e12f23 remove unneccessary null ptr check
Coverity ID:	173918
2006-08-02 04:55:04 +00:00
Sam Leffler
9ee0e22742 support for 802.11 packet injection via bpf
Reviewed by:	arch@
MFC after:	1 month
2006-07-26 03:30:50 +00:00
Warner Losh
dbde02fe74 Add a few more devices to the supported list. Specifically, the PHAROS and
the silly dongly I just bought at Radio Shack.
2006-07-24 19:47:00 +00:00
Andrew Thompson
3bdf75a5ca Change the multicast calculation to be the same as the other usb drivers and
avoid calling into the usb code with the lock held. This doenst fix the
fundamental usb sleeping problem but at least the adapter can be used.
2006-07-05 00:49:26 +00:00
Maxim Konovalov
b01f957bcd o Remove rev. 1.30 leftover. From Damien: However, this code path
is never taken since there aren't any 802.11a ural(4) sticks available
on the market.

PR:		kern/99676
Submitted by:	KIYOHARA Takashi
Reviewed by:	damien
MFC after:	1 week
2006-07-01 13:39:04 +00:00
Takanori Watanabe
84c269d3f3 Comment fix.
Pointed out by: ume via IRC
2006-06-29 06:31:13 +00:00
Takanori Watanabe
bc5f8a4e55 Willcom WSIM DD support. 2006-06-29 06:17:48 +00:00
Matteo Riondato
0a8d09fe8a Add a forgotten "," 2006-06-19 16:31:58 +00:00
Matteo Riondato
d8eab5725f Add Hamlet eXagerate XURS232 USB-Serial adapter
PR:		usb/98983
Submitted by:	Massimo Lusetti
MFC after:	1 week
2006-06-19 16:30:35 +00:00
Alexander Leidinger
8cc6aade65 Add support for the Aceeca Mez1000 RDA.
PR:		82839
Submitted by:	Mike Durian <durian@shadetreesoftware.com>
2006-06-18 17:55:29 +00:00
Alexander Leidinger
8128fd701e Add support for:
- Curitel PC5740 Wireless Modem (Verizon's PCMCIA card)
 - Sierra MC5720 Wireless Modem (Built in to Thinkpad X60s)

PR:		98908
Submitted by:	Michael Collette <metrol@metrol.net>
2006-06-18 17:54:33 +00:00
Alexander Leidinger
04cb71301e Add support for:
- Curitel PC5740 Wireless Modem (Verizon's PCMCIA card)
 - Sierra MC5720 Wireless Modem (Built in to Thinkpad X60s)

The scanner in the PR is already supported.

PR:		98908
Submitted by:	Michael Collette <metrol@metrol.net>
2006-06-18 17:43:38 +00:00
Alexander Leidinger
4e93c5c41e Add Epson Perfection 1270 scanner. All other scanners in the PR are already
detected, but with a different name.

PR:		98106
Submitted by:	Lars Engels <lars.engels@0x20.net>
2006-06-18 17:29:16 +00:00
Alexander Leidinger
e932b6c236 When attaching an Xbox 360 gamepad a computer, the LED on the gamepad
blinks by default. When the operating system (read: normally an Xbox
360) initializes the gamepad, the LED stops blinking.

Change our uhid code to do the same.

PR:		97169
Submitted by:	Ed Schouten <ed@fxq.nl>
2006-06-18 17:18:17 +00:00
Ian Dowse
c62502d1f6 Fix a number of cases where ugen would panic, especially when the
device went away while open or if you tried to change the config
number while devices were open. Based on the patch from the PR with
a number of changes as discussed with the submitter.

PR:		usb/97271
Submitted by:	Anish Mistry
2006-06-05 14:44:39 +00:00
Ian Dowse
a48ddf5b85 Add a sleep lock that protects access to sequences of blocking
axe_cmd() calls. Without this the device can get confused if multiple
threads attempt these operations concurrently. The problem was
easily reproducible by running "ifconfig axe0" in a loop because
eventually it would conflict with axe_tick_task().

A similar approach is probably required in all USB ethernet drivers.
2006-06-04 14:42:38 +00:00
Ian Dowse
3b63ffa20c Allow zero-length read/write operations to get through to the
hardware. Also set both the read and write timeouts from the
USB_SET_TIMEOUT ioctl.
2006-06-03 10:37:42 +00:00
Sam Leffler
ff046a6c6b add missed calls to bpf_peers_present 2006-06-02 23:14:40 +00:00
Christian S.J. Peron
16d878cc99 Fix the following bpf(4) race condition which can result in a panic:
(1) bpf peer attaches to interface netif0
	(2) Packet is received by netif0
	(3) ifp->if_bpf pointer is checked and handed off to bpf
	(4) bpf peer detaches from netif0 resulting in ifp->if_bpf being
	    initialized to NULL.
	(5) ifp->if_bpf is dereferenced by bpf machinery
	(6) Kaboom

This race condition likely explains the various different kernel panics
reported around sending SIGINT to tcpdump or dhclient processes. But really
this race can result in kernel panics anywhere you have frequent bpf attach
and detach operations with high packet per second load.

Summary of changes:

- Remove the bpf interface's "driverp" member
- When we attach bpf interfaces, we now set the ifp->if_bpf member to the
  bpf interface structure. Once this is done, ifp->if_bpf should never be
  NULL. [1]
- Introduce bpf_peers_present function, an inline operation which will do
  a lockless read bpf peer list associated with the interface. It should
  be noted that the bpf code will pickup the bpf_interface lock before adding
  or removing bpf peers. This should serialize the access to the bpf descriptor
  list, removing the race.
- Expose the bpf_if structure in bpf.h so that the bpf_peers_present function
  can use it. This also removes the struct bpf_if; hack that was there.
- Adjust all consumers of the raw if_bpf structure to use bpf_peers_present

Now what happens is:

	(1) Packet is received by netif0
	(2) Check to see if bpf descriptor list is empty
	(3) Pickup the bpf interface lock
	(4) Hand packet off to process

From the attach/detach side:

	(1) Pickup the bpf interface lock
	(2) Add/remove from bpf descriptor list

Now that we are storing the bpf interface structure with the ifnet, there is
is no need to walk the bpf interface list to locate the correct bpf interface.
We now simply look up the interface, and initialize the pointer. This has a
nice side effect of changing a bpf interface attach operation from O(N) (where
N is the number of bpf interfaces), to O(1).

[1] From now on, we can no longer check ifp->if_bpf to tell us whether or
    not we have any bpf peers that might be interested in receiving packets.

In collaboration with:	sam@
MFC after:	1 month
2006-06-02 19:59:33 +00:00
Ian Dowse
46f1e0d36c If a zero-length bulk or interrupt transfer is requested then assume
USBD_FORCE_SHORT_XFER to ensure that we actually build and execute
a transfer. This means that the various alloc_sqtd_chain functions
will always construct a transfer, so it is safe to modify the
allocated descriptors on return. Previously there were cases where
a zero length transfer would cause a NULL dereference.

Reported by:	bp
2006-05-28 23:37:04 +00:00
Ian Dowse
368030a87a Use the limited scatter-gather capabilities of ehci, ohci and uhci
host controllers to avoid the need to allocate any multi-page
physically contiguous memory blocks. This makes it possible to use
USB devices reliably on low-memory systems or when memory is too
fragmented for contiguous allocations to succeed.

The USB subsystem now uses bus_dmamap_load() directly on the buffers
supplied by USB peripheral drivers, so this also avoids having to
copy data back and forth before and after transfers. The ehci and
ohci controllers support scatter/gather as long as the buffer is
contiguous in the virtual address space. For uhci the hardware
cannot handle a physical address discontinuity within a USB packet,
so it is necessary to copy small memory fragments at times.
2006-05-28 05:27:09 +00:00
Ian Dowse
e97ba859b3 NULL out ii->stdstart and ii->stdend when they are invalid. This
is not necessary for correct operation but makes it clearer that
freed transfer descriptors cannot be accessed.
2006-05-28 01:17:13 +00:00
Ian Dowse
a7c15197cf Fix a harmless typo where the software pointer in the dummy QH for
control transfers did not match the hardware pointer.
2006-05-28 01:07:46 +00:00