Felix Fietkau [Thu, 16 Dec 2010 23:57:01 +0000 (00:57 +0100)]
ath9k_hw: remove baseband rfsilent support
When rfkill is enabled, ath9k_hw unnecessarily configured the baseband to
turn off based on GPIO input, however that code was hardcoded to GPIO 0
instead of ah->rfkill_gpio.
Since ath9k uses software rfkill anyway, this code is completely unnecessary
and should be removed in case anything else ever uses GPIO 0.
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Thu, 16 Dec 2010 23:57:00 +0000 (00:57 +0100)]
ath9k: fix queue depth check for forming new aggregates
To improve aggregation length, there should not be more than two fully formed
A-MPDU frames in the hardware queue. To ensure this, the code checks the tx
queue length before forming new A-MPDUs. This can reduce the throughput (or
maybe even starve out A-MPDU traffic) when too many non-aggregated frames are
in the queue.
Fix this by keeping track of pending A-MPDU frames (even when they're sent out
as single frames), but exclude rate control probing frames to improve
performance.
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Javier Cardona [Fri, 17 Dec 2010 01:23:34 +0000 (17:23 -0800)]
mac80211: Remove unused third address from mesh address extension header.
The Mesh Control header only includes 0, 1 or 2 addresses. If there is
one address, it should be interpreted as Address 4. If there are 2,
they are interpreted as Addresses 5 and 6 (Address 4 being the 4th
address in the 802.11 header).
The address extension used to hold up to 3 addresses instead of the current 2.
I'm not sure which draft version changed this, but it is very unlikely that it
will change again given the state of the approval process of this draft. See
section 7.1.3.6.3 in current draft (8.0).
Also, note that the extra address that I'm removing was not being used, so this
change has no effect on over-the-air frame formats. But I thought I better
remove it before someone does start using it.
Signed-off-by: Javier Cardona <javier@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Bruno Randolf [Thu, 16 Dec 2010 02:30:22 +0000 (11:30 +0900)]
cfg80211: Separate available antennas for RX and TX
As has been pointed out by Daniel Halperin some devices (e.g. Intel IWL5100)
can only TX from a subset of RX antennas, so use separate availability masks
for RX and TX.
Signed-off-by: Bruno Randolf <br1@einfach.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Javier Cardona [Fri, 17 Dec 2010 01:37:50 +0000 (17:37 -0800)]
mac80211: Send mesh non-HWMP path selection frames to userspace
Let path selection frames for protocols other than HWMP be sent to
userspace via NL80211_CMD_REGISTER_FRAME. Also allow userspace to send
and receive mesh path selection frames.
Signed-off-by: Javier Cardona <javier@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Javier Cardona [Fri, 17 Dec 2010 01:37:49 +0000 (17:37 -0800)]
mac80211: Let userspace enable and configure vendor specific path selection.
Userspace will now be allowed to toggle between the default path
selection algorithm (HWMP, implemented in the kernel), and a vendor
specific alternative. Also in the same patch, allow userspace to add
information elements to mesh beacons. This is accordance with the
Extensible Path Selection Framework specified in version 7.0 of the
802.11s draft.
Signed-off-by: Javier Cardona <javier@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Javier Cardona [Fri, 17 Dec 2010 01:37:48 +0000 (17:37 -0800)]
mac80211: Rename mesh_params to mesh_config to prepare for mesh_setup
Mesh parameters can be to setup a mesh or to configure it.
This patch renames the ambiguous name mesh_params to mesh_config
in preparation for mesh_setup.
Signed-off-by: Javier Cardona <javier@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Bruno Randolf [Thu, 16 Dec 2010 07:22:20 +0000 (16:22 +0900)]
ath5k: Fix survey
The old survey implementation was broken and returned nonsense data.
Clear cycle counters and survey data on reset. Since the cycle counters easily
overflow it's better to keep a local version of collected survey data (in ms
resolution, instead of clockrate) and update this every time survey is
retrieved. If survey is retrieved often enough to avoid cycle counter overflows
this works fine, otherwise we could update survey more often, like ath9k does.
Still only the survey for the current channel is kept.
Signed-off-by: Bruno Randolf <br1@einfach.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Larry Finger [Thu, 16 Dec 2010 04:55:34 +0000 (22:55 -0600)]
rtl8192ce: Fix build on powerpc
After merge of the rtl8192ce driver, a powerpc build fails with:
drivers/net/wireless/rtlwifi/rtl8192ce/rtl8192c-sw.c: In function 'rtl92c_init_sw_vars':
drivers/net/wireless/rtlwifi/rtl8192ce/rtl8192c-sw.c:76: error: implicit declaration of function 'vmalloc'
drivers/net/wireless/rtlwifi/rtl8192ce/rtl8192c-sw.c:76: warning: cast to pointer from integer of different size
drivers/net/wireless/rtlwifi/rtl8192ce/rtl8192c-sw.c: In function 'rtl92c_deinit_sw_vars':
drivers/net/wireless/rtlwifi/rtl8192ce/rtl8192c-sw.c:91: error: implicit declaration of function 'vfree'
The problem is fixed by explicitly including the appropriate header.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
ath: fix NULL pointer dereference on reg_notifier()
The reg_notifier() was recently updated as being capable of
having the request passed as NULL, fix ath to follow this API
change. Without this we end up oopsing:
cfg80211: fix null pointer dereference with a custom regulatory request
Once we moved the core regulatory request to the queue and let
the scheduler process it last_request will have been left NULL
until the schedular decides to process the first request. When
this happens and we are loading a driver with a custom regulatory
request like all Atheros drivers we end up with a NULL pointer
dereference. We fix this by checking if the request was a
custom one.
Reported-by: Sujith Manoharan <Sujith.Manoharan@atheros.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Jouni Malinen [Wed, 15 Dec 2010 22:52:40 +0000 (00:52 +0200)]
nl80211: Add notification for dropped Deauth/Disassoc
Add a new notification to indicate that a received, unprotected
Deauthentication or Disassociation frame was dropped due to
management frame protection being in use. This notification is
needed to allow user space (e.g., wpa_supplicant) to implement
SA Query procedure to recover from association state mismatch
between an AP and STA.
This is needed to avoid getting stuck in non-working state when MFP
(IEEE 802.11w) is used and a protected Deauthentication or
Disassociation frame is dropped for any reason. After that, the
station would silently discard any unprotected Deauthentication or
Disassociation frame that could be indicating that the AP does not
have association for the STA (when the Reason Code would be 6 or 7).
IEEE Std 802.11w-2009, 11.13 describes this recovery mechanism.
Signed-off-by: Jouni Malinen <j@w1.fi> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sedat Dilek [Thu, 16 Dec 2010 11:46:23 +0000 (12:46 +0100)]
iwlwifi: Fix error: struct iwl_lq_sta has no member named dbg_fixed_rate
While compiling linux-next (next-20101216) I fell over this breakage:
...
drivers/net/wireless/iwlwifi/iwl-agn-rs.c: In function ‘iwl_rs_rate_init’:
drivers/net/wireless/iwlwifi/iwl-agn-rs.c:2876:8: error: ‘struct iwl_lq_sta’ has no member named ‘dbg_fixed_rate’
dbg_fixed_rate is only used when CONFIG_MAC80211_DEBUGFS is set:
Sujith Manoharan [Wed, 15 Dec 2010 02:17:10 +0000 (07:47 +0530)]
mac80211: Add timeout to BA session start API
Allow drivers or rate control algorithms to specify BlockAck session
timeout when initiating an ADDBA transaction. This is useful in cases
where maintaining persistent BA sessions does not incur any overhead.
The current timeout value of 5000 TUs is retained for all non ath9k/ath9k_htc
drivers.
Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com> Reviewed-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Tue, 14 Dec 2010 16:54:28 +0000 (17:54 +0100)]
nl80211: advertise maximum remain-on-channel duration
With the upcoming hardware offload implementation,
some devices will have a different maximum duration
for the remain-on-channel command. Advertise the
maximum duration in mac80211, and make mac80211 set
it.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Wey-Yi Guy [Tue, 14 Dec 2010 15:38:58 +0000 (07:38 -0800)]
iwlagn: fix witespace damage
patch "iwlagn: check ready in iwlagn_bss_info_changed()" introduce
whitespace, fix it
please merge with the previous patch
Reported by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This patch allows the pm-qos value to be user configurable by making it as
a module parameter.This will help our customers to configure the pm-qos
value according to the effect in throughput due to the DMA latency problem
which was observed in Intel Pinetrail platforms.
The tested value of '55' will be filled as the default
pm-qos-value incase the user does not specifies pm-qos value as a
module parameter.
example usage: sudo modprobe ath9k pmqos=65
Cc: Senthilkumar Balasubramanian <Senthilkumar.Balasubramanian@Atheros.com> Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Juuso Oikarinen [Mon, 13 Dec 2010 07:52:37 +0000 (09:52 +0200)]
wl12xx: Change TX queue to be per AC
With the current single-queue implementation traffic priorization is not
working correctly - when using multiple BE streams and one, say VI stream,
the VI stream will share bandwidth almost equally with the BE streams.
To fix the issue, implement per AC queues, which are emptied in priority
order to the firmware. To keep it relatively simple, maintain a global
buffer count and global queue stop/wake instead of per-AC.
With these changes, priorization appears to work just fine.
Eliad Peller [Sun, 12 Dec 2010 10:15:35 +0000 (12:15 +0200)]
wl12xx: allow runtime changing of debug_level
Currently, the debug level is set in compilation time (by the DEBUG_LEVEL
const). This method has the advantage of compiling only the relevant
messages, while optimizing out the unused ones.
In order to allow runtime control over the debug_level, while optimizing
out messages when debug messages are not needed, we combine some methods:
1. use dynamic_debug (pr_debug) rather then printk.
2. add debug_level module param in order to set debug level during insmod.
3. add debug_level sysfs file in order to allow dynamic control over the
debug level.
Since patches for pr_debug_hex_dump() implementation haven't been applied yet,
we are still temporarly using print_hex_dump().
Guy Eilam [Thu, 9 Dec 2010 14:54:59 +0000 (16:54 +0200)]
wl1271: fixed problem with WPS IEs in probe requests
Inclusion of a WPS IE in probe requests caused a problem
in the driver due to the maximum size of the probe request
template and the max_scan_ie_len values at initialization.
Increased the size of probe request template
to the maximum size allowed by the firmware.
Struct wl12xx_probe_req_template, which was only used
for calculating the max size of the probe request template,
is no longer used and needed.
max_scan_ie_len is used for validating the size of
additional IEs in scan requests.
Initialized the max_scan_ie_len field to the maximum size
of the probe request template minus the ieee80211 header size.
Signed-off-by: Guy Eilam <guy@wizery.com> Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Roger Quadros [Wed, 1 Dec 2010 09:58:54 +0000 (11:58 +0200)]
wl1271_sdio_test: Add module for sdio RX/TX testing
This module enables individually generating RX and TX traffic
over the SDIO bus on which the WL1271 chipset is connected.
This is required to perform RF interference testing.
The module takes 2 module parameters 'rx' and 'tx'.
To generate RX traffic:
modprobe wl1271_sdio_test rx=1
To generate TX traffic:
modprobe wl1271_sdio_test tx=1
To generate both RX & TX traffic, set both rx and tx to 1.
You can change the testing configuration at runtime by changing
the rx & tx values at /sys/modules/wl1271_sdio_test/
To stop testing simply unload the module.
Signed-off-by: Roger Quadros <roger.quadros@nokia.com> Reviewed-by: Carlos Chinea <carlos.chinea@nokia.com> Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Luciano Coelho [Fri, 3 Dec 2010 15:05:40 +0000 (17:05 +0200)]
wl12xx: disable 11a channels when wl->enable_11a is known
Disabling the 11a channels when not supported in the reg_notify function was
not working as it should, because when the driver is initiailizing (and
registering itself with mac80211), it would get the reg notification too
early. At that point the driver wouldn't have received the NVS yet, so it
wouldn't know whether 11a was supported.
To fix this, we disable 11a channels when we read the NVS instead. Also, it
is easier (and still safe) to set n_channels to zero instead of setting the
disabled flag on every 11a channel.
Eduardo Costa [Tue, 14 Dec 2010 20:37:59 +0000 (14:37 -0600)]
p54usb: New USB ID for Gemtek WUBI-100GW
This USB ID is for the WUBI-100GW 802.11g Wireless LAN USB Device that
uses p54usb.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Eduardo Costa <ecosta.tmp@gmail.com> Cc: Stable <stable@kernel.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Wey-Yi Guy [Wed, 8 Dec 2010 15:51:50 +0000 (07:51 -0800)]
iwlagn: code clean up to remove duplicate code
Multiple devices use almost the same .cfg with minor differences.
Use macro and remove the duplication. By doing this, reduce
the chance for mistake while modify .cfg parameters
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Wey-Yi Guy [Tue, 7 Dec 2010 16:06:31 +0000 (08:06 -0800)]
iwlwifi: do not reload fw if WiMAX own the RF
For WiFi/WiMAX combo devices, if WiMAX own the RF, WiFi driver
try to access RF and fail. This is the W/A to To avoid WiFi keep
reloading firmware and try to access RF again.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Johannes Berg [Thu, 9 Dec 2010 20:56:42 +0000 (12:56 -0800)]
iwlagn: remove old EEPROM TX power reading
This removes the old TX power reading code, it isn't
necessary since the new code is able to read all the
various EEPROM layouts due to relying on information
contained in the EEPROM.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Johannes Berg [Thu, 9 Dec 2010 17:30:14 +0000 (09:30 -0800)]
iwlagn: implement layout-agnostic EEPROM reading
The current EEPROM reading code has some layout
assumptions that now turned out to be false with
some newer versions of the EEPROM. Luckily, we
can avoid all such assumptions by using data in
the EEPROM itself, so implement using that.
However, for risk mitigation purposes, keep the
old reading code for current hardware for now.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Johannes Berg [Tue, 30 Nov 2010 19:03:44 +0000 (11:03 -0800)]
iwlagn: rename enhanced txpower fields
Some fields we didn't previously use from the
enhanced TX power structure will be needed in
the next patch, so rename them to their correct
names to be able to use them and change code
reading them accordingly.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Wey-Yi Guy [Mon, 6 Dec 2010 19:51:39 +0000 (11:51 -0800)]
iwlagn: rx antenna diversity
For the new 1x1 devices, hw and uCode will support rx
antenna diversity, but we need to indicate 1x1 device to
AccessPoint to make sure it won't use MIMO.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Johannes Berg [Tue, 30 Nov 2010 21:24:36 +0000 (13:24 -0800)]
iwlagn: fix debug variable access
The compiler correctly warns:
iwl-agn-tx.c: In function ‘iwlagn_tx_status_reply_compressed_ba’:
iwl-agn-tx.c:1240: warning: ‘bitmap’ may be used uninitialized in this function
Move the debug print to the branch that reads the
bitmap, and move the variables too so it's more
obvious where they are needed.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Shanyu Zhao [Thu, 2 Dec 2010 19:02:28 +0000 (11:02 -0800)]
iwlagn: check ready in iwlagn_bss_info_changed()
In function iwlagn_bss_info_changed(), we need to check if the driver
is ready before doing real work. Also, the previously put WARN() is
removed because the vif is not guaranteed to be valid. uCode restart
routine will clear the vif.
Signed-off-by: Shanyu Zhao <shanyu.zhao@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Wolfgang Kufner [Mon, 13 Dec 2010 11:39:39 +0000 (12:39 +0100)]
rt2x00: Fix firmware loading regression on x86_64.
Commit 6175ddf06b6172046a329e3abfd9c901a43efd2e changes the way
memcpy_toio() works for x86_64, causing firmware loading to fail for
some Ralink WLAN devices with the rt2800pci driver since linux 2.6.34.
This causes the log message: "phy0 -> rt2800pci_load_firmware: Error -
PBF system register not ready.".
Fix this by using __iowrite32_copy instead of memcpy_toio().
Signed-off-by: Wolfgang Kufner <wolfgang.kufner@gmail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Wolfgang Kufner [Mon, 13 Dec 2010 11:39:12 +0000 (12:39 +0100)]
rt2x00: Pad beacon to multiple of 32 bits.
Pad beacon to a multiple of 32 bits in preparation for the change
from memcpy_toio() to __iowrite32_copy() in register_multiwrite().
Signed-off-by: Wolfgang Kufner <wolfgang.kufner@gmail.com> Acked-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
The stray semicolon after DEBUG_PRINTK_MSG causes things
like "if (...) WARNING(...); else {}" to fail with syntax error.
Signed-off-by: Johannes Stezenbach <js@sig21.net> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Ivo van Doorn [Mon, 13 Dec 2010 11:36:18 +0000 (12:36 +0100)]
rt2x00: Introduce extra queue entry sanity flag
Add a queue entry flag ENTRY_DATA_STATUS_PENDING,
which can be used to indicate a queue entry has
returned from the hardware and is waiting for
status processing. Using this flag we can add
some extra sanity checks to prevent queue corruption.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Acked-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Ivo van Doorn [Mon, 13 Dec 2010 11:36:00 +0000 (12:36 +0100)]
rt2x00: Cleanup RX index counting
Add the rt2x00_dmastart function to rt2x00lib which
marks the queue_entry as "owned by device", and increased
the Q_INDEX number.
This cleanups up the index handling by rt2x00lib which
at until so far used hackish approaches to keep the
RX queue index numbering sane.
The rt2x00pci.c changes are from Helmut Schaa
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Ivo van Doorn [Mon, 13 Dec 2010 11:35:40 +0000 (12:35 +0100)]
rt2x00: Add "flush" queue command
Add a new command to the queue handlers: "flush",
this moves the flush() callback from mac80211
into rt2x00queue and adds support for flushing
the RX queue as well.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Acked-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Ivo van Doorn [Mon, 13 Dec 2010 11:34:54 +0000 (12:34 +0100)]
rt2x00: Reorganize queue callback functions
As part of the queue refactoring, change the queue callback
function names to have 3 different actions: start, kick & stop.
We can now also remove the STATE_RADIO_RX_ON/STATE_RADIO_RX_OFF
device_state flags, and replace the usage with using the
start_queue/stop_queue callback functions.
This streamlines the RX queue handling to the
similar approach as all other queues.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Acked-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Ivo van Doorn [Mon, 13 Dec 2010 11:34:22 +0000 (12:34 +0100)]
rt2x00: Introduce 3 queue commands in drivers (start, kick, stop).
As part of the queue refactoring, we now introduce
3 queue commands: start, kick, stop.
- Start: will enable a queue, for TX this will
not mean anything, while for beacons and RX
this will update the registers to enable the queue.
- Kick: This will kick all pending frames to
the hardware. This is needed for the TX queue
to push all frames to the HW after the queue
has been started
- Stop: This will stop the queue in the hardware,
and cancel any pending work (So this doesn't
mean the queue is empty after a stop!).
Move all code from the drivers into the appropriate
functions, and link those calls to the old rt2x00lib
callback functions (we will fix this later when we
refactor the queue control inside rt2x00lib).
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Acked-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Johannes Stezenbach <js@sig21.net> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Helmut Schaa [Mon, 13 Dec 2010 11:33:36 +0000 (12:33 +0100)]
rt2x00: Don't frequently reset beacon interval in AdHoc mode
Commit 0204464329c17ba6d293e1899f71223599a0e582 "Check for specific changed
flags when updating the erp config" changed the way in which a new beacon
interval gets handled. However, due to a bug in rt2800usb and rt2800pci the
beacon interval was reset during each scan, thus causing problems in AdHoc
mode.
Fix this by not cleaning up the beacon interval when killing the beacon queue
but just prevent the device from sending out beacons.
Reported-by: Wolfgang Kufner <wolfgang.kufner@gmail.com> Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
rt2x00: Ensure TX-ed frames are returned in the original state.
Recent changes to the TX-done code of rt2x00 resulted in TX-ed frames not
being returned to mac80211 in the original state, and therefore with
insufficient headroom for re-transmissions.
Fix this by reverting the changes done and by ensuring we remove the inserted
L2pad by moving the header backwards instead of the data forwards.
At the same time also make sure that the rt2x00queue_remove_l2pad will not
move any memory when a frame has no data at all.
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com> Acked-by: Helmut Schaa <helmut.schaa@googlemail.com> Cc: Jay Hung <Jay_Hung@ralinktech.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
rt2x00: fix hang when unplugging USB device in use
When an rt2x00 USB device is unplugged while in use, it reliably
hangs the whole system. After some time the watchdog prints:
BUG: soft lockup - CPU#0 stuck for 64s! [kworker/u:0:5]
...
[<c01a88d8>] (usb_submit_urb+0x0/0x2ac) from [<bf0e752c>] (rt2x00usb_kick_rx_entry+0xb4/0xe8 [rt2x00usb])
[<bf0e7478>] (rt2x00usb_kick_rx_entry+0x0/0xe8 [rt2x00usb]) from [<bf0e7588>] (rt2x00usb_clear_entry+x28/0x2c [rt2x00usb])
[<bf0e7560>] (rt2x00usb_clear_entry+0x0/0x2c [rt2x00usb]) from [<bf0d5bc4>] (rt2x00lib_rxdone+0x2e0/0x2f8 [rt2x00lib])
[<bf0d58e4>] (rt2x00lib_rxdone+0x0/0x2f8 [rt2x00lib]) from [<bf0e7e00>] (rt2x00usb_work_rxdone+0x54/0x74 [rt2x00usb])
[<bf0e7dac>] (rt2x00usb_work_rxdone+0x0/0x74 [rt2x00usb]) from [<c00542b4>] (process_one_work+0x20c/0x35c)
Clear the DEVICE_STATE_PRESENT flag when usb_submit_urb()
returns -ENODEV to fix this.
Signed-off-by: Johannes Stezenbach <js@sig21.net> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
RA-Jay Hung [Mon, 13 Dec 2010 11:32:22 +0000 (12:32 +0100)]
rt2x00: Add RF chip definition
Add RF chip definition
Signed-off-by: RA-Jay Hung <jay_hung@ralinktech.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Helmut Schaa [Mon, 13 Dec 2010 11:31:58 +0000 (12:31 +0100)]
rt2x00: Implement get_survey callback for rt2800
Implement the get_survey callback to allow user space to read statistics
about the current channel condition.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
RA-Jay Hung [Mon, 13 Dec 2010 11:31:27 +0000 (12:31 +0100)]
rt2x00: Add rt2800 EEPROM definition
Add and modify NIC Configuration and LED definition of EEPROM
Signed-off-by: RA-Jay Hung <jay_hung@ralinktech.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Mon, 13 Dec 2010 07:40:54 +0000 (08:40 +0100)]
ath9k_hw: fix PA predistortion training power selection
The EEPROM contains scale factors for the tx power, which define
the range of allowable difference between target power and training
power. If the difference is too big, PA predistortion cannot be used.
For 2.4 GHz there is only one scale factor, for 5 GHz there are
three, depending on the specific frequency range.
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Mon, 13 Dec 2010 07:40:53 +0000 (08:40 +0100)]
ath9k_hw: fix the PA predistortion rate mask
The EEPROM PAPRD rate mask fields only contain mask values for actual
rates in the low 25 bits. The upper bits are reserved for tx power
scale values. Add the proper mask definitions and use them before
writing the values to the register.
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Mon, 13 Dec 2010 07:40:52 +0000 (08:40 +0100)]
ath9k: fix PA predistortion thermal measurement handling
To be able to measure the thermal values correctly for PAPRD, we need
to send training frames before setting up the gain table for the measurement,
and then again afterwards for the actual training.
For further improvement, send training frames at MCS0 instead of 54 MBit/s
legacy. That way we can use the No-ACK flag for the transmission, which
speeds up PAPRD training in general, as the hardware won't have to
retransmit and wait for ACK timeout (was previously set to 4 * 6
transmission attempts).
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Mon, 13 Dec 2010 07:40:51 +0000 (08:40 +0100)]
ath9k_hw: fix the slot time setting for long distance links
Testing shows that adjusting the slot time based on the coverage class
produces very high latencies and very low throughput on long distance links.
Adjusting only the ACK timeout and leaving the slot time at the regular
values - while technically not optimal for CSMA - works a lot better on
long links (tested with 10 km distance)
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Mon, 13 Dec 2010 07:40:50 +0000 (08:40 +0100)]
ath9k_hw: initialize ah->slottime
(u32) -1 is not particularly useful as a slottime default, so even though
the ath9k_hw default should never get used, it's better to pick something
sane here.
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Sat, 11 Dec 2010 23:51:11 +0000 (00:51 +0100)]
ath9k_hw: remove antenna configuration eeprom ops and variables
AR9280 based hardware with 3 antennas and slow antenna diversity has
not been seen in the wild and ath9k does not support that form of
antenna diversity, so remove the EEPROM ops for it.
These EEPROM ops are currently only used for setting the
AR_PHY_SWITCH_COM register, which is being done in the EEPROM specific
file already.
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Fri, 10 Dec 2010 20:16:46 +0000 (21:16 +0100)]
ath9k: fix sequence number assigment for non-AMPDU QoS data frames
wireless-testing commit 04caf863750bc7e042d1e8d57e5ce9d6326ab435
('ath9k: more tx setup cleanups') merged tx path code for HT vs
non-HT frames, however it did not pass the tid pointer to
ath_tx_send_normal, causing an inconsistency between AMPDU vs
non-AMPDU sequence number handling.
Fix this by always passing in the tid pointer for all QoS data frames.
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
The 802.11 spec states that the STA that generated the last Beacon frame shall
be the STA that response to a probe request. This is important for congestion
reduction when a probe request is received - only 1 node in an adhoc BSS
will transmit a response. While mac80211 drivers should provide the
tx_last_beacon function to report if they transmitted the last beacon many
do not. As an attempt to reduce probe response congestion default this
to 0 such that a node not implementing this capability does not contribute
to unnecessary congestion.
In a modern medium sized office environment I see upwards of 100 probe
requests per second received at a given node from various hardware/OS/drivers
doing zeroconf 'active probing' as opposed to passively listening for beacons.
With a modest 10-node adhoc network consisting of drivers that do not implement
this tx_last_beacon feature, I have seen this result in the simultaneous xmit
of probe responses accumulating to 500 probe responses per second because of
collisions which brings the adhoc network to its knees as well as causes
needless congestion.
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Rafał Miłecki [Thu, 9 Dec 2010 19:56:01 +0000 (20:56 +0100)]
b43: rename TMS defines, drop useless condition from core reset
As discussed we do not know band width at core reset time and it is not a good
idea to reset whole just to change band. So just set unconditionally 20 MHz
band width as default during core reset.
As for defines PHY clock changed to band width in specs and it makes much more
sens to call defines by band width which is self-explainable. Updated specs do
not mention 0 value, but comparing to old ones you can notice lineral relation
between PHY clock speed and band width. So it makes sense for 0x0 value to be
10 MHz band width.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>