aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath6kl/txrx.c
diff options
context:
space:
mode:
authorVasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>2011-10-25 10:04:01 -0400
committerKalle Valo <kvalo@qca.qualcomm.com>2011-11-11 05:58:47 -0500
commit59c98449b8af405aa6245ea9f640c5847f42d26e (patch)
tree4da0ceca0fbc1e332cd9f9116975b8765729572f /drivers/net/wireless/ath/ath6kl/txrx.c
parent108438bc6ad16b3962aa5009123cd810d1c1f643 (diff)
ath6kl: Define interface specific states
Currently ar->flag maintains interface stats. Move interface specific states from ar->flag to vif->flags. Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath6kl/txrx.c')
-rw-r--r--drivers/net/wireless/ath/ath6kl/txrx.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/txrx.c b/drivers/net/wireless/ath/ath6kl/txrx.c
index a9dff01c70a6..d1652bdb51d8 100644
--- a/drivers/net/wireless/ath/ath6kl/txrx.c
+++ b/drivers/net/wireless/ath/ath6kl/txrx.c
@@ -83,6 +83,8 @@ static bool ath6kl_powersave_ap(struct ath6kl *ar, struct sk_buff *skb,
83 struct ethhdr *datap = (struct ethhdr *) skb->data; 83 struct ethhdr *datap = (struct ethhdr *) skb->data;
84 struct ath6kl_sta *conn = NULL; 84 struct ath6kl_sta *conn = NULL;
85 bool ps_queued = false, is_psq_empty = false; 85 bool ps_queued = false, is_psq_empty = false;
86 /* TODO: Findout vif */
87 struct ath6kl_vif *vif = ar->vif;
86 88
87 if (is_multicast_ether_addr(datap->h_dest)) { 89 if (is_multicast_ether_addr(datap->h_dest)) {
88 u8 ctr = 0; 90 u8 ctr = 0;
@@ -100,7 +102,7 @@ static bool ath6kl_powersave_ap(struct ath6kl *ar, struct sk_buff *skb,
100 * If this transmit is not because of a Dtim Expiry 102 * If this transmit is not because of a Dtim Expiry
101 * q it. 103 * q it.
102 */ 104 */
103 if (!test_bit(DTIM_EXPIRED, &ar->flag)) { 105 if (!test_bit(DTIM_EXPIRED, &vif->flags)) {
104 bool is_mcastq_empty = false; 106 bool is_mcastq_empty = false;
105 107
106 spin_lock_bh(&ar->mcastpsq_lock); 108 spin_lock_bh(&ar->mcastpsq_lock);
@@ -235,6 +237,7 @@ int ath6kl_data_tx(struct sk_buff *skb, struct net_device *dev)
235 struct ath6kl *ar = ath6kl_priv(dev); 237 struct ath6kl *ar = ath6kl_priv(dev);
236 struct ath6kl_cookie *cookie = NULL; 238 struct ath6kl_cookie *cookie = NULL;
237 enum htc_endpoint_id eid = ENDPOINT_UNUSED; 239 enum htc_endpoint_id eid = ENDPOINT_UNUSED;
240 struct ath6kl_vif *vif = netdev_priv(dev);
238 u32 map_no = 0; 241 u32 map_no = 0;
239 u16 htc_tag = ATH6KL_DATA_PKT_TAG; 242 u16 htc_tag = ATH6KL_DATA_PKT_TAG;
240 u8 ac = 99 ; /* initialize to unmapped ac */ 243 u8 ac = 99 ; /* initialize to unmapped ac */
@@ -246,7 +249,7 @@ int ath6kl_data_tx(struct sk_buff *skb, struct net_device *dev)
246 skb, skb->data, skb->len); 249 skb, skb->data, skb->len);
247 250
248 /* If target is not associated */ 251 /* If target is not associated */
249 if (!test_bit(CONNECTED, &ar->flag)) { 252 if (!test_bit(CONNECTED, &vif->flags)) {
250 dev_kfree_skb(skb); 253 dev_kfree_skb(skb);
251 return 0; 254 return 0;
252 } 255 }
@@ -278,12 +281,12 @@ int ath6kl_data_tx(struct sk_buff *skb, struct net_device *dev)
278 } 281 }
279 282
280 if ((ar->nw_type == ADHOC_NETWORK) && 283 if ((ar->nw_type == ADHOC_NETWORK) &&
281 ar->ibss_ps_enable && test_bit(CONNECTED, &ar->flag)) 284 ar->ibss_ps_enable && test_bit(CONNECTED, &vif->flags))
282 chk_adhoc_ps_mapping = true; 285 chk_adhoc_ps_mapping = true;
283 else { 286 else {
284 /* get the stream mapping */ 287 /* get the stream mapping */
285 ret = ath6kl_wmi_implicit_create_pstream(ar->wmi, skb, 288 ret = ath6kl_wmi_implicit_create_pstream(ar->wmi, skb,
286 0, test_bit(WMM_ENABLED, &ar->flag), &ac); 289 0, test_bit(WMM_ENABLED, &vif->flags), &ac);
287 if (ret) 290 if (ret)
288 goto fail_tx; 291 goto fail_tx;
289 } 292 }
@@ -426,6 +429,8 @@ enum htc_send_full_action ath6kl_tx_queue_full(struct htc_target *target,
426 struct htc_packet *packet) 429 struct htc_packet *packet)
427{ 430{
428 struct ath6kl *ar = target->dev->ar; 431 struct ath6kl *ar = target->dev->ar;
432 /* TODO: Findout vif properly */
433 struct ath6kl_vif *vif = ar->vif;
429 enum htc_endpoint_id endpoint = packet->endpoint; 434 enum htc_endpoint_id endpoint = packet->endpoint;
430 435
431 if (endpoint == ar->ctrl_ep) { 436 if (endpoint == ar->ctrl_ep) {
@@ -468,7 +473,7 @@ enum htc_send_full_action ath6kl_tx_queue_full(struct htc_target *target,
468 473
469stop_net_queues: 474stop_net_queues:
470 spin_lock_bh(&ar->lock); 475 spin_lock_bh(&ar->lock);
471 set_bit(NETQ_STOPPED, &ar->flag); 476 set_bit(NETQ_STOPPED, &vif->flags);
472 spin_unlock_bh(&ar->lock); 477 spin_unlock_bh(&ar->lock);
473 netif_stop_queue(ar->net_dev); 478 netif_stop_queue(ar->net_dev);
474 479
@@ -524,6 +529,8 @@ void ath6kl_tx_complete(void *context, struct list_head *packet_queue)
524 enum htc_endpoint_id eid; 529 enum htc_endpoint_id eid;
525 bool wake_event = false; 530 bool wake_event = false;
526 bool flushing = false; 531 bool flushing = false;
532 /* TODO: Findout vif */
533 struct ath6kl_vif *vif = ar->vif;
527 534
528 skb_queue_head_init(&skb_queue); 535 skb_queue_head_init(&skb_queue);
529 536
@@ -597,15 +604,15 @@ void ath6kl_tx_complete(void *context, struct list_head *packet_queue)
597 604
598 ath6kl_free_cookie(ar, ath6kl_cookie); 605 ath6kl_free_cookie(ar, ath6kl_cookie);
599 606
600 if (test_bit(NETQ_STOPPED, &ar->flag)) 607 if (test_bit(NETQ_STOPPED, &vif->flags))
601 clear_bit(NETQ_STOPPED, &ar->flag); 608 clear_bit(NETQ_STOPPED, &vif->flags);
602 } 609 }
603 610
604 spin_unlock_bh(&ar->lock); 611 spin_unlock_bh(&ar->lock);
605 612
606 __skb_queue_purge(&skb_queue); 613 __skb_queue_purge(&skb_queue);
607 614
608 if (test_bit(CONNECTED, &ar->flag)) { 615 if (test_bit(CONNECTED, &vif->flags)) {
609 if (!flushing) 616 if (!flushing)
610 netif_wake_queue(ar->net_dev); 617 netif_wake_queue(ar->net_dev);
611 } 618 }