Commit Graph

226 Commits

Author SHA1 Message Date
Kevin Lo
51a25d3479 If eapol packets are sent at the lowest rate, key negotiation will
become more reliable.

Submitted by:	Akinori Furukoshi <moonlightakkiy at yahoo dot ca>
2014-08-20 01:32:04 +00:00
Kevin Lo
d4bcd25553 Add the D-Link DWA-125 rev D1.
Tested by myself.
2014-08-20 01:26:27 +00:00
Nick Hibma
7ae432c00d Remove unused defines.
Fix some device_printf's that were missing '\n' at the end or had
speling errors.

PR:		145319
Submitted by:	rozhuk.im gmail.com
2014-08-05 08:24:41 +00:00
Hans Petter Selasky
b8e3094c34 Fix for division by zero.
MFC after:	3 days
2014-07-26 16:06:01 +00:00
Kevin Lo
b11ce478cf Enable 8051 before downloading firmware.
Tested by:	Carlos Jacobo Puga Medina <cpm at fbsd dot es>
2014-07-10 09:42:34 +00:00
Hans Petter Selasky
af3b2549c4 Pull in r267961 and r267973 again. Fix for issues reported will follow. 2014-06-28 03:56:17 +00:00
Glen Barber
37a107a407 Revert r267961, r267973:
These changes prevent sysctl(8) from returning proper output,
such as:

 1) no output from sysctl(8)
 2) erroneously returning ENOMEM with tools like truss(1)
    or uname(1)
 truss: can not get etype: Cannot allocate memory
2014-06-27 22:05:21 +00:00
Hans Petter Selasky
3da1cf1e88 Extend the meaning of the CTLFLAG_TUN flag to automatically check if
there is an environment variable which shall initialize the SYSCTL
during early boot. This works for all SYSCTL types both statically and
dynamically created ones, except for the SYSCTL NODE type and SYSCTLs
which belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added to
be used in the case a tunable sysctl has a custom initialisation
function allowing the sysctl to still be marked as a tunable. The
kernel SYSCTL API is mostly the same, with a few exceptions for some
special operations like iterating childrens of a static/extern SYSCTL
node. This operation should probably be made into a factored out
common macro, hence some device drivers use this. The reason for
changing the SYSCTL API was the need for a SYSCTL parent OID pointer
and not only the SYSCTL parent OID list pointer in order to quickly
generate the sysctl path. The motivation behind this patch is to avoid
parameter loading cludges inside the OFED driver subsystem. Instead of
adding special code to the OFED driver subsystem to post-load tunables
into dynamically created sysctls, we generalize this in the kernel.

Other changes:
- Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask"
to "hw.pcic.intr_mask".
- Removed redundant TUNABLE statements throughout the kernel.
- Some minor code rewrites in connection to removing not needed
TUNABLE statements.
- Added a missing SYSCTL_DECL().
- Wrapped two very long lines.
- Avoid malloc()/free() inside sysctl string handling, in case it is
called to initialize a sysctl from a tunable, hence malloc()/free() is
not ready when sysctls from the sysctl dataset are registered.
- Bumped FreeBSD version to indicate SYSCTL API change.

MFC after:	2 weeks
Sponsored by:	Mellanox Technologies
2014-06-27 16:33:43 +00:00
Kevin Lo
a080f71521 Remove D-Link DWA140 rev D1 by accident.
Pointed out by Anders Larsson in private email.
2014-06-05 01:55:23 +00:00
Hans Petter Selasky
bb03cd6fa1 More RSU fixes:
- Properly align temporary buffer to 32-bit.
- Add an extra parenthesis to make expression clear.
- Range check the association ID received from hardware.

MFC after:	1 week
2014-06-04 16:58:35 +00:00
Hans Petter Selasky
910593b55c Fixes for the RSU driver:
- The R92S_TCR register is an 8-bit register. Don't access it like a
16-bit register.
- Disable parsing the delete station event, due to many false events.
- Ensure that there is only one transfer queue for each endpoint, so
that packets transmitted don't get out of order.

