Skip to content

Commit

Permalink
Commit mwlwifi driver 10.3.0.17-20160531
Browse files Browse the repository at this point in the history
Added code to support WPS.

Signed-off-by: David Lin <dlin@marvell.com>
  • Loading branch information
yuhhaurlin committed May 31, 2016
1 parent 608f4eb commit 41b7076
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 4 deletions.
4 changes: 3 additions & 1 deletion dev.h 100644 → 100755
Expand Up @@ -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) */
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down
37 changes: 36 additions & 1 deletion fwcmd.c 100644 → 100755
Expand Up @@ -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" },
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions fwcmd.h 100644 → 100755
Expand Up @@ -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);
Expand Down
12 changes: 10 additions & 2 deletions hostcmd.h 100644 → 100755
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 41b7076

Please sign in to comment.