2011-11-28 21:38:54

by Luis R. Rodriguez

[permalink] [raw]
Subject: [PATCH 0/5] wireless: fix set tx power

The driver maintainers have approved of these now except for brcm80211.
I should note that Kalle indicated he was going to queue up the ath6kl
patch though so not sure if you want to wait for his patch or just suck
mine in. I think it makes sense to roll these in together as a series,
the rebase that Kalle would do shouldn't be impacted by this I think.

What we can do later is just add a data structure as suggested by hpa
to avoid these sort of issues.

Luis R. Rodriguez (5):
cfg80211: clarify set tx power mBm documentation
ath6kl: fix ath6kl's set tx power
brcm80211: fix usage of set tx power
brcm80211: avoid code duplication on set tx power
mwifiex: fix usage of set tx power

drivers/net/wireless/ath/ath6kl/cfg80211.c | 3 ++-
.../net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | 9 ++-------
drivers/net/wireless/mwifiex/cfg80211.c | 3 ++-
include/net/cfg80211.h | 3 ++-
4 files changed, 8 insertions(+), 10 deletions(-)

--
1.7.4.15.g7811d



2011-11-28 21:39:05

by Luis R. Rodriguez

[permalink] [raw]
Subject: [PATCH 4/5] brcm80211: avoid code duplication on set tx power

Both cases are doing the same so treat the switch cases
for both as an "or".

Signed-off-by: Luis R. Rodriguez <[email protected]>
---
.../net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | 6 ------
1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
index fc98981..f23b0c3 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
@@ -1447,12 +1447,6 @@ brcmf_cfg80211_set_tx_power(struct wiphy *wiphy,
case NL80211_TX_POWER_AUTOMATIC:
break;
case NL80211_TX_POWER_LIMITED:
- if (dbm < 0) {
- WL_ERR("TX_POWER_LIMITED - dbm is negative\n");
- err = -EINVAL;
- goto done;
- }
- break;
case NL80211_TX_POWER_FIXED:
if (dbm < 0) {
WL_ERR("TX_POWER_FIXED - dbm is negative\n");
--
1.7.4.15.g7811d


2011-11-28 21:38:57

by Luis R. Rodriguez

[permalink] [raw]
Subject: [PATCH 1/5] cfg80211: clarify set tx power mBm documentation

Tons of drivers missed that we use mBm and not dBm...

Signed-off-by: Luis R. Rodriguez <[email protected]>
---
include/net/cfg80211.h | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index ce6236b..f0e82b2 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1402,7 +1402,8 @@ struct cfg80211_gtk_rekey_data {
* have changed. The actual parameter values are available in
* struct wiphy. If returning an error, no value should be changed.
*
- * @set_tx_power: set the transmit power according to the parameters
+ * @set_tx_power: set the transmit power according to the parameters,
+ * the power passed is in mBm, to get dBm use MBM_TO_DBM().
* @get_tx_power: store the current TX power into the dbm variable;
* return 0 if successful
*
--
1.7.4.15.g7811d


2011-11-30 20:11:54

by Franky Lin

[permalink] [raw]
Subject: Re: [PATCH 4/5] brcm80211: avoid code duplication on set tx power

On 11/28/2011 01:38 PM, Luis R. Rodriguez wrote:
> Both cases are doing the same so treat the switch cases
> for both as an "or".
>
> Signed-off-by: Luis R. Rodriguez<[email protected]>

Thanks Luis,

Acked-by: Franky Lin <[email protected]>

Franky



2011-11-28 21:39:00

by Luis R. Rodriguez

[permalink] [raw]
Subject: [PATCH 2/5] ath6kl: fix set tx power

ath6kl assumed cfg80211 passed to us power in dBm but it is in mBm.

Acked-by: Kalle Valo <[email protected]>
Signed-off-by: Luis R. Rodriguez <[email protected]>
---

Kalle queued this up already.

drivers/net/wireless/ath/ath6kl/cfg80211.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 0252604..9f3d3f0 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -1181,11 +1181,12 @@ static int ath6kl_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed)
*/
static int ath6kl_cfg80211_set_txpower(struct wiphy *wiphy,
enum nl80211_tx_power_setting type,
- int dbm)
+ int mbm)
{
struct ath6kl *ar = (struct ath6kl *)wiphy_priv(wiphy);
struct ath6kl_vif *vif;
u8 ath6kl_dbm;
+ int dbm = MBM_TO_DBM(mbm);

ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: type 0x%x, dbm %d\n", __func__,
type, dbm);
--
1.7.4.15.g7811d


2011-11-30 20:11:21

by Franky Lin

[permalink] [raw]
Subject: Re: [PATCH 3/5] brcm80211: fix usage of set tx power

On 11/28/2011 01:38 PM, Luis R. Rodriguez wrote:
> mBm is passed but dBm was assumed...
>
> Signed-off-by: Luis R. Rodriguez<[email protected]>

Thanks Luis,

Acked-by: Franky Lin <[email protected]>

Franky


2011-11-28 21:39:08

by Luis R. Rodriguez

[permalink] [raw]
Subject: [PATCH 5/5] mwifiex: fix usage of set tx power

mBm is passed but dBm was assumed...

Acked-by: Bing Zhao <[email protected]>
Signed-off-by: Luis R. Rodriguez <[email protected]>
---
drivers/net/wireless/mwifiex/cfg80211.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index e9ab9a3..0db97cc 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -120,10 +120,11 @@ mwifiex_cfg80211_del_key(struct wiphy *wiphy, struct net_device *netdev,
static int
mwifiex_cfg80211_set_tx_power(struct wiphy *wiphy,
enum nl80211_tx_power_setting type,
- int dbm)
+ int mbm)
{
struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy);
struct mwifiex_power_cfg power_cfg;
+ int dbm = MBM_TO_DBM(mbm);

if (type == NL80211_TX_POWER_FIXED) {
power_cfg.is_power_auto = 0;
--
1.7.4.15.g7811d


2011-11-29 06:36:09

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH 0/5] wireless: fix set tx power

"Luis R. Rodriguez" <[email protected]> writes:

> The driver maintainers have approved of these now except for brcm80211.
> I should note that Kalle indicated he was going to queue up the ath6kl
> patch though so not sure if you want to wait for his patch or just suck
> mine in.

John, please don't take the ath6kl patch as it's already in ath6kl.git:

https://github.com/kvalo/ath6kl/commit/b992a28557afdcabcee7d8af88471dddfe791c11

> I think it makes sense to roll these in together as a series,

I don't see any benefit from this.

> the rebase that Kalle would do shouldn't be impacted by this I think.

I don't rebase ath6kl.git unless absolutely necessary. And I prefer that
ath6kl patches would go through ath6kl.git, I get less conflicts that
way.

--
Kalle Valo

2011-11-28 21:39:02

by Luis R. Rodriguez

[permalink] [raw]
Subject: [PATCH 3/5] brcm80211: fix usage of set tx power

mBm is passed but dBm was assumed...

Signed-off-by: Luis R. Rodriguez <[email protected]>
---
.../net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
index cc19a73..fc98981 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
@@ -1429,7 +1429,7 @@ brcmf_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *ndev,

static s32
brcmf_cfg80211_set_tx_power(struct wiphy *wiphy,
- enum nl80211_tx_power_setting type, s32 dbm)
+ enum nl80211_tx_power_setting type, s32 mbm)
{

struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy);
@@ -1437,6 +1437,7 @@ brcmf_cfg80211_set_tx_power(struct wiphy *wiphy,
u16 txpwrmw;
s32 err = 0;
s32 disable = 0;
+ s32 dbm = MBM_TO_DBM(mbm);

WL_TRACE("Enter\n");
if (!check_sys_up(wiphy))
--
1.7.4.15.g7811d


2011-11-29 15:15:02

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: [PATCH 0/5] wireless: fix set tx power

On Tue, Nov 29, 2011 at 1:36 AM, Kalle Valo <[email protected]> wrote:
> "Luis R. Rodriguez" <[email protected]> writes:
>
>> The driver maintainers have approved of these now except for brcm80211.
>> I should note that Kalle indicated he was going to queue up the ath6kl
>> patch though so not sure if you want to wait for his patch or just suck
>> mine in.
>
> John, please don't take the ath6kl patch as it's already in ath6kl.git:
>
> https://github.com/kvalo/ath6kl/commit/b992a28557afdcabcee7d8af88471dddfe791c11
>
>> I think it makes sense to roll these in together as a series,
>
> I don't see any benefit from this.
>
>> the rebase that Kalle would do shouldn't be impacted by this I think.
>
> I don't rebase ath6kl.git unless absolutely necessary. And I prefer that
> ath6kl patches would go through ath6kl.git, I get less conflicts that
> way.

Alrighty, then the others can be sucked in.

Luis