MFC after:	1 week
2014-06-04 09:18:13 +00:00
Kevin Lo
26c79a7652 Remove r264317 by accident.
Spotted by:	Kuan-Chung Chiu
2014-05-27 01:47:23 +00:00
Hans Petter Selasky
1593e8754e - Give firmware loading more time.
MFC after:	3 days
2014-05-22 12:01:43 +00:00
Hans Petter Selasky
885476cb9a - Stop transfers when RSU init fails.
- Make sure TX/RX lists don't leak and are only allocated once.
- Fix off-by one transfer index computation.
- Give firmware loading more time.

MFC after:	3 days
2014-05-22 06:28:09 +00:00
Hans Petter Selasky
400b4e53bd - Split transmit queue into one for each type. Apparently there will
be a race when using a single active queue for all transmit types.
- Last argument of usb_pause_mtx() is ticks and not milliseconds.
- Remove unused watchdog.
- Remove some unused fields from the RSU softc structure.
- Workaround usbd_transfer_start() recursion from inside of completion
callback.

MFC after:	3 days
2014-05-21 16:52:55 +00:00
Hans Petter Selasky
302a703b5b Avoid starting a USB transfer inside the callback function, right
after its been submitted.

MFC after:	3 days
2014-05-21 06:23:52 +00:00
Hans Petter Selasky
aff6e94558 - The DELAY() should not be used in USB drivers.
- The usb_pause_mtx() function takes ticks and not milliseconds as last argument.

MFC after:	3 days
2014-05-20 15:53:17 +00:00
Hans Petter Selasky
b41381aea9 - The DELAY() should not be used in USB drivers.
- The usb_pause_mtx() function takes ticks and not milliseconds as last argument.

MFC after:	3 days
2014-05-20 15:47:37 +00:00
Hans Petter Selasky
7243077c9d Make sure detach code is executed in all cases. This fixes a panic
when debugging is enabled.

Reported by:	Idwer Vollering <vidwer@gmail.com>
MFC after:	3 days
2014-05-20 12:22:53 +00:00
Andreas Tobler
269aedcff5 Fix gcc build, initialize off variable. 2014-04-26 19:30:04 +00:00
Kevin Lo
11a4d354a2 Initialize rssi variable. 2014-04-26 14:39:58 +00:00
Kevin Lo
28bc7834e0 Add preliminary support for the Realtek RTL8188EUS and RTL8188ETV chipsets.
Committed over the TP-LINK TL-WN725N v2 (RTL8188EUS) on amd64 with WPA.
2014-04-25 08:01:22 +00:00
Kevin Lo
d0cc98c0b1 Fix panic by adding mtx_assert() to urtwn_init_locked() and
urtwn_stop_locked().

Tested by:	Anthony Jenkins <scoobi_doo at yahoo dot com>
2014-04-24 03:16:47 +00:00
Kevin Lo
ed8023f58b Add the Asus USB-N10 NANO.
Tested by:	Kuan-Chung Chiu <buganini@gmail.com>
2014-04-10 14:37:37 +00:00
Hans Petter Selasky
4ebc1ddf98 Add new USB ID.
Submitted by:	Tuomo Latto <djv+fbpr@iki.fi>
PR:		usb/188046
MFC after:	1 week
2014-04-01 10:34:39 +00:00
Kevin Lo
a275e26512 Reset the bit of the R92C_MCUFWDL associated with checksum report
before loading firmware page.  It may fix this problem:
"urtwn0: timeout waiting for checksum report"
2014-03-14 06:38:22 +00:00
Kevin Lo
9602062e96 Similar to r246614, fix panic on removing urtwn(4). It happens because
nodes are freed after the adapter is gone.
2014-03-14 06:37:08 +00:00
Kevin Lo
22584722c6 Fix a logic error when enabling MAC. 2014-03-06 06:39:55 +00:00
Hans Petter Selasky
44bf877e1a - Temporary fix for race in RUN driver which can
cause freed memory to be accessed.
- Properly lock callout_reset()'s.

MFC after:	1 week
2014-03-05 18:39:27 +00:00
Kevin Lo
5c5e99d273 Add a flag to run's device list which uses a standard scsi eject.
The flag indicates that the mcu doesn't need to load firmware.

