diff options
author | Zhu Yi <yi.zhu@intel.com> | 2010-03-29 04:42:26 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-03-31 14:43:58 -0400 |
commit | ecdf94b81237d272b1514b76f27a5d22782bcaa6 (patch) | |
tree | 53487ff42cf5f183faae9b9a8693c60eef8aae7d /drivers/net/wireless/iwlwifi/iwl-3945.c | |
parent | e3cf8b3f7b9eefbe1d39b160726d6e5c2cbb4c5d (diff) |
iwlwifi: remove skb_linearize for rx frames
Remove skb_linearize() in the iwlwifi drivers since
mac80211 supports paged rx SKBs now.
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-3945.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945.c | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c index 6b7201551ca7..2c16c5c10bc5 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945.c | |||
@@ -548,7 +548,6 @@ static void iwl3945_pass_packet_to_mac80211(struct iwl_priv *priv, | |||
548 | struct iwl3945_rx_frame_end *rx_end = IWL_RX_END(pkt); | 548 | struct iwl3945_rx_frame_end *rx_end = IWL_RX_END(pkt); |
549 | u16 len = le16_to_cpu(rx_hdr->len); | 549 | u16 len = le16_to_cpu(rx_hdr->len); |
550 | struct sk_buff *skb; | 550 | struct sk_buff *skb; |
551 | int ret; | ||
552 | __le16 fc = hdr->frame_control; | 551 | __le16 fc = hdr->frame_control; |
553 | 552 | ||
554 | /* We received data from the HW, so stop the watchdog */ | 553 | /* We received data from the HW, so stop the watchdog */ |
@@ -565,9 +564,9 @@ static void iwl3945_pass_packet_to_mac80211(struct iwl_priv *priv, | |||
565 | return; | 564 | return; |
566 | } | 565 | } |
567 | 566 | ||
568 | skb = alloc_skb(IWL_LINK_HDR_MAX * 2, GFP_ATOMIC); | 567 | skb = dev_alloc_skb(128); |
569 | if (!skb) { | 568 | if (!skb) { |
570 | IWL_ERR(priv, "alloc_skb failed\n"); | 569 | IWL_ERR(priv, "dev_alloc_skb failed\n"); |
571 | return; | 570 | return; |
572 | } | 571 | } |
573 | 572 | ||
@@ -576,37 +575,13 @@ static void iwl3945_pass_packet_to_mac80211(struct iwl_priv *priv, | |||
576 | (struct ieee80211_hdr *)rxb_addr(rxb), | 575 | (struct ieee80211_hdr *)rxb_addr(rxb), |
577 | le32_to_cpu(rx_end->status), stats); | 576 | le32_to_cpu(rx_end->status), stats); |
578 | 577 | ||
579 | skb_reserve(skb, IWL_LINK_HDR_MAX); | ||
580 | skb_add_rx_frag(skb, 0, rxb->page, | 578 | skb_add_rx_frag(skb, 0, rxb->page, |
581 | (void *)rx_hdr->payload - (void *)pkt, len); | 579 | (void *)rx_hdr->payload - (void *)pkt, len); |
582 | 580 | ||
583 | /* mac80211 currently doesn't support paged SKB. Convert it to | ||
584 | * linear SKB for management frame and data frame requires | ||
585 | * software decryption or software defragementation. */ | ||
586 | if (ieee80211_is_mgmt(fc) || | ||
587 | ieee80211_has_protected(fc) || | ||
588 | ieee80211_has_morefrags(fc) || | ||
589 | le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG) | ||
590 | ret = skb_linearize(skb); | ||
591 | else | ||
592 | ret = __pskb_pull_tail(skb, min_t(u16, IWL_LINK_HDR_MAX, len)) ? | ||
593 | 0 : -ENOMEM; | ||
594 | |||
595 | if (ret) { | ||
596 | kfree_skb(skb); | ||
597 | goto out; | ||
598 | } | ||
599 | |||
600 | /* | ||
601 | * XXX: We cannot touch the page and its virtual memory (pkt) after | ||
602 | * here. It might have already been freed by the above skb change. | ||
603 | */ | ||
604 | |||
605 | iwl_update_stats(priv, false, fc, len); | 581 | iwl_update_stats(priv, false, fc, len); |
606 | memcpy(IEEE80211_SKB_RXCB(skb), stats, sizeof(*stats)); | 582 | memcpy(IEEE80211_SKB_RXCB(skb), stats, sizeof(*stats)); |
607 | 583 | ||
608 | ieee80211_rx(priv->hw, skb); | 584 | ieee80211_rx(priv->hw, skb); |
609 | out: | ||
610 | priv->alloc_rxb_page--; | 585 | priv->alloc_rxb_page--; |
611 | rxb->page = NULL; | 586 | rxb->page = NULL; |
612 | } | 587 | } |