wifi: mt76: mt7603: remove dead WEP handling code
Subsystems (2)
PATCH 1/1 wifi: mt76: mt7603: remove dead WEP handling code
mt7603_set_key() only offloads TKIP and CCMP keys to the hardware and returns -EOPNOTSUPP for everything else, so WEP is always handled in software by mac80211. Hardware WEP was disabled as broken in the out-of-tree mt76 repository before the driver was merged upstream (see Link below), and in mainline mt7603_set_key() has never accepted WEP ciphers.
The WEP cases in mt7603_mac_get_key_info() and the WEP-specific key offset/length handling in mt7603_wtbl_set_key() are therefore unreachable. No functional change.
Signed-off-by Oleh Shcherba <[email protected]>
--- drivers/net/wireless/mediatek/mt76/mt7603/mac.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-)
drivers/net/wireless/mediatek/mt76/mt7603/mac.c +1 -11
@@ -894,10 +894,6 @@ mt7603_mac_get_key_info(struct ieee80211_key_conf *key, u8 *key_data)memcpy (key_data, key->key, key->keylen);switch (key->cipher) { -case WLAN_CIPHER_SUITE_WEP40 : -return MT_CIPHER_WEP40 ; -case WLAN_CIPHER_SUITE_WEP104 : -return MT_CIPHER_WEP104 ;case WLAN_CIPHER_SUITE_TKIP :/* Rx/Tx MIC keys are swapped */ memcpy (key_data +16 , key->key +24 ,8 );
@@ -916,18 +912,12 @@ int mt7603_wtbl_set_key(struct mt7603_dev *dev, int wcid,enum mt76_cipher_type cipher;u32 addr =mt7603_wtbl3_addr (wcid);u8 key_data[32 ]; -int key_len =sizeof (key_data); cipher =mt7603_mac_get_key_info (key, key_data);if (cipher ==MT_CIPHER_NONE && key)return -EOPNOTSUPP ; -if (key && (cipher ==MT_CIPHER_WEP40 || cipher ==MT_CIPHER_WEP104 )) { - addr += key->keyidx *16 ; - key_len =16 ; - } - -mt76_wr_copy (dev, addr, key_data, key_len); +mt76_wr_copy (dev, addr, key_data,sizeof (key_data)); addr =mt7603_wtbl1_addr (wcid);mt76_rmw_field (dev, addr +2 *4 ,MT_WTBL1_W2_KEY_TYPE , cipher);
Signature · 1 line
2.43.0