* [PATCH 5/5] dell-laptop: poll the rfkill hard-block
From: Alan Jenkins @ 2009-08-19 14:06 UTC (permalink / raw)
To: mjg; +Cc: marcel, linux-acpi, linux-kernel, linux-wireless, Alan Jenkins
In-Reply-To: <4A8C0623.8030808@tuffmail.co.uk>
This is controlled by a hardware switch, so we should poll it in order
to pick up changes. (There does not appear to be an interrupt or any
other notification mechanism).
Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
---
drivers/platform/x86/dell-laptop.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
index 250c4b1..349cf12 100644
--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -195,7 +195,7 @@ static int dell_rfkill_set(void *data, bool blocked)
return 0;
}
-static void dell_rfkill_query(struct rfkill *rfkill, void *data)
+static void dell_rfkill_poll(struct rfkill *rfkill, void *data)
{
struct calling_interface_buffer buffer;
int status;
@@ -211,7 +211,7 @@ static void dell_rfkill_query(struct rfkill *rfkill, void *data)
static const struct rfkill_ops dell_rfkill_ops = {
.set_block = dell_rfkill_set,
- .query = dell_rfkill_query,
+ .poll = dell_rfkill_poll,
};
static int __init dell_setup_rfkill(void)
--
1.6.3.2
^ permalink raw reply related
* [PATCH 1/5] dell-laptop: fix a use-after-free error on the failure path
From: Alan Jenkins @ 2009-08-19 14:06 UTC (permalink / raw)
To: mjg; +Cc: marcel, linux-acpi, linux-kernel, linux-wireless, Alan Jenkins
In-Reply-To: <4A8C0623.8030808@tuffmail.co.uk>
dell_setup_rfkill() already cleans up the rfkill devices on failure.
So if it returns an error, we should not try to unregister the rfkill
devices.
Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
---
drivers/platform/x86/dell-laptop.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
index 74909c4..12b6f33 100644
--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -330,7 +330,7 @@ static int __init dell_init(void)
if (ret) {
printk(KERN_WARNING "dell-laptop: Unable to setup rfkill\n");
- goto out;
+ goto fail_rfkill;
}
#ifdef CONFIG_ACPI
@@ -358,7 +358,7 @@ static int __init dell_init(void)
if (IS_ERR(dell_backlight_device)) {
ret = PTR_ERR(dell_backlight_device);
dell_backlight_device = NULL;
- goto out;
+ goto fail_backlight;
}
dell_backlight_device->props.max_brightness = max_intensity;
@@ -368,13 +368,15 @@ static int __init dell_init(void)
}
return 0;
-out:
+
+fail_backlight:
if (wifi_rfkill)
rfkill_unregister(wifi_rfkill);
if (bluetooth_rfkill)
rfkill_unregister(bluetooth_rfkill);
if (wwan_rfkill)
rfkill_unregister(wwan_rfkill);
+fail_rfkill:
kfree(da_tokens);
return ret;
}
--
1.6.3.2
^ permalink raw reply related
* [PATCH 2/5] dell-laptop: fix rfkill memory leak on unload and failure paths
From: Alan Jenkins @ 2009-08-19 14:06 UTC (permalink / raw)
To: mjg; +Cc: marcel, linux-acpi, linux-kernel, linux-wireless, Alan Jenkins
In-Reply-To: <4A8C0623.8030808@tuffmail.co.uk>
rfkill_unregister() should always be followed by rfkill_destroy().
Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
---
drivers/platform/x86/dell-laptop.c | 30 ++++++++++++++++++------------
1 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
index 12b6f33..8fbff38 100644
--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -268,6 +268,22 @@ err_wifi:
return ret;
}
+static void dell_cleanup_rfkill(void)
+{
+ if (wifi_rfkill) {
+ rfkill_unregister(wifi_rfkill);
+ rfkill_destroy(wifi_rfkill);
+ }
+ if (bluetooth_rfkill) {
+ rfkill_unregister(bluetooth_rfkill);
+ rfkill_destroy(bluetooth_rfkill);
+ }
+ if (wwan_rfkill) {
+ rfkill_unregister(wwan_rfkill);
+ rfkill_destroy(wwan_rfkill);
+ }
+}
+
static int dell_send_intensity(struct backlight_device *bd)
{
struct calling_interface_buffer buffer;
@@ -370,12 +386,7 @@ static int __init dell_init(void)
return 0;
fail_backlight:
- if (wifi_rfkill)
- rfkill_unregister(wifi_rfkill);
- if (bluetooth_rfkill)
- rfkill_unregister(bluetooth_rfkill);
- if (wwan_rfkill)
- rfkill_unregister(wwan_rfkill);
+ dell_cleanup_rfkill();
fail_rfkill:
kfree(da_tokens);
return ret;
@@ -384,12 +395,7 @@ fail_rfkill:
static void __exit dell_exit(void)
{
backlight_device_unregister(dell_backlight_device);
- if (wifi_rfkill)
- rfkill_unregister(wifi_rfkill);
- if (bluetooth_rfkill)
- rfkill_unregister(bluetooth_rfkill);
- if (wwan_rfkill)
- rfkill_unregister(wwan_rfkill);
+ dell_cleanup_rfkill();
}
module_init(dell_init);
--
1.6.3.2
^ permalink raw reply related
* Re: [PATCH 5/5] dell-laptop: poll the rfkill hard-block
From: Matthew Garrett @ 2009-08-19 14:13 UTC (permalink / raw)
To: Alan Jenkins; +Cc: marcel, linux-acpi, linux-kernel, linux-wireless
In-Reply-To: <1250690811-21203-5-git-send-email-alan-jenkins@tuffmail.co.uk>
On Wed, Aug 19, 2009 at 03:06:51PM +0100, Alan Jenkins wrote:
> This is controlled by a hardware switch, so we should poll it in order
> to pick up changes. (There does not appear to be an interrupt or any
> other notification mechanism).
With the exception of this one they all look fine - I'm moving house
next week and won't have access to any Dell hardware for over a month,
so if anyone else could confirm that these work that would be excellent.
--
Matthew Garrett | mjg59@srcf.ucam.org
^ permalink raw reply
* [PATCH 3/5] dell-laptop: create a platform device as a parent for the rfkill devices etc.
From: Alan Jenkins @ 2009-08-19 14:06 UTC (permalink / raw)
To: mjg; +Cc: marcel, linux-acpi, linux-kernel, linux-wireless, Alan Jenkins
In-Reply-To: <4A8C0623.8030808@tuffmail.co.uk>
dell-laptop may not need to export any sysfs files, but it should still
create a platform device as a parent for the rfkill and backlight
devices. Otherwise sysfs will display these as "virtual" devices,
with no connection to either physical hardware or the dell-laptop
module.
Apparently this is useful for hardware detection.
Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
---
drivers/platform/x86/dell-laptop.c | 38 ++++++++++++++++++++++++++++++++---
1 files changed, 34 insertions(+), 4 deletions(-)
diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
index 8fbff38..a13a9f7 100644
--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -58,6 +58,14 @@ static int da_command_code;
static int da_num_tokens;
static struct calling_interface_token *da_tokens;
+static struct platform_driver platform_driver = {
+ .driver = {
+ .name = "dell-laptop",
+ .owner = THIS_MODULE,
+ }
+};
+
+static struct platform_device *platform_device;
static struct backlight_device *dell_backlight_device;
static struct rfkill *wifi_rfkill;
static struct rfkill *bluetooth_rfkill;
@@ -217,7 +225,8 @@ static int dell_setup_rfkill(void)
status = buffer.output[1];
if ((status & (1<<2|1<<8)) == (1<<2|1<<8)) {
- wifi_rfkill = rfkill_alloc("dell-wifi", NULL, RFKILL_TYPE_WLAN,
+ wifi_rfkill = rfkill_alloc("dell-wifi", &platform_device->dev,
+ RFKILL_TYPE_WLAN,
&dell_rfkill_ops, (void *) 1);
if (!wifi_rfkill) {
ret = -ENOMEM;
@@ -229,7 +238,8 @@ static int dell_setup_rfkill(void)
}
if ((status & (1<<3|1<<9)) == (1<<3|1<<9)) {
- bluetooth_rfkill = rfkill_alloc("dell-bluetooth", NULL,
+ bluetooth_rfkill = rfkill_alloc("dell-bluetooth",
+ &platform_device->dev,
RFKILL_TYPE_BLUETOOTH,
&dell_rfkill_ops, (void *) 2);
if (!bluetooth_rfkill) {
@@ -242,7 +252,9 @@ static int dell_setup_rfkill(void)
}
if ((status & (1<<4|1<<10)) == (1<<4|1<<10)) {
- wwan_rfkill = rfkill_alloc("dell-wwan", NULL, RFKILL_TYPE_WWAN,
+ wwan_rfkill = rfkill_alloc("dell-wwan",
+ &platform_device->dev,
+ RFKILL_TYPE_WWAN,
&dell_rfkill_ops, (void *) 3);
if (!wwan_rfkill) {
ret = -ENOMEM;
@@ -342,6 +354,18 @@ static int __init dell_init(void)
return -ENODEV;
}
+ ret = platform_driver_register(&platform_driver);
+ if (ret)
+ goto fail_platform_driver;
+ platform_device = platform_device_alloc("dell-laptop", -1);
+ if (!platform_device) {
+ ret = -ENOMEM;
+ goto fail_platform_device1;
+ }
+ ret = platform_device_add(platform_device);
+ if (ret)
+ goto fail_platform_device2;
+
ret = dell_setup_rfkill();
if (ret) {
@@ -368,7 +392,7 @@ static int __init dell_init(void)
if (max_intensity) {
dell_backlight_device = backlight_device_register(
"dell_backlight",
- NULL, NULL,
+ &platform_device->dev, NULL,
&dell_ops);
if (IS_ERR(dell_backlight_device)) {
@@ -388,6 +412,12 @@ static int __init dell_init(void)
fail_backlight:
dell_cleanup_rfkill();
fail_rfkill:
+ platform_device_del(platform_device);
+fail_platform_device2:
+ platform_device_put(platform_device);
+fail_platform_device1:
+ platform_driver_unregister(&platform_driver);
+fail_platform_driver:
kfree(da_tokens);
return ret;
}
--
1.6.3.2
^ permalink raw reply related
* Re: [PATCH 0/5] dell-laptop improvements
From: Matthew Garrett @ 2009-08-19 14:09 UTC (permalink / raw)
To: Alan Jenkins
Cc: Marcel Holtmann, linux acpi, linux-kernel,
linux-wireless@vger.kernel.org
In-Reply-To: <4A8C0623.8030808@tuffmail.co.uk>
On Wed, Aug 19, 2009 at 03:03:15PM +0100, Alan Jenkins wrote:
> The last patch adds polling for the hardware switch which blocks all
> radios. This exercises the hardware a little more than before; it would
> benefit from testing. It should be possible to see events generated by
> the hardware switch using "udevadm monitor --kernel --environment".
We get a hardware event (via the keyboard controller...) when the switch
is set. I need to fix up my i8042 filtering patch to match feedback from
the maintainer, but there's no real need to poll.
--
Matthew Garrett | mjg59@srcf.ucam.org
^ permalink raw reply
* Re: [ANN] b43 LP-PHY support (BCM4310/4312/4315) working (partially)!
From: Gábor Stefanik @ 2009-08-19 14:03 UTC (permalink / raw)
To: Mark Huijgen
Cc: Johannes Berg, Larry Finger, Broadcom Wireless, linux-wireless
In-Reply-To: <4A8C056A.4050005@huijgen.tk>
2009/8/19 Mark Huijgen <mark.sf.net@huijgen.tk>:
> Gábor Stefanik wrote:
>> 2009/8/19 Mark Huijgen <mark.sf.net@huijgen.tk>:
>>
>>> Gábor Stefanik wrote:
>>>
>>>> Mark, could you produce a dmesg output with the new firmware, patches
>>>> applied, and channel set to 1? Post the output of dmesg after scanning
>>>> & probably associating, if possible. (Scan/assoc may produce messages
>>>> in dmesg.)
>>>>
>>>>
>>> I tested this already, but with default chan set to 1, I cannot get the
>>> interface up.
>>> This is somewhere in my mail, but it got a bit messy after I noticed
>>> that after
>>> changing some of the code my modules got installed in another directory
>>> (-dirty).
>>>
>>> I just restarted the notebook, but now the results are different again...
>>>
>>> New firmware, with patches applied and default channel 7:
>>> [ 72.160057] b43-phy1: Loading firmware version 478.104 (2008-07-01
>>> 00:50:23)
>>> [ 72.163484] b43-phy1 debug: RC calib: Failed to switch to channel 7,
>>> error = -5
>>> [ 72.168100] b43-phy1 debug: Switch to init channel failed, error = -5.
>>>
>>> Recompile module with default chan 1, patches still applied and new
>>> firmware,
>>> # modprobe -r b43 && modprobe b43 verbose=3 && ifconfig wlan0 up
>>>
>>> [ 430.259877] b43-phy2 debug: Switch to init channel failed, error = -5.
>>>
>>> Recompile again, but with default chan back to 7, still patched and
>>> still new firmware.
>>> So same as in first situation:
>>> # modprobe -r b43 && modprobe b43 verbose=3 && ifconfig wlan0 up
>>>
>>> [ 524.748062] b43-phy3 debug: Chip initialized
>>>
>>> And I can get my interface up and working!
>>>
>>> Without this procedure I have not been able to get a working chip. Seems
>>> the partially
>>> initialized state after each try, allows the next try to get a bit
>>> further. And together with
>>> the default channel switching between 1 and 7, I get a working chip, but
>>> a chip that does
>>> not seem to be able to find my AP thats on channel 1.
>>>
>>> If I now change default chan to 1 again, I am getting the same error as
>>> in step 2 above.
>>> I have not been able to get the interface up with default chan set to 1.
>>>
>>> Mark
>>>
>>>
>>>
>>
>> What do you see in dmesg after running a scan?
>>
> After step 2, interface cannot be brought up:
> # iw dev wlan0 scan
> command failed: Network is down (-100)
>
> No extra output in dmesg
>
> After step 3 (so with default chan 7 again), interface comes up and I
> can scan:
> # iw dev wlan0 scan
> <<list of scan results>>
>
> No extra output generated in dmesg.
>
> I must add that I do not have debugging messages enabled for any
> mac80211 related options, only for b43 module.
That's not needed.
However, try "iw dev wlan0 scan trigger".
Also, try switching to all B/G channels manually.
One more thing to try is create a monitor interface and run kismet on
it. In addition, you can use aireplay-ng on the monitor interface to
test TX.
>
> Mark
>
>
>
--
Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-)
^ permalink raw reply
* [PATCH 0/5] dell-laptop improvements
From: Alan Jenkins @ 2009-08-19 14:03 UTC (permalink / raw)
To: Matthew Garrett
Cc: Marcel Holtmann, linux acpi, linux-kernel,
linux-wireless@vger.kernel.org
Mario Limonciello's compal-laptop changes were partly based on a reading
of dell-laptop. Unfortunately dell-laptop set a few bad examples; let's
fix them.
I don't have the hardware to test this, but the first four patches
should be nice and low risk.
dell-laptop: fix a use-after-free error on the failure path
dell-laptop: fix rfkill memory leak on unload and failure paths
dell-laptop: create a platform device as a parent for the rfkill devices
etc.
dell-laptop: add __init to init functions
The last patch adds polling for the hardware switch which blocks all
radios. This exercises the hardware a little more than before; it would
benefit from testing. It should be possible to see events generated by
the hardware switch using "udevadm monitor --kernel --environment".
dell-laptop: poll the rfkill hard-block
^ permalink raw reply
* Re: [ANN] b43 LP-PHY support (BCM4310/4312/4315) working (partially)!
From: Mark Huijgen @ 2009-08-19 14:00 UTC (permalink / raw)
To: Gábor Stefanik
Cc: Johannes Berg, Larry Finger, Broadcom Wireless, linux-wireless
In-Reply-To: <69e28c910908190654v231d66c7k6a223f481f702c7c@mail.gmail.com>
Gábor Stefanik wrote:
> 2009/8/19 Mark Huijgen <mark.sf.net@huijgen.tk>:
>
>> Gábor Stefanik wrote:
>>
>>> Mark, could you produce a dmesg output with the new firmware, patches
>>> applied, and channel set to 1? Post the output of dmesg after scanning
>>> & probably associating, if possible. (Scan/assoc may produce messages
>>> in dmesg.)
>>>
>>>
>> I tested this already, but with default chan set to 1, I cannot get the
>> interface up.
>> This is somewhere in my mail, but it got a bit messy after I noticed
>> that after
>> changing some of the code my modules got installed in another directory
>> (-dirty).
>>
>> I just restarted the notebook, but now the results are different again...
>>
>> New firmware, with patches applied and default channel 7:
>> [ 72.160057] b43-phy1: Loading firmware version 478.104 (2008-07-01
>> 00:50:23)
>> [ 72.163484] b43-phy1 debug: RC calib: Failed to switch to channel 7,
>> error = -5
>> [ 72.168100] b43-phy1 debug: Switch to init channel failed, error = -5.
>>
>> Recompile module with default chan 1, patches still applied and new
>> firmware,
>> # modprobe -r b43 && modprobe b43 verbose=3 && ifconfig wlan0 up
>>
>> [ 430.259877] b43-phy2 debug: Switch to init channel failed, error = -5.
>>
>> Recompile again, but with default chan back to 7, still patched and
>> still new firmware.
>> So same as in first situation:
>> # modprobe -r b43 && modprobe b43 verbose=3 && ifconfig wlan0 up
>>
>> [ 524.748062] b43-phy3 debug: Chip initialized
>>
>> And I can get my interface up and working!
>>
>> Without this procedure I have not been able to get a working chip. Seems
>> the partially
>> initialized state after each try, allows the next try to get a bit
>> further. And together with
>> the default channel switching between 1 and 7, I get a working chip, but
>> a chip that does
>> not seem to be able to find my AP thats on channel 1.
>>
>> If I now change default chan to 1 again, I am getting the same error as
>> in step 2 above.
>> I have not been able to get the interface up with default chan set to 1.
>>
>> Mark
>>
>>
>>
>
> What do you see in dmesg after running a scan?
>
After step 2, interface cannot be brought up:
# iw dev wlan0 scan
command failed: Network is down (-100)
No extra output in dmesg
After step 3 (so with default chan 7 again), interface comes up and I
can scan:
# iw dev wlan0 scan
<<list of scan results>>
No extra output generated in dmesg.
I must add that I do not have debugging messages enabled for any
mac80211 related options, only for b43 module.
Mark
^ permalink raw reply
* Re: [ANN] b43 LP-PHY support (BCM4310/4312/4315) working (partially)!
From: Gábor Stefanik @ 2009-08-19 13:54 UTC (permalink / raw)
To: Mark Huijgen
Cc: Johannes Berg, Larry Finger, Broadcom Wireless, linux-wireless
In-Reply-To: <4A8C02D8.7080309@huijgen.tk>
2009/8/19 Mark Huijgen <mark.sf.net@huijgen.tk>:
> Gábor Stefanik wrote:
>> Mark, could you produce a dmesg output with the new firmware, patches
>> applied, and channel set to 1? Post the output of dmesg after scanning
>> & probably associating, if possible. (Scan/assoc may produce messages
>> in dmesg.)
>>
> I tested this already, but with default chan set to 1, I cannot get the
> interface up.
> This is somewhere in my mail, but it got a bit messy after I noticed
> that after
> changing some of the code my modules got installed in another directory
> (-dirty).
>
> I just restarted the notebook, but now the results are different again...
>
> New firmware, with patches applied and default channel 7:
> [ 72.160057] b43-phy1: Loading firmware version 478.104 (2008-07-01
> 00:50:23)
> [ 72.163484] b43-phy1 debug: RC calib: Failed to switch to channel 7,
> error = -5
> [ 72.168100] b43-phy1 debug: Switch to init channel failed, error = -5.
>
> Recompile module with default chan 1, patches still applied and new
> firmware,
> # modprobe -r b43 && modprobe b43 verbose=3 && ifconfig wlan0 up
>
> [ 430.259877] b43-phy2 debug: Switch to init channel failed, error = -5.
>
> Recompile again, but with default chan back to 7, still patched and
> still new firmware.
> So same as in first situation:
> # modprobe -r b43 && modprobe b43 verbose=3 && ifconfig wlan0 up
>
> [ 524.748062] b43-phy3 debug: Chip initialized
>
> And I can get my interface up and working!
>
> Without this procedure I have not been able to get a working chip. Seems
> the partially
> initialized state after each try, allows the next try to get a bit
> further. And together with
> the default channel switching between 1 and 7, I get a working chip, but
> a chip that does
> not seem to be able to find my AP thats on channel 1.
>
> If I now change default chan to 1 again, I am getting the same error as
> in step 2 above.
> I have not been able to get the interface up with default chan set to 1.
>
> Mark
>
>
What do you see in dmesg after running a scan?
--
Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-)
^ permalink raw reply
* Re: [ANN] b43 LP-PHY support (BCM4310/4312/4315) working (partially)!
From: Mark Huijgen @ 2009-08-19 13:49 UTC (permalink / raw)
To: Gábor Stefanik
Cc: Johannes Berg, Larry Finger, Broadcom Wireless, linux-wireless
In-Reply-To: <69e28c910908190626s46fd0bfer5cc9dec9c5bb1c24@mail.gmail.com>
Gábor Stefanik wrote:
> Mark, could you produce a dmesg output with the new firmware, patches
> applied, and channel set to 1? Post the output of dmesg after scanning
> & probably associating, if possible. (Scan/assoc may produce messages
> in dmesg.)
>
I tested this already, but with default chan set to 1, I cannot get the
interface up.
This is somewhere in my mail, but it got a bit messy after I noticed
that after
changing some of the code my modules got installed in another directory
(-dirty).
I just restarted the notebook, but now the results are different again...
New firmware, with patches applied and default channel 7:
[ 72.160057] b43-phy1: Loading firmware version 478.104 (2008-07-01
00:50:23)
[ 72.163484] b43-phy1 debug: RC calib: Failed to switch to channel 7,
error = -5
[ 72.168100] b43-phy1 debug: Switch to init channel failed, error = -5.
Recompile module with default chan 1, patches still applied and new
firmware,
# modprobe -r b43 && modprobe b43 verbose=3 && ifconfig wlan0 up
[ 430.259877] b43-phy2 debug: Switch to init channel failed, error = -5.
Recompile again, but with default chan back to 7, still patched and
still new firmware.
So same as in first situation:
# modprobe -r b43 && modprobe b43 verbose=3 && ifconfig wlan0 up
[ 524.748062] b43-phy3 debug: Chip initialized
And I can get my interface up and working!
Without this procedure I have not been able to get a working chip. Seems
the partially
initialized state after each try, allows the next try to get a bit
further. And together with
the default channel switching between 1 and 7, I get a working chip, but
a chip that does
not seem to be able to find my AP thats on channel 1.
If I now change default chan to 1 again, I am getting the same error as
in step 2 above.
I have not been able to get the interface up with default chan set to 1.
Mark
^ permalink raw reply
* Re: [ANN] b43 LP-PHY support (BCM4310/4312/4315) working (partially)!
From: Gábor Stefanik @ 2009-08-19 13:26 UTC (permalink / raw)
To: Mark Huijgen, Johannes Berg, Larry Finger
Cc: Broadcom Wireless, linux-wireless
In-Reply-To: <1250687066.1067.25.camel@johannes.local>
On Wed, Aug 19, 2009 at 3:04 PM, Johannes Berg<johannes@sipsolutions.net> wrote:
> On Wed, 2009-08-19 at 14:43 +0200, Mark Huijgen wrote:
>
>> After running the included python script, patching the cutter and
>> extracting firmware, I now get ucode version 478.104 in dmesg. Next test
>> is also without the 2 patches. Following log is from modprobe+ifconfig
>> wlan0 up:
>
> Not really surprising, the firmware is for the MAC _only_, it doesn't
> really ever touch the PHY, so it's very unlikely to matter.
>
> johannes
>
Actually, the output does change with the new firmware.
Current outputs:
1. Patches not applied, old firmware, default chan = 1: the channel
switch to 7 during calibration works, but nothing else.
2. Patches applied, old firmware, default chan = 1: no channels work
(not even the channel 7 switch in the calibration routine), ifup
fails.
3. Patches not applied, new firmware, default chan = 1 (I got this
from Larry in private mail): only channels 7 and 8 work, but ifup
works(?).
(4. Patches applied, new firmware, default chan = 1: please test!)
(5. Patches not applied, old firmware, default chan = 7: probably ifup
succeeds, but only channel 7 works. Not tested.)
(6. Patches applied, old firmware, default chan = 7: unknown, probably
doesn't work at all.)
(7. Patches not applied, new firmware, default chan = 7: Unknown.)
8. Patches applied, new firmware, default chan = 7: interface comes
up, scans (but only channels 6 and above show results), associates to
WPA AP on channel 11 and gets DHCP address (meaning, both TX and RX
working)!
Notice that 2 and 8 only differ in the FW ver and the default channel,
and in 8 (with new firmware), the switch to channel 7 during RC
calibration (before the switch to default channel) works - in 2, it
fails. Looks like the routines reverse-engineered from the newer
driver depend on the firmware included in that driver; or maybe the
old firmware simply doesn't properly handle LP-PHY. Initvals are also
a possible candidate for this. (Larry, what do you think about this?)
Mark, could you produce a dmesg output with the new firmware, patches
applied, and channel set to 1? Post the output of dmesg after scanning
& probably associating, if possible. (Scan/assoc may produce messages
in dmesg.)
(The news about TX working is great by the way!)
--
Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-)
^ permalink raw reply
* Re: [ANN] b43 LP-PHY support (BCM4310/4312/4315) working (partially)!
From: Johannes Berg @ 2009-08-19 13:04 UTC (permalink / raw)
To: Mark Huijgen; +Cc: Gábor Stefanik, Broadcom Wireless, linux-wireless
In-Reply-To: <4A8BF35E.1090507@huijgen.tk>
[-- Attachment #1: Type: text/plain, Size: 436 bytes --]
On Wed, 2009-08-19 at 14:43 +0200, Mark Huijgen wrote:
> After running the included python script, patching the cutter and
> extracting firmware, I now get ucode version 478.104 in dmesg. Next test
> is also without the 2 patches. Following log is from modprobe+ifconfig
> wlan0 up:
Not really surprising, the firmware is for the MAC _only_, it doesn't
really ever touch the PHY, so it's very unlikely to matter.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply
* Re: [ANN] b43 LP-PHY support (BCM4310/4312/4315) working (partially)!
From: Mark Huijgen @ 2009-08-19 12:43 UTC (permalink / raw)
To: Gábor Stefanik; +Cc: Broadcom Wireless, linux-wireless
In-Reply-To: <69e28c910908190428s46f3d25dnb2f2d8591f99618f@mail.gmail.com>
Gábor Stefanik wrote:
> 2009/8/19 Mark Huijgen <mark.sf.net@huijgen.tk>:
>
>> Gábor Stefanik wrote:
>>
>>> Hello World!
>>>
>>> Great news for Broadcom BCM4310/4312/4315 (PCI 14e4:4315) users:
>>> LP-PHY support is now at the point where it can be tested for functionality!
>>>
>>> So, go ahead, give it a try, and let's rock!
>>>
>>>
>> Patches applied, well manually, cause I wasn't able to extract a working
>> version from the emails or the weblink provided. Whats the recommended
>> method to apply these git patches on mailinglists?
>>
>> Here goes:
>>
>> # modprobe b43 verbose=3
>> [ 1596.228088] ssb: Core 0 found: ChipCommon (cc 0x800, rev 0x16, vendor
>> 0x4243)
>> [ 1596.228100] ssb: Core 1 found: IEEE 802.11 (cc 0x812, rev 0x0F,
>> vendor 0x4243)
>> [ 1596.228110] ssb: Core 2 found: PCMCIA (cc 0x80D, rev 0x0A, vendor 0x4243)
>> [ 1596.228120] ssb: Core 3 found: PCI-E (cc 0x820, rev 0x09, vendor 0x4243)
>> [ 1596.248050] ssb: Found rev 1 PMU (capabilities 0x02A62F01)
>> [ 1596.256780] ssb: SPROM revision 8 detected.
>> [ 1596.276093] ssb: Sonics Silicon Backplane found on PCI device
>> 0000:10:00.0
>> [ 1596.281108] b43-phy2: Broadcom 4312 WLAN found (core revision 15)
>> [ 1596.324046] b43-phy2 debug: Found PHY: Analog 6, Type 5, Revision 1
>> [ 1596.324060] b43-phy2 debug: Found Radio: Manuf 0x17F, Version 0x2062,
>> Revision 2
>> [ 1596.348233] phy2: Selected rate control algorithm 'minstrel'
>> [ 1596.348349] Broadcom 43xx driver loaded [ Features: PL, Firmware-ID:
>> FW13 ]
>>
>> # ifconfig wlan0 up
>> SIOCSIFFLAGS: Input/output error
>>
>> [ 1689.356055] b43 ssb0:0: firmware: requesting b43/ucode15.fw
>> [ 1689.703918] b43 ssb0:0: firmware: requesting b43/lp0initvals15.fw
>> [ 1689.710418] b43 ssb0:0: firmware: requesting b43/lp0bsinitvals15.fw
>> [ 1689.852058] b43-phy2: Loading firmware version 410.2160 (2007-05-26
>> 15:32:10)
>> [ 1689.854963] b43-phy2 debug: b2062: Using crystal tab entry 19200 kHz.
>> [ 1689.855468] b43-phy2 debug: RC calib: Failed to switch to channel 7,
>> error = -5
>> [ 1689.860016] b43-phy2 debug: Switch to init channel failed, error = -5.
>>
>
> Hmm, error -5 is EIO, which in the channel switch code is used to
> represent "PLL charge pump out of range". This is specifically the
> error I was trying to fix... could you try without the 2 extra
> patches? Maybe I did something wrong. (Without the 2 patches, channels
> 1..6 and 9..11 (12...14 not tested) throw this error, but channels 7
> and 8 work.)
>
Same error without the patches, but 1 less error in dmesg. The 'RC
calib: Failed to switch to channel 7, error = -5' is gone now.
> Also try extracting firmware from
> ftp://downloads.netgear.com/files/GPL/WNDR3300-V1.0.29_gpl_src.zip's
> wl_apsta.o file (newer than the one on mirror.openwrt.org - you may
> need to add the extraction defines to fwcutter first; there is a
> script in the fwcutter git tree, probably also in tarballs, that
> generates extraction lists.) This is the firmware the specs are
> written for; it's possible that the current firmware is simply not
> good for LP-PHY (or maybe it needs code based on older specs).
>
After running the included python script, patching the cutter and
extracting firmware, I now get ucode version 478.104 in dmesg. Next test
is also without the 2 patches. Following log is from modprobe+ifconfig
wlan0 up:
[14600.712104] ssb: Core 0 found: ChipCommon (cc 0x800, rev 0x16, vendor
0x4243)
[14600.712116] ssb: Core 1 found: IEEE 802.11 (cc 0x812, rev 0x0F,
vendor 0x4243)
[14600.712126] ssb: Core 2 found: PCMCIA (cc 0x80D, rev 0x0A, vendor 0x4243)
[14600.712136] ssb: Core 3 found: PCI-E (cc 0x820, rev 0x09, vendor 0x4243)
[14600.732052] ssb: Found rev 1 PMU (capabilities 0x02A62F01)
[14600.740727] ssb: SPROM revision 8 detected.
[14600.760093] ssb: Sonics Silicon Backplane found on PCI device
0000:10:00.0
[14600.816481] b43-phy5: Broadcom 4312 WLAN found (core revision 15)
[14600.860044] b43-phy5 debug: Found PHY: Analog 6, Type 5, Revision 1
[14600.860058] b43-phy5 debug: Found Radio: Manuf 0x17F, Version 0x2062,
Revision 2
[14600.884250] phy5: Selected rate control algorithm 'minstrel'
[14600.884367] Broadcom 43xx driver loaded [ Features: PL, Firmware-ID:
FW13 ]
[14611.192054] b43 ssb0:0: firmware: requesting b43/ucode15.fw
[14611.206016] b43 ssb0:0: firmware: requesting b43/lp0initvals15.fw
[14611.211387] b43 ssb0:0: firmware: requesting b43/lp0bsinitvals15.fw
[14611.364058] b43-phy5: Loading firmware version 478.104 (2008-07-01
00:50:23)
[14611.367051] b43-phy5 debug: b2062: Using crystal tab entry 19200 kHz.
[14611.371875] b43-phy5 debug: Switch to init channel failed, error = -5.
[14611.372406] b43-phy5 ERROR: PHY init: Channel switch to default failed
Still the "SIOCSIFFLAGS: Input/output error" on ifconfig wlan0 up.
>
>> [ 1689.860543] b43-phy2 ERROR: PHY init: Channel switch to default failed
>>
>> Interface is not coming up, so cannot scan:
>> # iwlist wlan0 scan
>> wlan0 Interface doesn't support scanning : Network is down
>>
>
> When testing mac80211 drivers, always use "iw dev wlan0 scan", not
> "iwlist wlan0 scan". (Though this shouldn't affect your results in
> this case.)
>
OK will do. Never used iw before your other mail about iw phy and friends :)
> Try bringing up the interface in monitor mode.
> Also, try changing get_default_chan to return 7 instead of 1.
>
Tested default_chan 7, *with* the 2 patches and the interface comes up!
Scan results show a lot of the AP's around here, but only AP's of
channel 6 and higher.
The closest AP here is actually on channel 1 and is not showing. It
seems there is a problem with channel 1?
Dmesg for modprobe+ifconfig wlan0 up:
[ 478.516094] ssb: Core 0 found: ChipCommon (cc 0x800, rev 0x16, vendor
0x4243)
[ 478.516106] ssb: Core 1 found: IEEE 802.11 (cc 0x812, rev 0x0F,
vendor 0x4243)
[ 478.516116] ssb: Core 2 found: PCMCIA (cc 0x80D, rev 0x0A, vendor 0x4243)
[ 478.516125] ssb: Core 3 found: PCI-E (cc 0x820, rev 0x09, vendor 0x4243)
[ 478.536053] ssb: Found rev 1 PMU (capabilities 0x02A62F01)
[ 478.544729] ssb: SPROM revision 8 detected.
[ 478.564094] ssb: Sonics Silicon Backplane found on PCI device
0000:10:00.0
[ 478.569257] b43-phy3: Broadcom 4312 WLAN found (core revision 15)
[ 478.612046] b43-phy3 debug: Found PHY: Analog 6, Type 5, Revision 1
[ 478.612061] b43-phy3 debug: Found Radio: Manuf 0x17F, Version 0x2062,
Revision 2
[ 478.636235] phy3: Selected rate control algorithm 'minstrel'
[ 478.636347] Broadcom 43xx driver loaded [ Features: PL, Firmware-ID:
FW13 ]
[ 483.116055] b43 ssb0:0: firmware: requesting b43/ucode15.fw
[ 483.120545] b43 ssb0:0: firmware: requesting b43/lp0initvals15.fw
[ 483.127002] b43 ssb0:0: firmware: requesting b43/lp0bsinitvals15.fw
[ 483.280059] b43-phy3: Loading firmware version 478.104 (2008-07-01
00:50:23)
[ 483.283053] b43-phy3 debug: b2062: Using crystal tab entry 19200 kHz.
[ 483.296062] b43-phy3 debug: Chip initialized
[ 483.296272] b43-phy3 debug: 64-bit DMA initialized
[ 483.317545] Registered led device: b43-phy3::tx
[ 483.317568] Registered led device: b43-phy3::rx
[ 483.317589] Registered led device: b43-phy3::radio
[ 483.317649] b43-phy3 debug: Wireless interface started
[ 483.317669] b43-phy3 debug: Adding Interface type 2
# wpa_supplicant -Dwext -i wlan0 -c /etc/wpa_supplicant.conf
ioctl[SIOCSIWAUTH]: Operation not supported
WEXT auth param 4 value 0x0 - Trying to associate with 00:30:f1:f9:10:45
(SSID='default' freq=2462 MHz)
Associated with 00:30:f1:f9:10:45
WPA: Key negotiation completed with 00:30:f1:f9:10:45 [PTK=TKIP GTK=TKIP]
CTRL-EVENT-CONNECTED - Connection to 00:30:f1:f9:10:45 completed (auth)
[id=0 id_str=]
Well, what do you know, it actually does WPA authentication already!
Means TX must be working too.
I am also able to get an IP address with a dhcp client.
dmesg from wpa_supplicant part:
[ 618.820622] wlan0: direct probe to AP 00:30:f1:f9:10:45 (try 1)
[ 618.824200] wlan0 direct probe responded
[ 618.824204] wlan0: authenticate with AP 00:30:f1:f9:10:45 (try 1)
[ 618.825886] wlan0: authenticated
[ 618.825902] wlan0: associate with AP 00:30:f1:f9:10:45 (try 1)
[ 618.828148] wlan0: RX AssocResp from 00:30:f1:f9:10:45 (capab=0x431
status=0 aid=10)
[ 618.828151] wlan0: associated
This AP is on channel 11.
I don't have time for further testing today, but results are promising!
Mark
^ permalink raw reply
* Re: [PATCH 2/3] Add rfkill support to compal-laptop
From: Cezary Jackiewicz @ 2009-08-19 11:43 UTC (permalink / raw)
To: Johannes Berg
Cc: Mario Limonciello, Alan Jenkins, Marcel Holtmann, linux-acpi,
linux-kernel, linux-wireless@vger.kernel.org
In-Reply-To: <1250672475.25419.7.camel@johannes.local>
> Also, I'm not entirely clear about the semantics -- you've called the
> bit KILLSWITCH_MASK, but does it really control all technologies as a
> hard block, i.e. it toggles both the bluetooth and wireless hard block?
In compal's laptop - yes. Switch disables all radios, bluetooth and wifi.
--
Cezary
^ permalink raw reply
* Re: [PATCH] b43: LP-PHY: Implement spec updates and remove resolved FIXMEs
From: Gábor Stefanik @ 2009-08-19 11:30 UTC (permalink / raw)
To: John Linville, Michael Buesch, Larry Finger
Cc: Mark Huijgen, Broadcom Wireless, linux-wireless
In-Reply-To: <4A8AE255.9030102@gmail.com>
John, please hold off this patch for now, it appears to be causing
regressions. I will investigate this.
2009/8/18 Gábor Stefanik <netrolller.3d@gmail.com>:
> Larry has started re-checking all current routines against a new
> version of the Broadcom MIPS driver. This patch implements the first
> round of changes he documented on the specs wiki.
>
> Also remove a few FIXMEs regarding missing initial values for variables
> with dynamic initial values where reading the values has been implemented.
>
> Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
> ---
> drivers/net/wireless/b43/phy_lp.c | 98
> +++++++++++++++++++------------
> drivers/net/wireless/b43/phy_lp.h | 18 +++---
> drivers/net/wireless/b43/tables_lpphy.c | 12 ++++-
> 3 files changed, 82 insertions(+), 46 deletions(-)
>
> diff --git a/drivers/net/wireless/b43/phy_lp.c
> b/drivers/net/wireless/b43/phy_lp.c
> index 242338f..6c69cdb 100644
> --- a/drivers/net/wireless/b43/phy_lp.c
> +++ b/drivers/net/wireless/b43/phy_lp.c
> @@ -719,9 +719,39 @@ static void lpphy_set_bb_mult(struct b43_wldev *dev, u8
> bb_mult)
> b43_lptab_write(dev, B43_LPTAB16(0, 87), (u16)bb_mult << 8);
> }
>
> -static void lpphy_disable_crs(struct b43_wldev *dev)
> +static void lpphy_set_deaf(struct b43_wldev *dev, bool user)
> {
> + struct b43_phy_lp *lpphy = dev->phy.lp;
> +
> + if (user)
> + lpphy->crs_usr_disable = 1;
> + else
> + lpphy->crs_sys_disable = 1;
> b43_phy_maskset(dev, B43_LPPHY_CRSGAIN_CTL, 0xFF1F, 0x80);
> +}
> +
> +static void lpphy_clear_deaf(struct b43_wldev *dev, bool user)
> +{
> + struct b43_phy_lp *lpphy = dev->phy.lp;
> +
> + if (user)
> + lpphy->crs_usr_disable = 0;
> + else
> + lpphy->crs_sys_disable = 0;
> +
> + if (!lpphy->crs_usr_disable && !lpphy->crs_sys_disable) {
> + if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ)
> + b43_phy_maskset(dev, B43_LPPHY_CRSGAIN_CTL,
> + 0xFF1F, 0x60);
> + else
> + b43_phy_maskset(dev, B43_LPPHY_CRSGAIN_CTL,
> + 0xFF1F, 0x20);
> + }
> +}
> +
> +static void lpphy_disable_crs(struct b43_wldev *dev, bool user)
> +{
> + lpphy_set_deaf(dev, user);
> b43_phy_maskset(dev, B43_LPPHY_RF_OVERRIDE_VAL_0, 0xFFFC, 0x1);
> b43_phy_set(dev, B43_LPPHY_RF_OVERRIDE_0, 0x3);
> b43_phy_mask(dev, B43_LPPHY_RF_OVERRIDE_VAL_0, 0xFFFB);
> @@ -749,12 +779,9 @@ static void lpphy_disable_crs(struct b43_wldev *dev)
> b43_phy_write(dev, B43_LPPHY_RF_OVERRIDE_2, 0x3FF);
> }
>
> -static void lpphy_restore_crs(struct b43_wldev *dev)
> +static void lpphy_restore_crs(struct b43_wldev *dev, bool user)
> {
> - if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ)
> - b43_phy_maskset(dev, B43_LPPHY_CRSGAIN_CTL, 0xFF1F, 0x60);
> - else
> - b43_phy_maskset(dev, B43_LPPHY_CRSGAIN_CTL, 0xFF1F, 0x20);
> + lpphy_clear_deaf(dev, user);
> b43_phy_mask(dev, B43_LPPHY_RF_OVERRIDE_0, 0xFF80);
> b43_phy_mask(dev, B43_LPPHY_RF_OVERRIDE_2, 0xFC00);
> }
> @@ -800,10 +827,11 @@ static void lpphy_set_tx_gains(struct b43_wldev *dev,
> b43_phy_maskset(dev, B43_LPPHY_TX_GAIN_CTL_OVERRIDE_VAL,
> 0xF800, rf_gain);
> } else {
> - pa_gain = b43_phy_read(dev, B43_PHY_OFDM(0xFB)) & 0x7F00;
> + pa_gain = b43_phy_read(dev, B43_PHY_OFDM(0xFB)) & 0x1FC0;
> + pa_gain <<= 2;
> b43_phy_write(dev, B43_LPPHY_TX_GAIN_CTL_OVERRIDE_VAL,
> (gains.pga << 8) | gains.gm);
> - b43_phy_maskset(dev, B43_LPPHY_TX_GAIN_CTL_OVERRIDE_VAL,
> + b43_phy_maskset(dev, B43_PHY_OFDM(0xFB),
> 0x8000, gains.pad | pa_gain);
> b43_phy_write(dev, B43_PHY_OFDM(0xFC),
> (gains.pga << 8) | gains.gm);
> @@ -817,7 +845,7 @@ static void lpphy_set_tx_gains(struct b43_wldev *dev,
> b43_phy_maskset(dev, B43_LPPHY_RF_OVERRIDE_2, 0xFF7F, 1 <<
> 7);
> b43_phy_maskset(dev, B43_LPPHY_RF_OVERRIDE_2, 0xBFFF, 1 <<
> 14);
> }
> - b43_phy_maskset(dev, B43_LPPHY_RF_OVERRIDE_2, 0xFFBF, 1 << 6);
> + b43_phy_maskset(dev, B43_LPPHY_AFE_CTL_OVR, 0xFFBF, 1 << 6);
> }
>
> static void lpphy_rev0_1_set_rx_gain(struct b43_wldev *dev, u32 gain)
> @@ -857,33 +885,33 @@ static void lpphy_rev2plus_set_rx_gain(struct
> b43_wldev *dev, u32 gain)
> }
> }
>
> -static void lpphy_enable_rx_gain_override(struct b43_wldev *dev)
> +static void lpphy_disable_rx_gain_override(struct b43_wldev *dev)
> {
> b43_phy_mask(dev, B43_LPPHY_RF_OVERRIDE_0, 0xFFFE);
> b43_phy_mask(dev, B43_LPPHY_RF_OVERRIDE_0, 0xFFEF);
> b43_phy_mask(dev, B43_LPPHY_RF_OVERRIDE_0, 0xFFBF);
> if (dev->phy.rev >= 2) {
> b43_phy_mask(dev, B43_LPPHY_RF_OVERRIDE_2, 0xFEFF);
> - if (b43_current_band(dev->wl) != IEEE80211_BAND_2GHZ)
> - return;
> - b43_phy_mask(dev, B43_LPPHY_RF_OVERRIDE_2, 0xFBFF);
> - b43_phy_mask(dev, B43_LPPHY_RF_OVERRIDE_2, 0xFFF7);
> + if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) {
> + b43_phy_mask(dev, B43_LPPHY_RF_OVERRIDE_2, 0xFBFF);
> + b43_phy_mask(dev, B43_PHY_OFDM(0xE5), 0xFFF7);
> + }
> } else {
> b43_phy_mask(dev, B43_LPPHY_RF_OVERRIDE_2, 0xFDFF);
> }
> }
>
> -static void lpphy_disable_rx_gain_override(struct b43_wldev *dev)
> +static void lpphy_enable_rx_gain_override(struct b43_wldev *dev)
> {
> b43_phy_set(dev, B43_LPPHY_RF_OVERRIDE_0, 0x1);
> b43_phy_set(dev, B43_LPPHY_RF_OVERRIDE_0, 0x10);
> b43_phy_set(dev, B43_LPPHY_RF_OVERRIDE_0, 0x40);
> if (dev->phy.rev >= 2) {
> b43_phy_set(dev, B43_LPPHY_RF_OVERRIDE_2, 0x100);
> - if (b43_current_band(dev->wl) != IEEE80211_BAND_2GHZ)
> - return;
> - b43_phy_set(dev, B43_LPPHY_RF_OVERRIDE_2, 0x400);
> - b43_phy_set(dev, B43_LPPHY_RF_OVERRIDE_2, 0x8);
> + if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) {
> + b43_phy_set(dev, B43_LPPHY_RF_OVERRIDE_2, 0x400);
> + b43_phy_set(dev, B43_PHY_OFDM(0xE5), 0x8);
> + }
> } else {
> b43_phy_set(dev, B43_LPPHY_RF_OVERRIDE_2, 0x200);
> }
> @@ -1002,26 +1030,22 @@ static u32 lpphy_qdiv_roundup(u32 dividend, u32
> divisor, u8 precision)
> {
> u32 quotient, remainder, rbit, roundup, tmp;
>
> - if (divisor == 0) {
> - quotient = 0;
> - remainder = 0;
> - } else {
> - quotient = dividend / divisor;
> - remainder = dividend % divisor;
> - }
> + if (divisor == 0)
> + return 0;
> +
> + quotient = dividend / divisor;
> + remainder = dividend % divisor;
>
> rbit = divisor & 0x1;
> roundup = (divisor >> 1) + rbit;
> - precision--;
>
> - while (precision != 0xFF) {
> + while (precision != 0) {
> tmp = remainder - roundup;
> quotient <<= 1;
> - remainder <<= 1;
> - if (remainder >= roundup) {
> + if (remainder >= roundup)
> remainder = (tmp << 1) + rbit;
> - quotient--;
> - }
> + else
> + remainder <<= 1;
> precision--;
> }
>
> @@ -1123,11 +1147,11 @@ static void lpphy_rev0_1_rc_calib(struct b43_wldev
> *dev)
> struct b43_phy_lp *lpphy = dev->phy.lp;
> struct lpphy_iq_est iq_est;
> struct lpphy_tx_gains tx_gains;
> - static const u32 ideal_pwr_table[22] = {
> + static const u32 ideal_pwr_table[21] = {
> 0x10000, 0x10557, 0x10e2d, 0x113e0, 0x10f22, 0x0ff64,
> 0x0eda2, 0x0e5d4, 0x0efd1, 0x0fbe8, 0x0b7b8, 0x04b35,
> 0x01a5e, 0x00a0b, 0x00444, 0x001fd, 0x000ff, 0x00088,
> - 0x0004c, 0x0002c, 0x0001a, 0xc0006,
> + 0x0004c, 0x0002c, 0x0001a,
> };
> bool old_txg_ovr;
> u8 old_bbmult;
> @@ -1145,7 +1169,7 @@ static void lpphy_rev0_1_rc_calib(struct b43_wldev
> *dev)
> "RC calib: Failed to switch to channel 7, error = %d",
> err);
> }
> - old_txg_ovr = (b43_phy_read(dev, B43_LPPHY_AFE_CTL_OVR) >> 6) & 1;
> + old_txg_ovr = !!(b43_phy_read(dev, B43_LPPHY_AFE_CTL_OVR) & 0x40);
> old_bbmult = lpphy_get_bb_mult(dev);
> if (old_txg_ovr)
> tx_gains = lpphy_get_tx_gains(dev);
> @@ -1160,7 +1184,7 @@ static void lpphy_rev0_1_rc_calib(struct b43_wldev
> *dev)
> old_txpctl = lpphy->txpctl_mode;
>
> lpphy_set_tx_power_control(dev, B43_LPPHY_TXPCTL_OFF);
> - lpphy_disable_crs(dev);
> + lpphy_disable_crs(dev, true);
> loopback = lpphy_loopback(dev);
> if (loopback == -1)
> goto finish;
> @@ -1193,7 +1217,7 @@ static void lpphy_rev0_1_rc_calib(struct b43_wldev
> *dev)
> lpphy_stop_ddfs(dev);
>
> finish:
> - lpphy_restore_crs(dev);
> + lpphy_restore_crs(dev, true);
> b43_phy_write(dev, B43_LPPHY_RF_OVERRIDE_VAL_0, old_rf_ovrval);
> b43_phy_write(dev, B43_LPPHY_RF_OVERRIDE_0, old_rf_ovr);
> b43_phy_write(dev, B43_LPPHY_AFE_CTL_OVRVAL, old_afe_ovrval);
> diff --git a/drivers/net/wireless/b43/phy_lp.h
> b/drivers/net/wireless/b43/phy_lp.h
> index 99cb038..e158d1f 100644
> --- a/drivers/net/wireless/b43/phy_lp.h
> +++ b/drivers/net/wireless/b43/phy_lp.h
> @@ -825,11 +825,11 @@ struct b43_phy_lp {
> enum b43_lpphy_txpctl_mode txpctl_mode;
>
> /* Transmit isolation medium band */
> - u8 tx_isolation_med_band; /* FIXME initial value? */
> + u8 tx_isolation_med_band;
> /* Transmit isolation low band */
> - u8 tx_isolation_low_band; /* FIXME initial value? */
> + u8 tx_isolation_low_band;
> /* Transmit isolation high band */
> - u8 tx_isolation_hi_band; /* FIXME initial value? */
> + u8 tx_isolation_hi_band;
>
> /* Max transmit power medium band */
> u16 max_tx_pwr_med_band;
> @@ -848,7 +848,7 @@ struct b43_phy_lp {
> s16 txpa[3], txpal[3], txpah[3];
>
> /* Receive power offset */
> - u8 rx_pwr_offset; /* FIXME initial value? */
> + u8 rx_pwr_offset;
>
> /* TSSI transmit count */
> u16 tssi_tx_count;
> @@ -864,16 +864,16 @@ struct b43_phy_lp {
> s8 tx_pwr_idx_over; /* FIXME initial value? */
>
> /* RSSI vf */
> - u8 rssi_vf; /* FIXME initial value? */
> + u8 rssi_vf;
> /* RSSI vc */
> - u8 rssi_vc; /* FIXME initial value? */
> + u8 rssi_vc;
> /* RSSI gs */
> - u8 rssi_gs; /* FIXME initial value? */
> + u8 rssi_gs;
>
> /* RC cap */
> u8 rc_cap; /* FIXME initial value? */
> /* BX arch */
> - u8 bx_arch; /* FIXME initial value? */
> + u8 bx_arch;
>
> /* Full calibration channel */
> u8 full_calib_chan; /* FIXME initial value? */
> @@ -885,6 +885,8 @@ struct b43_phy_lp {
> /* Used for "Save/Restore Dig Filt State" */
> u16 dig_flt_state[9];
>
> + bool crs_usr_disable, crs_sys_disable;
> +
> unsigned int pdiv;
> };
>
> diff --git a/drivers/net/wireless/b43/tables_lpphy.c
> b/drivers/net/wireless/b43/tables_lpphy.c
> index 2721310..60d472f 100644
> --- a/drivers/net/wireless/b43/tables_lpphy.c
> +++ b/drivers/net/wireless/b43/tables_lpphy.c
> @@ -2367,7 +2367,17 @@ static void lpphy_rev2plus_write_gain_table(struct
> b43_wldev *dev, int offset,
> tmp = data.pad << 16;
> tmp |= data.pga << 8;
> tmp |= data.gm;
> - tmp |= 0x7f000000;
> + if (dev->phy.rev >= 3) {
> + if (b43_current_band(dev->wl) == IEEE80211_BAND_5GHZ)
> + tmp |= 0x10 << 24;
> + else
> + tmp |= 0x70 << 24;
> + } else {
> + if (b43_current_band(dev->wl) == IEEE80211_BAND_5GHZ)
> + tmp |= 0x14 << 24;
> + else
> + tmp |= 0x7F << 24;
> + }
> b43_lptab_write(dev, B43_LPTAB32(7, 0xC0 + offset), tmp);
> tmp = data.bb_mult << 20;
> tmp |= data.dac << 28;
> --
> 1.6.2.4
>
>
>
>
--
Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-)
^ permalink raw reply
* Re: [ANN] b43 LP-PHY support (BCM4310/4312/4315) now ready for testing!
From: Gábor Stefanik @ 2009-08-19 11:28 UTC (permalink / raw)
To: Mark Huijgen; +Cc: Broadcom Wireless, linux-wireless
In-Reply-To: <4A8BBB02.4020203@huijgen.tk>
2009/8/19 Mark Huijgen <mark.sf.net@huijgen.tk>:
> Gábor Stefanik wrote:
>> Hello World!
>>
>> Great news for Broadcom BCM4310/4312/4315 (PCI 14e4:4315) users:
>> LP-PHY support is now at the point where it can be tested for functionality!
>>
>> So, go ahead, give it a try, and let's rock!
>>
> Patches applied, well manually, cause I wasn't able to extract a working
> version from the emails or the weblink provided. Whats the recommended
> method to apply these git patches on mailinglists?
>
> Here goes:
>
> # modprobe b43 verbose=3
> [ 1596.228088] ssb: Core 0 found: ChipCommon (cc 0x800, rev 0x16, vendor
> 0x4243)
> [ 1596.228100] ssb: Core 1 found: IEEE 802.11 (cc 0x812, rev 0x0F,
> vendor 0x4243)
> [ 1596.228110] ssb: Core 2 found: PCMCIA (cc 0x80D, rev 0x0A, vendor 0x4243)
> [ 1596.228120] ssb: Core 3 found: PCI-E (cc 0x820, rev 0x09, vendor 0x4243)
> [ 1596.248050] ssb: Found rev 1 PMU (capabilities 0x02A62F01)
> [ 1596.256780] ssb: SPROM revision 8 detected.
> [ 1596.276093] ssb: Sonics Silicon Backplane found on PCI device
> 0000:10:00.0
> [ 1596.281108] b43-phy2: Broadcom 4312 WLAN found (core revision 15)
> [ 1596.324046] b43-phy2 debug: Found PHY: Analog 6, Type 5, Revision 1
> [ 1596.324060] b43-phy2 debug: Found Radio: Manuf 0x17F, Version 0x2062,
> Revision 2
> [ 1596.348233] phy2: Selected rate control algorithm 'minstrel'
> [ 1596.348349] Broadcom 43xx driver loaded [ Features: PL, Firmware-ID:
> FW13 ]
>
> # ifconfig wlan0 up
> SIOCSIFFLAGS: Input/output error
>
> [ 1689.356055] b43 ssb0:0: firmware: requesting b43/ucode15.fw
> [ 1689.703918] b43 ssb0:0: firmware: requesting b43/lp0initvals15.fw
> [ 1689.710418] b43 ssb0:0: firmware: requesting b43/lp0bsinitvals15.fw
> [ 1689.852058] b43-phy2: Loading firmware version 410.2160 (2007-05-26
> 15:32:10)
> [ 1689.854963] b43-phy2 debug: b2062: Using crystal tab entry 19200 kHz.
> [ 1689.855468] b43-phy2 debug: RC calib: Failed to switch to channel 7,
> error = -5
> [ 1689.860016] b43-phy2 debug: Switch to init channel failed, error = -5.
Hmm, error -5 is EIO, which in the channel switch code is used to
represent "PLL charge pump out of range". This is specifically the
error I was trying to fix... could you try without the 2 extra
patches? Maybe I did something wrong. (Without the 2 patches, channels
1..6 and 9..11 (12...14 not tested) throw this error, but channels 7
and 8 work.)
Also try extracting firmware from
ftp://downloads.netgear.com/files/GPL/WNDR3300-V1.0.29_gpl_src.zip's
wl_apsta.o file (newer than the one on mirror.openwrt.org - you may
need to add the extraction defines to fwcutter first; there is a
script in the fwcutter git tree, probably also in tarballs, that
generates extraction lists.) This is the firmware the specs are
written for; it's possible that the current firmware is simply not
good for LP-PHY (or maybe it needs code based on older specs).
> [ 1689.860543] b43-phy2 ERROR: PHY init: Channel switch to default failed
>
> Interface is not coming up, so cannot scan:
> # iwlist wlan0 scan
> wlan0 Interface doesn't support scanning : Network is down
When testing mac80211 drivers, always use "iw dev wlan0 scan", not
"iwlist wlan0 scan". (Though this shouldn't affect your results in
this case.)
Try bringing up the interface in monitor mode.
Also, try changing get_default_chan to return 7 instead of 1.
>
>
> # iwconfig wlan0
> wlan0 IEEE 802.11bg Mode:Managed Access Point: Not-Associated
> Tx-Power=0 dBm
> Retry long limit:7 RTS thr:off Fragment thr:off
> Encryption key:off
> Power Management:off
>
> # iw dev wlan0 info
> Interface wlan0
> ifindex 5
> type managed
>
> # iw phy phy2 info
> Wiphy phy2
> Band 1:
> Frequencies:
> * 2412 MHz [1] (27.0 dBm)
> * 2417 MHz [2] (27.0 dBm)
> * 2422 MHz [3] (27.0 dBm)
> * 2427 MHz [4] (27.0 dBm)
> * 2432 MHz [5] (27.0 dBm)
> * 2437 MHz [6] (27.0 dBm)
> * 2442 MHz [7] (27.0 dBm)
> * 2447 MHz [8] (27.0 dBm)
> * 2452 MHz [9] (27.0 dBm)
> * 2457 MHz [10] (27.0 dBm)
> * 2462 MHz [11] (27.0 dBm)
> * 2467 MHz [12] (disabled)
> * 2472 MHz [13] (disabled)
> * 2484 MHz [14] (disabled)
> Bitrates (non-HT):
> * 1.0 Mbps
> * 2.0 Mbps (short preamble supported)
> * 5.5 Mbps (short preamble supported)
> * 11.0 Mbps (short preamble supported)
> * 6.0 Mbps
> * 9.0 Mbps
> * 12.0 Mbps
> * 18.0 Mbps
> * 24.0 Mbps
> * 36.0 Mbps
> * 48.0 Mbps
> * 54.0 Mbps
> max # scan SSIDs: 4
> Supported interface modes:
> * IBSS
> * managed
> * AP
> * AP/VLAN
> * WDS
> * monitor
> * mesh point
>
>
>
>
--
Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-)
^ permalink raw reply
* [PATCH] ath9k: Nuke struct ath9k_node_stats
From: Vasanthakumar Thiagarajan @ 2009-08-19 10:53 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, Luis.Rodriguez, Jouni.Malinen, ath9k-devel
In-Reply-To: <1250679220-30392-1-git-send-email-vasanth@atheros.com>
Other than ns_avgbrssi (Average beacon rssi) no data of
ath9k_node_stats is being used anywhere. Nuke this structure
and move its only useful member to ar5416Anistate. Also cleanup
this redundant data in ath_softc.
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
---
drivers/net/wireless/ath/ath9k/ani.c | 6 +-----
drivers/net/wireless/ath/ath9k/ani.h | 15 +++------------
drivers/net/wireless/ath/ath9k/ath9k.h | 1 -
drivers/net/wireless/ath/ath9k/main.c | 9 +++------
drivers/net/wireless/ath/ath9k/recv.c | 2 +-
5 files changed, 8 insertions(+), 25 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/ani.c b/drivers/net/wireless/ath/ath9k/ani.c
index f264097..a7cbb07 100644
--- a/drivers/net/wireless/ath/ath9k/ani.c
+++ b/drivers/net/wireless/ath/ath9k/ani.c
@@ -538,7 +538,6 @@ void ath9k_ani_reset(struct ath_hw *ah)
}
void ath9k_hw_ani_monitor(struct ath_hw *ah,
- const struct ath9k_node_stats *stats,
struct ath9k_channel *chan)
{
struct ar5416AniState *aniState;
@@ -550,7 +549,6 @@ void ath9k_hw_ani_monitor(struct ath_hw *ah,
return;
aniState = ah->curani;
- ah->stats.ast_nodestats = *stats;
listenTime = ath9k_hw_ani_get_listen_time(ah);
if (listenTime < 0) {
@@ -693,8 +691,7 @@ u32 ath9k_hw_GetMibCycleCountsPct(struct ath_hw *ah,
* any of the MIB counters overflow/trigger so don't assume we're
* here because a PHY error counter triggered.
*/
-void ath9k_hw_procmibevent(struct ath_hw *ah,
- const struct ath9k_node_stats *stats)
+void ath9k_hw_procmibevent(struct ath_hw *ah)
{
u32 phyCnt1, phyCnt2;
@@ -706,7 +703,6 @@ void ath9k_hw_procmibevent(struct ath_hw *ah,
/* Clear the mib counters and save them in the stats */
ath9k_hw_update_mibstats(ah, &ah->ah_mibStats);
- ah->stats.ast_nodestats = *stats;
if (!DO_ANI(ah))
return;
diff --git a/drivers/net/wireless/ath/ath9k/ani.h b/drivers/net/wireless/ath/ath9k/ani.h
index 6273fd0..4e1ab94 100644
--- a/drivers/net/wireless/ath/ath9k/ani.h
+++ b/drivers/net/wireless/ath/ath9k/ani.h
@@ -21,7 +21,7 @@
#define DO_ANI(ah) (((ah)->proc_phyerr & HAL_PROCESS_ANI))
-#define BEACON_RSSI(ahp) (ahp->stats.ast_nodestats.ns_avgbrssi)
+#define BEACON_RSSI(ahp) (ahp->stats.avgbrssi)
#define ATH9K_ANI_OFDM_TRIG_HIGH 500
#define ATH9K_ANI_OFDM_TRIG_LOW 200
@@ -60,13 +60,6 @@ struct ath9k_mib_stats {
u32 beacons;
};
-struct ath9k_node_stats {
- u32 ns_avgbrssi;
- u32 ns_avgrssi;
- u32 ns_avgtxrssi;
- u32 ns_avgtxrate;
-};
-
struct ar5416AniState {
struct ath9k_channel *c;
u8 noiseImmunityLevel;
@@ -110,21 +103,19 @@ struct ar5416Stats {
u32 ast_ani_reset;
u32 ast_ani_lzero;
u32 ast_ani_lneg;
+ u32 avgbrssi;
struct ath9k_mib_stats ast_mibstats;
- struct ath9k_node_stats ast_nodestats;
};
#define ah_mibStats stats.ast_mibstats
void ath9k_ani_reset(struct ath_hw *ah);
void ath9k_hw_ani_monitor(struct ath_hw *ah,
- const struct ath9k_node_stats *stats,
struct ath9k_channel *chan);
void ath9k_enable_mib_counters(struct ath_hw *ah);
void ath9k_hw_disable_mib_counters(struct ath_hw *ah);
u32 ath9k_hw_GetMibCycleCountsPct(struct ath_hw *ah, u32 *rxc_pcnt,
u32 *rxf_pcnt, u32 *txf_pcnt);
-void ath9k_hw_procmibevent(struct ath_hw *ah,
- const struct ath9k_node_stats *stats);
+void ath9k_hw_procmibevent(struct ath_hw *ah);
void ath9k_hw_ani_setup(struct ath_hw *ah);
void ath9k_hw_ani_init(struct ath_hw *ah);
void ath9k_hw_ani_disable(struct ath_hw *ah);
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 2c9f662..70bdd92 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -603,7 +603,6 @@ struct ath_softc {
int beacon_interval;
struct ath_ani ani;
- struct ath9k_node_stats nodestats;
#ifdef CONFIG_ATH9K_DEBUG
struct ath9k_debug debug;
#endif
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 2f9c149..f92b47d 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -384,7 +384,7 @@ static void ath_ani_calibrate(unsigned long data)
if (longcal || shortcal || aniflag) {
/* Call ANI routine if necessary */
if (aniflag)
- ath9k_hw_ani_monitor(ah, &sc->nodestats, ah->curchan);
+ ath9k_hw_ani_monitor(ah, ah->curchan);
/* Perform calibration if necessary */
if (longcal || shortcal) {
@@ -589,7 +589,7 @@ irqreturn_t ath_isr(int irq, void *dev)
* it will clear whatever condition caused
* the interrupt.
*/
- ath9k_hw_procmibevent(ah, &sc->nodestats);
+ ath9k_hw_procmibevent(ah);
ath9k_hw_set_interrupts(ah, sc->imask);
}
@@ -940,10 +940,7 @@ static void ath9k_bss_assoc_info(struct ath_softc *sc,
ath_beacon_config(sc, vif);
/* Reset rssi stats */
- sc->nodestats.ns_avgbrssi = ATH_RSSI_DUMMY_MARKER;
- sc->nodestats.ns_avgrssi = ATH_RSSI_DUMMY_MARKER;
- sc->nodestats.ns_avgtxrssi = ATH_RSSI_DUMMY_MARKER;
- sc->nodestats.ns_avgtxrate = ATH_RATE_DUMMY_MARKER;
+ sc->sc_ah->stats.avgbrssi = ATH_RSSI_DUMMY_MARKER;
ath_start_ani(sc);
} else {
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index 61dbdd2..7b62c22 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -222,7 +222,7 @@ static int ath_rx_prepare(struct sk_buff *skb, struct ath_desc *ds,
/* Update Beacon RSSI, this is used by ANI. */
if (ieee80211_is_beacon(fc))
- sc->nodestats.ns_avgbrssi = ds->ds_rxstat.rs_rssi;
+ sc->sc_ah->stats.avgbrssi = ds->ds_rxstat.rs_rssi;
rx_status->mactime = ath_extend_tsf(sc, ds->ds_rxstat.rs_tstamp);
rx_status->band = hw->conf.channel->band;
--
1.5.5.1
^ permalink raw reply related
* [PATCH] ath9k: Fix bug in retrieving average beacon rssi
From: Vasanthakumar Thiagarajan @ 2009-08-19 10:53 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, Luis.Rodriguez, Jouni.Malinen, ath9k-devel
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
---
drivers/net/wireless/ath/ath9k/ani.h | 7 +------
1 files changed, 1 insertions(+), 6 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/ani.h b/drivers/net/wireless/ath/ath9k/ani.h
index 1199245..6273fd0 100644
--- a/drivers/net/wireless/ath/ath9k/ani.h
+++ b/drivers/net/wireless/ath/ath9k/ani.h
@@ -18,15 +18,10 @@
#define ANI_H
#define HAL_PROCESS_ANI 0x00000001
-#define ATH9K_RSSI_EP_MULTIPLIER (1<<7)
#define DO_ANI(ah) (((ah)->proc_phyerr & HAL_PROCESS_ANI))
-#define HAL_EP_RND(x, mul) \
- ((((x)%(mul)) >= ((mul)/2)) ? ((x) + ((mul) - 1)) / (mul) : (x)/(mul))
-#define BEACON_RSSI(ahp) \
- HAL_EP_RND(ahp->stats.ast_nodestats.ns_avgbrssi, \
- ATH9K_RSSI_EP_MULTIPLIER)
+#define BEACON_RSSI(ahp) (ahp->stats.ast_nodestats.ns_avgbrssi)
#define ATH9K_ANI_OFDM_TRIG_HIGH 500
#define ATH9K_ANI_OFDM_TRIG_LOW 200
--
1.5.5.1
^ permalink raw reply related
* [PATCH v2] ar9170: refactor configure_filter
From: Christian Lamparter @ 2009-08-19 10:43 UTC (permalink / raw)
To: linux-wireless; +Cc: John Linville
In-Reply-To: <200908190126.31928.chunkeey@web.de>
Thanks to "mac80211: allow configure_filter callback to sleep",
we no longer have to defer the work to the workqueue.
Signed-off-by: Christian Lamparter <chunkeey@web.de>
---
please test!
changes to v1:
- re-based
- fixed possible WARN_ON in ieee80211_configure_filter
on module unload
---
diff --git a/drivers/net/wireless/ath/ar9170/ar9170.h b/drivers/net/wireless/ath/ar9170/ar9170.h
index 95f8256..ce40724 100644
--- a/drivers/net/wireless/ath/ar9170/ar9170.h
+++ b/drivers/net/wireless/ath/ar9170/ar9170.h
@@ -185,10 +185,8 @@ struct ar9170 {
bool disable_offload;
/* filter settings */
- struct work_struct filter_config_work;
- u64 cur_mc_hash, want_mc_hash;
- u32 cur_filter, want_filter;
- unsigned long filter_changed;
+ u64 cur_mc_hash;
+ u32 cur_filter;
unsigned int filter_state;
bool sniffer_enabled;
@@ -261,10 +259,6 @@ struct ar9170_tx_info {
#define IS_STARTED(a) (((struct ar9170 *)a)->state >= AR9170_STARTED)
#define IS_ACCEPTING_CMD(a) (((struct ar9170 *)a)->state >= AR9170_IDLE)
-#define AR9170_FILTER_CHANGED_MODE BIT(0)
-#define AR9170_FILTER_CHANGED_MULTICAST BIT(1)
-#define AR9170_FILTER_CHANGED_FRAMEFILTER BIT(2)
-
/* exported interface */
void *ar9170_alloc(size_t priv_size);
int ar9170_register(struct ar9170 *ar, struct device *pdev);
@@ -278,8 +272,8 @@ int ar9170_nag_limiter(struct ar9170 *ar);
int ar9170_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb);
int ar9170_init_mac(struct ar9170 *ar);
int ar9170_set_qos(struct ar9170 *ar);
-int ar9170_update_multicast(struct ar9170 *ar);
-int ar9170_update_frame_filter(struct ar9170 *ar);
+int ar9170_update_multicast(struct ar9170 *ar, const u64 mc_hast);
+int ar9170_update_frame_filter(struct ar9170 *ar, const u32 filter);
int ar9170_set_operating_mode(struct ar9170 *ar);
int ar9170_set_beacon_timers(struct ar9170 *ar);
int ar9170_set_dyn_sifs_ack(struct ar9170 *ar);
diff --git a/drivers/net/wireless/ath/ar9170/mac.c b/drivers/net/wireless/ath/ar9170/mac.c
index d9f1f46..6004936 100644
--- a/drivers/net/wireless/ath/ar9170/mac.c
+++ b/drivers/net/wireless/ath/ar9170/mac.c
@@ -238,39 +238,31 @@ static int ar9170_set_mac_reg(struct ar9170 *ar, const u32 reg, const u8 *mac)
return ar9170_regwrite_result();
}
-int ar9170_update_multicast(struct ar9170 *ar)
+int ar9170_update_multicast(struct ar9170 *ar, const u64 mc_hash)
{
int err;
ar9170_regwrite_begin(ar);
- ar9170_regwrite(AR9170_MAC_REG_GROUP_HASH_TBL_H,
- ar->want_mc_hash >> 32);
- ar9170_regwrite(AR9170_MAC_REG_GROUP_HASH_TBL_L,
- ar->want_mc_hash);
-
+ ar9170_regwrite(AR9170_MAC_REG_GROUP_HASH_TBL_H, mc_hash >> 32);
+ ar9170_regwrite(AR9170_MAC_REG_GROUP_HASH_TBL_L, mc_hash);
ar9170_regwrite_finish();
err = ar9170_regwrite_result();
-
if (err)
return err;
- ar->cur_mc_hash = ar->want_mc_hash;
-
+ ar->cur_mc_hash = mc_hash;
return 0;
}
-int ar9170_update_frame_filter(struct ar9170 *ar)
+int ar9170_update_frame_filter(struct ar9170 *ar, const u32 filter)
{
int err;
- err = ar9170_write_reg(ar, AR9170_MAC_REG_FRAMETYPE_FILTER,
- ar->want_filter);
-
+ err = ar9170_write_reg(ar, AR9170_MAC_REG_FRAMETYPE_FILTER, filter);
if (err)
return err;
- ar->cur_filter = ar->want_filter;
-
+ ar->cur_filter = filter;
return 0;
}
diff --git a/drivers/net/wireless/ath/ar9170/main.c b/drivers/net/wireless/ath/ar9170/main.c
index d30f33d..658b323 100644
--- a/drivers/net/wireless/ath/ar9170/main.c
+++ b/drivers/net/wireless/ath/ar9170/main.c
@@ -1232,8 +1232,6 @@ static int ar9170_op_start(struct ieee80211_hw *hw)
mutex_lock(&ar->mutex);
- ar->filter_changed = 0;
-
/* reinitialize queues statistics */
memset(&ar->tx_stats, 0, sizeof(ar->tx_stats));
for (i = 0; i < __AR9170_NUM_TXQ; i++)
@@ -1296,7 +1294,6 @@ static void ar9170_op_stop(struct ieee80211_hw *hw)
#ifdef CONFIG_AR9170_LEDS
cancel_delayed_work_sync(&ar->led_work);
#endif
- cancel_work_sync(&ar->filter_config_work);
cancel_work_sync(&ar->beacon_work);
mutex_lock(&ar->mutex);
@@ -1973,8 +1970,7 @@ static int ar9170_op_add_interface(struct ieee80211_hw *hw,
}
ar->cur_filter = 0;
- ar->want_filter = AR9170_MAC_REG_FTF_DEFAULTS;
- err = ar9170_update_frame_filter(ar);
+ err = ar9170_update_frame_filter(ar, AR9170_MAC_REG_FTF_DEFAULTS);
if (err)
goto unlock;
@@ -1992,8 +1988,7 @@ static void ar9170_op_remove_interface(struct ieee80211_hw *hw,
mutex_lock(&ar->mutex);
ar->vif = NULL;
- ar->want_filter = 0;
- ar9170_update_frame_filter(ar);
+ ar9170_update_frame_filter(ar, 0);
ar9170_set_beacon_timers(ar);
dev_kfree_skb(ar->beacon);
ar->beacon = NULL;
@@ -2065,41 +2060,6 @@ out:
return err;
}
-static void ar9170_set_filters(struct work_struct *work)
-{
- struct ar9170 *ar = container_of(work, struct ar9170,
- filter_config_work);
- int err;
-
- if (unlikely(!IS_STARTED(ar)))
- return ;
-
- mutex_lock(&ar->mutex);
- if (test_and_clear_bit(AR9170_FILTER_CHANGED_MODE,
- &ar->filter_changed)) {
- err = ar9170_set_operating_mode(ar);
- if (err)
- goto unlock;
- }
-
- if (test_and_clear_bit(AR9170_FILTER_CHANGED_MULTICAST,
- &ar->filter_changed)) {
- err = ar9170_update_multicast(ar);
- if (err)
- goto unlock;
- }
-
- if (test_and_clear_bit(AR9170_FILTER_CHANGED_FRAMEFILTER,
- &ar->filter_changed)) {
- err = ar9170_update_frame_filter(ar);
- if (err)
- goto unlock;
- }
-
-unlock:
- mutex_unlock(&ar->mutex);
-}
-
static u64 ar9170_op_prepare_multicast(struct ieee80211_hw *hw, int mc_count,
struct dev_addr_list *mclist)
{
@@ -2126,6 +2086,11 @@ static void ar9170_op_configure_filter(struct ieee80211_hw *hw,
{
struct ar9170 *ar = hw->priv;
+ if (unlikely(!IS_ACCEPTING_CMD(ar)))
+ return ;
+
+ mutex_lock(&ar->mutex);
+
/* mask supported flags */
*new_flags &= FIF_ALLMULTI | FIF_CONTROL | FIF_BCN_PRBRESP_PROMISC |
FIF_PROMISC_IN_BSS | FIF_FCSFAIL | FIF_PLCPFAIL;
@@ -2136,12 +2101,10 @@ static void ar9170_op_configure_filter(struct ieee80211_hw *hw,
*/
if (changed_flags & FIF_ALLMULTI && *new_flags & FIF_ALLMULTI)
- multicast = ~0ULL;
+ multicast = ~0ULL;
- if (multicast != ar->want_mc_hash) {
- ar->want_mc_hash = multicast;
- set_bit(AR9170_FILTER_CHANGED_MULTICAST, &ar->filter_changed);
- }
+ if (multicast != ar->cur_mc_hash)
+ ar9170_update_multicast(ar, multicast);
if (changed_flags & FIF_CONTROL) {
u32 filter = AR9170_MAC_REG_FTF_PSPOLL |
@@ -2152,24 +2115,22 @@ static void ar9170_op_configure_filter(struct ieee80211_hw *hw,
AR9170_MAC_REG_FTF_CFE_ACK;
if (*new_flags & FIF_CONTROL)
- ar->want_filter = ar->cur_filter | filter;
+ filter |= ar->cur_filter;
else
- ar->want_filter = ar->cur_filter & ~filter;
+ filter &= (~ar->cur_filter);
- set_bit(AR9170_FILTER_CHANGED_FRAMEFILTER,
- &ar->filter_changed);
+ ar9170_update_frame_filter(ar, filter);
}
if (changed_flags & FIF_PROMISC_IN_BSS) {
ar->sniffer_enabled = ((*new_flags) & FIF_PROMISC_IN_BSS) != 0;
- set_bit(AR9170_FILTER_CHANGED_MODE,
- &ar->filter_changed);
+ ar9170_set_operating_mode(ar);
}
- if (likely(IS_STARTED(ar)))
- ieee80211_queue_work(ar->hw, &ar->filter_config_work);
+ mutex_unlock(&ar->mutex);
}
+
static void ar9170_op_bss_info_changed(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct ieee80211_bss_conf *bss_conf,
@@ -2423,9 +2384,6 @@ static void ar9170_sta_notify(struct ieee80211_hw *hw,
default:
break;
}
-
- if (IS_STARTED(ar) && ar->filter_changed)
- ieee80211_queue_work(ar->hw, &ar->filter_config_work);
}
static int ar9170_get_stats(struct ieee80211_hw *hw,
@@ -2596,7 +2554,6 @@ void *ar9170_alloc(size_t priv_size)
skb_queue_head_init(&ar->tx_pending[i]);
}
ar9170_rx_reset_rx_mpdu(ar);
- INIT_WORK(&ar->filter_config_work, ar9170_set_filters);
INIT_WORK(&ar->beacon_work, ar9170_new_beacon);
INIT_DELAYED_WORK(&ar->tx_janitor, ar9170_tx_janitor);
INIT_LIST_HEAD(&ar->tx_ampdu_list);
^ permalink raw reply related
* Re: [PATCH 00/29] mwl8k update to version 0.10
From: Lennert Buytenhek @ 2009-08-19 9:32 UTC (permalink / raw)
To: linville, linux-wireless; +Cc: Johannes Berg
In-Reply-To: <20090818103043.GA6171@mail.wantstofly.org>
On Tue, Aug 18, 2009 at 12:30:43PM +0200, Lennert Buytenhek wrote:
> The following changes since commit f0602f40fe362f4ee15aad719d5cf7021de61914:
> Bob Copeland (1):
> wl1251: correct definitions for 0th bit defines
>
> are available in the git repository at:
>
> git://git.marvell.com/mwl8k.git master
>
> Lennert Buytenhek (29):
> mwl8k: remove various unused struct members and defines
> mwl8k: s/IEEE80211_ADDR_LEN/ETH_ALEN/g
> mwl8k: sort firmware command list by opcode, and trim unused commands
> mwl8k: various coding style cleanups
> mwl8k: remove MWL8K_RADIO_* defines
> mwl8k: remove MWL8K_RADIO_*_PREAMBLE defines
> mwl8k: remove MWL8K_WMM_* defines
> mwl8k: remove MWL8K_*_SLOTTIME defines
> mwl8k: fix mwl8k_configure_filter() parameter lifetime issue
> mwl8k: ->add_interface() is not called for monitor interfaces
> mwl8k: dma header manipulations can't fail
> mwl8k: don't touch 'command done' interrupt during firmware load
> mwl8k: don't hardcode the number of transmit queues
> mwl8k: no need to hold ->tx_lock while setting the hardware interrupt mask
> mwl8k: implement rfkill
Johannes pointed out that this subject line is nonsense, which it
is as the patch itself implements IEEE80211_CONF_IDLE, so I've replaced
this commit message by "mwl8k: implement idle mode" and updated the
master branch (renaming the old one to master.old). No code changes.
^ permalink raw reply
* Re: [PATCH 2/3] Add rfkill support to compal-laptop
From: Johannes Berg @ 2009-08-19 9:01 UTC (permalink / raw)
To: Mario Limonciello
Cc: Alan Jenkins, Marcel Holtmann, cezary.jackiewicz, linux-acpi,
linux-kernel, linux-wireless@vger.kernel.org
In-Reply-To: <4A8B246D.7050004@dell.com>
[-- Attachment #1: Type: text/plain, Size: 1898 bytes --]
Ah, heh, thanks Alan for pointing out there was a patch here :)
> +static void compal_rfkill_poll(struct rfkill *rfkill, void *data)
> +{
> + unsigned long radio = (unsigned long) data;
> + u8 result;
> + bool hw_blocked;
> + bool sw_blocked;
> +
> + ec_read(COMPAL_EC_COMMAND_WIRELESS, &result);
> +
> + hw_blocked = !(result & (KILLSWITCH_MASK | radio));
I don't quite understand the "| radio" bit since that seems to be the
soft kill bit according to rfkill_set()?
> + sw_blocked = rfkill_set_hw_state(rfkill, hw_blocked);
> +
> + rfkill_set_sw_state(rfkill, sw_blocked);
This is wrong. You can remove the entire part about sw_blocked, almost.
> +static int compal_rfkill_set(void *data, bool blocked)
> +{
> + unsigned long radio = (unsigned long) data;
> + u8 result, value;
> +
> + ec_read(COMPAL_EC_COMMAND_WIRELESS, &result);
> +
> + if ((result & KILLSWITCH_MASK) == 0)
> + return -EINVAL;
Anyhow, here you reject the request to set the soft bit. I suspect you
could let it go through but it would only change the soft bit in the
BIOS, nothing else really.
Two options:
1) You can let it go though, in that case do that, and remove the sw
block stuff from poll() completely.
2) You can't let it go through. In this case, you need to leave set as
it is, but implement poll like this:
sw_block = rfkill_set_hw_state(rfkill, hw_blocked);
compal_rfkill_set(data, sw_block);
so that when the user soft-blocks the device while hard-blocked, the
soft block is still honoured after pushing the button on the laptop.
Also, I'm not entirely clear about the semantics -- you've called the
bit KILLSWITCH_MASK, but does it really control all technologies as a
hard block, i.e. it toggles both the bluetooth and wireless hard block?
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply
* Re: [PATCH 2/3] Add rfkill support to compal-laptop
From: Alan Jenkins @ 2009-08-19 8:51 UTC (permalink / raw)
To: Mario Limonciello
Cc: Johannes Berg, Marcel Holtmann, cezary.jackiewicz, linux-acpi,
linux-kernel, linux-wireless@vger.kernel.org
In-Reply-To: <4A8B246D.7050004@dell.com>
On 8/18/09, Mario Limonciello <mario_limonciello@dell.com> wrote:
> Hi Guys:
Hi again Mario
> Alan Jenkins wrote:
>
>> ... but you *do* need to unregister wifi_rfkill here, before you go on
>> to destroy it.
>>
>> +err_wifi:
>> + rfkill_destroy(wifi_rfkill);
>> +
>> + return ret;
>> +}
>>
>> Regards
>> Alan
>>
> I think I've addressed this properly now and only go through each of the
> error handlers as necessary.
Yes, that looks better. I'm still a bit confused about poll(), I'll
have to leave that for Johannes to verify. Feel free to add
Reviewed-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Regards
Alan
^ permalink raw reply
* Re: [ANN] b43 LP-PHY support (BCM4310/4312/4315) now ready for testing!
From: Mark Huijgen @ 2009-08-19 8:42 UTC (permalink / raw)
To: Gábor Stefanik; +Cc: Broadcom Wireless, linux-wireless
In-Reply-To: <69e28c910908181329r4b6b7cc8w3c9c0d79dda3730c@mail.gmail.com>
Gábor Stefanik wrote:
> Hello World!
>
> Great news for Broadcom BCM4310/4312/4315 (PCI 14e4:4315) users:
> LP-PHY support is now at the point where it can be tested for functionality!
>
> So, go ahead, give it a try, and let's rock!
>
Patches applied, well manually, cause I wasn't able to extract a working
version from the emails or the weblink provided. Whats the recommended
method to apply these git patches on mailinglists?
Here goes:
# modprobe b43 verbose=3
[ 1596.228088] ssb: Core 0 found: ChipCommon (cc 0x800, rev 0x16, vendor
0x4243)
[ 1596.228100] ssb: Core 1 found: IEEE 802.11 (cc 0x812, rev 0x0F,
vendor 0x4243)
[ 1596.228110] ssb: Core 2 found: PCMCIA (cc 0x80D, rev 0x0A, vendor 0x4243)
[ 1596.228120] ssb: Core 3 found: PCI-E (cc 0x820, rev 0x09, vendor 0x4243)
[ 1596.248050] ssb: Found rev 1 PMU (capabilities 0x02A62F01)
[ 1596.256780] ssb: SPROM revision 8 detected.
[ 1596.276093] ssb: Sonics Silicon Backplane found on PCI device
0000:10:00.0
[ 1596.281108] b43-phy2: Broadcom 4312 WLAN found (core revision 15)
[ 1596.324046] b43-phy2 debug: Found PHY: Analog 6, Type 5, Revision 1
[ 1596.324060] b43-phy2 debug: Found Radio: Manuf 0x17F, Version 0x2062,
Revision 2
[ 1596.348233] phy2: Selected rate control algorithm 'minstrel'
[ 1596.348349] Broadcom 43xx driver loaded [ Features: PL, Firmware-ID:
FW13 ]
# ifconfig wlan0 up
SIOCSIFFLAGS: Input/output error
[ 1689.356055] b43 ssb0:0: firmware: requesting b43/ucode15.fw
[ 1689.703918] b43 ssb0:0: firmware: requesting b43/lp0initvals15.fw
[ 1689.710418] b43 ssb0:0: firmware: requesting b43/lp0bsinitvals15.fw
[ 1689.852058] b43-phy2: Loading firmware version 410.2160 (2007-05-26
15:32:10)
[ 1689.854963] b43-phy2 debug: b2062: Using crystal tab entry 19200 kHz.
[ 1689.855468] b43-phy2 debug: RC calib: Failed to switch to channel 7,
error = -5
[ 1689.860016] b43-phy2 debug: Switch to init channel failed, error = -5.
[ 1689.860543] b43-phy2 ERROR: PHY init: Channel switch to default failed
Interface is not coming up, so cannot scan:
# iwlist wlan0 scan
wlan0 Interface doesn't support scanning : Network is down
# iwconfig wlan0
wlan0 IEEE 802.11bg Mode:Managed Access Point: Not-Associated
Tx-Power=0 dBm
Retry long limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
# iw dev wlan0 info
Interface wlan0
ifindex 5
type managed
# iw phy phy2 info
Wiphy phy2
Band 1:
Frequencies:
* 2412 MHz [1] (27.0 dBm)
* 2417 MHz [2] (27.0 dBm)
* 2422 MHz [3] (27.0 dBm)
* 2427 MHz [4] (27.0 dBm)
* 2432 MHz [5] (27.0 dBm)
* 2437 MHz [6] (27.0 dBm)
* 2442 MHz [7] (27.0 dBm)
* 2447 MHz [8] (27.0 dBm)
* 2452 MHz [9] (27.0 dBm)
* 2457 MHz [10] (27.0 dBm)
* 2462 MHz [11] (27.0 dBm)
* 2467 MHz [12] (disabled)
* 2472 MHz [13] (disabled)
* 2484 MHz [14] (disabled)
Bitrates (non-HT):
* 1.0 Mbps
* 2.0 Mbps (short preamble supported)
* 5.5 Mbps (short preamble supported)
* 11.0 Mbps (short preamble supported)
* 6.0 Mbps
* 9.0 Mbps
* 12.0 Mbps
* 18.0 Mbps
* 24.0 Mbps
* 36.0 Mbps
* 48.0 Mbps
* 54.0 Mbps
max # scan SSIDs: 4
Supported interface modes:
* IBSS
* managed
* AP
* AP/VLAN
* WDS
* monitor
* mesh point
^ permalink raw reply
* Re: [PATCH V2] cfg80211: allow cfg80211_connect_result with bssid == NULL
From: Johannes Berg @ 2009-08-19 8:12 UTC (permalink / raw)
To: Zhu Yi; +Cc: linville, linux-wireless
In-Reply-To: <1250669302-11362-1-git-send-email-yi.zhu@intel.com>
[-- Attachment #1: Type: text/plain, Size: 1848 bytes --]
On Wed, 2009-08-19 at 16:08 +0800, Zhu Yi wrote:
> In case of connection failure, the bssid info is not a must have.
>
> Cc: Johannes Berg <johannes@sipsolutions.net>
> Signed-off-by: Zhu Yi <yi.zhu@intel.com>
> ---
> V2: change a __cfg80211_connect_result() caller to used NULL instead of zero addr
Thanks.
Acked-by: Johannes Berg <johannes@sipsolutions.net>
> net/wireless/core.c | 4 +++-
> net/wireless/sme.c | 3 ++-
> 2 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/net/wireless/core.c b/net/wireless/core.c
> index e630648..8eddf98 100644
> --- a/net/wireless/core.c
> +++ b/net/wireless/core.c
> @@ -12,6 +12,7 @@
> #include <linux/debugfs.h>
> #include <linux/notifier.h>
> #include <linux/device.h>
> +#include <linux/etherdevice.h>
> #include <linux/rtnetlink.h>
> #include <net/genetlink.h>
> #include <net/cfg80211.h>
> @@ -309,7 +310,8 @@ static void cfg80211_process_events(struct wireless_dev *wdev)
> switch (ev->type) {
> case EVENT_CONNECT_RESULT:
> __cfg80211_connect_result(
> - wdev->netdev, ev->cr.bssid,
> + wdev->netdev, is_zero_ether_addr(ev->cr.bssid) ?
> + NULL : ev->cr.bssid,
> ev->cr.req_ie, ev->cr.req_ie_len,
> ev->cr.resp_ie, ev->cr.resp_ie_len,
> ev->cr.status,
> diff --git a/net/wireless/sme.c b/net/wireless/sme.c
> index 8e2ef54..dbd8211 100644
> --- a/net/wireless/sme.c
> +++ b/net/wireless/sme.c
> @@ -458,7 +458,8 @@ void cfg80211_connect_result(struct net_device *dev, const u8 *bssid,
> return;
>
> ev->type = EVENT_CONNECT_RESULT;
> - memcpy(ev->cr.bssid, bssid, ETH_ALEN);
> + if (bssid)
> + memcpy(ev->cr.bssid, bssid, ETH_ALEN);
> ev->cr.req_ie = ((u8 *)ev) + sizeof(*ev);
> ev->cr.req_ie_len = req_ie_len;
> memcpy((void *)ev->cr.req_ie, req_ie, req_ie_len);
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox