diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn-rx.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-rx.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rx.c b/drivers/net/wireless/iwlwifi/iwl-agn-rx.c index f4b84d1596e3..22474608a70b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-rx.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-rx.c | |||
@@ -773,8 +773,7 @@ static void iwlagn_pass_packet_to_mac80211(struct iwl_priv *priv, | |||
773 | struct sk_buff *skb; | 773 | struct sk_buff *skb; |
774 | __le16 fc = hdr->frame_control; | 774 | __le16 fc = hdr->frame_control; |
775 | struct iwl_rxon_context *ctx; | 775 | struct iwl_rxon_context *ctx; |
776 | struct page *p; | 776 | unsigned int hdrlen, fraglen; |
777 | int offset; | ||
778 | 777 | ||
779 | /* We only process data packets if the interface is open */ | 778 | /* We only process data packets if the interface is open */ |
780 | if (unlikely(!priv->is_open)) { | 779 | if (unlikely(!priv->is_open)) { |
@@ -788,16 +787,24 @@ static void iwlagn_pass_packet_to_mac80211(struct iwl_priv *priv, | |||
788 | iwlagn_set_decrypted_flag(priv, hdr, ampdu_status, stats)) | 787 | iwlagn_set_decrypted_flag(priv, hdr, ampdu_status, stats)) |
789 | return; | 788 | return; |
790 | 789 | ||
791 | skb = dev_alloc_skb(128); | 790 | /* Dont use dev_alloc_skb(), we'll have enough headroom once |
791 | * ieee80211_hdr pulled. | ||
792 | */ | ||
793 | skb = alloc_skb(128, GFP_ATOMIC); | ||
792 | if (!skb) { | 794 | if (!skb) { |
793 | IWL_ERR(priv, "dev_alloc_skb failed\n"); | 795 | IWL_ERR(priv, "alloc_skb failed\n"); |
794 | return; | 796 | return; |
795 | } | 797 | } |
798 | hdrlen = min_t(unsigned int, len, skb_tailroom(skb)); | ||
799 | memcpy(skb_put(skb, hdrlen), hdr, hdrlen); | ||
800 | fraglen = len - hdrlen; | ||
796 | 801 | ||
797 | offset = (void *)hdr - rxb_addr(rxb); | 802 | if (fraglen) { |
798 | p = rxb_steal_page(rxb); | 803 | int offset = (void *)hdr + hdrlen - rxb_addr(rxb); |
799 | skb_add_rx_frag(skb, 0, p, offset, len, len); | ||
800 | 804 | ||
805 | skb_add_rx_frag(skb, 0, rxb_steal_page(rxb), offset, | ||
806 | fraglen, rxb->truesize); | ||
807 | } | ||
801 | iwl_update_stats(priv, false, fc, len); | 808 | iwl_update_stats(priv, false, fc, len); |
802 | 809 | ||
803 | /* | 810 | /* |