SVN-Revision: 21756master
parent
97904a9d2f
commit
68779160b0
@ -1,262 +0,0 @@ |
||||
--- a/net/mac80211/debugfs.c
|
||||
+++ b/net/mac80211/debugfs.c
|
||||
@@ -307,9 +307,6 @@ static const struct file_operations queu
|
||||
|
||||
/* statistics stuff */
|
||||
|
||||
-#define DEBUGFS_STATS_FILE(name, buflen, fmt, value...) \
|
||||
- DEBUGFS_READONLY_FILE(stats_ ##name, buflen, fmt, ##value)
|
||||
-
|
||||
static ssize_t format_devstat_counter(struct ieee80211_local *local,
|
||||
char __user *userbuf,
|
||||
size_t count, loff_t *ppos,
|
||||
@@ -351,75 +348,16 @@ static const struct file_operations stat
|
||||
.open = mac80211_open_file_generic, \
|
||||
};
|
||||
|
||||
-#define DEBUGFS_STATS_ADD(name) \
|
||||
+#define DEBUGFS_STATS_ADD(name, field) \
|
||||
+ debugfs_create_u32(#name, 0400, statsd, (u32 *) &field);
|
||||
+#define DEBUGFS_DEVSTATS_ADD(name) \
|
||||
debugfs_create_file(#name, 0400, statsd, local, &stats_ ##name## _ops);
|
||||
|
||||
-DEBUGFS_STATS_FILE(transmitted_fragment_count, 20, "%u",
|
||||
- local->dot11TransmittedFragmentCount);
|
||||
-DEBUGFS_STATS_FILE(multicast_transmitted_frame_count, 20, "%u",
|
||||
- local->dot11MulticastTransmittedFrameCount);
|
||||
-DEBUGFS_STATS_FILE(failed_count, 20, "%u",
|
||||
- local->dot11FailedCount);
|
||||
-DEBUGFS_STATS_FILE(retry_count, 20, "%u",
|
||||
- local->dot11RetryCount);
|
||||
-DEBUGFS_STATS_FILE(multiple_retry_count, 20, "%u",
|
||||
- local->dot11MultipleRetryCount);
|
||||
-DEBUGFS_STATS_FILE(frame_duplicate_count, 20, "%u",
|
||||
- local->dot11FrameDuplicateCount);
|
||||
-DEBUGFS_STATS_FILE(received_fragment_count, 20, "%u",
|
||||
- local->dot11ReceivedFragmentCount);
|
||||
-DEBUGFS_STATS_FILE(multicast_received_frame_count, 20, "%u",
|
||||
- local->dot11MulticastReceivedFrameCount);
|
||||
-DEBUGFS_STATS_FILE(transmitted_frame_count, 20, "%u",
|
||||
- local->dot11TransmittedFrameCount);
|
||||
-#ifdef CONFIG_MAC80211_DEBUG_COUNTERS
|
||||
-DEBUGFS_STATS_FILE(tx_handlers_drop, 20, "%u",
|
||||
- local->tx_handlers_drop);
|
||||
-DEBUGFS_STATS_FILE(tx_handlers_queued, 20, "%u",
|
||||
- local->tx_handlers_queued);
|
||||
-DEBUGFS_STATS_FILE(tx_handlers_drop_unencrypted, 20, "%u",
|
||||
- local->tx_handlers_drop_unencrypted);
|
||||
-DEBUGFS_STATS_FILE(tx_handlers_drop_fragment, 20, "%u",
|
||||
- local->tx_handlers_drop_fragment);
|
||||
-DEBUGFS_STATS_FILE(tx_handlers_drop_wep, 20, "%u",
|
||||
- local->tx_handlers_drop_wep);
|
||||
-DEBUGFS_STATS_FILE(tx_handlers_drop_not_assoc, 20, "%u",
|
||||
- local->tx_handlers_drop_not_assoc);
|
||||
-DEBUGFS_STATS_FILE(tx_handlers_drop_unauth_port, 20, "%u",
|
||||
- local->tx_handlers_drop_unauth_port);
|
||||
-DEBUGFS_STATS_FILE(rx_handlers_drop, 20, "%u",
|
||||
- local->rx_handlers_drop);
|
||||
-DEBUGFS_STATS_FILE(rx_handlers_queued, 20, "%u",
|
||||
- local->rx_handlers_queued);
|
||||
-DEBUGFS_STATS_FILE(rx_handlers_drop_nullfunc, 20, "%u",
|
||||
- local->rx_handlers_drop_nullfunc);
|
||||
-DEBUGFS_STATS_FILE(rx_handlers_drop_defrag, 20, "%u",
|
||||
- local->rx_handlers_drop_defrag);
|
||||
-DEBUGFS_STATS_FILE(rx_handlers_drop_short, 20, "%u",
|
||||
- local->rx_handlers_drop_short);
|
||||
-DEBUGFS_STATS_FILE(rx_handlers_drop_passive_scan, 20, "%u",
|
||||
- local->rx_handlers_drop_passive_scan);
|
||||
-DEBUGFS_STATS_FILE(tx_expand_skb_head, 20, "%u",
|
||||
- local->tx_expand_skb_head);
|
||||
-DEBUGFS_STATS_FILE(tx_expand_skb_head_cloned, 20, "%u",
|
||||
- local->tx_expand_skb_head_cloned);
|
||||
-DEBUGFS_STATS_FILE(rx_expand_skb_head, 20, "%u",
|
||||
- local->rx_expand_skb_head);
|
||||
-DEBUGFS_STATS_FILE(rx_expand_skb_head2, 20, "%u",
|
||||
- local->rx_expand_skb_head2);
|
||||
-DEBUGFS_STATS_FILE(rx_handlers_fragments, 20, "%u",
|
||||
- local->rx_handlers_fragments);
|
||||
-DEBUGFS_STATS_FILE(tx_status_drop, 20, "%u",
|
||||
- local->tx_status_drop);
|
||||
-
|
||||
-#endif
|
||||
-
|
||||
DEBUGFS_DEVSTATS_FILE(dot11ACKFailureCount);
|
||||
DEBUGFS_DEVSTATS_FILE(dot11RTSFailureCount);
|
||||
DEBUGFS_DEVSTATS_FILE(dot11FCSErrorCount);
|
||||
DEBUGFS_DEVSTATS_FILE(dot11RTSSuccessCount);
|
||||
|
||||
-
|
||||
void debugfs_hw_add(struct ieee80211_local *local)
|
||||
{
|
||||
struct dentry *phyd = local->hw.wiphy->debugfsdir;
|
||||
@@ -448,38 +386,60 @@ void debugfs_hw_add(struct ieee80211_loc
|
||||
if (!statsd)
|
||||
return;
|
||||
|
||||
- DEBUGFS_STATS_ADD(transmitted_fragment_count);
|
||||
- DEBUGFS_STATS_ADD(multicast_transmitted_frame_count);
|
||||
- DEBUGFS_STATS_ADD(failed_count);
|
||||
- DEBUGFS_STATS_ADD(retry_count);
|
||||
- DEBUGFS_STATS_ADD(multiple_retry_count);
|
||||
- DEBUGFS_STATS_ADD(frame_duplicate_count);
|
||||
- DEBUGFS_STATS_ADD(received_fragment_count);
|
||||
- DEBUGFS_STATS_ADD(multicast_received_frame_count);
|
||||
- DEBUGFS_STATS_ADD(transmitted_frame_count);
|
||||
+ DEBUGFS_STATS_ADD(transmitted_fragment_count,
|
||||
+ local->dot11TransmittedFragmentCount);
|
||||
+ DEBUGFS_STATS_ADD(multicast_transmitted_frame_count,
|
||||
+ local->dot11MulticastTransmittedFrameCount);
|
||||
+ DEBUGFS_STATS_ADD(failed_count, local->dot11FailedCount);
|
||||
+ DEBUGFS_STATS_ADD(retry_count, local->dot11RetryCount);
|
||||
+ DEBUGFS_STATS_ADD(multiple_retry_count,
|
||||
+ local->dot11MultipleRetryCount);
|
||||
+ DEBUGFS_STATS_ADD(frame_duplicate_count,
|
||||
+ local->dot11FrameDuplicateCount);
|
||||
+ DEBUGFS_STATS_ADD(received_fragment_count,
|
||||
+ local->dot11ReceivedFragmentCount);
|
||||
+ DEBUGFS_STATS_ADD(multicast_received_frame_count,
|
||||
+ local->dot11MulticastReceivedFrameCount);
|
||||
+ DEBUGFS_STATS_ADD(transmitted_frame_count,
|
||||
+ local->dot11TransmittedFrameCount);
|
||||
#ifdef CONFIG_MAC80211_DEBUG_COUNTERS
|
||||
- DEBUGFS_STATS_ADD(tx_handlers_drop);
|
||||
- DEBUGFS_STATS_ADD(tx_handlers_queued);
|
||||
- DEBUGFS_STATS_ADD(tx_handlers_drop_unencrypted);
|
||||
- DEBUGFS_STATS_ADD(tx_handlers_drop_fragment);
|
||||
- DEBUGFS_STATS_ADD(tx_handlers_drop_wep);
|
||||
- DEBUGFS_STATS_ADD(tx_handlers_drop_not_assoc);
|
||||
- DEBUGFS_STATS_ADD(tx_handlers_drop_unauth_port);
|
||||
- DEBUGFS_STATS_ADD(rx_handlers_drop);
|
||||
- DEBUGFS_STATS_ADD(rx_handlers_queued);
|
||||
- DEBUGFS_STATS_ADD(rx_handlers_drop_nullfunc);
|
||||
- DEBUGFS_STATS_ADD(rx_handlers_drop_defrag);
|
||||
- DEBUGFS_STATS_ADD(rx_handlers_drop_short);
|
||||
- DEBUGFS_STATS_ADD(rx_handlers_drop_passive_scan);
|
||||
- DEBUGFS_STATS_ADD(tx_expand_skb_head);
|
||||
- DEBUGFS_STATS_ADD(tx_expand_skb_head_cloned);
|
||||
- DEBUGFS_STATS_ADD(rx_expand_skb_head);
|
||||
- DEBUGFS_STATS_ADD(rx_expand_skb_head2);
|
||||
- DEBUGFS_STATS_ADD(rx_handlers_fragments);
|
||||
- DEBUGFS_STATS_ADD(tx_status_drop);
|
||||
+ DEBUGFS_STATS_ADD(tx_handlers_drop, local->tx_handlers_drop);
|
||||
+ DEBUGFS_STATS_ADD(tx_handlers_queued, local->tx_handlers_queued);
|
||||
+ DEBUGFS_STATS_ADD(tx_handlers_drop_unencrypted,
|
||||
+ local->tx_handlers_drop_unencrypted);
|
||||
+ DEBUGFS_STATS_ADD(tx_handlers_drop_fragment,
|
||||
+ local->tx_handlers_drop_fragment);
|
||||
+ DEBUGFS_STATS_ADD(tx_handlers_drop_wep,
|
||||
+ local->tx_handlers_drop_wep);
|
||||
+ DEBUGFS_STATS_ADD(tx_handlers_drop_not_assoc,
|
||||
+ local->tx_handlers_drop_not_assoc);
|
||||
+ DEBUGFS_STATS_ADD(tx_handlers_drop_unauth_port,
|
||||
+ local->tx_handlers_drop_unauth_port);
|
||||
+ DEBUGFS_STATS_ADD(rx_handlers_drop, local->rx_handlers_drop);
|
||||
+ DEBUGFS_STATS_ADD(rx_handlers_queued, local->rx_handlers_queued);
|
||||
+ DEBUGFS_STATS_ADD(rx_handlers_drop_nullfunc,
|
||||
+ local->rx_handlers_drop_nullfunc);
|
||||
+ DEBUGFS_STATS_ADD(rx_handlers_drop_defrag,
|
||||
+ local->rx_handlers_drop_defrag);
|
||||
+ DEBUGFS_STATS_ADD(rx_handlers_drop_short,
|
||||
+ local->rx_handlers_drop_short);
|
||||
+ DEBUGFS_STATS_ADD(rx_handlers_drop_passive_scan,
|
||||
+ local->rx_handlers_drop_passive_scan);
|
||||
+ DEBUGFS_STATS_ADD(tx_expand_skb_head,
|
||||
+ local->tx_expand_skb_head);
|
||||
+ DEBUGFS_STATS_ADD(tx_expand_skb_head_cloned,
|
||||
+ local->tx_expand_skb_head_cloned);
|
||||
+ DEBUGFS_STATS_ADD(rx_expand_skb_head,
|
||||
+ local->rx_expand_skb_head);
|
||||
+ DEBUGFS_STATS_ADD(rx_expand_skb_head2,
|
||||
+ local->rx_expand_skb_head2);
|
||||
+ DEBUGFS_STATS_ADD(rx_handlers_fragments,
|
||||
+ local->rx_handlers_fragments);
|
||||
+ DEBUGFS_STATS_ADD(tx_status_drop,
|
||||
+ local->tx_status_drop);
|
||||
#endif
|
||||
- DEBUGFS_STATS_ADD(dot11ACKFailureCount);
|
||||
- DEBUGFS_STATS_ADD(dot11RTSFailureCount);
|
||||
- DEBUGFS_STATS_ADD(dot11FCSErrorCount);
|
||||
- DEBUGFS_STATS_ADD(dot11RTSSuccessCount);
|
||||
+ DEBUGFS_DEVSTATS_ADD(dot11ACKFailureCount);
|
||||
+ DEBUGFS_DEVSTATS_ADD(dot11RTSFailureCount);
|
||||
+ DEBUGFS_DEVSTATS_ADD(dot11FCSErrorCount);
|
||||
+ DEBUGFS_DEVSTATS_ADD(dot11RTSSuccessCount);
|
||||
}
|
||||
--- a/net/mac80211/debugfs_sta.c
|
||||
+++ b/net/mac80211/debugfs_sta.c
|
||||
@@ -30,7 +30,6 @@ static ssize_t sta_ ##name## _read(struc
|
||||
}
|
||||
#define STA_READ_D(name, field) STA_READ(name, 20, field, "%d\n")
|
||||
#define STA_READ_U(name, field) STA_READ(name, 20, field, "%u\n")
|
||||
-#define STA_READ_LU(name, field) STA_READ(name, 20, field, "%lu\n")
|
||||
#define STA_READ_S(name, field) STA_READ(name, 20, field, "%s\n")
|
||||
|
||||
#define STA_OPS(name) \
|
||||
@@ -52,19 +51,7 @@ static const struct file_operations sta_
|
||||
|
||||
STA_FILE(aid, sta.aid, D);
|
||||
STA_FILE(dev, sdata->name, S);
|
||||
-STA_FILE(rx_packets, rx_packets, LU);
|
||||
-STA_FILE(tx_packets, tx_packets, LU);
|
||||
-STA_FILE(rx_bytes, rx_bytes, LU);
|
||||
-STA_FILE(tx_bytes, tx_bytes, LU);
|
||||
-STA_FILE(rx_duplicates, num_duplicates, LU);
|
||||
-STA_FILE(rx_fragments, rx_fragments, LU);
|
||||
-STA_FILE(rx_dropped, rx_dropped, LU);
|
||||
-STA_FILE(tx_fragments, tx_fragments, LU);
|
||||
-STA_FILE(tx_filtered, tx_filtered_count, LU);
|
||||
-STA_FILE(tx_retry_failed, tx_retry_failed, LU);
|
||||
-STA_FILE(tx_retry_count, tx_retry_count, LU);
|
||||
STA_FILE(last_signal, last_signal, D);
|
||||
-STA_FILE(wep_weak_iv_count, wep_weak_iv_count, LU);
|
||||
|
||||
static ssize_t sta_flags_read(struct file *file, char __user *userbuf,
|
||||
size_t count, loff_t *ppos)
|
||||
@@ -307,6 +294,13 @@ STA_OPS(ht_capa);
|
||||
debugfs_create_file(#name, 0400, \
|
||||
sta->debugfs.dir, sta, &sta_ ##name## _ops);
|
||||
|
||||
+#define DEBUGFS_ADD_COUNTER(name, field) \
|
||||
+ if (sizeof(sta->field) == sizeof(u32)) \
|
||||
+ debugfs_create_u32(#name, 0400, sta->debugfs.dir, \
|
||||
+ (u32 *) &sta->field); \
|
||||
+ else \
|
||||
+ debugfs_create_u64(#name, 0400, sta->debugfs.dir, \
|
||||
+ (u64 *) &sta->field);
|
||||
|
||||
void ieee80211_sta_debugfs_add(struct sta_info *sta)
|
||||
{
|
||||
@@ -339,20 +333,21 @@ void ieee80211_sta_debugfs_add(struct st
|
||||
DEBUGFS_ADD(last_seq_ctrl);
|
||||
DEBUGFS_ADD(agg_status);
|
||||
DEBUGFS_ADD(dev);
|
||||
- DEBUGFS_ADD(rx_packets);
|
||||
- DEBUGFS_ADD(tx_packets);
|
||||
- DEBUGFS_ADD(rx_bytes);
|
||||
- DEBUGFS_ADD(tx_bytes);
|
||||
- DEBUGFS_ADD(rx_duplicates);
|
||||
- DEBUGFS_ADD(rx_fragments);
|
||||
- DEBUGFS_ADD(rx_dropped);
|
||||
- DEBUGFS_ADD(tx_fragments);
|
||||
- DEBUGFS_ADD(tx_filtered);
|
||||
- DEBUGFS_ADD(tx_retry_failed);
|
||||
- DEBUGFS_ADD(tx_retry_count);
|
||||
DEBUGFS_ADD(last_signal);
|
||||
- DEBUGFS_ADD(wep_weak_iv_count);
|
||||
DEBUGFS_ADD(ht_capa);
|
||||
+
|
||||
+ DEBUGFS_ADD_COUNTER(rx_packets, rx_packets);
|
||||
+ DEBUGFS_ADD_COUNTER(tx_packets, tx_packets);
|
||||
+ DEBUGFS_ADD_COUNTER(rx_bytes, rx_bytes);
|
||||
+ DEBUGFS_ADD_COUNTER(tx_bytes, tx_bytes);
|
||||
+ DEBUGFS_ADD_COUNTER(rx_duplicates, num_duplicates);
|
||||
+ DEBUGFS_ADD_COUNTER(rx_fragments, rx_fragments);
|
||||
+ DEBUGFS_ADD_COUNTER(rx_dropped, rx_dropped);
|
||||
+ DEBUGFS_ADD_COUNTER(tx_fragments, tx_fragments);
|
||||
+ DEBUGFS_ADD_COUNTER(tx_filtered, tx_filtered_count);
|
||||
+ DEBUGFS_ADD_COUNTER(tx_retry_failed, tx_retry_failed);
|
||||
+ DEBUGFS_ADD_COUNTER(tx_retry_count, tx_retry_count);
|
||||
+ DEBUGFS_ADD_COUNTER(wep_weak_iv_count, wep_weak_iv_count);
|
||||
}
|
||||
|
||||
void ieee80211_sta_debugfs_remove(struct sta_info *sta)
|
@ -1,6 +1,6 @@ |
||||
--- a/drivers/net/wireless/ath/ath9k/init.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/init.c
|
||||
@@ -689,7 +689,11 @@ void ath9k_set_hw_capab(struct ath_softc
|
||||
@@ -677,7 +677,11 @@ void ath9k_set_hw_capab(struct ath_softc
|
||||
hw->sta_data_size = sizeof(struct ath_node);
|
||||
hw->vif_data_size = sizeof(struct ath_vif);
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,36 +0,0 @@ |
||||
--- a/drivers/net/wireless/ath/ath9k/hw.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/hw.c
|
||||
@@ -1497,6 +1497,7 @@ EXPORT_SYMBOL(ath9k_hw_keyreset);
|
||||
bool ath9k_hw_keysetmac(struct ath_hw *ah, u16 entry, const u8 *mac)
|
||||
{
|
||||
u32 macHi, macLo;
|
||||
+ u32 unicast_flag = AR_KEYTABLE_VALID;
|
||||
|
||||
if (entry >= ah->caps.keycache_size) {
|
||||
ath_print(ath9k_hw_common(ah), ATH_DBG_FATAL,
|
||||
@@ -1505,6 +1506,16 @@ bool ath9k_hw_keysetmac(struct ath_hw *a
|
||||
}
|
||||
|
||||
if (mac != NULL) {
|
||||
+ /*
|
||||
+ * AR_KEYTABLE_VALID indicates that the address is a unicast
|
||||
+ * address, which must match the transmitter address for
|
||||
+ * decrypting frames.
|
||||
+ * Not setting this bit allows the hardware to use the key
|
||||
+ * for multicast frame decryption.
|
||||
+ */
|
||||
+ if (mac[0] & 0x01)
|
||||
+ unicast_flag = 0;
|
||||
+
|
||||
macHi = (mac[5] << 8) | mac[4];
|
||||
macLo = (mac[3] << 24) |
|
||||
(mac[2] << 16) |
|
||||
@@ -1517,7 +1528,7 @@ bool ath9k_hw_keysetmac(struct ath_hw *a
|
||||
macLo = macHi = 0;
|
||||
}
|
||||
REG_WRITE(ah, AR_KEYTABLE_MAC0(entry), macLo);
|
||||
- REG_WRITE(ah, AR_KEYTABLE_MAC1(entry), macHi | AR_KEYTABLE_VALID);
|
||||
+ REG_WRITE(ah, AR_KEYTABLE_MAC1(entry), macHi | unicast_flag);
|
||||
|
||||
return true;
|
||||
}
|
@ -0,0 +1,10 @@ |
||||
--- a/drivers/net/wireless/ath/ath9k/pci.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/pci.c
|
||||
@@ -29,6 +29,7 @@ static DEFINE_PCI_DEVICE_TABLE(ath_pci_i
|
||||
{ PCI_VDEVICE(ATHEROS, 0x002C) }, /* PCI-E 802.11n bonded out */
|
||||
{ PCI_VDEVICE(ATHEROS, 0x002D) }, /* PCI */
|
||||
{ PCI_VDEVICE(ATHEROS, 0x002E) }, /* PCI-E */
|
||||
+ { PCI_VDEVICE(ATHEROS, 0x0030) }, /* PCI-E AR9300 */
|
||||
{ 0 }
|
||||
};
|
||||
|
@ -1,72 +0,0 @@ |
||||
--- a/drivers/net/wireless/ath/ath9k/common.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/common.c
|
||||
@@ -211,10 +211,14 @@ static int ath_reserve_key_cache_slot_tk
|
||||
return -1;
|
||||
}
|
||||
|
||||
-static int ath_reserve_key_cache_slot(struct ath_common *common)
|
||||
+static int ath_reserve_key_cache_slot(struct ath_common *common,
|
||||
+ enum ieee80211_key_alg alg)
|
||||
{
|
||||
int i;
|
||||
|
||||
+ if (alg == ALG_TKIP)
|
||||
+ return ath_reserve_key_cache_slot_tkip(common);
|
||||
+
|
||||
/* First, try to find slots that would not be available for TKIP. */
|
||||
if (common->splitmic) {
|
||||
for (i = IEEE80211_WEP_NKID; i < common->keymax / 4; i++) {
|
||||
@@ -283,6 +287,7 @@ int ath9k_cmn_key_config(struct ath_comm
|
||||
struct ath_hw *ah = common->ah;
|
||||
struct ath9k_keyval hk;
|
||||
const u8 *mac = NULL;
|
||||
+ u8 gmac[ETH_ALEN];
|
||||
int ret = 0;
|
||||
int idx;
|
||||
|
||||
@@ -306,9 +311,23 @@ int ath9k_cmn_key_config(struct ath_comm
|
||||
memcpy(hk.kv_val, key->key, key->keylen);
|
||||
|
||||
if (!(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) {
|
||||
- /* For now, use the default keys for broadcast keys. This may
|
||||
- * need to change with virtual interfaces. */
|
||||
- idx = key->keyidx;
|
||||
+ switch (vif->type) {
|
||||
+ case NL80211_IFTYPE_AP:
|
||||
+ memcpy(gmac, vif->addr, ETH_ALEN);
|
||||
+ gmac[0] |= 0x01;
|
||||
+ mac = gmac;
|
||||
+ idx = ath_reserve_key_cache_slot(common, key->alg);
|
||||
+ break;
|
||||
+ case NL80211_IFTYPE_ADHOC:
|
||||
+ memcpy(gmac, sta->addr, ETH_ALEN);
|
||||
+ gmac[0] |= 0x01;
|
||||
+ mac = gmac;
|
||||
+ idx = ath_reserve_key_cache_slot(common, key->alg);
|
||||
+ break;
|
||||
+ default:
|
||||
+ idx = key->keyidx;
|
||||
+ break;
|
||||
+ }
|
||||
} else if (key->keyidx) {
|
||||
if (WARN_ON(!sta))
|
||||
return -EOPNOTSUPP;
|
||||
@@ -325,14 +344,12 @@ int ath9k_cmn_key_config(struct ath_comm
|
||||
return -EOPNOTSUPP;
|
||||
mac = sta->addr;
|
||||
|
||||
- if (key->alg == ALG_TKIP)
|
||||
- idx = ath_reserve_key_cache_slot_tkip(common);
|
||||
- else
|
||||
- idx = ath_reserve_key_cache_slot(common);
|
||||
- if (idx < 0)
|
||||
- return -ENOSPC; /* no free key cache entries */
|
||||
+ idx = ath_reserve_key_cache_slot(common, key->alg);
|
||||
}
|
||||
|
||||
+ if (idx < 0)
|
||||
+ return -ENOSPC; /* no free key cache entries */
|
||||
+
|
||||
if (key->alg == ALG_TKIP)
|
||||
ret = ath_setkey_tkip(common, idx, key->key, &hk, mac,
|
||||
vif->type == NL80211_IFTYPE_AP);
|
@ -1,255 +0,0 @@ |
||||
--- a/drivers/net/wireless/ath/ath9k/main.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/main.c
|
||||
@@ -622,234 +622,6 @@ static u32 ath_get_extchanmode(struct at
|
||||
return chanmode;
|
||||
}
|
||||
|
||||
-static int ath_setkey_tkip(struct ath_common *common, u16 keyix, const u8 *key,
|
||||
- struct ath9k_keyval *hk, const u8 *addr,
|
||||
- bool authenticator)
|
||||
-{
|
||||
- struct ath_hw *ah = common->ah;
|
||||
- const u8 *key_rxmic;
|
||||
- const u8 *key_txmic;
|
||||
-
|
||||
- key_txmic = key + NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY;
|
||||
- key_rxmic = key + NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY;
|
||||
-
|
||||
- if (addr == NULL) {
|
||||
- /*
|
||||
- * Group key installation - only two key cache entries are used
|
||||
- * regardless of splitmic capability since group key is only
|
||||
- * used either for TX or RX.
|
||||
- */
|
||||
- if (authenticator) {
|
||||
- memcpy(hk->kv_mic, key_txmic, sizeof(hk->kv_mic));
|
||||
- memcpy(hk->kv_txmic, key_txmic, sizeof(hk->kv_mic));
|
||||
- } else {
|
||||
- memcpy(hk->kv_mic, key_rxmic, sizeof(hk->kv_mic));
|
||||
- memcpy(hk->kv_txmic, key_rxmic, sizeof(hk->kv_mic));
|
||||
- }
|
||||
- return ath9k_hw_set_keycache_entry(ah, keyix, hk, addr);
|
||||
- }
|
||||
- if (!common->splitmic) {
|
||||
- /* TX and RX keys share the same key cache entry. */
|
||||
- memcpy(hk->kv_mic, key_rxmic, sizeof(hk->kv_mic));
|
||||
- memcpy(hk->kv_txmic, key_txmic, sizeof(hk->kv_txmic));
|
||||
- return ath9k_hw_set_keycache_entry(ah, keyix, hk, addr);
|
||||
- }
|
||||
-
|
||||
- /* Separate key cache entries for TX and RX */
|
||||
-
|
||||
- /* TX key goes at first index, RX key at +32. */
|
||||
- memcpy(hk->kv_mic, key_txmic, sizeof(hk->kv_mic));
|
||||
- if (!ath9k_hw_set_keycache_entry(ah, keyix, hk, NULL)) {
|
||||
- /* TX MIC entry failed. No need to proceed further */
|
||||
- ath_print(common, ATH_DBG_FATAL,
|
||||
- "Setting TX MIC Key Failed\n");
|
||||
- return 0;
|
||||
- }
|
||||
-
|
||||
- memcpy(hk->kv_mic, key_rxmic, sizeof(hk->kv_mic));
|
||||
- /* XXX delete tx key on failure? */
|
||||
- return ath9k_hw_set_keycache_entry(ah, keyix + 32, hk, addr);
|
||||
-}
|
||||
-
|
||||
-static int ath_reserve_key_cache_slot_tkip(struct ath_common *common)
|
||||
-{
|
||||
- int i;
|
||||
-
|
||||
- for (i = IEEE80211_WEP_NKID; i < common->keymax / 2; i++) {
|
||||
- if (test_bit(i, common->keymap) ||
|
||||
- test_bit(i + 64, common->keymap))
|
||||
- continue; /* At least one part of TKIP key allocated */
|
||||
- if (common->splitmic &&
|
||||
- (test_bit(i + 32, common->keymap) ||
|
||||
- test_bit(i + 64 + 32, common->keymap)))
|
||||
- continue; /* At least one part of TKIP key allocated */
|
||||
-
|
||||
- /* Found a free slot for a TKIP key */
|
||||
- return i;
|
||||
- }
|
||||
- return -1;
|
||||
-}
|
||||
-
|
||||
-static int ath_reserve_key_cache_slot(struct ath_common *common)
|
||||
-{
|
||||
- int i;
|
||||
-
|
||||
- /* First, try to find slots that would not be available for TKIP. */
|
||||
- if (common->splitmic) {
|
||||
- for (i = IEEE80211_WEP_NKID; i < common->keymax / 4; i++) {
|
||||
- if (!test_bit(i, common->keymap) &&
|
||||
- (test_bit(i + 32, common->keymap) ||
|
||||
- test_bit(i + 64, common->keymap) ||
|
||||
- test_bit(i + 64 + 32, common->keymap)))
|
||||
- return i;
|
||||
- if (!test_bit(i + 32, common->keymap) &&
|
||||
- (test_bit(i, common->keymap) ||
|
||||
- test_bit(i + 64, common->keymap) ||
|
||||
- test_bit(i + 64 + 32, common->keymap)))
|
||||
- return i + 32;
|
||||
- if (!test_bit(i + 64, common->keymap) &&
|
||||
- (test_bit(i , common->keymap) ||
|
||||
- test_bit(i + 32, common->keymap) ||
|
||||
- test_bit(i + 64 + 32, common->keymap)))
|
||||
- return i + 64;
|
||||
- if (!test_bit(i + 64 + 32, common->keymap) &&
|
||||
- (test_bit(i, common->keymap) ||
|
||||
- test_bit(i + 32, common->keymap) ||
|
||||
- test_bit(i + 64, common->keymap)))
|
||||
- return i + 64 + 32;
|
||||
- }
|
||||
- } else {
|
||||
- for (i = IEEE80211_WEP_NKID; i < common->keymax / 2; i++) {
|
||||
- if (!test_bit(i, common->keymap) &&
|
||||
- test_bit(i + 64, common->keymap))
|
||||
- return i;
|
||||
- if (test_bit(i, common->keymap) &&
|
||||
- !test_bit(i + 64, common->keymap))
|
||||
- return i + 64;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- /* No partially used TKIP slots, pick any available slot */
|
||||
- for (i = IEEE80211_WEP_NKID; i < common->keymax; i++) {
|
||||
- /* Do not allow slots that could be needed for TKIP group keys
|
||||
- * to be used. This limitation could be removed if we know that
|
||||
- * TKIP will not be used. */
|
||||
- if (i >= 64 && i < 64 + IEEE80211_WEP_NKID)
|
||||
- continue;
|
||||
- if (common->splitmic) {
|
||||
- if (i >= 32 && i < 32 + IEEE80211_WEP_NKID)
|
||||
- continue;
|
||||
- if (i >= 64 + 32 && i < 64 + 32 + IEEE80211_WEP_NKID)
|
||||
- continue;
|
||||
- }
|
||||
-
|
||||
- if (!test_bit(i, common->keymap))
|
||||
- return i; /* Found a free slot for a key */
|
||||
- }
|
||||
-
|
||||
- /* No free slot found */
|
||||
- return -1;
|
||||
-}
|
||||
-
|
||||
-static int ath_key_config(struct ath_common *common,
|
||||
- struct ieee80211_vif *vif,
|
||||
- struct ieee80211_sta *sta,
|
||||
- struct ieee80211_key_conf *key)
|
||||
-{
|
||||
- struct ath_hw *ah = common->ah;
|
||||
- struct ath9k_keyval hk;
|
||||
- const u8 *mac = NULL;
|
||||
- int ret = 0;
|
||||
- int idx;
|
||||
-
|
||||
- memset(&hk, 0, sizeof(hk));
|
||||
-
|
||||
- switch (key->alg) {
|
||||
- case ALG_WEP:
|
||||
- hk.kv_type = ATH9K_CIPHER_WEP;
|
||||
- break;
|
||||
- case ALG_TKIP:
|
||||
- hk.kv_type = ATH9K_CIPHER_TKIP;
|
||||
- break;
|
||||
- case ALG_CCMP:
|
||||
- hk.kv_type = ATH9K_CIPHER_AES_CCM;
|
||||
- break;
|
||||
- default:
|
||||
- return -EOPNOTSUPP;
|
||||
- }
|
||||
-
|
||||
- hk.kv_len = key->keylen;
|
||||
- memcpy(hk.kv_val, key->key, key->keylen);
|
||||
-
|
||||
- if (!(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) {
|
||||
- /* For now, use the default keys for broadcast keys. This may
|
||||
- * need to change with virtual interfaces. */
|
||||
- idx = key->keyidx;
|
||||
- } else if (key->keyidx) {
|
||||
- if (WARN_ON(!sta))
|
||||
- return -EOPNOTSUPP;
|
||||
- mac = sta->addr;
|
||||
-
|
||||
- if (vif->type != NL80211_IFTYPE_AP) {
|
||||
- /* Only keyidx 0 should be used with unicast key, but
|
||||
- * allow this for client mode for now. */
|
||||
- idx = key->keyidx;
|
||||
- } else
|
||||
- return -EIO;
|
||||
- } else {
|
||||
- if (WARN_ON(!sta))
|
||||
- return -EOPNOTSUPP;
|
||||
- mac = sta->addr;
|
||||
-
|
||||
- if (key->alg == ALG_TKIP)
|
||||
- idx = ath_reserve_key_cache_slot_tkip(common);
|
||||
- else
|
||||
- idx = ath_reserve_key_cache_slot(common);
|
||||
- if (idx < 0)
|
||||
- return -ENOSPC; /* no free key cache entries */
|
||||
- }
|
||||
-
|
||||
- if (key->alg == ALG_TKIP)
|
||||
- ret = ath_setkey_tkip(common, idx, key->key, &hk, mac,
|
||||
- vif->type == NL80211_IFTYPE_AP);
|
||||
- else
|
||||
- ret = ath9k_hw_set_keycache_entry(ah, idx, &hk, mac);
|
||||
-
|
||||
- if (!ret)
|
||||
- return -EIO;
|
||||
-
|
||||
- set_bit(idx, common->keymap);
|
||||
- if (key->alg == ALG_TKIP) {
|
||||
- set_bit(idx + 64, common->keymap);
|
||||
- if (common->splitmic) {
|
||||
- set_bit(idx + 32, common->keymap);
|
||||
- set_bit(idx + 64 + 32, common->keymap);
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- return idx;
|
||||
-}
|
||||
-
|
||||
-static void ath_key_delete(struct ath_common *common, struct ieee80211_key_conf *key)
|
||||
-{
|
||||
- struct ath_hw *ah = common->ah;
|
||||
-
|
||||
- ath9k_hw_keyreset(ah, key->hw_key_idx);
|
||||
- if (key->hw_key_idx < IEEE80211_WEP_NKID)
|
||||
- return;
|
||||
-
|
||||
- clear_bit(key->hw_key_idx, common->keymap);
|
||||
- if (key->alg != ALG_TKIP)
|
||||
- return;
|
||||
-
|
||||
- clear_bit(key->hw_key_idx + 64, common->keymap);
|
||||
- if (common->splitmic) {
|
||||
- ath9k_hw_keyreset(ah, key->hw_key_idx + 32);
|
||||
- clear_bit(key->hw_key_idx + 32, common->keymap);
|
||||
- clear_bit(key->hw_key_idx + 64 + 32, common->keymap);
|
||||
- }
|
||||
-}
|
||||
-
|
||||
static void ath9k_bss_assoc_info(struct ath_softc *sc,
|
||||
struct ieee80211_vif *vif,
|
||||
struct ieee80211_bss_conf *bss_conf)
|
||||
@@ -1814,7 +1586,7 @@ static int ath9k_set_key(struct ieee8021
|
||||
|
||||
switch (cmd) {
|
||||
case SET_KEY:
|
||||
- ret = ath_key_config(common, vif, sta, key);
|
||||
+ ret = ath9k_cmn_key_config(common, vif, sta, key);
|
||||
if (ret >= 0) {
|
||||
key->hw_key_idx = ret;
|
||||
/* push IV and Michael MIC generation to stack */
|
||||
@@ -1827,7 +1599,7 @@ static int ath9k_set_key(struct ieee8021
|
||||
}
|
||||
break;
|
||||
case DISABLE_KEY:
|
||||
- ath_key_delete(common, key);
|
||||
+ ath9k_cmn_key_delete(common, key);
|
||||
break;
|
||||
default:
|
||||
ret = -EINVAL;
|
@ -1,154 +0,0 @@ |
||||
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
|
||||
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
|
||||
@@ -137,6 +137,8 @@ void ath_descdma_cleanup(struct ath_soft
|
||||
#define ATH_MAX_ANTENNA 3
|
||||
#define ATH_RXBUF 512
|
||||
#define ATH_TXBUF 512
|
||||
+#define ATH_TXBUF_RESERVE 5
|
||||
+#define ATH_MAX_QDEPTH (ATH_TXBUF / 4 - ATH_TXBUF_RESERVE)
|
||||
#define ATH_TXMAXTRY 13
|
||||
#define ATH_MGT_TXMAXTRY 4
|
||||
|
||||
@@ -205,6 +207,7 @@ struct ath_txq {
|
||||
struct list_head txq_fifo_pending;
|
||||
u8 txq_headidx;
|
||||
u8 txq_tailidx;
|
||||
+ int pending_frames;
|
||||
};
|
||||
|
||||
struct ath_atx_ac {
|
||||
@@ -242,6 +245,7 @@ struct ath_buf {
|
||||
struct ath_buf_state bf_state;
|
||||
dma_addr_t bf_dmacontext;
|
||||
struct ath_wiphy *aphy;
|
||||
+ struct ath_txq *txq;
|
||||
};
|
||||
|
||||
struct ath_atx_tid {
|
||||
@@ -331,7 +335,6 @@ void ath_tx_node_cleanup(struct ath_soft
|
||||
void ath_txq_schedule(struct ath_softc *sc, struct ath_txq *txq);
|
||||
int ath_tx_init(struct ath_softc *sc, int nbufs);
|
||||
void ath_tx_cleanup(struct ath_softc *sc);
|
||||
-struct ath_txq *ath_test_get_txq(struct ath_softc *sc, struct sk_buff *skb);
|
||||
int ath_txq_update(struct ath_softc *sc, int qnum,
|
||||
struct ath9k_tx_queue_info *q);
|
||||
int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb,
|
||||
--- a/drivers/net/wireless/ath/ath9k/xmit.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
|
||||
@@ -986,32 +986,6 @@ int ath_tx_get_qnum(struct ath_softc *sc
|
||||
return qnum;
|
||||
}
|
||||
|
||||
-struct ath_txq *ath_test_get_txq(struct ath_softc *sc, struct sk_buff *skb)
|
||||
-{
|
||||
- struct ath_txq *txq = NULL;
|
||||
- u16 skb_queue = skb_get_queue_mapping(skb);
|
||||
- int qnum;
|
||||
-
|
||||
- qnum = ath_get_hal_qnum(skb_queue, sc);
|
||||
- txq = &sc->tx.txq[qnum];
|
||||
-
|
||||
- spin_lock_bh(&txq->axq_lock);
|
||||
-
|
||||
- if (txq->axq_depth >= (ATH_TXBUF - 20)) {
|
||||
- ath_print(ath9k_hw_common(sc->sc_ah), ATH_DBG_XMIT,
|
||||
- "TX queue: %d is full, depth: %d\n",
|
||||
- qnum, txq->axq_depth);
|
||||
- ath_mac80211_stop_queue(sc, skb_queue);
|
||||
- txq->stopped = 1;
|
||||
- spin_unlock_bh(&txq->axq_lock);
|
||||
- return NULL;
|
||||
- }
|
||||
-
|
||||
- spin_unlock_bh(&txq->axq_lock);
|
||||
-
|
||||
- return txq;
|
||||
-}
|
||||
-
|
||||
int ath_txq_update(struct ath_softc *sc, int qnum,
|
||||
struct ath9k_tx_queue_info *qinfo)
|
||||
{
|
||||
@@ -1811,6 +1785,7 @@ int ath_tx_start(struct ieee80211_hw *hw
|
||||
struct ath_wiphy *aphy = hw->priv;
|
||||
struct ath_softc *sc = aphy->sc;
|
||||
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
|
||||
+ struct ath_txq *txq = txctl->txq;
|
||||
struct ath_buf *bf;
|
||||
int r;
|
||||
|
||||
@@ -1820,10 +1795,16 @@ int ath_tx_start(struct ieee80211_hw *hw
|
||||
return -1;
|
||||
}
|
||||
|
||||
+ bf->txq = txctl->txq;
|
||||
+ spin_lock_bh(&bf->txq->axq_lock);
|
||||
+ if (++bf->txq->pending_frames > ATH_MAX_QDEPTH && !txq->stopped) {
|
||||
+ ath_mac80211_stop_queue(sc, skb_get_queue_mapping(skb));
|
||||
+ txq->stopped = 1;
|
||||
+ }
|
||||
+ spin_unlock_bh(&bf->txq->axq_lock);
|
||||
+
|
||||
r = ath_tx_setup_buffer(hw, bf, skb, txctl);
|
||||
if (unlikely(r)) {
|
||||
- struct ath_txq *txq = txctl->txq;
|
||||
-
|
||||
ath_print(common, ATH_DBG_FATAL, "TX mem alloc failure\n");
|
||||
|
||||
/* upon ath_tx_processq() this TX queue will be resumed, we
|
||||
@@ -1831,7 +1812,7 @@ int ath_tx_start(struct ieee80211_hw *hw
|
||||
* we will at least have to run TX completionon one buffer
|
||||
* on the queue */
|
||||
spin_lock_bh(&txq->axq_lock);
|
||||
- if (sc->tx.txq[txq->axq_qnum].axq_depth > 1) {
|
||||
+ if (!txq->stopped && txq->axq_depth > 1) {
|
||||
ath_mac80211_stop_queue(sc, skb_get_queue_mapping(skb));
|
||||
txq->stopped = 1;
|
||||
}
|
||||
@@ -1972,6 +1953,13 @@ static void ath_tx_complete_buf(struct a
|
||||
tx_flags |= ATH_TX_XRETRY;
|
||||
}
|
||||
|
||||
+ if (bf->txq) {
|
||||
+ spin_lock_bh(&bf->txq->axq_lock);
|
||||
+ bf->txq->pending_frames--;
|
||||
+ spin_unlock_bh(&bf->txq->axq_lock);
|
||||
+ bf->txq = NULL;
|
||||
+ }
|
||||
+
|
||||
dma_unmap_single(sc->dev, bf->bf_dmacontext, skb->len, DMA_TO_DEVICE);
|
||||
ath_tx_complete(sc, skb, bf->aphy, tx_flags);
|
||||
ath_debug_stat_tx(sc, txq, bf, ts);
|
||||
@@ -2060,8 +2048,7 @@ static void ath_wake_mac80211_queue(stru
|
||||
int qnum;
|
||||
|
||||
spin_lock_bh(&txq->axq_lock);
|
||||
- if (txq->stopped &&
|
||||
- sc->tx.txq[txq->axq_qnum].axq_depth <= (ATH_TXBUF - 20)) {
|
||||
+ if (txq->stopped && txq->pending_frames < ATH_MAX_QDEPTH) {
|
||||
qnum = ath_get_mac80211_qnum(txq->axq_qnum, sc);
|
||||
if (qnum != -1) {
|
||||
ath_mac80211_start_queue(sc, qnum);
|
||||
--- a/drivers/net/wireless/ath/ath9k/main.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/main.c
|
||||
@@ -1026,6 +1026,7 @@ static int ath9k_tx(struct ieee80211_hw
|
||||
struct ath_tx_control txctl;
|
||||
int padpos, padsize;
|
||||
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
|
||||
+ int qnum;
|
||||
|
||||
if (aphy->state != ATH_WIPHY_ACTIVE && aphy->state != ATH_WIPHY_SCAN) {
|
||||
ath_print(common, ATH_DBG_XMIT,
|
||||
@@ -1098,11 +1099,8 @@ static int ath9k_tx(struct ieee80211_hw
|
||||
memmove(skb->data, skb->data + padsize, padpos);
|
||||
}
|
||||
|
||||
- /* Check if a tx queue is available */
|
||||
-
|
||||
- txctl.txq = ath_test_get_txq(sc, skb);
|
||||
- if (!txctl.txq)
|
||||
- goto exit;
|
||||
+ qnum = ath_get_hal_qnum(skb_get_queue_mapping(skb), sc);
|
||||
+ txctl.txq = &sc->tx.txq[qnum];
|
||||
|
||||
ath_print(common, ATH_DBG_XMIT, "transmitting packet, skb: %p\n", skb);
|
||||
|
Loading…
Reference in new issue