tzh
2024-08-15 d4a1bd480003f3e1a0590bc46fbcb24f05652ca7
longan/kernel/linux-4.9/drivers/net/wireless/aic8800/aic8800_fdrv/rwnx_tx.c
old mode 100644new mode 100755
....@@ -41,7 +41,9 @@
4141 } else {
4242 bool uapsd = (ps_id != LEGACY_PS_ID);
4343 rwnx_send_me_traffic_ind(rwnx_hw, sta->sta_idx, uapsd, available);
44
+#ifdef CREATE_TRACE_POINTS
4445 trace_ps_traffic_update(sta->sta_idx, available, uapsd);
46
+#endif
4547 }
4648 }
4749
....@@ -76,8 +78,9 @@
7678 struct rwnx_txq *txq;
7779
7880 if (enable) {
81
+#ifdef CREATE_TRACE_POINTS
7982 trace_ps_enable(sta);
80
-
83
+#endif
8184 spin_lock_bh(&rwnx_hw->tx_lock);
8285 sta->ps.active = true;
8386 sta->ps.sp_cnt[LEGACY_PS_ID] = 0;
....@@ -100,14 +103,15 @@
100103
101104 spin_unlock_bh(&rwnx_hw->tx_lock);
102105
103
- if (sta->ps.pkt_ready[LEGACY_PS_ID])
106
+ /*if (sta->ps.pkt_ready[LEGACY_PS_ID])
104107 rwnx_set_traffic_status(rwnx_hw, sta, true, LEGACY_PS_ID);
105108
106109 if (sta->ps.pkt_ready[UAPSD_ID])
107
- rwnx_set_traffic_status(rwnx_hw, sta, true, UAPSD_ID);
110
+ rwnx_set_traffic_status(rwnx_hw, sta, true, UAPSD_ID);*/
108111 } else {
112
+#ifdef CREATE_TRACE_POINTS
109113 trace_ps_disable(sta->sta_idx);
110
-
114
+#endif
111115 spin_lock_bh(&rwnx_hw->tx_lock);
112116 sta->ps.active = false;
113117
....@@ -125,11 +129,11 @@
125129 rwnx_txq_sta_start(sta, RWNX_TXQ_STOP_STA_PS, rwnx_hw);
126130 spin_unlock_bh(&rwnx_hw->tx_lock);
127131
128
- if (sta->ps.pkt_ready[LEGACY_PS_ID])
132
+ /*if (sta->ps.pkt_ready[LEGACY_PS_ID])
129133 rwnx_set_traffic_status(rwnx_hw, sta, false, LEGACY_PS_ID);
130134
131135 if (sta->ps.pkt_ready[UAPSD_ID])
132
- rwnx_set_traffic_status(rwnx_hw, sta, false, UAPSD_ID);
136
+ rwnx_set_traffic_status(rwnx_hw, sta, false, UAPSD_ID);*/
133137
134138 tasklet_schedule(&rwnx_hw->task);
135139 }
....@@ -168,9 +172,9 @@
168172 printk("sta %pM is not in Power Save mode", sta->mac_addr);
169173 return;
170174 }
171
-
175
+#ifdef CREATE_TRACE_POINTS
172176 trace_ps_traffic_req(sta, pkt_req, ps_id);
173
-
177
+#endif
174178 spin_lock_bh(&rwnx_hw->tx_lock);
175179
176180 /* Fw may ask to stop a service period with PS_SP_INTERRUPTED. This only
....@@ -446,9 +450,9 @@
446450 if (unlikely(sta->ps.active)) {
447451 sta->ps.pkt_ready[txq->ps_id]--;
448452 sta->ps.sp_cnt[txq->ps_id]--;
449
-
453
+#ifdef CREATE_TRACE_POINTS
450454 trace_ps_push(sta);
451
-
455
+#endif
452456 if (((txq->ps_id == UAPSD_ID) || (vif->wdev.iftype == NL80211_IFTYPE_MESH_POINT) || (sta->tdls.active))
453457 && !sta->ps.sp_cnt[txq->ps_id]) {
454458 sw_txhdr->desc.host.flags |= TXU_CNTRL_EOSP;
....@@ -578,7 +582,8 @@
578582 between queue and push (because of PS) */
579583 sw_txhdr->hw_queue = hw_queue;
580584
581
- sw_txhdr->desc.host.packet_addr = hw_queue; //use packet_addr field for hw_txq
585
+ //sw_txhdr->desc.host.packet_addr = hw_queue; //use packet_addr field for hw_txq
586
+ sw_txhdr->desc.host.ac = hw_queue; //use ac field for hw_txq
582587 #ifdef CONFIG_RWNX_MUMIMO_TX
583588 /* MU group is only selected during hwq processing */
584589 sw_txhdr->desc.host.mumimo_info = txq->mumimo_info;
....@@ -589,8 +594,9 @@
589594 /* only for AP mode */
590595 rwnx_set_more_data_flag(rwnx_hw, sw_txhdr);
591596 }
592
-
597
+#ifdef CREATE_TRACE_POINTS
593598 trace_push_desc(skb, sw_txhdr, flags);
599
+#endif
594600 #if 0
595601 txq->credits--;
596602 #endif
....@@ -607,7 +613,8 @@
607613 rwnx_ipc_txdesc_push(rwnx_hw, &sw_txhdr->desc, skb, hw_queue, user);
608614 #else
609615 #ifdef AICWF_SDIO_SUPPORT
610
- if (((sw_txhdr->desc.host.flags & TXU_CNTRL_MGMT) && ((*(skb->data+sw_txhdr->headroom) == 0xd0) || (*(skb->data+sw_txhdr->headroom) == 0x10))) || \
616
+ if (((sw_txhdr->desc.host.flags & TXU_CNTRL_MGMT) && \
617
+ ((*(skb->data+sw_txhdr->headroom) == 0xd0) || (*(skb->data+sw_txhdr->headroom) == 0x10) || (*(skb->data+sw_txhdr->headroom) == 0x30))) || \
611618 (sw_txhdr->desc.host.ethertype == 0x8e88)) {
612619 sw_txhdr->need_cfm = 1;
613620 sw_txhdr->desc.host.status_desc_addr = ((1<<31) | rwnx_hw->sdio_env.txdesc_free_idx[0]);
....@@ -624,7 +631,8 @@
624631 aicwf_frame_tx((void *)(rwnx_hw->sdiodev), skb);
625632 #endif
626633 #ifdef AICWF_USB_SUPPORT
627
- if (((sw_txhdr->desc.host.flags & TXU_CNTRL_MGMT) && ((*(skb->data+sw_txhdr->headroom) == 0xd0) || (*(skb->data+sw_txhdr->headroom) == 0x10))) || \
634
+ if (((sw_txhdr->desc.host.flags & TXU_CNTRL_MGMT) && \
635
+ ((*(skb->data+sw_txhdr->headroom) == 0xd0) || (*(skb->data+sw_txhdr->headroom) == 0x10) || (*(skb->data+sw_txhdr->headroom) == 0x30))) || \
628636 (sw_txhdr->desc.host.ethertype == 0x8e88)) {
629637 printk("push need cfm flags 0x%x\n", sw_txhdr->desc.host.flags);
630638 sw_txhdr->need_cfm = 1;
....@@ -672,12 +680,14 @@
672680
673681 if (!sw_retry) {
674682 /* update sw desc */
683
+#if 0
675684 sw_txhdr->desc.host.sn = cfm->sn;
676685 sw_txhdr->desc.host.pn[0] = cfm->pn[0];
677686 sw_txhdr->desc.host.pn[1] = cfm->pn[1];
678687 sw_txhdr->desc.host.pn[2] = cfm->pn[2];
679688 sw_txhdr->desc.host.pn[3] = cfm->pn[3];
680689 sw_txhdr->desc.host.timestamp = cfm->timestamp;
690
+#endif
681691 sw_txhdr->desc.host.flags |= TXU_CNTRL_RETRY;
682692
683693 #ifdef CONFIG_RWNX_AMSDUS_TX
....@@ -866,9 +876,6 @@
866876 amsdu->pad = AMSDU_PADDING(map_len - amsdu->pad);
867877 list_add_tail(&amsdu_txhdr->list, &amsdu->hdrs);
868878 amsdu->len += map_len;
869
-
870
- rwnx_ipc_sta_buffer(rwnx_hw, sw_txhdr->txq->sta,
871
- sw_txhdr->txq->tid, msdu_len);
872879
873880 trace_amsdu_subframe(sw_txhdr);
874881 return 0;
....@@ -1095,7 +1102,7 @@
10951102 (memcmp(desc->host.eth_dest_addr.array, rwnx_vif->sta.tdls_sta->mac_addr, ETH_ALEN) == 0)) {
10961103 desc->host.flags |= TXU_CNTRL_TDLS;
10971104 rwnx_vif->sta.tdls_sta->tdls.last_tid = desc->host.tid;
1098
- rwnx_vif->sta.tdls_sta->tdls.last_sn = desc->host.sn;
1105
+ //rwnx_vif->sta.tdls_sta->tdls.last_sn = desc->host.sn;
10991106 }
11001107
11011108 if (rwnx_vif->wdev.iftype == NL80211_IFTYPE_MESH_POINT) {
....@@ -1122,11 +1129,13 @@
11221129 /* Fill-in TX descriptor */
11231130 frame_oft = sizeof(struct rwnx_txhdr) - offsetof(struct rwnx_txhdr, hw_hdr)
11241131 + hdr_pads;// + sizeof(*eth);
1132
+#if 0
11251133 #ifdef CONFIG_RWNX_SPLIT_TX_BUF
11261134 desc->host.packet_addr[0] = sw_txhdr->dma_addr + frame_oft;
11271135 desc->host.packet_cnt = 1;
11281136 #else
11291137 desc->host.packet_addr = sw_txhdr->dma_addr + frame_oft;
1138
+#endif
11301139 #endif
11311140 desc->host.status_desc_addr = sw_txhdr->dma_addr;
11321141
....@@ -1312,11 +1321,13 @@
13121321 }
13131322
13141323 frame_oft = sizeof(struct rwnx_txhdr) - offsetof(struct rwnx_txhdr, hw_hdr);
1324
+#if 0
13151325 #ifdef CONFIG_RWNX_SPLIT_TX_BUF
13161326 desc->host.packet_addr[0] = sw_txhdr->dma_addr + frame_oft;
13171327 desc->host.packet_cnt = 1;
13181328 #else
13191329 desc->host.packet_addr = sw_txhdr->dma_addr + frame_oft;
1330
+#endif
13201331 #endif
13211332 desc->host.status_desc_addr = sw_txhdr->dma_addr;
13221333
....@@ -1344,6 +1355,7 @@
13441355 struct rwnx_sw_txhdr *sw_txhdr;
13451356 struct rwnx_hwq *hwq;
13461357 struct rwnx_txq *txq;
1358
+ int headroom;
13471359 //int peek_off = offsetof(struct rwnx_hw_txhdr, cfm);
13481360 //int peek_len = sizeof(((struct rwnx_hw_txhdr *)0)->cfm);
13491361
....@@ -1366,14 +1378,14 @@
13661378
13671379 /* Update txq and HW queue credits */
13681380 if (sw_txhdr->desc.host.flags & TXU_CNTRL_MGMT) {
1369
- trace_printk("done=%d retry_required=%d sw_retry_required=%d acknowledged=%d\n",
1381
+ printk("done=%d retry_required=%d sw_retry_required=%d acknowledged=%d\n",
13701382 rwnx_txst.tx_done, rwnx_txst.retry_required,
13711383 rwnx_txst.sw_retry_required, rwnx_txst.acknowledged);
1372
-
1384
+#ifdef CREATE_TRACE_POINTS
13731385 trace_mgmt_cfm(sw_txhdr->rwnx_vif->vif_index,
13741386 (sw_txhdr->rwnx_sta) ? sw_txhdr->rwnx_sta->sta_idx : 0xFF,
13751387 rwnx_txst.acknowledged);
1376
-
1388
+#endif
13771389 /* Confirm transmission to CFG80211 */
13781390 cfg80211_mgmt_tx_status(&sw_txhdr->rwnx_vif->wdev,
13791391 (unsigned long)skb,
....@@ -1393,9 +1405,9 @@
13931405 rwnx_tx_retry(rwnx_hw, skb, txhdr, sw_retry);
13941406 return 0;
13951407 }
1396
-
1408
+#ifdef CREATE_TRACE_POINTS
13971409 trace_skb_confirm(skb, txq, hwq, &txhdr->hw_hdr.cfm);
1398
-
1410
+#endif
13991411 /* STA may have disconnect (and txq stopped) when buffers were stored
14001412 in fw. In this case do nothing when they're returned */
14011413 if (txq->idx != TXQ_INACTIVE) {
....@@ -1433,18 +1445,14 @@
14331445 struct rwnx_amsdu_txhdr *amsdu_txhdr;
14341446 list_for_each_entry(amsdu_txhdr, &sw_txhdr->amsdu.hdrs, list) {
14351447 rwnx_amsdu_del_subframe_header(amsdu_txhdr);
1436
- rwnx_ipc_sta_buffer(rwnx_hw, txq->sta, txq->tid,
1437
- -amsdu_txhdr->msdu_len);
14381448 consume_skb(amsdu_txhdr->skb);
14391449 }
14401450 }
14411451 #endif /* CONFIG_RWNX_AMSDUS_TX */
14421452
1443
- rwnx_ipc_sta_buffer(rwnx_hw, txq->sta, txq->tid,
1444
- -sw_txhdr->frame_len);
1445
-
1453
+ headroom = sw_txhdr->headroom;
14461454 kmem_cache_free(rwnx_hw->sw_txhdr_cache, sw_txhdr);
1447
- skb_pull(skb, sw_txhdr->headroom);
1455
+ skb_pull(skb, headroom);
14481456 consume_skb(skb);
14491457
14501458 return 0;
....@@ -1473,7 +1481,9 @@
14731481
14741482 if (txq->idx != TXQ_INACTIVE) {
14751483 //txq->credits += update;
1484
+#ifdef CREATE_TRACE_POINTS
14761485 trace_credit_update(txq, update);
1486
+#endif
14771487 if (txq->credits <= 0)
14781488 rwnx_txq_stop(txq, RWNX_TXQ_STOP_FULL);
14791489 else