Commit f4d02007 authored by Arik Nemtsov's avatar Arik Nemtsov Committed by Luciano Coelho

wlcore: remove support for injected Tx

Require each incoming packet to have a valid vif. The injected Tx code
path was buggy (and unused), so disallow it altogether.

Cleanup a few places and add a warning so we can better discover
anomalies (corrupted skbs?) masquerading as injected Tx.
Signed-off-by: default avatarArik Nemtsov <arik@wizery.com>
Signed-off-by: default avatarLuciano Coelho <coelho@ti.com>
parent 530abe19
...@@ -1179,9 +1179,13 @@ static void wl1271_op_tx(struct ieee80211_hw *hw, ...@@ -1179,9 +1179,13 @@ static void wl1271_op_tx(struct ieee80211_hw *hw,
int q, mapping; int q, mapping;
u8 hlid; u8 hlid;
if (vif) if (!vif) {
wlvif = wl12xx_vif_to_data(vif); wl1271_debug(DEBUG_TX, "DROP skb with no vif");
ieee80211_free_txskb(hw, skb);
return;
}
wlvif = wl12xx_vif_to_data(vif);
mapping = skb_get_queue_mapping(skb); mapping = skb_get_queue_mapping(skb);
q = wl1271_tx_get_queue(mapping); q = wl1271_tx_get_queue(mapping);
...@@ -1195,7 +1199,7 @@ static void wl1271_op_tx(struct ieee80211_hw *hw, ...@@ -1195,7 +1199,7 @@ static void wl1271_op_tx(struct ieee80211_hw *hw,
* allow these packets through. * allow these packets through.
*/ */
if (hlid == WL12XX_INVALID_LINK_ID || if (hlid == WL12XX_INVALID_LINK_ID ||
(wlvif && !test_bit(hlid, wlvif->links_map)) || (!test_bit(hlid, wlvif->links_map)) ||
(wlcore_is_queue_stopped(wl, q) && (wlcore_is_queue_stopped(wl, q) &&
!wlcore_is_queue_stopped_by_reason(wl, q, !wlcore_is_queue_stopped_by_reason(wl, q,
WLCORE_QUEUE_STOP_REASON_WATERMARK))) { WLCORE_QUEUE_STOP_REASON_WATERMARK))) {
...@@ -1209,8 +1213,7 @@ static void wl1271_op_tx(struct ieee80211_hw *hw, ...@@ -1209,8 +1213,7 @@ static void wl1271_op_tx(struct ieee80211_hw *hw,
skb_queue_tail(&wl->links[hlid].tx_queue[q], skb); skb_queue_tail(&wl->links[hlid].tx_queue[q], skb);
wl->tx_queue_count[q]++; wl->tx_queue_count[q]++;
if (wlvif) wlvif->tx_queue_count[q]++;
wlvif->tx_queue_count[q]++;
/* /*
* The workqueue is slow to process the tx_queue and we need stop * The workqueue is slow to process the tx_queue and we need stop
......
...@@ -157,9 +157,6 @@ u8 wl12xx_tx_get_hlid(struct wl1271 *wl, struct wl12xx_vif *wlvif, ...@@ -157,9 +157,6 @@ u8 wl12xx_tx_get_hlid(struct wl1271 *wl, struct wl12xx_vif *wlvif,
{ {
struct ieee80211_tx_info *control; struct ieee80211_tx_info *control;
if (!wlvif || wl12xx_is_dummy_packet(wl, skb))
return wl->system_hlid;
if (wlvif->bss_type == BSS_TYPE_AP_BSS) if (wlvif->bss_type == BSS_TYPE_AP_BSS)
return wl12xx_tx_get_hlid_ap(wl, wlvif, skb, sta); return wl12xx_tx_get_hlid_ap(wl, wlvif, skb, sta);
...@@ -764,7 +761,7 @@ int wlcore_tx_work_locked(struct wl1271 *wl) ...@@ -764,7 +761,7 @@ int wlcore_tx_work_locked(struct wl1271 *wl)
bool has_data = false; bool has_data = false;
wlvif = NULL; wlvif = NULL;
if (!wl12xx_is_dummy_packet(wl, skb) && info->control.vif) if (!wl12xx_is_dummy_packet(wl, skb))
wlvif = wl12xx_vif_to_data(info->control.vif); wlvif = wl12xx_vif_to_data(info->control.vif);
else else
hlid = wl->system_hlid; hlid = wl->system_hlid;
......
...@@ -451,6 +451,7 @@ struct wl12xx_vif { ...@@ -451,6 +451,7 @@ struct wl12xx_vif {
static inline struct wl12xx_vif *wl12xx_vif_to_data(struct ieee80211_vif *vif) static inline struct wl12xx_vif *wl12xx_vif_to_data(struct ieee80211_vif *vif)
{ {
WARN_ON(!vif);
return (struct wl12xx_vif *)vif->drv_priv; return (struct wl12xx_vif *)vif->drv_priv;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment