Commit Graph

1967 Commits

Author SHA1 Message Date
Warner Losh
eb0fa74e92 A port of the zyd driver from NetBSD by . This supports the ZyDAS
ZD1211/ZD1211B USB IEEE 802.11b/g wireless network devices.  Not (yet)
connected to the build process (next batch of commits once I've looped
the current back back).

Submitted by: Weongyo Jeong
Reviewed by: sam@
Approved by: re@
2007-08-29 21:16:50 +00:00
Warner Losh
4c2b0b2a5e Add devices for the forthcoming zyd driver, ported from NetBSD, by
Weongyo Jeong.

Submitted by: Weongyo Jeong
Approved by: re@
2007-08-29 21:00:57 +00:00
Don Lewis
4d54b88811 Replace three copies of the host controller reset sequence that
differ in their details with calls to a new function, ehci_hcreset(),
that performs the reset.

The original sequences either had no delay or a 1ms delay between
telling the controller to stop and asserting the controller reset
bit.  One instance of the original reset sequence waited for the
controller to indicate that its reset was complete before continuing,
but the other two immediately let the subsequent code execute.  The
latter is a problem on some hardware, because a read of the HCCPARAMS
register returns an incorrect value while the reset is in progress,
which triggers an infinite loop in ehci_pci_givecontroller(), which
hangs the system on shutdown.

The reset sequence in ehci_hcreset() starts with the most complete
instance from the original code, which contains a loop to wait for
the controller to indicate that its reset is complete.   This appears
to be the correct thing to do according to "Enhanced Host Controller
Interface Specification for Universal Serial Bus" revision 1.0,
section 2.3.1.  Add another loop to wait for the controller to
indicate that it has stopped before setting the HCRESET bit.  This
is required by the section 2.3.1 in the specification, which says
that setting HCRESET before the controller has halted "will result
in undefined behaviour".

Reviewed by:	imp (previous patch version without the extra wait loop)
Tested by:	se  (previous patch version without the extra wait loop)
Approved by:	re (bmah)
MFC after:	1 week
2007-08-12 18:45:24 +00:00
Warner Losh
d8e3f30539 Merge in the AX88178 and AX88772 register definions (along with
rename) from OpenBSD.  This also dribbles in a few fields from OpenBSD
as well.

Approved by: re@ (blanket)
Obtained from: OpenBSD
2007-08-09 04:40:07 +00:00
Warner Losh
1dfb823e11 Add missing newline in printf.
Submitted by:  "R.Mahmatkhanov" cvs-src at yandex ru
Approved by: re (blanket)
2007-07-29 18:16:43 +00:00
Takanori Watanabe
32ee7eee09 Minor Bug fix that will cause panic with some terminal with voice path on USB.
Approved by: re@ (kensmith)
2007-07-27 12:00:29 +00:00
Warner Losh
6dc2dedb7a Start to converge on standard ways of saying some things like
Ethernet and Adapter.

Obtained from: NetBSD (kinda)
Approved by: re (blanket)
2007-07-25 07:11:08 +00:00
Warner Losh
3b62e837c9 Fix absolutely maddening autorepeat bug that would cause the last key
to repeat if you had more than two keys down at any given time (which
happened to me all the time with emacs).

This is taken from PR 110681, although what URATAN Shigenobu describes
there is different than the pathology that I have been seeing.  I'm
seeing this only in X, while he sees it on his console, yet I think
the two problems are related.  I've also reworked the patch slightly
to conform to the coding standards of adjacent code.

It is unclear to me if this merely masks the maddening bug that I have
seen, or if this is a real fix.  I typically see the problem when I'm
typing fast in emacs and using lots of motion keys (meta and control).
In either case, my workstation at work again is finally useful with
this patch.

PR:		110681
Submitted by:	URATAN Shigenobu
Approved by: 	re (blanket)
2007-07-25 06:48:33 +00:00
Warner Losh
8a639d8fb6 ums(4) does not work if the mouse defaults to boot protocol. Force
the protocol to be report on each open, but ignore any errors as set
protocol for mice that don't implement the boot protocol can generate
an error.  Evidentally, the Gyration GyroPoint RF Technology Receiver
(Gyration Ultra Cordless) device has this problem.

Submitted by: Eugene M. Kim
PR: 106565
Approved by: re (blanket)
2007-07-25 06:43:06 +00:00
Warner Losh
0e0e91989d Add support for ShanTou ST268 usb nic. This is from a patch for NetBSD
the PR pointed to.  This appears to have been written by Julian Suschlik.

Submitted by: Kuan-Chung Chiu
Obtained from: http://www.nabble.com/Patch-for-udav(4)-t4070804.html
PR: 114860
Approved by: re@ (blanket)
2007-07-24 14:44:23 +00:00
Warner Losh
944f82cd4f Change new Wi-Spy device name to Wi-Spy 2.4x.
Submitted by: Brix Andersen
Approved by: re@ (blanket)
PR: 114807
2007-07-22 18:29:18 +00:00
Warner Losh
9fb43cb678 WISPY added an X.
Approved by: re
2007-07-22 15:59:45 +00:00
Warner Losh
7e23029ae6 Add some additional devices.
Submitted by: HPS hselasky at c2i dot net
Approved by: re (blanket)
2007-07-22 03:45:35 +00:00
Sepherosa Ziehau
733ab6b6c8 Correct RSSI calculation.
Noticed by: Hans Petter Selasky <hselasky@c2i.net>
Approved by: re (kensmith), sam (mentor)
2007-07-17 11:27:57 +00:00
Warner Losh
36fef1500d Add additional product id and quirks entry for MetaGeek Wi-Spy
Submitted by: Robert Noland
PR: 114481
Approved by: re@ (blanket)
2007-07-10 21:00:10 +00:00
Warner Losh
2f33a9032b Missed in last commit: add usb task for rue to use for its ticks.
Approved by: re (bmah)
2007-07-09 20:56:39 +00:00
Warner Losh
f129c7fd08 When all the other drivers were converted to scheduling a taskqueue to
do the heavy lifting of the 'mii_tick' function, rue was left behind.
Implement this in a naive way.  Reports from the field show this makes
the driver functional with some locking issues, as opposed to an
instant panic.  Those will be addressed in a later version of the
driver.

