diff options
author | David Woodhouse <dwmw2@infradead.org> | 2007-12-10 00:05:37 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:06:31 -0500 |
commit | 180be755aec37483337f64bfca3d4b02f5c8fef4 (patch) | |
tree | 310fc67f9a6a8f103203f82b71aa7e81f362defe /drivers/net/wireless | |
parent | 2eb188a1c57ae79283cee951c317bd191cf1ca56 (diff) |
libertas: remove unreachable code from process_rxed_802_11_packet()
The function is only ever called if we're in rtap mode. So the bit in it
which is conditional on rtap mode seems a little superfluous.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/libertas/rx.c | 75 |
1 files changed, 32 insertions, 43 deletions
diff --git a/drivers/net/wireless/libertas/rx.c b/drivers/net/wireless/libertas/rx.c index 58e831108120..90a21996e823 100644 --- a/drivers/net/wireless/libertas/rx.c +++ b/drivers/net/wireless/libertas/rx.c | |||
@@ -355,52 +355,41 @@ static int process_rxed_802_11_packet(struct lbs_private *priv, | |||
355 | skb->len, sizeof(struct rxpd), skb->len - sizeof(struct rxpd)); | 355 | skb->len, sizeof(struct rxpd), skb->len - sizeof(struct rxpd)); |
356 | 356 | ||
357 | /* create the exported radio header */ | 357 | /* create the exported radio header */ |
358 | if (priv->monitormode == LBS_MONITOR_OFF) { | ||
359 | /* no radio header */ | ||
360 | /* chop the rxpd */ | ||
361 | skb_pull(skb, sizeof(struct rxpd)); | ||
362 | } | ||
363 | 358 | ||
364 | else { | 359 | /* radiotap header */ |
365 | /* radiotap header */ | 360 | radiotap_hdr.hdr.it_version = 0; |
366 | radiotap_hdr.hdr.it_version = 0; | 361 | /* XXX must check this value for pad */ |
367 | /* XXX must check this value for pad */ | 362 | radiotap_hdr.hdr.it_pad = 0; |
368 | radiotap_hdr.hdr.it_pad = 0; | 363 | radiotap_hdr.hdr.it_len = cpu_to_le16 (sizeof(struct rx_radiotap_hdr)); |
369 | radiotap_hdr.hdr.it_len = cpu_to_le16 (sizeof(struct rx_radiotap_hdr)); | 364 | radiotap_hdr.hdr.it_present = cpu_to_le32 (RX_RADIOTAP_PRESENT); |
370 | radiotap_hdr.hdr.it_present = cpu_to_le32 (RX_RADIOTAP_PRESENT); | 365 | /* unknown values */ |
371 | /* unknown values */ | 366 | radiotap_hdr.flags = 0; |
372 | radiotap_hdr.flags = 0; | 367 | radiotap_hdr.chan_freq = 0; |
373 | radiotap_hdr.chan_freq = 0; | 368 | radiotap_hdr.chan_flags = 0; |
374 | radiotap_hdr.chan_flags = 0; | 369 | radiotap_hdr.antenna = 0; |
375 | radiotap_hdr.antenna = 0; | 370 | /* known values */ |
376 | /* known values */ | 371 | radiotap_hdr.rate = convert_mv_rate_to_radiotap(prxpd->rx_rate); |
377 | radiotap_hdr.rate = convert_mv_rate_to_radiotap(prxpd->rx_rate); | 372 | /* XXX must check no carryout */ |
378 | /* XXX must check no carryout */ | 373 | radiotap_hdr.antsignal = prxpd->snr + prxpd->nf; |
379 | radiotap_hdr.antsignal = prxpd->snr + prxpd->nf; | 374 | radiotap_hdr.rx_flags = 0; |
380 | radiotap_hdr.rx_flags = 0; | 375 | if (!(prxpd->status & cpu_to_le16(MRVDRV_RXPD_STATUS_OK))) |
381 | if (!(prxpd->status & cpu_to_le16(MRVDRV_RXPD_STATUS_OK))) | 376 | radiotap_hdr.rx_flags |= IEEE80211_RADIOTAP_F_RX_BADFCS; |
382 | radiotap_hdr.rx_flags |= IEEE80211_RADIOTAP_F_RX_BADFCS; | 377 | //memset(radiotap_hdr.pad, 0x11, IEEE80211_RADIOTAP_HDRLEN - 18); |
383 | //memset(radiotap_hdr.pad, 0x11, IEEE80211_RADIOTAP_HDRLEN - 18); | 378 | |
384 | 379 | /* chop the rxpd */ | |
385 | /* chop the rxpd */ | 380 | skb_pull(skb, sizeof(struct rxpd)); |
386 | skb_pull(skb, sizeof(struct rxpd)); | 381 | |
387 | 382 | /* add space for the new radio header */ | |
388 | /* add space for the new radio header */ | 383 | if ((skb_headroom(skb) < sizeof(struct rx_radiotap_hdr)) && |
389 | if ((skb_headroom(skb) < sizeof(struct rx_radiotap_hdr)) && | 384 | pskb_expand_head(skb, sizeof(struct rx_radiotap_hdr), 0, |
390 | pskb_expand_head(skb, sizeof(struct rx_radiotap_hdr), 0, | 385 | GFP_ATOMIC)) { |
391 | GFP_ATOMIC)) { | 386 | lbs_pr_alert("%s: couldn't pskb_expand_head\n", |
392 | lbs_pr_alert("%s: couldn't pskb_expand_head\n", | 387 | __func__); |
393 | __func__); | ||
394 | } | ||
395 | |||
396 | pradiotap_hdr = | ||
397 | (struct rx_radiotap_hdr *)skb_push(skb, | ||
398 | sizeof(struct | ||
399 | rx_radiotap_hdr)); | ||
400 | memcpy(pradiotap_hdr, &radiotap_hdr, | ||
401 | sizeof(struct rx_radiotap_hdr)); | ||
402 | } | 388 | } |
403 | 389 | ||
390 | pradiotap_hdr = (void *)skb_push(skb, sizeof(struct rx_radiotap_hdr)); | ||
391 | memcpy(pradiotap_hdr, &radiotap_hdr, sizeof(struct rx_radiotap_hdr)); | ||
392 | |||
404 | /* Take the data rate from the rxpd structure | 393 | /* Take the data rate from the rxpd structure |
405 | * only if the rate is auto | 394 | * only if the rate is auto |
406 | */ | 395 | */ |