Commit Graph

3979 Commits

Author SHA1 Message Date
Bruce M Simpson
5df8285d33 Add ID for NEC uPD720202 xHCI controller.
MFC after:	1 month
2017-02-27 17:04:35 +00:00
Andriy Voskoboinyk
f631357540 net80211 drivers: fix rate setup for EAPOL frames, obtain Tx parameters
directly from the node.

- Use ni_txparms directly instead of calculating them manually every time
- Move M_EAPOL flag check upper; otherwise it may be skipped due to
'ucastrate' / 'mcastrate' check
- Use 'mgtrate' for control frames too (see ifconfig(8), mgtrate parameter)
- Add few more M_EAPOL checks where it was missing (zyd(4), ural(4),
urtw(4))
- Few unrelated cleanups

Tested with:
 - Intel 6205 (iwn(4)), STA mode;
 - WUSB54GC (rum(4)), HOSTAP mode + RTL8188EU (rtwn(4)), STA mode.

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D9811
2017-02-26 20:49:35 +00:00
Alexander Motin
789f39c3dc Implement use of multiple transfers per I/O.
This change removes limitation of single S/G list entry and limitation on
maximal I/O size, using multiple data transfers per I/O if needed.  Also
it removes code duplication between send and receive paths, which are now
completely equal.
2017-02-26 06:25:55 +00:00
Alexander Motin
ebaf2c29d7 Use ctl_queue_sense() to implement sense data reporting.
USB MS BBB transport does not support autosense, so we have to queue any
sense data back to CTL for later fetching via REQUEST SENSE.
2017-02-25 14:24:29 +00:00
Alexander Motin
5e70e673d9 Update kern_data_resid according to r312291.
This now mandatory for correct operation.
2017-02-25 12:11:07 +00:00
Edward Tomasz Napierala
cc5bbcb275 Add USB Mass Storage CTL frontend. This makes it possible
for USB OTG-capable hardware to implement device side of USB
Mass Storage, ie pretend it's a flash drive.  It's configured
in the same way as other CTL frontends, using ctladm(8)
or ctld(8).  Differently from usfs(4), all the configuration
can be done without rebuilding the kernel.

Testing and review is welcome.  Right now I'm still moving,
and I don't have access to my test environment, so I'm somewhat
reluctant to making larger changes to this code; on the other
hand I don't want to let it sit on Phab until my testing setup
is back, because I want to get it into 11.1-RELEASE.

Reviewed by:	emaste (cursory), wblock (man page)
MFC after:	2 weeks
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D8787
2017-02-19 17:47:43 +00:00
Andriy Voskoboinyk
ce017db11c iwi, ral, zyd: fix possible use-after-free.
MFC after:	5 days
2017-02-17 23:20:22 +00:00
Ian Lepore
8148f4f3d5 Enable usb low and full speed devices connected to the imx6 root hubs.
This enables the PHY circuitry for UTMI+ level 2 and 3, and sets the
flag to tell the ehci code that the root hub has a transaction translator
in it.  For imx6 we can use the standard ehci_get_port_speed_portsc()
function to find out what speed device is connected to the port.
2017-02-12 00:52:22 +00:00
Ian Lepore
9ad221a558 Add tsw_busy support to usb_serial (ucom).
The tty layer uses tsw_busy to poll for busy/idle status of the transmitter
hardware during close() and tcdrain(). The ucom layer defines ULSR_TXRDY and
ULSR_TSRE bits for the line status register; when both are set, the
transmitter is idle. Not all chip drivers maintain those bits in the sc_lsr
field, and if the bits never get set the transmitter will always appear
busy, causing hangs in tcdrain().