Approved by: re@ (bmah)
2007-07-09 16:58:07 +00:00
Warner Losh
bb900be1fe Fix duplicates that crept in at the last minute :-(.
Noticed by: Ian Freislich
Approved by: re@ (blanket)
2007-07-09 14:26:08 +00:00
Warner Losh
66807691fe Further diff reduction against the proposed merged usbdevs: Add a few
more vendors, use slightly more standardized names.

No md5 chagnes for !USBVERBOSE kernels

Approved by: re@ (blanket)
2007-07-09 06:20:07 +00:00
Warner Losh
dc950f0469 More vendors from the merged list.
Sort NETGEAR list per convention.
Swap QUALCOMM and QUALCOMM2.
Add a few vendor products.

no md5 changes with this file (except when USBVERBOSE is enabled)

Approved by: re@ (blanket)
2007-07-09 05:47:32 +00:00
Warner Losh
f1d2cc831c Trivial differences with the proposed merged BSD usbdevs file merged
in.  These are exclusively in the name of the company for this round.
No new devices have been added, but the MITEL entry has been
eliminated because nothing uses it.  You won't see any difference
unless you have USBVERBOSE defined for the kernel.

Approved by: re@ (blanket)
2007-07-06 20:05:39 +00:00
Warner Losh
56f6c2d8fa uhub already does the printing and naming of a device, so don't do it
again here for compat drivers.

Approved by: re@ (blanket)
2007-07-06 20:02:37 +00:00
Warner Losh
05adc69b08 Prefer device_printf to printf + device_get_nameunit. This saves
about 100 bytes.

Approved by: re (blanket)
2007-07-05 15:25:32 +00:00
Warner Losh
d9c12353bf Prefer device_printf to printf("%s: ...", device_get_nameunit()). On
amd64, we save about 240 bytes (this is about 20 per instance).

Approved by: re (blanket)
2007-07-05 06:42:14 +00:00
Warner Losh
96e0645dd4 Prefer device_printf to printf("%s:...", device_get_nameunit(),...);
This saves ~300 bytes for uvscom.c and ~100 for uvisor.c

Approved by: re (blanket)
2007-07-05 06:28:46 +00:00
Warner Losh
8705c3d30b Add quirks, derived from the linux quirks table for:
o Adonics Cable 205
o Aiptek PocketCAM 3Mega
o Belkin USB2SCSI
o Casio QV DigiCam
o CCYU EasyDisk ED1064
o Desknote UCR-61S2B
o Epson Stylus Photo 875DC Card Reader
o Epson Stylus Photo 895 Card Reader
o Feiya 5-in-1 Card Reader
o Hitachi Dvd-CAM DZ-MV100A Camcorder
o HP CD-WRiter+ CD-4e
o Insystem Storage Adapter v2
o Kyocera Finecam S3x
o Kyocera Finecam S4
o Kyocera Finecam S5
o Kyocera Finecam L3
o Lexar USB CF Reader
o MindAtWork Digital Wallet
o Minolta Dimage F300
o Minolta Dimage E223
o Minsumi USB Fdd
o Netac USB-CF-Card
o NetChip USB Clik! 40
o Onspec MDCFE-B USB CF Reader
o Onspec SIIG/Datafab Memory Stick + CF Reader/Writer
o Onspec Datafab-based Reader
o Onspec PNY/Datafab CF+SM Reader
o Onspec SimpleTech/Datafab CF+SM Reader
o Onspec MDSM-b Reader
o Onspec USB To CF + SM Combo (LC1)
o Onspec ImageMate SDDR55
o Panasonic LS-120 Camera
o Samsung Techwin Digimax 410
o Shuttle eUSB SmartMedia / CompactFlash Adapter
o Skanhex MD 7425 Camera
o Skanhex SX 520z Camera
o Sony Memorystick NW-MS7
o Sony Portable USB Hardrive V2
o Sony Memorystick PEG N760c
o Sony Memorystick MSC-U03
o TREK/IBM USB memory key
o Trumpion T33520 USB Flash Card Controller
o Trumpion MP3 Player
o Vivtar Vivicam 35Xx
o WinMaxGroup USB Flash Disk 64M-C
o Zoran Digital Camera EX-20 DSC

and maybe a few others...

Submitted by: Vaidas Damosevicius and flz
PR: 79893
Reviewed by: njl, flz
Approved by: re (blanket)
2007-07-05 05:26:08 +00:00
Warner Losh
e196c772a8 Add support for Western Digital MyBook external enclosures. They need
this quirk to work.

Submitted by: Dierk Sacher
PR: usb/99419
Approved by: re (blanket)
2007-07-05 04:05:51 +00:00
Warner Losh
bf21ee8d91 WD Firewire/USB Combo hangs under load on USB interface. Fix with
these quirks.

Submitted by: John Pettitt
PR: 79140
Approved by: re@ (blanket)
2007-07-02 04:55:56 +00:00
Warner Losh
c78c2f1bd2 Fix two more PRs:
(1) Add size parameter to usbd_get_string()
(2) Properly limit speed when a full speed hub is plugged into a high
    speed hub.

Submitted by: Hans Petter Selasky
PR: 80773, 79725
Approved by: re@ (kensmith)
2007-06-30 20:18:44 +00:00
Warner Losh
1371adb3ca Additional devices from NetBSD and OpenBSD. This includes devices not
yet supported by this driver.  Support will be committed soon, or a
filter on all the 'newer' devices will be installed before the
release.

Approved by: re@ (blanket)
Obtained from: NetBSD, OpenBSD
Small Furry Animals by: Pink Floyd
2007-06-30 20:08:08 +00:00
Warner Losh
ad416b7abe umass quirk: Samsung YP-U2 USB MP3/Ogg Player
Submitted by: Ulrich Spoerlein
PR: 114154
Approved by: re@ (blanket)
2007-06-30 14:53:44 +00:00
Warner Losh
439ebffe8d quirk for CENTURY EX35QUAT disk enclosure
Submitted by: Daniel Hartmeier
PR: 94132
Approved by: re (blanket)
2007-06-30 04:58:35 +00:00
Warner Losh
a72de103a1 Fix cheapy Myson USB-IDE adapter
Submitted by: Arno J. Klaassen
PR: 88939
Approved by: re@ (blanket)
2007-06-30 04:42:29 +00:00
Warner Losh
006bd3063f Expand the transform API to allow transports to return 'success' for
the command.  Make UFI devices return 'success' when asked to do a
SYNC_CACHE.  There's no support for write caching in the UFI spec, so
this is the most appropriate action to undertake.

Reviewed by: scottl
Approved by: re@ (blanket)
2007-06-30 02:50:57 +00:00
Warner Losh
5d3558fcac Reduce diffs to OtherBSD by using usb_lookup. No functional changes.
Approved by: re@ (Blanket)
2007-06-30 02:42:36 +00:00
Warner Losh
4524d0b678 Remove duplicate USBDEVUNIT #define
Approved by: re@ (blanket)
2007-06-30 02:41:29 +00:00
Warner Losh
0d5a50d6bf Add definition for UIPROTO_MOUSE.
Approved by: re@
2007-06-30 02:40:21 +00:00
Warner Losh
ea36be213c Update to merged names for things. No functional changes.
Approved by: re (blanket)
2007-06-30 02:35:42 +00:00
Warner Losh
3995a80fd6 Add support for various MS Wirless usb mice. the patch is from
Hellmuth with some refinements by myself and flz@.  It works for me
with my non-MS mice, so nothing should be broken by it.

Submitted by: Hellmuth Michaelis
PR: 90162
Approved by: re (blanket)
2007-06-29 21:07:41 +00:00
Warner Losh
57c02fd548 Change uhub to dynamic status size for status change endpoint. From a
pr, the submitter says:

	Found this while running freebsd as guest in qemu with -usb
	parameter. The patch implements the missing dynamic size based on
	number of ports a hub has.

Submitted by: Lonnie Mendez
PR: 94946
Approved by: re@ (blanket)
2007-06-29 20:34:42 +00:00
Warner Losh
9729910999 The timeout is in milliseconds, not in hz. Only the portion of the
patch that converts ms to ticks was used.  Another PR states that a
return code of 0 is the right one for libusb.

Submitted by: Lonnie Mendez
PR: 94311
Approved by: re (blanket)
2007-06-28 06:22:40 +00:00
Warner Losh
e9da08f2eb With the advent of G3/CDMA modems, the old buffer sizes are no longer
adequate.  Increase them to 1k.  The referenced PR made this a sysctl,
but that seems like overkill to me.  The difference between 320 and
2048 bytes in modern systems, even embedded ones, seems to be in the
noise to be worth the extra hair to make it settable.

PR: 74609
Submitted by: Divacky Roman
Approved by: re (blanket)
2007-06-28 05:50:14 +00:00
Warner Losh
dc0c82bc3f For both interrupt and isochronous (the patch was unclear which one it
applied to, but I'd think both), honor the timeout that's been set.
Return 0 bytes to be consistant with what libusb expects.  By default,
the timeout will be zero, so only applications that change the default
will see a change.  The patch only seems to apply to the interrupt end
points, but it should also apply to isochronous endpoints as well.

Submitted by: Maurice Castro
PR: 110122
Approved by: re (blanket)
2007-06-28 05:15:33 +00:00
Warner Losh
67c4e28638 Partially updated usbdevs from OpenBSD's usbdevs. Also, some sorting
of the file numerically for vendors and then each product numerically
by vendor (with all the foo2's sorting after the foo's).  Someday, all
the usbdevs will be merged, I hope, but until then, we have these
mega-merges.

This also finishes the LINKSYS4 -> CISCOLINKSYS rename.

Approved by: re@ (blanket)
2007-06-26 05:29:27 +00:00
Warner Losh
b19eb2f4c1 LINKSYS4 is going to be going away. Migrate to CISCOLINKSYS instead.
There is no md5 delta for this change.

Approved by: re@ (blanket)
2007-06-25 20:51:58 +00:00
Warner Losh
5acfdb129b Starting in version 1.56, ucomstop started calling ucomstart to work
around an output freezing problem (see the CVS log for details).  This
is the same approach that sio takes to solve that problem.  However,
ucom has a problem that sio doesn't have.

Consider the case where output is pending, and the device is closed.
ttyclose calls tt_close (which indirects to ucomclose) and then calls
ttyflush which calls tt_stop (which indirects to ucomstop).  Since
ucomclose removed all the usb transfer points, sc_oxfer will be NULL
when ucomstop calls ucomstart.  This results in a null pointer
dereference.

Since calling ucomstart in ucomstart solves other problems, we need to
work with this calling sequence.  The easiest way to do that is to
bail early if sc_oxfer is NULL.

Kazuaki ODA-san came up with this patch, and filed a PR.  I had seen
this bug at work and this patch does seem to solve it.  He had no idea
why it worked, but knew that either this patch, or backing out ucom.c
1.56 fixed his panic.  I just did the legwork of chasing down the code
paths that would cause this, and added a comment.  This is obscure
enough to warrant a comment, I think.

Submitted by: Kazuaki ODA-san
PR: 113964
Approved by: re (bmah)
2007-06-25 06:40:20 +00:00
Warner Losh
a272617c67 For USBVERBOSE case, we can't have " in any of the names.
Submitted by:  Flemming Jacobsen
Approved by: re (blanket)
2007-06-23 16:50:46 +00:00
Warner Losh
aca96341db Drag in another device: The Surecom RT2570.
Obtained from: OpenBSD
Approved by: re@ (blanket for device IDs)
2007-06-23 06:52:56 +00:00
Warner Losh
0b204f9c17 Add a boatload of devices from OpenBSD and NetBSD to kue and cdce.
Obtained From: OpenBSD/NetBSD
Approved by: re (blanket)
2007-06-23 06:47:43 +00:00
Warner Losh
2de4b931b6 Note the Belkin F5U111 Adapter is covered by NETMATE entry.
Approved by: re (blanket)
2007-06-23 06:29:19 +00:00
Warner Losh
cea0228c56 Remove duplicate ID and recall that I comes after E in alphabetical
listings.

Approved by: re@
2007-06-23 05:59:53 +00:00
Warner Losh
1331348cb7 Merge some device IDs from OpenBSD for aue. Minor sorting of usbdevs
to fix disorder.

Obtained from: OpenBSD
Approved by: re@ (blanket)
2007-06-23 05:52:12 +00:00
Warner Losh
fbd57cc069 We need a special module loader routine, not the stock usbd one. This
also eliminates a routine unused message.

Submitted by: mjacob
Approved by: re@
2007-06-23 04:20:24 +00:00
Warner Losh
78f3413f0c Initialize id before using it.
Submitted by: mjacob
Approved by: re@
2007-06-23 04:18:44 +00:00
Warner Losh
c199bfa6cb Add support for Garmin iQue 3600
Submitted by: Lapo Luchini
PR: 113324
Approved by: re (kensmith, blanket)
2007-06-22 06:02:19 +00:00
Warner Losh
30d52b75e4 add support for Option GlobeTrotter 3G+
(PR says this may be from OpenBSD)

Submitted by: Simun Mikecin
PR: 111710
Approved by: re (kensmith, blanket)
2007-06-22 05:56:05 +00:00
Warner Losh
e5be70a464 Tactrix Openport support
Submitted by: Jonathan Charest
PR: 110992
Approved by: re (kensmith, blanket)
2007-06-22 05:53:05 +00:00
Warner Losh
54a25dd338 add Benq 3300U/4300U support
Submitted by: Denis Sadykov
PR: 110477
Approved by: re (kensmith, blanket)
2007-06-22 05:49:12 +00:00
Warner Losh
dffc4a655f Crystalfontz CFA-635 20x4 USB LCD
(plus minor sorting)

Submitted by: John Wilson
PR: 107526
Approved by: re (kensmith, blanket)
2007-06-22 05:44:41 +00:00
Warner Losh
c0a4ed889c Update uvisor to support the Fossil Abacus Wrist PDA
Submitted by: Simon Dick
PR: 96714
Approved by: re (kensmith, blanket)
2007-06-22 05:33:20 +00:00
Warner Losh
b1aafdf7af USB Ethernet Adaptor "ELECOM LD-USB20"
PR: 86195
Submitted by: kato <redzonemiata@yahoo.co.jp>
Approved by: re (kensmith)
2007-06-22 05:20:11 +00:00
Warner Losh
21bf93883e USL101 Host-to-Host bridge support
PR: 82436
Submitted by: Maxim M. Kazachek
Approved by: re (kensmith)
2007-06-22 05:14:27 +00:00
Warner Losh
638c640a71 Add support for YANO external USB-HDD.
Submitted by: Norihiro TANAKA
PR: 94742
Approved by: re (kensmith blanket)
2007-06-21 20:13:07 +00:00
Warner Losh
c2861c84f6 Fix two PRs by adding vendor IDs:
PR 108097: ADMtek 851X USB-to-LAN adapter
PR 74849: Samsung SPH-i500 does not attach properly as usb modem/Palm device

PR: 108097, 74849
Approved by: re@ (kensmith trivial usb blanket)
2007-06-21 17:55:28 +00:00
Warner Losh
bbc84740c1 Latest round of usb cleanups:
o Consistently use device_foo_t and bus_foo_t for functions implementing
  device_foo and bus_foo respectively.  Adjust those routines that were wrong
  (we should do this throughout the tree).
o make all the modules depend on usb.  Otherwise these modules won't
  load.
o ucycom doesn't need usb_port.h
o Minor unifdefing
o uhub, umass, ums, urio, uscanner conversion complete.
o ukbd: Remove the NO_SET_PROTO quirk (fixes a PR 77940).  NetBSD removed
  their check and setting the proto a long time ago.
o umodem panic fixed.  UQ_ASSUME_CM_OVER_DATA quirk removed because I've never
  seen a umodem that needed this rejection for proection (this gets rid of
  ~20% of the quirks).

Approved by: re@ (kensmith)
PR: 77940
2007-06-21 14:42:34 +00:00
Warner Losh
cb198db63b Restore approximately FreeBDS 6.x's level of compatibility macros.
Older drivers that do not wish to convert to the native API (which
will work with both 6.x and 7.x) can simply include
<dev/usb/usb_port.h>.  Drivers in the tree shouldn't these macros,
unless they actually work on other OSes and are actively maintained.

Approved by: re@
2007-06-21 14:36:22 +00:00
Warner Losh
7bd250d818 s/logprintf/printf/g
Approved by: re@
2007-06-20 05:11:37 +00:00
Xin LI
b76d072be1 Include usb_port.h to fix build.
Reported by:	tinderbox
Approved by:	re (mux)
2007-06-19 10:28:08 +00:00
Warner Losh
c8222a9830 Mark the few remaining drivers that haven't been converted as needing
usb_port.h by explicitly including it.
2007-06-18 22:32:09 +00:00
Warner Losh
3f35ccb617 Expand usb_port macros 2007-06-18 22:31:35 +00:00
Warner Losh
34f7cf9af5 Remove usb_port.h from usb.h, except for one or two useful things that
don't belong there (these moved into usb.h).
2007-06-18 22:30:53 +00:00
Warner Losh
bd6bb69705 Expand usb_port.h macros. 2007-06-18 22:30:08 +00:00
Warner Losh
70c1d26317 Expand usb_callout_init 2007-06-18 22:28:32 +00:00
Warner Losh
70f16d924f Finish removal of usb_port.h macros. 2007-06-18 22:27:57 +00:00
Warner Losh
a5509ec848 Use device_foo_t to declare kobj methods
Fix shutdown type to return int rather than void.
2007-06-18 22:25:46 +00:00
Warner Losh
bb92e05941 minor style(9) polishing
# but we need a usb_match function, if we don't already have one...
2007-06-18 02:15:58 +00:00
Warner Losh
6cf684e14a Remove USBGETSOFTC, USB_ATTACH_START, USB_DETACH_START and
USB_DECLARE_DRIVER_INIT from the usb network drivers.
2007-06-17 18:46:26 +00:00
Warner Losh
fc5d431363 Expand USB_MATCH_START 2007-06-17 16:24:49 +00:00
Warner Losh
2e447a2d92 Remove USB_DO_ATTACH 2007-06-17 07:34:34 +00:00
Warner Losh
7a86867fc0 Expand USB_DO_ATTACH inline.
Remove device_t dv, since it is no longer needed.
Add sizeof(device_t) to replace sizeof dv.
Change device_detach(dev) to device_detach(dev->subdevs[i]) since the type
of dev isn't right!  Not sure when this was introduced, but it likely would
lead to a crash on disconnect.

MFC After: 1 week
2007-06-17 07:33:59 +00:00
Scott Long
b50569b71d Prepare for future integration between CAM and newbus. xpt_bus_register
now takes a device_t to be the parent of the bus that is being created.
Most SIMs have been updated with a reasonable argument, but a few exceptions
just pass NULL for now.  This argument isn't used yet and the newbus
integration likely won't be ready until after 7.0-RELEASE.
2007-06-17 05:55:54 +00:00
Wilko Bulte
ff9d7fae6a Per request (to core) by the person refered to in the comment. 2007-06-16 19:23:14 +00:00
Warner Losh
200d9c860d Expand callout compatibility macros in the main usb bridges. 2007-06-14 16:23:31 +00:00
Warner Losh
a73530728e Move PWR_* from usb_port.h to usb.h 2007-06-14 16:12:04 +00:00
Warner Losh
058cc61a3e Move malloc definitions to usb.h.
Also, remove usb_malloc_type: it was unused.
Remove METHODS_NONE: it was unused.
Move include of opt_usb.h from usb_port.h to usb.h, since usb_port.h is
going away (there will be a usb_compat.h for out-of-tree drivers that want it).
2007-06-14 15:09:21 +00:00
Warner Losh
6f93a78c1a config_detach is just used in one place, so expand it inline. 2007-06-13 20:58:57 +00:00
Warner Losh
2283429409 Remove more unnecessary and unwanted __OtherBSD__ ifdefs. 2007-06-13 06:00:10 +00:00
Warner Losh
63ba0d2d76 Remove more __OtherBSD__ ifdefs that don't make sense, and haven't for
some time.
2007-06-13 05:45:48 +00:00
Warner Losh
778e5b6687 Expand USB_DETACH, USB_ATTACH and USB_MATCH inline. No functional
change, and MD5's appear to be the same.
2007-06-13 05:37:59 +00:00
Warner Losh
828dd7cd00 Remove compat macros. md5 the same. 2007-06-12 21:35:18 +00:00
Warner Losh
9ab3a4add1 First pass at removing __OtherBSD__. We can't blindly remove all of
them in bulk because there is at least one feature that's
unimplemented on FreeBSD that needs to be done and these are good
placeholders.
2007-06-12 19:40:20 +00:00
Warner Losh
f3ece13593 Don't pretend to support !BSD systems. 2007-06-12 19:01:32 +00:00
Warner Losh
5ea892ec7c Remove usb_kthread_create*. They are now unused. 2007-06-12 18:52:29 +00:00
Warner Losh
015454acee unifdef -D__FreeBSD__ -U__NetBSD__ -U__OpenBSD__
Use kthread_create directly
2007-06-12 18:52:07 +00:00
Warner Losh
4f9929e80f Eliminate usb_thread_t. 2007-06-12 17:30:54 +00:00
Warner Losh
0f5a2cb6b7 Remove USBDEV() macro. We do not need a macro that is defined as its
only argument.  It was used inconsistently in the tree, so remove it.
2007-06-12 16:52:07 +00:00
Warner Losh
e4255d701d clalloc and clfree are useles. Remove them. Remove dead code that's
always been dead for years, but has been obfuscated by these macros.
2007-06-12 16:41:29 +00:00
Warner Losh
645016c0e4 Expand USB_ATTACH_{ERROR,SUCCESS}_RETURN inline and eliminate from
usb_port.h.  They aren't needed, and are a legacy of this code's past.
2007-06-12 15:37:19 +00:00
Warner Losh
930ed6f61b Expand DECLARE_USB_DMA_T inline in the one place it is used and eliminate
from usb_port.h.
2007-06-11 06:21:50 +00:00
Warner Losh
c02f7d824d Eliminate USB_ATTACH_SETUP and USB_MATCH_SETUP. They are no longer in
the tree.
2007-06-11 06:18:34 +00:00
Warner Losh
2a88b253af Prefer device_printf over printf. 2007-06-11 06:14:42 +00:00
Warner Losh
478124e645 Minor tweak. 2007-06-11 06:03:32 +00:00
Warner Losh
339075ea3d Prefer device_printf to printf
Eliminate rue_unit from softc

# saves ~200 bytes
2007-06-11 06:01:05 +00:00
Warner Losh
9b1defb041 Prefer device_printf to printf
Remove keu_unit from softc

# this change saves about 180 bytes in the module, all in text
2007-06-11 05:50:47 +00:00
Warner Losh
b4b82058d3 Get rid of useless devinfo stuff
Kill bogus bzero
prefer device_printf to printf

Reviewed by: alfred@
2007-06-11 05:44:28 +00:00
Warner Losh
68069d1337 Prefer device_printf to printf where sane.
Elimiante cue_unit from softc.
2007-06-11 05:42:47 +00:00
Sam Leffler
68e8e04e93 Update 802.11 wireless support:
o major overhaul of the way channels are handled: channels are now
  fully enumerated and uniquely identify the operating characteristics;
  these changes are visible to user applications which require changes
o make scanning support independent of the state machine to enable
  background scanning and roaming
o move scanning support into loadable modules based on the operating
  mode to enable different policies and reduce the memory footprint
  on systems w/ constrained resources
o add background scanning in station mode (no support for adhoc/ibss
  mode yet)
o significantly speedup sta mode scanning with a variety of techniques
o add roaming support when background scanning is supported; for now
  we use a simple algorithm to trigger a roam: we threshold the rssi
  and tx rate, if either drops too low we try to roam to a new ap
o add tx fragmentation support
o add first cut at 802.11n support: this code works with forthcoming
  drivers but is incomplete; it's included now to establish a baseline
  for other drivers to be developed and for user applications
o adjust max_linkhdr et. al. to reflect 802.11 requirements; this eliminates
  prepending mbufs for traffic generated locally
o add support for Atheros protocol extensions; mainly the fast frames
  encapsulation (note this can be used with any card that can tx+rx
  large frames correctly)
o add sta support for ap's that beacon both WPA1+2 support
o change all data types from bsd-style to posix-style
o propagate noise floor data from drivers to net80211 and on to user apps
o correct various issues in the sta mode state machine related to handling
  authentication and association failures
o enable the addition of sta mode power save support for drivers that need
  net80211 support (not in this commit)
o remove old WI compatibility ioctls (wicontrol is officially dead)
o change the data structures returned for get sta info and get scan
  results so future additions will not break user apps
o fixed tx rate is now maintained internally as an ieee rate and not an
  index into the rate set; this needs to be extended to deal with
  multi-mode operation
o add extended channel specifications to radiotap to enable 11n sniffing

Drivers:
o ath: add support for bg scanning, tx fragmentation, fast frames,
       dynamic turbo (lightly tested), 11n (sniffing only and needs
       new hal)
o awi: compile tested only
o ndis: lightly tested
o ipw: lightly tested
o iwi: add support for bg scanning (well tested but may have some
       rough edges)
o ral, ural, rum: add suppoort for bg scanning, calibrate rssi data
o wi: lightly tested

This work is based on contributions by Atheros, kmacy, sephe, thompsa,
mlaier, kevlo, and others.  Much of the scanning work was supported by
Atheros.  The 11n work was supported by Marvell.
2007-06-11 03:36:55 +00:00
Warner Losh
ab8c137045 Prefer device_printf over printf
Eliminate cdce_unit from softc.
2007-06-10 07:33:48 +00:00
Warner Losh
ed6ed00ed0 Prefer device_printf over printf. Eliminate axe_unit as it is no
longer required.
2007-06-10 07:24:32 +00:00
Matt Jacob
fc2ca23fa3 Remove unused variable. 2007-06-10 04:51:03 +00:00
Matt Jacob
16ccae5559 Complete an initialization to make gcc 4.2 happy. 2007-06-10 01:28:55 +00:00
Matt Jacob
cffc6c3fe1 Initialize devname. 2007-06-10 01:28:26 +00:00
Warner Losh
a5b1cb0cd0 Remove devinfo junk.
Remove bogus bzero/memset
Expand USB_ATTACH_SETUP
Minor nits
2007-06-09 06:42:19 +00:00
Warner Losh
07f51bab6d Remove lots of extra junk:
o other bsd defines, there's no way this would work there
o devinfo junk
2007-06-09 06:40:17 +00:00
Warner Losh
80170fd0c4 Kill devinfo stuff. It is no longer needed.
Kill bogus bzero as necessary.
Minor tidy.
Expand USB_ATTACH_SETUP inline where needed.
2007-06-09 06:39:43 +00:00
Warner Losh
7f5ede5819 Kill USB_MATCH_SETUP, since this is the only place it was used in the tree.
While I'm here, kill devinfo junk.
2007-06-09 06:38:19 +00:00
Warner Losh
e491a67b63 Try to set the data multiplexed feature, but don't care if there's an
error doing so.  It seems an increasing number of phones have this
quirk, and we're not keeping up.  There appears to be nothing bad that
happens for non-quirked phones.

Minor cleanups:
o prefer device_printf over printf
o kill devinfo stuff
o minor other preening.
2007-06-09 06:37:17 +00:00
Warner Losh
e591b223d8 The devinfo stuff has been moved up into the parent bus. There's no
need to do it at all anymore.  Remove it from here.  Expand
USB_ATTACH_SETUP inline now that it is one line and we're moving away
from the compat macros.  Remove some bzero calls that turn out not be
be necessary.
2007-06-09 06:31:07 +00:00
Warner Losh
58ba374e3d Cleanup messages printed on attach. Since the description gets set to
what we print, don't print it anymore.  And don't compute it anymore.
And don't malloc/free memory for it anymore.  While I'm here, prefer
device_printf where appropriate.
2007-06-08 22:25:09 +00:00
Christian Brueffer
578e607926 Remove compat ifdefs for version < 500014 from the rest of the USB files.
Approved by:	rwatson (mentor)
MFC after:	1 week
2007-06-07 09:29:37 +00:00
Warner Losh
cf93a36f82 Fix spaces introduced in last commit 2007-06-07 06:05:53 +00:00
Warner Losh
1fdf3b1b35 Add more IDs for the uftdi driver. Slight tweaks to patch by me.
Submitted by:  Thorsten Trampisch
PR: 113384
2007-06-05 21:06:17 +00:00
David Malone
041b706b2f Despite several examples in the kernel, the third argument of
sysctl_handle_int is not sizeof the int type you want to export.
The type must always be an int or an unsigned int.

Remove the instances where a sizeof(variable) is passed to stop
people accidently cut and pasting these examples.

In a few places this was sysctl_handle_int was being used on 64 bit
types, which would truncate the value to be exported.  In these
cases use sysctl_handle_quad to export them and change the format
to Q so that sysctl(1) can still print them.
2007-06-04 18:25:08 +00:00
Warner Losh
965f1e2a4a Add more devices from the hps tree. These appear to have come from
OpenBSD's if_ral.c.

I didn't make the LINKSYS4 -> CISCOLINKSYS name change, nor did I
include the RALINK RT2573 that's supported by the rum(4) driver.  I
didn't merge any code changes either.
2007-05-29 20:05:13 +00:00
Alexander Kabaev
b27167c85e Remove local static redefinition of ucom_devclass. 2007-05-19 04:57:15 +00:00
Christian Brueffer
3f054080e6 Add missing curly braces.
Approved by:	rwatson (mentor)
2007-05-12 05:56:58 +00:00
Christian Brueffer
c9960ef732 ALTQify.
Submitted by:	J.R. Oldroyd
Reviewed by:	mlaier
Approved by:	rwatson (mentor)
MFC after:	1 week
2007-05-12 05:56:10 +00:00
Christian Brueffer
224aecbcdf Remove compat ifdefs for FreeBSD versions < 500014, makes the code
quite a bit easier to read.

Approved by:	rwatson (mentor)
MFC after:	1 weeks
2007-05-12 05:53:53 +00:00
Kevin Lo
eb6e110a7a - Remove dependency on deprecated if_watchdog ABI.
- Move amrr code into net80211 itself.
- Handle ->INIT state transition in ural_newstate() to eliminate the race.

Tested with a ASUS WL-167g.
2007-05-09 09:32:41 +00:00
Maxim Konovalov
717d7ba708 o Add AnyData ADU-E100H modem. Sort a list of ubsa(4) supported devices.
PR:		usb/95803
Submitted by:	Jindrich Fucik
Tested by:	R.Mahmatkhanov
MFC after:	2 weeks
2007-05-08 18:51:40 +00:00
Kevin Lo
e43719c485 Do not set address early. It fix problems when SET_ADDR_FAILED happens
on the hubs.

Reviewed by: imp
2007-05-08 03:25:05 +00:00
Dag-Erling Smørgrav
c8285e3723 Unbreak the build on 64-bit architectures as well. 2007-05-06 21:06:08 +00:00
Dag-Erling Smørgrav
f679c6ff12 Unbreak the build. 2007-05-06 14:25:52 +00:00
Kevin Lo
0738dfc386 Add support for Ralink Technology RT2501USB/RT2601USB devices.
Reviewed by: sam, sephe
Obtained from: OpenBSD
2007-05-06 10:07:21 +00:00
Christian Brueffer
8d2896ac91 Remove pre-5.0 compat cruft.
Approved by:	rwatson (mentor)
MFC after:	1 week
2007-05-01 11:17:29 +00:00
Takanori Watanabe
0f23397d3f Add MELCO PC-OP-RS Universal remote ID. 2007-04-30 16:15:19 +00:00
Sepherosa Ziehau
3629c47471 Nuke unnecessary setting of ural(4)'s security registers. ural(4) only
supports software encrypt/decrypt.

The nuked code itself is quite problematic, as pointed out by sam@ ---
wk->wk_keyix should be replaced by the loop count.

Tested with WEP/TKIP/CCMP/no-protection.

Approved by:	sam@ (mentor)
Noticed by:	Hans Petter Selasky <hselasky@c2i.net>
2007-04-24 11:18:55 +00:00
Sepherosa Ziehau
b03cfe2396 - Fix mbuf/node leakage in drivers' raw_xmit().
- For ural(4):
  o  Fix node leakage in ural_start(), if ural_tx_mgt() fails.
  o  Fix mbuf leakage in ural_tx_{mgt,data}(), if usbd_transfer() fails.
  o  In ural_tx_{mgt,data}(), set ural_tx_data.{m,ni} to NULL, if
     usbd_transfer() fails, so they will not be freed again in ural_stop().

Approved by:	sam (mentor)
2007-04-19 13:09:57 +00:00
Scott Long
2b83592fdc Remove Giant from CAM. Drivers (SIMs) now register a mutex that CAM will
use to synchornize and protect all data objects that are used for that
SIM.  Drivers that are not yet MPSAFE register Giant and operate as
usual.  RIght now, no drivers are MPSAFE, though a few will be changed
in the coming week as this work settles down.

The driver API has changed, so all CAM drivers will need to be recompiled.
The userland API has not changed, so tools like camcontrol do not need to
be recompiled.
2007-04-15 08:49:19 +00:00
Maxim Konovalov
b274ce9ef2 o Extend the list of supported CDMA-2000 terminals.
Submitted by:	R.Mahmatkhanov
MFC after:	10 days
2007-04-13 18:15:07 +00:00
Kevin Lo
6d361569d5 Since the driver uses mutexes, remove splusb() and splx(). 2007-04-03 05:59:17 +00:00
Alexander Leidinger
2acfcc2d4c Make it obvious that we don't care about the return value of
usbd_endpoint_count(), the failure case is handled implicit in the
following code.

Found by:	Coverity Prevent (tm)
CID:		56
2007-04-01 13:46:39 +00:00
John Baldwin
4e7f640dfb Optimize sx locks to use simple atomic operations for the common cases of
obtaining and releasing shared and exclusive locks.  The algorithms for
manipulating the lock cookie are very similar to that rwlocks.  This patch
also adds support for exclusive locks using the same algorithm as mutexes.

A new sx_init_flags() function has been added so that optional flags can be
specified to alter a given locks behavior.  The flags include SX_DUPOK,
SX_NOWITNESS, SX_NOPROFILE, and SX_QUITE which are all identical in nature
to the similar flags for mutexes.

Adaptive spinning on select locks may be enabled by enabling the
ADAPTIVE_SX kernel option.  Only locks initialized with the SX_ADAPTIVESPIN
flag via sx_init_flags() will adaptively spin.

The common cases for sx_slock(), sx_sunlock(), sx_xlock(), and sx_xunlock()
are now performed inline in non-debug kernels.  As a result, <sys/sx.h> now
requires <sys/lock.h> to be included prior to <sys/sx.h>.

The new kernel option SX_NOINLINE can be used to disable the aforementioned
inlining in non-debug kernels.

The size of struct sx has changed, so the kernel ABI is probably greatly
disturbed.

MFC after:	1 month
Submitted by:	attilio
Tested by:	kris, pjd
2007-03-31 23:23:42 +00:00
Julian Elischer
6f5d1a3c01 Don't assume the run bit is still set after a suspend.
Submitted by: Andrea Bittau ( adotbittauatcsdotucldotacdotuk)
MFC After: 1 week
2007-03-27 18:55:06 +00:00
Maxim Konovalov
d986a9f435 o A quirk for Sagem USB-Serial controller.
PR:		usb/109613
Submitted by:	Mayr Gerald
MFC after:	1 month
2007-03-24 09:27:58 +00:00
Maxim Konovalov
bbb4f3ad1e o Add several CDMA-2000 terminals.
PR:		usb/109838
Submitted by:	R.Mahmatkhanov
MFC after:	1 month
2007-03-24 09:25:56 +00:00
Sam Leffler
fa393cd523 allow net80211 to fillin rate sets
MFC after:	2 weeks
2007-03-11 22:43:35 +00:00
Warner Losh
76ddd31f5a Some USB mass storage devices return the number of sectors in response
to a READ_CAPACITY request rather than the maximum sector (off by one
problem).  This causes a huge cascade of errors as the geom tasting
code tries to read the last sector (which isn't really there in the
face of this error).  automated tools that manipulate disk labels and
such also have issues.

Create a new quirk READ_CAPACITY_OFFBY1 and add a quirk for the
SanDISK ImageMate that I have that suffers from this problem (the
SDDR-31).  It intercepts the READ_CAPACITY response and adjusts it
from number of sectors to max sector for devices with this quirk.

Reading the Linux source suggests that there are a host of
other devices with this issue, including iPods and some popular
cameras.  I've not added quirks for them, since I don't have the
devices in front of me to test.
2007-02-27 22:33:50 +00:00
Warner Losh
9995cc7a29 Entries sorted by id number, not name 2007-02-27 22:27:53 +00:00
John Baldwin
4d70511ac3 Use pause() rather than tsleep() on stack variables and function pointers. 2007-02-27 17:23:29 +00:00