diff options
Diffstat (limited to 'drivers/net/wireless/mwifiex/join.c')
-rw-r--r-- | drivers/net/wireless/mwifiex/join.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/drivers/net/wireless/mwifiex/join.c b/drivers/net/wireless/mwifiex/join.c index 8a390982463e..d6b4fb04011f 100644 --- a/drivers/net/wireless/mwifiex/join.c +++ b/drivers/net/wireless/mwifiex/join.c | |||
@@ -1374,22 +1374,28 @@ static int mwifiex_deauthenticate_infra(struct mwifiex_private *priv, u8 *mac) | |||
1374 | * | 1374 | * |
1375 | * In case of infra made, it sends deauthentication request, and | 1375 | * In case of infra made, it sends deauthentication request, and |
1376 | * in case of ad-hoc mode, a stop network request is sent to the firmware. | 1376 | * in case of ad-hoc mode, a stop network request is sent to the firmware. |
1377 | * In AP mode, a command to stop bss is sent to firmware. | ||
1377 | */ | 1378 | */ |
1378 | int mwifiex_deauthenticate(struct mwifiex_private *priv, u8 *mac) | 1379 | int mwifiex_deauthenticate(struct mwifiex_private *priv, u8 *mac) |
1379 | { | 1380 | { |
1380 | int ret = 0; | 1381 | if (!priv->media_connected) |
1382 | return 0; | ||
1381 | 1383 | ||
1382 | if (priv->media_connected) { | 1384 | switch (priv->bss_mode) { |
1383 | if (priv->bss_mode == NL80211_IFTYPE_STATION) { | 1385 | case NL80211_IFTYPE_STATION: |
1384 | ret = mwifiex_deauthenticate_infra(priv, mac); | 1386 | return mwifiex_deauthenticate_infra(priv, mac); |
1385 | } else if (priv->bss_mode == NL80211_IFTYPE_ADHOC) { | 1387 | case NL80211_IFTYPE_ADHOC: |
1386 | ret = mwifiex_send_cmd_sync(priv, | 1388 | return mwifiex_send_cmd_sync(priv, |
1387 | HostCmd_CMD_802_11_AD_HOC_STOP, | 1389 | HostCmd_CMD_802_11_AD_HOC_STOP, |
1388 | HostCmd_ACT_GEN_SET, 0, NULL); | 1390 | HostCmd_ACT_GEN_SET, 0, NULL); |
1389 | } | 1391 | case NL80211_IFTYPE_AP: |
1392 | return mwifiex_send_cmd_sync(priv, HostCmd_CMD_UAP_BSS_STOP, | ||
1393 | HostCmd_ACT_GEN_SET, 0, NULL); | ||
1394 | default: | ||
1395 | break; | ||
1390 | } | 1396 | } |
1391 | 1397 | ||
1392 | return ret; | 1398 | return 0; |
1393 | } | 1399 | } |
1394 | EXPORT_SYMBOL_GPL(mwifiex_deauthenticate); | 1400 | EXPORT_SYMBOL_GPL(mwifiex_deauthenticate); |
1395 | 1401 | ||