Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 195259
b: refs/heads/master
c: fd76f14
h: refs/heads/master
i:
  195257: 59c0187
  195255: 886a226
v: v3
  • Loading branch information
Gertjan van Wingerde authored and John W. Linville committed May 12, 2010
1 parent efee23f commit 408a92d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 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: 185e5f77f891d5bc7a0d8c8eb2b1edf6c317edab
refs/heads/master: fd76f148ebc67d662f71f00128c8ddb0538168c0
14 changes: 10 additions & 4 deletions trunk/drivers/net/wireless/rt2x00/rt2x00debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ void rt2x00debug_dump_frame(struct rt2x00_dev *rt2x00dev,
struct sk_buff *skbcopy;
struct rt2x00dump_hdr *dump_hdr;
struct timeval timestamp;
u32 data_len;

do_gettimeofday(&timestamp);

Expand All @@ -170,7 +171,11 @@ void rt2x00debug_dump_frame(struct rt2x00_dev *rt2x00dev,
return;
}

skbcopy = alloc_skb(sizeof(*dump_hdr) + skbdesc->desc_len + skb->len,
data_len = skb->len;
if (skbdesc->flags & SKBDESC_DESC_IN_SKB)
data_len -= skbdesc->desc_len;

skbcopy = alloc_skb(sizeof(*dump_hdr) + skbdesc->desc_len + data_len,
GFP_ATOMIC);
if (!skbcopy) {
DEBUG(rt2x00dev, "Failed to copy skb for dump.\n");
Expand All @@ -181,7 +186,7 @@ void rt2x00debug_dump_frame(struct rt2x00_dev *rt2x00dev,
dump_hdr->version = cpu_to_le32(DUMP_HEADER_VERSION);
dump_hdr->header_length = cpu_to_le32(sizeof(*dump_hdr));
dump_hdr->desc_length = cpu_to_le32(skbdesc->desc_len);
dump_hdr->data_length = cpu_to_le32(skb->len);
dump_hdr->data_length = cpu_to_le32(data_len);
dump_hdr->chip_rt = cpu_to_le16(rt2x00dev->chip.rt);
dump_hdr->chip_rf = cpu_to_le16(rt2x00dev->chip.rf);
dump_hdr->chip_rev = cpu_to_le16(rt2x00dev->chip.rev);
Expand All @@ -191,8 +196,9 @@ void rt2x00debug_dump_frame(struct rt2x00_dev *rt2x00dev,
dump_hdr->timestamp_sec = cpu_to_le32(timestamp.tv_sec);
dump_hdr->timestamp_usec = cpu_to_le32(timestamp.tv_usec);

memcpy(skb_put(skbcopy, skbdesc->desc_len), skbdesc->desc,
skbdesc->desc_len);
if (!(skbdesc->flags & SKBDESC_DESC_IN_SKB))
memcpy(skb_put(skbcopy, skbdesc->desc_len), skbdesc->desc,
skbdesc->desc_len);
memcpy(skb_put(skbcopy, skb->len), skb->data, skb->len);

skb_queue_tail(&intf->frame_dump_skbqueue, skbcopy);
Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/net/wireless/rt2x00/rt2x00queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,15 @@ enum data_queue_qid {
* mac80211 but was stripped for processing by the driver.
* @SKBDESC_NOT_MAC80211: Frame didn't originate from mac80211,
* don't try to pass it back.
* @SKBDESC_DESC_IN_SKB: The descriptor is at the start of the
* skb, instead of in the desc field.
*/
enum skb_frame_desc_flags {
SKBDESC_DMA_MAPPED_RX = 1 << 0,
SKBDESC_DMA_MAPPED_TX = 1 << 1,
SKBDESC_IV_STRIPPED = 1 << 2,
SKBDESC_NOT_MAC80211 = 1 << 3,
SKBDESC_DESC_IN_SKB = 1 << 4,
};

/**
Expand Down

0 comments on commit 408a92d

Please sign in to comment.