Commit Graph

3631 Commits

Author SHA1 Message Date
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
Andriy Voskoboinyk
b3f5d50360 urtwn: add a command queue for sleepable tasks.
An implementation from rum(4) was used (it looks simpler for me).
Will be used for h/w encryption support.

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4447
2015-12-13 21:50:38 +00:00
Andriy Voskoboinyk
be615269bb urtwn(4): setup channel frequency/flags for radiotap in urtwn_set_channel()
Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D3832
2015-12-13 21:43:54 +00:00
Andriy Voskoboinyk
371028a3b7 urtwn: add rate control support for RTL8188EU.
Tested with:
- RTL8188EU, STA and HOSTAP modes.
- RTL8188CUS, STA mode.

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4402
2015-12-13 21:00:21 +00:00
Andriy Voskoboinyk
bdfff33ff6 net80211: remove hardcoded slot time durations from drivers
- Add IEEE80211_GET_SLOTTIME(ic) macro.
- Use predefined macroses to set slot time.

Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4044
2015-12-13 20:48:24 +00:00
Warner Losh
f809f280e0 Create a USB_PNP_INFO and use it to export the existing PNP
tables. Some drivers needed some slight re-arrangement of declarations
to accommodate this. Change the USB pnp tables slightly to allow
better compatibility with the system by moving linux driver info from
start of each entry to the end. All other PNP tables in the system
have the per-device flags and such at the end of the elements rather
that at the beginning.

Differential Review: https://reviews.freebsd.org/D3458
2015-12-11 05:28:00 +00:00
Kevin Lo
c70294dc3a All 2-endpoints configs have high and normal pariority queues. 2015-12-10 07:45:58 +00:00
Andriy Voskoboinyk
907809bec0 urtwn: add WME support
Tested with:
 - RTL8188CUS, HOSTAP mode.
 - RTL8188EU, STA mode.

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4020
2015-12-09 09:29:38 +00:00
Hans Petter Selasky
4da9ba7e7f When setting up VLANs on a Raspberry Pi ethernet port, the MTU drops
from 1500 to 1496 bytes. The MTU should remain at 1500, extending the
frame size as per IEEE 802.3. Adding IFCAP_VLAN_MTU to the
if_capabilities field in the smsc driver solves the problem.  The
datasheet for the LAN9512 chip, section 3.2.3 states that the chip
supports the extended frame.

Submitted by:	rpp@ci.com.au
MFC after:	1 week
PR:		205050
2015-12-07 18:55:33 +00:00
Kevin Lo
eab02f464a - Fix Tx queues to USB endpoints mapping
- Merge urtwn_r92c_dma_init() and urtwn_r88e_dma_init() into one

Reviewed by:	adrian, avos
Differential Revision:	https://reviews.freebsd.org/D4381
2015-12-06 14:07:57 +00:00
Andriy Voskoboinyk
2e3c0e969e urtwn: fix some regressions after r290630
- Restore R92C_TXDW4_HWSEQ_EN bit - it is used by non-8188EU chips.
- Fix DRVRATE bit usage.

Tested with:
 - RTL8188EU, STA mode.
 - RTL8188CUS, STA mode.

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4352
2015-12-05 15:08:01 +00:00
Andriy Voskoboinyk
a7d4c4c102 urtwn(4): add error handling for urtwn_write_X() functions.
- Call ieee80211_stop() when urtwn_init() fails
(i.e., stop vap explicitly)
- Return an error when urtwn_write_<smth>() fails.
- Handle errors from them in:
 * urtwn_fw_cmd();
 * urtwn_llt_write();
 * urtwn_efuse_*();
 * urtwn_*_power_on();
 * urtwn_*_dma_init();
 * urtwn_mac_init();
 * urtwn_init();

Tested with RTL8188EU, STA mode

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4291
2015-12-03 14:38:55 +00:00
Andriy Voskoboinyk
aacc26e329 urtwn(4): move duplicate code from urtwn_(r92c/r88e)_dma_init()
to urtwn_dma_init() (noop).

Reviewed by:	kevlo
Approved by:	adrian (mentor, implicit)
Differential Revision:	https://reviews.freebsd.org/D4271
2015-12-03 14:17:28 +00:00
Kevin Lo
e1b74f21f5 Add initial support for RTL8152 USB Fast Ethernet. RTL8152 supports
IPv4/IPv6 checksum offloading and VLAN tag insertion/stripping.

Since uether doesn't provide a way to announce driver specific offload
capabilities to upper stack, checksum offloading support needs more work
and will be done in the future.

Special thanks to Hayes Wang from RealTek who gave input.
2015-12-01 05:12:13 +00:00
Andriy Voskoboinyk
974d2101ba urtwn(4): rework ROM reading.
- Add error handling for urtwn_(r88e_)read_rom() and
urtwn_efuse_*() functions.
- Remove code duplication between urtwn_efuse_read() and
urtwn_r88e_read_rom().
- Merge r88e_rom and (r92c_)rom structures
(only one of them can be used at the same time).
- Other minor fixes / improvements.

