Commit Graph

2349 Commits

Author SHA1 Message Date
Ed Schouten
c5e30cc02b Last minute TTY API change: remove mutex argument from tty_alloc().
I don't want people to override the mutex when allocating a TTY. It has
to be there, to keep drivers like syscons happy. So I'm creating a
tty_alloc_mutex() which can be used in those cases. tty_alloc_mutex()
should eventually be removed.

The advantage of this approach, is that we can just remove a function,
without breaking the regular API in the future.
2009-05-29 06:41:23 +00:00
Andrew Thompson
760bc48e7e s/usb2_/usb_/ on all C structs for the USB stack. 2009-05-28 17:36:36 +00:00
Andrew Thompson
c86aead66c Allocate the usb serial, manufacturer and product strings rather than use char
arrays in the usb_device struct. This also eliminates USB_HAVE_STRINGS.
2009-05-27 23:12:02 +00:00
Andrew Thompson
fa64b9442b Add support for the Apple MacBook Pro keyboard
- add key mappings for fn keys
- byte swapping for certain models
- Fix leds for keyboards which require an ID byte for the HID output structures

Submitted by:	Hans Petter Selasky
2009-05-27 19:27:29 +00:00
Andrew Thompson
f72c0c2e5c Remove empty dir. 2009-05-27 16:44:43 +00:00
Andrew Thompson
84c5da4c4e move ng_ubt_var.h back to its original place 2009-05-27 16:34:08 +00:00
Andrew Thompson
3671d9d810 move ng_ubt.c back to its original place 2009-05-27 16:33:08 +00:00
Andrew Thompson
d434bfe44a move ubtbcmfw.c back to its original place 2009-05-27 16:32:05 +00:00
Weongyo Jeong
f58ca84122 ports urtw(4) for USB2. Additionally it supports a 8187B chipset weakly
that it needs more stabilization.
2009-05-27 03:57:38 +00:00
Andrew Thompson
3e8739762f Unifdef __NetBSD__ here, the usb stack as a whole doesnt support NetBSD and it
obsfucates the code.
2009-05-26 21:20:42 +00:00
Andrew Thompson
2b85e080e3 Do not forcefully close the write transfer when closing the tty, it needs to
run to completion and drain the tty queue.
2009-05-26 17:06:36 +00:00
Andrew Thompson
fe45987e99 Don't clear last usage when a new HID item is found, it improves parsing of
Apple keyboard HID descriptors.

Submitted by:	Hans Petter Selasky
2009-05-21 17:55:18 +00:00
Andrew Thompson
a688f49162 Remove README.TXT as the info is in usb(4). 2009-05-21 17:48:41 +00:00
Andrew Thompson
df05202dd5 Add Sharp WILLCOM03 ipaq and Option GTHSDPA 3g device ids.
Submitted by:	Hans Petter Selasky
2009-05-21 17:47:27 +00:00
Andrew Thompson
774651eee7 Use the correct usb config number on attach.
Reported by:	Greg Rivers
Submitted by:	Hans Petter Selasky
2009-05-21 17:45:37 +00:00
Andrew Thompson
1d70ff1cf6 Fix a failure to report failure on stalled status stage for control
transactions.

Submitted by:	Hans Petter Selasky
2009-05-21 17:43:35 +00:00
Andrew Thompson
55e76c210e Add a driver for the AVR32 series USB Device Controller. Not hooked up as
FreeBSD does not yet support this platform but it makes it easier to stay in
sync.

Submitted by:	Hans Petter Selasky
2009-05-21 17:42:32 +00:00
Andrew Thompson
476183df94 Improve device mode (gadget) stall handling.
Some hardware easily comes out of sync with regard to whether the current or
the next control transfer should be stalled, if a stall command is always
issued before receiving the SETUP packet. After this patch the stall command
will only be issued when a transfer should actually be stalled.

Submitted by:	Hans Petter Selasky
2009-05-21 17:39:21 +00:00
Andrew Thompson
88f3df72ef Print out device attachment. 2009-05-21 02:26:51 +00:00
Andrew Thompson
9360ae4073 Rename the usb sysctl tree from hw.usb2.* back to hw.usb.*.
Submitted by:	Hans Petter Selasky
2009-05-21 01:48:42 +00:00
Andrew Thompson
8d2dd5dd85 Use enums for speed and rev data types. 2009-05-21 01:05:21 +00:00
Andrew Thompson
f29a072444 - rename usb2_mode to usb_mode [1]
- change variable types to use the enum

Submitted by:	Hans Petter Selasky [1]
2009-05-21 00:04:17 +00:00
Sam Leffler
5463c4a485 Overhaul monitor mode handling:
o replace DLT_IEEE802_11 support in net80211 with DLT_IEEE802_11_RADIO
  and remove explicit bpf support from wireless drivers; drivers now
  use ieee80211_radiotap_attach to setup shared data structures that
  hold the radiotap header for each packet tx/rx
