summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb
AgeCommit message (Collapse)AuthorFilesLines
2017-09-05Correct a bounds test. Coverity CID 1452930.jsg1-2/+2
ok mpi@
2017-09-04Revert previous: "Fix a remaining length miscalculation in xhci(4)."stsp1-2/+2
It made one of my machines get stuck during boot.
2017-09-01Add macros for reading the bmAttributes field of the USB super speedstsp1-1/+4
endpoint companion descriptor. ok mpi@
2017-09-01Fix a remaining length miscalculation in xhci(4).stsp1-2/+2
Each TRB contains a remaining TD size, which allows hardware to tell whether additional TRBs follow within the current transfer without reading ahead. The length of the first TRB was subtracted from the total length before calculating the remaining TD sizes. This is wrong because remaining TD sizes are relative to the size of the entire transfer, including the first TRB. Our current USB code does not trigger this bug because there is no code in upper layers yet which triggers use of multiple TRBs per transfer. ok mpi@
2017-08-30Use endpoint 5 for chaoskey, it should have been 5 from the start, thisabieber1-7/+13
puts us in line with the linux driver. Also add a DPRINTF for endpoints. "i'd say go for it" jasper@
2017-08-29add _MEASURE_RATE bits from uonerng(4)jasper1-1/+47
tested by abieber@
2017-08-29rename sc_pipe to sc_outpipe to indicate it's direction as there'll come anjasper1-6/+6
sc_inpipe too
2017-08-29"urng" is needed on the file lines... or these end up in all kernels,deraadt1-2/+2
including ramdisks without usb support...
2017-08-28Add urng(4) which supports various USB RNG devices. Instead of adding onejasper2-65/+107
driver per device, start bundling them into a single driver. urng(4) supports the device currently supported by ualea(4) and adds support for the Altusmetrum ChaosKey 1.0, by abieber@ This was tested by abieber@ with a ChaosKey and Sean Levy with an Alea II ok abieber@ deraadt@ naddy@
2017-08-26regenabieber2-4/+9
2017-08-26Add device ID for Altusmetrum ChaosKey 1.0abieber1-1/+2
OK jasper@
2017-08-23Fix up rssi calculations and r88e_rx_cck structure for RTL8188EU.kevlo1-2/+3
Tested with TL-WN725N v2 (rtl8188eu) on amd64. ok stsp@
2017-08-21Fix off by one in array bounds tests when parsing descriptors.jsg1-3/+3
Coverity CIDs 1452970 1453305.
2017-08-18Fix checks for error return from urtw_alloc_rx_data_list() andkevlo1-8/+6
urtw_alloc_tx_data_list(), CID 980284. ok stsp@
2017-08-16Mostly cosmetic changes to make things a bit more consistant:kevlo1-2/+2
- rename bit definition of R88E_TX_RPT1_ENA to reflect reality - no need to set R92C_FPGA0_ANAPARAM2 for 40mhz for rtl8188eu - in rtwn_write_txpower(), writing to MCS8-15 power registers if the WNIC has 2 spatial streams ok stsp@
2017-08-14Attach run(4) to D-Link DWA-137 and DWA-140 rev D1.stsp1-1/+3
Patch by Mike Korbakov
2017-08-14regenstsp2-4/+14
2017-08-14Add USB device IDs for D-Link DWA-137 and DWA-140 rev D1.stsp1-1/+3
Patch by Mike Korbakov
2017-08-12Fix Coverity CID 1452915: urtwn(4) would use an uninitialized array indexstsp1-4/+10
if a hypothetical and malicious USB device reports no Rx endpoints. ok mpi@
2017-08-11Remove NET_LOCK()'s argument.mpi1-7/+7
Tested by Hrvoje Popovski, ok bluhm@
2017-08-10Deactivate the device if I/O fails in attach.mpi1-2/+6
Coverity CID 1453399; ok deraadt@
2017-08-02Match D-Link DWA-130 rev F1 devices. These work with run(4).stsp1-1/+2
Patch by Jacqueline Jolicoeur ok deraadt
2017-08-02regenstsp2-4/+9
2017-08-02Add device ID for D-Link DWA-130 rev F.stsp1-1/+2
Patch by Jacqueline Jolicoeur ok deraadt
2017-07-30Use memcpy instead of casts to copy 8 bytes of data to avoid unalignedkettenis1-2/+2
access. ok visa@, mpi@, deraadt@
2017-07-29Remove useless conditional before free().ians1-3/+2
ok mpi@
2017-07-29Device trees for the Rasperry Pi are still in flux. Catch up with thekettenis1-6/+22
latest ways to encode the MAC address for the onboard USB Ethernet. ok visa@
2017-07-28The read buffer size reported by the hardware can be up to 4095bluhm1-3/+3
bytes. This would exceed the mbuf cluster size. Use larger clusters in this case. bug report Ilja Van Sprundel; OK deraadt@ stsp@
2017-07-21Do not permit USB ioctl handler malloc(9)'s to block as this interferesians2-4/+10
with expected behavior. OK mpi@ patrick@
2017-07-21Add frame length boundary checks to the input path of atu(4).stsp1-3/+15
Problem found by Ilja Van Sprundel. ok kevlo
2017-07-21Unbreak the rsu(4) driver which was not kept up-to-date with recent WPAstsp1-4/+12
supplicant and net80211 state machine changes. While here, make rsu(4) report the correct channel for received frames to tcpdump(8). ok deraadt@
2017-07-21Fix frame length bounds checks in rsu(4).stsp1-5/+16
Due to signedness issues the existing checks didn't work as intended. Problem reported by Ilja Van Sprundel. ok deraadt@
2017-07-21Drop Rx'd frames larger than MCLBYTES.kevlo1-1/+6
Problem reported by Ilja Van Sprundel. ok stsp@, tb@
2017-07-20Make otus(4) drop frames larger than MCLBYTES.stsp1-1/+6
Problem reported by Ilja Van Sprundel. ok deraadt@ tb@
2017-07-20Remove SIGIO support. Base tools do not implement it and ports relyingmpi1-26/+1
on libusbhid, generally via SDL, shouldn't do it either since it's not portable. Suggested by deraadt@ after Ilja van Sprundel reported an issue with a stale struct proc pointer in similar code. ok kettenis@, deraadt@
2017-07-20Enable RX aggregation, fix configuring custom MAC address and removempi1-11/+11
double reset sequence. From and tested by sc.dying at gmail on RTL8152 (ver 4c10) and RTL8153 (ver 5c20).
2017-07-19Add a handler for RNDIS status messagesmikeb1-1/+39
RNDIS status messages may indicate various conditions reported by the hardware, including link status events. They're not supposed to be universally treated as errors. Issue reported by Artturi Alm, ok armani
2017-07-03Replace slot time durations with macros.kevlo5-13/+17
ok stsp@
2017-06-29kill RCSID macros; discussed with millertderaadt7-40/+7
2017-06-23- Fix Tx queues to USB endpoints mapping and merge urtwn_r92c_dma_init()kevlo1-128/+89
and urtwn_r88e_dma_init() into one; from FreeBSD r291902. - Change the way the number of pages for public queue is calculated; Based on the vendor driver's _InitQueueReservedPage(), the formula for calculation of the number of pages for public priority queue is as follows: if the device has 3 endpoints: PUBQ = total number of Tx pages - HQ - LQ - NQ if the device has 2 endpoints (i.e. has high and normal priority queues): PUBQ = total number of Tx pages - HQ - NQ - Don't write MCS8..MCS15 Tx power if the WNIC is a 1-stream Tx; - Set R88E_TX_PAGE_COUNT to a correct value; - Minimal enhancement in urtwn_open_pipes() for upcoming rtl8192eu chipset support; Tested with USB-N10 Nano (rtl8188cu), DWA-131 rev B (rtl8192cu), and TL-WN725N v2 (rtl8188eu) on amd64. ok stsp@
2017-06-22double ;;. xhci one found by geoffhillderaadt2-4/+4
2017-06-20Check the validity of the `qtd' pointer after each interrupt casevisa1-11/+57
and bail out if the pointer has become invalid. This prevents use-after-free memory accesses that corrupted the dwc2qtd pool. This fix improves stability on the Raspberry Pi 3. From Linux commit dc8730846948e517169f630826cd2c97615f5ee8 OK kettenis@
2017-06-16- Fix incorrect values in the computation of transmit power for thekevlo1-111/+111
rtl8188eu chipset. - Small code refactoring: - replace hardcoded rate indexes with their name, like athn(4). - replace fields offsets with the structure; from FreeBSD r294198. - be compliant with definitions of the efuse in vendor hal_pg.h and rename struct r92c_rom member names: s/channel_plan/reserved5/, s/xtal_calib/channel_plan. - no need to disable HWPDN twice in urtwn_r88e_power_on(). Tested by stsp@ and myself with RTL8188CUS, RTL8192CU, RTL8188EU, and RTL8188CE devices. ok stsp@
2017-06-10Pass M_CANFAIL to malloc(9) calls which use M_WAITOK but are testedkevlo1-8/+8
for failure. ok armani@
2017-06-06Set the weak variant of hysteresis as default.bru1-7/+2
2017-06-06Regen.kevlo3-16/+22
2017-06-06Sort DLINK section and add USB device ID of D-Link DWA-131 rev E1.kevlo1-3/+4
ok stsp@
2017-06-02Remove a bogus run_read() call about getting MAC version.kevlo1-2/+1
ok stsp@
2017-06-01Defering some processing to the soft-interrupt handler introduced ampi2-50/+105
race. Revert for now. Issue found by claudio@.
2017-05-30Introduce ipv{4,6}_input(), two wrappers around IP queues.mpi1-7/+5
This will help transitionning to an un-KERNEL_LOCK()ed IP forwarding path. Disucssed with bluhm@, ok claudio@