* Re: i386 allmodconfig, current mainline
From: David Miller @ 2010-08-10 7:07 UTC (permalink / raw)
To: akpm
Cc: greg, dwmw2, vapier, jbarnes, kevin.curtis, phillip, faisal.latif,
chien.tin.tung, dan.j.williams, samuel.ortiz, linux-kernel,
netdev, linux-wireless, x86, linux-rdma
In-Reply-To: <20100809164346.6e30cf8c.akpm@linux-foundation.org>
From: Andrew Morton <akpm@linux-foundation.org>
Date: Mon, 9 Aug 2010 16:43:46 -0700
> drivers/net/wan/farsync.c: In function 'fst_intr_rx':
> drivers/net/wan/farsync.c:1312: warning: cast to pointer from integer of different size
> drivers/net/wan/farsync.c: In function 'do_bottom_half_tx':
> drivers/net/wan/farsync.c:1407: warning: cast to pointer from integer of different size
I'll toss the following into net-2.6:
--------------------
farsync: Fix compile warnings.
drivers/net/wan/farsync.c: In function 'fst_intr_rx':
drivers/net/wan/farsync.c:1312: warning: cast to pointer from integer of different size
drivers/net/wan/farsync.c: In function 'do_bottom_half_tx':
drivers/net/wan/farsync.c:1407: warning: cast to pointer from integer of different size
The "skb" and "mem" arguments being passed here are DMA addresses
being programmed into the hardware registers, so pass them as the type
that they actually are. And use the correct printf formatting in
debug logging statements for these things to match the type change.
Reported-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
drivers/net/wan/farsync.c | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c
index ad7719f..e050bd6 100644
--- a/drivers/net/wan/farsync.c
+++ b/drivers/net/wan/farsync.c
@@ -885,20 +885,21 @@ fst_rx_dma_complete(struct fst_card_info *card, struct fst_port_info *port,
* Receive a frame through the DMA
*/
static inline void
-fst_rx_dma(struct fst_card_info *card, unsigned char *skb,
- unsigned char *mem, int len)
+fst_rx_dma(struct fst_card_info *card, dma_addr_t skb,
+ dma_addr_t mem, int len)
{
/*
* This routine will setup the DMA and start it
*/
- dbg(DBG_RX, "In fst_rx_dma %p %p %d\n", skb, mem, len);
+ dbg(DBG_RX, "In fst_rx_dma %lx %lx %d\n",
+ (unsigned long) skb, (unsigned long) mem, len);
if (card->dmarx_in_progress) {
dbg(DBG_ASS, "In fst_rx_dma while dma in progress\n");
}
- outl((unsigned long) skb, card->pci_conf + DMAPADR0); /* Copy to here */
- outl((unsigned long) mem, card->pci_conf + DMALADR0); /* from here */
+ outl(skb, card->pci_conf + DMAPADR0); /* Copy to here */
+ outl(mem, card->pci_conf + DMALADR0); /* from here */
outl(len, card->pci_conf + DMASIZ0); /* for this length */
outl(0x00000000c, card->pci_conf + DMADPR0); /* In this direction */
@@ -1309,8 +1310,8 @@ fst_intr_rx(struct fst_card_info *card, struct fst_port_info *port)
card->dma_port_rx = port;
card->dma_len_rx = len;
card->dma_rxpos = rxp;
- fst_rx_dma(card, (char *) card->rx_dma_handle_card,
- (char *) BUF_OFFSET(rxBuffer[pi][rxp][0]), len);
+ fst_rx_dma(card, card->rx_dma_handle_card,
+ BUF_OFFSET(rxBuffer[pi][rxp][0]), len);
}
if (rxp != port->rxpos) {
dbg(DBG_ASS, "About to increment rxpos by more than 1\n");
--
1.7.2.1
^ permalink raw reply related
* [PATCH 0/5] mac80211 crypto cleanups
From: Johannes Berg @ 2010-08-10 7:46 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless
This has a bunch of crypto code cleanups.
The last two might be applicable to .36
if that got the WEP thing you (John) did?
But they'd have to be rebased due to the
first patch in this series.
johannes
^ permalink raw reply
* [PATCH 1/5] mac80211: use cipher suite selectors
From: Johannes Berg @ 2010-08-10 7:46 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless
In-Reply-To: <20100810074637.034583799@sipsolutions.net>
From: Johannes Berg <johannes.berg@intel.com>
Currently, mac80211 translates the cfg80211
cipher suite selectors into ALG_* values.
That isn't all too useful, and some drivers
benefit from the distinction between WEP40
and WEP104 as well. Therefore, convert it
all to use the cipher suite selectors.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
drivers/net/wireless/ath/ar9170/main.c | 31 +++++++-------
drivers/net/wireless/ath/ath5k/base.c | 9 ++--
drivers/net/wireless/ath/ath5k/pcu.c | 19 +++-----
drivers/net/wireless/ath/ath9k/common.c | 36 +++++++++--------
drivers/net/wireless/ath/ath9k/htc_drv_main.c | 5 +-
drivers/net/wireless/ath/ath9k/main.c | 5 +-
drivers/net/wireless/ath/ath9k/xmit.c | 18 --------
drivers/net/wireless/b43/main.c | 16 +++----
drivers/net/wireless/iwlwifi/iwl-agn-tx.c | 16 +++----
drivers/net/wireless/iwlwifi/iwl-agn.c | 4 +
drivers/net/wireless/iwlwifi/iwl-dev.h | 2
drivers/net/wireless/iwlwifi/iwl-sta.c | 24 ++++++-----
drivers/net/wireless/iwlwifi/iwl3945-base.c | 43 +++++++++++---------
drivers/net/wireless/p54/main.c | 9 ++--
drivers/net/wireless/p54/txrx.c | 17 ++++----
drivers/net/wireless/rt2x00/rt2500usb.c | 4 +
drivers/net/wireless/rt2x00/rt2x00crypto.c | 17 +++-----
drivers/net/wireless/wl12xx/wl1251_main.c | 13 +++---
drivers/net/wireless/wl12xx/wl1251_tx.c | 4 -
drivers/net/wireless/wl12xx/wl1271_main.c | 13 +++---
drivers/net/wireless/wl12xx/wl1271_tx.c | 4 -
include/net/mac80211.h | 18 --------
net/mac80211/cfg.c | 44 +++++---------------
net/mac80211/debugfs_key.c | 55 ++++++++++----------------
net/mac80211/driver-trace.h | 4 -
net/mac80211/key.c | 25 +++++------
net/mac80211/key.h | 4 -
net/mac80211/rx.c | 18 ++++----
net/mac80211/tx.c | 22 +++++-----
net/mac80211/wep.c | 2
net/mac80211/wpa.c | 6 +-
31 files changed, 233 insertions(+), 274 deletions(-)
--- wireless-testing.orig/include/net/mac80211.h 2010-08-05 23:30:24.000000000 +0200
+++ wireless-testing/include/net/mac80211.h 2010-08-05 23:30:25.000000000 +0200
@@ -789,20 +789,6 @@ static inline bool ieee80211_vif_is_mesh
}
/**
- * enum ieee80211_key_alg - key algorithm
- * @ALG_WEP: WEP40 or WEP104
- * @ALG_TKIP: TKIP
- * @ALG_CCMP: CCMP (AES)
- * @ALG_AES_CMAC: AES-128-CMAC
- */
-enum ieee80211_key_alg {
- ALG_WEP,
- ALG_TKIP,
- ALG_CCMP,
- ALG_AES_CMAC,
-};
-
-/**
* enum ieee80211_key_flags - key flags
*
* These flags are used for communication about keys between the driver
@@ -839,7 +825,7 @@ enum ieee80211_key_flags {
* @hw_key_idx: To be set by the driver, this is the key index the driver
* wants to be given when a frame is transmitted and needs to be
* encrypted in hardware.
- * @alg: The key algorithm.
+ * @cipher: The key's cipher suite selector.
* @flags: key flags, see &enum ieee80211_key_flags.
* @keyidx: the key index (0-3)
* @keylen: key material length
@@ -852,7 +838,7 @@ enum ieee80211_key_flags {
* @iv_len: The IV length for this key type
*/
struct ieee80211_key_conf {
- enum ieee80211_key_alg alg;
+ u32 cipher;
u8 icv_len;
u8 iv_len;
u8 hw_key_idx;
--- wireless-testing.orig/net/mac80211/cfg.c 2010-08-05 23:30:24.000000000 +0200
+++ wireless-testing/net/mac80211/cfg.c 2010-08-06 09:01:49.000000000 +0200
@@ -116,7 +116,6 @@ static int ieee80211_add_key(struct wiph
{
struct ieee80211_sub_if_data *sdata;
struct sta_info *sta = NULL;
- enum ieee80211_key_alg alg;
struct ieee80211_key *key;
int err;
@@ -125,31 +124,20 @@ static int ieee80211_add_key(struct wiph
sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+ /* reject WEP and TKIP keys if WEP failed to initialize */
switch (params->cipher) {
case WLAN_CIPHER_SUITE_WEP40:
- case WLAN_CIPHER_SUITE_WEP104:
- alg = ALG_WEP;
- break;
case WLAN_CIPHER_SUITE_TKIP:
- alg = ALG_TKIP;
- break;
- case WLAN_CIPHER_SUITE_CCMP:
- alg = ALG_CCMP;
- break;
- case WLAN_CIPHER_SUITE_AES_CMAC:
- alg = ALG_AES_CMAC;
+ case WLAN_CIPHER_SUITE_WEP104:
+ if (IS_ERR(sdata->local->wep_tx_tfm))
+ return -EINVAL;
break;
default:
- return -EINVAL;
+ break;
}
- /* reject WEP and TKIP keys if WEP failed to initialize */
- if ((alg == ALG_WEP || alg == ALG_TKIP) &&
- IS_ERR(sdata->local->wep_tx_tfm))
- return -EINVAL;
-
- key = ieee80211_key_alloc(alg, key_idx, params->key_len, params->key,
- params->seq_len, params->seq);
+ key = ieee80211_key_alloc(params->cipher, key_idx, params->key_len,
+ params->key, params->seq_len, params->seq);
if (!key)
return -ENOMEM;
@@ -247,10 +235,10 @@ static int ieee80211_get_key(struct wiph
memset(¶ms, 0, sizeof(params));
- switch (key->conf.alg) {
- case ALG_TKIP:
- params.cipher = WLAN_CIPHER_SUITE_TKIP;
+ params.cipher = key->conf.cipher;
+ switch (key->conf.cipher) {
+ case WLAN_CIPHER_SUITE_TKIP:
iv32 = key->u.tkip.tx.iv32;
iv16 = key->u.tkip.tx.iv16;
@@ -268,8 +256,7 @@ static int ieee80211_get_key(struct wiph
params.seq = seq;
params.seq_len = 6;
break;
- case ALG_CCMP:
- params.cipher = WLAN_CIPHER_SUITE_CCMP;
+ case WLAN_CIPHER_SUITE_CCMP:
seq[0] = key->u.ccmp.tx_pn[5];
seq[1] = key->u.ccmp.tx_pn[4];
seq[2] = key->u.ccmp.tx_pn[3];
@@ -279,14 +266,7 @@ static int ieee80211_get_key(struct wiph
params.seq = seq;
params.seq_len = 6;
break;
- case ALG_WEP:
- if (key->conf.keylen == 5)
- params.cipher = WLAN_CIPHER_SUITE_WEP40;
- else
- params.cipher = WLAN_CIPHER_SUITE_WEP104;
- break;
- case ALG_AES_CMAC:
- params.cipher = WLAN_CIPHER_SUITE_AES_CMAC;
+ case WLAN_CIPHER_SUITE_AES_CMAC:
seq[0] = key->u.aes_cmac.tx_pn[5];
seq[1] = key->u.aes_cmac.tx_pn[4];
seq[2] = key->u.aes_cmac.tx_pn[3];
--- wireless-testing.orig/net/mac80211/key.c 2010-08-05 23:30:24.000000000 +0200
+++ wireless-testing/net/mac80211/key.c 2010-08-06 09:01:49.000000000 +0200
@@ -227,9 +227,7 @@ static void __ieee80211_key_replace(stru
}
}
-struct ieee80211_key *ieee80211_key_alloc(enum ieee80211_key_alg alg,
- int idx,
- size_t key_len,
+struct ieee80211_key *ieee80211_key_alloc(u32 cipher, int idx, size_t key_len,
const u8 *key_data,
size_t seq_len, const u8 *seq)
{
@@ -249,15 +247,16 @@ struct ieee80211_key *ieee80211_key_allo
key->conf.flags = 0;
key->flags = 0;
- key->conf.alg = alg;
+ key->conf.cipher = cipher;
key->conf.keyidx = idx;
key->conf.keylen = key_len;
- switch (alg) {
- case ALG_WEP:
+ switch (cipher) {
+ case WLAN_CIPHER_SUITE_WEP40:
+ case WLAN_CIPHER_SUITE_WEP104:
key->conf.iv_len = WEP_IV_LEN;
key->conf.icv_len = WEP_ICV_LEN;
break;
- case ALG_TKIP:
+ case WLAN_CIPHER_SUITE_TKIP:
key->conf.iv_len = TKIP_IV_LEN;
key->conf.icv_len = TKIP_ICV_LEN;
if (seq) {
@@ -269,7 +268,7 @@ struct ieee80211_key *ieee80211_key_allo
}
}
break;
- case ALG_CCMP:
+ case WLAN_CIPHER_SUITE_CCMP:
key->conf.iv_len = CCMP_HDR_LEN;
key->conf.icv_len = CCMP_MIC_LEN;
if (seq) {
@@ -279,7 +278,7 @@ struct ieee80211_key *ieee80211_key_allo
seq[CCMP_PN_LEN - j - 1];
}
break;
- case ALG_AES_CMAC:
+ case WLAN_CIPHER_SUITE_AES_CMAC:
key->conf.iv_len = 0;
key->conf.icv_len = sizeof(struct ieee80211_mmie);
if (seq)
@@ -290,7 +289,7 @@ struct ieee80211_key *ieee80211_key_allo
memcpy(key->conf.key, key_data, key_len);
INIT_LIST_HEAD(&key->list);
- if (alg == ALG_CCMP) {
+ if (cipher == WLAN_CIPHER_SUITE_CCMP) {
/*
* Initialize AES key state here as an optimization so that
* it does not need to be initialized for every packet.
@@ -302,7 +301,7 @@ struct ieee80211_key *ieee80211_key_allo
}
}
- if (alg == ALG_AES_CMAC) {
+ if (cipher == WLAN_CIPHER_SUITE_AES_CMAC) {
/*
* Initialize AES key state here as an optimization so that
* it does not need to be initialized for every packet.
@@ -326,9 +325,9 @@ static void __ieee80211_key_destroy(stru
if (key->local)
ieee80211_key_disable_hw_accel(key);
- if (key->conf.alg == ALG_CCMP)
+ if (key->conf.cipher == WLAN_CIPHER_SUITE_CCMP)
ieee80211_aes_key_free(key->u.ccmp.tfm);
- if (key->conf.alg == ALG_AES_CMAC)
+ if (key->conf.cipher == WLAN_CIPHER_SUITE_AES_CMAC)
ieee80211_aes_cmac_key_free(key->u.aes_cmac.tfm);
if (key->local)
ieee80211_debugfs_key_remove(key);
--- wireless-testing.orig/net/mac80211/key.h 2010-08-05 23:30:24.000000000 +0200
+++ wireless-testing/net/mac80211/key.h 2010-08-06 09:01:49.000000000 +0200
@@ -123,9 +123,7 @@ struct ieee80211_key {
struct ieee80211_key_conf conf;
};
-struct ieee80211_key *ieee80211_key_alloc(enum ieee80211_key_alg alg,
- int idx,
- size_t key_len,
+struct ieee80211_key *ieee80211_key_alloc(u32 cipher, int idx, size_t key_len,
const u8 *key_data,
size_t seq_len, const u8 *seq);
/*
--- wireless-testing.orig/net/mac80211/rx.c 2010-08-05 23:30:24.000000000 +0200
+++ wireless-testing/net/mac80211/rx.c 2010-08-06 09:01:49.000000000 +0200
@@ -935,7 +935,8 @@ ieee80211_rx_h_decrypt(struct ieee80211_
* pairwise or station-to-station keys, but for WEP we allow
* using a key index as well.
*/
- if (rx->key && rx->key->conf.alg != ALG_WEP &&
+ if (rx->key && rx->key->conf.cipher != WLAN_CIPHER_SUITE_WEP40 &&
+ rx->key->conf.cipher != WLAN_CIPHER_SUITE_WEP104 &&
!is_multicast_ether_addr(hdr->addr1))
rx->key = NULL;
}
@@ -951,8 +952,9 @@ ieee80211_rx_h_decrypt(struct ieee80211_
return RX_DROP_UNUSABLE;
/* the hdr variable is invalid now! */
- switch (rx->key->conf.alg) {
- case ALG_WEP:
+ switch (rx->key->conf.cipher) {
+ case WLAN_CIPHER_SUITE_WEP40:
+ case WLAN_CIPHER_SUITE_WEP104:
/* Check for weak IVs if possible */
if (rx->sta && ieee80211_is_data(fc) &&
(!(status->flag & RX_FLAG_IV_STRIPPED) ||
@@ -962,13 +964,13 @@ ieee80211_rx_h_decrypt(struct ieee80211_
result = ieee80211_crypto_wep_decrypt(rx);
break;
- case ALG_TKIP:
+ case WLAN_CIPHER_SUITE_TKIP:
result = ieee80211_crypto_tkip_decrypt(rx);
break;
- case ALG_CCMP:
+ case WLAN_CIPHER_SUITE_CCMP:
result = ieee80211_crypto_ccmp_decrypt(rx);
break;
- case ALG_AES_CMAC:
+ case WLAN_CIPHER_SUITE_AES_CMAC:
result = ieee80211_crypto_aes_cmac_decrypt(rx);
break;
}
@@ -1265,7 +1267,7 @@ ieee80211_rx_h_defragment(struct ieee802
/* This is the first fragment of a new frame. */
entry = ieee80211_reassemble_add(rx->sdata, frag, seq,
rx->queue, &(rx->skb));
- if (rx->key && rx->key->conf.alg == ALG_CCMP &&
+ if (rx->key && rx->key->conf.cipher == WLAN_CIPHER_SUITE_CCMP &&
ieee80211_has_protected(fc)) {
int queue = ieee80211_is_mgmt(fc) ?
NUM_RX_DATA_QUEUES : rx->queue;
@@ -1294,7 +1296,7 @@ ieee80211_rx_h_defragment(struct ieee802
int i;
u8 pn[CCMP_PN_LEN], *rpn;
int queue;
- if (!rx->key || rx->key->conf.alg != ALG_CCMP)
+ if (!rx->key || rx->key->conf.cipher != WLAN_CIPHER_SUITE_CCMP)
return RX_DROP_UNUSABLE;
memcpy(pn, entry->last_pn, CCMP_PN_LEN);
for (i = CCMP_PN_LEN - 1; i >= 0; i--) {
--- wireless-testing.orig/net/mac80211/tx.c 2010-08-05 23:30:24.000000000 +0200
+++ wireless-testing/net/mac80211/tx.c 2010-08-06 09:01:49.000000000 +0200
@@ -543,15 +543,16 @@ ieee80211_tx_h_select_key(struct ieee802
tx->key->tx_rx_count++;
/* TODO: add threshold stuff again */
- switch (tx->key->conf.alg) {
- case ALG_WEP:
+ switch (tx->key->conf.cipher) {
+ case WLAN_CIPHER_SUITE_WEP40:
+ case WLAN_CIPHER_SUITE_WEP104:
if (ieee80211_is_auth(hdr->frame_control))
break;
- case ALG_TKIP:
+ case WLAN_CIPHER_SUITE_TKIP:
if (!ieee80211_is_data_present(hdr->frame_control))
tx->key = NULL;
break;
- case ALG_CCMP:
+ case WLAN_CIPHER_SUITE_CCMP:
if (!ieee80211_is_data_present(hdr->frame_control) &&
!ieee80211_use_mfp(hdr->frame_control, tx->sta,
tx->skb))
@@ -561,7 +562,7 @@ ieee80211_tx_h_select_key(struct ieee802
IEEE80211_KEY_FLAG_SW_MGMT) &&
ieee80211_is_mgmt(hdr->frame_control);
break;
- case ALG_AES_CMAC:
+ case WLAN_CIPHER_SUITE_AES_CMAC:
if (!ieee80211_is_mgmt(hdr->frame_control))
tx->key = NULL;
break;
@@ -949,14 +950,15 @@ ieee80211_tx_h_encrypt(struct ieee80211_
if (!tx->key)
return TX_CONTINUE;
- switch (tx->key->conf.alg) {
- case ALG_WEP:
+ switch (tx->key->conf.cipher) {
+ case WLAN_CIPHER_SUITE_WEP40:
+ case WLAN_CIPHER_SUITE_WEP104:
return ieee80211_crypto_wep_encrypt(tx);
- case ALG_TKIP:
+ case WLAN_CIPHER_SUITE_TKIP:
return ieee80211_crypto_tkip_encrypt(tx);
- case ALG_CCMP:
+ case WLAN_CIPHER_SUITE_CCMP:
return ieee80211_crypto_ccmp_encrypt(tx);
- case ALG_AES_CMAC:
+ case WLAN_CIPHER_SUITE_AES_CMAC:
return ieee80211_crypto_aes_cmac_encrypt(tx);
}
--- wireless-testing.orig/net/mac80211/wep.c 2010-08-05 23:30:24.000000000 +0200
+++ wireless-testing/net/mac80211/wep.c 2010-08-05 23:30:25.000000000 +0200
@@ -240,7 +240,7 @@ static int ieee80211_wep_decrypt(struct
keyidx = skb->data[hdrlen + 3] >> 6;
- if (!key || keyidx != key->conf.keyidx || key->conf.alg != ALG_WEP)
+ if (!key || keyidx != key->conf.keyidx)
return -1;
klen = 3 + key->conf.keylen;
--- wireless-testing.orig/net/mac80211/wpa.c 2010-08-05 23:30:24.000000000 +0200
+++ wireless-testing/net/mac80211/wpa.c 2010-08-05 23:30:25.000000000 +0200
@@ -36,8 +36,8 @@ ieee80211_tx_h_michael_mic_add(struct ie
int tail;
hdr = (struct ieee80211_hdr *)skb->data;
- if (!tx->key || tx->key->conf.alg != ALG_TKIP || skb->len < 24 ||
- !ieee80211_is_data_present(hdr->frame_control))
+ if (!tx->key || tx->key->conf.cipher != WLAN_CIPHER_SUITE_TKIP ||
+ skb->len < 24 || !ieee80211_is_data_present(hdr->frame_control))
return TX_CONTINUE;
hdrlen = ieee80211_hdrlen(hdr->frame_control);
@@ -94,7 +94,7 @@ ieee80211_rx_h_michael_mic_verify(struct
if (status->flag & RX_FLAG_MMIC_STRIPPED)
return RX_CONTINUE;
- if (!rx->key || rx->key->conf.alg != ALG_TKIP ||
+ if (!rx->key || rx->key->conf.cipher != WLAN_CIPHER_SUITE_TKIP ||
!ieee80211_has_protected(hdr->frame_control) ||
!ieee80211_is_data_present(hdr->frame_control))
return RX_CONTINUE;
--- wireless-testing.orig/net/mac80211/debugfs_key.c 2010-08-05 23:30:24.000000000 +0200
+++ wireless-testing/net/mac80211/debugfs_key.c 2010-08-05 23:30:25.000000000 +0200
@@ -64,26 +64,13 @@ static ssize_t key_algorithm_read(struct
char __user *userbuf,
size_t count, loff_t *ppos)
{
- char *alg;
+ char buf[15];
struct ieee80211_key *key = file->private_data;
+ u32 c = key->conf.cipher;
- switch (key->conf.alg) {
- case ALG_WEP:
- alg = "WEP\n";
- break;
- case ALG_TKIP:
- alg = "TKIP\n";
- break;
- case ALG_CCMP:
- alg = "CCMP\n";
- break;
- case ALG_AES_CMAC:
- alg = "AES-128-CMAC\n";
- break;
- default:
- return 0;
- }
- return simple_read_from_buffer(userbuf, count, ppos, alg, strlen(alg));
+ sprintf(buf, "%.2x-%.2x-%.2x:%d\n",
+ c >> 24, (c >> 16) & 0xff, (c >> 8) & 0xff, c & 0xff);
+ return simple_read_from_buffer(userbuf, count, ppos, buf, strlen(buf));
}
KEY_OPS(algorithm);
@@ -95,21 +82,22 @@ static ssize_t key_tx_spec_read(struct f
int len;
struct ieee80211_key *key = file->private_data;
- switch (key->conf.alg) {
- case ALG_WEP:
+ switch (key->conf.cipher) {
+ case WLAN_CIPHER_SUITE_WEP40:
+ case WLAN_CIPHER_SUITE_WEP104:
len = scnprintf(buf, sizeof(buf), "\n");
break;
- case ALG_TKIP:
+ case WLAN_CIPHER_SUITE_TKIP:
len = scnprintf(buf, sizeof(buf), "%08x %04x\n",
key->u.tkip.tx.iv32,
key->u.tkip.tx.iv16);
break;
- case ALG_CCMP:
+ case WLAN_CIPHER_SUITE_CCMP:
tpn = key->u.ccmp.tx_pn;
len = scnprintf(buf, sizeof(buf), "%02x%02x%02x%02x%02x%02x\n",
tpn[0], tpn[1], tpn[2], tpn[3], tpn[4], tpn[5]);
break;
- case ALG_AES_CMAC:
+ case WLAN_CIPHER_SUITE_AES_CMAC:
tpn = key->u.aes_cmac.tx_pn;
len = scnprintf(buf, sizeof(buf), "%02x%02x%02x%02x%02x%02x\n",
tpn[0], tpn[1], tpn[2], tpn[3], tpn[4],
@@ -130,11 +118,12 @@ static ssize_t key_rx_spec_read(struct f
int i, len;
const u8 *rpn;
- switch (key->conf.alg) {
- case ALG_WEP:
+ switch (key->conf.cipher) {
+ case WLAN_CIPHER_SUITE_WEP40:
+ case WLAN_CIPHER_SUITE_WEP104:
len = scnprintf(buf, sizeof(buf), "\n");
break;
- case ALG_TKIP:
+ case WLAN_CIPHER_SUITE_TKIP:
for (i = 0; i < NUM_RX_DATA_QUEUES; i++)
p += scnprintf(p, sizeof(buf)+buf-p,
"%08x %04x\n",
@@ -142,7 +131,7 @@ static ssize_t key_rx_spec_read(struct f
key->u.tkip.rx[i].iv16);
len = p - buf;
break;
- case ALG_CCMP:
+ case WLAN_CIPHER_SUITE_CCMP:
for (i = 0; i < NUM_RX_DATA_QUEUES + 1; i++) {
rpn = key->u.ccmp.rx_pn[i];
p += scnprintf(p, sizeof(buf)+buf-p,
@@ -152,7 +141,7 @@ static ssize_t key_rx_spec_read(struct f
}
len = p - buf;
break;
- case ALG_AES_CMAC:
+ case WLAN_CIPHER_SUITE_AES_CMAC:
rpn = key->u.aes_cmac.rx_pn;
p += scnprintf(p, sizeof(buf)+buf-p,
"%02x%02x%02x%02x%02x%02x\n",
@@ -174,11 +163,11 @@ static ssize_t key_replays_read(struct f
char buf[20];
int len;
- switch (key->conf.alg) {
- case ALG_CCMP:
+ switch (key->conf.cipher) {
+ case WLAN_CIPHER_SUITE_CCMP:
len = scnprintf(buf, sizeof(buf), "%u\n", key->u.ccmp.replays);
break;
- case ALG_AES_CMAC:
+ case WLAN_CIPHER_SUITE_AES_CMAC:
len = scnprintf(buf, sizeof(buf), "%u\n",
key->u.aes_cmac.replays);
break;
@@ -196,8 +185,8 @@ static ssize_t key_icverrors_read(struct
char buf[20];
int len;
- switch (key->conf.alg) {
- case ALG_AES_CMAC:
+ switch (key->conf.cipher) {
+ case WLAN_CIPHER_SUITE_AES_CMAC:
len = scnprintf(buf, sizeof(buf), "%u\n",
key->u.aes_cmac.icverrors);
break;
--- wireless-testing.orig/net/mac80211/driver-trace.h 2010-08-05 23:30:24.000000000 +0200
+++ wireless-testing/net/mac80211/driver-trace.h 2010-08-05 23:30:25.000000000 +0200
@@ -336,7 +336,7 @@ TRACE_EVENT(drv_set_key,
LOCAL_ENTRY
VIF_ENTRY
STA_ENTRY
- __field(enum ieee80211_key_alg, alg)
+ __field(u32, cipher)
__field(u8, hw_key_idx)
__field(u8, flags)
__field(s8, keyidx)
@@ -346,7 +346,7 @@ TRACE_EVENT(drv_set_key,
LOCAL_ASSIGN;
VIF_ASSIGN;
STA_ASSIGN;
- __entry->alg = key->alg;
+ __entry->cipher = key->cipher;
__entry->flags = key->flags;
__entry->keyidx = key->keyidx;
__entry->hw_key_idx = key->hw_key_idx;
--- wireless-testing.orig/drivers/net/wireless/ath/ar9170/main.c 2010-08-05 23:30:25.000000000 +0200
+++ wireless-testing/drivers/net/wireless/ath/ar9170/main.c 2010-08-05 23:30:25.000000000 +0200
@@ -1190,14 +1190,13 @@ static int ar9170_tx_prepare(struct ar91
if (info->control.hw_key) {
icv = info->control.hw_key->icv_len;
- switch (info->control.hw_key->alg) {
- case ALG_WEP:
+ switch (info->control.hw_key->cipher) {
+ case WLAN_CIPHER_SUITE_WEP40:
+ case WLAN_CIPHER_SUITE_WEP104:
+ case WLAN_CIPHER_SUITE_TKIP:
keytype = AR9170_TX_MAC_ENCR_RC4;
break;
- case ALG_TKIP:
- keytype = AR9170_TX_MAC_ENCR_RC4;
- break;
- case ALG_CCMP:
+ case WLAN_CIPHER_SUITE_CCMP:
keytype = AR9170_TX_MAC_ENCR_AES;
break;
default:
@@ -1778,17 +1777,17 @@ static int ar9170_set_key(struct ieee802
if ((!ar->vif) || (ar->disable_offload))
return -EOPNOTSUPP;
- switch (key->alg) {
- case ALG_WEP:
- if (key->keylen == WLAN_KEY_LEN_WEP40)
- ktype = AR9170_ENC_ALG_WEP64;
- else
- ktype = AR9170_ENC_ALG_WEP128;
+ switch (key->cipher) {
+ case WLAN_CIPHER_SUITE_WEP40:
+ ktype = AR9170_ENC_ALG_WEP64;
+ break;
+ case WLAN_CIPHER_SUITE_WEP104:
+ ktype = AR9170_ENC_ALG_WEP128;
break;
- case ALG_TKIP:
+ case WLAN_CIPHER_SUITE_TKIP:
ktype = AR9170_ENC_ALG_TKIP;
break;
- case ALG_CCMP:
+ case WLAN_CIPHER_SUITE_CCMP:
ktype = AR9170_ENC_ALG_AESCCMP;
break;
default:
@@ -1827,7 +1826,7 @@ static int ar9170_set_key(struct ieee802
if (err)
goto out;
- if (key->alg == ALG_TKIP) {
+ if (key->cipher == WLAN_CIPHER_SUITE_TKIP) {
err = ar9170_upload_key(ar, i, sta ? sta->addr : NULL,
ktype, 1, key->key + 16, 16);
if (err)
@@ -1864,7 +1863,7 @@ static int ar9170_set_key(struct ieee802
if (err)
goto out;
- if (key->alg == ALG_TKIP) {
+ if (key->cipher == WLAN_CIPHER_SUITE_TKIP) {
err = ar9170_upload_key(ar, key->hw_key_idx,
NULL,
AR9170_ENC_ALG_NONE, 1,
--- wireless-testing.orig/drivers/net/wireless/ath/ath5k/base.c 2010-08-05 23:30:25.000000000 +0200
+++ wireless-testing/drivers/net/wireless/ath/ath5k/base.c 2010-08-05 23:30:25.000000000 +0200
@@ -3276,11 +3276,12 @@ ath5k_set_key(struct ieee80211_hw *hw, e
if (sc->opmode == NL80211_IFTYPE_AP)
return -EOPNOTSUPP;
- switch (key->alg) {
- case ALG_WEP:
- case ALG_TKIP:
+ switch (key->cipher) {
+ case WLAN_CIPHER_SUITE_WEP40:
+ case WLAN_CIPHER_SUITE_WEP104:
+ case WLAN_CIPHER_SUITE_TKIP:
break;
- case ALG_CCMP:
+ case WLAN_CIPHER_SUITE_CCMP:
if (sc->ah->ah_aes_support)
break;
--- wireless-testing.orig/drivers/net/wireless/ath/ath5k/pcu.c 2010-08-05 23:30:25.000000000 +0200
+++ wireless-testing/drivers/net/wireless/ath/ath5k/pcu.c 2010-08-05 23:30:25.000000000 +0200
@@ -695,21 +695,18 @@ int ath5k_hw_reset_key(struct ath5k_hw *
static
int ath5k_keycache_type(const struct ieee80211_key_conf *key)
{
- switch (key->alg) {
- case ALG_TKIP:
+ switch (key->cipher) {
+ case WLAN_CIPHER_SUITE_TKIP:
return AR5K_KEYTABLE_TYPE_TKIP;
- case ALG_CCMP:
+ case WLAN_CIPHER_SUITE_CCMP:
return AR5K_KEYTABLE_TYPE_CCM;
- case ALG_WEP:
- if (key->keylen == WLAN_KEY_LEN_WEP40)
- return AR5K_KEYTABLE_TYPE_40;
- else if (key->keylen == WLAN_KEY_LEN_WEP104)
- return AR5K_KEYTABLE_TYPE_104;
- return -EINVAL;
+ case WLAN_CIPHER_SUITE_WEP40:
+ return AR5K_KEYTABLE_TYPE_40;
+ case WLAN_CIPHER_SUITE_WEP104:
+ return AR5K_KEYTABLE_TYPE_104;
default:
return -EINVAL;
}
- return -EINVAL;
}
/*
@@ -728,7 +725,7 @@ int ath5k_hw_set_key(struct ath5k_hw *ah
bool is_tkip;
const u8 *key_ptr;
- is_tkip = (key->alg == ALG_TKIP);
+ is_tkip = (key->cipher == WLAN_CIPHER_SUITE_TKIP);
/*
* key->keylen comes in from mac80211 in bytes.
--- wireless-testing.orig/drivers/net/wireless/ath/ath9k/main.c 2010-08-05 23:30:25.000000000 +0200
+++ wireless-testing/drivers/net/wireless/ath/ath9k/main.c 2010-08-05 23:30:25.000000000 +0200
@@ -1776,9 +1776,10 @@ static int ath9k_set_key(struct ieee8021
key->hw_key_idx = ret;
/* push IV and Michael MIC generation to stack */
key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
- if (key->alg == ALG_TKIP)
+ if (key->cipher == WLAN_CIPHER_SUITE_TKIP)
key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC;
- if (sc->sc_ah->sw_mgmt_crypto && key->alg == ALG_CCMP)
+ if (sc->sc_ah->sw_mgmt_crypto &&
+ key->cipher == WLAN_CIPHER_SUITE_CCMP)
key->flags |= IEEE80211_KEY_FLAG_SW_MGMT;
ret = 0;
}
--- wireless-testing.orig/drivers/net/wireless/ath/ath9k/xmit.c 2010-08-05 23:30:25.000000000 +0200
+++ wireless-testing/drivers/net/wireless/ath/ath9k/xmit.c 2010-08-06 08:56:43.000000000 +0200
@@ -1407,22 +1407,6 @@ static enum ath9k_pkt_type get_hw_packet
return htype;
}
-static int get_hw_crypto_keytype(struct sk_buff *skb)
-{
- struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
-
- if (tx_info->control.hw_key) {
- if (tx_info->control.hw_key->alg == ALG_WEP)
- return ATH9K_KEY_TYPE_WEP;
- else if (tx_info->control.hw_key->alg == ALG_TKIP)
- return ATH9K_KEY_TYPE_TKIP;
- else if (tx_info->control.hw_key->alg == ALG_CCMP)
- return ATH9K_KEY_TYPE_AES;
- }
-
- return ATH9K_KEY_TYPE_CLEAR;
-}
-
static void assign_aggr_tid_seqno(struct sk_buff *skb,
struct ath_buf *bf)
{
@@ -1661,7 +1645,7 @@ static int ath_tx_setup_buffer(struct ie
bf->bf_state.bfs_paprd_timestamp = jiffies;
bf->bf_flags = setup_tx_flags(skb, use_ldpc);
- bf->bf_keytype = get_hw_crypto_keytype(skb);
+ bf->bf_keytype = ath9k_cmn_get_hw_crypto_keytype(skb);
if (bf->bf_keytype != ATH9K_KEY_TYPE_CLEAR) {
bf->bf_frmlen += tx_info->control.hw_key->icv_len;
bf->bf_keyix = tx_info->control.hw_key->hw_key_idx;
--- wireless-testing.orig/drivers/net/wireless/ath/ath9k/common.c 2010-08-05 23:30:25.000000000 +0200
+++ wireless-testing/drivers/net/wireless/ath/ath9k/common.c 2010-08-05 23:30:25.000000000 +0200
@@ -46,12 +46,17 @@ int ath9k_cmn_get_hw_crypto_keytype(stru
struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
if (tx_info->control.hw_key) {
- if (tx_info->control.hw_key->alg == ALG_WEP)
+ switch (tx_info->control.hw_key->cipher) {
+ case WLAN_CIPHER_SUITE_WEP40:
+ case WLAN_CIPHER_SUITE_WEP104:
return ATH9K_KEY_TYPE_WEP;
- else if (tx_info->control.hw_key->alg == ALG_TKIP)
+ case WLAN_CIPHER_SUITE_TKIP:
return ATH9K_KEY_TYPE_TKIP;
- else if (tx_info->control.hw_key->alg == ALG_CCMP)
+ case WLAN_CIPHER_SUITE_CCMP:
return ATH9K_KEY_TYPE_AES;
+ default:
+ break;
+ }
}
return ATH9K_KEY_TYPE_CLEAR;
@@ -212,11 +217,11 @@ static int ath_reserve_key_cache_slot_tk
}
static int ath_reserve_key_cache_slot(struct ath_common *common,
- enum ieee80211_key_alg alg)
+ u32 cipher)
{
int i;
- if (alg == ALG_TKIP)
+ if (cipher == WLAN_CIPHER_SUITE_TKIP)
return ath_reserve_key_cache_slot_tkip(common);
/* First, try to find slots that would not be available for TKIP. */
@@ -293,14 +298,15 @@ int ath9k_cmn_key_config(struct ath_comm
memset(&hk, 0, sizeof(hk));
- switch (key->alg) {
- case ALG_WEP:
+ switch (key->cipher) {
+ case WLAN_CIPHER_SUITE_WEP40:
+ case WLAN_CIPHER_SUITE_WEP104:
hk.kv_type = ATH9K_CIPHER_WEP;
break;
- case ALG_TKIP:
+ case WLAN_CIPHER_SUITE_TKIP:
hk.kv_type = ATH9K_CIPHER_TKIP;
break;
- case ALG_CCMP:
+ case WLAN_CIPHER_SUITE_CCMP:
hk.kv_type = ATH9K_CIPHER_AES_CCM;
break;
default:
@@ -316,7 +322,7 @@ int ath9k_cmn_key_config(struct ath_comm
memcpy(gmac, vif->addr, ETH_ALEN);
gmac[0] |= 0x01;
mac = gmac;
- idx = ath_reserve_key_cache_slot(common, key->alg);
+ idx = ath_reserve_key_cache_slot(common, key->cipher);
break;
case NL80211_IFTYPE_ADHOC:
if (!sta) {
@@ -326,7 +332,7 @@ int ath9k_cmn_key_config(struct ath_comm
memcpy(gmac, sta->addr, ETH_ALEN);
gmac[0] |= 0x01;
mac = gmac;
- idx = ath_reserve_key_cache_slot(common, key->alg);
+ idx = ath_reserve_key_cache_slot(common, key->cipher);
break;
default:
idx = key->keyidx;
@@ -348,13 +354,13 @@ int ath9k_cmn_key_config(struct ath_comm
return -EOPNOTSUPP;
mac = sta->addr;
- idx = ath_reserve_key_cache_slot(common, key->alg);
+ idx = ath_reserve_key_cache_slot(common, key->cipher);
}
if (idx < 0)
return -ENOSPC; /* no free key cache entries */
- if (key->alg == ALG_TKIP)
+ if (key->cipher == WLAN_CIPHER_SUITE_TKIP)
ret = ath_setkey_tkip(common, idx, key->key, &hk, mac,
vif->type == NL80211_IFTYPE_AP);
else
@@ -364,7 +370,7 @@ int ath9k_cmn_key_config(struct ath_comm
return -EIO;
set_bit(idx, common->keymap);
- if (key->alg == ALG_TKIP) {
+ if (key->cipher == WLAN_CIPHER_SUITE_TKIP) {
set_bit(idx + 64, common->keymap);
if (common->splitmic) {
set_bit(idx + 32, common->keymap);
@@ -389,7 +395,7 @@ void ath9k_cmn_key_delete(struct ath_com
return;
clear_bit(key->hw_key_idx, common->keymap);
- if (key->alg != ALG_TKIP)
+ if (key->cipher != WLAN_CIPHER_SUITE_TKIP)
return;
clear_bit(key->hw_key_idx + 64, common->keymap);
--- wireless-testing.orig/drivers/net/wireless/ath/ath9k/htc_drv_main.c 2010-08-05 23:30:25.000000000 +0200
+++ wireless-testing/drivers/net/wireless/ath/ath9k/htc_drv_main.c 2010-08-05 23:30:25.000000000 +0200
@@ -1584,9 +1584,10 @@ static int ath9k_htc_set_key(struct ieee
key->hw_key_idx = ret;
/* push IV and Michael MIC generation to stack */
key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
- if (key->alg == ALG_TKIP)
+ if (key->cipher == WLAN_CIPHER_SUITE_TKIP)
key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC;
- if (priv->ah->sw_mgmt_crypto && key->alg == ALG_CCMP)
+ if (priv->ah->sw_mgmt_crypto &&
+ key->cipher == WLAN_CIPHER_SUITE_CCMP)
key->flags |= IEEE80211_KEY_FLAG_SW_MGMT;
ret = 0;
}
--- wireless-testing.orig/drivers/net/wireless/b43/main.c 2010-08-05 23:30:24.000000000 +0200
+++ wireless-testing/drivers/net/wireless/b43/main.c 2010-08-05 23:30:25.000000000 +0200
@@ -3754,17 +3754,17 @@ static int b43_op_set_key(struct ieee802
}
err = -EINVAL;
- switch (key->alg) {
- case ALG_WEP:
- if (key->keylen == WLAN_KEY_LEN_WEP40)
- algorithm = B43_SEC_ALGO_WEP40;
- else
- algorithm = B43_SEC_ALGO_WEP104;
+ switch (key->cipher) {
+ case WLAN_CIPHER_SUITE_WEP40:
+ algorithm = B43_SEC_ALGO_WEP40;
break;
- case ALG_TKIP:
+ case WLAN_CIPHER_SUITE_WEP104:
+ algorithm = B43_SEC_ALGO_WEP104;
+ break;
+ case WLAN_CIPHER_SUITE_TKIP:
algorithm = B43_SEC_ALGO_TKIP;
break;
- case ALG_CCMP:
+ case WLAN_CIPHER_SUITE_CCMP:
algorithm = B43_SEC_ALGO_AES;
break;
default:
--- wireless-testing.orig/drivers/net/wireless/iwlwifi/iwl-agn-tx.c 2010-08-05 23:30:25.000000000 +0200
+++ wireless-testing/drivers/net/wireless/iwlwifi/iwl-agn-tx.c 2010-08-05 23:30:25.000000000 +0200
@@ -488,8 +488,8 @@ static void iwlagn_tx_cmd_build_hwcrypto
{
struct ieee80211_key_conf *keyconf = info->control.hw_key;
- switch (keyconf->alg) {
- case ALG_CCMP:
+ switch (keyconf->cipher) {
+ case WLAN_CIPHER_SUITE_CCMP:
tx_cmd->sec_ctl = TX_CMD_SEC_CCM;
memcpy(tx_cmd->key, keyconf->key, keyconf->keylen);
if (info->flags & IEEE80211_TX_CTL_AMPDU)
@@ -497,20 +497,20 @@ static void iwlagn_tx_cmd_build_hwcrypto
IWL_DEBUG_TX(priv, "tx_cmd with AES hwcrypto\n");
break;
- case ALG_TKIP:
+ case WLAN_CIPHER_SUITE_TKIP:
tx_cmd->sec_ctl = TX_CMD_SEC_TKIP;
ieee80211_get_tkip_key(keyconf, skb_frag,
IEEE80211_TKIP_P2_KEY, tx_cmd->key);
IWL_DEBUG_TX(priv, "tx_cmd with tkip hwcrypto\n");
break;
- case ALG_WEP:
+ case WLAN_CIPHER_SUITE_WEP104:
+ tx_cmd->sec_ctl |= TX_CMD_SEC_KEY128;
+ /* fall through */
+ case WLAN_CIPHER_SUITE_WEP40:
tx_cmd->sec_ctl |= (TX_CMD_SEC_WEP |
(keyconf->keyidx & TX_CMD_SEC_MSK) << TX_CMD_SEC_SHIFT);
- if (keyconf->keylen == WEP_KEY_LEN_128)
- tx_cmd->sec_ctl |= TX_CMD_SEC_KEY128;
-
memcpy(&tx_cmd->key[3], keyconf->key, keyconf->keylen);
IWL_DEBUG_TX(priv, "Configuring packet for WEP encryption "
@@ -518,7 +518,7 @@ static void iwlagn_tx_cmd_build_hwcrypto
break;
default:
- IWL_ERR(priv, "Unknown encode alg %d\n", keyconf->alg);
+ IWL_ERR(priv, "Unknown encode cipher %x\n", keyconf->cipher);
break;
}
}
--- wireless-testing.orig/drivers/net/wireless/iwlwifi/iwl-dev.h 2010-08-05 23:30:25.000000000 +0200
+++ wireless-testing/drivers/net/wireless/iwlwifi/iwl-dev.h 2010-08-05 23:30:25.000000000 +0200
@@ -420,7 +420,7 @@ struct iwl_tid_data {
};
struct iwl_hw_key {
- enum ieee80211_key_alg alg;
+ u32 cipher;
int keylen;
u8 keyidx;
u8 key[32];
--- wireless-testing.orig/drivers/net/wireless/iwlwifi/iwl3945-base.c 2010-08-05 23:30:24.000000000 +0200
+++ wireless-testing/drivers/net/wireless/iwlwifi/iwl3945-base.c 2010-08-05 23:30:25.000000000 +0200
@@ -151,7 +151,7 @@ static int iwl3945_set_ccmp_dynamic_key_
key_flags &= ~STA_KEY_FLG_INVALID;
spin_lock_irqsave(&priv->sta_lock, flags);
- priv->stations[sta_id].keyinfo.alg = keyconf->alg;
+ priv->stations[sta_id].keyinfo.cipher = keyconf->cipher;
priv->stations[sta_id].keyinfo.keylen = keyconf->keylen;
memcpy(priv->stations[sta_id].keyinfo.key, keyconf->key,
keyconf->keylen);
@@ -222,23 +222,25 @@ static int iwl3945_set_dynamic_key(struc
keyconf->hw_key_idx = HW_KEY_DYNAMIC;
- switch (keyconf->alg) {
- case ALG_CCMP:
+ switch (keyconf->cipher) {
+ case WLAN_CIPHER_SUITE_CCMP:
ret = iwl3945_set_ccmp_dynamic_key_info(priv, keyconf, sta_id);
break;
- case ALG_TKIP:
+ case WLAN_CIPHER_SUITE_TKIP:
ret = iwl3945_set_tkip_dynamic_key_info(priv, keyconf, sta_id);
break;
- case ALG_WEP:
+ case WLAN_CIPHER_SUITE_WEP40:
+ case WLAN_CIPHER_SUITE_WEP104:
ret = iwl3945_set_wep_dynamic_key_info(priv, keyconf, sta_id);
break;
default:
- IWL_ERR(priv, "Unknown alg: %s alg = %d\n", __func__, keyconf->alg);
+ IWL_ERR(priv, "Unknown alg: %s alg=%x\n", __func__,
+ keyconf->cipher);
ret = -EINVAL;
}
- IWL_DEBUG_WEP(priv, "Set dynamic key: alg= %d len=%d idx=%d sta=%d ret=%d\n",
- keyconf->alg, keyconf->keylen, keyconf->keyidx,
+ IWL_DEBUG_WEP(priv, "Set dynamic key: alg=%x len=%d idx=%d sta=%d ret=%d\n",
+ keyconf->cipher, keyconf->keylen, keyconf->keyidx,
sta_id, ret);
return ret;
@@ -254,10 +256,11 @@ static int iwl3945_remove_static_key(str
static int iwl3945_set_static_key(struct iwl_priv *priv,
struct ieee80211_key_conf *key)
{
- if (key->alg == ALG_WEP)
+ if (key->cipher == WLAN_CIPHER_SUITE_WEP40 ||
+ key->cipher == WLAN_CIPHER_SUITE_WEP104)
return -EOPNOTSUPP;
- IWL_ERR(priv, "Static key invalid: alg %d\n", key->alg);
+ IWL_ERR(priv, "Static key invalid: cipher %x\n", key->cipher);
return -EINVAL;
}
@@ -369,23 +372,25 @@ static void iwl3945_build_tx_cmd_hwcrypt
struct iwl3945_tx_cmd *tx_cmd = (struct iwl3945_tx_cmd *)cmd->cmd.payload;
struct iwl_hw_key *keyinfo = &priv->stations[sta_id].keyinfo;
- switch (keyinfo->alg) {
- case ALG_CCMP:
+ tx_cmd->sec_ctl = 0;
+
+ switch (keyinfo->cipher) {
+ case WLAN_CIPHER_SUITE_CCMP:
tx_cmd->sec_ctl = TX_CMD_SEC_CCM;
memcpy(tx_cmd->key, keyinfo->key, keyinfo->keylen);
IWL_DEBUG_TX(priv, "tx_cmd with AES hwcrypto\n");
break;
- case ALG_TKIP:
+ case WLAN_CIPHER_SUITE_TKIP:
break;
- case ALG_WEP:
- tx_cmd->sec_ctl = TX_CMD_SEC_WEP |
+ case WLAN_CIPHER_SUITE_WEP104:
+ tx_cmd->sec_ctl |= TX_CMD_SEC_KEY128;
+ /* fall through */
+ case WLAN_CIPHER_SUITE_WEP40:
+ tx_cmd->sec_ctl |= TX_CMD_SEC_WEP |
(info->control.hw_key->hw_key_idx & TX_CMD_SEC_MSK) << TX_CMD_SEC_SHIFT;
- if (keyinfo->keylen == 13)
- tx_cmd->sec_ctl |= TX_CMD_SEC_KEY128;
-
memcpy(&tx_cmd->key[3], keyinfo->key, keyinfo->keylen);
IWL_DEBUG_TX(priv, "Configuring packet for WEP encryption "
@@ -393,7 +398,7 @@ static void iwl3945_build_tx_cmd_hwcrypt
break;
default:
- IWL_ERR(priv, "Unknown encode alg %d\n", keyinfo->alg);
+ IWL_ERR(priv, "Unknown encode cipher %x\n", keyinfo->cipher);
break;
}
}
--- wireless-testing.orig/drivers/net/wireless/iwlwifi/iwl-agn.c 2010-08-05 23:30:24.000000000 +0200
+++ wireless-testing/drivers/net/wireless/iwlwifi/iwl-agn.c 2010-08-05 23:30:25.000000000 +0200
@@ -3429,7 +3429,9 @@ static int iwl_mac_set_key(struct ieee80
* in 1X mode.
* In legacy wep mode, we use another host command to the uCode.
*/
- if (key->alg == ALG_WEP && !sta && vif->type != NL80211_IFTYPE_AP) {
+ if ((key->cipher == WLAN_CIPHER_SUITE_WEP40 ||
+ key->cipher == WLAN_CIPHER_SUITE_WEP104) &&
+ !sta && vif->type != NL80211_IFTYPE_AP) {
if (cmd == SET_KEY)
is_default_wep_key = !priv->key_mapping_key;
else
--- wireless-testing.orig/drivers/net/wireless/iwlwifi/iwl-sta.c 2010-08-05 23:30:24.000000000 +0200
+++ wireless-testing/drivers/net/wireless/iwlwifi/iwl-sta.c 2010-08-05 23:30:25.000000000 +0200
@@ -818,7 +818,7 @@ int iwl_set_default_wep_key(struct iwl_p
keyconf->flags &= ~IEEE80211_KEY_FLAG_GENERATE_IV;
keyconf->hw_key_idx = HW_KEY_DEFAULT;
- priv->stations[IWL_AP_ID].keyinfo.alg = ALG_WEP;
+ priv->stations[IWL_AP_ID].keyinfo.cipher = keyconf->cipher;
priv->wep_keys[keyconf->keyidx].key_size = keyconf->keylen;
memcpy(&priv->wep_keys[keyconf->keyidx].key, &keyconf->key,
@@ -856,7 +856,7 @@ static int iwl_set_wep_dynamic_key_info(
spin_lock_irqsave(&priv->sta_lock, flags);
- priv->stations[sta_id].keyinfo.alg = keyconf->alg;
+ priv->stations[sta_id].keyinfo.cipher = keyconf->cipher;
priv->stations[sta_id].keyinfo.keylen = keyconf->keylen;
priv->stations[sta_id].keyinfo.keyidx = keyconf->keyidx;
@@ -906,7 +906,7 @@ static int iwl_set_ccmp_dynamic_key_info
keyconf->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
spin_lock_irqsave(&priv->sta_lock, flags);
- priv->stations[sta_id].keyinfo.alg = keyconf->alg;
+ priv->stations[sta_id].keyinfo.cipher = keyconf->cipher;
priv->stations[sta_id].keyinfo.keylen = keyconf->keylen;
memcpy(priv->stations[sta_id].keyinfo.key, keyconf->key,
@@ -955,7 +955,7 @@ static int iwl_set_tkip_dynamic_key_info
spin_lock_irqsave(&priv->sta_lock, flags);
- priv->stations[sta_id].keyinfo.alg = keyconf->alg;
+ priv->stations[sta_id].keyinfo.cipher = keyconf->cipher;
priv->stations[sta_id].keyinfo.keylen = 16;
if ((priv->stations[sta_id].sta.key.key_flags & STA_KEY_FLG_ENCRYPT_MSK)
@@ -1090,24 +1090,26 @@ int iwl_set_dynamic_key(struct iwl_priv
priv->key_mapping_key++;
keyconf->hw_key_idx = HW_KEY_DYNAMIC;
- switch (keyconf->alg) {
- case ALG_CCMP:
+ switch (keyconf->cipher) {
+ case WLAN_CIPHER_SUITE_CCMP:
ret = iwl_set_ccmp_dynamic_key_info(priv, keyconf, sta_id);
break;
- case ALG_TKIP:
+ case WLAN_CIPHER_SUITE_TKIP:
ret = iwl_set_tkip_dynamic_key_info(priv, keyconf, sta_id);
break;
- case ALG_WEP:
+ case WLAN_CIPHER_SUITE_WEP40:
+ case WLAN_CIPHER_SUITE_WEP104:
ret = iwl_set_wep_dynamic_key_info(priv, keyconf, sta_id);
break;
default:
IWL_ERR(priv,
- "Unknown alg: %s alg = %d\n", __func__, keyconf->alg);
+ "Unknown alg: %s cipher = %x\n", __func__,
+ keyconf->cipher);
ret = -EINVAL;
}
- IWL_DEBUG_WEP(priv, "Set dynamic key: alg= %d len=%d idx=%d sta=%d ret=%d\n",
- keyconf->alg, keyconf->keylen, keyconf->keyidx,
+ IWL_DEBUG_WEP(priv, "Set dynamic key: cipher=%x len=%d idx=%d sta=%d ret=%d\n",
+ keyconf->cipher, keyconf->keylen, keyconf->keyidx,
sta_id, ret);
return ret;
--- wireless-testing.orig/drivers/net/wireless/p54/main.c 2010-08-05 23:30:25.000000000 +0200
+++ wireless-testing/drivers/net/wireless/p54/main.c 2010-08-05 23:30:25.000000000 +0200
@@ -429,8 +429,8 @@ static int p54_set_key(struct ieee80211_
mutex_lock(&priv->conf_mutex);
if (cmd == SET_KEY) {
- switch (key->alg) {
- case ALG_TKIP:
+ switch (key->cipher) {
+ case WLAN_CIPHER_SUITE_TKIP:
if (!(priv->privacy_caps & (BR_DESC_PRIV_CAP_MICHAEL |
BR_DESC_PRIV_CAP_TKIP))) {
ret = -EOPNOTSUPP;
@@ -439,7 +439,8 @@ static int p54_set_key(struct ieee80211_
key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
algo = P54_CRYPTO_TKIPMICHAEL;
break;
- case ALG_WEP:
+ case WLAN_CIPHER_SUITE_WEP40:
+ case WLAN_CIPHER_SUITE_WEP104:
if (!(priv->privacy_caps & BR_DESC_PRIV_CAP_WEP)) {
ret = -EOPNOTSUPP;
goto out_unlock;
@@ -447,7 +448,7 @@ static int p54_set_key(struct ieee80211_
key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
algo = P54_CRYPTO_WEP;
break;
- case ALG_CCMP:
+ case WLAN_CIPHER_SUITE_CCMP:
if (!(priv->privacy_caps & BR_DESC_PRIV_CAP_AESCCMP)) {
ret = -EOPNOTSUPP;
goto out_unlock;
--- wireless-testing.orig/drivers/net/wireless/p54/txrx.c 2010-08-05 23:30:25.000000000 +0200
+++ wireless-testing/drivers/net/wireless/p54/txrx.c 2010-08-05 23:30:25.000000000 +0200
@@ -683,14 +683,15 @@ static void p54_tx_80211_header(struct p
}
}
-static u8 p54_convert_algo(enum ieee80211_key_alg alg)
+static u8 p54_convert_algo(u32 cipher)
{
- switch (alg) {
- case ALG_WEP:
+ switch (cipher) {
+ case WLAN_CIPHER_SUITE_WEP40:
+ case WLAN_CIPHER_SUITE_WEP104:
return P54_CRYPTO_WEP;
- case ALG_TKIP:
+ case WLAN_CIPHER_SUITE_TKIP:
return P54_CRYPTO_TKIPMICHAEL;
- case ALG_CCMP:
+ case WLAN_CIPHER_SUITE_CCMP:
return P54_CRYPTO_AESCCMP;
default:
return 0;
@@ -731,7 +732,7 @@ int p54_tx_80211(struct ieee80211_hw *de
if (info->control.hw_key) {
crypt_offset = ieee80211_get_hdrlen_from_skb(skb);
- if (info->control.hw_key->alg == ALG_TKIP) {
+ if (info->control.hw_key->cipher == WLAN_CIPHER_SUITE_TKIP) {
u8 *iv = (u8 *)(skb->data + crypt_offset);
/*
* The firmware excepts that the IV has to have
@@ -827,10 +828,10 @@ int p54_tx_80211(struct ieee80211_hw *de
hdr->tries = ridx;
txhdr->rts_rate_idx = 0;
if (info->control.hw_key) {
- txhdr->key_type = p54_convert_algo(info->control.hw_key->alg);
+ txhdr->key_type = p54_convert_algo(info->control.hw_key->cipher);
txhdr->key_len = min((u8)16, info->control.hw_key->keylen);
memcpy(txhdr->key, info->control.hw_key->key, txhdr->key_len);
- if (info->control.hw_key->alg == ALG_TKIP) {
+ if (info->control.hw_key->cipher == WLAN_CIPHER_SUITE_TKIP) {
/* reserve space for the MIC key */
len += 8;
memcpy(skb_put(skb, 8), &(info->control.hw_key->key
--- wireless-testing.orig/drivers/net/wireless/rt2x00/rt2500usb.c 2010-08-05 23:30:25.000000000 +0200
+++ wireless-testing/drivers/net/wireless/rt2x00/rt2500usb.c 2010-08-05 23:30:25.000000000 +0200
@@ -355,7 +355,9 @@ static int rt2500usb_config_key(struct r
* it is known that not work at least on some hardware.
* SW crypto will be used in that case.
*/
- if (key->alg == ALG_WEP && key->keyidx != 0)
+ if ((key->cipher == WLAN_CIPHER_SUITE_WEP40 ||
+ key->cipher == WLAN_CIPHER_SUITE_WEP104) &&
+ key->keyidx != 0)
return -EOPNOTSUPP;
/*
--- wireless-testing.orig/drivers/net/wireless/rt2x00/rt2x00crypto.c 2010-08-05 23:30:25.000000000 +0200
+++ wireless-testing/drivers/net/wireless/rt2x00/rt2x00crypto.c 2010-08-05 23:30:25.000000000 +0200
@@ -31,15 +31,14 @@
enum cipher rt2x00crypto_key_to_cipher(struct ieee80211_key_conf *key)
{
- switch (key->alg) {
- case ALG_WEP:
- if (key->keylen == WLAN_KEY_LEN_WEP40)
- return CIPHER_WEP64;
- else
- return CIPHER_WEP128;
- case ALG_TKIP:
+ switch (key->cipher) {
+ case WLAN_CIPHER_SUITE_WEP40:
+ return CIPHER_WEP64;
+ case WLAN_CIPHER_SUITE_WEP104:
+ return CIPHER_WEP128;
+ case WLAN_CIPHER_SUITE_TKIP:
return CIPHER_TKIP;
- case ALG_CCMP:
+ case WLAN_CIPHER_SUITE_CCMP:
return CIPHER_AES;
default:
return CIPHER_NONE;
@@ -95,7 +94,7 @@ unsigned int rt2x00crypto_tx_overhead(st
overhead += key->iv_len;
if (!(key->flags & IEEE80211_KEY_FLAG_GENERATE_MMIC)) {
- if (key->alg == ALG_TKIP)
+ if (key->cipher == WLAN_CIPHER_SUITE_TKIP)
overhead += 8;
}
--- wireless-testing.orig/drivers/net/wireless/wl12xx/wl1251_main.c 2010-08-05 23:30:25.000000000 +0200
+++ wireless-testing/drivers/net/wireless/wl12xx/wl1251_main.c 2010-08-05 23:30:25.000000000 +0200
@@ -725,8 +725,9 @@ static int wl1251_set_key_type(struct wl
struct ieee80211_key_conf *mac80211_key,
const u8 *addr)
{
- switch (mac80211_key->alg) {
- case ALG_WEP:
+ switch (mac80211_key->cipher) {
+ case WLAN_CIPHER_SUITE_WEP40:
+ case WLAN_CIPHER_SUITE_WEP104:
if (is_broadcast_ether_addr(addr))
key->key_type = KEY_WEP_DEFAULT;
else
@@ -734,7 +735,7 @@ static int wl1251_set_key_type(struct wl
mac80211_key->hw_key_idx = mac80211_key->keyidx;
break;
- case ALG_TKIP:
+ case WLAN_CIPHER_SUITE_TKIP:
if (is_broadcast_ether_addr(addr))
key->key_type = KEY_TKIP_MIC_GROUP;
else
@@ -742,7 +743,7 @@ static int wl1251_set_key_type(struct wl
mac80211_key->hw_key_idx = mac80211_key->keyidx;
break;
- case ALG_CCMP:
+ case WLAN_CIPHER_SUITE_CCMP:
if (is_broadcast_ether_addr(addr))
key->key_type = KEY_AES_GROUP;
else
@@ -750,7 +751,7 @@ static int wl1251_set_key_type(struct wl
mac80211_key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
break;
default:
- wl1251_error("Unknown key algo 0x%x", mac80211_key->alg);
+ wl1251_error("Unknown key cipher 0x%x", mac80211_key->cipher);
return -EOPNOTSUPP;
}
@@ -783,7 +784,7 @@ static int wl1251_op_set_key(struct ieee
wl1251_debug(DEBUG_CRYPT, "CMD: 0x%x", cmd);
wl1251_dump(DEBUG_CRYPT, "ADDR: ", addr, ETH_ALEN);
wl1251_debug(DEBUG_CRYPT, "Key: algo:0x%x, id:%d, len:%d flags 0x%x",
- key->alg, key->keyidx, key->keylen, key->flags);
+ key->cipher, key->keyidx, key->keylen, key->flags);
wl1251_dump(DEBUG_CRYPT, "KEY: ", key->key, key->keylen);
if (is_zero_ether_addr(addr)) {
--- wireless-testing.orig/drivers/net/wireless/wl12xx/wl1251_tx.c 2010-08-05 23:30:25.000000000 +0200
+++ wireless-testing/drivers/net/wireless/wl12xx/wl1251_tx.c 2010-08-05 23:30:25.000000000 +0200
@@ -189,7 +189,7 @@ static int wl1251_tx_send_packet(struct
tx_hdr = (struct tx_double_buffer_desc *) skb->data;
if (control->control.hw_key &&
- control->control.hw_key->alg == ALG_TKIP) {
+ control->control.hw_key->cipher == WLAN_CIPHER_SUITE_TKIP) {
int hdrlen;
__le16 fc;
u16 length;
@@ -399,7 +399,7 @@ static void wl1251_tx_packet_cb(struct w
*/
frame = skb_pull(skb, sizeof(struct tx_double_buffer_desc));
if (info->control.hw_key &&
- info->control.hw_key->alg == ALG_TKIP) {
+ info->control.hw_key->cipher == WLAN_CIPHER_SUITE_TKIP) {
hdrlen = ieee80211_get_hdrlen_from_skb(skb);
memmove(frame + WL1251_TKIP_IV_SPACE, frame, hdrlen);
skb_pull(skb, WL1251_TKIP_IV_SPACE);
--- wireless-testing.orig/drivers/net/wireless/wl12xx/wl1271_main.c 2010-08-05 23:30:25.000000000 +0200
+++ wireless-testing/drivers/net/wireless/wl12xx/wl1271_main.c 2010-08-05 23:30:25.000000000 +0200
@@ -1439,7 +1439,7 @@ static int wl1271_op_set_key(struct ieee
wl1271_debug(DEBUG_CRYPT, "CMD: 0x%x", cmd);
wl1271_dump(DEBUG_CRYPT, "ADDR: ", addr, ETH_ALEN);
wl1271_debug(DEBUG_CRYPT, "Key: algo:0x%x, id:%d, len:%d flags 0x%x",
- key_conf->alg, key_conf->keyidx,
+ key_conf->cipher, key_conf->keyidx,
key_conf->keylen, key_conf->flags);
wl1271_dump(DEBUG_CRYPT, "KEY: ", key_conf->key, key_conf->keylen);
@@ -1455,20 +1455,21 @@ static int wl1271_op_set_key(struct ieee
if (ret < 0)
goto out_unlock;
- switch (key_conf->alg) {
- case ALG_WEP:
+ switch (key_conf->cipher) {
+ case WLAN_CIPHER_SUITE_WEP40:
+ case WLAN_CIPHER_SUITE_WEP104:
key_type = KEY_WEP;
key_conf->hw_key_idx = key_conf->keyidx;
break;
- case ALG_TKIP:
+ case WLAN_CIPHER_SUITE_TKIP:
key_type = KEY_TKIP;
key_conf->hw_key_idx = key_conf->keyidx;
tx_seq_32 = WL1271_TX_SECURITY_HI32(wl->tx_security_seq);
tx_seq_16 = WL1271_TX_SECURITY_LO16(wl->tx_security_seq);
break;
- case ALG_CCMP:
+ case WLAN_CIPHER_SUITE_CCMP:
key_type = KEY_AES;
key_conf->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
@@ -1476,7 +1477,7 @@ static int wl1271_op_set_key(struct ieee
tx_seq_16 = WL1271_TX_SECURITY_LO16(wl->tx_security_seq);
break;
default:
- wl1271_error("Unknown key algo 0x%x", key_conf->alg);
+ wl1271_error("Unknown key algo 0x%x", key_conf->cipher);
ret = -EOPNOTSUPP;
goto out_sleep;
--- wireless-testing.orig/drivers/net/wireless/wl12xx/wl1271_tx.c 2010-08-05 23:30:25.000000000 +0200
+++ wireless-testing/drivers/net/wireless/wl12xx/wl1271_tx.c 2010-08-05 23:30:25.000000000 +0200
@@ -193,7 +193,7 @@ static int wl1271_tx_frame(struct wl1271
info = IEEE80211_SKB_CB(skb);
if (info->control.hw_key &&
- info->control.hw_key->alg == ALG_TKIP)
+ info->control.hw_key->cipher == WLAN_CIPHER_SUITE_TKIP)
extra = WL1271_TKIP_IV_SPACE;
if (info->control.hw_key) {
@@ -347,7 +347,7 @@ static void wl1271_tx_complete_packet(st
/* remove TKIP header space if present */
if (info->control.hw_key &&
- info->control.hw_key->alg == ALG_TKIP) {
+ info->control.hw_key->cipher == WLAN_CIPHER_SUITE_TKIP) {
int hdrlen = ieee80211_get_hdrlen_from_skb(skb);
memmove(skb->data + WL1271_TKIP_IV_SPACE, skb->data, hdrlen);
skb_pull(skb, WL1271_TKIP_IV_SPACE);
^ permalink raw reply
* [PATCH 2/5] mac80211: move key tfm setup
From: Johannes Berg @ 2010-08-10 7:46 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless
In-Reply-To: <20100810074637.034583799@sipsolutions.net>
From: Johannes Berg <johannes.berg@intel.com>
There's no need to keep separate if statements
for setting up the CCMP/AES-CMAC tfm structs;
move that into the existing switch statement.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
net/mac80211/key.c | 26 ++++++++++----------------
1 file changed, 10 insertions(+), 16 deletions(-)
--- wireless-testing.orig/net/mac80211/key.c 2010-08-08 11:03:25.000000000 +0200
+++ wireless-testing/net/mac80211/key.c 2010-08-08 11:03:26.000000000 +0200
@@ -277,19 +277,6 @@ struct ieee80211_key *ieee80211_key_allo
key->u.ccmp.rx_pn[i][j] =
seq[CCMP_PN_LEN - j - 1];
}
- break;
- case WLAN_CIPHER_SUITE_AES_CMAC:
- key->conf.iv_len = 0;
- key->conf.icv_len = sizeof(struct ieee80211_mmie);
- if (seq)
- for (j = 0; j < 6; j++)
- key->u.aes_cmac.rx_pn[j] = seq[6 - j - 1];
- break;
- }
- memcpy(key->conf.key, key_data, key_len);
- INIT_LIST_HEAD(&key->list);
-
- if (cipher == WLAN_CIPHER_SUITE_CCMP) {
/*
* Initialize AES key state here as an optimization so that
* it does not need to be initialized for every packet.
@@ -299,9 +286,13 @@ struct ieee80211_key *ieee80211_key_allo
kfree(key);
return NULL;
}
- }
-
- if (cipher == WLAN_CIPHER_SUITE_AES_CMAC) {
+ break;
+ case WLAN_CIPHER_SUITE_AES_CMAC:
+ key->conf.iv_len = 0;
+ key->conf.icv_len = sizeof(struct ieee80211_mmie);
+ if (seq)
+ for (j = 0; j < 6; j++)
+ key->u.aes_cmac.rx_pn[j] = seq[6 - j - 1];
/*
* Initialize AES key state here as an optimization so that
* it does not need to be initialized for every packet.
@@ -312,7 +303,10 @@ struct ieee80211_key *ieee80211_key_allo
kfree(key);
return NULL;
}
+ break;
}
+ memcpy(key->conf.key, key_data, key_len);
+ INIT_LIST_HEAD(&key->list);
return key;
}
^ permalink raw reply
* [PATCH 3/5] mac80211: remove unused status flag checks
From: Johannes Berg @ 2010-08-10 7:46 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless
In-Reply-To: <20100810074637.034583799@sipsolutions.net>
From: Johannes Berg <johannes.berg@intel.com>
The decryption code verifies whether or not
a given frame was decrypted and verified by
hardware. This is unnecessary, as the crypto
RX handler already does it long before the
decryption code is even invoked, so remove
that code to avoid confusion.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
net/mac80211/wpa.c | 26 ++++++--------------------
1 file changed, 6 insertions(+), 20 deletions(-)
--- wireless-testing.orig/net/mac80211/wpa.c 2010-08-08 10:38:47.000000000 +0200
+++ wireless-testing/net/mac80211/wpa.c 2010-08-08 10:40:03.000000000 +0200
@@ -221,19 +221,13 @@ ieee80211_crypto_tkip_decrypt(struct iee
if (!rx->sta || skb->len - hdrlen < 12)
return RX_DROP_UNUSABLE;
- if (status->flag & RX_FLAG_DECRYPTED) {
- if (status->flag & RX_FLAG_IV_STRIPPED) {
- /*
- * Hardware took care of all processing, including
- * replay protection, and stripped the ICV/IV so
- * we cannot do any checks here.
- */
- return RX_CONTINUE;
- }
-
- /* let TKIP code verify IV, but skip decryption */
+ /*
+ * Let TKIP code verify IV, but skip decryption.
+ * In the case where hardware checks the IV as well,
+ * we don't even get here, see ieee80211_rx_h_decrypt()
+ */
+ if (status->flag & RX_FLAG_DECRYPTED)
hwaccel = 1;
- }
res = ieee80211_tkip_decrypt_data(rx->local->wep_rx_tfm,
key, skb->data + hdrlen,
@@ -447,10 +441,6 @@ ieee80211_crypto_ccmp_decrypt(struct iee
if (!rx->sta || data_len < 0)
return RX_DROP_UNUSABLE;
- if ((status->flag & RX_FLAG_DECRYPTED) &&
- (status->flag & RX_FLAG_IV_STRIPPED))
- return RX_CONTINUE;
-
ccmp_hdr2pn(pn, skb->data + hdrlen);
queue = ieee80211_is_mgmt(hdr->frame_control) ?
@@ -564,10 +554,6 @@ ieee80211_crypto_aes_cmac_decrypt(struct
if (!ieee80211_is_mgmt(hdr->frame_control))
return RX_CONTINUE;
- if ((status->flag & RX_FLAG_DECRYPTED) &&
- (status->flag & RX_FLAG_IV_STRIPPED))
- return RX_CONTINUE;
-
if (skb->len < 24 + sizeof(*mmie))
return RX_DROP_UNUSABLE;
^ permalink raw reply
* [PATCH 4/5] mac80211: dont advertise WEP if unavailable
From: Johannes Berg @ 2010-08-10 7:46 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless
In-Reply-To: <20100810074637.034583799@sipsolutions.net>
From: Johannes Berg <johannes.berg@intel.com>
When WEP is unavailable, don't advertise it
to cfg80211.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
net/mac80211/main.c | 5 +++++
1 file changed, 5 insertions(+)
--- wireless-testing.orig/net/mac80211/main.c 2010-08-08 11:11:08.000000000 +0200
+++ wireless-testing/net/mac80211/main.c 2010-08-08 11:21:24.000000000 +0200
@@ -509,6 +509,7 @@ int ieee80211_register_hw(struct ieee802
int channels, max_bitrates;
bool supp_ht;
static const u32 cipher_suites[] = {
+ /* keep WEP first, it may be removed below */
WLAN_CIPHER_SUITE_WEP40,
WLAN_CIPHER_SUITE_WEP104,
WLAN_CIPHER_SUITE_TKIP,
@@ -596,6 +597,10 @@ int ieee80211_register_hw(struct ieee802
local->hw.wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites);
if (!(local->hw.flags & IEEE80211_HW_MFP_CAPABLE))
local->hw.wiphy->n_cipher_suites--;
+ if (IS_ERR(local->wep_tx_tfm) || IS_ERR(local->wep_rx_tfm)) {
+ local->hw.wiphy->cipher_suites += 2;
+ local->hw.wiphy->n_cipher_suites -= 2;
+ }
result = wiphy_register(local->hw.wiphy);
if (result < 0)
^ permalink raw reply
* [PATCH 5/5] cfg80211: check if WEP is available for shared key auth
From: Johannes Berg @ 2010-08-10 7:46 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless
In-Reply-To: <20100810074637.034583799@sipsolutions.net>
From: Johannes Berg <johannes.berg@intel.com>
When shared key auth is requested, cfg80211
should verify that the device is capable of
WEP crypto which is required.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
net/wireless/nl80211.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
--- wireless-testing.orig/net/wireless/nl80211.c 2010-08-08 11:32:20.000000000 +0200
+++ wireless-testing/net/wireless/nl80211.c 2010-08-08 11:32:28.000000000 +0200
@@ -3604,6 +3604,21 @@ static int nl80211_authenticate(struct s
if (err)
goto unlock_rtnl;
+ if (key.idx >= 0) {
+ int i;
+ bool ok = false;
+ for (i = 0; i < rdev->wiphy.n_cipher_suites; i++) {
+ if (key.p.cipher == rdev->wiphy.cipher_suites[i]) {
+ ok = true;
+ break;
+ }
+ }
+ if (!ok) {
+ err = -EINVAL;
+ goto out;
+ }
+ }
+
if (!rdev->ops->auth) {
err = -EOPNOTSUPP;
goto out;
^ permalink raw reply
* bug: wl1251 stalls connection
From: Ameya Palande @ 2010-08-10 11:10 UTC (permalink / raw)
To: linux-wireless; +Cc: kalle.valo
Hi,
Can you guys have a look at following wl1251 bug?
Bug 5030 - WL1251 stalls connection completely when being asked to scan
while associated
Link: http://bugs.meego.com/show_bug.cgi?id=5030
Cheers,
Ameya.
^ permalink raw reply
* mac80211: Beaconing adhoc process (ar9170 & ath9k)
From: Jónatan Muñoz @ 2010-08-10 11:35 UTC (permalink / raw)
To: linux-wireless
Hi all,
I am modifying the beaconing system of adhoc mode for ath9k and ar9170.
Until now I change /net/mac80211/ibss.
static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
const u8 *bssid, const int beacon_int,
struct ieee80211_channel *chan,
const u32 basic_rates,
const u16 capability, u64 tsf)
{
.....
if (ifibss->ie_len)
memcpy(skb_put(skb, ifibss->ie_len),
ifibss->ie, ifibss->ie_len);
rcu_assign_pointer(ifibss->presp, skb);
- sdata->vif.bss_conf.beacon_int = beacon_int;
- bss_change = BSS_CHANGED_BEACON_INT;
- bss_change |= ieee80211_reset_erp_info(sdata);
+ bss_change = ieee80211_reset_erp_info(sdata);
bss_change |= BSS_CHANGED_BSSID;
bss_change |= BSS_CHANGED_BEACON;
bss_change |= BSS_CHANGED_BEACON_ENABLED;
bss_change |= BSS_CHANGED_IBSS;
sdata->vif.bss_conf.ibss_joined = true;
ieee80211_bss_info_change_notify(sdata, bss_change);
ieee80211_sta_def_wmm_params(sdata, sband->n_bitrates, supp_rates);
ifibss->state = IEEE80211_IBSS_MLME_JOINED;
mod_timer(&ifibss->timer,
round_jiffies(jiffies + IEEE80211_IBSS_MERGE_INTERVAL));
bss = cfg80211_inform_bss_frame(local->hw.wiphy,
local->hw.conf.channel,
mgmt, skb->len, 0, GFP_KERNEL);
cfg80211_put_bss(bss);
cfg80211_ibss_joined(sdata->dev, ifibss->bssid, GFP_KERNEL);
}
I pretend that each node in an adhoc network send periodically beacons every
100ms. Until now I get that two nodes, one with driver ath9k and the other
one with ar9170, send their beacons in the way I want. But if another node
with ar9170 or ath9k driver is added to the network, the nodes with the same
driver send one beacon every 100ms in total, not each one as I wish. Is
there something more that I must to change?
I hope you bring me some ligth in this darkness.
Thanks in advance
John
------------------------------------------
Jónatan Muñoz
Email: jmunoz@umh.es
Ubiquitous Wireless Communications Research Laboratory
Uwicore, http://www.uwicore.umh.es
Signal Theory and Communications Division
University Miguel Hernández of Elche
Avenida de la Universidad s/n
Edificio Quorum V P2 012
03202, Elche (Alicante)
Spain
Tel: +34 96522 2031 /+34 669256708
Fax: +34 96665 8903
------------------------------------------
^ permalink raw reply
* Pull request: bluetooth-2.6 2010-08-10
From: Marcel Holtmann @ 2010-08-10 12:05 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless
Hi John,
these patches are for 2.6.36 merge window. They are fixing the regressions
with L2CAP ERTM support that haven been found recently.
Regards
Marcel
Please pull from
git://git.kernel.org/pub/scm/linux/kernel/git/holtmann/bluetooth-2.6.git master
This will update the following files:
include/net/bluetooth/l2cap.h | 4 ++--
net/bluetooth/l2cap.c | 11 +++++------
2 files changed, 7 insertions(+), 8 deletions(-)
through these ChangeSets:
Mat Martineau (4):
Bluetooth: Fix endianness issue with L2CAP MPS configuration
Bluetooth: Change default L2CAP ERTM retransmit timeout
Bluetooth: Fix incorrect setting of remote_tx_win for L2CAP ERTM
Bluetooth: Use 3-DH5 payload size for default ERTM max PDU size
^ permalink raw reply
* Re: bug: wl1251 stalls connection
From: Kalle Valo @ 2010-08-10 12:43 UTC (permalink / raw)
To: Ameya Palande; +Cc: linux-wireless, carsten
In-Reply-To: <1281438628.1964.6.camel@chotu>
On 08/10/2010 02:10 PM, Ameya Palande wrote:
> Hi,
Hi Ameya,
> Can you guys have a look at following wl1251 bug?
I'll plan to look at later this week. I need to first setup my n900 to
work with the latest upstream kernel.
> Bug 5030 - WL1251 stalls connection completely when being asked to scan
> while associated
>
> Link: http://bugs.meego.com/show_bug.cgi?id=5030
I remember Android having similar problems with wl1251_sdio. I'm
guessing wl1251 scan commands are somehow broken in upstream kernel.
Obviously this was working with maemo kernels.
It would help someone can file a bug about this to
https://bugzilla.kernel.org/. Easier to track the issue that way.
Kalle
^ permalink raw reply
* Re: Compilation errors on latest git tree
From: Jiri Kosina @ 2010-08-10 12:52 UTC (permalink / raw)
To: Peter Teoh; +Cc: LKML, linux-wireless, linville
In-Reply-To: <AANLkTinU1jzHEwgQScFxt=a0MBSUsMXuYJwkwKocJP6D@mail.gmail.com>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1709 bytes --]
On Tue, 10 Aug 2010, Peter Teoh wrote:
> Got the following compilation errors on the latest linus git tree
> (v.2.6.35-6113-gf6cec0a).
>
> CHK include/linux/version.h
> CHK include/generated/utsrelease.h
> CALL scripts/checksyscalls.sh
> CHK include/generated/compile.h
> VDSOSYM arch/x86/vdso/vdso32-int80-syms.lds
> VDSOSYM arch/x86/vdso/vdso32-sysenter-syms.lds
> VDSOSYM arch/x86/vdso/vdso32-syms.lds
> LD arch/x86/vdso/built-in.o
> LD arch/x86/built-in.o
> CC [M] drivers/net/wireless/libertas/cfg.o
> drivers/net/wireless/libertas/cfg.c: In function ‘lbs_scan_worker’:
> drivers/net/wireless/libertas/cfg.c:722: error: ‘TASK_NORMAL’
> undeclared (first use in this function)
> drivers/net/wireless/libertas/cfg.c:722: error: (Each undeclared
> identifier is reported only once
> drivers/net/wireless/libertas/cfg.c:722: error: for each function it
> appears in.)
> drivers/net/wireless/libertas/cfg.c: In function ‘lbs_cfg_connect’:
> drivers/net/wireless/libertas/cfg.c:1267: error: ‘TASK_INTERRUPTIBLE’
> undeclared (first use in this function)
> drivers/net/wireless/libertas/cfg.c:1267: error: implicit declaration
> of function ‘signal_pending’
> drivers/net/wireless/libertas/cfg.c:1267: error: implicit declaration
> of function ‘schedule_timeout’
> make[4]: *** [drivers/net/wireless/libertas/cfg.o] Error 1
> make[3]: *** [drivers/net/wireless/libertas] Error 2
> make[2]: *** [drivers/net/wireless] Error 2
> make[1]: *** [drivers/net] Error 2
> make: *** [drivers] Error 2
>
> It as resolved via the attached patch. You may want to change the
> way I patch it. Thanks.
Adding some appropriate CCs.
--
Jiri Kosina
SUSE Labs, Novell Inc.
[-- Attachment #2: Type: TEXT/PLAIN, Size: 372 bytes --]
diff --git a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c
index 8e9fbfd..51a96f5 100644
--- a/drivers/net/wireless/libertas/cfg.c
+++ b/drivers/net/wireless/libertas/cfg.c
@@ -7,6 +7,7 @@
*/
#include <linux/slab.h>
+#include <linux/sched.h>
#include <linux/ieee80211.h>
#include <net/cfg80211.h>
#include <asm/unaligned.h>
^ permalink raw reply related
* Re: bug: wl1251 stalls connection
From: Ameya Palande @ 2010-08-10 13:35 UTC (permalink / raw)
To: ext Kalle Valo; +Cc: linux-wireless@vger.kernel.org, carsten@maemo.org
In-Reply-To: <4C614988.20106@adurom.com>
Hi Kalle,
On Tue, 2010-08-10 at 14:43 +0200, ext Kalle Valo wrote:
> On 08/10/2010 02:10 PM, Ameya Palande wrote:
> > Hi,
>
> Hi Ameya,
>
> > Can you guys have a look at following wl1251 bug?
>
> I'll plan to look at later this week. I need to first setup my n900 to
> work with the latest upstream kernel.
>
> > Bug 5030 - WL1251 stalls connection completely when being asked to scan
> > while associated
> >
> > Link: http://bugs.meego.com/show_bug.cgi?id=5030
>
> I remember Android having similar problems with wl1251_sdio. I'm
> guessing wl1251 scan commands are somehow broken in upstream kernel.
> Obviously this was working with maemo kernels.
>
> It would help someone can file a bug about this to
> https://bugzilla.kernel.org/. Easier to track the issue that way.
https://bugzilla.kernel.org/show_bug.cgi?id=16554
Cheers,
Ameya.
^ permalink raw reply
* Re: bug: wl1251 stalls connection
From: Kalle Valo @ 2010-08-10 13:38 UTC (permalink / raw)
To: Ameya Palande; +Cc: linux-wireless@vger.kernel.org, carsten@maemo.org
In-Reply-To: <1281447317.17541.30.camel@chotu>
Ameya Palande <ameya.palande@nokia.com> writes:
> Hi Kalle,
Hi Ameya,
>> I remember Android having similar problems with wl1251_sdio. I'm
>> guessing wl1251 scan commands are somehow broken in upstream kernel.
>> Obviously this was working with maemo kernels.
>>
>> It would help someone can file a bug about this to
>> https://bugzilla.kernel.org/. Easier to track the issue that way.
>
> https://bugzilla.kernel.org/show_bug.cgi?id=16554
Thanks a lot for filing the bug. I'll keep it up-to-date.
--
Kalle Valo
^ permalink raw reply
* Re: Setting MCS rate on injected packets (includes patch)
From: Daniel Haid @ 2010-08-10 14:48 UTC (permalink / raw)
To: linux-wireless; +Cc: Björn Smedman
In-Reply-To: <AANLkTik_78KB4QV210TbTxFRveL-e7yPwsxL-DEizRcX@mail.gmail.com>
I have still not been able to successfully inject packets with a
throughput >10Mbits/s. I have included the patch that I used.
I have combined two old patches that I found on this list.
Please tell me if this can even work in principle, or if I have
to make any changes.
I am injecting packets with libpcap and use the following headers:
static const uint8_t radiotap_header[] = {
0x00, 0x00, // <-- radiotap version
0x0e, 0x00, // <- radiotap header length
0x06, 0x00, 0x0b, 0x00, // <-- bitmap
0x00, // <-- flags
0x00, // <-- rate
0x00, // <-- rts retries
0x01, // <-- data retries
0x02, 0x01 // <-- mcs index, flags 1=40MHz 2=shortgi
};
static const uint8_t ieee_header[] = {
0x88, 0x00, 0x00, 0x00,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0x11, 0x22, 0x33, 0x44, 0x55, 0x66,
0x11, 0x22, 0x33, 0x44, 0x55, 0x66,
0x00, 0x00,
0x00, 0x00,
0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00
};
I also tried different MCS indexes, and using the real mac-adresses instead, but never
am I able to get more than 10MBits/s throughput.
diff -ru a/Documentation/networking/mac80211-injection.txt b/Documentation/networking/mac80211-injection.txt
--- a/Documentation/networking/mac80211-injection.txt 2010-08-09 23:30:51.375120261 +0200
+++ b/Documentation/networking/mac80211-injection.txt 2010-08-09 23:56:11.470652572 +0200
@@ -23,6 +23,17 @@
IEEE80211_RADIOTAP_F_FRAG: frame will be fragmented if longer than the
current fragmentation threshold.
+ * IEEE80211_RADIOTAP_RATE: Transmit rate will be set to the requested value if
+ it's available. Rate control will not be used for
+ the frame.
+
+ * IEEE80211_RADIOTAP_DATA_RETRIES: Retry count will be set to the requested
+ value. This parameter can only be used in
+ conjunction with IEEE80211_RADIOTAP_RATE.
+
+ * IEEE80211_RADIOTAP_RATE_MCS: Transmit rate will be set to the requested MCS
+ index. Rate control will not be used for the
+ frame.
The injection code can also skip all other currently defined radiotap fields
facilitating replay of captured radiotap headers directly.
diff -ru a/include/net/ieee80211_radiotap.h b/include/net/ieee80211_radiotap.h
--- a/include/net/ieee80211_radiotap.h 2010-08-09 23:29:56.819125364 +0200
+++ b/include/net/ieee80211_radiotap.h 2010-08-09 23:11:33.962618255 +0200
@@ -174,6 +174,11 @@
*
* Number of rts retries a transmitted frame used.
*
+ * IEEE80211_RADIOTAP_RATE_MCS 2 x u8 data, bitmap
+ *
+ * First byte is the MCS index of the rate,
+ * second one has flags about channel width and guard interval
+ *
* IEEE80211_RADIOTAP_DATA_RETRIES u8 data
*
* Number of unicast retries a transmitted frame used.
@@ -198,6 +203,7 @@
IEEE80211_RADIOTAP_TX_FLAGS = 15,
IEEE80211_RADIOTAP_RTS_RETRIES = 16,
IEEE80211_RADIOTAP_DATA_RETRIES = 17,
+ IEEE80211_RADIOTAP_RATE_MCS = 19,
/* valid in every it_present bitmap, even vendor namespaces */
IEEE80211_RADIOTAP_RADIOTAP_NAMESPACE = 29,
@@ -245,6 +251,10 @@
#define IEEE80211_RADIOTAP_F_TX_CTS 0x0002 /* used cts 'protection' */
#define IEEE80211_RADIOTAP_F_TX_RTS 0x0004 /* used rts/cts handshake */
+/* For IEEE80211_RADIOTAP_RATE_MCS */
+#define IEEE80211_RADIOTAP_RATE_MCS_40MHZ 0x01 /* 40 MHz channel width */
+#define IEEE80211_RADIOTAP_RATE_MCS_SHORT_GI 0x02 /* short guard interval */
+
/* Ugly macro to convert literal channel numbers into their mhz equivalents
* There are certianly some conditions that will break this (like feeding it '30')
* but they shouldn't arise since nothing talks on channel 30. */
diff -ru a/include/net/mac80211.h b/include/net/mac80211.h
--- a/include/net/mac80211.h 2010-08-09 23:29:57.398627648 +0200
+++ b/include/net/mac80211.h 2010-08-09 23:59:45.182646922 +0200
@@ -287,6 +287,7 @@
* @IEEE80211_TX_CTL_LDPC: tells the driver to use LDPC for this frame
* @IEEE80211_TX_CTL_STBC: Enables Space-Time Block Coding (STBC) for this
* frame and selects the maximum number of streams that it can use.
+ * @IEEE80211_TX_CTL_RC_BYPASS: Don't use rate control on the frame.
*/
enum mac80211_tx_control_flags {
IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0),
@@ -313,6 +314,7 @@
IEEE80211_TX_CTL_LDPC = BIT(22),
IEEE80211_TX_CTL_STBC = BIT(23) | BIT(24),
#define IEEE80211_TX_CTL_STBC_SHIFT 23
+ IEEE80211_TX_CTL_RC_BYPASS = BIT(25),
};
/**
@@ -1929,7 +1931,7 @@
* The TX headroom reserved by mac80211 for its own tx_status functions.
* This is enough for the radiotap header.
*/
-#define IEEE80211_TX_STATUS_HEADROOM 13
+#define IEEE80211_TX_STATUS_HEADROOM 14
/**
* ieee80211_tx_status - transmit status callback
diff -ru a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
--- a/net/mac80211/ieee80211_i.h 2010-08-09 23:26:40.731120745 +0200
+++ b/net/mac80211/ieee80211_i.h 2010-08-09 23:13:27.235118320 +0200
@@ -1084,6 +1084,7 @@
u8 padding_for_rate;
__le16 tx_flags;
u8 data_retries;
+ u8 mcs; /*HT rates*/
} __attribute__ ((packed));
diff -ru a/net/mac80211/rx.c b/net/mac80211/rx.c
--- a/net/mac80211/rx.c 2010-08-09 23:26:40.694618415 +0200
+++ b/net/mac80211/rx.c 2010-08-09 23:13:27.270630234 +0200
@@ -81,7 +81,8 @@
len += 8;
if (local->hw.flags & IEEE80211_HW_SIGNAL_DBM)
len += 1;
-
+ if (status->flag & RX_FLAG_HT)
+ len += 2;
if (len & 1) /* padding for RX_FLAGS if necessary */
len++;
@@ -137,19 +138,11 @@
pos++;
/* IEEE80211_RADIOTAP_RATE */
- if (status->flag & RX_FLAG_HT) {
- /*
- * TODO: add following information into radiotap header once
- * suitable fields are defined for it:
- * - MCS index (status->rate_idx)
- * - HT40 (status->flag & RX_FLAG_40MHZ)
- * - short-GI (status->flag & RX_FLAG_SHORT_GI)
- */
+ rthdr->it_present |= cpu_to_le32(1 << IEEE80211_RADIOTAP_RATE);
+ if (status->flag & RX_FLAG_HT)
*pos = 0;
- } else {
- rthdr->it_present |= cpu_to_le32(1 << IEEE80211_RADIOTAP_RATE);
+ else
*pos = rate->bitrate / 5;
- }
pos++;
/* IEEE80211_RADIOTAP_CHANNEL */
@@ -193,6 +186,20 @@
rx_flags |= IEEE80211_RADIOTAP_F_RX_BADPLCP;
put_unaligned_le16(rx_flags, pos);
pos += 2;
+
+ /* IEEE80211_RADIOTAP_RATE_MCS */
+ if (status->flag & RX_FLAG_HT) {
+ rthdr->it_present |=
+ cpu_to_le32(1 << IEEE80211_RADIOTAP_RATE_MCS);
+ *pos = status->rate_idx;
+ pos++;
+ *pos = 0;
+ if (status->flag & RX_FLAG_40MHZ)
+ *pos |= IEEE80211_RADIOTAP_RATE_MCS_40MHZ;
+ if (status->flag & RX_FLAG_SHORT_GI)
+ *pos |= IEEE80211_RADIOTAP_RATE_MCS_SHORT_GI;
+ pos++;
+ }
}
/*
diff -ru a/net/mac80211/status.c b/net/mac80211/status.c
--- a/net/mac80211/status.c 2010-08-09 23:26:40.714691704 +0200
+++ b/net/mac80211/status.c 2010-08-09 23:13:26.422694046 +0200
@@ -352,6 +352,16 @@
!(info->status.rates[0].flags & IEEE80211_TX_RC_MCS))
rthdr->rate = sband->bitrates[
info->status.rates[0].idx].bitrate / 5;
+ /* HT rates */
+ if (info->status.rates[0].flags & IEEE80211_TX_RC_MCS) {
+ rthdr->hdr.it_present |= cpu_to_le32(1 << IEEE80211_RADIOTAP_RATE_MCS);
+ rthdr->rate = 0;
+ rthdr->mcs = info->status.rates[0].idx;
+ if (info->status.rates[0].flags & IEEE80211_TX_RC_40_MHZ_WIDTH)
+ rthdr->tx_flags |= cpu_to_le16(IEEE80211_RADIOTAP_RATE_MCS_40MHZ);
+ if (info->status.rates[0].flags & IEEE80211_TX_RC_SHORT_GI)
+ rthdr->tx_flags |= cpu_to_le16(IEEE80211_RADIOTAP_RATE_MCS_SHORT_GI);
+ }
/* for now report the total retry_count */
rthdr->data_retries = retry_count;
diff -ru a/net/mac80211/tx.c b/net/mac80211/tx.c
--- a/net/mac80211/tx.c 2010-08-09 23:26:40.558625717 +0200
+++ b/net/mac80211/tx.c 2010-08-09 23:58:17.347120109 +0200
@@ -1068,6 +1068,49 @@
tx->flags |= IEEE80211_TX_FRAGMENTED;
break;
+ case IEEE80211_RADIOTAP_RATE: {
+ info->control.rates[0].idx = 0;
+ if (*iterator.this_arg) {
+ int i;
+ for (i = 0; i < sband->n_bitrates; i++)
+ if (sband->bitrates[i].bitrate <=
+ *iterator.this_arg * 5) {
+ info->control.rates[0].idx = i;
+ break;
+ }
+ }
+ info->flags |= IEEE80211_TX_CTL_RC_BYPASS;
+ info->control.rates[0].flags = 0;
+ info->control.rates[1].idx = -1;
+ info->control.rates[2].idx = -1;
+ info->control.rates[3].idx = -1;
+ info->control.rates[4].idx = -1;
+ break;
+ }
+
+ case IEEE80211_RADIOTAP_DATA_RETRIES:
+ info->control.rates[0].count = *iterator.this_arg;
+ break;
+
+ case IEEE80211_RADIOTAP_RATE_MCS: {
+ u8 flags;
+ if (info->control.rates[0].idx)
+ break;
+ flags = *(iterator.this_arg + 1);
+ info->control.rates[0].idx = *iterator.this_arg;
+
+ info->flags |= IEEE80211_TX_CTL_RC_BYPASS;
+ info->control.rates[0].flags |=
+ IEEE80211_TX_RC_MCS;
+ if (flags & IEEE80211_RADIOTAP_RATE_MCS_40MHZ)
+ info->control.rates[0].flags |=
+ IEEE80211_TX_RC_40_MHZ_WIDTH;
+ if (flags & IEEE80211_RADIOTAP_RATE_MCS_SHORT_GI)
+ info->control.rates[0].flags |=
+ IEEE80211_TX_RC_SHORT_GI;
+ break;
+ }
+
/*
* Please update the file
* Documentation/networking/mac80211-injection.txt
@@ -1314,7 +1357,8 @@
CALL_TXH(ieee80211_tx_h_ps_buf);
CALL_TXH(ieee80211_tx_h_select_key);
CALL_TXH(ieee80211_tx_h_sta);
- if (!(tx->local->hw.flags & IEEE80211_HW_HAS_RATE_CONTROL))
+ if (!(tx->local->hw.flags & IEEE80211_HW_HAS_RATE_CONTROL) &&
+ !(info->flags & IEEE80211_TX_CTL_RC_BYPASS))
CALL_TXH(ieee80211_tx_h_rate_ctrl);
if (unlikely(info->flags & IEEE80211_TX_INTFL_RETRANSMISSION))
diff -ru a/net/wireless/radiotap.c b/net/wireless/radiotap.c
--- a/net/wireless/radiotap.c 2010-08-09 23:26:28.263132773 +0200
+++ b/net/wireless/radiotap.c 2010-08-09 23:12:46.366644666 +0200
@@ -39,6 +39,7 @@
[IEEE80211_RADIOTAP_TX_FLAGS] = { .align = 2, .size = 2, },
[IEEE80211_RADIOTAP_RTS_RETRIES] = { .align = 1, .size = 1, },
[IEEE80211_RADIOTAP_DATA_RETRIES] = { .align = 1, .size = 1, },
+ [IEEE80211_RADIOTAP_RATE_MCS] = { .align = 1, .size = 2, }
/*
* add more here as they are defined in radiotap.h
*/
^ permalink raw reply
* Re: [ipw3945-devel] [PATCH 0/1] fix for 2.6.35
From: Luis R. Rodriguez @ 2010-08-10 16:51 UTC (permalink / raw)
To: Wey-Yi Guy; +Cc: linville, linux-wireless, ipw3945-devel
In-Reply-To: <1281376622-6835-1-git-send-email-wey-yi.w.guy@intel.com>
On Mon, Aug 9, 2010 at 10:57 AM, Wey-Yi Guy <wey-yi.w.guy@intel.com> wrote:
> This patch required for 2.6.35 to fix 5GHz association problem. Without this,
> iwlagn device will have issue connecting to 11a AP
>
> Johannes Berg (1):
> iwlagn: fix rts cts protection
This patch has an awesome commit log entry and describes issues with
the current RTS mechanism and improvements made on the patch for
different scenarios but in no way talks about issues with association
with 5 GHz APs. Can you clarify in the commit log how it cures issues
with 5 GHz, if that is indeed an intended fix for it?
Luis
^ permalink raw reply
* Re: i386 allmodconfig, current mainline
From: Geert Uytterhoeven @ 2010-08-10 16:53 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Andrew Morton, Greg KH, David Woodhouse, Mike Frysinger,
Jesse Barnes, Kevin Curtis, Phillip Lougher, Faisal Latif,
Chien Tung, Dan Williams, Samuel Ortiz, linux-kernel, netdev,
linux-wireless, x86, linux-rdma
In-Reply-To: <20100810101521.0dcd4393.sfr@canb.auug.org.au>
On Tue, Aug 10, 2010 at 02:15, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> On Mon, 9 Aug 2010 16:43:46 -0700 Andrew Morton <akpm@linux-foundation.org> wrote:
>>
>> Guys. What's goin' on out there?
>
> I guess we are all so up to date that noone does 32 bit builds any
> more ... Also noone is bothering to look at the build logs:
>
> linus tree: http://kisskb.ellerman.id.au/kisskb/branch/3/
> linux-next: http://kisskb.ellerman.id.au/kisskb/branch/9/
Yeah, we have build failures migrating from -next to -linus :-(
BTW, still no one has commented on http://lkml.org/lkml/2010/7/13/378?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply
* Re: virtual access poitns (ath5k/mac80211)
From: Luis R. Rodriguez @ 2010-08-10 16:54 UTC (permalink / raw)
To: Ben Greear; +Cc: Ryszard, Florian Fainelli, Patrick McHardy, linux-wireless
In-Reply-To: <4C55F377.6040404@candelatech.com>
On Sun, Aug 1, 2010 at 3:21 PM, Ben Greear <greearb@candelatech.com> wrote:
> On 08/01/2010 01:56 PM, Ryszard wrote:
>>
>> Hey Florian,
>>
>> thanks for the help on this! Ben/Patrick, if you rebase the patches
>> for this functionality, i'm more than happy and willing to do userland
>> testing on this to move it along.
>>
>> regs
>>
>> On 1 August 2010 19:37, Florian Fainelli<florian@openwrt.org> wrote:
>>>
>>> Hi,
>>>
>>> Le Sunday 1 August 2010 03:53:13, Ryszard a écrit :
>>>>
>>>> Hi all,
>>>>
>>>> i'm working on a project that requires i can create multiple access
>>>> points on the one bit of hardware. After an insane amount of googling
>>>> and reading the lists the closest i've been able to come up with is
>>>> something along the lines of:
>>>> iw dev wlan0 interface add vap0 type __ap
>>>> iw dev wlan0 interface add vap1 type __ap
>>>>
>>>> then using macchanger to assign unique mac addresses.
>>>>
>>>> I've also seen something from March 2009
>>>> (http://lwn.net/Articles/321690/) that hints at the functionality
>>>> available with the ath9k which gave me a bit of hope!
>>>>
>>>> My question is, is it possible to create multiple virtual access
>>>> points with my hardware ( Atheros Communications Inc. AR5413 802.11abg
>>>> ) and the ath5k/mac80211 drivers (or is there some other method to
>>>> achieve what i'm after) ? i'm not too fussed about different
>>>> channels, but different SSID's and WPA keys are a requirement for the
>>>> project.
>>>
>>> There is support for creating virtual interfaces using iw and ath5k here:
>>> http://www.candelatech.com/oss/vsta.html
>>>
>>> I really wish someone could submit this mainline, unfortunately it is
>>> pretty
>>> hard to isolate the commits in this tree which are implementing virtual
>>> interfaces support.
>>>
>>> Ben, Patrick, could you rebase your patches on top of wireless-testing
>>> and
>>> send them for review/testing?
>
> You would not believe how hard it is to keep up with the wireless tree.
> Last time,
> by the time we had something stable, upstream had changed too much to merge.
This is why you should not do your development outside of
wireless-testing. If you are doing development on a stable kernel tree
then you will likely run into huge issues. You should do development
on wireless-testing.git, always rebase when John has a new update, and
break your changes out into a small changes as possible. If you follow
these basic rules I believe you will likely have better luck with
keeping your code up to date.
Luis
^ permalink raw reply
* Re: Setting MCS rate on injected packets does not work properly (with patches)
From: Luis R. Rodriguez @ 2010-08-10 16:58 UTC (permalink / raw)
To: Björn Smedman; +Cc: Daniel Haid, linux-wireless
In-Reply-To: <AANLkTinXjYAwJqui41MFzPebUMkvQdO3UsfQcD7se158@mail.gmail.com>
2010/8/9 Björn Smedman <bjorn.smedman@venatech.se>:
> On Sun, Aug 8, 2010 at 9:24 PM, Daniel Haid <d.haid@gogi.tv> wrote:
>> Hello,
>
>> When I use hostapd on one station and enable HT I get
>> rates of about 60MBit/s.
>>
>> But when I inject packets manually and I set the MCS index
>> the MCS index gets reported properly at the other station.
>> However no matter what index I choose, I never get rates
>> higher than 10MBit/s (I wrote a program that reads monitor
>> mode packets with libpcap and sends them to a tun device
>> and everything that comes from the tun device is injected
>> with libpcap - then I measured the rate for UDP packets sent
>> trough this connection).
>
> One reason for this is aggregation: injected packets are not
> aggregated. Depending on your setup that could be the whole
> explanation.
You don't need to use aggregation for all frames, aggregation is just
one technique that you can use for 802.11n, ath9k is an example driver
that chooses to always use aggregation though.
> Also, a single fixed MCS index in the first slot of the tx control
> rates array will not perform as well as e.g. minstrel_ht, especially
> not if your radio environment is noisy.
You might want to look at how the passed rate gets mapped to a
hardware rate on the driver you are using.
Luis
^ permalink raw reply
* Re: [ipw3945-devel] [PATCH 0/1] fix for 2.6.35
From: Guy, Wey-Yi @ 2010-08-10 17:04 UTC (permalink / raw)
To: Luis R. Rodriguez
Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org,
ipw3945-devel@lists.sourceforge.net
In-Reply-To: <AANLkTinJtJGQCgpWCu5t+EF7bEvXR3cQG7oHuagrjd1a@mail.gmail.com>
Hi Luis,
On Tue, 2010-08-10 at 09:51 -0700, Luis R. Rodriguez wrote:
> On Mon, Aug 9, 2010 at 10:57 AM, Wey-Yi Guy <wey-yi.w.guy@intel.com> wrote:
> > This patch required for 2.6.35 to fix 5GHz association problem. Without this,
> > iwlagn device will have issue connecting to 11a AP
> >
> > Johannes Berg (1):
> > iwlagn: fix rts cts protection
>
> This patch has an awesome commit log entry and describes issues with
> the current RTS mechanism and improvements made on the patch for
> different scenarios but in no way talks about issues with association
> with 5 GHz APs. Can you clarify in the commit log how it cures issues
> with 5 GHz, if that is indeed an intended fix for it?
>
Johannes might be able to add more, the original attempt of this patch
is to prevent un-necessary protection for non-data frames which we
introduced few rc ago. while we fix this, but we also found out this
patch also address the issue we have for 5GHz unable to associate to AP.
Thanks
Wey
^ permalink raw reply
* Re: virtual access poitns (ath5k/mac80211)
From: Ben Greear @ 2010-08-10 17:06 UTC (permalink / raw)
To: Luis R. Rodriguez
Cc: Ryszard, Florian Fainelli, Patrick McHardy, linux-wireless
In-Reply-To: <AANLkTinGqWZ8o9L=ePsbgzWtitWAHCt3=g_z6BM7EpjO@mail.gmail.com>
On 08/10/2010 09:54 AM, Luis R. Rodriguez wrote:
> On Sun, Aug 1, 2010 at 3:21 PM, Ben Greear<greearb@candelatech.com> wrote:
>> You would not believe how hard it is to keep up with the wireless tree.
>> Last time,
>> by the time we had something stable, upstream had changed too much to merge.
>
> This is why you should not do your development outside of
> wireless-testing. If you are doing development on a stable kernel tree
> then you will likely run into huge issues. You should do development
> on wireless-testing.git, always rebase when John has a new update, and
> break your changes out into a small changes as possible. If you follow
> these basic rules I believe you will likely have better luck with
> keeping your code up to date.
That sounds nice, but at that time I was carrying a lot of other patches
needed to make my test environment work. Fortunately, .35 pretty much
works out of the box, so I can develop on pristine upstream kernels now.
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply
* [PATCH] ipw2100: avoid warning from pointer cast in call to IPW_DEBUG_TX
From: John W. Linville @ 2010-08-10 17:13 UTC (permalink / raw)
To: linux-wireless; +Cc: Andrew Morton, John W. Linville
In-Reply-To: <20100809164346.6e30cf8c.akpm@linux-foundation.org>
drivers/net/wireless/ipw2x00/ipw2100.c: In function 'ipw2100_tx_send_commands':
drivers/net/wireless/ipw2x00/ipw2100.c:3063: warning: cast to pointer from integer of different size
This changes the cast and the conversion to match other usage of the
same value in calls to IPW_DEBUG_TX.
Reported-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
drivers/net/wireless/ipw2x00/ipw2100.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
index a146240..e4ed479 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
@@ -3064,9 +3064,9 @@ static void ipw2100_tx_send_commands(struct ipw2100_priv *priv)
packet = list_entry(element, struct ipw2100_tx_packet, list);
- IPW_DEBUG_TX("using TBD at virt=%p, phys=%p\n",
+ IPW_DEBUG_TX("using TBD at virt=%p, phys=%04X\n",
&txq->drv[txq->next],
- (void *)(txq->nic + txq->next *
+ (u32) (txq->nic + txq->next *
sizeof(struct ipw2100_bd)));
packet->index = txq->next;
--
1.7.2.1
^ permalink raw reply related
* Re: [ipw3945-devel] [PATCH 0/1] fix for 2.6.35
From: Johannes Berg @ 2010-08-10 17:18 UTC (permalink / raw)
To: Guy, Wey-Yi
Cc: Luis R. Rodriguez, linville@tuxdriver.com,
linux-wireless@vger.kernel.org,
ipw3945-devel@lists.sourceforge.net
In-Reply-To: <1281459872.6027.6.camel@wwguy-ubuntu>
On Tue, 2010-08-10 at 10:04 -0700, Guy, Wey-Yi wrote:
> > This patch has an awesome commit log entry and describes issues with
> > the current RTS mechanism and improvements made on the patch for
> > different scenarios
:-)
> > but in no way talks about issues with association
> > with 5 GHz APs. Can you clarify in the commit log how it cures issues
> > with 5 GHz, if that is indeed an intended fix for it?
> Johannes might be able to add more, the original attempt of this patch
> is to prevent un-necessary protection for non-data frames which we
> introduced few rc ago. while we fix this, but we also found out this
> patch also address the issue we have for 5GHz unable to associate to AP.
Well it does describe what it's intended to fix, we just found out that
a side effect of trying to protect too many frames can be, but maybe
isn't always, that you can't associate on 5 GHz because the protection
mechanism fails on the direct probe probe request frame ...
johannes
^ permalink raw reply
* [PATCH] iwm3200wifi: remove comparison to WIFI_IF_NTFY_MAX in iwm_ntf_wifi_if_wrapper
From: John W. Linville @ 2010-08-10 17:26 UTC (permalink / raw)
To: linux-wireless; +Cc: Andrew Morton, Samuel Ortiz, John W. Linville
In-Reply-To: <20100809164346.6e30cf8c.akpm@linux-foundation.org>
drivers/net/wireless/iwmc3200wifi/rx.c: In function 'iwm_ntf_wifi_if_wrapper':
drivers/net/wireless/iwmc3200wifi/rx.c:1198: warning: comparison is always true due to limited range of data type
This is, of course, because the value of WIFI_IF_NTFY_MAX is 0xff and
hdr->oid is a u8. This is obviously an attempt to verify the range on
an input value, but since it has no effect it can simply be removed.
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
drivers/net/wireless/iwmc3200wifi/rx.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/iwmc3200wifi/rx.c b/drivers/net/wireless/iwmc3200wifi/rx.c
index c02fced..a944893 100644
--- a/drivers/net/wireless/iwmc3200wifi/rx.c
+++ b/drivers/net/wireless/iwmc3200wifi/rx.c
@@ -1195,11 +1195,8 @@ static int iwm_ntf_wifi_if_wrapper(struct iwm_priv *iwm, u8 *buf,
IWM_DBG_NTF(iwm, DBG, "WIFI_IF_WRAPPER cmd is delivered to UMAC: "
"oid is 0x%x\n", hdr->oid);
- if (hdr->oid <= WIFI_IF_NTFY_MAX) {
- set_bit(hdr->oid, &iwm->wifi_ntfy[0]);
- wake_up_interruptible(&iwm->wifi_ntfy_queue);
- } else
- return -EINVAL;
+ set_bit(hdr->oid, &iwm->wifi_ntfy[0]);
+ wake_up_interruptible(&iwm->wifi_ntfy_queue);
switch (hdr->oid) {
case UMAC_WIFI_IF_CMD_SET_PROFILE:
--
1.7.2.1
^ permalink raw reply related
* Re: virtual access poitns (ath5k/mac80211)
From: Luis R. Rodriguez @ 2010-08-10 17:39 UTC (permalink / raw)
To: Ben Greear; +Cc: Ryszard, Florian Fainelli, Patrick McHardy, linux-wireless
In-Reply-To: <4C618713.9030303@candelatech.com>
On Tue, Aug 10, 2010 at 10:06 AM, Ben Greear <greearb@candelatech.com> wrote:
> On 08/10/2010 09:54 AM, Luis R. Rodriguez wrote:
>>
>> On Sun, Aug 1, 2010 at 3:21 PM, Ben Greear<greearb@candelatech.com>
>> wrote:
>
>>> You would not believe how hard it is to keep up with the wireless tree.
>>> Last time,
>>> by the time we had something stable, upstream had changed too much to
>>> merge.
>>
>> This is why you should not do your development outside of
>> wireless-testing. If you are doing development on a stable kernel tree
>> then you will likely run into huge issues. You should do development
>> on wireless-testing.git, always rebase when John has a new update, and
>> break your changes out into a small changes as possible. If you follow
>> these basic rules I believe you will likely have better luck with
>> keeping your code up to date.
>
> That sounds nice, but at that time I was carrying a lot of other patches
> needed to make my test environment work. Fortunately, .35 pretty much
> works out of the box, so I can develop on pristine upstream kernels now.
Do not work on "pristine kernels" work on wireless-testing.git.
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