diff options
Diffstat (limited to 'drivers/net/wireless/libertas/rx.c')
-rw-r--r-- | drivers/net/wireless/libertas/rx.c | 48 |
1 files changed, 17 insertions, 31 deletions
diff --git a/drivers/net/wireless/libertas/rx.c b/drivers/net/wireless/libertas/rx.c index 8e669775cb5d..65f02cc6752f 100644 --- a/drivers/net/wireless/libertas/rx.c +++ b/drivers/net/wireless/libertas/rx.c | |||
@@ -25,7 +25,6 @@ struct rfc1042hdr { | |||
25 | } __attribute__ ((packed)); | 25 | } __attribute__ ((packed)); |
26 | 26 | ||
27 | struct rxpackethdr { | 27 | struct rxpackethdr { |
28 | struct rxpd rx_pd; | ||
29 | struct eth803hdr eth803_hdr; | 28 | struct eth803hdr eth803_hdr; |
30 | struct rfc1042hdr rfc1042_hdr; | 29 | struct rfc1042hdr rfc1042_hdr; |
31 | } __attribute__ ((packed)); | 30 | } __attribute__ ((packed)); |
@@ -158,10 +157,18 @@ int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *skb) | |||
158 | if (priv->monitormode) | 157 | if (priv->monitormode) |
159 | return process_rxed_802_11_packet(priv, skb); | 158 | return process_rxed_802_11_packet(priv, skb); |
160 | 159 | ||
161 | p_rx_pkt = (struct rxpackethdr *) skb->data; | 160 | p_rx_pd = (struct rxpd *) skb->data; |
162 | p_rx_pd = &p_rx_pkt->rx_pd; | 161 | p_rx_pkt = (struct rxpackethdr *) ((u8 *)p_rx_pd + |
163 | if (priv->mesh_dev && (p_rx_pd->rx_control & RxPD_MESH_FRAME)) | 162 | le32_to_cpu(p_rx_pd->pkt_ptr)); |
164 | dev = priv->mesh_dev; | 163 | if (priv->mesh_dev) { |
164 | if (priv->mesh_fw_ver == MESH_FW_OLD) { | ||
165 | if (p_rx_pd->rx_control & RxPD_MESH_FRAME) | ||
166 | dev = priv->mesh_dev; | ||
167 | } else if (priv->mesh_fw_ver == MESH_FW_NEW) { | ||
168 | if (p_rx_pd->u.bss.bss_num == MESH_IFACE_ID) | ||
169 | dev = priv->mesh_dev; | ||
170 | } | ||
171 | } | ||
165 | 172 | ||
166 | lbs_deb_hex(LBS_DEB_RX, "RX Data: Before chop rxpd", skb->data, | 173 | lbs_deb_hex(LBS_DEB_RX, "RX Data: Before chop rxpd", skb->data, |
167 | min_t(unsigned int, skb->len, 100)); | 174 | min_t(unsigned int, skb->len, 100)); |
@@ -174,20 +181,9 @@ int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *skb) | |||
174 | goto done; | 181 | goto done; |
175 | } | 182 | } |
176 | 183 | ||
177 | /* | 184 | lbs_deb_rx("rx data: skb->len - pkt_ptr = %d-%zd = %zd\n", |
178 | * Check rxpd status and update 802.3 stat, | 185 | skb->len, (size_t)le32_to_cpu(p_rx_pd->pkt_ptr), |
179 | */ | 186 | skb->len - (size_t)le32_to_cpu(p_rx_pd->pkt_ptr)); |
180 | if (!(p_rx_pd->status & cpu_to_le16(MRVDRV_RXPD_STATUS_OK))) { | ||
181 | lbs_deb_rx("rx err: frame received with bad status\n"); | ||
182 | lbs_pr_alert("rxpd not ok\n"); | ||
183 | dev->stats.rx_errors++; | ||
184 | ret = 0; | ||
185 | dev_kfree_skb(skb); | ||
186 | goto done; | ||
187 | } | ||
188 | |||
189 | lbs_deb_rx("rx data: skb->len-sizeof(RxPd) = %d-%zd = %zd\n", | ||
190 | skb->len, sizeof(struct rxpd), skb->len - sizeof(struct rxpd)); | ||
191 | 187 | ||
192 | lbs_deb_hex(LBS_DEB_RX, "RX Data: Dest", p_rx_pkt->eth803_hdr.dest_addr, | 188 | lbs_deb_hex(LBS_DEB_RX, "RX Data: Dest", p_rx_pkt->eth803_hdr.dest_addr, |
193 | sizeof(p_rx_pkt->eth803_hdr.dest_addr)); | 189 | sizeof(p_rx_pkt->eth803_hdr.dest_addr)); |
@@ -221,14 +217,14 @@ int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *skb) | |||
221 | /* Chop off the rxpd + the excess memory from the 802.2/llc/snap header | 217 | /* Chop off the rxpd + the excess memory from the 802.2/llc/snap header |
222 | * that was removed | 218 | * that was removed |
223 | */ | 219 | */ |
224 | hdrchop = (u8 *) p_ethhdr - (u8 *) p_rx_pkt; | 220 | hdrchop = (u8 *)p_ethhdr - (u8 *)p_rx_pd; |
225 | } else { | 221 | } else { |
226 | lbs_deb_hex(LBS_DEB_RX, "RX Data: LLC/SNAP", | 222 | lbs_deb_hex(LBS_DEB_RX, "RX Data: LLC/SNAP", |
227 | (u8 *) & p_rx_pkt->rfc1042_hdr, | 223 | (u8 *) & p_rx_pkt->rfc1042_hdr, |
228 | sizeof(p_rx_pkt->rfc1042_hdr)); | 224 | sizeof(p_rx_pkt->rfc1042_hdr)); |
229 | 225 | ||
230 | /* Chop off the rxpd */ | 226 | /* Chop off the rxpd */ |
231 | hdrchop = (u8 *) & p_rx_pkt->eth803_hdr - (u8 *) p_rx_pkt; | 227 | hdrchop = (u8 *)&p_rx_pkt->eth803_hdr - (u8 *)p_rx_pd; |
232 | } | 228 | } |
233 | 229 | ||
234 | /* Chop off the leading header bytes so the skb points to the start of | 230 | /* Chop off the leading header bytes so the skb points to the start of |
@@ -334,14 +330,6 @@ static int process_rxed_802_11_packet(struct lbs_private *priv, | |||
334 | goto done; | 330 | goto done; |
335 | } | 331 | } |
336 | 332 | ||
337 | /* | ||
338 | * Check rxpd status and update 802.3 stat, | ||
339 | */ | ||
340 | if (!(prxpd->status & cpu_to_le16(MRVDRV_RXPD_STATUS_OK))) { | ||
341 | //lbs_deb_rx("rx err: frame received with bad status\n"); | ||
342 | dev->stats.rx_errors++; | ||
343 | } | ||
344 | |||
345 | lbs_deb_rx("rx data: skb->len-sizeof(RxPd) = %d-%zd = %zd\n", | 333 | lbs_deb_rx("rx data: skb->len-sizeof(RxPd) = %d-%zd = %zd\n", |
346 | skb->len, sizeof(struct rxpd), skb->len - sizeof(struct rxpd)); | 334 | skb->len, sizeof(struct rxpd), skb->len - sizeof(struct rxpd)); |
347 | 335 | ||
@@ -353,8 +341,6 @@ static int process_rxed_802_11_packet(struct lbs_private *priv, | |||
353 | radiotap_hdr.hdr.it_pad = 0; | 341 | radiotap_hdr.hdr.it_pad = 0; |
354 | radiotap_hdr.hdr.it_len = cpu_to_le16 (sizeof(struct rx_radiotap_hdr)); | 342 | radiotap_hdr.hdr.it_len = cpu_to_le16 (sizeof(struct rx_radiotap_hdr)); |
355 | radiotap_hdr.hdr.it_present = cpu_to_le32 (RX_RADIOTAP_PRESENT); | 343 | radiotap_hdr.hdr.it_present = cpu_to_le32 (RX_RADIOTAP_PRESENT); |
356 | if (!(prxpd->status & cpu_to_le16(MRVDRV_RXPD_STATUS_OK))) | ||
357 | radiotap_hdr.flags |= IEEE80211_RADIOTAP_F_BADFCS; | ||
358 | radiotap_hdr.rate = convert_mv_rate_to_radiotap(prxpd->rx_rate); | 344 | radiotap_hdr.rate = convert_mv_rate_to_radiotap(prxpd->rx_rate); |
359 | /* XXX must check no carryout */ | 345 | /* XXX must check no carryout */ |
360 | radiotap_hdr.antsignal = prxpd->snr + prxpd->nf; | 346 | radiotap_hdr.antsignal = prxpd->snr + prxpd->nf; |