From: Larry Finger <Larry.Finger@lwfinger.net>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: "Rafał Miłecki" <zajec5@gmail.com>,
linux-wireless@vger.kernel.org,
"John W. Linville" <linville@tuxdriver.com>,
linux-kernel@vger.kernel.org,
"Linus Torvalds" <torvalds@linux-foundation.org>,
b43-dev <b43-dev@lists.infradead.org>
Subject: [PATCH] b43: fix regression in PIO case
Date: Mon, 26 Dec 2011 12:32:15 -0600 [thread overview]
Message-ID: <4EF8BDAF.6050402@lwfinger.net> (raw)
In-Reply-To: <alpine.DEB.2.00.1112261909550.12108@axis700.grange>
On 12/26/2011 12:17 PM, Guennadi Liakhovetski wrote:
> On Mon, 26 Dec 2011, Larry Finger wrote:
>
>> On 12/26/2011 11:28 AM, Guennadi Liakhovetski wrote:
>>> This patch fixes the regression, introduced by
>>>
>>> commit 17030f48e31adde5b043741c91ba143f5f7db0fd
>>> From: Rafa? Mi?ecki<zajec5@gmail.com>
>>> Date: Thu, 11 Aug 2011 17:16:27 +0200
>>> Subject: [PATCH] b43: support new RX header, noticed to be used in 598.314+
>>> fw
>>>
>>> in PIO case.
>>>
>>> Signed-off-by: Guennadi Liakhovetski<g.liakhovetski@gmx.de>
>>> ---
>>> diff --git a/drivers/net/wireless/b43/pio.c b/drivers/net/wireless/b43/pio.c
>>> index ce8a4bd..b64b64c 100644
>>> --- a/drivers/net/wireless/b43/pio.c
>>> +++ b/drivers/net/wireless/b43/pio.c
>>> @@ -617,9 +617,19 @@ static bool pio_rx_frame(struct b43_pio_rxqueue *q)
>>> const char *err_msg = NULL;
>>> struct b43_rxhdr_fw4 *rxhdr =
>>> (struct b43_rxhdr_fw4 *)wl->pio_scratchspace;
>>> + size_t rxhdr_size = sizeof(*rxhdr);
>>>
>>> BUILD_BUG_ON(sizeof(wl->pio_scratchspace)< sizeof(*rxhdr));
>>> - memset(rxhdr, 0, sizeof(*rxhdr));
>>> + switch (dev->fw.hdr_format) {
>>> + case B43_FW_HDR_410:
>>> + case B43_FW_HDR_351:
>>> + rxhdr_size -= sizeof(rxhdr->format_598) -
>>> + sizeof(rxhdr->format_351);
>>> + break;
>>> + case B43_FW_HDR_598:
>>> + break;
>>> + }
>>
>> I do not think the above will work for format_410. By my count, the format_410
>> struct is 4 bytes longer than the format_351 struct.
>
> I think you're looking at struct b43_txhdr, whereas the problem is in
> struct b43_rxhdr_fw4.
>
> Thanks
> Guennadi
>
>>
>> Even if it does work, I suggest using the following:
>>
>> size_t rxhdr_size;
>>
>> BUILD_BUG_ON(sizeof(wl->pio_scratchspace)< sizeof(*rxhdr));
>> switch (dev->fw.hdr_format) {
>> case B43_FW_HDR_351:
>> rxhdr_size = sizeof(rxhdr->format_351);
>> break;
>> case B43_FW_HDR_410:
You are correct - I was looking in the wrong place. Even so, I prefer setting
rxhdr_size in the case branches, and not adjust one preset earlier.
Larry
WARNING: multiple messages have this Message-ID (diff)
From: Larry Finger <Larry.Finger@lwfinger.net>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: "Rafał Miłecki" <zajec5@gmail.com>,
linux-wireless@vger.kernel.org,
"John W. Linville" <linville@tuxdriver.com>,
linux-kernel@vger.kernel.org,
"Linus Torvalds" <torvalds@linux-foundation.org>,
b43-dev <b43-dev@lists.infradead.org>
Subject: Re: [PATCH] b43: fix regression in PIO case
Date: Mon, 26 Dec 2011 12:32:15 -0600 [thread overview]
Message-ID: <4EF8BDAF.6050402@lwfinger.net> (raw)
In-Reply-To: <alpine.DEB.2.00.1112261909550.12108@axis700.grange>
On 12/26/2011 12:17 PM, Guennadi Liakhovetski wrote:
> On Mon, 26 Dec 2011, Larry Finger wrote:
>
>> On 12/26/2011 11:28 AM, Guennadi Liakhovetski wrote:
>>> This patch fixes the regression, introduced by
>>>
>>> commit 17030f48e31adde5b043741c91ba143f5f7db0fd
>>> From: Rafał Miłecki<zajec5@gmail.com>
>>> Date: Thu, 11 Aug 2011 17:16:27 +0200
>>> Subject: [PATCH] b43: support new RX header, noticed to be used in 598.314+
>>> fw
>>>
>>> in PIO case.
>>>
>>> Signed-off-by: Guennadi Liakhovetski<g.liakhovetski@gmx.de>
>>> ---
>>> diff --git a/drivers/net/wireless/b43/pio.c b/drivers/net/wireless/b43/pio.c
>>> index ce8a4bd..b64b64c 100644
>>> --- a/drivers/net/wireless/b43/pio.c
>>> +++ b/drivers/net/wireless/b43/pio.c
>>> @@ -617,9 +617,19 @@ static bool pio_rx_frame(struct b43_pio_rxqueue *q)
>>> const char *err_msg = NULL;
>>> struct b43_rxhdr_fw4 *rxhdr =
>>> (struct b43_rxhdr_fw4 *)wl->pio_scratchspace;
>>> + size_t rxhdr_size = sizeof(*rxhdr);
>>>
>>> BUILD_BUG_ON(sizeof(wl->pio_scratchspace)< sizeof(*rxhdr));
>>> - memset(rxhdr, 0, sizeof(*rxhdr));
>>> + switch (dev->fw.hdr_format) {
>>> + case B43_FW_HDR_410:
>>> + case B43_FW_HDR_351:
>>> + rxhdr_size -= sizeof(rxhdr->format_598) -
>>> + sizeof(rxhdr->format_351);
>>> + break;
>>> + case B43_FW_HDR_598:
>>> + break;
>>> + }
>>
>> I do not think the above will work for format_410. By my count, the format_410
>> struct is 4 bytes longer than the format_351 struct.
>
> I think you're looking at struct b43_txhdr, whereas the problem is in
> struct b43_rxhdr_fw4.
>
> Thanks
> Guennadi
>
>>
>> Even if it does work, I suggest using the following:
>>
>> size_t rxhdr_size;
>>
>> BUILD_BUG_ON(sizeof(wl->pio_scratchspace)< sizeof(*rxhdr));
>> switch (dev->fw.hdr_format) {
>> case B43_FW_HDR_351:
>> rxhdr_size = sizeof(rxhdr->format_351);
>> break;
>> case B43_FW_HDR_410:
You are correct - I was looking in the wrong place. Even so, I prefer setting
rxhdr_size in the case branches, and not adjust one preset earlier.
Larry
next prev parent reply other threads:[~2011-12-26 18:32 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-26 15:29 [PATCH] b43: support new RX header, noticed to be used in 598.314+ fw Guennadi Liakhovetski
2011-12-26 17:18 ` Larry Finger
2011-12-26 17:28 ` [PATCH] b43: fix regression in PIO case Guennadi Liakhovetski
2011-12-26 17:51 ` Larry Finger
2011-12-26 17:51 ` Larry Finger
2011-12-26 18:17 ` Guennadi Liakhovetski
2011-12-26 18:32 ` Larry Finger [this message]
2011-12-26 18:32 ` Larry Finger
2011-12-27 18:47 ` Rafał Miłecki
2011-12-27 23:05 ` Guennadi Liakhovetski
2011-12-27 23:47 ` Larry Finger
2011-12-28 0:00 ` Guennadi Liakhovetski
2011-12-28 0:11 ` Larry Finger
2011-12-28 16:37 ` Guennadi Liakhovetski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4EF8BDAF.6050402@lwfinger.net \
--to=larry.finger@lwfinger.net \
--cc=b43-dev@lists.infradead.org \
--cc=g.liakhovetski@gmx.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=torvalds@linux-foundation.org \
--cc=zajec5@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.