diff options
Diffstat (limited to 'drivers/net/wireless/mwifiex')
-rw-r--r-- | drivers/net/wireless/mwifiex/sta_rx.c | 12 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/sta_tx.c | 22 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/txrx.c | 13 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/util.c | 20 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/wmm.c | 122 |
5 files changed, 94 insertions, 95 deletions
diff --git a/drivers/net/wireless/mwifiex/sta_rx.c b/drivers/net/wireless/mwifiex/sta_rx.c index d7a5d7616f22..750b695aca12 100644 --- a/drivers/net/wireless/mwifiex/sta_rx.c +++ b/drivers/net/wireless/mwifiex/sta_rx.c | |||
@@ -43,8 +43,9 @@ int mwifiex_process_rx_packet(struct mwifiex_adapter *adapter, | |||
43 | { | 43 | { |
44 | int ret; | 44 | int ret; |
45 | struct mwifiex_rxinfo *rx_info = MWIFIEX_SKB_RXCB(skb); | 45 | struct mwifiex_rxinfo *rx_info = MWIFIEX_SKB_RXCB(skb); |
46 | struct mwifiex_private *priv = mwifiex_get_priv_by_id(adapter, | 46 | struct mwifiex_private *priv = |
47 | rx_info->bss_num, rx_info->bss_type); | 47 | mwifiex_get_priv_by_id(adapter, rx_info->bss_num, |
48 | rx_info->bss_type); | ||
48 | struct rx_packet_hdr *rx_pkt_hdr; | 49 | struct rx_packet_hdr *rx_pkt_hdr; |
49 | struct rxpd *local_rx_pd; | 50 | struct rxpd *local_rx_pd; |
50 | int hdr_chop; | 51 | int hdr_chop; |
@@ -125,8 +126,9 @@ int mwifiex_process_sta_rx_packet(struct mwifiex_adapter *adapter, | |||
125 | struct rx_packet_hdr *rx_pkt_hdr; | 126 | struct rx_packet_hdr *rx_pkt_hdr; |
126 | u8 ta[ETH_ALEN]; | 127 | u8 ta[ETH_ALEN]; |
127 | u16 rx_pkt_type; | 128 | u16 rx_pkt_type; |
128 | struct mwifiex_private *priv = mwifiex_get_priv_by_id(adapter, | 129 | struct mwifiex_private *priv = |
129 | rx_info->bss_num, rx_info->bss_type); | 130 | mwifiex_get_priv_by_id(adapter, rx_info->bss_num, |
131 | rx_info->bss_type); | ||
130 | 132 | ||
131 | if (!priv) | 133 | if (!priv) |
132 | return -1; | 134 | return -1; |
@@ -157,7 +159,7 @@ int mwifiex_process_sta_rx_packet(struct mwifiex_adapter *adapter, | |||
157 | skb_trim(skb, local_rx_pd->rx_pkt_length); | 159 | skb_trim(skb, local_rx_pd->rx_pkt_length); |
158 | 160 | ||
159 | ieee80211_amsdu_to_8023s(skb, &list, priv->curr_addr, | 161 | ieee80211_amsdu_to_8023s(skb, &list, priv->curr_addr, |
160 | priv->wdev->iftype, 0, false); | 162 | priv->wdev->iftype, 0, false); |
161 | 163 | ||
162 | while (!skb_queue_empty(&list)) { | 164 | while (!skb_queue_empty(&list)) { |
163 | rx_skb = __skb_dequeue(&list); | 165 | rx_skb = __skb_dequeue(&list); |
diff --git a/drivers/net/wireless/mwifiex/sta_tx.c b/drivers/net/wireless/mwifiex/sta_tx.c index 94d31a94620a..7af534feb420 100644 --- a/drivers/net/wireless/mwifiex/sta_tx.c +++ b/drivers/net/wireless/mwifiex/sta_tx.c | |||
@@ -50,8 +50,7 @@ void *mwifiex_process_sta_txpd(struct mwifiex_private *priv, | |||
50 | u8 pad; | 50 | u8 pad; |
51 | 51 | ||
52 | if (!skb->len) { | 52 | if (!skb->len) { |
53 | dev_err(adapter->dev, "Tx: bad packet length: %d\n", | 53 | dev_err(adapter->dev, "Tx: bad packet length: %d\n", skb->len); |
54 | skb->len); | ||
55 | tx_info->status_code = -1; | 54 | tx_info->status_code = -1; |
56 | return skb->data; | 55 | return skb->data; |
57 | } | 56 | } |
@@ -60,19 +59,20 @@ void *mwifiex_process_sta_txpd(struct mwifiex_private *priv, | |||
60 | pad = (4 - (((void *)skb->data - NULL) & 0x3)) % 4; | 59 | pad = (4 - (((void *)skb->data - NULL) & 0x3)) % 4; |
61 | 60 | ||
62 | BUG_ON(skb_headroom(skb) < (sizeof(*local_tx_pd) + INTF_HEADER_LEN | 61 | BUG_ON(skb_headroom(skb) < (sizeof(*local_tx_pd) + INTF_HEADER_LEN |
63 | + pad)); | 62 | + pad)); |
64 | skb_push(skb, sizeof(*local_tx_pd) + pad); | 63 | skb_push(skb, sizeof(*local_tx_pd) + pad); |
65 | 64 | ||
66 | local_tx_pd = (struct txpd *) skb->data; | 65 | local_tx_pd = (struct txpd *) skb->data; |
67 | memset(local_tx_pd, 0, sizeof(struct txpd)); | 66 | memset(local_tx_pd, 0, sizeof(struct txpd)); |
68 | local_tx_pd->bss_num = priv->bss_num; | 67 | local_tx_pd->bss_num = priv->bss_num; |
69 | local_tx_pd->bss_type = priv->bss_type; | 68 | local_tx_pd->bss_type = priv->bss_type; |
70 | local_tx_pd->tx_pkt_length = cpu_to_le16((u16) (skb->len - | 69 | local_tx_pd->tx_pkt_length = cpu_to_le16((u16)(skb->len - |
71 | (sizeof(struct txpd) + pad))); | 70 | (sizeof(struct txpd) |
71 | + pad))); | ||
72 | 72 | ||
73 | local_tx_pd->priority = (u8) skb->priority; | 73 | local_tx_pd->priority = (u8) skb->priority; |
74 | local_tx_pd->pkt_delay_2ms = | 74 | local_tx_pd->pkt_delay_2ms = |
75 | mwifiex_wmm_compute_drv_pkt_delay(priv, skb); | 75 | mwifiex_wmm_compute_drv_pkt_delay(priv, skb); |
76 | 76 | ||
77 | if (local_tx_pd->priority < | 77 | if (local_tx_pd->priority < |
78 | ARRAY_SIZE(priv->wmm.user_pri_pkt_tx_ctrl)) | 78 | ARRAY_SIZE(priv->wmm.user_pri_pkt_tx_ctrl)) |
@@ -82,7 +82,7 @@ void *mwifiex_process_sta_txpd(struct mwifiex_private *priv, | |||
82 | */ | 82 | */ |
83 | local_tx_pd->tx_control = | 83 | local_tx_pd->tx_control = |
84 | cpu_to_le32(priv->wmm.user_pri_pkt_tx_ctrl[local_tx_pd-> | 84 | cpu_to_le32(priv->wmm.user_pri_pkt_tx_ctrl[local_tx_pd-> |
85 | priority]); | 85 | priority]); |
86 | 86 | ||
87 | if (adapter->pps_uapsd_mode) { | 87 | if (adapter->pps_uapsd_mode) { |
88 | if (mwifiex_check_last_packet_indication(priv)) { | 88 | if (mwifiex_check_last_packet_indication(priv)) { |
@@ -160,13 +160,13 @@ int mwifiex_send_null_packet(struct mwifiex_private *priv, u8 flags) | |||
160 | case -1: | 160 | case -1: |
161 | dev_kfree_skb_any(skb); | 161 | dev_kfree_skb_any(skb); |
162 | dev_err(adapter->dev, "%s: host_to_card failed: ret=%d\n", | 162 | dev_err(adapter->dev, "%s: host_to_card failed: ret=%d\n", |
163 | __func__, ret); | 163 | __func__, ret); |
164 | adapter->dbg.num_tx_host_to_card_failure++; | 164 | adapter->dbg.num_tx_host_to_card_failure++; |
165 | break; | 165 | break; |
166 | case 0: | 166 | case 0: |
167 | dev_kfree_skb_any(skb); | 167 | dev_kfree_skb_any(skb); |
168 | dev_dbg(adapter->dev, "data: %s: host_to_card succeeded\n", | 168 | dev_dbg(adapter->dev, "data: %s: host_to_card succeeded\n", |
169 | __func__); | 169 | __func__); |
170 | adapter->tx_lock_flag = true; | 170 | adapter->tx_lock_flag = true; |
171 | break; | 171 | break; |
172 | case -EINPROGRESS: | 172 | case -EINPROGRESS: |
@@ -192,8 +192,8 @@ mwifiex_check_last_packet_indication(struct mwifiex_private *priv) | |||
192 | if (mwifiex_wmm_lists_empty(adapter)) | 192 | if (mwifiex_wmm_lists_empty(adapter)) |
193 | ret = true; | 193 | ret = true; |
194 | 194 | ||
195 | if (ret && !adapter->cmd_sent && !adapter->curr_cmd | 195 | if (ret && !adapter->cmd_sent && !adapter->curr_cmd && |
196 | && !is_command_pending(adapter)) { | 196 | !is_command_pending(adapter)) { |
197 | adapter->delay_null_pkt = false; | 197 | adapter->delay_null_pkt = false; |
198 | ret = true; | 198 | ret = true; |
199 | } else { | 199 | } else { |
diff --git a/drivers/net/wireless/mwifiex/txrx.c b/drivers/net/wireless/mwifiex/txrx.c index 9a6eacc9d6f9..d2af8cb98541 100644 --- a/drivers/net/wireless/mwifiex/txrx.c +++ b/drivers/net/wireless/mwifiex/txrx.c | |||
@@ -85,8 +85,7 @@ int mwifiex_process_tx(struct mwifiex_private *priv, struct sk_buff *skb, | |||
85 | switch (ret) { | 85 | switch (ret) { |
86 | case -EBUSY: | 86 | case -EBUSY: |
87 | if ((GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_STA) && | 87 | if ((GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_STA) && |
88 | (adapter->pps_uapsd_mode) && | 88 | (adapter->pps_uapsd_mode) && (adapter->tx_lock_flag)) { |
89 | (adapter->tx_lock_flag)) { | ||
90 | priv->adapter->tx_lock_flag = false; | 89 | priv->adapter->tx_lock_flag = false; |
91 | if (local_tx_pd) | 90 | if (local_tx_pd) |
92 | local_tx_pd->flags = 0; | 91 | local_tx_pd->flags = 0; |
@@ -96,7 +95,7 @@ int mwifiex_process_tx(struct mwifiex_private *priv, struct sk_buff *skb, | |||
96 | case -1: | 95 | case -1: |
97 | adapter->data_sent = false; | 96 | adapter->data_sent = false; |
98 | dev_err(adapter->dev, "mwifiex_write_data_async failed: 0x%X\n", | 97 | dev_err(adapter->dev, "mwifiex_write_data_async failed: 0x%X\n", |
99 | ret); | 98 | ret); |
100 | adapter->dbg.num_tx_host_to_card_failure++; | 99 | adapter->dbg.num_tx_host_to_card_failure++; |
101 | mwifiex_write_data_complete(adapter, skb, ret); | 100 | mwifiex_write_data_complete(adapter, skb, ret); |
102 | break; | 101 | break; |
@@ -132,7 +131,7 @@ int mwifiex_write_data_complete(struct mwifiex_adapter *adapter, | |||
132 | 131 | ||
133 | tx_info = MWIFIEX_SKB_TXCB(skb); | 132 | tx_info = MWIFIEX_SKB_TXCB(skb); |
134 | priv = mwifiex_get_priv_by_id(adapter, tx_info->bss_num, | 133 | priv = mwifiex_get_priv_by_id(adapter, tx_info->bss_num, |
135 | tx_info->bss_type); | 134 | tx_info->bss_type); |
136 | if (!priv) | 135 | if (!priv) |
137 | goto done; | 136 | goto done; |
138 | 137 | ||
@@ -151,11 +150,11 @@ int mwifiex_write_data_complete(struct mwifiex_adapter *adapter, | |||
151 | 150 | ||
152 | tpriv = adapter->priv[i]; | 151 | tpriv = adapter->priv[i]; |
153 | 152 | ||
154 | if ((GET_BSS_ROLE(tpriv) == MWIFIEX_BSS_ROLE_STA) | 153 | if ((GET_BSS_ROLE(tpriv) == MWIFIEX_BSS_ROLE_STA) && |
155 | && (tpriv->media_connected)) { | 154 | (tpriv->media_connected)) { |
156 | if (netif_queue_stopped(tpriv->netdev)) | 155 | if (netif_queue_stopped(tpriv->netdev)) |
157 | mwifiex_wake_up_net_dev_queue(tpriv->netdev, | 156 | mwifiex_wake_up_net_dev_queue(tpriv->netdev, |
158 | adapter); | 157 | adapter); |
159 | } | 158 | } |
160 | } | 159 | } |
161 | done: | 160 | done: |
diff --git a/drivers/net/wireless/mwifiex/util.c b/drivers/net/wireless/mwifiex/util.c index 9c48f37069f7..6b399976d6c8 100644 --- a/drivers/net/wireless/mwifiex/util.c +++ b/drivers/net/wireless/mwifiex/util.c | |||
@@ -93,10 +93,10 @@ int mwifiex_get_debug_info(struct mwifiex_private *priv, | |||
93 | sizeof(priv->wmm.packets_out)); | 93 | sizeof(priv->wmm.packets_out)); |
94 | info->max_tx_buf_size = (u32) adapter->max_tx_buf_size; | 94 | info->max_tx_buf_size = (u32) adapter->max_tx_buf_size; |
95 | info->tx_buf_size = (u32) adapter->tx_buf_size; | 95 | info->tx_buf_size = (u32) adapter->tx_buf_size; |
96 | info->rx_tbl_num = mwifiex_get_rx_reorder_tbl( | 96 | info->rx_tbl_num = mwifiex_get_rx_reorder_tbl(priv, |
97 | priv, info->rx_tbl); | 97 | info->rx_tbl); |
98 | info->tx_tbl_num = mwifiex_get_tx_ba_stream_tbl( | 98 | info->tx_tbl_num = mwifiex_get_tx_ba_stream_tbl(priv, |
99 | priv, info->tx_tbl); | 99 | info->tx_tbl); |
100 | info->ps_mode = adapter->ps_mode; | 100 | info->ps_mode = adapter->ps_mode; |
101 | info->ps_state = adapter->ps_state; | 101 | info->ps_state = adapter->ps_state; |
102 | info->is_deep_sleep = adapter->is_deep_sleep; | 102 | info->is_deep_sleep = adapter->is_deep_sleep; |
@@ -105,19 +105,19 @@ int mwifiex_get_debug_info(struct mwifiex_private *priv, | |||
105 | info->is_hs_configured = adapter->is_hs_configured; | 105 | info->is_hs_configured = adapter->is_hs_configured; |
106 | info->hs_activated = adapter->hs_activated; | 106 | info->hs_activated = adapter->hs_activated; |
107 | info->num_cmd_host_to_card_failure | 107 | info->num_cmd_host_to_card_failure |
108 | = adapter->dbg.num_cmd_host_to_card_failure; | 108 | = adapter->dbg.num_cmd_host_to_card_failure; |
109 | info->num_cmd_sleep_cfm_host_to_card_failure | 109 | info->num_cmd_sleep_cfm_host_to_card_failure |
110 | = adapter->dbg.num_cmd_sleep_cfm_host_to_card_failure; | 110 | = adapter->dbg.num_cmd_sleep_cfm_host_to_card_failure; |
111 | info->num_tx_host_to_card_failure | 111 | info->num_tx_host_to_card_failure |
112 | = adapter->dbg.num_tx_host_to_card_failure; | 112 | = adapter->dbg.num_tx_host_to_card_failure; |
113 | info->num_event_deauth = adapter->dbg.num_event_deauth; | 113 | info->num_event_deauth = adapter->dbg.num_event_deauth; |
114 | info->num_event_disassoc = adapter->dbg.num_event_disassoc; | 114 | info->num_event_disassoc = adapter->dbg.num_event_disassoc; |
115 | info->num_event_link_lost = adapter->dbg.num_event_link_lost; | 115 | info->num_event_link_lost = adapter->dbg.num_event_link_lost; |
116 | info->num_cmd_deauth = adapter->dbg.num_cmd_deauth; | 116 | info->num_cmd_deauth = adapter->dbg.num_cmd_deauth; |
117 | info->num_cmd_assoc_success = | 117 | info->num_cmd_assoc_success = |
118 | adapter->dbg.num_cmd_assoc_success; | 118 | adapter->dbg.num_cmd_assoc_success; |
119 | info->num_cmd_assoc_failure = | 119 | info->num_cmd_assoc_failure = |
120 | adapter->dbg.num_cmd_assoc_failure; | 120 | adapter->dbg.num_cmd_assoc_failure; |
121 | info->num_tx_timeout = adapter->dbg.num_tx_timeout; | 121 | info->num_tx_timeout = adapter->dbg.num_tx_timeout; |
122 | info->num_cmd_timeout = adapter->dbg.num_cmd_timeout; | 122 | info->num_cmd_timeout = adapter->dbg.num_cmd_timeout; |
123 | info->timeout_cmd_id = adapter->dbg.timeout_cmd_id; | 123 | info->timeout_cmd_id = adapter->dbg.timeout_cmd_id; |
@@ -160,7 +160,7 @@ int mwifiex_recv_packet(struct mwifiex_adapter *adapter, struct sk_buff *skb) | |||
160 | 160 | ||
161 | rx_info = MWIFIEX_SKB_RXCB(skb); | 161 | rx_info = MWIFIEX_SKB_RXCB(skb); |
162 | priv = mwifiex_get_priv_by_id(adapter, rx_info->bss_num, | 162 | priv = mwifiex_get_priv_by_id(adapter, rx_info->bss_num, |
163 | rx_info->bss_type); | 163 | rx_info->bss_type); |
164 | if (!priv) | 164 | if (!priv) |
165 | return -1; | 165 | return -1; |
166 | 166 | ||
@@ -191,7 +191,7 @@ int mwifiex_complete_cmd(struct mwifiex_adapter *adapter, | |||
191 | { | 191 | { |
192 | atomic_dec(&adapter->cmd_pending); | 192 | atomic_dec(&adapter->cmd_pending); |
193 | dev_dbg(adapter->dev, "cmd completed: status=%d\n", | 193 | dev_dbg(adapter->dev, "cmd completed: status=%d\n", |
194 | adapter->cmd_wait_q.status); | 194 | adapter->cmd_wait_q.status); |
195 | 195 | ||
196 | *(cmd_node->condition) = true; | 196 | *(cmd_node->condition) = true; |
197 | 197 | ||
diff --git a/drivers/net/wireless/mwifiex/wmm.c b/drivers/net/wireless/mwifiex/wmm.c index 6f0cc210f79a..5a7316c6f125 100644 --- a/drivers/net/wireless/mwifiex/wmm.c +++ b/drivers/net/wireless/mwifiex/wmm.c | |||
@@ -87,15 +87,15 @@ mwifiex_wmm_ac_debug_print(const struct ieee_types_wmm_ac_parameters *ac_param) | |||
87 | const char *ac_str[] = { "BK", "BE", "VI", "VO" }; | 87 | const char *ac_str[] = { "BK", "BE", "VI", "VO" }; |
88 | 88 | ||
89 | pr_debug("info: WMM AC_%s: ACI=%d, ACM=%d, Aifsn=%d, " | 89 | pr_debug("info: WMM AC_%s: ACI=%d, ACM=%d, Aifsn=%d, " |
90 | "EcwMin=%d, EcwMax=%d, TxopLimit=%d\n", | 90 | "EcwMin=%d, EcwMax=%d, TxopLimit=%d\n", |
91 | ac_str[wmm_aci_to_qidx_map[(ac_param->aci_aifsn_bitmap | 91 | ac_str[wmm_aci_to_qidx_map[(ac_param->aci_aifsn_bitmap |
92 | & MWIFIEX_ACI) >> 5]], | 92 | & MWIFIEX_ACI) >> 5]], |
93 | (ac_param->aci_aifsn_bitmap & MWIFIEX_ACI) >> 5, | 93 | (ac_param->aci_aifsn_bitmap & MWIFIEX_ACI) >> 5, |
94 | (ac_param->aci_aifsn_bitmap & MWIFIEX_ACM) >> 4, | 94 | (ac_param->aci_aifsn_bitmap & MWIFIEX_ACM) >> 4, |
95 | ac_param->aci_aifsn_bitmap & MWIFIEX_AIFSN, | 95 | ac_param->aci_aifsn_bitmap & MWIFIEX_AIFSN, |
96 | ac_param->ecw_bitmap & MWIFIEX_ECW_MIN, | 96 | ac_param->ecw_bitmap & MWIFIEX_ECW_MIN, |
97 | (ac_param->ecw_bitmap & MWIFIEX_ECW_MAX) >> 4, | 97 | (ac_param->ecw_bitmap & MWIFIEX_ECW_MAX) >> 4, |
98 | le16_to_cpu(ac_param->tx_op_limit)); | 98 | le16_to_cpu(ac_param->tx_op_limit)); |
99 | } | 99 | } |
100 | 100 | ||
101 | /* | 101 | /* |
@@ -112,7 +112,7 @@ mwifiex_wmm_allocate_ralist_node(struct mwifiex_adapter *adapter, u8 *ra) | |||
112 | 112 | ||
113 | if (!ra_list) { | 113 | if (!ra_list) { |
114 | dev_err(adapter->dev, "%s: failed to alloc ra_list\n", | 114 | dev_err(adapter->dev, "%s: failed to alloc ra_list\n", |
115 | __func__); | 115 | __func__); |
116 | return NULL; | 116 | return NULL; |
117 | } | 117 | } |
118 | INIT_LIST_HEAD(&ra_list->list); | 118 | INIT_LIST_HEAD(&ra_list->list); |
@@ -154,7 +154,7 @@ mwifiex_ralist_add(struct mwifiex_private *priv, u8 *ra) | |||
154 | ra_list, ra_list->is_11n_enabled); | 154 | ra_list, ra_list->is_11n_enabled); |
155 | 155 | ||
156 | list_add_tail(&ra_list->list, | 156 | list_add_tail(&ra_list->list, |
157 | &priv->wmm.tid_tbl_ptr[i].ra_list); | 157 | &priv->wmm.tid_tbl_ptr[i].ra_list); |
158 | 158 | ||
159 | if (!priv->wmm.tid_tbl_ptr[i].ra_list_curr) | 159 | if (!priv->wmm.tid_tbl_ptr[i].ra_list_curr) |
160 | priv->wmm.tid_tbl_ptr[i].ra_list_curr = ra_list; | 160 | priv->wmm.tid_tbl_ptr[i].ra_list_curr = ra_list; |
@@ -217,22 +217,19 @@ mwifiex_wmm_setup_queue_priorities(struct mwifiex_private *priv, | |||
217 | wmm_ie->reserved); | 217 | wmm_ie->reserved); |
218 | 218 | ||
219 | for (num_ac = 0; num_ac < ARRAY_SIZE(wmm_ie->ac_params); num_ac++) { | 219 | for (num_ac = 0; num_ac < ARRAY_SIZE(wmm_ie->ac_params); num_ac++) { |
220 | cw_min = (1 << (wmm_ie->ac_params[num_ac].ecw_bitmap & | 220 | u8 ecw = wmm_ie->ac_params[num_ac].ecw_bitmap; |
221 | MWIFIEX_ECW_MIN)) - 1; | 221 | u8 aci_aifsn = wmm_ie->ac_params[num_ac].aci_aifsn_bitmap; |
222 | avg_back_off = (cw_min >> 1) + | 222 | cw_min = (1 << (ecw & MWIFIEX_ECW_MIN)) - 1; |
223 | (wmm_ie->ac_params[num_ac].aci_aifsn_bitmap & | 223 | avg_back_off = (cw_min >> 1) + (aci_aifsn & MWIFIEX_AIFSN); |
224 | MWIFIEX_AIFSN); | 224 | |
225 | 225 | ac_idx = wmm_aci_to_qidx_map[(aci_aifsn & MWIFIEX_ACI) >> 5]; | |
226 | ac_idx = wmm_aci_to_qidx_map[(wmm_ie->ac_params[num_ac]. | ||
227 | aci_aifsn_bitmap & | ||
228 | MWIFIEX_ACI) >> 5]; | ||
229 | priv->wmm.queue_priority[ac_idx] = ac_idx; | 226 | priv->wmm.queue_priority[ac_idx] = ac_idx; |
230 | tmp[ac_idx] = avg_back_off; | 227 | tmp[ac_idx] = avg_back_off; |
231 | 228 | ||
232 | dev_dbg(priv->adapter->dev, "info: WMM: CWmax=%d CWmin=%d Avg Back-off=%d\n", | 229 | dev_dbg(priv->adapter->dev, |
233 | (1 << ((wmm_ie->ac_params[num_ac].ecw_bitmap & | 230 | "info: WMM: CWmax=%d CWmin=%d Avg Back-off=%d\n", |
234 | MWIFIEX_ECW_MAX) >> 4)) - 1, | 231 | (1 << ((ecw & MWIFIEX_ECW_MAX) >> 4)) - 1, |
235 | cw_min, avg_back_off); | 232 | cw_min, avg_back_off); |
236 | mwifiex_wmm_ac_debug_print(&wmm_ie->ac_params[num_ac]); | 233 | mwifiex_wmm_ac_debug_print(&wmm_ie->ac_params[num_ac]); |
237 | } | 234 | } |
238 | 235 | ||
@@ -312,13 +309,14 @@ mwifiex_wmm_setup_ac_downgrade(struct mwifiex_private *priv) | |||
312 | /* WMM is not enabled, default priorities */ | 309 | /* WMM is not enabled, default priorities */ |
313 | for (ac_val = WMM_AC_BK; ac_val <= WMM_AC_VO; ac_val++) | 310 | for (ac_val = WMM_AC_BK; ac_val <= WMM_AC_VO; ac_val++) |
314 | priv->wmm.ac_down_graded_vals[ac_val] = | 311 | priv->wmm.ac_down_graded_vals[ac_val] = |
315 | (enum mwifiex_wmm_ac_e) ac_val; | 312 | (enum mwifiex_wmm_ac_e) ac_val; |
316 | } else { | 313 | } else { |
317 | for (ac_val = WMM_AC_BK; ac_val <= WMM_AC_VO; ac_val++) { | 314 | for (ac_val = WMM_AC_BK; ac_val <= WMM_AC_VO; ac_val++) { |
318 | priv->wmm.ac_down_graded_vals[ac_val] | 315 | priv->wmm.ac_down_graded_vals[ac_val] |
319 | = mwifiex_wmm_eval_downgrade_ac(priv, | 316 | = mwifiex_wmm_eval_downgrade_ac(priv, |
320 | (enum mwifiex_wmm_ac_e) ac_val); | 317 | (enum mwifiex_wmm_ac_e) ac_val); |
321 | dev_dbg(priv->adapter->dev, "info: WMM: AC PRIO %d maps to %d\n", | 318 | dev_dbg(priv->adapter->dev, |
319 | "info: WMM: AC PRIO %d maps to %d\n", | ||
322 | ac_val, priv->wmm.ac_down_graded_vals[ac_val]); | 320 | ac_val, priv->wmm.ac_down_graded_vals[ac_val]); |
323 | } | 321 | } |
324 | } | 322 | } |
@@ -394,13 +392,13 @@ mwifiex_wmm_init(struct mwifiex_adapter *adapter) | |||
394 | } | 392 | } |
395 | 393 | ||
396 | priv->aggr_prio_tbl[6].amsdu | 394 | priv->aggr_prio_tbl[6].amsdu |
397 | = priv->aggr_prio_tbl[6].ampdu_ap | 395 | = priv->aggr_prio_tbl[6].ampdu_ap |
398 | = priv->aggr_prio_tbl[6].ampdu_user | 396 | = priv->aggr_prio_tbl[6].ampdu_user |
399 | = BA_STREAM_NOT_ALLOWED; | 397 | = BA_STREAM_NOT_ALLOWED; |
400 | 398 | ||
401 | priv->aggr_prio_tbl[7].amsdu = priv->aggr_prio_tbl[7].ampdu_ap | 399 | priv->aggr_prio_tbl[7].amsdu = priv->aggr_prio_tbl[7].ampdu_ap |
402 | = priv->aggr_prio_tbl[7].ampdu_user | 400 | = priv->aggr_prio_tbl[7].ampdu_user |
403 | = BA_STREAM_NOT_ALLOWED; | 401 | = BA_STREAM_NOT_ALLOWED; |
404 | 402 | ||
405 | priv->add_ba_param.timeout = MWIFIEX_DEFAULT_BLOCK_ACK_TIMEOUT; | 403 | priv->add_ba_param.timeout = MWIFIEX_DEFAULT_BLOCK_ACK_TIMEOUT; |
406 | priv->add_ba_param.tx_win_size = MWIFIEX_AMPDU_DEF_TXWINSIZE; | 404 | priv->add_ba_param.tx_win_size = MWIFIEX_AMPDU_DEF_TXWINSIZE; |
@@ -472,7 +470,7 @@ static void mwifiex_wmm_cleanup_queues(struct mwifiex_private *priv) | |||
472 | 470 | ||
473 | for (i = 0; i < MAX_NUM_TID; i++) | 471 | for (i = 0; i < MAX_NUM_TID; i++) |
474 | mwifiex_wmm_del_pkts_in_ralist(priv, &priv->wmm.tid_tbl_ptr[i]. | 472 | mwifiex_wmm_del_pkts_in_ralist(priv, &priv->wmm.tid_tbl_ptr[i]. |
475 | ra_list); | 473 | ra_list); |
476 | 474 | ||
477 | atomic_set(&priv->wmm.tx_pkts_queued, 0); | 475 | atomic_set(&priv->wmm.tx_pkts_queued, 0); |
478 | atomic_set(&priv->wmm.highest_queued_prio, HIGH_PRIO_TID); | 476 | atomic_set(&priv->wmm.highest_queued_prio, HIGH_PRIO_TID); |
@@ -488,9 +486,10 @@ static void mwifiex_wmm_delete_all_ralist(struct mwifiex_private *priv) | |||
488 | 486 | ||
489 | for (i = 0; i < MAX_NUM_TID; ++i) { | 487 | for (i = 0; i < MAX_NUM_TID; ++i) { |
490 | dev_dbg(priv->adapter->dev, | 488 | dev_dbg(priv->adapter->dev, |
491 | "info: ra_list: freeing buf for tid %d\n", i); | 489 | "info: ra_list: freeing buf for tid %d\n", i); |
492 | list_for_each_entry_safe(ra_list, tmp_node, | 490 | list_for_each_entry_safe(ra_list, tmp_node, |
493 | &priv->wmm.tid_tbl_ptr[i].ra_list, list) { | 491 | &priv->wmm.tid_tbl_ptr[i].ra_list, |
492 | list) { | ||
494 | list_del(&ra_list->list); | 493 | list_del(&ra_list->list); |
495 | kfree(ra_list); | 494 | kfree(ra_list); |
496 | } | 495 | } |
@@ -652,7 +651,7 @@ mwifiex_wmm_add_buf_txqueue(struct mwifiex_private *priv, | |||
652 | if (atomic_read(&priv->wmm.highest_queued_prio) < | 651 | if (atomic_read(&priv->wmm.highest_queued_prio) < |
653 | tos_to_tid_inv[tid_down]) | 652 | tos_to_tid_inv[tid_down]) |
654 | atomic_set(&priv->wmm.highest_queued_prio, | 653 | atomic_set(&priv->wmm.highest_queued_prio, |
655 | tos_to_tid_inv[tid_down]); | 654 | tos_to_tid_inv[tid_down]); |
656 | 655 | ||
657 | spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock, flags); | 656 | spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock, flags); |
658 | } | 657 | } |
@@ -681,7 +680,7 @@ int mwifiex_ret_wmm_get_status(struct mwifiex_private *priv, | |||
681 | struct mwifiex_wmm_ac_status *ac_status; | 680 | struct mwifiex_wmm_ac_status *ac_status; |
682 | 681 | ||
683 | dev_dbg(priv->adapter->dev, "info: WMM: WMM_GET_STATUS cmdresp received: %d\n", | 682 | dev_dbg(priv->adapter->dev, "info: WMM: WMM_GET_STATUS cmdresp received: %d\n", |
684 | resp_len); | 683 | resp_len); |
685 | 684 | ||
686 | while ((resp_len >= sizeof(tlv_hdr->header)) && valid) { | 685 | while ((resp_len >= sizeof(tlv_hdr->header)) && valid) { |
687 | tlv_hdr = (struct mwifiex_ie_types_data *) curr; | 686 | tlv_hdr = (struct mwifiex_ie_types_data *) curr; |
@@ -695,15 +694,15 @@ int mwifiex_ret_wmm_get_status(struct mwifiex_private *priv, | |||
695 | dev_dbg(priv->adapter->dev, | 694 | dev_dbg(priv->adapter->dev, |
696 | "info: CMD_RESP: WMM_GET_STATUS:" | 695 | "info: CMD_RESP: WMM_GET_STATUS:" |
697 | " QSTATUS TLV: %d, %d, %d\n", | 696 | " QSTATUS TLV: %d, %d, %d\n", |
698 | tlv_wmm_qstatus->queue_index, | 697 | tlv_wmm_qstatus->queue_index, |
699 | tlv_wmm_qstatus->flow_required, | 698 | tlv_wmm_qstatus->flow_required, |
700 | tlv_wmm_qstatus->disabled); | 699 | tlv_wmm_qstatus->disabled); |
701 | 700 | ||
702 | ac_status = &priv->wmm.ac_status[tlv_wmm_qstatus-> | 701 | ac_status = &priv->wmm.ac_status[tlv_wmm_qstatus-> |
703 | queue_index]; | 702 | queue_index]; |
704 | ac_status->disabled = tlv_wmm_qstatus->disabled; | 703 | ac_status->disabled = tlv_wmm_qstatus->disabled; |
705 | ac_status->flow_required = | 704 | ac_status->flow_required = |
706 | tlv_wmm_qstatus->flow_required; | 705 | tlv_wmm_qstatus->flow_required; |
707 | ac_status->flow_created = tlv_wmm_qstatus->flow_created; | 706 | ac_status->flow_created = tlv_wmm_qstatus->flow_created; |
708 | break; | 707 | break; |
709 | 708 | ||
@@ -772,29 +771,27 @@ mwifiex_wmm_process_association_req(struct mwifiex_private *priv, | |||
772 | if (!wmm_ie) | 771 | if (!wmm_ie) |
773 | return 0; | 772 | return 0; |
774 | 773 | ||
775 | dev_dbg(priv->adapter->dev, "info: WMM: process assoc req:" | 774 | dev_dbg(priv->adapter->dev, |
776 | "bss->wmmIe=0x%x\n", | 775 | "info: WMM: process assoc req: bss->wmm_ie=%#x\n", |
777 | wmm_ie->vend_hdr.element_id); | 776 | wmm_ie->vend_hdr.element_id); |
778 | 777 | ||
779 | if ((priv->wmm_required | 778 | if ((priv->wmm_required || |
780 | || (ht_cap && (priv->adapter->config_bands & BAND_GN | 779 | (ht_cap && (priv->adapter->config_bands & BAND_GN || |
781 | || priv->adapter->config_bands & BAND_AN)) | 780 | priv->adapter->config_bands & BAND_AN))) && |
782 | ) | 781 | wmm_ie->vend_hdr.element_id == WLAN_EID_VENDOR_SPECIFIC) { |
783 | && wmm_ie->vend_hdr.element_id == WLAN_EID_VENDOR_SPECIFIC) { | ||
784 | wmm_tlv = (struct mwifiex_ie_types_wmm_param_set *) *assoc_buf; | 782 | wmm_tlv = (struct mwifiex_ie_types_wmm_param_set *) *assoc_buf; |
785 | wmm_tlv->header.type = cpu_to_le16((u16) wmm_info_ie[0]); | 783 | wmm_tlv->header.type = cpu_to_le16((u16) wmm_info_ie[0]); |
786 | wmm_tlv->header.len = cpu_to_le16((u16) wmm_info_ie[1]); | 784 | wmm_tlv->header.len = cpu_to_le16((u16) wmm_info_ie[1]); |
787 | memcpy(wmm_tlv->wmm_ie, &wmm_info_ie[2], | 785 | memcpy(wmm_tlv->wmm_ie, &wmm_info_ie[2], |
788 | le16_to_cpu(wmm_tlv->header.len)); | 786 | le16_to_cpu(wmm_tlv->header.len)); |
789 | if (wmm_ie->qos_info_bitmap & IEEE80211_WMM_IE_AP_QOSINFO_UAPSD) | 787 | if (wmm_ie->qos_info_bitmap & IEEE80211_WMM_IE_AP_QOSINFO_UAPSD) |
790 | memcpy((u8 *) (wmm_tlv->wmm_ie | 788 | memcpy((u8 *) (wmm_tlv->wmm_ie |
791 | + le16_to_cpu(wmm_tlv->header.len) | 789 | + le16_to_cpu(wmm_tlv->header.len) |
792 | - sizeof(priv->wmm_qosinfo)), | 790 | - sizeof(priv->wmm_qosinfo)), |
793 | &priv->wmm_qosinfo, | 791 | &priv->wmm_qosinfo, sizeof(priv->wmm_qosinfo)); |
794 | sizeof(priv->wmm_qosinfo)); | ||
795 | 792 | ||
796 | ret_len = sizeof(wmm_tlv->header) | 793 | ret_len = sizeof(wmm_tlv->header) |
797 | + le16_to_cpu(wmm_tlv->header.len); | 794 | + le16_to_cpu(wmm_tlv->header.len); |
798 | 795 | ||
799 | *assoc_buf += ret_len; | 796 | *assoc_buf += ret_len; |
800 | } | 797 | } |
@@ -813,7 +810,7 @@ mwifiex_wmm_process_association_req(struct mwifiex_private *priv, | |||
813 | */ | 810 | */ |
814 | u8 | 811 | u8 |
815 | mwifiex_wmm_compute_drv_pkt_delay(struct mwifiex_private *priv, | 812 | mwifiex_wmm_compute_drv_pkt_delay(struct mwifiex_private *priv, |
816 | const struct sk_buff *skb) | 813 | const struct sk_buff *skb) |
817 | { | 814 | { |
818 | u8 ret_val; | 815 | u8 ret_val; |
819 | struct timeval out_tstamp, in_tstamp; | 816 | struct timeval out_tstamp, in_tstamp; |
@@ -857,11 +854,11 @@ mwifiex_wmm_get_highest_priolist_ptr(struct mwifiex_adapter *adapter, | |||
857 | 854 | ||
858 | for (j = adapter->priv_num - 1; j >= 0; --j) { | 855 | for (j = adapter->priv_num - 1; j >= 0; --j) { |
859 | spin_lock_irqsave(&adapter->bss_prio_tbl[j].bss_prio_lock, | 856 | spin_lock_irqsave(&adapter->bss_prio_tbl[j].bss_prio_lock, |
860 | flags); | 857 | flags); |
861 | is_list_empty = list_empty(&adapter->bss_prio_tbl[j] | 858 | is_list_empty = list_empty(&adapter->bss_prio_tbl[j] |
862 | .bss_prio_head); | 859 | .bss_prio_head); |
863 | spin_unlock_irqrestore(&adapter->bss_prio_tbl[j].bss_prio_lock, | 860 | spin_unlock_irqrestore(&adapter->bss_prio_tbl[j].bss_prio_lock, |
864 | flags); | 861 | flags); |
865 | if (is_list_empty) | 862 | if (is_list_empty) |
866 | continue; | 863 | continue; |
867 | 864 | ||
@@ -1210,10 +1207,11 @@ mwifiex_dequeue_tx_packet(struct mwifiex_adapter *adapter) | |||
1210 | return 0; | 1207 | return 0; |
1211 | } | 1208 | } |
1212 | 1209 | ||
1213 | if (!ptr->is_11n_enabled || mwifiex_is_ba_stream_setup(priv, ptr, tid) | 1210 | if (!ptr->is_11n_enabled || |
1214 | || ((priv->sec_info.wpa_enabled | 1211 | mwifiex_is_ba_stream_setup(priv, ptr, tid) || |
1215 | || priv->sec_info.wpa2_enabled) && !priv->wpa_is_gtk_set) | 1212 | ((priv->sec_info.wpa_enabled || |
1216 | ) { | 1213 | priv->sec_info.wpa2_enabled) && |
1214 | !priv->wpa_is_gtk_set)) { | ||
1217 | mwifiex_send_single_packet(priv, ptr, ptr_index, flags); | 1215 | mwifiex_send_single_packet(priv, ptr, ptr_index, flags); |
1218 | /* ra_list_spinlock has been freed in | 1216 | /* ra_list_spinlock has been freed in |
1219 | mwifiex_send_single_packet() */ | 1217 | mwifiex_send_single_packet() */ |