o remove rx timestamp from the rx path; it was used only by the tdma support
  for debugging and was mostly useless due to it being 32-bits and mostly
  unavailable
o track DLT_IEEE80211_RADIO bpf attachments and maintain per-vap and
  per-com state when there are active taps
o track the number of monitor mode vaps
o use bpf tap and monitor mode vap state to decide when to collect radiotap
  state and dispatch frames; drivers no longer explicitly directly check
  bpf state or use bpf calls to tap frames
o handle radiotap state updates on channel change in net80211; drivers
  should not do this (unless they bypass net80211 which is almost always
  a mistake)
o update various drivers to be more consistent/correct in handling radiotap
o update ral to include TSF in radiotap'd frames
o add promisc mode callback to wi

Reviewed by:	cbzimmer, rpaulo, thompsa
2009-05-20 20:00:40 +00:00
Andrew Thompson
6f6932dc0b Use defines for register offsets that do not change.
Submitted by:	Hans Petter Selasky
2009-05-20 17:03:12 +00:00
Andrew Thompson
7eaa41aed8 - Add new register definitions
- Enable the controller and wait for the PLL to start

Submitted by:	Hans Petter Selasky
2009-05-20 17:00:55 +00:00
Andrew Thompson
b28838a861 The register shift is not needed on this controller.
Submitted by:	Hans Petter Selasky
2009-05-20 16:58:53 +00:00
Weongyo Jeong
e557e68088 try to unsetup USB xfers before calling ieee80211_ifdetach() to fix a
bug referencing a destroyed lock within TX callbacks during device
detach.

Submitted by:	hps (original version)
Tested by:	Lucius Windschuh <lwindschuh at googlemail.com>
2009-05-20 03:49:16 +00:00
Sam Leffler
afb8a6b500 add TRENDnet TEW-504UB/EU
Submitted by:	Lucius Windschuh <lwindschuh@googlemail.com>
2009-05-17 19:51:08 +00:00
Sam Leffler
f61336e4cb fix 11a channel use; mark OFDM operation correctly
Submitted by:	Lucius Windschuh <lwindschuh@googlemail.com>
2009-05-17 19:46:50 +00:00
Andrew Thompson
7261357fbc Ensure the bmRequestType is the right type for the incoming control request.
Submitted by:	Hans Petter Selasky
2009-05-13 18:26:55 +00:00
Andrew Thompson
8ea86e467f Add parenthesis around the xfer macro argument.
Submitted by:	Hans Petter Selasky
2009-05-13 18:25:14 +00:00
Andrew Thompson
ecf65ed434 Make sure collections have the usage field set.
Submitted by:	Hans Petter Selasky
2009-05-13 18:06:52 +00:00
Andrew Thompson
07532e4997 Check the correct variable for IO_NDELAY.
Submitted by:	Hans Petter Selasky
2009-05-13 18:05:40 +00:00
Andrew Thompson
c773c25419 Add debug lines for fullspeed and highspeed xfer completion.
Submitted by:	Hans Petter Selasky
2009-05-13 18:04:51 +00:00
Andrew Thompson
3a67e91430 Sync to P4
Add umass quirks for Alcor AU6390, Cypress PATA 6830XX and MPMan MPF400.

Submitted by:	Hans Petter Selasky
2009-05-13 18:03:23 +00:00
Andrew Thompson
f1f8840814 The transfer must return USB_ERR_CANCELLED when the device is gone due to the
way usb drivers work.

Submitted by:	Hans Petter Selasky
2009-05-13 17:58:37 +00:00
Weongyo Jeong
922f7c5c21 Add WUSB54AG and XM142 entries for upgt(4) 2009-05-12 02:05:42 +00:00
Weongyo Jeong
879f0eff53 ports upgt(4) driver for USB2. 2009-05-11 02:39:49 +00:00
Andrew Thompson
822e5d76f8 Use a 32 bit type for the interface mask as this equals the max interface
count.
2009-05-07 17:05:03 +00:00
Andrew Thompson
426909d969 Add the Sierra AC885U and increase the max ports to 8. 2009-05-07 02:17:09 +00:00
Andrew Thompson
e92a451510 - Fix the u3g port detection where it would not calculate the correct number of
ports when multiple interfaces are present.
- Claim all interfaces regardless of how many are attached
2009-05-07 02:15:58 +00:00
Andrew Thompson
a173706bbd Use vendor and product macro expansion to make the device table smaller and
more readable.
2009-05-07 02:13:56 +00:00
Andrew Thompson
b9c81a5dce Make sure the frame list base address is re-programmed after stopping the USB
schedule, in case the hardware clears the frame list base address.

Submitted by:	Hans Petter Selasky
Reported by:	Chao Shin
2009-05-05 15:41:30 +00:00
Andrew Thompson
6b1bca02b9 Remove USB shutdown methods from device drivers as its the host controllers
responsibility to detach the bus.

PR:		usb/133896
Submitted by:	Hans Petter Selasky
2009-05-05 15:39:29 +00:00
Andrew Thompson
ec8f31275d Revert part of r191494 which used the udev state to mark suspending, this needs
to be set via two variables (peer_suspended and self_suspended) and can not be
merged into one.

Submitted by:	Hans Petter Selasky
Pointy hat:	me
2009-05-05 15:36:23 +00:00
Andrew Thompson
5efea30f03 Create a taskqueue for each wireless interface which provides a serialised
sleepable context for net80211 driver callbacks. This removes the need for USB
and firmware based drivers to roll their own code to defer the chip programming
for state changes, scan requests, channel changes and mcast/promisc updates.
When a driver callback completes the hardware state is now guaranteed to have
been updated and is in sync with net80211 layer.

This nukes around 1300 lines of code from the wireless device drivers making
them more readable and less race prone.

The net80211 layer has been updated as follows
 - all state/channel changes are serialised on the taskqueue.
 - ieee80211_new_state() always queues and can now be called from any context
 - scanning runs from a single taskq function and executes to completion. driver
   callbacks are synchronous so the channel, phy mode and rx filters are
   guaranteed to be set in hardware before probe request frames are
   transmitted.

Help and contributions from Sam Leffler.

Reviewed by:	sam
2009-05-02 15:14:18 +00:00
Andrew Thompson
6fca021096 We need to ref the bss node when sending the beacon since it goes through the
normal tx path and will be decremented on the mbuf free.
2009-04-30 22:30:01 +00:00
Andrew Thompson
4d4fa6edd4 Make the state string descriptions public. 2009-04-25 21:25:52 +00:00
Andrew Thompson
bd21677868 Track the usb device state as its powered on, addressed and configured. This helps
to avoid touching the device when it is not going to respond and would otherwise
timeout.

Implement the suspend tracking as a udev state too.
2009-04-25 21:10:06 +00:00
Andrew Thompson
459d369ee2 MFp4 //depot/projects/usb@160930
Change the roothub exec functions to take the usb request and data pointers
directly rather than placing them on the parent bus struct.

Submitted by:	Hans Petter Selasky
2009-04-22 17:08:16 +00:00
Andrew Thompson
c1911c1b7c MFp4 //depot/projects/usb@160708
Need to check Read/Write allowed before writing any data for non-control
transfers.

Submitted by:	Hans Petter Selasky
2009-04-22 17:08:13 +00:00
Andrew Thompson
672c9965ef MFp4 //depot/projects/usb@160706
Resolve possible device side mode deadlock by creating another thread.

Submitted by:	Hans Petter Selasky
2009-04-22 17:08:10 +00:00
Andrew Thompson
39063699e6 MFp4 //depot/projects/usb@160678
Remove unused field.

Submitted by:	Hans Petter Selasky
2009-04-22 17:08:07 +00:00
Andrew Thompson
9469c92974 MFp4 //depot/projects/usb@160655
Fix possible issue with clear-stall and set-config happening at the same time.

Submitted by:	Hans Petter Selasky
2009-04-22 17:08:04 +00:00
Andrew Thompson
88b4e0abcf MFp4 //depot/projects/usb@160614
Fix errornous printout.

Submitted by:	Hans Petter Selasky
2009-04-22 17:07:59 +00:00
Andrew Thompson
8ac0864630 MFp4 //depot/projects/usb@160485
Fix a bug in the USB power daemon code where connection of multiple HUBs in
series would result in incorrect device suspend.

Reported by:	Nicolas xxx@wanadoo.fr
Submitted by:	Hans Petter Selasky
2009-04-22 17:07:56 +00:00
Andrew Thompson
495f25cedc MFp4 //depot/projects/usb@160413
Use direct reference to parent high-speed HUB instead of indirect, due to
pointer clearing race at detach of parent USB HUB.

Reported by:	kientzle
Submitted by:	Hans Petter Selasky
PR:		usb/133545
2009-04-22 17:07:53 +00:00
Takanori Watanabe
450a309dfe Add another FTDI serial converter. 2009-04-21 05:06:31 +00:00
Andrew Thompson
853a10a581 Revert r190676,190677
The geom and CAM changes for root_hold are the wrong solution for USB design
quirks.

Requested by:	scottl
2009-04-10 04:08:34 +00:00
Andrew Thompson
6830af1a05 Remove usb_sw_transfer.[ch] which are now empty after r190735. 2009-04-06 00:32:54 +00:00
Andrew Thompson
fde875265f Provide a better commit log for r190735, forced by making a whitespace change.
Refactor how we interface with the root HUB. This is achieved by making a
direct call from usb2_do_request to the host controller for root hub requests,
this call will perform the controller specific register read/writes and return
the error code.

This cuts out a lot of code in the host controller files and saves one thread
per USB bus.

Submitted by:	Hans Petter Selasky
2009-04-06 00:22:49 +00:00
Andrew Thompson
5cbbd666e1 Catch up with usb2_config struct layout changes. 2009-04-05 18:26:19 +00:00
Andrew Thompson
9f2b42e596 MFp4 //depot/projects/usb@160056
Remove code for unused and unlikely quirk, "uq_power_claim"

Submitted by:	Hans Petter Selasky
2009-04-05 18:22:13 +00:00
Andrew Thompson
afa07055be MFp4 //depot/projects/usb@160052
Wait until line configuration is complete before starting data transfers.

Submitted by:	Hans Petter Selasky
2009-04-05 18:22:03 +00:00
Andrew Thompson
de967835e0 MFp4 //depot/projects/usb@159995
- add support for more complicated HID descriptors which can have multiple
  definitions of the same field.
- remove old modulo patch in ums, which I think is due to bad HID parsing,
  which should be fixed now.

Reported by:	netchild
Submitted by:	Hans Petter Selasky
2009-04-05 18:21:51 +00:00
Andrew Thompson
03797f3300 MFp4 //depot/projects/usb@159948
Add more debugging output on enumeration failures.

Submitted by:	Hans Petter Selasky
2009-04-05 18:21:31 +00:00
Andrew Thompson
4565300d56 MFp4 //depot/projects/usb@159946
Some cancelable flags are always true.  Substitute these away. These cancelable
flags were mostly useful with the root HUB which is now handled differently.

Submitted by:	Hans Petter Selasky
2009-04-05 18:21:21 +00:00
Andrew Thompson
3b01d5130c MFp4 //depot/projects/usb@159926
Minor code factorisation in atmegadci.c

Submitted by:	Hans Petter Selasky
2009-04-05 18:21:08 +00:00
Andrew Thompson
c48fb077ea MFp4 //depot/projects/usb@159925
Cast variables properly for non-32-bit platforms.

Submitted by:	Hans Petter Selasky
2009-04-05 18:20:58 +00:00
Andrew Thompson
3930731567 MFp4 //depot/projects/usb@159922
Refactor how we interface with the root HUB. This cuts around 1200 lines of
code totally and saves one thread per USB bus.

Submitted by:	Hans Petter Selasky
2009-04-05 18:20:49 +00:00
Andrew Thompson
4eae601ebd MFp4 //depot/projects/usb@159909
- make usb2_power_mask_t 16-bit
- remove "usb2_config_sub" structure from "usb2_config". To compensate for this
  "usb2_config" has a new field called "usb_mode" which select for which mode
  the current xfer entry is active. Options are: a) Device mode only b) Host
  mode only (default-by-zero) c) Both modes.  This change was scripted using
  the following sed script: "s/\.mh\././g".
- the standard packet size table in "usb_transfer.c" is now a function, hence
  the code for the function uses less memory than the table itself.

Submitted by:	Hans Petter Selasky
2009-04-05 18:20:38 +00:00
Andrew Thompson
3b52b6f172 MFp4 //depot/projects/usb@159908
Reduce the amount of memory used by better sizing buffer arrays.

Submitted by:	Hans Petter Selasky
2009-04-05 18:20:24 +00:00
Andrew Thompson
51ec16035f MFp4 //depot/projects/usb@159897
Add new endpoint direction values for use with usb2_config

Submitted by:	Hans Petter Selasky
2009-04-05 18:20:13 +00:00
Andrew Thompson
63521bbc5a MFp4 //depot/projects/usb@159871
- bugfixes after the memory usage reduction patch
- Use "udev->pipes_max" instead of USB_EP_MAX
- Use correct "bmRequestType" for getting the config descriptor.

Submitted by:	Hans Petter Selasky
2009-04-05 18:20:03 +00:00
Andrew Thompson
bdd4120608 MFp4 //depot/projects/usb@159866
- memory usage reduction by only allocating the required USB pipes and USB
  interfaces.
- cleanup some USB parsing functions to be more flexible.

Submitted by:	Hans Petter Selasky
2009-04-05 18:19:52 +00:00
Andrew Thompson
0ed53d4515 MFp4 //depot/projects/usb@159864
Fix possible deadlock with UGEN at detach.

Submitted by:	Hans Petter Selasky
2009-04-05 18:19:42 +00:00
Andrew Thompson
dab47558c8 MFp4 //depot/projects/usb@159863
Speed up the endpoint descriptor search

Submitted by:	Hans Petter Selasky
2009-04-05 18:19:30 +00:00
Andrew Thompson
7efaaa9a91 MFp4 //depot/projects/usb@159811
First patch in a series of memory save patches.

Submitted by:	Hans Petter Selasky
2009-04-05 18:19:19 +00:00
Andrew Thompson
ab32485fd9 MFp4 //depot/projects/usb@159806
Properly name usb2_uref_location() so that it is not confused with
usb2_unref_location() .

Submitted by:	Hans Petter Selasky
2009-04-05 18:19:10 +00:00
Andrew Thompson
9e6e0ec449 MFp4 //depot/projects/usb@159797
Remove unused field in "struct usb2_pipe".

Submitted by:	Hans Petter Selasky
2009-04-05 18:19:00 +00:00
Andrew Thompson
684e3f2245 MFp4 //depot/projects/usb@159700
Get rid of the last CALLOUT_RETURNUNLOCKED reference.

Submitted by:	Hans Petter Selasky
2009-04-05 18:18:47 +00:00
Andrew Thompson
72b532e501 MFp4 //depot/projects/usb@159677
Remove redundant locking.

Submitted by:	Hans Petter Selasky
2009-04-05 18:18:36 +00:00
Andrew Thompson
eb846b4eb5 MFp4 //depot/projects/usb@159674
Fix more corner cases around reception of SETUP packets.

Submitted by:	Hans Petter Selasky
2009-04-05 18:18:25 +00:00
Andrew Thompson
f3464815ee MFp4 //depot/projects/usb@159673
Fix a corner case around stalling SETUP packets in device side mode.

Submitted by:	Hans Petter Selasky
2009-04-05 18:18:16 +00:00
Andrew Thompson
df075012e8 MFp4 //depot/projects/usb@159671
Fix interrupt register setting on the atmegadci controller.

Submitted by:	Hans Petter Selasky
2009-04-05 18:18:07 +00:00
Andrew Thompson
01e1df136a MFp4 //depot/projects/usb@159562
Reapply r190173 with compilation fixed on 64bit arches.

Submitted by:	Hans Petter Selasky
2009-04-05 18:18:01 +00:00
Weongyo Jeong
dc60165b73 Add uath(4) wireless USB driver for Atheros AR5005UG and AR5005UX
chipsets.

Reviewed by:	sam
2009-04-04 11:23:00 +00:00
Andrew Thompson
626fc9fe3d Add a how argument to root_mount_hold() so it can be passed NOWAIT and be called
in situations where sleeping isnt allowed.
2009-04-03 19:46:12 +00:00
Kevin Lo
2da462e383 Add another rum(4) device found in
http://www.fit-pc.com/new/whats-new.html
2009-03-31 07:40:36 +00:00
Sam Leffler
339ccfb391 Hoist 802.11 encapsulation up into net80211:
o call ieee80211_encap in ieee80211_start so frames passed down to drivers
  are already encapsulated
o remove ieee80211_encap calls in drivers
o fixup wi so it recreates the 802.3 head it requires from the 802.11
  header contents
o move fast-frame aggregation from ath to net80211 (conditional on
  IEEE80211_SUPPORT_SUPERG):
  - aggregation is now done in ieee80211_start; it is enabled when the
    packets/sec exceeds ieee80211_ffppsmin (net.wlan.ffppsmin) and frames
    are held on a staging queue according to ieee80211_ffagemax
    (net.wlan.ffagemax) to wait for a frame to combine with
  - drivers must call back to age/flush the staging queue (ath does this
    on tx done, at swba, and on rx according to the state of the tx queues
    and/or the contents of the staging queue)
  - remove fast-frame-related data structures from ath
  - add ieee80211_ff_node_init and ieee80211_ff_node_cleanup to handle
    per-node fast-frames state (we reuse 11n tx ampdu state)
o change ieee80211_encap calling convention to include an explicit vap
  so frames coming through a WDS vap are recognized w/o setting M_WDS

With these changes any device able to tx/rx 3Kbyte+ frames can use fast-frames.

Reviewed by:	thompsa, rpaulo, avatar, imp, sephe
2009-03-30 21:53:27 +00:00
Sam Leffler
26d39e2c68 o add ic_rt to track the rate table for the current channel; this enables
calculation of packet transmit times to do things like check txop limits
o remove equivalent driver code and convert to use net80211 state
2009-03-29 21:17:08 +00:00
Sam Leffler
29aca94080 Eliminate ic_myaddr so changing the mac address of a device works correctly:
o remove ic_myaddr from ieee80211com
o change ieee80211_ifattach to take the mac address of the physical device
  and use that to setup the lladdr.
o replace all references to ic_myaddr in drivers by IF_LLADDR
o related cleanups (e.g. kill dead code)

PR:		kern/133178
Reviewed by:	thompsa, rpaulo
2009-03-29 17:59:14 +00:00
Andrew Thompson
b3e9a2aaac The buffer start and end phys addresses should be 0x0 for an OHCI zero length
packet, this fixes LS/FS devices on the Gateworks 2348 XScale board.

