Commit Graph

2925 Commits

Author SHA1 Message Date
jmcneill 05b25a6836 Ensure that we don't clear the EHCI_PS_CLEAR bits by writing 1s to them
when modifying port state in ehci_suspend and ehci_resume.
2008-01-28 01:52:31 +00:00
jmcneill e4e10d4f97 Release port ownership on detach, so devices will be routed to companion
controllers. This allows 'drvctl -d ehci0' to disable USB 2.0 mode.
2008-01-28 00:47:05 +00:00
jmcneill b6294fbf32 Add some USB EHCI Legacy Support Extended CSR bit definitions. 2008-01-27 20:06:48 +00:00
ad 632e64ed4e lockmgr() not used here, remove ref to it. 2008-01-25 20:39:28 +00:00
jmcneill a06bac7d44 Speed up uhub attachment considerably. Rather than powering up each port
individually then waiting for it to become stable, power them up all
at once and then delay. Don't even bother delaying if we are a root hub,
as this is handled separately in the event thread. From OpenBSD.
2008-01-25 00:29:12 +00:00
ichiro 2e9fa9fff0 make compile 2008-01-21 12:16:31 +00:00
ichiro c6061e7174 change umass quirks logic in USB_MATCH()
PR/37687 from Yojiro UO
2008-01-21 12:11:21 +00:00
ichiro 817e003a02 add full support device driver for Huawei E220 wireless modem
PR/37692 from Yojiro UO
---
uhmodem: device driver for huawei 3G wireless modem

* what it is?

A device driver for huawei 3G wireless modem, E220 and its valiations.

The devices are very simuler to ubsa device, but they need special care
to use as modem device.
This patch introduce "uhmodem (USB Huawei modem)" for the devices.
A uhmodem device has two com devices and one USB mass strage device.
The driver enable to use all of them.

* dmesg:
uhmodem0 at uhub0 port 1 configuration 1 interface 0
uhmodem0: HUAWEI Technologies HUAWEI Mobile, rev 1.10/0.00, addr 2
uhmodem0: mass storage only mode, reattach to enable modem
uhmodem0: at uhub0 port 1 (addr 2) disconnected
uhmodem0 detached
uhmodem0 at uhub0 port 1 configuration 1 interface 0
uhmodem0: HUAWEI Technologies HUAWEI Mobile, rev 1.10/0.00, addr 2
ucom0 at uhmodem0 portno 0: modem
ucom1 at uhmodem0 portno 1: monitor
umass0 at uhub0 port 1 configuration 1 interface 2
umass0: HUAWEI Technologies HUAWEI Mobile, rev 1.10/0.00, addr 2
umass0: using SCSI over Bulk-Only
scsibus0 at umass0: 2 targets, 1 lun per target
cd0 at scsibus0 target 0 lun 0: <HUAWEI, Mass Storage, 2.31> cdrom removable
2008-01-21 11:36:46 +00:00
dyoung b480b62270 Make many ethernet drivers share the common code for MII media
handling, ether_mediastatus() and ether_mediachange().  Check for
a non-ENXIO error return from mii_mediachg().  (ENXIO indicates
that a PHY is suspended.)

This patch shrinks the source code size by 979 lines.  There was
a 5100-byte savings on the NetBSD/i386 kernel configuration, ALL.

I have made a few miscellaneous changes, too:

gem(4): use LIST_EMPTY(), LIST_FOREACH().
mtd(4): handle media ioctls, for a change!
axe(4): do not track link status in sc->axe_link any longer
nfe(4), aue(4), axe(4), udav(4), url(4): do not reset all PHYs
        on a change of media

Except for the change to mtd(4), no functional changes are intended.

XXX This patch affects more architectures than I can feasibly
XXX compile and run.  I have compiled macppc, sparc64, i386.  I
XXX have run the patches on i386 boxen with bnx(4) and sip(4).
XXX Compiling and running on evbmips (MERAKI, ADM5120) is in
XXX progress.
2008-01-19 22:10:14 +00:00
is 257a88e757 Move from workqueue to an explicit kthread for setting the multicast
filter, as suggested by cube@. Actual code review by cube@.
This way, a backport of the fix to netbsd-4 is possible.
2008-01-16 12:33:54 +00:00
cube 55f21981d9 workqueue(9) has the non-evident limitation that the caller cannot reuse
the same struct work before workqueue(9) has internally started to work on
the task.

So to make sure that doesn't happen, provide a semaphore not to run the
workqueue multiple times.  It might be clearer just skip using workqueue(9)
and use a thread for about everything, but oh well, I leave that to
someone else.

Now is@ can yank his USB-to-Ethernet adapter while the interface is up.
2008-01-12 22:32:51 +00:00
gdt 1424adf410 Support FIONBIO.
Support non-blocking reads from USB printers.  With this, escputil can
query the printer model, and I can print a test page with gutenprint
5.1 and cups.   Add many comments explaining why the support is not
quite right.  (This change is quite a bit less invasive than a
"correct" fix, and thus more reasonable to pull up to netbsd-4.)

Rototill debugging, so that all DPRINTFN have a level, and so that the
message is printed if the debug level is >= the number in the source
code.  Document debug level plan.

Fix bug where only one status change would be printed (by inspection,
not tested).

Document scheme for reading/discarding data when ulpt(4) is opened for
write only.

Delete dead code.

Plan and patch posted on tech-kern without objections.
2008-01-08 00:58:09 +00:00
ad 0664a0459b Start detangling lock.h from intr.h. This is likely to cause short term
breakage, but the mess of dependencies has been regularly breaking the
build recently anyhow.
2008-01-04 21:17:40 +00:00
smb 0cb6d977ab Add calls to pmf_deregister on detach. 2008-01-04 03:56:47 +00:00
smb 1d2e422408 Add pmf register/deregister to ucom and ugensa. (Addtionally, let a
Sierra wireless card be recognized as a ugensa.)
2007-12-30 21:49:47 +00:00
perry b6a2ef7569 Convert many of the uses of __attribute__ to equivalent
__packed, __unused and __dead macros from cdefs.h
2007-12-25 18:33:32 +00:00
smb 34da33dfe3 Add missing call to pmf_deregister() in the USB_DETACH routine. 2007-12-24 14:41:19 +00:00
dyoung 6f3852fab4 Constify struct ifnet->if_sadl and every use throughout the tree.
Add if_set_sadl() that both sets the link-layer address length and
replaces the current link-layer address with a new one, and use it
throughout the tree.
2007-12-20 21:08:17 +00:00
christos f54e064ee9 add null pmf handlers. 2007-12-16 19:01:35 +00:00
mjf e3aec4fc22 Regen. 2007-12-15 12:51:59 +00:00
mjf cd86b0a3cf Add the vendor eMPIA Technology and add the built-in USB camera that is
found on the EEEpc.
2007-12-15 12:50:12 +00:00
lukem 456279df8f use __KERNEL_RCSID() 2007-12-11 12:29:11 +00:00
lukem 961afe5035 use __KERNEL_RCSID() instead of __RCSID() 2007-12-11 12:16:34 +00:00
jmcneill 8eeb638b73 Register with pmf 2007-12-11 03:45:57 +00:00
smb 9428ee68f7 Add Sierra 5725 miniPCI wireless card (CDMA EVDO) 2007-12-09 21:26:47 +00:00
smb 8167a34333 Correct error in 5725 commit 2007-12-09 21:24:30 +00:00
smb 38fba18e22 Add Sierra 5725 mini-PCI card 2007-12-09 21:21:21 +00:00
jmcneill 4c1d81b2b5 Merge jmcneill-pm branch. 2007-12-09 20:27:42 +00:00
pooka 4e38160d4d Do not "return 1" from kqfilter for errors. That value is passed
directly to the userland caller and results in a mysterious EPERM.
Instead, return EINVAL or something else sensible depending on the
case.
2007-12-05 17:19:46 +00:00
ad 6874e511b7 lockmgr -> mutex 2007-12-05 07:58:29 +00:00
ad 5a24480bf8 lockmgr -> mutex 2007-12-05 07:15:53 +00:00
jmcneill 490542edae aprintify, on behalf of xtraeme 2007-12-01 23:40:28 +00:00
jmcneill a0d3b0d7a8 aprintify 2007-12-01 14:35:51 +00:00
jmcneill 4fbe23fdd0 aprintify 2007-12-01 04:50:50 +00:00
xtraeme f59c58fb50 regen 2007-11-29 21:08:19 +00:00
xtraeme 0970ce7295 Typo in previous s/HDSPA/HSDPA/ 2007-11-29 21:07:59 +00:00
xtraeme 0976f2f104 regen 2007-11-29 18:38:43 +00:00
xtraeme 88696b51e4 Add support for Novatel Wireless HSDPA Modem to ugensa(4), patch
from Marcin Michal Jessa... thanks.
2007-11-29 18:38:22 +00:00
plunky 736a9db087 Clean up the way that bluetooth drivers attach to the bluetooth stack,
to remove the frobbing that drivers must do in the hci_unit structure.

- driver provides a static const interface descriptor
- hci_unit is allocated by hci_attach() rather than part of softc
- statistics are compiled by driver and provided on request
- driver provides output methods and is responsible for output queue
- stack provides input methods and is responsible for input queue
- mutex is used to arbitrate device queue access
2007-11-28 20:16:11 +00:00
kiyohara 3bf7c476ac + Add COREGA CG-WLUSB2GL and ABOCOM WUG2700.
+ make sure ni->ni_txrate is always initialized to a meaningful value by
  redefining ic->ic_newassoc.
  this should prevent "bogus xmit rate" panics when operating in HostAP
  mode.
+ s/RT2573_[TR]X_LIST_COUNT/RUM_[TR]X_LIST_COUNT/
+ Restore the workaround for rate==0 bug.
+ http://www.ralinktech.com/ domain name is for sale.
  use official url instead: http://www.ralinktech.com.tw/
2007-11-25 09:30:10 +00:00
kiyohara e18f7bdc36 Regen. 2007-11-25 09:17:56 +00:00
kiyohara b18c0cc551 Add COREGA CG-WLUSB2GL. 2007-11-25 09:16:49 +00:00
sborrill 12e455f905 Some manufacturers use the same vendor and product id for different devices.
We need to sanity check the DeviceClass in this case.

Currently known guilty products:
0x050d/0x0121 Belkin Bluetooth and USB2LAN

If this turns out to be more common, we could use a quirk table.
2007-11-20 10:43:01 +00:00
ad dc26833bb6 - Factor out too many copies of the same bit of tty code.
- Fix another tty signalling/wakeup problem.
2007-11-19 18:51:36 +00:00
gson 944c1349c7 Set sc_dying on attach failure so that a subsequent open won't cause a
crash.  Fixes kern/36476.
2007-11-16 15:21:42 +00:00
ad 9bf7522dd1 Call ttwakeup() with tty_lock held. 2007-11-12 14:20:40 +00:00
plunky 7cca9485cc convert device printf() usages to aprint_xxxx() 2007-11-11 12:59:02 +00:00
plunky 0b799668fb use more device_t and device_xxx() accessors
make bluetooth stack keep device_t instead of softc pointer as
device is not necessarily part of softc, and pass device_t to
driver callbacks. hci_devname is no longer required.
2007-11-10 23:12:22 +00:00
ad 0f8b0df960 Call ttyflush() with tty_lock held. 2007-11-10 18:29:36 +00:00
plunky ed67784932 remove #include <usbhid.h> as its not needed 2007-10-25 19:32:15 +00:00
degroote 0e9691e3e3 Fix a number of driver which doesn't check wep flag in *_tx_mgt.
It is incorrect because we need to encrypt some management frame in case of
shared authentification.
2007-10-21 17:03:37 +00:00
ad a2a3828545 machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h 2007-10-19 11:59:34 +00:00
xtraeme ee740853d7 regen 2007-10-14 01:09:00 +00:00
xtraeme fe47e4a5cf umidi(4) entries plus quirks for Roland UA25, UA4FX and SonicCell.
Submitted by DHOYASHIKI Shinichi via PR kern/36834.
2007-10-14 01:08:35 +00:00
ad 46ed8f7d77 Use the softint API. 2007-10-08 16:18:02 +00:00
veego d7415fbd43 Add support to ignore hid attachments for some devices, right now MGE and
APC UPS devices.
No objections on tech-kern at the end of June 2007
Patch is from PR kern/31884
2007-10-03 15:01:28 +00:00
plunky 2e43d32311 fix typo : -> ; 2007-10-02 05:53:47 +00:00
plunky 0327efae31 clean up activate function 2007-10-02 05:38:06 +00:00
mlelstv 33b1e31ca5 Regen 2007-09-22 08:37:33 +00:00
mlelstv 40f327bf0a Add different models of the i-Bead Musicstick 2007-09-22 08:37:01 +00:00
mlelstv 1d76013c7f Regen. 2007-09-22 07:42:12 +00:00
mlelstv 7842ee46ad Another UMTS device from Option N.V. 2007-09-22 07:41:29 +00:00
mlelstv 43bf615b6b Add config information for uslsa(4) to the list 2007-09-22 07:40:19 +00:00
mlelstv 50c43c7f9f Regen. 2007-09-16 10:53:28 +00:00
mlelstv 3d9a003a8b add product code for Huawei E220 HSDPA USB Modem 2007-09-16 10:51:14 +00:00
riz ed3a102d07 Remove a comment that is no longer true - this driver does, in fact,
support multiple serial ports.
2007-09-13 21:01:48 +00:00
gson a74fd1b8dc Fix typo in comment 2007-09-09 16:35:13 +00:00
plunky 086f1f09f5 fix misleading comment 2007-09-08 07:46:13 +00:00
plunky c212c4900f move the HID processing defs to a higher context, since it is used by
bluetooth and USB code.
2007-09-07 20:17:37 +00:00
tshiozak d0a32c7b25 add support for WinChipHead CH341/340 USB-Serial bridge. 2007-09-03 17:57:36 +00:00
tshiozak ad88e4382b sync with the last change of usbdevs. 2007-09-03 17:43:20 +00:00
tshiozak 64af3fdf23 add vendor WINCHIPHEAD and product CH341SER. 2007-09-03 17:41:41 +00:00
riz f6f3fbbfc3 Properly support both ports of the FTDI 2232C. This allows me to
use all 16 ports of my USB-16COM-RM adapter.  I also verified that
single-port units still work as expected.
2007-09-02 22:35:25 +00:00
dyoung dcd8923429 Change a bazillion occurrences of code resembling this,
error = (cmd == SIOCADDMULTI) ?
	    ether_addmulti(ifr, &sc->sc_ec) :
	    ether_delmulti(ifr, &sc->sc_ec);

	if (error == ENETRESET) {

to this,

	if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) {

which does the same thing.

(A bazillion is a very large number.  This seems to make the i386
ALL kernel smaller by 3kB to 4kB.)

Use ifreq_getaddr() twice in es(4).

Whitespace nits.
2007-09-01 07:32:22 +00:00
dyoung f59a11881a Constify: LLADDR() -> CLLADDR(). 2007-08-29 22:33:42 +00:00
xtraeme 7479c7d76e Use rw_destroy() in the detach function. Spotted by rmind@. 2007-08-27 17:49:54 +00:00
xtraeme 87186fcca6 Use rwlock(9) rather than lockmgr(9). 2007-08-27 15:57:13 +00:00
dyoung 71e77a61b4 Constify: LLADDR -> CLLADDR. I'm aiming here to make it easier to
identify sockaddr_dl abuse that remains in the kernel, especially
the potential for overwriting memory past the end of a sockaddr_dl
with, e.g., memcpy(LLADDR(), ...).
2007-08-26 22:45:55 +00:00
sborrill d07cbdc44b Regen 2007-08-18 20:24:33 +00:00
sborrill e8925d472b Add support for SMART Technologies-badged Prolific USB-Serial converter 2007-08-18 20:23:04 +00:00
kiyohara 66161689a5 Already called *_free_[rt]x_list() in *_stop(). 2007-08-15 16:58:54 +00:00
kiyohara 2db72b9118 * splsoftusb, IPL_SOFTUSB, and IPL_HARDUSB defines in usbdi.h
-> the current names are confusing (didn't change other drivers)
* fix invalid memory access in usbd_transfer (kern/24636)
-> needed for this driver
* fix USB HC detach race condition (kern/32011)
-> main patch needed for this driver, sc_dying changes in other drivers
not necessary but seem right to me

Patch from Matthew Orgass.
  http://mail-index.netbsd.org/tech-kern/2007/06/26/0001.html
2007-08-15 04:00:33 +00:00
jmcneill 2a8951f91f Clear the run flag in the command register when powering down, from
FreeBSD. Makes my laptop, and hopefully others, successfully sleep. Waking
up is a different story...
2007-08-01 22:40:16 +00:00
dyoung c342db9666 Use printf("%zx", arg) instead of printf("%lx", (unsigned long)arg).
Use __arraycount().
2007-07-16 15:55:38 +00:00
nisimura 80496a1328 regen usbdevs.h and usbdevs_data.h 2007-07-16 07:08:49 +00:00
nisimura d99ce83fb8 Redo the previous change, suffered from an accidental removal of ShanTou. 2007-07-16 07:05:27 +00:00
nisimura ed16ca3c2c add PLANEX/PCI GW-US54GXS USB WLAN stick device ID. Not working well yet.
Linked with AP but no real xfer is observed so far.  Hope this helpful for
further debugging.
2007-07-16 06:56:23 +00:00
ad bba99c25aa Generic soft interrupts are mandatory. 2007-07-14 21:02:36 +00:00
xtraeme ff350d3235 regen 2007-07-12 21:24:35 +00:00
xtraeme e05b0ff702 SB-NIC Shantou ST268 for udav(4), patch from Julian Suschlik
via current-users@... thanks.
2007-07-12 21:24:02 +00:00
rmind 20bbb87e34 Implementation of per-CPU work-queues support for workqueue(9) interface.
WQ_PERCPU flag for workqueue and additional argument for workqueue_enqueue()
to assign a CPU might be used. Notes:
 - For now, the list is used for workqueue_queue, which is non-optimal,
   and will be changed with array, where index would be CPU ID.
 - The data structures should be changed to be cache-friendly.

Reviewed by: <yamt>, <tech-kern>
2007-07-12 20:39:56 +00:00
drochner e2da0057b3 Stopgap fix to avoid crash on detach if the attach failed due to eg
USB problems - just return in detach if the softc appears not to be
filled in completely.
(This is a common problem with usb and probably other drivers which
support detach; we need some API support to deal with this cleanly.)
2007-07-11 20:13:14 +00:00
ad 88ab7da936 Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
2007-07-09 20:51:58 +00:00
mlelstv e044ee54b9 Fix typo that prevents port reset after several retries. 2007-06-30 09:17:45 +00:00
itohy 25a6244f88 Regen from usbdevs rev 1.477. 2007-06-28 03:13:43 +00:00
itohy c52b34e473 Add vendors and products from FreeBSD/OpenBSD.
- for ubsa(4):
	Add vendor Huawei Technologies and its product Huawei Mobile
	GlobeTrotter 3G Quad Plus

 - for uipaq(4):
	ASUSTeK MyPal A730
2007-06-28 03:13:01 +00:00
itohy aa6964a386 Regen from usbdevs rev 1.476. 2007-06-24 10:56:32 +00:00
itohy ff96cdce81 Sort vendors and products by number.
Remove duplicates.
2007-06-24 10:43:23 +00:00
veego 4d897a6e25 Regen after the usbdevs updates in rev 1.474 and 1.475 2007-06-24 10:07:05 +00:00
veego 1419b5b5c5 - Add the MGE vendor and two entries.
- Change the APC entry, because it is not Back-UPS Pro 500 specific, it
  is used for more UPS's
Based on a patch from PR kern/31884
2007-06-24 10:02:45 +00:00