Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 300188
b: refs/heads/master
c: ed90542
h: refs/heads/master
v: v3
  • Loading branch information
Eric Dumazet authored and John W. Linville committed May 3, 2012
1 parent 59d2e93 commit f1a1293
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9d1ceac5c6f7e77ea914de376ec17ced3eb22e5f
refs/heads/master: ed90542b0ce5415050c6fbfca324bccaafa69f2f
21 changes: 14 additions & 7 deletions trunk/drivers/net/wireless/iwlwifi/iwl-agn-rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -773,8 +773,7 @@ static void iwlagn_pass_packet_to_mac80211(struct iwl_priv *priv,
struct sk_buff *skb;
__le16 fc = hdr->frame_control;
struct iwl_rxon_context *ctx;
struct page *p;
int offset;
unsigned int hdrlen, fraglen;

/* We only process data packets if the interface is open */
if (unlikely(!priv->is_open)) {
Expand All @@ -788,16 +787,24 @@ static void iwlagn_pass_packet_to_mac80211(struct iwl_priv *priv,
iwlagn_set_decrypted_flag(priv, hdr, ampdu_status, stats))
return;

skb = dev_alloc_skb(128);
/* Dont use dev_alloc_skb(), we'll have enough headroom once
* ieee80211_hdr pulled.
*/
skb = alloc_skb(128, GFP_ATOMIC);
if (!skb) {
IWL_ERR(priv, "dev_alloc_skb failed\n");
IWL_ERR(priv, "alloc_skb failed\n");
return;
}
hdrlen = min_t(unsigned int, len, skb_tailroom(skb));
memcpy(skb_put(skb, hdrlen), hdr, hdrlen);
fraglen = len - hdrlen;

offset = (void *)hdr - rxb_addr(rxb);
p = rxb_steal_page(rxb);
skb_add_rx_frag(skb, 0, p, offset, len, len);
if (fraglen) {
int offset = (void *)hdr + hdrlen - rxb_addr(rxb);

skb_add_rx_frag(skb, 0, rxb_steal_page(rxb), offset,
fraglen, rxb->truesize);
}
iwl_update_stats(priv, false, fc, len);

/*
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,9 @@ static void iwl_rx_handle_rxbuf(struct iwl_trans *trans,
if (WARN_ON(!rxb))
return;

rxcb.truesize = PAGE_SIZE << hw_params(trans).rx_page_order;
dma_unmap_page(trans->dev, rxb->page_dma,
PAGE_SIZE << hw_params(trans).rx_page_order,
rxcb.truesize,
DMA_FROM_DEVICE);

rxcb._page = rxb->page;
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-trans.h
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ static inline void iwl_free_resp(struct iwl_host_cmd *cmd)

struct iwl_rx_cmd_buffer {
struct page *_page;
unsigned int truesize;
};

static inline void *rxb_addr(struct iwl_rx_cmd_buffer *r)
Expand Down

0 comments on commit f1a1293

Please sign in to comment.