Reviewed by:	HPS
2009-03-27 16:56:01 +00:00
Andrew Thompson
91f72cedda Fix order of debug printf items, addr and config# were swapped. 2009-03-23 19:10:38 +00:00
Alexander Kabaev
62a5f39429 Do not pass uninitialized data buffer to devctl_queue_data function.
This was botched in revision 190191.
2009-03-23 01:24:17 +00:00
Andrew Thompson
2989a67790 Set the endpoint on the preallocated fifo so it doesnt get matched as an
endpoint fifo.

Reported by:	Pieter de Goeje
2009-03-22 17:09:56 +00:00
Warner Losh
e952f9cf75 NO_INQUIRY is wrong for this device. Alternatively, if it is right,
it is right for only a tiny fraction of these devices and this
wild-card entry is too broad.

# I run a kernel without this entry at all without ill effects...
2009-03-22 13:17:46 +00:00
Andrew Thompson
cba3049682 Improve debugging output around ioctls. 2009-03-22 04:19:36 +00:00
Andrew Thompson
96a7948cf6 Revert r190173 as it breaks 64bit arches. 2009-03-21 05:44:22 +00:00
Andrew Thompson
8755859a43 Fix compile with USB_HAVE_BUSDMA/USB_HAVE_UGEN/USB_HAVE_STRINGS.
Submitted by:	Hans Petter Selasky
2009-03-20 23:12:14 +00:00
Andrew Thompson
d891ddcaea Add umass quirk.
PR:			usb/132799
Reported by:		Yoshihiro Ota
Submitted by:		Hans Petter Selasky
2009-03-20 22:17:27 +00:00
Andrew Thompson
01cf783140 MFp4 //depot/projects/usb @159423, 159497
- Return a Zero Length packet on read errors.
- Allow for smaller buffer size.

Submitted by:	Hans Petter Selasky
2009-03-20 22:15:22 +00:00
Andrew Thompson
80536a485c MFp4 //depot/projects/usb@159446
Remove unused and depreciated function: usb2_get_devid().

Submitted by:	Hans Petter Selasky
2009-03-20 22:12:15 +00:00
Andrew Thompson
090f65a6f6 MFp4 //depot/projects/usb@159517
Fix warnings with the IAR compiler.

Submitted by:	Hans Petter Selasky
2009-03-20 22:10:36 +00:00
Andrew Thompson
bafdb74c0b MFp4 //depot/projects/usb
Sync usb_core.h after header changes.

Submitted by:	Hans Petter Selasky
2009-03-20 22:04:33 +00:00
Andrew Thompson
e1ccac965c MFp4 //depot/projects/usb @159479,159502,159516,159522,159529
Workaround for buggy USB hardware not handling new SETUP packet before STATUS
stage is complete, this allows xfers to endpoint0 to return a short frame.

Submitted by: Hans Petter Selasky
Reported by:  me
2009-03-20 22:01:45 +00:00
Andrew Thompson
0f7d454847 MFp4 //depot/projects/usb @159479,159502,159516,159522,159529
Workaround for buggy USB hardware not handling new SETUP packet before STATUS
stage is complete, this allows xfers to endpoint0 to return a short frame.

Submitted by:	Hans Petter Selasky
Reported by:	me
2009-03-20 21:57:54 +00:00
Andrew Thompson
578d0eff90 MFp4 //depot/projects/usb @159431,159437,159438
- start using the new USB typedefs in the USB core
- Remove usage of USB_ADD_BYTES()

Submitted by:	Hans Petter Selasky
2009-03-20 21:50:54 +00:00
Andrew Thompson
bdc081c60f MFp4 //depot/projects/usb@159392
Add ifdefs for making parts of usb conditional.

Submitted by:	Hans Petter Selasky
2009-03-20 21:48:11 +00:00
Andrew Thompson
ab42e8b2df MFp4 //depot/projects/usb @159430
- Move tunable defines into usb_core.h and dependancy towards usb_defs.h
- Leave hardcoded defines in "usb_defs.h".
- Allow overriding all tunable defines.
- Add more customisable typedefs.
- Correct maximum device number.

Submitted by:	Hans Petter Selasky
2009-03-20 19:04:31 +00:00
Andrew Thompson
c629193176 MFp4 //depot/projects/usb @159379,159380
Fixes for 8-bit and 16-bit compilation.

Submitted by:	Hans Petter Selasky
2009-03-20 18:59:53 +00:00
Andrew Thompson
296ade6016 MFp4 //depot/projects/usb @159375,159376,159377
Further remove dependancy towards Giant.

Submitted by:	Hans Petter Selasky
2009-03-20 18:56:27 +00:00
Andrew Thompson
2b78d30630 Remove the uscanner(4) driver, this follows the removal of the kernel scanner
driver in Linux 2.6. uscanner was just a simple wrapper around a fifo and
contained no logic, the default interface is now libusb (supported by sane).

