[nbd168-wireless:mt76 61/62] drivers/net/wireless/mediatek/mt76/mt7615/main.c:408:35: warning: implicit conversion from 'enum mcu_cipher_type' to 'enum mt76_cipher_type'

From: kernel test robot
Date: Wed Dec 29 2021 - 11:38:17 EST


tree: https://github.com/nbd168/wireless mt76
head: b18073c341fd3b4143cd034decb0ad8544b51bdf
commit: ef1e7305c000792e704ba70d34ad653224d56d24 [61/62] mt76: mt7615: update bss_info with cipher after setting the group key
config: alpha-allyesconfig (https://download.01.org/0day-ci/archive/20211230/202112300039.Vl9TunbG-lkp@xxxxxxxxx/config)
compiler: alpha-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/nbd168/wireless/commit/ef1e7305c000792e704ba70d34ad653224d56d24
git remote add nbd168-wireless https://github.com/nbd168/wireless
git fetch --no-tags nbd168-wireless mt76
git checkout ef1e7305c000792e704ba70d34ad653224d56d24
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=alpha SHELL=/bin/bash drivers/net/wireless/mediatek/mt76/mt7615/ drivers/net/wireless/mediatek/mt76/mt7915/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

drivers/net/wireless/mediatek/mt76/mt7615/main.c: In function 'mt7615_set_key':
>> drivers/net/wireless/mediatek/mt76/mt7615/main.c:408:35: warning: implicit conversion from 'enum mcu_cipher_type' to 'enum mt76_cipher_type' [-Wenum-conversion]
408 | mvif->mt76.cipher = mt76_connac_mcu_get_cipher(key->cipher);
| ^


vim +408 drivers/net/wireless/mediatek/mt76/mt7615/main.c

362
363 static int mt7615_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
364 struct ieee80211_vif *vif, struct ieee80211_sta *sta,
365 struct ieee80211_key_conf *key)
366 {
367 struct mt7615_dev *dev = mt7615_hw_dev(hw);
368 struct mt7615_phy *phy = mt7615_hw_phy(hw);
369 struct mt7615_vif *mvif = (struct mt7615_vif *)vif->drv_priv;
370 struct mt7615_sta *msta = sta ? (struct mt7615_sta *)sta->drv_priv :
371 &mvif->sta;
372 struct mt76_wcid *wcid = &msta->wcid;
373 int idx = key->keyidx, err = 0;
374 u8 *wcid_keyidx = &wcid->hw_key_idx;
375
376 /* The hardware does not support per-STA RX GTK, fallback
377 * to software mode for these.
378 */
379 if ((vif->type == NL80211_IFTYPE_ADHOC ||
380 vif->type == NL80211_IFTYPE_MESH_POINT) &&
381 (key->cipher == WLAN_CIPHER_SUITE_TKIP ||
382 key->cipher == WLAN_CIPHER_SUITE_CCMP) &&
383 !(key->flags & IEEE80211_KEY_FLAG_PAIRWISE))
384 return -EOPNOTSUPP;
385
386 /* fall back to sw encryption for unsupported ciphers */
387 switch (key->cipher) {
388 case WLAN_CIPHER_SUITE_AES_CMAC:
389 wcid_keyidx = &wcid->hw_key_idx2;
390 key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIE;
391 break;
392 case WLAN_CIPHER_SUITE_TKIP:
393 case WLAN_CIPHER_SUITE_CCMP:
394 case WLAN_CIPHER_SUITE_CCMP_256:
395 case WLAN_CIPHER_SUITE_GCMP:
396 case WLAN_CIPHER_SUITE_GCMP_256:
397 case WLAN_CIPHER_SUITE_SMS4:
398 break;
399 case WLAN_CIPHER_SUITE_WEP40:
400 case WLAN_CIPHER_SUITE_WEP104:
401 default:
402 return -EOPNOTSUPP;
403 }
404
405 mt7615_mutex_acquire(dev);
406
407 if (cmd == SET_KEY && !sta && !mvif->mt76.cipher) {
> 408 mvif->mt76.cipher = mt76_connac_mcu_get_cipher(key->cipher);
409 mt7615_mcu_add_bss_info(phy, vif, NULL, true);
410 }
411
412 if (cmd == SET_KEY)
413 *wcid_keyidx = idx;
414 else if (idx == *wcid_keyidx)
415 *wcid_keyidx = -1;
416 else
417 goto out;
418
419 mt76_wcid_key_setup(&dev->mt76, wcid,
420 cmd == SET_KEY ? key : NULL);
421
422 if (mt76_is_mmio(&dev->mt76))
423 err = mt7615_mac_wtbl_set_key(dev, wcid, key, cmd);
424 else
425 err = __mt7615_mac_wtbl_set_key(dev, wcid, key, cmd);
426
427 out:
428 mt7615_mutex_release(dev);
429
430 return err;
431 }
432

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx