Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d439260e authored by Sujith's avatar Sujith Committed by John W. Linville
Browse files

ath9k_htc: Validate TX Endpoint ID



Check for the endpoint IDs when processing
TX completions and drop the unsupported EPIDs.

We can add other endpoints (UAPSD,..) when support
is added.

Signed-off-by: default avatarSujith <Sujith.Manoharan@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 5bf1e17a
Loading
Loading
Loading
Loading
+12 −3
Original line number Original line Diff line number Diff line
@@ -244,16 +244,25 @@ void ath9k_htc_txep(void *drv_priv, struct sk_buff *skb,
		    enum htc_endpoint_id ep_id, bool txok)
		    enum htc_endpoint_id ep_id, bool txok)
{
{
	struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) drv_priv;
	struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) drv_priv;
	struct ath_common *common = ath9k_hw_common(priv->ah);
	struct ieee80211_tx_info *tx_info;
	struct ieee80211_tx_info *tx_info;


	if (!skb)
	if (!skb)
		return;
		return;


	if (ep_id == priv->mgmt_ep)
	if (ep_id == priv->mgmt_ep) {
		skb_pull(skb, sizeof(struct tx_mgmt_hdr));
		skb_pull(skb, sizeof(struct tx_mgmt_hdr));
	else
	} else if ((ep_id == priv->data_bk_ep) ||
		/* TODO: Check for cab/uapsd/data */
		   (ep_id == priv->data_be_ep) ||
		   (ep_id == priv->data_vi_ep) ||
		   (ep_id == priv->data_vo_ep)) {
		skb_pull(skb, sizeof(struct tx_frame_hdr));
		skb_pull(skb, sizeof(struct tx_frame_hdr));
	} else {
		ath_print(common, ATH_DBG_FATAL,
			  "Unsupported TX EPID: %d\n", ep_id);
		dev_kfree_skb_any(skb);
		return;
	}


	tx_info = IEEE80211_SKB_CB(skb);
	tx_info = IEEE80211_SKB_CB(skb);