All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@qca.qualcomm.com>
To: ath10k@lists.infradead.org
Subject: [HACK PATCH 4/4] ath10k: tx
Date: Mon, 8 Dec 2014 19:17:37 +0200	[thread overview]
Message-ID: <20141208171737.1001.63200.stgit@potku.adurom.net> (raw)
In-Reply-To: <20141208170804.1001.1804.stgit@potku.adurom.net>

From: Michal Kazior <michal.kazior@tieto.com>

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath10k/Kconfig  |    8 ++++++++
 drivers/net/wireless/ath/ath10k/core.h   |    4 ++++
 drivers/net/wireless/ath/ath10k/htt_tx.c |   12 ++++++++++++
 drivers/net/wireless/ath/ath10k/mac.c    |   21 +++++++++++++++++++++
 4 files changed, 45 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/Kconfig b/drivers/net/wireless/ath/ath10k/Kconfig
index 72acb822bb11..1bac2e94c3a9 100644
--- a/drivers/net/wireless/ath/ath10k/Kconfig
+++ b/drivers/net/wireless/ath/ath10k/Kconfig
@@ -45,3 +45,11 @@ config ATH10K_DFS_CERTIFIED
 	---help---
 	This option enables DFS support for initiating radiation on
 	ath10k.
+
+config ATH10K_802_3_FORMAT
+	bool "ath10k 802.3 frame format"
+	depends on ATH10K
+	default n
+	---help---
+	This option enables HIGHLY EXPERIMENTAL 802.3 frame format 
+	support in ath10k. If it breaks, you get to keep both pieces.
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index f4a4d3c346aa..c5c33a56a03e 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -82,6 +82,10 @@ struct ath10k_skb_cb {
 	u8 eid;
 	u8 vdev_id;
 
+#ifdef CONFIG_ATH10K_802_3_FORMAT
+	bool is_8023;
+#endif
+
 	struct {
 		u8 tid;
 		u16 freq;
diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c
index a1bda41fb543..a340444bc64c 100644
--- a/drivers/net/wireless/ath/ath10k/htt_tx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
@@ -467,11 +467,15 @@ int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff *msdu)
 	prefetch_len = min(htt->prefetch_len, msdu->len);
 	prefetch_len = roundup(prefetch_len, 4);
 
+#ifdef CONFIG_ATH10K_802_3_FORMAT
+	use_frags = true;
+#else
 	/* Since HTT 3.0 there is no separate mgmt tx command. However in case
 	 * of mgmt tx using TX_FRM there is not tx fragment list. Instead of tx
 	 * fragment list host driver specifies directly frame pointer. */
 	use_frags = htt->target_version_major < 3 ||
 		    !ieee80211_is_mgmt(hdr->frame_control);
+#endif
 
 	skb_cb->htt.txbuf = dma_pool_alloc(htt->tx_pool, GFP_ATOMIC,
 					   &paddr);
@@ -527,8 +531,16 @@ int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff *msdu)
 			prefetch_len);
 	skb_cb->htt.txbuf->htc_hdr.flags = 0;
 
+#ifdef CONFIG_ATH10K_802_3_FORMAT
+	flags0 |= SM(ATH10K_HW_TXRX_ETHERNET,
+		     HTT_DATA_TX_DESC_FLAGS0_PKT_TYPE);
+	flags0 |= HTT_DATA_TX_DESC_FLAGS0_NO_ENCRYPT;
+
+#else
+
 	if (!ieee80211_has_protected(hdr->frame_control))
 		flags0 |= HTT_DATA_TX_DESC_FLAGS0_NO_ENCRYPT;
+#endif
 
 	flags0 |= HTT_DATA_TX_DESC_FLAGS0_MAC_HDR_PRESENT;
 
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 3ab09470438f..d7ccb0531a48 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -2364,6 +2364,23 @@ static void ath10k_tx(struct ieee80211_hw *hw,
 	struct ieee80211_key_conf *key = info->control.hw_key;
 	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
 
+#ifdef CONFIG_ATH10K_802_3_FORMAT
+	if (likely(info->is_8023)) {
+		int ret;
+
+		ATH10K_SKB_CB(skb)->vdev_id = 0;
+		ATH10K_SKB_CB(skb)->is_8023 = true;
+		ATH10K_SKB_CB(skb)->htt.is_offchan = false;
+		ATH10K_SKB_CB(skb)->htt.tid = skb->priority &
+					      IEEE80211_QOS_CTL_TAG1D_MASK;
+
+		ret = ath10k_htt_tx(&ar->htt, skb);
+		if (unlikely(ret < 0))
+			ieee80211_free_txskb(hw, skb);
+		return;
+	}
+#endif
+
 	/* We should disable CCK RATE due to P2P */
 	if (info->flags & IEEE80211_TX_CTL_NO_CCK_RATE)
 		ath10k_dbg(ar, ATH10K_DBG_MAC, "IEEE80211_TX_CTL_NO_CCK_RATE\n");
@@ -2372,6 +2389,10 @@ static void ath10k_tx(struct ieee80211_hw *hw,
 	ATH10K_SKB_CB(skb)->htt.tid = ath10k_tx_h_get_tid(hdr);
 	ATH10K_SKB_CB(skb)->vdev_id = ath10k_tx_h_get_vdev_id(ar, vif);
 
+#ifdef CONFIG_ATH10K_802_3_FORMAT
+	ATH10K_SKB_CB(skb)->is_8023 = false;
+#endif
+
 	/* it makes no sense to process injected frames like that */
 	if (vif && vif->type != NL80211_IFTYPE_MONITOR) {
 		ath10k_tx_h_nwifi(hw, skb);


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

      parent reply	other threads:[~2014-12-08 17:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-08 17:16 [HACK PATCH 0/4] ath10k: 802.3 frame format support Kalle Valo
2014-12-08 17:17 ` [HACK PATCH 1/4] mac80211: rx Kalle Valo
2014-12-08 17:17 ` [HACK PATCH 2/4] mac8011: tx Kalle Valo
2014-12-08 17:17 ` [HACK PATCH 3/4] ath10k: rx Kalle Valo
2014-12-08 17:17 ` Kalle Valo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141208171737.1001.63200.stgit@potku.adurom.net \
    --to=kvalo@qca.qualcomm.com \
    --cc=ath10k@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.