summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb
AgeCommit message (Collapse)AuthorFilesLines
2015-04-16Make sure LLVM static analyzer do not report a false positive,mpi1-5/+3
found by and fix confirmed by jsg@.
2015-04-16New driver for Araneus Alea II TRNG. All the hardwork has been done bympi2-1/+199
Sean Levy, aka attila, <attila + stalphonsos ! com>, thanks! ok deraadt@
2015-04-14Setting the configuration in *_attach() is a bad practise because if itmpi1-23/+10
fails it's impossible to debug and you cannot use your device. So instead of calling usbd_set_config_index(), match the right interface. This is trivial with this device because it has only one configuration and interface.
2015-04-14It's not possible to call umcs_get_status() in interrupt contextmpi1-2/+28
because it submits synchronous transfers, so schedule a task when necessary.
2015-04-14Make sure we close the interrupt pipe when the device is detached.mpi1-7/+1
Bug reported and fix tested by Thomas Pfaff, thanks!
2015-04-13Now that if_input() set the receiving interface pointer on mbufs for usmpi1-2/+2
there's no need to do it in m_devget(9). Stop passing an ``ifp'' will help for upcoming interface pointer -> index conversion. While here remove unused ``ifp'' argument from m_clget(9) and kill two birds^W layer violations in one commit. ok henning@
2015-04-10I did quite some changes to this driver, so add copyright.mpi1-1/+16
2015-04-10Full-speed isochronous transfers support with opportunistic micro-framesmpi3-356/+417
scheduling. More work is required to properly budget and schedule micro-frames, most of it at the HUB level. But this let people use USB1.1 uaudio(4) devices on ehci(4)-only systems. Thanks to all the testers! ok ratchov@, sthen@, naddy@
2015-04-10Convert remaining USB Ethernet adapter to if_input().mpi6-89/+35
ok dlg@
2015-04-02use correct capitalization of 'BlackBerry'jasper4-11/+11
"sure" deraadt@
2015-04-01Small cleanups when attaching sensors, from David Higgs.mpi1-6/+5
2015-03-27Convert to if_input().mpi1-19/+6
Tested by and ok uaa@
2015-03-27simply do if_input() between splnet() and splx(), like other driversuaa1-6/+4
(such as if_udav.c). ok by mpi@
2015-03-25Expand ehci_{add,del}_intr_list() macros.mpi1-17/+12
ehci(4) is using a TAILQ_* to keep track of the pending transfers. In this context "pending" means submitted to the hardware. Now that we are no longer fiddling with the internal of the TAILQ_* there's no good reason to keep these macro, but more importantly this will let us reuse the 'inext' field to get rid of the other hand-rolled lists of xfers. No functional change.
2015-03-25Merge ehci_device_request() into ehci_device_ctrl_start() to matchmpi1-52/+35
what's done with other transfer types. No functional change.
2015-03-25Remove more DPRINTFs, this file is almost in a readable state now.mpi1-53/+3
2015-03-25Use KASSERT() to check when/if URQ_REQUEST is correctly set just likempi1-31/+9
xhci(4) does.
2015-03-25Remove EHCI_DEBUG chunks that make things harder to understand.mpi1-159/+2
Over the years I understood that debugging USB HCD problems without hardware access do not work and even in this case it's easier to write a specific debug/prinf diff.
2015-03-24Convert to if_input(). Tested by jsg@ who found that at least one hismpi1-22/+6
(newer) machine can't set the device in a configurated state. But this is a USB-related problem.
2015-03-23unlock MII on smsc_miibus_writereg errorjsg1-1/+2
from Patrick Wildt
2015-03-23Return an error if getting the config descriptor failed.jsg1-1/+3
Avoids a NULL dereference encountered with a device I have. ok mpi@
2015-03-23Convert to if_input(), tested by jsg@, thanks!mpi2-27/+12
2015-03-20Convert to if_input(), tested by Fabian Raetz, thanks!mpi1-10/+8
2015-03-19Let it compile.mpi1-5/+5
2015-03-19Abort tasks are run in their own thead, that's why they need a specialmpi1-2/+2
type, from Patrick Wildt.
2015-03-19Use the same workaround as ehci(4) and ohci(4) in setaddr() to deal withmpi1-1/+26
half configured control pipe, from Patrick Wildt.
2015-03-19unlock MII on smsc_miibus_readreg errorjsg1-3/+3
from Patrick Wildt
2015-03-17Prevent a race resulting in an infinite loop printing "ehci_idone" messages.mpi1-20/+28
As soon as a transfer is being cancelled, remove it from the list of pending xfers. This way the soft interrupt routine won't try to process it before ehci_abort() gives it back to the stack. Problem analysed by and previous diff ok stsp@
2015-03-14Remove some includes include-what-you-use claims don'tjsg61-125/+61
have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
2015-03-11Convert to if_input().mpi1-13/+7
Tested and ok armani@
2015-03-06Revert previous, the fix is not right and causes a regression asmpi1-15/+17
reported by Remi Locherer on bugs@. ok deraadt@
2015-03-02Remove stray ')' from athn(4) "firmware command timed out" error message.stsp1-2/+2
2015-03-02athn(4) USB drops received frames larger than MCLBYTES.stsp1-1/+7
Count these dropped frames as input errors.
2015-03-02Fix re-associations with athn(4) USB devices in station mode.stsp1-6/+23
Sending the firmware a NODE_ADD command for our BSS doesn't seem to have the desired effect in station mode. It made a new association after ifconfig down/up impossible until the device was re-plugged. Leave the code in place but limit it to hostap mode, just in case it is needed there (hard to tell since hostap mode seems to be broken -- no beacons are sent by the device). Also, when leaving run state, reset the RX filer to allow all beacons again. ok mpi@
2015-03-02Rework ath(4) USB firmware command handling.stsp2-31/+55
The previous code was racy and could dead-lock the USB task thread when a firmware command timed out (e.g. because the user pulled out the device). Handle this condition by marking the device as dying as soon as the interrupt handler gets an IOERROR and making sleeping firmware command threads check for a dying device when waking up. Ensure that no thread will try to send a command before the previous one has completed. There is only a single xfer data structure for firmware command transfers and reusing an in-flight xfer will give the USB stack curly toenails ("xfer not free"). Allow up to ATHN_USB_HOST_CMD_RING_COUNT firmware commands to be enqueued on the command ring, rather than just one. Use standard usdb_wait_task() when waiting for command ring completion instead of hand-rolled tsleep()s. discussed with and ok mpi@
2015-03-02Fix scanning with athn(4) USB devices.stsp2-6/+36
The driver artificially limited the number of slots for nodes in its net80211 node cache to 8, the rationale being the device firmware can only handle 8 associated nodes at a time. But that's not a good reason to only cache 8 of potentially many APs in the area. Instead of crippling upper layer data structures, impose the limit locally by raising an error if more than 8 nodes are trying to associate (which can only happen in hostap mode, and hostap mode seems to be broken anyway). This matches what Linux ath9k does. Also, use a USB-specific scan timeout callback to we can do USB refcounting while scanning. ok mpi@
2015-03-02In athn(4), set USB pipe pointers to NULL after closing pipes. Not reallystsp1-6/+14
required since this code runs during device detach but looks prettier. Also remove an unneeded call to usbd_abort_pipe() which is implied by usbd_close_pipe(). ok mpi@
2015-03-02Teach athn(4) about USB reference counting to prevent it from causing majorstsp1-2/+18
confusion in the USB stack. Also add some usbd_is_dying checks. suggested by + ok mpi@
2015-02-28Prevent a race resulting in an infinite loop printing "ehci_idone" messages.mpi1-17/+15
As soon as a transfer is being cancelled, remove it from the list of pending xfers. This way the soft interrupt routine won't try to process it before ehci_abort() gives it back to the stack. Problem analysed by and ok stsp@
2015-02-28Fix uhidev_get_report_async() from David Higgs.mpi1-4/+7
2015-02-16allow Arduino Leonardo to attach to umodem(4), from Gregor Beststhen1-1/+5
2015-02-16syncsthen2-4/+16
2015-02-16add Arduino Leonardo, from Gregor Best (plus typo+ordering fix)sthen1-1/+5
2015-02-14Define UPS_PORT_TEST as FreeBSD/NetBSD do.uebayasi1-1/+2
2015-02-14Handle (poll) HCD interrupt right after initialization to immediately markuebayasi1-1/+4
ports as enabled/connected.
2015-02-12Convert to if_input().mpi1-12/+8
ok dlg@
2015-02-12Fix typos.uebayasi2-8/+8
2015-02-12Provide interface for external DMA address configuration.uebayasi6-12/+53
2015-02-12Convert to if_input().mpi1-8/+4
ok dlg@
2015-02-12Remove a stray ;.uebayasi1-2/+2