diff --git a/dev.h b/dev.h old mode 100644 new mode 100755 index 5527e689..2d69278a --- a/dev.h +++ b/dev.h @@ -27,7 +27,7 @@ #include #define MWL_DRV_NAME KBUILD_MODNAME -#define MWL_DRV_VERSION "10.3.0.17-20160530" +#define MWL_DRV_VERSION "10.3.0.17-20160531" /* Map to 0x80000000 (Bus control) on BAR0 */ #define MACREG_REG_H2A_INTERRUPT_EVENTS 0x00000C18 /* (From host to ARM) */ @@ -402,6 +402,7 @@ struct beacon_info { u8 ie_list_ht[148]; u8 ie_list_vht[24]; u8 *ie_wmm_ptr; + u8 *ie_wsc_ptr; u8 *ie_rsn_ptr; u8 *ie_rsn48_ptr; u8 *ie_ht_ptr; @@ -413,6 +414,7 @@ struct beacon_info { u8 *ie_meshchsw_ptr; #endif u8 ie_wmm_len; + u8 ie_wsc_len; u8 ie_rsn_len; u8 ie_rsn48_len; u8 ie_ht_len; diff --git a/fwcmd.c b/fwcmd.c old mode 100644 new mode 100755 index b252ff74..6565ed76 --- a/fwcmd.c +++ b/fwcmd.c @@ -105,7 +105,8 @@ static char *mwl_fwcmd_get_cmd_string(unsigned short cmd) { HOSTCMD_CMD_SET_SPECTRUM_MGMT, "SetSpectrumMgmt" }, { HOSTCMD_CMD_SET_POWER_CONSTRAINT, "SetPowerConstraint" }, { HOSTCMD_CMD_SET_COUNTRY_CODE, "SetCountryCode" }, - { HOSTCMD_CMD_SET_OPTIMIZATION_LEVEL, "SetOptimizationLevel"}, + { HOSTCMD_CMD_SET_OPTIMIZATION_LEVEL, "SetOptimizationLevel" }, + { HOSTCMD_CMD_SET_WSC_IE, "SetWscIE" }, { HOSTCMD_CMD_DWDS_ENABLE, "DwdsEnable" }, { HOSTCMD_CMD_FW_FLUSH_TIMER, "FwFlushTimer" }, { HOSTCMD_CMD_SET_CDD, "SetCDD" }, @@ -510,6 +511,11 @@ static void mwl_fwcmd_parse_beacon(struct mwl_priv *priv, beacon_info->ie_wmm_len = (elen + 2); beacon_info->ie_wmm_ptr = (pos - 2); } + + if (pos[3] == 0x04) { + beacon_info->ie_wsc_len = (elen + 2); + beacon_info->ie_wsc_ptr = (pos - 2); + } } break; default: @@ -1860,6 +1866,9 @@ int mwl_fwcmd_set_beacon(struct ieee80211_hw *hw, if (mwl_fwcmd_set_ies(priv, mwl_vif)) goto err; + if (mwl_fwcmd_set_wsc_ie(hw, b_inf->ie_wsc_len, b_inf->ie_wsc_ptr)) + goto err; + if (mwl_fwcmd_set_ap_beacon(priv, mwl_vif, &vif->bss_conf)) goto err; @@ -2613,6 +2622,32 @@ int mwl_fwcmd_set_optimization_level(struct ieee80211_hw *hw, u8 opt_level) return 0; } +int mwl_fwcmd_set_wsc_ie(struct ieee80211_hw *hw, u8 len, u8 *data) +{ + struct mwl_priv *priv = hw->priv; + struct hostcmd_cmd_set_wsc_ie *pcmd; + + pcmd = (struct hostcmd_cmd_set_wsc_ie *)&priv->pcmd_buf[0]; + + mutex_lock(&priv->fwcmd_mutex); + + memset(pcmd, 0x00, sizeof(*pcmd)); + pcmd->cmd_hdr.cmd = cpu_to_le16(HOSTCMD_CMD_SET_WSC_IE); + pcmd->cmd_hdr.len = cpu_to_le16(sizeof(*pcmd)); + pcmd->len = cpu_to_le16(len); + memcpy(pcmd->data, data, len); + + if (mwl_fwcmd_exec_cmd(priv, HOSTCMD_CMD_SET_WSC_IE)) { + mutex_unlock(&priv->fwcmd_mutex); + wiphy_err(hw->wiphy, "failed execution\n"); + return -EIO; + } + + mutex_unlock(&priv->fwcmd_mutex); + + return 0; +} + int mwl_fwcmd_set_dwds_stamode(struct ieee80211_hw *hw, bool enable) { struct mwl_priv *priv = hw->priv; diff --git a/fwcmd.h b/fwcmd.h old mode 100644 new mode 100755 index 1f1249cd..fdb9fe8e --- a/fwcmd.h +++ b/fwcmd.h @@ -196,6 +196,8 @@ bool mwl_fwcmd_ampdu_allowed(struct ieee80211_sta *sta, u8 tid); int mwl_fwcmd_set_optimization_level(struct ieee80211_hw *hw, u8 opt_level); +int mwl_fwcmd_set_wsc_ie(struct ieee80211_hw *hw, u8 len, u8 *data); + int mwl_fwcmd_set_dwds_stamode(struct ieee80211_hw *hw, bool enable); int mwl_fwcmd_set_fw_flush_timer(struct ieee80211_hw *hw, u32 value); diff --git a/hostcmd.h b/hostcmd.h old mode 100644 new mode 100755 index 57c4dca3..63199f64 --- a/hostcmd.h +++ b/hostcmd.h @@ -55,6 +55,7 @@ #define HOSTCMD_CMD_SET_POWER_CONSTRAINT 0x1129 #define HOSTCMD_CMD_SET_COUNTRY_CODE 0x1130 #define HOSTCMD_CMD_SET_OPTIMIZATION_LEVEL 0x1133 +#define HOSTCMD_CMD_SET_WSC_IE 0x1136 /* per-vif */ #define HOSTCMD_CMD_DWDS_ENABLE 0x1144 #define HOSTCMD_CMD_FW_FLUSH_TIMER 0x1148 #define HOSTCMD_CMD_SET_CDD 0x1150 @@ -127,8 +128,7 @@ #define HOSTCMD_ACT_GEN_GET_LIST 0x0003 /* Misc */ -#define MAX_ENCR_KEY_LENGTH 16 -#define MIC_KEY_LENGTH 8 +#define WSC_IE_MAX_LENGTH 251 enum { WL_DISABLE = 0, @@ -834,6 +834,14 @@ struct hostcmd_cmd_set_optimization_level { u8 opt_level; } __packed; +/* HOSTCMD_CMD_SET_WSC_IE */ +struct hostcmd_cmd_set_wsc_ie { + struct hostcmd_header cmd_hdr; + __le16 ie_type; /* 0 -- beacon. or 1 -- probe response. */ + __le16 len; + u8 data[WSC_IE_MAX_LENGTH]; +} __packed; + /* HOSTCMD_CMD_DWDS_ENABLE */ struct hostcmd_cmd_dwds_enable { struct hostcmd_header cmd_hdr;