-/*
- * IOCTL request handler to set/get BSS mode.
- *
- * This function prepares the correct firmware command and
- * issues it to set or get the BSS mode.
- *
- * In case the mode is changed, a deauthentication is performed
- * first by the function automatically.
- */
-int mwifiex_bss_ioctl_mode(struct mwifiex_private *priv,
- struct mwifiex_wait_queue *wait,
- u16 action, int *mode)
-{
- int ret = 0;
-
- if (!mode)
- return -1;
-
- if (action == HostCmd_ACT_GEN_GET) {
- *mode = priv->bss_mode;
- return 0;
- }
-
- if ((priv->bss_mode == *mode) || (*mode == MWIFIEX_BSS_MODE_AUTO)) {
- dev_dbg(priv->adapter->dev,
- "info: Already set to required mode! No change!\n");
- priv->bss_mode = *mode;
- return 0;
- }
-
- ret = mwifiex_deauthenticate(priv, wait, NULL);
-
- priv->sec_info.authentication_mode = MWIFIEX_AUTH_MODE_OPEN;
- priv->bss_mode = *mode;
- if (priv->bss_mode != MWIFIEX_BSS_MODE_AUTO) {
- ret = mwifiex_prepare_cmd(priv, HostCmd_CMD_SET_BSS_MODE,
- HostCmd_ACT_GEN_SET, 0, wait, NULL);
- if (!ret)
- ret = -EINPROGRESS;
- }
-
- return ret;
-}
-