Tested with RTL8188EU, STA mode
(URTWN_DEBUG + USB_DEBUG, hw.usb.urtwn.debug=3, no visual differences).

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4253
2015-11-24 19:20:45 +00:00
Hans Petter Selasky
db8409e00a Fix compile warning about shifting signed negative constant.
MFC after:	3 days
2015-11-23 12:55:37 +00:00
Hans Petter Selasky
db00265949 Add support for Kana and Eisu keys to the USB keyboard driver.
PR:		204709
Submitted by:	naito.yuichiro@gmail.com
MFC after:	3 days
2015-11-21 21:18:55 +00:00
Andriy Voskoboinyk
a2ff3c9268 urtwn(4): add IBSS mode support
Tested with RTL8188EU, IBSS and STA modes.

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4038
2015-11-10 12:52:26 +00:00
Hans Petter Selasky
fcc75f06aa Update the wsp driver to support newer touch pads, like found in
MacBookPro11,4 and MacBook12,1. This update adds support for the
force touch parameter.

PR:		204420
MFC after:	1 week
2015-11-10 09:27:52 +00:00
Andriy Voskoboinyk
98b83dc236 urtwn(4): fix the build.
Add some missing bits from D4020.
2015-11-10 00:42:32 +00:00
Andriy Voskoboinyk
337bcd0ac2 urtwn(4): add HOSTAP mode support.
Tested with RTL8188EU, HOSTAP and STA modes

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4034
2015-11-10 00:12:00 +00:00
Andriy Voskoboinyk
3aedf2e3b6 urtwn(4): refactor and fix TX path.
- Split urtwn_tx_start() into urtwn_tx_data() and urtwn_tx_start()
  (the last will be used for beacon updates / raw xmit path).
- Remove unneeded code from _urtwn_getbuf().
- Use CCK11 for data frames in 11b mode.
- Send EAPOL frames at 1 Mbps.
- Reduce code duplication in urtwn_tx_data().
- Fix sequence numbering.
- Add IEEE80211_RADIOTAP_F_WEP flag for encrypted frames.
- Check URTWN_RUNNING flag under lock.

Tested with RTL8188EU, STA mode.

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4017
2015-11-09 23:46:13 +00:00
Andriy Voskoboinyk
55dbdc2140 urtwn(4): improve RX filter.
- Filter out unneeded frames in STA mode.
- Implement ic_promisc() call.

Tested with RTL8188EU, STA and MONITOR modes.

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D3999
2015-11-08 23:21:54 +00:00
Hans Petter Selasky
c2472ff8fb Avoid using the bounce buffer when the source or destination buffer is
32-bits aligned. Merge the two bounce buffers into a single one. Some
rough tests showed that the DWC OTG throughput on RPI2 increased by
10% after this patch.

MFC after:	1 week
2015-11-08 09:37:26 +00:00
Hans Petter Selasky
c6b6f54640 Add helper function to check if a USB page cache buffer is properly
aligned to reduce the use of bounce buffers in PIO mode.

MFC after:	1 week
2015-11-07 11:40:35 +00:00
Hans Petter Selasky
a51f980180 Fix for unaligned IP-header.
The mbuf length fields must be set before m_adj() is called else
m_adj() will not always adjust the mbuf and an unaligned read
exception can trigger inside the network stack. This can happen on
platforms where unaligned reads are not supported. Adjust a length
check to include the 2-byte ethernet alignment while at it.

MFC after:	3 days
2015-11-06 12:54:27 +00:00
Andriy Voskoboinyk
160caba341 urtwn(4): simplify urtwn_tsf_sync_enable().
- Drop TSF initialization; device can discover it without our help.
- Do not touch R92C_BCN_CTRL_EN_BCN bit in STA mode.
- Add 'static' keyword for function definition.

Tested with RTL8188EU, STA mode.

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D3801
2015-11-06 11:29:24 +00:00
Andriy Voskoboinyk
a14954c5d6 net80211: WME callback cleanup in various drivers
Since r288350, ic_wme_task() is called via ieee80211_runtask(),
so, any additional deferring from the driver side is not needed.

Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4072
2015-11-05 17:58:18 +00:00
Hans Petter Selasky
94bceb529a Revert r290327. The compiler warnings seems to be specific to clang v3.5 only. 2015-11-03 09:38:39 +00:00
Hans Petter Selasky
b4f0cda47b Fix some clang compile warnings.
MFC after:	1 week
2015-11-03 08:52:06 +00:00
Hans Petter Selasky
a2aa9bebf1 Relax the BUS_DMA_KEEP_PG_OFFSET requirement to allow optimising
allocation of DMA bounce buffers.

Discussed with:	ian @
MFC after:	3 weeks
2015-11-03 08:42:43 +00:00
Hans Petter Selasky
52d7c63839 Reduce the DWC OTG interrupt load by not reading all the host channel
status registers for every interrupt. Check a common host channel
status interrupt register first, then conditionally read the
individual host channel status registers.

Submitted by:	Sebastian Huber <sebastian.huber@embedded-brains.de>
MFC after:	1 week
2015-10-30 14:50:29 +00:00
Hans Petter Selasky
8d59ecb214 Finish process of moving the LinuxKPI module into the default kernel build.
- Move all files related to the LinuxKPI into sys/compat/linuxkpi and
  its subfolders.
- Update sys/conf/files and some Makefiles to use new file locations.
- Added description of COMPAT_LINUXKPI to sys/conf/NOTES which in turn
  adds the LinuxKPI to all LINT builds.
- The LinuxKPI can be added to the kernel by setting the
  COMPAT_LINUXKPI option. The OFED kernel option no longer builds the
  LinuxKPI into the kernel. This was done to keep the build rules for
  the LinuxKPI in sys/conf/files simple.
- Extend the LinuxKPI module to include support for USB by moving the
  Linux USB compat from usb.ko to linuxkpi.ko.
- Bump the FreeBSD_version.
- A universe kernel build has been done.

Reviewed by:	np @ (cxgb and cxgbe related changes only)
Sponsored by:	Mellanox Technologies
2015-10-29 08:28:39 +00:00
Andriy Voskoboinyk
240dd2906d urtwn(4): fix scanning from AUTH state
Tested with RTL8188EU, STA mode.

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D3968
2015-10-27 14:21:24 +00:00
Andriy Voskoboinyk
9acc0e6bea urtwn(4): do not filter out control frames in the RX path
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D3811
2015-10-26 21:03:20 +00:00
Andriy Voskoboinyk
a0226b9f2d urtwn(4): fix mbuf leak in the TX path
Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D3988
2015-10-24 19:59:15 +00:00
Andriy Voskoboinyk
db70df04c4 run(4): convert to ieee80211_tx_complete()
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D3992
2015-10-23 17:35:03 +00:00
Hans Petter Selasky
74a24bbee6 Fix kernel build by restoring a temporary variable which was not yet
ripe for removal.
2015-10-23 11:00:35 +00:00
Andriy Voskoboinyk
74ee6e03d0 urtwn(4): add DBM_ANTNOISE radiotap field
Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D3839
2015-10-23 08:44:40 +00:00
Andriy Voskoboinyk
e97705d4b7 - Split one 4-byte R92C_CR register into 2-byte R92C_CR and 1-byte R92C_MSR
registers (they are used for different purposes).
- Wrap R92C_MSR modifications into urtwn_set_mode().

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D3838
2015-10-23 08:26:26 +00:00
Andriy Voskoboinyk
1b65f30ffa urtwn(4): fix the RSSI calculation for RTL8188EU.
This change also reverts r252405 (causes integer underflow).

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D3820
2015-10-23 07:42:56 +00:00
Andriy Voskoboinyk
5a5461d8e0 urtwn(4): replace hardcoded rate indices with their names
Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D3967
2015-10-22 15:42:53 +00:00
Andriy Voskoboinyk
cc52232057 Initialize radiotap header fields before calling ieee80211_radiotap_rx()
Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D3951
2015-10-22 12:15:40 +00:00
Hans Petter Selasky
4be283b9be Add quirk for USB 3.0 PCI device.
Submitted by:	philipp.maechler@mamo.li
PR:		203650
MFC after:	1 week
2015-10-19 07:21:57 +00:00
Kevin Lo
dc82802918 Accept any correct frames from any source when MONITOR mode is used.
Submitted by:	Andriy Voskoboinyk <s3erios at gmail.com>
Differential Revision:	https://reviews.freebsd.org/D3812
2015-10-12 08:17:21 +00:00
Adrian Chadd
4f4a7a03ce net80211 drivers: eliminate any references to sc_rxtap_len/sc_txtap_len (never used here)
Submitted by:	<s3erios@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D3776
2015-10-12 05:21:51 +00:00
Adrian Chadd
c0658ced70 urtwn(4): split *reg and *var parts (no functional change).
Submitted by:	<s3erios@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D3775
2015-10-12 05:14:49 +00:00
Adrian Chadd
d957a93abe net80211: move ieee80211_free_node() call on error from ic_raw_xmit() to ieee80211_raw_output().
This doesn't free the mbuf upon error; the driver ic_raw_xmit method is still
doing that.

Submitted by:	<s3erios@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D3774
2015-10-12 04:55:20 +00:00
Adrian Chadd
d07be335a0 net80211: separate mbuf cleanup from ieee80211_fragment()
* Create ieee80211_free_mbuf() which frees a list of mbufs.
* Use it in the fragment transmit path and ath / uath transmit paths.
* Call it in xmit_pkt() if the transmission fails; otherwise fragments
  may be leaked.

This should be a big no-op.

Submitted by:	<s3erios@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D3769
2015-10-12 03:27:08 +00:00