Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 351718
b: refs/heads/master
c: a357d7f
h: refs/heads/master
v: v3
  • Loading branch information
Johannes Berg committed Jan 3, 2013
1 parent 05f0d7a commit 5b88755
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 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: f4eabc918c3b88763bc20dd9e2b248aa6c757005
refs/heads/master: a357d7f9855e3002d6aaaea5c40dd1ac02b78de7
26 changes: 23 additions & 3 deletions trunk/drivers/net/wireless/mac80211_hwsim.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ static int channels = 1;
module_param(channels, int, 0444);
MODULE_PARM_DESC(channels, "Number of concurrent channels");

static bool paged_rx = false;
module_param(paged_rx, bool, 0644);
MODULE_PARM_DESC(paged_rx, "Use paged SKBs for RX instead of linear ones");

/**
* enum hwsim_regtest - the type of regulatory tests we offer
*
Expand Down Expand Up @@ -755,9 +759,25 @@ static bool mac80211_hwsim_tx_frame_no_nl(struct ieee80211_hw *hw,
* reserve some space for our vendor and the normal
* radiotap header, since we're copying anyway
*/
nskb = skb_copy_expand(skb, 64, 0, GFP_ATOMIC);
if (nskb == NULL)
continue;
if (skb->len < PAGE_SIZE && paged_rx) {
struct page *page = alloc_page(GFP_ATOMIC);

if (!page)
continue;

nskb = dev_alloc_skb(128);
if (!nskb) {
__free_page(page);
continue;
}

memcpy(page_address(page), skb->data, skb->len);
skb_add_rx_frag(nskb, 0, page, 0, skb->len, skb->len);
} else {
nskb = skb_copy(skb, GFP_ATOMIC);
if (!nskb)
continue;
}

if (mac80211_hwsim_addr_match(data2, hdr->addr1))
ack = true;
Expand Down

0 comments on commit 5b88755

Please sign in to comment.