forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/drivers/net/wireless/ath/wil6210/txrx.c
....@@ -1,18 +1,7 @@
1
+// SPDX-License-Identifier: ISC
12 /*
23 * Copyright (c) 2012-2017 Qualcomm Atheros, Inc.
3
- * Copyright (c) 2018, The Linux Foundation. All rights reserved.
4
- *
5
- * Permission to use, copy, modify, and/or distribute this software for any
6
- * purpose with or without fee is hereby granted, provided that the above
7
- * copyright notice and this permission notice appear in all copies.
8
- *
9
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
4
+ * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
165 */
176
187 #include <linux/etherdevice.h>
....@@ -21,6 +10,7 @@
2110 #include <linux/moduleparam.h>
2211 #include <linux/ip.h>
2312 #include <linux/ipv6.h>
13
+#include <linux/if_vlan.h>
2414 #include <net/ipv6.h>
2515 #include <linux/prefetch.h>
2616
....@@ -30,11 +20,6 @@
3020 #include "trace.h"
3121 #include "txrx_edma.h"
3222
33
-static bool rtap_include_phy_info;
34
-module_param(rtap_include_phy_info, bool, 0444);
35
-MODULE_PARM_DESC(rtap_include_phy_info,
36
- " Include PHY info in the radiotap header, default - no");
37
-
3823 bool rx_align_2;
3924 module_param(rx_align_2, bool, 0444);
4025 MODULE_PARM_DESC(rx_align_2, " align Rx buffers on 4*n+2, default - no");
....@@ -42,6 +27,9 @@
4227 bool rx_large_buf;
4328 module_param(rx_large_buf, bool, 0444);
4429 MODULE_PARM_DESC(rx_large_buf, " allocate 8KB RX buffers, default - no");
30
+
31
+/* Drop Tx packets in case Tx ring is full */
32
+bool drop_if_ring_full;
4533
4634 static inline uint wil_rx_snaplen(void)
4735 {
....@@ -261,8 +249,7 @@
261249 vring->ctx = NULL;
262250 }
263251
264
-/**
265
- * Allocate one skb for Rx VRING
252
+/* Allocate one skb for Rx VRING
266253 *
267254 * Safe to call from IRQ
268255 */
....@@ -307,8 +294,7 @@
307294 return 0;
308295 }
309296
310
-/**
311
- * Adds radiotap header
297
+/* Adds radiotap header
312298 *
313299 * Any error indicated as "Bad FCS"
314300 *
....@@ -332,46 +318,10 @@
332318 u8 mcs_flags;
333319 u8 mcs_index;
334320 } __packed;
335
- struct wil6210_rtap_vendor {
336
- struct wil6210_rtap rtap;
337
- /* vendor */
338
- u8 vendor_oui[3] __aligned(2);
339
- u8 vendor_ns;
340
- __le16 vendor_skip;
341
- u8 vendor_data[0];
342
- } __packed;
343321 struct vring_rx_desc *d = wil_skb_rxdesc(skb);
344
- struct wil6210_rtap_vendor *rtap_vendor;
322
+ struct wil6210_rtap *rtap;
345323 int rtap_len = sizeof(struct wil6210_rtap);
346
- int phy_length = 0; /* phy info header size, bytes */
347
- static char phy_data[128];
348324 struct ieee80211_channel *ch = wil->monitor_chandef.chan;
349
-
350
- if (rtap_include_phy_info) {
351
- rtap_len = sizeof(*rtap_vendor) + sizeof(*d);
352
- /* calculate additional length */
353
- if (d->dma.status & RX_DMA_STATUS_PHY_INFO) {
354
- /**
355
- * PHY info starts from 8-byte boundary
356
- * there are 8-byte lines, last line may be partially
357
- * written (HW bug), thus FW configures for last line
358
- * to be excessive. Driver skips this last line.
359
- */
360
- int len = min_t(int, 8 + sizeof(phy_data),
361
- wil_rxdesc_phy_length(d));
362
-
363
- if (len > 8) {
364
- void *p = skb_tail_pointer(skb);
365
- void *pa = PTR_ALIGN(p, 8);
366
-
367
- if (skb_tailroom(skb) >= len + (pa - p)) {
368
- phy_length = len - 8;
369
- memcpy(phy_data, pa, phy_length);
370
- }
371
- }
372
- }
373
- rtap_len += phy_length;
374
- }
375325
376326 if (skb_headroom(skb) < rtap_len &&
377327 pskb_expand_head(skb, rtap_len, 0, GFP_ATOMIC)) {
....@@ -379,40 +329,23 @@
379329 return;
380330 }
381331
382
- rtap_vendor = skb_push(skb, rtap_len);
383
- memset(rtap_vendor, 0, rtap_len);
332
+ rtap = skb_push(skb, rtap_len);
333
+ memset(rtap, 0, rtap_len);
384334
385
- rtap_vendor->rtap.rthdr.it_version = PKTHDR_RADIOTAP_VERSION;
386
- rtap_vendor->rtap.rthdr.it_len = cpu_to_le16(rtap_len);
387
- rtap_vendor->rtap.rthdr.it_present = cpu_to_le32(
388
- (1 << IEEE80211_RADIOTAP_FLAGS) |
335
+ rtap->rthdr.it_version = PKTHDR_RADIOTAP_VERSION;
336
+ rtap->rthdr.it_len = cpu_to_le16(rtap_len);
337
+ rtap->rthdr.it_present = cpu_to_le32((1 << IEEE80211_RADIOTAP_FLAGS) |
389338 (1 << IEEE80211_RADIOTAP_CHANNEL) |
390339 (1 << IEEE80211_RADIOTAP_MCS));
391340 if (d->dma.status & RX_DMA_STATUS_ERROR)
392
- rtap_vendor->rtap.flags |= IEEE80211_RADIOTAP_F_BADFCS;
341
+ rtap->flags |= IEEE80211_RADIOTAP_F_BADFCS;
393342
394
- rtap_vendor->rtap.chnl_freq = cpu_to_le16(ch ? ch->center_freq : 58320);
395
- rtap_vendor->rtap.chnl_flags = cpu_to_le16(0);
343
+ rtap->chnl_freq = cpu_to_le16(ch ? ch->center_freq : 58320);
344
+ rtap->chnl_flags = cpu_to_le16(0);
396345
397
- rtap_vendor->rtap.mcs_present = IEEE80211_RADIOTAP_MCS_HAVE_MCS;
398
- rtap_vendor->rtap.mcs_flags = 0;
399
- rtap_vendor->rtap.mcs_index = wil_rxdesc_mcs(d);
400
-
401
- if (rtap_include_phy_info) {
402
- rtap_vendor->rtap.rthdr.it_present |= cpu_to_le32(1 <<
403
- IEEE80211_RADIOTAP_VENDOR_NAMESPACE);
404
- /* OUI for Wilocity 04:ce:14 */
405
- rtap_vendor->vendor_oui[0] = 0x04;
406
- rtap_vendor->vendor_oui[1] = 0xce;
407
- rtap_vendor->vendor_oui[2] = 0x14;
408
- rtap_vendor->vendor_ns = 1;
409
- /* Rx descriptor + PHY data */
410
- rtap_vendor->vendor_skip = cpu_to_le16(sizeof(*d) +
411
- phy_length);
412
- memcpy(rtap_vendor->vendor_data, (void *)d, sizeof(*d));
413
- memcpy(rtap_vendor->vendor_data + sizeof(*d), phy_data,
414
- phy_length);
415
- }
346
+ rtap->mcs_present = IEEE80211_RADIOTAP_MCS_HAVE_MCS;
347
+ rtap->mcs_flags = 0;
348
+ rtap->mcs_index = wil_rxdesc_mcs(d);
416349 }
417350
418351 static bool wil_is_rx_idle(struct wil6210_priv *wil)
....@@ -427,8 +360,77 @@
427360 return true;
428361 }
429362
430
-/**
431
- * reap 1 frame from @swhead
363
+static int wil_rx_get_cid_by_skb(struct wil6210_priv *wil, struct sk_buff *skb)
364
+{
365
+ struct vring_rx_desc *d = wil_skb_rxdesc(skb);
366
+ int mid = wil_rxdesc_mid(d);
367
+ struct wil6210_vif *vif = wil->vifs[mid];
368
+ /* cid from DMA descriptor is limited to 3 bits.
369
+ * In case of cid>=8, the value would be cid modulo 8 and we need to
370
+ * find real cid by locating the transmitter (ta) inside sta array
371
+ */
372
+ int cid = wil_rxdesc_cid(d);
373
+ unsigned int snaplen = wil_rx_snaplen();
374
+ struct ieee80211_hdr_3addr *hdr;
375
+ int i;
376
+ unsigned char *ta;
377
+ u8 ftype;
378
+
379
+ /* in monitor mode there are no connections */
380
+ if (vif->wdev.iftype == NL80211_IFTYPE_MONITOR)
381
+ return cid;
382
+
383
+ ftype = wil_rxdesc_ftype(d) << 2;
384
+ if (likely(ftype == IEEE80211_FTYPE_DATA)) {
385
+ if (unlikely(skb->len < ETH_HLEN + snaplen)) {
386
+ wil_err_ratelimited(wil,
387
+ "Short data frame, len = %d\n",
388
+ skb->len);
389
+ return -ENOENT;
390
+ }
391
+ ta = wil_skb_get_sa(skb);
392
+ } else {
393
+ if (unlikely(skb->len < sizeof(struct ieee80211_hdr_3addr))) {
394
+ wil_err_ratelimited(wil, "Short frame, len = %d\n",
395
+ skb->len);
396
+ return -ENOENT;
397
+ }
398
+ hdr = (void *)skb->data;
399
+ ta = hdr->addr2;
400
+ }
401
+
402
+ if (wil->max_assoc_sta <= WIL6210_RX_DESC_MAX_CID)
403
+ return cid;
404
+
405
+ /* assuming no concurrency between AP interfaces and STA interfaces.
406
+ * multista is used only in P2P_GO or AP mode. In other modes return
407
+ * cid from the rx descriptor
408
+ */
409
+ if (vif->wdev.iftype != NL80211_IFTYPE_P2P_GO &&
410
+ vif->wdev.iftype != NL80211_IFTYPE_AP)
411
+ return cid;
412
+
413
+ /* For Rx packets cid from rx descriptor is limited to 3 bits (0..7),
414
+ * to find the real cid, compare transmitter address with the stored
415
+ * stations mac address in the driver sta array
416
+ */
417
+ for (i = cid; i < wil->max_assoc_sta; i += WIL6210_RX_DESC_MAX_CID) {
418
+ if (wil->sta[i].status != wil_sta_unused &&
419
+ ether_addr_equal(wil->sta[i].addr, ta)) {
420
+ cid = i;
421
+ break;
422
+ }
423
+ }
424
+ if (i >= wil->max_assoc_sta) {
425
+ wil_err_ratelimited(wil, "Could not find cid for frame with transmit addr = %pM, iftype = %d, frametype = %d, len = %d\n",
426
+ ta, vif->wdev.iftype, ftype, skb->len);
427
+ cid = -ENOENT;
428
+ }
429
+
430
+ return cid;
431
+}
432
+
433
+/* reap 1 frame from @swhead
432434 *
433435 * Rx descriptor copied to skb->cb
434436 *
....@@ -452,7 +454,7 @@
452454 int i;
453455 struct wil_net_stats *stats;
454456
455
- BUILD_BUG_ON(sizeof(struct vring_rx_desc) > sizeof(skb->cb));
457
+ BUILD_BUG_ON(sizeof(struct skb_rx_info) > sizeof(skb->cb));
456458
457459 again:
458460 if (unlikely(wil_ring_is_empty(vring)))
....@@ -484,7 +486,6 @@
484486 wil_hex_dump_txrx("RxD ", DUMP_PREFIX_NONE, 32, 4,
485487 (const void *)d, sizeof(*d), false);
486488
487
- cid = wil_rxdesc_cid(d);
488489 mid = wil_rxdesc_mid(d);
489490 vif = wil->vifs[mid];
490491
....@@ -495,11 +496,9 @@
495496 goto again;
496497 }
497498 ndev = vif_to_ndev(vif);
498
- stats = &wil->sta[cid].stats;
499
-
500499 if (unlikely(dmalen > sz)) {
501
- wil_err(wil, "Rx size too large: %d bytes!\n", dmalen);
502
- stats->rx_large_frame++;
500
+ wil_err_ratelimited(wil, "Rx size too large: %d bytes!\n",
501
+ dmalen);
503502 kfree_skb(skb);
504503 goto again;
505504 }
....@@ -509,6 +508,14 @@
509508
510509 wil_hex_dump_txrx("Rx ", DUMP_PREFIX_OFFSET, 16, 1,
511510 skb->data, skb_headlen(skb), false);
511
+
512
+ cid = wil_rx_get_cid_by_skb(wil, skb);
513
+ if (cid == -ENOENT) {
514
+ kfree_skb(skb);
515
+ goto again;
516
+ }
517
+ wil_skb_set_cid(skb, (u8)cid);
518
+ stats = &wil->sta[cid].stats;
512519
513520 stats->last_mcs_rx = wil_rxdesc_mcs(d);
514521 if (stats->last_mcs_rx < ARRAY_SIZE(stats->rx_per_mcs))
....@@ -556,13 +563,6 @@
556563 goto again;
557564 }
558565
559
- if (unlikely(skb->len < ETH_HLEN + snaplen)) {
560
- wil_err(wil, "Short frame, len = %d\n", skb->len);
561
- stats->rx_short_frame++;
562
- kfree_skb(skb);
563
- goto again;
564
- }
565
-
566566 /* L4 IDENT is on when HW calculated checksum, check status
567567 * and in case of error drop the packet
568568 * higher stack layers will handle retransmission (if required)
....@@ -594,8 +594,7 @@
594594 return skb;
595595 }
596596
597
-/**
598
- * allocate and fill up to @count buffers in rx ring
597
+/* allocate and fill up to @count buffers in rx ring
599598 * buffers posted at @swtail
600599 * Note: we have a single RX queue for servicing all VIFs, but we
601600 * allocate skbs with headroom according to main interface only. This
....@@ -659,7 +658,7 @@
659658 static int wil_rx_crypto_check(struct wil6210_priv *wil, struct sk_buff *skb)
660659 {
661660 struct vring_rx_desc *d = wil_skb_rxdesc(skb);
662
- int cid = wil_rxdesc_cid(d);
661
+ int cid = wil_skb_get_cid(skb);
663662 int tid = wil_rxdesc_tid(d);
664663 int key_id = wil_rxdesc_key_id(d);
665664 int mc = wil_rxdesc_mcast(d);
....@@ -667,7 +666,7 @@
667666 struct wil_tid_crypto_rx *c = mc ? &s->group_crypto_rx :
668667 &s->tid_crypto_rx[tid];
669668 struct wil_tid_crypto_rx_single *cc = &c->key_id[key_id];
670
- const u8 *pn = (u8 *)&d->mac.pn_15_0;
669
+ const u8 *pn = (u8 *)&d->mac.pn;
671670
672671 if (!cc->key_set) {
673672 wil_err_ratelimited(wil,
....@@ -707,72 +706,213 @@
707706 {
708707 struct vring_rx_desc *d = wil_skb_rxdesc(skb);
709708
710
- *cid = wil_rxdesc_cid(d); /* always 0..7, no need to check */
709
+ *cid = wil_skb_get_cid(skb);
711710 *security = wil_rxdesc_security(d);
711
+}
712
+
713
+/*
714
+ * Check if skb is ptk eapol key message
715
+ *
716
+ * returns a pointer to the start of the eapol key structure, NULL
717
+ * if frame is not PTK eapol key
718
+ */
719
+static struct wil_eapol_key *wil_is_ptk_eapol_key(struct wil6210_priv *wil,
720
+ struct sk_buff *skb)
721
+{
722
+ u8 *buf;
723
+ const struct wil_1x_hdr *hdr;
724
+ struct wil_eapol_key *key;
725
+ u16 key_info;
726
+ int len = skb->len;
727
+
728
+ if (!skb_mac_header_was_set(skb)) {
729
+ wil_err(wil, "mac header was not set\n");
730
+ return NULL;
731
+ }
732
+
733
+ len -= skb_mac_offset(skb);
734
+
735
+ if (len < sizeof(struct ethhdr) + sizeof(struct wil_1x_hdr) +
736
+ sizeof(struct wil_eapol_key))
737
+ return NULL;
738
+
739
+ buf = skb_mac_header(skb) + sizeof(struct ethhdr);
740
+
741
+ hdr = (const struct wil_1x_hdr *)buf;
742
+ if (hdr->type != WIL_1X_TYPE_EAPOL_KEY)
743
+ return NULL;
744
+
745
+ key = (struct wil_eapol_key *)(buf + sizeof(struct wil_1x_hdr));
746
+ if (key->type != WIL_EAPOL_KEY_TYPE_WPA &&
747
+ key->type != WIL_EAPOL_KEY_TYPE_RSN)
748
+ return NULL;
749
+
750
+ key_info = be16_to_cpu(key->key_info);
751
+ if (!(key_info & WIL_KEY_INFO_KEY_TYPE)) /* check if pairwise */
752
+ return NULL;
753
+
754
+ return key;
755
+}
756
+
757
+static bool wil_skb_is_eap_3(struct wil6210_priv *wil, struct sk_buff *skb)
758
+{
759
+ struct wil_eapol_key *key;
760
+ u16 key_info;
761
+
762
+ key = wil_is_ptk_eapol_key(wil, skb);
763
+ if (!key)
764
+ return false;
765
+
766
+ key_info = be16_to_cpu(key->key_info);
767
+ if (key_info & (WIL_KEY_INFO_MIC |
768
+ WIL_KEY_INFO_ENCR_KEY_DATA)) {
769
+ /* 3/4 of 4-Way Handshake */
770
+ wil_dbg_misc(wil, "EAPOL key message 3\n");
771
+ return true;
772
+ }
773
+ /* 1/4 of 4-Way Handshake */
774
+ wil_dbg_misc(wil, "EAPOL key message 1\n");
775
+
776
+ return false;
777
+}
778
+
779
+static bool wil_skb_is_eap_4(struct wil6210_priv *wil, struct sk_buff *skb)
780
+{
781
+ struct wil_eapol_key *key;
782
+ u32 *nonce, i;
783
+
784
+ key = wil_is_ptk_eapol_key(wil, skb);
785
+ if (!key)
786
+ return false;
787
+
788
+ nonce = (u32 *)key->key_nonce;
789
+ for (i = 0; i < WIL_EAP_NONCE_LEN / sizeof(u32); i++, nonce++) {
790
+ if (*nonce != 0) {
791
+ /* message 2/4 */
792
+ wil_dbg_misc(wil, "EAPOL key message 2\n");
793
+ return false;
794
+ }
795
+ }
796
+ wil_dbg_misc(wil, "EAPOL key message 4\n");
797
+
798
+ return true;
799
+}
800
+
801
+void wil_enable_tx_key_worker(struct work_struct *work)
802
+{
803
+ struct wil6210_vif *vif = container_of(work,
804
+ struct wil6210_vif, enable_tx_key_worker);
805
+ struct wil6210_priv *wil = vif_to_wil(vif);
806
+ int rc, cid;
807
+
808
+ rtnl_lock();
809
+ if (vif->ptk_rekey_state != WIL_REKEY_WAIT_M4_SENT) {
810
+ wil_dbg_misc(wil, "Invalid rekey state = %d\n",
811
+ vif->ptk_rekey_state);
812
+ rtnl_unlock();
813
+ return;
814
+ }
815
+
816
+ cid = wil_find_cid_by_idx(wil, vif->mid, 0);
817
+ if (!wil_cid_valid(wil, cid)) {
818
+ wil_err(wil, "Invalid cid = %d\n", cid);
819
+ rtnl_unlock();
820
+ return;
821
+ }
822
+
823
+ wil_dbg_misc(wil, "Apply PTK key after eapol was sent out\n");
824
+ rc = wmi_add_cipher_key(vif, 0, wil->sta[cid].addr, 0, NULL,
825
+ WMI_KEY_USE_APPLY_PTK);
826
+
827
+ vif->ptk_rekey_state = WIL_REKEY_IDLE;
828
+ rtnl_unlock();
829
+
830
+ if (rc)
831
+ wil_err(wil, "Apply PTK key failed %d\n", rc);
832
+}
833
+
834
+void wil_tx_complete_handle_eapol(struct wil6210_vif *vif, struct sk_buff *skb)
835
+{
836
+ struct wil6210_priv *wil = vif_to_wil(vif);
837
+ struct wireless_dev *wdev = vif_to_wdev(vif);
838
+ bool q = false;
839
+
840
+ if (wdev->iftype != NL80211_IFTYPE_STATION ||
841
+ !test_bit(WMI_FW_CAPABILITY_SPLIT_REKEY, wil->fw_capabilities))
842
+ return;
843
+
844
+ /* check if skb is an EAP message 4/4 */
845
+ if (!wil_skb_is_eap_4(wil, skb))
846
+ return;
847
+
848
+ spin_lock_bh(&wil->eap_lock);
849
+ switch (vif->ptk_rekey_state) {
850
+ case WIL_REKEY_IDLE:
851
+ /* ignore idle state, can happen due to M4 retransmission */
852
+ break;
853
+ case WIL_REKEY_M3_RECEIVED:
854
+ vif->ptk_rekey_state = WIL_REKEY_IDLE;
855
+ break;
856
+ case WIL_REKEY_WAIT_M4_SENT:
857
+ q = true;
858
+ break;
859
+ default:
860
+ wil_err(wil, "Unknown rekey state = %d",
861
+ vif->ptk_rekey_state);
862
+ }
863
+ spin_unlock_bh(&wil->eap_lock);
864
+
865
+ if (q) {
866
+ q = queue_work(wil->wmi_wq, &vif->enable_tx_key_worker);
867
+ wil_dbg_misc(wil, "queue_work of enable_tx_key_worker -> %d\n",
868
+ q);
869
+ }
870
+}
871
+
872
+static void wil_rx_handle_eapol(struct wil6210_vif *vif, struct sk_buff *skb)
873
+{
874
+ struct wil6210_priv *wil = vif_to_wil(vif);
875
+ struct wireless_dev *wdev = vif_to_wdev(vif);
876
+
877
+ if (wdev->iftype != NL80211_IFTYPE_STATION ||
878
+ !test_bit(WMI_FW_CAPABILITY_SPLIT_REKEY, wil->fw_capabilities))
879
+ return;
880
+
881
+ /* check if skb is a EAP message 3/4 */
882
+ if (!wil_skb_is_eap_3(wil, skb))
883
+ return;
884
+
885
+ if (vif->ptk_rekey_state == WIL_REKEY_IDLE)
886
+ vif->ptk_rekey_state = WIL_REKEY_M3_RECEIVED;
712887 }
713888
714889 /*
715890 * Pass Rx packet to the netif. Update statistics.
716891 * Called in softirq context (NAPI poll).
717892 */
718
-void wil_netif_rx_any(struct sk_buff *skb, struct net_device *ndev)
893
+void wil_netif_rx(struct sk_buff *skb, struct net_device *ndev, int cid,
894
+ struct wil_net_stats *stats, bool gro)
719895 {
720
- gro_result_t rc = GRO_NORMAL;
721896 struct wil6210_vif *vif = ndev_to_vif(ndev);
722897 struct wil6210_priv *wil = ndev_to_wil(ndev);
723898 struct wireless_dev *wdev = vif_to_wdev(vif);
724899 unsigned int len = skb->len;
725
- int cid;
726
- int security;
727
- struct ethhdr *eth = (void *)skb->data;
900
+ u8 *sa, *da = wil_skb_get_da(skb);
728901 /* here looking for DA, not A1, thus Rxdesc's 'mcast' indication
729902 * is not suitable, need to look at data
730903 */
731
- int mcast = is_multicast_ether_addr(eth->h_dest);
732
- struct wil_net_stats *stats;
904
+ int mcast = is_multicast_ether_addr(da);
733905 struct sk_buff *xmit_skb = NULL;
734
- static const char * const gro_res_str[] = {
735
- [GRO_MERGED] = "GRO_MERGED",
736
- [GRO_MERGED_FREE] = "GRO_MERGED_FREE",
737
- [GRO_HELD] = "GRO_HELD",
738
- [GRO_NORMAL] = "GRO_NORMAL",
739
- [GRO_DROP] = "GRO_DROP",
740
- [GRO_CONSUMED] = "GRO_CONSUMED",
741
- };
742
-
743
- wil->txrx_ops.get_netif_rx_params(skb, &cid, &security);
744
-
745
- stats = &wil->sta[cid].stats;
746
-
747
- if (ndev->features & NETIF_F_RXHASH)
748
- /* fake L4 to ensure it won't be re-calculated later
749
- * set hash to any non-zero value to activate rps
750
- * mechanism, core will be chosen according
751
- * to user-level rps configuration.
752
- */
753
- skb_set_hash(skb, 1, PKT_HASH_TYPE_L4);
754
-
755
- skb_orphan(skb);
756
-
757
- if (security && (wil->txrx_ops.rx_crypto_check(wil, skb) != 0)) {
758
- rc = GRO_DROP;
759
- dev_kfree_skb(skb);
760
- stats->rx_replay++;
761
- goto stats;
762
- }
763
-
764
- /* check errors reported by HW and update statistics */
765
- if (unlikely(wil->txrx_ops.rx_error_check(wil, skb, stats))) {
766
- dev_kfree_skb(skb);
767
- return;
768
- }
769906
770907 if (wdev->iftype == NL80211_IFTYPE_STATION) {
771
- if (mcast && ether_addr_equal(eth->h_source, ndev->dev_addr)) {
908
+ sa = wil_skb_get_sa(skb);
909
+ if (mcast && ether_addr_equal(sa, ndev->dev_addr)) {
772910 /* mcast packet looped back to us */
773
- rc = GRO_DROP;
774911 dev_kfree_skb(skb);
775
- goto stats;
912
+ ndev->stats.rx_dropped++;
913
+ stats->rx_dropped++;
914
+ wil_dbg_txrx(wil, "Rx drop %d bytes\n", len);
915
+ return;
776916 }
777917 } else if (wdev->iftype == NL80211_IFTYPE_AP && !vif->ap_isolate) {
778918 if (mcast) {
....@@ -781,8 +921,7 @@
781921 */
782922 xmit_skb = skb_copy(skb, GFP_ATOMIC);
783923 } else {
784
- int xmit_cid = wil_find_cid(wil, vif->mid,
785
- eth->h_dest);
924
+ int xmit_cid = wil_find_cid(wil, vif->mid, da);
786925
787926 if (xmit_cid >= 0) {
788927 /* The destination station is associated to
....@@ -812,28 +951,54 @@
812951 if (skb) { /* deliver to local stack */
813952 skb->protocol = eth_type_trans(skb, ndev);
814953 skb->dev = ndev;
815
- rc = napi_gro_receive(&wil->napi_rx, skb);
816
- wil_dbg_txrx(wil, "Rx complete %d bytes => %s\n",
817
- len, gro_res_str[rc]);
954
+
955
+ if (skb->protocol == cpu_to_be16(ETH_P_PAE))
956
+ wil_rx_handle_eapol(vif, skb);
957
+
958
+ if (gro)
959
+ napi_gro_receive(&wil->napi_rx, skb);
960
+ else
961
+ netif_rx_ni(skb);
818962 }
819
-stats:
820
- /* statistics. rc set to GRO_NORMAL for AP bridging */
821
- if (unlikely(rc == GRO_DROP)) {
822
- ndev->stats.rx_dropped++;
823
- stats->rx_dropped++;
824
- wil_dbg_txrx(wil, "Rx drop %d bytes\n", len);
825
- } else {
826
- ndev->stats.rx_packets++;
827
- stats->rx_packets++;
828
- ndev->stats.rx_bytes += len;
829
- stats->rx_bytes += len;
830
- if (mcast)
831
- ndev->stats.multicast++;
832
- }
963
+ ndev->stats.rx_packets++;
964
+ stats->rx_packets++;
965
+ ndev->stats.rx_bytes += len;
966
+ stats->rx_bytes += len;
967
+ if (mcast)
968
+ ndev->stats.multicast++;
833969 }
834970
835
-/**
836
- * Proceed all completed skb's from Rx VRING
971
+void wil_netif_rx_any(struct sk_buff *skb, struct net_device *ndev)
972
+{
973
+ int cid, security;
974
+ struct wil6210_priv *wil = ndev_to_wil(ndev);
975
+ struct wil_net_stats *stats;
976
+
977
+ wil->txrx_ops.get_netif_rx_params(skb, &cid, &security);
978
+
979
+ stats = &wil->sta[cid].stats;
980
+
981
+ skb_orphan(skb);
982
+
983
+ if (security && (wil->txrx_ops.rx_crypto_check(wil, skb) != 0)) {
984
+ wil_dbg_txrx(wil, "Rx drop %d bytes\n", skb->len);
985
+ dev_kfree_skb(skb);
986
+ ndev->stats.rx_dropped++;
987
+ stats->rx_replay++;
988
+ stats->rx_dropped++;
989
+ return;
990
+ }
991
+
992
+ /* check errors reported by HW and update statistics */
993
+ if (unlikely(wil->txrx_ops.rx_error_check(wil, skb, stats))) {
994
+ dev_kfree_skb(skb);
995
+ return;
996
+ }
997
+
998
+ wil_netif_rx(skb, ndev, cid, stats, true);
999
+}
1000
+
1001
+/* Proceed all completed skb's from Rx VRING
8371002 *
8381003 * Safe to call from NAPI poll, i.e. softirq with interrupts enabled
8391004 */
....@@ -953,7 +1118,7 @@
9531118 void wil_tx_data_init(struct wil_ring_tx_data *txdata)
9541119 {
9551120 spin_lock_bh(&txdata->lock);
956
- txdata->dot1x_open = 0;
1121
+ txdata->dot1x_open = false;
9571122 txdata->enabled = 0;
9581123 txdata->idle = 0;
9591124 txdata->last_idle = 0;
....@@ -980,7 +1145,6 @@
9801145 .ring_size = cpu_to_le16(size),
9811146 },
9821147 .ringid = id,
983
- .cidxtid = mk_cidxtid(cid, tid),
9841148 .encap_trans_type = WMI_VRING_ENC_TYPE_802_3,
9851149 .mac_ctrl = 0,
9861150 .to_resolution = 0,
....@@ -999,6 +1163,14 @@
9991163 };
10001164 struct wil_ring *vring = &wil->ring_tx[id];
10011165 struct wil_ring_tx_data *txdata = &wil->ring_tx_data[id];
1166
+
1167
+ if (cid >= WIL6210_RX_DESC_MAX_CID) {
1168
+ cmd.vring_cfg.cidxtid = CIDXTID_EXTENDED_CID_TID;
1169
+ cmd.vring_cfg.cid = cid;
1170
+ cmd.vring_cfg.tid = tid;
1171
+ } else {
1172
+ cmd.vring_cfg.cidxtid = mk_cidxtid(cid, tid);
1173
+ }
10021174
10031175 wil_dbg_misc(wil, "vring_init_tx: max_mpdu_size %d\n",
10041176 cmd.vring_cfg.tx_sw_ring.max_mpdu_size);
....@@ -1025,7 +1197,8 @@
10251197 if (!vif->privacy)
10261198 txdata->dot1x_open = true;
10271199 rc = wmi_call(wil, WMI_VRING_CFG_CMDID, vif->mid, &cmd, sizeof(cmd),
1028
- WMI_VRING_CFG_DONE_EVENTID, &reply, sizeof(reply), 100);
1200
+ WMI_VRING_CFG_DONE_EVENTID, &reply, sizeof(reply),
1201
+ WIL_WMI_CALL_GENERAL_TO_MS);
10291202 if (rc)
10301203 goto out_free;
10311204
....@@ -1052,11 +1225,94 @@
10521225 txdata->enabled = 0;
10531226 spin_unlock_bh(&txdata->lock);
10541227 wil_vring_free(wil, vring);
1055
- wil->ring2cid_tid[id][0] = WIL6210_MAX_CID;
1228
+ wil->ring2cid_tid[id][0] = wil->max_assoc_sta;
10561229 wil->ring2cid_tid[id][1] = 0;
10571230
10581231 out:
10591232
1233
+ return rc;
1234
+}
1235
+
1236
+static int wil_tx_vring_modify(struct wil6210_vif *vif, int ring_id, int cid,
1237
+ int tid)
1238
+{
1239
+ struct wil6210_priv *wil = vif_to_wil(vif);
1240
+ int rc;
1241
+ struct wmi_vring_cfg_cmd cmd = {
1242
+ .action = cpu_to_le32(WMI_VRING_CMD_MODIFY),
1243
+ .vring_cfg = {
1244
+ .tx_sw_ring = {
1245
+ .max_mpdu_size =
1246
+ cpu_to_le16(wil_mtu2macbuf(mtu_max)),
1247
+ .ring_size = 0,
1248
+ },
1249
+ .ringid = ring_id,
1250
+ .cidxtid = mk_cidxtid(cid, tid),
1251
+ .encap_trans_type = WMI_VRING_ENC_TYPE_802_3,
1252
+ .mac_ctrl = 0,
1253
+ .to_resolution = 0,
1254
+ .agg_max_wsize = 0,
1255
+ .schd_params = {
1256
+ .priority = cpu_to_le16(0),
1257
+ .timeslot_us = cpu_to_le16(0xfff),
1258
+ },
1259
+ },
1260
+ };
1261
+ struct {
1262
+ struct wmi_cmd_hdr wmi;
1263
+ struct wmi_vring_cfg_done_event cmd;
1264
+ } __packed reply = {
1265
+ .cmd = {.status = WMI_FW_STATUS_FAILURE},
1266
+ };
1267
+ struct wil_ring *vring = &wil->ring_tx[ring_id];
1268
+ struct wil_ring_tx_data *txdata = &wil->ring_tx_data[ring_id];
1269
+
1270
+ wil_dbg_misc(wil, "vring_modify: ring %d cid %d tid %d\n", ring_id,
1271
+ cid, tid);
1272
+ lockdep_assert_held(&wil->mutex);
1273
+
1274
+ if (!vring->va) {
1275
+ wil_err(wil, "Tx ring [%d] not allocated\n", ring_id);
1276
+ return -EINVAL;
1277
+ }
1278
+
1279
+ if (wil->ring2cid_tid[ring_id][0] != cid ||
1280
+ wil->ring2cid_tid[ring_id][1] != tid) {
1281
+ wil_err(wil, "ring info does not match cid=%u tid=%u\n",
1282
+ wil->ring2cid_tid[ring_id][0],
1283
+ wil->ring2cid_tid[ring_id][1]);
1284
+ }
1285
+
1286
+ cmd.vring_cfg.tx_sw_ring.ring_mem_base = cpu_to_le64(vring->pa);
1287
+
1288
+ rc = wmi_call(wil, WMI_VRING_CFG_CMDID, vif->mid, &cmd, sizeof(cmd),
1289
+ WMI_VRING_CFG_DONE_EVENTID, &reply, sizeof(reply),
1290
+ WIL_WMI_CALL_GENERAL_TO_MS);
1291
+ if (rc)
1292
+ goto fail;
1293
+
1294
+ if (reply.cmd.status != WMI_FW_STATUS_SUCCESS) {
1295
+ wil_err(wil, "Tx modify failed, status 0x%02x\n",
1296
+ reply.cmd.status);
1297
+ rc = -EINVAL;
1298
+ goto fail;
1299
+ }
1300
+
1301
+ /* set BA aggregation window size to 0 to force a new BA with the
1302
+ * new AP
1303
+ */
1304
+ txdata->agg_wsize = 0;
1305
+ if (txdata->dot1x_open && agg_wsize >= 0)
1306
+ wil_addba_tx_request(wil, ring_id, agg_wsize);
1307
+
1308
+ return 0;
1309
+fail:
1310
+ spin_lock_bh(&txdata->lock);
1311
+ txdata->dot1x_open = false;
1312
+ txdata->enabled = 0;
1313
+ spin_unlock_bh(&txdata->lock);
1314
+ wil->ring2cid_tid[ring_id][0] = wil->max_assoc_sta;
1315
+ wil->ring2cid_tid[ring_id][1] = 0;
10601316 return rc;
10611317 }
10621318
....@@ -1102,7 +1358,7 @@
11021358 if (rc)
11031359 goto out;
11041360
1105
- wil->ring2cid_tid[id][0] = WIL6210_MAX_CID; /* CID */
1361
+ wil->ring2cid_tid[id][0] = wil->max_assoc_sta; /* CID */
11061362 wil->ring2cid_tid[id][1] = 0; /* TID */
11071363
11081364 cmd.vring_cfg.tx_sw_ring.ring_mem_base = cpu_to_le64(vring->pa);
....@@ -1111,7 +1367,8 @@
11111367 txdata->dot1x_open = true;
11121368 rc = wmi_call(wil, WMI_BCAST_VRING_CFG_CMDID, vif->mid,
11131369 &cmd, sizeof(cmd),
1114
- WMI_VRING_CFG_DONE_EVENTID, &reply, sizeof(reply), 100);
1370
+ WMI_VRING_CFG_DONE_EVENTID, &reply, sizeof(reply),
1371
+ WIL_WMI_CALL_GENERAL_TO_MS);
11151372 if (rc)
11161373 goto out_free;
11171374
....@@ -1144,12 +1401,13 @@
11441401 struct wil6210_vif *vif,
11451402 struct sk_buff *skb)
11461403 {
1147
- int i;
1148
- struct ethhdr *eth = (void *)skb->data;
1149
- int cid = wil_find_cid(wil, vif->mid, eth->h_dest);
1404
+ int i, cid;
1405
+ const u8 *da = wil_skb_get_da(skb);
11501406 int min_ring_id = wil_get_min_tx_ring_id(wil);
11511407
1152
- if (cid < 0)
1408
+ cid = wil_find_cid(wil, vif->mid, da);
1409
+
1410
+ if (cid < 0 || cid >= wil->max_assoc_sta)
11531411 return NULL;
11541412
11551413 /* TODO: fix for multiple TID */
....@@ -1162,7 +1420,7 @@
11621420 struct wil_ring_tx_data *txdata = &wil->ring_tx_data[i];
11631421
11641422 wil_dbg_txrx(wil, "find_tx_ucast: (%pM) -> [%d]\n",
1165
- eth->h_dest, i);
1423
+ da, i);
11661424 if (v->va && txdata->enabled) {
11671425 return v;
11681426 } else {
....@@ -1201,7 +1459,7 @@
12011459 continue;
12021460
12031461 cid = wil->ring2cid_tid[i][0];
1204
- if (cid >= WIL6210_MAX_CID) /* skip BCAST */
1462
+ if (cid >= wil->max_assoc_sta) /* skip BCAST */
12051463 continue;
12061464
12071465 if (!wil->ring_tx_data[i].dot1x_open &&
....@@ -1250,13 +1508,42 @@
12501508 return v;
12511509 }
12521510
1511
+/* apply multicast to unicast only for ARP and IP packets
1512
+ * (see NL80211_CMD_SET_MULTICAST_TO_UNICAST for more info)
1513
+ */
1514
+static bool wil_check_multicast_to_unicast(struct wil6210_priv *wil,
1515
+ struct sk_buff *skb)
1516
+{
1517
+ const struct ethhdr *eth = (void *)skb->data;
1518
+ const struct vlan_ethhdr *ethvlan = (void *)skb->data;
1519
+ __be16 ethertype;
1520
+
1521
+ if (!wil->multicast_to_unicast)
1522
+ return false;
1523
+
1524
+ /* multicast to unicast conversion only for some payload */
1525
+ ethertype = eth->h_proto;
1526
+ if (ethertype == htons(ETH_P_8021Q) && skb->len >= VLAN_ETH_HLEN)
1527
+ ethertype = ethvlan->h_vlan_encapsulated_proto;
1528
+ switch (ethertype) {
1529
+ case htons(ETH_P_ARP):
1530
+ case htons(ETH_P_IP):
1531
+ case htons(ETH_P_IPV6):
1532
+ break;
1533
+ default:
1534
+ return false;
1535
+ }
1536
+
1537
+ return true;
1538
+}
1539
+
12531540 static void wil_set_da_for_vring(struct wil6210_priv *wil,
12541541 struct sk_buff *skb, int vring_index)
12551542 {
1256
- struct ethhdr *eth = (void *)skb->data;
1543
+ u8 *da = wil_skb_get_da(skb);
12571544 int cid = wil->ring2cid_tid[vring_index][0];
12581545
1259
- ether_addr_copy(eth->h_dest, wil->sta[cid].addr);
1546
+ ether_addr_copy(da, wil->sta[cid].addr);
12601547 }
12611548
12621549 static struct wil_ring *wil_find_tx_bcast_2(struct wil6210_priv *wil,
....@@ -1267,8 +1554,7 @@
12671554 struct sk_buff *skb2;
12681555 int i;
12691556 u8 cid;
1270
- struct ethhdr *eth = (void *)skb->data;
1271
- char *src = eth->h_source;
1557
+ const u8 *src = wil_skb_get_sa(skb);
12721558 struct wil_ring_tx_data *txdata, *txdata2;
12731559 int min_ring_id = wil_get_min_tx_ring_id(wil);
12741560
....@@ -1280,7 +1566,7 @@
12801566 continue;
12811567
12821568 cid = wil->ring2cid_tid[i][0];
1283
- if (cid >= WIL6210_MAX_CID) /* skip BCAST */
1569
+ if (cid >= wil->max_assoc_sta) /* skip BCAST */
12841570 continue;
12851571 if (!wil->ring_tx_data[i].dot1x_open &&
12861572 skb->protocol != cpu_to_be16(ETH_P_PAE))
....@@ -1308,7 +1594,7 @@
13081594 if (!v2->va || txdata2->mid != vif->mid)
13091595 continue;
13101596 cid = wil->ring2cid_tid[i][0];
1311
- if (cid >= WIL6210_MAX_CID) /* skip BCAST */
1597
+ if (cid >= wil->max_assoc_sta) /* skip BCAST */
13121598 continue;
13131599 if (!wil->ring_tx_data[i].dot1x_open &&
13141600 skb->protocol != cpu_to_be16(ETH_P_PAE))
....@@ -1338,8 +1624,7 @@
13381624 d->mac.d[2] |= (nr_frags << MAC_CFG_DESC_TX_2_NUM_OF_DESCRIPTORS_POS);
13391625 }
13401626
1341
-/**
1342
- * Sets the descriptor @d up for csum and/or TSO offloading. The corresponding
1627
+/* Sets the descriptor @d up for csum and/or TSO offloading. The corresponding
13431628 * @skb is used to obtain the protocol and headers length.
13441629 * @tso_desc_type is a descriptor type for TSO: 0 - a header, 1 - first data,
13451630 * 2 - middle, 3 - last descriptor.
....@@ -1369,8 +1654,7 @@
13691654 d->dma.d0 |= BIT(DMA_CFG_DESC_TX_0_PSEUDO_HEADER_CALC_EN_POS);
13701655 }
13711656
1372
-/**
1373
- * Sets the descriptor @d up for csum. The corresponding
1657
+/* Sets the descriptor @d up for csum. The corresponding
13741658 * @skb is used to obtain the protocol and headers length.
13751659 * Returns the protocol: 0 - not TCP, 1 - TCPv4, 2 - TCPv6.
13761660 * Note, if d==NULL, the function only returns the protocol result.
....@@ -1560,7 +1844,7 @@
15601844 len);
15611845 } else {
15621846 frag = &skb_shinfo(skb)->frags[f];
1563
- len = frag->size;
1847
+ len = skb_frag_size(frag);
15641848 wil_dbg_txrx(wil, "TSO: frag[%d]: len %u\n", f, len);
15651849 }
15661850
....@@ -1581,8 +1865,8 @@
15811865
15821866 if (!headlen) {
15831867 pa = skb_frag_dma_map(dev, frag,
1584
- frag->size - len, lenmss,
1585
- DMA_TO_DEVICE);
1868
+ skb_frag_size(frag) - len,
1869
+ lenmss, DMA_TO_DEVICE);
15861870 vring->ctx[i].mapped_as = wil_mapped_as_page;
15871871 } else {
15881872 pa = dma_map_single(dev,
....@@ -1666,6 +1950,9 @@
16661950 *_desc = *d;
16671951 }
16681952 }
1953
+
1954
+ if (!_desc)
1955
+ goto mem_error;
16691956
16701957 /* first descriptor may also be the last.
16711958 * in this case d pointer is invalid
....@@ -1800,8 +2087,7 @@
18002087
18012088 /* middle segments */
18022089 for (; f < nr_frags; f++) {
1803
- const struct skb_frag_struct *frag =
1804
- &skb_shinfo(skb)->frags[f];
2090
+ const skb_frag_t *frag = &skb_shinfo(skb)->frags[f];
18052091 int len = skb_frag_size(frag);
18062092
18072093 *_d = *d;
....@@ -1923,8 +2209,7 @@
19232209 return rc;
19242210 }
19252211
1926
-/**
1927
- * Check status of tx vrings and stop/wake net queues if needed
2212
+/* Check status of tx vrings and stop/wake net queues if needed
19282213 * It will start/stop net queues of a specific VIF net_device.
19292214 *
19302215 * This function does one of two checks:
....@@ -1958,6 +2243,10 @@
19582243 else
19592244 wil_dbg_txrx(wil, "check_stop=%d, mid=%d, stopped=%d",
19602245 check_stop, vif->mid, vif->net_queue_stopped);
2246
+
2247
+ if (ring && drop_if_ring_full)
2248
+ /* no need to stop/wake net queues */
2249
+ return;
19612250
19622251 if (check_stop == vif->net_queue_stopped)
19632252 /* net queues already in desired state */
....@@ -2022,8 +2311,8 @@
20222311 {
20232312 struct wil6210_vif *vif = ndev_to_vif(ndev);
20242313 struct wil6210_priv *wil = vif_to_wil(vif);
2025
- struct ethhdr *eth = (void *)skb->data;
2026
- bool bcast = is_multicast_ether_addr(eth->h_dest);
2314
+ const u8 *da = wil_skb_get_da(skb);
2315
+ bool bcast = is_multicast_ether_addr(da);
20272316 struct wil_ring *ring;
20282317 static bool pr_once_fw;
20292318 int rc;
....@@ -2052,7 +2341,7 @@
20522341 /* in STA mode (ESS), all to same VRING (to AP) */
20532342 ring = wil_find_tx_ring_sta(wil, vif, skb);
20542343 } else if (bcast) {
2055
- if (vif->pbss)
2344
+ if (vif->pbss || wil_check_multicast_to_unicast(wil, skb))
20562345 /* in pbss, no bcast VRING - duplicate skb in
20572346 * all stations VRINGs
20582347 */
....@@ -2070,7 +2359,7 @@
20702359 ring = wil_find_tx_ucast(wil, vif, skb);
20712360 }
20722361 if (unlikely(!ring)) {
2073
- wil_dbg_txrx(wil, "No Tx RING found for %pM\n", eth->h_dest);
2362
+ wil_dbg_txrx(wil, "No Tx RING found for %pM\n", da);
20742363 goto drop;
20752364 }
20762365 /* set up vring entry */
....@@ -2084,6 +2373,8 @@
20842373 dev_kfree_skb_any(skb);
20852374 return NETDEV_TX_OK;
20862375 case -ENOMEM:
2376
+ if (drop_if_ring_full)
2377
+ goto drop;
20872378 return NETDEV_TX_BUSY;
20882379 default:
20892380 break; /* goto drop; */
....@@ -2120,8 +2411,7 @@
21202411 sta->stats.tx_latency_max_us = skb_time_us;
21212412 }
21222413
2123
-/**
2124
- * Clean up transmitted skb's from the Tx VRING
2414
+/* Clean up transmitted skb's from the Tx VRING
21252415 *
21262416 * Return number of descriptors cleared
21272417 *
....@@ -2155,14 +2445,13 @@
21552445
21562446 used_before_complete = wil_ring_used_tx(vring);
21572447
2158
- if (cid < WIL6210_MAX_CID)
2448
+ if (cid < wil->max_assoc_sta)
21592449 stats = &wil->sta[cid].stats;
21602450
21612451 while (!wil_ring_is_empty(vring)) {
21622452 int new_swtail;
21632453 struct wil_ctx *ctx = &vring->ctx[vring->swtail];
2164
- /**
2165
- * For the fragmented skb, HW will set DU bit only for the
2454
+ /* For the fragmented skb, HW will set DU bit only for the
21662455 * last fragment. look for it.
21672456 * In TSO the first DU will include hdr desc
21682457 */
....@@ -2215,6 +2504,10 @@
22152504 if (stats)
22162505 stats->tx_errors++;
22172506 }
2507
+
2508
+ if (skb->protocol == cpu_to_be16(ETH_P_PAE))
2509
+ wil_tx_complete_handle_eapol(vif, skb);
2510
+
22182511 wil_consume_skb(skb, d->dma.error == 0);
22192512 }
22202513 memset(ctx, 0, sizeof(*ctx));
....@@ -2264,7 +2557,7 @@
22642557 struct vring_rx_desc *d = wil_skb_rxdesc(skb);
22652558
22662559 *tid = wil_rxdesc_tid(d);
2267
- *cid = wil_rxdesc_cid(d);
2560
+ *cid = wil_skb_get_cid(skb);
22682561 *mid = wil_rxdesc_mid(d);
22692562 *seq = wil_rxdesc_seq(d);
22702563 *mcast = wil_rxdesc_mcast(d);
....@@ -2284,6 +2577,7 @@
22842577 wil->txrx_ops.ring_init_bcast = wil_vring_init_bcast;
22852578 wil->txrx_ops.tx_init = wil_tx_init;
22862579 wil->txrx_ops.tx_fini = wil_tx_fini;
2580
+ wil->txrx_ops.tx_ring_modify = wil_tx_vring_modify;
22872581 /* RX ops */
22882582 wil->txrx_ops.rx_init = wil_rx_init;
22892583 wil->txrx_ops.wmi_addba_rx_resp = wmi_addba_rx_resp;