[package] mac80211: update compat-wireless to 2009-02-25
[openwrt/svn-archive/archive.git] / package / mac80211 / patches / 319-rt2x00-support-get_tkip_seq-fix-TX-streams-rt2800.patch
1 From 6b12c7bb631dd47cff8b0bad6d47c4b2439c6a59 Mon Sep 17 00:00:00 2001
2 From: Ivo van Doorn <IvDoorn@gmail.com>
3 Date: Sat, 14 Feb 2009 19:55:36 +0100
4 Subject: [PATCH] rt2x00: support get_tkip_seq, fix TX streams (rt2800pci)
5
6 Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
7 ---
8 drivers/net/wireless/rt2x00/rt2800pci.c | 23 ++++++++++++++++++++++-
9 drivers/net/wireless/rt2x00/rt2800pci.h | 6 ------
10 2 files changed, 22 insertions(+), 7 deletions(-)
11
12 --- a/drivers/net/wireless/rt2x00/rt2800pci.c
13 +++ b/drivers/net/wireless/rt2x00/rt2800pci.c
14 @@ -1374,6 +1374,8 @@ static int rt2800pci_init_registers(stru
15
16 rt2x00pci_register_read(rt2x00dev, TX_RTS_CFG, &reg);
17 rt2x00_set_field32(&reg, TX_RTS_CFG_AUTO_RTS_RETRY_LIMIT, 32);
18 + rt2x00_set_field32(&reg, TX_RTS_CFG_RTS_THRES,
19 + IEEE80211_MAX_RTS_THRESHOLD);
20 rt2x00_set_field32(&reg, TX_RTS_CFG_RTS_FBK_EN, 0);
21 rt2x00pci_register_write(rt2x00dev, TX_RTS_CFG, reg);
22
23 @@ -2470,7 +2472,10 @@ static int rt2800pci_probe_hw_mode(struc
24 spec->ht.ampdu_factor = 3;
25 spec->ht.ampdu_density = 4;
26 spec->ht.mcs.tx_params =
27 - IEEE80211_HT_MCS_TX_DEFINED;
28 + IEEE80211_HT_MCS_TX_DEFINED |
29 + IEEE80211_HT_MCS_TX_RX_DIFF |
30 + ((rt2x00_get_field16(eeprom, EEPROM_ANTENNA_TXPATH) - 1) <<
31 + IEEE80211_HT_MCS_TX_MAX_STREAMS_SHIFT);
32
33 switch (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_RXPATH)) {
34 case 3:
35 @@ -2552,6 +2557,21 @@ static int rt2800pci_probe_hw(struct rt2
36 /*
37 * IEEE80211 stack callback functions.
38 */
39 +static void rt2800pci_get_tkip_seq(struct ieee80211_hw *hw, u8 hw_key_idx,
40 + u32 *iv32, u16 *iv16)
41 +{
42 + struct rt2x00_dev *rt2x00dev = hw->priv;
43 + struct mac_iveiv_entry iveiv_entry;
44 + u32 offset;
45 +
46 + offset = MAC_IVEIV_ENTRY(hw_key_idx);
47 + rt2x00pci_register_multiread(rt2x00dev, offset,
48 + &iveiv_entry, sizeof(iveiv_entry));
49 +
50 + memcpy(&iveiv_entry.iv[0], iv16, sizeof(iv16));
51 + memcpy(&iveiv_entry.iv[4], iv32, sizeof(iv32));
52 +}
53 +
54 static int rt2800pci_set_rts_threshold(struct ieee80211_hw *hw, u32 value)
55 {
56 struct rt2x00_dev *rt2x00dev = hw->priv;
57 @@ -2681,6 +2701,7 @@ static const struct ieee80211_ops rt2800
58 .configure_filter = rt2x00mac_configure_filter,
59 .set_key = rt2x00mac_set_key,
60 .get_stats = rt2x00mac_get_stats,
61 + .get_tkip_seq = rt2800pci_get_tkip_seq,
62 .set_rts_threshold = rt2800pci_set_rts_threshold,
63 .bss_info_changed = rt2x00mac_bss_info_changed,
64 .conf_tx = rt2800pci_conf_tx,
65 --- a/drivers/net/wireless/rt2x00/rt2800pci.h
66 +++ b/drivers/net/wireless/rt2x00/rt2800pci.h
67 @@ -1327,12 +1327,6 @@ struct mac_iveiv_entry {
68 } __attribute__ ((packed));
69
70 /*
71 - * MAC_IVEIV:
72 - */
73 -#define MAC_IVEIV_EIV FIELD32(0x20000000)
74 -#define MAC_IVEIV_KEYIDX FIELD32(0xc0000000)
75 -
76 -/*
77 * MAC_WCID_ATTRIBUTE:
78 */
79 #define MAC_WCID_ATTRIBUTE_KEYTAB FIELD32(0x00000001)