提交 848819f4 编写于 作者: A Amitkumar Karwar 提交者: John W. Linville

mwifiex: stop AP at shutdown time

Deauth is sent to AP when the device is acting as station at
shutdown time. Similarly we should stop AP operation also.
mwifiex_deauthenticate() takes care closing the connection
based on provided interface type.

Add a new function to simplify the code.
Reported-by: NAvery Pennarun <apenwarr@gmail.com>
Signed-off-by: NAmitkumar Karwar <akarwar@marvell.com>
Signed-off-by: NBing Zhao <bzhao@marvell.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 ace27355
...@@ -1443,7 +1443,20 @@ int mwifiex_deauthenticate(struct mwifiex_private *priv, u8 *mac) ...@@ -1443,7 +1443,20 @@ int mwifiex_deauthenticate(struct mwifiex_private *priv, u8 *mac)
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(mwifiex_deauthenticate);
/* This function deauthenticates/disconnects from all BSS. */
void mwifiex_deauthenticate_all(struct mwifiex_adapter *adapter)
{
struct mwifiex_private *priv;
int i;
for (i = 0; i < adapter->priv_num; i++) {
priv = adapter->priv[i];
if (priv)
mwifiex_deauthenticate(priv, NULL);
}
}
EXPORT_SYMBOL_GPL(mwifiex_deauthenticate_all);
/* /*
* This function converts band to radio type used in channel TLV. * This function converts band to radio type used in channel TLV.
......
...@@ -927,6 +927,7 @@ int mwifiex_ret_802_11_associate(struct mwifiex_private *priv, ...@@ -927,6 +927,7 @@ int mwifiex_ret_802_11_associate(struct mwifiex_private *priv,
void mwifiex_reset_connect_state(struct mwifiex_private *priv, u16 reason); void mwifiex_reset_connect_state(struct mwifiex_private *priv, u16 reason);
u8 mwifiex_band_to_radio_type(u8 band); u8 mwifiex_band_to_radio_type(u8 band);
int mwifiex_deauthenticate(struct mwifiex_private *priv, u8 *mac); int mwifiex_deauthenticate(struct mwifiex_private *priv, u8 *mac);
void mwifiex_deauthenticate_all(struct mwifiex_adapter *adapter);
int mwifiex_adhoc_start(struct mwifiex_private *priv, int mwifiex_adhoc_start(struct mwifiex_private *priv,
struct cfg80211_ssid *adhoc_ssid); struct cfg80211_ssid *adhoc_ssid);
int mwifiex_adhoc_join(struct mwifiex_private *priv, int mwifiex_adhoc_join(struct mwifiex_private *priv,
......
...@@ -211,7 +211,6 @@ static void mwifiex_pcie_remove(struct pci_dev *pdev) ...@@ -211,7 +211,6 @@ static void mwifiex_pcie_remove(struct pci_dev *pdev)
struct pcie_service_card *card; struct pcie_service_card *card;
struct mwifiex_adapter *adapter; struct mwifiex_adapter *adapter;
struct mwifiex_private *priv; struct mwifiex_private *priv;
int i;
card = pci_get_drvdata(pdev); card = pci_get_drvdata(pdev);
if (!card) if (!card)
...@@ -230,11 +229,7 @@ static void mwifiex_pcie_remove(struct pci_dev *pdev) ...@@ -230,11 +229,7 @@ static void mwifiex_pcie_remove(struct pci_dev *pdev)
mwifiex_pcie_resume(&pdev->dev); mwifiex_pcie_resume(&pdev->dev);
#endif #endif
for (i = 0; i < adapter->priv_num; i++) mwifiex_deauthenticate_all(adapter);
if ((GET_BSS_ROLE(adapter->priv[i]) ==
MWIFIEX_BSS_ROLE_STA) &&
adapter->priv[i]->media_connected)
mwifiex_deauthenticate(adapter->priv[i], NULL);
priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY); priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY);
......
...@@ -166,7 +166,6 @@ mwifiex_sdio_remove(struct sdio_func *func) ...@@ -166,7 +166,6 @@ mwifiex_sdio_remove(struct sdio_func *func)
struct sdio_mmc_card *card; struct sdio_mmc_card *card;
struct mwifiex_adapter *adapter; struct mwifiex_adapter *adapter;
struct mwifiex_private *priv; struct mwifiex_private *priv;
int i;
pr_debug("info: SDIO func num=%d\n", func->num); pr_debug("info: SDIO func num=%d\n", func->num);
...@@ -185,11 +184,7 @@ mwifiex_sdio_remove(struct sdio_func *func) ...@@ -185,11 +184,7 @@ mwifiex_sdio_remove(struct sdio_func *func)
if (adapter->is_suspended) if (adapter->is_suspended)
mwifiex_sdio_resume(adapter->dev); mwifiex_sdio_resume(adapter->dev);
for (i = 0; i < adapter->priv_num; i++) mwifiex_deauthenticate_all(adapter);
if ((GET_BSS_ROLE(adapter->priv[i]) ==
MWIFIEX_BSS_ROLE_STA) &&
adapter->priv[i]->media_connected)
mwifiex_deauthenticate(adapter->priv[i], NULL);
priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY); priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY);
mwifiex_disable_auto_ds(priv); mwifiex_disable_auto_ds(priv);
......
...@@ -1036,7 +1036,6 @@ static void mwifiex_usb_cleanup_module(void) ...@@ -1036,7 +1036,6 @@ static void mwifiex_usb_cleanup_module(void)
if (usb_card && usb_card->adapter) { if (usb_card && usb_card->adapter) {
struct mwifiex_adapter *adapter = usb_card->adapter; struct mwifiex_adapter *adapter = usb_card->adapter;
int i;
/* In case driver is removed when asynchronous FW downloading is /* In case driver is removed when asynchronous FW downloading is
* in progress * in progress
...@@ -1047,11 +1046,8 @@ static void mwifiex_usb_cleanup_module(void) ...@@ -1047,11 +1046,8 @@ static void mwifiex_usb_cleanup_module(void)
if (adapter->is_suspended) if (adapter->is_suspended)
mwifiex_usb_resume(usb_card->intf); mwifiex_usb_resume(usb_card->intf);
#endif #endif
for (i = 0; i < adapter->priv_num; i++)
if ((GET_BSS_ROLE(adapter->priv[i]) == mwifiex_deauthenticate_all(adapter);
MWIFIEX_BSS_ROLE_STA) &&
adapter->priv[i]->media_connected)
mwifiex_deauthenticate(adapter->priv[i], NULL);
mwifiex_init_shutdown_fw(mwifiex_get_priv(adapter, mwifiex_init_shutdown_fw(mwifiex_get_priv(adapter,
MWIFIEX_BSS_ROLE_ANY), MWIFIEX_BSS_ROLE_ANY),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册