Commit Graph

3819 Commits

Author SHA1 Message Date
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