summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Tarnyagin <dmitry.tarnyagin@stericsson.com>2011-06-04 17:08:40 +0200
committerPhilippe LANGLAIS <philippe.langlais@stericsson.com>2011-06-22 11:30:51 +0200
commit010113999d1c0db44b9bdd44b325914dc4d14645 (patch)
treee5b1eb40f7561cafbff8e0b7129c015cbb051019
parent0abce402c0cbf94ef7c280e040388eca730bd8da (diff)
cw1200: stylistic change: move RX callback to txrx.c
WSM RX callback is moved form sta.c to txrx. Change-Id: Id56e07c3b71d8a2fb52b3b974feaed8c48364390 Signed-off-by: Dmitry Tarnyagin <dmitry.tarnyagin@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/24479 Reviewed-by: Robert MARKLUND <robert.marklund@stericsson.com> Tested-by: Robert MARKLUND <robert.marklund@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/25619 Reviewed-by: Philippe LANGLAIS <philippe.langlais@stericsson.com>
-rw-r--r--drivers/staging/cw1200/sta.c71
-rw-r--r--drivers/staging/cw1200/sta.h3
-rw-r--r--drivers/staging/cw1200/txrx.c60
-rw-r--r--drivers/staging/cw1200/txrx.h3
4 files changed, 63 insertions, 74 deletions
diff --git a/drivers/staging/cw1200/sta.c b/drivers/staging/cw1200/sta.c
index 145a370dc50..60a3c57100b 100644
--- a/drivers/staging/cw1200/sta.c
+++ b/drivers/staging/cw1200/sta.c
@@ -661,77 +661,6 @@ void cw1200_flush(struct ieee80211_hw *hw, bool drop)
/* ******************************************************************** */
/* WSM callbacks */
-/* TODO: move to txrx.c */
-void cw1200_rx_cb(struct cw1200_common *priv,
- struct wsm_rx *arg,
- struct sk_buff **skb_p)
-{
- struct sk_buff *skb = *skb_p;
- struct ieee80211_rx_status *hdr = IEEE80211_SKB_RXCB(skb);
- hdr->flag = 0;
-
- if (unlikely(priv->mode == NL80211_IFTYPE_UNSPECIFIED)) {
- /* STA is stopped. */
- return;
- }
-
- if (unlikely(arg->status)) {
- if (arg->status == WSM_STATUS_MICFAILURE) {
- sta_printk(KERN_DEBUG "[RX] MIC failure.\n");
- hdr->flag |= RX_FLAG_MMIC_ERROR;
- } else if (arg->status == WSM_STATUS_NO_KEY_FOUND) {
- sta_printk(KERN_DEBUG "[RX] No key found.\n");
- return;
- } else {
- sta_printk(KERN_DEBUG "[RX] Receive failure: %d.\n",
- arg->status);
- return;
- }
- }
-
- hdr->mactime = 0; /* Not supported by WSM */
- hdr->freq = ieee80211_channel_to_frequency(arg->channelNumber);
- hdr->band = (hdr->freq >= 5000) ?
- IEEE80211_BAND_5GHZ : IEEE80211_BAND_2GHZ;
- hdr->rate_idx = arg->rxedRate;
- if (hdr->rate_idx >= 4) /* TODO: Use common convert function. */
- hdr->rate_idx -= 2;
- hdr->signal = (s8)arg->rcpiRssi;
- hdr->antenna = 0;
-
- if (WSM_RX_STATUS_ENCRYPTION(arg->flags)) {
- hdr->flag |= RX_FLAG_DECRYPTED;
- if (!arg->status &&
- (WSM_RX_STATUS_ENCRYPTION(arg->flags) ==
- WSM_RX_STATUS_TKIP)) {
- hdr->flag |= RX_FLAG_MMIC_STRIPPED;
- skb_trim(skb, skb->len - 8 /*MICHAEL_MIC_LEN*/);
- }
- }
- if (arg->flags & WSM_RX_STATUS_HT)
- hdr->flag |= RX_FLAG_HT;
-
- cw1200_debug_rxed(priv);
- if (arg->flags & WSM_RX_STATUS_AGGREGATE)
- cw1200_debug_rxed_agg(priv);
-#if 0
- /* Wrong: ACK could be disable for this ACL */
- if (arg->flags & WSM_RX_STATUS_ADDRESS1)
- priv->last_activity_time = jiffies;
-#endif
-
-#if 0
- print_hex_dump_bytes("RX: ", DUMP_PREFIX_NONE,
- skb->data, skb->len);
-#endif
-
- /* Not that we really need _irqsafe variant here,
- * but it offloads realtime bh thread and improve
- * system performance. */
- ieee80211_rx(priv->hw, skb);
- *skb_p = NULL;
-}
-
void cw1200_channel_switch_cb(struct cw1200_common *priv)
{
wsm_unlock_tx(priv);
diff --git a/drivers/staging/cw1200/sta.h b/drivers/staging/cw1200/sta.h
index 998afeedf45..2a3c8836c0b 100644
--- a/drivers/staging/cw1200/sta.h
+++ b/drivers/staging/cw1200/sta.h
@@ -45,9 +45,6 @@ void cw1200_flush(struct ieee80211_hw *hw, bool drop);
/* ******************************************************************** */
/* WSM callbacks */
-void cw1200_rx_cb(struct cw1200_common *priv,
- struct wsm_rx *arg,
- struct sk_buff **skb_p);
/* void cw1200_set_pm_complete_cb(struct cw1200_common *priv,
struct wsm_set_pm_complete *arg); */
void cw1200_channel_switch_cb(struct cw1200_common *priv);
diff --git a/drivers/staging/cw1200/txrx.c b/drivers/staging/cw1200/txrx.c
index fd04156dcb5..005654eabe8 100644
--- a/drivers/staging/cw1200/txrx.c
+++ b/drivers/staging/cw1200/txrx.c
@@ -563,6 +563,66 @@ void cw1200_tx_confirm_cb(struct cw1200_common *priv,
}
}
+void cw1200_rx_cb(struct cw1200_common *priv,
+ struct wsm_rx *arg,
+ struct sk_buff **skb_p)
+{
+ struct sk_buff *skb = *skb_p;
+ struct ieee80211_rx_status *hdr = IEEE80211_SKB_RXCB(skb);
+ hdr->flag = 0;
+
+ if (unlikely(priv->mode == NL80211_IFTYPE_UNSPECIFIED)) {
+ /* STA is stopped. */
+ return;
+ }
+
+ if (unlikely(arg->status)) {
+ if (arg->status == WSM_STATUS_MICFAILURE) {
+ txrx_printk(KERN_DEBUG "[RX] MIC failure.\n");
+ hdr->flag |= RX_FLAG_MMIC_ERROR;
+ } else if (arg->status == WSM_STATUS_NO_KEY_FOUND) {
+ txrx_printk(KERN_DEBUG "[RX] No key found.\n");
+ return;
+ } else {
+ txrx_printk(KERN_DEBUG "[RX] Receive failure: %d.\n",
+ arg->status);
+ return;
+ }
+ }
+
+ hdr->mactime = 0; /* Not supported by WSM */
+ hdr->freq = ieee80211_channel_to_frequency(arg->channelNumber);
+ hdr->band = (hdr->freq >= 5000) ?
+ IEEE80211_BAND_5GHZ : IEEE80211_BAND_2GHZ;
+ hdr->rate_idx = arg->rxedRate;
+ if (hdr->rate_idx >= 4) /* TODO: Use common convert function. */
+ hdr->rate_idx -= 2;
+ hdr->signal = (s8)arg->rcpiRssi;
+ hdr->antenna = 0;
+
+ if (WSM_RX_STATUS_ENCRYPTION(arg->flags)) {
+ hdr->flag |= RX_FLAG_DECRYPTED;
+ if (!arg->status &&
+ (WSM_RX_STATUS_ENCRYPTION(arg->flags) ==
+ WSM_RX_STATUS_TKIP)) {
+ hdr->flag |= RX_FLAG_MMIC_STRIPPED;
+ skb_trim(skb, skb->len - 8 /*MICHAEL_MIC_LEN*/);
+ }
+ }
+ if (arg->flags & WSM_RX_STATUS_HT)
+ hdr->flag |= RX_FLAG_HT;
+
+ cw1200_debug_rxed(priv);
+ if (arg->flags & WSM_RX_STATUS_AGGREGATE)
+ cw1200_debug_rxed_agg(priv);
+
+ /* Not that we really need _irqsafe variant here,
+ * but it offloads realtime bh thread and improve
+ * system performance. */
+ ieee80211_rx_irqsafe(priv->hw, skb);
+ *skb_p = NULL;
+}
+
/* ******************************************************************** */
/* Security */
diff --git a/drivers/staging/cw1200/txrx.h b/drivers/staging/cw1200/txrx.h
index 2be3af99d03..12a9b49028b 100644
--- a/drivers/staging/cw1200/txrx.h
+++ b/drivers/staging/cw1200/txrx.h
@@ -68,6 +68,9 @@ int cw1200_tx(struct ieee80211_hw *dev, struct sk_buff *skb);
void cw1200_tx_confirm_cb(struct cw1200_common *priv,
struct wsm_tx_confirm *arg);
+void cw1200_rx_cb(struct cw1200_common *priv,
+ struct wsm_rx *arg,
+ struct sk_buff **skb_p);
/* ******************************************************************** */
/* Timeout */