diff options
Diffstat (limited to 'drivers/net/wireless/mwifiex/sta_cmd.c')
-rw-r--r-- | drivers/net/wireless/mwifiex/sta_cmd.c | 71 |
1 files changed, 48 insertions, 23 deletions
diff --git a/drivers/net/wireless/mwifiex/sta_cmd.c b/drivers/net/wireless/mwifiex/sta_cmd.c index e90c34d9c63d..40e025da6bc2 100644 --- a/drivers/net/wireless/mwifiex/sta_cmd.c +++ b/drivers/net/wireless/mwifiex/sta_cmd.c | |||
@@ -498,7 +498,8 @@ mwifiex_cmd_802_11_key_material(struct mwifiex_private *priv, | |||
498 | { | 498 | { |
499 | struct host_cmd_ds_802_11_key_material *key_material = | 499 | struct host_cmd_ds_802_11_key_material *key_material = |
500 | &cmd->params.key_material; | 500 | &cmd->params.key_material; |
501 | u16 key_param_len = 0; | 501 | struct host_cmd_tlv_mac_addr *tlv_mac; |
502 | u16 key_param_len = 0, cmd_size; | ||
502 | int ret = 0; | 503 | int ret = 0; |
503 | const u8 bc_mac[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; | 504 | const u8 bc_mac[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; |
504 | 505 | ||
@@ -614,11 +615,26 @@ mwifiex_cmd_802_11_key_material(struct mwifiex_private *priv, | |||
614 | cpu_to_le16((u16) enc_key->key_len + | 615 | cpu_to_le16((u16) enc_key->key_len + |
615 | KEYPARAMSET_FIXED_LEN); | 616 | KEYPARAMSET_FIXED_LEN); |
616 | 617 | ||
617 | key_param_len = (u16) (enc_key->key_len + KEYPARAMSET_FIXED_LEN) | 618 | key_param_len = (u16)(enc_key->key_len + KEYPARAMSET_FIXED_LEN) |
618 | + sizeof(struct mwifiex_ie_types_header); | 619 | + sizeof(struct mwifiex_ie_types_header); |
619 | 620 | ||
620 | cmd->size = cpu_to_le16(sizeof(key_material->action) + S_DS_GEN | 621 | cmd->size = cpu_to_le16(sizeof(key_material->action) + S_DS_GEN |
621 | + key_param_len); | 622 | + key_param_len); |
623 | |||
624 | if (priv->bss_type == MWIFIEX_BSS_TYPE_UAP) { | ||
625 | tlv_mac = (void *)((u8 *)&key_material->key_param_set + | ||
626 | key_param_len); | ||
627 | tlv_mac->tlv.type = cpu_to_le16(TLV_TYPE_STA_MAC_ADDR); | ||
628 | tlv_mac->tlv.len = cpu_to_le16(ETH_ALEN); | ||
629 | memcpy(tlv_mac->mac_addr, enc_key->mac_addr, ETH_ALEN); | ||
630 | cmd_size = key_param_len + S_DS_GEN + | ||
631 | sizeof(key_material->action) + | ||
632 | sizeof(struct host_cmd_tlv_mac_addr); | ||
633 | } else { | ||
634 | cmd_size = key_param_len + S_DS_GEN + | ||
635 | sizeof(key_material->action); | ||
636 | } | ||
637 | cmd->size = cpu_to_le16(cmd_size); | ||
622 | } | 638 | } |
623 | 639 | ||
624 | return ret; | 640 | return ret; |
@@ -988,7 +1004,7 @@ mwifiex_cmd_802_11_subsc_evt(struct mwifiex_private *priv, | |||
988 | rssi_tlv->abs_value = subsc_evt_cfg->bcn_h_rssi_cfg.abs_value; | 1004 | rssi_tlv->abs_value = subsc_evt_cfg->bcn_h_rssi_cfg.abs_value; |
989 | rssi_tlv->evt_freq = subsc_evt_cfg->bcn_h_rssi_cfg.evt_freq; | 1005 | rssi_tlv->evt_freq = subsc_evt_cfg->bcn_h_rssi_cfg.evt_freq; |
990 | 1006 | ||
991 | dev_dbg(priv->adapter->dev, "Cfg Beacon Low Rssi event, " | 1007 | dev_dbg(priv->adapter->dev, "Cfg Beacon High Rssi event, " |
992 | "RSSI:-%d dBm, Freq:%d\n", | 1008 | "RSSI:-%d dBm, Freq:%d\n", |
993 | subsc_evt_cfg->bcn_h_rssi_cfg.abs_value, | 1009 | subsc_evt_cfg->bcn_h_rssi_cfg.abs_value, |
994 | subsc_evt_cfg->bcn_h_rssi_cfg.evt_freq); | 1010 | subsc_evt_cfg->bcn_h_rssi_cfg.evt_freq); |
@@ -1248,13 +1264,15 @@ int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta) | |||
1248 | if (ret) | 1264 | if (ret) |
1249 | return -1; | 1265 | return -1; |
1250 | 1266 | ||
1251 | /* Enable IEEE PS by default */ | 1267 | if (priv->bss_type != MWIFIEX_BSS_TYPE_UAP) { |
1252 | priv->adapter->ps_mode = MWIFIEX_802_11_POWER_MODE_PSP; | 1268 | /* Enable IEEE PS by default */ |
1253 | ret = mwifiex_send_cmd_async(priv, | 1269 | priv->adapter->ps_mode = MWIFIEX_802_11_POWER_MODE_PSP; |
1254 | HostCmd_CMD_802_11_PS_MODE_ENH, | 1270 | ret = mwifiex_send_cmd_async( |
1255 | EN_AUTO_PS, BITMAP_STA_PS, NULL); | 1271 | priv, HostCmd_CMD_802_11_PS_MODE_ENH, |
1256 | if (ret) | 1272 | EN_AUTO_PS, BITMAP_STA_PS, NULL); |
1257 | return -1; | 1273 | if (ret) |
1274 | return -1; | ||
1275 | } | ||
1258 | } | 1276 | } |
1259 | 1277 | ||
1260 | /* get tx rate */ | 1278 | /* get tx rate */ |
@@ -1270,12 +1288,14 @@ int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta) | |||
1270 | if (ret) | 1288 | if (ret) |
1271 | return -1; | 1289 | return -1; |
1272 | 1290 | ||
1273 | /* set ibss coalescing_status */ | 1291 | if (priv->bss_type == MWIFIEX_BSS_TYPE_STA) { |
1274 | ret = mwifiex_send_cmd_async(priv, | 1292 | /* set ibss coalescing_status */ |
1275 | HostCmd_CMD_802_11_IBSS_COALESCING_STATUS, | 1293 | ret = mwifiex_send_cmd_async( |
1276 | HostCmd_ACT_GEN_SET, 0, &enable); | 1294 | priv, HostCmd_CMD_802_11_IBSS_COALESCING_STATUS, |
1277 | if (ret) | 1295 | HostCmd_ACT_GEN_SET, 0, &enable); |
1278 | return -1; | 1296 | if (ret) |
1297 | return -1; | ||
1298 | } | ||
1279 | 1299 | ||
1280 | memset(&amsdu_aggr_ctrl, 0, sizeof(amsdu_aggr_ctrl)); | 1300 | memset(&amsdu_aggr_ctrl, 0, sizeof(amsdu_aggr_ctrl)); |
1281 | amsdu_aggr_ctrl.enable = true; | 1301 | amsdu_aggr_ctrl.enable = true; |
@@ -1293,7 +1313,8 @@ int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta) | |||
1293 | if (ret) | 1313 | if (ret) |
1294 | return -1; | 1314 | return -1; |
1295 | 1315 | ||
1296 | if (first_sta) { | 1316 | if (first_sta && priv->adapter->iface_type != MWIFIEX_USB && |
1317 | priv->bss_type != MWIFIEX_BSS_TYPE_UAP) { | ||
1297 | /* Enable auto deep sleep */ | 1318 | /* Enable auto deep sleep */ |
1298 | auto_ds.auto_ds = DEEP_SLEEP_ON; | 1319 | auto_ds.auto_ds = DEEP_SLEEP_ON; |
1299 | auto_ds.idle_time = DEEP_SLEEP_IDLE_TIME; | 1320 | auto_ds.idle_time = DEEP_SLEEP_IDLE_TIME; |
@@ -1305,12 +1326,16 @@ int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta) | |||
1305 | return -1; | 1326 | return -1; |
1306 | } | 1327 | } |
1307 | 1328 | ||
1308 | /* Send cmd to FW to enable/disable 11D function */ | 1329 | if (priv->bss_type != MWIFIEX_BSS_TYPE_UAP) { |
1309 | state_11d = ENABLE_11D; | 1330 | /* Send cmd to FW to enable/disable 11D function */ |
1310 | ret = mwifiex_send_cmd_async(priv, HostCmd_CMD_802_11_SNMP_MIB, | 1331 | state_11d = ENABLE_11D; |
1311 | HostCmd_ACT_GEN_SET, DOT11D_I, &state_11d); | 1332 | ret = mwifiex_send_cmd_async(priv, HostCmd_CMD_802_11_SNMP_MIB, |
1312 | if (ret) | 1333 | HostCmd_ACT_GEN_SET, DOT11D_I, |
1313 | dev_err(priv->adapter->dev, "11D: failed to enable 11D\n"); | 1334 | &state_11d); |
1335 | if (ret) | ||
1336 | dev_err(priv->adapter->dev, | ||
1337 | "11D: failed to enable 11D\n"); | ||
1338 | } | ||
1314 | 1339 | ||
1315 | /* Send cmd to FW to configure 11n specific configuration | 1340 | /* Send cmd to FW to configure 11n specific configuration |
1316 | * (Short GI, Channel BW, Green field support etc.) for transmit | 1341 | * (Short GI, Channel BW, Green field support etc.) for transmit |