Commit Graph

1893 Commits

Author SHA1 Message Date
Kevin Lo
d618552420 Fix NULL dereference in rum_txeof()
PR: kern/117820
2007-11-21 05:51:43 +00:00
Jack F Vogel
b8b1729d3c Add PCI device support for Intel S7000FC4UR in usb and ichwd, systems
will not install without the usb changes in the install kernel, so I
would like to MFC this in time for 7.0 RC

MFC: 3 days
2007-11-15 23:59:36 +00:00
Henrik Brix Andersen
419f6676c3 Update quirks for the MetaGeek Wi-Spy 1A, 1B and 2.4x.
PR:		usb/116057
Approved by:	imp, erwin (mentor)
2007-11-11 20:57:08 +00:00
Sam Leffler
b0db4c9328 Add private tx/rx buffer management to support large frame sizes
and update the rx code to handle multiple frames in a single usb
transfer.  AX772 parts (at least) exhibit many input errors when
operated with a 2K rx buffer and no errors w/ a 4K rx buffer (it's
unclear what the cause of the errors is for 2K so this may just be
covering up the real issue).  Larger rx buffer sizes show no
significant performance improvement for AX772.  Bypassing the common
buffer management routines also eliminates an extra context switch
on every packet which noticeably improves performance (TCP netperf
rx goes from 45 Mb/s to 85 MB/s).

Submitted by:	"J.R. Oldroyd" <fbsd@opal.com>
Reviewed by:	imp
Obtained from:	openbsd (partly)
MFC after:	3 weeks
2007-11-10 16:23:38 +00:00
Ariff Abdullah
20005f72d1 - Remove magic number and fit max rx buffer size accurately.
- Patch registers CR47 and CR157 on devices that require it.
- Fix power calibration setting on ZD1211B.

Obtained from:	OpenBSD

- Fix multicast transfer by properly reprogram multicast global
  hash table, which in turns fix promiscuous mode and IPv6
  autoconfiguration / local networking.

Reviewed by:	sam, Weongyo Jeong
Tested using:	Aztech WL230 , Belkin F5D7050, Unicorn WL-54G,
             	3COM 3CRUSB10075
MFC after:	1 week
2007-11-08 08:25:58 +00:00
Kevin Lo
02f0a39fed Check wep flag in *_tx_mgt since we need to encrypt some management frame
in case of shared authentification.

Obtained from: NetBSD
2007-11-06 07:30:12 +00:00
Alexander Kabaev
907aa90518 Do not pass an address to local stack variable to usbd_set_report_async.
Allocate space in keyboard state structure instead to prevent random byte
from possibly overwritten stack location frombeing shoved into USB device
when transfer actually takes place.

This fixes at least one instance of LEDs not working with USB keyboards.
2007-11-05 19:51:12 +00:00
Sam Leffler
96492b1b20 upgrade zd1211b firmware for the zyd driver. This solves a hardware
reset problem when we reboot the system with the zyd device inserted.

Submitted by:	Weongyo Jeong
Reported by:	Ted Lindgreen (ted@tednet.nl)
MFC after:	1 week
2007-11-03 19:24:51 +00:00
Sam Leffler
38cb62eb95 fix a typo in rx radiotap's flags
Submitted by:	Weongyo Jeong
Reviewed by:	sam
MFC after:	3 days
2007-11-03 19:22:54 +00:00
Sam Leffler
d8e40e35ce correct entry 2007-11-03 19:11:35 +00:00
Alexander Motin
11bfc2922d Add one of HTC Smartphone/PocketPC device IDs.
Tested with Qtek S200 (HTC Prophet).
2007-10-22 08:28:24 +00:00
Julian Elischer
3745c395ec Rename the kthread_xxx (e.g. kthread_create()) calls
to kproc_xxx as they actually make whole processes.
Thos makes way for us to add REAL kthread_create() and friends
that actually make theads. it turns out that most of these
calls actually end up being moved back to the thread version
when it's added. but we need to make this cosmetic change first.

I'd LOVE to do this rename in 7.0  so that we can eventually MFC the
new kthread_xxx() calls.
2007-10-20 23:23:23 +00:00
Sam Leffler
df8a38f46a fix an incorrect setting of `retry times' in case of zd1211b, we
should set the ZYD_MACB_MAX_RETRY register instead of ZYD_MAC_RETRY

Submitted by:	Weongyo Jeong
MFC after:	1 week
2007-10-19 16:33:31 +00:00
Takanori Watanabe
02c788a24e Add Winchiphead (or Nanjin QinHeng Electronics) USB Serial converter driver.
I tested it on cheap serial converter.(Only costs 980JPY.)
2007-10-18 10:51:06 +00:00
Alexander Kabaev
d5d78259ac Make ukbd_getc respect non-blocking behavior if one is requested. Change
ukbd_poll to mark this keyboard instance as polling before calling
usbd_set_polling at USB level. usbd_set_polling runs softintr before
returning, stealing our input and making consequent polling getchar
kind of pointless.

This allows USB keyboards to coexist peacefully with serial console in DDB
and other contexts where polling is used.

MFC after:	1 week
2007-10-15 20:37:34 +00:00
Sam Leffler
b6cbf52f09 fix a bug of RX routines that can't process multi-frame transactions
properly due to the shortage of the RX buffer size.  In a case of zyd
devices, up to 3 frames can be combined in an USB transaction.  So, RX
buffer should be at least ((MCLBYTES + extra structs) * 3)

Submitted by:	Weongyo Jeong <weongyo.jeong@gmail.com>
MFC after:	3 days
2007-10-15 17:39:47 +00:00
John Baldwin
6b66deaeff The ukbd driver has some questionable "magic" to for a default keyboard
which is ukbd0.  Specifically, the keyboard driver structures for ukbd0
are not allocated/freed but are statically allocated via a persistent
global variable.  There is some additional magic for the ukbd0 such that
if the keyboard is marked as probed in this global variable, then we
don't check to see if the device_t we are probing has an interface.

This causes a problem if an attach of ukbd0 fails without fulling clearing
the state in the global variable.  Specifically, if the keyboard fails to
initialize in init_keyboard() or kbd_register(), then the keyboard will
still be marked as probed.  The USB layer will then try to offer the
"generic" version of the USB keyboard device (as opposed to the
per-interface sub-devices) and the ukbd(4) driver will see that the
keyboard is marked probe and will skip the "is this a per-interface device"
check.  Later in ukbd_attach() it panics because it tries to dereference
the interface pointer which is NULL.

The fix is to clear the flags in the persistent keyboard data for ukbd0
when init_keyboard() or kbd_register() fail.

MFC after:	1 week
Reviewed by:	imp
2007-10-12 19:47:42 +00:00
Takanori Watanabe
5e6c8da764 Add another zydas device: Planex GW-US54GD (a.k.a Dempaotoko) 2007-10-12 08:45:55 +00:00
Luigi Rizzo
cf1a10e8c0 Add entries for Epson multifunction scanner/printer/card readers,
with all functions supported. This is done adding usb device IDs
to the table of recognised devices (because there is no standard
'scanner' class, so no other way to recognise them), and with
a small change to the uscanner attach routine that prevents
reconfiguring the whole USB device while we are dealing only with
one of its USB interfaces.

The latter part has been suggested by Steinar Hamre in
http://www.freebsd.org/cgi/query-pr.cgi?pr=107665 , i have
only added a bit of explaination to the code.

I have personally tried this on the Epson DX-5050 and DX-6000
devices (on the US market they have different names, CX-something).
I have good reasons to think that, possibly with the mere addition
of more USB ids to the table in uscanner.c, this should work with
all Epson multifunction devices in that family (from DX-3800 to
DX-7000 - these units are in the 50-120$ price range).
More details on related topics (SANE configuration, OCR, etc.)
at http://info.iet.unipi.it/~luigi/FreeBSD/dx5050.html

Manpage updates coming soon.

Approved by: re, imp
MFC after: 3 days
2007-10-05 07:26:39 +00:00
Warner Losh
2ba799df13 Add support for the AX88178 and AX88772 based devices.
Submitted by: sam@
Approved by: re@ (blanket)
2007-09-25 20:47:24 +00:00
John Baldwin
75d4506b87 - Only assume that a PCI device on the same slot is a "neighbor" USB
controller if it's sole child device has the "usb" device class.
  Previously ehci(4) would think that PCI-ISA bridges on the same slot
  (such as in some Intel ICHs) were "neighbors" resulting in spurious
  warnings about neighbor count mismatches.
- Fix a memory leak when looking for neighbors.

MFC after:	1 week
Approved by:	re (kensmith)
Tested by:	phk
2007-09-19 16:21:34 +00:00
Sam Leffler
b105a06908 Update beacon handling to sync w/ vap code base:
o add driver callback to handle notification of beacon changes;
  this is required for devices that manage beacon frames themselves
  (devices must override the default handler which does nothing)
o move beacon update-related flags from ieee80211com to the beacon
  offsets storage (or handle however a driver wants)
o expand beacon offsets structure with members needed for 11h/dfs
  and appie's
o change calling convention for ieee80211_beacon_alloc and
  ieee80211_beacon_update
o add overlapping bss support for 11g; requires driver to pass
  beacon frames from overlapping bss up to net80211 which is not
  presently done by any driver
o move HT beacon contents update to a routine in the HT code area

Reviewed by:	avatar, thompsa, sephe
Approved by:	re (blanket wireless)
2007-09-17 19:07:24 +00:00
Warner Losh
30ac77cd25 Zyd needs be under Giant because USB is under Giant.
Submitted by: Weongyo Jeong
Reviewed by: sam@
Approved by: re@ (blanket)
2007-09-15 23:30:10 +00:00
Sam Leffler
2a2391c23c - fix a bug that zyd_attach() returns 0 even if it encountered errors
that can lead to a panic when the stick is yanked.
- make sure that zyd_attach() returns 0 or errno.

Submitted by:	Weongyo Jeong <weongyo.jeong@gmail.com>
Reported by:	Ted Lindgreen <ted@tednet.nl>
Reviewed by:	sam
Approved by:	re (blanket wireless)
2007-09-07 03:54:54 +00:00
Sam Leffler
5c096cfbe5 Add missing bg scanning bits; update ic_lastdata and cancel any
bg scan when there's outbound traffic.

Approved by:	re (blanket wireless)
2007-09-05 23:40:59 +00:00
Sam Leffler
2b9411e29f Add missing bits that made bg scanning lame:
o update ic_lastdata to reflect time of last outbound frame
o outbound traffic must preempt/cancel bg scanning to avoid delays

This stuff was somehow missed in the initial import.

Reviewed by:	thompsa, avatar, sephe (earlier version)
Approved by:	re (blanket wireless)
2007-09-05 23:00:27 +00:00
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