28 #define CAPINFO_MASK (~(BIT(15) | BIT(14) | BIT(12) | BIT(11) | BIT(9)))
56 "info: %s: append generic ie len %d to %p\n",
62 memcpy(*buffer, &ie_header,
sizeof(ie_header));
66 *buffer +=
sizeof(ie_header);
67 ret_len +=
sizeof(ie_header);
115 tsf_tlv.header.len =
cpu_to_le16(2 *
sizeof(tsf_val));
117 memcpy(*buffer, &tsf_tlv,
sizeof(tsf_tlv.header));
118 *buffer +=
sizeof(tsf_tlv.header);
122 memcpy(*buffer, &tsf_val,
sizeof(tsf_val));
123 *buffer +=
sizeof(tsf_val);
128 "info: %s: TSF offset calc: %016llx - %016llx\n",
131 memcpy(*buffer, &tsf_val,
sizeof(tsf_val));
132 *buffer +=
sizeof(tsf_val);
134 return sizeof(tsf_tlv.header) + (2 *
sizeof(tsf_val));
146 u32 rate1_size,
u8 *rate2,
u32 rate2_size)
158 memset(rate1, 0, rate1_size);
160 for (i = 0; rate2[
i] && i < rate2_size; i++) {
161 for (j = 0; tmp[
j] && j < rate1_size; j++) {
164 if ((rate2[i] & 0x7F) == (tmp[j] & 0x7F)) {
183 " is not compatible with the network\n",
203 u8 *out_rates,
u32 *out_rates_size)
214 card_rates, card_rates_size)) {
240 if (!buffer || !*buffer)
254 memcpy(*buffer, &ie_header,
sizeof(ie_header));
255 *buffer +=
sizeof(ie_header);
256 retLen +=
sizeof(ie_header);
300 memcpy(*buffer, &ie_header,
sizeof(ie_header));
304 *buffer +=
sizeof(ie_header);
305 retLen +=
sizeof(ie_header);
325 static int mwifiex_append_rsn_ie_wpa_wpa2(
struct mwifiex_private *priv,
331 if (!buffer || !(*buffer))
347 rsn_ie_len =
sizeof(rsn_ie_tlv->
header) +
349 *buffer += rsn_ie_len;
443 if (mwifiex_setup_rates_from_bssdesc
444 (priv, bss_desc, rates, &rates_size))
456 pos +=
sizeof(rates_tlv->
header) + rates_size;
499 pos +=
sizeof(chan_tlv->
header) +
503 if (!priv->
wps.session_enable) {
505 rsn_ie_len = mwifiex_append_rsn_ie_wpa_wpa2(priv, &pos);
507 if (rsn_ie_len == -1)
523 mwifiex_cmd_append_wapi_ie(priv, &pos);
526 mwifiex_cmd_append_wps_ie(priv, &pos);
528 mwifiex_cmd_append_generic_ie(priv, &pos);
530 mwifiex_cmd_append_tsf_tlv(priv, &pos, bss_desc);
541 dev_dbg(priv->
adapter->dev,
"info: ASSOC_CMD: tmp_cap=%4X CAPINFO_MASK=%4lX\n",
617 u8 enable_data =
true;
627 priv->
adapter->dbg.num_cmd_assoc_failure++;
629 "ASSOC_RESP: failed, status code=%d err=%#x a_id=%#x\n",
642 priv->
adapter->pps_uapsd_mode =
false;
643 priv->
adapter->tx_lock_flag =
false;
649 bss_desc->
ssid.ssid);
676 = ((bss_desc->
wmm_ie.qos_info_bitmap &
679 dev_dbg(priv->
adapter->dev,
"info: ASSOC_RESP: curr_pkt_filter is %#x\n",
697 "info: post association, re-enabling data flow\n");
713 priv->
adapter->dbg.num_cmd_assoc_success++;
722 if (!netif_carrier_ok(priv->
netdev))
724 if (netif_queue_stopped(priv->
netdev))
725 netif_wake_queue(priv->
netdev);
732 if (adapter->
curr_cmd->wait_q_enabled) {
770 u32 cmd_append_size = 0;
803 dev_dbg(adapter->
dev,
"info: ADHOC_S_CMD: SSID = %s\n",
819 #define DS_PARA_IE_ID 3
821 #define DS_PARA_IE_LEN 1
836 dev_err(adapter->
dev,
"ADHOC_S_CMD: adhoc_channel cannot be 0\n");
840 dev_dbg(adapter->
dev,
"info: ADHOC_S_CMD: creating ADHOC on channel %d\n",
855 #define IBSS_PARA_IE_ID 6
857 #define IBSS_PARA_IE_LEN 2
873 if (priv->
sec_info.encryption_mode) {
876 "info: ADHOC_S_CMD: wep_status set privacy to WEP\n");
880 dev_dbg(adapter->
dev,
"info: ADHOC_S_CMD: wep_status NOT set,"
881 " setting privacy to ACCEPT ALL\n");
893 "ADHOC_S_CMD: G Protection config failed\n");
898 for (i = 0; i <
sizeof(adhoc_start->
data_rate); i++)
908 dev_dbg(adapter->
dev,
"info: ADHOC_S_CMD: rates=%02x %02x %02x %02x\n",
912 dev_dbg(adapter->
dev,
"info: ADHOC_S_CMD: AD-HOC Start command is ready\n");
926 dev_dbg(adapter->
dev,
"info: ADHOC_S_CMD: TLV Chan = %d\n",
942 dev_dbg(adapter->
dev,
"info: ADHOC_S_CMD: TLV Band = %d\n",
944 pos +=
sizeof(chan_tlv->
header) +
947 sizeof(chan_tlv->
header) +
956 rsn_ie_len = mwifiex_append_rsn_ie_wpa_wpa2(priv, &pos);
957 if (rsn_ie_len == -1)
959 cmd_append_size += rsn_ie_len;
983 ht_info->
ht_oper.primary_chan =
990 ht_info->
ht_oper.operation_mode =
992 ht_info->
ht_oper.basic_set[0] = 0xff;
1037 u32 cmd_append_size = 0;
1039 u32 i, rates_size = 0;
1040 u16 curr_pkt_filter;
1046 #define USE_G_PROTECTION 0x02
1054 &curr_pkt_filter)) {
1056 "ADHOC_J_CMD: G Protection config failed\n");
1074 &bss_desc->
ssid.ssid, bss_desc->
ssid.ssid_len);
1088 "info: ADHOC_J_CMD: tmp_cap=%4X CAPINFO_MASK=%4lX\n",
1092 dev_dbg(priv->
adapter->dev,
"info: ADHOC_J_CMD: BSSID=%pM, SSID='%s'\n",
1139 pos +=
sizeof(chan_tlv->
header) +
1141 cmd_append_size +=
sizeof(chan_tlv->
header) +
1146 rsn_ie_len = mwifiex_append_rsn_ie_wpa_wpa2(priv, &pos);
1147 if (rsn_ie_len == -1)
1149 cmd_append_size += rsn_ie_len;
1208 bss_desc->
ssid.ssid);
1221 bss_desc->
ssid.ssid);
1239 if (!netif_carrier_ok(priv->
netdev))
1241 if (netif_queue_stopped(priv->
netdev))
1242 netif_wake_queue(priv->
netdev);
1248 if (adapter->
curr_cmd->wait_q_enabled) {
1278 sizeof(current_bssid));
1299 dev_dbg(priv->
adapter->dev,
"info: curr_bss_params.channel = %d\n",
1317 dev_dbg(priv->
adapter->dev,
"info: adhoc join: curr_bss ssid =%s\n",
1319 dev_dbg(priv->
adapter->dev,
"info: adhoc join: curr_bss ssid_len =%u\n",
1322 bss_desc->
ssid.ssid);
1324 bss_desc->
ssid.ssid_len);
1333 " is the same as current; not attempting to re-join\n");
1337 dev_dbg(priv->
adapter->dev,
"info: curr_bss_params.channel = %d\n",
1355 if (!mac || is_zero_ether_addr(mac))
1382 return mwifiex_deauthenticate_infra(priv, mac);