Commit Graph

3361 Commits

Author SHA1 Message Date
cegger
e811b2c552 fix NULL pointer dereference on detaching:
Attach an USB device that looks like this:
ugen1 at uhub0 port 2
ugen1: detached
ugen1: at uhub0 port 2 (addr 3) disconnected


When unplugging the device:

usb_transfer_complete: xfer=0xffff80000832a800 not busy 0x00000055
usb_transfer_complete: bad dequeue 0xffff80000832a800 != 0x0
2010-09-03 23:15:09 +00:00
tsutsui
cd398ae4e9 If firmware_load() returns ENOENT (i.e. No such file or directory),
explicitly mention that firmware file is not in the default distribution.
2010-08-25 12:43:56 +00:00
pgoyette
f05cff10bd Update the various xxx_verbose modules to conform to the module subsystem's
new locking protocol.
2010-08-21 13:18:35 +00:00
tsutsui
b1321efa54 Misc cleanup:
- no need to keep TX/RX mbufs during xfers in struct kue_chain
- check RX packet length more strictly in kue_rxeof()
- make some TX/RX handling in kue_send() and kue_rxeof() more readable
  with proper functions

Tested on:
kue0: LINKSYS USB  Network Adapter, rev 1.00/2.02, addr 5
2010-08-16 11:21:43 +00:00
tsutsui
67a0da11d8 Static -> static
We can still preserve static function symbols for debug.
(they're also likely inlined but we can specify -fno-inline on debug)
2010-08-16 09:52:11 +00:00
tsutsui
103c7b2a22 - u_intNN_t -> uintNN_t
- use uint8_t for binary data
- use bool for boolean vaules
No binary change.
2010-08-16 09:44:01 +00:00
tsutsui
0d465ab0de Unifdef defined(__NetBSD__) part. No binary change. 2010-08-16 09:34:43 +00:00
jym
59f63c5a24 Only print the debug message about failed remapping when ATU_QUIRK_NO_REMAP
is not set in the atu_quirk flags.

'!' takes precedence over bitwise operation '&', so use parenthesis.
2010-08-14 21:01:26 +00:00
tsutsui
406df1ed74 Don't free TX mbuf until it's passed to bpf(9). 2010-08-14 12:11:46 +00:00
tsutsui
fffa0899ac - use uint8_t for xfer buffers and byte numbers
- use bool for sc_dying and sc_attached booleans
2010-08-14 10:47:57 +00:00
tsutsui
28bdb07e79 No need to keep TX/RX mbufs during xfers in struct axe_chain.
All xfers are done against axe_buf allocated by usbd_alloc_buffer()
and nothing touched preserved mbufs during xfers.
2010-08-14 10:30:11 +00:00
tsutsui
a2004ecab6 Fix missed botch in previous. 2010-08-14 09:57:13 +00:00
tsutsui
6cc75bd4ed Make pointer arithmetics of RX buf in axe_rxeof() more readable
to avoid further confusion.
2010-08-14 09:02:17 +00:00
tsutsui
e1302a1d39 Apply rev 1.39 again.
The assignment is not dead, but just a leftover that causes a RX bug.

Now axe(4) can receive fragmented packets.
2010-08-14 08:42:15 +00:00
tsutsui
35680abbb1 Ugh, no, revert previous. 2010-08-14 08:10:49 +00:00
tsutsui
69bf29b2a3 Remove dead assignment. 2010-08-14 08:06:54 +00:00
jakllsch
a5bc0d2495 Like some other USB devices, register cdce(4) with pmf(9).
Addresses PR#40949.
2010-08-08 01:57:24 +00:00
christos
2268c39319 Pass the lengths of the buffers and use bound string functions where easy
to do so.
2010-08-07 21:09:48 +00:00
christos
825647fecd Fix for another 3g modem used by Cosmote in Greece. This is a ZTE MF636(?)
modem that requires ejecting the fake umass disk that contains the drivers
like the novatel one. Perhaps I should rename the novatel routine
usbd_scsi_eject() or something.
2010-08-07 20:43:46 +00:00
kiyohara
a6ccc4563f Add attribute sysmon_envsys to device uthum. 2010-08-01 07:29:03 +00:00
jakllsch
0117c2837f Tune ugen(4) isochronous parameters to better support high speed pipes.
Fixes PR#43159.

Justification:

UGEN_NISORFRMS, previously 4, is now 8 because that's the number of
microframes per frame on a high speed bus.  This allows data to be
transfered every microframe if necessary.

UGEN_NISOREQS, previously 6, is now 4.  This is harder to justify,
but I didn't think the total number of buffer frames needed to be
much more than it was.

UGEN_NISOFRAMES, previously 500, is now (UGEN_NISORFRMS * UGEN_NISOREQS)
(32 with values as above).  This is all the more we've actually used.
2010-07-27 20:20:46 +00:00
drochner
d8c815f3cd do a port reset between initial device descriptor fetch and
address assignment - not required by the spec but Windows does so,
fixes a problem with a Sun Keyboard reported by Jonathan Perkin,
verified by Jonathan Kollasch
2010-07-27 16:15:30 +00:00
pgoyette
444ff5f1e3 Move setting of the usb_verbose_loaded flag into the module's init routine.
This ensures that the flag is set even if the module was manually loaded
by the user rather than just auto-loaded.
2010-07-25 13:19:27 +00:00
drochner
e817025fd2 another iteration in the eternal device enumeration struggle:
use a request of 64 bytes for the initial device descriptor fetch.
This is what windows does, and I've seen USB device firmware which
really depends on this. (sends 8 bytes if 64 are requested and
the full descriptor which is more than NetBSD's USB_MAX_IPACKET
otherwise) This is the world...
2010-07-20 20:56:06 +00:00
jakllsch
01c06fb42e Make sc_vendor in ohci_softc the same size as that in uhci_softc and ehci_softc.
This change prevents some truncated OHCI vendor names in some verbose cases:
uhub0 at usb0: ATI Technologie OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
...
uhub1 at usb1: ATI Technologies EHCI root hub, class 9/0, rev 2.00/1.00, addr 1
2010-07-12 04:16:51 +00:00
msaitoh
310cb20a73 For interrupt transfer, nak throttling must be disabled, but for the other
transfer type, nak throttling should be enabled from the veiwpoint that
avoids the memory thrashing. Fixes a problem that interrupt transfer stall
on some EHCI controllers (e.g. Geode LX). Fixed by Yamada Katsumi.
2010-07-07 03:55:01 +00:00
tsutsui
765d16798a Add a missing newline in error messages. 2010-07-05 14:27:26 +00:00
tsutsui
44e300fde8 Make zyd(4) use config_mountroot(9) to complete device initialization
(which requires firmload(9)) right after mountroot.

Now it's attached on boot as following:
---
uhub4 at usb4: vendor 0x1033 EHCI root hub, class 9/0, rev 2.00/1.00, addr 1
uhub4: 5 ports with 5 removable, self powered
 :
zyd0 at uhub4 port 4
zyd0: PCI PCI GW-US54GXS, rev 2.00/48.10, addr 3
 :
boot device: wd0
root on wd0a dumps on wd0b
root file system type: ffs
zyd0: HMAC ZD1211B, FW 47.25, RF AL2230, PA 0, address 00:22:cf:xx:xx:xx
zyd0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
zyd0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
 :
---

Should close PR kern/43125, no particular objections in that PR.
2010-07-04 15:38:27 +00:00
tsutsui
c3e7f27703 Add upgt(4), a driver for Conexant/Intersil PrismGT SoftMAC USB
IEEE 802.11b/g WLAN device, ported from OpenBSD by FUKAUMI Naoki:
http://mail-index.NetBSD.org/current-users/2010/05/28/msg013570.html
Slightly modified by me to use recently added config_mountroot(9)
to defer some device initialization until mountroot for firmload(9).

Tested on Sharp W-ZERO3 WS003SH with internal WLAN.

Note currently we cannot redistribute firmware files for upgt(4) so
they have to be downloaded and copied into /libdata/firmware/upgt manually.
See upgt(4) man page about firmware details.
2010-07-04 15:21:57 +00:00
tnn
1560e0a19d regen 2010-07-02 08:36:57 +00:00
tnn
f6a7b56eb6 Add id for Samsung GT-B3730 LTE/4G datacard 2010-07-02 08:35:41 +00:00
msaitoh
c8a979e989 Do not process the abnormality system procedure, when Run/Stop=0 and
HCHalted=1 - this is normal. Fixes a bug that system hangs at boot time
when a USB mass storage is connected via UHCI. This problem was observed
on Intel D410PT and was fixed by Katsumi Yamada.
2010-06-29 04:02:07 +00:00
tsutsui
25ee109070 Replace evil pointer casts that cause unaligned access panic on ARM and
MIPS with proper le16dec(9) and le32dec(9) functions for byte stream.

Now kue(4) works on hpcarm W-ZERO3.
2010-06-27 11:53:59 +00:00
kardel
4eaf338488 add quirk for CDC-ACM devices that do not have a CDC UNION interface descriptor.
idea gleened from Linux cdc-acm implementation (which has a long list of these devices)
first tested/added device is MTK GPS receiver.
2010-06-27 10:41:26 +00:00
kardel
32f65870e4 add MTK chipset based GPS receiver (e. g. Qstarz BT-Q1000eX) 2010-06-27 10:32:13 +00:00
tsutsui
586cb95b19 KNF and misc cosmetics. 2010-06-24 15:01:45 +00:00
tsutsui
79c4c75696 Remove unused sc->axe_stop_task in softc. 2010-06-24 14:41:31 +00:00
tsutsui
59fadcf9bc Fix several botches:
* in axe_detach():
  * call callout_destroy(9) after axe_stop() which calls callout_stop(9)
    (otherwise gets panic on DIAGNOSTIC and LOCK_DEBUG kernel)
  * no need to call usbd_abort_pipe() that are done in axe_stop()
  * no need to call usb_detach_wait() twice
  * also destroy axe_mii_lock mutex
 * in axe_tick_task():
  * fix an inverted logic
2010-06-24 14:39:57 +00:00
pgoyette
55ac16fd0f Update if_axe for additional chips and models. Mostly imported from
OpenBSD, with significant contribution from FUKAUMI Naoki.

Also addresses PR kern/40456
2010-06-23 19:00:26 +00:00
pgoyette
e526de58fe Fix cut&paste error - the commit log message was correct, just the code
got messed up.  Thanks cegger@ for noticing!
2010-06-23 06:25:17 +00:00
pgoyette
97c9adb3c6 Make sure we unlock before exit. 2010-06-22 21:30:55 +00:00
kardel
814e4d4117 add Huawei E1750 Mobile Broadband HSPA USB Stick 2010-06-19 22:41:32 +00:00
riz
7bb51f5029 Add support for the Novatel Wireless U760 3g USB Modem. Tested
by Matthew Sporleder.
2010-06-17 23:25:01 +00:00
riz
cdb738d83f Regen. 2010-06-17 23:22:50 +00:00
riz
34a8cadc70 Novatel U760 3g wireless device IDs. 2010-06-17 23:22:21 +00:00
riz
85415e1eb9 Sort ugensa_devs by vendor/product. No functional change intended. 2010-06-14 22:24:14 +00:00
riz
ed9f91bc14 Sort u3g_devs by vendor/product. Also, remove duplicate
USB_PRODUCT_NOVATEL2_MERLINV620 entry.  No functional change intended.
2010-06-14 22:22:44 +00:00
riz
90f3d84c58 ugensa support for Sierra Wireless USB 305, from Andy Wallis
in PR#43468 .
2010-06-14 19:05:24 +00:00
riz
153e354bb9 Regen for Sierra Wireless USB 305 and sorting change. 2010-06-14 19:02:06 +00:00
riz
58c5a38c32 Sort Sierra Wireless products by ID. 2010-06-14 18:57:49 +00:00