aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
diff options
context:
space:
mode:
authorZhu Yi <yi.zhu@intel.com>2010-03-29 04:42:26 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-03-31 14:43:58 -0400
commitecdf94b81237d272b1514b76f27a5d22782bcaa6 (patch)
tree53487ff42cf5f183faae9b9a8693c60eef8aae7d /drivers/net/wireless/iwlwifi/iwl-agn-lib.c
parente3cf8b3f7b9eefbe1d39b160726d6e5c2cbb4c5d (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-agn-lib.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-lib.c32
1 files changed, 2 insertions, 30 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
index e8e3118ec0ad..1d2e84c1fad5 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
@@ -931,7 +931,6 @@ static void iwlagn_pass_packet_to_mac80211(struct iwl_priv *priv,
931 struct ieee80211_rx_status *stats) 931 struct ieee80211_rx_status *stats)
932{ 932{
933 struct sk_buff *skb; 933 struct sk_buff *skb;
934 int ret = 0;
935 __le16 fc = hdr->frame_control; 934 __le16 fc = hdr->frame_control;
936 935
937 /* We only process data packets if the interface is open */ 936 /* We only process data packets if the interface is open */
@@ -946,45 +945,18 @@ static void iwlagn_pass_packet_to_mac80211(struct iwl_priv *priv,
946 iwl_set_decrypted_flag(priv, hdr, ampdu_status, stats)) 945 iwl_set_decrypted_flag(priv, hdr, ampdu_status, stats))
947 return; 946 return;
948 947
949 skb = alloc_skb(IWL_LINK_HDR_MAX * 2, GFP_ATOMIC); 948 skb = dev_alloc_skb(128);
950 if (!skb) { 949 if (!skb) {
951 IWL_ERR(priv, "alloc_skb failed\n"); 950 IWL_ERR(priv, "dev_alloc_skb failed\n");
952 return; 951 return;
953 } 952 }
954 953
955 skb_reserve(skb, IWL_LINK_HDR_MAX);
956 skb_add_rx_frag(skb, 0, rxb->page, (void *)hdr - rxb_addr(rxb), len); 954 skb_add_rx_frag(skb, 0, rxb->page, (void *)hdr - rxb_addr(rxb), len);
957 955
958 /* mac80211 currently doesn't support paged SKB. Convert it to
959 * linear SKB for management frame and data frame requires
960 * software decryption or software defragementation. */
961 if (ieee80211_is_mgmt(fc) ||
962 ieee80211_has_protected(fc) ||
963 ieee80211_has_morefrags(fc) ||
964 le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG ||
965 (ieee80211_is_data_qos(fc) &&
966 *ieee80211_get_qos_ctl(hdr) &
967 IEEE80211_QOS_CONTROL_A_MSDU_PRESENT))
968 ret = skb_linearize(skb);
969 else
970 ret = __pskb_pull_tail(skb, min_t(u16, IWL_LINK_HDR_MAX, len)) ?
971 0 : -ENOMEM;
972
973 if (ret) {
974 kfree_skb(skb);
975 goto out;
976 }
977
978 /*
979 * XXX: We cannot touch the page and its virtual memory (hdr) after
980 * here. It might have already been freed by the above skb change.
981 */
982
983 iwl_update_stats(priv, false, fc, len); 956 iwl_update_stats(priv, false, fc, len);
984 memcpy(IEEE80211_SKB_RXCB(skb), stats, sizeof(*stats)); 957 memcpy(IEEE80211_SKB_RXCB(skb), stats, sizeof(*stats));
985 958
986 ieee80211_rx(priv->hw, skb); 959 ieee80211_rx(priv->hw, skb);
987 out:
988 priv->alloc_rxb_page--; 960 priv->alloc_rxb_page--;
989 rxb->page = NULL; 961 rxb->page = NULL;
990} 962}