* Re: [PATCH 7/9] mac80211: add flags for STBC (Space-Time Block Coding)
From: Johannes Berg @ 2010-04-18 15:53 UTC (permalink / raw)
To: Felix Fietkau; +Cc: linux-wireless, linville, lrodriguez
In-Reply-To: <1271602602-8538-7-git-send-email-nbd@openwrt.org>
On Sun, 2010-04-18 at 16:56 +0200, Felix Fietkau wrote:
> Signed-off-by: Felix Fietkau <nbd@openwrt.org>
> ---
> include/linux/ieee80211.h | 1 +
> include/net/mac80211.h | 3 +++
> 2 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
> index 1252ba1..97b2eae 100644
> --- a/include/linux/ieee80211.h
> +++ b/include/linux/ieee80211.h
> @@ -876,6 +876,7 @@ struct ieee80211_ht_cap {
> #define IEEE80211_HT_CAP_SGI_40 0x0040
> #define IEEE80211_HT_CAP_TX_STBC 0x0080
> #define IEEE80211_HT_CAP_RX_STBC 0x0300
> +#define IEEE80211_HT_CAP_RX_STBC_SHIFT 8
> #define IEEE80211_HT_CAP_DELAY_BA 0x0400
> #define IEEE80211_HT_CAP_MAX_AMSDU 0x0800
> #define IEEE80211_HT_CAP_DSSSCCK40 0x1000
> diff --git a/include/net/mac80211.h b/include/net/mac80211.h
> index 75056dd..eadf794 100644
> --- a/include/net/mac80211.h
> +++ b/include/net/mac80211.h
> @@ -275,6 +275,8 @@ struct ieee80211_bss_conf {
> * MLME command (internal to mac80211 to figure out whether to send TX
> * status to user space)
> * @IEEE80211_TX_CTL_LDPC: tells the driver to use LDPC for this frame
> + * @IEEE80211_TX_CTL_STBC: tells the driver to use Space-Time Block Coding
> + * (STBC) for this frame.
> */
> enum mac80211_tx_control_flags {
> IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0),
> @@ -299,6 +301,7 @@ enum mac80211_tx_control_flags {
> IEEE80211_TX_INTFL_HAS_RADIOTAP = BIT(20),
> IEEE80211_TX_INTFL_NL80211_FRAME_TX = BIT(21),
> IEEE80211_TX_CTL_LDPC = BIT(22),
> + IEEE80211_TX_CTL_STBC = BIT(23),
What if the # of streams is different? That doesn't look sufficient.
johannes
^ permalink raw reply
* [PATCH 3/9] ath9k: update the MCS mask for MCS16 and above
From: Felix Fietkau @ 2010-04-18 14:56 UTC (permalink / raw)
To: linux-wireless; +Cc: linville, lrodriguez
In-Reply-To: <1271602602-8538-2-git-send-email-nbd@openwrt.org>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
drivers/net/wireless/ath/ath9k/xmit.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index fcbb4a8..5d3d563 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -19,7 +19,7 @@
#define BITS_PER_BYTE 8
#define OFDM_PLCP_BITS 22
-#define HT_RC_2_MCS(_rc) ((_rc) & 0x0f)
+#define HT_RC_2_MCS(_rc) ((_rc) & 0x1f)
#define HT_RC_2_STREAMS(_rc) ((((_rc) & 0x78) >> 3) + 1)
#define L_STF 8
#define L_LTF 8
--
1.6.4.2
^ permalink raw reply related
* [PATCH 1/9] ath9k: check for specific rx stuck conditions and recover from them
From: Felix Fietkau @ 2010-04-18 14:56 UTC (permalink / raw)
To: linux-wireless; +Cc: linville, lrodriguez
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
drivers/net/wireless/ath/ath9k/hw.c | 28 ++++++++++++++++++++++++++++
drivers/net/wireless/ath/ath9k/hw.h | 1 +
drivers/net/wireless/ath/ath9k/main.c | 3 ++-
3 files changed, 31 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 9aa40df..5a29048 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -1160,6 +1160,34 @@ static bool ath9k_hw_channel_change(struct ath_hw *ah,
return true;
}
+bool ath9k_hw_check_alive(struct ath_hw *ah)
+{
+ int count = 50;
+ u32 reg;
+
+ if (AR_SREV_9285_10_OR_LATER(ah))
+ return true;
+
+ do {
+ reg = REG_READ(ah, AR_OBS_BUS_1);
+
+ if ((reg & 0x7E7FFFEF) == 0x00702400)
+ continue;
+
+ switch (reg & 0x7E000B00) {
+ case 0x1E000000:
+ case 0x52000B00:
+ case 0x18000B00:
+ continue;
+ default:
+ return true;
+ }
+ } while (count-- > 0);
+
+ return false;
+}
+EXPORT_SYMBOL(ath9k_hw_check_alive);
+
int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
bool bChannelChange)
{
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index 8158e8e..a78e09b 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -869,6 +869,7 @@ void ath9k_hw_set11nmac2040(struct ath_hw *ah);
void ath9k_hw_beaconinit(struct ath_hw *ah, u32 next_beacon, u32 beacon_period);
void ath9k_hw_set_sta_beacon_timers(struct ath_hw *ah,
const struct ath9k_beacon_state *bs);
+bool ath9k_hw_check_alive(struct ath_hw *ah);
bool ath9k_hw_setpower(struct ath_hw *ah, enum ath9k_power_mode mode);
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 1f4ea74..0246e7a 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -405,7 +405,8 @@ void ath9k_tasklet(unsigned long data)
ath9k_ps_wakeup(sc);
- if (status & ATH9K_INT_FATAL) {
+ if ((status & ATH9K_INT_FATAL) ||
+ !ath9k_hw_check_alive(ah)) {
ath_reset(sc, false);
ath9k_ps_restore(sc);
return;
--
1.6.4.2
^ permalink raw reply related
* [PATCH 4/9] ath9k: update the ath_max_4ms_framelen table
From: Felix Fietkau @ 2010-04-18 14:56 UTC (permalink / raw)
To: linux-wireless; +Cc: linville, lrodriguez
In-Reply-To: <1271602602-8538-3-git-send-email-nbd@openwrt.org>
Include MCS0-31 and also add SGI for HT20. This makes it
possible to support more different rate combinations with
newer hardware.
Based on a patch by Selvam. T.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
drivers/net/wireless/ath/ath9k/xmit.c | 41 +++++++++++++++++++++-----------
1 files changed, 27 insertions(+), 14 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 5d3d563..4078982 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -71,24 +71,36 @@ static void ath_tx_rc_status(struct ath_buf *bf, struct ath_tx_status *ts,
int nbad, int txok, bool update_rc);
enum {
- MCS_DEFAULT,
+ MCS_HT20,
+ MCS_HT20_SGI,
MCS_HT40,
MCS_HT40_SGI,
};
-static int ath_max_4ms_framelen[3][16] = {
- [MCS_DEFAULT] = {
- 3216, 6434, 9650, 12868, 19304, 25740, 28956, 32180,
- 6430, 12860, 19300, 25736, 38600, 51472, 57890, 64320,
+static int ath_max_4ms_framelen[4][32] = {
+ [MCS_HT20] = {
+ 3212, 6432, 9648, 12864, 19300, 25736, 28952, 32172,
+ 6424, 12852, 19280, 25708, 38568, 51424, 57852, 64280,
+ 9628, 19260, 28896, 38528, 57792, 65532, 65532, 65532,
+ 12828, 25656, 38488, 51320, 65532, 65532, 65532, 65532,
+ },
+ [MCS_HT20_SGI] = {
+ 3572, 7144, 10720, 14296, 21444, 28596, 32172, 35744,
+ 7140, 14284, 21428, 28568, 42856, 57144, 64288, 65532,
+ 10700, 21408, 32112, 42816, 64228, 65532, 65532, 65532,
+ 14256, 28516, 42780, 57040, 65532, 65532, 65532, 65532,
},
[MCS_HT40] = {
- 6684, 13368, 20052, 26738, 40104, 53476, 60156, 66840,
- 13360, 26720, 40080, 53440, 80160, 106880, 120240, 133600,
+ 6680, 13360, 20044, 26724, 40092, 53456, 60140, 65532,
+ 13348, 26700, 40052, 53400, 65532, 65532, 65532, 65532,
+ 20004, 40008, 60016, 65532, 65532, 65532, 65532, 65532,
+ 26644, 53292, 65532, 65532, 65532, 65532, 65532, 65532,
},
[MCS_HT40_SGI] = {
- /* TODO: Only MCS 7 and 15 updated, recalculate the rest */
- 6684, 13368, 20052, 26738, 40104, 53476, 60156, 74200,
- 13360, 26720, 40080, 53440, 80160, 106880, 120240, 148400,
+ 7420, 14844, 22272, 29696, 44544, 59396, 65532, 65532,
+ 14832, 29668, 44504, 59340, 65532, 65532, 65532, 65532,
+ 22232, 44464, 65532, 65532, 65532, 65532, 65532, 65532,
+ 29616, 59232, 65532, 65532, 65532, 65532, 65532, 65532,
}
};
@@ -538,12 +550,13 @@ static u32 ath_lookup_rate(struct ath_softc *sc, struct ath_buf *bf,
break;
}
- if (rates[i].flags & IEEE80211_TX_RC_SHORT_GI)
- modeidx = MCS_HT40_SGI;
- else if (rates[i].flags & IEEE80211_TX_RC_40_MHZ_WIDTH)
+ if (rates[i].flags & IEEE80211_TX_RC_40_MHZ_WIDTH)
modeidx = MCS_HT40;
else
- modeidx = MCS_DEFAULT;
+ modeidx = MCS_HT20;
+
+ if (rates[i].flags & IEEE80211_TX_RC_SHORT_GI)
+ modeidx++;
frmlen = ath_max_4ms_framelen[modeidx][rates[i].idx];
max_4ms_framelen = min(max_4ms_framelen, frmlen);
--
1.6.4.2
^ permalink raw reply related
* [PATCH 6/9] ath9k: initialize the number of tx/rx streams correctly
From: Felix Fietkau @ 2010-04-18 14:56 UTC (permalink / raw)
To: linux-wireless; +Cc: linville, lrodriguez
In-Reply-To: <1271602602-8538-5-git-send-email-nbd@openwrt.org>
AR9300 based hardware can 3x3 MCS rates, this should be set in the
HT capabilities.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
drivers/net/wireless/ath/ath9k/init.c | 39 +++++++++++++++++++++++---------
1 files changed, 28 insertions(+), 11 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index ca6e781..2c0630e 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -175,6 +175,18 @@ static const struct ath_ops ath9k_common_ops = {
.write = ath9k_iowrite32,
};
+static int count_streams(unsigned int chainmask, int max)
+{
+ int streams = 0;
+
+ do {
+ if (++streams == max)
+ break;
+ } while ((chainmask = chainmask & (chainmask - 1)));
+
+ return streams;
+}
+
/**************************/
/* Initialization */
/**************************/
@@ -182,8 +194,10 @@ static const struct ath_ops ath9k_common_ops = {
static void setup_ht_cap(struct ath_softc *sc,
struct ieee80211_sta_ht_cap *ht_info)
{
- struct ath_common *common = ath9k_hw_common(sc->sc_ah);
+ struct ath_hw *ah = sc->sc_ah;
+ struct ath_common *common = ath9k_hw_common(ah);
u8 tx_streams, rx_streams;
+ int i, max_streams;
ht_info->ht_supported = true;
ht_info->cap = IEEE80211_HT_CAP_SUP_WIDTH_20_40 |
@@ -197,25 +211,28 @@ static void setup_ht_cap(struct ath_softc *sc,
ht_info->ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K;
ht_info->ampdu_density = IEEE80211_HT_MPDU_DENSITY_8;
+ if (AR_SREV_9300_20_OR_LATER(ah))
+ max_streams = 3;
+ else
+ max_streams = 2;
+
/* set up supported mcs set */
memset(&ht_info->mcs, 0, sizeof(ht_info->mcs));
- tx_streams = !(common->tx_chainmask & (common->tx_chainmask - 1)) ?
- 1 : 2;
- rx_streams = !(common->rx_chainmask & (common->rx_chainmask - 1)) ?
- 1 : 2;
+ tx_streams = count_streams(common->tx_chainmask, max_streams);
+ rx_streams = count_streams(common->rx_chainmask, max_streams);
+
+ ath_print(common, ATH_DBG_CONFIG,
+ "TX streams %d, RX streams: %d\n",
+ tx_streams, rx_streams);
if (tx_streams != rx_streams) {
- ath_print(common, ATH_DBG_CONFIG,
- "TX streams %d, RX streams: %d\n",
- tx_streams, rx_streams);
ht_info->mcs.tx_params |= IEEE80211_HT_MCS_TX_RX_DIFF;
ht_info->mcs.tx_params |= ((tx_streams - 1) <<
IEEE80211_HT_MCS_TX_MAX_STREAMS_SHIFT);
}
- ht_info->mcs.rx_mask[0] = 0xff;
- if (rx_streams >= 2)
- ht_info->mcs.rx_mask[1] = 0xff;
+ for (i = 0; i < rx_streams; i++)
+ ht_info->mcs.rx_mask[i] = 0xff;
ht_info->mcs.tx_params |= IEEE80211_HT_MCS_TX_DEFINED;
}
--
1.6.4.2
^ permalink raw reply related
* [PATCH 7/9] mac80211: add flags for STBC (Space-Time Block Coding)
From: Felix Fietkau @ 2010-04-18 14:56 UTC (permalink / raw)
To: linux-wireless; +Cc: linville, lrodriguez
In-Reply-To: <1271602602-8538-6-git-send-email-nbd@openwrt.org>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
include/linux/ieee80211.h | 1 +
include/net/mac80211.h | 3 +++
2 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 1252ba1..97b2eae 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -876,6 +876,7 @@ struct ieee80211_ht_cap {
#define IEEE80211_HT_CAP_SGI_40 0x0040
#define IEEE80211_HT_CAP_TX_STBC 0x0080
#define IEEE80211_HT_CAP_RX_STBC 0x0300
+#define IEEE80211_HT_CAP_RX_STBC_SHIFT 8
#define IEEE80211_HT_CAP_DELAY_BA 0x0400
#define IEEE80211_HT_CAP_MAX_AMSDU 0x0800
#define IEEE80211_HT_CAP_DSSSCCK40 0x1000
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 75056dd..eadf794 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -275,6 +275,8 @@ struct ieee80211_bss_conf {
* MLME command (internal to mac80211 to figure out whether to send TX
* status to user space)
* @IEEE80211_TX_CTL_LDPC: tells the driver to use LDPC for this frame
+ * @IEEE80211_TX_CTL_STBC: tells the driver to use Space-Time Block Coding
+ * (STBC) for this frame.
*/
enum mac80211_tx_control_flags {
IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0),
@@ -299,6 +301,7 @@ enum mac80211_tx_control_flags {
IEEE80211_TX_INTFL_HAS_RADIOTAP = BIT(20),
IEEE80211_TX_INTFL_NL80211_FRAME_TX = BIT(21),
IEEE80211_TX_CTL_LDPC = BIT(22),
+ IEEE80211_TX_CTL_STBC = BIT(23),
};
/**
--
1.6.4.2
^ permalink raw reply related
* [PATCH 9/9] ath9k: set the STBC flag in rate control if the peer supports it
From: Felix Fietkau @ 2010-04-18 14:56 UTC (permalink / raw)
To: linux-wireless; +Cc: linville, lrodriguez
In-Reply-To: <1271602602-8538-8-git-send-email-nbd@openwrt.org>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
drivers/net/wireless/ath/ath9k/rc.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
index bf3ad7a..7f2000c 100644
--- a/drivers/net/wireless/ath/ath9k/rc.c
+++ b/drivers/net/wireless/ath/ath9k/rc.c
@@ -700,6 +700,10 @@ static void ath_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta,
(sta->ht_cap.cap & IEEE80211_HT_CAP_LDPC_CODING))
tx_info->flags |= IEEE80211_TX_CTL_LDPC;
+ if (conf_is_ht(&sc->hw->conf) &&
+ (sta->ht_cap.cap & IEEE80211_HT_CAP_TX_STBC))
+ tx_info->flags |= IEEE80211_TX_CTL_STBC;
+
if (is_probe) {
/* set one try for probe rates. For the
* probes don't enable rts */
--
1.6.4.2
^ permalink raw reply related
* Re: [PATCH 1/3] compat-wireless: backport convert multicast list to list_head.
From: Pavel Roskin @ 2010-04-18 14:15 UTC (permalink / raw)
To: Hauke Mehrtens; +Cc: lrodriguez, linux-wireless, mcgrof
In-Reply-To: <1271597784-4811-2-git-send-email-hauke@hauke-m.de>
Hello, Hauke!
Thank you for doing this effort! I would prefer that we avoid
patching as much as possible. Patches tend to break as the code
changes. I think there are several cases where patching can be
eliminated.
> ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
> + struct netdev_hw_addr *ha;
> ++#else
> ++ struct dev_mc_list *ha;
> ++#endif
We could simply use this in some header:
#define dev_mc_list netdev_hw_addr
> + /* comoute mc addresses' hash value ,and put it into hash table */
Someone had a bout of dyslexia, and it will be fixed, breaking the patch :-)
> + netdev_for_each_mc_addr(ha, netdev) {
> ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
> + hash_value = atl1c_hash_mc_addr(hw, ha->addr);
> ++#else
> ++ hash_value = atl1c_hash_mc_addr(hw, ha->dmi_addr);
> ++#endif
#define addr dmi_addr
OK, this is likely to break if done in a header, but maybe it could be
done in the C code away from the rest of the code.
> ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
> + __hw_addr_unsync(&local->mc_list, &dev->mc, dev->addr_len);
> ++#else
> ++ __dev_addr_unsync(&local->mc_list, &local->mc_count,
> ++ &dev->mc_list, &dev->mc_count);
> ++#endif
Cannot we reimplement __hw_addr_unsync()?
> ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
> +
> + __hw_addr_init(&local->mc_list);
> +
> ++#endif
That could be an empty function.
--
Regards,
Pavel Roskin
^ permalink raw reply
* [PATCH 2/2] compat: Add linux/version.h include before using it.
From: Hauke Mehrtens @ 2010-04-18 13:37 UTC (permalink / raw)
To: lrodriguez; +Cc: linux-wireless, mcgrof, Hauke Mehrtens
In-Reply-To: <1271597877-4878-1-git-send-email-hauke@hauke-m.de>
This causes problems if theses header files are used without including
linux/compat-2.6.h
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
include/linux/tracepoint.h | 2 ++
include/net/net_namespace.h | 2 ++
include/trace/define_trace.h | 2 ++
3 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index 7484716..9f5add1 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -1,6 +1,8 @@
#ifndef _COMPAT_LINUX_TRACEPOINT_H
#define _COMPAT_LINUX_TRACEPOINT_H 1
+#include <linux/version.h>
+
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,27))
#include_next <linux/tracepoint.h>
#endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,27)) */
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index 206c0c1..0f74944 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -1,6 +1,8 @@
#ifndef _COMPAT_NET_NET_NAMESPACE_H
#define _COMPAT_NET_NET_NAMESPACE_H 1
+#include <linux/version.h>
+
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,23))
#include_next <net/net_namespace.h>
#endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,23)) */
diff --git a/include/trace/define_trace.h b/include/trace/define_trace.h
index f5c01de..a31105a 100644
--- a/include/trace/define_trace.h
+++ b/include/trace/define_trace.h
@@ -1,6 +1,8 @@
#ifndef _COMPAT_TRACE_DEFINE_TRACE_H
#define _COMPAT_TRACE_DEFINE_TRACE_H 1
+#include <linux/version.h>
+
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30))
#include_next <trace/define_trace.h>
#endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30)) */
--
1.6.3.3
^ permalink raw reply related
* [PATCH 1/2] compat: Add definitions needed for libertas sdio driver.
From: Hauke Mehrtens @ 2010-04-18 13:37 UTC (permalink / raw)
To: lrodriguez; +Cc: linux-wireless, mcgrof, Hauke Mehrtens
In-Reply-To: <1271597877-4878-1-git-send-email-hauke@hauke-m.de>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
include/linux/compat-2.6.35.h | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/include/linux/compat-2.6.35.h b/include/linux/compat-2.6.35.h
index 7387c46..964e8dc 100644
--- a/include/linux/compat-2.6.35.h
+++ b/include/linux/compat-2.6.35.h
@@ -8,6 +8,9 @@
#define IW_HANDLER(id, func) \
[IW_IOCTL_IDX(id)] = func
+#define SDIO_BUS_ECSI 0x20 /* Enable continuous SPI interrupt */
+#define SDIO_BUS_SCSI 0x40 /* Support continuous SPI interrupt */
+
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)) */
#endif /* LINUX_26_35_COMPAT_H */
--
1.6.3.3
^ permalink raw reply related
* [PATCH 0/2] compat-wireless: compile fixes
From: Hauke Mehrtens @ 2010-04-18 13:37 UTC (permalink / raw)
To: lrodriguez; +Cc: linux-wireless, mcgrof, Hauke Mehrtens
This series contains mostly compile fixes.
It was compile tested on kernel 2.6.25 to 2.6.34 and ath9k is working in
Ubuntu 9.04.
Hauke Mehrtens (2):
compat: Add definitions needed for libertas sdio driver.
compat: Add linux/version.h include before using it.
include/linux/compat-2.6.35.h | 3 +++
include/linux/tracepoint.h | 2 ++
include/net/net_namespace.h | 2 ++
include/trace/define_trace.h | 2 ++
4 files changed, 9 insertions(+), 0 deletions(-)
^ permalink raw reply
* [PATCH 3/3] compat-wireless: include net and trace includes form compat.
From: Hauke Mehrtens @ 2010-04-18 13:36 UTC (permalink / raw)
To: lrodriguez; +Cc: linux-wireless, mcgrof, Hauke Mehrtens
In-Reply-To: <1271597784-4811-1-git-send-email-hauke@hauke-m.de>
The includes form the net and trace directory of compat were not copyed.
This broke compilation on older kernels that needed some files in these
directories from compat.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
scripts/admin-update.sh | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/scripts/admin-update.sh b/scripts/admin-update.sh
index 36cdfac..39fafb2 100755
--- a/scripts/admin-update.sh
+++ b/scripts/admin-update.sh
@@ -116,6 +116,7 @@ DRIVER_FILES="$DRIVER_FILES mwl8k.c"
mkdir -p include/linux/ include/net/ include/linux/usb \
include/linux/unaligned \
include/linux/spi \
+ include/trace \
net/mac80211/ net/wireless/ \
net/rfkill/ \
drivers/ssb/ \
@@ -233,6 +234,8 @@ cp $GIT_COMPAT_TREE/compat/Makefile $COMPAT/
cp -a $GIT_COMPAT_TREE/udev/ .
cp -a $GIT_COMPAT_TREE/scripts/ $COMPAT/
cp -a $GIT_COMPAT_TREE/include/linux/* include/linux/
+cp -a $GIT_COMPAT_TREE/include/net/* include/net/
+cp -a $GIT_COMPAT_TREE/include/trace/* include/trace/
rm -f $COMPAT/*.mod.c
# Refresh patches using quilt
--
1.6.3.3
^ permalink raw reply related
* [PATCH 1/3] compat-wireless: backport convert multicast list to list_head.
From: Hauke Mehrtens @ 2010-04-18 13:36 UTC (permalink / raw)
To: lrodriguez; +Cc: linux-wireless, mcgrof, Hauke Mehrtens
In-Reply-To: <1271597784-4811-1-git-send-email-hauke@hauke-m.de>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
patches/25-multicast-list_head.patch | 813 ++++++++++++++++++++++++++++++++++
1 files changed, 813 insertions(+), 0 deletions(-)
create mode 100644 patches/25-multicast-list_head.patch
diff --git a/patches/25-multicast-list_head.patch b/patches/25-multicast-list_head.patch
new file mode 100644
index 0000000..a420187
--- /dev/null
+++ b/patches/25-multicast-list_head.patch
@@ -0,0 +1,813 @@
+Backport commit 22bedad3ce112d5ca1eaf043d4990fa2ed698c87:
+ net: convert multicast list to list_head
+
+ Converts the list and the core manipulating with it to be the same as uc_list.
+
+ +uses two functions for adding/removing mc address (normal and "global"
+ variant) instead of a function parameter.
+ +removes dev_mcast.c completely.
+ +exposes netdev_hw_addr_list_* macros along with __hw_addr_* functions for
+ manipulation with lists on a sandbox (used in bonding and 80211 drivers)
+
+This also backport commit 2f787b0b76bf5de2eaa3ca3a29d89123ae03c856
+
+--- a/drivers/net/atl1c/atl1c_main.c
++++ b/drivers/net/atl1c/atl1c_main.c
+@@ -354,7 +354,11 @@ static void atl1c_set_multi(struct net_d
+ {
+ struct atl1c_adapter *adapter = netdev_priv(netdev);
+ struct atl1c_hw *hw = &adapter->hw;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ struct netdev_hw_addr *ha;
++#else
++ struct dev_mc_list *ha;
++#endif
+ u32 mac_ctrl_data;
+ u32 hash_value;
+
+@@ -378,7 +382,11 @@ static void atl1c_set_multi(struct net_d
+
+ /* comoute mc addresses' hash value ,and put it into hash table */
+ netdev_for_each_mc_addr(ha, netdev) {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ hash_value = atl1c_hash_mc_addr(hw, ha->addr);
++#else
++ hash_value = atl1c_hash_mc_addr(hw, ha->dmi_addr);
++#endif
+ atl1c_hash_set(hw, hash_value);
+ }
+ }
+--- a/drivers/net/atl1e/atl1e_main.c
++++ b/drivers/net/atl1e/atl1e_main.c
+@@ -284,7 +284,11 @@ static void atl1e_set_multi(struct net_d
+ {
+ struct atl1e_adapter *adapter = netdev_priv(netdev);
+ struct atl1e_hw *hw = &adapter->hw;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ struct netdev_hw_addr *ha;
++#else
++ struct dev_mc_list *ha;
++#endif
+ u32 mac_ctrl_data = 0;
+ u32 hash_value;
+
+@@ -308,7 +312,11 @@ static void atl1e_set_multi(struct net_d
+
+ /* comoute mc addresses' hash value ,and put it into hash table */
+ netdev_for_each_mc_addr(ha, netdev) {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ hash_value = atl1e_hash_mc_addr(hw, ha->addr);
++#else
++ hash_value = atl1e_hash_mc_addr(hw, ha->dmi_addr);
++#endif
+ atl1e_hash_set(hw, hash_value);
+ }
+ }
+--- a/drivers/net/atlx/atl2.c
++++ b/drivers/net/atlx/atl2.c
+@@ -136,7 +136,11 @@ static void atl2_set_multi(struct net_de
+ {
+ struct atl2_adapter *adapter = netdev_priv(netdev);
+ struct atl2_hw *hw = &adapter->hw;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ struct netdev_hw_addr *ha;
++#else
++ struct dev_mc_list *ha;
++#endif
+ u32 rctl;
+ u32 hash_value;
+
+@@ -159,7 +163,11 @@ static void atl2_set_multi(struct net_de
+
+ /* comoute mc addresses' hash value ,and put it into hash table */
+ netdev_for_each_mc_addr(ha, netdev) {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ hash_value = atl2_hash_mc_addr(hw, ha->addr);
++#else
++ hash_value = atl2_hash_mc_addr(hw, ha->dmi_addr);
++#endif
+ atl2_hash_set(hw, hash_value);
+ }
+ }
+--- a/drivers/net/atlx/atlx.c
++++ b/drivers/net/atlx/atlx.c
+@@ -123,7 +123,11 @@ static void atlx_set_multi(struct net_de
+ {
+ struct atlx_adapter *adapter = netdev_priv(netdev);
+ struct atlx_hw *hw = &adapter->hw;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ struct netdev_hw_addr *ha;
++#else
++ struct dev_mc_list *ha;
++#endif
+ u32 rctl;
+ u32 hash_value;
+
+@@ -145,7 +149,11 @@ static void atlx_set_multi(struct net_de
+
+ /* compute mc addresses' hash value ,and put it into hash table */
+ netdev_for_each_mc_addr(ha, netdev) {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ hash_value = atlx_hash_mc_addr(hw, ha->addr);
++#else
++ hash_value = atlx_hash_mc_addr(hw, ha->dmi_addr);
++#endif
+ atlx_hash_set(hw, hash_value);
+ }
+ }
+--- a/drivers/net/b44.c
++++ b/drivers/net/b44.c
+@@ -1681,7 +1681,11 @@ static struct net_device_stats *b44_get_
+
+ static int __b44_load_mcast(struct b44 *bp, struct net_device *dev)
+ {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ struct netdev_hw_addr *ha;
++#else
++ struct dev_mc_list *ha;
++#endif
+ int i, num_ents;
+
+ num_ents = min_t(int, netdev_mc_count(dev), B44_MCAST_TABLE_SIZE);
+@@ -1689,7 +1693,11 @@ static int __b44_load_mcast(struct b44 *
+ netdev_for_each_mc_addr(ha, dev) {
+ if (i == num_ents)
+ break;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ __b44_cam_write(bp, ha->addr, i++ + 1);
++#else
++ __b44_cam_write(bp, ha->dmi_addr, i++ + 1);
++#endif
+ }
+ return i+1;
+ }
+--- a/drivers/net/wireless/adm8211.c
++++ b/drivers/net/wireless/adm8211.c
+@@ -1318,19 +1318,37 @@ static void adm8211_bss_info_changed(str
+ }
+
+ static u64 adm8211_prepare_multicast(struct ieee80211_hw *hw,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ struct netdev_hw_addr_list *mc_list)
++#else
++ int mc_count, struct dev_addr_list *ha)
++#endif
+ {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ unsigned int bit_nr;
+- u32 mc_filter[2];
+ struct netdev_hw_addr *ha;
++#else
++ unsigned int bit_nr, i;
++#endif
++ u32 mc_filter[2];
+
+ mc_filter[1] = mc_filter[0] = 0;
+
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ netdev_hw_addr_list_for_each(ha, mc_list) {
+ bit_nr = ether_crc(ETH_ALEN, ha->addr) >> 26;
++#else
++ for (i = 0; i < mc_count; i++) {
++ if (!ha)
++ break;
++ bit_nr = ether_crc(ETH_ALEN, ha->dmi_addr) >> 26;
++#endif
+
+ bit_nr &= 0x3F;
+ mc_filter[bit_nr >> 5] |= 1 << (bit_nr & 31);
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35))
++ ha = ha->next;
++#endif
+ }
+
+ return mc_filter[0] | ((u64)(mc_filter[1]) << 32);
+--- a/drivers/net/wireless/ath/ar9170/main.c
++++ b/drivers/net/wireless/ath/ar9170/main.c
+@@ -2047,17 +2047,35 @@ out:
+ return err;
+ }
+
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ static u64 ar9170_op_prepare_multicast(struct ieee80211_hw *hw,
+ struct netdev_hw_addr_list *mc_list)
++#else
++static u64 ar9170_op_prepare_multicast(struct ieee80211_hw *hw, int mc_count,
++ struct dev_addr_list *ha)
++#endif
+ {
+ u64 mchash;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ struct netdev_hw_addr *ha;
++#else
++ int i;
++#endif
+
+ /* always get broadcast frames */
+ mchash = 1ULL << (0xff >> 2);
+
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ netdev_hw_addr_list_for_each(ha, mc_list)
+ mchash |= 1ULL << (ha->addr[5] >> 2);
++#else
++ for (i = 0; i < mc_count; i++) {
++ if (WARN_ON(!ha))
++ break;
++ mchash |= 1ULL << (ha->dmi_addr[5] >> 2);
++ ha = ha->next;
++ }
++#endif
+
+ return mchash;
+ }
+--- a/drivers/net/wireless/ath/ath5k/base.c
++++ b/drivers/net/wireless/ath/ath5k/base.c
+@@ -263,7 +263,11 @@ static void ath5k_remove_interface(struc
+ struct ieee80211_vif *vif);
+ static int ath5k_config(struct ieee80211_hw *hw, u32 changed);
+ static u64 ath5k_prepare_multicast(struct ieee80211_hw *hw,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ struct netdev_hw_addr_list *mc_list);
++#else
++ int mc_count, struct dev_addr_list *mc_list);
++#endif
+ static void ath5k_configure_filter(struct ieee80211_hw *hw,
+ unsigned int changed_flags,
+ unsigned int *new_flags,
+@@ -3105,20 +3109,42 @@ unlock:
+ }
+
+ static u64 ath5k_prepare_multicast(struct ieee80211_hw *hw,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ struct netdev_hw_addr_list *mc_list)
++#else
++ int mc_count, struct dev_addr_list *ha)
++#endif
+ {
+ u32 mfilt[2], val;
+ u8 pos;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ struct netdev_hw_addr *ha;
++#else
++ int i;
++#endif
+
+ mfilt[0] = 0;
+ mfilt[1] = 1;
+
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ netdev_hw_addr_list_for_each(ha, mc_list) {
++#else
++ for (i = 0; i < mc_count; i++) {
++ if (!ha)
++ break;
++#endif
+ /* calculate XOR of eight 6-bit values */
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ val = get_unaligned_le32(ha->addr + 0);
++#else
++ val = get_unaligned_le32(ha->dmi_addr + 0);
++#endif
+ pos = (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ val = get_unaligned_le32(ha->addr + 3);
++#else
++ val = get_unaligned_le32(ha->dmi_addr + 3);
++#endif
+ pos ^= (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val;
+ pos &= 0x3f;
+ mfilt[pos / 32] |= (1 << (pos % 32));
+@@ -3127,6 +3153,9 @@ static u64 ath5k_prepare_multicast(struc
+ * neet to inform below to not reset the mcast */
+ /* ath5k_hw_set_mcast_filterindex(ah,
+ * ha->addr[5]); */
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35))
++ ha = ha->next;
++#endif
+ }
+
+ return ((u64)(mfilt[1]) << 32) | mfilt[0];
+--- a/drivers/net/wireless/libertas/main.c
++++ b/drivers/net/wireless/libertas/main.c
+@@ -319,7 +319,11 @@ static int lbs_add_mcast_addrs(struct cm
+ struct net_device *dev, int nr_addrs)
+ {
+ int i = nr_addrs;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ struct netdev_hw_addr *ha;
++#else
++ struct dev_mc_list *ha;
++#endif
+ int cnt;
+
+ if ((dev->flags & (IFF_UP|IFF_MULTICAST)) != (IFF_UP|IFF_MULTICAST))
+@@ -328,18 +332,34 @@ static int lbs_add_mcast_addrs(struct cm
+ netif_addr_lock_bh(dev);
+ cnt = netdev_mc_count(dev);
+ netdev_for_each_mc_addr(ha, dev) {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ if (mac_in_list(cmd->maclist, nr_addrs, ha->addr)) {
++#else
++ if (mac_in_list(cmd->maclist, nr_addrs, ha->dmi_addr)) {
++#endif
+ lbs_deb_net("mcast address %s:%pM skipped\n", dev->name,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ ha->addr);
++#else
++ ha->dmi_addr);
++#endif
+ cnt--;
+ continue;
+ }
+
+ if (i == MRVDRV_MAX_MULTICAST_LIST_SIZE)
+ break;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ memcpy(&cmd->maclist[6*i], ha->addr, ETH_ALEN);
++#else
++ memcpy(&cmd->maclist[6*i], ha->dmi_addr, ETH_ALEN);
++#endif
+ lbs_deb_net("mcast address %s:%pM added to filter\n", dev->name,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ ha->addr);
++#else
++ ha->dmi_addr);
++#endif
+ i++;
+ cnt--;
+ }
+--- a/drivers/net/wireless/libertas_tf/main.c
++++ b/drivers/net/wireless/libertas_tf/main.c
+@@ -369,20 +369,36 @@ static int lbtf_op_config(struct ieee802
+ }
+
+ static u64 lbtf_op_prepare_multicast(struct ieee80211_hw *hw,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ struct netdev_hw_addr_list *mc_list)
++#else
++ int mc_count, struct dev_addr_list *ha)
++#endif
+ {
+ struct lbtf_private *priv = hw->priv;
+ int i;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ struct netdev_hw_addr *ha;
+ int mc_count = netdev_hw_addr_list_count(mc_list);
++#endif
+
+ if (!mc_count || mc_count > MRVDRV_MAX_MULTICAST_LIST_SIZE)
+ return mc_count;
+
+ priv->nr_of_multicastmacaddr = mc_count;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ i = 0;
+ netdev_hw_addr_list_for_each(ha, mc_list)
+ memcpy(&priv->multicastlist[i++], ha->addr, ETH_ALEN);
++#else
++ for (i = 0; i < mc_count; i++) {
++ if (!ha)
++ break;
++ memcpy(&priv->multicastlist[i], ha->da_addr,
++ ETH_ALEN);
++ ha = ha->next;
++ }
++#endif
+
+ return mc_count;
+ }
+--- a/drivers/net/wireless/mwl8k.c
++++ b/drivers/net/wireless/mwl8k.c
+@@ -1939,15 +1939,21 @@ struct mwl8k_cmd_mac_multicast_adr {
+
+ static struct mwl8k_cmd_pkt *
+ __mwl8k_cmd_mac_multicast_adr(struct ieee80211_hw *hw, int allmulti,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ struct netdev_hw_addr_list *mc_list)
++#else
++ int mc_count, struct dev_addr_list *ha)
++#endif
+ {
+ struct mwl8k_priv *priv = hw->priv;
+ struct mwl8k_cmd_mac_multicast_adr *cmd;
+ int size;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ int mc_count = 0;
+
+ if (mc_list)
+ mc_count = netdev_hw_addr_list_count(mc_list);
++#endif
+
+ if (allmulti || mc_count > priv->num_mcaddrs) {
+ allmulti = 1;
+@@ -1968,13 +1974,27 @@ __mwl8k_cmd_mac_multicast_adr(struct iee
+ if (allmulti) {
+ cmd->action |= cpu_to_le16(MWL8K_ENABLE_RX_ALL_MULTICAST);
+ } else if (mc_count) {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ struct netdev_hw_addr *ha;
+ int i = 0;
++#else
++ int i;
++#endif
+
+ cmd->action |= cpu_to_le16(MWL8K_ENABLE_RX_MULTICAST);
+ cmd->numaddr = cpu_to_le16(mc_count);
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ netdev_hw_addr_list_for_each(ha, mc_list) {
+ memcpy(cmd->addr[i], ha->addr, ETH_ALEN);
++#else
++ for (i = 0; i < mc_count && ha; i++) {
++ if (ha->da_addrlen != ETH_ALEN) {
++ kfree(cmd);
++ return NULL;
++ }
++ memcpy(cmd->addr[i], ha->da_addr, ETH_ALEN);
++ ha = ha->next;
++#endif
+ }
+ }
+
+@@ -3553,7 +3573,11 @@ mwl8k_bss_info_changed(struct ieee80211_
+ }
+
+ static u64 mwl8k_prepare_multicast(struct ieee80211_hw *hw,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ struct netdev_hw_addr_list *mc_list)
++#else
++ int mc_count, struct dev_addr_list *ha)
++#endif
+ {
+ struct mwl8k_cmd_pkt *cmd;
+
+@@ -3564,7 +3588,11 @@ static u64 mwl8k_prepare_multicast(struc
+ * we'll end up throwing this packet away and creating a new
+ * one in mwl8k_configure_filter().
+ */
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ cmd = __mwl8k_cmd_mac_multicast_adr(hw, 0, mc_list);
++#else
++ cmd = __mwl8k_cmd_mac_multicast_adr(hw, 0, mc_count, ha);
++#endif
+
+ return (unsigned long)cmd;
+ }
+@@ -3687,7 +3715,11 @@ static void mwl8k_configure_filter(struc
+ */
+ if (*total_flags & FIF_ALLMULTI) {
+ kfree(cmd);
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ cmd = __mwl8k_cmd_mac_multicast_adr(hw, 1, NULL);
++#else
++ cmd = __mwl8k_cmd_mac_multicast_adr(hw, 1, 0, NULL);
++#endif
+ }
+
+ if (cmd != NULL) {
+--- a/drivers/net/wireless/orinoco/hw.c
++++ b/drivers/net/wireless/orinoco/hw.c
+@@ -1056,14 +1056,22 @@ int __orinoco_hw_set_multicast_list(stru
+ * group address if either we want to multicast, or if we were
+ * multicasting and want to stop */
+ if (!promisc && (mc_count || priv->mc_count)) {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ struct netdev_hw_addr *ha;
++#else
++ struct dev_mc_list *ha;
++#endif
+ struct hermes_multicast mclist;
+ int i = 0;
+
+ netdev_for_each_mc_addr(ha, dev) {
+ if (i == mc_count)
+ break;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ memcpy(mclist.addr[i++], ha->addr, ETH_ALEN);
++#else
++ memcpy(mclist.addr[i++], ha->dmi_addr, ETH_ALEN);
++#endif
+ }
+
+ err = hermes_write_ltv(hw, USER_BAP,
+--- a/drivers/net/wireless/orinoco/hw.h
++++ b/drivers/net/wireless/orinoco/hw.h
+@@ -22,6 +22,9 @@
+
+ /* Forward declarations */
+ struct orinoco_private;
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35))
++struct dev_addr_list;
++#endif
+
+ int determine_fw_capabilities(struct orinoco_private *priv, char *fw_name,
+ size_t fw_name_len, u32 *hw_ver);
+--- a/drivers/net/wireless/rndis_wlan.c
++++ b/drivers/net/wireless/rndis_wlan.c
+@@ -1546,7 +1546,11 @@ static int remove_key(struct usbnet *usb
+ static void set_multicast_list(struct usbnet *usbdev)
+ {
+ struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev);
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ struct netdev_hw_addr *ha;
++#else
++ struct dev_mc_list *ha;
++#endif
+ __le32 filter, basefilter;
+ int ret;
+ char *mc_addrs = NULL;
+@@ -1587,7 +1591,11 @@ static void set_multicast_list(struct us
+
+ netdev_for_each_mc_addr(ha, usbdev->net)
+ memcpy(mc_addrs + i++ * ETH_ALEN,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ ha->addr, ETH_ALEN);
++#else
++ ha->dmi_addr, ETH_ALEN);
++#endif
+ }
+ netif_addr_unlock_bh(usbdev->net);
+
+--- a/drivers/net/wireless/rtl818x/rtl8180_dev.c
++++ b/drivers/net/wireless/rtl818x/rtl8180_dev.c
+@@ -724,10 +724,19 @@ static void rtl8180_bss_info_changed(str
+ priv->rf->conf_erp(dev, info);
+ }
+
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ static u64 rtl8180_prepare_multicast(struct ieee80211_hw *dev,
+ struct netdev_hw_addr_list *mc_list)
++#else
++static u64 rtl8180_prepare_multicast(struct ieee80211_hw *dev, int mc_count,
++ struct dev_addr_list *mc_list)
++#endif
+ {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ return netdev_hw_addr_list_count(mc_list);
++#else
++ return mc_count;
++#endif
+ }
+
+ static void rtl8180_configure_filter(struct ieee80211_hw *dev,
+--- a/drivers/net/wireless/rtl818x/rtl8187_dev.c
++++ b/drivers/net/wireless/rtl818x/rtl8187_dev.c
+@@ -1194,9 +1194,17 @@ static void rtl8187_bss_info_changed(str
+ }
+
+ static u64 rtl8187_prepare_multicast(struct ieee80211_hw *dev,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ struct netdev_hw_addr_list *mc_list)
++#else
++ int mc_count, struct dev_addr_list *mc_list)
++#endif
+ {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ return netdev_hw_addr_list_count(mc_list);
++#else
++ return mc_count;
++#endif
+ }
+
+ static void rtl8187_configure_filter(struct ieee80211_hw *dev,
+--- a/drivers/net/wireless/wl12xx/wl1271_main.c
++++ b/drivers/net/wireless/wl12xx/wl1271_main.c
+@@ -1305,11 +1305,20 @@ struct wl1271_filter_params {
+ u8 mc_list[ACX_MC_ADDRESS_GROUP_MAX][ETH_ALEN];
+ };
+
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ static u64 wl1271_op_prepare_multicast(struct ieee80211_hw *hw,
+ struct netdev_hw_addr_list *mc_list)
++#else
++static u64 wl1271_op_prepare_multicast(struct ieee80211_hw *hw, int mc_count,
++ struct dev_addr_list *mc_list)
++#endif
+ {
+ struct wl1271_filter_params *fp;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ struct netdev_hw_addr *ha;
++#else
++ int i;
++#endif
+ struct wl1271 *wl = hw->priv;
+
+ if (unlikely(wl->state == WL1271_STATE_OFF))
+@@ -1322,16 +1331,40 @@ static u64 wl1271_op_prepare_multicast(s
+ }
+
+ /* update multicast filtering parameters */
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ fp->mc_list_length = 0;
+ if (netdev_hw_addr_list_count(mc_list) > ACX_MC_ADDRESS_GROUP_MAX) {
++#else
++ fp->enabled = true;
++ if (mc_count > ACX_MC_ADDRESS_GROUP_MAX) {
++ mc_count = 0;
++#endif
+ fp->enabled = false;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ } else {
+ fp->enabled = true;
+ netdev_hw_addr_list_for_each(ha, mc_list) {
++#else
++ }
++
++ fp->mc_list_length = 0;
++ for (i = 0; i < mc_count; i++) {
++ if (mc_list->da_addrlen == ETH_ALEN) {
++#endif
+ memcpy(fp->mc_list[fp->mc_list_length],
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ ha->addr, ETH_ALEN);
++#else
++ mc_list->da_addr, ETH_ALEN);
++#endif
+ fp->mc_list_length++;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ }
++#else
++ } else
++ wl1271_warning("Unknown mc address length.");
++ mc_list = mc_list->next;
++#endif
+ }
+
+ return (u64)(unsigned long)fp;
+--- a/drivers/net/wireless/zd1211rw/zd_mac.c
++++ b/drivers/net/wireless/zd1211rw/zd_mac.c
+@@ -948,17 +948,34 @@ static void set_rx_filter_handler(struct
+ }
+
+ static u64 zd_op_prepare_multicast(struct ieee80211_hw *hw,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ struct netdev_hw_addr_list *mc_list)
++#else
++ int mc_count, struct dev_addr_list *ha)
++#endif
+ {
+ struct zd_mac *mac = zd_hw_mac(hw);
+ struct zd_mc_hash hash;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ struct netdev_hw_addr *ha;
++#else
++ int i;
++#endif
+
+ zd_mc_clear(&hash);
+
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ netdev_hw_addr_list_for_each(ha, mc_list) {
+ dev_dbg_f(zd_mac_dev(mac), "mc addr %pM\n", ha->addr);
+ zd_mc_add_addr(&hash, ha->addr);
++#else
++ for (i = 0; i < mc_count; i++) {
++ if (!ha)
++ break;
++ dev_dbg_f(zd_mac_dev(mac), "mc addr %pM\n", ha->dmi_addr);
++ zd_mc_add_addr(&hash, ha->dmi_addr);
++ ha = ha->next;
++#endif
+ }
+
+ return hash.low | ((u64)hash.high << 32);
+--- a/include/net/mac80211.h
++++ b/include/net/mac80211.h
+@@ -1631,7 +1631,11 @@ struct ieee80211_ops {
+ struct ieee80211_bss_conf *info,
+ u32 changed);
+ u64 (*prepare_multicast)(struct ieee80211_hw *hw,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ struct netdev_hw_addr_list *mc_list);
++#else
++ int mc_count, struct dev_addr_list *mc_list);
++#endif
+ void (*configure_filter)(struct ieee80211_hw *hw,
+ unsigned int changed_flags,
+ unsigned int *total_flags,
+--- a/net/bluetooth/bnep/netdev.c
++++ b/net/bluetooth/bnep/netdev.c
+@@ -88,7 +88,11 @@ static void bnep_net_set_mc_list(struct
+ memcpy(__skb_put(skb, ETH_ALEN), dev->broadcast, ETH_ALEN);
+ r->len = htons(ETH_ALEN * 2);
+ } else {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ struct netdev_hw_addr *ha;
++#else
++ struct dev_mc_list *ha;
++#endif
+ int i, len = skb->len;
+
+ if (dev->flags & IFF_BROADCAST) {
+@@ -102,8 +106,13 @@ static void bnep_net_set_mc_list(struct
+ netdev_for_each_mc_addr(ha, dev) {
+ if (i == BNEP_MAX_MULTICAST_FILTERS)
+ break;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ memcpy(__skb_put(skb, ETH_ALEN), ha->addr, ETH_ALEN);
+ memcpy(__skb_put(skb, ETH_ALEN), ha->addr, ETH_ALEN);
++#else
++ memcpy(__skb_put(skb, ETH_ALEN), ha->dmi_addr, ETH_ALEN);
++ memcpy(__skb_put(skb, ETH_ALEN), ha->dmi_addr, ETH_ALEN);
++#endif
+ }
+ r->len = htons(skb->len - len);
+ }
+--- a/net/mac80211/driver-ops.h
++++ b/net/mac80211/driver-ops.h
+@@ -84,14 +84,28 @@ static inline void drv_bss_info_changed(
+ }
+
+ static inline u64 drv_prepare_multicast(struct ieee80211_local *local,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ struct netdev_hw_addr_list *mc_list)
++#else
++ int mc_count,
++ struct dev_addr_list *mc_list)
++#endif
+ {
+ u64 ret = 0;
+
+ if (local->ops->prepare_multicast)
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ ret = local->ops->prepare_multicast(&local->hw, mc_list);
++#else
++ ret = local->ops->prepare_multicast(&local->hw, mc_count,
++ mc_list);
++#endif
+
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ trace_drv_prepare_multicast(local, mc_list->count, ret);
++#else
++ trace_drv_prepare_multicast(local, mc_count, ret);
++#endif
+
+ return ret;
+ }
+--- a/net/mac80211/ieee80211_i.h
++++ b/net/mac80211/ieee80211_i.h
+@@ -665,7 +665,12 @@ struct ieee80211_local {
+ struct work_struct recalc_smps;
+
+ /* aggregated multicast list */
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ struct netdev_hw_addr_list mc_list;
++#else
++ struct dev_addr_list *mc_list;
++ int mc_count;
++#endif
+
+ bool tim_in_locked_section; /* see ieee80211_beacon_get() */
+
+--- a/net/mac80211/iface.c
++++ b/net/mac80211/iface.c
+@@ -413,7 +413,12 @@ static int ieee80211_stop(struct net_dev
+
+ netif_addr_lock_bh(dev);
+ spin_lock_bh(&local->filter_lock);
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ __hw_addr_unsync(&local->mc_list, &dev->mc, dev->addr_len);
++#else
++ __dev_addr_unsync(&local->mc_list, &local->mc_count,
++ &dev->mc_list, &dev->mc_count);
++#endif
+ spin_unlock_bh(&local->filter_lock);
+ netif_addr_unlock_bh(dev);
+
+@@ -596,7 +601,12 @@ static void ieee80211_set_multicast_list
+ sdata->flags ^= IEEE80211_SDATA_PROMISC;
+ }
+ spin_lock_bh(&local->filter_lock);
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ __hw_addr_sync(&local->mc_list, &dev->mc, dev->addr_len);
++#else
++ __dev_addr_sync(&local->mc_list, &local->mc_count,
++ &dev->mc_list, &dev->mc_count);
++#endif
+ spin_unlock_bh(&local->filter_lock);
+ ieee80211_queue_work(&local->hw, &local->reconfig_filter);
+ }
+--- a/net/mac80211/main.c
++++ b/net/mac80211/main.c
+@@ -71,7 +71,11 @@ void ieee80211_configure_filter(struct i
+ spin_lock_bh(&local->filter_lock);
+ changed_flags = local->filter_flags ^ new_flags;
+
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ mc = drv_prepare_multicast(local, &local->mc_list);
++#else
++ mc = drv_prepare_multicast(local, local->mc_count, local->mc_list);
++#endif
+ spin_unlock_bh(&local->filter_lock);
+
+ /* be a bit nasty */
+@@ -390,9 +394,11 @@ struct ieee80211_hw *ieee80211_alloc_hw(
+ local->uapsd_max_sp_len = IEEE80211_DEFAULT_MAX_SP_LEN;
+
+ INIT_LIST_HEAD(&local->interfaces);
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+
+ __hw_addr_init(&local->mc_list);
+
++#endif
+ mutex_init(&local->iflist_mtx);
+ mutex_init(&local->scan_mtx);
+
--
1.6.3.3
^ permalink raw reply related
* [PATCH 2/3] compat-wireless: Remove use of sdio quirks attribute
From: Hauke Mehrtens @ 2010-04-18 13:36 UTC (permalink / raw)
To: lrodriguez; +Cc: linux-wireless, mcgrof, Hauke Mehrtens
In-Reply-To: <1271597784-4811-1-git-send-email-hauke@hauke-m.de>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
patches/26-sdio-quirks.patch | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
create mode 100644 patches/26-sdio-quirks.patch
diff --git a/patches/26-sdio-quirks.patch b/patches/26-sdio-quirks.patch
new file mode 100644
index 0000000..0b43be5
--- /dev/null
+++ b/patches/26-sdio-quirks.patch
@@ -0,0 +1,20 @@
+The quirks attribute is not available on older kernels.
+
+--- a/drivers/net/wireless/libertas/if_sdio.c
++++ b/drivers/net/wireless/libertas/if_sdio.c
+@@ -1026,6 +1026,7 @@ static int if_sdio_probe(struct sdio_fun
+ if (ret)
+ goto disable;
+
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32))
+ /* For 1-bit transfers to the 8686 model, we need to enable the
+ * interrupt flag in the CCCR register. Set the MMC_QUIRK_LENIENT_FN0
+ * bit to allow access to non-vendor registers. */
+@@ -1044,6 +1045,7 @@ static int if_sdio_probe(struct sdio_fun
+ if (ret)
+ goto release_int;
+ }
++#endif
+
+ card->ioport = sdio_readb(func, IF_SDIO_IOPORT, &ret);
+ if (ret)
--
1.6.3.3
^ permalink raw reply related
* [PATCH 0/3] compat-wireless: compile fixes
From: Hauke Mehrtens @ 2010-04-18 13:36 UTC (permalink / raw)
To: lrodriguez; +Cc: linux-wireless, mcgrof, Hauke Mehrtens
This series contains mostly compile fixes.
It was compile tested on kernel 2.6.25 to 2.6.34 and ath9k is working in
Ubuntu 9.04.
Hauke Mehrtens (3):
compat-wireless: backport convert multicast list to list_head.
compat-wireless: Remove use of sdio quirks attribute
compat-wireless: include net and trace includes form compat.
patches/25-multicast-list_head.patch | 813 ++++++++++++++++++++++++++++++++++
patches/26-sdio-quirks.patch | 20 +
scripts/admin-update.sh | 3 +
3 files changed, 836 insertions(+), 0 deletions(-)
create mode 100644 patches/25-multicast-list_head.patch
create mode 100644 patches/26-sdio-quirks.patch
^ permalink raw reply
* rc80211_minstrel.c:70 WARNING with 2.6.34-rc4
From: Richard Zidlicky @ 2010-04-18 8:56 UTC (permalink / raw)
To: linux-wireless
Hi,
I am getting tons of these http://www.kerneloops.org/submitresult.php?number=3048061,
appears every packet triggers that.
Can provide lots of debugging info.
Richard
^ permalink raw reply
* Re: [ath5k-devel] [PATCH] ath5k/ath9k: Fix 64 bits TSF reads
From: Pavel Roskin @ 2010-04-17 23:02 UTC (permalink / raw)
To: Benoit PAPILLAULT; +Cc: lrodriguez, ath5k-devel, linux-wireless, ath9k-devel
In-Reply-To: <4BC9B75E.9070005@free.fr>
Quoting Benoit PAPILLAULT <benoit.papillault@free.fr>:
> You are considering rollover here, but the TSF can make big jumps as
> well (in case of IBSS merges). This later case can only be handled by
> the above code, to my knowledge. I am seeking consistency first and
> optimization next, not the opposite.
OK, I didn't realize that. Then I'm fine with your patch. Sorry for
the noise.
--
Regards,
Pavel Roskin
^ permalink raw reply
* Re: [ath5k-devel] [PATCH] ath5k/ath9k: Fix 64 bits TSF reads
From: Derek Smithies @ 2010-04-17 21:33 UTC (permalink / raw)
To: Pavel Roskin; +Cc: Benoit Papillault, linux-wireless, ath5k-devel, ath9k-devel
In-Reply-To: <1271452384.16507.16.camel@mj>
Hi,
The original code was wrong, and there must have been occasions when the
TSF was read incorrectly. Those occasions were infrequent, and would have
show up in large networks that were operational on the month timescale.
Benoit's code tries 10 times to read the TSF, looking for when two
consecutive upper TSF values that are the same. I can think of no physical
scenario that would cause the 10 consecutive reads to not terminate.
If this fails to happen, then the TSF counter on the radio board is
busted. If the TSF counter (or the reading of the TSF counter) is busted,
then you have a bad situation, and something seriously wrong is happening.
We need to know about this - so the kernel warnings are good.
> The problem with overengineered code is that it doesn't break when it's
> better to break and expose the problem :-)
Yes, but the problem with underengineered code is that it doesn't break,
and the users of the code are blissfully unaware of serious problems.
I would not call this overengineered. I would call this the appropriate
level of peer review to get stable code that is acceptably reliable.
Benoit's patch is good.
ACK.
Derek.
========================================================================
On Fri, 16 Apr 2010, Pavel Roskin wrote:
> On Fri, 2010-04-16 at 00:07 +0200, Benoit Papillault wrote:
>
>> It follows the logic mentionned by Derek, with only 2 register reads
>> needed at each additional steps instead of 3 (the minimum number of
>> register reads is still 3).
>
> I would prefer an approach whereas tsf_upper2 or tsf_upper1 is chosen
> based on whether tsf_lower is more or less than 0x80000000 if
> (tsf_upper2 - tsf_upper1) is 1. If the difference is not 0 or 1, either
> the hardware is broken or the kernel was stuck for so long (71 minutes!)
> that getting the exact tsf should be the least worry. That's when
> WARN_ON would be appropriate.
>
> The problem with overengineered code is that it doesn't break when it's
> better to break and expose the problem :-)
>
> But it's just a suggestion, not a NACK. It's better to have some fix
> than no fix at all.
>
>
--
Derek Smithies Ph.D.
IndraNet Technologies Ltd.
Email: derek@indranet.co.nz
ph +64 3 365 6485
Web: http://www.indranet-technologies.com/
^ permalink raw reply
* iwl3945: Error sending REPLY_{RXON|SCAN_CMD|TX_PWR_TABLE_CMD} time out after 500ms
From: Sedat Dilek @ 2010-04-17 14:05 UTC (permalink / raw)
To: wireless; +Cc: Reinette Chatre, Johannes Berg
Hi,
I have already sent an bug-report "iwl3945: Network dropouts w/
flash-stream in firefox" in [1].
Unfortunately, the problem still remains, especially when
fast-forwarding flash movies in firefox-3.6.3.
It seems the wifi-card is hanging and my system needs a coldstart.
My wifi-card is an iwl3945 and my access-point is a speedport-w701v.
I am using a Debian/sid 32-bit system.
Today, I enabled CONFIG_IWLWIFI_DEBUG=y to see what is going on.
I stopped networking, unloaded the kernel-module and re-loaded with
module-option debug=0x43fff [2].
# /etc/init.d/networking stop
# modprobe -r -v iwl3945
# modprobe -v iwl3945 debug=0x43fff
The kernel I use is a Linux-2.6.34-rc4-git4 with these 3 patches in addition:
patches/wireless-2.6:
0001-iwlwifi-work-around-bogus-active-chains-detection.patch
patches/iwlwifi-fixes-for-2.6.34:
1-2-iwlwifi-fix-scan-races.patch
2-2-iwlwifi-correct-6000-EEPROM-regulatory-address.patch
According to Johannes (on IRC) iwl3945 doesn't use internal scans yet
(see my patch below).
Thus, I am not sure if this needs to be fixed separately for iwl3945
and if I ran into a scan race condition here.
If this matters: I am using Debian's wpasupplicant (0.6.10-2) and wext
wpa-driver.
I collected all data and provide them in [3].
Hope, this helps.
Kind Regards,
- Sedat -
[1] http://marc.info/?l=linux-wireless&m=127135267301937&w=2
[2] http://intellinuxwireless.org/?n=fw_error_report
[3] http://files.iniza.org/BUG_iwl3945_20100417/
[PATCH]
$ cat iwl3945-fix-scan-races.patch
--- linux-2.6.orig/drivers/net/wireless/iwlwifi/iwl3945-base.c 2010-04-13
03:41:35.000000000 +0200
+++ linux-2.6/drivers/net/wireless/iwlwifi/iwl3945-base.c 2010-04-17
10:46:52.765166367 +0200
@@ -3792,6 +3792,7 @@ static void iwl3945_cancel_deferred_work
cancel_delayed_work_sync(&priv->init_alive_start);
cancel_delayed_work(&priv->scan_check);
+ cancel_work_sync(&priv->start_internal_scan);
cancel_delayed_work(&priv->alive_start);
cancel_work_sync(&priv->beacon_update);
}
[/PATCH]
^ permalink raw reply
* Re: [ath5k-devel] [PATCH] ath5k/ath9k: Fix 64 bits TSF reads
From: Benoit PAPILLAULT @ 2010-04-17 13:27 UTC (permalink / raw)
To: Pavel Roskin; +Cc: lrodriguez, ath5k-devel, linux-wireless, ath9k-devel
In-Reply-To: <1271452384.16507.16.camel@mj>
Pavel Roskin a écrit :
> On Fri, 2010-04-16 at 00:07 +0200, Benoit Papillault wrote:
>
>
>> It follows the logic mentionned by Derek, with only 2 register reads
>> needed at each additional steps instead of 3 (the minimum number of
>> register reads is still 3).
>>
>
> I would prefer an approach whereas tsf_upper2 or tsf_upper1 is chosen
> based on whether tsf_lower is more or less than 0x80000000 if
> (tsf_upper2 - tsf_upper1) is 1. If the difference is not 0 or 1, either
> the hardware is broken or the kernel was stuck for so long (71 minutes!)
> that getting the exact tsf should be the least worry. That's when
> WARN_ON would be appropriate.
>
> The problem with overengineered code is that it doesn't break when it's
> better to break and expose the problem :-)
>
> But it's just a suggestion, not a NACK. It's better to have some fix
> than no fix at all.
>
>
Hello Pavel,
You are considering rollover here, but the TSF can make big jumps as
well (in case of IBSS merges). This later case can only be handled by
the above code, to my knowledge. I am seeking consistency first and
optimization next, not the opposite.
We can even consider the case where only the lower TSF has made a small
jump before reading the higher part and the lower part. However, such
case cannot be distinguished from a normal case and the resulting value
will be consistent anyway (since the higher part has not changed).
In the case where tsf_upper2 = tsf_upper1 + 1, this can happen when a
rollover occurs. It could also happens in case of IBSS merge, in which
case, your logic won't work. Let's take an example:
real TSF 0x00000001-ffffffc0 => tsf_upper1 = 1
--- rollover ---
real TSF 0x00000001-ffffffc8 => tsf_lower = 0xffffffc8
real TSF 0x00000002-00000008 => tsf_upper2 = 2
In this case, we assume that TSF = 0x00000001-ffffffc8 (since 0xffffffc8
> 0x80000000).
real TSF 0x00000001-10000009 => tsf_upper1 = 1
--- HW IBSS merge ---
real TSF 0x00000002-ffffffc8 => tsf_lower = 0xffffffc8
real TSF 0x00000002-ffffffd0 => tsf_upper2 = 2
In this case, we assume that TSF = 0x00000001-ffffffc8 ... which is wrong!
Did I miss something?
Regards,
Benoit
^ permalink raw reply
* Re: [rt2x00] rt3070 fails to initialize with rt2800usb
From: Ivo van Doorn @ 2010-04-17 13:16 UTC (permalink / raw)
To: Walter; +Cc: linux-wireless, users
In-Reply-To: <79834.90907.qm@web56804.mail.re3.yahoo.com>
On Saturday 17 April 2010, Walter wrote:
> > From: Ivo van Doorn <ivdoorn@gmail.com>
> > Subject: Re: [rt2x00] rt3070 fails to initialize with rt2800usb
> > To: "Walter" <goldenstranger@yahoo.com>
> > Cc: linux-wireless@vger.kernel.org, users@rt2x00.serialmonkey.com
> > Date: Saturday, April 17, 2010, 8:45 AM
> > On Saturday 17 April 2010, Walter
> > wrote:
> > > I've been monitoring the community's work for the
> > rt3070 chips and especially your recent success towards
> > improving the driver.
> > >
> > > I would like to share something with the rt2x00
> > development team which may or may not be known.
> > >
> > > The rt3070 card I own fails to initialize with the
> > latest (working) compat-wireless release. When I plug the
> > USB card, rt2800usb doesn't automatically load and when I
> > manually modprobe the driver it does not recognize it as
> > well.
> > >
> > > Looking in to the rt2800usb.c file I found the
> > 'problem'. The VIDs aren't properly set. Mine shows
> > 148f:3070. Although a line is included in the "#ifdef
> > CONFIG_RT2800USB_RT30XX", the module won't initialize the
> > card.
> > >
> > > I fixed the problem by adding my device here:
> > >
> > > /* Ralink */
> > > { USB_DEVICE(0x148f, 0x2770),
> > USB_DEVICE_DATA(&rt2800usb_ops) },
> > > { USB_DEVICE(0x148f, 0x2870),
> > USB_DEVICE_DATA(&rt2800usb_ops) },
> > > /* Samsung */
> > >
> > > which now looks like:
> > >
> > > /* Ralink */
> > > { USB_DEVICE(0x148f, 0x2770),
> > USB_DEVICE_DATA(&rt2800usb_ops) },
> > > { USB_DEVICE(0x148f, 0x2870),
> > USB_DEVICE_DATA(&rt2800usb_ops) },
> > > {
> > USB_DEVICE(0x148f, 0x3070),
> > USB_DEVICE_DATA(&rt2800usb_ops) },
> > > /* Samsung */
> > >
> > > This pertains to the rt3071 as well.
> >
> > That USB ID is already known, did you compile the driver
> > with support
> > for CONFIG_RT2800USB_RT30XX enabled?
> >
> > Ivo
>
> Yes, compat-wireless ships with ''CONFIG_RT2800USB_RT30XX=y'' in config.mk, but the card's VIDs aren't shown in modinfo rt2800usb when compiled, thus the module doesn't recognize the card at all. The only workaround I rustled up is the above mentioned one.
Thats odd, in compar-wireless, it already contains the lines:
#ifdef CONFIG_RT2800USB_RT30XX
<..snip..>
/* Ralink */
{ USB_DEVICE(0x148f, 0x2070), USB_DEVICE_DATA(&rt2800usb_ops) },
{ USB_DEVICE(0x148f, 0x3070), USB_DEVICE_DATA(&rt2800usb_ops) },
{ USB_DEVICE(0x148f, 0x3071), USB_DEVICE_DATA(&rt2800usb_ops) },
{ USB_DEVICE(0x148f, 0x3072), USB_DEVICE_DATA(&rt2800usb_ops) },
<..snip..>
#endif
So adding the USB ID does not need to be added.
Ivo
^ permalink raw reply
* Re: [rt2x00] rt3070 fails to initialize with rt2800usb
From: Walter @ 2010-04-17 13:09 UTC (permalink / raw)
To: Ivo van Doorn, linux-wireless, users
In-Reply-To: <201004171445.13785.IvDoorn@gmail.com>
> From: Ivo van Doorn <ivdoorn@gmail.com>
> Subject: Re: [rt2x00] rt3070 fails to initialize with rt2800usb
> To: "Walter" <goldenstranger@yahoo.com>
> Cc: linux-wireless@vger.kernel.org, users@rt2x00.serialmonkey.com
> Date: Saturday, April 17, 2010, 8:45 AM
> On Saturday 17 April 2010, Walter
> wrote:
> > I've been monitoring the community's work for the
> rt3070 chips and especially your recent success towards
> improving the driver.
> >
> > I would like to share something with the rt2x00
> development team which may or may not be known.
> >
> > The rt3070 card I own fails to initialize with the
> latest (working) compat-wireless release. When I plug the
> USB card, rt2800usb doesn't automatically load and when I
> manually modprobe the driver it does not recognize it as
> well.
> >
> > Looking in to the rt2800usb.c file I found the
> 'problem'. The VIDs aren't properly set. Mine shows
> 148f:3070. Although a line is included in the "#ifdef
> CONFIG_RT2800USB_RT30XX", the module won't initialize the
> card.
> >
> > I fixed the problem by adding my device here:
> >
> > /* Ralink */
> > { USB_DEVICE(0x148f, 0x2770),
> USB_DEVICE_DATA(&rt2800usb_ops) },
> > { USB_DEVICE(0x148f, 0x2870),
> USB_DEVICE_DATA(&rt2800usb_ops) },
> > /* Samsung */
> >
> > which now looks like:
> >
> > /* Ralink */
> > { USB_DEVICE(0x148f, 0x2770),
> USB_DEVICE_DATA(&rt2800usb_ops) },
> > { USB_DEVICE(0x148f, 0x2870),
> USB_DEVICE_DATA(&rt2800usb_ops) },
> > {
> USB_DEVICE(0x148f, 0x3070),
> USB_DEVICE_DATA(&rt2800usb_ops) },
> > /* Samsung */
> >
> > This pertains to the rt3071 as well.
>
> That USB ID is already known, did you compile the driver
> with support
> for CONFIG_RT2800USB_RT30XX enabled?
>
> Ivo
Yes, compat-wireless ships with ''CONFIG_RT2800USB_RT30XX=y'' in config.mk, but the card's VIDs aren't shown in modinfo rt2800usb when compiled, thus the module doesn't recognize the card at all. The only workaround I rustled up is the above mentioned one.
^ permalink raw reply
* Re: [rt2x00] rt3070 fails to initialize with rt2800usb
From: Ivo van Doorn @ 2010-04-17 12:45 UTC (permalink / raw)
To: Walter; +Cc: linux-wireless, users
In-Reply-To: <364037.65667.qm@web56808.mail.re3.yahoo.com>
On Saturday 17 April 2010, Walter wrote:
> I've been monitoring the community's work for the rt3070 chips and especially your recent success towards improving the driver.
>
> I would like to share something with the rt2x00 development team which may or may not be known.
>
> The rt3070 card I own fails to initialize with the latest (working) compat-wireless release. When I plug the USB card, rt2800usb doesn't automatically load and when I manually modprobe the driver it does not recognize it as well.
>
> Looking in to the rt2800usb.c file I found the 'problem'. The VIDs aren't properly set. Mine shows 148f:3070. Although a line is included in the "#ifdef CONFIG_RT2800USB_RT30XX", the module won't initialize the card.
>
> I fixed the problem by adding my device here:
>
> /* Ralink */
> { USB_DEVICE(0x148f, 0x2770), USB_DEVICE_DATA(&rt2800usb_ops) },
> { USB_DEVICE(0x148f, 0x2870), USB_DEVICE_DATA(&rt2800usb_ops) },
> /* Samsung */
>
> which now looks like:
>
> /* Ralink */
> { USB_DEVICE(0x148f, 0x2770), USB_DEVICE_DATA(&rt2800usb_ops) },
> { USB_DEVICE(0x148f, 0x2870), USB_DEVICE_DATA(&rt2800usb_ops) },
> { USB_DEVICE(0x148f, 0x3070), USB_DEVICE_DATA(&rt2800usb_ops) },
> /* Samsung */
>
> This pertains to the rt3071 as well.
That USB ID is already known, did you compile the driver with support
for CONFIG_RT2800USB_RT30XX enabled?
Ivo
^ permalink raw reply
* [rt2x00] rt3070 fails to initialize with rt2800usb
From: Walter @ 2010-04-17 12:26 UTC (permalink / raw)
To: linux-wireless, users
I've been monitoring the community's work for the rt3070 chips and especially your recent success towards improving the driver.
I would like to share something with the rt2x00 development team which may or may not be known.
The rt3070 card I own fails to initialize with the latest (working) compat-wireless release. When I plug the USB card, rt2800usb doesn't automatically load and when I manually modprobe the driver it does not recognize it as well.
Looking in to the rt2800usb.c file I found the 'problem'. The VIDs aren't properly set. Mine shows 148f:3070. Although a line is included in the "#ifdef CONFIG_RT2800USB_RT30XX", the module won't initialize the card.
I fixed the problem by adding my device here:
/* Ralink */
{ USB_DEVICE(0x148f, 0x2770), USB_DEVICE_DATA(&rt2800usb_ops) },
{ USB_DEVICE(0x148f, 0x2870), USB_DEVICE_DATA(&rt2800usb_ops) },
/* Samsung */
which now looks like:
/* Ralink */
{ USB_DEVICE(0x148f, 0x2770), USB_DEVICE_DATA(&rt2800usb_ops) },
{ USB_DEVICE(0x148f, 0x2870), USB_DEVICE_DATA(&rt2800usb_ops) },
{ USB_DEVICE(0x148f, 0x3070), USB_DEVICE_DATA(&rt2800usb_ops) },
/* Samsung */
This pertains to the rt3071 as well.
Regards.
^ permalink raw reply
* Re: [PATCH] wl1251: add support for dedicated IRQ line
From: Grazvydas Ignotas @ 2010-04-17 11:00 UTC (permalink / raw)
To: Kalle Valo; +Cc: John W. Linville, linux-wireless, Bob Copeland
In-Reply-To: <87633qmylr.fsf@purkki.valot.fi>
On Sat, Apr 17, 2010 at 8:34 AM, Kalle Valo <kvalo@adurom.com> wrote:
> Grazvydas Ignotas <notasas@gmail.com> writes:
>
>> wl1251 has WLAN_IRQ pin for generating interrupts to host processor,
>> which is mandatory in SPI mode and optional in SDIO mode (which can
>> use SDIO interrupts instead). However TI recommends using deditated
>> IRQ line for SDIO too.
>>
>> Add support for using dedicated interrupt line with SDIO, but also leave
>> ability to switch to SDIO interrupts in case it's needed.
>
> For spi the irq number delivered through struct spi_device, I assume
> sdio didn't have any similar mechanism and that's why you added it to
> struct wl12xx_platform_data.
Yes, SDIO currently only reads the card itself for information and
doesn't use any board data at all. This is enough for typical SDIO
card but not in this case, where we have additional signals for power
control and IRQ.
> Only minor comment is that it would be better to mention also in the
> code that the gpio interrupt is the recommended method. But I can add
> that comment later.
Will have that in mind too if I send something more, thanks.
>> Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
>
> Acked-by: Kalle Valo <kvalo@adurom.com>
>
> Thank you again.
>
> --
> Kalle Valo
>
^ 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