* [PATCH 1/9] rt2x00: Consistently name skb frame descriptor skbdesc.
2010-05-11 21:51 [PATCH 0/9] rt2x00: Further fixes and cleanups Gertjan van Wingerde
@ 2010-05-11 21:51 ` Gertjan van Wingerde
2010-05-12 6:59 ` Ivo Van Doorn
2010-05-11 21:51 ` [PATCH 2/9] rt2x00: Fix beacon descriptor writing for rt61pci Gertjan van Wingerde
` (7 subsequent siblings)
8 siblings, 1 reply; 32+ messages in thread
From: Gertjan van Wingerde @ 2010-05-11 21:51 UTC (permalink / raw)
To: John W. Linville
Cc: Ivo van Doorn, linux-wireless, users, Gertjan van Wingerde
The skb frame descriptor is called everywhere skbdesc, except in one
place in rt2x00debug_dump_frame. Change that occurence to have
consistent naming.
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
---
drivers/net/wireless/rt2x00/rt2x00debug.c | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2x00debug.c b/drivers/net/wireless/rt2x00/rt2x00debug.c
index 70c04c2..9e2eed5 100644
--- a/drivers/net/wireless/rt2x00/rt2x00debug.c
+++ b/drivers/net/wireless/rt2x00/rt2x00debug.c
@@ -155,7 +155,7 @@ void rt2x00debug_dump_frame(struct rt2x00_dev *rt2x00dev,
enum rt2x00_dump_type type, struct sk_buff *skb)
{
struct rt2x00debug_intf *intf = rt2x00dev->debugfs_intf;
- struct skb_frame_desc *desc = get_skb_frame_desc(skb);
+ struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb);
struct sk_buff *skbcopy;
struct rt2x00dump_hdr *dump_hdr;
struct timeval timestamp;
@@ -170,7 +170,7 @@ void rt2x00debug_dump_frame(struct rt2x00_dev *rt2x00dev,
return;
}
- skbcopy = alloc_skb(sizeof(*dump_hdr) + desc->desc_len + skb->len,
+ skbcopy = alloc_skb(sizeof(*dump_hdr) + skbdesc->desc_len + skb->len,
GFP_ATOMIC);
if (!skbcopy) {
DEBUG(rt2x00dev, "Failed to copy skb for dump.\n");
@@ -180,18 +180,19 @@ void rt2x00debug_dump_frame(struct rt2x00_dev *rt2x00dev,
dump_hdr = (struct rt2x00dump_hdr *)skb_put(skbcopy, sizeof(*dump_hdr));
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(desc->desc_len);
+ dump_hdr->desc_length = cpu_to_le32(skbdesc->desc_len);
dump_hdr->data_length = cpu_to_le32(skb->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);
dump_hdr->type = cpu_to_le16(type);
- dump_hdr->queue_index = desc->entry->queue->qid;
- dump_hdr->entry_index = desc->entry->entry_idx;
+ dump_hdr->queue_index = skbdesc->entry->queue->qid;
+ dump_hdr->entry_index = skbdesc->entry->entry_idx;
dump_hdr->timestamp_sec = cpu_to_le32(timestamp.tv_sec);
dump_hdr->timestamp_usec = cpu_to_le32(timestamp.tv_usec);
- memcpy(skb_put(skbcopy, desc->desc_len), desc->desc, desc->desc_len);
+ 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);
--
1.7.1
^ permalink raw reply related [flat|nested] 32+ messages in thread* Re: [PATCH 1/9] rt2x00: Consistently name skb frame descriptor skbdesc.
2010-05-11 21:51 ` [PATCH 1/9] rt2x00: Consistently name skb frame descriptor skbdesc Gertjan van Wingerde
@ 2010-05-12 6:59 ` Ivo Van Doorn
0 siblings, 0 replies; 32+ messages in thread
From: Ivo Van Doorn @ 2010-05-12 6:59 UTC (permalink / raw)
To: Gertjan van Wingerde; +Cc: John W. Linville, linux-wireless, users
On Tue, May 11, 2010 at 11:51 PM, Gertjan van Wingerde
<gwingerde@gmail.com> wrote:
> The skb frame descriptor is called everywhere skbdesc, except in one
> place in rt2x00debug_dump_frame. Change that occurence to have
> consistent naming.
>
> Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
> ---
> drivers/net/wireless/rt2x00/rt2x00debug.c | 13 +++++++------
> 1 files changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/wireless/rt2x00/rt2x00debug.c b/drivers/net/wireless/rt2x00/rt2x00debug.c
> index 70c04c2..9e2eed5 100644
> --- a/drivers/net/wireless/rt2x00/rt2x00debug.c
> +++ b/drivers/net/wireless/rt2x00/rt2x00debug.c
> @@ -155,7 +155,7 @@ void rt2x00debug_dump_frame(struct rt2x00_dev *rt2x00dev,
> enum rt2x00_dump_type type, struct sk_buff *skb)
> {
> struct rt2x00debug_intf *intf = rt2x00dev->debugfs_intf;
> - struct skb_frame_desc *desc = get_skb_frame_desc(skb);
> + struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb);
> struct sk_buff *skbcopy;
> struct rt2x00dump_hdr *dump_hdr;
> struct timeval timestamp;
> @@ -170,7 +170,7 @@ void rt2x00debug_dump_frame(struct rt2x00_dev *rt2x00dev,
> return;
> }
>
> - skbcopy = alloc_skb(sizeof(*dump_hdr) + desc->desc_len + skb->len,
> + skbcopy = alloc_skb(sizeof(*dump_hdr) + skbdesc->desc_len + skb->len,
> GFP_ATOMIC);
> if (!skbcopy) {
> DEBUG(rt2x00dev, "Failed to copy skb for dump.\n");
> @@ -180,18 +180,19 @@ void rt2x00debug_dump_frame(struct rt2x00_dev *rt2x00dev,
> dump_hdr = (struct rt2x00dump_hdr *)skb_put(skbcopy, sizeof(*dump_hdr));
> 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(desc->desc_len);
> + dump_hdr->desc_length = cpu_to_le32(skbdesc->desc_len);
> dump_hdr->data_length = cpu_to_le32(skb->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);
> dump_hdr->type = cpu_to_le16(type);
> - dump_hdr->queue_index = desc->entry->queue->qid;
> - dump_hdr->entry_index = desc->entry->entry_idx;
> + dump_hdr->queue_index = skbdesc->entry->queue->qid;
> + dump_hdr->entry_index = skbdesc->entry->entry_idx;
> dump_hdr->timestamp_sec = cpu_to_le32(timestamp.tv_sec);
> dump_hdr->timestamp_usec = cpu_to_le32(timestamp.tv_usec);
>
> - memcpy(skb_put(skbcopy, desc->desc_len), desc->desc, desc->desc_len);
> + 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);
> --
> 1.7.1
>
>
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 2/9] rt2x00: Fix beacon descriptor writing for rt61pci.
2010-05-11 21:51 [PATCH 0/9] rt2x00: Further fixes and cleanups Gertjan van Wingerde
2010-05-11 21:51 ` [PATCH 1/9] rt2x00: Consistently name skb frame descriptor skbdesc Gertjan van Wingerde
@ 2010-05-11 21:51 ` Gertjan van Wingerde
2010-05-12 6:59 ` Ivo Van Doorn
2010-05-12 18:47 ` Ivo Van Doorn
2010-05-11 21:51 ` [PATCH 3/9] rt2x00: Re-order tx descriptor writing code in drivers Gertjan van Wingerde
` (6 subsequent siblings)
8 siblings, 2 replies; 32+ messages in thread
From: Gertjan van Wingerde @ 2010-05-11 21:51 UTC (permalink / raw)
To: John W. Linville
Cc: Ivo van Doorn, linux-wireless, users, Gertjan van Wingerde
The buffer address descriptor word is not part of the TXINFO structure
needed for beacons. The current writing of that word for beacons is
therefore an out-of-bounds write.
Fix this by only writing the buffer address descriptor word for TX
queues.
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
---
drivers/net/wireless/rt2x00/rt61pci.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index 2436363..99c2981 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -1801,12 +1801,12 @@ static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
rt2x00_set_field32(&word, TXD_W5_WAITING_DMA_DONE_INT, 1);
rt2x00_desc_write(txd, 5, word);
- rt2x00_desc_read(txd, 6, &word);
- rt2x00_set_field32(&word, TXD_W6_BUFFER_PHYSICAL_ADDRESS,
- skbdesc->skb_dma);
- rt2x00_desc_write(txd, 6, word);
+ if (txdesc->queue != QID_BEACON) {
+ rt2x00_desc_read(txd, 6, &word);
+ rt2x00_set_field32(&word, TXD_W6_BUFFER_PHYSICAL_ADDRESS,
+ skbdesc->skb_dma);
+ rt2x00_desc_write(txd, 6, word);
- if (skbdesc->desc_len > TXINFO_SIZE) {
rt2x00_desc_read(txd, 11, &word);
rt2x00_set_field32(&word, TXD_W11_BUFFER_LENGTH0,
txdesc->length);
--
1.7.1
^ permalink raw reply related [flat|nested] 32+ messages in thread* Re: [PATCH 2/9] rt2x00: Fix beacon descriptor writing for rt61pci.
2010-05-11 21:51 ` [PATCH 2/9] rt2x00: Fix beacon descriptor writing for rt61pci Gertjan van Wingerde
@ 2010-05-12 6:59 ` Ivo Van Doorn
2010-05-12 9:46 ` Gertjan van Wingerde
2010-05-12 18:47 ` Ivo Van Doorn
1 sibling, 1 reply; 32+ messages in thread
From: Ivo Van Doorn @ 2010-05-12 6:59 UTC (permalink / raw)
To: Gertjan van Wingerde; +Cc: John W. Linville, linux-wireless, users
On Tue, May 11, 2010 at 11:51 PM, Gertjan van Wingerde
<gwingerde@gmail.com> wrote:
> The buffer address descriptor word is not part of the TXINFO structure
> needed for beacons. The current writing of that word for beacons is
> therefore an out-of-bounds write.
> Fix this by only writing the buffer address descriptor word for TX
> queues.
>
> Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
> ---
> drivers/net/wireless/rt2x00/rt61pci.c | 10 +++++-----
> 1 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
> index 2436363..99c2981 100644
> --- a/drivers/net/wireless/rt2x00/rt61pci.c
> +++ b/drivers/net/wireless/rt2x00/rt61pci.c
> @@ -1801,12 +1801,12 @@ static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
> rt2x00_set_field32(&word, TXD_W5_WAITING_DMA_DONE_INT, 1);
> rt2x00_desc_write(txd, 5, word);
>
> - rt2x00_desc_read(txd, 6, &word);
> - rt2x00_set_field32(&word, TXD_W6_BUFFER_PHYSICAL_ADDRESS,
> - skbdesc->skb_dma);
> - rt2x00_desc_write(txd, 6, word);
> + if (txdesc->queue != QID_BEACON) {
> + rt2x00_desc_read(txd, 6, &word);
> + rt2x00_set_field32(&word, TXD_W6_BUFFER_PHYSICAL_ADDRESS,
> + skbdesc->skb_dma);
> + rt2x00_desc_write(txd, 6, word);
>
> - if (skbdesc->desc_len > TXINFO_SIZE) {
> rt2x00_desc_read(txd, 11, &word);
> rt2x00_set_field32(&word, TXD_W11_BUFFER_LENGTH0,
> txdesc->length);
Shouldn't the check for TXINFO_SIZE be used rather than explicitly
checking for the QID?
Ivo
^ permalink raw reply [flat|nested] 32+ messages in thread* Re: [PATCH 2/9] rt2x00: Fix beacon descriptor writing for rt61pci.
2010-05-12 6:59 ` Ivo Van Doorn
@ 2010-05-12 9:46 ` Gertjan van Wingerde
2010-05-12 17:43 ` Ivo Van Doorn
0 siblings, 1 reply; 32+ messages in thread
From: Gertjan van Wingerde @ 2010-05-12 9:46 UTC (permalink / raw)
To: Ivo Van Doorn; +Cc: John W. Linville, linux-wireless, users
On Wed, May 12, 2010 at 8:59 AM, Ivo Van Doorn <ivdoorn@gmail.com> wrote:
> On Tue, May 11, 2010 at 11:51 PM, Gertjan van Wingerde
> <gwingerde@gmail.com> wrote:
>> The buffer address descriptor word is not part of the TXINFO structure
>> needed for beacons. The current writing of that word for beacons is
>> therefore an out-of-bounds write.
>> Fix this by only writing the buffer address descriptor word for TX
>> queues.
>>
>> Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
>> ---
>> drivers/net/wireless/rt2x00/rt61pci.c | 10 +++++-----
>> 1 files changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
>> index 2436363..99c2981 100644
>> --- a/drivers/net/wireless/rt2x00/rt61pci.c
>> +++ b/drivers/net/wireless/rt2x00/rt61pci.c
>> @@ -1801,12 +1801,12 @@ static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
>> rt2x00_set_field32(&word, TXD_W5_WAITING_DMA_DONE_INT, 1);
>> rt2x00_desc_write(txd, 5, word);
>>
>> - rt2x00_desc_read(txd, 6, &word);
>> - rt2x00_set_field32(&word, TXD_W6_BUFFER_PHYSICAL_ADDRESS,
>> - skbdesc->skb_dma);
>> - rt2x00_desc_write(txd, 6, word);
>> + if (txdesc->queue != QID_BEACON) {
>> + rt2x00_desc_read(txd, 6, &word);
>> + rt2x00_set_field32(&word, TXD_W6_BUFFER_PHYSICAL_ADDRESS,
>> + skbdesc->skb_dma);
>> + rt2x00_desc_write(txd, 6, word);
>>
>> - if (skbdesc->desc_len > TXINFO_SIZE) {
>> rt2x00_desc_read(txd, 11, &word);
>> rt2x00_set_field32(&word, TXD_W11_BUFFER_LENGTH0,
>> txdesc->length);
>
> Shouldn't the check for TXINFO_SIZE be used rather than explicitly
> checking for the QID?
>
I agree that this is a change that didn't have to be made in this patch.
However, after patch 4 of the series we cannot depend on the
skbdesc->desc_len being set anymore, and we would have to depend on
checking the QID anyway.
Note that in reality these two checks are completely equivalent with
respect to the result.
---
Gertjan.
^ permalink raw reply [flat|nested] 32+ messages in thread* Re: [PATCH 2/9] rt2x00: Fix beacon descriptor writing for rt61pci.
2010-05-12 9:46 ` Gertjan van Wingerde
@ 2010-05-12 17:43 ` Ivo Van Doorn
2010-05-12 18:42 ` Gertjan van Wingerde
0 siblings, 1 reply; 32+ messages in thread
From: Ivo Van Doorn @ 2010-05-12 17:43 UTC (permalink / raw)
To: Gertjan van Wingerde; +Cc: John W. Linville, linux-wireless, users
On Wed, May 12, 2010 at 11:46 AM, Gertjan van Wingerde
<gwingerde@gmail.com> wrote:
> On Wed, May 12, 2010 at 8:59 AM, Ivo Van Doorn <ivdoorn@gmail.com> wrote:
>> On Tue, May 11, 2010 at 11:51 PM, Gertjan van Wingerde
>> <gwingerde@gmail.com> wrote:
>>> The buffer address descriptor word is not part of the TXINFO structure
>>> needed for beacons. The current writing of that word for beacons is
>>> therefore an out-of-bounds write.
>>> Fix this by only writing the buffer address descriptor word for TX
>>> queues.
>>>
>>> Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
>>> ---
>>> drivers/net/wireless/rt2x00/rt61pci.c | 10 +++++-----
>>> 1 files changed, 5 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
>>> index 2436363..99c2981 100644
>>> --- a/drivers/net/wireless/rt2x00/rt61pci.c
>>> +++ b/drivers/net/wireless/rt2x00/rt61pci.c
>>> @@ -1801,12 +1801,12 @@ static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
>>> rt2x00_set_field32(&word, TXD_W5_WAITING_DMA_DONE_INT, 1);
>>> rt2x00_desc_write(txd, 5, word);
>>>
>>> - rt2x00_desc_read(txd, 6, &word);
>>> - rt2x00_set_field32(&word, TXD_W6_BUFFER_PHYSICAL_ADDRESS,
>>> - skbdesc->skb_dma);
>>> - rt2x00_desc_write(txd, 6, word);
>>> + if (txdesc->queue != QID_BEACON) {
>>> + rt2x00_desc_read(txd, 6, &word);
>>> + rt2x00_set_field32(&word, TXD_W6_BUFFER_PHYSICAL_ADDRESS,
>>> + skbdesc->skb_dma);
>>> + rt2x00_desc_write(txd, 6, word);
>>>
>>> - if (skbdesc->desc_len > TXINFO_SIZE) {
>>> rt2x00_desc_read(txd, 11, &word);
>>> rt2x00_set_field32(&word, TXD_W11_BUFFER_LENGTH0,
>>> txdesc->length);
>>
>> Shouldn't the check for TXINFO_SIZE be used rather than explicitly
>> checking for the QID?
>>
>
> I agree that this is a change that didn't have to be made in this patch.
> However, after patch 4 of the series we cannot depend on the
> skbdesc->desc_len being set anymore, and we would have to depend on
> checking the QID anyway.
> Note that in reality these two checks are completely equivalent with
> respect to the result.
Hmm, is that a good idea? I mean we are using the skbdesc inside the
function, but we can't be sure that one of the basic values contains the right
value?
Ivo
^ permalink raw reply [flat|nested] 32+ messages in thread* Re: [PATCH 2/9] rt2x00: Fix beacon descriptor writing for rt61pci.
2010-05-12 17:43 ` Ivo Van Doorn
@ 2010-05-12 18:42 ` Gertjan van Wingerde
2010-05-12 18:46 ` Ivo Van Doorn
0 siblings, 1 reply; 32+ messages in thread
From: Gertjan van Wingerde @ 2010-05-12 18:42 UTC (permalink / raw)
To: Ivo Van Doorn; +Cc: John W. Linville, linux-wireless, users
On 05/12/10 19:43, Ivo Van Doorn wrote:
> On Wed, May 12, 2010 at 11:46 AM, Gertjan van Wingerde
> <gwingerde@gmail.com> wrote:
>> On Wed, May 12, 2010 at 8:59 AM, Ivo Van Doorn <ivdoorn@gmail.com> wrote:
>>> On Tue, May 11, 2010 at 11:51 PM, Gertjan van Wingerde
>>> <gwingerde@gmail.com> wrote:
>>>> The buffer address descriptor word is not part of the TXINFO structure
>>>> needed for beacons. The current writing of that word for beacons is
>>>> therefore an out-of-bounds write.
>>>> Fix this by only writing the buffer address descriptor word for TX
>>>> queues.
>>>>
>>>> Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
>>>> ---
>>>> drivers/net/wireless/rt2x00/rt61pci.c | 10 +++++-----
>>>> 1 files changed, 5 insertions(+), 5 deletions(-)
>>>>
>>>> diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
>>>> index 2436363..99c2981 100644
>>>> --- a/drivers/net/wireless/rt2x00/rt61pci.c
>>>> +++ b/drivers/net/wireless/rt2x00/rt61pci.c
>>>> @@ -1801,12 +1801,12 @@ static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
>>>> rt2x00_set_field32(&word, TXD_W5_WAITING_DMA_DONE_INT, 1);
>>>> rt2x00_desc_write(txd, 5, word);
>>>>
>>>> - rt2x00_desc_read(txd, 6, &word);
>>>> - rt2x00_set_field32(&word, TXD_W6_BUFFER_PHYSICAL_ADDRESS,
>>>> - skbdesc->skb_dma);
>>>> - rt2x00_desc_write(txd, 6, word);
>>>> + if (txdesc->queue != QID_BEACON) {
>>>> + rt2x00_desc_read(txd, 6, &word);
>>>> + rt2x00_set_field32(&word, TXD_W6_BUFFER_PHYSICAL_ADDRESS,
>>>> + skbdesc->skb_dma);
>>>> + rt2x00_desc_write(txd, 6, word);
>>>>
>>>> - if (skbdesc->desc_len > TXINFO_SIZE) {
>>>> rt2x00_desc_read(txd, 11, &word);
>>>> rt2x00_set_field32(&word, TXD_W11_BUFFER_LENGTH0,
>>>> txdesc->length);
>>>
>>> Shouldn't the check for TXINFO_SIZE be used rather than explicitly
>>> checking for the QID?
>>>
>>
>> I agree that this is a change that didn't have to be made in this patch.
>> However, after patch 4 of the series we cannot depend on the
>> skbdesc->desc_len being set anymore, and we would have to depend on
>> checking the QID anyway.
>> Note that in reality these two checks are completely equivalent with
>> respect to the result.
>
> Hmm, is that a good idea? I mean we are using the skbdesc inside the
> function, but we can't be sure that one of the basic values contains the right
> value?
>
To be honest, the chipset drivers don't need the skbdesc->desc and skbdesc->desc_len
at all. Based on the queue ID they already have everything they need to know to write
a descriptor. As far as I can tell the only code that really needs those two fields is
the rt2x00debug code, to dump a frame to userspace via debugfs.
As the dumping through debugfs is done after writing the TX descriptor, with this patch
I changed the desc and desc_len fields of the skbdesc to be output of the write_tx_desc
function (for the generic parts of the rt2x00 code) rather than being input.
Note that originally my plan was to get rid of the desc and desc_len field altogether,
but for now I refrained from doing that.
---
Gertjan.
^ permalink raw reply [flat|nested] 32+ messages in thread* Re: [PATCH 2/9] rt2x00: Fix beacon descriptor writing for rt61pci.
2010-05-12 18:42 ` Gertjan van Wingerde
@ 2010-05-12 18:46 ` Ivo Van Doorn
0 siblings, 0 replies; 32+ messages in thread
From: Ivo Van Doorn @ 2010-05-12 18:46 UTC (permalink / raw)
To: Gertjan van Wingerde; +Cc: John W. Linville, linux-wireless, users
On Wed, May 12, 2010 at 8:42 PM, Gertjan van Wingerde
<gwingerde@gmail.com> wrote:
> On 05/12/10 19:43, Ivo Van Doorn wrote:
>> On Wed, May 12, 2010 at 11:46 AM, Gertjan van Wingerde
>> <gwingerde@gmail.com> wrote:
>>> On Wed, May 12, 2010 at 8:59 AM, Ivo Van Doorn <ivdoorn@gmail.com> wrote:
>>>> On Tue, May 11, 2010 at 11:51 PM, Gertjan van Wingerde
>>>> <gwingerde@gmail.com> wrote:
>>>>> The buffer address descriptor word is not part of the TXINFO structure
>>>>> needed for beacons. The current writing of that word for beacons is
>>>>> therefore an out-of-bounds write.
>>>>> Fix this by only writing the buffer address descriptor word for TX
>>>>> queues.
>>>>>
>>>>> Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
>>>>> ---
>>>>> drivers/net/wireless/rt2x00/rt61pci.c | 10 +++++-----
>>>>> 1 files changed, 5 insertions(+), 5 deletions(-)
>>>>>
>>>>> diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
>>>>> index 2436363..99c2981 100644
>>>>> --- a/drivers/net/wireless/rt2x00/rt61pci.c
>>>>> +++ b/drivers/net/wireless/rt2x00/rt61pci.c
>>>>> @@ -1801,12 +1801,12 @@ static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
>>>>> rt2x00_set_field32(&word, TXD_W5_WAITING_DMA_DONE_INT, 1);
>>>>> rt2x00_desc_write(txd, 5, word);
>>>>>
>>>>> - rt2x00_desc_read(txd, 6, &word);
>>>>> - rt2x00_set_field32(&word, TXD_W6_BUFFER_PHYSICAL_ADDRESS,
>>>>> - skbdesc->skb_dma);
>>>>> - rt2x00_desc_write(txd, 6, word);
>>>>> + if (txdesc->queue != QID_BEACON) {
>>>>> + rt2x00_desc_read(txd, 6, &word);
>>>>> + rt2x00_set_field32(&word, TXD_W6_BUFFER_PHYSICAL_ADDRESS,
>>>>> + skbdesc->skb_dma);
>>>>> + rt2x00_desc_write(txd, 6, word);
>>>>>
>>>>> - if (skbdesc->desc_len > TXINFO_SIZE) {
>>>>> rt2x00_desc_read(txd, 11, &word);
>>>>> rt2x00_set_field32(&word, TXD_W11_BUFFER_LENGTH0,
>>>>> txdesc->length);
>>>>
>>>> Shouldn't the check for TXINFO_SIZE be used rather than explicitly
>>>> checking for the QID?
>>>>
>>>
>>> I agree that this is a change that didn't have to be made in this patch.
>>> However, after patch 4 of the series we cannot depend on the
>>> skbdesc->desc_len being set anymore, and we would have to depend on
>>> checking the QID anyway.
>>> Note that in reality these two checks are completely equivalent with
>>> respect to the result.
>>
>> Hmm, is that a good idea? I mean we are using the skbdesc inside the
>> function, but we can't be sure that one of the basic values contains the right
>> value?
>>
>
> To be honest, the chipset drivers don't need the skbdesc->desc and skbdesc->desc_len
> at all. Based on the queue ID they already have everything they need to know to write
> a descriptor. As far as I can tell the only code that really needs those two fields is
> the rt2x00debug code, to dump a frame to userspace via debugfs.
>
> As the dumping through debugfs is done after writing the TX descriptor, with this patch
> I changed the desc and desc_len fields of the skbdesc to be output of the write_tx_desc
> function (for the generic parts of the rt2x00 code) rather than being input.
>
> Note that originally my plan was to get rid of the desc and desc_len field altogether,
> but for now I refrained from doing that.
Ah ok. Thanks for the explanation.
Ivo
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 2/9] rt2x00: Fix beacon descriptor writing for rt61pci.
2010-05-11 21:51 ` [PATCH 2/9] rt2x00: Fix beacon descriptor writing for rt61pci Gertjan van Wingerde
2010-05-12 6:59 ` Ivo Van Doorn
@ 2010-05-12 18:47 ` Ivo Van Doorn
1 sibling, 0 replies; 32+ messages in thread
From: Ivo Van Doorn @ 2010-05-12 18:47 UTC (permalink / raw)
To: Gertjan van Wingerde; +Cc: John W. Linville, linux-wireless, users
On Tue, May 11, 2010 at 11:51 PM, Gertjan van Wingerde
<gwingerde@gmail.com> wrote:
> The buffer address descriptor word is not part of the TXINFO structure
> needed for beacons. The current writing of that word for beacons is
> therefore an out-of-bounds write.
> Fix this by only writing the buffer address descriptor word for TX
> queues.
>
> Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 3/9] rt2x00: Re-order tx descriptor writing code in drivers.
2010-05-11 21:51 [PATCH 0/9] rt2x00: Further fixes and cleanups Gertjan van Wingerde
2010-05-11 21:51 ` [PATCH 1/9] rt2x00: Consistently name skb frame descriptor skbdesc Gertjan van Wingerde
2010-05-11 21:51 ` [PATCH 2/9] rt2x00: Fix beacon descriptor writing for rt61pci Gertjan van Wingerde
@ 2010-05-11 21:51 ` Gertjan van Wingerde
2010-05-12 7:00 ` Ivo Van Doorn
2010-05-11 21:51 ` [PATCH 4/9] rt2x00: Simplify TXD handling of beacons Gertjan van Wingerde
` (5 subsequent siblings)
8 siblings, 1 reply; 32+ messages in thread
From: Gertjan van Wingerde @ 2010-05-11 21:51 UTC (permalink / raw)
To: John W. Linville
Cc: Ivo van Doorn, linux-wireless, users, Gertjan van Wingerde
Where possible, write the tx descriptor words from start to end, to
follow a logical ordering of words.
Where this is not possible (in rt2400pci, rt2500pci and rt61pci) add
a comment as to why word 0 needs to be written last.
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
---
drivers/net/wireless/rt2x00/rt2400pci.c | 5 +++
drivers/net/wireless/rt2x00/rt2500pci.c | 5 +++
drivers/net/wireless/rt2x00/rt2500usb.c | 36 +++++++++++-----------
drivers/net/wireless/rt2x00/rt61pci.c | 5 +++
drivers/net/wireless/rt2x00/rt73usb.c | 52 +++++++++++++++---------------
5 files changed, 59 insertions(+), 44 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index 4b38451..1eff6ec 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -1039,6 +1039,11 @@ static void rt2400pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
rt2x00_set_field32(&word, TXD_W3_PLCP_LENGTH_HIGH_BUSY, 1);
rt2x00_desc_write(txd, 4, word);
+ /*
+ * Writing TXD word 0 must the last to prevent a race condition with
+ * the device, whereby the device may take hold of the TXD before we
+ * finished updating it.
+ */
rt2x00_desc_read(txd, 0, &word);
rt2x00_set_field32(&word, TXD_W0_OWNER_NIC, 1);
rt2x00_set_field32(&word, TXD_W0_VALID, 1);
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index d876c6d..8d3e95e 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -1193,6 +1193,11 @@ static void rt2500pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
test_bit(ENTRY_TXD_RTS_FRAME, &txdesc->flags));
rt2x00_desc_write(txd, 10, word);
+ /*
+ * Writing TXD word 0 must the last to prevent a race condition with
+ * the device, whereby the device may take hold of the TXD before we
+ * finished updating it.
+ */
rt2x00_desc_read(txd, 0, &word);
rt2x00_set_field32(&word, TXD_W0_OWNER_NIC, 1);
rt2x00_set_field32(&word, TXD_W0_VALID, 1);
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index 30c0544..9a915be 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -1039,6 +1039,24 @@ static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
/*
* Start writing the descriptor words.
*/
+ rt2x00_desc_read(txd, 0, &word);
+ rt2x00_set_field32(&word, TXD_W0_RETRY_LIMIT, txdesc->retry_limit);
+ rt2x00_set_field32(&word, TXD_W0_MORE_FRAG,
+ test_bit(ENTRY_TXD_MORE_FRAG, &txdesc->flags));
+ rt2x00_set_field32(&word, TXD_W0_ACK,
+ test_bit(ENTRY_TXD_ACK, &txdesc->flags));
+ rt2x00_set_field32(&word, TXD_W0_TIMESTAMP,
+ test_bit(ENTRY_TXD_REQ_TIMESTAMP, &txdesc->flags));
+ rt2x00_set_field32(&word, TXD_W0_OFDM,
+ (txdesc->rate_mode == RATE_MODE_OFDM));
+ rt2x00_set_field32(&word, TXD_W0_NEW_SEQ,
+ test_bit(ENTRY_TXD_FIRST_FRAGMENT, &txdesc->flags));
+ rt2x00_set_field32(&word, TXD_W0_IFS, txdesc->ifs);
+ rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, txdesc->length);
+ rt2x00_set_field32(&word, TXD_W0_CIPHER, !!txdesc->cipher);
+ rt2x00_set_field32(&word, TXD_W0_KEY_ID, txdesc->key_idx);
+ rt2x00_desc_write(txd, 0, word);
+
rt2x00_desc_read(txd, 1, &word);
rt2x00_set_field32(&word, TXD_W1_IV_OFFSET, txdesc->iv_offset);
rt2x00_set_field32(&word, TXD_W1_AIFS, txdesc->aifs);
@@ -1057,24 +1075,6 @@ static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
_rt2x00_desc_write(txd, 3, skbdesc->iv[0]);
_rt2x00_desc_write(txd, 4, skbdesc->iv[1]);
}
-
- rt2x00_desc_read(txd, 0, &word);
- rt2x00_set_field32(&word, TXD_W0_RETRY_LIMIT, txdesc->retry_limit);
- rt2x00_set_field32(&word, TXD_W0_MORE_FRAG,
- test_bit(ENTRY_TXD_MORE_FRAG, &txdesc->flags));
- rt2x00_set_field32(&word, TXD_W0_ACK,
- test_bit(ENTRY_TXD_ACK, &txdesc->flags));
- rt2x00_set_field32(&word, TXD_W0_TIMESTAMP,
- test_bit(ENTRY_TXD_REQ_TIMESTAMP, &txdesc->flags));
- rt2x00_set_field32(&word, TXD_W0_OFDM,
- (txdesc->rate_mode == RATE_MODE_OFDM));
- rt2x00_set_field32(&word, TXD_W0_NEW_SEQ,
- test_bit(ENTRY_TXD_FIRST_FRAGMENT, &txdesc->flags));
- rt2x00_set_field32(&word, TXD_W0_IFS, txdesc->ifs);
- rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, txdesc->length);
- rt2x00_set_field32(&word, TXD_W0_CIPHER, !!txdesc->cipher);
- rt2x00_set_field32(&word, TXD_W0_KEY_ID, txdesc->key_idx);
- rt2x00_desc_write(txd, 0, word);
}
/*
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index 99c2981..55aa010 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -1813,6 +1813,11 @@ static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
rt2x00_desc_write(txd, 11, word);
}
+ /*
+ * Writing TXD word 0 must the last to prevent a race condition with
+ * the device, whereby the device may take hold of the TXD before we
+ * finished updating it.
+ */
rt2x00_desc_read(txd, 0, &word);
rt2x00_set_field32(&word, TXD_W0_OWNER_NIC, 1);
rt2x00_set_field32(&word, TXD_W0_VALID, 1);
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 81f6db1..fa40d43 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -1446,6 +1446,32 @@ static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
/*
* Start writing the descriptor words.
*/
+ rt2x00_desc_read(txd, 0, &word);
+ rt2x00_set_field32(&word, TXD_W0_BURST,
+ test_bit(ENTRY_TXD_BURST, &txdesc->flags));
+ rt2x00_set_field32(&word, TXD_W0_VALID, 1);
+ rt2x00_set_field32(&word, TXD_W0_MORE_FRAG,
+ test_bit(ENTRY_TXD_MORE_FRAG, &txdesc->flags));
+ rt2x00_set_field32(&word, TXD_W0_ACK,
+ test_bit(ENTRY_TXD_ACK, &txdesc->flags));
+ rt2x00_set_field32(&word, TXD_W0_TIMESTAMP,
+ test_bit(ENTRY_TXD_REQ_TIMESTAMP, &txdesc->flags));
+ rt2x00_set_field32(&word, TXD_W0_OFDM,
+ (txdesc->rate_mode == RATE_MODE_OFDM));
+ rt2x00_set_field32(&word, TXD_W0_IFS, txdesc->ifs);
+ rt2x00_set_field32(&word, TXD_W0_RETRY_MODE,
+ test_bit(ENTRY_TXD_RETRY_MODE, &txdesc->flags));
+ rt2x00_set_field32(&word, TXD_W0_TKIP_MIC,
+ test_bit(ENTRY_TXD_ENCRYPT_MMIC, &txdesc->flags));
+ rt2x00_set_field32(&word, TXD_W0_KEY_TABLE,
+ test_bit(ENTRY_TXD_ENCRYPT_PAIRWISE, &txdesc->flags));
+ rt2x00_set_field32(&word, TXD_W0_KEY_INDEX, txdesc->key_idx);
+ rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, txdesc->length);
+ rt2x00_set_field32(&word, TXD_W0_BURST2,
+ test_bit(ENTRY_TXD_BURST, &txdesc->flags));
+ rt2x00_set_field32(&word, TXD_W0_CIPHER_ALG, txdesc->cipher);
+ rt2x00_desc_write(txd, 0, word);
+
rt2x00_desc_read(txd, 1, &word);
rt2x00_set_field32(&word, TXD_W1_HOST_Q_ID, txdesc->queue);
rt2x00_set_field32(&word, TXD_W1_AIFSN, txdesc->aifs);
@@ -1473,32 +1499,6 @@ static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
TXPOWER_TO_DEV(rt2x00dev->tx_power));
rt2x00_set_field32(&word, TXD_W5_WAITING_DMA_DONE_INT, 1);
rt2x00_desc_write(txd, 5, word);
-
- rt2x00_desc_read(txd, 0, &word);
- rt2x00_set_field32(&word, TXD_W0_BURST,
- test_bit(ENTRY_TXD_BURST, &txdesc->flags));
- rt2x00_set_field32(&word, TXD_W0_VALID, 1);
- rt2x00_set_field32(&word, TXD_W0_MORE_FRAG,
- test_bit(ENTRY_TXD_MORE_FRAG, &txdesc->flags));
- rt2x00_set_field32(&word, TXD_W0_ACK,
- test_bit(ENTRY_TXD_ACK, &txdesc->flags));
- rt2x00_set_field32(&word, TXD_W0_TIMESTAMP,
- test_bit(ENTRY_TXD_REQ_TIMESTAMP, &txdesc->flags));
- rt2x00_set_field32(&word, TXD_W0_OFDM,
- (txdesc->rate_mode == RATE_MODE_OFDM));
- rt2x00_set_field32(&word, TXD_W0_IFS, txdesc->ifs);
- rt2x00_set_field32(&word, TXD_W0_RETRY_MODE,
- test_bit(ENTRY_TXD_RETRY_MODE, &txdesc->flags));
- rt2x00_set_field32(&word, TXD_W0_TKIP_MIC,
- test_bit(ENTRY_TXD_ENCRYPT_MMIC, &txdesc->flags));
- rt2x00_set_field32(&word, TXD_W0_KEY_TABLE,
- test_bit(ENTRY_TXD_ENCRYPT_PAIRWISE, &txdesc->flags));
- rt2x00_set_field32(&word, TXD_W0_KEY_INDEX, txdesc->key_idx);
- rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, txdesc->length);
- rt2x00_set_field32(&word, TXD_W0_BURST2,
- test_bit(ENTRY_TXD_BURST, &txdesc->flags));
- rt2x00_set_field32(&word, TXD_W0_CIPHER_ALG, txdesc->cipher);
- rt2x00_desc_write(txd, 0, word);
}
/*
--
1.7.1
^ permalink raw reply related [flat|nested] 32+ messages in thread* [PATCH 4/9] rt2x00: Simplify TXD handling of beacons.
2010-05-11 21:51 [PATCH 0/9] rt2x00: Further fixes and cleanups Gertjan van Wingerde
` (2 preceding siblings ...)
2010-05-11 21:51 ` [PATCH 3/9] rt2x00: Re-order tx descriptor writing code in drivers Gertjan van Wingerde
@ 2010-05-11 21:51 ` Gertjan van Wingerde
2010-05-12 7:11 ` Ivo Van Doorn
2010-05-11 21:51 ` [PATCH 5/9] rt2x00: Dump beacons under a different identifier than TX frames Gertjan van Wingerde
` (4 subsequent siblings)
8 siblings, 1 reply; 32+ messages in thread
From: Gertjan van Wingerde @ 2010-05-11 21:51 UTC (permalink / raw)
To: John W. Linville
Cc: Ivo van Doorn, linux-wireless, users, Gertjan van Wingerde
The handling of tx descriptors for beacons can be simplified by updating
write_tx_desc implementations of each driver to write directly to the
queue entry descriptor instead of to a provided memory area.
This is also a preparation for further clean ups where descriptors are
properly reserved in the skb instead of fiddling with the skb data
pointer.
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
---
drivers/net/wireless/rt2x00/rt2400pci.c | 21 +++++++++------------
drivers/net/wireless/rt2x00/rt2500pci.c | 21 +++++++++------------
drivers/net/wireless/rt2x00/rt2500usb.c | 21 ++++++++++++---------
drivers/net/wireless/rt2x00/rt2800pci.c | 14 ++++++++++----
drivers/net/wireless/rt2x00/rt2800usb.c | 8 +++++++-
drivers/net/wireless/rt2x00/rt2x00pci.c | 9 ---------
drivers/net/wireless/rt2x00/rt2x00queue.c | 10 ----------
drivers/net/wireless/rt2x00/rt2x00usb.c | 8 --------
drivers/net/wireless/rt2x00/rt61pci.c | 20 +++++++++++++-------
drivers/net/wireless/rt2x00/rt73usb.c | 21 ++++++++++++---------
10 files changed, 72 insertions(+), 81 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index 1eff6ec..def3fa4 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -1006,15 +1006,15 @@ static void rt2400pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
{
struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb);
struct queue_entry_priv_pci *entry_priv = skbdesc->entry->priv_data;
- __le32 *txd = skbdesc->desc;
+ __le32 *txd = entry_priv->desc;
u32 word;
/*
* Start writing the descriptor words.
*/
- rt2x00_desc_read(entry_priv->desc, 1, &word);
+ rt2x00_desc_read(txd, 1, &word);
rt2x00_set_field32(&word, TXD_W1_BUFFER_ADDRESS, skbdesc->skb_dma);
- rt2x00_desc_write(entry_priv->desc, 1, word);
+ rt2x00_desc_write(txd, 1, word);
rt2x00_desc_read(txd, 2, &word);
rt2x00_set_field32(&word, TXD_W2_BUFFER_LENGTH, txdesc->length);
@@ -1059,6 +1059,12 @@ static void rt2400pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
rt2x00_set_field32(&word, TXD_W0_RETRY_MODE,
test_bit(ENTRY_TXD_RETRY_MODE, &txdesc->flags));
rt2x00_desc_write(txd, 0, word);
+
+ /*
+ * Register descriptor details in skb frame descriptor.
+ */
+ skbdesc->desc = txd;
+ skbdesc->desc_len = TXD_DESC_SIZE;
}
/*
@@ -1081,15 +1087,6 @@ static void rt2400pci_write_beacon(struct queue_entry *entry,
rt2x00_set_field32(®, CSR14_BEACON_GEN, 0);
rt2x00pci_register_write(rt2x00dev, CSR14, reg);
- /*
- * Replace rt2x00lib allocated descriptor with the
- * pointer to the _real_ hardware descriptor.
- * After that, map the beacon to DMA and update the
- * descriptor.
- */
- memcpy(entry_priv->desc, skbdesc->desc, skbdesc->desc_len);
- skbdesc->desc = entry_priv->desc;
-
rt2x00queue_map_txskb(rt2x00dev, entry->skb);
rt2x00_desc_read(entry_priv->desc, 1, &word);
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index 8d3e95e..070c23e 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -1164,15 +1164,15 @@ static void rt2500pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
{
struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb);
struct queue_entry_priv_pci *entry_priv = skbdesc->entry->priv_data;
- __le32 *txd = skbdesc->desc;
+ __le32 *txd = entry_priv->desc;
u32 word;
/*
* Start writing the descriptor words.
*/
- rt2x00_desc_read(entry_priv->desc, 1, &word);
+ rt2x00_desc_read(txd, 1, &word);
rt2x00_set_field32(&word, TXD_W1_BUFFER_ADDRESS, skbdesc->skb_dma);
- rt2x00_desc_write(entry_priv->desc, 1, word);
+ rt2x00_desc_write(txd, 1, word);
rt2x00_desc_read(txd, 2, &word);
rt2x00_set_field32(&word, TXD_W2_IV_OFFSET, IEEE80211_HEADER);
@@ -1216,6 +1216,12 @@ static void rt2500pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, txdesc->length);
rt2x00_set_field32(&word, TXD_W0_CIPHER_ALG, CIPHER_NONE);
rt2x00_desc_write(txd, 0, word);
+
+ /*
+ * Register descriptor details in skb frame descriptor.
+ */
+ skbdesc->desc = txd;
+ skbdesc->desc_len = TXD_DESC_SIZE;
}
/*
@@ -1238,15 +1244,6 @@ static void rt2500pci_write_beacon(struct queue_entry *entry,
rt2x00_set_field32(®, CSR14_BEACON_GEN, 0);
rt2x00pci_register_write(rt2x00dev, CSR14, reg);
- /*
- * Replace rt2x00lib allocated descriptor with the
- * pointer to the _real_ hardware descriptor.
- * After that, map the beacon to DMA and update the
- * descriptor.
- */
- memcpy(entry_priv->desc, skbdesc->desc, skbdesc->desc_len);
- skbdesc->desc = entry_priv->desc;
-
rt2x00queue_map_txskb(rt2x00dev, entry->skb);
rt2x00_desc_read(entry_priv->desc, 1, &word);
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index 9a915be..b985d8f 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -1033,7 +1033,7 @@ static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
struct txentry_desc *txdesc)
{
struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb);
- __le32 *txd = skbdesc->desc;
+ __le32 *txd = (__le32 *)(skb->data - TXD_DESC_SIZE);
u32 word;
/*
@@ -1075,6 +1075,12 @@ static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
_rt2x00_desc_write(txd, 3, skbdesc->iv[0]);
_rt2x00_desc_write(txd, 4, skbdesc->iv[1]);
}
+
+ /*
+ * Register descriptor details in skb frame descriptor.
+ */
+ skbdesc->desc = txd;
+ skbdesc->desc_len = TXD_DESC_SIZE;
}
/*
@@ -1088,19 +1094,11 @@ static void rt2500usb_write_beacon(struct queue_entry *entry,
struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
struct usb_device *usb_dev = to_usb_device_intf(rt2x00dev->dev);
struct queue_entry_priv_usb_bcn *bcn_priv = entry->priv_data;
- struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
int pipe = usb_sndbulkpipe(usb_dev, entry->queue->usb_endpoint);
int length;
u16 reg, reg0;
/*
- * Add the descriptor in front of the skb.
- */
- skb_push(entry->skb, entry->queue->desc_size);
- memcpy(entry->skb->data, skbdesc->desc, skbdesc->desc_len);
- skbdesc->desc = entry->skb->data;
-
- /*
* Disable beaconing while we are reloading the beacon data,
* otherwise we might be sending out invalid data.
*/
@@ -1109,6 +1107,11 @@ static void rt2500usb_write_beacon(struct queue_entry *entry,
rt2500usb_register_write(rt2x00dev, TXRX_CSR19, reg);
/*
+ * Take the descriptor in front of the skb into account.
+ */
+ skb_push(entry->skb, TXD_DESC_SIZE);
+
+ /*
* USB devices cannot blindly pass the skb->len as the
* length of the data to usb_fill_bulk_urb. Pass the skb
* to the driver to determine what the length should be.
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index 7d4778d..b2f2327 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -633,7 +633,8 @@ static void rt2800pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
struct txentry_desc *txdesc)
{
struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb);
- __le32 *txd = skbdesc->desc;
+ struct queue_entry_priv_pci *entry_priv = skbdesc->entry->priv_data;
+ __le32 *txd = entry_priv->desc;
u32 word;
/*
@@ -657,15 +658,14 @@ static void rt2800pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
!test_bit(ENTRY_TXD_MORE_FRAG, &txdesc->flags));
rt2x00_set_field32(&word, TXD_W1_BURST,
test_bit(ENTRY_TXD_BURST, &txdesc->flags));
- rt2x00_set_field32(&word, TXD_W1_SD_LEN0,
- rt2x00dev->ops->extra_tx_headroom);
+ rt2x00_set_field32(&word, TXD_W1_SD_LEN0, TXWI_DESC_SIZE);
rt2x00_set_field32(&word, TXD_W1_LAST_SEC0, 0);
rt2x00_set_field32(&word, TXD_W1_DMA_DONE, 0);
rt2x00_desc_write(txd, 1, word);
rt2x00_desc_read(txd, 2, &word);
rt2x00_set_field32(&word, TXD_W2_SD_PTR1,
- skbdesc->skb_dma + rt2x00dev->ops->extra_tx_headroom);
+ skbdesc->skb_dma + TXWI_DESC_SIZE);
rt2x00_desc_write(txd, 2, word);
rt2x00_desc_read(txd, 3, &word);
@@ -673,6 +673,12 @@ static void rt2800pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
!test_bit(ENTRY_TXD_ENCRYPT_IV, &txdesc->flags));
rt2x00_set_field32(&word, TXD_W3_QSEL, 2);
rt2x00_desc_write(txd, 3, word);
+
+ /*
+ * Register descriptor details in skb frame descriptor.
+ */
+ skbdesc->desc = txd;
+ skbdesc->desc_len = TXD_DESC_SIZE;
}
/*
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
index d48d705..1b87daa 100644
--- a/drivers/net/wireless/rt2x00/rt2800usb.c
+++ b/drivers/net/wireless/rt2x00/rt2800usb.c
@@ -400,7 +400,7 @@ static void rt2800usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
struct txentry_desc *txdesc)
{
struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb);
- __le32 *txi = skbdesc->desc;
+ __le32 *txi = (__le32 *)(skb->data - TXWI_DESC_SIZE - TXINFO_DESC_SIZE);
u32 word;
/*
@@ -422,6 +422,12 @@ static void rt2800usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
rt2x00_set_field32(&word, TXINFO_W0_USB_DMA_TX_BURST,
test_bit(ENTRY_TXD_BURST, &txdesc->flags));
rt2x00_desc_write(txi, 0, word);
+
+ /*
+ * Register descriptor details in skb frame descriptor.
+ */
+ skbdesc->desc = txi;
+ skbdesc->desc_len = TXINFO_DESC_SIZE + TXWI_DESC_SIZE;
}
/*
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c
index 2fe9f29..ff80ef7 100644
--- a/drivers/net/wireless/rt2x00/rt2x00pci.c
+++ b/drivers/net/wireless/rt2x00/rt2x00pci.c
@@ -66,8 +66,6 @@ int rt2x00pci_write_tx_data(struct queue_entry *entry,
struct txentry_desc *txdesc)
{
struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
- struct queue_entry_priv_pci *entry_priv = entry->priv_data;
- struct skb_frame_desc *skbdesc;
/*
* This should not happen, we already checked the entry
@@ -82,13 +80,6 @@ int rt2x00pci_write_tx_data(struct queue_entry *entry,
return -EINVAL;
}
- /*
- * Fill in skb descriptor
- */
- skbdesc = get_skb_frame_desc(entry->skb);
- skbdesc->desc = entry_priv->desc;
- skbdesc->desc_len = entry->queue->desc_size;
-
return 0;
}
EXPORT_SYMBOL_GPL(rt2x00pci_write_tx_data);
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index 97b2c76..891d5f7 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -552,7 +552,6 @@ int rt2x00queue_update_beacon(struct rt2x00_dev *rt2x00dev,
struct rt2x00_intf *intf = vif_to_intf(vif);
struct skb_frame_desc *skbdesc;
struct txentry_desc txdesc;
- __le32 desc[16];
if (unlikely(!intf->beacon))
return -ENOBUFS;
@@ -585,19 +584,10 @@ int rt2x00queue_update_beacon(struct rt2x00_dev *rt2x00dev,
rt2x00queue_create_tx_descriptor(intf->beacon, &txdesc);
/*
- * For the descriptor we use a local array from where the
- * driver can move it to the correct location required for
- * the hardware.
- */
- memset(desc, 0, sizeof(desc));
-
- /*
* Fill in skb descriptor
*/
skbdesc = get_skb_frame_desc(intf->beacon->skb);
memset(skbdesc, 0, sizeof(*skbdesc));
- skbdesc->desc = desc;
- skbdesc->desc_len = intf->beacon->queue->desc_size;
skbdesc->entry = intf->beacon;
/*
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c
index acf3282..a4f0551 100644
--- a/drivers/net/wireless/rt2x00/rt2x00usb.c
+++ b/drivers/net/wireless/rt2x00/rt2x00usb.c
@@ -221,7 +221,6 @@ int rt2x00usb_write_tx_data(struct queue_entry *entry,
struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
struct usb_device *usb_dev = to_usb_device_intf(rt2x00dev->dev);
struct queue_entry_priv_usb *entry_priv = entry->priv_data;
- struct skb_frame_desc *skbdesc;
u32 length;
/*
@@ -231,13 +230,6 @@ int rt2x00usb_write_tx_data(struct queue_entry *entry,
memset(entry->skb->data, 0, entry->queue->desc_size);
/*
- * Fill in skb descriptor
- */
- skbdesc = get_skb_frame_desc(entry->skb);
- skbdesc->desc = entry->skb->data;
- skbdesc->desc_len = entry->queue->desc_size;
-
- /*
* USB devices cannot blindly pass the skb->len as the
* length of the data to usb_fill_bulk_urb. Pass the skb
* to the driver to determine what the length should be.
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index 55aa010..1be1d7d 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -1763,7 +1763,8 @@ static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
struct txentry_desc *txdesc)
{
struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb);
- __le32 *txd = skbdesc->desc;
+ struct queue_entry_priv_pci *entry_priv = skbdesc->entry->priv_data;
+ __le32 *txd = entry_priv->desc;
u32 word;
/*
@@ -1842,6 +1843,13 @@ static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
test_bit(ENTRY_TXD_BURST, &txdesc->flags));
rt2x00_set_field32(&word, TXD_W0_CIPHER_ALG, txdesc->cipher);
rt2x00_desc_write(txd, 0, word);
+
+ /*
+ * Register descriptor details in skb frame descriptor.
+ */
+ skbdesc->desc = txd;
+ skbdesc->desc_len =
+ (txdesc->queue == QID_BEACON) ? TXINFO_SIZE : TXD_DESC_SIZE;
}
/*
@@ -1851,7 +1859,7 @@ static void rt61pci_write_beacon(struct queue_entry *entry,
struct txentry_desc *txdesc)
{
struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
- struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
+ struct queue_entry_priv_pci *entry_priv = entry->priv_data;
unsigned int beacon_base;
u32 reg;
@@ -1867,11 +1875,9 @@ static void rt61pci_write_beacon(struct queue_entry *entry,
* Write entire beacon with descriptor to register.
*/
beacon_base = HW_BEACON_OFFSET(entry->entry_idx);
- rt2x00pci_register_multiwrite(rt2x00dev,
- beacon_base,
- skbdesc->desc, skbdesc->desc_len);
- rt2x00pci_register_multiwrite(rt2x00dev,
- beacon_base + skbdesc->desc_len,
+ rt2x00pci_register_multiwrite(rt2x00dev, beacon_base,
+ entry_priv->desc, TXINFO_SIZE);
+ rt2x00pci_register_multiwrite(rt2x00dev, beacon_base + TXINFO_SIZE,
entry->skb->data, entry->skb->len);
/*
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index fa40d43..fca661c 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -1440,7 +1440,7 @@ static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
struct txentry_desc *txdesc)
{
struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb);
- __le32 *txd = skbdesc->desc;
+ __le32 *txd = (__le32 *)(skb->data - TXD_DESC_SIZE);
u32 word;
/*
@@ -1499,6 +1499,12 @@ static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
TXPOWER_TO_DEV(rt2x00dev->tx_power));
rt2x00_set_field32(&word, TXD_W5_WAITING_DMA_DONE_INT, 1);
rt2x00_desc_write(txd, 5, word);
+
+ /*
+ * Register descriptor details in skb frame descriptor.
+ */
+ skbdesc->desc = txd;
+ skbdesc->desc_len = TXD_DESC_SIZE;
}
/*
@@ -1508,18 +1514,10 @@ static void rt73usb_write_beacon(struct queue_entry *entry,
struct txentry_desc *txdesc)
{
struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
- struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
unsigned int beacon_base;
u32 reg;
/*
- * Add the descriptor in front of the skb.
- */
- skb_push(entry->skb, entry->queue->desc_size);
- memcpy(entry->skb->data, skbdesc->desc, skbdesc->desc_len);
- skbdesc->desc = entry->skb->data;
-
- /*
* Disable beaconing while we are reloading the beacon data,
* otherwise we might be sending out invalid data.
*/
@@ -1528,6 +1526,11 @@ static void rt73usb_write_beacon(struct queue_entry *entry,
rt2x00usb_register_write(rt2x00dev, TXRX_CSR9, reg);
/*
+ * Take the descriptor in front of the skb into account.
+ */
+ skb_push(entry->skb, TXD_DESC_SIZE);
+
+ /*
* Write entire beacon with descriptor to register.
*/
beacon_base = HW_BEACON_OFFSET(entry->entry_idx);
--
1.7.1
^ permalink raw reply related [flat|nested] 32+ messages in thread* Re: [PATCH 4/9] rt2x00: Simplify TXD handling of beacons.
2010-05-11 21:51 ` [PATCH 4/9] rt2x00: Simplify TXD handling of beacons Gertjan van Wingerde
@ 2010-05-12 7:11 ` Ivo Van Doorn
0 siblings, 0 replies; 32+ messages in thread
From: Ivo Van Doorn @ 2010-05-12 7:11 UTC (permalink / raw)
To: Gertjan van Wingerde; +Cc: John W. Linville, linux-wireless, users
On Tue, May 11, 2010 at 11:51 PM, Gertjan van Wingerde
<gwingerde@gmail.com> wrote:
> The handling of tx descriptors for beacons can be simplified by updating
> write_tx_desc implementations of each driver to write directly to the
> queue entry descriptor instead of to a provided memory area.
> This is also a preparation for further clean ups where descriptors are
> properly reserved in the skb instead of fiddling with the skb data
> pointer.
>
> Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 5/9] rt2x00: Dump beacons under a different identifier than TX frames.
2010-05-11 21:51 [PATCH 0/9] rt2x00: Further fixes and cleanups Gertjan van Wingerde
` (3 preceding siblings ...)
2010-05-11 21:51 ` [PATCH 4/9] rt2x00: Simplify TXD handling of beacons Gertjan van Wingerde
@ 2010-05-11 21:51 ` Gertjan van Wingerde
2010-05-12 7:00 ` Ivo Van Doorn
2010-05-11 21:51 ` [PATCH 6/9] rt2x00: Push beacon TX descriptor writing to drivers Gertjan van Wingerde
` (3 subsequent siblings)
8 siblings, 1 reply; 32+ messages in thread
From: Gertjan van Wingerde @ 2010-05-11 21:51 UTC (permalink / raw)
To: John W. Linville
Cc: Ivo van Doorn, linux-wireless, users, Gertjan van Wingerde
This allows for specific identification of beacons in the debugfs
frame stream.
Preparation for later differences between dumped TX frames and dumped
beacons.
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
---
drivers/net/wireless/rt2x00/rt2x00dump.h | 3 +++
drivers/net/wireless/rt2x00/rt2x00queue.c | 5 ++++-
2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2x00dump.h b/drivers/net/wireless/rt2x00/rt2x00dump.h
index 727019a..ed303b4 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dump.h
+++ b/drivers/net/wireless/rt2x00/rt2x00dump.h
@@ -62,11 +62,14 @@
* the tx event which has either succeeded or failed. A frame
* with this type should also have been reported with as a
* %DUMP_FRAME_TX frame.
+ * @DUMP_FRAME_BEACON: This beacon frame is queued for transmission to the
+ * hardware.
*/
enum rt2x00_dump_type {
DUMP_FRAME_RXDONE = 1,
DUMP_FRAME_TX = 2,
DUMP_FRAME_TXDONE = 3,
+ DUMP_FRAME_BEACON = 4,
};
/**
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index 891d5f7..e5969a5 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -420,6 +420,7 @@ static void rt2x00queue_write_tx_descriptor(struct queue_entry *entry,
{
struct data_queue *queue = entry->queue;
struct rt2x00_dev *rt2x00dev = queue->rt2x00dev;
+ enum rt2x00_dump_type;
rt2x00dev->ops->lib->write_tx_desc(rt2x00dev, entry->skb, txdesc);
@@ -427,7 +428,9 @@ static void rt2x00queue_write_tx_descriptor(struct queue_entry *entry,
* All processing on the frame has been completed, this means
* it is now ready to be dumped to userspace through debugfs.
*/
- rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_TX, entry->skb);
+ dump_type = (txdesc->queue == QID_BEACON) ?
+ DUMP_FRAME_BEACON : DUMP_FRAME_TX;
+ rt2x00debug_dump_frame(rt2x00dev, dump_type, entry->skb);
}
static void rt2x00queue_kick_tx_queue(struct queue_entry *entry,
--
1.7.1
^ permalink raw reply related [flat|nested] 32+ messages in thread* [PATCH 6/9] rt2x00: Push beacon TX descriptor writing to drivers.
2010-05-11 21:51 [PATCH 0/9] rt2x00: Further fixes and cleanups Gertjan van Wingerde
` (4 preceding siblings ...)
2010-05-11 21:51 ` [PATCH 5/9] rt2x00: Dump beacons under a different identifier than TX frames Gertjan van Wingerde
@ 2010-05-11 21:51 ` Gertjan van Wingerde
2010-05-12 7:06 ` Ivo Van Doorn
2010-05-11 21:51 ` [PATCH 7/9] rt2x00: In debugfs frame dumping allow the TX descriptor to be part of the skb Gertjan van Wingerde
` (2 subsequent siblings)
8 siblings, 1 reply; 32+ messages in thread
From: Gertjan van Wingerde @ 2010-05-11 21:51 UTC (permalink / raw)
To: John W. Linville
Cc: Ivo van Doorn, linux-wireless, users, Gertjan van Wingerde
Not all the devices require a TX descriptor to be written (i.e. rt2800
device don't require them). Push down the creation of the TX descriptor
to the device drivers so that they can decide for themselves whether
a TX descriptor is to be created.
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
---
drivers/net/wireless/rt2x00/rt2400pci.c | 16 ++++++++++------
drivers/net/wireless/rt2x00/rt2500pci.c | 16 ++++++++++------
drivers/net/wireless/rt2x00/rt2500usb.c | 11 +++++++++++
drivers/net/wireless/rt2x00/rt2800pci.c | 17 +++++++++++++++++
drivers/net/wireless/rt2x00/rt2800usb.c | 17 +++++++++++++++++
drivers/net/wireless/rt2x00/rt2x00debug.c | 1 +
drivers/net/wireless/rt2x00/rt2x00queue.c | 10 +---------
drivers/net/wireless/rt2x00/rt61pci.c | 11 +++++++++++
drivers/net/wireless/rt2x00/rt73usb.c | 11 +++++++++++
9 files changed, 89 insertions(+), 21 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index def3fa4..741c531 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -33,6 +33,7 @@
#include <linux/eeprom_93cx6.h>
#include "rt2x00.h"
+#include "rt2x00lib.h"
#include "rt2x00pci.h"
#include "rt2400pci.h"
@@ -1074,9 +1075,6 @@ static void rt2400pci_write_beacon(struct queue_entry *entry,
struct txentry_desc *txdesc)
{
struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
- struct queue_entry_priv_pci *entry_priv = entry->priv_data;
- struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
- u32 word;
u32 reg;
/*
@@ -1089,9 +1087,15 @@ static void rt2400pci_write_beacon(struct queue_entry *entry,
rt2x00queue_map_txskb(rt2x00dev, entry->skb);
- rt2x00_desc_read(entry_priv->desc, 1, &word);
- rt2x00_set_field32(&word, TXD_W1_BUFFER_ADDRESS, skbdesc->skb_dma);
- rt2x00_desc_write(entry_priv->desc, 1, word);
+ /*
+ * Write the TX descriptor for the beacon.
+ */
+ rt2400pci_write_tx_desc(rt2x00dev, entry->skb, txdesc);
+
+ /*
+ * Dump beacon to userspace through debugfs.
+ */
+ rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_BEACON, entry->skb);
/*
* Enable beaconing again.
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index 070c23e..4dc101e 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -33,6 +33,7 @@
#include <linux/eeprom_93cx6.h>
#include "rt2x00.h"
+#include "rt2x00lib.h"
#include "rt2x00pci.h"
#include "rt2500pci.h"
@@ -1231,9 +1232,6 @@ static void rt2500pci_write_beacon(struct queue_entry *entry,
struct txentry_desc *txdesc)
{
struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
- struct queue_entry_priv_pci *entry_priv = entry->priv_data;
- struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
- u32 word;
u32 reg;
/*
@@ -1246,9 +1244,15 @@ static void rt2500pci_write_beacon(struct queue_entry *entry,
rt2x00queue_map_txskb(rt2x00dev, entry->skb);
- rt2x00_desc_read(entry_priv->desc, 1, &word);
- rt2x00_set_field32(&word, TXD_W1_BUFFER_ADDRESS, skbdesc->skb_dma);
- rt2x00_desc_write(entry_priv->desc, 1, word);
+ /*
+ * Write the TX descriptor for the beacon.
+ */
+ rt2500pci_write_tx_desc(rt2x00dev, entry->skb, txdesc);
+
+ /*
+ * Dump beacon to userspace through debugfs.
+ */
+ rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_BEACON, entry->skb);
/*
* Enable beaconing again.
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index b985d8f..4911d1a 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -32,6 +32,7 @@
#include <linux/usb.h>
#include "rt2x00.h"
+#include "rt2x00lib.h"
#include "rt2x00usb.h"
#include "rt2500usb.h"
@@ -1107,6 +1108,16 @@ static void rt2500usb_write_beacon(struct queue_entry *entry,
rt2500usb_register_write(rt2x00dev, TXRX_CSR19, reg);
/*
+ * Write the TX descriptor for the beacon.
+ */
+ rt2500usb_write_tx_desc(rt2x00dev, entry->skb, txdesc);
+
+ /*
+ * Dump beacon to userspace through debugfs.
+ */
+ rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_BEACON, entry->skb);
+
+ /*
* Take the descriptor in front of the skb into account.
*/
skb_push(entry->skb, TXD_DESC_SIZE);
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index b2f2327..fcca30c 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -42,6 +42,7 @@
#include <linux/eeprom_93cx6.h>
#include "rt2x00.h"
+#include "rt2x00lib.h"
#include "rt2x00pci.h"
#include "rt2x00soc.h"
#include "rt2800lib.h"
@@ -688,6 +689,7 @@ static void rt2800pci_write_beacon(struct queue_entry *entry,
struct txentry_desc *txdesc)
{
struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
+ struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
unsigned int beacon_base;
u32 reg;
@@ -700,9 +702,24 @@ static void rt2800pci_write_beacon(struct queue_entry *entry,
rt2800_register_write(rt2x00dev, BCN_TIME_CFG, reg);
/*
+ * Register descriptor details in skb frame descriptor.
+ */
+ skbdesc->desc = entry->skb->data - TXWI_DESC_SIZE;
+ skbdesc->desc_len = TXWI_DESC_SIZE;
+
+ /*
* Add the TXWI for the beacon to the skb.
*/
rt2800_write_txwi(entry->skb, txdesc);
+
+ /*
+ * Dump beacon to userspace through debugfs.
+ */
+ rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_BEACON, entry->skb);
+
+ /*
+ * Adjust skb to take TXWI into account.
+ */
skb_push(entry->skb, TXWI_DESC_SIZE);
/*
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
index 1b87daa..9a29f73 100644
--- a/drivers/net/wireless/rt2x00/rt2800usb.c
+++ b/drivers/net/wireless/rt2x00/rt2800usb.c
@@ -37,6 +37,7 @@
#include <linux/usb.h>
#include "rt2x00.h"
+#include "rt2x00lib.h"
#include "rt2x00usb.h"
#include "rt2800lib.h"
#include "rt2800.h"
@@ -437,6 +438,7 @@ static void rt2800usb_write_beacon(struct queue_entry *entry,
struct txentry_desc *txdesc)
{
struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
+ struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
unsigned int beacon_base;
u32 reg;
@@ -449,9 +451,24 @@ static void rt2800usb_write_beacon(struct queue_entry *entry,
rt2800_register_write(rt2x00dev, BCN_TIME_CFG, reg);
/*
+ * Register descriptor details in skb frame descriptor.
+ */
+ skbdesc->desc = entry->skb->data - TXWI_DESC_SIZE;
+ skbdesc->desc_len = TXWI_DESC_SIZE;
+
+ /*
* Add the TXWI for the beacon to the skb.
*/
rt2800_write_txwi(entry->skb, txdesc);
+
+ /*
+ * Dump beacon to userspace through debugfs.
+ */
+ rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_BEACON, entry->skb);
+
+ /*
+ * Adjust skb to take TXWI into account.
+ */
skb_push(entry->skb, TXWI_DESC_SIZE);
/*
diff --git a/drivers/net/wireless/rt2x00/rt2x00debug.c b/drivers/net/wireless/rt2x00/rt2x00debug.c
index 9e2eed5..85e9990 100644
--- a/drivers/net/wireless/rt2x00/rt2x00debug.c
+++ b/drivers/net/wireless/rt2x00/rt2x00debug.c
@@ -204,6 +204,7 @@ void rt2x00debug_dump_frame(struct rt2x00_dev *rt2x00dev,
if (!test_bit(FRAME_DUMP_FILE_OPEN, &intf->frame_dump_flags))
skb_queue_purge(&intf->frame_dump_skbqueue);
}
+EXPORT_SYMBOL_GPL(rt2x00debug_dump_frame);
static int rt2x00debug_file_open(struct inode *inode, struct file *file)
{
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index e5969a5..9e48bbc 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -420,7 +420,6 @@ static void rt2x00queue_write_tx_descriptor(struct queue_entry *entry,
{
struct data_queue *queue = entry->queue;
struct rt2x00_dev *rt2x00dev = queue->rt2x00dev;
- enum rt2x00_dump_type;
rt2x00dev->ops->lib->write_tx_desc(rt2x00dev, entry->skb, txdesc);
@@ -428,9 +427,7 @@ static void rt2x00queue_write_tx_descriptor(struct queue_entry *entry,
* All processing on the frame has been completed, this means
* it is now ready to be dumped to userspace through debugfs.
*/
- dump_type = (txdesc->queue == QID_BEACON) ?
- DUMP_FRAME_BEACON : DUMP_FRAME_TX;
- rt2x00debug_dump_frame(rt2x00dev, dump_type, entry->skb);
+ rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_TX, entry->skb);
}
static void rt2x00queue_kick_tx_queue(struct queue_entry *entry,
@@ -594,11 +591,6 @@ int rt2x00queue_update_beacon(struct rt2x00_dev *rt2x00dev,
skbdesc->entry = intf->beacon;
/*
- * Write TX descriptor into reserved room in front of the beacon.
- */
- rt2x00queue_write_tx_descriptor(intf->beacon, &txdesc);
-
- /*
* Send beacon to hardware and enable beacon genaration..
*/
rt2x00dev->ops->lib->write_beacon(intf->beacon, &txdesc);
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index 1be1d7d..cf9d507 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -34,6 +34,7 @@
#include <linux/eeprom_93cx6.h>
#include "rt2x00.h"
+#include "rt2x00lib.h"
#include "rt2x00pci.h"
#include "rt61pci.h"
@@ -1872,6 +1873,16 @@ static void rt61pci_write_beacon(struct queue_entry *entry,
rt2x00pci_register_write(rt2x00dev, TXRX_CSR9, reg);
/*
+ * Write the TX descriptor for the beacon.
+ */
+ rt61pci_write_tx_desc(rt2x00dev, entry->skb, txdesc);
+
+ /*
+ * Dump beacon to userspace through debugfs.
+ */
+ rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_BEACON, entry->skb);
+
+ /*
* Write entire beacon with descriptor to register.
*/
beacon_base = HW_BEACON_OFFSET(entry->entry_idx);
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index fca661c..085f76e 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -33,6 +33,7 @@
#include <linux/usb.h>
#include "rt2x00.h"
+#include "rt2x00lib.h"
#include "rt2x00usb.h"
#include "rt73usb.h"
@@ -1526,6 +1527,16 @@ static void rt73usb_write_beacon(struct queue_entry *entry,
rt2x00usb_register_write(rt2x00dev, TXRX_CSR9, reg);
/*
+ * Write the TX descriptor for the beacon.
+ */
+ rt73usb_write_tx_desc(rt2x00dev, entry->skb, txdesc);
+
+ /*
+ * Dump beacon to userspace through debugfs.
+ */
+ rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_BEACON, entry->skb);
+
+ /*
* Take the descriptor in front of the skb into account.
*/
skb_push(entry->skb, TXD_DESC_SIZE);
--
1.7.1
^ permalink raw reply related [flat|nested] 32+ messages in thread* Re: [PATCH 6/9] rt2x00: Push beacon TX descriptor writing to drivers.
2010-05-11 21:51 ` [PATCH 6/9] rt2x00: Push beacon TX descriptor writing to drivers Gertjan van Wingerde
@ 2010-05-12 7:06 ` Ivo Van Doorn
2010-05-12 9:53 ` Gertjan van Wingerde
0 siblings, 1 reply; 32+ messages in thread
From: Ivo Van Doorn @ 2010-05-12 7:06 UTC (permalink / raw)
To: Gertjan van Wingerde; +Cc: John W. Linville, linux-wireless, users
On Tue, May 11, 2010 at 11:51 PM, Gertjan van Wingerde
<gwingerde@gmail.com> wrote:
> Not all the devices require a TX descriptor to be written (i.e. rt2800
> device don't require them). Push down the creation of the TX descriptor
> to the device drivers so that they can decide for themselves whether
> a TX descriptor is to be created.
>
> Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
> ---
> drivers/net/wireless/rt2x00/rt2400pci.c | 16 ++++++++++------
> drivers/net/wireless/rt2x00/rt2500pci.c | 16 ++++++++++------
> drivers/net/wireless/rt2x00/rt2500usb.c | 11 +++++++++++
> drivers/net/wireless/rt2x00/rt2800pci.c | 17 +++++++++++++++++
> drivers/net/wireless/rt2x00/rt2800usb.c | 17 +++++++++++++++++
> drivers/net/wireless/rt2x00/rt2x00debug.c | 1 +
> drivers/net/wireless/rt2x00/rt2x00queue.c | 10 +---------
> drivers/net/wireless/rt2x00/rt61pci.c | 11 +++++++++++
> drivers/net/wireless/rt2x00/rt73usb.c | 11 +++++++++++
> 9 files changed, 89 insertions(+), 21 deletions(-)
>
> diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
> index def3fa4..741c531 100644
> --- a/drivers/net/wireless/rt2x00/rt2400pci.c
> +++ b/drivers/net/wireless/rt2x00/rt2400pci.c
> @@ -33,6 +33,7 @@
> #include <linux/eeprom_93cx6.h>
>
> #include "rt2x00.h"
> +#include "rt2x00lib.h"
> #include "rt2x00pci.h"
> #include "rt2400pci.h"
rt2x00lib.h must not be used in the drivers. It is for the rt2x00lib
internal files only.
> @@ -1074,9 +1075,6 @@ static void rt2400pci_write_beacon(struct queue_entry *entry,
> struct txentry_desc *txdesc)
> {
> struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
> - struct queue_entry_priv_pci *entry_priv = entry->priv_data;
> - struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
> - u32 word;
> u32 reg;
>
> /*
> @@ -1089,9 +1087,15 @@ static void rt2400pci_write_beacon(struct queue_entry *entry,
>
> rt2x00queue_map_txskb(rt2x00dev, entry->skb);
>
> - rt2x00_desc_read(entry_priv->desc, 1, &word);
> - rt2x00_set_field32(&word, TXD_W1_BUFFER_ADDRESS, skbdesc->skb_dma);
> - rt2x00_desc_write(entry_priv->desc, 1, word);
> + /*
> + * Write the TX descriptor for the beacon.
> + */
> + rt2400pci_write_tx_desc(rt2x00dev, entry->skb, txdesc);
> +
> + /*
> + * Dump beacon to userspace through debugfs.
> + */
> + rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_BEACON, entry->skb);
The goal for rt2x00debug was that the logic must be inside rt2x00lib
as much as possible.
This can/should be moved into rt2x00lib where write_beacon() is being called.
Ivo
^ permalink raw reply [flat|nested] 32+ messages in thread* Re: [PATCH 6/9] rt2x00: Push beacon TX descriptor writing to drivers.
2010-05-12 7:06 ` Ivo Van Doorn
@ 2010-05-12 9:53 ` Gertjan van Wingerde
2010-05-12 17:45 ` Ivo Van Doorn
0 siblings, 1 reply; 32+ messages in thread
From: Gertjan van Wingerde @ 2010-05-12 9:53 UTC (permalink / raw)
To: Ivo Van Doorn; +Cc: John W. Linville, linux-wireless, users
On Wed, May 12, 2010 at 9:06 AM, Ivo Van Doorn <ivdoorn@gmail.com> wrote:
> On Tue, May 11, 2010 at 11:51 PM, Gertjan van Wingerde
> <gwingerde@gmail.com> wrote:
>> Not all the devices require a TX descriptor to be written (i.e. rt2800
>> device don't require them). Push down the creation of the TX descriptor
>> to the device drivers so that they can decide for themselves whether
>> a TX descriptor is to be created.
>>
>> Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
>> ---
>> drivers/net/wireless/rt2x00/rt2400pci.c | 16 ++++++++++------
>> drivers/net/wireless/rt2x00/rt2500pci.c | 16 ++++++++++------
>> drivers/net/wireless/rt2x00/rt2500usb.c | 11 +++++++++++
>> drivers/net/wireless/rt2x00/rt2800pci.c | 17 +++++++++++++++++
>> drivers/net/wireless/rt2x00/rt2800usb.c | 17 +++++++++++++++++
>> drivers/net/wireless/rt2x00/rt2x00debug.c | 1 +
>> drivers/net/wireless/rt2x00/rt2x00queue.c | 10 +---------
>> drivers/net/wireless/rt2x00/rt61pci.c | 11 +++++++++++
>> drivers/net/wireless/rt2x00/rt73usb.c | 11 +++++++++++
>> 9 files changed, 89 insertions(+), 21 deletions(-)
>>
>> diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
>> index def3fa4..741c531 100644
>> --- a/drivers/net/wireless/rt2x00/rt2400pci.c
>> +++ b/drivers/net/wireless/rt2x00/rt2400pci.c
>> @@ -33,6 +33,7 @@
>> #include <linux/eeprom_93cx6.h>
>>
>> #include "rt2x00.h"
>> +#include "rt2x00lib.h"
>> #include "rt2x00pci.h"
>> #include "rt2400pci.h"
>
> rt2x00lib.h must not be used in the drivers. It is for the rt2x00lib
> internal files only.
OK. This include is/was necessary for the rt2x00debug_dump_frame call.
So this may be handled with your next issue.
>
>> @@ -1074,9 +1075,6 @@ static void rt2400pci_write_beacon(struct queue_entry *entry,
>> struct txentry_desc *txdesc)
>> {
>> struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
>> - struct queue_entry_priv_pci *entry_priv = entry->priv_data;
>> - struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
>> - u32 word;
>> u32 reg;
>>
>> /*
>> @@ -1089,9 +1087,15 @@ static void rt2400pci_write_beacon(struct queue_entry *entry,
>>
>> rt2x00queue_map_txskb(rt2x00dev, entry->skb);
>>
>> - rt2x00_desc_read(entry_priv->desc, 1, &word);
>> - rt2x00_set_field32(&word, TXD_W1_BUFFER_ADDRESS, skbdesc->skb_dma);
>> - rt2x00_desc_write(entry_priv->desc, 1, word);
>> + /*
>> + * Write the TX descriptor for the beacon.
>> + */
>> + rt2400pci_write_tx_desc(rt2x00dev, entry->skb, txdesc);
>> +
>> + /*
>> + * Dump beacon to userspace through debugfs.
>> + */
>> + rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_BEACON, entry->skb);
>
> The goal for rt2x00debug was that the logic must be inside rt2x00lib
> as much as possible.
> This can/should be moved into rt2x00lib where write_beacon() is being called.
>
Yes, I wasn't too happy about this part about the patch, but couldn't
find a better solution. The problem is that with the patch the frame
cannot be dumped before the call to write_beacon, as the descriptor
hasn't been set up yet. Also, it cannot be dumped after the call to
write_beacon as most of the write_beacon functions actually free the
skb with the beacon.
So, I ran out of ideas as to how to keep rt2x00debug only inside
rt2x00lib. I'm open for suggestions, though.
---
Gertjan
^ permalink raw reply [flat|nested] 32+ messages in thread* Re: [PATCH 6/9] rt2x00: Push beacon TX descriptor writing to drivers.
2010-05-12 9:53 ` Gertjan van Wingerde
@ 2010-05-12 17:45 ` Ivo Van Doorn
2010-05-12 19:03 ` Gertjan van Wingerde
0 siblings, 1 reply; 32+ messages in thread
From: Ivo Van Doorn @ 2010-05-12 17:45 UTC (permalink / raw)
To: Gertjan van Wingerde; +Cc: John W. Linville, linux-wireless, users
On Wed, May 12, 2010 at 11:53 AM, Gertjan van Wingerde
<gwingerde@gmail.com> wrote:
> On Wed, May 12, 2010 at 9:06 AM, Ivo Van Doorn <ivdoorn@gmail.com> wrote:
>> On Tue, May 11, 2010 at 11:51 PM, Gertjan van Wingerde
>> <gwingerde@gmail.com> wrote:
>>> Not all the devices require a TX descriptor to be written (i.e. rt2800
>>> device don't require them). Push down the creation of the TX descriptor
>>> to the device drivers so that they can decide for themselves whether
>>> a TX descriptor is to be created.
>>>
>>> Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
>>> ---
>>> drivers/net/wireless/rt2x00/rt2400pci.c | 16 ++++++++++------
>>> drivers/net/wireless/rt2x00/rt2500pci.c | 16 ++++++++++------
>>> drivers/net/wireless/rt2x00/rt2500usb.c | 11 +++++++++++
>>> drivers/net/wireless/rt2x00/rt2800pci.c | 17 +++++++++++++++++
>>> drivers/net/wireless/rt2x00/rt2800usb.c | 17 +++++++++++++++++
>>> drivers/net/wireless/rt2x00/rt2x00debug.c | 1 +
>>> drivers/net/wireless/rt2x00/rt2x00queue.c | 10 +---------
>>> drivers/net/wireless/rt2x00/rt61pci.c | 11 +++++++++++
>>> drivers/net/wireless/rt2x00/rt73usb.c | 11 +++++++++++
>>> 9 files changed, 89 insertions(+), 21 deletions(-)
>>>
>>> diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
>>> index def3fa4..741c531 100644
>>> --- a/drivers/net/wireless/rt2x00/rt2400pci.c
>>> +++ b/drivers/net/wireless/rt2x00/rt2400pci.c
>>> @@ -33,6 +33,7 @@
>>> #include <linux/eeprom_93cx6.h>
>>>
>>> #include "rt2x00.h"
>>> +#include "rt2x00lib.h"
>>> #include "rt2x00pci.h"
>>> #include "rt2400pci.h"
>>
>> rt2x00lib.h must not be used in the drivers. It is for the rt2x00lib
>> internal files only.
>
> OK. This include is/was necessary for the rt2x00debug_dump_frame call.
> So this may be handled with your next issue.
>
>>
>>> @@ -1074,9 +1075,6 @@ static void rt2400pci_write_beacon(struct queue_entry *entry,
>>> struct txentry_desc *txdesc)
>>> {
>>> struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
>>> - struct queue_entry_priv_pci *entry_priv = entry->priv_data;
>>> - struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
>>> - u32 word;
>>> u32 reg;
>>>
>>> /*
>>> @@ -1089,9 +1087,15 @@ static void rt2400pci_write_beacon(struct queue_entry *entry,
>>>
>>> rt2x00queue_map_txskb(rt2x00dev, entry->skb);
>>>
>>> - rt2x00_desc_read(entry_priv->desc, 1, &word);
>>> - rt2x00_set_field32(&word, TXD_W1_BUFFER_ADDRESS, skbdesc->skb_dma);
>>> - rt2x00_desc_write(entry_priv->desc, 1, word);
>>> + /*
>>> + * Write the TX descriptor for the beacon.
>>> + */
>>> + rt2400pci_write_tx_desc(rt2x00dev, entry->skb, txdesc);
>>> +
>>> + /*
>>> + * Dump beacon to userspace through debugfs.
>>> + */
>>> + rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_BEACON, entry->skb);
>>
>> The goal for rt2x00debug was that the logic must be inside rt2x00lib
>> as much as possible.
>> This can/should be moved into rt2x00lib where write_beacon() is being called.
>>
>
> Yes, I wasn't too happy about this part about the patch, but couldn't
> find a better solution. The problem is that with the patch the frame
> cannot be dumped before the call to write_beacon, as the descriptor
> hasn't been set up yet. Also, it cannot be dumped after the call to
> write_beacon as most of the write_beacon functions actually free the
> skb with the beacon.
> So, I ran out of ideas as to how to keep rt2x00debug only inside
> rt2x00lib. I'm open for suggestions, though.
Well ok, if there aren't obvious alternatives this change is fine.
However, please move the declaration of rt2x00debug_dump_frame()
into rt2x00.h? That way we don't have to include the rt2x00lib.h header.
Ivo
^ permalink raw reply [flat|nested] 32+ messages in thread* Re: [PATCH 6/9] rt2x00: Push beacon TX descriptor writing to drivers.
2010-05-12 17:45 ` Ivo Van Doorn
@ 2010-05-12 19:03 ` Gertjan van Wingerde
2010-05-12 19:10 ` Ivo Van Doorn
0 siblings, 1 reply; 32+ messages in thread
From: Gertjan van Wingerde @ 2010-05-12 19:03 UTC (permalink / raw)
To: Ivo Van Doorn; +Cc: John W. Linville, linux-wireless, users
On 05/12/10 19:45, Ivo Van Doorn wrote:
> On Wed, May 12, 2010 at 11:53 AM, Gertjan van Wingerde
> <gwingerde@gmail.com> wrote:
>> On Wed, May 12, 2010 at 9:06 AM, Ivo Van Doorn <ivdoorn@gmail.com> wrote:
>>> On Tue, May 11, 2010 at 11:51 PM, Gertjan van Wingerde
>>> <gwingerde@gmail.com> wrote:
>>>> Not all the devices require a TX descriptor to be written (i.e. rt2800
>>>> device don't require them). Push down the creation of the TX descriptor
>>>> to the device drivers so that they can decide for themselves whether
>>>> a TX descriptor is to be created.
>>>>
>>>> Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
>>>> ---
>>>> drivers/net/wireless/rt2x00/rt2400pci.c | 16 ++++++++++------
>>>> drivers/net/wireless/rt2x00/rt2500pci.c | 16 ++++++++++------
>>>> drivers/net/wireless/rt2x00/rt2500usb.c | 11 +++++++++++
>>>> drivers/net/wireless/rt2x00/rt2800pci.c | 17 +++++++++++++++++
>>>> drivers/net/wireless/rt2x00/rt2800usb.c | 17 +++++++++++++++++
>>>> drivers/net/wireless/rt2x00/rt2x00debug.c | 1 +
>>>> drivers/net/wireless/rt2x00/rt2x00queue.c | 10 +---------
>>>> drivers/net/wireless/rt2x00/rt61pci.c | 11 +++++++++++
>>>> drivers/net/wireless/rt2x00/rt73usb.c | 11 +++++++++++
>>>> 9 files changed, 89 insertions(+), 21 deletions(-)
>>>>
>>>> diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
>>>> index def3fa4..741c531 100644
>>>> --- a/drivers/net/wireless/rt2x00/rt2400pci.c
>>>> +++ b/drivers/net/wireless/rt2x00/rt2400pci.c
>>>> @@ -33,6 +33,7 @@
>>>> #include <linux/eeprom_93cx6.h>
>>>>
>>>> #include "rt2x00.h"
>>>> +#include "rt2x00lib.h"
>>>> #include "rt2x00pci.h"
>>>> #include "rt2400pci.h"
>>>
>>> rt2x00lib.h must not be used in the drivers. It is for the rt2x00lib
>>> internal files only.
>>
>> OK. This include is/was necessary for the rt2x00debug_dump_frame call.
>> So this may be handled with your next issue.
>>
>>>
>>>> @@ -1074,9 +1075,6 @@ static void rt2400pci_write_beacon(struct queue_entry *entry,
>>>> struct txentry_desc *txdesc)
>>>> {
>>>> struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
>>>> - struct queue_entry_priv_pci *entry_priv = entry->priv_data;
>>>> - struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
>>>> - u32 word;
>>>> u32 reg;
>>>>
>>>> /*
>>>> @@ -1089,9 +1087,15 @@ static void rt2400pci_write_beacon(struct queue_entry *entry,
>>>>
>>>> rt2x00queue_map_txskb(rt2x00dev, entry->skb);
>>>>
>>>> - rt2x00_desc_read(entry_priv->desc, 1, &word);
>>>> - rt2x00_set_field32(&word, TXD_W1_BUFFER_ADDRESS, skbdesc->skb_dma);
>>>> - rt2x00_desc_write(entry_priv->desc, 1, word);
>>>> + /*
>>>> + * Write the TX descriptor for the beacon.
>>>> + */
>>>> + rt2400pci_write_tx_desc(rt2x00dev, entry->skb, txdesc);
>>>> +
>>>> + /*
>>>> + * Dump beacon to userspace through debugfs.
>>>> + */
>>>> + rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_BEACON, entry->skb);
>>>
>>> The goal for rt2x00debug was that the logic must be inside rt2x00lib
>>> as much as possible.
>>> This can/should be moved into rt2x00lib where write_beacon() is being called.
>>>
>>
>> Yes, I wasn't too happy about this part about the patch, but couldn't
>> find a better solution. The problem is that with the patch the frame
>> cannot be dumped before the call to write_beacon, as the descriptor
>> hasn't been set up yet. Also, it cannot be dumped after the call to
>> write_beacon as most of the write_beacon functions actually free the
>> skb with the beacon.
>> So, I ran out of ideas as to how to keep rt2x00debug only inside
>> rt2x00lib. I'm open for suggestions, though.
>
> Well ok, if there aren't obvious alternatives this change is fine.
> However, please move the declaration of rt2x00debug_dump_frame()
> into rt2x00.h? That way we don't have to include the rt2x00lib.h header.
>
The only alternative I can think of is to have the chipset driver clone the skb to have
a private copy of the skb, so that the original one can be freed in the generic code.
In that case the rt2x00debug_dump_frame call can be done from rt2x00queue code, after
the write_beacon function has been called.
What do you think of that solution?
---
Gertjan.
^ permalink raw reply [flat|nested] 32+ messages in thread* Re: [PATCH 6/9] rt2x00: Push beacon TX descriptor writing to drivers.
2010-05-12 19:03 ` Gertjan van Wingerde
@ 2010-05-12 19:10 ` Ivo Van Doorn
2010-05-12 19:22 ` Gertjan van Wingerde
0 siblings, 1 reply; 32+ messages in thread
From: Ivo Van Doorn @ 2010-05-12 19:10 UTC (permalink / raw)
To: Gertjan van Wingerde; +Cc: John W. Linville, linux-wireless, users
On Wed, May 12, 2010 at 9:03 PM, Gertjan van Wingerde
<gwingerde@gmail.com> wrote:
> On 05/12/10 19:45, Ivo Van Doorn wrote:
>> On Wed, May 12, 2010 at 11:53 AM, Gertjan van Wingerde
>> <gwingerde@gmail.com> wrote:
>>> On Wed, May 12, 2010 at 9:06 AM, Ivo Van Doorn <ivdoorn@gmail.com> wrote:
>>>> On Tue, May 11, 2010 at 11:51 PM, Gertjan van Wingerde
>>>> <gwingerde@gmail.com> wrote:
>>>>> Not all the devices require a TX descriptor to be written (i.e. rt2800
>>>>> device don't require them). Push down the creation of the TX descriptor
>>>>> to the device drivers so that they can decide for themselves whether
>>>>> a TX descriptor is to be created.
>>>>>
>>>>> Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
>>>>> ---
>>>>> drivers/net/wireless/rt2x00/rt2400pci.c | 16 ++++++++++------
>>>>> drivers/net/wireless/rt2x00/rt2500pci.c | 16 ++++++++++------
>>>>> drivers/net/wireless/rt2x00/rt2500usb.c | 11 +++++++++++
>>>>> drivers/net/wireless/rt2x00/rt2800pci.c | 17 +++++++++++++++++
>>>>> drivers/net/wireless/rt2x00/rt2800usb.c | 17 +++++++++++++++++
>>>>> drivers/net/wireless/rt2x00/rt2x00debug.c | 1 +
>>>>> drivers/net/wireless/rt2x00/rt2x00queue.c | 10 +---------
>>>>> drivers/net/wireless/rt2x00/rt61pci.c | 11 +++++++++++
>>>>> drivers/net/wireless/rt2x00/rt73usb.c | 11 +++++++++++
>>>>> 9 files changed, 89 insertions(+), 21 deletions(-)
>>>>>
>>>>> diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
>>>>> index def3fa4..741c531 100644
>>>>> --- a/drivers/net/wireless/rt2x00/rt2400pci.c
>>>>> +++ b/drivers/net/wireless/rt2x00/rt2400pci.c
>>>>> @@ -33,6 +33,7 @@
>>>>> #include <linux/eeprom_93cx6.h>
>>>>>
>>>>> #include "rt2x00.h"
>>>>> +#include "rt2x00lib.h"
>>>>> #include "rt2x00pci.h"
>>>>> #include "rt2400pci.h"
>>>>
>>>> rt2x00lib.h must not be used in the drivers. It is for the rt2x00lib
>>>> internal files only.
>>>
>>> OK. This include is/was necessary for the rt2x00debug_dump_frame call.
>>> So this may be handled with your next issue.
>>>
>>>>
>>>>> @@ -1074,9 +1075,6 @@ static void rt2400pci_write_beacon(struct queue_entry *entry,
>>>>> struct txentry_desc *txdesc)
>>>>> {
>>>>> struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
>>>>> - struct queue_entry_priv_pci *entry_priv = entry->priv_data;
>>>>> - struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
>>>>> - u32 word;
>>>>> u32 reg;
>>>>>
>>>>> /*
>>>>> @@ -1089,9 +1087,15 @@ static void rt2400pci_write_beacon(struct queue_entry *entry,
>>>>>
>>>>> rt2x00queue_map_txskb(rt2x00dev, entry->skb);
>>>>>
>>>>> - rt2x00_desc_read(entry_priv->desc, 1, &word);
>>>>> - rt2x00_set_field32(&word, TXD_W1_BUFFER_ADDRESS, skbdesc->skb_dma);
>>>>> - rt2x00_desc_write(entry_priv->desc, 1, word);
>>>>> + /*
>>>>> + * Write the TX descriptor for the beacon.
>>>>> + */
>>>>> + rt2400pci_write_tx_desc(rt2x00dev, entry->skb, txdesc);
>>>>> +
>>>>> + /*
>>>>> + * Dump beacon to userspace through debugfs.
>>>>> + */
>>>>> + rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_BEACON, entry->skb);
>>>>
>>>> The goal for rt2x00debug was that the logic must be inside rt2x00lib
>>>> as much as possible.
>>>> This can/should be moved into rt2x00lib where write_beacon() is being called.
>>>>
>>>
>>> Yes, I wasn't too happy about this part about the patch, but couldn't
>>> find a better solution. The problem is that with the patch the frame
>>> cannot be dumped before the call to write_beacon, as the descriptor
>>> hasn't been set up yet. Also, it cannot be dumped after the call to
>>> write_beacon as most of the write_beacon functions actually free the
>>> skb with the beacon.
>>> So, I ran out of ideas as to how to keep rt2x00debug only inside
>>> rt2x00lib. I'm open for suggestions, though.
>>
>> Well ok, if there aren't obvious alternatives this change is fine.
>> However, please move the declaration of rt2x00debug_dump_frame()
>> into rt2x00.h? That way we don't have to include the rt2x00lib.h header.
>>
>
> The only alternative I can think of is to have the chipset driver clone the skb to have
> a private copy of the skb, so that the original one can be freed in the generic code.
> In that case the rt2x00debug_dump_frame call can be done from rt2x00queue code, after
> the write_beacon function has been called.
>
> What do you think of that solution?
I think the extra cloning isn't really worth the effort. Since it is
only needed for debugfs,
so the code in rt2x00queue must check for debugfs support, and debugfs code must
be updated not to clone the frame again.
Overall I think it is in this case better to just do your change with calling
the debugfs function from the driver, but moving the declaration of the function
into rt2x00.h to prevent the inclusion of rt2x00lib.h into the drivers.
Ivo
^ permalink raw reply [flat|nested] 32+ messages in thread* Re: [PATCH 6/9] rt2x00: Push beacon TX descriptor writing to drivers.
2010-05-12 19:10 ` Ivo Van Doorn
@ 2010-05-12 19:22 ` Gertjan van Wingerde
0 siblings, 0 replies; 32+ messages in thread
From: Gertjan van Wingerde @ 2010-05-12 19:22 UTC (permalink / raw)
To: Ivo Van Doorn; +Cc: John W. Linville, linux-wireless, users
On 05/12/10 21:10, Ivo Van Doorn wrote:
> On Wed, May 12, 2010 at 9:03 PM, Gertjan van Wingerde
> <gwingerde@gmail.com> wrote:
>> On 05/12/10 19:45, Ivo Van Doorn wrote:
>>> On Wed, May 12, 2010 at 11:53 AM, Gertjan van Wingerde
>>> <gwingerde@gmail.com> wrote:
>>>> On Wed, May 12, 2010 at 9:06 AM, Ivo Van Doorn <ivdoorn@gmail.com> wrote:
>>>>> On Tue, May 11, 2010 at 11:51 PM, Gertjan van Wingerde
>>>>> <gwingerde@gmail.com> wrote:
>>>>>> Not all the devices require a TX descriptor to be written (i.e. rt2800
>>>>>> device don't require them). Push down the creation of the TX descriptor
>>>>>> to the device drivers so that they can decide for themselves whether
>>>>>> a TX descriptor is to be created.
>>>>>>
>>>>>> Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
>>>>>> ---
>>>>>> drivers/net/wireless/rt2x00/rt2400pci.c | 16 ++++++++++------
>>>>>> drivers/net/wireless/rt2x00/rt2500pci.c | 16 ++++++++++------
>>>>>> drivers/net/wireless/rt2x00/rt2500usb.c | 11 +++++++++++
>>>>>> drivers/net/wireless/rt2x00/rt2800pci.c | 17 +++++++++++++++++
>>>>>> drivers/net/wireless/rt2x00/rt2800usb.c | 17 +++++++++++++++++
>>>>>> drivers/net/wireless/rt2x00/rt2x00debug.c | 1 +
>>>>>> drivers/net/wireless/rt2x00/rt2x00queue.c | 10 +---------
>>>>>> drivers/net/wireless/rt2x00/rt61pci.c | 11 +++++++++++
>>>>>> drivers/net/wireless/rt2x00/rt73usb.c | 11 +++++++++++
>>>>>> 9 files changed, 89 insertions(+), 21 deletions(-)
>>>>>>
>>>>>> diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
>>>>>> index def3fa4..741c531 100644
>>>>>> --- a/drivers/net/wireless/rt2x00/rt2400pci.c
>>>>>> +++ b/drivers/net/wireless/rt2x00/rt2400pci.c
>>>>>> @@ -33,6 +33,7 @@
>>>>>> #include <linux/eeprom_93cx6.h>
>>>>>>
>>>>>> #include "rt2x00.h"
>>>>>> +#include "rt2x00lib.h"
>>>>>> #include "rt2x00pci.h"
>>>>>> #include "rt2400pci.h"
>>>>>
>>>>> rt2x00lib.h must not be used in the drivers. It is for the rt2x00lib
>>>>> internal files only.
>>>>
>>>> OK. This include is/was necessary for the rt2x00debug_dump_frame call.
>>>> So this may be handled with your next issue.
>>>>
>>>>>
>>>>>> @@ -1074,9 +1075,6 @@ static void rt2400pci_write_beacon(struct queue_entry *entry,
>>>>>> struct txentry_desc *txdesc)
>>>>>> {
>>>>>> struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
>>>>>> - struct queue_entry_priv_pci *entry_priv = entry->priv_data;
>>>>>> - struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
>>>>>> - u32 word;
>>>>>> u32 reg;
>>>>>>
>>>>>> /*
>>>>>> @@ -1089,9 +1087,15 @@ static void rt2400pci_write_beacon(struct queue_entry *entry,
>>>>>>
>>>>>> rt2x00queue_map_txskb(rt2x00dev, entry->skb);
>>>>>>
>>>>>> - rt2x00_desc_read(entry_priv->desc, 1, &word);
>>>>>> - rt2x00_set_field32(&word, TXD_W1_BUFFER_ADDRESS, skbdesc->skb_dma);
>>>>>> - rt2x00_desc_write(entry_priv->desc, 1, word);
>>>>>> + /*
>>>>>> + * Write the TX descriptor for the beacon.
>>>>>> + */
>>>>>> + rt2400pci_write_tx_desc(rt2x00dev, entry->skb, txdesc);
>>>>>> +
>>>>>> + /*
>>>>>> + * Dump beacon to userspace through debugfs.
>>>>>> + */
>>>>>> + rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_BEACON, entry->skb);
>>>>>
>>>>> The goal for rt2x00debug was that the logic must be inside rt2x00lib
>>>>> as much as possible.
>>>>> This can/should be moved into rt2x00lib where write_beacon() is being called.
>>>>>
>>>>
>>>> Yes, I wasn't too happy about this part about the patch, but couldn't
>>>> find a better solution. The problem is that with the patch the frame
>>>> cannot be dumped before the call to write_beacon, as the descriptor
>>>> hasn't been set up yet. Also, it cannot be dumped after the call to
>>>> write_beacon as most of the write_beacon functions actually free the
>>>> skb with the beacon.
>>>> So, I ran out of ideas as to how to keep rt2x00debug only inside
>>>> rt2x00lib. I'm open for suggestions, though.
>>>
>>> Well ok, if there aren't obvious alternatives this change is fine.
>>> However, please move the declaration of rt2x00debug_dump_frame()
>>> into rt2x00.h? That way we don't have to include the rt2x00lib.h header.
>>>
>>
>> The only alternative I can think of is to have the chipset driver clone the skb to have
>> a private copy of the skb, so that the original one can be freed in the generic code.
>> In that case the rt2x00debug_dump_frame call can be done from rt2x00queue code, after
>> the write_beacon function has been called.
>>
>> What do you think of that solution?
>
> I think the extra cloning isn't really worth the effort. Since it is
> only needed for debugfs,
> so the code in rt2x00queue must check for debugfs support, and debugfs code must
> be updated not to clone the frame again.
>
> Overall I think it is in this case better to just do your change with calling
> the debugfs function from the driver, but moving the declaration of the function
> into rt2x00.h to prevent the inclusion of rt2x00lib.h into the drivers.
>
OK. I'll move the declaration to rt2x00.h.
---
Gertjan.
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 7/9] rt2x00: In debugfs frame dumping allow the TX descriptor to be part of the skb.
2010-05-11 21:51 [PATCH 0/9] rt2x00: Further fixes and cleanups Gertjan van Wingerde
` (5 preceding siblings ...)
2010-05-11 21:51 ` [PATCH 6/9] rt2x00: Push beacon TX descriptor writing to drivers Gertjan van Wingerde
@ 2010-05-11 21:51 ` Gertjan van Wingerde
2010-05-12 7:12 ` Ivo Van Doorn
2010-05-11 21:51 ` [PATCH 8/9] rt2x00: Reverse calling order of bus write_tx_desc and driver write_tx_desc Gertjan van Wingerde
2010-05-11 21:51 ` [PATCH 9/9] rt2x00: Properly reserve room for descriptors in skbs Gertjan van Wingerde
8 siblings, 1 reply; 32+ messages in thread
From: Gertjan van Wingerde @ 2010-05-11 21:51 UTC (permalink / raw)
To: John W. Linville
Cc: Ivo van Doorn, linux-wireless, users, Gertjan van Wingerde
Preparation for futher cleanups in the area of properly maintaining the skb
data without fiddling with the skb->data pointer.
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
---
drivers/net/wireless/rt2x00/rt2x00debug.c | 14 ++++++++++----
drivers/net/wireless/rt2x00/rt2x00queue.h | 3 +++
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2x00debug.c b/drivers/net/wireless/rt2x00/rt2x00debug.c
index 85e9990..9dd8b7c 100644
--- a/drivers/net/wireless/rt2x00/rt2x00debug.c
+++ b/drivers/net/wireless/rt2x00/rt2x00debug.c
@@ -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(×tamp);
@@ -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");
@@ -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);
@@ -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);
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.h b/drivers/net/wireless/rt2x00/rt2x00queue.h
index 36a957a..f791708 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.h
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.h
@@ -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,
};
/**
--
1.7.1
^ permalink raw reply related [flat|nested] 32+ messages in thread* [PATCH 8/9] rt2x00: Reverse calling order of bus write_tx_desc and driver write_tx_desc.
2010-05-11 21:51 [PATCH 0/9] rt2x00: Further fixes and cleanups Gertjan van Wingerde
` (6 preceding siblings ...)
2010-05-11 21:51 ` [PATCH 7/9] rt2x00: In debugfs frame dumping allow the TX descriptor to be part of the skb Gertjan van Wingerde
@ 2010-05-11 21:51 ` Gertjan van Wingerde
2010-05-12 7:02 ` Ivo Van Doorn
2010-05-11 21:51 ` [PATCH 9/9] rt2x00: Properly reserve room for descriptors in skbs Gertjan van Wingerde
8 siblings, 1 reply; 32+ messages in thread
From: Gertjan van Wingerde @ 2010-05-11 21:51 UTC (permalink / raw)
To: John W. Linville
Cc: Ivo van Doorn, linux-wireless, users, Gertjan van Wingerde
For rt2800 reverse the calling order of rt2x00pci_write_data and
rt2800pci_write_data. Currently rt2800pci_write_data calls rt2x00pci_write_data
as there can be only 1 driver callback function specified by the driver.
Reverse this calling order by introducing a new driver callback function,
called add_tx_datadesc, which is called from the bus-specific write_tx_data
functions.
Preparation for futher cleanups in the skb data handling of rt2x00.
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
---
drivers/net/wireless/rt2x00/rt2800pci.c | 15 ++++-----------
drivers/net/wireless/rt2x00/rt2x00.h | 2 ++
drivers/net/wireless/rt2x00/rt2x00pci.c | 6 ++++++
drivers/net/wireless/rt2x00/rt2x00usb.c | 6 ++++++
4 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index fcca30c..bbd6481 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -614,18 +614,10 @@ static int rt2800pci_set_device_state(struct rt2x00_dev *rt2x00dev,
/*
* TX descriptor initialization
*/
-static int rt2800pci_write_tx_data(struct queue_entry* entry,
- struct txentry_desc *txdesc)
+static void rt2800pci_add_tx_datadesc(struct queue_entry* entry,
+ struct txentry_desc *txdesc)
{
- int ret;
-
- ret = rt2x00pci_write_tx_data(entry, txdesc);
- if (ret)
- return ret;
-
rt2800_write_txwi(entry->skb, txdesc);
-
- return 0;
}
@@ -1080,7 +1072,8 @@ static const struct rt2x00lib_ops rt2800pci_rt2x00_ops = {
.reset_tuner = rt2800_reset_tuner,
.link_tuner = rt2800_link_tuner,
.write_tx_desc = rt2800pci_write_tx_desc,
- .write_tx_data = rt2800pci_write_tx_data,
+ .write_tx_data = rt2x00pci_write_tx_data,
+ .add_tx_datadesc = rt2800pci_add_tx_datadesc,
.write_beacon = rt2800pci_write_beacon,
.kick_tx_queue = rt2800pci_kick_tx_queue,
.kill_tx_queue = rt2800pci_kill_tx_queue,
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
index 6c1ff4c..5f2531f 100644
--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
@@ -551,6 +551,8 @@ struct rt2x00lib_ops {
struct txentry_desc *txdesc);
int (*write_tx_data) (struct queue_entry *entry,
struct txentry_desc *txdesc);
+ void (*add_tx_datadesc) (struct queue_entry *entry,
+ struct txentry_desc *txdesc);
void (*write_beacon) (struct queue_entry *entry,
struct txentry_desc *txdesc);
int (*get_tx_data_len) (struct queue_entry *entry);
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c
index ff80ef7..cd61d6f 100644
--- a/drivers/net/wireless/rt2x00/rt2x00pci.c
+++ b/drivers/net/wireless/rt2x00/rt2x00pci.c
@@ -80,6 +80,12 @@ int rt2x00pci_write_tx_data(struct queue_entry *entry,
return -EINVAL;
}
+ /*
+ * Call the driver's add_tx_datadesc function, if it exists.
+ */
+ if (rt2x00dev->ops->lib->add_tx_datadesc)
+ rt2x00dev->ops->lib->add_tx_datadesc(entry, txdesc);
+
return 0;
}
EXPORT_SYMBOL_GPL(rt2x00pci_write_tx_data);
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c
index a4f0551..e731389 100644
--- a/drivers/net/wireless/rt2x00/rt2x00usb.c
+++ b/drivers/net/wireless/rt2x00/rt2x00usb.c
@@ -247,6 +247,12 @@ int rt2x00usb_write_tx_data(struct queue_entry *entry,
*/
skb_pull(entry->skb, entry->queue->desc_size);
+ /*
+ * Call the driver's add_tx_datadesc function, if it exists.
+ */
+ if (rt2x00dev->ops->lib->add_tx_datadesc)
+ rt2x00dev->ops->lib->add_tx_datadesc(entry, txdesc);
+
return 0;
}
EXPORT_SYMBOL_GPL(rt2x00usb_write_tx_data);
--
1.7.1
^ permalink raw reply related [flat|nested] 32+ messages in thread* Re: [PATCH 8/9] rt2x00: Reverse calling order of bus write_tx_desc and driver write_tx_desc.
2010-05-11 21:51 ` [PATCH 8/9] rt2x00: Reverse calling order of bus write_tx_desc and driver write_tx_desc Gertjan van Wingerde
@ 2010-05-12 7:02 ` Ivo Van Doorn
2010-05-12 9:55 ` Gertjan van Wingerde
0 siblings, 1 reply; 32+ messages in thread
From: Ivo Van Doorn @ 2010-05-12 7:02 UTC (permalink / raw)
To: Gertjan van Wingerde; +Cc: John W. Linville, linux-wireless, users
On Tue, May 11, 2010 at 11:51 PM, Gertjan van Wingerde
<gwingerde@gmail.com> wrote:
> For rt2800 reverse the calling order of rt2x00pci_write_data and
> rt2800pci_write_data. Currently rt2800pci_write_data calls rt2x00pci_write_data
> as there can be only 1 driver callback function specified by the driver.
> Reverse this calling order by introducing a new driver callback function,
> called add_tx_datadesc, which is called from the bus-specific write_tx_data
> functions.
> Preparation for futher cleanups in the skb data handling of rt2x00.
>
> Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
> ---
> drivers/net/wireless/rt2x00/rt2800pci.c | 15 ++++-----------
> drivers/net/wireless/rt2x00/rt2x00.h | 2 ++
> drivers/net/wireless/rt2x00/rt2x00pci.c | 6 ++++++
> drivers/net/wireless/rt2x00/rt2x00usb.c | 6 ++++++
> 4 files changed, 18 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
> index fcca30c..bbd6481 100644
> --- a/drivers/net/wireless/rt2x00/rt2800pci.c
> +++ b/drivers/net/wireless/rt2x00/rt2800pci.c
> @@ -614,18 +614,10 @@ static int rt2800pci_set_device_state(struct rt2x00_dev *rt2x00dev,
> /*
> * TX descriptor initialization
> */
> -static int rt2800pci_write_tx_data(struct queue_entry* entry,
> - struct txentry_desc *txdesc)
> +static void rt2800pci_add_tx_datadesc(struct queue_entry* entry,
> + struct txentry_desc *txdesc)
> {
> - int ret;
> -
> - ret = rt2x00pci_write_tx_data(entry, txdesc);
> - if (ret)
> - return ret;
> -
> rt2800_write_txwi(entry->skb, txdesc);
> -
> - return 0;
> }
>
>
> @@ -1080,7 +1072,8 @@ static const struct rt2x00lib_ops rt2800pci_rt2x00_ops = {
> .reset_tuner = rt2800_reset_tuner,
> .link_tuner = rt2800_link_tuner,
> .write_tx_desc = rt2800pci_write_tx_desc,
> - .write_tx_data = rt2800pci_write_tx_data,
> + .write_tx_data = rt2x00pci_write_tx_data,
> + .add_tx_datadesc = rt2800pci_add_tx_datadesc,
> .write_beacon = rt2800pci_write_beacon,
> .kick_tx_queue = rt2800pci_kick_tx_queue,
> .kill_tx_queue = rt2800pci_kill_tx_queue,
Doesn't the name write_tx_datadesc make more sense?
Ivo
^ permalink raw reply [flat|nested] 32+ messages in thread* Re: [PATCH 8/9] rt2x00: Reverse calling order of bus write_tx_desc and driver write_tx_desc.
2010-05-12 7:02 ` Ivo Van Doorn
@ 2010-05-12 9:55 ` Gertjan van Wingerde
2010-05-12 17:47 ` Ivo Van Doorn
0 siblings, 1 reply; 32+ messages in thread
From: Gertjan van Wingerde @ 2010-05-12 9:55 UTC (permalink / raw)
To: Ivo Van Doorn; +Cc: John W. Linville, linux-wireless, users
On Wed, May 12, 2010 at 9:02 AM, Ivo Van Doorn <ivdoorn@gmail.com> wrote:
> On Tue, May 11, 2010 at 11:51 PM, Gertjan van Wingerde
> <gwingerde@gmail.com> wrote:
>> For rt2800 reverse the calling order of rt2x00pci_write_data and
>> rt2800pci_write_data. Currently rt2800pci_write_data calls rt2x00pci_write_data
>> as there can be only 1 driver callback function specified by the driver.
>> Reverse this calling order by introducing a new driver callback function,
>> called add_tx_datadesc, which is called from the bus-specific write_tx_data
>> functions.
>> Preparation for futher cleanups in the skb data handling of rt2x00.
>>
>> Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
>> ---
>> drivers/net/wireless/rt2x00/rt2800pci.c | 15 ++++-----------
>> drivers/net/wireless/rt2x00/rt2x00.h | 2 ++
>> drivers/net/wireless/rt2x00/rt2x00pci.c | 6 ++++++
>> drivers/net/wireless/rt2x00/rt2x00usb.c | 6 ++++++
>> 4 files changed, 18 insertions(+), 11 deletions(-)
>>
>> diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
>> index fcca30c..bbd6481 100644
>> --- a/drivers/net/wireless/rt2x00/rt2800pci.c
>> +++ b/drivers/net/wireless/rt2x00/rt2800pci.c
>> @@ -614,18 +614,10 @@ static int rt2800pci_set_device_state(struct rt2x00_dev *rt2x00dev,
>> /*
>> * TX descriptor initialization
>> */
>> -static int rt2800pci_write_tx_data(struct queue_entry* entry,
>> - struct txentry_desc *txdesc)
>> +static void rt2800pci_add_tx_datadesc(struct queue_entry* entry,
>> + struct txentry_desc *txdesc)
>> {
>> - int ret;
>> -
>> - ret = rt2x00pci_write_tx_data(entry, txdesc);
>> - if (ret)
>> - return ret;
>> -
>> rt2800_write_txwi(entry->skb, txdesc);
>> -
>> - return 0;
>> }
>>
>>
>> @@ -1080,7 +1072,8 @@ static const struct rt2x00lib_ops rt2800pci_rt2x00_ops = {
>> .reset_tuner = rt2800_reset_tuner,
>> .link_tuner = rt2800_link_tuner,
>> .write_tx_desc = rt2800pci_write_tx_desc,
>> - .write_tx_data = rt2800pci_write_tx_data,
>> + .write_tx_data = rt2x00pci_write_tx_data,
>> + .add_tx_datadesc = rt2800pci_add_tx_datadesc,
>> .write_beacon = rt2800pci_write_beacon,
>> .kick_tx_queue = rt2800pci_kick_tx_queue,
>> .kill_tx_queue = rt2800pci_kill_tx_queue,
>
> Doesn't the name write_tx_datadesc make more sense?
>
The names are equivalent to me. But if that name makes more sense to
you then I have no problem with changing the name of the callback
function.
---
Gertjan
^ permalink raw reply [flat|nested] 32+ messages in thread* Re: [PATCH 8/9] rt2x00: Reverse calling order of bus write_tx_desc and driver write_tx_desc.
2010-05-12 9:55 ` Gertjan van Wingerde
@ 2010-05-12 17:47 ` Ivo Van Doorn
2010-05-12 19:02 ` Gertjan van Wingerde
0 siblings, 1 reply; 32+ messages in thread
From: Ivo Van Doorn @ 2010-05-12 17:47 UTC (permalink / raw)
To: Gertjan van Wingerde; +Cc: John W. Linville, linux-wireless, users
On Wed, May 12, 2010 at 11:55 AM, Gertjan van Wingerde
<gwingerde@gmail.com> wrote:
> On Wed, May 12, 2010 at 9:02 AM, Ivo Van Doorn <ivdoorn@gmail.com> wrote:
>> On Tue, May 11, 2010 at 11:51 PM, Gertjan van Wingerde
>> <gwingerde@gmail.com> wrote:
>>> For rt2800 reverse the calling order of rt2x00pci_write_data and
>>> rt2800pci_write_data. Currently rt2800pci_write_data calls rt2x00pci_write_data
>>> as there can be only 1 driver callback function specified by the driver.
>>> Reverse this calling order by introducing a new driver callback function,
>>> called add_tx_datadesc, which is called from the bus-specific write_tx_data
>>> functions.
>>> Preparation for futher cleanups in the skb data handling of rt2x00.
>>>
>>> Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
>>> ---
>>> drivers/net/wireless/rt2x00/rt2800pci.c | 15 ++++-----------
>>> drivers/net/wireless/rt2x00/rt2x00.h | 2 ++
>>> drivers/net/wireless/rt2x00/rt2x00pci.c | 6 ++++++
>>> drivers/net/wireless/rt2x00/rt2x00usb.c | 6 ++++++
>>> 4 files changed, 18 insertions(+), 11 deletions(-)
>>>
>>> diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
>>> index fcca30c..bbd6481 100644
>>> --- a/drivers/net/wireless/rt2x00/rt2800pci.c
>>> +++ b/drivers/net/wireless/rt2x00/rt2800pci.c
>>> @@ -614,18 +614,10 @@ static int rt2800pci_set_device_state(struct rt2x00_dev *rt2x00dev,
>>> /*
>>> * TX descriptor initialization
>>> */
>>> -static int rt2800pci_write_tx_data(struct queue_entry* entry,
>>> - struct txentry_desc *txdesc)
>>> +static void rt2800pci_add_tx_datadesc(struct queue_entry* entry,
>>> + struct txentry_desc *txdesc)
>>> {
>>> - int ret;
>>> -
>>> - ret = rt2x00pci_write_tx_data(entry, txdesc);
>>> - if (ret)
>>> - return ret;
>>> -
>>> rt2800_write_txwi(entry->skb, txdesc);
>>> -
>>> - return 0;
>>> }
>>>
>>>
>>> @@ -1080,7 +1072,8 @@ static const struct rt2x00lib_ops rt2800pci_rt2x00_ops = {
>>> .reset_tuner = rt2800_reset_tuner,
>>> .link_tuner = rt2800_link_tuner,
>>> .write_tx_desc = rt2800pci_write_tx_desc,
>>> - .write_tx_data = rt2800pci_write_tx_data,
>>> + .write_tx_data = rt2x00pci_write_tx_data,
>>> + .add_tx_datadesc = rt2800pci_add_tx_datadesc,
>>> .write_beacon = rt2800pci_write_beacon,
>>> .kick_tx_queue = rt2800pci_kick_tx_queue,
>>> .kill_tx_queue = rt2800pci_kill_tx_queue,
>>
>> Doesn't the name write_tx_datadesc make more sense?
>>
>
> The names are equivalent to me. But if that name makes more sense to
> you then I have no problem with changing the name of the callback
> function.
Yes please rename it. That way it fits in the
write_tx_desc
write_tx_data
write_tx_datadesc
Thanks,
Ivo
^ permalink raw reply [flat|nested] 32+ messages in thread* Re: [PATCH 8/9] rt2x00: Reverse calling order of bus write_tx_desc and driver write_tx_desc.
2010-05-12 17:47 ` Ivo Van Doorn
@ 2010-05-12 19:02 ` Gertjan van Wingerde
0 siblings, 0 replies; 32+ messages in thread
From: Gertjan van Wingerde @ 2010-05-12 19:02 UTC (permalink / raw)
To: Ivo Van Doorn; +Cc: John W. Linville, linux-wireless, users
On 05/12/10 19:47, Ivo Van Doorn wrote:
> On Wed, May 12, 2010 at 11:55 AM, Gertjan van Wingerde
> <gwingerde@gmail.com> wrote:
>> On Wed, May 12, 2010 at 9:02 AM, Ivo Van Doorn <ivdoorn@gmail.com> wrote:
>>> On Tue, May 11, 2010 at 11:51 PM, Gertjan van Wingerde
>>> <gwingerde@gmail.com> wrote:
>>>> For rt2800 reverse the calling order of rt2x00pci_write_data and
>>>> rt2800pci_write_data. Currently rt2800pci_write_data calls rt2x00pci_write_data
>>>> as there can be only 1 driver callback function specified by the driver.
>>>> Reverse this calling order by introducing a new driver callback function,
>>>> called add_tx_datadesc, which is called from the bus-specific write_tx_data
>>>> functions.
>>>> Preparation for futher cleanups in the skb data handling of rt2x00.
>>>>
>>>> Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
>>>> ---
>>>> drivers/net/wireless/rt2x00/rt2800pci.c | 15 ++++-----------
>>>> drivers/net/wireless/rt2x00/rt2x00.h | 2 ++
>>>> drivers/net/wireless/rt2x00/rt2x00pci.c | 6 ++++++
>>>> drivers/net/wireless/rt2x00/rt2x00usb.c | 6 ++++++
>>>> 4 files changed, 18 insertions(+), 11 deletions(-)
>>>>
>>>> diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
>>>> index fcca30c..bbd6481 100644
>>>> --- a/drivers/net/wireless/rt2x00/rt2800pci.c
>>>> +++ b/drivers/net/wireless/rt2x00/rt2800pci.c
>>>> @@ -614,18 +614,10 @@ static int rt2800pci_set_device_state(struct rt2x00_dev *rt2x00dev,
>>>> /*
>>>> * TX descriptor initialization
>>>> */
>>>> -static int rt2800pci_write_tx_data(struct queue_entry* entry,
>>>> - struct txentry_desc *txdesc)
>>>> +static void rt2800pci_add_tx_datadesc(struct queue_entry* entry,
>>>> + struct txentry_desc *txdesc)
>>>> {
>>>> - int ret;
>>>> -
>>>> - ret = rt2x00pci_write_tx_data(entry, txdesc);
>>>> - if (ret)
>>>> - return ret;
>>>> -
>>>> rt2800_write_txwi(entry->skb, txdesc);
>>>> -
>>>> - return 0;
>>>> }
>>>>
>>>>
>>>> @@ -1080,7 +1072,8 @@ static const struct rt2x00lib_ops rt2800pci_rt2x00_ops = {
>>>> .reset_tuner = rt2800_reset_tuner,
>>>> .link_tuner = rt2800_link_tuner,
>>>> .write_tx_desc = rt2800pci_write_tx_desc,
>>>> - .write_tx_data = rt2800pci_write_tx_data,
>>>> + .write_tx_data = rt2x00pci_write_tx_data,
>>>> + .add_tx_datadesc = rt2800pci_add_tx_datadesc,
>>>> .write_beacon = rt2800pci_write_beacon,
>>>> .kick_tx_queue = rt2800pci_kick_tx_queue,
>>>> .kill_tx_queue = rt2800pci_kill_tx_queue,
>>>
>>> Doesn't the name write_tx_datadesc make more sense?
>>>
>>
>> The names are equivalent to me. But if that name makes more sense to
>> you then I have no problem with changing the name of the callback
>> function.
>
> Yes please rename it. That way it fits in the
> write_tx_desc
> write_tx_data
> write_tx_datadesc
>
OK. Will do.
---
Gertjan
^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 9/9] rt2x00: Properly reserve room for descriptors in skbs.
2010-05-11 21:51 [PATCH 0/9] rt2x00: Further fixes and cleanups Gertjan van Wingerde
` (7 preceding siblings ...)
2010-05-11 21:51 ` [PATCH 8/9] rt2x00: Reverse calling order of bus write_tx_desc and driver write_tx_desc Gertjan van Wingerde
@ 2010-05-11 21:51 ` Gertjan van Wingerde
2010-05-12 7:08 ` Ivo Van Doorn
8 siblings, 1 reply; 32+ messages in thread
From: Gertjan van Wingerde @ 2010-05-11 21:51 UTC (permalink / raw)
To: John W. Linville
Cc: Ivo van Doorn, linux-wireless, users, Gertjan van Wingerde
Instead of fiddling with the skb->data pointer and thereby risking
out of bounds accesses, properly reserve the space needed in an
skb for descriptors.
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
---
drivers/net/wireless/rt2x00/rt2400pci.c | 2 +-
drivers/net/wireless/rt2x00/rt2500pci.c | 2 +-
drivers/net/wireless/rt2x00/rt2500usb.c | 14 ++++++----
drivers/net/wireless/rt2x00/rt2800lib.c | 3 +-
drivers/net/wireless/rt2x00/rt2800lib.h | 2 +-
drivers/net/wireless/rt2x00/rt2800pci.c | 23 ++++++++--------
drivers/net/wireless/rt2x00/rt2800usb.c | 22 +++++++++------
drivers/net/wireless/rt2x00/rt2x00.h | 7 +++++
drivers/net/wireless/rt2x00/rt2x00dev.c | 5 ---
drivers/net/wireless/rt2x00/rt2x00lib.h | 7 -----
drivers/net/wireless/rt2x00/rt2x00pci.c | 40 +++++++++++++++++++++++++++++
drivers/net/wireless/rt2x00/rt2x00pci.h | 8 ++++++
drivers/net/wireless/rt2x00/rt2x00queue.c | 24 +----------------
drivers/net/wireless/rt2x00/rt2x00usb.c | 11 +++----
drivers/net/wireless/rt2x00/rt61pci.c | 4 +-
drivers/net/wireless/rt2x00/rt73usb.c | 14 ++++++----
16 files changed, 109 insertions(+), 79 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index 741c531..38ee78b 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -1228,7 +1228,7 @@ static void rt2400pci_txdone(struct rt2x00_dev *rt2x00dev,
}
txdesc.retry = rt2x00_get_field32(word, TXD_W0_RETRY_COUNT);
- rt2x00lib_txdone(entry, &txdesc);
+ rt2x00pci_txdone(entry, &txdesc);
}
}
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index 4dc101e..cc7091c 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -1364,7 +1364,7 @@ static void rt2500pci_txdone(struct rt2x00_dev *rt2x00dev,
}
txdesc.retry = rt2x00_get_field32(word, TXD_W0_RETRY_COUNT);
- rt2x00lib_txdone(entry, &txdesc);
+ rt2x00pci_txdone(entry, &txdesc);
}
}
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index 4911d1a..b6ccb57 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -1034,7 +1034,7 @@ static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
struct txentry_desc *txdesc)
{
struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb);
- __le32 *txd = (__le32 *)(skb->data - TXD_DESC_SIZE);
+ __le32 *txd = (__le32 *) skb->data;
u32 word;
/*
@@ -1080,6 +1080,7 @@ static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
/*
* Register descriptor details in skb frame descriptor.
*/
+ skbdesc->flags |= SKBDESC_DESC_IN_SKB;
skbdesc->desc = txd;
skbdesc->desc_len = TXD_DESC_SIZE;
}
@@ -1108,6 +1109,12 @@ static void rt2500usb_write_beacon(struct queue_entry *entry,
rt2500usb_register_write(rt2x00dev, TXRX_CSR19, reg);
/*
+ * Add space for the descriptor in front of the skb.
+ */
+ skb_push(entry->skb, TXD_DESC_SIZE);
+ memset(entry->skb->data, 0, TXD_DESC_SIZE);
+
+ /*
* Write the TX descriptor for the beacon.
*/
rt2500usb_write_tx_desc(rt2x00dev, entry->skb, txdesc);
@@ -1118,11 +1125,6 @@ static void rt2500usb_write_beacon(struct queue_entry *entry,
rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_BEACON, entry->skb);
/*
- * Take the descriptor in front of the skb into account.
- */
- skb_push(entry->skb, TXD_DESC_SIZE);
-
- /*
* USB devices cannot blindly pass the skb->len as the
* length of the data to usb_fill_bulk_urb. Pass the skb
* to the driver to determine what the length should be.
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index 7410ac1..53a3257 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -281,9 +281,8 @@ int rt2800_wait_wpdma_ready(struct rt2x00_dev *rt2x00dev)
}
EXPORT_SYMBOL_GPL(rt2800_wait_wpdma_ready);
-void rt2800_write_txwi(struct sk_buff *skb, struct txentry_desc *txdesc)
+void rt2800_write_txwi(__le32 *txwi, struct txentry_desc *txdesc)
{
- __le32 *txwi = (__le32 *)(skb->data - TXWI_DESC_SIZE);
u32 word;
/*
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.h b/drivers/net/wireless/rt2x00/rt2800lib.h
index 94de999..0f0a13c 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.h
+++ b/drivers/net/wireless/rt2x00/rt2800lib.h
@@ -111,7 +111,7 @@ void rt2800_mcu_request(struct rt2x00_dev *rt2x00dev,
const u8 command, const u8 token,
const u8 arg0, const u8 arg1);
-void rt2800_write_txwi(struct sk_buff *skb, struct txentry_desc *txdesc);
+void rt2800_write_txwi(__le32 *txwi, struct txentry_desc *txdesc);
void rt2800_process_rxwi(struct sk_buff *skb, struct rxdone_entry_desc *txdesc);
extern const struct rt2x00debug rt2800_rt2x00debug;
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index bbd6481..86f7042 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -617,7 +617,7 @@ static int rt2800pci_set_device_state(struct rt2x00_dev *rt2x00dev,
static void rt2800pci_add_tx_datadesc(struct queue_entry* entry,
struct txentry_desc *txdesc)
{
- rt2800_write_txwi(entry->skb, txdesc);
+ rt2800_write_txwi((__le32 *) entry->skb->data, txdesc);
}
@@ -694,15 +694,22 @@ static void rt2800pci_write_beacon(struct queue_entry *entry,
rt2800_register_write(rt2x00dev, BCN_TIME_CFG, reg);
/*
+ * Add space for the TXWI in front of the skb.
+ */
+ skb_push(entry->skb, TXWI_DESC_SIZE);
+ memset(entry->skb, 0, TXWI_DESC_SIZE);
+
+ /*
* Register descriptor details in skb frame descriptor.
*/
- skbdesc->desc = entry->skb->data - TXWI_DESC_SIZE;
+ skbdesc->flags |= SKBDESC_DESC_IN_SKB;
+ skbdesc->desc = entry->skb->data;
skbdesc->desc_len = TXWI_DESC_SIZE;
/*
* Add the TXWI for the beacon to the skb.
*/
- rt2800_write_txwi(entry->skb, txdesc);
+ rt2800_write_txwi((__le32 *)entry->skb->data, txdesc);
/*
* Dump beacon to userspace through debugfs.
@@ -710,11 +717,6 @@ static void rt2800pci_write_beacon(struct queue_entry *entry,
rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_BEACON, entry->skb);
/*
- * Adjust skb to take TXWI into account.
- */
- skb_push(entry->skb, TXWI_DESC_SIZE);
-
- /*
* Write entire beacon with TXWI to register.
*/
beacon_base = HW_BEACON_OFFSET(entry->entry_idx);
@@ -889,8 +891,7 @@ static void rt2800pci_txdone(struct rt2x00_dev *rt2x00dev)
/* Check if we got a match by looking at WCID/ACK/PID
* fields */
- txwi = (__le32 *)(entry->skb->data -
- rt2x00dev->ops->extra_tx_headroom);
+ txwi = (__le32 *) entry->skb->data;
rt2x00_desc_read(txwi, 1, &word);
tx_wcid = rt2x00_get_field32(word, TXWI_W1_WIRELESS_CLI_ID);
@@ -935,7 +936,7 @@ static void rt2800pci_txdone(struct rt2x00_dev *rt2x00dev)
__set_bit(TXDONE_FALLBACK, &txdesc.flags);
- rt2x00lib_txdone(entry, &txdesc);
+ rt2x00pci_txdone(entry, &txdesc);
}
}
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
index 9a29f73..a8e6e71 100644
--- a/drivers/net/wireless/rt2x00/rt2800usb.c
+++ b/drivers/net/wireless/rt2x00/rt2800usb.c
@@ -401,13 +401,14 @@ static void rt2800usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
struct txentry_desc *txdesc)
{
struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb);
- __le32 *txi = (__le32 *)(skb->data - TXWI_DESC_SIZE - TXINFO_DESC_SIZE);
+ __le32 *txi = (__le32 *) skb->data;
+ __le32 *txwi = (__le32 *) (skb->data + TXINFO_DESC_SIZE);
u32 word;
/*
* Initialize TXWI descriptor
*/
- rt2800_write_txwi(skb, txdesc);
+ rt2800_write_txwi(txwi, txdesc);
/*
* Initialize TXINFO descriptor
@@ -427,6 +428,7 @@ static void rt2800usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
/*
* Register descriptor details in skb frame descriptor.
*/
+ skbdesc->flags |= SKBDESC_DESC_IN_SKB;
skbdesc->desc = txi;
skbdesc->desc_len = TXINFO_DESC_SIZE + TXWI_DESC_SIZE;
}
@@ -451,15 +453,22 @@ static void rt2800usb_write_beacon(struct queue_entry *entry,
rt2800_register_write(rt2x00dev, BCN_TIME_CFG, reg);
/*
+ * Add space for the TXWI in front of the skb.
+ */
+ skb_push(entry->skb, TXWI_DESC_SIZE);
+ memset(entry->skb, 0, TXWI_DESC_SIZE);
+
+ /*
* Register descriptor details in skb frame descriptor.
*/
- skbdesc->desc = entry->skb->data - TXWI_DESC_SIZE;
+ skbdesc->flags |= SKBDESC_DESC_IN_SKB;
+ skbdesc->desc = entry->skb->data;
skbdesc->desc_len = TXWI_DESC_SIZE;
/*
* Add the TXWI for the beacon to the skb.
*/
- rt2800_write_txwi(entry->skb, txdesc);
+ rt2800_write_txwi((__le32 *) entry->skb->data, txdesc);
/*
* Dump beacon to userspace through debugfs.
@@ -467,11 +476,6 @@ static void rt2800usb_write_beacon(struct queue_entry *entry,
rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_BEACON, entry->skb);
/*
- * Adjust skb to take TXWI into account.
- */
- skb_push(entry->skb, TXWI_DESC_SIZE);
-
- /*
* Write entire beacon with descriptor to register.
*/
beacon_base = HW_BEACON_OFFSET(entry->entry_idx);
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
index 5f2531f..4cb9f87 100644
--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
@@ -1001,6 +1001,13 @@ static inline bool rt2x00_is_soc(struct rt2x00_dev *rt2x00dev)
void rt2x00queue_map_txskb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb);
/**
+ * rt2x00queue_unmap_skb - Unmap a skb from DMA.
+ * @rt2x00dev: Pointer to &struct rt2x00_dev.
+ * @skb: The skb to unmap.
+ */
+void rt2x00queue_unmap_skb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb);
+
+/**
* rt2x00queue_get_queue - Convert queue index to queue pointer
* @rt2x00dev: Pointer to &struct rt2x00_dev.
* @queue: rt2x00 queue index (see &enum data_queue_qid).
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index 33c2f5f..6790441 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -210,11 +210,6 @@ void rt2x00lib_txdone(struct queue_entry *entry,
bool success;
/*
- * Unmap the skb.
- */
- rt2x00queue_unmap_skb(rt2x00dev, entry->skb);
-
- /*
* Remove L2 padding which was added during
*/
if (test_bit(DRIVER_REQUIRE_L2PAD, &rt2x00dev->flags))
diff --git a/drivers/net/wireless/rt2x00/rt2x00lib.h b/drivers/net/wireless/rt2x00/rt2x00lib.h
index be2e37f..2bffc51 100644
--- a/drivers/net/wireless/rt2x00/rt2x00lib.h
+++ b/drivers/net/wireless/rt2x00/rt2x00lib.h
@@ -107,13 +107,6 @@ struct sk_buff *rt2x00queue_alloc_rxskb(struct rt2x00_dev *rt2x00dev,
struct queue_entry *entry);
/**
- * rt2x00queue_unmap_skb - Unmap a skb from DMA.
- * @rt2x00dev: Pointer to &struct rt2x00_dev.
- * @skb: The skb to unmap.
- */
-void rt2x00queue_unmap_skb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb);
-
-/**
* rt2x00queue_free_skb - free a skb
* @rt2x00dev: Pointer to &struct rt2x00_dev.
* @skb: The skb to free.
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c
index cd61d6f..e474629 100644
--- a/drivers/net/wireless/rt2x00/rt2x00pci.c
+++ b/drivers/net/wireless/rt2x00/rt2x00pci.c
@@ -81,11 +81,23 @@ int rt2x00pci_write_tx_data(struct queue_entry *entry,
}
/*
+ * Add the requested extra tx headroom in front of the skb.
+ */
+ skb_push(entry->skb, rt2x00dev->ops->extra_tx_headroom);
+ memset(entry->skb->data, 0, rt2x00dev->ops->extra_tx_headroom);
+
+ /*
* Call the driver's add_tx_datadesc function, if it exists.
*/
if (rt2x00dev->ops->lib->add_tx_datadesc)
rt2x00dev->ops->lib->add_tx_datadesc(entry, txdesc);
+ /*
+ * Map the skb to DMA.
+ */
+ if (test_bit(DRIVER_REQUIRE_DMA, &rt2x00dev->flags))
+ rt2x00queue_map_txskb(rt2x00dev, entry->skb);
+
return 0;
}
EXPORT_SYMBOL_GPL(rt2x00pci_write_tx_data);
@@ -93,6 +105,34 @@ EXPORT_SYMBOL_GPL(rt2x00pci_write_tx_data);
/*
* TX/RX data handlers.
*/
+void rt2x00pci_txdone(struct queue_entry *entry,
+ struct txdone_entry_desc *txdesc)
+{
+ struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
+ struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
+
+ /*
+ * Unmap the skb.
+ */
+ rt2x00queue_unmap_skb(rt2x00dev, entry->skb);
+
+ /*
+ * Remove the extra tx headroom from the skb.
+ */
+ skb_pull(entry->skb, rt2x00dev->ops->extra_tx_headroom);
+
+ /*
+ * Signal that the TX descriptor is no longer in the skb.
+ */
+ skbdesc->flags &= ~SKBDESC_DESC_IN_SKB;
+
+ /*
+ * Pass on to rt2x00lib.
+ */
+ rt2x00lib_txdone(entry, txdesc);
+}
+EXPORT_SYMBOL_GPL(rt2x00pci_txdone);
+
void rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev)
{
struct data_queue *queue = rt2x00dev->rx;
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.h b/drivers/net/wireless/rt2x00/rt2x00pci.h
index 51bcef3..00528b8 100644
--- a/drivers/net/wireless/rt2x00/rt2x00pci.h
+++ b/drivers/net/wireless/rt2x00/rt2x00pci.h
@@ -109,6 +109,14 @@ struct queue_entry_priv_pci {
};
/**
+ * rt2x00pci_txdone - Handle TX done events.
+ * @entry: The queue entry for which a TX done event was received.
+ * @txdesc: The TX done descriptor for the entry.
+ */
+void rt2x00pci_txdone(struct queue_entry *entry,
+ struct txdone_entry_desc *txdesc);
+
+/**
* rt2x00pci_rxdone - Handle RX done events
* @rt2x00dev: Device pointer, see &struct rt2x00_dev.
*/
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index 9e48bbc..bcdbf95 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -99,21 +99,8 @@ void rt2x00queue_map_txskb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb)
{
struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb);
- /*
- * If device has requested headroom, we should make sure that
- * is also mapped to the DMA so it can be used for transfering
- * additional descriptor information to the hardware.
- */
- skb_push(skb, rt2x00dev->ops->extra_tx_headroom);
-
skbdesc->skb_dma =
dma_map_single(rt2x00dev->dev, skb->data, skb->len, DMA_TO_DEVICE);
-
- /*
- * Restore data pointer to original location again.
- */
- skb_pull(skb, rt2x00dev->ops->extra_tx_headroom);
-
skbdesc->flags |= SKBDESC_DMA_MAPPED_TX;
}
EXPORT_SYMBOL_GPL(rt2x00queue_map_txskb);
@@ -129,16 +116,12 @@ void rt2x00queue_unmap_skb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb)
}
if (skbdesc->flags & SKBDESC_DMA_MAPPED_TX) {
- /*
- * Add headroom to the skb length, it has been removed
- * by the driver, but it was actually mapped to DMA.
- */
- dma_unmap_single(rt2x00dev->dev, skbdesc->skb_dma,
- skb->len + rt2x00dev->ops->extra_tx_headroom,
+ dma_unmap_single(rt2x00dev->dev, skbdesc->skb_dma, skb->len,
DMA_TO_DEVICE);
skbdesc->flags &= ~SKBDESC_DMA_MAPPED_TX;
}
}
+EXPORT_SYMBOL_GPL(rt2x00queue_unmap_skb);
void rt2x00queue_free_skb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb)
{
@@ -533,9 +516,6 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb,
return -EIO;
}
- if (test_bit(DRIVER_REQUIRE_DMA, &queue->rt2x00dev->flags))
- rt2x00queue_map_txskb(queue->rt2x00dev, skb);
-
set_bit(ENTRY_DATA_PENDING, &entry->flags);
rt2x00queue_index_inc(queue, Q_INDEX);
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c
index e731389..9388e44 100644
--- a/drivers/net/wireless/rt2x00/rt2x00usb.c
+++ b/drivers/net/wireless/rt2x00/rt2x00usb.c
@@ -197,6 +197,11 @@ static void rt2x00usb_interrupt_txdone(struct urb *urb)
return;
/*
+ * Remove the descriptor from the front of the skb.
+ */
+ skb_pull(entry->skb, entry->queue->desc_size);
+
+ /*
* Obtain the status about this packet.
* Note that when the status is 0 it does not mean the
* frame was send out correctly. It only means the frame
@@ -242,12 +247,6 @@ int rt2x00usb_write_tx_data(struct queue_entry *entry,
rt2x00usb_interrupt_txdone, entry);
/*
- * Make sure the skb->data pointer points to the frame, not the
- * descriptor.
- */
- skb_pull(entry->skb, entry->queue->desc_size);
-
- /*
* Call the driver's add_tx_datadesc function, if it exists.
*/
if (rt2x00dev->ops->lib->add_tx_datadesc)
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index cf9d507..5fd6481 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -2109,7 +2109,7 @@ static void rt61pci_txdone(struct rt2x00_dev *rt2x00dev)
__set_bit(TXDONE_UNKNOWN, &txdesc.flags);
txdesc.retry = 0;
- rt2x00lib_txdone(entry_done, &txdesc);
+ rt2x00pci_txdone(entry_done, &txdesc);
entry_done = rt2x00queue_get_entry(queue, Q_INDEX_DONE);
}
@@ -2129,7 +2129,7 @@ static void rt61pci_txdone(struct rt2x00_dev *rt2x00dev)
}
txdesc.retry = rt2x00_get_field32(reg, STA_CSR4_RETRY_COUNT);
- rt2x00lib_txdone(entry, &txdesc);
+ rt2x00pci_txdone(entry, &txdesc);
}
}
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 085f76e..10893d5 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -1441,7 +1441,7 @@ static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
struct txentry_desc *txdesc)
{
struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb);
- __le32 *txd = (__le32 *)(skb->data - TXD_DESC_SIZE);
+ __le32 *txd = (__le32 *) skb->data;
u32 word;
/*
@@ -1504,6 +1504,7 @@ static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
/*
* Register descriptor details in skb frame descriptor.
*/
+ skbdesc->flags |= SKBDESC_DESC_IN_SKB;
skbdesc->desc = txd;
skbdesc->desc_len = TXD_DESC_SIZE;
}
@@ -1527,6 +1528,12 @@ static void rt73usb_write_beacon(struct queue_entry *entry,
rt2x00usb_register_write(rt2x00dev, TXRX_CSR9, reg);
/*
+ * Add space for the descriptor in front of the skb.
+ */
+ skb_push(entry->skb, TXD_DESC_SIZE);
+ memset(entry->skb->data, 0, TXD_DESC_SIZE);
+
+ /*
* Write the TX descriptor for the beacon.
*/
rt73usb_write_tx_desc(rt2x00dev, entry->skb, txdesc);
@@ -1537,11 +1544,6 @@ static void rt73usb_write_beacon(struct queue_entry *entry,
rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_BEACON, entry->skb);
/*
- * Take the descriptor in front of the skb into account.
- */
- skb_push(entry->skb, TXD_DESC_SIZE);
-
- /*
* Write entire beacon with descriptor to register.
*/
beacon_base = HW_BEACON_OFFSET(entry->entry_idx);
--
1.7.1
^ permalink raw reply related [flat|nested] 32+ messages in thread