aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Lin <dlin@marvell.com>2016-05-31 16:08:34 +0800
committerDavid Lin <dlin@marvell.com>2016-05-31 16:10:05 +0800
commit41b7076b70abe7567e715c300a7d8e15b302a71a (patch)
treec220dad4770945d2eab82fdea07a540d310c3e5d
parent608f4eb0d2ca67f9bae686b8de25e4f627e3af7c (diff)
Commit mwlwifi driver 10.3.0.17-20160531
Added code to support WPS. Signed-off-by: David Lin <dlin@marvell.com>
-rwxr-xr-x[-rw-r--r--]dev.h4
-rwxr-xr-x[-rw-r--r--]fwcmd.c37
-rwxr-xr-x[-rw-r--r--]fwcmd.h2
-rwxr-xr-x[-rw-r--r--]hostcmd.h12
4 files changed, 51 insertions, 4 deletions
diff --git a/dev.h b/dev.h
index 5527e68..2d69278 100644..100755
--- a/dev.h
+++ b/dev.h
@@ -27,7 +27,7 @@
#include <net/mac80211.h>
#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
index b252ff7..6565ed7 100644..100755
--- 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
index 1f1249c..fdb9fe8 100644..100755
--- 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
index 57c4dca..63199f6 100644..100755
--- 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;