These changes add a new sc_flag bit, UCOM_FLAG_LSRTXIDLE. When this flag is
set, ucom_busy() uses the lsr bits to return busy vs. idle state, otherwise
it always returns idle (which is effectively what happened before this
change because tsw_busy wasn't implemented).

For the uftdi chip driver, these changes stop masking out the tx idle bits
when processing the status register (because now they're useful), and it
calls ucom_use_lsr_txbits() to indicate the bits are maintained by the
driver and can be used by ucom_busy().

Differential Revision:	https://reviews.freebsd.org/D9183
2017-02-05 15:45:31 +00:00
Warner Losh
50d96564ed Add USB IDs supported by TI / Intel USB 3410 family (modems of various
flavors). This includes both the release products (from Honeywell,
Moxa and Multitech) as well as development kits.
2017-02-01 02:00:18 +00:00
Kevin Lo
a6bac5b604 Sort REALTEK section and remove duplicate entry for RTL8192CU. 2017-01-24 03:00:22 +00:00
Kevin Lo
60b9567d16 Add support for the Realtek RTL8192EU chipset.
Committed over the D-Link DWA-131 rev E1 on amd64 with WPA.

Reviewed by:	avos
2017-01-24 02:35:38 +00:00
Hans Petter Selasky
f515174b94 Fix problem with suspend and resume when using Skylake chipsets. Make
sure the XHCI controller is reset after halting it. The problem is
clearly a BIOS bug as the suspend and resume is failing without
loading the XHCI driver. The same happens when using Linux and the
XHCI driver is not loaded.

Submitted by:		Yanko Yankulov <yanko.yankulov@gmail.com>
PR:			216261
MFC after:		1 week
2017-01-19 18:33:27 +00:00
Hans Petter Selasky
067e471a24 Add USB audio support for S/PDIF output with C-Media CM6206 devices.
Submitted by:		Julien Nadeau <vedge@hypertriton.com>
PR:			216131
MFC after:		1 week
2017-01-17 08:15:10 +00:00
Conrad Meyer
db4fcadf52 "Buses" is the preferred plural of "bus"
Replace archaic "busses" with modern form "buses."

Intentionally excluded:
* Old/random drivers I didn't recognize
  * Old hardware in general
* Use of "busses" in code as identifiers

No functional change.

http://grammarist.com/spelling/buses-busses/

PR:		216099
Reported by:	bltsrc at mail.ru
Sponsored by:	Dell EMC Isilon
2017-01-15 17:54:01 +00:00
Ian Lepore
cfed2e639e Use the post-reset hook to force the controller to host mode. This will
make both usb ports work on imx6 systems (the OTG port of course will only
work in host mode).
2017-01-10 03:53:38 +00:00
Bruce M Simpson
ae9fd9cccd Allow udbp(4) to claim Belkin "Windows Easy Transfer Cable" for Netgraph use.
These have been tested back-to-back with Linux 3.x and a similar attachment
at the other end; a CDC EEM-like encapsulation can be used for emulated
Ethernet over udbp(4) with ng_ether.
2017-01-10 01:31:26 +00:00
Bruce M Simpson
5ca4ae8bb7 Add PID for Belkin F5U258 "Windows Easy Transfer Cable", a udbp-like device. 2017-01-10 00:28:01 +00:00
Adrian Chadd
129adb62dc [rsu] add support for the "green" rsu NICs.
They're still a 1T2R NIC, so reuse the same rfconfig and
nstream configuration.

Submitted by:	Idwer Vollering <vidwer@gmail.com>
2017-01-09 21:46:24 +00:00
Kevin Lo
094fba962f Add new USB device ID. 2017-01-06 14:05:31 +00:00
Andriy Voskoboinyk
53d2e5b73e rsu: restore 40Mhz channel support.
MFC after:	4 days.
2017-01-02 16:58:55 +00:00
Gavin Atkinson
3656b9615b Fix bit value for a debug flag definition.
Pointy hat to:	gavin
2016-12-30 11:02:16 +00:00
Adrian Chadd
3620e9605c [rsu] convert rsu to use the ieee80211_rx_stats struct to pass up RSSI, PHY and rate information.
I don't yet know which RX descriptor bits map to shortgi, long-gi,
short-preamble, long-preamble, STBC, LDPC, HT40, etc - so I can't
easily add those just yet.

There's apparently no per-frame RX RSSI information exposed so we
also just use the results from the previous calibration task.

This also tidies up how the per-mbuf RSSI is pushed into the frame -
now that it's attached to the mbuf via rx_stats, we don't have to
do any silly hijinx to get it out of the frame processing path.

Tested:

* RTL8712, 1x1 cut 3, STA mode
2016-12-22 21:01:56 +00:00
Hans Petter Selasky
433ded8b81 Defer USB enumeration until the SI_SUB_KICK_SCHEDULER is executed to avoid
boot panics in conjunction with the recently added EARLY_AP_STARTUP feature.
The panics happen due to using kernel facilities like callouts too early.

Tested by:	jhb @
MFC after:	1 week
2016-12-19 09:28:12 +00:00
Andriy Voskoboinyk
ef06a176eb rsu: fix and enable Rx TCP checksum offloading.
Tested with Asus USB-N10, STA mode.
2016-12-11 17:15:25 +00:00
Andriy Voskoboinyk
14a8d2f995 rsu: various initialization fixes.
- Do not ignore initialization errors; call ieee80211_stop()
when initialization failed.
- Use usb_pause_mtx() instead of DELAY() while waiting for firmware
loading; this fixes system freeze during firmware startup.
- Do not execute rsu_stop() when device is powered off; fixes
'unknown board type (rfconfig=0xff)' error when the device is
reattached.

Tested with Asus USB-N10.
2016-12-10 22:31:49 +00:00
Andriy Voskoboinyk
88c2e36adb rsu: use bitmap for all debug messages.
- Replace all remaining DPRINTF(N)'s with RSU_DPRINTF.
- Add new RSU_DEBUG_USB flag to track error codes returned by
usbd_do_request_flags().
- Improve few messages.
2016-12-10 20:19:57 +00:00
Andriy Voskoboinyk
f06ccf881e rsu: add promiscuous mode support.
- Add partial promiscuous mode support (no management frames;
they cannot be received by the firmware and net80211 at the same time).
- Add monitor mode support (all frames).

Tested with Asus, USB-N10.
2016-12-10 18:47:13 +00:00
Andriy Voskoboinyk
7a4575d0b5 rsu: increase Rx buffer size from 8k to 30k.
This is required for USB Rx aggregation
(and fixes 'could not allocate RX mbuf' / few other failures).

While here, reduce the number of Rx buffers from 100 to 1 -
the driver never uses more than one Rx buffer.

Tested with Asus USB-N10.
2016-12-10 17:06:55 +00:00
Andriy Voskoboinyk
88e8709ef1 rsu: add TSF field into Rx radiotap.
Tested with Asus USB-N10.
2016-12-10 13:30:16 +00:00
Poul-Henning Kamp
34feb2d2cb Add Genesys Logic USB hub.
Make two other USB hub descriptions more precise.
2016-12-10 09:10:48 +00:00
Andriy Voskoboinyk
e1b3ed8f32 rsu: fix incorrect register addresses. 2016-12-08 20:54:54 +00:00
Gavin Atkinson
109005cc14 Switch if_run.c to use a bitmap for debug levels rather than arbitrary
values. This more closely matches other wifi drivers in the tree.
The bitmap levels have been based closely on other drivers (primarily
[u]rtwn(4)) in the hope that one day these can be unified into a shared
wifi-debug framework.

This is the first step of several pieces of work I'm planning on doing
with the run(4) driver. I may well adjust and refine some of the debug
bitmaps at a later date.

Reviewed by:	adrian, avos
Differential Revision:	https://reviews.freebsd.org/D8704
2016-12-07 22:52:12 +00:00
Andriy Voskoboinyk
4a19d71238 net80211 + drivers: convert to ieee80211_crypto_get_key_wepidx().
Proposed by:	adrian
2016-12-07 22:16:07 +00:00
Andriy Voskoboinyk
8e61c3f8e3 rsu: fix printf format specifiers. 2016-12-06 06:12:01 +00:00
Andriy Voskoboinyk
31847d9434 rsu: add hardware crypto support (WEP, TKIP and CCMP).
This change includes firmware commands for key setup +
some additional checking via CAMREAD / CAMWRITE registers.
Nothing (except rsu_delete_key() for pairwise keys) is deferred;
to ensure that things are done in order rsu_set_key() will wait
until key deletion task will be finished.

Tested with Asus USB-N10 (all ciphers).

Differences from initial (reviewed) patch:
- Pause AC queues before disassociation - since CMD_DISCONNECT clears
crypto state all pending frames must be processed / dropped before it.
- Check sc_running flag before trying to set static keys.
- Clear key index from bitmap even when firmware command fails
(it will be invalidated via CAMWRITE anyway).

Reviewed by:	adrian, kevlo
Tested by:	kevlo
Differential Revision:	https://reviews.freebsd.org/D8706
2016-12-06 00:13:49 +00:00
Andriy Voskoboinyk
c057023b75 rsu: fix RSSI reporting, partially revert r288414.
- Append RCR_APP_PHYSTS bit after firmware loading - otherwise
firmware will reset the register and this modification will be lost.
(without it Rx PHY descriptor section will contain garbage).
- Check if R92S_RXDW0_PHYST bit is set (like it is done in rtwn(4)) -
even if infosz is non-zero the section may not contain anything useful.
- In case, if descriptor is absent (A-MPDU?) use last calibrated RSSI
(rtwn(4) uses RSSI from the previous (sub)frame; probably, this
approach should be used here too).

Tested with Asus USB-N10, STA mode.
2016-12-04 21:40:49 +00:00
Andriy Voskoboinyk
6127805391 rsu: fix frame processing in the Rx path (similar to r292207).
- Fill in Rx radiotap header correctly (for every packet in a chain;
not once per chain).
- Fix rate / flags fields in Rx radiotap.
- Add debug messages for discarded frames.
- Pass received control (< sizeof(struct ieee80211_frame)) frames
to net80211 (if allowed by device filter; cannot happen yet).

Tested with Asus USB-N10.

Differential Revision:	https://reviews.freebsd.org/D5723
2016-12-03 16:02:53 +00:00
Andriy Voskoboinyk
bcb071810a rsu: remove unused structures / variables. 2016-12-03 14:26:58 +00:00
Andriy Voskoboinyk
935b4fcccd rsu: add support for hardware multicast filter setup.
The algorithm is the same as in rtwn(4).

Tested with Asus USB-N10 (STA) + RTL8188CUS (AP).
2016-11-27 18:06:03 +00:00
Hans Petter Selasky
c0f71e317b Fix spelling. 2016-11-27 12:04:54 +00:00
Andriy Voskoboinyk
5dbbb84e42 rsu: various scanning fixes.
- Set IEEE80211_FEXT_SCAN_OFFLOAD flag; firmware can send null data
frames when associated.
- Check IEEE80211_SCAN_ACTIVE scan flag instead of IEEE80211_F_ASCAN
ic flag; the last is never set since r170530.
- Eliminate software scan (net80211) <-> site_survey (driver) race:
 * override ic_scan_curchan and ic_scan_mindwell pointers so net80211
will not try to finish scanning automatically;
 * inform net80211 about current status via ieee80211_cancel_scan()
and ieee80211_scan_done();
 * remove corresponding workaround from rsu_join_bss().

Now the driver can associate to an AP with hidden SSID.

Tested with Asus USB-N10.
2016-11-27 12:03:34 +00:00
Andriy Voskoboinyk
babfcab670 rsu: fix R92S_TXDW1_QSEL_H2C definition (0x1f -> 0x13).
Without this fix firmware ignores all but first 32 commands
(= almost everything (except plain Tx / Rx) stops working).

Tested with ASUS USB-N10.
2016-11-26 20:26:29 +00:00
Ruslan Bukin
ead1785e1e Declare dwc_otg_detach as non-static (same as dwc_otg_attach),
so it can be called from fdt-glue drivers.

Submitted by:	kan
Sponsored by:	DARPA, AFRL
2016-11-17 15:12:03 +00:00
Ruslan Bukin
cec8009ca1 Allow operation with UTMI+ phy.
Submitted by:	kan
Sponsored by:	DARPA, AFRL
2016-11-17 15:08:30 +00:00
Hans Petter Selasky
33299e3d96 Make sure MAC address is reprogrammed when if_init() callback is
invoked. Else promiscious mode must be used to pass traffic. While at
it fix a debug print macro.

MFC after:	1 week
2016-11-16 14:39:03 +00:00
Andrew Turner
a2696bf3c0 Use ofw_bus_node_is_compatible in more drivers used on arm.
Sponsored by:	ABT Systems Ltd
2016-11-11 15:42:12 +00:00
Alexander Motin
2b064d4653 Add some device IDs found in my new laptop. 2016-11-09 08:57:59 +00:00
Kevin Lo
a28ed036b6 Sort DLINK section and add USB device ID of D-Link DWA-131 rev E1. 2016-11-09 06:47:29 +00:00
Hans Petter Selasky
d03403c4b1 Make sure the virtual T-axis buttons generate button release event(s)
for continuous tilting.

PR:		213957
MFC after:	3 days
2016-11-01 07:15:39 +00:00
Hans Petter Selasky
e2efc9becb Make sure the virtual T-axis buttons gets cleared for USB mice which has
less than 6 buttons.

PR:		213919
MFC after:	3 days
2016-10-31 18:38:50 +00:00
Kevin Lo
a24d62b533 Add preliminary support for the RTL8153.
Reviewed by:	hselasky
2016-10-31 05:58:11 +00:00
Conrad Meyer
b8acc2d67e uhso(4): Fix a null pointer dereference
The directly following m_defrag() call can wait, so there is no reason this
call can't as well.

Reported by:	Coverity
CID:		1353551
Sponsored by:	Dell EMC Isilon
2016-10-25 18:36:15 +00:00
Edward Tomasz Napierala
88f9a4ff75 Make the USB attach strings in dmesg include product name.
Note to self: MFC this to 9 and 8.

Reviewed by:	hselasky@, imp@
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D8259
2016-10-25 07:48:19 +00:00
Oleksandr Tymoshenko
e012a280a5 EVDEV: ums evdev support improvements: locking and event reporting
- Use ums lock as evdev lock
- Do not cap axes values to sysmouse limits for evdev reports
- Do not map T-axis events to buttons for evdev reports
- Use shortcuts for event reporting

Submitted by:	Vladimir Kondratiev <wulf@cicgroup.ru>
MFC after:	1 week
2016-10-22 22:55:10 +00:00
Hans Petter Selasky
d3bf5efc1f Fix device delete child function.
When detaching device trees parent devices must be detached prior to
detaching its children. This is because parent devices can have
pointers to the child devices in their softcs which are not
invalidated by device_delete_child(). This can cause use after free
issues and panic().

Device drivers implementing trees, must ensure its detach function
detaches or deletes all its children before returning.

While at it remove now redundant device_detach() calls before
device_delete_child() and device_delete_children(), mostly in
the USB controller drivers.

Tested by:		Jan Henrik Sylvester <me@janh.de>
Reviewed by:		jhb
Differential Revision:	https://reviews.freebsd.org/D8070
MFC after:		2 weeks
2016-10-17 10:20:38 +00:00
Andriy Voskoboinyk
bdc7291ec9 net80211: convert all ieee80211_input_mimo*() consumers
to ieee80211_add_rx_params() + drop last (ieee80211_rx_stats) parameter

Note: there is an additional check for ieee80211_get_rx_params()
return value (which does not exist in the original diff).

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D8207
2016-10-12 20:50:13 +00:00
Oleksandr Tymoshenko
968d859d09 [fdt] Add one more heuristic to determine MAC address of the SMSC device
- If check for net,ethernet/usb,device compatible node fails, try to find
    .../usb/hub/ethernet, where ... is bus path that can depend on actual HW.
    net,ethernet/usb,device compatibity strings are FreeBSD custom invention
    that is used only in RPi DTBs and since there is no other way to tie USB
    device to FDT node we just do our best effort here to work with upstream
    device tree

- Use -1 value to indicate invalid phandle_t, 0 is valid phandle value and
    shouldn't be used as error signal
2016-10-12 19:53:10 +00:00
Oleksandr Tymoshenko
bf798f819a Make BCM28x USB driver compatible with upstream device tree
This should have been committed in r307093: resource allocation depends
on source of the device tree. upstream dts has extra interrupt that we can
ignore
2016-10-12 03:36:46 +00:00
Adrian Chadd
e97796e2b6 [net80211] extend the ieee80211_rx_stats struct to include more information.
There are a variety of more interesting RX statistics that we should
keep track of but we don't.  This is a starting point for adding more
information.

Specifically:

* now the RX rate information and some of the packet status is
  passed up;
* The 32 bit or 64 bit TSF is passed up;
* the PHY mode is passed up;
* the "I'm decap'ed AMSDU!" state is passed up;
* number of RX chains is bumped to 4.

This is all mostly a placeholder for getting the data into the RX status
before we pass it up to net80211 - unfortunately we don't yet enforce
that drivers provide it, nor do we pass the provided info back up the
stack so anyone can use the data.

We're going to need to use some of this data moving forward.
Notably, now that some hardware can do AMSDU decap for us (the intel iwm
driver can do it when we flip it on; the ath10k port I'm doing does
it for us) then we need to pass it up through the stack so the duplicate
RX sequence numbers and crypto/IV details don't cause the packet to
be dropped and/or counted against a replay counter.

It's also the beginning of being able to do more interesting node
accounting in net80211.  Specifically, once drivers start populating
per-packet rate information, AMPDU information, timestamps, etc,
we can start providing histograms of rate-versus-RSSI, account
for receive time spent per node and other such interesting things.

(Note: I'm also hoping to include ranging and RTT information for
future chipset support; and it's likely going to include it in
this kind of fashion.)
2016-10-08 01:12:29 +00:00
Oleksandr Tymoshenko
5163e77fad const-ify struct evdev_methods
Submitted by:	Vladimir Kondratiev <wulf@cicgroup.ru>
Suggested by:	hselasky
2016-10-03 17:20:34 +00:00
Andriy Voskoboinyk
f6930bec33 net80211: ieee80211_ratectl*: switch to reusable KPI
Replace various void * / int argument combinations with common structures:
- ieee80211_ratectl_tx_status for *_tx_complete();
- ieee80211_ratectl_tx_stats for *_tx_update();

While here, improve amrr_tx_update() for a bit:
1. In case, if receiver is not known (typical for Ralink USB drivers),
refresh Tx rate for all nodes on the interface.
2. There was a misuse:
- otus(4) sends non-decreasing counters (as originally intended);
- but ural(4), rum(4) and run(4) are using 'read & clear' registers
to obtain statistics for some period of time (and those 'last period'
values are used as arguments for tx_update()). If arguments are not big
enough, they are just discarded after the next call.

Fix: move counting into *_tx_update()
(now otus(4) will zero out all node counters after every tx_update() call)

Tested with:
- Intel 3945BG (wpi(4)), STA mode.
- WUSB54GC (rum(4)), STA / HOSTAP mode.
- RTL8188EU (urtwn(4)), STA mode.

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D8037
2016-10-02 20:35:55 +00:00
Oleksandr Tymoshenko
a6b15a3429 Modularize evdev
- Convert "options EVDEV" to "device evdev" and "device uinput", add
    modules for both new devices. They are isolated subsystems and do not
    require any compile-time changes to general kernel subsytems
- For hybrid drivers that have evdev as an optional way to deliver input
    events add option EVDEV_SUPPORT. Update all existing hybrid drivers
    to use it instead of EVDEV
- Remove no-op DECLARE_MODULE in evdev, it's not required, MODULE_VERSION
    is enough
- Add evdev module dependency to uinput

Submitted by:	Vladimir Kondratiev <wulf@cicgroup.ru>
2016-10-02 03:20:31 +00:00
Oleksandr Tymoshenko
fa26e8edee Declare a module for evdev and add dependency to ukbd(4) and ums(4)
Prepare for making evdev a module. "Pure" evdev device drivers (like
touchscreen) and evdev itself can be built as a modules regardless of
"options EVDEV" in kernel config. So if people does not require evdev
functionality in hybrid drivers like ums and ukbd they can, for instance,
kldload evdev and utouchscreen to run FreeBSD in kiosk mode.
2016-09-30 21:04:56 +00:00
Hans Petter Selasky
2cb568fc23 Add new USB ID.
While at it remove some whitespaces.

Submitted by:	Jose Luis Duran <jlduran@gmail.com>
PR:		213110
MFC after:	1 week
2016-09-30 05:28:11 +00:00
Andriy Voskoboinyk
fbc9d202d8 rsu: do not restart calibration task when going out of RUN state.
Clear 'sc_calibrating' flag and stop calibration task when interface
is not associated; this fixes possible panic after detach.

Reported and tested by:	hselasky
Reviewed by:	adrian
MFC after:	6 days
2016-09-25 19:13:07 +00:00
Oleksandr Tymoshenko
7dd7ec2c6b Do not perform extra check for NULL, evdev_free can handle NULL value
Submitted by:	Vladimir Kondratiev <wulf@cicgroup.ru>
2016-09-23 18:55:32 +00:00
Luiz Otavio O Souza
38d1af45cd Add the ID for the Huawei ME909S LTE modem.
Submitted by:	svenauhagen at github
MFC after:	3 days
Sponsored by:	Rubicon Communications, LLC (Netgate)
2016-09-22 18:45:25 +00:00
Kevin Lo
32f7d047c3 Add TP-Link Archer T4U.
It will be used by the updated rtwn(4) / urtwn(4) driver.
2016-09-22 09:33:22 +00:00
Oleksandr Tymoshenko
c3af259a20 Add evdev support to ums(4)
event generation is disabled by default in favour of sysmouse. This
behavoiur is controlled by kern.evdev.rcpt_mask sysctl, bit 2 should
be set to give priority to hw over sysmouse

Submitted by:	Vladimir Kondratiev <wulf@cicgroup.ru>
Reviewed by:	hans
Differential Revision:	https://reviews.freebsd.org/D7863
2016-09-21 18:52:03 +00:00
Oleksandr Tymoshenko
10063b791c Add evdev support to ukbd driver
event generation is disabled by default in favour of kbdmux. This
behavoiur is controlled by kern.evdev.rcpt_mask sysctl, bit 3 should
be set to give priority to hw over mux

Submitted by:	Vladimir Kondratiev <wulf@cicgroup.ru>
Reviewed by:	hans
Differential Revision:	https://reviews.freebsd.org/D7957
2016-09-21 18:47:21 +00:00
Andriy Voskoboinyk
887a63246c net80211: remove IEEE80211_RADIOTAP_TSFT field from transmit definitions.
This field may be used for received frames only.

Differential Revision:	https://reviews.freebsd.org/D3826
Differential Revision:	https://reviews.freebsd.org/D3827
2016-09-20 18:53:42 +00:00
Andriy Voskoboinyk
07fa0846ca dev/usb: add USB IDs for Realtek 802.11ac wireless adapters.
They are will be used by the updated rtwn(4) / urtwn(4) driver.

Suggested by:	adrian
2016-09-19 18:36:26 +00:00
Hans Petter Selasky
0eb8d46232 Improve USB polling mode by not locking any mutexes, asserting any
mutexes or using any callouts when active.

Trying to lock a mutex when KDB is active or the scheduler is stopped
can result in infinite wait loops. The same goes for calling callout
related functions which in turn lock mutexes.

If the USB controller at which a USB keyboard is connected is idle
when KDB is entered, polling the USB keyboard via USB will always
succeed. Else polling may fail depending on which state the USB
subsystem and USB interrupt handler is in. This is unavoidable unless
KDB can wait for USB interrupt threads to complete before stalling the
CPU(s).

Tested by:	Bruce Evans <bde@freebsd.org>
MFC after:	4 weeks
2016-09-14 12:07:34 +00:00
Hans Petter Selasky
2b5b3a0923 Correctly map the USB mouse tilt delta values into buttons 5 and 6
instead of 3 and 4 which is used for the scroll wheel, according to
X.org.

PR:		170358
MFC after:	1 week
2016-09-08 10:10:05 +00:00
Andriy Voskoboinyk
d204cea9f8 rum: fix possible panic on device detach (similar to r302034).
Tested with WUSB54GC, STA/AP modes.
2016-09-07 16:19:20 +00:00
Andriy Voskoboinyk
4c90f11b3c rum: use mgmt frame rate for EAPOL frames. 2016-09-07 12:07:02 +00:00
Andriy Voskoboinyk
93ae47478c rum: use m_get2() in Rx path. 2016-09-06 12:00:16 +00:00
Andriy Voskoboinyk
c84bb70268 rum: fix frame length checks in Rx path.
Split usbd_xfer_status() check:
- Check xfer length: must be longer, than Rx descriptor size.
- Check frame size: must be shorter than xfer length.
- Discard too short frames.

Tested with WUSB54GC, STA/MONITOR modes.
2016-09-06 06:40:59 +00:00
Andriy Voskoboinyk
c57ee45ba9 rum: do not restart device when protmode / rtsthreshold is changed. 2016-09-05 19:42:35 +00:00
Hans Petter Selasky
64cb5e2a26 Resolve deadlock between device_detach() and usbd_do_request_flags()
by reviving the SX control request lock and refining which lock
protects the common scratch area in "struct usb_device".

The SX control request lock was removed by r246759 because it caused a
lock order reversal with the USB enumeration lock inside
usbd_transfer_setup() as a function of r246616. It was thought that
reducing the number of locks would resolve the LOR, but because some
USB device drivers use usbd_do_request_flags() inside callback
functions, like in taskqueues, a deadlock may occur when these are
drained from device_detach(). By restoring the SX control request
lock usbd_do_request_flags() is allowed to complete its execution
when a USB device driver is detaching. By using the SX control request
lock to protect the scratch area, the LOR introduced by r246616 is
also resolved.

Bump the FreeBSD version while at it to force recompilation of all USB
kernel modules.

Found by:	avos@
MFC after:	1 week
2016-09-05 15:35:58 +00:00
Dimitry Andric
02d4a225db With clang 3.9.0, compiling uplcom results in the following warnings:
sys/dev/usb/serial/uplcom.c:543:29: error: implicit conversion from 'int' to 'int8_t' (aka 'signed char') changes value from 192 to -64 [-Werror,-Wconstant-conversion]
        if (uplcom_pl2303_do(udev, UT_READ_VENDOR_DEVICE, UPLCOM_SET_REQUEST, 0x8484, 0, 1)
            ~~~~~~~~~~~~~~~~       ^~~~~~~~~~~~~~~~~~~~~
sys/dev/usb/usb.h:179:53: note: expanded from macro 'UT_READ_VENDOR_DEVICE'
#define UT_READ_VENDOR_DEVICE   (UT_READ  | UT_VENDOR | UT_DEVICE)
                                 ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~

This is because UT_READ is 0x80, so the int8_t argument is wrapped to a
negative value.  Fix this by using uint8_t instead.

Reviewed by:	imp, hselasky
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D7776
2016-09-04 16:59:35 +00:00
Sepherosa Ziehau
1010113dad net/rndis: Packet types are defined by NDIS; not RNDIS specific.
Reviewed by:	hps
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7681
2016-08-30 03:11:07 +00:00
Bruce Evans
1a58327bc3 Fix key delay and repeat, part 2.
Use sbintime_t timeouts with precision control to get very accurate
timing.  It costs little to always ask for about 1% accuracy, and the
not so new event timer implementation usual delivers that, and when
it can't it gets much closer than our previous coarse timeouts and
buggy simple countdown.

The 2 fastest atkbd repeat rates have periods 34 and 38 msec, and ukbd
pretended to support rates in between these.  This requires
sub-microsecond precision and accuracy even to handle the 4 msec
difference very well, but ukbd asked the timeout subsystem for timeouts
of 25 msec and the buggy simple countdown of this gave a a wide range
of precisions and accuracies depending on HZ and other timer
configuration (sometimes better than 25 msec but usually more like 50
msec).  We now ask for and usually get precision and accuracy of about
1% for each repeat and much better on average.

The 1% accuracy is overkill.  Rounding of 30 cps to 34 msec instead of
33 already gives an error of +2% instead of -1%, and ut AT keyboards on
PS/2 interfaces have similar errors.

A timeout is now scheduled for every keypress and release.  This allows
some simplifications that are not done.  It allows removing the timeout
scheduling for exiting polled mode where it was unsafe in ddb mode.  This
is done.  Exiting polled mode had some problems with extra repeats.  Now
exiting polled mode lets an extra timeout fire and the state is fudged
so that the timeout handler does very little.

The sc->time_ms variable is unsigned to avoid overflow.  Differences of
it need to be signed.  Signed comparisons were emulated by testing an
emulated sign bits.  This only works easily for '<' comparisonss, but
we now need a '<=' comparison.  Change the difference variable to
signed and use a signed comparison.  Using unsigned types here didn't
prevent overflow bugs but just reduced them.  Overflow occurs with
n repeats at the silly repeat period of [U]INT_MAX / n.  The old countdown
had an off by 1 error, and the simplifications would simply count down
1 to 0 and not need to accumulate possibly-large repeat repeats.
2016-08-24 05:54:11 +00:00
Kevin Lo
e626c40eb5 Bring datasheet URL up to date. 2016-08-24 03:44:16 +00:00
Sepherosa Ziehau
48ef7b17f0 net/rndis: Add canonical RNDIS major/minor version as of today.
Reviewed by:	hps
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7593
2016-08-24 03:08:13 +00:00
Bruce Evans
e99472e0d6 Fix key delay and repeat, part 1.
kbdcontrol -r fast is documented to give a non-emulated atkbd's fastest
rate of 250.34, but is misimplemented to request this as 0.0.  ukbd
supports many nonstandard rates, although it is currently too inaccurate
by a factor of several hundred for non-huge nonstandard rates to be
useful.  It mapped 0.0 to 200.0.  A repeat delay of 0 means a rate of
infinity which is quite fast, but physical constraints limit this to
a few MHz and the inaccuracies made it almost usable.

Convert 0.0 to the documented 250.34.

Also convert negative args and small args to the 250.34 minimal ones,
like atkbd does.  This is for KDSETREPEAT -- the 2 versions of the
deprecated KDSETRAD have bounds checking.  Keep not doing any bounds
checking or conversions for upper limits since nonstandard large
delays are useful for testing.

The inaccuracies are dependent on HZ and the timeout implementation.
With the old timeout implementation and HZ = 1000, 200.0 probably
worked better to emulate 250.34 than 250.34 itself.  HZ = 100 gives
roundoff errors that accidentally reduce the inaaccuracies, and
event timers reduce the inaccuracies even more, so 200.0 was giving
more like itself (perhaps 215.15 on average but sometimes close to
10 msec repeat which is noticebly too fast).  This commit makes 0.0
noticeably too slow, like 250.34 always was.
2016-08-23 19:50:16 +00:00
Sepherosa Ziehau
1ba241d223 net: Split RNDIS protocol structs/macros out of dev/usb/net/if_urndisreg.h
So that Hyper-V can leverage them instead of rolling its own definition.

Discussed with:	hps
Reviewed by:	hps
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7592
2016-08-23 02:54:06 +00:00
Hans Petter Selasky
f81d0b43f1 Don't separate the status stage of the XHCI USB control transfers into
its own job because this breaks the simplified QEMU XHCI TRB parser,
which expects the complete USB control transfer as a series of back to
back TRBs. The old behaviour is kept under #ifdef in case this change
breaks enumeration of any USB devices.

PR:		212021
MFC after:	1 week
2016-08-22 19:32:50 +00:00
Bruce Evans
ded67349a3 Further fixes for translation of PrintScreen/SysRq.
The previous fix was tested mainly on 3 AT keyboards with USB adaptors where
it works.  1 USB keyboard doesn't translate Alt-PrintScreen, so the software
has to do it.

Reorganize a little to share some code and to not translate the unusual usb
scan code0x8a unless an Alt modified is set.  Remove redundant check of Alt
modifiers.  Translation now more clearly filters out Alt-PrintScreen before
the check.

The table of errors fixed in the previous commit had many bugs.  Correct
table:

K_RAW  Ctl-PrintScreen:                                 E0-2A-E0-37 -> E0-37
K_RAW  Alt-PrintScreen (with 4 comb. of Ctl/Shift):     79 -> 54
K_RAW  Pause/Break (with 4 comb. of Alt/Shift):         E0-46 -> E1-1D-45
K_CODE PrintScreen (with 4 comb. of Ctl/Shift):         54 -> 5c
K_CODE Alt-PrintScreen (with 4 comb. of Ctl/Shift):     7e -> 54
K_CODE Pause/Break (with 8 comb. of Ctl/Alt/Shift):     6c -> 68

That is 25 of 32 shift combinations for 2 keys fixed.  All 16 combinations
were broken for K_CODE and thus also for K_XLATE.
2016-08-22 16:39:51 +00:00
Hans Petter Selasky
7816434a4f Fix for invalid use of bits in input context. Basically split
configuring of EP0 and non-EP0 into xhci_cmd_evaluate_ctx() and
xhci_cmd_configure_ep() respectivly. This resolves some errors when
using XHCI under QEMU and gets is more in line with the XHCI
specification.

PR:		212021
MFC after:	1 week
2016-08-22 10:21:25 +00:00
Hans Petter Selasky
a6ae9251b4 Make the UKBD USB transfers double buffered and set them up one by one,
so they are memory independent which allows for handling panics
triggered by the keyboard driver itself, typically via CTRL+ALT+ESC
sequences. Or if the USB keyboard driver was processing a key at the
moment of panic. Allow UKBD to be attached while keyboard polling is active.

Tested by:	Bruce Evans <bde@freebsd.org>
MFC after:	1 week
2016-08-21 18:37:21 +00:00
Bruce Evans
3f7880e23a Fix translation of the PrintScreen/SysRq and Pause/Break keys. Almost
everything was broken.  The cases that I noticed were Ctrl-PrintScreen
not being mapped to the virtual scancode 0x5c (debug) and Pause not being
mapped to the physical/virtual scancode 0x46 (slock).

These keys are the most complicated ones due to kludges to give some
compatibility back to before AT keyboards.

Alt-PrintScreen must pretend to be a separate key from PrintScreen
even at the "raw" level.  The (unique) usb code for it is 0x8a and we
just have to map this to our unique virtual scancode 0x54, but we
mapped it first to the internal code 0x7e and then to 0x79 which is a
key on the Japanese 106/109 keyboard.  This fix is under the
UKBD_EMULATE_ATASCANCODE option which shouldn't be used for non-AT
keyboards.  If it is, then the syscons Japanese keymaps have nothing
of importance for code 0x79 and can easily be changed.  0x54 is also
unimportant in Japanese and US keymaps.

NonAlt-PrintScreen and NonCtl-Pause/Break had many much larger bugs with
smaller compatibility problems from fixing them.  The details are too
ugly to give here.  Summary of the changed (hex) codes:

K_RAW  PrintScreen (Ctl, Shift, Ctl-Shift):             E0-2A-E0-37 -> E0-37
K_RAW  Alt-PrintScreen (all shift states):              79 -> 54
K_RAW  Pause/Break (unshifted, Shift, Alt, Alt-Shift)): E0-46 -> E1-1D-45
K_CODE ALT-PrintScreen (all shift states):              79 -> 54

That is 15 of 32 shift combinations for 2 keys fixed, with 8 easy cases
from the 79 -> 54 remapping.

The difference is only large and with no workaround using a keymap for
for K_RAW, but this affects other modes when ukbd is layered under kbmux
because kbmux keeps all subdevices in K_RAW mode and translates.  Oops.
I used kbdmux to generate the above table of changes.
2016-08-21 16:06:00 +00:00
Pyun YongHyeon
ac14c068f9 Host controller is byte oriented. Fix wrong assumption on big-endian
systems.

Pointed out by:	hselasky
2016-08-19 10:51:30 +00:00
Pyun YongHyeon
b06ccf7919 Fix build on big-endian systems.
Reported by:	bz
2016-08-19 00:50:32 +00:00
Pyun YongHyeon
9ab0e2a7e0 When device is detached make sure to stop the controller and make
it return zero-length USB packet.
2016-08-18 07:11:31 +00:00
Pyun YongHyeon
15b5fb58b6 In axge_stop(), clear medium receive enable bit which will stop RX
MAC operation.
2016-08-18 06:46:14 +00:00
Pyun YongHyeon
2948462df8 When usbd_transfer_setup() fails, don't call
usbd_transfer_unsetup().
2016-08-18 06:35:09 +00:00
Pyun YongHyeon
a5d826557f Introduce axge_rxfilter() which configures RX filtering and replace
axge_setmulti()/axge_setpromisc() with axge_rxfilter().
Multicast filter programming and promiscuous mode requires
access to a common RX configuration register so there is no need to
use separate functions with added complexity.  axge_rxfilter() does
not read back AXGE_RCR register since accessing a register in USB
is too slow and we already have all knowledge of required
configuration.  Rebuilding RX filter configuration is simpler and
faster than manipulating every bits after reading back the
register.

Note, axge_rxfilter() does not set RCR_IPE(IP header alignment on
32bit boundary) to disable extra padding bytes insertion.  The
extra padding wastes ethernet to USB host bandwidth as well as
complicating RX handling logic.  Current USB framework requires
copying RX frames to mbufs so there is no need to worry about
alignment.  Previously axge_rx_frame() performed wrong bound check
due to the extra padding and it was broken when RX checksum
offloading is disabled.  See added comment in axge_rx_frame () for
actual RX packet layout.

In axge_init(), disable WOL.  It's meaningless to enable WOL in
normal operation.

In axge_rxeof(), use properly sized mbuf rather than blindly
allocating a mbuf cluster.

Use RX H/W checksum offloading only when administrator requested RX
checksum offloading. Previously it always used RX H/W checksum
offloading result regardless of RX checksum offloading state.

Separate L4 checksum offloading validation from L3 one and properly
set required offloading bits for each layer. This is to fix setting
L4 checksum offloading bits for L3 packets.

There are still lots of RX errors(probably RX FIFO overflows) under
moderate load.  Users are strongly recommended to enable ethernet
flow control.

Reviewed by:	kevlo (initial version), hselasky
2016-08-18 06:29:07 +00:00
Pyun YongHyeon
7c10cf8c28 Switch to TX header format rather than directly manipulating header
structures.  This simplifies mbuf copy operation to USB buffers as
well as improving readability.  The controller supports Microsoft
LSOv1(aka TSO) but this change set does not include the support due
to copying overhead to USB buffers and large amount of memory waste.

Remove useless ZLP padding which seems to come from Linux.  Required
bits the code tried to set was not copied into USB buffer so it had
no effect.  Unlike Linux, FreeBSD USB stack automatically generates
ZLP so no explicit padding is required in driver.[1]

Micro-optimize updating IFCOUNTER_OPACKETS counter by moving it out
of TX loop since updating counter is not cheap operation as it did
long time ago and we already know how many number of packets were
queued after exiting the loop.

While here, fix a checksum offloading bug which will happen when
upper stack computes checksum while H/W checksum offloading is
active.  The controller should be notified to not recompute the
checksum in this case.

Reviewed by:	kevlo (initial version), hselasky
Pointed out by:	hselasky [1]
2016-08-18 05:07:02 +00:00
Pyun YongHyeon
b2cdc7ca6f Rename cryptic RX filter constants with more readable ones.
No functional change.
2016-08-18 04:25:17 +00:00
Pyun YongHyeon
7598bc98ca Don't explicitly call MIIBUS_STATCHG() method handler. Link state
change should be handled by PHY driver.  Some broken PHY H/Ws may
need that workaround but it seems axge(4) don't use such PHYs.
2016-08-18 02:14:39 +00:00
Pyun YongHyeon
a42c5d9fa7 Pass PHY location information and remove PHY access hack. 2016-08-18 01:48:58 +00:00
Pedro F. Giffuni
f0be707d74 sys/dev: replace comma with semicolon when pertinent.
Uses of commas instead of a semicolons can easily go undetected. The comma
can serve as a statement separator but this shouldn't be abused when
statements are meant to be standalone.

Detected with devel/coccinelle following a hint from DragonFlyBSD.

MFC after:	1 month
2016-08-09 19:41:46 +00:00
Cy Schubert
e13c1ef1e7 Add Logitech Unifying receiver.
MFC after:	1 week
2016-08-06 20:27:12 +00:00
Hans Petter Selasky
f87a304c8b Keep a reference count on USB keyboard polling to allow recursive
cngrab() during a panic for example, similar to what the AT-keyboard
driver is doing.

Found by:	Bruce Evans <brde@optusnet.com.au>
MFC after:	1 week
2016-08-05 08:58:00 +00:00
Edward Tomasz Napierala
6be7599235 Improve error message.
MFC after:	1 month
2016-07-29 11:33:23 +00:00
Edward Tomasz Napierala
5a92ac1d68 Fix MTP description in the comment.
MFC after:	1 month
2016-07-29 11:33:01 +00:00
Andrew Turner
eda295b9e5 Add a generic EHCI USB driver based on the Allwinner A10 driver. It is ACPI
only for now, but wouldn't be too difficult to add support for FDT.

Reviewed by:	hselasky
Obtained from:	ABT Systems Ltd
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D7352
2016-07-29 08:50:36 +00:00
Ian Lepore
fe67c84656 Annotate the usb-serial drivers which always return 0 for line status,
so that it'll be easier to find and fix them in the future.
2016-07-27 00:08:01 +00:00
Ian Lepore
d83433299b Translate modem status reg bits from ns16550 to SER_* values used by the
tty layer.

Also annotate a switch case fall-through per style(9).
2016-07-27 00:03:18 +00:00
Ian Lepore
d88e7bb082 Translate modem status reg bits from ns16550 to SER_* values used by the
tty layer.

Also annotate a switch case fall-through per style(9).
2016-07-26 23:42:42 +00:00
Ian Lepore
ab3249b590 Translate modem status reg bits from ns16550 to SER_* values used by the
tty layer.  Also, the line status reg bits are already ns16550 as expected
by the ucom layer, so no need for translation or a local var to hold them.
2016-07-26 23:27:28 +00:00
Ian Lepore
b90ce50491 Actually return line status register values from umoscom_cfg_get_status().
The hardware delivers ns16550-compatible status bits, which is what the
usb_serial code expects, so no need for translation, no need for a local
variable to hold a temporary lsr result.
2016-07-26 22:26:49 +00:00
Michal Meloun
dac935533b EXTRES: Add OF node as argument to all <foo>_get_by_ofw_<bar>() functions.
In some cases, the driver must handle given properties located in
specific OF subnode. Instead of creating duplicate set of function, add
'node' as argument to existing functions, defaulting it to device OF node.

MFC after: 3 weeks
2016-07-10 18:28:15 +00:00
Hans Petter Selasky
c5390e5ab4 Fix regression issue with XHCI on 32-bit ARMv7 Armada-38x. Make sure
"struct xhci_dev_ctx_addr" fits into a single 4K page until further.

Approved by:	re (hrs)
MFC after:	1 week
2016-07-06 10:57:04 +00:00
Hans Petter Selasky
e4d1732068 Fix interrupt loop when switching from USB device to USB host mode by
clearing all endpoint interrupt bits.

PR:		210736
Approved by:	re (glebius)
MFC after:	1 week
2016-07-04 17:12:22 +00:00
Hans Petter Selasky
2d8904583c Fix detection of USB device disconnects in USB host mode when the USB
device is connected directly to the USB port of the DWC OTG, in this
case a RPI-zero.

PR:		210695
Approved by:	re (gjb)
MFC after:	1 week
2016-07-01 07:27:33 +00:00
Conrad Meyer
fb017b828d USB: Add Garmin FR230 device quirk (broken INQUIRY)
PR:		210544
Reviewed by:	hps
Approved by:	re
2016-06-29 06:42:20 +00:00
Hans Petter Selasky
bbd41717f0 Update the definition for number of scratch pages to match the latest
version of the XHCI specification. Make sure the code can handle the
maximum number of allowed scratch pages.

Submitted by:	Shichun_Ma@Dell.com
Approved by:	re (hrs)
MFC after:	1 week
2016-06-22 09:03:55 +00:00
Bjoern A. Zeeb
89856f7e2d Get closer to a VIMAGE network stack teardown from top to bottom rather
than removing the network interfaces first. This change is rather larger
and convoluted as the ordering requirements cannot be separated.

Move the pfil(9) framework to SI_SUB_PROTO_PFIL, move Firewalls and
related modules to their own SI_SUB_PROTO_FIREWALL.
Move initialization of "physical" interfaces to SI_SUB_DRIVERS,
move virtual (cloned) interfaces to SI_SUB_PSEUDO.
Move Multicast to SI_SUB_PROTO_MC.

Re-work parts of multicast initialisation and teardown, not taking the
huge amount of memory into account if used as a module yet.

For interface teardown we try to do as many of them as we can on
SI_SUB_INIT_IF, but for some this makes no sense, e.g., when tunnelling
over a higher layer protocol such as IP. In that case the interface
has to go along (or before) the higher layer protocol is shutdown.

Kernel hhooks need to go last on teardown as they may be used at various
higher layers and we cannot remove them before we cleaned up the higher
layers.

For interface teardown there are multiple paths:
(a) a cloned interface is destroyed (inside a VIMAGE or in the base system),
(b) any interface is moved from a virtual network stack to a different
network stack ("vmove"), or (c) a virtual network stack is being shut down.
All code paths go through if_detach_internal() where we, depending on the
vmove flag or the vnet state, make a decision on how much to shut down;
in case we are destroying a VNET the individual protocol layers will
cleanup their own parts thus we cannot do so again for each interface as
we end up with, e.g., double-frees, destroying locks twice or acquiring
already destroyed locks.
When calling into protocol cleanups we equally have to tell them
whether they need to detach upper layer protocols ("ulp") or not
(e.g., in6_ifdetach()).

Provide or enahnce helper functions to do proper cleanup at a protocol
rather than at an interface level.

Approved by:		re (hrs)
Obtained from:		projects/vnet
Reviewed by:		gnn, jhb
Sponsored by:		The FreeBSD Foundation
MFC after:		2 weeks
Differential Revision:	https://reviews.freebsd.org/D6747
2016-06-21 13:48:49 +00:00
Adrian Chadd
cdf039af74 [run] fix TSF locking in RX radiotap.
Submitted by:	Imre Vadasz <imre@vdsz.com>
2016-06-04 07:18:39 +00:00
Pedro F. Giffuni
b16de7bff1 usb/uhso: Don't bail out on first USB error.
CID:		1305680
Submitted by:	hselasky
MFC after:	3 days
2016-06-02 15:30:58 +00:00
Andriy Voskoboinyk
6fc44742fd urtw: fix unused variable assignments.
Append CWmax and retry limitation to tp->maxretry instead of rewriting it
(will restore pre-r198194 behavior).

Noticed by:	pfg, hps

Reported by:	Coverity
CID:		1304937, 1304920
2016-06-02 12:01:58 +00:00
Andriy Voskoboinyk
a7c31fe1e9 urtwn, rtwn, rsu: switch to ieee80211_add_channel_list_2ghz().
- Use device's channel list instead of default one (from
ieee80211_init_channels()); adds 12 - 14 2GHz channels.
- Add ic_getradiocaps() method.
2016-05-26 16:39:11 +00:00
Andriy Voskoboinyk
2a06b6b33f urtw: switch to ieee80211_add_channel_list_2ghz().
- Use device's channel list instead of default one (from
ieee80211_init_channels()).
- Add ic_getradiocaps() method.
2016-05-26 16:15:10 +00:00
Andriy Voskoboinyk
5a62dab132 zyd: switch to ieee80211_add_channel_list_*()
- Use device's channel list instead of default one (adds 12, 13 and 14
2GHz channels).
- Add ic_getradiocaps() method.