Reviewed by:	HPS
2009-03-19 20:33:26 +00:00
Renato Botelho
102bad657b - Add Sun Type 7 keyboard
- Rename Type 6 entry (following NetBSD)
- Add Sun Type 7 Keyboard USB Hub

PR:		usb/132811
Reviewed by:	thompsa
Approved by:	thompsa
2009-03-19 17:16:33 +00:00
Andrew Thompson
7214348f57 MFp4 //depot/projects/usb 159225,159241,159292
Fix regression issue in the USB file system interface.
 - Use cdev_privdata pointer as indicator of correct file handle.
 - Remove redundant FIFO opened flags.

Don't send ZLP at close for ulpt and uscanner devices as this causes some
models to stop working. This reverts back to the USB1 behaviour.

Submitted by:	Hans Petter Selasky
2009-03-17 01:46:40 +00:00
Andrew Thompson
39fcd91bb5 MFp4 //depot/projects/usb 159238,159275
Add umass quirks.

Submitted by:	Michael Gmelin
2009-03-17 01:42:46 +00:00
Andrew Thompson
d3db083bcc Add Supertop IDE adapter and Quickcam entries. 2009-03-17 01:38:51 +00:00
Andrew Thompson
3f67dc0f46 HID usage minimum can be equal to the maximum.
Submitted by:	Hans Petter Selasky
Tested by:	Andreas Tobler
2009-03-13 22:28:37 +00:00
Andrew Thompson
46364b29a8 MFp4 //depot/projects/usb 159004,159053,159091
More HID parsing fixes for usb mice.
 - be less strict on the last HID item usage.
 - preserve item size and count accross items
 - improve default HID usage selection.

Tested by:	ache
Submitted by:	Hans Petter Selasky
2009-03-12 02:32:54 +00:00
Andrew Thompson
d59dbd0a3d MFp4 //depot/projects/usb 158981,159016,159024
Sync support for ATMEGA DCI parts.

Submitted by:	Hans Petter Selasky
2009-03-11 04:58:21 +00:00
Andrew Thompson
1be5bf51d3 Fix a possible NULL pointer access at controller attach.
Submitted by:	Hans Petter Selasky
2009-03-11 04:56:30 +00:00
Andrew Thompson
b1e14b53e3 Make sure HID has a default usage, this fixes recent mouse problems.
Tested by:	Renato Botelho
Tested by:	beech (earlier version)
Submitted by:	Hans Petter Selasky
2009-03-10 19:35:41 +00:00
Andrew Thompson
0f6e8f934f MFp4 //depot/projects/usb 158942,158948
Allow USB to be compiled without ugen support.

Submitted by:	Hans Petter Selasky
2009-03-09 20:08:08 +00:00
Andrew Thompson
07bf38d7cf Fix musb_otg.h include filename.
Submitted by:	Hans Petter Selasky
2009-03-09 20:05:46 +00:00
Andrew Thompson
bf87f556ac MFp4 //depot/projects/usb@158916
USB mouse patch to address complicated data reporting descriptors.

Reported by:	Boris Kotzev
Submitted by:	Hans Petter Selasky
2009-03-09 15:25:46 +00:00
Warner Losh
155a83e87a remove now-redunant cardbus attachment. 2009-03-09 13:23:54 +00:00
Andrew Thompson
da6c1373fa MFp4 //depot/projects/usb@158868
Fix bugs and improve HID parsing.
- fix possible memory leak found
- fix possible NULL pointer access
- fix possible invalid memory read
- parsing improvements
- reset item data position when a new report ID is detected.

Submitted by:	Hans Petter Selasky
2009-03-08 22:58:19 +00:00
Andrew Thompson
4309a3fb19 MFp4 //depot/projects/usb@158869
Fix sael init code.

Reported by:	Alberto Mijares
Submitted by:	Hans Petter Selasky
2009-03-08 22:55:17 +00:00
Andrew Thompson
75fd0939b4 Move m_getcl() into its own function. This also fixes a bug where the m_adj for
ETHER_ALIGN was having no effect since m_len had not been set.
2009-03-08 06:56:13 +00:00
Andrew Thompson
36002e92e9 Fix endian conversion from htole16 to htole32.
Tested with:	ARM xscale
2009-03-08 06:03:28 +00:00
Andrew Thompson
e55e1ebc35 (re)merge r186415,186416 from the old usb stack;
o add Transaction Translator support (still missing ISOC xfers)
o add EHCI_SCFLG_BIGEMMIO flag to force big-endian byte-select to be
  set in USBMODE
o split reset work into new public routine ehci_reset so bus shim drivers
  can force big-endian byte-select before ehci_init
o enable TT and big-endian MMIO
o force a reset before ehci_init to get byte-select setup

Also go back to using USB_EHCI_BIG_ENDIAN_DESC at compile time to enable the
byteswapping and reduce diffs to the original commits.

