rt2800_mcu_request(rt2x00dev, MCU_BOOT_SIGNAL, 0, 0, 0);
}
msleep(1);
-@@ -1001,8 +1011,10 @@ void rt2800_write_beacon(struct queue_en
+@@ -1035,8 +1045,10 @@ void rt2800_write_beacon(struct queue_en
beacon_base = rt2800_hw_beacon_base(rt2x00dev, entry->entry_idx);
rt2800_register_multiwrite(rt2x00dev, beacon_base, entry->skb->data,
entry->skb->len + padding_len);
+ rt2800_shared_mem_unlock(rt2x00dev);
+ __set_bit(ENTRY_BCN_ENABLED, &entry->flags);
/*
- * Enable beaconing again.
-@@ -1027,6 +1039,8 @@ static inline void rt2800_clear_beacon_r
+@@ -1066,6 +1078,8 @@ static inline void rt2800_clear_beacon_r
beacon_base = rt2800_hw_beacon_base(rt2x00dev, index);
/*
* For the Beacon base registers we only need to clear
* the whole TXWI which (when set to 0) will invalidate
-@@ -1034,6 +1048,8 @@ static inline void rt2800_clear_beacon_r
+@@ -1073,6 +1087,8 @@ static inline void rt2800_clear_beacon_r
*/
for (i = 0; i < txwi_desc_size; i += sizeof(__le32))
rt2800_register_write(rt2x00dev, beacon_base + i, 0);
}
void rt2800_clear_beacon(struct queue_entry *entry)
-@@ -1217,7 +1233,9 @@ static void rt2800_delete_wcid_attr(stru
+@@ -1261,7 +1277,9 @@ static void rt2800_delete_wcid_attr(stru
{
u32 offset;
offset = MAC_WCID_ATTR_ENTRY(wcid);
}
static void rt2800_config_wcid_attr_bssidx(struct rt2x00_dev *rt2x00dev,
-@@ -1230,11 +1248,13 @@ static void rt2800_config_wcid_attr_bssi
+@@ -1274,11 +1292,13 @@ static void rt2800_config_wcid_attr_bssi
* The BSS Idx numbers is split in a main value of 3 bits,
* and a extended field for adding one additional bit to the value.
*/
}
static void rt2800_config_wcid_attr_cipher(struct rt2x00_dev *rt2x00dev,
-@@ -1247,6 +1267,7 @@ static void rt2800_config_wcid_attr_ciph
+@@ -1291,6 +1311,7 @@ static void rt2800_config_wcid_attr_ciph
offset = MAC_WCID_ATTR_ENTRY(key->hw_key_idx);
if (crypto->cmd == SET_KEY) {
rt2800_register_read(rt2x00dev, offset, ®);
rt2x00_set_field32(®, MAC_WCID_ATTRIBUTE_KEYTAB,
-@@ -1271,6 +1292,7 @@ static void rt2800_config_wcid_attr_ciph
+@@ -1315,6 +1336,7 @@ static void rt2800_config_wcid_attr_ciph
rt2x00_set_field32(®, MAC_WCID_ATTRIBUTE_RX_WIUDF, 0);
rt2800_register_write(rt2x00dev, offset, reg);
}
offset = MAC_IVEIV_ENTRY(key->hw_key_idx);
-@@ -1280,8 +1302,11 @@ static void rt2800_config_wcid_attr_ciph
+@@ -1324,8 +1346,11 @@ static void rt2800_config_wcid_attr_ciph
(crypto->cipher == CIPHER_AES))
iveiv_entry.iv[3] |= 0x20;
iveiv_entry.iv[3] |= key->keyidx << 6;
}
int rt2800_config_shared_key(struct rt2x00_dev *rt2x00dev,
-@@ -1304,8 +1329,11 @@ int rt2800_config_shared_key(struct rt2x
+@@ -1348,8 +1373,11 @@ int rt2800_config_shared_key(struct rt2x
sizeof(key_entry.rx_mic));
offset = SHARED_KEY_ENTRY(key->hw_key_idx);
}
/*
-@@ -1320,10 +1348,12 @@ int rt2800_config_shared_key(struct rt2x
+@@ -1364,10 +1392,12 @@ int rt2800_config_shared_key(struct rt2x
offset = SHARED_KEY_MODE_ENTRY(key->hw_key_idx / 8);
/*
* Update WCID information
-@@ -1393,8 +1423,11 @@ int rt2800_config_pairwise_key(struct rt
+@@ -1405,8 +1435,11 @@ int rt2800_config_pairwise_key(struct rt
sizeof(key_entry.rx_mic));
offset = PAIRWISE_KEY_ENTRY(key->hw_key_idx);
}
/*
-@@ -4876,14 +4909,19 @@ static int rt2800_init_registers(struct
+@@ -4884,14 +4917,19 @@ static int rt2800_init_registers(struct
/*
* ASIC will keep garbage value after boot, clear encryption keys.
*/
}
/*
-@@ -5009,8 +5047,10 @@ static int rt2800_wait_bbp_ready(struct
+@@ -5017,8 +5055,10 @@ static int rt2800_wait_bbp_ready(struct
* BBP was enabled after firmware was loaded,
* but we need to reactivate it now.
*/
msleep(1);
for (i = 0; i < REGISTER_BUSY_COUNT; i++) {
-@@ -6706,11 +6746,19 @@ int rt2800_enable_radio(struct rt2x00_de
+@@ -6714,11 +6754,19 @@ int rt2800_enable_radio(struct rt2x00_de
/*
* Send signal during boot time to initialize firmware.
*/
msleep(1);
/*
-@@ -7716,6 +7764,8 @@ int rt2800_probe_hw(struct rt2x00_dev *r
+@@ -7725,6 +7773,8 @@ int rt2800_probe_hw(struct rt2x00_dev *r
int retval;
u32 reg;
retval = rt2800_probe_rt(rt2x00dev);
if (retval)
return retval;
-@@ -7795,8 +7845,11 @@ void rt2800_get_tkip_seq(struct ieee8021
- u32 offset;
+@@ -7808,8 +7858,11 @@ void rt2800_get_key_seq(struct ieee80211
+ return;
- offset = MAC_IVEIV_ENTRY(hw_key_idx);
+ offset = MAC_IVEIV_ENTRY(key->hw_key_idx);
+
+ rt2800_shared_mem_lock(rt2x00dev);
rt2800_register_multiread(rt2x00dev, offset,
&iveiv_entry, sizeof(iveiv_entry));
+ rt2800_shared_mem_unlock(rt2x00dev);
- memcpy(iv16, &iveiv_entry.iv[0], sizeof(*iv16));
- memcpy(iv32, &iveiv_entry.iv[4], sizeof(*iv32));
+ memcpy(&seq->tkip.iv16, &iveiv_entry.iv[0], 2);
+ memcpy(&seq->tkip.iv32, &iveiv_entry.iv[4], 4);
--- a/drivers/net/wireless/rt2x00/rt2800lib.h
+++ b/drivers/net/wireless/rt2x00/rt2800lib.h
-@@ -35,6 +35,11 @@ struct rt2800_drv_data {
- unsigned int tbtt_tick;
+@@ -38,6 +38,11 @@ struct rt2800_drv_data {
+ DECLARE_BITMAP(sta_ids, STA_IDS_SIZE);
unsigned long rt2800_flags;
+
};
struct rt2800_ops {
-@@ -65,6 +70,10 @@ struct rt2800_ops {
+@@ -68,6 +73,10 @@ struct rt2800_ops {
const u8 *data, const size_t len);
int (*drv_init_registers)(struct rt2x00_dev *rt2x00dev);
__le32 *(*drv_get_txwi)(struct queue_entry *entry);
};
static inline bool rt2800_has_high_shared_mem(struct rt2x00_dev *rt2x00dev)
-@@ -74,6 +83,29 @@ static inline bool rt2800_has_high_share
+@@ -77,6 +86,29 @@ static inline bool rt2800_has_high_share
return test_bit(RT2800_HAS_HIGH_SHARED_MEM, &drv_data->rt2800_flags);
}
/*
* Queue handlers.
*/
-@@ -260,8 +281,10 @@ static int rt2800usb_write_firmware(stru
- rt2x00usb_register_multiwrite(rt2x00dev, FIRMWARE_IMAGE_BASE,
- data + offset, length);
+@@ -299,8 +320,10 @@ static int rt2800usb_write_firmware(stru
+ data + offset, length);
+ }
+ rt2800_shared_mem_lock(rt2x00dev);
rt2x00usb_register_write(rt2x00dev, H2M_MAILBOX_CID, ~0);
/*
* Send firmware request to device to load firmware,
-@@ -276,7 +299,10 @@ static int rt2800usb_write_firmware(stru
+@@ -315,7 +338,10 @@ static int rt2800usb_write_firmware(stru
}
msleep(10);
return 0;
}
-@@ -294,8 +320,10 @@ static int rt2800usb_init_registers(stru
+@@ -333,8 +359,10 @@ static int rt2800usb_init_registers(stru
if (rt2800_wait_csr_ready(rt2x00dev))
return -EBUSY;
reg = 0;
rt2x00_set_field32(®, MAC_SYS_CTRL_RESET_CSR, 1);
-@@ -810,6 +838,9 @@ static const struct rt2800_ops rt2800usb
+@@ -863,6 +891,9 @@ static const struct rt2800_ops rt2800usb
.drv_write_firmware = rt2800usb_write_firmware,
.drv_init_registers = rt2800usb_init_registers,
.drv_get_txwi = rt2800usb_get_txwi,