* Re: How to scan APs with ATH5k?
From: Pavel Roskin @ 2010-05-20 21:53 UTC (permalink / raw)
To: Jaroslav Fojtik; +Cc: linux-wireless, Bob Copeland
In-Reply-To: <4BF58D72.22852.D1D2D@jafojtik.seznam.cz>
On Thu, 2010-05-20 at 21:28 +0200, Jaroslav Fojtik wrote:
> Dear Bob,
>
> > $ sudo ifconfig wlan0 up
> > $ sudo iw dev wlan0 scan
>
> I have typed:
>
> ifconfig wlan0 down
> ifconfig wlan0 up
> iwlist wlan0 scanning
> (I do not have installed iw)
I think you should install iw and use it instead. Ideally, iwlist
should work as well, but iw would provide a useful datapoint.
> But when an interface wlan0 become associated, it refuses scanning.
>
> root@dvouramenna:~# iwlist wlan0 scanning
> wlan0 Interface doesn't support scanning : Operation not supported
>
>
> Is this bug or feature?
It looks like a bug. Even if something is preventing scanning, the
error code should be -EBUSY (device busy).
> MadWifi can scan even when interface is associated.
> ipw2200bg can also scan when it is associated.
The same is true for ath9k, but I cannot test ath5k at the moment.
mac80211 does a considerable effort to allow scanning while associated.
--
Regards,
Pavel Roskin
^ permalink raw reply
* [PATCH 3/3] ath9k: Fix bug in validating received data length for edma
From: Vasanthakumar Thiagarajan @ 2010-05-20 21:47 UTC (permalink / raw)
To: linville; +Cc: linux-wireless
The rx status length should also be taken into account while
validating the length of a received frame.
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
---
drivers/net/wireless/ath/ath9k/recv.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index 95f1622..fc15b4b 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -827,6 +827,7 @@ static bool ath9k_rx_accept(struct ath_common *common,
{
struct ath_hw *ah = common->ah;
__le16 fc;
+ u8 rx_status_len = ah->caps.rx_status_len;
fc = hdr->frame_control;
@@ -837,7 +838,7 @@ static bool ath9k_rx_accept(struct ath_common *common,
* we can take a hint that hardware corrupted it, so ignore
* those frames.
*/
- if (rx_stats->rs_datalen > common->rx_bufsize)
+ if (rx_stats->rs_datalen > (common->rx_bufsize - rx_status_len))
return false;
/*
--
1.7.0.4
^ permalink raw reply related
* [PATCH 2/3] ath9k: Fix bug in accessing skb->data of rx frame for edma
From: Vasanthakumar Thiagarajan @ 2010-05-20 21:47 UTC (permalink / raw)
To: linville; +Cc: linux-wireless
Skip the rx status portion in skb->data before accessing ieee80211
frame header.
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
---
drivers/net/wireless/ath/ath9k/recv.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index 512b3f0..95f1622 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -1091,6 +1091,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp)
enum ath9k_rx_qtype qtype;
bool edma = !!(ah->caps.hw_caps & ATH9K_HW_CAP_EDMA);
int dma_type;
+ u8 rx_status_len = ah->caps.rx_status_len;
if (edma)
dma_type = DMA_FROM_DEVICE;
@@ -1118,7 +1119,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp)
if (!skb)
continue;
- hdr = (struct ieee80211_hdr *) skb->data;
+ hdr = (struct ieee80211_hdr *) (skb->data + rx_status_len);
rxs = IEEE80211_SKB_RXCB(skb);
hw = ath_get_virt_hw(sc, hdr);
--
1.7.0.4
^ permalink raw reply related
* [PATCH 1/3] ath9k: Clean up few function parameters in recv.c
From: Vasanthakumar Thiagarajan @ 2010-05-20 21:34 UTC (permalink / raw)
To: linville; +Cc: linux-wireless
ath9k_rx_skb_preprocess() needs only ieee80211 frame header,
pass only frame headers instead of skb to that function. Also
remove ineffective frame dump in ath9k_process_rate().
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
---
drivers/net/wireless/ath/ath9k/recv.c | 23 ++++++++---------------
1 files changed, 8 insertions(+), 15 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index d855155..512b3f0 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -820,16 +820,14 @@ static struct ath_buf *ath_get_next_rx_buf(struct ath_softc *sc,
/* Assumes you've already done the endian to CPU conversion */
static bool ath9k_rx_accept(struct ath_common *common,
- struct sk_buff *skb,
+ struct ieee80211_hdr *hdr,
struct ieee80211_rx_status *rxs,
struct ath_rx_status *rx_stats,
bool *decrypt_error)
{
struct ath_hw *ah = common->ah;
- struct ieee80211_hdr *hdr;
__le16 fc;
- hdr = (struct ieee80211_hdr *) skb->data;
fc = hdr->frame_control;
if (!rx_stats->rs_datalen)
@@ -900,8 +898,7 @@ static bool ath9k_rx_accept(struct ath_common *common,
static int ath9k_process_rate(struct ath_common *common,
struct ieee80211_hw *hw,
struct ath_rx_status *rx_stats,
- struct ieee80211_rx_status *rxs,
- struct sk_buff *skb)
+ struct ieee80211_rx_status *rxs)
{
struct ieee80211_supported_band *sband;
enum ieee80211_band band;
@@ -939,25 +936,21 @@ static int ath9k_process_rate(struct ath_common *common,
*/
ath_print(common, ATH_DBG_XMIT, "unsupported hw bitrate detected "
"0x%02x using 1 Mbit\n", rx_stats->rs_rate);
- if ((common->debug_mask & ATH_DBG_XMIT))
- print_hex_dump_bytes("", DUMP_PREFIX_NONE, skb->data, skb->len);
return -EINVAL;
}
static void ath9k_process_rssi(struct ath_common *common,
struct ieee80211_hw *hw,
- struct sk_buff *skb,
+ struct ieee80211_hdr *hdr,
struct ath_rx_status *rx_stats)
{
struct ath_hw *ah = common->ah;
struct ieee80211_sta *sta;
- struct ieee80211_hdr *hdr;
struct ath_node *an;
int last_rssi = ATH_RSSI_DUMMY_MARKER;
__le16 fc;
- hdr = (struct ieee80211_hdr *)skb->data;
fc = hdr->frame_control;
rcu_read_lock();
@@ -996,7 +989,7 @@ static void ath9k_process_rssi(struct ath_common *common,
*/
static int ath9k_rx_skb_preprocess(struct ath_common *common,
struct ieee80211_hw *hw,
- struct sk_buff *skb,
+ struct ieee80211_hdr *hdr,
struct ath_rx_status *rx_stats,
struct ieee80211_rx_status *rx_status,
bool *decrypt_error)
@@ -1009,12 +1002,12 @@ static int ath9k_rx_skb_preprocess(struct ath_common *common,
* everything but the rate is checked here, the rate check is done
* separately to avoid doing two lookups for a rate for each frame.
*/
- if (!ath9k_rx_accept(common, skb, rx_status, rx_stats, decrypt_error))
+ if (!ath9k_rx_accept(common, hdr, rx_status, rx_stats, decrypt_error))
return -EINVAL;
- ath9k_process_rssi(common, hw, skb, rx_stats);
+ ath9k_process_rssi(common, hw, hdr, rx_stats);
- if (ath9k_process_rate(common, hw, rx_stats, rx_status, skb))
+ if (ath9k_process_rate(common, hw, rx_stats, rx_status))
return -EINVAL;
rx_status->mactime = ath9k_hw_extend_tsf(ah, rx_stats->rs_tstamp);
@@ -1139,7 +1132,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp)
if (flush)
goto requeue;
- retval = ath9k_rx_skb_preprocess(common, hw, skb, &rs,
+ retval = ath9k_rx_skb_preprocess(common, hw, hdr, &rs,
rxs, &decrypt_error);
if (retval)
goto requeue;
--
1.7.0.4
^ permalink raw reply related
* Re: How the mac80211 handle "\0" essid?
From: Dan Williams @ 2010-05-20 20:30 UTC (permalink / raw)
To: leo liang; +Cc: linux-wireless
In-Reply-To: <AANLkTinMa92irnw8fH8PPO6egbAVDFWBg4pCPp3dInwd@mail.gmail.com>
On Thu, 2010-05-20 at 15:40 -0400, leo liang wrote:
> Hi,
>
> Does any one know that if the application send "\0" as essid to
> mac80211, how it handle this case?
What are you trying to do? Are you trying to work with a hidden AP, or
do something else?
An SSID is simply a 32-byte array; the protocol and the stack don't care
what's in that array. So while you can't use command-line tools like
'iwconfig' to send an SSID containing a \0, you can use netlink or
wpa_supplicant's nl80211 driver to do so.
But in the end, if you're trying to associate with an AP that has an
SSID of only '\0', that AP is likely broken or trying to hide it's SSID,
and you should be using the real SSID of that AP instead of '\0'.
Dan
^ permalink raw reply
* Re: How to scan APs with ATH5k?
From: Jaroslav Fojtik @ 2010-05-20 19:28 UTC (permalink / raw)
To: linux-wireless; +Cc: Bob Copeland
In-Reply-To: <AANLkTim90zZxvcwT9joVAqO1oDzk-jCaRCQAd0Cfu3N0@mail.gmail.com>
Dear Bob,
> $ sudo ifconfig wlan0 up
> $ sudo iw dev wlan0 scan
I have typed:
ifconfig wlan0 down
ifconfig wlan0 up
iwlist wlan0 scanning
(I do not have installed iw)
and it works:
wlan1 Scan completed :
Cell 01 - Address: 00:15:6D:D6:2A:9D
Channel:36
Frequency:5.18 GHz (Channel 36)
Quality=38/70 Signal level=-72 dBm
Encryption key:off
ESSID:"dvrmn.heaven-czfree.net"
Bit Rate:6 Mb/s
Bit Rate:9 Mb/s
Bit Rate:12 Mb/s
Bit Rate:18 Mb/s
Bit Rate:24 Mb/s
Bit Rate:36 Mb/s
Bit Rate:48 Mb/s
Bit Rate:54 Mb/s
Mode:Master
Extra:tsf=000000949a880598
Extra: Last beacon: 1533ms ago
(Unknown Wireless Token 0x8C05)
Cell 02 - Address: 00:19:E0:84:E1:4C
Channel:2
Frequency:2.417 GHz (Channel 2)
.............................................
But when an interface wlan0 become associated, it refuses scanning.
root@dvouramenna:~# iwlist wlan0 scanning
wlan0 Interface doesn't support scanning : Operation not supported
Is this bug or feature?
MadWifi can scan even when interface is associated.
ipw2200bg can also scan when it is associated.
regards
J.Fojtik
>
> --
> Bob Copeland %% www.bobcopeland.com
^ permalink raw reply
* How the mac80211 handle "\0" essid?
From: leo liang @ 2010-05-20 19:40 UTC (permalink / raw)
To: linux-wireless
Hi,
Does any one know that if the application send "\0" as essid to
mac80211, how it handle this case?
I am studying mac80211 code, but I don't get this answer yet. Could
some give me the answer or a tip?
Thanks.
^ permalink raw reply
* Re: [PATCH 07/11] drivers/net/wireless: Storage class should be before const qualifier
From: Luciano Coelho @ 2010-05-20 17:05 UTC (permalink / raw)
To: ext Tobias Klauser
Cc: linville@tuxdriver.com, ilw@linux.intel.com,
reinette.chatre@intel.com, yi.zhu@intel.com,
linux-wireless@vger.kernel.org, kernel-janitors@vger.kernel.org
In-Reply-To: <1274344691-9095-1-git-send-email-tklauser@distanz.ch>
On Thu, 2010-05-20 at 10:38 +0200, ext Tobias Klauser wrote:
> The C99 specification states in section 6.11.5:
>
> The placement of a storage-class specifier other than at the beginning
> of the declaration specifiers in a declaration is an obsolescent
> feature.
>
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
> ---
Thanks! Regarding wl1271:
Acked-by: Luciano Coelho <luciano.coelho@nokia.com>
--
Cheers,
Luca.
^ permalink raw reply
* Re: [PATCH 07/11] drivers/net/wireless: Storage class should be before const qualifier
From: reinette chatre @ 2010-05-20 16:26 UTC (permalink / raw)
To: Tobias Klauser
Cc: linville@tuxdriver.com, ilw@linux.intel.com, Zhu, Yi,
luciano.coelho@nokia.com, linux-wireless@vger.kernel.org,
kernel-janitors@vger.kernel.org
In-Reply-To: <1274344691-9095-1-git-send-email-tklauser@distanz.ch>
On Thu, 2010-05-20 at 01:38 -0700, Tobias Klauser wrote:
> The C99 specification states in section 6.11.5:
>
> The placement of a storage-class specifier other than at the beginning
> of the declaration specifiers in a declaration is an obsolescent
> feature.
>
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
> ---
For the iwlwifi parts ...
Thank you
Acked-by: Reinette Chatre <reinette.chatre@intel.com>
Reinette
^ permalink raw reply
* Re: wireless card that support master mode
From: VivekKumar Singh @ 2010-05-20 15:22 UTC (permalink / raw)
To: Bob Beers; +Cc: linux-wireless
In-Reply-To: <AANLkTinRbL-9udra90QbgYxr1x3VVgzNZI82xfbrg9PB@mail.gmail.com>
Hi Bob,
Thanks a lot for your help.
I want to ask that is it possible to change the tranmission power of a
athros card without rebooting the card?
Thanks,
Vivek
On Thu, May 20, 2010 at 7:54 PM, Bob Beers <bob.beers@gmail.com> wrote:
> On Thu, May 20, 2010 at 8:12 AM, VivekKumar Singh
> <vivekkumar.singh@iiitb.net> wrote:
>> Dear Friends,
>>
>> I have to purchase a PCI based wireless card that can support "master
>> mode" in linux. I want to make it to work like an access point. But
>> not all cards support "master mode".
>>
>> Please mail me some wireless cards (PCI / USB) model number/company
>> name that supports "master mode".
>
> Maybe this is helpful?
> <http://linuxwireless.org/en/users/Drivers>
>
> -Bob Beers
>
--
Thanks and Regards,
Vivek Kumar Singh
MT-2009146
IIITB, Bangalore
(91)9886317184
^ permalink raw reply
* Re: wireless card that support master mode
From: Bob Beers @ 2010-05-20 14:24 UTC (permalink / raw)
To: VivekKumar Singh; +Cc: linux-wireless
In-Reply-To: <AANLkTimly6U5ZIYR8epN1povTgoCEG3STEuy2-1T-9Gq@mail.gmail.com>
On Thu, May 20, 2010 at 8:12 AM, VivekKumar Singh
<vivekkumar.singh@iiitb.net> wrote:
> Dear Friends,
>
> I have to purchase a PCI based wireless card that can support "master
> mode" in linux. I want to make it to work like an access point. But
> not all cards support "master mode".
>
> Please mail me some wireless cards (PCI / USB) model number/company
> name that supports "master mode".
Maybe this is helpful?
<http://linuxwireless.org/en/users/Drivers>
-Bob Beers
^ permalink raw reply
* Re: [PATCH v2 11/20] ath5k: always calculate ANI listen time
From: Nick Kossifidis @ 2010-05-20 12:59 UTC (permalink / raw)
To: Bruno Randolf; +Cc: linville, ath5k-devel, linux-wireless
In-Reply-To: <20100519013137.22206.45012.stgit@tt-desk>
2010/5/19 Bruno Randolf <br1@einfach.org>:
> Calculate 'listen' time also when automatic ANI is off, since this and the
> "busy" time is useful information also in manual mode.
>
> Signed-off-by: Bruno Randolf <br1@einfach.org>
> ---
> drivers/net/wireless/ath/ath5k/ani.c | 9 +++++----
> 1 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath5k/ani.c b/drivers/net/wireless/ath/ath5k/ani.c
> index f2311ab..987e3d3 100644
> --- a/drivers/net/wireless/ath/ath5k/ani.c
> +++ b/drivers/net/wireless/ath/ath5k/ani.c
> @@ -481,14 +481,15 @@ ath5k_ani_calibration(struct ath5k_hw *ah)
> struct ath5k_ani_state *as = &ah->ah_sc->ani_state;
> int listen, ofdm_high, ofdm_low, cck_high, cck_low;
>
> - if (as->ani_mode != ATH5K_ANI_MODE_AUTO)
> - return;
> -
> /* get listen time since last call and add it to the counter because we
> - * might not have restarted the "ani period" last time */
> + * might not have restarted the "ani period" last time.
> + * always do this to calculate the busy time also in manual mode */
> listen = ath5k_hw_ani_get_listen_time(ah, as);
> as->listen_time += listen;
>
> + if (as->ani_mode != ATH5K_ANI_MODE_AUTO)
> + return;
> +
> ath5k_ani_save_and_clear_phy_errors(ah, as);
>
> ofdm_high = as->listen_time * ATH5K_ANI_OFDM_TRIG_HIGH / 1000;
>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
--
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-)
Nick
^ permalink raw reply
* Re: [PATCH v2 10/20] ath5k: add sysfs files for ANI parameters
From: Nick Kossifidis @ 2010-05-20 12:58 UTC (permalink / raw)
To: Bruno Randolf; +Cc: linville, ath5k-devel, linux-wireless
In-Reply-To: <20100519013132.22206.87611.stgit@tt-desk>
MjAxMC81LzE5IEJydW5vIFJhbmRvbGYgPGJyMUBlaW5mYWNoLm9yZz46Cj4gL3N5cy9jbGFzcy9p
ZWVlODAyMTEvcGh5MC9kZXZpY2UvYW5pL2FuaV9tb2RlCj4gL3N5cy9jbGFzcy9pZWVlODAyMTEv
cGh5MC9kZXZpY2UvYW5pL25vaXNlX2ltbXVuaXR5X2xldmVsCj4gL3N5cy9jbGFzcy9pZWVlODAy
MTEvcGh5MC9kZXZpY2UvYW5pL3NwdXJfbGV2ZWwKPiAvc3lzL2NsYXNzL2llZWU4MDIxMS9waHkw
L2RldmljZS9hbmkvZmlyc3Rlc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C1ieTogTmljayBLb3NzaWZpZGlzIDxtaWNrZmxlbW1AZ21h
aWwuY29tPgoKCgotLSAKR1BHIElEOiAweEQyMURCMkRCCkFzIHlvdSByZWFkIHRoaXMgcG9zdCBn
bG9iYWwgZW50cm9weSByaXNlcy4gSGF2ZSBGdW4gOy0pCk5pY2sK
^ permalink raw reply
* Re: [PATCH v2 07/20] ath5k: remove ATH_TRACE macro
From: Nick Kossifidis @ 2010-05-20 12:56 UTC (permalink / raw)
To: Bruno Randolf; +Cc: linville, ath5k-devel, linux-wireless
In-Reply-To: <20100519013116.22206.5335.stgit@tt-desk>
2010/5/19 Bruno Randolf <br1@einfach.org>:
> Now that we have ftrace, it is not needed any more.
>
> Signed-off-by: Bruno Randolf <br1@einfach.org>
> ---
> drivers/net/wireless/ath/ath5k/attach.c | 2 --
> drivers/net/wireless/ath/ath5k/caps.c | 7 -------
> drivers/net/wireless/ath/ath5k/debug.c | 1 -
> drivers/net/wireless/ath/ath5k/debug.h | 8 --------
> drivers/net/wireless/ath/ath5k/desc.c | 7 -------
> drivers/net/wireless/ath/ath5k/dma.c | 13 -------------
> drivers/net/wireless/ath/ath5k/eeprom.c | 1 -
> drivers/net/wireless/ath/ath5k/gpio.c | 7 -------
> drivers/net/wireless/ath/ath5k/pcu.c | 24 ------------------------
> drivers/net/wireless/ath/ath5k/phy.c | 13 -------------
> drivers/net/wireless/ath/ath5k/qcu.c | 9 ---------
> drivers/net/wireless/ath/ath5k/reset.c | 7 -------
> 12 files changed, 0 insertions(+), 99 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath5k/attach.c b/drivers/net/wireless/ath/ath5k/attach.c
> index e0c244b..ef2dc1d 100644
> --- a/drivers/net/wireless/ath/ath5k/attach.c
> +++ b/drivers/net/wireless/ath/ath5k/attach.c
> @@ -351,8 +351,6 @@ err_free:
> */
> void ath5k_hw_detach(struct ath5k_hw *ah)
> {
> - ATH5K_TRACE(ah->ah_sc);
> -
> __set_bit(ATH_STAT_INVALID, ah->ah_sc->status);
>
> if (ah->ah_rf_banks != NULL)
> diff --git a/drivers/net/wireless/ath/ath5k/caps.c b/drivers/net/wireless/ath/ath5k/caps.c
> index 74f0071..beae519 100644
> --- a/drivers/net/wireless/ath/ath5k/caps.c
> +++ b/drivers/net/wireless/ath/ath5k/caps.c
> @@ -34,7 +34,6 @@ int ath5k_hw_set_capabilities(struct ath5k_hw *ah)
> {
> u16 ee_header;
>
> - ATH5K_TRACE(ah->ah_sc);
> /* Capabilities stored in the EEPROM */
> ee_header = ah->ah_capabilities.cap_eeprom.ee_header;
>
> @@ -123,8 +122,6 @@ int ath5k_hw_get_capability(struct ath5k_hw *ah,
> enum ath5k_capability_type cap_type,
> u32 capability, u32 *result)
> {
> - ATH5K_TRACE(ah->ah_sc);
> -
> switch (cap_type) {
> case AR5K_CAP_NUM_TXQUEUES:
> if (result) {
> @@ -173,8 +170,6 @@ yes:
> int ath5k_hw_enable_pspoll(struct ath5k_hw *ah, u8 *bssid,
> u16 assoc_id)
> {
> - ATH5K_TRACE(ah->ah_sc);
> -
> if (ah->ah_version == AR5K_AR5210) {
> AR5K_REG_DISABLE_BITS(ah, AR5K_STA_ID1,
> AR5K_STA_ID1_NO_PSPOLL | AR5K_STA_ID1_DEFAULT_ANTENNA);
> @@ -186,8 +181,6 @@ int ath5k_hw_enable_pspoll(struct ath5k_hw *ah, u8 *bssid,
>
> int ath5k_hw_disable_pspoll(struct ath5k_hw *ah)
> {
> - ATH5K_TRACE(ah->ah_sc);
> -
> if (ah->ah_version == AR5K_AR5210) {
> AR5K_REG_ENABLE_BITS(ah, AR5K_STA_ID1,
> AR5K_STA_ID1_NO_PSPOLL | AR5K_STA_ID1_DEFAULT_ANTENNA);
> diff --git a/drivers/net/wireless/ath/ath5k/debug.c b/drivers/net/wireless/ath/ath5k/debug.c
> index c77a6ad..97c5ada 100644
> --- a/drivers/net/wireless/ath/ath5k/debug.c
> +++ b/drivers/net/wireless/ath/ath5k/debug.c
> @@ -307,7 +307,6 @@ static const struct {
> { ATH5K_DEBUG_DUMP_RX, "dumprx", "print received skb content" },
> { ATH5K_DEBUG_DUMP_TX, "dumptx", "print transmit skb content" },
> { ATH5K_DEBUG_DUMPBANDS, "dumpbands", "dump bands" },
> - { ATH5K_DEBUG_TRACE, "trace", "trace function calls" },
> { ATH5K_DEBUG_ANI, "ani", "adaptive noise immunity" },
> { ATH5K_DEBUG_ANY, "all", "show all debug levels" },
> };
> diff --git a/drivers/net/wireless/ath/ath5k/debug.h b/drivers/net/wireless/ath/ath5k/debug.h
> index c7a0769..606ae94 100644
> --- a/drivers/net/wireless/ath/ath5k/debug.h
> +++ b/drivers/net/wireless/ath/ath5k/debug.h
> @@ -116,18 +116,12 @@ enum ath5k_debug_level {
> ATH5K_DEBUG_DUMP_RX = 0x00000100,
> ATH5K_DEBUG_DUMP_TX = 0x00000200,
> ATH5K_DEBUG_DUMPBANDS = 0x00000400,
> - ATH5K_DEBUG_TRACE = 0x00001000,
> ATH5K_DEBUG_ANI = 0x00002000,
> ATH5K_DEBUG_ANY = 0xffffffff
> };
>
> #ifdef CONFIG_ATH5K_DEBUG
>
> -#define ATH5K_TRACE(_sc) do { \
> - if (unlikely((_sc)->debug.level & ATH5K_DEBUG_TRACE)) \
> - printk(KERN_DEBUG "ath5k trace %s:%d\n", __func__, __LINE__); \
> - } while (0)
> -
> #define ATH5K_DBG(_sc, _m, _fmt, ...) do { \
> if (unlikely((_sc)->debug.level & (_m) && net_ratelimit())) \
> ATH5K_PRINTK(_sc, KERN_DEBUG, "(%s:%d): " _fmt, \
> @@ -169,8 +163,6 @@ ath5k_debug_printtxbuf(struct ath5k_softc *sc, struct ath5k_buf *bf);
>
> #include <linux/compiler.h>
>
> -#define ATH5K_TRACE(_sc) typecheck(struct ath5k_softc *, (_sc))
> -
> static inline void __attribute__ ((format (printf, 3, 4)))
> ATH5K_DBG(struct ath5k_softc *sc, unsigned int m, const char *fmt, ...) {}
>
> diff --git a/drivers/net/wireless/ath/ath5k/desc.c b/drivers/net/wireless/ath/ath5k/desc.c
> index 7d7b646..da5dbb6 100644
> --- a/drivers/net/wireless/ath/ath5k/desc.c
> +++ b/drivers/net/wireless/ath/ath5k/desc.c
> @@ -176,7 +176,6 @@ static int ath5k_hw_setup_4word_tx_desc(struct ath5k_hw *ah,
> struct ath5k_hw_4w_tx_ctl *tx_ctl;
> unsigned int frame_len;
>
> - ATH5K_TRACE(ah->ah_sc);
> tx_ctl = &desc->ud.ds_tx5212.tx_ctl;
>
> /*
> @@ -342,8 +341,6 @@ static int ath5k_hw_proc_2word_tx_status(struct ath5k_hw *ah,
> struct ath5k_hw_2w_tx_ctl *tx_ctl;
> struct ath5k_hw_tx_status *tx_status;
>
> - ATH5K_TRACE(ah->ah_sc);
> -
> tx_ctl = &desc->ud.ds_tx5210.tx_ctl;
> tx_status = &desc->ud.ds_tx5210.tx_stat;
>
> @@ -396,8 +393,6 @@ static int ath5k_hw_proc_4word_tx_status(struct ath5k_hw *ah,
> struct ath5k_hw_4w_tx_ctl *tx_ctl;
> struct ath5k_hw_tx_status *tx_status;
>
> - ATH5K_TRACE(ah->ah_sc);
> -
> tx_ctl = &desc->ud.ds_tx5212.tx_ctl;
> tx_status = &desc->ud.ds_tx5212.tx_stat;
>
> @@ -490,7 +485,6 @@ static int ath5k_hw_setup_rx_desc(struct ath5k_hw *ah, struct ath5k_desc *desc,
> {
> struct ath5k_hw_rx_ctl *rx_ctl;
>
> - ATH5K_TRACE(ah->ah_sc);
> rx_ctl = &desc->ud.ds_rx.rx_ctl;
>
> /*
> @@ -593,7 +587,6 @@ static int ath5k_hw_proc_5212_rx_status(struct ath5k_hw *ah,
> struct ath5k_hw_rx_status *rx_status;
> struct ath5k_hw_rx_error *rx_err;
>
> - ATH5K_TRACE(ah->ah_sc);
> rx_status = &desc->ud.ds_rx.u.rx_stat;
>
> /* Overlay on error */
> diff --git a/drivers/net/wireless/ath/ath5k/dma.c b/drivers/net/wireless/ath/ath5k/dma.c
> index 941b511..484f318 100644
> --- a/drivers/net/wireless/ath/ath5k/dma.c
> +++ b/drivers/net/wireless/ath/ath5k/dma.c
> @@ -48,7 +48,6 @@
> */
> void ath5k_hw_start_rx_dma(struct ath5k_hw *ah)
> {
> - ATH5K_TRACE(ah->ah_sc);
> ath5k_hw_reg_write(ah, AR5K_CR_RXE, AR5K_CR);
> ath5k_hw_reg_read(ah, AR5K_CR);
> }
> @@ -62,7 +61,6 @@ int ath5k_hw_stop_rx_dma(struct ath5k_hw *ah)
> {
> unsigned int i;
>
> - ATH5K_TRACE(ah->ah_sc);
> ath5k_hw_reg_write(ah, AR5K_CR_RXD, AR5K_CR);
>
> /*
> @@ -96,8 +94,6 @@ u32 ath5k_hw_get_rxdp(struct ath5k_hw *ah)
> */
> void ath5k_hw_set_rxdp(struct ath5k_hw *ah, u32 phys_addr)
> {
> - ATH5K_TRACE(ah->ah_sc);
> -
> ath5k_hw_reg_write(ah, phys_addr, AR5K_RXDP);
> }
>
> @@ -125,7 +121,6 @@ int ath5k_hw_start_tx_dma(struct ath5k_hw *ah, unsigned int queue)
> {
> u32 tx_queue;
>
> - ATH5K_TRACE(ah->ah_sc);
> AR5K_ASSERT_ENTRY(queue, ah->ah_capabilities.cap_queues.q_tx_num);
>
> /* Return if queue is declared inactive */
> @@ -186,7 +181,6 @@ int ath5k_hw_stop_tx_dma(struct ath5k_hw *ah, unsigned int queue)
> unsigned int i = 40;
> u32 tx_queue, pending;
>
> - ATH5K_TRACE(ah->ah_sc);
> AR5K_ASSERT_ENTRY(queue, ah->ah_capabilities.cap_queues.q_tx_num);
>
> /* Return if queue is declared inactive */
> @@ -297,7 +291,6 @@ u32 ath5k_hw_get_txdp(struct ath5k_hw *ah, unsigned int queue)
> {
> u16 tx_reg;
>
> - ATH5K_TRACE(ah->ah_sc);
> AR5K_ASSERT_ENTRY(queue, ah->ah_capabilities.cap_queues.q_tx_num);
>
> /*
> @@ -340,7 +333,6 @@ int ath5k_hw_set_txdp(struct ath5k_hw *ah, unsigned int queue, u32 phys_addr)
> {
> u16 tx_reg;
>
> - ATH5K_TRACE(ah->ah_sc);
> AR5K_ASSERT_ENTRY(queue, ah->ah_capabilities.cap_queues.q_tx_num);
>
> /*
> @@ -400,8 +392,6 @@ int ath5k_hw_update_tx_triglevel(struct ath5k_hw *ah, bool increase)
> u32 trigger_level, imr;
> int ret = -EIO;
>
> - ATH5K_TRACE(ah->ah_sc);
> -
> /*
> * Disable interrupts by setting the mask
> */
> @@ -451,7 +441,6 @@ done:
> */
> bool ath5k_hw_is_intr_pending(struct ath5k_hw *ah)
> {
> - ATH5K_TRACE(ah->ah_sc);
> return ath5k_hw_reg_read(ah, AR5K_INTPEND) == 1 ? 1 : 0;
> }
>
> @@ -475,8 +464,6 @@ int ath5k_hw_get_isr(struct ath5k_hw *ah, enum ath5k_int *interrupt_mask)
> {
> u32 data;
>
> - ATH5K_TRACE(ah->ah_sc);
> -
> /*
> * Read interrupt status from the Interrupt Status register
> * on 5210
> diff --git a/drivers/net/wireless/ath/ath5k/eeprom.c b/drivers/net/wireless/ath/ath5k/eeprom.c
> index ed02636..155a82c 100644
> --- a/drivers/net/wireless/ath/ath5k/eeprom.c
> +++ b/drivers/net/wireless/ath/ath5k/eeprom.c
> @@ -35,7 +35,6 @@ static int ath5k_hw_eeprom_read(struct ath5k_hw *ah, u32 offset, u16 *data)
> {
> u32 status, timeout;
>
> - ATH5K_TRACE(ah->ah_sc);
> /*
> * Initialize EEPROM access
> */
> diff --git a/drivers/net/wireless/ath/ath5k/gpio.c b/drivers/net/wireless/ath/ath5k/gpio.c
> index 64a27e7..bc90503 100644
> --- a/drivers/net/wireless/ath/ath5k/gpio.c
> +++ b/drivers/net/wireless/ath/ath5k/gpio.c
> @@ -34,8 +34,6 @@ void ath5k_hw_set_ledstate(struct ath5k_hw *ah, unsigned int state)
> /*5210 has different led mode handling*/
> u32 led_5210;
>
> - ATH5K_TRACE(ah->ah_sc);
> -
> /*Reset led status*/
> if (ah->ah_version != AR5K_AR5210)
> AR5K_REG_DISABLE_BITS(ah, AR5K_PCICFG,
> @@ -82,7 +80,6 @@ void ath5k_hw_set_ledstate(struct ath5k_hw *ah, unsigned int state)
> */
> int ath5k_hw_set_gpio_input(struct ath5k_hw *ah, u32 gpio)
> {
> - ATH5K_TRACE(ah->ah_sc);
> if (gpio >= AR5K_NUM_GPIO)
> return -EINVAL;
>
> @@ -98,7 +95,6 @@ int ath5k_hw_set_gpio_input(struct ath5k_hw *ah, u32 gpio)
> */
> int ath5k_hw_set_gpio_output(struct ath5k_hw *ah, u32 gpio)
> {
> - ATH5K_TRACE(ah->ah_sc);
> if (gpio >= AR5K_NUM_GPIO)
> return -EINVAL;
>
> @@ -114,7 +110,6 @@ int ath5k_hw_set_gpio_output(struct ath5k_hw *ah, u32 gpio)
> */
> u32 ath5k_hw_get_gpio(struct ath5k_hw *ah, u32 gpio)
> {
> - ATH5K_TRACE(ah->ah_sc);
> if (gpio >= AR5K_NUM_GPIO)
> return 0xffffffff;
>
> @@ -129,7 +124,6 @@ u32 ath5k_hw_get_gpio(struct ath5k_hw *ah, u32 gpio)
> int ath5k_hw_set_gpio(struct ath5k_hw *ah, u32 gpio, u32 val)
> {
> u32 data;
> - ATH5K_TRACE(ah->ah_sc);
>
> if (gpio >= AR5K_NUM_GPIO)
> return -EINVAL;
> @@ -153,7 +147,6 @@ void ath5k_hw_set_gpio_intr(struct ath5k_hw *ah, unsigned int gpio,
> {
> u32 data;
>
> - ATH5K_TRACE(ah->ah_sc);
> if (gpio >= AR5K_NUM_GPIO)
> return;
>
> diff --git a/drivers/net/wireless/ath/ath5k/pcu.c b/drivers/net/wireless/ath/ath5k/pcu.c
> index 5212e27..86fdb6d 100644
> --- a/drivers/net/wireless/ath/ath5k/pcu.c
> +++ b/drivers/net/wireless/ath/ath5k/pcu.c
> @@ -59,8 +59,6 @@ int ath5k_hw_set_opmode(struct ath5k_hw *ah, enum nl80211_iftype op_mode)
>
> beacon_reg = 0;
>
> - ATH5K_TRACE(ah->ah_sc);
> -
> switch (op_mode) {
> case NL80211_IFTYPE_ADHOC:
> pcu_reg |= AR5K_STA_ID1_ADHOC | AR5K_STA_ID1_KEYSRCH_MODE;
> @@ -173,7 +171,6 @@ void ath5k_hw_set_ack_bitrate_high(struct ath5k_hw *ah, bool high)
> */
> static int ath5k_hw_set_ack_timeout(struct ath5k_hw *ah, unsigned int timeout)
> {
> - ATH5K_TRACE(ah->ah_sc);
> if (ath5k_hw_clocktoh(ah, AR5K_REG_MS(0xffffffff, AR5K_TIME_OUT_ACK))
> <= timeout)
> return -EINVAL;
> @@ -192,7 +189,6 @@ static int ath5k_hw_set_ack_timeout(struct ath5k_hw *ah, unsigned int timeout)
> */
> static int ath5k_hw_set_cts_timeout(struct ath5k_hw *ah, unsigned int timeout)
> {
> - ATH5K_TRACE(ah->ah_sc);
> if (ath5k_hw_clocktoh(ah, AR5K_REG_MS(0xffffffff, AR5K_TIME_OUT_CTS))
> <= timeout)
> return -EINVAL;
> @@ -297,7 +293,6 @@ int ath5k_hw_set_lladdr(struct ath5k_hw *ah, const u8 *mac)
> u32 low_id, high_id;
> u32 pcu_reg;
>
> - ATH5K_TRACE(ah->ah_sc);
> /* Set new station ID */
> memcpy(common->macaddr, mac, ETH_ALEN);
>
> @@ -357,7 +352,6 @@ void ath5k_hw_set_associd(struct ath5k_hw *ah)
> void ath5k_hw_set_bssid_mask(struct ath5k_hw *ah, const u8 *mask)
> {
> struct ath_common *common = ath5k_hw_common(ah);
> - ATH5K_TRACE(ah->ah_sc);
>
> /* Cache bssid mask so that we can restore it
> * on reset */
> @@ -382,7 +376,6 @@ void ath5k_hw_set_bssid_mask(struct ath5k_hw *ah, const u8 *mask)
> */
> void ath5k_hw_start_rx_pcu(struct ath5k_hw *ah)
> {
> - ATH5K_TRACE(ah->ah_sc);
> AR5K_REG_DISABLE_BITS(ah, AR5K_DIAG_SW, AR5K_DIAG_SW_DIS_RX);
> }
>
> @@ -397,7 +390,6 @@ void ath5k_hw_start_rx_pcu(struct ath5k_hw *ah)
> */
> void ath5k_hw_stop_rx_pcu(struct ath5k_hw *ah)
> {
> - ATH5K_TRACE(ah->ah_sc);
> AR5K_REG_ENABLE_BITS(ah, AR5K_DIAG_SW, AR5K_DIAG_SW_DIS_RX);
> }
>
> @@ -406,8 +398,6 @@ void ath5k_hw_stop_rx_pcu(struct ath5k_hw *ah)
> */
> void ath5k_hw_set_mcast_filter(struct ath5k_hw *ah, u32 filter0, u32 filter1)
> {
> - ATH5K_TRACE(ah->ah_sc);
> - /* Set the multicat filter */
> ath5k_hw_reg_write(ah, filter0, AR5K_MCAST_FILTER0);
> ath5k_hw_reg_write(ah, filter1, AR5K_MCAST_FILTER1);
> }
> @@ -427,7 +417,6 @@ u32 ath5k_hw_get_rx_filter(struct ath5k_hw *ah)
> {
> u32 data, filter = 0;
>
> - ATH5K_TRACE(ah->ah_sc);
> filter = ath5k_hw_reg_read(ah, AR5K_RX_FILTER);
>
> /*Radar detection for 5212*/
> @@ -457,8 +446,6 @@ void ath5k_hw_set_rx_filter(struct ath5k_hw *ah, u32 filter)
> {
> u32 data = 0;
>
> - ATH5K_TRACE(ah->ah_sc);
> -
> /* Set PHY error filter register on 5212*/
> if (ah->ah_version == AR5K_AR5212) {
> if (filter & AR5K_RX_FILTER_RADARERR)
> @@ -533,8 +520,6 @@ u64 ath5k_hw_get_tsf64(struct ath5k_hw *ah)
>
> WARN_ON( i == ATH5K_MAX_TSF_READ );
>
> - ATH5K_TRACE(ah->ah_sc);
> -
> return (((u64)tsf_upper1 << 32) | tsf_lower);
> }
>
> @@ -548,8 +533,6 @@ u64 ath5k_hw_get_tsf64(struct ath5k_hw *ah)
> */
> void ath5k_hw_set_tsf64(struct ath5k_hw *ah, u64 tsf64)
> {
> - ATH5K_TRACE(ah->ah_sc);
> -
> ath5k_hw_reg_write(ah, tsf64 & 0xffffffff, AR5K_TSF_L32);
> ath5k_hw_reg_write(ah, (tsf64 >> 32) & 0xffffffff, AR5K_TSF_U32);
> }
> @@ -565,8 +548,6 @@ void ath5k_hw_reset_tsf(struct ath5k_hw *ah)
> {
> u32 val;
>
> - ATH5K_TRACE(ah->ah_sc);
> -
> val = ath5k_hw_reg_read(ah, AR5K_BEACON) | AR5K_BEACON_RESET_TSF;
>
> /*
> @@ -586,7 +567,6 @@ void ath5k_hw_init_beacon(struct ath5k_hw *ah, u32 next_beacon, u32 interval)
> {
> u32 timer1, timer2, timer3;
>
> - ATH5K_TRACE(ah->ah_sc);
> /*
> * Set the additional timers by mode
> */
> @@ -674,7 +654,6 @@ int ath5k_hw_reset_key(struct ath5k_hw *ah, u16 entry)
> unsigned int i, type;
> u16 micentry = entry + AR5K_KEYTABLE_MIC_OFFSET;
>
> - ATH5K_TRACE(ah->ah_sc);
> AR5K_ASSERT_ENTRY(entry, AR5K_KEYTABLE_SIZE);
>
> type = ath5k_hw_reg_read(ah, AR5K_KEYTABLE_TYPE(entry));
> @@ -749,8 +728,6 @@ int ath5k_hw_set_key(struct ath5k_hw *ah, u16 entry,
> bool is_tkip;
> const u8 *key_ptr;
>
> - ATH5K_TRACE(ah->ah_sc);
> -
> is_tkip = (key->alg == ALG_TKIP);
>
> /*
> @@ -836,7 +813,6 @@ int ath5k_hw_set_key_lladdr(struct ath5k_hw *ah, u16 entry, const u8 *mac)
> {
> u32 low_id, high_id;
>
> - ATH5K_TRACE(ah->ah_sc);
> /* Invalid entry (key table overflow) */
> AR5K_ASSERT_ENTRY(entry, AR5K_KEYTABLE_SIZE);
>
> diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c
> index 0b24081..f369e7e 100644
> --- a/drivers/net/wireless/ath/ath5k/phy.c
> +++ b/drivers/net/wireless/ath/ath5k/phy.c
> @@ -378,8 +378,6 @@ enum ath5k_rfgain ath5k_hw_gainf_calibrate(struct ath5k_hw *ah)
> u32 data, type;
> struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom;
>
> - ATH5K_TRACE(ah->ah_sc);
> -
> if (ah->ah_rf_banks == NULL ||
> ah->ah_gain.g_state == AR5K_RFGAIN_INACTIVE)
> return AR5K_RFGAIN_INACTIVE;
> @@ -1353,7 +1351,6 @@ ath5k_hw_rf511x_iq_calibrate(struct ath5k_hw *ah)
> u32 i_pwr, q_pwr;
> s32 iq_corr, i_coff, i_coffd, q_coff, q_coffd;
> int i;
> - ATH5K_TRACE(ah->ah_sc);
>
> if (!ah->ah_calibration ||
> ath5k_hw_reg_read(ah, AR5K_PHY_IQ) & AR5K_PHY_IQ_RUN)
> @@ -1680,7 +1677,6 @@ ath5k_hw_set_spur_mitigation_filter(struct ath5k_hw *ah,
>
> int ath5k_hw_phy_disable(struct ath5k_hw *ah)
> {
> - ATH5K_TRACE(ah->ah_sc);
> /*Just a try M.F.*/
> ath5k_hw_reg_write(ah, AR5K_PHY_ACT_DISABLE, AR5K_PHY_ACT);
>
> @@ -1696,8 +1692,6 @@ u16 ath5k_hw_radio_revision(struct ath5k_hw *ah, unsigned int chan)
> u32 srev;
> u16 ret;
>
> - ATH5K_TRACE(ah->ah_sc);
> -
> /*
> * Set the radio chip access register
> */
> @@ -1742,8 +1736,6 @@ u16 ath5k_hw_radio_revision(struct ath5k_hw *ah, unsigned int chan)
> static void /*TODO:Boundary check*/
> ath5k_hw_set_def_antenna(struct ath5k_hw *ah, u8 ant)
> {
> - ATH5K_TRACE(ah->ah_sc);
> -
> if (ah->ah_version != AR5K_AR5210)
> ath5k_hw_reg_write(ah, ant & 0x7, AR5K_DEFAULT_ANTENNA);
> }
> @@ -1803,8 +1795,6 @@ ath5k_hw_set_antenna_mode(struct ath5k_hw *ah, u8 ant_mode)
>
> def_ant = ah->ah_def_ant;
>
> - ATH5K_TRACE(ah->ah_sc);
> -
> switch (channel->hw_value & CHANNEL_MODES) {
> case CHANNEL_A:
> case CHANNEL_T:
> @@ -2970,7 +2960,6 @@ ath5k_hw_txpower(struct ath5k_hw *ah, struct ieee80211_channel *channel,
> u8 type;
> int ret;
>
> - ATH5K_TRACE(ah->ah_sc);
> if (txpower > AR5K_TUNE_MAX_TXPOWER) {
> ATH5K_ERR(ah->ah_sc, "invalid tx power: %u\n", txpower);
> return -EINVAL;
> @@ -3066,8 +3055,6 @@ int ath5k_hw_set_txpower_limit(struct ath5k_hw *ah, u8 txpower)
> struct ieee80211_channel *channel = ah->ah_current_channel;
> u8 ee_mode;
>
> - ATH5K_TRACE(ah->ah_sc);
> -
> switch (channel->hw_value & CHANNEL_MODES) {
> case CHANNEL_A:
> case CHANNEL_T:
> diff --git a/drivers/net/wireless/ath/ath5k/qcu.c b/drivers/net/wireless/ath/ath5k/qcu.c
> index f5831da..4186ff4 100644
> --- a/drivers/net/wireless/ath/ath5k/qcu.c
> +++ b/drivers/net/wireless/ath/ath5k/qcu.c
> @@ -31,7 +31,6 @@ Queue Control Unit, DFS Control Unit Functions
> int ath5k_hw_get_tx_queueprops(struct ath5k_hw *ah, int queue,
> struct ath5k_txq_info *queue_info)
> {
> - ATH5K_TRACE(ah->ah_sc);
> memcpy(queue_info, &ah->ah_txq[queue], sizeof(struct ath5k_txq_info));
> return 0;
> }
> @@ -42,7 +41,6 @@ int ath5k_hw_get_tx_queueprops(struct ath5k_hw *ah, int queue,
> int ath5k_hw_set_tx_queueprops(struct ath5k_hw *ah, int queue,
> const struct ath5k_txq_info *queue_info)
> {
> - ATH5K_TRACE(ah->ah_sc);
> AR5K_ASSERT_ENTRY(queue, ah->ah_capabilities.cap_queues.q_tx_num);
>
> if (ah->ah_txq[queue].tqi_type == AR5K_TX_QUEUE_INACTIVE)
> @@ -69,8 +67,6 @@ int ath5k_hw_setup_tx_queue(struct ath5k_hw *ah, enum ath5k_tx_queue queue_type,
> unsigned int queue;
> int ret;
>
> - ATH5K_TRACE(ah->ah_sc);
> -
> /*
> * Get queue by type
> */
> @@ -149,7 +145,6 @@ int ath5k_hw_setup_tx_queue(struct ath5k_hw *ah, enum ath5k_tx_queue queue_type,
> u32 ath5k_hw_num_tx_pending(struct ath5k_hw *ah, unsigned int queue)
> {
> u32 pending;
> - ATH5K_TRACE(ah->ah_sc);
> AR5K_ASSERT_ENTRY(queue, ah->ah_capabilities.cap_queues.q_tx_num);
>
> /* Return if queue is declared inactive */
> @@ -177,7 +172,6 @@ u32 ath5k_hw_num_tx_pending(struct ath5k_hw *ah, unsigned int queue)
> */
> void ath5k_hw_release_tx_queue(struct ath5k_hw *ah, unsigned int queue)
> {
> - ATH5K_TRACE(ah->ah_sc);
> if (WARN_ON(queue >= ah->ah_capabilities.cap_queues.q_tx_num))
> return;
>
> @@ -195,7 +189,6 @@ int ath5k_hw_reset_tx_queue(struct ath5k_hw *ah, unsigned int queue)
> u32 cw_min, cw_max, retry_lg, retry_sh;
> struct ath5k_txq_info *tq = &ah->ah_txq[queue];
>
> - ATH5K_TRACE(ah->ah_sc);
> AR5K_ASSERT_ENTRY(queue, ah->ah_capabilities.cap_queues.q_tx_num);
>
> tq = &ah->ah_txq[queue];
> @@ -523,8 +516,6 @@ int ath5k_hw_set_slot_time(struct ath5k_hw *ah, unsigned int slot_time)
> {
> u32 slot_time_clock = ath5k_hw_htoclock(ah, slot_time);
>
> - ATH5K_TRACE(ah->ah_sc);
> -
> if (slot_time < 6 || slot_time_clock > AR5K_SLOT_TIME_MAX)
> return -EINVAL;
>
> diff --git a/drivers/net/wireless/ath/ath5k/reset.c b/drivers/net/wireless/ath/ath5k/reset.c
> index 44bbbf2..5e23e61 100644
> --- a/drivers/net/wireless/ath/ath5k/reset.c
> +++ b/drivers/net/wireless/ath/ath5k/reset.c
> @@ -201,8 +201,6 @@ static int ath5k_hw_nic_reset(struct ath5k_hw *ah, u32 val)
> int ret;
> u32 mask = val ? val : ~0U;
>
> - ATH5K_TRACE(ah->ah_sc);
> -
> /* Read-and-clear RX Descriptor Pointer*/
> ath5k_hw_reg_read(ah, AR5K_RXDP);
>
> @@ -246,7 +244,6 @@ static int ath5k_hw_set_power(struct ath5k_hw *ah, enum ath5k_power_mode mode,
> unsigned int i;
> u32 staid, data;
>
> - ATH5K_TRACE(ah->ah_sc);
> staid = ath5k_hw_reg_read(ah, AR5K_STA_ID1);
>
> switch (mode) {
> @@ -393,8 +390,6 @@ int ath5k_hw_nic_wakeup(struct ath5k_hw *ah, int flags, bool initial)
> mode = 0;
> clock = 0;
>
> - ATH5K_TRACE(ah->ah_sc);
> -
> /* Wakeup the device */
> ret = ath5k_hw_set_power(ah, AR5K_PM_AWAKE, true, 0);
> if (ret) {
> @@ -899,8 +894,6 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
> u8 mode, freq, ee_mode, ant[2];
> int i, ret;
>
> - ATH5K_TRACE(ah->ah_sc);
> -
> s_ant = 0;
> ee_mode = 0;
> staid1_flags = 0;
>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
--
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-)
Nick
^ permalink raw reply
* Re: [PATCH v2 18/20] ath5k: update AR5K_PHY_RESTART_DIV_GC values to match masks
From: Nick Kossifidis @ 2010-05-20 12:54 UTC (permalink / raw)
To: Bruno Randolf; +Cc: linville, ath5k-devel, linux-wireless
In-Reply-To: <20100519013214.22206.43556.stgit@tt-desk>
2010/5/19 Bruno Randolf <br1@einfach.org>:
> #define AR5K_PHY_RESTART_DIV_GC 0x001c0000
> is 3 bit wide.
>
> The previous values of 0xc and 0x8 are 4bit wide and bigger than the mask.
>
> Writing 0 and 1 to AR5K_PHY_RESTART_DIV_GC is consistent with the comments and
> initvals we have in the HAL.
>
> Signed-off-by: Bruno Randolf <br1@einfach.org>
> ---
> drivers/net/wireless/ath/ath5k/phy.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c
> index d9506e7..2136930 100644
> --- a/drivers/net/wireless/ath/ath5k/phy.c
> +++ b/drivers/net/wireless/ath/ath5k/phy.c
> @@ -1768,13 +1768,13 @@ ath5k_hw_set_fast_div(struct ath5k_hw *ah, u8 ee_mode, bool enable)
>
> if (enable) {
> AR5K_REG_WRITE_BITS(ah, AR5K_PHY_RESTART,
> - AR5K_PHY_RESTART_DIV_GC, 0xc);
> + AR5K_PHY_RESTART_DIV_GC, 1);
>
> AR5K_REG_ENABLE_BITS(ah, AR5K_PHY_FAST_ANT_DIV,
> AR5K_PHY_FAST_ANT_DIV_EN);
> } else {
> AR5K_REG_WRITE_BITS(ah, AR5K_PHY_RESTART,
> - AR5K_PHY_RESTART_DIV_GC, 0x8);
> + AR5K_PHY_RESTART_DIV_GC, 0);
>
> AR5K_REG_DISABLE_BITS(ah, AR5K_PHY_FAST_ANT_DIV,
> AR5K_PHY_FAST_ANT_DIV_EN);
>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
--
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-)
Nick
^ permalink raw reply
* Re: [PATCH v2 05/20] ath5k: Stop queues only for NF calibration
From: Nick Kossifidis @ 2010-05-20 12:52 UTC (permalink / raw)
To: Bruno Randolf; +Cc: linville, ath5k-devel, linux-wireless
In-Reply-To: <20100519013105.22206.74955.stgit@tt-desk>
2010/5/19 Bruno Randolf <br1@einfach.org>:
> As far as we know, only NF calibration interferes with RX/TX so we can
> leave the queues enabled for the other calibrations.
>
> BTW: Stopping the queues is not enough for avoiding transmissions, since there
> might be packets in the queue + beacons are also sent regularly! But i leave it
> like this until we have a better solution (stopping TX DMA?).
>
> Signed-off-by: Bruno Randolf <br1@einfach.org>
> ---
> drivers/net/wireless/ath/ath5k/base.c | 11 ++++++-----
> 1 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
> index 88c7314..3206ed6 100644
> --- a/drivers/net/wireless/ath/ath5k/base.c
> +++ b/drivers/net/wireless/ath/ath5k/base.c
> @@ -2785,10 +2785,6 @@ ath5k_tasklet_calibrate(unsigned long data)
> /* Only full calibration for now */
> ah->ah_cal_mask |= AR5K_CALIBRATION_FULL;
>
> - /* Stop queues so that calibration
> - * doesn't interfere with tx */
> - ieee80211_stop_queues(sc->hw);
> -
> ATH5K_DBG(sc, ATH5K_DEBUG_CALIBRATE, "channel %u/%x\n",
> ieee80211_frequency_to_channel(sc->curchan->center_freq),
> sc->curchan->hw_value);
> @@ -2806,8 +2802,13 @@ ath5k_tasklet_calibrate(unsigned long data)
> ieee80211_frequency_to_channel(
> sc->curchan->center_freq));
>
> + /* TODO: We don't need to run noise floor calibration as often
> + * as I/Q calibration.*/
> +
> + /* Noise floor calibration interrupts rx/tx path while I/Q calibration
> + * doesn't. Stop queues so that calibration doesn't interfere with tx */
> + ieee80211_stop_queues(sc->hw);
> ath5k_hw_update_noise_floor(ah);
> - /* Wake queues */
> ieee80211_wake_queues(sc->hw);
>
> ah->ah_cal_mask &= ~AR5K_CALIBRATION_FULL;
>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
--
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-)
Nick
^ permalink raw reply
* Re: [ath5k-devel] [PATCH v2 02/20] ath5k: wake queues on reset
From: Nick Kossifidis @ 2010-05-20 12:51 UTC (permalink / raw)
To: Bruno Randolf; +Cc: linville, ath5k-devel, linux-wireless
In-Reply-To: <20100519013049.22206.42069.stgit@tt-desk>
2010/5/19 Bruno Randolf <br1@einfach.org>:
> We can wake all queues after a chip reset since everything should be set up and
> we are ready to transmit. If we don't do that we might end up starting up with
> stopped queues, not beeing able to transmit. (This started to happen after
> "ath5k: clean up queue manipulation" but since periodic calibration also
> stopped and started the queues this effect was hidden most of the time).
>
> This way we can also get rid of the superfluous ath5k_reset_wake() function.
>
> Signed-off-by: Bruno Randolf <br1@einfach.org>
> ---
> drivers/net/wireless/ath/ath5k/base.c | 17 +++--------------
> 1 files changed, 3 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
> index fbd5fc7..9f9107b 100644
> --- a/drivers/net/wireless/ath/ath5k/base.c
> +++ b/drivers/net/wireless/ath/ath5k/base.c
> @@ -222,7 +222,6 @@ static int ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb);
> static int ath5k_tx_queue(struct ieee80211_hw *hw, struct sk_buff *skb,
> struct ath5k_txq *txq);
> static int ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan);
> -static int ath5k_reset_wake(struct ath5k_softc *sc);
> static int ath5k_start(struct ieee80211_hw *hw);
> static void ath5k_stop(struct ieee80211_hw *hw);
> static int ath5k_add_interface(struct ieee80211_hw *hw,
> @@ -2770,7 +2769,7 @@ ath5k_tasklet_reset(unsigned long data)
> {
> struct ath5k_softc *sc = (void *)data;
>
> - ath5k_reset_wake(sc);
> + ath5k_reset(sc, sc->curchan);
> }
>
> /*
> @@ -2941,23 +2940,13 @@ ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan)
> ath5k_beacon_config(sc);
> /* intrs are enabled by ath5k_beacon_config */
>
> + ieee80211_wake_queues(sc->hw);
> +
> return 0;
> err:
> return ret;
> }
>
> -static int
> -ath5k_reset_wake(struct ath5k_softc *sc)
> -{
> - int ret;
> -
> - ret = ath5k_reset(sc, sc->curchan);
> - if (!ret)
> - ieee80211_wake_queues(sc->hw);
> -
> - return ret;
> -}
> -
> static int ath5k_start(struct ieee80211_hw *hw)
> {
> return ath5k_init(hw->priv);
>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
--
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-)
Nick
^ permalink raw reply
* Re: [PATCH v2 04/20] ath5k: move noise floor calibration into tasklet
From: Nick Kossifidis @ 2010-05-20 12:50 UTC (permalink / raw)
To: Bruno Randolf; +Cc: linville, ath5k-devel, linux-wireless
In-Reply-To: <20100519013100.22206.64528.stgit@tt-desk>
2010/5/19 Bruno Randolf <br1@einfach.org>:
> Seperate noise floor calibration from other PHY calibration and move it to the
> tasklet. This is the first step to more separation of different calibrations.
>
> Also move out ath5k_hw_request_rfgain_probe(ah) so we have one clean function
> for I/Q calibration on 5111x parts.
>
> Signed-off-by: Bruno Randolf <br1@einfach.org>
> ---
> drivers/net/wireless/ath/ath5k/ath5k.h | 1 +
> drivers/net/wireless/ath/ath5k/base.c | 1 +
> drivers/net/wireless/ath/ath5k/phy.c | 33 ++++++++++----------------------
> 3 files changed, 12 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h b/drivers/net/wireless/ath/ath5k/ath5k.h
> index 2785946..131e8b3 100644
> --- a/drivers/net/wireless/ath/ath5k/ath5k.h
> +++ b/drivers/net/wireless/ath/ath5k/ath5k.h
> @@ -1270,6 +1270,7 @@ int ath5k_hw_channel(struct ath5k_hw *ah, struct ieee80211_channel *channel);
> void ath5k_hw_init_nfcal_hist(struct ath5k_hw *ah);
> int ath5k_hw_phy_calibrate(struct ath5k_hw *ah,
> struct ieee80211_channel *channel);
> +void ath5k_hw_update_noise_floor(struct ath5k_hw *ah);
> /* Spur mitigation */
> bool ath5k_hw_chan_has_spur_noise(struct ath5k_hw *ah,
> struct ieee80211_channel *channel);
> diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
> index de59a6e..88c7314 100644
> --- a/drivers/net/wireless/ath/ath5k/base.c
> +++ b/drivers/net/wireless/ath/ath5k/base.c
> @@ -2806,6 +2806,7 @@ ath5k_tasklet_calibrate(unsigned long data)
> ieee80211_frequency_to_channel(
> sc->curchan->center_freq));
>
> + ath5k_hw_update_noise_floor(ah);
> /* Wake queues */
> ieee80211_wake_queues(sc->hw);
>
> diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c
> index 3ce9afb..0b24081 100644
> --- a/drivers/net/wireless/ath/ath5k/phy.c
> +++ b/drivers/net/wireless/ath/ath5k/phy.c
> @@ -1167,7 +1167,7 @@ static s16 ath5k_hw_get_median_noise_floor(struct ath5k_hw *ah)
> * The median of the values in the history is then loaded into the
> * hardware for its own use for RSSI and CCA measurements.
> */
> -static void ath5k_hw_update_noise_floor(struct ath5k_hw *ah)
> +void ath5k_hw_update_noise_floor(struct ath5k_hw *ah)
> {
> struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom;
> u32 val;
> @@ -1248,7 +1248,6 @@ static void ath5k_hw_update_noise_floor(struct ath5k_hw *ah)
> /*
> * Perform a PHY calibration on RF5110
> * -Fix BPSK/QAM Constellation (I/Q correction)
> - * -Calculate Noise Floor
> */
> static int ath5k_hw_rf5110_calibrate(struct ath5k_hw *ah,
> struct ieee80211_channel *channel)
> @@ -1335,8 +1334,6 @@ static int ath5k_hw_rf5110_calibrate(struct ath5k_hw *ah,
> return ret;
> }
>
> - ath5k_hw_update_noise_floor(ah);
> -
> /*
> * Re-enable RX/TX and beacons
> */
> @@ -1348,10 +1345,10 @@ static int ath5k_hw_rf5110_calibrate(struct ath5k_hw *ah,
> }
>
> /*
> - * Perform a PHY calibration on RF5111/5112 and newer chips
> + * Perform I/Q calibration on RF5111/5112 and newer chips
> */
> -static int ath5k_hw_rf511x_calibrate(struct ath5k_hw *ah,
> - struct ieee80211_channel *channel)
> +static int
> +ath5k_hw_rf511x_iq_calibrate(struct ath5k_hw *ah)
> {
> u32 i_pwr, q_pwr;
> s32 iq_corr, i_coff, i_coffd, q_coff, q_coffd;
> @@ -1360,10 +1357,9 @@ static int ath5k_hw_rf511x_calibrate(struct ath5k_hw *ah,
>
> if (!ah->ah_calibration ||
> ath5k_hw_reg_read(ah, AR5K_PHY_IQ) & AR5K_PHY_IQ_RUN)
> - goto done;
> + return 0;
>
> /* Calibration has finished, get the results and re-run */
> -
> /* work around empty results which can apparently happen on 5212 */
> for (i = 0; i <= 10; i++) {
> iq_corr = ath5k_hw_reg_read(ah, AR5K_PHY_IQRES_CAL_CORR);
> @@ -1384,7 +1380,7 @@ static int ath5k_hw_rf511x_calibrate(struct ath5k_hw *ah,
>
> /* protect against divide by 0 and loss of sign bits */
> if (i_coffd == 0 || q_coffd < 2)
> - goto done;
> + return -1;
>
> i_coff = (-iq_corr) / i_coffd;
> i_coff = clamp(i_coff, -32, 31); /* signed 6 bit */
> @@ -1410,17 +1406,6 @@ static int ath5k_hw_rf511x_calibrate(struct ath5k_hw *ah,
> AR5K_PHY_IQ_CAL_NUM_LOG_MAX, 15);
> AR5K_REG_ENABLE_BITS(ah, AR5K_PHY_IQ, AR5K_PHY_IQ_RUN);
>
> -done:
> -
> - /* TODO: Separate noise floor calibration from I/Q calibration
> - * since noise floor calibration interrupts rx path while I/Q
> - * calibration doesn't. We don't need to run noise floor calibration
> - * as often as I/Q calibration.*/
> - ath5k_hw_update_noise_floor(ah);
> -
> - /* Initiate a gain_F calibration */
> - ath5k_hw_request_rfgain_probe(ah);
> -
> return 0;
> }
>
> @@ -1434,8 +1419,10 @@ int ath5k_hw_phy_calibrate(struct ath5k_hw *ah,
>
> if (ah->ah_radio == AR5K_RF5110)
> ret = ath5k_hw_rf5110_calibrate(ah, channel);
> - else
> - ret = ath5k_hw_rf511x_calibrate(ah, channel);
> + else {
> + ret = ath5k_hw_rf511x_iq_calibrate(ah);
> + ath5k_hw_request_rfgain_probe(ah);
> + }
>
> return ret;
> }
>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
--
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-)
Nick
^ permalink raw reply
* Re: [PATCH v2 03/20] ath5k: initialize calibration timers
From: Nick Kossifidis @ 2010-05-20 12:48 UTC (permalink / raw)
To: Bruno Randolf; +Cc: linville, ath5k-devel, linux-wireless
In-Reply-To: <20100519013055.22206.21675.stgit@tt-desk>
2010/5/19 Bruno Randolf <br1@einfach.org>:
> Initialize calibration timers on reset, since otherwise they might be in the
> future and the calibration tasklet might not be scheduled for a long time.
>
> Signed-off-by: Bruno Randolf <br1@einfach.org>
> ---
> drivers/net/wireless/ath/ath5k/base.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
> index 9f9107b..de59a6e 100644
> --- a/drivers/net/wireless/ath/ath5k/base.c
> +++ b/drivers/net/wireless/ath/ath5k/base.c
> @@ -2926,6 +2926,8 @@ ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan)
>
> ath5k_ani_init(ah, ah->ah_sc->ani_state.ani_mode);
>
> + ah->ah_cal_next_full = jiffies;
> + ah->ah_cal_next_ani = jiffies;
> /*
> * Change channels and update the h/w rate map if we're switching;
> * e.g. 11a to 11b/g.
>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
--
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-)
Nick
^ permalink raw reply
* Fwd: wireless card that support master mode
From: VivekKumar Singh @ 2010-05-20 12:12 UTC (permalink / raw)
To: linux-wireless
In-Reply-To: <AANLkTimKdb5sUCSq1i3gfeV0GLNiNFyfK057q26Kw67n@mail.gmail.com>
Dear Friends,
I have to purchase a PCI based wireless card that can support "master
mode" in linux. I want to make it to work like an access point. But
not all cards support "master mode".
Please mail me some wireless cards (PCI / USB) model number/company
name that supports "master mode".
--
Thanks and Regards,
Vivek Kumar Singh
IIITB, Bangalore
^ permalink raw reply
* [PATCH 2/2] ath9k: Move driver specific structures
From: Sujith @ 2010-05-20 11:53 UTC (permalink / raw)
To: linville; +Cc: linux-wireless
A bunch of data structures are present in the
common module, which are internal to ath9k.
Move them to ath9k.h
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
---
drivers/net/wireless/ath/ath9k/ath9k.h | 63 +++++++++++++++++++++++++++++++
drivers/net/wireless/ath/ath9k/common.h | 63 -------------------------------
2 files changed, 63 insertions(+), 63 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index fbb7dec..cc6ea42 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -206,6 +206,69 @@ struct ath_txq {
u8 txq_tailidx;
};
+struct ath_atx_ac {
+ int sched;
+ int qnum;
+ struct list_head list;
+ struct list_head tid_q;
+};
+
+struct ath_buf_state {
+ int bfs_nframes;
+ u16 bfs_al;
+ u16 bfs_frmlen;
+ int bfs_seqno;
+ int bfs_tidno;
+ int bfs_retries;
+ u8 bf_type;
+ u32 bfs_keyix;
+ enum ath9k_key_type bfs_keytype;
+};
+
+struct ath_buf {
+ struct list_head list;
+ struct ath_buf *bf_lastbf; /* last buf of this unit (a frame or
+ an aggregate) */
+ struct ath_buf *bf_next; /* next subframe in the aggregate */
+ struct sk_buff *bf_mpdu; /* enclosing frame structure */
+ void *bf_desc; /* virtual addr of desc */
+ dma_addr_t bf_daddr; /* physical addr of desc */
+ dma_addr_t bf_buf_addr; /* physical addr of data buffer */
+ bool bf_stale;
+ bool bf_isnullfunc;
+ bool bf_tx_aborted;
+ u16 bf_flags;
+ struct ath_buf_state bf_state;
+ dma_addr_t bf_dmacontext;
+ struct ath_wiphy *aphy;
+};
+
+struct ath_atx_tid {
+ struct list_head list;
+ struct list_head buf_q;
+ struct ath_node *an;
+ struct ath_atx_ac *ac;
+ struct ath_buf *tx_buf[ATH_TID_MAX_BUFS];
+ u16 seq_start;
+ u16 seq_next;
+ u16 baw_size;
+ int tidno;
+ int baw_head; /* first un-acked tx buffer */
+ int baw_tail; /* next unused tx buffer slot */
+ int sched;
+ int paused;
+ u8 state;
+};
+
+struct ath_node {
+ struct ath_common *common;
+ struct ath_atx_tid tid[WME_NUM_TID];
+ struct ath_atx_ac ac[WME_NUM_AC];
+ u16 maxampdu;
+ u8 mpdudensity;
+ int last_rssi;
+};
+
#define AGGR_CLEANUP BIT(1)
#define AGGR_ADDBA_COMPLETE BIT(2)
#define AGGR_ADDBA_PROGRESS BIT(3)
diff --git a/drivers/net/wireless/ath/ath9k/common.h b/drivers/net/wireless/ath/ath9k/common.h
index 1e6f360..283cca8 100644
--- a/drivers/net/wireless/ath/ath9k/common.h
+++ b/drivers/net/wireless/ath/ath9k/common.h
@@ -52,69 +52,6 @@
#define ATH_EP_RND(x, mul) \
((((x)%(mul)) >= ((mul)/2)) ? ((x) + ((mul) - 1)) / (mul) : (x)/(mul))
-struct ath_atx_ac {
- int sched;
- int qnum;
- struct list_head list;
- struct list_head tid_q;
-};
-
-struct ath_buf_state {
- int bfs_nframes;
- u16 bfs_al;
- u16 bfs_frmlen;
- int bfs_seqno;
- int bfs_tidno;
- int bfs_retries;
- u8 bf_type;
- u32 bfs_keyix;
- enum ath9k_key_type bfs_keytype;
-};
-
-struct ath_buf {
- struct list_head list;
- struct ath_buf *bf_lastbf; /* last buf of this unit (a frame or
- an aggregate) */
- struct ath_buf *bf_next; /* next subframe in the aggregate */
- struct sk_buff *bf_mpdu; /* enclosing frame structure */
- void *bf_desc; /* virtual addr of desc */
- dma_addr_t bf_daddr; /* physical addr of desc */
- dma_addr_t bf_buf_addr; /* physical addr of data buffer */
- bool bf_stale;
- bool bf_isnullfunc;
- bool bf_tx_aborted;
- u16 bf_flags;
- struct ath_buf_state bf_state;
- dma_addr_t bf_dmacontext;
- struct ath_wiphy *aphy;
-};
-
-struct ath_atx_tid {
- struct list_head list;
- struct list_head buf_q;
- struct ath_node *an;
- struct ath_atx_ac *ac;
- struct ath_buf *tx_buf[ATH_TID_MAX_BUFS];
- u16 seq_start;
- u16 seq_next;
- u16 baw_size;
- int tidno;
- int baw_head; /* first un-acked tx buffer */
- int baw_tail; /* next unused tx buffer slot */
- int sched;
- int paused;
- u8 state;
-};
-
-struct ath_node {
- struct ath_common *common;
- struct ath_atx_tid tid[WME_NUM_TID];
- struct ath_atx_ac ac[WME_NUM_AC];
- u16 maxampdu;
- u8 mpdudensity;
- int last_rssi;
-};
-
int ath9k_cmn_padpos(__le16 frame_control);
int ath9k_cmn_get_hw_crypto_keytype(struct sk_buff *skb);
void ath9k_cmn_update_ichannel(struct ieee80211_hw *hw,
--
1.7.1
^ permalink raw reply related
* [PATCH 1/2] ath9k: Move ath9k specific RX code to driver
From: Sujith @ 2010-05-20 10:04 UTC (permalink / raw)
To: linville; +Cc: linux-wireless
This patch relocates RX processing code from the
common module to ath9k. This reduces the size
of the common module which is also used by ath9k_htc.
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
---
drivers/net/wireless/ath/ath9k/common.c | 264 ------------------------------
drivers/net/wireless/ath/ath9k/common.h | 13 --
drivers/net/wireless/ath/ath9k/recv.c | 267 ++++++++++++++++++++++++++++++-
3 files changed, 263 insertions(+), 281 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/common.c b/drivers/net/wireless/ath/ath9k/common.c
index 7707341..27f9ae5 100644
--- a/drivers/net/wireless/ath/ath9k/common.c
+++ b/drivers/net/wireless/ath/ath9k/common.c
@@ -27,270 +27,6 @@ MODULE_AUTHOR("Atheros Communications");
MODULE_DESCRIPTION("Shared library for Atheros wireless 802.11n LAN cards.");
MODULE_LICENSE("Dual BSD/GPL");
-/* Common RX processing */
-
-/* Assumes you've already done the endian to CPU conversion */
-static bool ath9k_rx_accept(struct ath_common *common,
- struct sk_buff *skb,
- struct ieee80211_rx_status *rxs,
- struct ath_rx_status *rx_stats,
- bool *decrypt_error)
-{
- struct ath_hw *ah = common->ah;
- struct ieee80211_hdr *hdr;
- __le16 fc;
-
- hdr = (struct ieee80211_hdr *) skb->data;
- fc = hdr->frame_control;
-
- if (!rx_stats->rs_datalen)
- return false;
- /*
- * rs_status follows rs_datalen so if rs_datalen is too large
- * we can take a hint that hardware corrupted it, so ignore
- * those frames.
- */
- if (rx_stats->rs_datalen > common->rx_bufsize)
- return false;
-
- /*
- * rs_more indicates chained descriptors which can be used
- * to link buffers together for a sort of scatter-gather
- * operation.
- * reject the frame, we don't support scatter-gather yet and
- * the frame is probably corrupt anyway
- */
- if (rx_stats->rs_more)
- return false;
-
- /*
- * The rx_stats->rs_status will not be set until the end of the
- * chained descriptors so it can be ignored if rs_more is set. The
- * rs_more will be false at the last element of the chained
- * descriptors.
- */
- if (rx_stats->rs_status != 0) {
- if (rx_stats->rs_status & ATH9K_RXERR_CRC)
- rxs->flag |= RX_FLAG_FAILED_FCS_CRC;
- if (rx_stats->rs_status & ATH9K_RXERR_PHY)
- return false;
-
- if (rx_stats->rs_status & ATH9K_RXERR_DECRYPT) {
- *decrypt_error = true;
- } else if (rx_stats->rs_status & ATH9K_RXERR_MIC) {
- if (ieee80211_is_ctl(fc))
- /*
- * Sometimes, we get invalid
- * MIC failures on valid control frames.
- * Remove these mic errors.
- */
- rx_stats->rs_status &= ~ATH9K_RXERR_MIC;
- else
- rxs->flag |= RX_FLAG_MMIC_ERROR;
- }
- /*
- * Reject error frames with the exception of
- * decryption and MIC failures. For monitor mode,
- * we also ignore the CRC error.
- */
- if (ah->opmode == NL80211_IFTYPE_MONITOR) {
- if (rx_stats->rs_status &
- ~(ATH9K_RXERR_DECRYPT | ATH9K_RXERR_MIC |
- ATH9K_RXERR_CRC))
- return false;
- } else {
- if (rx_stats->rs_status &
- ~(ATH9K_RXERR_DECRYPT | ATH9K_RXERR_MIC)) {
- return false;
- }
- }
- }
- return true;
-}
-
-static int ath9k_process_rate(struct ath_common *common,
- struct ieee80211_hw *hw,
- struct ath_rx_status *rx_stats,
- struct ieee80211_rx_status *rxs,
- struct sk_buff *skb)
-{
- struct ieee80211_supported_band *sband;
- enum ieee80211_band band;
- unsigned int i = 0;
-
- band = hw->conf.channel->band;
- sband = hw->wiphy->bands[band];
-
- if (rx_stats->rs_rate & 0x80) {
- /* HT rate */
- rxs->flag |= RX_FLAG_HT;
- if (rx_stats->rs_flags & ATH9K_RX_2040)
- rxs->flag |= RX_FLAG_40MHZ;
- if (rx_stats->rs_flags & ATH9K_RX_GI)
- rxs->flag |= RX_FLAG_SHORT_GI;
- rxs->rate_idx = rx_stats->rs_rate & 0x7f;
- return 0;
- }
-
- for (i = 0; i < sband->n_bitrates; i++) {
- if (sband->bitrates[i].hw_value == rx_stats->rs_rate) {
- rxs->rate_idx = i;
- return 0;
- }
- if (sband->bitrates[i].hw_value_short == rx_stats->rs_rate) {
- rxs->flag |= RX_FLAG_SHORTPRE;
- rxs->rate_idx = i;
- return 0;
- }
- }
-
- /*
- * No valid hardware bitrate found -- we should not get here
- * because hardware has already validated this frame as OK.
- */
- ath_print(common, ATH_DBG_XMIT, "unsupported hw bitrate detected "
- "0x%02x using 1 Mbit\n", rx_stats->rs_rate);
- if ((common->debug_mask & ATH_DBG_XMIT))
- print_hex_dump_bytes("", DUMP_PREFIX_NONE, skb->data, skb->len);
-
- return -EINVAL;
-}
-
-static void ath9k_process_rssi(struct ath_common *common,
- struct ieee80211_hw *hw,
- struct sk_buff *skb,
- struct ath_rx_status *rx_stats)
-{
- struct ath_hw *ah = common->ah;
- struct ieee80211_sta *sta;
- struct ieee80211_hdr *hdr;
- struct ath_node *an;
- int last_rssi = ATH_RSSI_DUMMY_MARKER;
- __le16 fc;
-
- hdr = (struct ieee80211_hdr *)skb->data;
- fc = hdr->frame_control;
-
- rcu_read_lock();
- /*
- * XXX: use ieee80211_find_sta! This requires quite a bit of work
- * under the current ath9k virtual wiphy implementation as we have
- * no way of tying a vif to wiphy. Typically vifs are attached to
- * at least one sdata of a wiphy on mac80211 but with ath9k virtual
- * wiphy you'd have to iterate over every wiphy and each sdata.
- */
- sta = ieee80211_find_sta_by_hw(hw, hdr->addr2);
- if (sta) {
- an = (struct ath_node *) sta->drv_priv;
- if (rx_stats->rs_rssi != ATH9K_RSSI_BAD &&
- !rx_stats->rs_moreaggr)
- ATH_RSSI_LPF(an->last_rssi, rx_stats->rs_rssi);
- last_rssi = an->last_rssi;
- }
- rcu_read_unlock();
-
- if (likely(last_rssi != ATH_RSSI_DUMMY_MARKER))
- rx_stats->rs_rssi = ATH_EP_RND(last_rssi,
- ATH_RSSI_EP_MULTIPLIER);
- if (rx_stats->rs_rssi < 0)
- rx_stats->rs_rssi = 0;
-
- /* Update Beacon RSSI, this is used by ANI. */
- if (ieee80211_is_beacon(fc))
- ah->stats.avgbrssi = rx_stats->rs_rssi;
-}
-
-/*
- * For Decrypt or Demic errors, we only mark packet status here and always push
- * up the frame up to let mac80211 handle the actual error case, be it no
- * decryption key or real decryption error. This let us keep statistics there.
- */
-int ath9k_cmn_rx_skb_preprocess(struct ath_common *common,
- struct ieee80211_hw *hw,
- struct sk_buff *skb,
- struct ath_rx_status *rx_stats,
- struct ieee80211_rx_status *rx_status,
- bool *decrypt_error)
-{
- struct ath_hw *ah = common->ah;
-
- memset(rx_status, 0, sizeof(struct ieee80211_rx_status));
-
- /*
- * everything but the rate is checked here, the rate check is done
- * separately to avoid doing two lookups for a rate for each frame.
- */
- if (!ath9k_rx_accept(common, skb, rx_status, rx_stats, decrypt_error))
- return -EINVAL;
-
- ath9k_process_rssi(common, hw, skb, rx_stats);
-
- if (ath9k_process_rate(common, hw, rx_stats, rx_status, skb))
- return -EINVAL;
-
- rx_status->mactime = ath9k_hw_extend_tsf(ah, rx_stats->rs_tstamp);
- rx_status->band = hw->conf.channel->band;
- rx_status->freq = hw->conf.channel->center_freq;
- rx_status->signal = ATH_DEFAULT_NOISE_FLOOR + rx_stats->rs_rssi;
- rx_status->antenna = rx_stats->rs_antenna;
- rx_status->flag |= RX_FLAG_TSFT;
-
- return 0;
-}
-EXPORT_SYMBOL(ath9k_cmn_rx_skb_preprocess);
-
-void ath9k_cmn_rx_skb_postprocess(struct ath_common *common,
- struct sk_buff *skb,
- struct ath_rx_status *rx_stats,
- struct ieee80211_rx_status *rxs,
- bool decrypt_error)
-{
- struct ath_hw *ah = common->ah;
- struct ieee80211_hdr *hdr;
- int hdrlen, padpos, padsize;
- u8 keyix;
- __le16 fc;
-
- /* see if any padding is done by the hw and remove it */
- hdr = (struct ieee80211_hdr *) skb->data;
- hdrlen = ieee80211_get_hdrlen_from_skb(skb);
- fc = hdr->frame_control;
- padpos = ath9k_cmn_padpos(hdr->frame_control);
-
- /* The MAC header is padded to have 32-bit boundary if the
- * packet payload is non-zero. The general calculation for
- * padsize would take into account odd header lengths:
- * padsize = (4 - padpos % 4) % 4; However, since only
- * even-length headers are used, padding can only be 0 or 2
- * bytes and we can optimize this a bit. In addition, we must
- * not try to remove padding from short control frames that do
- * not have payload. */
- padsize = padpos & 3;
- if (padsize && skb->len>=padpos+padsize+FCS_LEN) {
- memmove(skb->data + padsize, skb->data, padpos);
- skb_pull(skb, padsize);
- }
-
- keyix = rx_stats->rs_keyix;
-
- if (!(keyix == ATH9K_RXKEYIX_INVALID) && !decrypt_error &&
- ieee80211_has_protected(fc)) {
- rxs->flag |= RX_FLAG_DECRYPTED;
- } else if (ieee80211_has_protected(fc)
- && !decrypt_error && skb->len >= hdrlen + 4) {
- keyix = skb->data[hdrlen + 3] >> 6;
-
- if (test_bit(keyix, common->keymap))
- rxs->flag |= RX_FLAG_DECRYPTED;
- }
- if (ah->sw_mgmt_crypto &&
- (rxs->flag & RX_FLAG_DECRYPTED) &&
- ieee80211_is_mgmt(fc))
- /* Use software decrypt for management frames. */
- rxs->flag &= ~RX_FLAG_DECRYPTED;
-}
-EXPORT_SYMBOL(ath9k_cmn_rx_skb_postprocess);
-
int ath9k_cmn_padpos(__le16 frame_control)
{
int padpos = 24;
diff --git a/drivers/net/wireless/ath/ath9k/common.h b/drivers/net/wireless/ath/ath9k/common.h
index e08f7e5..1e6f360 100644
--- a/drivers/net/wireless/ath/ath9k/common.h
+++ b/drivers/net/wireless/ath/ath9k/common.h
@@ -115,19 +115,6 @@ struct ath_node {
int last_rssi;
};
-int ath9k_cmn_rx_skb_preprocess(struct ath_common *common,
- struct ieee80211_hw *hw,
- struct sk_buff *skb,
- struct ath_rx_status *rx_stats,
- struct ieee80211_rx_status *rx_status,
- bool *decrypt_error);
-
-void ath9k_cmn_rx_skb_postprocess(struct ath_common *common,
- struct sk_buff *skb,
- struct ath_rx_status *rx_stats,
- struct ieee80211_rx_status *rxs,
- bool decrypt_error);
-
int ath9k_cmn_padpos(__le16 frame_control);
int ath9k_cmn_get_hw_crypto_keytype(struct sk_buff *skb);
void ath9k_cmn_update_ichannel(struct ieee80211_hw *hw,
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index ba13913..10092dd 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -815,6 +815,265 @@ static struct ath_buf *ath_get_next_rx_buf(struct ath_softc *sc,
return bf;
}
+/* Assumes you've already done the endian to CPU conversion */
+static bool ath9k_rx_accept(struct ath_common *common,
+ struct sk_buff *skb,
+ struct ieee80211_rx_status *rxs,
+ struct ath_rx_status *rx_stats,
+ bool *decrypt_error)
+{
+ struct ath_hw *ah = common->ah;
+ struct ieee80211_hdr *hdr;
+ __le16 fc;
+
+ hdr = (struct ieee80211_hdr *) skb->data;
+ fc = hdr->frame_control;
+
+ if (!rx_stats->rs_datalen)
+ return false;
+ /*
+ * rs_status follows rs_datalen so if rs_datalen is too large
+ * we can take a hint that hardware corrupted it, so ignore
+ * those frames.
+ */
+ if (rx_stats->rs_datalen > common->rx_bufsize)
+ return false;
+
+ /*
+ * rs_more indicates chained descriptors which can be used
+ * to link buffers together for a sort of scatter-gather
+ * operation.
+ * reject the frame, we don't support scatter-gather yet and
+ * the frame is probably corrupt anyway
+ */
+ if (rx_stats->rs_more)
+ return false;
+
+ /*
+ * The rx_stats->rs_status will not be set until the end of the
+ * chained descriptors so it can be ignored if rs_more is set. The
+ * rs_more will be false at the last element of the chained
+ * descriptors.
+ */
+ if (rx_stats->rs_status != 0) {
+ if (rx_stats->rs_status & ATH9K_RXERR_CRC)
+ rxs->flag |= RX_FLAG_FAILED_FCS_CRC;
+ if (rx_stats->rs_status & ATH9K_RXERR_PHY)
+ return false;
+
+ if (rx_stats->rs_status & ATH9K_RXERR_DECRYPT) {
+ *decrypt_error = true;
+ } else if (rx_stats->rs_status & ATH9K_RXERR_MIC) {
+ if (ieee80211_is_ctl(fc))
+ /*
+ * Sometimes, we get invalid
+ * MIC failures on valid control frames.
+ * Remove these mic errors.
+ */
+ rx_stats->rs_status &= ~ATH9K_RXERR_MIC;
+ else
+ rxs->flag |= RX_FLAG_MMIC_ERROR;
+ }
+ /*
+ * Reject error frames with the exception of
+ * decryption and MIC failures. For monitor mode,
+ * we also ignore the CRC error.
+ */
+ if (ah->opmode == NL80211_IFTYPE_MONITOR) {
+ if (rx_stats->rs_status &
+ ~(ATH9K_RXERR_DECRYPT | ATH9K_RXERR_MIC |
+ ATH9K_RXERR_CRC))
+ return false;
+ } else {
+ if (rx_stats->rs_status &
+ ~(ATH9K_RXERR_DECRYPT | ATH9K_RXERR_MIC)) {
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
+static int ath9k_process_rate(struct ath_common *common,
+ struct ieee80211_hw *hw,
+ struct ath_rx_status *rx_stats,
+ struct ieee80211_rx_status *rxs,
+ struct sk_buff *skb)
+{
+ struct ieee80211_supported_band *sband;
+ enum ieee80211_band band;
+ unsigned int i = 0;
+
+ band = hw->conf.channel->band;
+ sband = hw->wiphy->bands[band];
+
+ if (rx_stats->rs_rate & 0x80) {
+ /* HT rate */
+ rxs->flag |= RX_FLAG_HT;
+ if (rx_stats->rs_flags & ATH9K_RX_2040)
+ rxs->flag |= RX_FLAG_40MHZ;
+ if (rx_stats->rs_flags & ATH9K_RX_GI)
+ rxs->flag |= RX_FLAG_SHORT_GI;
+ rxs->rate_idx = rx_stats->rs_rate & 0x7f;
+ return 0;
+ }
+
+ for (i = 0; i < sband->n_bitrates; i++) {
+ if (sband->bitrates[i].hw_value == rx_stats->rs_rate) {
+ rxs->rate_idx = i;
+ return 0;
+ }
+ if (sband->bitrates[i].hw_value_short == rx_stats->rs_rate) {
+ rxs->flag |= RX_FLAG_SHORTPRE;
+ rxs->rate_idx = i;
+ return 0;
+ }
+ }
+
+ /*
+ * No valid hardware bitrate found -- we should not get here
+ * because hardware has already validated this frame as OK.
+ */
+ ath_print(common, ATH_DBG_XMIT, "unsupported hw bitrate detected "
+ "0x%02x using 1 Mbit\n", rx_stats->rs_rate);
+ if ((common->debug_mask & ATH_DBG_XMIT))
+ print_hex_dump_bytes("", DUMP_PREFIX_NONE, skb->data, skb->len);
+
+ return -EINVAL;
+}
+
+static void ath9k_process_rssi(struct ath_common *common,
+ struct ieee80211_hw *hw,
+ struct sk_buff *skb,
+ struct ath_rx_status *rx_stats)
+{
+ struct ath_hw *ah = common->ah;
+ struct ieee80211_sta *sta;
+ struct ieee80211_hdr *hdr;
+ struct ath_node *an;
+ int last_rssi = ATH_RSSI_DUMMY_MARKER;
+ __le16 fc;
+
+ hdr = (struct ieee80211_hdr *)skb->data;
+ fc = hdr->frame_control;
+
+ rcu_read_lock();
+ /*
+ * XXX: use ieee80211_find_sta! This requires quite a bit of work
+ * under the current ath9k virtual wiphy implementation as we have
+ * no way of tying a vif to wiphy. Typically vifs are attached to
+ * at least one sdata of a wiphy on mac80211 but with ath9k virtual
+ * wiphy you'd have to iterate over every wiphy and each sdata.
+ */
+ sta = ieee80211_find_sta_by_hw(hw, hdr->addr2);
+ if (sta) {
+ an = (struct ath_node *) sta->drv_priv;
+ if (rx_stats->rs_rssi != ATH9K_RSSI_BAD &&
+ !rx_stats->rs_moreaggr)
+ ATH_RSSI_LPF(an->last_rssi, rx_stats->rs_rssi);
+ last_rssi = an->last_rssi;
+ }
+ rcu_read_unlock();
+
+ if (likely(last_rssi != ATH_RSSI_DUMMY_MARKER))
+ rx_stats->rs_rssi = ATH_EP_RND(last_rssi,
+ ATH_RSSI_EP_MULTIPLIER);
+ if (rx_stats->rs_rssi < 0)
+ rx_stats->rs_rssi = 0;
+
+ /* Update Beacon RSSI, this is used by ANI. */
+ if (ieee80211_is_beacon(fc))
+ ah->stats.avgbrssi = rx_stats->rs_rssi;
+}
+
+/*
+ * For Decrypt or Demic errors, we only mark packet status here and always push
+ * up the frame up to let mac80211 handle the actual error case, be it no
+ * decryption key or real decryption error. This let us keep statistics there.
+ */
+static int ath9k_rx_skb_preprocess(struct ath_common *common,
+ struct ieee80211_hw *hw,
+ struct sk_buff *skb,
+ struct ath_rx_status *rx_stats,
+ struct ieee80211_rx_status *rx_status,
+ bool *decrypt_error)
+{
+ struct ath_hw *ah = common->ah;
+
+ memset(rx_status, 0, sizeof(struct ieee80211_rx_status));
+
+ /*
+ * everything but the rate is checked here, the rate check is done
+ * separately to avoid doing two lookups for a rate for each frame.
+ */
+ if (!ath9k_rx_accept(common, skb, rx_status, rx_stats, decrypt_error))
+ return -EINVAL;
+
+ ath9k_process_rssi(common, hw, skb, rx_stats);
+
+ if (ath9k_process_rate(common, hw, rx_stats, rx_status, skb))
+ return -EINVAL;
+
+ rx_status->mactime = ath9k_hw_extend_tsf(ah, rx_stats->rs_tstamp);
+ rx_status->band = hw->conf.channel->band;
+ rx_status->freq = hw->conf.channel->center_freq;
+ rx_status->signal = ATH_DEFAULT_NOISE_FLOOR + rx_stats->rs_rssi;
+ rx_status->antenna = rx_stats->rs_antenna;
+ rx_status->flag |= RX_FLAG_TSFT;
+
+ return 0;
+}
+
+static void ath9k_rx_skb_postprocess(struct ath_common *common,
+ struct sk_buff *skb,
+ struct ath_rx_status *rx_stats,
+ struct ieee80211_rx_status *rxs,
+ bool decrypt_error)
+{
+ struct ath_hw *ah = common->ah;
+ struct ieee80211_hdr *hdr;
+ int hdrlen, padpos, padsize;
+ u8 keyix;
+ __le16 fc;
+
+ /* see if any padding is done by the hw and remove it */
+ hdr = (struct ieee80211_hdr *) skb->data;
+ hdrlen = ieee80211_get_hdrlen_from_skb(skb);
+ fc = hdr->frame_control;
+ padpos = ath9k_cmn_padpos(hdr->frame_control);
+
+ /* The MAC header is padded to have 32-bit boundary if the
+ * packet payload is non-zero. The general calculation for
+ * padsize would take into account odd header lengths:
+ * padsize = (4 - padpos % 4) % 4; However, since only
+ * even-length headers are used, padding can only be 0 or 2
+ * bytes and we can optimize this a bit. In addition, we must
+ * not try to remove padding from short control frames that do
+ * not have payload. */
+ padsize = padpos & 3;
+ if (padsize && skb->len>=padpos+padsize+FCS_LEN) {
+ memmove(skb->data + padsize, skb->data, padpos);
+ skb_pull(skb, padsize);
+ }
+
+ keyix = rx_stats->rs_keyix;
+
+ if (!(keyix == ATH9K_RXKEYIX_INVALID) && !decrypt_error &&
+ ieee80211_has_protected(fc)) {
+ rxs->flag |= RX_FLAG_DECRYPTED;
+ } else if (ieee80211_has_protected(fc)
+ && !decrypt_error && skb->len >= hdrlen + 4) {
+ keyix = skb->data[hdrlen + 3] >> 6;
+
+ if (test_bit(keyix, common->keymap))
+ rxs->flag |= RX_FLAG_DECRYPTED;
+ }
+ if (ah->sw_mgmt_crypto &&
+ (rxs->flag & RX_FLAG_DECRYPTED) &&
+ ieee80211_is_mgmt(fc))
+ /* Use software decrypt for management frames. */
+ rxs->flag &= ~RX_FLAG_DECRYPTED;
+}
int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp)
{
@@ -877,8 +1136,8 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp)
if (flush)
goto requeue;
- retval = ath9k_cmn_rx_skb_preprocess(common, hw, skb, &rs,
- rxs, &decrypt_error);
+ retval = ath9k_rx_skb_preprocess(common, hw, skb, &rs,
+ rxs, &decrypt_error);
if (retval)
goto requeue;
@@ -902,8 +1161,8 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp)
if (ah->caps.rx_status_len)
skb_pull(skb, ah->caps.rx_status_len);
- ath9k_cmn_rx_skb_postprocess(common, skb, &rs,
- rxs, decrypt_error);
+ ath9k_rx_skb_postprocess(common, skb, &rs,
+ rxs, decrypt_error);
/* We will now give hardware our shiny new allocated skb */
bf->bf_mpdu = requeue_skb;
--
1.7.1
^ permalink raw reply related
* [PATCH 07/11] drivers/net/wireless: Storage class should be before const qualifier
From: Tobias Klauser @ 2010-05-20 8:38 UTC (permalink / raw)
To: linville, ilw, reinette.chatre, yi.zhu, luciano.coelho
Cc: linux-wireless, kernel-janitors, Tobias Klauser
The C99 specification states in section 6.11.5:
The placement of a storage-class specifier other than at the beginning
of the declaration specifiers in a declaration is an obsolescent
feature.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
---
drivers/net/wireless/iwlwifi/iwl-core.c | 4 ++--
drivers/net/wireless/wl12xx/wl1271_main.c | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 5a7eca8..5df3f88 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -2544,7 +2544,7 @@ void iwl_update_stats(struct iwl_priv *priv, bool is_tx, __le16 fc, u16 len)
EXPORT_SYMBOL(iwl_update_stats);
#endif
-const static char *get_csr_string(int cmd)
+static const char *get_csr_string(int cmd)
{
switch (cmd) {
IWL_CMD(CSR_HW_IF_CONFIG_REG);
@@ -2615,7 +2615,7 @@ void iwl_dump_csr(struct iwl_priv *priv)
}
EXPORT_SYMBOL(iwl_dump_csr);
-const static char *get_fh_string(int cmd)
+static const char *get_fh_string(int cmd)
{
switch (cmd) {
IWL_CMD(FH_RSCSR_CHNL0_STTS_WPTR_REG);
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
index b7d9137..b7a78e2 100644
--- a/drivers/net/wireless/wl12xx/wl1271_main.c
+++ b/drivers/net/wireless/wl12xx/wl1271_main.c
@@ -1991,7 +1991,7 @@ static struct ieee80211_channel wl1271_channels[] = {
};
/* mapping to indexes for wl1271_rates */
-const static u8 wl1271_rate_to_idx_2ghz[] = {
+static const u8 wl1271_rate_to_idx_2ghz[] = {
/* MCS rates are used only with 11n */
CONF_HW_RXTX_RATE_UNSUPPORTED, /* CONF_HW_RXTX_RATE_MCS7 */
CONF_HW_RXTX_RATE_UNSUPPORTED, /* CONF_HW_RXTX_RATE_MCS6 */
@@ -2103,7 +2103,7 @@ static struct ieee80211_channel wl1271_channels_5ghz[] = {
};
/* mapping to indexes for wl1271_rates_5ghz */
-const static u8 wl1271_rate_to_idx_5ghz[] = {
+static const u8 wl1271_rate_to_idx_5ghz[] = {
/* MCS rates are used only with 11n */
CONF_HW_RXTX_RATE_UNSUPPORTED, /* CONF_HW_RXTX_RATE_MCS7 */
CONF_HW_RXTX_RATE_UNSUPPORTED, /* CONF_HW_RXTX_RATE_MCS6 */
@@ -2139,7 +2139,7 @@ static struct ieee80211_supported_band wl1271_band_5ghz = {
.n_bitrates = ARRAY_SIZE(wl1271_rates_5ghz),
};
-const static u8 *wl1271_band_rate_to_idx[] = {
+static const u8 *wl1271_band_rate_to_idx[] = {
[IEEE80211_BAND_2GHZ] = wl1271_rate_to_idx_2ghz,
[IEEE80211_BAND_5GHZ] = wl1271_rate_to_idx_5ghz
};
--
1.6.3.3
^ permalink raw reply related
* How to scan APs with ATH5k?
From: Jaroslav Fojtik @ 2010-05-20 6:00 UTC (permalink / raw)
To: linux-wireless
In-Reply-To: <201005200852.03136.helmut.schaa@googlemail.com>
Dears,
I have a problem with AP scanning:
root@dvouramenna:/tmp# iwlist "wlan0" scanning
wlan0 Interface doesn't support scanning : Operation not supported
root@dvouramenna:/tmp# iwlist "wlan1" scanning
wlan1 Failed to read scan data : Resource temporarily unavailable
I am testing "compat-wireless-2.6.34-rc4".
I hope that this is a defect and should be reported somewhere into bugzilla.
regards
Jara
PS: this is my wireless devices:
02:08.0 Ethernet controller: Atheros Communications Inc. AR2413 802.11bg NIC (rev 01)
Subsystem: Atheros Communications Inc. TP-Link TL-WN510G Wireless CardBus Adapter
Flags: bus master, medium devsel, latency 168, IRQ 17
Memory at fdef0000 (32-bit, non-prefetchable) [size=64K]
Capabilities: [44] Power Management version 2
02:0a.0 Ethernet controller: Atheros Communications Inc. AR5212/AR5213 Multiprotocol MAC/baseband processor (rev 01)
Subsystem: Wistron NeWeb Corp. CM9 Wireless a/b/g MiniPCI Adapter
Flags: bus master, medium devsel, latency 168, IRQ 19
Memory at fdee0000 (32-bit, non-prefetchable) [size=64K]
Capabilities: [44] Power Management version 2
^ permalink raw reply
* Re: WLAN Regulatory Domain Germany
From: Luis R. Rodriguez @ 2010-05-20 7:03 UTC (permalink / raw)
To: Kurt Garloff; +Cc: Michael Green, David Quan, linux-wireless
In-Reply-To: <20100520064809.GC32757@tpkurt2.garloff.de>
On Wed, May 19, 2010 at 11:48 PM, Kurt Garloff <kurt@garloff.de> wrote:
> Luis,
>
> On Wed, May 19, 2010 at 03:20:24PM -0700, Luis R. Rodriguez wrote:
>> On Wed, May 19, 2010 at 10:29 AM, Kurt Garloff <kurt@garloff.de> wrote:
>> > country DE:
>> > # entries 279004 and 280006
>> > (2400 - 2483.5 @ 40), (N/A, 100 mW)
>> > # entry 303005
>> > (5150 - 5250 @ 40), (N/A, 100 mW), NO-OUTDOOR
>> > # entries 304002 and 305002
>> > (5250 - 5350 @ 40), (N/A, 100 mW), NO-OUTDOOR, DFS
>> > # entries 308002, 309001 and 310003
>> > (5470 - 5725 @ 40), (N/A, 500 mW), DFS
>> >
>> > 8<------------------------------------------------------------------------
>> >
>> > (Or in db, as displayed by iw reg get)
>> > country DE:
>> > (2400 - 2483 @ 40), (N/A, 20)
>> > (5150 - 5250 @ 40), (N/A, 20), NO-OUTDOOR
>> > (5250 - 5350 @ 40), (N/A, 20), NO-OUTDOOR, DFS
>> > (5470 - 5725 @ 40), (N/A, 27), DFS
>> >
>> > PS: I'm not subscribed, please copy responses to me.
>>
>> Thanks for the e-mail and your review, I've passed this to our
>> regulatory gods and it is now being picked at and reviewed.
>
> Thanks.
>
> Two more remarks:
> - Having looked at the framework how we handle this regulatory stuff
> in Linux these days, it looks very reasonable to me -- good job!
Thanks! Thank Johannes as well :)
> - The frequencies above (from Frequenznutzungsplan = freq. util. plan)
> are really the limits of the frequency ranges to be used, not channel
> center freqs. So if we'd have to put possible center freqs in there
> and assume 22MHz (+-11MHz) for the 2.4 GHz range, we'd need to put
> 2411 -- 2472.5 in the DB. Likewise, assuming 20MHz (+-10MHz for the
> 5GHz range, we'd specify 5160 -- 5240, 5240 -- 5340 and 5480 -- 5715),
> of, for 40MHz(+-20MHz) channels, it would be 5170 -- 5230, 5230 --
> 5330 and 5490 -- 5705. Such values are displayed with iw reg get
> for our neighbors NL, FR, ... which gave me the idea that we might
> not have the real boundaries in the db, but center freqs.
> That said, I'd think real boundaries make more sense, as channel
> widths may evolve over time ...
The db.txt rules uses the exact ranges, not the center of freq, the
bandwidth indicates the maximum bandwidth allowed. We had also revised
on linux-wireless some changes to make for future more complex
considerations. For details see:
http://wireless.kernel.org/en/developers/todo-list
Luis
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox