Linux wireless drivers development
 help / color / mirror / Atom feed
* Re: [PATCH v2] mac80211: pass vif param to conf_tx() callback
From: Eliad Peller @ 2011-10-14  9:54 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless
In-Reply-To: <1318433496.3933.44.camel@jlt3.sipsolutions.net>

On Wed, Oct 12, 2011 at 5:31 PM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Sun, 2011-10-02 at 10:15 +0200, Eliad Peller wrote:
>> tx params should be configured per interface.
>> add ieee80211_vif param to the conf_tx callback,
>> and change all the drivers that use this callback.
>
> For the record, I said this to you on IRC but you weren't around I
> guess. This patch (with the other ones) is now passing a bogus sdata/vif
> pointer to drivers -- e.g. for monitor mode interfaces from
> ieee80211_do_open -> ieee80211_set_wmm_default -> drv_conf_tx.
>
> I suspect the way to fix this would be to move the call to
> ieee80211_set_wmm_default into the last switch statement in do_open,
> could you please look into it?
>
thanks for the info.
i'll look into it.

Eliad.

^ permalink raw reply

* Re: [PATCH] mac80211: handle HT PHY BSS membership selector value correctly
From: Christian Lamparter @ 2011-10-14  8:12 UTC (permalink / raw)
  To: Jouni Malinen; +Cc: linux-wireless, johannes, linville
In-Reply-To: <201110140942.37085.chunkeey@googlemail.com>

[Hit 'sent' by accident]

On Friday, October 14, 2011 09:42:36 AM Christian Lamparter wrote:
> On Friday, October 14, 2011 12:45:32 AM Jouni Malinen wrote:
> > On Thu, Oct 13, 2011 at 09:08:49PM +0200, Christian Lamparter wrote:
> > > 802.11n-2009 extends the supported rates element with a
> > > magic value which can be used to prevent legacy stations
> > > from joining the BSS.
> > 
> > Well, it can be used to try to make legacy stations not attempt
> > connection, but no guarantees on them actually checking whether they
> > support all the "basic rates".. For example, where is mac80211 (or
> > wpa_supplicant) doing that check? ;-)
> 
Actually, you have already implemented the check in hostapd :)

commit 2944824315b7c74838c551ef08c9843e02de1d46
Author: Jouni Malinen <jouni.malinen@atheros.com>
Date:   Wed Feb 9 15:08:47 2011 +0200

line 682:
        if (hapd->iconf->ieee80211n && hapd->iconf->require_ht &&
            !(sta->flags & WLAN_STA_HT)) {
                hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211,
                               HOSTAPD_LEVEL_INFO, "Station does not support "
                               "mandatory HT PHY - reject association");
                return WLAN_STATUS_ASSOC_DENIED_NO_HT;
        }

so if a legacy station decides to join a require_ht = 1 BSS
then the AP will refuse it with WLAN_STATUS_ASSOC_DENIED_NO_HT
and the wpa_supp client will blacklist the AP because of that
and it will choose a different AP for the next try.

> > > diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
> > > @@ -1463,6 +1463,38 @@ ieee80211_rx_mgmt_disassoc(struct ieee80211_sub_if_data *sdata,
> > > +static void ieee80211_get_rates(struct ieee80211_supported_band *sband,
> > 
> > > +	for (i = 0; i < supp_rates_len; i++) {
> > > +		int rate = (supp_rates[i] & 0x7f) * 5;
> > > +		bool is_basic = !!(supp_rates[i] & BSS_MEMBERSHIP_SELECTOR);
> > 
> > This looks a bit odd since the BSS_MEMBERSHIP_SELECTOR is not exactly
> > same as basic rate indicator even through they share the same bit. We
> > used to have the magic 0x80 value here which could actually look less
> > confusing than the mixing of basic and BSS membership terms.
So, what's the exact difference between then BasicRate and a MembershipRate
in this context then? Is a rate called "basic rate" when it's one of the
legacy e.g.: 6, 12, 24 Mbit rates [And likewise: is a rate called a MembershipRate
when only in the magic 127 HT PHY case?] 

> > 
> > > +		if (rate > 110)
> > > +			*have_higher_than_11mbit = true;
> > While this is not really introduced by this patch, this looks quite
> > bogus since the higher-than-11Mbps is then used to figure out whether
> > this was a 802.11g network. That is not correct since a network with a
> > single supported rate 6 Mbps should also get that behavior.. More robust
> > mechanism would be to check for any OFDM rate being listed.
Also, there's 22mbit 8-PSK PBCC [I think mwl8k supports it and some TI
stuff could support it as well]. The check is questionable, but fixing
it may no be trivial either. [Anyway, it's a bit outside the scope and
requires another patch]

Regards,
	Chr

^ permalink raw reply

* Re: [PATCH] mac80211: handle HT PHY BSS membership selector value correctly
From: Christian Lamparter @ 2011-10-14  7:42 UTC (permalink / raw)
  To: Jouni Malinen; +Cc: linux-wireless, johannes, linville
In-Reply-To: <20111013224532.GA1959@jm.kir.nu>

On Friday, October 14, 2011 12:45:32 AM Jouni Malinen wrote:
> On Thu, Oct 13, 2011 at 09:08:49PM +0200, Christian Lamparter wrote:
> > 802.11n-2009 extends the supported rates element with a
> > magic value which can be used to prevent legacy stations
> > from joining the BSS.
> 
> Well, it can be used to try to make legacy stations not attempt
> connection, but no guarantees on them actually checking whether they
> support all the "basic rates".. For example, where is mac80211 (or
> wpa_supplicant) doing that check? ;-)

Actually, you have already implemented the check elsewhere :)


> 
> > diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
> > @@ -1463,6 +1463,38 @@ ieee80211_rx_mgmt_disassoc(struct ieee80211_sub_if_data *sdata,
> > +static void ieee80211_get_rates(struct ieee80211_supported_band *sband,
> 
> > +	for (i = 0; i < supp_rates_len; i++) {
> > +		int rate = (supp_rates[i] & 0x7f) * 5;
> > +		bool is_basic = !!(supp_rates[i] & BSS_MEMBERSHIP_SELECTOR);
> 
> This looks a bit odd since the BSS_MEMBERSHIP_SELECTOR is not exactly
> same as basic rate indicator even through they share the same bit. We
> used to have the magic 0x80 value here which could actually look less
> confusing than the mixing of basic and BSS membership terms.
> 
> > +		if (rate > 110)
> > +			*have_higher_than_11mbit = true;
> 
> While this is not really introduced by this patch, this looks quite
> bogus since the higher-than-11Mbps is then used to figure out whether
> this was a 802.11g network. That is not correct since a network with a
> single supported rate 6 Mbps should also get that behavior.. More robust
> mechanism would be to check for any OFDM rate being listed.
> 
> > +	ieee80211_get_rates(sband, elems.supp_rates, elems.supp_rates_len,
> > +			    &rates, &basic_rates, &have_higher_than_11mbit);
> 
> > +	ieee80211_get_rates(sband, elems.ext_supp_rates,
> > +			    elems.ext_supp_rates_len, &rates, &basic_rates,
> > +			    &have_higher_than_11mbit);
> 
> Yay for getting rid of the duplicated loop :-).
>  
> 

^ permalink raw reply

* Re: [PATCH] mac80211: handle HT PHY BSS membership selector value correctly
From: Jouni Malinen @ 2011-10-13 22:45 UTC (permalink / raw)
  To: Christian Lamparter; +Cc: linux-wireless, johannes, linville
In-Reply-To: <201110132108.50019.chunkeey@googlemail.com>

On Thu, Oct 13, 2011 at 09:08:49PM +0200, Christian Lamparter wrote:
> 802.11n-2009 extends the supported rates element with a
> magic value which can be used to prevent legacy stations
> from joining the BSS.

Well, it can be used to try to make legacy stations not attempt
connection, but no guarantees on them actually checking whether they
support all the "basic rates".. For example, where is mac80211 (or
wpa_supplicant) doing that check? ;-)

> diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
> @@ -1463,6 +1463,38 @@ ieee80211_rx_mgmt_disassoc(struct ieee80211_sub_if_data *sdata,
> +static void ieee80211_get_rates(struct ieee80211_supported_band *sband,

> +	for (i = 0; i < supp_rates_len; i++) {
> +		int rate = (supp_rates[i] & 0x7f) * 5;
> +		bool is_basic = !!(supp_rates[i] & BSS_MEMBERSHIP_SELECTOR);

This looks a bit odd since the BSS_MEMBERSHIP_SELECTOR is not exactly
same as basic rate indicator even through they share the same bit. We
used to have the magic 0x80 value here which could actually look less
confusing than the mixing of basic and BSS membership terms.

> +		if (rate > 110)
> +			*have_higher_than_11mbit = true;

While this is not really introduced by this patch, this looks quite
bogus since the higher-than-11Mbps is then used to figure out whether
this was a 802.11g network. That is not correct since a network with a
single supported rate 6 Mbps should also get that behavior.. More robust
mechanism would be to check for any OFDM rate being listed.

> +	ieee80211_get_rates(sband, elems.supp_rates, elems.supp_rates_len,
> +			    &rates, &basic_rates, &have_higher_than_11mbit);

> +	ieee80211_get_rates(sband, elems.ext_supp_rates,
> +			    elems.ext_supp_rates_len, &rates, &basic_rates,
> +			    &have_higher_than_11mbit);

Yay for getting rid of the duplicated loop :-).
 
-- 
Jouni Malinen                                            PGP id EFC895FA

^ permalink raw reply

* [PATCH] mac80211: handle HT PHY BSS membership selector value correctly
From: Christian Lamparter @ 2011-10-13 19:08 UTC (permalink / raw)
  To: linux-wireless; +Cc: johannes, linville

802.11n-2009 extends the supported rates element with a
magic value which can be used to prevent legacy stations
from joining the BSS.

However, this magic value is not a rate like the others
and the magic can simply be ignored/skipped at this late
stage.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
---
pending... still testing.
---
 include/linux/ieee80211.h |    4 ++
 net/mac80211/mlme.c       |   71 ++++++++++++++++++++++++--------------------
 2 files changed, 42 insertions(+), 33 deletions(-)

diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 48363c3..7d2c72d 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -770,6 +770,10 @@ struct ieee80211_mgmt {
 	} u;
 } __attribute__ ((packed));
 
+/* Supported Rates flags and value encodings in 802.11n-2009 7.3.2.2 */
+#define BSS_MEMBERSHIP_SELECTOR		BIT(7)
+#define BSS_MEMBERSHIP_SELECTOR_HT_PHY	127
+
 /* mgmt header + 1 byte category code */
 #define IEEE80211_MIN_ACTION_SIZE offsetof(struct ieee80211_mgmt, u.action.u)
 
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 0e5d8da..5619fd5 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1463,6 +1463,38 @@ ieee80211_rx_mgmt_disassoc(struct ieee80211_sub_if_data *sdata,
 	return RX_MGMT_CFG80211_DISASSOC;
 }
 
+static void ieee80211_get_rates(struct ieee80211_supported_band *sband,
+				u8 *supp_rates, unsigned int supp_rates_len,
+				u32 *rates, u32 *basic_rates,
+				bool *have_higher_than_11mbit)
+{
+	int i, j;
+
+	for (i = 0; i < supp_rates_len; i++) {
+		int rate = (supp_rates[i] & 0x7f) * 5;
+		bool is_basic = !!(supp_rates[i] & BSS_MEMBERSHIP_SELECTOR);
+
+		if (rate > 110)
+			*have_higher_than_11mbit = true;
+
+		/*
+		 * BSS_MEMBERSHIP_SELECTOR_HT_PHY is defined in 802.11n-2009
+		 * 7.3.2.2 as a magic value instead of a rate. Hence, skip it.
+		 */
+		if (is_basic &&
+		    (supp_rates[i] & 0x7f) == BSS_MEMBERSHIP_SELECTOR_HT_PHY)
+			continue;
+
+		for (j = 0; j < sband->n_bitrates; j++) {
+			if (sband->bitrates[j].bitrate == rate) {
+				*rates |= BIT(j);
+				if (is_basic)
+					*basic_rates |= BIT(j);
+				break;
+			}
+		}
+	}
+}
 
 static bool ieee80211_assoc_success(struct ieee80211_work *wk,
 				    struct ieee80211_mgmt *mgmt, size_t len)
@@ -1479,7 +1511,7 @@ static bool ieee80211_assoc_success(struct ieee80211_work *wk,
 	struct ieee802_11_elems elems;
 	struct ieee80211_bss_conf *bss_conf = &sdata->vif.bss_conf;
 	u32 changed = 0;
-	int i, j, err;
+	int err;
 	bool have_higher_than_11mbit = false;
 	u16 ap_ht_cap_flags;
 
@@ -1525,39 +1557,12 @@ static bool ieee80211_assoc_success(struct ieee80211_work *wk,
 	basic_rates = 0;
 	sband = local->hw.wiphy->bands[wk->chan->band];
 
-	for (i = 0; i < elems.supp_rates_len; i++) {
-		int rate = (elems.supp_rates[i] & 0x7f) * 5;
-		bool is_basic = !!(elems.supp_rates[i] & 0x80);
-
-		if (rate > 110)
-			have_higher_than_11mbit = true;
-
-		for (j = 0; j < sband->n_bitrates; j++) {
-			if (sband->bitrates[j].bitrate == rate) {
-				rates |= BIT(j);
-				if (is_basic)
-					basic_rates |= BIT(j);
-				break;
-			}
-		}
-	}
-
-	for (i = 0; i < elems.ext_supp_rates_len; i++) {
-		int rate = (elems.ext_supp_rates[i] & 0x7f) * 5;
-		bool is_basic = !!(elems.ext_supp_rates[i] & 0x80);
+	ieee80211_get_rates(sband, elems.supp_rates, elems.supp_rates_len,
+			    &rates, &basic_rates, &have_higher_than_11mbit);
 
-		if (rate > 110)
-			have_higher_than_11mbit = true;
-
-		for (j = 0; j < sband->n_bitrates; j++) {
-			if (sband->bitrates[j].bitrate == rate) {
-				rates |= BIT(j);
-				if (is_basic)
-					basic_rates |= BIT(j);
-				break;
-			}
-		}
-	}
+	ieee80211_get_rates(sband, elems.ext_supp_rates,
+			    elems.ext_supp_rates_len, &rates, &basic_rates,
+			    &have_higher_than_11mbit);
 
 	sta->sta.supp_rates[wk->chan->band] = rates;
 	sdata->vif.bss_conf.basic_rates = basic_rates;
-- 
1.7.7


^ permalink raw reply related

* Compat-wireless release for 2011-10-13 is baked
From: Compat-wireless cronjob account @ 2011-10-13 19:04 UTC (permalink / raw)
  To: linux-wireless

>From git://github.com/sfrothwell/linux-next
 + 706f460...53c998a akpm-end   -> origin/akpm-end  (forced update)
 + 5c56568...7b64d23 master     -> origin/master  (forced update)
 * [new tag]         next-20111013 -> next-20111013

compat-wireless code metrics

    717234 - Total upstream lines of code being pulled

^ permalink raw reply

* Re: [PATCH 22/22] brcm80211: removed file wifi.c
From: Arend van Spriel @ 2011-10-13 18:32 UTC (permalink / raw)
  To: John W. Linville
  Cc: Luis R. Rodriguez, linux-wireless@vger.kernel.org, Alwin Beukers
In-Reply-To: <20111013182306.GD2504@tuxdriver.com>


[-- Attachment #1.1: Type: text/plain, Size: 1552 bytes --]

On 10/13/2011 08:23 PM, John W. Linville wrote:
> On Thu, Oct 13, 2011 at 11:08:15AM -0700, Luis R. Rodriguez wrote:
>> On Thu, Oct 13, 2011 at 1:51 AM, Arend van Spriel <arend@broadcom.com> wrote:
>>> On 10/12/2011 11:54 PM, Luis R. Rodriguez wrote:
>>>> On Wed, Oct 12, 2011 at 11:51 AM, Arend van Spriel <arend@broadcom.com> wrote:
>>>>> From: Alwin Beukers <alwin@broadcom.com>
>>>>>
>>>>> Wifi.c was empty after previous cleanups, so it was removed.
>>>>>
>>>>> Reviewed-by: Arend van Spriel <arend@broadcom.com>
>>>>> Signed-off-by: Arend van Spriel <arend@broadcom.com>
>>>>
>>>> Heh, remove Reviewed-by dude.
>>>>
>>>>   Luis
>>>>
>>>
>>> I had a remark on this in earlier commits. So I am clearly missing the
>>> point here. The author submitted this change and others for review to me
>>> and I reviewed it as requested. Hence the Reviewed-by: entry.
>>>
>>> I have been given the task to publish these patches and I sign them off
>>> for the "Developer's Certificate of Origin". Hence the Signed-off-by: entry.
>>>
>>> Is there something wrong with this reasoning?
>>
>> Yeah this all makes no sense. If someone submits you a patch for you
>> to review *and* push upstream you simply add *their* SOB first, and
>> then after that your own.
> 
> For my $0.02, having both a Reviewed-by and a Signed-off-by looks
> a little funny, but it isn't necessarily wrong.  The Signed-off-by
> really only says that you believe that patch is legally contributed.
> 
> Oh, and IANAL...
> 
> John

IANALE

Gr. AvS

[-- Attachment #1.2: 0xB5E1A116.asc --]
[-- Type: application/pgp-keys, Size: 3165 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 900 bytes --]

^ permalink raw reply

* Re: [PATCH 22/22] brcm80211: removed file wifi.c
From: John W. Linville @ 2011-10-13 18:23 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Arend van Spriel, linux-wireless@vger.kernel.org, Alwin Beukers
In-Reply-To: <CAB=NE6XiXc=TsjQ0bCphqaprDAjrXMfoKaQTwyNu-hX2d0issA@mail.gmail.com>

On Thu, Oct 13, 2011 at 11:08:15AM -0700, Luis R. Rodriguez wrote:
> On Thu, Oct 13, 2011 at 1:51 AM, Arend van Spriel <arend@broadcom.com> wrote:
> > On 10/12/2011 11:54 PM, Luis R. Rodriguez wrote:
> >> On Wed, Oct 12, 2011 at 11:51 AM, Arend van Spriel <arend@broadcom.com> wrote:
> >>> From: Alwin Beukers <alwin@broadcom.com>
> >>>
> >>> Wifi.c was empty after previous cleanups, so it was removed.
> >>>
> >>> Reviewed-by: Arend van Spriel <arend@broadcom.com>
> >>> Signed-off-by: Arend van Spriel <arend@broadcom.com>
> >>
> >> Heh, remove Reviewed-by dude.
> >>
> >>   Luis
> >>
> >
> > I had a remark on this in earlier commits. So I am clearly missing the
> > point here. The author submitted this change and others for review to me
> > and I reviewed it as requested. Hence the Reviewed-by: entry.
> >
> > I have been given the task to publish these patches and I sign them off
> > for the "Developer's Certificate of Origin". Hence the Signed-off-by: entry.
> >
> > Is there something wrong with this reasoning?
> 
> Yeah this all makes no sense. If someone submits you a patch for you
> to review *and* push upstream you simply add *their* SOB first, and
> then after that your own.

For my $0.02, having both a Reviewed-by and a Signed-off-by looks
a little funny, but it isn't necessarily wrong.  The Signed-off-by
really only says that you believe that patch is legally contributed.

Oh, and IANAL...

John
-- 
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: [PATCH 22/22] brcm80211: removed file wifi.c
From: Arend van Spriel @ 2011-10-13 18:27 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org,
	Alwin Beukers
In-Reply-To: <CAB=NE6XiXc=TsjQ0bCphqaprDAjrXMfoKaQTwyNu-hX2d0issA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1573 bytes --]

On 10/13/2011 08:08 PM, Luis R. Rodriguez wrote:
> On Thu, Oct 13, 2011 at 1:51 AM, Arend van Spriel <arend@broadcom.com> wrote:
>> On 10/12/2011 11:54 PM, Luis R. Rodriguez wrote:
>>> On Wed, Oct 12, 2011 at 11:51 AM, Arend van Spriel <arend@broadcom.com> wrote:
>>>> From: Alwin Beukers <alwin@broadcom.com>
>>>>
>>>> Wifi.c was empty after previous cleanups, so it was removed.
>>>>
>>>> Reviewed-by: Arend van Spriel <arend@broadcom.com>
>>>> Signed-off-by: Arend van Spriel <arend@broadcom.com>
>>>
>>> Heh, remove Reviewed-by dude.
>>>
>>>   Luis
>>>
>>
>> I had a remark on this in earlier commits. So I am clearly missing the
>> point here. The author submitted this change and others for review to me
>> and I reviewed it as requested. Hence the Reviewed-by: entry.
>>
>> I have been given the task to publish these patches and I sign them off
>> for the "Developer's Certificate of Origin". Hence the Signed-off-by: entry.
>>
>> Is there something wrong with this reasoning?
> 
> Yeah this all makes no sense. If someone submits you a patch for you
> to review *and* push upstream you simply add *their* SOB first, and
> then after that your own.
> 
>   Luis
> 

Ok, dude

Not trying to be rude, but in my opinion these are two separate things.
Your statement is that Signed-off-by: entry also covers the "Reviewer's
statement of oversight", but I could not find any confirmation to your
statement in the SubmittingPatches documentation.

The only miss I see is that the author did not sign off on this patch.

Gr. AvS


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 900 bytes --]

^ permalink raw reply

* Re: [PATCH 22/22] brcm80211: removed file wifi.c
From: Luis R. Rodriguez @ 2011-10-13 18:08 UTC (permalink / raw)
  To: Arend van Spriel
  Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org,
	Alwin Beukers
In-Reply-To: <4E96A696.9040607@broadcom.com>

On Thu, Oct 13, 2011 at 1:51 AM, Arend van Spriel <arend@broadcom.com> wrote:
> On 10/12/2011 11:54 PM, Luis R. Rodriguez wrote:
>> On Wed, Oct 12, 2011 at 11:51 AM, Arend van Spriel <arend@broadcom.com> wrote:
>>> From: Alwin Beukers <alwin@broadcom.com>
>>>
>>> Wifi.c was empty after previous cleanups, so it was removed.
>>>
>>> Reviewed-by: Arend van Spriel <arend@broadcom.com>
>>> Signed-off-by: Arend van Spriel <arend@broadcom.com>
>>
>> Heh, remove Reviewed-by dude.
>>
>>   Luis
>>
>
> I had a remark on this in earlier commits. So I am clearly missing the
> point here. The author submitted this change and others for review to me
> and I reviewed it as requested. Hence the Reviewed-by: entry.
>
> I have been given the task to publish these patches and I sign them off
> for the "Developer's Certificate of Origin". Hence the Signed-off-by: entry.
>
> Is there something wrong with this reasoning?

Yeah this all makes no sense. If someone submits you a patch for you
to review *and* push upstream you simply add *their* SOB first, and
then after that your own.

  Luis

^ permalink raw reply

* Re: [PATCH] brcm80211: rename CONFIG_BRCMUMAC to CONFIG_BRCMUTIL
From: Arend van Spriel @ 2011-10-13 15:12 UTC (permalink / raw)
  To: Johannes Berg
  Cc: Hauke Mehrtens, linville@tuxdriver.com,
	linux-wireless@vger.kernel.org
In-Reply-To: <1318516084.5612.18.camel@jlt3.sipsolutions.net>

[-- Attachment #1: Type: text/plain, Size: 1298 bytes --]

On 10/13/2011 04:28 PM, Johannes Berg wrote:
> On Thu, 2011-10-13 at 16:25 +0200, Hauke Mehrtens wrote:
>> There is no config option named CONFIG_BRCMUMAC this should be
>> CONFIG_BRCMUTIL as this is missing here.
>>
>> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
>> ---
>>  drivers/net/wireless/Makefile |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/net/wireless/Makefile b/drivers/net/wireless/Makefile
>> index 0a304b0..812a050 100644
>> --- a/drivers/net/wireless/Makefile
>> +++ b/drivers/net/wireless/Makefile
>> @@ -59,5 +59,5 @@ obj-$(CONFIG_IWM)	+= iwmc3200wifi/
>>  
>>  obj-$(CONFIG_MWIFIEX)	+= mwifiex/
>>  obj-$(CONFIG_BRCMFMAC) += brcm80211/
>> -obj-$(CONFIG_BRCMUMAC) += brcm80211/
>> +obj-$(CONFIG_BRCMUTIL) += brcm80211/
>>  obj-$(CONFIG_BRCMSMAC) += brcm80211/
> 
> Shouldn't it just go away since BRCMUTIL depends on SMAC||FMAC and is
> otherwise unreachable?
> 
> johannes
> 
> 

Henry provided the script for preparing the mainline patch. Indeed there
is no BRCMUMAC item so that was clearly a mistake. Also Johannes
statement is a valid one. BRCMUTIL always comes with either BRCMSMAC or
BRCMFMAC so include brcm80211/ on BRCMSMAC or BRCMFMAC is sufficient.
The Makefile in brcm80211 assures brcmutil module is built.

Gr. AvS

[-- Attachment #2: 0xB5E1A116.asc --]
[-- Type: application/pgp-keys, Size: 3113 bytes --]

^ permalink raw reply

* Re: [PATCH 1/2] nl80211: Add sta_flags to the station info
From: Johannes Berg @ 2011-10-13 15:00 UTC (permalink / raw)
  To: Helmut Schaa; +Cc: linux-wireless, linville
In-Reply-To: <CAGXE3d-9VfBm8DdzuQQ71U=1B81g_Ga1BvmJgv-0RZ6UMOSo_A@mail.gmail.com>

On Thu, 2011-10-13 at 16:54 +0200, Helmut Schaa wrote:
> On Thu, Oct 13, 2011 at 4:43 PM, Johannes Berg
> <johannes@sipsolutions.net> wrote:
> > Why would we care about the mask here? Wouldn't a u32 attribute with the
> > set flags only make more sense?
> 
> I though about using the mask to tell user space which flags are actually
> used/supported by the driver. There might be nl80211 drivers that can't provide
> all flags and hence want to mask out the flags. Otherwise user space cannot
> decide if a flag is not set or not supported by the driver. Does that sound
> reasonable?

Yeah I was thinking that too, maybe that makes some sense. Not sure
we'll really run into that? Anyway we can keep it, I don't mind.

johannes


^ permalink raw reply

* Re: [PATCH 1/2] nl80211: Add sta_flags to the station info
From: Helmut Schaa @ 2011-10-13 14:54 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, linville
In-Reply-To: <1318516981.5612.20.camel@jlt3.sipsolutions.net>

On Thu, Oct 13, 2011 at 4:43 PM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> Why would we care about the mask here? Wouldn't a u32 attribute with the
> set flags only make more sense?

I though about using the mask to tell user space which flags are actually
used/supported by the driver. There might be nl80211 drivers that can't provide
all flags and hence want to mask out the flags. Otherwise user space cannot
decide if a flag is not set or not supported by the driver. Does that sound
reasonable?

Helmut

^ permalink raw reply

* Re: [PATCH 1/2] nl80211: Add sta_flags to the station info
From: Johannes Berg @ 2011-10-13 14:43 UTC (permalink / raw)
  To: Helmut Schaa; +Cc: linux-wireless, linville
In-Reply-To: <1318516240-10033-1-git-send-email-helmut.schaa@googlemail.com>

On Thu, 2011-10-13 at 16:30 +0200, Helmut Schaa wrote:
> Reuse the already existing struct nl80211_sta_flag_update to specify
> both, a flag mask and the flag set itself. This means
> nl80211_sta_flag_update is now used for setting station flags and also
> for getting station flags.

Why would we care about the mask here? Wouldn't a u32 attribute with the
set flags only make more sense?

johannes


^ permalink raw reply

* [PATCH 2/2] mac80211: Provide station flags to cfg80211
From: Helmut Schaa @ 2011-10-13 14:30 UTC (permalink / raw)
  To: linux-wireless; +Cc: linville, johannes, Helmut Schaa
In-Reply-To: <1318516240-10033-1-git-send-email-helmut.schaa@googlemail.com>

Only station flags that are already defined in nl80211 are added for
now.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
---
 net/mac80211/cfg.c |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index d0705f2..e253afa 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -344,7 +344,8 @@ static void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
 			STATION_INFO_RX_BITRATE |
 			STATION_INFO_RX_DROP_MISC |
 			STATION_INFO_BSS_PARAM |
-			STATION_INFO_CONNECTED_TIME;
+			STATION_INFO_CONNECTED_TIME |
+			STATION_INFO_STA_FLAGS;
 
 	do_posix_clock_monotonic_gettime(&uptime);
 	sinfo->connected_time = uptime.tv_sec - sta->last_connected;
@@ -404,6 +405,23 @@ static void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
 		sinfo->bss_param.flags |= BSS_PARAM_FLAGS_SHORT_SLOT_TIME;
 	sinfo->bss_param.dtim_period = sdata->local->hw.conf.ps_dtim_period;
 	sinfo->bss_param.beacon_interval = sdata->vif.bss_conf.beacon_int;
+
+	sinfo->sta_flags.set = 0;
+	sinfo->sta_flags.mask = BIT(NL80211_STA_FLAG_AUTHORIZED) |
+				BIT(NL80211_STA_FLAG_SHORT_PREAMBLE) |
+				BIT(NL80211_STA_FLAG_WME) |
+				BIT(NL80211_STA_FLAG_MFP) |
+				BIT(NL80211_STA_FLAG_AUTHENTICATED);
+	if (test_sta_flag(sta, WLAN_STA_AUTHORIZED))
+		sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_AUTHORIZED);
+	if (test_sta_flag(sta, WLAN_STA_SHORT_PREAMBLE))
+		sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_SHORT_PREAMBLE);
+	if (test_sta_flag(sta, WLAN_STA_WME))
+		sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_WME);
+	if (test_sta_flag(sta, WLAN_STA_MFP))
+		sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_MFP);
+	if (test_sta_flag(sta, WLAN_STA_AUTH))
+		sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_AUTHENTICATED);
 }
 
 
-- 
1.7.3.4


^ permalink raw reply related

* [PATCH 1/2] nl80211: Add sta_flags to the station info
From: Helmut Schaa @ 2011-10-13 14:30 UTC (permalink / raw)
  To: linux-wireless; +Cc: linville, johannes, Helmut Schaa

Reuse the already existing struct nl80211_sta_flag_update to specify
both, a flag mask and the flag set itself. This means
nl80211_sta_flag_update is now used for setting station flags and also
for getting station flags.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
---

I think this is reasonable since even if we add read-only flags in
the future we can just ignore them when userspace tries to set them.

Helmut

 include/linux/nl80211.h |    2 ++
 include/net/cfg80211.h  |    5 ++++-
 net/wireless/nl80211.c  |    4 ++++
 3 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 9d797f2..013ec4b 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -1548,6 +1548,7 @@ enum nl80211_sta_bss_param {
  * @NL80211_STA_INFO_BSS_PARAM: current station's view of BSS, nested attribute
  *     containing info as possible, see &enum nl80211_sta_bss_param
  * @NL80211_STA_INFO_CONNECTED_TIME: time since the station is last connected
+ * @NL80211_STA_INFO_STA_FLAGS: Contains a struct nl80211_sta_flag_update. 
  * @__NL80211_STA_INFO_AFTER_LAST: internal
  * @NL80211_STA_INFO_MAX: highest possible station info attribute
  */
@@ -1569,6 +1570,7 @@ enum nl80211_sta_info {
 	NL80211_STA_INFO_RX_BITRATE,
 	NL80211_STA_INFO_BSS_PARAM,
 	NL80211_STA_INFO_CONNECTED_TIME,
+	NL80211_STA_INFO_STA_FLAGS,
 
 	/* keep last */
 	__NL80211_STA_INFO_AFTER_LAST,
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 74f4f85..92cf1c2 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -497,6 +497,7 @@ struct station_parameters {
  * @STATION_INFO_BSS_PARAM: @bss_param filled
  * @STATION_INFO_CONNECTED_TIME: @connected_time filled
  * @STATION_INFO_ASSOC_REQ_IES: @assoc_req_ies filled
+ * @STATION_INFO_STA_FLAGS: @sta_flags filled
  */
 enum station_info_flags {
 	STATION_INFO_INACTIVE_TIME	= 1<<0,
@@ -516,7 +517,8 @@ enum station_info_flags {
 	STATION_INFO_RX_BITRATE		= 1<<14,
 	STATION_INFO_BSS_PARAM          = 1<<15,
 	STATION_INFO_CONNECTED_TIME	= 1<<16,
-	STATION_INFO_ASSOC_REQ_IES	= 1<<17
+	STATION_INFO_ASSOC_REQ_IES	= 1<<17,
+	STATION_INFO_STA_FLAGS		= 1<<18
 };
 
 /**
@@ -633,6 +635,7 @@ struct station_info {
 	u32 tx_failed;
 	u32 rx_dropped_misc;
 	struct sta_bss_parameters bss_param;
+	struct nl80211_sta_flag_update sta_flags;
 
 	int generation;
 
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index edf655a..48260c2 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -2344,6 +2344,10 @@ static int nl80211_send_station(struct sk_buff *msg, u32 pid, u32 seq,
 
 		nla_nest_end(msg, bss_param);
 	}
+	if (sinfo->filled & STATION_INFO_STA_FLAGS)
+		NLA_PUT(msg, NL80211_STA_INFO_STA_FLAGS,
+			sizeof(struct nl80211_sta_flag_update),
+			&sinfo->sta_flags);
 	nla_nest_end(msg, sinfoattr);
 
 	if (sinfo->filled & STATION_INFO_ASSOC_REQ_IES)
-- 
1.7.3.4


^ permalink raw reply related

* Re: [PATCH] brcm80211: rename CONFIG_BRCMUMAC to CONFIG_BRCMUTIL
From: Johannes Berg @ 2011-10-13 14:28 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: arend, linville, linux-wireless
In-Reply-To: <1318515949-9558-1-git-send-email-hauke@hauke-m.de>

On Thu, 2011-10-13 at 16:25 +0200, Hauke Mehrtens wrote:
> There is no config option named CONFIG_BRCMUMAC this should be
> CONFIG_BRCMUTIL as this is missing here.
> 
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
> ---
>  drivers/net/wireless/Makefile |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/wireless/Makefile b/drivers/net/wireless/Makefile
> index 0a304b0..812a050 100644
> --- a/drivers/net/wireless/Makefile
> +++ b/drivers/net/wireless/Makefile
> @@ -59,5 +59,5 @@ obj-$(CONFIG_IWM)	+= iwmc3200wifi/
>  
>  obj-$(CONFIG_MWIFIEX)	+= mwifiex/
>  obj-$(CONFIG_BRCMFMAC) += brcm80211/
> -obj-$(CONFIG_BRCMUMAC) += brcm80211/
> +obj-$(CONFIG_BRCMUTIL) += brcm80211/
>  obj-$(CONFIG_BRCMSMAC) += brcm80211/

Shouldn't it just go away since BRCMUTIL depends on SMAC||FMAC and is
otherwise unreachable?

johannes


^ permalink raw reply

* [PATCH] brcm80211: rename CONFIG_BRCMUMAC to CONFIG_BRCMUTIL
From: Hauke Mehrtens @ 2011-10-13 14:25 UTC (permalink / raw)
  To: arend, linville; +Cc: linux-wireless, Hauke Mehrtens

There is no config option named CONFIG_BRCMUMAC this should be
CONFIG_BRCMUTIL as this is missing here.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 drivers/net/wireless/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/Makefile b/drivers/net/wireless/Makefile
index 0a304b0..812a050 100644
--- a/drivers/net/wireless/Makefile
+++ b/drivers/net/wireless/Makefile
@@ -59,5 +59,5 @@ obj-$(CONFIG_IWM)	+= iwmc3200wifi/
 
 obj-$(CONFIG_MWIFIEX)	+= mwifiex/
 obj-$(CONFIG_BRCMFMAC) += brcm80211/
-obj-$(CONFIG_BRCMUMAC) += brcm80211/
+obj-$(CONFIG_BRCMUTIL) += brcm80211/
 obj-$(CONFIG_BRCMSMAC) += brcm80211/
-- 
1.7.4.1


^ permalink raw reply related

* [PATCH] compat-wireless: adapt moving brcm80211 to main area
From: Hauke Mehrtens @ 2011-10-13 14:16 UTC (permalink / raw)
  To: mcgrof, mcgrof; +Cc: linux-wireless, Hauke Mehrtens

brcm80211 is no staging driver any more and can be found in the main
area where all the other wireless drivers are now. There where some
changes needed for the move.
And BRCMFMAC does not depend on WEXT any more so remove that from
config.
BRCMFMAC does not build with kernel < 2.6.29, because
ndev->netdev_ops = NULL and ndev->netdev_ops == &brcmf_netdev_ops_pri
are not supported by the backport code for netdev_ops.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 Makefile                               |    1 -
 config.mk                              |   12 +--------
 patches/25-multicast-list_head.patch   |   32 +++++++++++++-------------
 patches/29-sdio_no_suspend.patch       |   18 +++++++-------
 patches/35-fix-makefile-includes.patch |   26 ++++++++++----------
 scripts/admin-update.sh                |    8 +++++-
 scripts/driver-select                  |   39 +++++++++++++++++++++----------
 7 files changed, 73 insertions(+), 63 deletions(-)

diff --git a/Makefile b/Makefile
index 6fe77b8..d3a9d93 100644
--- a/Makefile
+++ b/Makefile
@@ -37,7 +37,6 @@ obj-$(CONFIG_COMPAT_VAR_MODULES) += drivers/bcma/
 obj-$(CONFIG_COMPAT_VAR_MODULES) += drivers/misc/eeprom/
 
 ifeq ($(CONFIG_STAGING_EXCLUDE_BUILD),)
-obj-$(CONFIG_COMPAT_STAGING) += drivers/staging/brcm80211/
 endif
 
 endif
diff --git a/config.mk b/config.mk
index 3463f83..a71de4e 100644
--- a/config.mk
+++ b/config.mk
@@ -396,9 +396,7 @@ CONFIG_RTL8192CE=m
 CONFIG_RTL8192SE=m
 CONFIG_RTL8192DE=m
 
-ifdef CONFIG_COMPAT_STAGING
 CONFIG_BRCMSMAC=m
-endif #CONFIG_COMPAT_STAGING
 
 endif #CONFIG_PCI
 ## end of PCI
@@ -572,13 +570,9 @@ CONFIG_ATH6KL=m
 # CONFIG_ATH6KL_DEBUG=y
 endif #CONFIG_COMPAT_KERNEL_2_6_27
 
-ifdef CONFIG_COMPAT_STAGING
-ifdef CONFIG_WIRELESS_EXT
-
+ifndef CONFIG_COMPAT_KERNEL_2_6_29
 CONFIG_BRCMFMAC=m
-
-endif #CONFIG_WIRELESS_EXT
-endif #CONFIG_COMPAT_STAGING
+endif #CONFIG_COMPAT_KERNEL_2_6_29
 
 endif #CONFIG_MMC
 
@@ -614,10 +608,8 @@ endif #CONFIG_MAC80211_LEDS
 CONFIG_ATH_COMMON=m
 # CONFIG_ATH_DEBUG=y
 
-ifdef CONFIG_COMPAT_STAGING
 CONFIG_BRCMUTIL=m
 # CONFIG_BRCMDBG=y
-endif #CONFIG_COMPAT_STAGING
 
 ifdef CONFIG_CRC7
 CONFIG_WL1251=m
diff --git a/patches/25-multicast-list_head.patch b/patches/25-multicast-list_head.patch
index e3e99e6..25fa450 100644
--- a/patches/25-multicast-list_head.patch
+++ b/patches/25-multicast-list_head.patch
@@ -83,7 +83,7 @@ This also backport commit 2f787b0b76bf5de2eaa3ca3a29d89123ae03c856
  }
 --- a/drivers/net/wireless/adm8211.c
 +++ b/drivers/net/wireless/adm8211.c
-@@ -1319,19 +1319,37 @@ static void adm8211_bss_info_changed(str
+@@ -1320,19 +1320,37 @@ static void adm8211_bss_info_changed(str
  }
  
  static u64 adm8211_prepare_multicast(struct ieee80211_hw *hw,
@@ -217,7 +217,7 @@ This also backport commit 2f787b0b76bf5de2eaa3ca3a29d89123ae03c856
  }
 --- a/drivers/net/wireless/libertas/main.c
 +++ b/drivers/net/wireless/libertas/main.c
-@@ -311,18 +311,34 @@ static int lbs_add_mcast_addrs(struct cm
+@@ -313,18 +313,34 @@ static int lbs_add_mcast_addrs(struct cm
  	netif_addr_lock_bh(dev);
  	cnt = netdev_mc_count(dev);
  	netdev_for_each_mc_addr(ha, dev) {
@@ -254,7 +254,7 @@ This also backport commit 2f787b0b76bf5de2eaa3ca3a29d89123ae03c856
  	}
 --- a/drivers/net/wireless/libertas_tf/main.c
 +++ b/drivers/net/wireless/libertas_tf/main.c
-@@ -418,20 +418,36 @@ static int lbtf_op_config(struct ieee802
+@@ -419,20 +419,36 @@ static int lbtf_op_config(struct ieee802
  }
  
  static u64 lbtf_op_prepare_multicast(struct ieee80211_hw *hw,
@@ -435,7 +435,7 @@ This also backport commit 2f787b0b76bf5de2eaa3ca3a29d89123ae03c856
  			      size_t fw_name_len, u32 *hw_ver);
 --- a/drivers/net/wireless/p54/main.c
 +++ b/drivers/net/wireless/p54/main.c
-@@ -359,11 +359,18 @@ out:
+@@ -360,11 +360,18 @@ out:
  	return ret;
  }
  
@@ -454,7 +454,7 @@ This also backport commit 2f787b0b76bf5de2eaa3ca3a29d89123ae03c856
  	int i;
  
  	BUILD_BUG_ON(ARRAY_SIZE(priv->mc_maclist) !=
-@@ -373,12 +380,23 @@ static u64 p54_prepare_multicast(struct
+@@ -374,12 +381,23 @@ static u64 p54_prepare_multicast(struct
  	 * Otherwise the firmware will drop it and ARP will no longer work.
  	 */
  	i = 1;
@@ -494,7 +494,7 @@ This also backport commit 2f787b0b76bf5de2eaa3ca3a29d89123ae03c856
  
 --- a/drivers/net/wireless/rtl818x/rtl8180/dev.c
 +++ b/drivers/net/wireless/rtl818x/rtl8180/dev.c
-@@ -813,10 +813,19 @@ static void rtl8180_bss_info_changed(str
+@@ -814,10 +814,19 @@ static void rtl8180_bss_info_changed(str
  	}
  }
  
@@ -516,7 +516,7 @@ This also backport commit 2f787b0b76bf5de2eaa3ca3a29d89123ae03c856
  static void rtl8180_configure_filter(struct ieee80211_hw *dev,
 --- a/drivers/net/wireless/rtl818x/rtl8187/dev.c
 +++ b/drivers/net/wireless/rtl818x/rtl8187/dev.c
-@@ -1204,9 +1204,17 @@ static void rtl8187_bss_info_changed(str
+@@ -1205,9 +1205,17 @@ static void rtl8187_bss_info_changed(str
  }
  
  static u64 rtl8187_prepare_multicast(struct ieee80211_hw *dev,
@@ -536,7 +536,7 @@ This also backport commit 2f787b0b76bf5de2eaa3ca3a29d89123ae03c856
  static void rtl8187_configure_filter(struct ieee80211_hw *dev,
 --- a/drivers/net/wireless/wl12xx/main.c
 +++ b/drivers/net/wireless/wl12xx/main.c
-@@ -2467,11 +2467,20 @@ struct wl1271_filter_params {
+@@ -2464,11 +2464,20 @@ struct wl1271_filter_params {
  	u8 mc_list[ACX_MC_ADDRESS_GROUP_MAX][ETH_ALEN];
  };
  
@@ -557,7 +557,7 @@ This also backport commit 2f787b0b76bf5de2eaa3ca3a29d89123ae03c856
  	struct wl1271 *wl = hw->priv;
  
  	if (unlikely(wl->state == WL1271_STATE_OFF))
-@@ -2484,16 +2493,40 @@ static u64 wl1271_op_prepare_multicast(s
+@@ -2481,16 +2490,40 @@ static u64 wl1271_op_prepare_multicast(s
  	}
  
  	/* update multicast filtering parameters */
@@ -635,10 +635,10 @@ This also backport commit 2f787b0b76bf5de2eaa3ca3a29d89123ae03c856
  	}
  
  	return hash.low | ((u64)hash.high << 32);
---- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
-+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
-@@ -213,7 +213,11 @@ static void _brcmf_set_multicast_list(st
- 	netdev_for_each_mc_addr(ha, dev) {
+--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
++++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
+@@ -172,7 +172,11 @@ static void _brcmf_set_multicast_list(st
+ 	netdev_for_each_mc_addr(ha, ndev) {
  		if (!cnt)
  			break;
 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
@@ -651,7 +651,7 @@ This also backport commit 2f787b0b76bf5de2eaa3ca3a29d89123ae03c856
  	}
 --- a/include/net/mac80211.h
 +++ b/include/net/mac80211.h
-@@ -1960,7 +1960,11 @@ struct ieee80211_ops {
+@@ -2112,7 +2112,11 @@ struct ieee80211_ops {
  			       enum ieee80211_tx_sync_type type);
  
  	u64 (*prepare_multicast)(struct ieee80211_hw *hw,
@@ -712,7 +712,7 @@ This also backport commit 2f787b0b76bf5de2eaa3ca3a29d89123ae03c856
  
 --- a/net/mac80211/ieee80211_i.h
 +++ b/net/mac80211/ieee80211_i.h
-@@ -776,7 +776,12 @@ struct ieee80211_local {
+@@ -780,7 +780,12 @@ struct ieee80211_local {
  	struct work_struct recalc_smps;
  
  	/* aggregated multicast list */
@@ -768,7 +768,7 @@ This also backport commit 2f787b0b76bf5de2eaa3ca3a29d89123ae03c856
  	spin_unlock_bh(&local->filter_lock);
  
  	/* be a bit nasty */
-@@ -616,9 +620,11 @@ struct ieee80211_hw *ieee80211_alloc_hw(
+@@ -630,9 +634,11 @@ struct ieee80211_hw *ieee80211_alloc_hw(
  	local->uapsd_max_sp_len = IEEE80211_DEFAULT_MAX_SP_LEN;
  
  	INIT_LIST_HEAD(&local->interfaces);
diff --git a/patches/29-sdio_no_suspend.patch b/patches/29-sdio_no_suspend.patch
index 1d09d34..934eb94 100644
--- a/patches/29-sdio_no_suspend.patch
+++ b/patches/29-sdio_no_suspend.patch
@@ -96,7 +96,7 @@ suspend and resume that are not backported.
  /*******************************************************************/
 --- a/drivers/net/wireless/mwifiex/sdio.c
 +++ b/drivers/net/wireless/mwifiex/sdio.c
-@@ -126,8 +126,10 @@ mwifiex_sdio_remove(struct sdio_func *fu
+@@ -127,8 +127,10 @@ mwifiex_sdio_remove(struct sdio_func *fu
  		return;
  
  	if (user_rmmod) {
@@ -107,7 +107,7 @@ suspend and resume that are not backported.
  
  		for (i = 0; i < adapter->priv_num; i++)
  			if ((GET_BSS_ROLE(adapter->priv[i]) ==
-@@ -147,6 +149,7 @@ mwifiex_sdio_remove(struct sdio_func *fu
+@@ -148,6 +150,7 @@ mwifiex_sdio_remove(struct sdio_func *fu
  	kfree(card);
  }
  
@@ -115,7 +115,7 @@ suspend and resume that are not backported.
  /*
   * SDIO suspend.
   *
-@@ -254,6 +257,7 @@ static int mwifiex_sdio_resume(struct de
+@@ -255,6 +258,7 @@ static int mwifiex_sdio_resume(struct de
  
  	return 0;
  }
@@ -123,7 +123,7 @@ suspend and resume that are not backported.
  
  /* Device ID for SD8787 */
  #define SDIO_DEVICE_ID_MARVELL_8787   (0x9119)
-@@ -266,10 +270,12 @@ static const struct sdio_device_id mwifi
+@@ -267,10 +271,12 @@ static const struct sdio_device_id mwifi
  
  MODULE_DEVICE_TABLE(sdio, mwifiex_ids);
  
@@ -136,7 +136,7 @@ suspend and resume that are not backported.
  
  static struct sdio_driver mwifiex_sdio = {
  	.name = "mwifiex_sdio",
-@@ -278,7 +284,9 @@ static struct sdio_driver mwifiex_sdio =
+@@ -279,7 +285,9 @@ static struct sdio_driver mwifiex_sdio =
  	.remove = mwifiex_sdio_remove,
  	.drv = {
  		.owner = THIS_MODULE,
@@ -146,8 +146,8 @@ suspend and resume that are not backported.
  	}
  };
  
---- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
-+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+--- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c
++++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c
 @@ -55,7 +55,7 @@ static bool
  brcmf_pm_resume_error(struct brcmf_sdio_dev *sdiodev)
  {
@@ -166,7 +166,7 @@ suspend and resume that are not backported.
  	int retry = 0;
  	while (atomic_read(&sdiodev->suspend) && retry++ != 30)
  		wait_event_timeout(*wq, false, HZ/100);
-@@ -564,7 +564,7 @@ static void brcmf_ops_sdio_remove(struct
+@@ -550,7 +550,7 @@ static void brcmf_ops_sdio_remove(struct
  	}
  }
  
@@ -175,7 +175,7 @@ suspend and resume that are not backported.
  static int brcmf_sdio_suspend(struct device *dev)
  {
  	mmc_pm_flag_t sdio_flags;
-@@ -617,7 +617,7 @@ static struct sdio_driver brcmf_sdmmc_dr
+@@ -603,7 +603,7 @@ static struct sdio_driver brcmf_sdmmc_dr
  	.remove = brcmf_ops_sdio_remove,
  	.name = "brcmfmac",
  	.id_table = brcmf_sdmmc_ids,
diff --git a/patches/35-fix-makefile-includes.patch b/patches/35-fix-makefile-includes.patch
index c9f8eb1..3207ab0 100644
--- a/patches/35-fix-makefile-includes.patch
+++ b/patches/35-fix-makefile-includes.patch
@@ -18,42 +18,42 @@ path the make process will search in the kernel tree for the headers.
  
 -ccflags-y += -Idrivers/net/wireless/rtl818x
 +ccflags-y += -I$(obj)/..
---- a/drivers/staging/brcm80211/brcmfmac/Makefile
-+++ b/drivers/staging/brcm80211/brcmfmac/Makefile
+--- a/drivers/net/wireless/brcm80211/brcmfmac/Makefile
++++ b/drivers/net/wireless/brcm80211/brcmfmac/Makefile
 @@ -16,8 +16,8 @@
  # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  
  ccflags-y += \
--	-Idrivers/staging/brcm80211/brcmfmac	\
--	-Idrivers/staging/brcm80211/include
+-	-Idrivers/net/wireless/brcm80211/brcmfmac	\
+-	-Idrivers/net/wireless/brcm80211/include
 +	-I$(obj)		\
 +	-I$(obj)/../include
  
  DHDOFILES = \
  	wl_cfg80211.o \
---- a/drivers/staging/brcm80211/brcmsmac/Makefile
-+++ b/drivers/staging/brcm80211/brcmsmac/Makefile
+--- a/drivers/net/wireless/brcm80211/brcmsmac/Makefile
++++ b/drivers/net/wireless/brcm80211/brcmsmac/Makefile
 @@ -17,9 +17,9 @@
  
  ccflags-y := \
  	-D__CHECK_ENDIAN__ \
--	-Idrivers/staging/brcm80211/brcmsmac \
--	-Idrivers/staging/brcm80211/brcmsmac/phy \
--	-Idrivers/staging/brcm80211/include
+-	-Idrivers/net/wireless/brcm80211/brcmsmac \
+-	-Idrivers/net/wireless/brcm80211/brcmsmac/phy \
+-	-Idrivers/net/wireless/brcm80211/include
 +	-I$(obj)				\
 +	-I$(obj)/phy				\
 +	-I$(obj)/../include
  
  BRCMSMAC_OFILES := \
  	mac80211_if.o \
---- a/drivers/staging/brcm80211/brcmutil/Makefile
-+++ b/drivers/staging/brcm80211/brcmutil/Makefile
+--- a/drivers/net/wireless/brcm80211/brcmutil/Makefile
++++ b/drivers/net/wireless/brcm80211/brcmutil/Makefile
 @@ -16,8 +16,8 @@
  # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  
  ccflags-y :=				\
--	-Idrivers/staging/brcm80211/brcmutil \
--	-Idrivers/staging/brcm80211/include
+-	-Idrivers/net/wireless/brcm80211/brcmutil \
+-	-Idrivers/net/wireless/brcm80211/include
 +	-I$(obj)			\
 +	-I$(obj)/../include
  
diff --git a/scripts/admin-update.sh b/scripts/admin-update.sh
index 061748c..3e63e51 100755
--- a/scripts/admin-update.sh
+++ b/scripts/admin-update.sh
@@ -224,6 +224,12 @@ DRIVERS="$DRIVERS drivers/ssb"
 DRIVERS="$DRIVERS drivers/bcma"
 DRIVERS="$DRIVERS drivers/net/wireless/b43"
 DRIVERS="$DRIVERS drivers/net/wireless/b43legacy"
+DRIVERS="$DRIVERS drivers/net/wireless/brcm80211"
+DRIVERS="$DRIVERS drivers/net/wireless/brcm80211/brcmfmac"
+DRIVERS="$DRIVERS drivers/net/wireless/brcm80211/brcmsmac"
+DRIVERS="$DRIVERS drivers/net/wireless/brcm80211/brcmsmac/phy"
+DRIVERS="$DRIVERS drivers/net/wireless/brcm80211/brcmutil"
+DRIVERS="$DRIVERS drivers/net/wireless/brcm80211/include"
 DRIVERS="$DRIVERS drivers/net/wireless/iwlegacy"
 DRIVERS="$DRIVERS drivers/net/wireless/iwlwifi"
 DRIVERS="$DRIVERS drivers/net/wireless/rt2x00"
@@ -248,7 +254,7 @@ DRIVERS="$DRIVERS drivers/net/wireless/orinoco"
 DRIVERS="$DRIVERS drivers/net/wireless/mwifiex"
 
 # Staging drivers
-STAGING_DRIVERS="drivers/staging/brcm80211"
+STAGING_DRIVERS=""
 
 # Ethernet drivers
 DRIVERS="$DRIVERS drivers/net/ethernet/atheros"
diff --git a/scripts/driver-select b/scripts/driver-select
index f571519..3619541 100755
--- a/scripts/driver-select
+++ b/scripts/driver-select
@@ -7,6 +7,7 @@
 DRIVERS_MAKEFILE="drivers/net/wireless/Makefile"
 ATH_MAKEFILE="drivers/net/wireless/ath/Makefile"
 ATH9K_MAKEFILE="drivers/net/wireless/ath/ath9k/Makefile"
+BRCM80211_MAKEFILE="drivers/net/wireless/brcm80211/Makefile"
 RT2X00_MAKEFILE="drivers/net/wireless/rt2x00/Makefile"
 NET_WIRELESS_MAKEFILE="net/wireless/Makefile"
 EEPROM_MAKEFILE="drivers/misc/eeprom/Makefile"
@@ -32,11 +33,7 @@ PURPLE="\033[35m"
 CYAN="\033[36m"
 UNDERLINE="\033[02m"
 
-SUPPORTED_80211_DRIVERS="ath5k ath9k ath9k_htc carl9170 ath6kl b43 zd1211rw rt2x00 wl1251 wl12xx"
-
-if [ -d drivers/staging/brcm80211 ]; then
-	SUPPORTED_80211_DRIVERS="$SUPPORTED_80211_DRIVERS brcm80211"
-fi
+SUPPORTED_80211_DRIVERS="ath5k ath9k ath9k_htc carl9170 ath6kl b43 zd1211rw rt2x00 wl1251 wl12xx brcmsmac brcmfmac"
 
 # b43 needs some more work for driver-select, the SSB stuff, plus
 # what if you update b44 but not b43? It will bust.
@@ -55,6 +52,7 @@ function usage {
 	echo -e "\nSupported group drivers:"
 	echo -e "\t${CYAN}atheros${NORMAL} < ${PURPLE} ath5k ath9k carl9170 zd1211rw ath6kl ${NORMAL}>"
 	echo -e "\t${CYAN}ath${NORMAL} < ${PURPLE} ath5k ath9k carl9170 ath6kl ${NORMAL}>"
+	echo -e "\t${CYAN}brcm80211${NORMAL} < ${PURPLE} brcmsmac brcmfmac ${NORMAL}>"
 	echo -e "\t${CYAN}iwlagn${NORMAL} < ${PURPLE} iwlagn ${NORMAL}>"
 	echo -e "\t${CYAN}rtl818x${NORMAL} < ${PURPLE} rtl8180 rtl8187 ${NORMAL}>"
 	echo -e "\t${CYAN}rtlwifi${NORMAL} < ${PURPLE} rtl8192ce ${NORMAL}>"
@@ -220,11 +218,6 @@ function disable_staging {
 	perl -i -ne 'print if ! /CONFIG_COMPAT_STAGING/ ' Makefile
 }
 
-function disable_brcm80211 {
-	backup_file Makefile
-	perl -i -ne 'print if ! /brcm80211/ ' Makefile
-}
-
 function disable_update-initramfs
 {
 	backup_file Makefile
@@ -244,6 +237,12 @@ function select_ath9k_driver
 	# In the future here we'll add stuff to disable ath9k_htc
 }
 
+function select_brcm80211_driver 
+{
+	backup_file $BRCM80211_MAKEFILE
+	perl -i -ne 'print if /'$1'/ || /CONFIG_BRCMUTIL/ ' $BRCM80211_MAKEFILE
+}
+
 function restore_file {
 	#ORIG=$(shell ${1%%.${BACKUP_EXT}})
 	ORIG=${1%%.bk}
@@ -306,7 +305,6 @@ case $1 in
 		;;
 	ath)
 		disable_bt_usb_ethernet_var
-		disable_brcm80211
 		select_drivers		CONFIG_ATH_COMMON
 		disable_var_01
 		;;
@@ -347,6 +345,13 @@ case $1 in
 		disable_staging
 		disable_var_01
 		;;
+	brcm80211)
+		disable_staging
+		disable_bt_usb_ethernet_var
+		select_drivers		CONFIG_BRCMUTIL \
+					CONFIG_BRCMFMAC \
+					CONFIG_BRCMSMAC
+		;;
 # Singular modules
 	ath5k)
 		disable_staging
@@ -379,9 +384,17 @@ case $1 in
 		select_driver		CONFIG_ATH_COMMON
 		select_ath_driver	CONFIG_ATH6KL
 		;;
-	brcm80211)
+	brcmsmac)
+		disable_staging
+		disable_bt_usb_ethernet_var
+		select_drivers		CONFIG_BRCMUTIL CONFIG_BRCMFMAC
+		select_brcm80211_driver	CONFIG_BRCMSMAC
+		;;
+	brcmfmac)
+		disable_staging
 		disable_bt_usb_ethernet_var
-		select_driver		CONFIG_NOTHING
+		select_drivers		CONFIG_BRCMUTIL CONFIG_BRCMFMAC
+		select_brcm80211_driver	CONFIG_BRCMFMAC
 		;;
 	zd1211rw)
 		select_driver		CONFIG_COMPAT_ZD1211RW
-- 
1.7.4.1


^ permalink raw reply related

* [PATCH 4/4] ath6kl: add debug level for hif
From: Kalle Valo @ 2011-10-13 12:21 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless
In-Reply-To: <20111013122115.30551.94.stgit@localhost6.localdomain6>

That way we htc level debug messages can be removed from hif files. Also
add few new messages and remove useless debug message about using
synchrous irq processing (we don't support anything else).

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath6kl/debug.h   |    2 +-
 drivers/net/wireless/ath/ath6kl/hif-ops.h |   18 ++++++++++++++++++
 drivers/net/wireless/ath/ath6kl/hif.c     |   17 ++++++++---------
 3 files changed, 27 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/debug.h b/drivers/net/wireless/ath/ath6kl/debug.h
index 01f4015..cbabc25 100644
--- a/drivers/net/wireless/ath/ath6kl/debug.h
+++ b/drivers/net/wireless/ath/ath6kl/debug.h
@@ -26,7 +26,7 @@ enum ATH6K_DEBUG_MASK {
 	ATH6KL_DBG_WLAN_RX      = BIT(3),     /* wlan rx */
 	ATH6KL_DBG_BMI		= BIT(4),     /* bmi tracing */
 	ATH6KL_DBG_HTC		= BIT(5),
-	/* hole */
+	ATH6KL_DBG_HIF		= BIT(6),
 	ATH6KL_DBG_IRQ		= BIT(7),     /* interrupt processing */
 	ATH6KL_DBG_PM           = BIT(8),     /* power management */
 	ATH6KL_DBG_WLAN_NODE    = BIT(9),     /* general wlan node tracing */
diff --git a/drivers/net/wireless/ath/ath6kl/hif-ops.h b/drivers/net/wireless/ath/ath6kl/hif-ops.h
index 21b1575..95e7303 100644
--- a/drivers/net/wireless/ath/ath6kl/hif-ops.h
+++ b/drivers/net/wireless/ath/ath6kl/hif-ops.h
@@ -18,10 +18,16 @@
 #define HIF_OPS_H
 
 #include "hif.h"
+#include "debug.h"
 
 static inline int hif_read_write_sync(struct ath6kl *ar, u32 addr, u8 *buf,
 				      u32 len, u32 request)
 {
+	ath6kl_dbg(ATH6KL_DBG_HIF,
+		   "hif %s sync addr 0x%x buf 0x%p len %d request 0x%x\n",
+		   (request & HIF_WRITE) ? "write" : "read",
+		   addr, buf, len, request);
+
 	return ar->hif_ops->read_write_sync(ar, addr, buf, len, request);
 }
 
@@ -29,16 +35,24 @@ static inline int hif_write_async(struct ath6kl *ar, u32 address, u8 *buffer,
 				  u32 length, u32 request,
 				  struct htc_packet *packet)
 {
+	ath6kl_dbg(ATH6KL_DBG_HIF,
+		   "hif write async addr 0x%x buf 0x%p len %d request 0x%x\n",
+		   address, buffer, length, request);
+
 	return ar->hif_ops->write_async(ar, address, buffer, length,
 					request, packet);
 }
 static inline void ath6kl_hif_irq_enable(struct ath6kl *ar)
 {
+	ath6kl_dbg(ATH6KL_DBG_HIF, "hif irq enable\n");
+
 	return ar->hif_ops->irq_enable(ar);
 }
 
 static inline void ath6kl_hif_irq_disable(struct ath6kl *ar)
 {
+	ath6kl_dbg(ATH6KL_DBG_HIF, "hif irq disable\n");
+
 	return ar->hif_ops->irq_disable(ar);
 }
 
@@ -71,11 +85,15 @@ static inline void ath6kl_hif_cleanup_scatter(struct ath6kl *ar)
 
 static inline int ath6kl_hif_suspend(struct ath6kl *ar)
 {
+	ath6kl_dbg(ATH6KL_DBG_HIF, "hif suspend\n");
+
 	return ar->hif_ops->suspend(ar);
 }
 
 static inline int ath6kl_hif_resume(struct ath6kl *ar)
 {
+	ath6kl_dbg(ATH6KL_DBG_HIF, "hif resume\n");
+
 	return ar->hif_ops->resume(ar);
 }
 #endif
diff --git a/drivers/net/wireless/ath/ath6kl/hif.c b/drivers/net/wireless/ath/ath6kl/hif.c
index 7cc6cec..e2d8088 100644
--- a/drivers/net/wireless/ath/ath6kl/hif.c
+++ b/drivers/net/wireless/ath/ath6kl/hif.c
@@ -51,8 +51,7 @@ int ath6kl_hif_rw_comp_handler(void *context, int status)
 {
 	struct htc_packet *packet = context;
 
-	ath6kl_dbg(ATH6KL_DBG_HTC,
-		   "ath6kl_hif_rw_comp_handler (pkt:0x%p , status: %d\n",
+	ath6kl_dbg(ATH6KL_DBG_HIF, "hif rw completion pkt 0x%p status %d\n",
 		   packet, status);
 
 	packet->status = status;
@@ -119,7 +118,7 @@ int ath6kl_hif_poll_mboxmsg_rx(struct ath6kl_device *dev, u32 *lk_ahd,
 
 		/* delay a little  */
 		mdelay(ATH6KL_TIME_QUANTUM);
-		ath6kl_dbg(ATH6KL_DBG_HTC, "retry mbox poll : %d\n", i);
+		ath6kl_dbg(ATH6KL_DBG_HIF, "hif retry mbox poll try %d\n", i);
 	}
 
 	if (i == 0) {
@@ -147,6 +146,9 @@ int ath6kl_hif_rx_control(struct ath6kl_device *dev, bool enable_rx)
 	struct ath6kl_irq_enable_reg regs;
 	int status = 0;
 
+	ath6kl_dbg(ATH6KL_DBG_HIF, "hif rx %s\n",
+		   enable_rx ? "enable" : "disable");
+
 	/* take the lock to protect interrupt enable shadows */
 	spin_lock_bh(&dev->lock);
 
@@ -186,8 +188,8 @@ int ath6kl_hif_submit_scat_req(struct ath6kl_device *dev,
 			dev->ar->mbox_info.htc_addr;
 	}
 
-	ath6kl_dbg(ATH6KL_DBG_HTC,
-		   "ath6kl_hif_submit_scat_req, entries: %d, total len: %d mbox:0x%X (mode: %s : %s)\n",
+	ath6kl_dbg(ATH6KL_DBG_HIF,
+		   "hif submit scatter request entries %d len %d mbox 0x%x %s %s\n",
 		   scat_req->scat_entries, scat_req->len,
 		   scat_req->addr, !read ? "async" : "sync",
 		   (read) ? "rd" : "wr");
@@ -629,12 +631,9 @@ int ath6kl_hif_setup(struct ath6kl_device *dev)
 	/* assemble mask, used for padding to a block */
 	dev->htc_cnxt->block_mask = dev->htc_cnxt->block_sz - 1;
 
-	ath6kl_dbg(ATH6KL_DBG_TRC, "block size: %d, mbox addr:0x%X\n",
+	ath6kl_dbg(ATH6KL_DBG_HIF, "hif block size %d mbox addr 0x%x\n",
 		   dev->htc_cnxt->block_sz, dev->ar->mbox_info.htc_addr);
 
-	ath6kl_dbg(ATH6KL_DBG_TRC,
-		   "hif interrupt processing is sync only\n");
-
 	status = ath6kl_hif_disable_intrs(dev);
 
 fail_setup:


^ permalink raw reply related

* [PATCH 3/4] ath6kl: don't dump full htc packets
From: Kalle Valo @ 2011-10-13 12:21 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless
In-Reply-To: <20111013122115.30551.94.stgit@localhost6.localdomain6>

It's currently possible to dump full sdio packets, so dumping htc packets
is not strictly needed. So remove it, we can always add it back if
there ever comes a need for that.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath6kl/htc.c |   11 -----------
 1 files changed, 0 insertions(+), 11 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/htc.c b/drivers/net/wireless/ath/ath6kl/htc.c
index 840f1b3..3cd3ef5 100644
--- a/drivers/net/wireless/ath/ath6kl/htc.c
+++ b/drivers/net/wireless/ath/ath6kl/htc.c
@@ -1431,10 +1431,6 @@ static int ath6kl_htc_rx_process_hdr(struct htc_target *target,
 	if (n_lkahds != NULL)
 		*n_lkahds = 0;
 
-	/* FIXME: is this needed? */
-	ath6kl_dbg_dump(ATH6KL_DBG_HTC, "htc rx", "htc rx",
-			packet->buf, packet->act_len);
-
 	/*
 	 * NOTE: we cannot assume the alignment of buf, so we use the safe
 	 * macros to retrieve 16 bit fields.
@@ -1516,13 +1512,6 @@ fail_rx:
 	if (status)
 		ath6kl_dbg_dump(ATH6KL_DBG_HTC, "htc rx bad packet",
 				"", packet->buf, packet->act_len);
-	else {
-		/* FIXME: is this needed? */
-		if (packet->act_len > 0)
-			ath6kl_dbg_dump(ATH6KL_DBG_HTC,
-					"htc rx application message", "",
-					packet->buf, packet->act_len);
-	}
 
 	return status;
 }


^ permalink raw reply related

* [PATCH 2/4] ath6kl: cleanup htc debug messages
From: Kalle Valo @ 2011-10-13 12:21 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless
In-Reply-To: <20111013122115.30551.94.stgit@localhost6.localdomain6>

Unify debug message format and other minor changes.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath6kl/htc.c |  138 ++++++++++++++++-----------------
 1 files changed, 67 insertions(+), 71 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/htc.c b/drivers/net/wireless/ath/ath6kl/htc.c
index 241a7ce..840f1b3 100644
--- a/drivers/net/wireless/ath/ath6kl/htc.c
+++ b/drivers/net/wireless/ath/ath6kl/htc.c
@@ -102,7 +102,7 @@ static void htc_tx_comp_update(struct htc_target *target,
 				packet->info.tx.cred_used;
 	endpoint->cred_dist.txq_depth = get_queue_depth(&endpoint->txq);
 
-	ath6kl_dbg(ATH6KL_DBG_HTC, "ctxt:0x%p dist:0x%p\n",
+	ath6kl_dbg(ATH6KL_DBG_HTC, "htc tx ctxt 0x%p dist 0x%p\n",
 		   target->cred_dist_cntxt, &target->cred_dist_list);
 
 	ath6k_credit_distribute(target->cred_dist_cntxt,
@@ -119,7 +119,7 @@ static void htc_tx_complete(struct htc_endpoint *endpoint,
 		return;
 
 	ath6kl_dbg(ATH6KL_DBG_HTC,
-		   "send complete ep %d, (%d pkts)\n",
+		   "htc tx complete ep %d pkts %d\n",
 		   endpoint->eid, get_queue_depth(txq));
 
 	ath6kl_tx_complete(endpoint->target->dev->ar, txq);
@@ -149,7 +149,7 @@ static void htc_async_tx_scat_complete(struct htc_target *target,
 	INIT_LIST_HEAD(&tx_compq);
 
 	ath6kl_dbg(ATH6KL_DBG_HTC,
-		"htc_async_tx_scat_complete  total len: %d  entries: %d\n",
+		"htc tx scat complete len %d entries %d\n",
 		scat_req->len, scat_req->scat_entries);
 
 	if (scat_req->status)
@@ -190,16 +190,13 @@ static int ath6kl_htc_tx_issue(struct htc_target *target,
 
 	send_len = packet->act_len + HTC_HDR_LENGTH;
 
-	ath6kl_dbg(ATH6KL_DBG_HTC, "%s: transmit len : %d (%s)\n",
-		   __func__, send_len, sync ? "sync" : "async");
-
 	padded_len = CALC_TXRX_PADDED_LEN(target, send_len);
 
 	ath6kl_dbg(ATH6KL_DBG_HTC,
-		"DevSendPacket, padded len: %d mbox:0x%X (mode:%s)\n",
-		padded_len,
-		target->dev->ar->mbox_info.htc_addr,
-		sync ? "sync" : "async");
+		   "htc tx issue len %d padded_len %d mbox 0x%X %s\n",
+		   send_len, padded_len,
+		   target->dev->ar->mbox_info.htc_addr,
+		   sync ? "sync" : "async");
 
 	if (sync) {
 		status = hif_read_write_sync(target->dev->ar,
@@ -227,7 +224,7 @@ static int htc_check_credits(struct htc_target *target,
 	*req_cred = (len > target->tgt_cred_sz) ?
 		     DIV_ROUND_UP(len, target->tgt_cred_sz) : 1;
 
-	ath6kl_dbg(ATH6KL_DBG_HTC, "creds required:%d got:%d\n",
+	ath6kl_dbg(ATH6KL_DBG_HTC, "htc creds required %d got %d\n",
 		   *req_cred, ep->cred_dist.credits);
 
 	if (ep->cred_dist.credits < *req_cred) {
@@ -237,7 +234,7 @@ static int htc_check_credits(struct htc_target *target,
 		/* Seek more credits */
 		ep->cred_dist.seek_cred = *req_cred - ep->cred_dist.credits;
 
-		ath6kl_dbg(ATH6KL_DBG_HTC, "ctxt:0x%p dist:0x%p\n",
+		ath6kl_dbg(ATH6KL_DBG_HTC, "htc creds ctxt 0x%p dist 0x%p\n",
 			   target->cred_dist_cntxt, &ep->cred_dist);
 
 		ath6k_seek_credits(target->cred_dist_cntxt, &ep->cred_dist);
@@ -246,7 +243,7 @@ static int htc_check_credits(struct htc_target *target,
 
 		if (ep->cred_dist.credits < *req_cred) {
 			ath6kl_dbg(ATH6KL_DBG_HTC,
-				   "not enough credits for ep %d - leaving packet in queue\n",
+				   "htc creds not enough credits for ep %d\n",
 				   eid);
 			return -EINVAL;
 		}
@@ -260,7 +257,7 @@ static int htc_check_credits(struct htc_target *target,
 		ep->cred_dist.seek_cred =
 		ep->cred_dist.cred_per_msg - ep->cred_dist.credits;
 
-		ath6kl_dbg(ATH6KL_DBG_HTC, "ctxt:0x%p dist:0x%p\n",
+		ath6kl_dbg(ATH6KL_DBG_HTC, "htc creds ctxt 0x%p dist 0x%p\n",
 			   target->cred_dist_cntxt, &ep->cred_dist);
 
 		ath6k_seek_credits(target->cred_dist_cntxt, &ep->cred_dist);
@@ -270,7 +267,7 @@ static int htc_check_credits(struct htc_target *target,
 			/* tell the target we need credits ASAP! */
 			*flags |= HTC_FLAGS_NEED_CREDIT_UPDATE;
 			ep->ep_st.cred_low_indicate += 1;
-			ath6kl_dbg(ATH6KL_DBG_HTC, "host needs credits\n");
+			ath6kl_dbg(ATH6KL_DBG_HTC, "htc creds host needs credits\n");
 		}
 	}
 
@@ -296,7 +293,7 @@ static void ath6kl_htc_tx_pkts_get(struct htc_target *target,
 					  list);
 
 		ath6kl_dbg(ATH6KL_DBG_HTC,
-			"got head pkt:0x%p , queue depth: %d\n",
+			"htc tx got packet 0x%p queue depth %d\n",
 			packet, get_queue_depth(&endpoint->txq));
 
 		len = CALC_TXRX_PADDED_LEN(target,
@@ -405,7 +402,7 @@ static int ath6kl_htc_tx_setup_scat_list(struct htc_target *target,
 		scat_req->len += len;
 		scat_req->scat_entries++;
 		ath6kl_dbg(ATH6KL_DBG_HTC,
-			   "%d, adding pkt : 0x%p len:%d (remaining space:%d)\n",
+			   "htc tx adding (%d) pkt 0x%p len %d remaining %d\n",
 			   i, packet, len, rem_scat);
 	}
 
@@ -456,11 +453,11 @@ static void ath6kl_htc_tx_bundle(struct htc_endpoint *endpoint,
 		if (!scat_req) {
 			/* no scatter resources  */
 			ath6kl_dbg(ATH6KL_DBG_HTC,
-				"no more scatter resources\n");
+				"htc tx no more scatter resources\n");
 			break;
 		}
 
-		ath6kl_dbg(ATH6KL_DBG_HTC, "pkts to scatter: %d\n",
+		ath6kl_dbg(ATH6KL_DBG_HTC, "htc tx pkts to scatter: %d\n",
 			   n_scat);
 
 		scat_req->len = 0;
@@ -480,7 +477,7 @@ static void ath6kl_htc_tx_bundle(struct htc_endpoint *endpoint,
 		tot_pkts_bundle += scat_req->scat_entries;
 
 		ath6kl_dbg(ATH6KL_DBG_HTC,
-			   "send scatter total bytes: %d , entries: %d\n",
+			   "htc tx scatter bytes %d entries %d\n",
 			   scat_req->len, scat_req->scat_entries);
 		ath6kl_hif_submit_scat_req(target->dev, scat_req, false);
 
@@ -490,8 +487,8 @@ static void ath6kl_htc_tx_bundle(struct htc_endpoint *endpoint,
 
 	*sent_bundle = n_sent_bundle;
 	*n_bundle_pkts = tot_pkts_bundle;
-	ath6kl_dbg(ATH6KL_DBG_HTC, "%s (sent:%d)\n",
-		   __func__, n_sent_bundle);
+	ath6kl_dbg(ATH6KL_DBG_HTC, "htc tx bundle sent %d pkts\n",
+		   n_sent_bundle);
 
 	return;
 }
@@ -510,7 +507,7 @@ static void ath6kl_htc_tx_from_queue(struct htc_target *target,
 	if (endpoint->tx_proc_cnt > 1) {
 		endpoint->tx_proc_cnt--;
 		spin_unlock_bh(&target->tx_lock);
-		ath6kl_dbg(ATH6KL_DBG_HTC, "htc_try_send (busy)\n");
+		ath6kl_dbg(ATH6KL_DBG_HTC, "htc tx busy\n");
 		return;
 	}
 
@@ -589,14 +586,11 @@ static bool ath6kl_htc_tx_try(struct htc_target *target,
 
 	if (overflow)
 		ath6kl_dbg(ATH6KL_DBG_HTC,
-			   "ep %d, tx queue will overflow :%d , tx depth:%d, max:%d\n",
-			   endpoint->eid, overflow, txq_depth,
+			   "htc tx overflow ep %d depth %d max %d\n",
+			   endpoint->eid, txq_depth,
 			   endpoint->max_txq_depth);
 
 	if (overflow && ep_cb.tx_full) {
-		ath6kl_dbg(ATH6KL_DBG_HTC,
-			   "indicating overflowed tx packet: 0x%p\n", tx_pkt);
-
 		if (ep_cb.tx_full(endpoint->target, tx_pkt) ==
 		    HTC_SEND_FULL_DROP) {
 			endpoint->ep_st.tx_dropped += 1;
@@ -630,7 +624,7 @@ static void htc_chk_ep_txq(struct htc_target *target)
 		spin_lock_bh(&target->tx_lock);
 		if (!list_empty(&endpoint->txq)) {
 			ath6kl_dbg(ATH6KL_DBG_HTC,
-				   "ep %d has %d credits and %d packets in tx queue\n",
+				   "htc creds ep %d credits %d pkts %d\n",
 				   cred_dist->endpoint,
 				   endpoint->cred_dist.credits,
 				   get_queue_depth(&endpoint->txq));
@@ -737,7 +731,7 @@ int ath6kl_htc_tx(struct htc_target *target, struct htc_packet *packet)
 	struct list_head queue;
 
 	ath6kl_dbg(ATH6KL_DBG_HTC,
-		   "htc_tx: ep id: %d, buf: 0x%p, len: %d\n",
+		   "htc tx ep id %d buf 0x%p len %d\n",
 		   packet->endpoint, packet->buf, packet->act_len);
 
 	if (packet->endpoint >= ENDPOINT_MAX) {
@@ -788,7 +782,7 @@ void ath6kl_htc_flush_txep(struct htc_target *target,
 		packet->status = -ECANCELED;
 		list_del(&packet->list);
 		ath6kl_dbg(ATH6KL_DBG_HTC,
-			"flushing tx pkt:0x%p, len:%d, ep:%d tag:0x%X\n",
+			"htc tx flushing pkt 0x%p len %d  ep %d tag 0x%x\n",
 			packet, packet->act_len,
 			packet->endpoint, packet->info.tx.tag);
 
@@ -844,7 +838,8 @@ void ath6kl_htc_indicate_activity_change(struct htc_target *target,
 		endpoint->cred_dist.txq_depth =
 			get_queue_depth(&endpoint->txq);
 
-		ath6kl_dbg(ATH6KL_DBG_HTC, "ctxt:0x%p dist:0x%p\n",
+		ath6kl_dbg(ATH6KL_DBG_HTC,
+			   "htc tx activity ctxt 0x%p dist 0x%p\n",
 			   target->cred_dist_cntxt, &target->cred_dist_list);
 
 		ath6k_credit_distribute(target->cred_dist_cntxt,
@@ -919,15 +914,15 @@ static int ath6kl_htc_rx_packet(struct htc_target *target,
 	padded_len = CALC_TXRX_PADDED_LEN(target, rx_len);
 
 	if (padded_len > packet->buf_len) {
-		ath6kl_err("not enough receive space for packet - padlen:%d recvlen:%d bufferlen:%d\n",
+		ath6kl_err("not enough receive space for packet - padlen %d recvlen %d bufferlen %d\n",
 			   padded_len, rx_len, packet->buf_len);
 		return -ENOMEM;
 	}
 
 	ath6kl_dbg(ATH6KL_DBG_HTC,
-		   "dev_rx_pkt (0x%p : hdr:0x%X) padded len: %d mbox:0x%X (mode:%s)\n",
+		   "htc rx 0x%p hdr x%x len %d mbox 0x%x\n",
 		   packet, packet->info.rx.exp_hdr,
-		   padded_len, dev->ar->mbox_info.htc_addr, "sync");
+		   padded_len, dev->ar->mbox_info.htc_addr);
 
 	status = hif_read_write_sync(dev->ar,
 				     dev->ar->mbox_info.htc_addr,
@@ -1138,7 +1133,7 @@ static int ath6kl_htc_rx_alloc(struct htc_target *target,
 
 			endpoint->ep_st.rx_bundle_from_hdr += 1;
 			ath6kl_dbg(ATH6KL_DBG_HTC,
-				   "htc hdr indicates :%d msg can be fetched as a bundle\n",
+				   "htc rx bundle pkts %d\n",
 				   n_msg);
 		} else
 			/* HTC header only indicates 1 message to fetch */
@@ -1191,8 +1186,8 @@ static void htc_ctrl_rx(struct htc_target *context, struct htc_packet *packets)
 		ath6kl_err("htc_ctrl_rx, got message with len:%zu\n",
 			packets->act_len + HTC_HDR_LENGTH);
 
-		ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES,
-				"Unexpected ENDPOINT 0 Message", "",
+		ath6kl_dbg_dump(ATH6KL_DBG_HTC,
+				"htc rx unexpected endpoint 0 message", "",
 				packets->buf - HTC_HDR_LENGTH,
 				packets->act_len + HTC_HDR_LENGTH);
 	}
@@ -1210,7 +1205,7 @@ static void htc_proc_cred_rpt(struct htc_target *target,
 	bool dist = false;
 
 	ath6kl_dbg(ATH6KL_DBG_HTC,
-		   "htc_proc_cred_rpt, credit report entries:%d\n", n_entries);
+		   "htc creds report entries %d\n", n_entries);
 
 	spin_lock_bh(&target->tx_lock);
 
@@ -1223,8 +1218,9 @@ static void htc_proc_cred_rpt(struct htc_target *target,
 
 		endpoint = &target->endpoint[rpt->eid];
 
-		ath6kl_dbg(ATH6KL_DBG_HTC, " ep %d got %d credits\n",
-			rpt->eid, rpt->credits);
+		ath6kl_dbg(ATH6KL_DBG_HTC,
+			   "htc creds report ep %d credits %d\n",
+			   rpt->eid, rpt->credits);
 
 		endpoint->ep_st.tx_cred_rpt += 1;
 		endpoint->ep_st.cred_retnd += rpt->credits;
@@ -1265,7 +1261,7 @@ static void htc_proc_cred_rpt(struct htc_target *target,
 	}
 
 	ath6kl_dbg(ATH6KL_DBG_HTC,
-		   "report indicated %d credits to distribute\n",
+		   "htc creds report tot_credits %d\n",
 		   tot_credits);
 
 	if (dist) {
@@ -1273,7 +1269,7 @@ static void htc_proc_cred_rpt(struct htc_target *target,
 		 * This was a credit return based on a completed send
 		 * operations note, this is done with the lock held
 		 */
-		ath6kl_dbg(ATH6KL_DBG_HTC, "ctxt:0x%p dist:0x%p\n",
+		ath6kl_dbg(ATH6KL_DBG_HTC, "htc creds ctxt 0x%p dist 0x%p\n",
 			   target->cred_dist_cntxt, &target->cred_dist_list);
 
 		ath6k_credit_distribute(target->cred_dist_cntxt,
@@ -1321,13 +1317,14 @@ static int htc_parse_trailer(struct htc_target *target,
 		    && next_lk_ahds) {
 
 			ath6kl_dbg(ATH6KL_DBG_HTC,
-				   "lk_ahd report found (pre valid:0x%X, post valid:0x%X)\n",
+				   "htc rx lk_ahd found pre_valid 0x%x post_valid 0x%x\n",
 				   lk_ahd->pre_valid, lk_ahd->post_valid);
 
 			/* look ahead bytes are valid, copy them over */
 			memcpy((u8 *)&next_lk_ahds[0], lk_ahd->lk_ahd, 4);
 
-			ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "Next Look Ahead",
+			ath6kl_dbg_dump(ATH6KL_DBG_HTC,
+					"htc rx next look ahead",
 					"", next_lk_ahds, 4);
 
 			*n_lk_ahds = 1;
@@ -1346,7 +1343,7 @@ static int htc_parse_trailer(struct htc_target *target,
 			bundle_lkahd_rpt =
 				(struct htc_bundle_lkahd_rpt *) record_buf;
 
-			ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "Bundle lk_ahd",
+			ath6kl_dbg_dump(ATH6KL_DBG_HTC, "htc rx bundle lk_ahd",
 					"", record_buf, record->len);
 
 			for (i = 0; i < len; i++) {
@@ -1378,10 +1375,8 @@ static int htc_proc_trailer(struct htc_target *target,
 	u8 *record_buf;
 	u8 *orig_buf;
 
-	ath6kl_dbg(ATH6KL_DBG_HTC, "+htc_proc_trailer (len:%d)\n", len);
-
-	ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "Recv Trailer", "",
-			buf, len);
+	ath6kl_dbg(ATH6KL_DBG_HTC, "htc rx trailer len %d\n", len);
+	ath6kl_dbg_dump(ATH6KL_DBG_HTC, NULL, "", buf, len);
 
 	orig_buf = buf;
 	orig_len = len;
@@ -1418,7 +1413,7 @@ static int htc_proc_trailer(struct htc_target *target,
 	}
 
 	if (status)
-		ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "BAD Recv Trailer",
+		ath6kl_dbg_dump(ATH6KL_DBG_HTC, "htc rx bad trailer",
 				"", orig_buf, orig_len);
 
 	return status;
@@ -1436,7 +1431,8 @@ static int ath6kl_htc_rx_process_hdr(struct htc_target *target,
 	if (n_lkahds != NULL)
 		*n_lkahds = 0;
 
-	ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "HTC Recv PKT", "htc ",
+	/* FIXME: is this needed? */
+	ath6kl_dbg_dump(ATH6KL_DBG_HTC, "htc rx", "htc rx",
 			packet->buf, packet->act_len);
 
 	/*
@@ -1480,9 +1476,9 @@ static int ath6kl_htc_rx_process_hdr(struct htc_target *target,
 	if (lk_ahd != packet->info.rx.exp_hdr) {
 		ath6kl_err("%s(): lk_ahd mismatch! (pPkt:0x%p flags:0x%X)\n",
 			   __func__, packet, packet->info.rx.rx_flags);
-		ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "Expected Message lk_ahd",
+		ath6kl_dbg_dump(ATH6KL_DBG_HTC, "htc rx expected lk_ahd",
 				"", &packet->info.rx.exp_hdr, 4);
-		ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "Current Frame Header",
+		ath6kl_dbg_dump(ATH6KL_DBG_HTC, "htc rx current header",
 				"", (u8 *)&lk_ahd, sizeof(lk_ahd));
 		status = -ENOMEM;
 		goto fail_rx;
@@ -1518,13 +1514,13 @@ static int ath6kl_htc_rx_process_hdr(struct htc_target *target,
 
 fail_rx:
 	if (status)
-		ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "BAD HTC Recv PKT",
-				"", packet->buf,
-				packet->act_len < 256 ? packet->act_len : 256);
+		ath6kl_dbg_dump(ATH6KL_DBG_HTC, "htc rx bad packet",
+				"", packet->buf, packet->act_len);
 	else {
+		/* FIXME: is this needed? */
 		if (packet->act_len > 0)
-			ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES,
-					"HTC - Application Msg", "",
+			ath6kl_dbg_dump(ATH6KL_DBG_HTC,
+					"htc rx application message", "",
 					packet->buf, packet->act_len);
 	}
 
@@ -1535,7 +1531,7 @@ static void ath6kl_htc_rx_complete(struct htc_endpoint *endpoint,
 				   struct htc_packet *packet)
 {
 		ath6kl_dbg(ATH6KL_DBG_HTC,
-			   "htc calling ep %d recv callback on packet 0x%p\n",
+			   "htc rx complete ep %d packet 0x%p\n",
 			   endpoint->eid, packet);
 		endpoint->ep_cb.rx(endpoint->target, packet);
 }
@@ -1572,8 +1568,8 @@ static int ath6kl_htc_rx_bundle(struct htc_target *target,
 	len = 0;
 
 	ath6kl_dbg(ATH6KL_DBG_HTC,
-		   "%s(): (numpackets: %d , actual : %d)\n",
-		   __func__, get_queue_depth(rxq), n_scat_pkt);
+		   "htc rx bundle depth %d pkts %d\n",
+		   get_queue_depth(rxq), n_scat_pkt);
 
 	scat_req = hif_scatter_req_get(target->dev->ar);
 
@@ -1898,7 +1894,7 @@ static struct htc_packet *htc_wait_for_ctrl_msg(struct htc_target *target)
 		return NULL;
 
 	ath6kl_dbg(ATH6KL_DBG_HTC,
-		"htc_wait_for_ctrl_msg: look_ahead : 0x%X\n", look_ahead);
+		"htc rx wait ctrl look_ahead 0x%X\n", look_ahead);
 
 	htc_hdr = (struct htc_frame_hdr *)&look_ahead;
 
@@ -1963,7 +1959,7 @@ int ath6kl_htc_add_rxbuf_multiple(struct htc_target *target,
 	depth = get_queue_depth(pkt_queue);
 
 	ath6kl_dbg(ATH6KL_DBG_HTC,
-		"htc_add_rxbuf_multiple: ep id: %d, cnt:%d, len: %d\n",
+		"htc rx add multiple ep id %d cnt %d len %d\n",
 		first_pkt->endpoint, depth, first_pkt->buf_len);
 
 	endpoint = &target->endpoint[first_pkt->endpoint];
@@ -1989,7 +1985,7 @@ int ath6kl_htc_add_rxbuf_multiple(struct htc_target *target,
 	if (target->rx_st_flags & HTC_RECV_WAIT_BUFFERS) {
 		if (target->ep_waiting == first_pkt->endpoint) {
 			ath6kl_dbg(ATH6KL_DBG_HTC,
-				"receiver was blocked on ep:%d, unblocking.\n",
+				"htc rx blocked on ep %d, unblocking\n",
 				target->ep_waiting);
 			target->rx_st_flags &= ~HTC_RECV_WAIT_BUFFERS;
 			target->ep_waiting = ENDPOINT_MAX;
@@ -2024,7 +2020,7 @@ void ath6kl_htc_flush_rx_buf(struct htc_target *target)
 			list_del(&packet->list);
 			spin_unlock_bh(&target->rx_lock);
 			ath6kl_dbg(ATH6KL_DBG_HTC,
-				   "flushing rx pkt:0x%p, len:%d, ep:%d\n",
+				   "htc rx flush pkt 0x%p  len %d  ep %d\n",
 				   packet, packet->buf_len,
 				   packet->endpoint);
 			dev_kfree_skb(packet->pkt_cntxt);
@@ -2048,7 +2044,7 @@ int ath6kl_htc_conn_service(struct htc_target *target,
 	int status = 0;
 
 	ath6kl_dbg(ATH6KL_DBG_HTC,
-		   "htc_conn_service, target:0x%p service id:0x%X\n",
+		   "htc connect service target 0x%p service id 0x%x\n",
 		   target, conn_req->svc_id);
 
 	if (conn_req->svc_id == HTC_CTRL_RSVD_SVC) {
@@ -2221,7 +2217,7 @@ static void htc_setup_msg_bndl(struct htc_target *target)
 				       target->msg_per_bndl_max);
 
 	ath6kl_dbg(ATH6KL_DBG_HTC,
-		   "htc bundling allowed. max msg per htc bundle: %d\n",
+		   "htc bundling allowed msg_per_bndl_max %d\n",
 		   target->msg_per_bndl_max);
 
 	/* Max rx bundle size is limited by the max tx bundle size */
@@ -2230,7 +2226,7 @@ static void htc_setup_msg_bndl(struct htc_target *target)
 	target->max_tx_bndl_sz = min(HIF_MBOX0_EXT_WIDTH,
 				     target->max_xfer_szper_scatreq);
 
-	ath6kl_dbg(ATH6KL_DBG_HTC, "max recv: %d max send: %d\n",
+	ath6kl_dbg(ATH6KL_DBG_HTC, "htc max_rx_bndl_sz %d max_tx_bndl_sz %d\n",
 		   target->max_rx_bndl_sz, target->max_tx_bndl_sz);
 
 	if (target->max_tx_bndl_sz)
@@ -2285,7 +2281,7 @@ int ath6kl_htc_wait_target(struct htc_target *target)
 	target->tgt_cred_sz = le16_to_cpu(rdy_msg->ver2_0_info.cred_sz);
 
 	ath6kl_dbg(ATH6KL_DBG_HTC,
-		   "target ready: credits: %d credit size: %d\n",
+		   "htc target ready credits %d size %d\n",
 		   target->tgt_creds, target->tgt_cred_sz);
 
 	/* check if this is an extended ready message */
@@ -2299,7 +2295,7 @@ int ath6kl_htc_wait_target(struct htc_target *target)
 		target->msg_per_bndl_max = 0;
 	}
 
-	ath6kl_dbg(ATH6KL_DBG_HTC, "using htc protocol version : %s (%d)\n",
+	ath6kl_dbg(ATH6KL_DBG_HTC, "htc using protocol %s (%d)\n",
 		  (target->htc_tgt_ver == HTC_VERSION_2P0) ? "2.0" : ">= 2.1",
 		  target->htc_tgt_ver);
 


^ permalink raw reply related

* [PATCH 1/4] ath6kl: merge htc debug levels
From: Kalle Valo @ 2011-10-13 12:21 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless

It's not really necessary to have separate debug levels for htc tx and rx
so combine them.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath6kl/debug.c |    5 +-
 drivers/net/wireless/ath/ath6kl/debug.h |    4 +
 drivers/net/wireless/ath/ath6kl/hif.c   |    6 +-
 drivers/net/wireless/ath/ath6kl/htc.c   |   84 ++++++++++++++++---------------
 4 files changed, 50 insertions(+), 49 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/debug.c b/drivers/net/wireless/ath/ath6kl/debug.c
index dd37785..e52f7e3 100644
--- a/drivers/net/wireless/ath/ath6kl/debug.c
+++ b/drivers/net/wireless/ath/ath6kl/debug.c
@@ -180,9 +180,10 @@ void dump_cred_dist_stats(struct htc_target *target)
 	list_for_each_entry(ep_list, &target->cred_dist_list, list)
 		dump_cred_dist(ep_list);
 
-	ath6kl_dbg(ATH6KL_DBG_HTC_SEND, "ctxt:%p dist:%p\n",
+	ath6kl_dbg(ATH6KL_DBG_HTC, "ctxt:%p dist:%p\n",
 		   target->cred_dist_cntxt, NULL);
-	ath6kl_dbg(ATH6KL_DBG_TRC, "credit distribution, total : %d, free : %d\n",
+	ath6kl_dbg(ATH6KL_DBG_HTC,
+		   "credit distribution, total : %d, free : %d\n",
 		   target->cred_dist_cntxt->total_avail_credits,
 		   target->cred_dist_cntxt->cur_free_credits);
 }
diff --git a/drivers/net/wireless/ath/ath6kl/debug.h b/drivers/net/wireless/ath/ath6kl/debug.h
index 7d5323d..01f4015 100644
--- a/drivers/net/wireless/ath/ath6kl/debug.h
+++ b/drivers/net/wireless/ath/ath6kl/debug.h
@@ -25,8 +25,8 @@ enum ATH6K_DEBUG_MASK {
 	ATH6KL_DBG_WLAN_TX      = BIT(2),     /* wlan tx */
 	ATH6KL_DBG_WLAN_RX      = BIT(3),     /* wlan rx */
 	ATH6KL_DBG_BMI		= BIT(4),     /* bmi tracing */
-	ATH6KL_DBG_HTC_SEND     = BIT(5),     /* htc send */
-	ATH6KL_DBG_HTC_RECV     = BIT(6),     /* htc recv */
+	ATH6KL_DBG_HTC		= BIT(5),
+	/* hole */
 	ATH6KL_DBG_IRQ		= BIT(7),     /* interrupt processing */
 	ATH6KL_DBG_PM           = BIT(8),     /* power management */
 	ATH6KL_DBG_WLAN_NODE    = BIT(9),     /* general wlan node tracing */
diff --git a/drivers/net/wireless/ath/ath6kl/hif.c b/drivers/net/wireless/ath/ath6kl/hif.c
index 57c9aff..7cc6cec 100644
--- a/drivers/net/wireless/ath/ath6kl/hif.c
+++ b/drivers/net/wireless/ath/ath6kl/hif.c
@@ -51,7 +51,7 @@ int ath6kl_hif_rw_comp_handler(void *context, int status)
 {
 	struct htc_packet *packet = context;
 
-	ath6kl_dbg(ATH6KL_DBG_HTC_RECV,
+	ath6kl_dbg(ATH6KL_DBG_HTC,
 		   "ath6kl_hif_rw_comp_handler (pkt:0x%p , status: %d\n",
 		   packet, status);
 
@@ -119,7 +119,7 @@ int ath6kl_hif_poll_mboxmsg_rx(struct ath6kl_device *dev, u32 *lk_ahd,
 
 		/* delay a little  */
 		mdelay(ATH6KL_TIME_QUANTUM);
-		ath6kl_dbg(ATH6KL_DBG_HTC_RECV, "retry mbox poll : %d\n", i);
+		ath6kl_dbg(ATH6KL_DBG_HTC, "retry mbox poll : %d\n", i);
 	}
 
 	if (i == 0) {
@@ -186,7 +186,7 @@ int ath6kl_hif_submit_scat_req(struct ath6kl_device *dev,
 			dev->ar->mbox_info.htc_addr;
 	}
 
-	ath6kl_dbg((ATH6KL_DBG_HTC_RECV | ATH6KL_DBG_HTC_SEND),
+	ath6kl_dbg(ATH6KL_DBG_HTC,
 		   "ath6kl_hif_submit_scat_req, entries: %d, total len: %d mbox:0x%X (mode: %s : %s)\n",
 		   scat_req->scat_entries, scat_req->len,
 		   scat_req->addr, !read ? "async" : "sync",
diff --git a/drivers/net/wireless/ath/ath6kl/htc.c b/drivers/net/wireless/ath/ath6kl/htc.c
index 9b8cb22..241a7ce 100644
--- a/drivers/net/wireless/ath/ath6kl/htc.c
+++ b/drivers/net/wireless/ath/ath6kl/htc.c
@@ -102,7 +102,7 @@ static void htc_tx_comp_update(struct htc_target *target,
 				packet->info.tx.cred_used;
 	endpoint->cred_dist.txq_depth = get_queue_depth(&endpoint->txq);
 
-	ath6kl_dbg(ATH6KL_DBG_HTC_SEND, "ctxt:0x%p dist:0x%p\n",
+	ath6kl_dbg(ATH6KL_DBG_HTC, "ctxt:0x%p dist:0x%p\n",
 		   target->cred_dist_cntxt, &target->cred_dist_list);
 
 	ath6k_credit_distribute(target->cred_dist_cntxt,
@@ -118,7 +118,7 @@ static void htc_tx_complete(struct htc_endpoint *endpoint,
 	if (list_empty(txq))
 		return;
 
-	ath6kl_dbg(ATH6KL_DBG_HTC_SEND,
+	ath6kl_dbg(ATH6KL_DBG_HTC,
 		   "send complete ep %d, (%d pkts)\n",
 		   endpoint->eid, get_queue_depth(txq));
 
@@ -148,7 +148,7 @@ static void htc_async_tx_scat_complete(struct htc_target *target,
 
 	INIT_LIST_HEAD(&tx_compq);
 
-	ath6kl_dbg(ATH6KL_DBG_HTC_SEND,
+	ath6kl_dbg(ATH6KL_DBG_HTC,
 		"htc_async_tx_scat_complete  total len: %d  entries: %d\n",
 		scat_req->len, scat_req->scat_entries);
 
@@ -190,12 +190,12 @@ static int ath6kl_htc_tx_issue(struct htc_target *target,
 
 	send_len = packet->act_len + HTC_HDR_LENGTH;
 
-	ath6kl_dbg(ATH6KL_DBG_HTC_SEND, "%s: transmit len : %d (%s)\n",
+	ath6kl_dbg(ATH6KL_DBG_HTC, "%s: transmit len : %d (%s)\n",
 		   __func__, send_len, sync ? "sync" : "async");
 
 	padded_len = CALC_TXRX_PADDED_LEN(target, send_len);
 
-	ath6kl_dbg(ATH6KL_DBG_HTC_SEND,
+	ath6kl_dbg(ATH6KL_DBG_HTC,
 		"DevSendPacket, padded len: %d mbox:0x%X (mode:%s)\n",
 		padded_len,
 		target->dev->ar->mbox_info.htc_addr,
@@ -227,7 +227,7 @@ static int htc_check_credits(struct htc_target *target,
 	*req_cred = (len > target->tgt_cred_sz) ?
 		     DIV_ROUND_UP(len, target->tgt_cred_sz) : 1;
 
-	ath6kl_dbg(ATH6KL_DBG_HTC_SEND, "creds required:%d got:%d\n",
+	ath6kl_dbg(ATH6KL_DBG_HTC, "creds required:%d got:%d\n",
 		   *req_cred, ep->cred_dist.credits);
 
 	if (ep->cred_dist.credits < *req_cred) {
@@ -237,7 +237,7 @@ static int htc_check_credits(struct htc_target *target,
 		/* Seek more credits */
 		ep->cred_dist.seek_cred = *req_cred - ep->cred_dist.credits;
 
-		ath6kl_dbg(ATH6KL_DBG_HTC_SEND, "ctxt:0x%p dist:0x%p\n",
+		ath6kl_dbg(ATH6KL_DBG_HTC, "ctxt:0x%p dist:0x%p\n",
 			   target->cred_dist_cntxt, &ep->cred_dist);
 
 		ath6k_seek_credits(target->cred_dist_cntxt, &ep->cred_dist);
@@ -245,7 +245,7 @@ static int htc_check_credits(struct htc_target *target,
 		ep->cred_dist.seek_cred = 0;
 
 		if (ep->cred_dist.credits < *req_cred) {
-			ath6kl_dbg(ATH6KL_DBG_HTC_SEND,
+			ath6kl_dbg(ATH6KL_DBG_HTC,
 				   "not enough credits for ep %d - leaving packet in queue\n",
 				   eid);
 			return -EINVAL;
@@ -260,7 +260,7 @@ static int htc_check_credits(struct htc_target *target,
 		ep->cred_dist.seek_cred =
 		ep->cred_dist.cred_per_msg - ep->cred_dist.credits;
 
-		ath6kl_dbg(ATH6KL_DBG_HTC_SEND, "ctxt:0x%p dist:0x%p\n",
+		ath6kl_dbg(ATH6KL_DBG_HTC, "ctxt:0x%p dist:0x%p\n",
 			   target->cred_dist_cntxt, &ep->cred_dist);
 
 		ath6k_seek_credits(target->cred_dist_cntxt, &ep->cred_dist);
@@ -270,7 +270,7 @@ static int htc_check_credits(struct htc_target *target,
 			/* tell the target we need credits ASAP! */
 			*flags |= HTC_FLAGS_NEED_CREDIT_UPDATE;
 			ep->ep_st.cred_low_indicate += 1;
-			ath6kl_dbg(ATH6KL_DBG_HTC_SEND, "host needs credits\n");
+			ath6kl_dbg(ATH6KL_DBG_HTC, "host needs credits\n");
 		}
 	}
 
@@ -295,7 +295,7 @@ static void ath6kl_htc_tx_pkts_get(struct htc_target *target,
 		packet = list_first_entry(&endpoint->txq, struct htc_packet,
 					  list);
 
-		ath6kl_dbg(ATH6KL_DBG_HTC_SEND,
+		ath6kl_dbg(ATH6KL_DBG_HTC,
 			"got head pkt:0x%p , queue depth: %d\n",
 			packet, get_queue_depth(&endpoint->txq));
 
@@ -404,7 +404,7 @@ static int ath6kl_htc_tx_setup_scat_list(struct htc_target *target,
 
 		scat_req->len += len;
 		scat_req->scat_entries++;
-		ath6kl_dbg(ATH6KL_DBG_HTC_SEND,
+		ath6kl_dbg(ATH6KL_DBG_HTC,
 			   "%d, adding pkt : 0x%p len:%d (remaining space:%d)\n",
 			   i, packet, len, rem_scat);
 	}
@@ -455,12 +455,12 @@ static void ath6kl_htc_tx_bundle(struct htc_endpoint *endpoint,
 
 		if (!scat_req) {
 			/* no scatter resources  */
-			ath6kl_dbg(ATH6KL_DBG_HTC_SEND,
+			ath6kl_dbg(ATH6KL_DBG_HTC,
 				"no more scatter resources\n");
 			break;
 		}
 
-		ath6kl_dbg(ATH6KL_DBG_HTC_SEND, "pkts to scatter: %d\n",
+		ath6kl_dbg(ATH6KL_DBG_HTC, "pkts to scatter: %d\n",
 			   n_scat);
 
 		scat_req->len = 0;
@@ -479,7 +479,7 @@ static void ath6kl_htc_tx_bundle(struct htc_endpoint *endpoint,
 		n_sent_bundle++;
 		tot_pkts_bundle += scat_req->scat_entries;
 
-		ath6kl_dbg(ATH6KL_DBG_HTC_SEND,
+		ath6kl_dbg(ATH6KL_DBG_HTC,
 			   "send scatter total bytes: %d , entries: %d\n",
 			   scat_req->len, scat_req->scat_entries);
 		ath6kl_hif_submit_scat_req(target->dev, scat_req, false);
@@ -490,7 +490,7 @@ static void ath6kl_htc_tx_bundle(struct htc_endpoint *endpoint,
 
 	*sent_bundle = n_sent_bundle;
 	*n_bundle_pkts = tot_pkts_bundle;
-	ath6kl_dbg(ATH6KL_DBG_HTC_SEND, "%s (sent:%d)\n",
+	ath6kl_dbg(ATH6KL_DBG_HTC, "%s (sent:%d)\n",
 		   __func__, n_sent_bundle);
 
 	return;
@@ -510,7 +510,7 @@ static void ath6kl_htc_tx_from_queue(struct htc_target *target,
 	if (endpoint->tx_proc_cnt > 1) {
 		endpoint->tx_proc_cnt--;
 		spin_unlock_bh(&target->tx_lock);
-		ath6kl_dbg(ATH6KL_DBG_HTC_SEND, "htc_try_send (busy)\n");
+		ath6kl_dbg(ATH6KL_DBG_HTC, "htc_try_send (busy)\n");
 		return;
 	}
 
@@ -588,13 +588,13 @@ static bool ath6kl_htc_tx_try(struct htc_target *target,
 		overflow = true;
 
 	if (overflow)
-		ath6kl_dbg(ATH6KL_DBG_HTC_SEND,
+		ath6kl_dbg(ATH6KL_DBG_HTC,
 			   "ep %d, tx queue will overflow :%d , tx depth:%d, max:%d\n",
 			   endpoint->eid, overflow, txq_depth,
 			   endpoint->max_txq_depth);
 
 	if (overflow && ep_cb.tx_full) {
-		ath6kl_dbg(ATH6KL_DBG_HTC_SEND,
+		ath6kl_dbg(ATH6KL_DBG_HTC,
 			   "indicating overflowed tx packet: 0x%p\n", tx_pkt);
 
 		if (ep_cb.tx_full(endpoint->target, tx_pkt) ==
@@ -629,7 +629,7 @@ static void htc_chk_ep_txq(struct htc_target *target)
 
 		spin_lock_bh(&target->tx_lock);
 		if (!list_empty(&endpoint->txq)) {
-			ath6kl_dbg(ATH6KL_DBG_HTC_SEND,
+			ath6kl_dbg(ATH6KL_DBG_HTC,
 				   "ep %d has %d credits and %d packets in tx queue\n",
 				   cred_dist->endpoint,
 				   endpoint->cred_dist.credits,
@@ -736,7 +736,7 @@ int ath6kl_htc_tx(struct htc_target *target, struct htc_packet *packet)
 	struct htc_endpoint *endpoint;
 	struct list_head queue;
 
-	ath6kl_dbg(ATH6KL_DBG_HTC_SEND,
+	ath6kl_dbg(ATH6KL_DBG_HTC,
 		   "htc_tx: ep id: %d, buf: 0x%p, len: %d\n",
 		   packet->endpoint, packet->buf, packet->act_len);
 
@@ -787,7 +787,7 @@ void ath6kl_htc_flush_txep(struct htc_target *target,
 	list_for_each_entry_safe(packet, tmp_pkt, &discard_q, list) {
 		packet->status = -ECANCELED;
 		list_del(&packet->list);
-		ath6kl_dbg(ATH6KL_DBG_TRC,
+		ath6kl_dbg(ATH6KL_DBG_HTC,
 			"flushing tx pkt:0x%p, len:%d, ep:%d tag:0x%X\n",
 			packet, packet->act_len,
 			packet->endpoint, packet->info.tx.tag);
@@ -844,7 +844,7 @@ void ath6kl_htc_indicate_activity_change(struct htc_target *target,
 		endpoint->cred_dist.txq_depth =
 			get_queue_depth(&endpoint->txq);
 
-		ath6kl_dbg(ATH6KL_DBG_HTC_SEND, "ctxt:0x%p dist:0x%p\n",
+		ath6kl_dbg(ATH6KL_DBG_HTC, "ctxt:0x%p dist:0x%p\n",
 			   target->cred_dist_cntxt, &target->cred_dist_list);
 
 		ath6k_credit_distribute(target->cred_dist_cntxt,
@@ -924,7 +924,7 @@ static int ath6kl_htc_rx_packet(struct htc_target *target,
 		return -ENOMEM;
 	}
 
-	ath6kl_dbg(ATH6KL_DBG_HTC_RECV,
+	ath6kl_dbg(ATH6KL_DBG_HTC,
 		   "dev_rx_pkt (0x%p : hdr:0x%X) padded len: %d mbox:0x%X (mode:%s)\n",
 		   packet, packet->info.rx.exp_hdr,
 		   padded_len, dev->ar->mbox_info.htc_addr, "sync");
@@ -1137,7 +1137,7 @@ static int ath6kl_htc_rx_alloc(struct htc_target *target,
 			}
 
 			endpoint->ep_st.rx_bundle_from_hdr += 1;
-			ath6kl_dbg(ATH6KL_DBG_HTC_RECV,
+			ath6kl_dbg(ATH6KL_DBG_HTC,
 				   "htc hdr indicates :%d msg can be fetched as a bundle\n",
 				   n_msg);
 		} else
@@ -1209,7 +1209,7 @@ static void htc_proc_cred_rpt(struct htc_target *target,
 	int tot_credits = 0, i;
 	bool dist = false;
 
-	ath6kl_dbg(ATH6KL_DBG_HTC_SEND,
+	ath6kl_dbg(ATH6KL_DBG_HTC,
 		   "htc_proc_cred_rpt, credit report entries:%d\n", n_entries);
 
 	spin_lock_bh(&target->tx_lock);
@@ -1223,7 +1223,7 @@ static void htc_proc_cred_rpt(struct htc_target *target,
 
 		endpoint = &target->endpoint[rpt->eid];
 
-		ath6kl_dbg(ATH6KL_DBG_HTC_SEND, " ep %d got %d credits\n",
+		ath6kl_dbg(ATH6KL_DBG_HTC, " ep %d got %d credits\n",
 			rpt->eid, rpt->credits);
 
 		endpoint->ep_st.tx_cred_rpt += 1;
@@ -1264,7 +1264,7 @@ static void htc_proc_cred_rpt(struct htc_target *target,
 		tot_credits += rpt->credits;
 	}
 
-	ath6kl_dbg(ATH6KL_DBG_HTC_SEND,
+	ath6kl_dbg(ATH6KL_DBG_HTC,
 		   "report indicated %d credits to distribute\n",
 		   tot_credits);
 
@@ -1273,7 +1273,7 @@ static void htc_proc_cred_rpt(struct htc_target *target,
 		 * This was a credit return based on a completed send
 		 * operations note, this is done with the lock held
 		 */
-		ath6kl_dbg(ATH6KL_DBG_HTC_SEND, "ctxt:0x%p dist:0x%p\n",
+		ath6kl_dbg(ATH6KL_DBG_HTC, "ctxt:0x%p dist:0x%p\n",
 			   target->cred_dist_cntxt, &target->cred_dist_list);
 
 		ath6k_credit_distribute(target->cred_dist_cntxt,
@@ -1320,7 +1320,7 @@ static int htc_parse_trailer(struct htc_target *target,
 		if ((lk_ahd->pre_valid == ((~lk_ahd->post_valid) & 0xFF))
 		    && next_lk_ahds) {
 
-			ath6kl_dbg(ATH6KL_DBG_HTC_RECV,
+			ath6kl_dbg(ATH6KL_DBG_HTC,
 				   "lk_ahd report found (pre valid:0x%X, post valid:0x%X)\n",
 				   lk_ahd->pre_valid, lk_ahd->post_valid);
 
@@ -1378,7 +1378,7 @@ static int htc_proc_trailer(struct htc_target *target,
 	u8 *record_buf;
 	u8 *orig_buf;
 
-	ath6kl_dbg(ATH6KL_DBG_HTC_RECV, "+htc_proc_trailer (len:%d)\n", len);
+	ath6kl_dbg(ATH6KL_DBG_HTC, "+htc_proc_trailer (len:%d)\n", len);
 
 	ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "Recv Trailer", "",
 			buf, len);
@@ -1534,7 +1534,7 @@ fail_rx:
 static void ath6kl_htc_rx_complete(struct htc_endpoint *endpoint,
 				   struct htc_packet *packet)
 {
-		ath6kl_dbg(ATH6KL_DBG_HTC_RECV,
+		ath6kl_dbg(ATH6KL_DBG_HTC,
 			   "htc calling ep %d recv callback on packet 0x%p\n",
 			   endpoint->eid, packet);
 		endpoint->ep_cb.rx(endpoint->target, packet);
@@ -1571,7 +1571,7 @@ static int ath6kl_htc_rx_bundle(struct htc_target *target,
 
 	len = 0;
 
-	ath6kl_dbg(ATH6KL_DBG_HTC_RECV,
+	ath6kl_dbg(ATH6KL_DBG_HTC,
 		   "%s(): (numpackets: %d , actual : %d)\n",
 		   __func__, get_queue_depth(rxq), n_scat_pkt);
 
@@ -1897,7 +1897,7 @@ static struct htc_packet *htc_wait_for_ctrl_msg(struct htc_target *target)
 			       HTC_TARGET_RESPONSE_TIMEOUT))
 		return NULL;
 
-	ath6kl_dbg(ATH6KL_DBG_HTC_RECV,
+	ath6kl_dbg(ATH6KL_DBG_HTC,
 		"htc_wait_for_ctrl_msg: look_ahead : 0x%X\n", look_ahead);
 
 	htc_hdr = (struct htc_frame_hdr *)&look_ahead;
@@ -1962,7 +1962,7 @@ int ath6kl_htc_add_rxbuf_multiple(struct htc_target *target,
 
 	depth = get_queue_depth(pkt_queue);
 
-	ath6kl_dbg(ATH6KL_DBG_HTC_RECV,
+	ath6kl_dbg(ATH6KL_DBG_HTC,
 		"htc_add_rxbuf_multiple: ep id: %d, cnt:%d, len: %d\n",
 		first_pkt->endpoint, depth, first_pkt->buf_len);
 
@@ -1988,7 +1988,7 @@ int ath6kl_htc_add_rxbuf_multiple(struct htc_target *target,
 	/* check if we are blocked waiting for a new buffer */
 	if (target->rx_st_flags & HTC_RECV_WAIT_BUFFERS) {
 		if (target->ep_waiting == first_pkt->endpoint) {
-			ath6kl_dbg(ATH6KL_DBG_HTC_RECV,
+			ath6kl_dbg(ATH6KL_DBG_HTC,
 				"receiver was blocked on ep:%d, unblocking.\n",
 				target->ep_waiting);
 			target->rx_st_flags &= ~HTC_RECV_WAIT_BUFFERS;
@@ -2023,7 +2023,7 @@ void ath6kl_htc_flush_rx_buf(struct htc_target *target)
 					 &endpoint->rx_bufq, list) {
 			list_del(&packet->list);
 			spin_unlock_bh(&target->rx_lock);
-			ath6kl_dbg(ATH6KL_DBG_HTC_RECV,
+			ath6kl_dbg(ATH6KL_DBG_HTC,
 				   "flushing rx pkt:0x%p, len:%d, ep:%d\n",
 				   packet, packet->buf_len,
 				   packet->endpoint);
@@ -2047,7 +2047,7 @@ int ath6kl_htc_conn_service(struct htc_target *target,
 	unsigned int max_msg_sz = 0;
 	int status = 0;
 
-	ath6kl_dbg(ATH6KL_DBG_TRC,
+	ath6kl_dbg(ATH6KL_DBG_HTC,
 		   "htc_conn_service, target:0x%p service id:0x%X\n",
 		   target, conn_req->svc_id);
 
@@ -2220,7 +2220,7 @@ static void htc_setup_msg_bndl(struct htc_target *target)
 	target->msg_per_bndl_max = min(target->max_scat_entries,
 				       target->msg_per_bndl_max);
 
-	ath6kl_dbg(ATH6KL_DBG_TRC,
+	ath6kl_dbg(ATH6KL_DBG_HTC,
 		   "htc bundling allowed. max msg per htc bundle: %d\n",
 		   target->msg_per_bndl_max);
 
@@ -2230,7 +2230,7 @@ static void htc_setup_msg_bndl(struct htc_target *target)
 	target->max_tx_bndl_sz = min(HIF_MBOX0_EXT_WIDTH,
 				     target->max_xfer_szper_scatreq);
 
-	ath6kl_dbg(ATH6KL_DBG_ANY, "max recv: %d max send: %d\n",
+	ath6kl_dbg(ATH6KL_DBG_HTC, "max recv: %d max send: %d\n",
 		   target->max_rx_bndl_sz, target->max_tx_bndl_sz);
 
 	if (target->max_tx_bndl_sz)
@@ -2284,7 +2284,7 @@ int ath6kl_htc_wait_target(struct htc_target *target)
 	target->tgt_creds = le16_to_cpu(rdy_msg->ver2_0_info.cred_cnt);
 	target->tgt_cred_sz = le16_to_cpu(rdy_msg->ver2_0_info.cred_sz);
 
-	ath6kl_dbg(ATH6KL_DBG_HTC_RECV,
+	ath6kl_dbg(ATH6KL_DBG_HTC,
 		   "target ready: credits: %d credit size: %d\n",
 		   target->tgt_creds, target->tgt_cred_sz);
 
@@ -2299,7 +2299,7 @@ int ath6kl_htc_wait_target(struct htc_target *target)
 		target->msg_per_bndl_max = 0;
 	}
 
-	ath6kl_dbg(ATH6KL_DBG_TRC, "using htc protocol version : %s (%d)\n",
+	ath6kl_dbg(ATH6KL_DBG_HTC, "using htc protocol version : %s (%d)\n",
 		  (target->htc_tgt_ver == HTC_VERSION_2P0) ? "2.0" : ">= 2.1",
 		  target->htc_tgt_ver);
 


^ permalink raw reply related

* [PATCH] mac80211: fix TID for null poll response
From: Johannes Berg @ 2011-10-13 11:19 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

From: Johannes Berg <johannes.berg@intel.com>

The queue mapping/TID for non-QoS null data
responses to is never set, making it default
to BK. Fix that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/mac80211/sta_info.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

--- a/net/mac80211/sta_info.c	2011-10-07 10:43:31.000000000 +0200
+++ b/net/mac80211/sta_info.c	2011-10-13 13:16:57.000000000 +0200
@@ -1203,11 +1203,9 @@ static void ieee80211_send_null_response
 	memcpy(nullfunc->addr2, sdata->vif.addr, ETH_ALEN);
 	memcpy(nullfunc->addr3, sdata->vif.addr, ETH_ALEN);
 
+	skb->priority = tid;
+	skb_set_queue_mapping(skb, ieee802_1d_to_ac[tid]);
 	if (qos) {
-		skb->priority = tid;
-
-		skb_set_queue_mapping(skb, ieee802_1d_to_ac[tid]);
-
 		nullfunc->qos_ctrl = cpu_to_le16(tid);
 
 		if (reason == IEEE80211_FRAME_RELEASE_UAPSD)



^ permalink raw reply

* Re: [RFC 02/07] compat-wireless: Connection quality monitor extensions
From: Johannes Berg @ 2011-10-13 10:49 UTC (permalink / raw)
  To: Janusz Dziedzic
  Cc: Dmitry Tarnyagin, linux-wireless, Bartosz MARKOWSKI,
	Janusz DZIEDZIC
In-Reply-To: <CAFED-jk8xp62A8cyR1qbbFzfM1AJRMUzGQ1Z3b4pDGdBPWYOrw@mail.gmail.com>

Hi,

Please trim your quotes. There's no point in quoting all of the email to
reply to specific points.


> >> +++ b/include/linux/nl80211.h
> >> @@ -2311,6 +2311,14 @@ enum nl80211_ps_state {
> >>    * @NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT: RSSI threshold event
> >>    * @NL80211_ATTR_CQM_PKT_LOSS_EVENT: a u32 value indicating that this many
> >>    *  consecutive packets were not acknowledged by the peer
> >> + * @NL80211_ATTR_CQM_BEACON_MISS_THOLD: BEACON threshold. This value
> >> specifies
> >> + *   the threshold for the BEACON loss level at which an event will be
> >> + *   sent. Zero to disable.
> >
> > Should it really be zero to disable rather than leaving it out to
> > disable?
> 
> Similar like in case of NL80211_ATTR_CQM_RSSI_
> Usefull to disable in run-time also - when associated.

I don't think you understood my question, but I think it's actually OK
as is so you can change other config w/o disabling this.

> >> + * @NL80211_ATTR_CQM_BEACON_MISS_THOLD_EVENT: BEACON miss event
> >> + * @NL80211_ATTR_CQM_TX_FAIL_THOLD: TX threshold. This value specifies the
> >> + *   the threshold for the TX loss level at which an event will be
> >> + *   sent. Zero to disable.
> >> + * @NL80211_ATTR_CQM_TX_FAIL_THOLD_EVENT: TX threshold event
> >
> > How's this not the same as PKT_LOSS_EVENT?
> 
> Based on supplicant code - this is mapped to EVENT_STATION_LOW_ACK.
> Seems used only in case we are GO/AP and not configurable from user space.
> I think possible to reuse PKT_LOSS_EVENT.
> But still new HW_FLAGS is required for that and counter configuration
> from user space could be usefull.

Yeah so add the config for PKT_LOSS_EVENT.

> >> +     if (!(local->hw.flags &
> IEEE80211_HW_SUPPORTS_CQM_BEACON_MISS)) {
> >> +             if (sdata->vif.type != NL80211_IFTYPE_STATION)
> >> +                     return -EOPNOTSUPP;
> >> +             return 0;
> >
> > This looks/is wrong in multiple ways.
> 
> 
> Could you add more description here - this is almost the same like
> ieee80211_set_cqm_rssi_config() fuction.

Well so evidently this accepts the config if the HW supports it and the
interface type isn't station -- that's bad.

Also, I haven't seen any evidence that you implemented support for this
in mac80211 if the device doesn't support it, so you can't do it this
way.

> >> -             } else {
> >> +             } else if (!(local->hw.flags &
> >> +                             IEEE80211_HW_SUPPORTS_CQM_BEACON_MISS) &&
> >> +                        !(local->hw.flags &
> >> +                             IEEE80211_HW_SUPPORTS_CQM_TX_FAIL)) {
> >>                       /*
> >>                        * We actually lost the connection ... or did we?
> >>                        * Let's make sure!
> >
> > explain.
> 
> In case of BEACON_MISS we should not report connection_loss to upper
> layer, we should only notify about beacon_miss and give a chance to
> roam without disconnection. Without that first we will see
> disconnection in wpa_supplicant. Next if roam will fail and driver
> support IEEE80211_HW_SUPPORTS_CQM_BEACON_MISS should report this
> connection_lost by itself via ieee80211_connection_loss().

So then the test is wrong -- it has to be dependent on wpa_s actually
having asked for this.


I really don't want to be reviewing this with so many basic errors. It
looks like you blindly copied parts of the other CQM things without
understanding what they do. Please find somebody else to review &
explain things with you first, I can't do that at this point.

johannes


^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox