* [PATCH 2.6.30 v2] iwl3945: fix rfkill switch
From: Stanislaw Gruszka @ 2009-08-13 12:29 UTC (permalink / raw)
To: stable
Cc: linux-wireless, Zhu Yi, Reinette Chatre, John W. Linville,
Stanislaw Gruszka
Due to rfkill and iwlwifi mishmash of SW / HW killswitch representation,
we have race conditions which make unable turn wifi radio on, after enable
and disable again killswitch. I can observe this problem on my laptop
with iwl3945 device.
In rfkill core HW switch and SW switch are separate 'states'. Device can
be only in one of 3 states: RFKILL_STATE_SOFT_BLOCKED, RFKILL_STATE_UNBLOCKED,
RFKILL_STATE_HARD_BLOCKED. Whereas in iwlwifi driver we have separate bits
STATUS_RF_KILL_HW and STATUS_RF_KILL_SW for HW and SW switches - radio can be
turned on, only if both bits are cleared.
In this particular race conditions, radio can not be turned on if in driver
STATUS_RF_KILL_SW bit is set, and rfkill core is in state
RFKILL_STATE_HARD_BLOCKED, because rfkill core is unable to call
rfkill->toggle_radio(). This situation can be entered in case:
- killswitch is turned on
- rfkill core 'see' button change first and move to RFKILL_STATE_SOFT_BLOCKED
also call ->toggle_radio() and STATE_RF_KILL_SW in driver is set
- iwl3945 get info about button from hardware to set STATUS_RF_KILL_HW bit and
force rfkill to move to RFKILL_STATE_HARD_BLOCKED
- killsiwtch is turend off
- driver clear STATUS_RF_KILL_HW
- rfkill core is unable to clear STATUS_RF_KILL_SW in driver
Additionally call to rfkill_epo() when STATUS_RF_KILL_HW in driver is set
cause move to the same situation.
In 2.6.31 this problem is fixed due to _total_ rewrite of rfkill subsystem.
This is a quite small fix for 2.6.30.x in iwlwifi driver. We are changing
internal rfkill state to always have below relations true:
STATUS_RF_KILL_HW=1 STATUS_RF_KILL_SW=1 <-> RFKILL_STATUS_SOFT_BLOCKED
STATUS_RF_KILL_HW=0 STATUS_RF_KILL_SW=1 <-> RFKILL_STATUS_SOFT_BLOCKED
STATUS_RF_KILL_HW=1 STATUS_RF_KILL_SW=0 <-> RFKILL_STATUS_HARD_BLOCKED
STATUS_RF_KILL_HW=0 STATUS_RF_KILL_SW=0 <-> RFKILL_STATUS_UNBLOCKED
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
Patch was tested by me only with iwl3945 device.
drivers/net/wireless/iwlwifi/iwl-rfkill.c | 26 ++++++++++++++++----------
1 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/iwl-rfkill.c b/drivers/net/wireless/iwlwifi/iwl-rfkill.c
index 2ad9faf..fc3a95f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-rfkill.c
+++ b/drivers/net/wireless/iwlwifi/iwl-rfkill.c
@@ -53,22 +53,31 @@ static int iwl_rfkill_soft_rf_kill(void *data, enum rfkill_state state)
switch (state) {
case RFKILL_STATE_UNBLOCKED:
if (iwl_is_rfkill_hw(priv)) {
+ /* pass error to rfkill core, make it state HARD
+ * BLOCKED (rfkill->mutex taken) and disable
+ * software kill switch */
err = -EBUSY;
- goto out_unlock;
+ priv->rfkill->state = RFKILL_STATE_HARD_BLOCKED;
}
iwl_radio_kill_sw_enable_radio(priv);
break;
case RFKILL_STATE_SOFT_BLOCKED:
iwl_radio_kill_sw_disable_radio(priv);
+ /* rfkill->mutex is taken */
+ if (priv->rfkill->state == RFKILL_STATE_HARD_BLOCKED) {
+ /* force rfkill core state to be SOFT BLOCKED,
+ * otherwise core will be unable to disable software
+ * kill switch */
+ priv->rfkill->state = RFKILL_STATE_SOFT_BLOCKED;
+ }
break;
default:
IWL_WARN(priv, "we received unexpected RFKILL state %d\n",
state);
break;
}
-out_unlock:
- mutex_unlock(&priv->mutex);
+ mutex_unlock(&priv->mutex);
return err;
}
@@ -132,14 +141,11 @@ void iwl_rfkill_set_hw_state(struct iwl_priv *priv)
if (!priv->rfkill)
return;
- if (iwl_is_rfkill_hw(priv)) {
+ if (iwl_is_rfkill_sw(priv))
+ rfkill_force_state(priv->rfkill, RFKILL_STATE_SOFT_BLOCKED);
+ else if (iwl_is_rfkill_hw(priv))
rfkill_force_state(priv->rfkill, RFKILL_STATE_HARD_BLOCKED);
- return;
- }
-
- if (!iwl_is_rfkill_sw(priv))
- rfkill_force_state(priv->rfkill, RFKILL_STATE_UNBLOCKED);
else
- rfkill_force_state(priv->rfkill, RFKILL_STATE_SOFT_BLOCKED);
+ rfkill_force_state(priv->rfkill, RFKILL_STATE_UNBLOCKED);
}
EXPORT_SYMBOL(iwl_rfkill_set_hw_state);
--
1.6.2.5
^ permalink raw reply related
* Re: [PATCH v3] b43: Implement RC calibration for rev.0/1 LP-PHYs
From: Michael Buesch @ 2009-08-13 13:10 UTC (permalink / raw)
To: Gábor Stefanik
Cc: John Linville, Larry Finger, Broadcom Wireless, linux-wireless
In-Reply-To: <4A8404B6.2070902@gmail.com>
On Thursday 13 August 2009 14:19:02 Gábor Stefanik wrote:
> Also implement get/set BB mult, get/set TX gain, set RX gain,
> disable/restore CRS, run/stop DDFS, RX IQ est and QDIV roundup
> in the process.
>
> Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
> ---
> Changes from v2->v3:
> -Two small spec updates/typo fixes, as suggested by Larry.
>
> Changes from v1->v2:
> -Coding style fixes as suggested by Michael.
> -Added missing static to lpphy_qdiv_roundup.
> -Moved set_tx_power_control & related functions before rev0/1 RC calibration,
> and removed forward declaration
> -Reordered variable declarations at the start of rev0_1_rc_calib.
> -The ideal power table is now static const.
>
> Interdiff v1->v2 available @ http://b43.pastebin.com/f5fe6ba3c for easier review.
>
Acked-by: Michael Buesch <mb@bu3sch.de>
--
Greetings, Michael.
^ permalink raw reply
* Re: [PATCH] b43: Update dummy transmission to match V4 specs
From: Michael Buesch @ 2009-08-13 13:12 UTC (permalink / raw)
To: Gábor Stefanik
Cc: John Linville, Larry Finger, Broadcom Wireless, linux-wireless
In-Reply-To: <4A832890.9010408@gmail.com>
On Wednesday 12 August 2009 22:39:44 Gábor Stefanik wrote:
> The V4 dummy transmission function has two extra bools in its
> prototype, so add a wrapper function for callers that expect the
> V3 version.
>
> Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
Nah, please just convert all callers instead. There are not that many callers.
It's maybe about 10.
--
Greetings, Michael.
^ permalink raw reply
* Re: [PATCH] b43: LP-PHY: Initialize TX power control
From: Michael Buesch @ 2009-08-13 13:15 UTC (permalink / raw)
To: Gábor Stefanik
Cc: John Linville, Larry Finger, Broadcom Wireless, linux-wireless
In-Reply-To: <4A832940.6000807@gmail.com>
On Wednesday 12 August 2009 22:42:40 Gábor Stefanik wrote:
> The HW TX power control init still needs work.
> The SW init is complete according to the specs.
HW PCTL needs a serious amount of work in the common code, too.
For now I would focus to SW PCTL and fix HW PCTL later.
>
> Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
> ---
> This depends on both the rev0/1 RC calibration patch and the
> V4 dummy transmission patch I submitted earlier.
>
> Larry, please check the SPEC TODO/SPEC FIXME comments.
>
> drivers/net/wireless/b43/phy_lp.c | 104 ++++++++++++++++++++++++++++++++++---
> drivers/net/wireless/b43/phy_lp.h | 5 ++
> 2 files changed, 102 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/wireless/b43/phy_lp.c b/drivers/net/wireless/b43/phy_lp.c
> index e05981b..6ebaeb2 100644
> --- a/drivers/net/wireless/b43/phy_lp.c
> +++ b/drivers/net/wireless/b43/phy_lp.c
> @@ -1258,18 +1258,108 @@ static void lpphy_calibration(struct b43_wldev *dev)
> b43_mac_enable(dev);
> }
>
> +static void lpphy_set_tssi_mux(struct b43_wldev *dev, enum tssi_mux_mode mode)
> +{
> + if (mode != TSSI_MUX_EXT) {
> + b43_radio_set(dev, B2063_PA_SP1, 0x2);
> + b43_phy_set(dev, B43_PHY_OFDM(0xF3), 0x1000);
> + b43_radio_write(dev, B2063_PA_CTL10, 0x51);
> + if (mode == TSSI_MUX_POSTPA) {
> + b43_radio_mask(dev, B2063_PA_SP1, 0xFFFE);
> + b43_phy_mask(dev, B43_LPPHY_AFE_CTL_OVRVAL, 0xFFC7);
> + } else {
> + b43_radio_maskset(dev, B2063_PA_SP1, 0xFFFE, 0x1);
> + b43_phy_maskset(dev, B43_LPPHY_AFE_CTL_OVRVAL,
> + 0xFFC7, 0x20);
> + }
> + } else {
> + //SPEC TODO
> + }
> +}
> +
> +static void lpphy_tx_pctl_init_hw(struct b43_wldev *dev)
> +{
> + u16 tmp;
> + int i;
> +
> + //SPEC TODO Call LP PHY Clear TX Power offsets
> + for (i = 0; i < 64; i++) {
> + if (dev->phy.rev >= 2)
> + b43_lptab_write(dev, B43_LPTAB32(7, i+1), i);
^^^
Please keep in mind to use spaces all the time. It is our coding style and I think
we should stick with it.
> + tmp = b43_phy_read(dev, B43_LPPHY_TX_PWR_CTL_STAT);
> + if (tmp & 0x8000)
> + b43_phy_maskset(dev, B43_LPPHY_TX_PWR_CTL_IDLETSSI,
> + 0xFFC0, (tmp & 0xFF) - 32);
Curly brackets for multiline indents, please.
--
Greetings, Michael.
^ permalink raw reply
* Re: [PATCH] b43: LP-PHY: Initialize TX power control
From: Gábor Stefanik @ 2009-08-13 14:12 UTC (permalink / raw)
To: Michael Buesch
Cc: John Linville, Larry Finger, Broadcom Wireless, linux-wireless
In-Reply-To: <200908131515.59966.mb@bu3sch.de>
2009/8/13 Michael Buesch <mb@bu3sch.de>:
> On Wednesday 12 August 2009 22:42:40 Gábor Stefanik wrote:
>> The HW TX power control init still needs work.
>> The SW init is complete according to the specs.
>
> HW PCTL needs a serious amount of work in the common code, too.
> For now I would focus to SW PCTL and fix HW PCTL later.
>
>>
>> Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
>> ---
>> This depends on both the rev0/1 RC calibration patch and the
>> V4 dummy transmission patch I submitted earlier.
>>
>> Larry, please check the SPEC TODO/SPEC FIXME comments.
>>
>> drivers/net/wireless/b43/phy_lp.c | 104 ++++++++++++++++++++++++++++++++++---
>> drivers/net/wireless/b43/phy_lp.h | 5 ++
>> 2 files changed, 102 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/net/wireless/b43/phy_lp.c b/drivers/net/wireless/b43/phy_lp.c
>> index e05981b..6ebaeb2 100644
>> --- a/drivers/net/wireless/b43/phy_lp.c
>> +++ b/drivers/net/wireless/b43/phy_lp.c
>> @@ -1258,18 +1258,108 @@ static void lpphy_calibration(struct b43_wldev *dev)
>> b43_mac_enable(dev);
>> }
>>
>> +static void lpphy_set_tssi_mux(struct b43_wldev *dev, enum tssi_mux_mode mode)
>> +{
>> + if (mode != TSSI_MUX_EXT) {
>> + b43_radio_set(dev, B2063_PA_SP1, 0x2);
>> + b43_phy_set(dev, B43_PHY_OFDM(0xF3), 0x1000);
>> + b43_radio_write(dev, B2063_PA_CTL10, 0x51);
>> + if (mode == TSSI_MUX_POSTPA) {
>> + b43_radio_mask(dev, B2063_PA_SP1, 0xFFFE);
>> + b43_phy_mask(dev, B43_LPPHY_AFE_CTL_OVRVAL, 0xFFC7);
>> + } else {
>> + b43_radio_maskset(dev, B2063_PA_SP1, 0xFFFE, 0x1);
>> + b43_phy_maskset(dev, B43_LPPHY_AFE_CTL_OVRVAL,
>> + 0xFFC7, 0x20);
>> + }
>> + } else {
>> + //SPEC TODO
>> + }
>> +}
>> +
>> +static void lpphy_tx_pctl_init_hw(struct b43_wldev *dev)
>> +{
>> + u16 tmp;
>> + int i;
>> +
>> + //SPEC TODO Call LP PHY Clear TX Power offsets
>> + for (i = 0; i < 64; i++) {
>> + if (dev->phy.rev >= 2)
>> + b43_lptab_write(dev, B43_LPTAB32(7, i+1), i);
> ^^^
> Please keep in mind to use spaces all the time. It is our coding style and I think
> we should stick with it.
Will do.
>
>> + tmp = b43_phy_read(dev, B43_LPPHY_TX_PWR_CTL_STAT);
>> + if (tmp & 0x8000)
>> + b43_phy_maskset(dev, B43_LPPHY_TX_PWR_CTL_IDLETSSI,
>> + 0xFFC0, (tmp & 0xFF) - 32);
>
> Curly brackets for multiline indents, please.
Will do.
V2 will also be updated for the dummy transmission change.
>
>
> --
> Greetings, Michael.
>
--
Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-)
^ permalink raw reply
* Re: [ath5k-devel] [PATCH 0/3] ath: advance ath.ko with one more helper
From: Nick Kossifidis @ 2009-08-13 14:41 UTC (permalink / raw)
To: Luis R. Rodriguez
Cc: Bob Copeland, ath5k-devel, ath9k-devel, linux-wireless, linville
In-Reply-To: <43e72e890908122007r766506e7i52aab859b01283d1@mail.gmail.com>
2009/8/13 Luis R. Rodriguez <lrodriguez@atheros.com>:
> On Wed, Aug 12, 2009 at 7:13 PM, Nick Kossifidis<mickflemm@gmail.com> wrote:
>> 2009/8/12 Luis R. Rodriguez <lrodriguez@atheros.com>:
>>> On Wed, Aug 12, 2009 at 10:21 AM, Bob Copeland<me@bobcopeland.com> wrote:
>>>> On Wed, Aug 12, 2009 at 12:56 PM, Luis R.
>>>> Rodriguez<lrodriguez@atheros.com> wrote:
>>>>> This adds a common structure where we can start stuffing shared items
>>>>> and introduces a helper for both ath5k and ath9k's use.
>>>>>
>>>>> Luis R. Rodriguez (3):
>>>>> ath: add common ath_rxbuf_alloc() and make ath9k use it
>>>>> ath5k: use common ath.ko ath_rxbuf_alloc()
>>>>> ath5k: use bit shift operators for cache line size
>>>>
>>>> Series looks OK to me but I think we can add a 4/4 that would:
>>>>
>>>> - include ath/reg.h [don't remember if that's the name right now]
>>>> in ath.h
>>>> - move reg structs into ath_common (although, this could be a
>>>> bad call for ar9170, haven't really checked).
>>>>
>>>> Then we only have to deal with one header and one composite struct
>>>> (for now) as the interface between the modules.
>>>
>>> Sure, I was thinking of doing this after this. Is that acceptable?
>>>
>>> Luis
>>
>> You mean have a common reg.h for both ath5k and ath9k ? Works for me
>> but we have to deal with some new register ranges and some registers
>> have moved on ath9k + reg.h on ath9k has no descriptions, comments, it doesn't
>> include macros for accessing queue registers or tables, mixes eeprom offsets
>> with register addresses and other macros.
>
> Sorry no I meant ath/reg.h as in regulatory, as that is already party of ath.ko.
>
>> My plan was to start merging ath9k hw code on ath5k (not the driver part,
>> pcu.c, qcu.c, phy.c, eeprom.c etc + registers/eeprom offsets/descriptor formats)
>> and then move all that on ath and have both ath5k/ath9k use it. I
>> believe ath5k hw
>> code is much cleaner than ath9k and it's a better place to start, i've
>> seen most hw
>> code on ath9k and i'm ready to move on if it's O.K. with you.
>
> When we update ath9k for new hw support it is easiest if that code
> matches what we have internally at Atheros. Granted we diverge from
> that every now and then but I believe those changes can be brought
> back in that we do and yet keep the internal code working. I believe
> the changes so far bring clarity and readability. Unfortunately we
> haven't yet gotten any the changes we've made on ath9k hw access stuff
> or regulatory merged back in so we keep diverging more and more from
> our internal codebase.
>
> Because of this for now I would not welcome bringing ath9k code to
> ath5k in any way whatsoever. What I think is reasonable though is to
> start merging into ath.ko common code which doesn't change much or
> would mean diverging a lot from ath9k's current style for the hw
> related stuff. Don't get me wrong, changes are welcomed but the less
> intrusive the better. "start merging ath9k hw code on ath5k" sounds
> very intrusive by all means.
>
> Lets do this slowly and take it on, on a patch by patch basis.
>
> Luis
>
ACK ;-)
--
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-)
Nick
^ permalink raw reply
* [PATCH v2] b43: Update dummy transmission to match V4 specs
From: Gábor Stefanik @ 2009-08-13 14:51 UTC (permalink / raw)
To: John Linville, Michael Buesch
Cc: Larry Finger, Broadcom Wireless, linux-wireless
The V4 dummy transmission has two extra bools in its prototype,
so update all callers with the 2 bools.
Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
---
v2: Convert all callers to v4, and drop the v3->v4 wrapper.
drivers/net/wireless/b43/lo.c | 2 +-
drivers/net/wireless/b43/main.c | 42 ++++++++++++++++++++++---------------
drivers/net/wireless/b43/main.h | 2 +-
drivers/net/wireless/b43/phy_g.c | 6 ++--
drivers/net/wireless/b43/wa.c | 2 +-
5 files changed, 31 insertions(+), 23 deletions(-)
diff --git a/drivers/net/wireless/b43/lo.c b/drivers/net/wireless/b43/lo.c
index 22d0fbd..976104f 100644
--- a/drivers/net/wireless/b43/lo.c
+++ b/drivers/net/wireless/b43/lo.c
@@ -477,7 +477,7 @@ static void lo_measure_setup(struct b43_wldev *dev,
} else
b43_phy_write(dev, B43_PHY_CCK(0x2B), 0x0802);
if (phy->rev >= 2)
- b43_dummy_transmission(dev);
+ b43_dummy_transmission(dev, false, true);
b43_gphy_channel_switch(dev, 6, 0);
b43_radio_read16(dev, 0x51); /* dummy read */
if (phy->type == B43_PHYTYPE_G)
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index cb4a871..fbcbe4f 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -684,9 +684,9 @@ static void b43_synchronize_irq(struct b43_wldev *dev)
}
/* DummyTransmission function, as documented on
- * http://bcm-specs.sipsolutions.net/DummyTransmission
+ * http://bcm-v4.sipsolutions.net/802.11/DummyTransmission
*/
-void b43_dummy_transmission(struct b43_wldev *dev)
+void b43_dummy_transmission(struct b43_wldev *dev, bool ofdm, bool pa_on)
{
struct b43_wl *wl = dev->wl;
struct b43_phy *phy = &dev->phy;
@@ -700,19 +700,12 @@ void b43_dummy_transmission(struct b43_wldev *dev)
0x00000000,
};
- switch (phy->type) {
- case B43_PHYTYPE_A:
+ if (ofdm) {
max_loop = 0x1E;
buffer[0] = 0x000201CC;
- break;
- case B43_PHYTYPE_B:
- case B43_PHYTYPE_G:
+ } else {
max_loop = 0xFA;
buffer[0] = 0x000B846E;
- break;
- default:
- B43_WARN_ON(1);
- return;
}
spin_lock_irq(&wl->irq_lock);
@@ -721,20 +714,35 @@ void b43_dummy_transmission(struct b43_wldev *dev)
for (i = 0; i < 5; i++)
b43_ram_write(dev, i * 4, buffer[i]);
- /* Commit writes */
- b43_read32(dev, B43_MMIO_MACCTL);
-
b43_write16(dev, 0x0568, 0x0000);
- b43_write16(dev, 0x07C0, 0x0000);
- value = ((phy->type == B43_PHYTYPE_A) ? 1 : 0);
+ if (dev->dev->id.revision < 11)
+ b43_write16(dev, 0x07C0, 0x0000);
+ else
+ b43_write16(dev, 0x07C0, 0x0100);
+ value = (ofdm ? 0x41 : 0x40);
b43_write16(dev, 0x050C, value);
+ if ((phy->type == B43_PHYTYPE_N) || (phy->type == B43_PHYTYPE_LP))
+ b43_write16(dev, 0x0514, 0x1A02);
b43_write16(dev, 0x0508, 0x0000);
b43_write16(dev, 0x050A, 0x0000);
b43_write16(dev, 0x054C, 0x0000);
b43_write16(dev, 0x056A, 0x0014);
b43_write16(dev, 0x0568, 0x0826);
b43_write16(dev, 0x0500, 0x0000);
- b43_write16(dev, 0x0502, 0x0030);
+ if (!pa_on && (phy->type == B43_PHYTYPE_N)) {
+ //SPEC TODO
+ }
+
+ switch (phy->type) {
+ case B43_PHYTYPE_N:
+ b43_write16(dev, 0x0502, 0x00D0);
+ break;
+ case B43_PHYTYPE_LP:
+ b43_write16(dev, 0x0502, 0x0050);
+ break;
+ default:
+ b43_write16(dev, 0x0502, 0x0030);
+ }
if (phy->radio_ver == 0x2050 && phy->radio_rev <= 0x5)
b43_radio_write16(dev, 0x0051, 0x0017);
diff --git a/drivers/net/wireless/b43/main.h b/drivers/net/wireless/b43/main.h
index 40abcf5..2d23f65 100644
--- a/drivers/net/wireless/b43/main.h
+++ b/drivers/net/wireless/b43/main.h
@@ -124,7 +124,7 @@ void __b43_shm_write16(struct b43_wldev *dev, u16 routing, u16 offset, u16 value
u64 b43_hf_read(struct b43_wldev *dev);
void b43_hf_write(struct b43_wldev *dev, u64 value);
-void b43_dummy_transmission(struct b43_wldev *dev);
+void b43_dummy_transmission(struct b43_wldev *dev, bool ofdm, bool pa_on);
void b43_wireless_core_reset(struct b43_wldev *dev, u32 flags);
diff --git a/drivers/net/wireless/b43/phy_g.c b/drivers/net/wireless/b43/phy_g.c
index e7b98f0..e75a39d 100644
--- a/drivers/net/wireless/b43/phy_g.c
+++ b/drivers/net/wireless/b43/phy_g.c
@@ -333,7 +333,7 @@ static void b43_set_all_gains(struct b43_wldev *dev,
b43_phy_maskset(dev, 0x04A1, 0xBFBF, tmp);
b43_phy_maskset(dev, 0x04A2, 0xBFBF, tmp);
}
- b43_dummy_transmission(dev);
+ b43_dummy_transmission(dev, false, true);
}
static void b43_set_original_gains(struct b43_wldev *dev)
@@ -365,7 +365,7 @@ static void b43_set_original_gains(struct b43_wldev *dev)
b43_phy_maskset(dev, 0x04A0, 0xBFBF, 0x4040);
b43_phy_maskset(dev, 0x04A1, 0xBFBF, 0x4040);
b43_phy_maskset(dev, 0x04A2, 0xBFBF, 0x4000);
- b43_dummy_transmission(dev);
+ b43_dummy_transmission(dev, false, true);
}
/* http://bcm-specs.sipsolutions.net/NRSSILookupTable */
@@ -1964,7 +1964,7 @@ static void b43_phy_init_pctl(struct b43_wldev *dev)
}
b43_set_txpower_g(dev, &bbatt, &rfatt, 0);
}
- b43_dummy_transmission(dev);
+ b43_dummy_transmission(dev, false, true);
gphy->cur_idle_tssi = b43_phy_read(dev, B43_PHY_ITSSI);
if (B43_DEBUG) {
/* Current-Idle-TSSI sanity check. */
diff --git a/drivers/net/wireless/b43/wa.c b/drivers/net/wireless/b43/wa.c
index e1e20f6..73e97fa 100644
--- a/drivers/net/wireless/b43/wa.c
+++ b/drivers/net/wireless/b43/wa.c
@@ -37,7 +37,7 @@ static void b43_wa_papd(struct b43_wldev *dev)
backup = b43_ofdmtab_read16(dev, B43_OFDMTAB_PWRDYN2, 0);
b43_ofdmtab_write16(dev, B43_OFDMTAB_PWRDYN2, 0, 7);
b43_ofdmtab_write16(dev, B43_OFDMTAB_UNKNOWN_APHY, 0, 0);
- b43_dummy_transmission(dev);
+ b43_dummy_transmission(dev, true, true);
b43_ofdmtab_write16(dev, B43_OFDMTAB_PWRDYN2, 0, backup);
}
--
1.6.2.4
^ permalink raw reply related
* [PATCH v2] b43: LP-PHY: Initialize TX power control
From: Gábor Stefanik @ 2009-08-13 14:54 UTC (permalink / raw)
To: John Linville, Michael Buesch, Larry Finger
Cc: Broadcom Wireless, linux-wireless
The HW TX power control init still needs work.
The SW init is complete according to the specs.
Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
---
v2: Address Michael's comments, and update for the dummy transmission changes.
This depends on both the rev0/1 RC calibration patch and the
updated V4 dummy transmission patch I submitted earlier.
Larry, please review the SPEC TODO/SPEC FIXME comments!
drivers/net/wireless/b43/phy_lp.c | 105 ++++++++++++++++++++++++++++++++++---
drivers/net/wireless/b43/phy_lp.h | 5 ++
2 files changed, 103 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/b43/phy_lp.c b/drivers/net/wireless/b43/phy_lp.c
index 2441a8d..b4e51f0 100644
--- a/drivers/net/wireless/b43/phy_lp.c
+++ b/drivers/net/wireless/b43/phy_lp.c
@@ -1257,18 +1257,109 @@ static void lpphy_calibration(struct b43_wldev *dev)
b43_mac_enable(dev);
}
+static void lpphy_set_tssi_mux(struct b43_wldev *dev, enum tssi_mux_mode mode)
+{
+ if (mode != TSSI_MUX_EXT) {
+ b43_radio_set(dev, B2063_PA_SP1, 0x2);
+ b43_phy_set(dev, B43_PHY_OFDM(0xF3), 0x1000);
+ b43_radio_write(dev, B2063_PA_CTL10, 0x51);
+ if (mode == TSSI_MUX_POSTPA) {
+ b43_radio_mask(dev, B2063_PA_SP1, 0xFFFE);
+ b43_phy_mask(dev, B43_LPPHY_AFE_CTL_OVRVAL, 0xFFC7);
+ } else {
+ b43_radio_maskset(dev, B2063_PA_SP1, 0xFFFE, 0x1);
+ b43_phy_maskset(dev, B43_LPPHY_AFE_CTL_OVRVAL,
+ 0xFFC7, 0x20);
+ }
+ } else {
+ //SPEC TODO
+ }
+}
+
+static void lpphy_tx_pctl_init_hw(struct b43_wldev *dev)
+{
+ u16 tmp;
+ int i;
+
+ //SPEC TODO Call LP PHY Clear TX Power offsets
+ for (i = 0; i < 64; i++) {
+ if (dev->phy.rev >= 2)
+ b43_lptab_write(dev, B43_LPTAB32(7, i + 1), i);
+ else
+ b43_lptab_write(dev, B43_LPTAB32(10, i + 1), i);
+ }
+
+ b43_phy_maskset(dev, B43_LPPHY_TX_PWR_CTL_NNUM, 0xFF00, 0xFF);
+ b43_phy_maskset(dev, B43_LPPHY_TX_PWR_CTL_NNUM, 0x8FFF, 0x5000);
+ b43_phy_maskset(dev, B43_LPPHY_TX_PWR_CTL_IDLETSSI, 0xFFC0, 0x1F);
+ if (dev->phy.rev < 2) {
+ b43_phy_mask(dev, B43_LPPHY_LP_PHY_CTL, 0xEFFF);
+ b43_phy_maskset(dev, B43_LPPHY_LP_PHY_CTL, 0xDFFF, 0x2000);
+ } else {
+ b43_phy_mask(dev, B43_PHY_OFDM(0x103), 0xFFFE);
+ b43_phy_maskset(dev, B43_PHY_OFDM(0x103), 0xFFFB, 0x4);
+ b43_phy_maskset(dev, B43_PHY_OFDM(0x103), 0xFFEF, 0x10);
+ b43_radio_maskset(dev, B2063_IQ_CALIB_CTL2, 0xF3, 0x1);
+ lpphy_set_tssi_mux(dev, TSSI_MUX_POSTPA);
+ }
+ b43_phy_maskset(dev, B43_LPPHY_TX_PWR_CTL_IDLETSSI, 0x7FFF, 0x8000);
+ b43_phy_mask(dev, B43_LPPHY_TX_PWR_CTL_DELTAPWR_LIMIT, 0xFF);
+ b43_phy_write(dev, B43_LPPHY_TX_PWR_CTL_DELTAPWR_LIMIT, 0xA);
+ b43_phy_maskset(dev, B43_LPPHY_TX_PWR_CTL_CMD,
+ (u16)~B43_LPPHY_TX_PWR_CTL_CMD_MODE,
+ B43_LPPHY_TX_PWR_CTL_CMD_MODE_OFF);
+ b43_phy_mask(dev, B43_LPPHY_TX_PWR_CTL_NNUM, 0xF8FF);
+ b43_phy_maskset(dev, B43_LPPHY_TX_PWR_CTL_CMD,
+ (u16)~B43_LPPHY_TX_PWR_CTL_CMD_MODE,
+ B43_LPPHY_TX_PWR_CTL_CMD_MODE_SW);
+
+ if (dev->phy.rev < 2) {
+ b43_phy_maskset(dev, B43_LPPHY_RF_OVERRIDE_0, 0xEFFF, 0x1000);
+ b43_phy_mask(dev, B43_LPPHY_RF_OVERRIDE_VAL_0, 0xEFFF);
+ } else {
+ lpphy_set_tx_power_by_index(dev, 0x7F);
+ }
+
+ b43_dummy_transmission(dev, true, true);
+
+ tmp = b43_phy_read(dev, B43_LPPHY_TX_PWR_CTL_STAT);
+ if (tmp & 0x8000) {
+ b43_phy_maskset(dev, B43_LPPHY_TX_PWR_CTL_IDLETSSI,
+ 0xFFC0, (tmp & 0xFF) - 32);
+ }
+
+ b43_phy_mask(dev, B43_LPPHY_RF_OVERRIDE_0, 0xEFFF);
+
+ // (SPEC?) TODO Set "Target TX frequency" variable to 0
+ // SPEC FIXME "Set BB Multiplier to 0xE000" impossible - bb_mult is u8!
+}
+
+static void lpphy_tx_pctl_init_sw(struct b43_wldev *dev)
+{
+ struct lpphy_tx_gains gains;
+
+ if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) {
+ gains.gm = 4;
+ gains.pad = 12;
+ gains.pga = 12;
+ gains.dac = 0;
+ } else {
+ gains.gm = 7;
+ gains.pad = 14;
+ gains.pga = 15;
+ gains.dac = 0;
+ }
+ lpphy_set_tx_gains(dev, gains);
+ lpphy_set_bb_mult(dev, 150);
+}
+
/* Initialize TX power control */
static void lpphy_tx_pctl_init(struct b43_wldev *dev)
{
if (0/*FIXME HWPCTL capable */) {
- //TODO
+ lpphy_tx_pctl_init_hw(dev);
} else { /* This device is only software TX power control capable. */
- if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) {
- //TODO
- } else {
- //TODO
- }
- //TODO set BB multiplier to 0x0096
+ lpphy_tx_pctl_init_sw(dev);
}
}
diff --git a/drivers/net/wireless/b43/phy_lp.h b/drivers/net/wireless/b43/phy_lp.h
index 0461d5b..4eab760 100644
--- a/drivers/net/wireless/b43/phy_lp.h
+++ b/drivers/net/wireless/b43/phy_lp.h
@@ -886,6 +886,11 @@ struct b43_phy_lp {
u16 dig_flt_state[9];
};
+enum tssi_mux_mode {
+ TSSI_MUX_PREPA,
+ TSSI_MUX_POSTPA,
+ TSSI_MUX_EXT,
+};
struct b43_phy_operations;
extern const struct b43_phy_operations b43_phyops_lp;
--
1.6.2.4
^ permalink raw reply related
* [RFC/RFT] b43: LP-PHY: Implement channel switching for rev2+/B2063 radio
From: Gábor Stefanik @ 2009-08-13 15:02 UTC (permalink / raw)
To: Michael Buesch, Larry Finger, John Linville
Cc: Broadcom Wireless, linux-wireless
Rev.2+/B2063 will now hopefully show some signs of life, though
it won't work at full performance, as calibration is still missing.
Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
---
If you have an LP-PHY device with the B2063 radio, please test!
Larry&Michael,
There is some pretty arcane stuff in op_switch_channel, please
review it closely!
drivers/net/wireless/b43/phy_lp.c | 395 ++++++++++++++++++++++++++++++++++++-
1 files changed, 390 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/b43/phy_lp.c b/drivers/net/wireless/b43/phy_lp.c
index b4e51f0..716bb87 100644
--- a/drivers/net/wireless/b43/phy_lp.c
+++ b/drivers/net/wireless/b43/phy_lp.c
@@ -142,10 +142,9 @@ static void lpphy_read_band_sprom(struct b43_wldev *dev)
}
}
-static void lpphy_adjust_gain_table(struct b43_wldev *dev)
+static void lpphy_adjust_gain_table(struct b43_wldev *dev, u32 freq)
{
struct b43_phy_lp *lpphy = dev->phy.lp;
- u32 freq = dev->wl->hw->conf.channel->center_freq;
u16 temp[3];
u16 isolation;
@@ -170,6 +169,8 @@ static void lpphy_adjust_gain_table(struct b43_wldev *dev)
static void lpphy_table_init(struct b43_wldev *dev)
{
+ u32 freq = dev->wl->hw->conf.channel->center_freq;
+
if (dev->phy.rev < 2)
lpphy_rev0_1_table_init(dev);
else
@@ -178,7 +179,7 @@ static void lpphy_table_init(struct b43_wldev *dev)
lpphy_init_tx_gain_table(dev);
if (dev->phy.rev < 2)
- lpphy_adjust_gain_table(dev);
+ lpphy_adjust_gain_table(dev, freq);
}
static void lpphy_baseband_rev0_1_init(struct b43_wldev *dev)
@@ -1369,7 +1370,7 @@ static int b43_lpphy_op_init(struct b43_wldev *dev)
lpphy_baseband_init(dev);
lpphy_radio_init(dev);
lpphy_calibrate_rc(dev);
- //TODO set channel
+ b43_switch_channel(dev, dev->wl->hw->conf.channel->hw_value);
lpphy_tx_pctl_init(dev);
lpphy_calibration(dev);
//TODO ACI init
@@ -1419,10 +1420,394 @@ static void b43_lpphy_op_software_rfkill(struct b43_wldev *dev,
//TODO
}
+static void lpphy_b2062_tune(struct b43_wldev *dev,
+ unsigned int channel)
+{
+ //TODO
+}
+
+struct b2063_channel {
+ u8 channel;
+ u16 freq;
+ u8 data[12];
+};
+
+static const struct b2063_channel b2063_chantbl[] = {
+ { .channel = 1, .freq = 2412, .data[0] = 0x6F, .data[1] = 0x3C,
+ .data[2] = 0x3C, .data[3] = 0x04, .data[4] = 0x05, .data[5] = 0x05,
+ .data[6] = 0x05, .data[7] = 0x05, .data[8] = 0x77, .data[9] = 0x80,
+ .data[10] = 0x80, .data[11] = 0x70, },
+ { .channel = 2, .freq = 2417, .data[0] = 0x6F, .data[1] = 0x3C,
+ .data[2] = 0x3C, .data[3] = 0x04, .data[4] = 0x05, .data[5] = 0x05,
+ .data[6] = 0x05, .data[7] = 0x05, .data[8] = 0x77, .data[9] = 0x80,
+ .data[10] = 0x80, .data[11] = 0x70, },
+ { .channel = 3, .freq = 2422, .data[0] = 0x6F, .data[1] = 0x3C,
+ .data[2] = 0x3C, .data[3] = 0x04, .data[4] = 0x05, .data[5] = 0x05,
+ .data[6] = 0x05, .data[7] = 0x05, .data[8] = 0x77, .data[9] = 0x80,
+ .data[10] = 0x80, .data[11] = 0x70, },
+ { .channel = 4, .freq = 2427, .data[0] = 0x6F, .data[1] = 0x2C,
+ .data[2] = 0x2C, .data[3] = 0x04, .data[4] = 0x05, .data[5] = 0x05,
+ .data[6] = 0x05, .data[7] = 0x05, .data[8] = 0x77, .data[9] = 0x80,
+ .data[10] = 0x80, .data[11] = 0x70, },
+ { .channel = 5, .freq = 2432, .data[0] = 0x6F, .data[1] = 0x2C,
+ .data[2] = 0x2C, .data[3] = 0x04, .data[4] = 0x05, .data[5] = 0x05,
+ .data[6] = 0x05, .data[7] = 0x05, .data[8] = 0x77, .data[9] = 0x80,
+ .data[10] = 0x80, .data[11] = 0x70, },
+ { .channel = 6, .freq = 2437, .data[0] = 0x6F, .data[1] = 0x2C,
+ .data[2] = 0x2C, .data[3] = 0x04, .data[4] = 0x05, .data[5] = 0x05,
+ .data[6] = 0x05, .data[7] = 0x05, .data[8] = 0x77, .data[9] = 0x80,
+ .data[10] = 0x80, .data[11] = 0x70, },
+ { .channel = 7, .freq = 2442, .data[0] = 0x6F, .data[1] = 0x2C,
+ .data[2] = 0x2C, .data[3] = 0x04, .data[4] = 0x05, .data[5] = 0x05,
+ .data[6] = 0x05, .data[7] = 0x05, .data[8] = 0x77, .data[9] = 0x80,
+ .data[10] = 0x80, .data[11] = 0x70, },
+ { .channel = 8, .freq = 2447, .data[0] = 0x6F, .data[1] = 0x2C,
+ .data[2] = 0x2C, .data[3] = 0x04, .data[4] = 0x05, .data[5] = 0x05,
+ .data[6] = 0x05, .data[7] = 0x05, .data[8] = 0x77, .data[9] = 0x80,
+ .data[10] = 0x80, .data[11] = 0x70, },
+ { .channel = 9, .freq = 2452, .data[0] = 0x6F, .data[1] = 0x1C,
+ .data[2] = 0x1C, .data[3] = 0x04, .data[4] = 0x05, .data[5] = 0x05,
+ .data[6] = 0x05, .data[7] = 0x05, .data[8] = 0x77, .data[9] = 0x80,
+ .data[10] = 0x80, .data[11] = 0x70, },
+ { .channel = 10, .freq = 2457, .data[0] = 0x6F, .data[1] = 0x1C,
+ .data[2] = 0x1C, .data[3] = 0x04, .data[4] = 0x05, .data[5] = 0x05,
+ .data[6] = 0x05, .data[7] = 0x05, .data[8] = 0x77, .data[9] = 0x80,
+ .data[10] = 0x80, .data[11] = 0x70, },
+ { .channel = 11, .freq = 2462, .data[0] = 0x6E, .data[1] = 0x1C,
+ .data[2] = 0x1C, .data[3] = 0x04, .data[4] = 0x05, .data[5] = 0x05,
+ .data[6] = 0x05, .data[7] = 0x05, .data[8] = 0x77, .data[9] = 0x80,
+ .data[10] = 0x80, .data[11] = 0x70, },
+ { .channel = 12, .freq = 2467, .data[0] = 0x6E, .data[1] = 0x1C,
+ .data[2] = 0x1C, .data[3] = 0x04, .data[4] = 0x05, .data[5] = 0x05,
+ .data[6] = 0x05, .data[7] = 0x05, .data[8] = 0x77, .data[9] = 0x80,
+ .data[10] = 0x80, .data[11] = 0x70, },
+ { .channel = 13, .freq = 2472, .data[0] = 0x6E, .data[1] = 0x1C,
+ .data[2] = 0x1C, .data[3] = 0x04, .data[4] = 0x05, .data[5] = 0x05,
+ .data[6] = 0x05, .data[7] = 0x05, .data[8] = 0x77, .data[9] = 0x80,
+ .data[10] = 0x80, .data[11] = 0x70, },
+ { .channel = 14, .freq = 2484, .data[0] = 0x6E, .data[1] = 0x0C,
+ .data[2] = 0x0C, .data[3] = 0x04, .data[4] = 0x05, .data[5] = 0x05,
+ .data[6] = 0x05, .data[7] = 0x05, .data[8] = 0x77, .data[9] = 0x80,
+ .data[10] = 0x80, .data[11] = 0x70, },
+ { .channel = 34, .freq = 5170, .data[0] = 0x6A, .data[1] = 0x0C,
+ .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x02, .data[5] = 0x05,
+ .data[6] = 0x0D, .data[7] = 0x0D, .data[8] = 0x77, .data[9] = 0x80,
+ .data[10] = 0x20, .data[11] = 0x00, },
+ { .channel = 38, .freq = 5190, .data[0] = 0x6A, .data[1] = 0x0C,
+ .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x01, .data[5] = 0x04,
+ .data[6] = 0x0C, .data[7] = 0x0C, .data[8] = 0x77, .data[9] = 0x80,
+ .data[10] = 0x20, .data[11] = 0x00, },
+ { .channel = 42, .freq = 5210, .data[0] = 0x69, .data[1] = 0x0C,
+ .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x01, .data[5] = 0x04,
+ .data[6] = 0x0B, .data[7] = 0x0C, .data[8] = 0x77, .data[9] = 0x70,
+ .data[10] = 0x20, .data[11] = 0x00, },
+ { .channel = 46, .freq = 5230, .data[0] = 0x69, .data[1] = 0x0C,
+ .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x03,
+ .data[6] = 0x0A, .data[7] = 0x0B, .data[8] = 0x77, .data[9] = 0x60,
+ .data[10] = 0x20, .data[11] = 0x00, },
+ { .channel = 36, .freq = 5180, .data[0] = 0x6A, .data[1] = 0x0C,
+ .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x01, .data[5] = 0x05,
+ .data[6] = 0x0D, .data[7] = 0x0C, .data[8] = 0x77, .data[9] = 0x80,
+ .data[10] = 0x20, .data[11] = 0x00, },
+ { .channel = 40, .freq = 5200, .data[0] = 0x69, .data[1] = 0x0C,
+ .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x01, .data[5] = 0x04,
+ .data[6] = 0x0C, .data[7] = 0x0C, .data[8] = 0x77, .data[9] = 0x70,
+ .data[10] = 0x20, .data[11] = 0x00, },
+ { .channel = 44, .freq = 5220, .data[0] = 0x69, .data[1] = 0x0C,
+ .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x04,
+ .data[6] = 0x0B, .data[7] = 0x0B, .data[8] = 0x77, .data[9] = 0x60,
+ .data[10] = 0x20, .data[11] = 0x00, },
+ { .channel = 48, .freq = 5240, .data[0] = 0x69, .data[1] = 0x0C,
+ .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x03,
+ .data[6] = 0x0A, .data[7] = 0x0A, .data[8] = 0x77, .data[9] = 0x60,
+ .data[10] = 0x20, .data[11] = 0x00, },
+ { .channel = 52, .freq = 5260, .data[0] = 0x68, .data[1] = 0x0C,
+ .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x02,
+ .data[6] = 0x09, .data[7] = 0x09, .data[8] = 0x77, .data[9] = 0x60,
+ .data[10] = 0x20, .data[11] = 0x00, },
+ { .channel = 56, .freq = 5280, .data[0] = 0x68, .data[1] = 0x0C,
+ .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x01,
+ .data[6] = 0x08, .data[7] = 0x08, .data[8] = 0x77, .data[9] = 0x50,
+ .data[10] = 0x10, .data[11] = 0x00, },
+ { .channel = 60, .freq = 5300, .data[0] = 0x68, .data[1] = 0x0C,
+ .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x01,
+ .data[6] = 0x08, .data[7] = 0x08, .data[8] = 0x77, .data[9] = 0x50,
+ .data[10] = 0x10, .data[11] = 0x00, },
+ { .channel = 64, .freq = 5320, .data[0] = 0x67, .data[1] = 0x0C,
+ .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x00,
+ .data[6] = 0x08, .data[7] = 0x08, .data[8] = 0x77, .data[9] = 0x50,
+ .data[10] = 0x10, .data[11] = 0x00, },
+ { .channel = 100, .freq = 5500, .data[0] = 0x64, .data[1] = 0x0C,
+ .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x00,
+ .data[6] = 0x02, .data[7] = 0x01, .data[8] = 0x77, .data[9] = 0x20,
+ .data[10] = 0x00, .data[11] = 0x00, },
+ { .channel = 104, .freq = 5520, .data[0] = 0x64, .data[1] = 0x0C,
+ .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x00,
+ .data[6] = 0x01, .data[7] = 0x01, .data[8] = 0x77, .data[9] = 0x20,
+ .data[10] = 0x00, .data[11] = 0x00, },
+ { .channel = 108, .freq = 5540, .data[0] = 0x63, .data[1] = 0x0C,
+ .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x00,
+ .data[6] = 0x01, .data[7] = 0x00, .data[8] = 0x77, .data[9] = 0x10,
+ .data[10] = 0x00, .data[11] = 0x00, },
+ { .channel = 112, .freq = 5560, .data[0] = 0x63, .data[1] = 0x0C,
+ .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x00,
+ .data[6] = 0x00, .data[7] = 0x00, .data[8] = 0x77, .data[9] = 0x10,
+ .data[10] = 0x00, .data[11] = 0x00, },
+ { .channel = 116, .freq = 5580, .data[0] = 0x62, .data[1] = 0x0C,
+ .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x00,
+ .data[6] = 0x00, .data[7] = 0x00, .data[8] = 0x77, .data[9] = 0x10,
+ .data[10] = 0x00, .data[11] = 0x00, },
+ { .channel = 120, .freq = 5600, .data[0] = 0x62, .data[1] = 0x0C,
+ .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x00,
+ .data[6] = 0x00, .data[7] = 0x00, .data[8] = 0x77, .data[9] = 0x00,
+ .data[10] = 0x00, .data[11] = 0x00, },
+ { .channel = 124, .freq = 5620, .data[0] = 0x62, .data[1] = 0x0C,
+ .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x00,
+ .data[6] = 0x00, .data[7] = 0x00, .data[8] = 0x77, .data[9] = 0x00,
+ .data[10] = 0x00, .data[11] = 0x00, },
+ { .channel = 128, .freq = 5640, .data[0] = 0x61, .data[1] = 0x0C,
+ .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x00,
+ .data[6] = 0x00, .data[7] = 0x00, .data[8] = 0x77, .data[9] = 0x00,
+ .data[10] = 0x00, .data[11] = 0x00, },
+ { .channel = 132, .freq = 5660, .data[0] = 0x61, .data[1] = 0x0C,
+ .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x00,
+ .data[6] = 0x00, .data[7] = 0x00, .data[8] = 0x77, .data[9] = 0x00,
+ .data[10] = 0x00, .data[11] = 0x00, },
+ { .channel = 136, .freq = 5680, .data[0] = 0x61, .data[1] = 0x0C,
+ .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x00,
+ .data[6] = 0x00, .data[7] = 0x00, .data[8] = 0x77, .data[9] = 0x00,
+ .data[10] = 0x00, .data[11] = 0x00, },
+ { .channel = 140, .freq = 5700, .data[0] = 0x60, .data[1] = 0x0C,
+ .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x00,
+ .data[6] = 0x00, .data[7] = 0x00, .data[8] = 0x77, .data[9] = 0x00,
+ .data[10] = 0x00, .data[11] = 0x00, },
+ { .channel = 149, .freq = 5745, .data[0] = 0x60, .data[1] = 0x0C,
+ .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x00,
+ .data[6] = 0x00, .data[7] = 0x00, .data[8] = 0x77, .data[9] = 0x00,
+ .data[10] = 0x00, .data[11] = 0x00, },
+ { .channel = 153, .freq = 5765, .data[0] = 0x60, .data[1] = 0x0C,
+ .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x00,
+ .data[6] = 0x00, .data[7] = 0x00, .data[8] = 0x77, .data[9] = 0x00,
+ .data[10] = 0x00, .data[11] = 0x00, },
+ { .channel = 157, .freq = 5785, .data[0] = 0x60, .data[1] = 0x0C,
+ .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x00,
+ .data[6] = 0x00, .data[7] = 0x00, .data[8] = 0x77, .data[9] = 0x00,
+ .data[10] = 0x00, .data[11] = 0x00, },
+ { .channel = 161, .freq = 5805, .data[0] = 0x60, .data[1] = 0x0C,
+ .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x00,
+ .data[6] = 0x00, .data[7] = 0x00, .data[8] = 0x77, .data[9] = 0x00,
+ .data[10] = 0x00, .data[11] = 0x00, },
+ { .channel = 165, .freq = 5825, .data[0] = 0x60, .data[1] = 0x0C,
+ .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x00,
+ .data[6] = 0x00, .data[7] = 0x00, .data[8] = 0x77, .data[9] = 0x00,
+ .data[10] = 0x00, .data[11] = 0x00, },
+ { .channel = 184, .freq = 4920, .data[0] = 0x6E, .data[1] = 0x0C,
+ .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x09, .data[5] = 0x0E,
+ .data[6] = 0x0F, .data[7] = 0x0F, .data[8] = 0x77, .data[9] = 0xC0,
+ .data[10] = 0x50, .data[11] = 0x00, },
+ { .channel = 188, .freq = 4940, .data[0] = 0x6E, .data[1] = 0x0C,
+ .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x09, .data[5] = 0x0D,
+ .data[6] = 0x0F, .data[7] = 0x0F, .data[8] = 0x77, .data[9] = 0xB0,
+ .data[10] = 0x50, .data[11] = 0x00, },
+ { .channel = 192, .freq = 4960, .data[0] = 0x6E, .data[1] = 0x0C,
+ .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x08, .data[5] = 0x0C,
+ .data[6] = 0x0F, .data[7] = 0x0F, .data[8] = 0x77, .data[9] = 0xB0,
+ .data[10] = 0x50, .data[11] = 0x00, },
+ { .channel = 196, .freq = 4980, .data[0] = 0x6D, .data[1] = 0x0C,
+ .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x08, .data[5] = 0x0C,
+ .data[6] = 0x0F, .data[7] = 0x0F, .data[8] = 0x77, .data[9] = 0xA0,
+ .data[10] = 0x40, .data[11] = 0x00, },
+ { .channel = 200, .freq = 5000, .data[0] = 0x6D, .data[1] = 0x0C,
+ .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x08, .data[5] = 0x0B,
+ .data[6] = 0x0F, .data[7] = 0x0F, .data[8] = 0x77, .data[9] = 0xA0,
+ .data[10] = 0x40, .data[11] = 0x00, },
+ { .channel = 204, .freq = 5020, .data[0] = 0x6D, .data[1] = 0x0C,
+ .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x08, .data[5] = 0x0A,
+ .data[6] = 0x0F, .data[7] = 0x0F, .data[8] = 0x77, .data[9] = 0xA0,
+ .data[10] = 0x40, .data[11] = 0x00, },
+ { .channel = 208, .freq = 5040, .data[0] = 0x6C, .data[1] = 0x0C,
+ .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x07, .data[5] = 0x09,
+ .data[6] = 0x0F, .data[7] = 0x0F, .data[8] = 0x77, .data[9] = 0x90,
+ .data[10] = 0x40, .data[11] = 0x00, },
+ { .channel = 212, .freq = 5060, .data[0] = 0x6C, .data[1] = 0x0C,
+ .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x06, .data[5] = 0x08,
+ .data[6] = 0x0F, .data[7] = 0x0F, .data[8] = 0x77, .data[9] = 0x90,
+ .data[10] = 0x40, .data[11] = 0x00, },
+ { .channel = 216, .freq = 5080, .data[0] = 0x6C, .data[1] = 0x0C,
+ .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x05, .data[5] = 0x08,
+ .data[6] = 0x0F, .data[7] = 0x0F, .data[8] = 0x77, .data[9] = 0x90,
+ .data[10] = 0x40, .data[11] = 0x00, },
+};
+
+static void lpphy_b2063_vco_calib(struct b43_wldev *dev)
+{
+ u16 tmp;
+
+ b43_phy_mask(dev, B2063_PLL_SP1, ~0x40);
+ tmp = b43_phy_read(dev, B2063_PLL_JTAG_CALNRST) & 0xF8;
+ b43_phy_write(dev, B2063_PLL_JTAG_CALNRST, tmp);
+ udelay(1);
+ b43_phy_write(dev, B2063_PLL_JTAG_CALNRST, tmp | 0x4);
+ udelay(1);
+ b43_phy_write(dev, B2063_PLL_JTAG_CALNRST, tmp | 0x6);
+ udelay(1);
+ b43_phy_write(dev, B2063_PLL_JTAG_CALNRST, tmp | 0x7);
+ udelay(300);
+ b43_phy_set(dev, B2063_PLL_SP1, 0x40);
+}
+
+static void lpphy_b2063_tune(struct b43_wldev *dev,
+ unsigned int channel)
+{
+ struct ssb_bus *bus = dev->dev->bus;
+
+ struct b2063_channel chandata;
+ u32 crystal_freq = bus->chipco.pmu.crystalfreq * 1000;
+ u32 freqref, vco_freq, val1, val2, val3, timeout, timeoutref, count;
+ u16 old_comm15, scale;
+ u32 tmp1, tmp2, tmp3, tmp4, tmp5, tmp6;
+ int i, div = (crystal_freq <= 26000000 ? 1 : 2);
+
+ memset(&chandata, 0, sizeof(chandata));
+
+ for (i = 0; i < ARRAY_SIZE(b2063_chantbl); i++) {
+ if (b2063_chantbl[i].channel == channel) {
+ chandata = b2063_chantbl[i];
+ break;
+ }
+ }
+
+ B43_WARN_ON(!chandata.channel);
+
+ b43_radio_write(dev, B2063_LOGEN_VCOBUF1, chandata.data[0]);
+ b43_radio_write(dev, B2063_LOGEN_MIXER2, chandata.data[1]);
+ b43_radio_write(dev, B2063_LOGEN_BUF2, chandata.data[2]);
+ b43_radio_write(dev, B2063_LOGEN_RCCR1, chandata.data[3]);
+ b43_radio_write(dev, B2063_A_RX_1ST3, chandata.data[4]);
+ b43_radio_write(dev, B2063_A_RX_2ND1, chandata.data[5]);
+ b43_radio_write(dev, B2063_A_RX_2ND4, chandata.data[6]);
+ b43_radio_write(dev, B2063_A_RX_2ND7, chandata.data[7]);
+ b43_radio_write(dev, B2063_A_RX_PS6, chandata.data[8]);
+ b43_radio_write(dev, B2063_TX_RF_CTL2, chandata.data[9]);
+ b43_radio_write(dev, B2063_TX_RF_CTL5, chandata.data[10]);
+ b43_radio_write(dev, B2063_PA_CTL11, chandata.data[11]);
+
+ old_comm15 = b43_radio_read(dev, B2063_COMM15);
+ b43_radio_set(dev, B2063_COMM15, 0x1E);
+
+ if (chandata.freq > 4000) /* spec says 2484, but 4000 is safer */
+ vco_freq = chandata.freq << 1;
+ else
+ vco_freq = chandata.freq << 2;
+
+ freqref = crystal_freq * 3;
+ val1 = lpphy_qdiv_roundup(crystal_freq, 1000000, 16);
+ val2 = lpphy_qdiv_roundup(crystal_freq, 1000000 * div, 16);
+ val3 = lpphy_qdiv_roundup(vco_freq, 3, 16);
+ timeout = ((((8 * crystal_freq) / (div * 5000000)) + 1) >> 1) - 1;
+ b43_radio_write(dev, B2063_PLL_JTAG_PLL_VCO_CALIB3, 0x2);
+ b43_radio_maskset(dev, B2063_PLL_JTAG_PLL_VCO_CALIB6,
+ 0xFFF8, timeout >> 2);
+ b43_radio_maskset(dev, B2063_PLL_JTAG_PLL_VCO_CALIB7,
+ 0xFF9F,timeout << 5);
+
+ timeoutref = ((((8 * crystal_freq) / (div * (timeout + 1))) +
+ 999999) / 1000000) + 1;
+ b43_radio_write(dev, B2063_PLL_JTAG_PLL_VCO_CALIB5, timeoutref);
+
+ count = lpphy_qdiv_roundup(val3, val2 + 16, 16);
+ count *= (timeout + 1) * (timeoutref + 1);
+ count--;
+ b43_radio_maskset(dev, B2063_PLL_JTAG_PLL_VCO_CALIB7,
+ 0xF0, count >> 8);
+ b43_radio_write(dev, B2063_PLL_JTAG_PLL_VCO_CALIB8, count & 0xFF);
+
+ tmp1 = ((val3 * 62500) / freqref) << 4;
+ tmp2 = ((val3 * 62500) % freqref) << 4;
+ while (tmp2 >= freqref) {
+ tmp1++;
+ tmp2 -= freqref;
+ }
+ b43_radio_maskset(dev, B2063_PLL_JTAG_PLL_SG1, 0xFFE0, tmp1 >> 4);
+ b43_radio_maskset(dev, B2063_PLL_JTAG_PLL_SG2, 0xFE0F, tmp1 << 4);
+ b43_radio_maskset(dev, B2063_PLL_JTAG_PLL_SG2, 0xFFF0, tmp1 >> 16);
+ b43_radio_write(dev, B2063_PLL_JTAG_PLL_SG3, (tmp2 >> 8) & 0xFF);
+ b43_radio_write(dev, B2063_PLL_JTAG_PLL_SG4, tmp2 & 0xFF);
+
+ b43_radio_write(dev, B2063_PLL_JTAG_PLL_LF1, 0xB9);
+ b43_radio_write(dev, B2063_PLL_JTAG_PLL_LF2, 0x88);
+ b43_radio_write(dev, B2063_PLL_JTAG_PLL_LF3, 0x28);
+ b43_radio_write(dev, B2063_PLL_JTAG_PLL_LF4, 0x63);
+
+ tmp3 = ((41 * (val3 - 3000)) /1200) + 27;
+ tmp4 = lpphy_qdiv_roundup(132000 * tmp1, 8451, 16);
+
+ if ((tmp4 + tmp3 - 1) / tmp3 > 60) {
+ scale = 1;
+ tmp5 = ((tmp4 + tmp3) / (tmp3 << 1)) - 8;
+ } else {
+ scale = 0;
+ tmp5 = ((tmp4 + (tmp3 >> 1)) / tmp3) - 8;
+ }
+ b43_phy_maskset(dev, B2063_PLL_JTAG_PLL_CP2, 0xFFC0, tmp5);
+ b43_phy_maskset(dev, B2063_PLL_JTAG_PLL_CP2, 0xFFBF, scale << 6);
+
+ tmp6 = lpphy_qdiv_roundup(100 * val1, val3, 16);
+ tmp6 *= (tmp5 * 8) * (scale + 1);
+ if (tmp6 > 150)
+ tmp6 = 0;
+
+ b43_phy_maskset(dev, B2063_PLL_JTAG_PLL_CP3, 0xFFE0, tmp6);
+ b43_phy_maskset(dev, B2063_PLL_JTAG_PLL_CP3, 0xFFDF, scale << 5);
+
+ b43_phy_maskset(dev, B2063_PLL_JTAG_PLL_XTAL_12, 0xFFFB, 0x4);
+ if (crystal_freq > 26000000)
+ b43_phy_set(dev, B2063_PLL_JTAG_PLL_XTAL_12, 0x2);
+ else
+ b43_phy_mask(dev, B2063_PLL_JTAG_PLL_XTAL_12, 0xFD);
+
+ if (val1 == 45)
+ b43_phy_set(dev, B2063_PLL_JTAG_PLL_VCO1, 0x2);
+ else
+ b43_phy_mask(dev, B2063_PLL_JTAG_PLL_VCO1, 0xFD);
+
+ b43_phy_set(dev, B2063_PLL_SP2, 0x3);
+ udelay(1);
+ b43_phy_mask(dev, B2063_PLL_SP2, 0xFFFC);
+ lpphy_b2063_vco_calib(dev);
+ b43_radio_write(dev, B2063_COMM15, old_comm15);
+}
+
static int b43_lpphy_op_switch_channel(struct b43_wldev *dev,
unsigned int new_channel)
{
- //TODO
+ struct b2063_channel chandata;
+ int i;
+
+ memset(&chandata, 0, sizeof(chandata));
+
+ //FIXME this abuses the 2063 channel table for chan2freq purposes!
+ for (i = 0; i < ARRAY_SIZE(b2063_chantbl); i++) {
+ if (b2063_chantbl[i].channel == new_channel) {
+ chandata = b2063_chantbl[i];
+ break;
+ }
+ }
+
+ B43_WARN_ON(!chandata.channel);
+
+ /* FIXME this should be the last thing done, even after generic
+ * parts - does it matter?
+ * SPEC FIXME should this write channel, freq, chanspec or cookie?
+ */
+ b43_write16(dev, B43_MMIO_CHANNEL, new_channel);
+ if (dev->phy.radio_ver == 0x2063) {
+ lpphy_b2063_tune(dev, new_channel);
+ } else {
+ lpphy_b2062_tune(dev, new_channel);
+ //TODO Japan filter
+ }
+ lpphy_adjust_gain_table(dev, chandata.freq);
return 0;
}
--
1.6.2.4
^ permalink raw reply related
* Re: [PATCH v2] b43: LP-PHY: Initialize TX power control
From: Larry Finger @ 2009-08-13 15:06 UTC (permalink / raw)
To: Gábor Stefanik
Cc: John Linville, Michael Buesch, Broadcom Wireless, linux-wireless
In-Reply-To: <4A842934.2060206@gmail.com>
Gábor Stefanik wrote:
> The HW TX power control init still needs work.
> The SW init is complete according to the specs.
>
> Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
> ---
> v2: Address Michael's comments, and update for the dummy transmission
> changes.
>
> This depends on both the rev0/1 RC calibration patch and the
> updated V4 dummy transmission patch I submitted earlier.
>
> Larry, please review the SPEC TODO/SPEC FIXME comments!
>
> drivers/net/wireless/b43/phy_lp.c | 105
> ++++++++++++++++++++++++++++++++++---
> drivers/net/wireless/b43/phy_lp.h | 5 ++
> 2 files changed, 103 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/wireless/b43/phy_lp.c
> b/drivers/net/wireless/b43/phy_lp.c
> index 2441a8d..b4e51f0 100644
> --- a/drivers/net/wireless/b43/phy_lp.c
> +++ b/drivers/net/wireless/b43/phy_lp.c
> @@ -1257,18 +1257,109 @@ static void lpphy_calibration(struct b43_wldev
> *dev)
> b43_mac_enable(dev);
> }
>
> +static void lpphy_set_tssi_mux(struct b43_wldev *dev, enum
> tssi_mux_mode mode)
> +{
> + if (mode != TSSI_MUX_EXT) {
> + b43_radio_set(dev, B2063_PA_SP1, 0x2);
> + b43_phy_set(dev, B43_PHY_OFDM(0xF3), 0x1000);
> + b43_radio_write(dev, B2063_PA_CTL10, 0x51);
> + if (mode == TSSI_MUX_POSTPA) {
> + b43_radio_mask(dev, B2063_PA_SP1, 0xFFFE);
> + b43_phy_mask(dev, B43_LPPHY_AFE_CTL_OVRVAL, 0xFFC7);
> + } else {
> + b43_radio_maskset(dev, B2063_PA_SP1, 0xFFFE, 0x1);
> + b43_phy_maskset(dev, B43_LPPHY_AFE_CTL_OVRVAL,
> + 0xFFC7, 0x20);
> + }
> + } else {
> + //SPEC TODO
Put a WARN_ON(1) here. This branch would be an error. No, I don't
understand it either!
Larry
^ permalink raw reply
* [PATCH v3] b43: LP-PHY: Initialize TX power control
From: Gábor Stefanik @ 2009-08-13 15:27 UTC (permalink / raw)
To: John Linville, Michael Buesch, Larry Finger
Cc: Broadcom Wireless, linux-wireless
The HW TX power control init still needs work.
The SW init is complete according to the specs.
Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
---
v3: WARN_ON() setting TSSI mux mode to Ext, per Larry's suggestion.
v2: Address Michael's comments, and update for the dummy transmission changes.
This depends on both the rev0/1 RC calibration patch and the
updated V4 dummy transmission patch I submitted earlier.
Larry, please review the SPEC TODO/SPEC FIXME comments!
drivers/net/wireless/b43/phy_lp.c | 105 ++++++++++++++++++++++++++++++++++---
drivers/net/wireless/b43/phy_lp.h | 5 ++
2 files changed, 103 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/b43/phy_lp.c b/drivers/net/wireless/b43/phy_lp.c
index 2441a8d..b4e51f0 100644
--- a/drivers/net/wireless/b43/phy_lp.c
+++ b/drivers/net/wireless/b43/phy_lp.c
@@ -1257,18 +1257,109 @@ static void lpphy_calibration(struct b43_wldev *dev)
b43_mac_enable(dev);
}
+static void lpphy_set_tssi_mux(struct b43_wldev *dev, enum tssi_mux_mode mode)
+{
+ if (mode != TSSI_MUX_EXT) {
+ b43_radio_set(dev, B2063_PA_SP1, 0x2);
+ b43_phy_set(dev, B43_PHY_OFDM(0xF3), 0x1000);
+ b43_radio_write(dev, B2063_PA_CTL10, 0x51);
+ if (mode == TSSI_MUX_POSTPA) {
+ b43_radio_mask(dev, B2063_PA_SP1, 0xFFFE);
+ b43_phy_mask(dev, B43_LPPHY_AFE_CTL_OVRVAL, 0xFFC7);
+ } else {
+ b43_radio_maskset(dev, B2063_PA_SP1, 0xFFFE, 0x1);
+ b43_phy_maskset(dev, B43_LPPHY_AFE_CTL_OVRVAL,
+ 0xFFC7, 0x20);
+ }
+ } else {
+ B43_WARN_ON(1);
+ }
+}
+
+static void lpphy_tx_pctl_init_hw(struct b43_wldev *dev)
+{
+ u16 tmp;
+ int i;
+
+ //SPEC TODO Call LP PHY Clear TX Power offsets
+ for (i = 0; i < 64; i++) {
+ if (dev->phy.rev >= 2)
+ b43_lptab_write(dev, B43_LPTAB32(7, i + 1), i);
+ else
+ b43_lptab_write(dev, B43_LPTAB32(10, i + 1), i);
+ }
+
+ b43_phy_maskset(dev, B43_LPPHY_TX_PWR_CTL_NNUM, 0xFF00, 0xFF);
+ b43_phy_maskset(dev, B43_LPPHY_TX_PWR_CTL_NNUM, 0x8FFF, 0x5000);
+ b43_phy_maskset(dev, B43_LPPHY_TX_PWR_CTL_IDLETSSI, 0xFFC0, 0x1F);
+ if (dev->phy.rev < 2) {
+ b43_phy_mask(dev, B43_LPPHY_LP_PHY_CTL, 0xEFFF);
+ b43_phy_maskset(dev, B43_LPPHY_LP_PHY_CTL, 0xDFFF, 0x2000);
+ } else {
+ b43_phy_mask(dev, B43_PHY_OFDM(0x103), 0xFFFE);
+ b43_phy_maskset(dev, B43_PHY_OFDM(0x103), 0xFFFB, 0x4);
+ b43_phy_maskset(dev, B43_PHY_OFDM(0x103), 0xFFEF, 0x10);
+ b43_radio_maskset(dev, B2063_IQ_CALIB_CTL2, 0xF3, 0x1);
+ lpphy_set_tssi_mux(dev, TSSI_MUX_POSTPA);
+ }
+ b43_phy_maskset(dev, B43_LPPHY_TX_PWR_CTL_IDLETSSI, 0x7FFF, 0x8000);
+ b43_phy_mask(dev, B43_LPPHY_TX_PWR_CTL_DELTAPWR_LIMIT, 0xFF);
+ b43_phy_write(dev, B43_LPPHY_TX_PWR_CTL_DELTAPWR_LIMIT, 0xA);
+ b43_phy_maskset(dev, B43_LPPHY_TX_PWR_CTL_CMD,
+ (u16)~B43_LPPHY_TX_PWR_CTL_CMD_MODE,
+ B43_LPPHY_TX_PWR_CTL_CMD_MODE_OFF);
+ b43_phy_mask(dev, B43_LPPHY_TX_PWR_CTL_NNUM, 0xF8FF);
+ b43_phy_maskset(dev, B43_LPPHY_TX_PWR_CTL_CMD,
+ (u16)~B43_LPPHY_TX_PWR_CTL_CMD_MODE,
+ B43_LPPHY_TX_PWR_CTL_CMD_MODE_SW);
+
+ if (dev->phy.rev < 2) {
+ b43_phy_maskset(dev, B43_LPPHY_RF_OVERRIDE_0, 0xEFFF, 0x1000);
+ b43_phy_mask(dev, B43_LPPHY_RF_OVERRIDE_VAL_0, 0xEFFF);
+ } else {
+ lpphy_set_tx_power_by_index(dev, 0x7F);
+ }
+
+ b43_dummy_transmission(dev, true, true);
+
+ tmp = b43_phy_read(dev, B43_LPPHY_TX_PWR_CTL_STAT);
+ if (tmp & 0x8000) {
+ b43_phy_maskset(dev, B43_LPPHY_TX_PWR_CTL_IDLETSSI,
+ 0xFFC0, (tmp & 0xFF) - 32);
+ }
+
+ b43_phy_mask(dev, B43_LPPHY_RF_OVERRIDE_0, 0xEFFF);
+
+ // (SPEC?) TODO Set "Target TX frequency" variable to 0
+ // SPEC FIXME "Set BB Multiplier to 0xE000" impossible - bb_mult is u8!
+}
+
+static void lpphy_tx_pctl_init_sw(struct b43_wldev *dev)
+{
+ struct lpphy_tx_gains gains;
+
+ if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) {
+ gains.gm = 4;
+ gains.pad = 12;
+ gains.pga = 12;
+ gains.dac = 0;
+ } else {
+ gains.gm = 7;
+ gains.pad = 14;
+ gains.pga = 15;
+ gains.dac = 0;
+ }
+ lpphy_set_tx_gains(dev, gains);
+ lpphy_set_bb_mult(dev, 150);
+}
+
/* Initialize TX power control */
static void lpphy_tx_pctl_init(struct b43_wldev *dev)
{
if (0/*FIXME HWPCTL capable */) {
- //TODO
+ lpphy_tx_pctl_init_hw(dev);
} else { /* This device is only software TX power control capable. */
- if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) {
- //TODO
- } else {
- //TODO
- }
- //TODO set BB multiplier to 0x0096
+ lpphy_tx_pctl_init_sw(dev);
}
}
diff --git a/drivers/net/wireless/b43/phy_lp.h b/drivers/net/wireless/b43/phy_lp.h
index 0461d5b..4eab760 100644
--- a/drivers/net/wireless/b43/phy_lp.h
+++ b/drivers/net/wireless/b43/phy_lp.h
@@ -886,6 +886,11 @@ struct b43_phy_lp {
u16 dig_flt_state[9];
};
+enum tssi_mux_mode {
+ TSSI_MUX_PREPA,
+ TSSI_MUX_POSTPA,
+ TSSI_MUX_EXT,
+};
struct b43_phy_operations;
extern const struct b43_phy_operations b43_phyops_lp;
--
1.6.2.4
^ permalink raw reply related
* Re: [RFC/RFT] b43: LP-PHY: Implement channel switching for rev2+/B2063 radio
From: Larry Finger @ 2009-08-13 15:45 UTC (permalink / raw)
To: Gábor Stefanik
Cc: Michael Buesch, John Linville, Broadcom Wireless, linux-wireless
In-Reply-To: <4A842AFD.1020903@gmail.com>
Gábor Stefanik wrote:
> Rev.2+/B2063 will now hopefully show some signs of life, though
> it won't work at full performance, as calibration is still missing.
>
> Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
> ---
> If you have an LP-PHY device with the B2063 radio, please test!
>
> Larry&Michael,
> There is some pretty arcane stuff in op_switch_channel, please
> review it closely!
>
> drivers/net/wireless/b43/phy_lp.c | 395
> ++++++++++++++++++++++++++++++++++++-
> 1 files changed, 390 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/wireless/b43/phy_lp.c
> b/drivers/net/wireless/b43/phy_lp.c
> index b4e51f0..716bb87 100644
> --- a/drivers/net/wireless/b43/phy_lp.c
> +++ b/drivers/net/wireless/b43/phy_lp.c
> @@ -142,10 +142,9 @@ static void lpphy_read_band_sprom(struct b43_wldev
> *dev)
> }
> }
>
> -static void lpphy_adjust_gain_table(struct b43_wldev *dev)
> +static void lpphy_adjust_gain_table(struct b43_wldev *dev, u32 freq)
> {
> struct b43_phy_lp *lpphy = dev->phy.lp;
> - u32 freq = dev->wl->hw->conf.channel->center_freq;
> u16 temp[3];
> u16 isolation;
>
> @@ -170,6 +169,8 @@ static void lpphy_adjust_gain_table(struct b43_wldev
> *dev)
>
> static void lpphy_table_init(struct b43_wldev *dev)
> {
> + u32 freq = dev->wl->hw->conf.channel->center_freq;
> +
> if (dev->phy.rev < 2)
> lpphy_rev0_1_table_init(dev);
> else
> @@ -178,7 +179,7 @@ static void lpphy_table_init(struct b43_wldev *dev)
> lpphy_init_tx_gain_table(dev);
>
> if (dev->phy.rev < 2)
> - lpphy_adjust_gain_table(dev);
> + lpphy_adjust_gain_table(dev, freq);
> }
>
> static void lpphy_baseband_rev0_1_init(struct b43_wldev *dev)
> @@ -1369,7 +1370,7 @@ static int b43_lpphy_op_init(struct b43_wldev *dev)
> lpphy_baseband_init(dev);
> lpphy_radio_init(dev);
> lpphy_calibrate_rc(dev);
> - //TODO set channel
> + b43_switch_channel(dev, dev->wl->hw->conf.channel->hw_value);
> lpphy_tx_pctl_init(dev);
> lpphy_calibration(dev);
> //TODO ACI init
> @@ -1419,10 +1420,394 @@ static void b43_lpphy_op_software_rfkill(struct
> b43_wldev *dev,
> //TODO
> }
>
> +static void lpphy_b2062_tune(struct b43_wldev *dev,
> + unsigned int channel)
> +{
> + //TODO
> +}
> +
> +struct b2063_channel {
> + u8 channel;
> + u16 freq;
> + u8 data[12];
> +};
> +
> +static const struct b2063_channel b2063_chantbl[] = {
> + { .channel = 1, .freq = 2412, .data[0] = 0x6F, .data[1] = 0x3C,
> + .data[2] = 0x3C, .data[3] = 0x04, .data[4] = 0x05, .data[5] = 0x05,
> + .data[6] = 0x05, .data[7] = 0x05, .data[8] = 0x77, .data[9] = 0x80,
> + .data[10] = 0x80, .data[11] = 0x70, },
> + { .channel = 2, .freq = 2417, .data[0] = 0x6F, .data[1] = 0x3C,
> + .data[2] = 0x3C, .data[3] = 0x04, .data[4] = 0x05, .data[5] = 0x05,
> + .data[6] = 0x05, .data[7] = 0x05, .data[8] = 0x77, .data[9] = 0x80,
> + .data[10] = 0x80, .data[11] = 0x70, },
> + { .channel = 3, .freq = 2422, .data[0] = 0x6F, .data[1] = 0x3C,
> + .data[2] = 0x3C, .data[3] = 0x04, .data[4] = 0x05, .data[5] = 0x05,
> + .data[6] = 0x05, .data[7] = 0x05, .data[8] = 0x77, .data[9] = 0x80,
> + .data[10] = 0x80, .data[11] = 0x70, },
> + { .channel = 4, .freq = 2427, .data[0] = 0x6F, .data[1] = 0x2C,
> + .data[2] = 0x2C, .data[3] = 0x04, .data[4] = 0x05, .data[5] = 0x05,
> + .data[6] = 0x05, .data[7] = 0x05, .data[8] = 0x77, .data[9] = 0x80,
> + .data[10] = 0x80, .data[11] = 0x70, },
> + { .channel = 5, .freq = 2432, .data[0] = 0x6F, .data[1] = 0x2C,
> + .data[2] = 0x2C, .data[3] = 0x04, .data[4] = 0x05, .data[5] = 0x05,
> + .data[6] = 0x05, .data[7] = 0x05, .data[8] = 0x77, .data[9] = 0x80,
> + .data[10] = 0x80, .data[11] = 0x70, },
> + { .channel = 6, .freq = 2437, .data[0] = 0x6F, .data[1] = 0x2C,
> + .data[2] = 0x2C, .data[3] = 0x04, .data[4] = 0x05, .data[5] = 0x05,
> + .data[6] = 0x05, .data[7] = 0x05, .data[8] = 0x77, .data[9] = 0x80,
> + .data[10] = 0x80, .data[11] = 0x70, },
> + { .channel = 7, .freq = 2442, .data[0] = 0x6F, .data[1] = 0x2C,
> + .data[2] = 0x2C, .data[3] = 0x04, .data[4] = 0x05, .data[5] = 0x05,
> + .data[6] = 0x05, .data[7] = 0x05, .data[8] = 0x77, .data[9] = 0x80,
> + .data[10] = 0x80, .data[11] = 0x70, },
> + { .channel = 8, .freq = 2447, .data[0] = 0x6F, .data[1] = 0x2C,
> + .data[2] = 0x2C, .data[3] = 0x04, .data[4] = 0x05, .data[5] = 0x05,
> + .data[6] = 0x05, .data[7] = 0x05, .data[8] = 0x77, .data[9] = 0x80,
> + .data[10] = 0x80, .data[11] = 0x70, },
> + { .channel = 9, .freq = 2452, .data[0] = 0x6F, .data[1] = 0x1C,
> + .data[2] = 0x1C, .data[3] = 0x04, .data[4] = 0x05, .data[5] = 0x05,
> + .data[6] = 0x05, .data[7] = 0x05, .data[8] = 0x77, .data[9] = 0x80,
> + .data[10] = 0x80, .data[11] = 0x70, },
> + { .channel = 10, .freq = 2457, .data[0] = 0x6F, .data[1] = 0x1C,
> + .data[2] = 0x1C, .data[3] = 0x04, .data[4] = 0x05, .data[5] = 0x05,
> + .data[6] = 0x05, .data[7] = 0x05, .data[8] = 0x77, .data[9] = 0x80,
> + .data[10] = 0x80, .data[11] = 0x70, },
> + { .channel = 11, .freq = 2462, .data[0] = 0x6E, .data[1] = 0x1C,
> + .data[2] = 0x1C, .data[3] = 0x04, .data[4] = 0x05, .data[5] = 0x05,
> + .data[6] = 0x05, .data[7] = 0x05, .data[8] = 0x77, .data[9] = 0x80,
> + .data[10] = 0x80, .data[11] = 0x70, },
> + { .channel = 12, .freq = 2467, .data[0] = 0x6E, .data[1] = 0x1C,
> + .data[2] = 0x1C, .data[3] = 0x04, .data[4] = 0x05, .data[5] = 0x05,
> + .data[6] = 0x05, .data[7] = 0x05, .data[8] = 0x77, .data[9] = 0x80,
> + .data[10] = 0x80, .data[11] = 0x70, },
> + { .channel = 13, .freq = 2472, .data[0] = 0x6E, .data[1] = 0x1C,
> + .data[2] = 0x1C, .data[3] = 0x04, .data[4] = 0x05, .data[5] = 0x05,
> + .data[6] = 0x05, .data[7] = 0x05, .data[8] = 0x77, .data[9] = 0x80,
> + .data[10] = 0x80, .data[11] = 0x70, },
> + { .channel = 14, .freq = 2484, .data[0] = 0x6E, .data[1] = 0x0C,
> + .data[2] = 0x0C, .data[3] = 0x04, .data[4] = 0x05, .data[5] = 0x05,
> + .data[6] = 0x05, .data[7] = 0x05, .data[8] = 0x77, .data[9] = 0x80,
> + .data[10] = 0x80, .data[11] = 0x70, },
> + { .channel = 34, .freq = 5170, .data[0] = 0x6A, .data[1] = 0x0C,
> + .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x02, .data[5] = 0x05,
> + .data[6] = 0x0D, .data[7] = 0x0D, .data[8] = 0x77, .data[9] = 0x80,
> + .data[10] = 0x20, .data[11] = 0x00, },
> + { .channel = 38, .freq = 5190, .data[0] = 0x6A, .data[1] = 0x0C,
> + .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x01, .data[5] = 0x04,
> + .data[6] = 0x0C, .data[7] = 0x0C, .data[8] = 0x77, .data[9] = 0x80,
> + .data[10] = 0x20, .data[11] = 0x00, },
> + { .channel = 42, .freq = 5210, .data[0] = 0x69, .data[1] = 0x0C,
> + .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x01, .data[5] = 0x04,
> + .data[6] = 0x0B, .data[7] = 0x0C, .data[8] = 0x77, .data[9] = 0x70,
> + .data[10] = 0x20, .data[11] = 0x00, },
> + { .channel = 46, .freq = 5230, .data[0] = 0x69, .data[1] = 0x0C,
> + .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x03,
> + .data[6] = 0x0A, .data[7] = 0x0B, .data[8] = 0x77, .data[9] = 0x60,
> + .data[10] = 0x20, .data[11] = 0x00, },
> + { .channel = 36, .freq = 5180, .data[0] = 0x6A, .data[1] = 0x0C,
> + .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x01, .data[5] = 0x05,
> + .data[6] = 0x0D, .data[7] = 0x0C, .data[8] = 0x77, .data[9] = 0x80,
> + .data[10] = 0x20, .data[11] = 0x00, },
> + { .channel = 40, .freq = 5200, .data[0] = 0x69, .data[1] = 0x0C,
> + .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x01, .data[5] = 0x04,
> + .data[6] = 0x0C, .data[7] = 0x0C, .data[8] = 0x77, .data[9] = 0x70,
> + .data[10] = 0x20, .data[11] = 0x00, },
> + { .channel = 44, .freq = 5220, .data[0] = 0x69, .data[1] = 0x0C,
> + .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x04,
> + .data[6] = 0x0B, .data[7] = 0x0B, .data[8] = 0x77, .data[9] = 0x60,
> + .data[10] = 0x20, .data[11] = 0x00, },
> + { .channel = 48, .freq = 5240, .data[0] = 0x69, .data[1] = 0x0C,
> + .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x03,
> + .data[6] = 0x0A, .data[7] = 0x0A, .data[8] = 0x77, .data[9] = 0x60,
> + .data[10] = 0x20, .data[11] = 0x00, },
> + { .channel = 52, .freq = 5260, .data[0] = 0x68, .data[1] = 0x0C,
> + .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x02,
> + .data[6] = 0x09, .data[7] = 0x09, .data[8] = 0x77, .data[9] = 0x60,
> + .data[10] = 0x20, .data[11] = 0x00, },
> + { .channel = 56, .freq = 5280, .data[0] = 0x68, .data[1] = 0x0C,
> + .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x01,
> + .data[6] = 0x08, .data[7] = 0x08, .data[8] = 0x77, .data[9] = 0x50,
> + .data[10] = 0x10, .data[11] = 0x00, },
> + { .channel = 60, .freq = 5300, .data[0] = 0x68, .data[1] = 0x0C,
> + .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x01,
> + .data[6] = 0x08, .data[7] = 0x08, .data[8] = 0x77, .data[9] = 0x50,
> + .data[10] = 0x10, .data[11] = 0x00, },
> + { .channel = 64, .freq = 5320, .data[0] = 0x67, .data[1] = 0x0C,
> + .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x00,
> + .data[6] = 0x08, .data[7] = 0x08, .data[8] = 0x77, .data[9] = 0x50,
> + .data[10] = 0x10, .data[11] = 0x00, },
> + { .channel = 100, .freq = 5500, .data[0] = 0x64, .data[1] = 0x0C,
> + .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x00,
> + .data[6] = 0x02, .data[7] = 0x01, .data[8] = 0x77, .data[9] = 0x20,
> + .data[10] = 0x00, .data[11] = 0x00, },
> + { .channel = 104, .freq = 5520, .data[0] = 0x64, .data[1] = 0x0C,
> + .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x00,
> + .data[6] = 0x01, .data[7] = 0x01, .data[8] = 0x77, .data[9] = 0x20,
> + .data[10] = 0x00, .data[11] = 0x00, },
> + { .channel = 108, .freq = 5540, .data[0] = 0x63, .data[1] = 0x0C,
> + .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x00,
> + .data[6] = 0x01, .data[7] = 0x00, .data[8] = 0x77, .data[9] = 0x10,
> + .data[10] = 0x00, .data[11] = 0x00, },
> + { .channel = 112, .freq = 5560, .data[0] = 0x63, .data[1] = 0x0C,
> + .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x00,
> + .data[6] = 0x00, .data[7] = 0x00, .data[8] = 0x77, .data[9] = 0x10,
> + .data[10] = 0x00, .data[11] = 0x00, },
> + { .channel = 116, .freq = 5580, .data[0] = 0x62, .data[1] = 0x0C,
> + .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x00,
> + .data[6] = 0x00, .data[7] = 0x00, .data[8] = 0x77, .data[9] = 0x10,
> + .data[10] = 0x00, .data[11] = 0x00, },
> + { .channel = 120, .freq = 5600, .data[0] = 0x62, .data[1] = 0x0C,
> + .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x00,
> + .data[6] = 0x00, .data[7] = 0x00, .data[8] = 0x77, .data[9] = 0x00,
> + .data[10] = 0x00, .data[11] = 0x00, },
> + { .channel = 124, .freq = 5620, .data[0] = 0x62, .data[1] = 0x0C,
> + .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x00,
> + .data[6] = 0x00, .data[7] = 0x00, .data[8] = 0x77, .data[9] = 0x00,
> + .data[10] = 0x00, .data[11] = 0x00, },
> + { .channel = 128, .freq = 5640, .data[0] = 0x61, .data[1] = 0x0C,
> + .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x00,
> + .data[6] = 0x00, .data[7] = 0x00, .data[8] = 0x77, .data[9] = 0x00,
> + .data[10] = 0x00, .data[11] = 0x00, },
> + { .channel = 132, .freq = 5660, .data[0] = 0x61, .data[1] = 0x0C,
> + .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x00,
> + .data[6] = 0x00, .data[7] = 0x00, .data[8] = 0x77, .data[9] = 0x00,
> + .data[10] = 0x00, .data[11] = 0x00, },
> + { .channel = 136, .freq = 5680, .data[0] = 0x61, .data[1] = 0x0C,
> + .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x00,
> + .data[6] = 0x00, .data[7] = 0x00, .data[8] = 0x77, .data[9] = 0x00,
> + .data[10] = 0x00, .data[11] = 0x00, },
> + { .channel = 140, .freq = 5700, .data[0] = 0x60, .data[1] = 0x0C,
> + .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x00,
> + .data[6] = 0x00, .data[7] = 0x00, .data[8] = 0x77, .data[9] = 0x00,
> + .data[10] = 0x00, .data[11] = 0x00, },
> + { .channel = 149, .freq = 5745, .data[0] = 0x60, .data[1] = 0x0C,
> + .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x00,
> + .data[6] = 0x00, .data[7] = 0x00, .data[8] = 0x77, .data[9] = 0x00,
> + .data[10] = 0x00, .data[11] = 0x00, },
> + { .channel = 153, .freq = 5765, .data[0] = 0x60, .data[1] = 0x0C,
> + .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x00,
> + .data[6] = 0x00, .data[7] = 0x00, .data[8] = 0x77, .data[9] = 0x00,
> + .data[10] = 0x00, .data[11] = 0x00, },
> + { .channel = 157, .freq = 5785, .data[0] = 0x60, .data[1] = 0x0C,
> + .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x00,
> + .data[6] = 0x00, .data[7] = 0x00, .data[8] = 0x77, .data[9] = 0x00,
> + .data[10] = 0x00, .data[11] = 0x00, },
> + { .channel = 161, .freq = 5805, .data[0] = 0x60, .data[1] = 0x0C,
> + .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x00,
> + .data[6] = 0x00, .data[7] = 0x00, .data[8] = 0x77, .data[9] = 0x00,
> + .data[10] = 0x00, .data[11] = 0x00, },
> + { .channel = 165, .freq = 5825, .data[0] = 0x60, .data[1] = 0x0C,
> + .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x00, .data[5] = 0x00,
> + .data[6] = 0x00, .data[7] = 0x00, .data[8] = 0x77, .data[9] = 0x00,
> + .data[10] = 0x00, .data[11] = 0x00, },
> + { .channel = 184, .freq = 4920, .data[0] = 0x6E, .data[1] = 0x0C,
> + .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x09, .data[5] = 0x0E,
> + .data[6] = 0x0F, .data[7] = 0x0F, .data[8] = 0x77, .data[9] = 0xC0,
> + .data[10] = 0x50, .data[11] = 0x00, },
> + { .channel = 188, .freq = 4940, .data[0] = 0x6E, .data[1] = 0x0C,
> + .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x09, .data[5] = 0x0D,
> + .data[6] = 0x0F, .data[7] = 0x0F, .data[8] = 0x77, .data[9] = 0xB0,
> + .data[10] = 0x50, .data[11] = 0x00, },
> + { .channel = 192, .freq = 4960, .data[0] = 0x6E, .data[1] = 0x0C,
> + .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x08, .data[5] = 0x0C,
> + .data[6] = 0x0F, .data[7] = 0x0F, .data[8] = 0x77, .data[9] = 0xB0,
> + .data[10] = 0x50, .data[11] = 0x00, },
> + { .channel = 196, .freq = 4980, .data[0] = 0x6D, .data[1] = 0x0C,
> + .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x08, .data[5] = 0x0C,
> + .data[6] = 0x0F, .data[7] = 0x0F, .data[8] = 0x77, .data[9] = 0xA0,
> + .data[10] = 0x40, .data[11] = 0x00, },
> + { .channel = 200, .freq = 5000, .data[0] = 0x6D, .data[1] = 0x0C,
> + .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x08, .data[5] = 0x0B,
> + .data[6] = 0x0F, .data[7] = 0x0F, .data[8] = 0x77, .data[9] = 0xA0,
> + .data[10] = 0x40, .data[11] = 0x00, },
> + { .channel = 204, .freq = 5020, .data[0] = 0x6D, .data[1] = 0x0C,
> + .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x08, .data[5] = 0x0A,
> + .data[6] = 0x0F, .data[7] = 0x0F, .data[8] = 0x77, .data[9] = 0xA0,
> + .data[10] = 0x40, .data[11] = 0x00, },
> + { .channel = 208, .freq = 5040, .data[0] = 0x6C, .data[1] = 0x0C,
> + .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x07, .data[5] = 0x09,
> + .data[6] = 0x0F, .data[7] = 0x0F, .data[8] = 0x77, .data[9] = 0x90,
> + .data[10] = 0x40, .data[11] = 0x00, },
> + { .channel = 212, .freq = 5060, .data[0] = 0x6C, .data[1] = 0x0C,
> + .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x06, .data[5] = 0x08,
> + .data[6] = 0x0F, .data[7] = 0x0F, .data[8] = 0x77, .data[9] = 0x90,
> + .data[10] = 0x40, .data[11] = 0x00, },
> + { .channel = 216, .freq = 5080, .data[0] = 0x6C, .data[1] = 0x0C,
> + .data[2] = 0x0C, .data[3] = 0x00, .data[4] = 0x05, .data[5] = 0x08,
> + .data[6] = 0x0F, .data[7] = 0x0F, .data[8] = 0x77, .data[9] = 0x90,
> + .data[10] = 0x40, .data[11] = 0x00, },
> +};
> +
> +static void lpphy_b2063_vco_calib(struct b43_wldev *dev)
> +{
> + u16 tmp;
> +
> + b43_phy_mask(dev, B2063_PLL_SP1, ~0x40);
> + tmp = b43_phy_read(dev, B2063_PLL_JTAG_CALNRST) & 0xF8;
> + b43_phy_write(dev, B2063_PLL_JTAG_CALNRST, tmp);
> + udelay(1);
> + b43_phy_write(dev, B2063_PLL_JTAG_CALNRST, tmp | 0x4);
> + udelay(1);
> + b43_phy_write(dev, B2063_PLL_JTAG_CALNRST, tmp | 0x6);
> + udelay(1);
> + b43_phy_write(dev, B2063_PLL_JTAG_CALNRST, tmp | 0x7);
> + udelay(300);
> + b43_phy_set(dev, B2063_PLL_SP1, 0x40);
> +}
> +
> +static void lpphy_b2063_tune(struct b43_wldev *dev,
> + unsigned int channel)
> +{
> + struct ssb_bus *bus = dev->dev->bus;
> +
> + struct b2063_channel chandata;
> + u32 crystal_freq = bus->chipco.pmu.crystalfreq * 1000;
> + u32 freqref, vco_freq, val1, val2, val3, timeout, timeoutref, count;
> + u16 old_comm15, scale;
> + u32 tmp1, tmp2, tmp3, tmp4, tmp5, tmp6;
> + int i, div = (crystal_freq <= 26000000 ? 1 : 2);
> +
> + memset(&chandata, 0, sizeof(chandata));
> +
> + for (i = 0; i < ARRAY_SIZE(b2063_chantbl); i++) {
> + if (b2063_chantbl[i].channel == channel) {
> + chandata = b2063_chantbl[i];
> + break;
> + }
> + }
> +
> + B43_WARN_ON(!chandata.channel);
> +
> + b43_radio_write(dev, B2063_LOGEN_VCOBUF1, chandata.data[0]);
> + b43_radio_write(dev, B2063_LOGEN_MIXER2, chandata.data[1]);
> + b43_radio_write(dev, B2063_LOGEN_BUF2, chandata.data[2]);
> + b43_radio_write(dev, B2063_LOGEN_RCCR1, chandata.data[3]);
> + b43_radio_write(dev, B2063_A_RX_1ST3, chandata.data[4]);
> + b43_radio_write(dev, B2063_A_RX_2ND1, chandata.data[5]);
> + b43_radio_write(dev, B2063_A_RX_2ND4, chandata.data[6]);
> + b43_radio_write(dev, B2063_A_RX_2ND7, chandata.data[7]);
> + b43_radio_write(dev, B2063_A_RX_PS6, chandata.data[8]);
> + b43_radio_write(dev, B2063_TX_RF_CTL2, chandata.data[9]);
> + b43_radio_write(dev, B2063_TX_RF_CTL5, chandata.data[10]);
> + b43_radio_write(dev, B2063_PA_CTL11, chandata.data[11]);
> +
> + old_comm15 = b43_radio_read(dev, B2063_COMM15);
> + b43_radio_set(dev, B2063_COMM15, 0x1E);
> +
> + if (chandata.freq > 4000) /* spec says 2484, but 4000 is safer */
> + vco_freq = chandata.freq << 1;
> + else
> + vco_freq = chandata.freq << 2;
> +
> + freqref = crystal_freq * 3;
> + val1 = lpphy_qdiv_roundup(crystal_freq, 1000000, 16);
> + val2 = lpphy_qdiv_roundup(crystal_freq, 1000000 * div, 16);
> + val3 = lpphy_qdiv_roundup(vco_freq, 3, 16);
> + timeout = ((((8 * crystal_freq) / (div * 5000000)) + 1) >> 1) - 1;
> + b43_radio_write(dev, B2063_PLL_JTAG_PLL_VCO_CALIB3, 0x2);
> + b43_radio_maskset(dev, B2063_PLL_JTAG_PLL_VCO_CALIB6,
> + 0xFFF8, timeout >> 2);
> + b43_radio_maskset(dev, B2063_PLL_JTAG_PLL_VCO_CALIB7,
> + 0xFF9F,timeout << 5);
> +
> + timeoutref = ((((8 * crystal_freq) / (div * (timeout + 1))) +
> + 999999) / 1000000) + 1;
> + b43_radio_write(dev, B2063_PLL_JTAG_PLL_VCO_CALIB5, timeoutref);
> +
> + count = lpphy_qdiv_roundup(val3, val2 + 16, 16);
> + count *= (timeout + 1) * (timeoutref + 1);
> + count--;
> + b43_radio_maskset(dev, B2063_PLL_JTAG_PLL_VCO_CALIB7,
> + 0xF0, count >> 8);
> + b43_radio_write(dev, B2063_PLL_JTAG_PLL_VCO_CALIB8, count & 0xFF);
> +
> + tmp1 = ((val3 * 62500) / freqref) << 4;
> + tmp2 = ((val3 * 62500) % freqref) << 4;
> + while (tmp2 >= freqref) {
> + tmp1++;
> + tmp2 -= freqref;
> + }
> + b43_radio_maskset(dev, B2063_PLL_JTAG_PLL_SG1, 0xFFE0, tmp1 >> 4);
> + b43_radio_maskset(dev, B2063_PLL_JTAG_PLL_SG2, 0xFE0F, tmp1 << 4);
> + b43_radio_maskset(dev, B2063_PLL_JTAG_PLL_SG2, 0xFFF0, tmp1 >> 16);
> + b43_radio_write(dev, B2063_PLL_JTAG_PLL_SG3, (tmp2 >> 8) & 0xFF);
> + b43_radio_write(dev, B2063_PLL_JTAG_PLL_SG4, tmp2 & 0xFF);
> +
> + b43_radio_write(dev, B2063_PLL_JTAG_PLL_LF1, 0xB9);
> + b43_radio_write(dev, B2063_PLL_JTAG_PLL_LF2, 0x88);
> + b43_radio_write(dev, B2063_PLL_JTAG_PLL_LF3, 0x28);
> + b43_radio_write(dev, B2063_PLL_JTAG_PLL_LF4, 0x63);
> +
> + tmp3 = ((41 * (val3 - 3000)) /1200) + 27;
> + tmp4 = lpphy_qdiv_roundup(132000 * tmp1, 8451, 16);
> +
> + if ((tmp4 + tmp3 - 1) / tmp3 > 60) {
> + scale = 1;
> + tmp5 = ((tmp4 + tmp3) / (tmp3 << 1)) - 8;
> + } else {
> + scale = 0;
> + tmp5 = ((tmp4 + (tmp3 >> 1)) / tmp3) - 8;
> + }
> + b43_phy_maskset(dev, B2063_PLL_JTAG_PLL_CP2, 0xFFC0, tmp5);
> + b43_phy_maskset(dev, B2063_PLL_JTAG_PLL_CP2, 0xFFBF, scale << 6);
> +
> + tmp6 = lpphy_qdiv_roundup(100 * val1, val3, 16);
> + tmp6 *= (tmp5 * 8) * (scale + 1);
> + if (tmp6 > 150)
> + tmp6 = 0;
> +
> + b43_phy_maskset(dev, B2063_PLL_JTAG_PLL_CP3, 0xFFE0, tmp6);
> + b43_phy_maskset(dev, B2063_PLL_JTAG_PLL_CP3, 0xFFDF, scale << 5);
> +
> + b43_phy_maskset(dev, B2063_PLL_JTAG_PLL_XTAL_12, 0xFFFB, 0x4);
> + if (crystal_freq > 26000000)
> + b43_phy_set(dev, B2063_PLL_JTAG_PLL_XTAL_12, 0x2);
> + else
> + b43_phy_mask(dev, B2063_PLL_JTAG_PLL_XTAL_12, 0xFD);
> +
> + if (val1 == 45)
> + b43_phy_set(dev, B2063_PLL_JTAG_PLL_VCO1, 0x2);
> + else
> + b43_phy_mask(dev, B2063_PLL_JTAG_PLL_VCO1, 0xFD);
> +
> + b43_phy_set(dev, B2063_PLL_SP2, 0x3);
> + udelay(1);
> + b43_phy_mask(dev, B2063_PLL_SP2, 0xFFFC);
> + lpphy_b2063_vco_calib(dev);
> + b43_radio_write(dev, B2063_COMM15, old_comm15);
> +}
> +
> static int b43_lpphy_op_switch_channel(struct b43_wldev *dev,
> unsigned int new_channel)
> {
> - //TODO
> + struct b2063_channel chandata;
> + int i;
> +
> + memset(&chandata, 0, sizeof(chandata));
> +
> + //FIXME this abuses the 2063 channel table for chan2freq purposes!
> + for (i = 0; i < ARRAY_SIZE(b2063_chantbl); i++) {
> + if (b2063_chantbl[i].channel == new_channel) {
> + chandata = b2063_chantbl[i];
> + break;
> + }
> + }
> +
> + B43_WARN_ON(!chandata.channel);
> +
> + /* FIXME this should be the last thing done, even after generic
> + * parts - does it matter?
> + * SPEC FIXME should this write channel, freq, chanspec or cookie?
> + */
> + b43_write16(dev, B43_MMIO_CHANNEL, new_channel);
Whenever this hardware register is written, it is always with a channel.
> + if (dev->phy.radio_ver == 0x2063) {
> + lpphy_b2063_tune(dev, new_channel);
> + } else {
> + lpphy_b2062_tune(dev, new_channel);
> + //TODO Japan filter
> + }
> + lpphy_adjust_gain_table(dev, chandata.freq);
> return 0;
> }
>
What SPEC page did you use for this? I only see the tuning calls in
http://bcm-v4.sipsolutions.net/802.11/PHY/LP/SetChanSpecLPPHY, but it
doesn't look like this.
Larry
^ permalink raw reply
* mmotm0812 - something in linux-next killed iwl-3945.c
From: Valdis.Kletnieks @ 2009-08-13 16:59 UTC (permalink / raw)
To: Andrew Morton, Zhu Yi; +Cc: linux-kernel, linux-wireless, ipw3945-devel
[-- Attachment #1: Type: text/plain, Size: 1259 bytes --]
Build bombs out:
CC drivers/net/wireless/iwlwifi/iwl-3945.o
drivers/net/wireless/iwlwifi/iwl-3945.c: In function 'iwl3945_pass_packet_to_mac80211':
drivers/net/wireless/iwlwifi/iwl-3945.c:580: error: 'hdr' undeclared (first use in this function)
drivers/net/wireless/iwlwifi/iwl-3945.c:580: error: (Each undeclared identifier is reported only once
drivers/net/wireless/iwlwifi/iwl-3945.c:580: error: for each function it appears in.)
make[1]: *** [drivers/net/wireless/iwlwifi/iwl-3945.o] Error 1
due to this in linux-next.patch:
index 46288e7..ae7f163 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
(skipping)
@@ -577,7 +577,10 @@ static void iwl3945_pass_packet_to_mac80211(struct iwl_priv
*priv,
if (ieee80211_is_data(hdr->frame_control))
priv->rxtxpackets += len;
#endif
- ieee80211_rx_irqsafe(priv->hw, rxb->skb, stats);
+ iwl_update_stats(priv, false, hdr->frame_control, len);
+
+ memcpy(IEEE80211_SKB_RXCB(rxb->skb), stats, sizeof(*stats));
+ ieee80211_rx_irqsafe(priv->hw, rxb->skb);
rxb->skb = NULL;
Sorry, don't have a linux-next git tree, so no 'git blame' for what did it.
Hopefully somebody recognizes their handiwork... ;)
[-- Attachment #2: Type: application/pgp-signature, Size: 226 bytes --]
^ permalink raw reply
* Re: [PATCH 2.6.30 v2] iwl3945: fix rfkill switch
From: reinette chatre @ 2009-08-13 17:12 UTC (permalink / raw)
To: Stanislaw Gruszka
Cc: stable@kernel.org, linux-wireless@vger.kernel.org, Zhu, Yi,
John W. Linville
In-Reply-To: <1250166548-2548-1-git-send-email-sgruszka@redhat.com>
On Thu, 2009-08-13 at 05:29 -0700, Stanislaw Gruszka wrote:
> Due to rfkill and iwlwifi mishmash of SW / HW killswitch representation,
> we have race conditions which make unable turn wifi radio on, after enable
> and disable again killswitch. I can observe this problem on my laptop
> with iwl3945 device.
>
> In rfkill core HW switch and SW switch are separate 'states'. Device can
> be only in one of 3 states: RFKILL_STATE_SOFT_BLOCKED, RFKILL_STATE_UNBLOCKED,
> RFKILL_STATE_HARD_BLOCKED. Whereas in iwlwifi driver we have separate bits
> STATUS_RF_KILL_HW and STATUS_RF_KILL_SW for HW and SW switches - radio can be
> turned on, only if both bits are cleared.
>
> In this particular race conditions, radio can not be turned on if in driver
> STATUS_RF_KILL_SW bit is set, and rfkill core is in state
> RFKILL_STATE_HARD_BLOCKED, because rfkill core is unable to call
> rfkill->toggle_radio(). This situation can be entered in case:
>
> - killswitch is turned on
> - rfkill core 'see' button change first and move to RFKILL_STATE_SOFT_BLOCKED
> also call ->toggle_radio() and STATE_RF_KILL_SW in driver is set
> - iwl3945 get info about button from hardware to set STATUS_RF_KILL_HW bit and
> force rfkill to move to RFKILL_STATE_HARD_BLOCKED
> - killsiwtch is turend off
> - driver clear STATUS_RF_KILL_HW
> - rfkill core is unable to clear STATUS_RF_KILL_SW in driver
>
> Additionally call to rfkill_epo() when STATUS_RF_KILL_HW in driver is set
> cause move to the same situation.
>
> In 2.6.31 this problem is fixed due to _total_ rewrite of rfkill subsystem.
> This is a quite small fix for 2.6.30.x in iwlwifi driver. We are changing
> internal rfkill state to always have below relations true:
>
> STATUS_RF_KILL_HW=1 STATUS_RF_KILL_SW=1 <-> RFKILL_STATUS_SOFT_BLOCKED
> STATUS_RF_KILL_HW=0 STATUS_RF_KILL_SW=1 <-> RFKILL_STATUS_SOFT_BLOCKED
> STATUS_RF_KILL_HW=1 STATUS_RF_KILL_SW=0 <-> RFKILL_STATUS_HARD_BLOCKED
> STATUS_RF_KILL_HW=0 STATUS_RF_KILL_SW=0 <-> RFKILL_STATUS_UNBLOCKED
>
> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
> ---
> Patch was tested by me only with iwl3945 device.
Fortunately I have not encountered these race conditions on my system.
Even so, I tested this on a 5100 system and it behaves as expected wrt
rfkill.
Acked-by: Reinette Chatre <reinette.chatre@intel.com>
Reinette
^ permalink raw reply
* Re: [PATCH 2.6.30 v2] iwl3945: fix rfkill switch
From: John W. Linville @ 2009-08-13 17:12 UTC (permalink / raw)
To: reinette chatre
Cc: Stanislaw Gruszka, stable@kernel.org,
linux-wireless@vger.kernel.org, Zhu, Yi
In-Reply-To: <1250183526.30019.6225.camel@rc-desk>
On Thu, Aug 13, 2009 at 10:12:06AM -0700, reinette chatre wrote:
> On Thu, 2009-08-13 at 05:29 -0700, Stanislaw Gruszka wrote:
> > Due to rfkill and iwlwifi mishmash of SW / HW killswitch representation,
> > we have race conditions which make unable turn wifi radio on, after enable
> > and disable again killswitch. I can observe this problem on my laptop
> > with iwl3945 device.
> >
> > In rfkill core HW switch and SW switch are separate 'states'. Device can
> > be only in one of 3 states: RFKILL_STATE_SOFT_BLOCKED, RFKILL_STATE_UNBLOCKED,
> > RFKILL_STATE_HARD_BLOCKED. Whereas in iwlwifi driver we have separate bits
> > STATUS_RF_KILL_HW and STATUS_RF_KILL_SW for HW and SW switches - radio can be
> > turned on, only if both bits are cleared.
> >
> > In this particular race conditions, radio can not be turned on if in driver
> > STATUS_RF_KILL_SW bit is set, and rfkill core is in state
> > RFKILL_STATE_HARD_BLOCKED, because rfkill core is unable to call
> > rfkill->toggle_radio(). This situation can be entered in case:
> >
> > - killswitch is turned on
> > - rfkill core 'see' button change first and move to RFKILL_STATE_SOFT_BLOCKED
> > also call ->toggle_radio() and STATE_RF_KILL_SW in driver is set
> > - iwl3945 get info about button from hardware to set STATUS_RF_KILL_HW bit and
> > force rfkill to move to RFKILL_STATE_HARD_BLOCKED
> > - killsiwtch is turend off
> > - driver clear STATUS_RF_KILL_HW
> > - rfkill core is unable to clear STATUS_RF_KILL_SW in driver
> >
> > Additionally call to rfkill_epo() when STATUS_RF_KILL_HW in driver is set
> > cause move to the same situation.
> >
> > In 2.6.31 this problem is fixed due to _total_ rewrite of rfkill subsystem.
> > This is a quite small fix for 2.6.30.x in iwlwifi driver. We are changing
> > internal rfkill state to always have below relations true:
> >
> > STATUS_RF_KILL_HW=1 STATUS_RF_KILL_SW=1 <-> RFKILL_STATUS_SOFT_BLOCKED
> > STATUS_RF_KILL_HW=0 STATUS_RF_KILL_SW=1 <-> RFKILL_STATUS_SOFT_BLOCKED
> > STATUS_RF_KILL_HW=1 STATUS_RF_KILL_SW=0 <-> RFKILL_STATUS_HARD_BLOCKED
> > STATUS_RF_KILL_HW=0 STATUS_RF_KILL_SW=0 <-> RFKILL_STATUS_UNBLOCKED
> >
> > Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
> > ---
> > Patch was tested by me only with iwl3945 device.
>
> Fortunately I have not encountered these race conditions on my system.
> Even so, I tested this on a 5100 system and it behaves as expected wrt
> rfkill.
>
> Acked-by: Reinette Chatre <reinette.chatre@intel.com>
ACK for stable
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
^ permalink raw reply
* Re: Roaming behavior
From: Dan Williams @ 2009-08-13 17:20 UTC (permalink / raw)
To: David Seira; +Cc: linux-wireless
In-Reply-To: <loom.20090813T094313-518@post.gmane.org>
On Thu, 2009-08-13 at 09:44 +0000, David Seira wrote:
>
>
> But I haven't installed wpa_supplicant, I don't need it. In which files is
> roaming behavior implemented?
wpa_supplicant is the defacto wifi control program for Linux. Yes, it
doesn't more than WPA. Yes, it can be used for open and WEP networks.
If you don't use it, you'll just end up rewriting a large chunk of it.
Dan
^ permalink raw reply
* Re: [PATCH v2] b43: Update dummy transmission to match V4 specs
From: Michael Buesch @ 2009-08-13 17:23 UTC (permalink / raw)
To: Gábor Stefanik
Cc: John Linville, Larry Finger, Broadcom Wireless, linux-wireless
In-Reply-To: <4A842887.2080109@gmail.com>
On Thursday 13 August 2009 16:51:51 Gábor Stefanik wrote:
> The V4 dummy transmission has two extra bools in its prototype,
> so update all callers with the 2 bools.
>
> Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
> ---
> v2: Convert all callers to v4, and drop the v3->v4 wrapper.
> - /* Commit writes */
> - b43_read32(dev, B43_MMIO_MACCTL);
> - value = ((phy->type == B43_PHYTYPE_A) ? 1 : 0);
> + if (dev->dev->id.revision < 11)
> + b43_write16(dev, 0x07C0, 0x0000);
> + else
> + b43_write16(dev, 0x07C0, 0x0100);
> + value = (ofdm ? 0x41 : 0x40);
> b43_write16(dev, 0x050C, value);
This patch changes G-PHY codepaths. Did you test it on (at least one) G-PHY device?
--
Greetings, Michael.
^ permalink raw reply
* Re: [ipw3945-devel] mmotm0812 - something in linux-next killed iwl-3945.c
From: John W. Linville @ 2009-08-13 17:28 UTC (permalink / raw)
To: Valdis.Kletnieks
Cc: Andrew Morton, Zhu Yi, linux-wireless, linux-kernel,
ipw3945-devel
In-Reply-To: <19728.1250182794@turing-police.cc.vt.edu>
On Thu, Aug 13, 2009 at 12:59:54PM -0400, Valdis.Kletnieks@vt.edu wrote:
> Build bombs out:
>
> CC drivers/net/wireless/iwlwifi/iwl-3945.o
> drivers/net/wireless/iwlwifi/iwl-3945.c: In function 'iwl3945_pass_packet_to_mac80211':
> drivers/net/wireless/iwlwifi/iwl-3945.c:580: error: 'hdr' undeclared (first use in this function)
> drivers/net/wireless/iwlwifi/iwl-3945.c:580: error: (Each undeclared identifier is reported only once
> drivers/net/wireless/iwlwifi/iwl-3945.c:580: error: for each function it appears in.)
> make[1]: *** [drivers/net/wireless/iwlwifi/iwl-3945.o] Error 1
>
> due to this in linux-next.patch:
>
> index 46288e7..ae7f163 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-3945.c
> +++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
> (skipping)
> @@ -577,7 +577,10 @@ static void iwl3945_pass_packet_to_mac80211(struct iwl_priv
> *priv,
> if (ieee80211_is_data(hdr->frame_control))
> priv->rxtxpackets += len;
> #endif
> - ieee80211_rx_irqsafe(priv->hw, rxb->skb, stats);
> + iwl_update_stats(priv, false, hdr->frame_control, len);
> +
> + memcpy(IEEE80211_SKB_RXCB(rxb->skb), stats, sizeof(*stats));
> + ieee80211_rx_irqsafe(priv->hw, rxb->skb);
> rxb->skb = NULL;
>
> Sorry, don't have a linux-next git tree, so no 'git blame' for what did it.
> Hopefully somebody recognizes their handiwork... ;)
I think this is the LEDS-related build failure, which already has a patch.
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
^ permalink raw reply
* [PATCH] cfg80211: export cfg80211_wext_siwfreq
From: Jussi Kivilinna @ 2009-08-13 17:39 UTC (permalink / raw)
To: linux-wireless; +Cc: John W. Linville, Johannes Berg
cfg80211_wext_siwfreq() should be exported with EXPORT_SYMBOL_GPL.
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
---
net/wireless/wext-compat.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c
index c449174..c12029b 100644
--- a/net/wireless/wext-compat.c
+++ b/net/wireless/wext-compat.c
@@ -771,6 +771,7 @@ int cfg80211_wext_siwfreq(struct net_device *dev,
return err;
}
}
+EXPORT_SYMBOL_GPL(cfg80211_wext_siwfreq);
int cfg80211_wext_giwfreq(struct net_device *dev,
struct iw_request_info *info,
^ permalink raw reply related
* Re: [RFC/RFT] b43: LP-PHY: Implement channel switching for rev2+/B2063 radio
From: Michael Buesch @ 2009-08-13 17:40 UTC (permalink / raw)
To: Gábor Stefanik
Cc: Larry Finger, John Linville, Broadcom Wireless, linux-wireless
In-Reply-To: <4A842AFD.1020903@gmail.com>
On Thursday 13 August 2009 17:02:21 Gábor Stefanik wrote:
> Rev.2+/B2063 will now hopefully show some signs of life, though
> it won't work at full performance, as calibration is still missing.
>
> Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
> static void lpphy_baseband_rev0_1_init(struct b43_wldev *dev)
> @@ -1369,7 +1370,7 @@ static int b43_lpphy_op_init(struct b43_wldev *dev)
> lpphy_baseband_init(dev);
> lpphy_radio_init(dev);
> lpphy_calibrate_rc(dev);
> - //TODO set channel
> + b43_switch_channel(dev, dev->wl->hw->conf.channel->hw_value);
Does dev->wl->hw->conf.channel->hw_value already have a sane value here?
Also please call b43_lpphy_op_switch_channel() instead of b43_switch_channel().
> +static void lpphy_b2063_tune(struct b43_wldev *dev,
> + unsigned int channel)
> +{
> + struct ssb_bus *bus = dev->dev->bus;
> +
> + struct b2063_channel chandata;
> + u32 crystal_freq = bus->chipco.pmu.crystalfreq * 1000;
> + u32 freqref, vco_freq, val1, val2, val3, timeout, timeoutref, count;
> + u16 old_comm15, scale;
> + u32 tmp1, tmp2, tmp3, tmp4, tmp5, tmp6;
> + int i, div = (crystal_freq <= 26000000 ? 1 : 2);
> +
> + memset(&chandata, 0, sizeof(chandata));
> +
> + for (i = 0; i < ARRAY_SIZE(b2063_chantbl); i++) {
> + if (b2063_chantbl[i].channel == channel) {
> + chandata = b2063_chantbl[i];
Can you use a const pointer instead of copying the whole data structure?
> + break;
> + }
> + }
> +
> + B43_WARN_ON(!chandata.channel);
> +
> static int b43_lpphy_op_switch_channel(struct b43_wldev *dev,
> unsigned int new_channel)
> {
> - //TODO
> + struct b2063_channel chandata;
> + int i;
> +
> + memset(&chandata, 0, sizeof(chandata));
> +
> + //FIXME this abuses the 2063 channel table for chan2freq purposes!
> + for (i = 0; i < ARRAY_SIZE(b2063_chantbl); i++) {
> + if (b2063_chantbl[i].channel == new_channel) {
> + chandata = b2063_chantbl[i];
> + break;
> + }
> + }
> +
> + B43_WARN_ON(!chandata.channel);
> +
> + /* FIXME this should be the last thing done, even after generic
> + * parts - does it matter?
It is correct as is.
> + * SPEC FIXME should this write channel, freq, chanspec or cookie?
> + */
Can you explain this FIXME? What's "chanspec", what's "cookie"?
> + b43_write16(dev, B43_MMIO_CHANNEL, new_channel);
> + if (dev->phy.radio_ver == 0x2063) {
> + lpphy_b2063_tune(dev, new_channel);
> + } else {
> + lpphy_b2062_tune(dev, new_channel);
> + //TODO Japan filter
> + }
> + lpphy_adjust_gain_table(dev, chandata.freq);
> return 0;
> }
>
--
Greetings, Michael.
^ permalink raw reply
* WG: rt2500usb with kernel >=2.6.29
From: Manuel Sahm @ 2009-08-13 17:51 UTC (permalink / raw)
To: linux-wireless
Hello,
my usb wlan sticks aren´t working anymore - I cannot connect to an access
point.
I have got this two usb sticks:
Buffallo WLI-U2-KG54-AI
GIGABYTE AirCruiser G USB Adapter (GN-WBKG)
With Kernel 2.6.28.10 all seems to work fine..... with kernel >= 2.6.29 it
doesn´t work anymore ???
Bootup (dmesg) shows:
usb 1-1: default language 0x0409
usb 1-1: New USB device found, idVendor=1044, idProduct=8007
usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-1: Product: 802.11g WLAN + Pen Drive
usb 1-1: Manufacturer: Ralink
usb 1-1: uevent
usb 1-1: usb_probe_device
usb 1-1: configuration #1 chosen from 1 choice
usb 1-1: adding 1-1:1.0 (config #1, interface 0)
usb 1-1:1.0: uevent
rt2500usb 1-1:1.0: usb_probe_interface
rt2500usb 1-1:1.0: usb_probe_interface - got id
phy0 -> rt2500usb_validate_eeprom: EEPROM recovery - NIC: 0xfff0
phy0 -> rt2x00_set_chip: Info - Chipset detected - rt: 1201, rf: 0005, rev:
00000005.
phy0: Selected rate control algorithm 'pid'
drivers/usb/core/inode.c: creating file '002'
hub 1-0:1.0: state 7 ports 2 chg 0000 evt 0002
phy0 -> rt2x00mac_conf_tx: Info - Configured TX queue 0 - CWmin: 5, CWmax:
10, Aifs: 2, TXop: 0.
phy0 -> rt2x00mac_conf_tx: Info - Configured TX queue 1 - CWmin: 5, CWmax:
10, Aifs: 2, TXop: 0.
ADDRCONF(NETDEV_UP): wlan0: link is not ready
any ideas ?
thanks very much
^ permalink raw reply
* Re: [RFC/RFT] b43: LP-PHY: Implement channel switching for rev2+/B2063 radio
From: Gábor Stefanik @ 2009-08-13 18:00 UTC (permalink / raw)
To: Michael Buesch, Larry Finger; +Cc: Broadcom Wireless, linux-wireless
In-Reply-To: <200908131955.32283.mb@bu3sch.de>
(List re-CC-ed.)
2009/8/13 Michael Buesch <mb@bu3sch.de>:
> On Thursday 13 August 2009 19:50:16 Gábor Stefanik wrote:
>> 2009/8/13 Michael Buesch <mb@bu3sch.de>:
>> > On Thursday 13 August 2009 17:02:21 Gábor Stefanik wrote:
>> >> Rev.2+/B2063 will now hopefully show some signs of life, though
>> >> it won't work at full performance, as calibration is still missing.
>> >>
>> >> Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
>> >
>> >> static void lpphy_baseband_rev0_1_init(struct b43_wldev *dev)
>> >> @@ -1369,7 +1370,7 @@ static int b43_lpphy_op_init(struct b43_wldev *dev)
>> >> lpphy_baseband_init(dev);
>> >> lpphy_radio_init(dev);
>> >> lpphy_calibrate_rc(dev);
>> >> - //TODO set channel
>> >> + b43_switch_channel(dev, dev->wl->hw->conf.channel->hw_value);
>> >
>> > Does dev->wl->hw->conf.channel->hw_value already have a sane value here?
>>
>> I think it should - hw->conf.channel was handed to us by mac80211.
>> http://bcm-v4.sipsolutions.net/802.11/PHY/LP/Init says "Set channel
>> with current chanspec as argument", and hw->conf.channel is our
>> equivalent of chanspec.
>
> hw->conf.channel was not handed to us at all. You simply pick it
> from mac80211's conf structure and _assume_ that it is initialized.
> In the other PHY implementations we use phyop_default_channel (or mandatory
> hardcoded channel values) in the PHY init only. I think you should do the
> same here. Mac80211 will make sure to select the correct channel later.
OK, I will use the default channel (though that's not exactly what the
spec says - Larry, is using the default channel correct?)
>
>> > Also please call b43_lpphy_op_switch_channel() instead of b43_switch_channel().
>>
>> No, that would be wrong; the generic parts of b43_switch_channel also
>> need to be executed. See
>
> I don't see why. The generic parts are nothing that should be done at the PHY init.
Well, the spec says that the generic parts need to be run, so I
implemented it as such.
Larry, is this part of the spec correct?
>
> --
> Greetings, Michael.
>
--
Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-)
^ permalink raw reply
* Re: [PATCH v2] b43: Update dummy transmission to match V4 specs
From: Gábor Stefanik @ 2009-08-13 18:02 UTC (permalink / raw)
To: Michael Buesch
Cc: John Linville, Larry Finger, Broadcom Wireless, linux-wireless
In-Reply-To: <200908131923.29847.mb@bu3sch.de>
2009/8/13 Michael Buesch <mb@bu3sch.de>:
> On Thursday 13 August 2009 16:51:51 Gábor Stefanik wrote:
>> The V4 dummy transmission has two extra bools in its prototype,
>> so update all callers with the 2 bools.
>>
>> Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
>> ---
>> v2: Convert all callers to v4, and drop the v3->v4 wrapper.
>
>> - /* Commit writes */
>> - b43_read32(dev, B43_MMIO_MACCTL);
>
>> - value = ((phy->type == B43_PHYTYPE_A) ? 1 : 0);
>> + if (dev->dev->id.revision < 11)
>> + b43_write16(dev, 0x07C0, 0x0000);
>> + else
>> + b43_write16(dev, 0x07C0, 0x0100);
>> + value = (ofdm ? 0x41 : 0x40);
>> b43_write16(dev, 0x050C, value);
>
> This patch changes G-PHY codepaths. Did you test it on (at least one) G-PHY device?
Not yet - if you could test it, I would be grateful.
--
Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-)
^ permalink raw reply
* Re: [RFC/RFT] b43: LP-PHY: Implement channel switching for rev2+/B2063 radio
From: Michael Buesch @ 2009-08-13 18:05 UTC (permalink / raw)
To: Gábor Stefanik; +Cc: Larry Finger, Broadcom Wireless, linux-wireless
In-Reply-To: <69e28c910908131100h7d403196y3f8be4809fc61d0f@mail.gmail.com>
On Thursday 13 August 2009 20:00:47 Gábor Stefanik wrote:
> (List re-CC-ed.)
>
> 2009/8/13 Michael Buesch <mb@bu3sch.de>:
> > On Thursday 13 August 2009 19:50:16 Gábor Stefanik wrote:
> >> 2009/8/13 Michael Buesch <mb@bu3sch.de>:
> >> > On Thursday 13 August 2009 17:02:21 Gábor Stefanik wrote:
> >> >> Rev.2+/B2063 will now hopefully show some signs of life, though
> >> >> it won't work at full performance, as calibration is still missing.
> >> >>
> >> >> Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
> >> >
> >> >> static void lpphy_baseband_rev0_1_init(struct b43_wldev *dev)
> >> >> @@ -1369,7 +1370,7 @@ static int b43_lpphy_op_init(struct b43_wldev *dev)
> >> >> lpphy_baseband_init(dev);
> >> >> lpphy_radio_init(dev);
> >> >> lpphy_calibrate_rc(dev);
> >> >> - //TODO set channel
> >> >> + b43_switch_channel(dev, dev->wl->hw->conf.channel->hw_value);
> >> >
> >> > Does dev->wl->hw->conf.channel->hw_value already have a sane value here?
> >>
> >> I think it should - hw->conf.channel was handed to us by mac80211.
> >> http://bcm-v4.sipsolutions.net/802.11/PHY/LP/Init says "Set channel
> >> with current chanspec as argument", and hw->conf.channel is our
> >> equivalent of chanspec.
> >
> > hw->conf.channel was not handed to us at all. You simply pick it
> > from mac80211's conf structure and _assume_ that it is initialized.
> > In the other PHY implementations we use phyop_default_channel (or mandatory
> > hardcoded channel values) in the PHY init only. I think you should do the
> > same here. Mac80211 will make sure to select the correct channel later.
>
> OK, I will use the default channel (though that's not exactly what the
> spec says - Larry, is using the default channel correct?)
What on earth could be incorrect about it? It's an as arbitrary value as
dev->wl->hw->conf.channel->hw_value would be.
>
> >
> >> > Also please call b43_lpphy_op_switch_channel() instead of b43_switch_channel().
> >>
> >> No, that would be wrong; the generic parts of b43_switch_channel also
> >> need to be executed. See
> >
> > I don't see why. The generic parts are nothing that should be done at the PHY init.
>
> Well, the spec says that the generic parts need to be run, so I
> implemented it as such.
We do understand what the generic stuff does and it is not required at this point.
> Larry, is this part of the spec correct?
I'm pretty sure it is. But that does not mean we have to implement the same
bullshit broadcom does ;)
--
Greetings, Michael.
^ permalink raw reply
* Re: [ipw3945-devel] mmotm0812 - something in linux-next killed iwl-3945.c
From: Valdis.Kletnieks @ 2009-08-13 18:19 UTC (permalink / raw)
To: John W. Linville
Cc: Andrew Morton, Zhu Yi, linux-wireless, linux-kernel,
ipw3945-devel
In-Reply-To: <20090813172819.GD2647@tuxdriver.com>
[-- Attachment #1: Type: text/plain, Size: 1124 bytes --]
On Thu, 13 Aug 2009 13:28:19 EDT, "John W. Linville" said:
> On Thu, Aug 13, 2009 at 12:59:54PM -0400, Valdis.Kletnieks@vt.edu wrote:
> > Build bombs out:
> >
> > CC drivers/net/wireless/iwlwifi/iwl-3945.o
> > drivers/net/wireless/iwlwifi/iwl-3945.c: In function 'iwl3945_pass_packet_to_mac80211':
> > drivers/net/wireless/iwlwifi/iwl-3945.c:580: error: 'hdr' undeclared (first use in this function)
> > drivers/net/wireless/iwlwifi/iwl-3945.c:580: error: (Each undeclared identifier is reported only once
> > drivers/net/wireless/iwlwifi/iwl-3945.c:580: error: for each function it appears in.)
> > make[1]: *** [drivers/net/wireless/iwlwifi/iwl-3945.o] Error 1
> > Sorry, don't have a linux-next git tree, so no 'git blame' for what did it.
> > Hopefully somebody recognizes their handiwork... ;)
>
> I think this is the LEDS-related build failure, which already has a patch.
Found Kalle Valo's patch removing the #ifdef's in the linux-wireless
archives, build is now proceeding thanks...
Now to figure out how I managed to trip over it, CONFIG_IWLWIFI_LEDS looks
like a config option I would have selected...
[-- Attachment #2: Type: application/pgp-signature, Size: 226 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