mwifiex: support for creation of AP interface
1. wiphy structure is per device; hence moved it to mwifiex_adapter mwifiex_register_cfg80211 takes mwifiex_adapter as parameter. This function only registers wiphy with cfg80211. 2. Creation of interfaces is moved to cfg80211 add_virtual_interface handler. 3. Create 2 interfaces by default: station and AP Signed-off-by: Avinash Patil <patila@marvell.com> Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kiran Divekar <dkiran@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:

committed by
John W. Linville

parent
03785387e1
commit
d6bffe8bb5
@@ -349,19 +349,26 @@ static void mwifiex_fw_dpc(const struct firmware *firmware, void *context)
|
||||
if (adapter->hw_status != MWIFIEX_HW_STATUS_READY)
|
||||
goto done;
|
||||
|
||||
priv = adapter->priv[0];
|
||||
if (mwifiex_register_cfg80211(priv) != 0) {
|
||||
priv = adapter->priv[MWIFIEX_BSS_ROLE_STA];
|
||||
if (mwifiex_register_cfg80211(adapter)) {
|
||||
dev_err(adapter->dev, "cannot register with cfg80211\n");
|
||||
goto err_init_fw;
|
||||
}
|
||||
|
||||
rtnl_lock();
|
||||
/* Create station interface by default */
|
||||
if (!mwifiex_add_virtual_intf(priv->wdev->wiphy, "mlan%d",
|
||||
if (!mwifiex_add_virtual_intf(adapter->wiphy, "mlan%d",
|
||||
NL80211_IFTYPE_STATION, NULL, NULL)) {
|
||||
dev_err(adapter->dev, "cannot create default STA interface\n");
|
||||
goto err_add_intf;
|
||||
}
|
||||
|
||||
/* Create AP interface by default */
|
||||
if (!mwifiex_add_virtual_intf(adapter->wiphy, "uap%d",
|
||||
NL80211_IFTYPE_AP, NULL, NULL)) {
|
||||
dev_err(adapter->dev, "cannot create default AP interface\n");
|
||||
goto err_add_intf;
|
||||
}
|
||||
rtnl_unlock();
|
||||
|
||||
mwifiex_drv_get_driver_version(adapter, fmt, sizeof(fmt) - 1);
|
||||
@@ -369,7 +376,7 @@ static void mwifiex_fw_dpc(const struct firmware *firmware, void *context)
|
||||
goto done;
|
||||
|
||||
err_add_intf:
|
||||
mwifiex_del_virtual_intf(priv->wdev->wiphy, priv->netdev);
|
||||
mwifiex_del_virtual_intf(adapter->wiphy, priv->netdev);
|
||||
rtnl_unlock();
|
||||
err_init_fw:
|
||||
pr_debug("info: %s: unregister device\n", __func__);
|
||||
@@ -830,8 +837,7 @@ int mwifiex_remove_card(struct mwifiex_adapter *adapter, struct semaphore *sem)
|
||||
|
||||
rtnl_lock();
|
||||
if (priv->wdev && priv->netdev)
|
||||
mwifiex_del_virtual_intf(priv->wdev->wiphy,
|
||||
priv->netdev);
|
||||
mwifiex_del_virtual_intf(adapter->wiphy, priv->netdev);
|
||||
rtnl_unlock();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user