Differential Revision:	https://reviews.freebsd.org/D6171
2016-05-26 15:56:27 +00:00
Andriy Voskoboinyk
83829b483d ural: switch to ieee80211_add_channel_list_*()
- Use device's channel list instead of default one (+ 12, 13 and 14
2GHz channels).
- Add ic_getradiocaps() method.

Differential Revision:	https://reviews.freebsd.org/D6170
2016-05-26 15:12:54 +00:00
Andriy Voskoboinyk
99bb30a9e0 run: switch to ieee80211_add_channel_list_*()
- Use device's channel list instead of default one (from
ieee80211_init_channels()).
- Add ic_getradiocaps() method.

Differential Revision:	https://reviews.freebsd.org/D6144
2016-05-26 15:05:37 +00:00
Jared McNeill
627c360fa7 Enable USB PHY regulators when requested by the host controller driver.
Previously the USB PHY driver would enable all regulators at attach time.
This prevented boards from booting when powered by the USB OTG port, as
it didn't take VBUS presence into consideration.
2016-05-26 10:50:39 +00:00
Hans Petter Selasky
10aab8b611 Check for signals when locking the USB enumeration thread from
userspace, so that USB applications can be killed if an enumeration
thread should be stuck for various reasons.

MFC after:	1 week
2016-05-25 07:48:36 +00:00
Hans Petter Selasky
6e2392aea4 Fix bad sizeof().
Submitted by:	David Binderman <dcb314@hotmail.com>
PR:	209636
2016-05-19 11:02:39 +00:00
Emmanuel Vadot
d71896a76a Add driver for "generic-ohci" as defined by FDT.
If platform support EXT_RESOURCES, clocks and resets are handled out of
the box.
If not driver can be subclassed using the generic_usb interface.
generic_usb name was choosed because at one point I'll add generic-ehci
FDT driver.

Reviewed by:	jmcneill, hselasky
Approved by:	andrew (mentor)
Differential Revision:	https://reviews.freebsd.org/D5481
2016-05-17 17:46:12 +00:00
Oleksandr Tymoshenko
27b917c85e Use OF_prop_free instead of direct call to free(9) 2016-05-14 18:44:30 +00:00
Pedro F. Giffuni
25cd047538 dev/usb: unsigned some loop indexes.
Although usually small, values produced by nitems() are unsigned.
By unsigning the corresponding indexes we avoid signed vs unsigned
comparisons. This may have some effect on performance, although given the
small sizes the effect will not be perceivable, and it makes the code
clearer.

Respect the style of the changed files: one uses u_int while the other
uses "unsigned int".

Reviewed by:	hselasky
2016-05-06 15:09:21 +00:00
Hans Petter Selasky
869df73304 Extend the UQ_NO_STRINGS quirk to also cover the USB language string
descriptor. This fixes enumeration of some older Samsung Galaxy S3
phones.

MFC after:	1 week
2016-05-04 08:57:40 +00:00
Alexander Motin
71733a504f Add some device IDs from Intel Sunrise Point chipsets.
MFC after:	2 weeks
2016-05-03 15:27:47 +00:00
Pedro F. Giffuni
207332450e dev/usb: minor spelling fixes in comments.
No functional change.

Reviewed by:	hselasky
2016-05-02 17:44:03 +00:00
Adrian Chadd
afce6f3b0b s/struct device */device_t/
Submitted by:	kmacy
2016-05-02 05:37:25 +00:00
Andriy Voskoboinyk
7b45c9dfe1 rum: switch to ieee80211_add_channel_list_*()
- Use device's channel list instead of default one
(from ieee80211_init_channels()).
- Add ic_getradiocaps() method.

Added channels:
2GHz band: 12, 13 and 14.
5Ghz band: 34, 38, 42, 46 and 165.

Tested with WUSB54GC, STA / MONITOR modes.

Differential Revision:	https://reviews.freebsd.org/D6125
2016-05-01 18:53:12 +00:00
Andriy Voskoboinyk
a061fea6ee net80211 + drivers: hide size of 'bands' array behind a macro.
Auto-replace 'howmany(IEEE80211_MODE_MAX, 8)' with 'IEEE80211_MODE_BYTES'.
No functional changes.
2016-04-29 22:14:11 +00:00
Pedro F. Giffuni
057b4402bf sys/dev: extend use of the howmany() macro when available.
We have a howmany() macro in the <sys/param.h> header that is
convenient to re-use as it makes things easier to read.
2016-04-26 15:03:15 +00:00
Pedro F. Giffuni
d9c9c81c08 sys: use our roundup2/rounddown2() macros when param.h is available.
rounddown2 tends to produce longer lines than the original code
and when the code has a high indentation level it was not really
advantageous to do the replacement.

