* [PATCH] wifi: mt76: mt7603: remove dead WEP handling code
@ 2026-11-23 19:27 Oleh Shcherba
0 siblings, 0 replies; only message in thread
From: Oleh Shcherba @ 2026-11-23 19:27 UTC (permalink / raw)
To: Felix Fietkau, Lorenzo Bianconi, Ryder Lee
Cc: Shayne Chen, Sean Wang, Matthias Brugger,
AngeloGioacchino Del Regno, linux-wireless, linux-mediatek,
linux-arm-kernel, linux-kernel, Oleh Shcherba
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.
Link: https://github.com/openwrt/mt76/commit/cd456ca87fb0afe4485ce9b091f40cf2faa3991a
Signed-off-by: Oleh Shcherba <scherbaoleg4@gmail.com>
---
drivers/net/wireless/mediatek/mt76/mt7603/mac.c | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/mac.c b/drivers/net/wireless/mediatek/mt76/mt7603/mac.c
index 196c39f..836ce7d 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7603/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7603/mac.c
@@ -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);
--
2.43.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-23 19:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-23 19:27 [PATCH] wifi: mt76: mt7603: remove dead WEP handling code Oleh Shcherba
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®