This fixes some locking w.r.t. the lower MAC (firmware).
It also removes a lot of ancient IRQ-locking that's not needed anymore.
We simply suspend the MAC. That's easier and causes less trouble.
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This patch removes unused parameter and unused local variable in
methods in iwl-tx.c:
- Remove a parameter (is_unicast) from iwl_tx_cmd_build_basic().
- Remove an unused variable name unicast from iwl_tx_skb().
Signed-off-by: Rami Rosen <ramirose@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
The RX code in ath9k uses sc_keymap to figure out whether a default
key was used. However, the default key entries in sc_keymap were
always set and as such, frames could have been claimed to be decrypted
by hardware when they were not. This can cause problems especially
with TKIP since mac80211 is validating the Michael MIC in the frame
and this will result in MIC failure and potentially TKIP
countermeasures if the frame was not decrypted correctly.
Change key cache slot allocation to mark only the keys that really
have been used in sc_keymap to avoid the issue. The key cache slot
selection routines are now internally avoiding the slots that may be
needed for TKIP group keys.
Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
ath_reserve_key_cache_slot() was obviously supposed to return an index
to a free slot, not reserved one. This could have caused problems with
hardware revisions that use splitmic.
Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This should fix the timeout issues seen when using wpa_supplicant.
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This patch fixes a serious regression (introduced by:
"p54: fix memory management")
that affected isl3886+net2280 usb devices operation.
Signed-off-by: Christian Lamparter <chunkeey@web.de>
Tested-by: Artur Skawina <art.08.09@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Enhance allocation of key cache entries to support multiple pairwise
keys to fix AP mode with more than one associated STA.
Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
It looks like mac80211 may try to send unicast frames to a STA that
does not have a STA entry. We need to make sure that that is caught in
the rate control code before dereferencing STA data.
Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
The patch checks if the radio is disabled before displaying the tx power
level. Previously when the txpower was set off show_tx_power still
returned the prior power level. Now it will indicate the power has been
turned off.
Signed-off-by: Jay Sternberg <jay.e.sternberg@linux.intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Previously we allocate Rx SKB with GFP_ATOMIC flag. This is because we need
to hold a spinlock to protect the two rx_used and rx_free lists operation
in the rxq.
spin_lock();
...
element = rxq->rx_used.next;
element->skb = alloc_skb(..., GFP_ATOMIC);
list_del(element);
list_add_tail(&element->list, &rxq->rx_free);
...
spin_unlock();
After spliting the rx_used delete and rx_free insert into two operations,
we don't require the skb allocation in an atomic context any more (the
function itself is scheduled in a workqueue).
spin_lock();
...
element = rxq->rx_used.next;
list_del(element);
...
spin_unlock();
...
element->skb = alloc_skb(..., GFP_KERNEL);
...
spin_lock()
...
list_add_tail(&element->list, &rxq->rx_free);
...
spin_unlock();
This patch should fix the "iwlagn: Can not allocate SKB buffers" warning
we see recently.
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Acked-by: Tomas Winkler <tomas.winkler@intel.com>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Rename vars in _iwl_poll_bit() to better reflect the truth.
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
The patch removes some useless goto in code cleanup.
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This enables one to change the debug level at bit 31.
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Bring up-to-date some comments on the location of debug files.
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Acked-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This adds line feed to printk.
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
The patch removes unused definition and moves code to proper places.
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This patch removes a parameter (dest) from iwl_fill_beacon_frame() (iwl-agn.c)
and from iwl3945_fill_beacon_frame(). (iwl-3945.c,iwl-3945.h)
Signed-off-by: Rami Rosen <ramirose@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This patch makes sure the rate control alg is registered/unregistered
only once for this module.
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This patch does pci_dma_sync_single_for_cpu() before accessing
the header of the frame and queueing the same buffer into h/w.
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Remove the possible MAC header pad before reporting TX status to
mac80211. This pad is hardware specific operation and should not be
exposed outside the driver. This fixes the frame body in monitor
interfaces that could be used to check on TX status for transmitted
frames.
Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
The count field in struct ieee80211_tx_rate does not include the final
successful attempt, so only report retries here.
Fix the struct ieee80211_tx_rate::idx field when MCS was used. It is
supposed to be the MCS index, not an internal index to the rate
control algorithm table.
Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Reported-by: Hin-Tak Leung <htl10@users.sourceforge.net>
After the code was modified to use urb anchors ("rtl8187: Use usb anchor
facilities to manage urbs"), rtl8187 began generating an intermittent GPF
on shutdown when using SLUB with debugging enabled. Furthermore, rebooting
the system with a ping running caused a GPF every time. There are two problems:
(1) incorrect locking in the rtl8187_rx_cb() routine, a pre-existing bug that
apparently had not been triggered before, and (2) duplicate freeing of receive
skbs that was probably introduced with the change to anchors.
Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Tested-by: Hin-Tak Leung <htl10@users.sourceforge.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This patch simplifies the tx code a bit and will be necessary for
the upcoming stlc45xx<->p54 port.
In detail: we no longer have to tell all back-end drivers directly,
if we want to free a frame right after it was send to the firmware,
or if we do it in the library callback later.
Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This patch replaces the static rssi auto calibration data
with more precise values out of the device's eeprom.
Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
There are two places in the rtl8187 code where a routine was returning zero
(OK) when it should have been returning an error.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Acked-by: Hin-Tak Leung <htl10@users.sourceforge.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This patch moves a good chunk of code from the former statistic update
timer routine into a workqueue, which is kindly provided by mac80211.
Also as a nice side-effect we can lay the foundation for other
essential housekeeping features we want to do in the future.
e.g:
- drain the (clogged) tx_queue.
- initiate bursts.
Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Rate scaling in agn can be broken because of these two problems
1- the LQ command could not sent, we try to call LQ command before
post association will be rejected, this will cause the driver to
break in rs_tx_status reporting initial rate does not match.
2- In rs_rate_init we can get a value of 12, rate 60, for
last_txrate_idx, this rate only valid in SISO/MIMO mode only
Signed-off-by: Mohamed Abbas <mohamed.abbas@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Padding the 802.11 header to a multiple of 4 bytes needs to be done only for
frames with a body. This fixes a bug where 2 bytes were missing in monitor
mode for ACK frames. Inspired by a patch from Jouni Malinen on ath9k.
Ref: http://bugzilla.kernel.org/show_bug.cgi?id=12101 :
Signed-off-by: Benoit Papillault <benoit.papillault@free.fr>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Fix and clean up the RX status reporting by getting rid of code that
used internal rate tables and ratekbps calculation. The correct value
is now reported with MCS index instead of the old mechanism that
defaulted to using the highest legacy rate.
Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Now that HT information is made available to the driver through
config() callback, the channel type can be calculated whenever
setting the channel. Update the rate table accordingly with the new
channel type.
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
HT management is done differently for AP and STA modes, unify
to just the ->config() callback since HT is fundamentally a
PHY property and cannot be per-BSS.
Rename enum nl80211_sec_chan_offset as nl80211_channel_type to denote
the channel type ( NO_HT, HT20, HT40+, HT40- ).
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
| commit 3d29b0c33d
| Author: John W. Linville <linville@tuxdriver.com>
| Date: Fri Oct 31 14:13:12 2008 -0400
|
| netdevice zd1201: Convert directly reference of netdev->priv to netdev_priv()
|
| We have some reasons to kill netdev->priv:
| 1. netdev->priv is equal to netdev_priv().
| 2. netdev_priv() wraps the calculation of netdev->priv's offset, obviously
| netdev_priv() is more flexible than netdev->priv.
| But we cann't kill netdev->priv, because so many drivers reference to it
| directly.
|
| OK, becasue Dave S. Miller said, "every direct netdev->priv usage is a bug",
| and I want to kill netdev->priv later, I decided to convert all the direct
| reference of netdev->priv first.
|
| (Original patch posted by Wang Chen <wangchen@cn.fujitsu.com> w/ above
| changelog but using dev->ml_priv. That doesn't seem appropriate
| to me for this driver, so I've revamped it to use netdev_priv()
| instead. -- JWL)
This commit changed the allocation of netdev, but didn't change
the free method of it.
This causes "zd" be used after the memory, which is pointed by "zd", being
freed by free_netdev().
Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This patch removes 4965 from common uCode API structures. Also updates
iwlagn commands with 3945 specific RX command in preparation for 3945 port.
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This patch removes includes of iwl-helpers.h where not needed
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Remove clip_groups from priv and related structure.
This code is for 3945 only and was renamed to 4965 in
when code was split.
Also remove unused RATE definitions
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This patch take care of coming out rfkill when the driver is up while
rfkill is on by restarting interface.
Signed-off-by: Mohamed Abbas <mohamed.abbas@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
The patch replaces the current reading EEPROM loop iterations with
iwl_poll_direct_bit(). It also fixes some comment error.
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
The 802.11 header is only padded to 32-bit boundary when the frame has
a non-zero length payload. In other words, control frames (e.g., ACK)
do not have a padding and we should not try to remove it. This fixes
monitor mode for short control frames. In addition, the hdrlen&3 use
is described in more detail to make it easier to understand how the
padding length is calculated.
Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This patch fixes the following build warning when CONFIG_IWLWIFI_DEBUG
is not set.
/work/src/wireless-testing/drivers/net/wireless/iwlwifi/iwl-rx.c:758:
warning: 'iwl_dbg_report_frame' defined but not used
Signed-off-by: Rami Rosen <ramirose@gmail.com>
Acked-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This patch adds the ability to change the number of probe response retries sent
by the mesh interface.
In dense networks it is recommended to change this value to zero to reduce
traffic congestion.
Signed-off-by: Anna Neal <anna@cozybit.com>
Signed-off-by: Andrey Yurovsky <andrey@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Split ath_softc into smaller structures for rx, tx and beacon
handling.
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This patch fixes an oops when the devices suddenly starts
to receive martian data frames.
bug reference:
http://marc.info/?l=linux-wireless&m=122872280317635&w=2
Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
AP mode operations are seriously affected if mac80211 runs through a
multi-second scan while the AP is trying to send Beacon frames on the
operation channel. While this could be implemented in a way that does
not cause too many problems, it is not very simple and will require
synchronization with Beacon frame scheduling in the drivers (scan one
channel at a time between Beacon frames). Furthermore, such scanning
takes quite a bit longer time and existing userspace applications
would be likely to timeout while waiting for the results.
For now, just refuse requests for new scans (SIOCSIWSCAN) when in AP
mode. In practice, this moves the rejection from iwl* drivers into
mac80211 to make it apply to every mac80211-based driver.
This issue shows up in associated stations getting disconnected when
something (e.g., Network Manager) requests a scan while the interface
is in AP mode. When doing this continuously (e.g., NM does it every 120
seconds), the network gets close to useless.
Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This patch fixes sporadic firmware restarts when scanning while associated.
The firmware will quietly cancel a scan (while associated) if the dwell time
for a channel to be scanned is larger than the time it may stay away from the
operating channel (because of DTIM catching). Unfortunately the driver is not
notified about the canceled scan and therefore the scan watchdog timeout will
be hit and the driver causes a firmware restart which results in
disassociation. This mainly happens on passive channels which use a dwell time
of 120 whereas a typical beacon interval is around 100.
The patch changes the dwell time for passive channels to be slightly smaller
than the actual beacon interval to work around the firmware issue. Furthermore
the number of allowed beacon misses is increased from one to three as otherwise
most scans (while associated) won't complete successfully.
However scanning while associated will still fail in corner cases such as a
beacon intervals below 30.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
When SLUB debugging is enabled in the kernel, and the boot command includes
the option "slub_debug=P", rtl8187 encounters a GPF due to a read-after-free
of a urb.
Following the example of changes in p54usb to fix the same problem, the code
has been modified to use the usb_anchor_urb() method. With this change, the
USB core handles the freeing of urb's.
This patch fixes the problem reported in Kernel Bugzilla #12185
(http://bugzilla.kernel.org/show_bug.cgi?id=12185).
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Tested-by: Hin-Tak Leung <htl10@users.sourceforge.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Fix these bugs found by sparse:
ath5k/pcu.c:1102:21: warning: restricted __le32 degrades to integer
ath5k/pcu.c:1102:13: warning: incorrect type in assignment (different base types)
ath5k/pcu.c:1102:13: expected restricted __le32 <noident>
ath5k/pcu.c:1102:13: got unsigned int
ath5k/pcu.c:1104:20: warning: restricted __le32 degrades to integer
ath5k/pcu.c:1104:13: warning: incorrect type in assignment (different base types)
ath5k/pcu.c:1104:13: expected restricted __le32 <noident>
ath5k/pcu.c:1104:13: got unsigned int
Changes-licensed-under: ISC
Reported-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>