Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 237002
b: refs/heads/master
c: bb4793b
h: refs/heads/master
v: v3
  • Loading branch information
David Gnedt authored and John W. Linville committed Feb 3, 2011
1 parent a6af749 commit 5d82598
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 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: e7332a41442bde1c14550998cadceca34c967dfc
refs/heads/master: bb4793b3c6370a1fed86978c6590241d770cb43e
26 changes: 20 additions & 6 deletions trunk/drivers/net/wireless/wl1251/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,16 +213,30 @@ static int wl1251_tx_send_packet(struct wl1251 *wl, struct sk_buff *skb,
wl1251_debug(DEBUG_TX, "skb offset %d", offset);

/* check whether the current skb can be used */
if (!skb_cloned(skb) && (skb_tailroom(skb) >= offset)) {
unsigned char *src = skb->data;
if (skb_cloned(skb) || (skb_tailroom(skb) < offset)) {
struct sk_buff *newskb = skb_copy_expand(skb, 0, 3,
GFP_KERNEL);

if (unlikely(newskb == NULL)) {
wl1251_error("Can't allocate skb!");
return -EINVAL;
}

tx_hdr = (struct tx_double_buffer_desc *) newskb->data;

dev_kfree_skb_any(skb);
wl->tx_frames[tx_hdr->id] = skb = newskb;

/* align the buffer on a 4-byte boundary */
offset = (4 - (long)skb->data) & 0x03;
wl1251_debug(DEBUG_TX, "new skb offset %d", offset);
}

/* align the buffer on a 4-byte boundary */
if (offset) {
unsigned char *src = skb->data;
skb_reserve(skb, offset);
memmove(skb->data, src, skb->len);
tx_hdr = (struct tx_double_buffer_desc *) skb->data;
} else {
wl1251_info("No handler, fixme!");
return -EINVAL;
}
}

Expand Down

0 comments on commit 5d82598

Please sign in to comment.