Commit adb6ed0c authored by Avinash Patil's avatar Avinash Patil Committed by John W. Linville

mwifiex: pass cfg80211_beacon_data to mwifiex_set_mgmt_ie()

Pass cfg80211_beacon_data pointer instead of cfg80211_ap_settings.
While setting management IEs we only need cfg80211_beacon_data of
cfg80211_ap_settings which has Tail IE, Head IE and other IE elements.
Signed-off-by: default avatarAvinash Patil <patila@marvell.com>
Signed-off-by: default avatarBing Zhao <bzhao@marvell.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent fd2841c5
...@@ -947,7 +947,7 @@ static int mwifiex_cfg80211_start_ap(struct wiphy *wiphy, ...@@ -947,7 +947,7 @@ static int mwifiex_cfg80211_start_ap(struct wiphy *wiphy,
if (priv->bss_type != MWIFIEX_BSS_TYPE_UAP) if (priv->bss_type != MWIFIEX_BSS_TYPE_UAP)
return -1; return -1;
if (mwifiex_set_mgmt_ies(priv, params)) if (mwifiex_set_mgmt_ies(priv, &params->beacon))
return -1; return -1;
bss_cfg = kzalloc(sizeof(struct mwifiex_uap_bss_param), GFP_KERNEL); bss_cfg = kzalloc(sizeof(struct mwifiex_uap_bss_param), GFP_KERNEL);
......
...@@ -222,7 +222,7 @@ mwifiex_update_uap_custom_ie(struct mwifiex_private *priv, ...@@ -222,7 +222,7 @@ mwifiex_update_uap_custom_ie(struct mwifiex_private *priv,
* to FW. * to FW.
*/ */
int mwifiex_set_mgmt_ies(struct mwifiex_private *priv, int mwifiex_set_mgmt_ies(struct mwifiex_private *priv,
struct cfg80211_ap_settings *params) struct cfg80211_beacon_data *data)
{ {
struct mwifiex_ie *beacon_ie = NULL, *pr_ie = NULL; struct mwifiex_ie *beacon_ie = NULL, *pr_ie = NULL;
struct mwifiex_ie *ar_ie = NULL, *gen_ie = NULL; struct mwifiex_ie *ar_ie = NULL, *gen_ie = NULL;
...@@ -233,7 +233,7 @@ int mwifiex_set_mgmt_ies(struct mwifiex_private *priv, ...@@ -233,7 +233,7 @@ int mwifiex_set_mgmt_ies(struct mwifiex_private *priv,
const u8 *vendor_ie; const u8 *vendor_ie;
int ret = 0; int ret = 0;
if (params->beacon.tail && params->beacon.tail_len) { if (data->tail && data->tail_len) {
gen_ie = kzalloc(sizeof(struct mwifiex_ie), GFP_KERNEL); gen_ie = kzalloc(sizeof(struct mwifiex_ie), GFP_KERNEL);
if (!gen_ie) if (!gen_ie)
return -ENOMEM; return -ENOMEM;
...@@ -243,8 +243,7 @@ int mwifiex_set_mgmt_ies(struct mwifiex_private *priv, ...@@ -243,8 +243,7 @@ int mwifiex_set_mgmt_ies(struct mwifiex_private *priv,
gen_ie->mgmt_subtype_mask = cpu_to_le16(mask); gen_ie->mgmt_subtype_mask = cpu_to_le16(mask);
rsn_ie = (void *)cfg80211_find_ie(WLAN_EID_RSN, rsn_ie = (void *)cfg80211_find_ie(WLAN_EID_RSN,
params->beacon.tail, data->tail, data->tail_len);
params->beacon.tail_len);
if (rsn_ie) { if (rsn_ie) {
memcpy(gen_ie->ie_buffer, rsn_ie, rsn_ie->len + 2); memcpy(gen_ie->ie_buffer, rsn_ie, rsn_ie->len + 2);
ie_len = rsn_ie->len + 2; ie_len = rsn_ie->len + 2;
...@@ -253,8 +252,7 @@ int mwifiex_set_mgmt_ies(struct mwifiex_private *priv, ...@@ -253,8 +252,7 @@ int mwifiex_set_mgmt_ies(struct mwifiex_private *priv,
vendor_ie = cfg80211_find_vendor_ie(WLAN_OUI_MICROSOFT, vendor_ie = cfg80211_find_vendor_ie(WLAN_OUI_MICROSOFT,
WLAN_OUI_TYPE_MICROSOFT_WPA, WLAN_OUI_TYPE_MICROSOFT_WPA,
params->beacon.tail, data->tail, data->tail_len);
params->beacon.tail_len);
if (vendor_ie) { if (vendor_ie) {
wpa_ie = (struct ieee_types_header *)vendor_ie; wpa_ie = (struct ieee_types_header *)vendor_ie;
memcpy(gen_ie->ie_buffer + ie_len, memcpy(gen_ie->ie_buffer + ie_len,
...@@ -275,7 +273,7 @@ int mwifiex_set_mgmt_ies(struct mwifiex_private *priv, ...@@ -275,7 +273,7 @@ int mwifiex_set_mgmt_ies(struct mwifiex_private *priv,
} }
} }
if (params->beacon.beacon_ies && params->beacon.beacon_ies_len) { if (data->beacon_ies && data->beacon_ies_len) {
beacon_ie = kmalloc(sizeof(struct mwifiex_ie), GFP_KERNEL); beacon_ie = kmalloc(sizeof(struct mwifiex_ie), GFP_KERNEL);
if (!beacon_ie) { if (!beacon_ie) {
ret = -ENOMEM; ret = -ENOMEM;
...@@ -284,13 +282,12 @@ int mwifiex_set_mgmt_ies(struct mwifiex_private *priv, ...@@ -284,13 +282,12 @@ int mwifiex_set_mgmt_ies(struct mwifiex_private *priv,
beacon_ie->ie_index = cpu_to_le16(beacon_idx); beacon_ie->ie_index = cpu_to_le16(beacon_idx);
beacon_ie->mgmt_subtype_mask = cpu_to_le16(MGMT_MASK_BEACON); beacon_ie->mgmt_subtype_mask = cpu_to_le16(MGMT_MASK_BEACON);
beacon_ie->ie_length = beacon_ie->ie_length = cpu_to_le16(data->beacon_ies_len);
cpu_to_le16(params->beacon.beacon_ies_len); memcpy(beacon_ie->ie_buffer, data->beacon_ies,
memcpy(beacon_ie->ie_buffer, params->beacon.beacon_ies, data->beacon_ies_len);
params->beacon.beacon_ies_len);
} }
if (params->beacon.proberesp_ies && params->beacon.proberesp_ies_len) { if (data->proberesp_ies && data->proberesp_ies_len) {
pr_ie = kmalloc(sizeof(struct mwifiex_ie), GFP_KERNEL); pr_ie = kmalloc(sizeof(struct mwifiex_ie), GFP_KERNEL);
if (!pr_ie) { if (!pr_ie) {
ret = -ENOMEM; ret = -ENOMEM;
...@@ -299,13 +296,12 @@ int mwifiex_set_mgmt_ies(struct mwifiex_private *priv, ...@@ -299,13 +296,12 @@ int mwifiex_set_mgmt_ies(struct mwifiex_private *priv,
pr_ie->ie_index = cpu_to_le16(pr_idx); pr_ie->ie_index = cpu_to_le16(pr_idx);
pr_ie->mgmt_subtype_mask = cpu_to_le16(MGMT_MASK_PROBE_RESP); pr_ie->mgmt_subtype_mask = cpu_to_le16(MGMT_MASK_PROBE_RESP);
pr_ie->ie_length = pr_ie->ie_length = cpu_to_le16(data->proberesp_ies_len);
cpu_to_le16(params->beacon.proberesp_ies_len); memcpy(pr_ie->ie_buffer, data->proberesp_ies,
memcpy(pr_ie->ie_buffer, params->beacon.proberesp_ies, data->proberesp_ies_len);
params->beacon.proberesp_ies_len);
} }
if (params->beacon.assocresp_ies && params->beacon.assocresp_ies_len) { if (data->assocresp_ies && data->assocresp_ies_len) {
ar_ie = kmalloc(sizeof(struct mwifiex_ie), GFP_KERNEL); ar_ie = kmalloc(sizeof(struct mwifiex_ie), GFP_KERNEL);
if (!ar_ie) { if (!ar_ie) {
ret = -ENOMEM; ret = -ENOMEM;
...@@ -315,10 +311,9 @@ int mwifiex_set_mgmt_ies(struct mwifiex_private *priv, ...@@ -315,10 +311,9 @@ int mwifiex_set_mgmt_ies(struct mwifiex_private *priv,
ar_ie->ie_index = cpu_to_le16(ar_idx); ar_ie->ie_index = cpu_to_le16(ar_idx);
mask = MGMT_MASK_ASSOC_RESP | MGMT_MASK_REASSOC_RESP; mask = MGMT_MASK_ASSOC_RESP | MGMT_MASK_REASSOC_RESP;
ar_ie->mgmt_subtype_mask = cpu_to_le16(mask); ar_ie->mgmt_subtype_mask = cpu_to_le16(mask);
ar_ie->ie_length = ar_ie->ie_length = cpu_to_le16(data->assocresp_ies_len);
cpu_to_le16(params->beacon.assocresp_ies_len); memcpy(ar_ie->ie_buffer, data->assocresp_ies,
memcpy(ar_ie->ie_buffer, params->beacon.assocresp_ies, data->assocresp_ies_len);
params->beacon.assocresp_ies_len);
} }
if (beacon_ie || pr_ie || ar_ie) { if (beacon_ie || pr_ie || ar_ie) {
......
...@@ -1013,7 +1013,7 @@ int mwifiex_del_virtual_intf(struct wiphy *wiphy, struct net_device *dev); ...@@ -1013,7 +1013,7 @@ int mwifiex_del_virtual_intf(struct wiphy *wiphy, struct net_device *dev);
void mwifiex_set_sys_config_invalid_data(struct mwifiex_uap_bss_param *config); void mwifiex_set_sys_config_invalid_data(struct mwifiex_uap_bss_param *config);
int mwifiex_set_mgmt_ies(struct mwifiex_private *priv, int mwifiex_set_mgmt_ies(struct mwifiex_private *priv,
struct cfg80211_ap_settings *params); struct cfg80211_beacon_data *data);
int mwifiex_del_mgmt_ies(struct mwifiex_private *priv); int mwifiex_del_mgmt_ies(struct mwifiex_private *priv);
u8 *mwifiex_11d_code_2_region(u8 code); u8 *mwifiex_11d_code_2_region(u8 code);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment