Commit ab5caf34 authored by Malcolm Priestley's avatar Malcolm Priestley Committed by Greg Kroah-Hartman

staging: vt6656: Move ieee80211_rx_status off stack.

ieee80211_rx_status off stack to IEEE80211_SKB_RXCB (skb->cb)
removing the need to copy on to it.

skb->cb is always present as a clean buffer so simply fill
it in.
Signed-off-by: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Link: https://lore.kernel.org/r/a66caba4-0c17-41af-a58f-3cdbb3243fb0@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9dd631fa
...@@ -29,7 +29,7 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb *ptr_rcb, ...@@ -29,7 +29,7 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb *ptr_rcb,
struct ieee80211_hw *hw = priv->hw; struct ieee80211_hw *hw = priv->hw;
struct ieee80211_supported_band *sband; struct ieee80211_supported_band *sband;
struct sk_buff *skb; struct sk_buff *skb;
struct ieee80211_rx_status rx_status = { 0 }; struct ieee80211_rx_status *rx_status;
struct ieee80211_hdr *hdr; struct ieee80211_hdr *hdr;
__le16 fc; __le16 fc;
u8 *rsr, *new_rsr, *rssi; u8 *rsr, *new_rsr, *rssi;
...@@ -46,6 +46,7 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb *ptr_rcb, ...@@ -46,6 +46,7 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb *ptr_rcb,
long rx_dbm; long rx_dbm;
skb = ptr_rcb->skb; skb = ptr_rcb->skb;
rx_status = IEEE80211_SKB_RXCB(skb);
/* [31:16]RcvByteCount ( not include 4-byte Status ) */ /* [31:16]RcvByteCount ( not include 4-byte Status ) */
wbk_status = *((u32 *)(skb->data)); wbk_status = *((u32 *)(skb->data));
...@@ -136,23 +137,23 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb *ptr_rcb, ...@@ -136,23 +137,23 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb *ptr_rcb,
skb_pull(skb, 8); skb_pull(skb, 8);
skb_trim(skb, frame_size); skb_trim(skb, frame_size);
rx_status.mactime = priv->tsf_time; rx_status->mactime = priv->tsf_time;
rx_status.band = hw->conf.chandef.chan->band; rx_status->band = hw->conf.chandef.chan->band;
rx_status.signal = rx_dbm; rx_status->signal = rx_dbm;
rx_status.flag = 0; rx_status->flag = 0;
rx_status.freq = hw->conf.chandef.chan->center_freq; rx_status->freq = hw->conf.chandef.chan->center_freq;
if (!(*rsr & RSR_CRCOK)) if (!(*rsr & RSR_CRCOK))
rx_status.flag |= RX_FLAG_FAILED_FCS_CRC; rx_status->flag |= RX_FLAG_FAILED_FCS_CRC;
hdr = (struct ieee80211_hdr *)(skb->data); hdr = (struct ieee80211_hdr *)(skb->data);
fc = hdr->frame_control; fc = hdr->frame_control;
rx_status.rate_idx = rate_idx; rx_status->rate_idx = rate_idx;
if (ieee80211_has_protected(fc)) { if (ieee80211_has_protected(fc)) {
if (priv->local_id > REV_ID_VT3253_A1) { if (priv->local_id > REV_ID_VT3253_A1) {
rx_status.flag |= RX_FLAG_DECRYPTED; rx_status->flag |= RX_FLAG_DECRYPTED;
/* Drop packet */ /* Drop packet */
if (!(*new_rsr & NEWRSR_DECRYPTOK)) { if (!(*new_rsr & NEWRSR_DECRYPTOK)) {
...@@ -162,8 +163,6 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb *ptr_rcb, ...@@ -162,8 +163,6 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb *ptr_rcb,
} }
} }
memcpy(IEEE80211_SKB_RXCB(skb), &rx_status, sizeof(rx_status));
ieee80211_rx_irqsafe(priv->hw, skb); ieee80211_rx_irqsafe(priv->hw, skb);
return true; return true;
......
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