Tested by:	Alex Deiter <alex dot deiter at gmail.com>, myself
Tested on:	ASUS USB-N66
2014-02-25 01:42:02 +00:00
Rui Paulo
a999ce6abf Add urtwn_start_locked() to avoid unlocking during TX. 2014-02-14 01:47:12 +00:00
Kevin Lo
c1033bd401 Correct setting R92C_TXAGC_MCS11_MCS08 register. 2014-02-05 08:09:02 +00:00
Hans Petter Selasky
198fc7c37f Fix a range check for maximum transmit length. The existing code was
off by 4 bytes in one case.

Approved by:	kevlo @
MFC after:	2 weeks
2014-01-31 22:42:26 +00:00
Kevin Lo
51fcfa2666 Fix comment. 2014-01-24 15:34:22 +00:00
Kevin Lo
56ae078529 Get rid of memmove(). It's not portable.
Tested on RT3071, RT3573, RT3570, RT3572, and RT5572.

Reviewed by:	hselasky
2014-01-24 09:17:29 +00:00
Hans Petter Selasky
2719d9c909 Revert r261014. Let Kevin fix it.
MFC after:	1 week
2014-01-23 10:18:28 +00:00
Hans Petter Selasky
2e74d8c857 - Fix some non-portable code with regard to endianness. Don't use memmove().
- Fix a range check for maximum transmit length.
- Fix read from missing field when transmitting data.

MFC after:	2 weeks
2014-01-22 09:57:26 +00:00
Kevin Lo
030dda5d1d Fix a logic error when checking if Tx power entries are greater than 31. 2014-01-11 14:48:16 +00:00
Kevin Lo
107f00c0b9 Use m_get2() instead of m_getcl().
Spotted by:	glebius
2014-01-10 14:47:20 +00:00
Kevin Lo
569dfed32c Use m_getcl() instead of MGETHDR/MCLGET macros.
Suggested by:	glebius
2014-01-10 02:47:20 +00:00
Kevin Lo
115ea7c105 Replace deprecated M_DONTWAIT with M_NOWAIT. 2014-01-09 01:48:33 +00:00
Kevin Lo
5945b5f5ab Rename definition of IEEE80211_FC1_WEP to IEEE80211_FC1_PROTECTED.
The origin of WEP comes from IEEE Std 802.11-1997 where it defines
whether the frame body of MAC frame has been encrypted using WEP
algorithm or not.
IEEE Std. 802.11-2007 changes WEP to Protected Frame, indicates
whether the frame is protected by a cryptographic encapsulation
algorithm.

Reviewed by:	adrian, rpaulo
2014-01-08 08:06:56 +00:00
Kevin Lo
7a7e01caa4 Add support for the MediaTek/Ralink RT3593 chipset.
Committed over the ZyXEL NWD2705 on amd64 with WPA.
2014-01-03 06:01:05 +00:00
Dimitry Andric
96106c9665 In sys/dev/usb/wlan/if_urtw.c, #if 0 a static const variable, which has
been unused since r198194.

MFC after:	3 days
2013-12-29 20:05:48 +00:00
Kevin Lo
959af34776 Add D-Link DWA-140 rev D1, another RT5372/run(4).
From Anton Mazunin.
2013-12-27 08:03:53 +00:00
Kevin Lo
7dc4b90e74 Some devices have a dual mode such as Tenda W326U and ZyXEL NWD2705,
add the product id and use a standard scsi eject.

Tested on the ZyXEL NWD2705 wlan dongle.
2013-12-24 07:02:05 +00:00
Kevin Lo
9df3ee0758 Use 'val' instead of 'val & 0xff' since the last argument of run_bbp_write()
is uint8_t.

Spotted by:	yongari
2013-12-18 08:53:40 +00:00
Kevin Lo
fd8fcee579 Fix style: add tab after #define. 2013-12-18 08:39:12 +00:00
Kevin Lo
c48c6bf8fc Fix typo in comment. 2013-12-18 07:47:50 +00:00
Kevin Lo
010b13fa94 Add support to IQ calibration. 2013-12-18 07:34:57 +00:00