diff options
-rw-r--r-- | drivers/net/wireless/ath/wil6210/debugfs.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/ath/wil6210/main.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/wil6210/txrx.c | 21 | ||||
-rw-r--r-- | drivers/net/wireless/ath/wil6210/wil6210.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/wil6210/wmi.c | 18 |
5 files changed, 38 insertions, 6 deletions
diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c b/drivers/net/wireless/ath/wil6210/debugfs.c index 1d09a4b0a0f4..ea868bea9e2e 100644 --- a/drivers/net/wireless/ath/wil6210/debugfs.c +++ b/drivers/net/wireless/ath/wil6210/debugfs.c | |||
@@ -631,7 +631,8 @@ static int wil_sta_debugfs_show(struct seq_file *s, void *data) | |||
631 | status = "connected"; | 631 | status = "connected"; |
632 | break; | 632 | break; |
633 | } | 633 | } |
634 | seq_printf(s, "[%d] %pM %s\n", i, p->addr, status); | 634 | seq_printf(s, "[%d] %pM %s%s\n", i, p->addr, status, |
635 | (p->data_port_open ? " data_port_open" : "")); | ||
635 | 636 | ||
636 | if (p->status == wil_sta_connected) { | 637 | if (p->status == wil_sta_connected) { |
637 | for (tid = 0; tid < WIL_STA_TID_NUM; tid++) { | 638 | for (tid = 0; tid < WIL_STA_TID_NUM; tid++) { |
diff --git a/drivers/net/wireless/ath/wil6210/main.c b/drivers/net/wireless/ath/wil6210/main.c index 41c362dee032..f10a0b2a99b2 100644 --- a/drivers/net/wireless/ath/wil6210/main.c +++ b/drivers/net/wireless/ath/wil6210/main.c | |||
@@ -59,6 +59,7 @@ static void wil_disconnect_cid(struct wil6210_priv *wil, int cid) | |||
59 | uint i; | 59 | uint i; |
60 | struct wil_sta_info *sta = &wil->sta[cid]; | 60 | struct wil_sta_info *sta = &wil->sta[cid]; |
61 | 61 | ||
62 | sta->data_port_open = false; | ||
62 | if (sta->status != wil_sta_unused) { | 63 | if (sta->status != wil_sta_unused) { |
63 | wmi_disconnect_sta(wil, sta->addr, WLAN_REASON_DEAUTH_LEAVING); | 64 | wmi_disconnect_sta(wil, sta->addr, WLAN_REASON_DEAUTH_LEAVING); |
64 | sta->status = wil_sta_unused; | 65 | sta->status = wil_sta_unused; |
diff --git a/drivers/net/wireless/ath/wil6210/txrx.c b/drivers/net/wireless/ath/wil6210/txrx.c index 7afaa5e5c42e..29f13e01b99e 100644 --- a/drivers/net/wireless/ath/wil6210/txrx.c +++ b/drivers/net/wireless/ath/wil6210/txrx.c | |||
@@ -662,6 +662,10 @@ static struct vring *wil_find_tx_vring(struct wil6210_priv *wil, | |||
662 | if (cid < 0) | 662 | if (cid < 0) |
663 | return NULL; | 663 | return NULL; |
664 | 664 | ||
665 | if (!wil->sta[cid].data_port_open && | ||
666 | (skb->protocol != cpu_to_be16(ETH_P_PAE))) | ||
667 | return NULL; | ||
668 | |||
665 | /* TODO: fix for multiple TID */ | 669 | /* TODO: fix for multiple TID */ |
666 | for (i = 0; i < ARRAY_SIZE(wil->vring2cid_tid); i++) { | 670 | for (i = 0; i < ARRAY_SIZE(wil->vring2cid_tid); i++) { |
667 | if (wil->vring2cid_tid[i][0] == cid) { | 671 | if (wil->vring2cid_tid[i][0] == cid) { |
@@ -700,12 +704,19 @@ static struct vring *wil_tx_bcast(struct wil6210_priv *wil, | |||
700 | struct vring *v, *v2; | 704 | struct vring *v, *v2; |
701 | struct sk_buff *skb2; | 705 | struct sk_buff *skb2; |
702 | int i; | 706 | int i; |
707 | u8 cid; | ||
703 | 708 | ||
704 | /* find 1-st vring */ | 709 | /* find 1-st vring eligible for data */ |
705 | for (i = 0; i < WIL6210_MAX_TX_RINGS; i++) { | 710 | for (i = 0; i < WIL6210_MAX_TX_RINGS; i++) { |
706 | v = &wil->vring_tx[i]; | 711 | v = &wil->vring_tx[i]; |
707 | if (v->va) | 712 | if (!v->va) |
708 | goto found; | 713 | continue; |
714 | |||
715 | cid = wil->vring2cid_tid[i][0]; | ||
716 | if (!wil->sta[cid].data_port_open) | ||
717 | continue; | ||
718 | |||
719 | goto found; | ||
709 | } | 720 | } |
710 | 721 | ||
711 | wil_err(wil, "Tx while no vrings active?\n"); | 722 | wil_err(wil, "Tx while no vrings active?\n"); |
@@ -721,6 +732,10 @@ found: | |||
721 | v2 = &wil->vring_tx[i]; | 732 | v2 = &wil->vring_tx[i]; |
722 | if (!v2->va) | 733 | if (!v2->va) |
723 | continue; | 734 | continue; |
735 | cid = wil->vring2cid_tid[i][0]; | ||
736 | if (!wil->sta[cid].data_port_open) | ||
737 | continue; | ||
738 | |||
724 | skb2 = skb_copy(skb, GFP_ATOMIC); | 739 | skb2 = skb_copy(skb, GFP_ATOMIC); |
725 | if (skb2) { | 740 | if (skb2) { |
726 | wil_dbg_txrx(wil, "BCAST DUP -> ring %d\n", i); | 741 | wil_dbg_txrx(wil, "BCAST DUP -> ring %d\n", i); |
diff --git a/drivers/net/wireless/ath/wil6210/wil6210.h b/drivers/net/wireless/ath/wil6210/wil6210.h index 273d00f86130..f06f71756996 100644 --- a/drivers/net/wireless/ath/wil6210/wil6210.h +++ b/drivers/net/wireless/ath/wil6210/wil6210.h | |||
@@ -321,6 +321,7 @@ struct wil_sta_info { | |||
321 | u8 addr[ETH_ALEN]; | 321 | u8 addr[ETH_ALEN]; |
322 | enum wil_sta_status status; | 322 | enum wil_sta_status status; |
323 | struct wil_net_stats stats; | 323 | struct wil_net_stats stats; |
324 | bool data_port_open; /* can send any data, not only EAPOL */ | ||
324 | /* Rx BACK */ | 325 | /* Rx BACK */ |
325 | struct wil_tid_ampdu_rx *tid_rx[WIL_STA_TID_NUM]; | 326 | struct wil_tid_ampdu_rx *tid_rx[WIL_STA_TID_NUM]; |
326 | unsigned long tid_rx_timer_expired[BITS_TO_LONGS(WIL_STA_TID_NUM)]; | 327 | unsigned long tid_rx_timer_expired[BITS_TO_LONGS(WIL_STA_TID_NUM)]; |
diff --git a/drivers/net/wireless/ath/wil6210/wmi.c b/drivers/net/wireless/ath/wil6210/wmi.c index 24eed0963581..58c3afcf839d 100644 --- a/drivers/net/wireless/ath/wil6210/wmi.c +++ b/drivers/net/wireless/ath/wil6210/wmi.c | |||
@@ -550,9 +550,16 @@ static void wmi_evt_linkup(struct wil6210_priv *wil, int id, void *d, int len) | |||
550 | { | 550 | { |
551 | struct net_device *ndev = wil_to_ndev(wil); | 551 | struct net_device *ndev = wil_to_ndev(wil); |
552 | struct wmi_data_port_open_event *evt = d; | 552 | struct wmi_data_port_open_event *evt = d; |
553 | u8 cid = evt->cid; | ||
553 | 554 | ||
554 | wil_dbg_wmi(wil, "Link UP for CID %d\n", evt->cid); | 555 | wil_dbg_wmi(wil, "Link UP for CID %d\n", cid); |
555 | 556 | ||
557 | if (cid >= ARRAY_SIZE(wil->sta)) { | ||
558 | wil_err(wil, "Link UP for invalid CID %d\n", cid); | ||
559 | return; | ||
560 | } | ||
561 | |||
562 | wil->sta[cid].data_port_open = true; | ||
556 | netif_carrier_on(ndev); | 563 | netif_carrier_on(ndev); |
557 | } | 564 | } |
558 | 565 | ||
@@ -560,10 +567,17 @@ static void wmi_evt_linkdown(struct wil6210_priv *wil, int id, void *d, int len) | |||
560 | { | 567 | { |
561 | struct net_device *ndev = wil_to_ndev(wil); | 568 | struct net_device *ndev = wil_to_ndev(wil); |
562 | struct wmi_wbe_link_down_event *evt = d; | 569 | struct wmi_wbe_link_down_event *evt = d; |
570 | u8 cid = evt->cid; | ||
563 | 571 | ||
564 | wil_dbg_wmi(wil, "Link DOWN for CID %d, reason %d\n", | 572 | wil_dbg_wmi(wil, "Link DOWN for CID %d, reason %d\n", |
565 | evt->cid, le32_to_cpu(evt->reason)); | 573 | cid, le32_to_cpu(evt->reason)); |
574 | |||
575 | if (cid >= ARRAY_SIZE(wil->sta)) { | ||
576 | wil_err(wil, "Link DOWN for invalid CID %d\n", cid); | ||
577 | return; | ||
578 | } | ||
566 | 579 | ||
580 | wil->sta[cid].data_port_open = false; | ||
567 | netif_carrier_off(ndev); | 581 | netif_carrier_off(ndev); |
568 | } | 582 | } |
569 | 583 | ||