This fixes the new USB stack on the Cambria board.
2009-03-07 19:49:47 +00:00
Andrew Thompson
5f1286689c Fix some missed htole32 conversions to htoehci32.
Reviewed by:	hps
2009-03-07 18:08:59 +00:00
Andrew Thompson
d1864afbac MFp4 //depot/projects/usb@158692
Workaround a EHCI performance problem by issuing a doorbell after queueing a
bulk xfer.

Submitted by:	Hans Petter Selasky
2009-03-06 17:13:12 +00:00
Andrew Thompson
d953f72075 Ensure the cached rq pointer is still valid before waking up the address, the
zyd_cmd function may have timed out. It wouldnt cause a panic but could wakeup
someone.

Spotted by:	HPS
2009-03-06 17:04:47 +00:00
Joerg Wunsch
bbb39ba587 Add a couple of more things to the FTDI driver I came across:
. Dresden Elektronik "Wireless Handheld Terminal"
. Atmel STK541 "Zigbee Controller"

MFC after:	1 week
2009-03-06 14:53:51 +00:00
Andrew Thompson
8a93629e41 Fix usb2_poll not to return an error number as the function return value is a
bitmask of events.

Pointed out by:	HPS
2009-03-05 19:20:17 +00:00
Andrew Thompson
c3beab6ac5 Add support for the UNION interface descriptor, used by Nokia phones.
PR:		usb/117185
2009-03-05 16:15:07 +00:00
Andrew Thompson
dc4b1d1662 Add Mobile Action MA-620 Infrared Adapter.
PR:		usb/125072
Submitted by:	Alexander Logvinov
MFC after:	1 week
2009-03-04 03:47:57 +00:00
Andrew Thompson
9aef556d71 Rename the ushub device class back to uhub as it was in the old usb stack,
moused(8) looks for "uhub/ums" to decide if needs to load the module.

Reported by:	Garrett Cooper
2009-03-02 05:37:05 +00:00
Andrew Thompson
deefe58337 Move the serial drivers from Giant to using their own mutexs.
Tested with:	u3g, ubser, uplcom
2009-03-02 02:44:10 +00:00
Andrew Thompson
f35aaff035 A couple of style nits in the last commit
- unwrap short lines
 - move variable initialisation out of the declaration.
2009-02-28 17:20:00 +00:00
Andrew Thompson
f5f145ba07 - Remove the usb interface number from the device nodes as it is not needed.
- Do not recreate the device nodes in set_alt_interface as the endpoints do not
  change.

Submitted by:	Hans Petter Selasky
2009-02-28 17:14:03 +00:00
Andrew Thompson
50230f983b Change the last references to PRIV_ROOT. /dev/usb used to be world writable so
further root checks were needed, this isnt the case anymore but just change it
to PRIV_DRIVER until it can be investigated later.

Spotted by:	rwatson
2009-02-27 22:12:15 +00:00
Andrew Thompson
a09d8d7315 Remove ic_update_mcast calls that are not implemented.
Spotted by:	sam
Pointy hat:	me
2009-02-27 21:50:15 +00:00
Andrew Thompson
77ddf3d34a Partial sync to //depot/projects/usb
- Reissue the ctrl request on failure
- Ensure Tx and ctrl requests are not interleaved
- Add promisc callbacks

Obtained from:	Hans Petter Selasky
2009-02-27 21:14:29 +00:00
Andrew Thompson
ee3e3ff5c2 Change USB over to make_dev() for all device nodes, previously it hooked into
the devfs clone handler to open the (invisible) devices on the fly.

The /dev entries are layed out as follows,

 /dev/usbctl      = master device
 /dev/usb/0.1.0.5 = usb device, (<bus>.<dev>.<iface>.<endpoint>)
 /dev/ugen0.1 -> usb/0.1.0.0 = ugen link to ctrl endpoint

This also removes the custom permissions model from USB.  Bump
__FreeBSD_version to 800066.

Submitted by:	rink (earlier version)
2009-02-27 17:27:16 +00:00
Ed Schouten
5d38a4d4f7 Also use proper capitalisation of FreeBSD in other source files.
Approved by:	thompsa
2009-02-24 17:15:29 +00:00
Ed Schouten
4b0af1dacc Use my address of the FreeBSD project in the copyright statement in USB2.
If I remember correctly, our policy was to use FreeBSD with proper
capitalisation in our email addresses. Fix this in Nick Hibma's address
as well.
2009-02-24 17:10:43 +00:00
Andrew Thompson
750a268260 MFp4 //depot/projects/usb@158015
Add support for the Sael M460 3G modem.

Submitted by:	Hans Petter Selasky
2009-02-24 05:35:48 +00:00
Andrew Thompson
6c9cef576c Fix compiler warning. 2009-02-24 04:16:19 +00:00