Revert "mt76: mt76x02: store software PN/IV in wcid"

This reverts commit f37ad72f1a.
PN needs to be shared with mac82011 for mgmt frame crypto

Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Felix Fietkau
2019-03-26 11:35:22 +01:00
parent ae166b09cf
commit bf6e72d6df
4 changed files with 3 additions and 14 deletions
-2
View File
@@ -212,8 +212,6 @@ struct mt76_wcid {
u8 rx_key_pn[IEEE80211_NUM_TIDS][6];
u32 tx_info;
u64 tx_pn;
bool sw_iv;
u8 packet_id;
+1 -6
View File
@@ -352,12 +352,7 @@ void mt76x02_mac_write_txwi(struct mt76x02_dev *dev, struct mt76x02_txwi *txwi,
txwi->wcid = 0xff;
if (wcid && wcid->sw_iv && key) {
u64 pn;
spin_lock(&dev->mt76.lock);
pn = ++wcid->tx_pn;
spin_unlock(&dev->mt76.lock);
u64 pn = atomic64_inc_return(&key->tx_pn);
ccmp_pn[0] = pn;
ccmp_pn[1] = pn >> 8;
ccmp_pn[2] = 0;
+2 -5
View File
@@ -397,13 +397,10 @@ static void mt76x02_key_sync(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
wcid = (struct mt76_wcid *) sta->drv_priv;
if (wcid->hw_key_idx != key->keyidx)
if (wcid->hw_key_idx != key->keyidx || wcid->sw_iv)
return;
if (wcid->sw_iv)
atomic64_set(&key->tx_pn, wcid->tx_pn);
else
mt76x02_mac_wcid_sync_pn(dev, wcid->idx, key);
mt76x02_mac_wcid_sync_pn(dev, wcid->idx, key);
}
static void mt76x02_reset_state(struct mt76x02_dev *dev)
-1
View File
@@ -443,7 +443,6 @@ int mt76x02_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
if (key->flags & IEEE80211_KEY_FLAG_RX_MGMT) {
key->flags |= IEEE80211_KEY_FLAG_SW_MGMT_TX;
wcid->sw_iv = true;
wcid->tx_pn = atomic64_read(&key->tx_pn);
}
} else {
if (idx == wcid->hw_key_idx) {