mwifiex: fix AP start problem for newly added interface
authorAmitkumar Karwar <akarwar@marvell.com>
Thu, 16 Jun 2016 13:22:26 +0000 (18:52 +0530)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 29 Jun 2016 15:54:02 +0000 (18:54 +0300)
It's been observed that if interface type is changed from managed to
__ap, AP can be successfully started. But there is a problem if new
ap interface is added.

The problem got resolved after sending appropriate commands to firmware
in add_interface handler.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/marvell/mwifiex/cfg80211.c

index a05ae009784340aecf63ce2034f66f2844171592..99e8cf1ad610e8d88778259686ef0d03cdec5f44 100644 (file)
@@ -2737,6 +2737,7 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy,
        struct mwifiex_private *priv;
        struct net_device *dev;
        void *mdev_priv;
+       int ret;
 
        if (!adapter)
                return ERR_PTR(-EFAULT);
@@ -2862,6 +2863,13 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy,
        mwifiex_init_priv_params(priv, dev);
        priv->netdev = dev;
 
+       ret = mwifiex_send_cmd(priv, HostCmd_CMD_SET_BSS_MODE,
+                              HostCmd_ACT_GEN_SET, 0, NULL, true);
+               return ERR_PTR(ret);
+
+       ret = mwifiex_sta_init_cmd(priv, false, false);
+               return ERR_PTR(ret);
+
        mwifiex_setup_ht_caps(&wiphy->bands[NL80211_BAND_2GHZ]->ht_cap, priv);
        if (adapter->is_hw_11ac_capable)
                mwifiex_setup_vht_caps(