This tries to strike a balance between readability using the macros
and flexibility of having the expressions, so not everything is
converted.
2016-04-21 19:57:40 +00:00
Hans Petter Selasky
be4e639d7a Add new USB quirk.
Submitted by:	Naram Qashat <cyberbotx@cyberbotx.com>
PR:		208642
MFC after:	1 week
2016-04-21 17:45:37 +00:00
Pedro F. Giffuni
432157dc67 dev/usb: use our nitems() macro when param.h is available.
Reviewed by: hselasky
2016-04-19 22:07:36 +00:00
Pedro F. Giffuni
74b8d63dcc Cleanup unnecessary semicolons from the kernel.
Found with devel/coccinelle.
2016-04-10 23:07:00 +00:00
Pedro F. Giffuni
2bf493863f USB: replace 0 with NULL for pointers.
Found with devel/coccinelle.

Reviewed by:	hselasky
2016-04-09 20:36:07 +00:00
Hans Petter Selasky
348256df6f Add new USB quirk.
Submitted by:	AJ <aleksanderlothe@live.com>
PR:		208623
MFC after:	1 week
2016-04-08 06:51:49 +00:00
Adrian Chadd
b60322c9b4 [rsu] We don't do A-MPDU transmit right now, so don't bother registering
for it.
2016-04-06 00:41:06 +00:00
Oleksandr Tymoshenko
e2bb79f70f Remove misleading comment. musb supports host mode for more than two years now
Spotted by: jmcneill
2016-04-05 18:07:13 +00:00
Ian Lepore
dc57f06939 Add more DPRINTF() to the ftdi driver. Now everything that can change the
chip's state has a DPRINTF, with things that happen repeatedly at debug=2
level and things that happen frequently (like per-transfer IO) at debug=3.
2016-04-05 13:47:06 +00:00
Michal Meloun
c520cb4f50 ehci_interrupt is MPSAFE code. Most drivers in tree calls bus_setup_intr
with MPSAFE, some are not. Fix those.

Submitted by: Howard Su <howard0su@gmail.com>
Differential Revision: https://reviews.freebsd.org/D5755
2016-04-05 12:13:53 +00:00
Hans Petter Selasky
4d36338081 Add new USB ID to UDL driver.
Submitted by:	Matthias Petermann <matthias@petermann-it.de>
PR:		201084
2016-03-30 10:05:52 +00:00
Alexander Motin
15e01a35e1 Add some device IDs found on AMD FCH shipsets.
MFC after:	2 weeks
2016-03-29 12:50:42 +00:00
Hans Petter Selasky
288edd19d7 Verify that all segments in the loaded segment list are back to back
with regard to the page offset, and not only the two first ones.
2016-03-29 10:47:14 +00:00
Hans Petter Selasky
6227e59635 Add more UHCI PCI IDs.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
2016-03-24 09:35:29 +00:00
Andriy Voskoboinyk
349156a945 rum: add legacy power saving support (STA mode).
Tested with WUSB54GC, STA mode + WRT54GC / RTL8188EU in HOSTAP mode.

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D5546
2016-03-21 22:29:24 +00:00
Andriy Voskoboinyk
96e29c261d rum: simplify error handling in rum_newstate().
Tested with WUSB54GC, STA mode.

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D5544
2016-03-21 22:14:48 +00:00
Andriy Voskoboinyk
3770442708 rum: do not try to restore bssid/TSF synchronization when device
is not associated.

Tested with WUSB54GC, STA mode.

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D5543
2016-03-21 21:33:30 +00:00
Andriy Voskoboinyk
fd7dae9c98 rum: separate some microcontroller vendor-specific requests into
rum_do_mcu_request()

This change should be no-op.

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D5542
2016-03-21 21:02:57 +00:00
Adrian Chadd
0c91dc1d08 [urtwn] migrate urtwn out into sys/dev/urtwn/ .
There's some upcoming work to add new chipset support here and I'd
like to only add 802.11n support to one driver, instead of both
urtwn and rtwn.

There's also missing support for things like 802.11n, some powersave
work, bluetooth integration/coexistence, etc, and also newer parts
(like 8192EU, maybe some 11ac parts, not sure yet.)

So, this is hopefully the first step in a longer set of steps to unify
rtwn/urtwn and extend it with more interesting chipset and functionality
support.

Reviewed by:	kevlo
2016-03-20 03:54:57 +00:00
Alexander Motin
cb6b0ad147 Add IDs for Intel Wellsburg USB controllers.
MFC after:	1 week
2016-03-19 09:20:18 +00:00
Wojciech Macek
9147c9b8b2 Add xhci_mv.c
Add missing xhci driver for Marvell systems.

Submitted by:          Bartosz Szczepanek <bsz@semihalf.com>
Obtained from:         Semihalf
Sponsored by:          Stormshield
Reviewed by:           hselasky
Approved by:           cognet (mentor)
Differential Revision: https://reviews.freebsd.org/D5031
2016-03-14 07:24:08 +00:00
Andriy Voskoboinyk
ae132f1122 zyd, run, ural: do not corrupt MAC address
Do not use ic_macaddr as a storage for current BSSID;
it may be reused in vap creation procedure;
similar to r288619.

Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D5513
2016-03-03 20:06:16 +00:00
Hans Petter Selasky
24fe42dcdd Allow for overlapping quirk device ranges. Prior to this patch only
the first device entry matching the USB vendor, product and revision
would be searched for quirks. After this patch all device entries will
be searched for quirks.

MFC after:	1 week
2016-03-03 08:47:27 +00:00
Mark Johnston
925bcbd658 Use m_catpkt(9) to ensure that pkthdr fields are updated properly.
Reviewed by:	glebius
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D5497
2016-03-02 05:05:02 +00:00
Andriy Voskoboinyk
067a92f8f4 urtwn: do not filter beacon frames in HOSTAP mode while scanning
urtwn_set_rx_bssid_all() will allow to receive beacons only
when they are not denied by filter.

Revealed by D5474.

Tested with RTL8188CUS, HOSTAP mode.

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D5477
2016-02-29 00:05:37 +00:00
Hans Petter Selasky
b265897c37 Configure the correct bMaxPacketSize for control endpoints before
requesting the initial complete device descriptor and not as part of
the subsequent babble error recovery. Babble means that the received
USB packet was bigger than than configured maximum packet size. This
only affects enumeration of FULL speed USB devices which use a
bMaxPacketSize different from 8 bytes. This patch might help fix
enumeration of USB devices which exhibit USB I/O errors in dmesg
during boot.

MFC after:	1 week
2016-02-23 18:17:01 +00:00
Hans Petter Selasky
ecc7ce0f3e Be more verbose when truncating number of HID items.
Suggested by:	Larry Rosenman <ler@lerctr.org>
MFC after:	1 week
2016-02-23 14:58:20 +00:00
Kevin Lo
c9b6e63dd3 Add device ID for 'AboCom 802.11n' usb.
PR:	207412
Submitted by:	Philippe Michaud-Boudreault <pitwuu at gmail dot com>
2016-02-23 01:56:58 +00:00
Andriy Voskoboinyk
6e2ab41693 urtwn: shutdown the device properly
- R92C path: NetBSD (mostly)
- R88E path: TP-Link driver

Tested with RTL8188EU and RTL8188CUS.

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D5198
2016-02-22 01:15:02 +00:00
Andriy Voskoboinyk
7873b2abd6 urtwn: add an option to compile the driver without firmware specific code
- Add URTWN_WITHOUT_UCODE option (will disable any firmware specific code
when set).
- Do not exclude the driver from build when MK_SOURCELESS_UCODE is set
(URTWN_WITHOUT_UCODE will be enforced unconditionally).
- Do not abort initialization when firmware cannot be loaded;
behave like the URTWN_WITHOUT_UCODE option was set.
- Drop some unused variables from urtwn_softc structure.

Tested with RTL8188EU and RTL8188CUS in HOSTAP and STA modes.

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4849
2016-02-22 00:48:53 +00:00
Hans Petter Selasky
d5fb67a401 Restore maximum number of host keys to 64.
Discussed with:	adrian @ and avos @
2016-02-14 16:18:39 +00:00
Hans Petter Selasky
8cb15594b3 Fix variable assignment inside if-clause in the smsc driver.
Found by D5245 / PVS.

MFC after:	1 week
2016-02-14 07:20:07 +00:00
Hans Petter Selasky
fe3e452399 Reduce the number of supported WLAN keys in the rum driver, else we
risk bit shifting overflows. Found by D5245 / PVS.

MFC after:	1 week
2016-02-14 07:16:36 +00:00
Hans Petter Selasky
4bc7e098c7 Correct PCI device description.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
2016-02-10 08:03:10 +00:00
Gleb Smirnoff
8ec07310fa These files were getting sys/malloc.h and vm/uma.h with header pollution
via sys/mbuf.h
2016-02-01 17:41:21 +00:00
Michal Meloun
477aff3eae EHCI: Correct address of EHCI_USBMODE_LPM register is 0xC8, not 0xA8. 2016-01-30 08:27:09 +00:00
Michal Meloun
cdf4ec6873 EHCI: Make core reset and port speed reading more generic.
Use driver settable callbacks for handling of:
- core post reset
- reading actual port speed

Typically, OTG enabled EHCI cores wants setting of USBMODE register,
but this register is not defined in EHCI specification and different
cores can have it on different offset.

Also, for cores with TT extension, actual port speed must be determinable.
But again, EHCI specification not covers this so this patch provides
function for two most common variant of speed bits layout.

Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D5088
2016-01-28 14:11:59 +00:00
Andriy Voskoboinyk
218592ceed urtwn: add temperature calibration
Redo LC calibration if temperature changed significantly since last
calibration.

Tested with RTL8188EU/RTL8188CUS in STA mode.

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Obtained from:	NetBSD (mostly)
Differential Revision:	https://reviews.freebsd.org/D4966
2016-01-20 23:55:39 +00:00
Andriy Voskoboinyk
01ff64089c urtwn: rework debug handling
- Use bitmap for debug output selection.
- Add few new messages (one for URTWN_DEBUG_BEACON
and another one for URTWN_DEBUG_INTR).
- Replace an undocumented URTWN_DEBUG definition with USB_DEBUG.

Tested with RTL8188EU / RTL8188CUS in IBSS / HOSTAP modes.

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4959
2016-01-20 23:27:02 +00:00
Andriy Voskoboinyk
783c605101 urtwn: use ic_updateslot method to handle slot time change
(by default it was set to 9us).

Tested with RTL8188EU / RTL8188CUS in STA mode.

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4535
2016-01-20 23:01:33 +00:00
Zbigniew Bodek
5c8fae4064 Improve attachment of the ehci_mv driver
Driver was modified to ensure it attaches properly to "marvell,orion-ehci"
node, which doesn't have error interrupt line defined. Neccessary
ofw_compat_data struct was added and probe procedure was altered.

Reviewed by:    andrew, ian
Obtained from:  Semihalf
Sponsored by:   Stormshield
Submitted by:   Bartosz Szczepanek <bsz@semihalf.com>
Differential revision:  https://reviews.freebsd.org/D4369
2016-01-20 13:58:07 +00:00
Ian Lepore
5508dc2afe Make PPS ASSERT/CLEAR events match the RS-232 signal levels as per RFC 2783.
Previously the polarity was for TTL levels, which are the reverse of RS-232.

Also add handling of the UART_PPS_INVERT_PULSE option bit in the sysctl
value, the same as was recently added to uart(4), so that people using TTL
level connections can request a logical inverting of the signal.

Use the named constants from the new dev/uart/uart_ppstypes.h for the pps
capture modes and option bits.
2016-01-17 21:19:45 +00:00
Andriy Voskoboinyk
8a1d6d278d urtwn: add ROM structure for RTL8188EU
- Add the structure with already known fields offsets
  (some of them were taken from this driver,
  some (channel_plan, rf_* fields) - from TP-LINK official driver)
- Fix a typo / dehardcode a constant in RTL8192C ROM structure.

Tested with RTL8188EU, STA mode

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4274
2016-01-17 00:52:21 +00:00
Warner Losh
64535e84f6 Move ohci files to their proper place in the tree for atmel.
Fix when it is included (we don't have a at91rm9200 device).
From a similar patch in the PR, with tweaked names.

PR: 206229
2016-01-16 04:47:32 +00:00
Hans Petter Selasky
ac3490fdef Use the recently added "make_dev_s()" function to solve old race setting the
si_drv1 field in "struct cdev" when creating new character devices.
2016-01-15 12:09:15 +00:00
Andriy Voskoboinyk
0046e1868f net80211 drivers: fix ieee80211_init_channels() usage
Fix out-of-bounds read (all) / write (11n capable) for drivers
that are using ieee80211_init_channels() to initialize channel list.

Tested with:
 * RTL8188EU, STA mode.
 * RTL8188CUS, STA mode.
 * WUSB54GC, HOSTAP mode.

Approved by:	adrian (mentor)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D4818
2016-01-07 18:41:03 +00:00
Hans Petter Selasky
076daeda4f Fix for directly connected FULL or LOW speed USB devices.
Found by:	Sebastian Huber <sebastian.huber@embedded-brains.de>
MFC after:	1 week
2016-01-05 09:18:43 +00:00
Andriy Voskoboinyk
60e9dd4e56 urtwn: add bits for R92C_HWSEQ_CTRL and R92C_TXPAUSE registers
Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4770
2016-01-04 21:16:49 +00:00
Kristof Provost
dd876af4de Add suppoort for the Sitecom LN-031
This is an AX88178 chip, which we already support so all we have to do is add
the USB product and vendor ID.
2015-12-31 18:12:35 +00:00
Hans Petter Selasky
f9e8f40d28 Update metadata for "tools/tools/bus_autoconf" after r292080. Use
BYTE_ORDER instead of _BYTE_ORDER due to 3rd party USB software for
now.
2015-12-29 11:53:13 +00:00
Andrew Turner
2245b38f73 Ads support to the xhci pci attachment to use MSI-X interrupts when
available. As with MSI interrupts these can be disabled by setting
hw.usb.xhci.msix to 0 in the loader.

MSI-X interrupts are needed on some hardware, for example the Cavium
ThunderX only supports them, and with this we don't fall back to polling.

PR:		204378
Reviewed by:	hselasky, jhb
MFC after:	1 week (after r292669)
Sponsored by:	ABT Systems Ltd
Differential Revision:	https://reviews.freebsd.org/D4698
2015-12-24 09:40:29 +00:00
Ian Lepore
bd6c93e8bd Flag the first port on a Sheevaplug ftdi serial device as jtag. 2015-12-16 20:54:28 +00:00
Andriy Voskoboinyk
64febdf2e2 urtwn: fix off-by-one error.
Reported by:	adrian
2015-12-15 17:59:13 +00:00
Andriy Voskoboinyk
31b80e9a5e urtwn: add raw Tx path.
Tested with RTL8188EU and RTL8188CUS in STA mode.

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4523
2015-12-14 20:39:38 +00:00
Andriy Voskoboinyk
e77cd6fd9e urtwn: fix frame processing in the Rx path.
Currently, in case when npkts >= 2, RSSI and Rx radiotap fields
will be overridden by the next packet. As a result, every packet
from this chain will use the same RSSI / radiotap data.

After this change, RSSI and radiotap structure will be filled
for every frame right before ieee80211_input() call.

Tested with RTL8188EU / RTL8188CUS, STA and MONITOR modes.

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4487
2015-12-14 13:05:16 +00:00
Andriy Voskoboinyk
352761d514 urtwn: add TSF field into RX radiotap header.
Tested with RTL8188EU, MONITOR/STA modes.

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D3831
2015-12-14 12:36:10 +00:00
Andriy Voskoboinyk
ce036b5148 wpi, rum and urtwn: update copyright headers
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4489
2015-12-13 22:08:27 +00:00
Andriy Voskoboinyk
2744e0b2ab urtwn: add support for hardware encryption (WEP, TKIP and CCMP)
Tested with:
- RTL8188EU;
- RTL8188CUS;

Modes:
- IBSS mode: TKIP, CCMP (WPA-None);
- STA / HOSTAP modes - WEP (static), TKIP, CCMP;

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Obtained from:	OpenBSD (mostly)
Differential Revision:	https://reviews.freebsd.org/D4448
2015-12-13 22:00:19 +00:00