mwifiex: 11h handling for AP interface
authorAvinash Patil <patila@marvell.com>
Wed, 28 Jan 2015 10:24:25 +0000 (15:54 +0530)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 29 Jan 2015 08:22:12 +0000 (10:22 +0200)
This patch enables 11h extensions in FW upon detecting DFS
channel in start radar detection/channel switch handlers.
Patch also takes care of disabling 11h when non DFS channels
are to be set during start_ap handler.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Qingshui Gao <gaoqs@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/mwifiex/11h.c
drivers/net/wireless/mwifiex/cfg80211.c
drivers/net/wireless/mwifiex/decl.h
drivers/net/wireless/mwifiex/fw.h
drivers/net/wireless/mwifiex/init.c
drivers/net/wireless/mwifiex/main.h

index d794686..3ab87a8 100644 (file)
 #include "fw.h"
 
 
+void mwifiex_init_11h_params(struct mwifiex_private *priv)
+{
+       priv->state_11h.is_11h_enabled = true;
+       priv->state_11h.is_11h_active = false;
+}
+
+inline int mwifiex_is_11h_active(struct mwifiex_private *priv)
+{
+       return priv->state_11h.is_11h_active;
+}
 /* This function appends 11h info to a buffer while joining an
  * infrastructure BSS
  */
@@ -69,10 +79,14 @@ mwifiex_11h_process_infra_join(struct mwifiex_private *priv, u8 **buffer,
 }
 
 /* Enable or disable the 11h extensions in the firmware */
-static int mwifiex_11h_activate(struct mwifiex_private *priv, bool flag)
+int mwifiex_11h_activate(struct mwifiex_private *priv, bool flag)
 {
        u32 enable = flag;
 
+       /* enable master mode radar detection on AP interface */
+       if ((GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_UAP) && enable)
+               enable |= MWIFIEX_MASTER_RADAR_DET_MASK;
+
        return mwifiex_send_cmd(priv, HostCmd_CMD_802_11_SNMP_MIB,
                                HostCmd_ACT_GEN_SET, DOT11H_I, &enable, true);
 }
@@ -91,11 +105,13 @@ void mwifiex_11h_process_join(struct mwifiex_private *priv, u8 **buffer,
                 * bit
                 */
                mwifiex_11h_activate(priv, true);
+               priv->state_11h.is_11h_active = true;
                bss_desc->cap_info_bitmap |= WLAN_CAPABILITY_SPECTRUM_MGMT;
                mwifiex_11h_process_infra_join(priv, buffer, bss_desc);
        } else {
                /* Deactivate 11h functions in the firmware */
                mwifiex_11h_activate(priv, false);
+               priv->state_11h.is_11h_active = false;
                bss_desc->cap_info_bitmap &= ~WLAN_CAPABILITY_SPECTRUM_MGMT;
        }
 }
Simple merge
Simple merge
Simple merge
Simple merge