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

staging: vt6656: vnt_rx_data add track rsr and new_rsr errors

Add rsr and new_rsr error packet error drop.

if NEWRSR_DECRYPTOK fails drop packet altogether.
Signed-off-by: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5091d963
...@@ -143,7 +143,10 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb *ptr_rcb, ...@@ -143,7 +143,10 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb *ptr_rcb,
new_rsr = skb_data + 8 + pay_load_with_padding + 9; new_rsr = skb_data + 8 + pay_load_with_padding + 9;
rssi = skb_data + 8 + pay_load_with_padding + 10; rssi = skb_data + 8 + pay_load_with_padding + 10;
rsr = skb_data + 8 + pay_load_with_padding + 11; rsr = skb_data + 8 + pay_load_with_padding + 11;
if (*rsr & (RSR_IVLDTYP | RSR_IVLDLEN))
return false;
frame_size = *pay_load_len; frame_size = *pay_load_len;
...@@ -163,14 +166,24 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb *ptr_rcb, ...@@ -163,14 +166,24 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb *ptr_rcb,
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))
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->byLocalID > REV_ID_VT3253_A1) if (priv->byLocalID > REV_ID_VT3253_A1) {
rx_status.flag = RX_FLAG_DECRYPTED; rx_status.flag |= RX_FLAG_DECRYPTED;
/* Drop packet */
if (!(*new_rsr & NEWRSR_DECRYPTOK)) {
dev_kfree_skb(skb);
return true;
}
}
} }
memcpy(IEEE80211_SKB_RXCB(skb), &rx_status, sizeof(rx_status)); memcpy(IEEE80211_SKB_RXCB(skb), &rx_status, sizeof(rx_status));
......
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