diff mbox series

[2/2] mt76: mt7615: add vif check in mt7615_update_vif_beacon()

Message ID 87747c34f3dd0f91a5fb68d1a40dd4adc6591092.1607104742.git.ryder.lee@mediatek.com (mailing list archive)
State New, archived
Headers show
Series [1/2] mt76: mt7915: add vif check in mt7915_update_vif_beacon() | expand

Commit Message

Ryder Lee Dec. 4, 2020, 6:36 p.m. UTC
This avoids the WARN_ON(1) calltrace in station mode.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
---
 drivers/net/wireless/mediatek/mt76/mt7615/mac.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Comments

kernel test robot Dec. 4, 2020, 9:23 p.m. UTC | #1
Hi Ryder,

I love your patch! Perhaps something to improve:

[auto build test WARNING on wireless-drivers-next/master]
[also build test WARNING on wireless-drivers/master v5.10-rc6 next-20201204]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Ryder-Lee/mt76-mt7915-add-vif-check-in-mt7915_update_vif_beacon/20201205-024232
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git master
config: x86_64-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/70a2e5dfc5fb443d0827fefd13ce0cb8a3785cf6
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Ryder-Lee/mt76-mt7915-add-vif-check-in-mt7915_update_vif_beacon/20201205-024232
        git checkout 70a2e5dfc5fb443d0827fefd13ce0cb8a3785cf6
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

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

All warnings (new ones prefixed by >>):

   drivers/net/wireless/mediatek/mt76/mt7615/mac.c: In function 'mt7615_update_vif_beacon':
>> drivers/net/wireless/mediatek/mt76/mt7615/mac.c:2059:2: warning: enumeration value 'NL80211_IFTYPE_UNSPECIFIED' not handled in switch [-Wswitch]
    2059 |  switch (vif->type) {
         |  ^~~~~~
>> drivers/net/wireless/mediatek/mt76/mt7615/mac.c:2059:2: warning: enumeration value 'NL80211_IFTYPE_STATION' not handled in switch [-Wswitch]
>> drivers/net/wireless/mediatek/mt76/mt7615/mac.c:2059:2: warning: enumeration value 'NL80211_IFTYPE_AP_VLAN' not handled in switch [-Wswitch]
>> drivers/net/wireless/mediatek/mt76/mt7615/mac.c:2059:2: warning: enumeration value 'NL80211_IFTYPE_WDS' not handled in switch [-Wswitch]
>> drivers/net/wireless/mediatek/mt76/mt7615/mac.c:2059:2: warning: enumeration value 'NL80211_IFTYPE_MONITOR' not handled in switch [-Wswitch]
>> drivers/net/wireless/mediatek/mt76/mt7615/mac.c:2059:2: warning: enumeration value 'NL80211_IFTYPE_P2P_CLIENT' not handled in switch [-Wswitch]
>> drivers/net/wireless/mediatek/mt76/mt7615/mac.c:2059:2: warning: enumeration value 'NL80211_IFTYPE_P2P_GO' not handled in switch [-Wswitch]
>> drivers/net/wireless/mediatek/mt76/mt7615/mac.c:2059:2: warning: enumeration value 'NL80211_IFTYPE_P2P_DEVICE' not handled in switch [-Wswitch]
>> drivers/net/wireless/mediatek/mt76/mt7615/mac.c:2059:2: warning: enumeration value 'NL80211_IFTYPE_OCB' not handled in switch [-Wswitch]
>> drivers/net/wireless/mediatek/mt76/mt7615/mac.c:2059:2: warning: enumeration value 'NL80211_IFTYPE_NAN' not handled in switch [-Wswitch]
>> drivers/net/wireless/mediatek/mt76/mt7615/mac.c:2059:2: warning: enumeration value 'NUM_NL80211_IFTYPES' not handled in switch [-Wswitch]
>> drivers/net/wireless/mediatek/mt76/mt7615/mac.c:2059:2: warning: enumeration value 'NL80211_IFTYPE_MAX' not handled in switch [-Wswitch]

vim +/NL80211_IFTYPE_UNSPECIFIED +2059 drivers/net/wireless/mediatek/mt76/mt7615/mac.c

  2052	
  2053	static void
  2054	mt7615_update_vif_beacon(void *priv, u8 *mac, struct ieee80211_vif *vif)
  2055	{
  2056		struct ieee80211_hw *hw = priv;
  2057		struct mt7615_dev *dev = mt7615_hw_dev(hw);
  2058	
> 2059		switch (vif->type) {
  2060		case NL80211_IFTYPE_MESH_POINT:
  2061		case NL80211_IFTYPE_ADHOC:
  2062		case NL80211_IFTYPE_AP:
  2063			mt7615_mcu_add_beacon(dev, hw, vif,
  2064					      vif->bss_conf.enable_beacon);
  2065			break;
  2066		}
  2067	}
  2068	

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

Patch

diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
index 0f360be0b885..49dced019482 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
@@ -2017,7 +2017,14 @@  mt7615_update_vif_beacon(void *priv, u8 *mac, struct ieee80211_vif *vif)
 	struct ieee80211_hw *hw = priv;
 	struct mt7615_dev *dev = mt7615_hw_dev(hw);
 
-	mt7615_mcu_add_beacon(dev, hw, vif, vif->bss_conf.enable_beacon);
+	switch (vif->type) {
+	case NL80211_IFTYPE_MESH_POINT:
+	case NL80211_IFTYPE_ADHOC:
+	case NL80211_IFTYPE_AP:
+		mt7615_mcu_add_beacon(dev, hw, vif,
+				      vif->bss_conf.enable_beacon);
+		break;
+	}
 }
 
 static void