summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb
AgeCommit message (Collapse)AuthorFilesLines
2017-05-26Prepare ohci_intr1() for IPL_MPSAFE.mpi2-105/+50
Stop manipulating the done list and root hub port status in the interrupt handler. Some parts lifted from NetBSD's r1.157 but with functionnal polling and without leaving WDH interrupts masked after exiting ddb(4). Fix an splassert() by no longer calling usb_transfer_complete() in the interrupt handler. Issue reported by claudio@, brynet@ and Jacqueline Jolicoeur.
2017-05-20Accept baud rates up to 2 Mbps as these are supported by CP2104 and laterkettenis1-2/+2
variants. ok jsg@, deraadt@
2017-05-18Grab the netlock in umb_state_task() and umb_decode_ip_configuration()bluhm1-4/+9
when calling in_ioctl(). These ioctls modify the routing table, which is global. So they need the lock. Found with Zaur Molotnikov's static lock analyzer. OK gerhard@ mpi@
2017-05-15Use splraise() rather than splsoftnet() which is going away.mpi1-4/+5
2017-05-15Replace remaining SPLUSBCHECK by a splsoftassert(IPL_SOFTUSB).mpi6-28/+22
USB is the last real user of IPL_SOFTNET.
2017-05-12Introduce a new keyboard console hook to enter ddb(4) and make ukbd(4)mpi1-4/+36
use it. Instead of defering every input of a USB console keyboard to a timeout via a queue of one element, only differ entering ddb(4) once a matching control sequenece has been typed. This prevent loosing inputs when a USB console keyboard is "too fast". Fix a problem reported by matthieu@, Adam McDougall and Hrvoje Popovski. ok stsp@, dlg@
2017-05-10It is unsafe to dereference ``xfer'' after calling the callback as itmpi1-5/+12
might free it. Prevent a use-after-free in various aynchronous cases. Found while looking at another user-after-free pointed out by ehrhardt@. Committing now to find if other drivers rely on this use-after-free. tb@ confirmed ubcmtp(4) is now fixed.
2017-05-10Revert r1.61 and partially 1.60. The resulting logic is currently ampi1-10/+1
noop and prevent us from fixing real use-after-free. Since xfer->status is reset by *_device_intr_done(), checking for USBD_IOERROR cannot be true. Problem reported by tb@ because ubcmtp(4) triggers some I/O errors when multiple fingers are used.
2017-05-08improved coordinate filtersbru1-2/+7
ok mpi@
2017-05-08For 8188EU chips, read the R92C_HSSI_PARAM2(0) register to detect whetherstsp1-5/+4
the driver needs to enable the CCK high power feature, as already done for other chips supported by urtwn(4). Same change as FreeBSD r311347. Patch submitted by Kevin Lo. Tested by me.
2017-05-05Remove a DIAGNOSTIC test for a NULL pipe value inside a transfer,jsg1-7/+1
mpi says a transfer can't exist without a pipe. ok mpi@
2017-05-03Byte order of IP addresses was broken on big endian machines.gerhard1-5/+3
MBIM already uses network byte order for IP addresses, so just use them as they are. ok stsp@, deraadt@
2017-05-03Remove unused (and wrong) uaudio_drain() call. From Michael W.ratchov1-29/+3
Bombardieri" <mb@ii.net>.
2017-04-30Rename Debugger() into db_enter().mpi1-2/+2
Using a name with the 'db_' prefix makes it invisible from the dynamic profiler. ok deraadt@, kettenis@, visa@
2017-04-21Use ether_crc32_le() instead of a custom version.mpi1-69/+2
From Hiltjo Posthuma.
2017-04-18Support packet aggregation for umb(4) on tx.gerhard3-83/+160
tested by bluhm@, ststp@ and Bryan Vyhmeister. ok bluhm@ ststp@
2017-04-18Rearrange ure_iff to resemble other drivers a bit more.jmatthew1-6/+13
from Brad
2017-04-11Partially revert previous mallocarray conversions that containdhill1-7/+7
constants. The consensus is that if both operands are constant, we don't need mallocarray. Reminded by tedu@ ok deraadt@
2017-04-09Convert some malloc(9) to mallocarray(9)dhill2-9/+9
ok deraadt@
2017-04-08A pile of sizes to free(9). In test for a few days in snapshots.deraadt42-166/+183
Errors will result in nice clean panic messages so we know what's wrong. Reviewed by dhill visa natano jsg.
2017-04-06Unify a few attach-time patterns between usb *com drivers, and removederaadt3-10/+7
extra zero'ing of variables not needed because softc is pre-zero'd. ok jsg
2017-04-053 more mallocarray() usesderaadt2-5/+5
2017-03-30these free() size choices appear to be wrong. joel has a diff that fixesderaadt1-3/+3
them, but for release let's be conservative and use 0.
2017-03-30Use m_devget(9) to replace code that does more or less the same but assumeskettenis1-25/+2
the received packet fits in a single mbuf cluster, which isn't necessarily the case. This might fix the pool corruption seen by jcs@. ok jcs@, jmatthew@, deraadt@
2017-03-29Remove quirks for two devices that are known to be CDC ACM protocol 0jsg1-10/+1
that are now covered by the generic class matching.
2017-03-29Match on class communications subclass abstract control model protocoljsg2-3/+5
0 "No class specific protocol required" in addition to the existing protocol 1 "AT Commands: V.250 etc" match. This lets umodem(4) attach to the serial console on the overdrive 1000 which is a usb type-b socket on the back of the box not a db9 like the overdrive 3000.
2017-03-26Add sizes to various free(9) calls. Fixing the simpler ones first.deraadt17-68/+74
ok natano visa
2017-03-17More debug goo to help tracking the use-after-free.mpi1-1/+3
2017-03-17ubcmtp(4) works because of a use-after-free. Many more drivers arempi1-13/+6
certainly doing the same. So revert r1.85 for the moment, we're too close from the release and these bugs have been there for years. Regression reported by tb@ on bugs@
2017-03-15Configure and apply the multitouch-tracking functions of wsmouse.bru1-81/+51
Special thanks to Martina P. for her help. ok jcs@ jung@
2017-03-11Add support for RTL8153 devices. Heavily based on changes made by Kevin Lokettenis2-30/+246
to the FreeBSD driver. This driver will attach instead of cdce(4), which doesn't expose a PHY and doesn't work with my 5c20 revision of the chip. ok jimatthew@, jcs@
2017-03-11Introduce a new knob to force the first USB keyboard as console input.mpi1-1/+21
By setting "machdep.forceukbd=1" you can now use your USB keyboard in ddb(4) even if your BIOS emulates a pckbd(4). ok tom@, kettenis@, deraadt@
2017-03-10Fix a use-after-free when sending root hub control transfers.mpi6-12/+12
*_root_ctrl_start() routines are synchronous and all end up calling usb_transfer_complete() in the non-error case. After calling this function it is unsafe to dereference ``xfer'' since the transfer callback has been called. So returning USBD_IN_PROGRESS is wrong in this case since transfers are always completed at this point. So return USBD_NORMAL_COMPLETION or the corresponding error code if something wrong happen.
2017-03-10Move per HC polling code to the stack.mpi6-237/+42
This code contains a use-after-free which be addressed in an upcoming diff. This fix xhci(4) polling mode. ok kettenis@
2017-03-08Do not clear IFF_UP, even in the error path.mpi1-4/+1
This flag should only be set by the stack, drivers shouldn't mess with it. Discussed with dlg@ and mikeb@, ok gerhard@
2017-03-06Do not print uninitialized variable in DPRINTFN().mpi1-2/+2
From Christian Ludwig.
2017-03-06It is unsafe to dereference ``xfer'' after calling the callback as itmpi1-9/+15
might free it. Prevent a use-after-free in various aynchronous cases. Found while looking at another user-after-free pointed out by ehrhardt@.
2017-02-16Remove an unnecessary NULL pointer check.visa1-7/+4
OK stsp@
2017-02-15Align mutex IPL with the interrupt handler's priority.visa1-2/+2
Spotted by stsp@; OK jmatthew@
2017-02-12Replace dummy mutex asserts with real ones.visa4-9/+7
OK stsp@
2017-02-12The videocore portion of the raspberry pi which boots the arm cores andjsg1-1/+29
runs the mailbox interface knows about a MAC address that appears to be derived from a unique serial number along with the raspberry pi foundation oui. It modifies the device tree when booting to store the MAC address in /axi/usb/hub/ethernet/mac-address so fetch and use this value for the integrated smsc(4) Ethernet. A different smsc adapter plugged into one of the USB ports probes later with a different unit number and skips this path.
2017-02-10Fix links to usb-audio specs. From Michael Reed <m.reed at mykolab.com>.ratchov1-4/+4
Thanks.
2017-02-10Use __func__ for DPRINTF's as we do in other parts of theratchov1-13/+13
code. From Michael W. Bombardieri" <mb at ii.net>. Thanks.
2017-02-04Prefer <sys/endian.h> to <machine/endian.h>guenther1-2/+2
ok visa@
2017-02-02Remove dead assignments and now unused variables.chl1-6/+1
Found by LLVM/Clang Static Analyzer. ok mpi@
2017-01-31Fix links to USB audio specs.jca1-4/+4
From Michael Reed
2017-01-30Make urtwn(4) run slot time updates from a USB task.stsp1-1/+24
Fixes 'usbd_do_request: not in process context' warnings introduced recently. Fix reported and confirmed by Mikhail aka mp39590 aka misha
2017-01-29In dwctwo(4), fix an off-by-one in frame interval calculation.stsp1-3/+3
Fix stolen from Linux commit 9ed04d976146cf10dfa4c71171434af7c0348747 ok visa@
2017-01-22move counting if_opackets next to counting if_obytes in if_enqueue.dlg27-65/+27
this means packets are consistently counted in one place, unlike the many and various ways that drivers thought they should do it. ok mpi@ deraadt@
2017-01-12Finish initial 11n support for athn(4).stsp2-26/+27
The heavy lifting was done by damien@ years ago. I didn't even have to figure out what the hardware expects, the code was already there. This driver now supports MCS 0-15 in client and hostap mode. No Tx aggregation and no 40 MHz channels yet. tested by vgross@, bmercer@, tb@, jmc@, Vadim Vygonets, Peter Kay ok bmercer@ tb@ phessler@