* Re: moving GIT back to kernel.org...
From: David Miller @ 2011-10-07 22:46 UTC (permalink / raw)
To: sfr; +Cc: netdev, linux-wireless, netfilter-devel, sparclinux, linux-ide
In-Reply-To: <20111008094212.e3342930c1833f73ef602a3e@canb.auug.org.au>
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Sat, 8 Oct 2011 09:42:12 +1100
> On Fri, 07 Oct 2011 15:59:02 -0400 (EDT) David Miller <davem@davemloft.net> wrote:
>> git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc.git
>> git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide.git
>
> You used to have sparc-next and ide-next (and the above used to be your
> "current release fixes" trees) ...
I've made a dummy sparc-next tree for you to pull from, thanks:
git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next.git
As for ide, I only plan to accept real bug fixes for that subsystem
so I'll avoid creating an ide-next tree for now.
^ permalink raw reply
* Re: moving GIT back to kernel.org...
From: Stephen Rothwell @ 2011-10-07 22:42 UTC (permalink / raw)
To: David Miller
Cc: netdev, linux-wireless, netfilter-devel, sparclinux, linux-ide
In-Reply-To: <20111007.155902.916470368193047875.davem@davemloft.net>
[-- Attachment #1: Type: text/plain, Size: 666 bytes --]
Hi Dave,
On Fri, 07 Oct 2011 15:59:02 -0400 (EDT) David Miller <davem@davemloft.net> wrote:
>
> Ok, they are now online, please update your URLs.
>
> git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git
> git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
I have switched to these.
> git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc.git
> git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide.git
You used to have sparc-next and ide-next (and the above used to be your
"current release fixes" trees) ...
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* Re: [PATCH 0/8] wireless: add DFS master support
From: Luis R. Rodriguez @ 2011-10-07 22:32 UTC (permalink / raw)
To: linux-wireless, linville, Johannes Berg; +Cc: Luis R. Rodriguez
In-Reply-To: <CAB=NE6U6hFMBhgkjhpjpQk+FpMbDi4X6aW6i70MUWRH73K+AuQ@mail.gmail.com>
On Fri, Oct 7, 2011 at 3:29 PM, Luis R. Rodriguez
<mcgrof@qca.qualcomm.com> wrote:
> On Fri, Oct 7, 2011 at 2:11 PM, Luis R. Rodriguez
> <mcgrof@qca.qualcomm.com> wrote:
>> On Tue, Oct 4, 2011 at 5:14 PM, Luis R. Rodriguez
>> <mcgrof@qca.qualcomm.com> wrote:
>>> On Tue, Oct 4, 2011 at 4:47 PM, Luis R. Rodriguez
>>> <mcgrof@qca.qualcomm.com> wrote:
>>>> This set of 8 patches adds DFS master support to the Linux wireless subsystem.
>>>> I've reviewed future possible changes to DFS master regions and it seems that
>>>> we are not going to be having multiple DFS regions for one country, instead
>>>> we'll always have one DFS region for one country.
>>>>
>>>> The changes here are spread out throughout wireless-regdb, crda the kernel and
>>>> lastly iw. The changes made allow for older verions of CRDA to work with new
>>>> wireless-regdb files with DFS region support. If you want DFS master region
>>>> support you'll need to upgrade your CRDA, your kernel and then hope someone
>>>> implements DFS master support for your respective driver.
>>>>
>>>> This patch series does not have specific driver changes, although some seem to
>>>> be backing in the oven right now.
>>>
>>> Here's a puzzle though... If we change this series to use the other
>>> pad byte that was available, the first pad byte, instead of the last
>>> one, we loose backward compatibility support and I cannot figure out
>>> why. What I ended up seeing was that crda sends the message, and for
>>> some reason (return code is 222 from nl_wait_for_ack(), whatever that
>>> is) the kernel rejects it. I suspect it may have to do with some sort
>>> of offset to the *other* data that makes some of the rules output
>>> invalid data for the attribute policy, but at least when I hexdump the
>>> wireless-regdb the only changes I see are in the signature and the pad
>>> shift.
>>>
>>> I got tired of trying though and after seeing flipping the pad bytes
>>> things worked decided to stay with it. In my original RFC in December
>>> I had used u16 instead, but since the data was in the last pad byte
>>> things still worked. So something is fishy about only using the first
>>> pad byte. The change below, as far as I can tell, should not have any
>>> issues but it does with the older version of CRDA and even a new one.
>>
>> Johannes spotted the issue, I'll send the fix, thanks to Johannes.
>> John, Johannes the patches still apply my fix goes on top of these
>> changes, the fix is not addressing a regression introduced by this
>> patchset, instead it fixes a long standing issue which would prevent
>> us from using the next available pad byte.
>
> I'm going to respin this to make use of 2 bits:
>
> 00 unset
> 01 FCC
> 10 ETSI
> 11 JP
>
> We may need some more DFS values later but
Sorry I did not finish this e-mail I meant that we may later have a
requirement for more DFS values but at this time we don't, we should
consider whether or not we will want to leave more bits for usage of
more DFS values and if so how many? Using two bits will give us
support for what we know today but nothing for the future.
If I use two bits I just don't want complains later if we have DFS
regions split in the db spec for future changes.
Luis
^ permalink raw reply
* Re: [PATCH 0/8] wireless: add DFS master support
From: Luis R. Rodriguez @ 2011-10-07 22:29 UTC (permalink / raw)
To: linux-wireless, linville, Johannes Berg; +Cc: Luis R. Rodriguez
In-Reply-To: <CAB=NE6VxNKJPQPBbkn9ha1EC6dWawj96B6f-R1XREN1JAcrOQQ@mail.gmail.com>
On Fri, Oct 7, 2011 at 2:11 PM, Luis R. Rodriguez
<mcgrof@qca.qualcomm.com> wrote:
> On Tue, Oct 4, 2011 at 5:14 PM, Luis R. Rodriguez
> <mcgrof@qca.qualcomm.com> wrote:
>> On Tue, Oct 4, 2011 at 4:47 PM, Luis R. Rodriguez
>> <mcgrof@qca.qualcomm.com> wrote:
>>> This set of 8 patches adds DFS master support to the Linux wireless subsystem.
>>> I've reviewed future possible changes to DFS master regions and it seems that
>>> we are not going to be having multiple DFS regions for one country, instead
>>> we'll always have one DFS region for one country.
>>>
>>> The changes here are spread out throughout wireless-regdb, crda the kernel and
>>> lastly iw. The changes made allow for older verions of CRDA to work with new
>>> wireless-regdb files with DFS region support. If you want DFS master region
>>> support you'll need to upgrade your CRDA, your kernel and then hope someone
>>> implements DFS master support for your respective driver.
>>>
>>> This patch series does not have specific driver changes, although some seem to
>>> be backing in the oven right now.
>>
>> Here's a puzzle though... If we change this series to use the other
>> pad byte that was available, the first pad byte, instead of the last
>> one, we loose backward compatibility support and I cannot figure out
>> why. What I ended up seeing was that crda sends the message, and for
>> some reason (return code is 222 from nl_wait_for_ack(), whatever that
>> is) the kernel rejects it. I suspect it may have to do with some sort
>> of offset to the *other* data that makes some of the rules output
>> invalid data for the attribute policy, but at least when I hexdump the
>> wireless-regdb the only changes I see are in the signature and the pad
>> shift.
>>
>> I got tired of trying though and after seeing flipping the pad bytes
>> things worked decided to stay with it. In my original RFC in December
>> I had used u16 instead, but since the data was in the last pad byte
>> things still worked. So something is fishy about only using the first
>> pad byte. The change below, as far as I can tell, should not have any
>> issues but it does with the older version of CRDA and even a new one.
>
> Johannes spotted the issue, I'll send the fix, thanks to Johannes.
> John, Johannes the patches still apply my fix goes on top of these
> changes, the fix is not addressing a regression introduced by this
> patchset, instead it fixes a long standing issue which would prevent
> us from using the next available pad byte.
I'm going to respin this to make use of 2 bits:
00 unset
01 FCC
10 ETSI
11 JP
We may need some more DFS values later but
Luis
^ permalink raw reply
* Re: [PATCH] wl12xx: remove warning message during IBSS Tx
From: Luciano Coelho @ 2011-10-07 21:17 UTC (permalink / raw)
To: Shahar Lev; +Cc: Johannes Berg, linux-wireless
In-Reply-To: <CANCvt+6JkxnE6Z7soUuhQSbzpxuxYUNC7z0vv+jn-sH+jpY4Qg@mail.gmail.com>
On Fri, 2011-10-07 at 23:03 +0200, Shahar Lev wrote:
> On Fri, Oct 7, 2011 at 6:20 PM, Johannes Berg <johannes@sipsolutions.net> wrote:
> > Maybe you should also change that? :-)
>
> Consider it added to our collective TODO.
Well, the fix is probably supposed to be done in mac80211, instead of
hiding the bug by removing the warning, isn't it?
--
Cheers,
Luca.
^ permalink raw reply
* [PATCH v2] crda: fix null string assumption for alpha2
From: Luis R. Rodriguez @ 2011-10-07 21:16 UTC (permalink / raw)
To: linux-wireless; +Cc: linville, johannes, Luis R. Rodriguez
The wireless-regdb only accounts for two bytes for
the country code but CRDA defined the alpha2 to be
as a string of length 2, and so does the nl80211 attribute
policy:
[NL80211_ATTR_REG_ALPHA2] = { .type = NLA_STRING, .len = 2 },
The meaning of a string is it'll be null terminated, so if you
do not add the null termination a country without the null termination
will not match up with the nl80211 attribute policy.
This has no impact for us unless we want to use the next available
pad byte on the wireless-regdb. This fixes CRDA by using a local copy
of the regdb's alpha2 that is properly null terminated and sending it.
The implications of this change is that new wirelesss-regdb's that
make use of the next pad byte for a country will get that country
ignored for regulatory hints sent to the kernel. At this point we
don't yet know what the next byte will be used for though so this
has no impact. The second pad byte is being used for DFS and that
is not impacted by this nor is this change required for it.
Distributions should upgrade though in case we ever do decide to use
this last precious country byte. I've tested that this indeed fixes
the bogus issue I saw when instead of using the second pad byte we
use the first pad byte. Thanks to Johannes for spotting the issue.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
---
This corrects language in the commit log, as I stated at first we
alread did have a use case for the next pad byte but this is not
true as I assumed we could use the next pad byte for TPC but if
TPC gain values can vary depending on the band then we cannot use
this country specific byte and instead will need another set of
values.
This goes on top of my DFS master patch. I'll push the change out
once and if Linville integrates my DFS changes to wireless-regdb.
crda.c | 4 ++--
reglib.h | 13 -------------
2 files changed, 2 insertions(+), 15 deletions(-)
diff --git a/crda.c b/crda.c
index dfc5353..63ebfff 100644
--- a/crda.c
+++ b/crda.c
@@ -149,7 +149,7 @@ int main(int argc, char **argv)
struct regdb_file_header *header;
struct regdb_file_reg_country *countries;
int dblen, siglen, num_countries, i, j, r;
- char alpha2[2];
+ char alpha2[3] = {}; /* NUL-terminate */
char *env_country;
struct nl80211_state nlstate;
struct nl_cb *cb = NULL;
@@ -279,7 +279,7 @@ int main(int argc, char **argv)
sizeof(*rcoll) + num_rules * sizeof(__be32),
country->reg_collection_ptr);
- NLA_PUT_STRING(msg, NL80211_ATTR_REG_ALPHA2, (char *) country->alpha2);
+ NLA_PUT_STRING(msg, NL80211_ATTR_REG_ALPHA2, (char *) alpha2);
NLA_PUT_U8(msg, NL80211_ATTR_DFS_REGION, country->dfs_region);
nl_reg_rules = nla_nest_start(msg, NL80211_ATTR_REG_RULES);
diff --git a/reglib.h b/reglib.h
index f3a76ef..9fe5d8b 100644
--- a/reglib.h
+++ b/reglib.h
@@ -53,21 +53,8 @@ static inline int is_alpha2(const char *alpha2)
return 0;
}
-/* Avoid stdlib */
-static inline int is_len_2(const char *alpha2)
-{
- if (alpha2[0] == '\0' || (alpha2[1] == '\0'))
- return 0;
- if (alpha2[2] == '\0')
- return 1;
- return 0;
-}
-
static inline int is_valid_regdom(const char *alpha2)
{
- if (!is_len_2(alpha2))
- return 0;
-
if (!is_alpha2(alpha2) && !is_world_regdom(alpha2))
return 0;
--
1.7.4.15.g7811d
^ permalink raw reply related
* [PATCH] crda: fix null string assumption for alpha2
From: Luis R. Rodriguez @ 2011-10-07 21:13 UTC (permalink / raw)
To: linux-wireless; +Cc: linville, johannes, Luis R. Rodriguez
The wireless-regdb only accounts for two bytes for
the country code but CRDA defined the alpha2 to be
as a string of length 2, and so does the nl80211 attribute
policy:
[NL80211_ATTR_REG_ALPHA2] = { .type = NLA_STRING, .len = 2 },
The meaning of a string is it'll be null terminated, so if you
do not add the null termination a country without the null termination
will not match up with the nl80211 attribute policy.
This has no impact for us unless we want to use the next available
pad byte on the wireless-regdb. We now want to use it so fix
CRDA by using a local copy of the regdb's alpha2 that is properly
null terminated and sending it.
The implications of this change is that new wirelesss-regdb's that
make use of the next pad byte for a country will get that country
ignored for regulatory hints sent to the kernel. At this point we
don't yet know what the next byte will be used for though so this
has no impact. The second pad byte is being used for DFS and that
is not impacted by this nor is this change required for it.
Distributions should upgrade though in case we ever do decide to use
this last precious country byte. I've tested that this indeed fixes
the bogus issue I saw when instead of using the second pad byte we
use the first pad byte. Thanks to Johannes for spotting the issue.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
---
This goes on top of my DFS master patch. I'll push the change out
once and if Linville integrates my DFS changes to wireless-regdb.
crda.c | 4 ++--
reglib.h | 13 -------------
2 files changed, 2 insertions(+), 15 deletions(-)
diff --git a/crda.c b/crda.c
index dfc5353..63ebfff 100644
--- a/crda.c
+++ b/crda.c
@@ -149,7 +149,7 @@ int main(int argc, char **argv)
struct regdb_file_header *header;
struct regdb_file_reg_country *countries;
int dblen, siglen, num_countries, i, j, r;
- char alpha2[2];
+ char alpha2[3] = {}; /* NUL-terminate */
char *env_country;
struct nl80211_state nlstate;
struct nl_cb *cb = NULL;
@@ -279,7 +279,7 @@ int main(int argc, char **argv)
sizeof(*rcoll) + num_rules * sizeof(__be32),
country->reg_collection_ptr);
- NLA_PUT_STRING(msg, NL80211_ATTR_REG_ALPHA2, (char *) country->alpha2);
+ NLA_PUT_STRING(msg, NL80211_ATTR_REG_ALPHA2, (char *) alpha2);
NLA_PUT_U8(msg, NL80211_ATTR_DFS_REGION, country->dfs_region);
nl_reg_rules = nla_nest_start(msg, NL80211_ATTR_REG_RULES);
diff --git a/reglib.h b/reglib.h
index f3a76ef..9fe5d8b 100644
--- a/reglib.h
+++ b/reglib.h
@@ -53,21 +53,8 @@ static inline int is_alpha2(const char *alpha2)
return 0;
}
-/* Avoid stdlib */
-static inline int is_len_2(const char *alpha2)
-{
- if (alpha2[0] == '\0' || (alpha2[1] == '\0'))
- return 0;
- if (alpha2[2] == '\0')
- return 1;
- return 0;
-}
-
static inline int is_valid_regdom(const char *alpha2)
{
- if (!is_len_2(alpha2))
- return 0;
-
if (!is_alpha2(alpha2) && !is_world_regdom(alpha2))
return 0;
--
1.7.4.15.g7811d
^ permalink raw reply related
* Re: [PATCH 0/8] wireless: add DFS master support
From: Luis R. Rodriguez @ 2011-10-07 21:11 UTC (permalink / raw)
To: linux-wireless, linville, Johannes Berg; +Cc: Luis R. Rodriguez
In-Reply-To: <CAB=NE6V1gUSNc4L8sNv-NnDDVSzDB4A=cc_Z7tmZ79Q4LKtbwQ@mail.gmail.com>
On Tue, Oct 4, 2011 at 5:14 PM, Luis R. Rodriguez
<mcgrof@qca.qualcomm.com> wrote:
> On Tue, Oct 4, 2011 at 4:47 PM, Luis R. Rodriguez
> <mcgrof@qca.qualcomm.com> wrote:
>> This set of 8 patches adds DFS master support to the Linux wireless subsystem.
>> I've reviewed future possible changes to DFS master regions and it seems that
>> we are not going to be having multiple DFS regions for one country, instead
>> we'll always have one DFS region for one country.
>>
>> The changes here are spread out throughout wireless-regdb, crda the kernel and
>> lastly iw. The changes made allow for older verions of CRDA to work with new
>> wireless-regdb files with DFS region support. If you want DFS master region
>> support you'll need to upgrade your CRDA, your kernel and then hope someone
>> implements DFS master support for your respective driver.
>>
>> This patch series does not have specific driver changes, although some seem to
>> be backing in the oven right now.
>
> Here's a puzzle though... If we change this series to use the other
> pad byte that was available, the first pad byte, instead of the last
> one, we loose backward compatibility support and I cannot figure out
> why. What I ended up seeing was that crda sends the message, and for
> some reason (return code is 222 from nl_wait_for_ack(), whatever that
> is) the kernel rejects it. I suspect it may have to do with some sort
> of offset to the *other* data that makes some of the rules output
> invalid data for the attribute policy, but at least when I hexdump the
> wireless-regdb the only changes I see are in the signature and the pad
> shift.
>
> I got tired of trying though and after seeing flipping the pad bytes
> things worked decided to stay with it. In my original RFC in December
> I had used u16 instead, but since the data was in the last pad byte
> things still worked. So something is fishy about only using the first
> pad byte. The change below, as far as I can tell, should not have any
> issues but it does with the older version of CRDA and even a new one.
Johannes spotted the issue, I'll send the fix, thanks to Johannes.
John, Johannes the patches still apply my fix goes on top of these
changes, the fix is not addressing a regression introduced by this
patchset, instead it fixes a long standing issue which would prevent
us from using the next available pad byte.
Luis
^ permalink raw reply
* Re: [PATCH] wl12xx: remove warning message during IBSS Tx
From: Shahar Lev @ 2011-10-07 21:03 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Luciano Coelho
In-Reply-To: <1318004434.3988.16.camel@jlt3.sipsolutions.net>
On Fri, Oct 7, 2011 at 6:20 PM, Johannes Berg <johannes@sipsolutions.net> wrote:
> Maybe you should also change that? :-)
Consider it added to our collective TODO.
^ permalink raw reply
* [PATCH 3.2] b43: trivial: do not report any link quality instead of invalid one
From: Rafał Miłecki @ 2011-10-07 20:39 UTC (permalink / raw)
To: linux-wireless, John W. Linville; +Cc: b43-dev, Rafał Miłecki
We don't want to report random quality info (new PHYs are affected).
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
---
drivers/net/wireless/b43/xmit.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/b43/xmit.c b/drivers/net/wireless/b43/xmit.c
index b8de62c..5f812d1 100644
--- a/drivers/net/wireless/b43/xmit.c
+++ b/drivers/net/wireless/b43/xmit.c
@@ -735,11 +735,13 @@ void b43_rx(struct b43_wldev *dev, struct sk_buff *skb, const void *_rxhdr)
}
/* Link quality statistics */
- if ((chanstat & B43_RX_CHAN_PHYTYPE) == B43_PHYTYPE_N) {
-// s8 rssi = max(rxhdr->power0, rxhdr->power1);
- //TODO: Find out what the rssi value is (dBm or percentage?)
- // and also find out what the maximum possible value is.
- // Fill status.ssi and status.signal fields.
+ if ((chanstat & B43_RX_CHAN_PHYTYPE) >= B43_PHYTYPE_N) {
+ /*
+ s8 rssi = max(rxhdr->power0, rxhdr->power1);
+ TODO: Find out what the rssi value is (dBm or percentage?)
+ and also find out what the maximum possible value is.
+ Fill status.ssi and status.signal fields.
+ */
} else {
status.signal = b43_rssi_postprocess(dev, rxhdr->jssi,
(phystat0 & B43_RX_PHYST0_OFDM),
--
1.7.3.4
^ permalink raw reply related
* Re: [PATCH 3/8] cfg80211: process regulatory DFS region for countries
From: Johannes Berg @ 2011-10-07 20:05 UTC (permalink / raw)
To: Luis R. Rodriguez; +Cc: linux-wireless, linville
In-Reply-To: <CAB=NE6WOvik7hJygC8cTpe+o1W==fsqw2ZgVA=_pbo6fpFhUzw@mail.gmail.com>
On Fri, 2011-10-07 at 12:57 -0700, Luis R. Rodriguez wrote:
> On Fri, Oct 7, 2011 at 12:54 PM, Johannes Berg
> <johannes@sipsolutions.net> wrote:
> > On Tue, 2011-10-04 at 16:47 -0700, Luis R. Rodriguez wrote:
> >
> >> /**
> >> + * enum nl80211_dfs_regions - regulatory DFS regions
> >> + *
> >> + * @NL80211_DFS_UNSET: Country has no DFS master region specified
> >> + * @NL80211_DFS_FCC_: Country follows DFS master rules from FCC
> >> + * @NL80211_DFS_FCC_: Country follows DFS master rules from ETSI
> >> + * @NL80211_DFS_JP_: Country follows DFS master rules from JP/MKK/Telec
> >> + */
> >> +enum nl80211_cflags {
> >> + NL80211_DFS_UNSET = 0,
> >
> > That seems odd -- nl80211 convention would be to just leave out the
> > attribute.
>
> I wonder what seems more odd, having that present or looking at this:
>
> +bool reg_supported_dfs_region(u8 dfs_region)
> +{
> + switch (dfs_region) {
> + case 0:
Yeah I noticed later you were going to use that value internally as
well, guess it's fine.
johannes
^ permalink raw reply
* Re: moving GIT back to kernel.org...
From: David Miller @ 2011-10-07 19:59 UTC (permalink / raw)
To: netdev, sfr; +Cc: linux-wireless, netfilter-devel, sparclinux, linux-ide
In-Reply-To: <20111007.145703.842130763413648388.davem@davemloft.net>
From: David Miller <davem@davemloft.net>
Date: Fri, 07 Oct 2011 14:57:03 -0400 (EDT)
>
> I'm about to setup my GIT trees on kernel.org, once that is complete
> I will be solely updating those trees again.
>
> I will notify everyone when this is ready to go.
>
> Just a heads up for everyone...
Ok, they are now online, please update your URLs.
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc.git
git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide.git
Thanks.
^ permalink raw reply
* Re: [PATCH 3/8] cfg80211: process regulatory DFS region for countries
From: Luis R. Rodriguez @ 2011-10-07 19:57 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, linville
In-Reply-To: <1318017260.3974.9.camel@jlt3.sipsolutions.net>
On Fri, Oct 7, 2011 at 12:54 PM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Tue, 2011-10-04 at 16:47 -0700, Luis R. Rodriguez wrote:
>
>> /**
>> + * enum nl80211_dfs_regions - regulatory DFS regions
>> + *
>> + * @NL80211_DFS_UNSET: Country has no DFS master region specified
>> + * @NL80211_DFS_FCC_: Country follows DFS master rules from FCC
>> + * @NL80211_DFS_FCC_: Country follows DFS master rules from ETSI
>> + * @NL80211_DFS_JP_: Country follows DFS master rules from JP/MKK/Telec
>> + */
>> +enum nl80211_cflags {
>> + NL80211_DFS_UNSET = 0,
>
> That seems odd -- nl80211 convention would be to just leave out the
> attribute.
I wonder what seems more odd, having that present or looking at this:
+bool reg_supported_dfs_region(u8 dfs_region)
+{
+ switch (dfs_region) {
+ case 0:
+ case NL80211_DFS_FCC:
+ case NL80211_DFS_ETSI:
+ case NL80211_DFS_JP:
+ return true;
+ default:
+ REG_DBG_PRINT("Ignoring uknown DFS master region: %d\n",
+ dfs_region);
+ return false;
+ }
+}
Vs:
+bool reg_supported_dfs_region(u8 dfs_region)
+{
+ switch (dfs_region) {
+ case NL80211_DFS_UNSET:
+ case NL80211_DFS_FCC:
+ case NL80211_DFS_ETSI:
+ case NL80211_DFS_JP:
+ return true;
+ default:
+ REG_DBG_PRINT("Ignoring uknown DFS master region: %d\n",
+ dfs_region);
+ return false;
+ }
+}
You pick, you're the maintainer.
Luis
^ permalink raw reply
* Re: [PATCH 3/8] cfg80211: process regulatory DFS region for countries
From: Johannes Berg @ 2011-10-07 19:54 UTC (permalink / raw)
To: Luis R. Rodriguez; +Cc: linux-wireless, linville
In-Reply-To: <1317772067-6998-4-git-send-email-mcgrof@qca.qualcomm.com>
On Tue, 2011-10-04 at 16:47 -0700, Luis R. Rodriguez wrote:
> /**
> + * enum nl80211_dfs_regions - regulatory DFS regions
> + *
> + * @NL80211_DFS_UNSET: Country has no DFS master region specified
> + * @NL80211_DFS_FCC_: Country follows DFS master rules from FCC
> + * @NL80211_DFS_FCC_: Country follows DFS master rules from ETSI
> + * @NL80211_DFS_JP_: Country follows DFS master rules from JP/MKK/Telec
> + */
> +enum nl80211_cflags {
> + NL80211_DFS_UNSET = 0,
That seems odd -- nl80211 convention would be to just leave out the
attribute.
johannes
^ permalink raw reply
* Compat-wireless release for 2011-10-07 is baked
From: Compat-wireless cronjob account @ 2011-10-07 19:04 UTC (permalink / raw)
To: linux-wireless
>From git://github.com/mcgrof/compat-wireless
e4f1a17..8163a60 master -> origin/master
>From git://github.com/sfrothwell/linux-next
+ 98b3e8f...186cf8e akpm-end -> origin/akpm-end (forced update)
538d288..3ee72ca akpm-start -> origin/akpm-start
+ 40a33ae...12d1b9a master -> origin/master (forced update)
538d288..3ee72ca stable -> origin/stable
* [new tag] next-20111007 -> next-20111007
compat-wireless code metrics
811845 - Total upstream lines of code being pulled
2431 - backport code changes
2113 - backport code additions
318 - backport code deletions
8588 - backport from compat module
11019 - total backport code
1.3573 - % of code consists of backport work
^ permalink raw reply
* moving GIT back to kernel.org...
From: David Miller @ 2011-10-07 18:57 UTC (permalink / raw)
To: netdev; +Cc: linux-wireless, netfilter-devel, sparclinux, linux-ide
I'm about to setup my GIT trees on kernel.org, once that is complete
I will be solely updating those trees again.
I will notify everyone when this is ready to go.
Just a heads up for everyone...
^ permalink raw reply
* Re: [RFC] net: add wireless TX status socket option
From: Johannes Berg @ 2011-10-07 18:06 UTC (permalink / raw)
To: netdev; +Cc: linux-wireless, Neil Horman
In-Reply-To: <1318007970.3988.27.camel@jlt3.sipsolutions.net>
On Fri, 2011-10-07 at 19:19 +0200, Johannes Berg wrote:
> This works similar to the existing TX timestamping
> in that it reflects the SKB back to the socket's
> error queue with a SCM_WIFI_STATUS cmsg that has
> an int indicating ACK status (0/1).
I should give you a test application. This is based on the code in
Documentation/networking/timestamping/timestamping.c and sends the same
frames, but to UDP port 1 to a peer you give on the command line.
E.g. if you save this file as ack.c, you can do
$ ./ack 192.168.100.2
SO_WIFI_STATUS 1
1318010597.494035: sent 124 bytes
1318010597.494084: select 2505916us
1318010597.513457: select returned: 1, success
ready for reading
1318010597.513668: received error data, 194 bytes from 69.0.0.152, 72 bytes control messages
cmsg len 20: SOL_SOCKET acked: 1
cmsg len 48: IPPROTO_IP IP_RECVERR ee_errno 'No message of desired type' ee_origin 4 => bounced packet => GOT OUR DATA BACK (HURRAY!)
1318010597.513860: select 2486140us
(not sure what's with the bogus RX IP, probably just not a valid field here)
johannes
/*
* This program demonstrates how the wifi ack status feature in
* the Linux kernel works. It sends some random packets and prints
* out whether it was acked.
*
* Copyright (C) 2009, 2011 Intel Corporation.
* Author: Patrick Ohly <patrick.ohly@intel.com>
* Author: Johannes Berg <johannes.berg@intel.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/select.h>
#include <sys/ioctl.h>
#include <arpa/inet.h>
#include <net/if.h>
#include <asm/types.h>
#include <linux/net_tstamp.h>
#include <linux/errqueue.h>
#ifndef SO_WIFI_STATUS
# define SO_WIFI_STATUS 41
# define SCM_WIFI_STATUS SO_WIFI_STATUS
#endif
#ifndef SO_EE_ORIGIN_TXSTATUS
#define SO_EE_ORIGIN_TXSTATUS 4
#endif
static void bail(const char *error)
{
printf("%s: %s\n", error, strerror(errno));
exit(1);
}
static const unsigned char sync[] = {
0x00, 0x01, 0x00, 0x01,
0x5f, 0x44, 0x46, 0x4c,
0x54, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x01, 0x01,
/* fake uuid */
0x00, 0x01,
0x02, 0x03, 0x04, 0x05,
0x00, 0x01, 0x00, 0x37,
0x00, 0x00, 0x00, 0x08,
0x00, 0x00, 0x00, 0x00,
0x49, 0x05, 0xcd, 0x01,
0x29, 0xb1, 0x8d, 0xb0,
0x00, 0x00, 0x00, 0x00,
0x00, 0x01,
/* fake uuid */
0x00, 0x01,
0x02, 0x03, 0x04, 0x05,
0x00, 0x00, 0x00, 0x37,
0x00, 0x00, 0x00, 0x04,
0x44, 0x46, 0x4c, 0x54,
0x00, 0x00, 0xf0, 0x60,
0x00, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0xf0, 0x60,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x04,
0x44, 0x46, 0x4c, 0x54,
0x00, 0x01,
/* fake uuid */
0x00, 0x01,
0x02, 0x03, 0x04, 0x05,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00
};
static void sendpacket(int sock, struct sockaddr *addr, socklen_t addr_len)
{
struct timeval now;
int res;
res = sendto(sock, sync, sizeof(sync), 0,
addr, addr_len);
gettimeofday(&now, 0);
if (res < 0)
printf("%s: %s\n", "send", strerror(errno));
else
printf("%ld.%06ld: sent %d bytes\n",
(long)now.tv_sec, (long)now.tv_usec,
res);
}
static void printpacket(struct msghdr *msg, int res,
char *data, int sock)
{
struct sockaddr_in *from_addr = (struct sockaddr_in *)msg->msg_name;
struct cmsghdr *cmsg;
struct timeval tv;
struct timespec ts;
struct timeval now;
gettimeofday(&now, 0);
printf("%ld.%06ld: received %s data, %d bytes from %s, %zu bytes control messages\n",
(long)now.tv_sec, (long)now.tv_usec, "error",
res,
inet_ntoa(from_addr->sin_addr),
msg->msg_controllen);
for (cmsg = CMSG_FIRSTHDR(msg);
cmsg;
cmsg = CMSG_NXTHDR(msg, cmsg)) {
printf(" cmsg len %zu: ", cmsg->cmsg_len);
switch (cmsg->cmsg_level) {
case SOL_SOCKET:
printf("SOL_SOCKET ");
switch (cmsg->cmsg_type) {
case SCM_WIFI_STATUS: {
int *ack = (void *)CMSG_DATA(cmsg);
printf("acked: %d", *ack);
break;
}
default:
printf("type %d", cmsg->cmsg_type);
break;
}
break;
case IPPROTO_IP:
printf("IPPROTO_IP ");
switch (cmsg->cmsg_type) {
case IP_RECVERR: {
struct sock_extended_err *err =
(struct sock_extended_err *)CMSG_DATA(cmsg);
printf("IP_RECVERR ee_errno '%s' ee_origin %d => %s",
strerror(err->ee_errno),
err->ee_origin,
err->ee_origin == SO_EE_ORIGIN_TXSTATUS ?
"bounced packet" : "unexpected origin"
);
if (res < sizeof(sync))
printf(" => truncated data?!");
else if (!memcmp(sync, data + res - sizeof(sync),
sizeof(sync)))
printf(" => GOT OUR DATA BACK (HURRAY!)");
break;
}
case IP_PKTINFO: {
struct in_pktinfo *pktinfo =
(struct in_pktinfo *)CMSG_DATA(cmsg);
printf("IP_PKTINFO interface index %u",
pktinfo->ipi_ifindex);
break;
}
default:
printf("type %d", cmsg->cmsg_type);
break;
}
break;
default:
printf("level %d type %d",
cmsg->cmsg_level,
cmsg->cmsg_type);
break;
}
printf("\n");
}
}
static void recvpacket(int sock)
{
char data[256];
struct msghdr msg;
struct iovec entry;
struct sockaddr_in from_addr;
struct {
struct cmsghdr cm;
char control[512];
} control;
int res;
memset(&msg, 0, sizeof(msg));
msg.msg_iov = &entry;
msg.msg_iovlen = 1;
entry.iov_base = data;
entry.iov_len = sizeof(data);
msg.msg_name = (caddr_t)&from_addr;
msg.msg_namelen = sizeof(from_addr);
msg.msg_control = &control;
msg.msg_controllen = sizeof(control);
res = recvmsg(sock, &msg, MSG_ERRQUEUE|MSG_DONTWAIT);
if (res < 0) {
printf("%s %s: %s\n",
"recvmsg", "error",
strerror(errno));
} else {
printpacket(&msg, res, data, sock);
}
}
int main(int argc, char **argv)
{
int i;
int enabled = 1;
int sock;
struct ifreq device;
struct ifreq hwtstamp;
struct sockaddr_in addr;
struct ip_mreq imr;
int val;
socklen_t len;
struct timeval next;
addr.sin_family = AF_INET;
addr.sin_port = htons(1);
if (argc != 2 || inet_aton(argv[1], &addr.sin_addr) == 0) {
printf("%s <ip addr>\n", argv[0]);
exit(1);
}
sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
if (sock < 0)
bail("socket");
/* set socket option for wifi status */
if (setsockopt(sock, SOL_SOCKET, SO_WIFI_STATUS,
&enabled, sizeof(enabled)) < 0) {
bail("enable ack status");
}
/* request IP_PKTINFO for debugging purposes */
if (setsockopt(sock, SOL_IP, IP_PKTINFO,
&enabled, sizeof(enabled)) < 0)
printf("%s: %s\n", "setsockopt IP_PKTINFO", strerror(errno));
/* verify socket options */
len = sizeof(val);
if (getsockopt(sock, SOL_SOCKET, SO_WIFI_STATUS, &val, &len) < 0)
printf("%s: %s\n", "getsockopt SO_TIMESTAMP", strerror(errno));
else
printf("SO_WIFI_STATUS %d\n", val);
/* send packets forever every five seconds */
gettimeofday(&next, 0);
next.tv_sec = (next.tv_sec + 1) / 5 * 5;
next.tv_usec = 0;
while (1) {
struct timeval now;
struct timeval delta;
long delta_us;
int res;
fd_set readfs, errorfs;
gettimeofday(&now, 0);
delta_us = (long)(next.tv_sec - now.tv_sec) * 1000000 +
(long)(next.tv_usec - now.tv_usec);
if (delta_us > 0) {
/* continue waiting for timeout or data */
delta.tv_sec = delta_us / 1000000;
delta.tv_usec = delta_us % 1000000;
FD_ZERO(&readfs);
FD_ZERO(&errorfs);
FD_SET(sock, &readfs);
FD_SET(sock, &errorfs);
printf("%ld.%06ld: select %ldus\n",
(long)now.tv_sec, (long)now.tv_usec,
delta_us);
res = select(sock + 1, &readfs, 0, &errorfs, &delta);
gettimeofday(&now, 0);
printf("%ld.%06ld: select returned: %d, %s\n",
(long)now.tv_sec, (long)now.tv_usec,
res,
res < 0 ? strerror(errno) : "success");
if (res > 0) {
if (FD_ISSET(sock, &readfs))
printf("ready for reading\n");
if (FD_ISSET(sock, &errorfs))
printf("has error\n");
recvpacket(sock);
}
} else {
/* write one packet */
sendpacket(sock,
(struct sockaddr *)&addr,
sizeof(addr));
next.tv_sec += 5;
continue;
}
}
return 0;
}
^ permalink raw reply
* Re: Using spdiff for backporting
From: Luis R. Rodriguez @ 2011-10-07 17:41 UTC (permalink / raw)
To: Jesper Andersen; +Cc: julia, linux-wireless, linux-kernel, alsa-devel
In-Reply-To: <1317721043.11231.2.camel@jmachine>
On Tue, Oct 4, 2011 at 2:37 AM, Jesper Andersen <jespera@gmail.com> wrote:
> Hi
>
> Somehow, I think the email below was never sent? Could either of you confirm my suspicion?
I just checked and I did get the original e-mail. Apologies for the
late reply. Below my reply.
> ====== Original email ======
>
> Here are a two results that I have found using spdiff on some of the
> patches from compat-wireless.
>
> 01-netdev:
> @@
> struct net_device * X5;
> const struct net_device_ops X6;
> @@
> - X5->netdev_ops=&X6;
> + netdev_attach_ops(X5,&X6);
>
> 27-hermes-read-pda:
> @@
> struct hermes * X0;
> @@
> - X0->ops->read_pda
> + X0->ops->read_pda_h
>
> Basically, I have done the following
>
> - clone the linux-next tree
> - apply a patch from compat-wireless/patches
> - git commit
> - extract pairs of original and modified files affected by the commit
> (I call this set of pairs a "change set")
> - apply spdiff to the extracted pairs
> - adjust parameters to spdiff until something reasonable comes out
>
> For spdiff to work in its current form we need a change set with at
> least two similar modifications. For the netdev-ops case we actually
> have many changes matching "X5->netdev_ops=&X6" and seemingly those
> locations are all rewritten into: "netdev_attach_ops(X5,&X6)".
>
> For many of the patches in compat-wireless/patches, however such a
> scenario is not present. For example 03-rfkill consists of just one
> change of the string "rfkill" to "rfkill_backport". In this case spdiff
> cannot really infer anything useful.
Ah I see.
> The question is: given that spdiff in its current form really needs at
> least two example changes, could you perhaps point me at which of the
> patches in compat-wireless/patches should contain such things?
Sure thing. I'll review that and get back to you.
> Also, in the slides from the plumbers-conf. I think I saw it mentioned
> that there's also an alsa-compat git-tree somewhere. Maybe that is a
> more compelling usecase? I was unable to find it though so I'd
> appreciate a link.
It was on kernel.org, but if it got rm -rf'd then its gone as I do not
have a local copy. The compat-alsa stuff though was determined to be
superflous with the ALSA's team's own backport work which is currently
independent. My hope though is to unify these through the compat.git /
compat-kernel (currently just called compat-wireless) effort.
> A way that we maybe could get some more similar changes would be to
> focus on finding a patch for a specific version. E.g. for
> 09-threaded-irq there's a lot if #ifdefs for versions less than 2.6.31.
> In that case it seems for the lower version numbers, some code is added
> and for higher versions some other code has to be present. Instead, we
> could try to find a patch from the changes between >2.6.31 and <2.6.31
> perhaps?
Not sure I get this, could you elaborate a bit more? Are you saying to
cheat and double up the ifdef's for at least two older kernels or
newer kernels so that spatch gets two "change sets"?
> Or maybe you (Luis) have a better suggestion for how spdiff could be
> used. I am very open to modifications required specifically for doing
> backports work, I just need to get an idea for what would be useful to
> be able to infer. :-)
I'm perfectly happy with living with spdiff only helping with large
"change sets", and dealing with the rest of the patches manually.
Likely spdiff can help when we decide we want to add backport support
for a new subsystem, so we'd just apply the spatch's generated to the
new directories we want to consider, and then just require manual work
for what is left.
Luis
^ permalink raw reply
* [RFC] net: add wireless TX status socket option
From: Johannes Berg @ 2011-10-07 17:19 UTC (permalink / raw)
To: netdev; +Cc: linux-wireless, Neil Horman
From: Johannes Berg <johannes.berg@intel.com>
The 802.1X EAPOL handshake hostapd does requires
knowing whether the frame was ack'ed by the peer.
Currently, we fudge this pretty badly by not even
transmitting the frame as a normal data frame but
injecting it with radiotap and getting the status
out of radiotap monitor as well. This is rather
complex, confuses users (mon.wlan0 presence) and
doesn't work with all hardware.
To get rid of that hack, introduce a real wifi TX
status option for data frame transmissions.
This works similar to the existing TX timestamping
in that it reflects the SKB back to the socket's
error queue with a SCM_WIFI_STATUS cmsg that has
an int indicating ACK status (0/1).
Since it is possible that at some point we will
want to have TX timestamping and wifi status in a
single errqueue SKB (there's little point in not
doing that), redefine SO_EE_ORIGIN_TIMESTAMPING
to SO_EE_ORIGIN_TXSTATUS which can collect more
than just the timestamp; keep the old constant
as an alias of course. Currently the internal APIs
don't make that possible, but it wouldn't be hard
to split them up in a way that makes it possible.
Thanks to Neil Horman for helping me figure out
the functions that add the control messages.
TODO:
* sock_tx_timestamp() function should be renamed,
maybe to sock_tx_status()?
* sock_recv_timestamp() should also be renamed,
I had a hard time figuring out the difference
between that and sock_recv_ts_and_drops(). The
former is generic, while the latter adds RX
information only, maybe that should be reflected
in new names?
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
arch/alpha/include/asm/socket.h | 3 +++
arch/arm/include/asm/socket.h | 3 +++
arch/avr32/include/asm/socket.h | 3 +++
arch/cris/include/asm/socket.h | 3 +++
arch/frv/include/asm/socket.h | 3 +++
arch/h8300/include/asm/socket.h | 3 +++
arch/ia64/include/asm/socket.h | 3 +++
arch/m32r/include/asm/socket.h | 3 +++
arch/m68k/include/asm/socket.h | 3 +++
arch/mips/include/asm/socket.h | 3 +++
arch/mn10300/include/asm/socket.h | 3 +++
arch/parisc/include/asm/socket.h | 3 +++
arch/powerpc/include/asm/socket.h | 3 +++
arch/s390/include/asm/socket.h | 3 +++
arch/sparc/include/asm/socket.h | 3 +++
arch/xtensa/include/asm/socket.h | 3 +++
include/asm-generic/socket.h | 3 +++
include/linux/errqueue.h | 3 ++-
include/linux/skbuff.h | 18 ++++++++++++++++--
include/net/sock.h | 7 +++++++
net/core/skbuff.c | 20 ++++++++++++++++++++
net/core/sock.c | 9 +++++++++
net/mac80211/status.c | 35 +++++++++++++++++++++++++++--------
net/mac80211/tx.c | 8 +++++++-
net/socket.c | 19 +++++++++++++++++++
25 files changed, 158 insertions(+), 12 deletions(-)
--- a/include/asm-generic/socket.h 2011-10-07 18:59:12.000000000 +0200
+++ b/include/asm-generic/socket.h 2011-10-07 18:59:12.000000000 +0200
@@ -64,4 +64,7 @@
#define SO_DOMAIN 39
#define SO_RXQ_OVFL 40
+
+#define SO_WIFI_STATUS 41
+#define SCM_WIFI_STATUS SO_WIFI_STATUS
#endif /* __ASM_GENERIC_SOCKET_H */
--- a/net/core/sock.c 2011-10-07 18:59:12.000000000 +0200
+++ b/net/core/sock.c 2011-10-07 18:59:12.000000000 +0200
@@ -740,6 +740,11 @@ set_rcvbuf:
case SO_RXQ_OVFL:
sock_valbool_flag(sk, SOCK_RXQ_OVFL, valbool);
break;
+
+ case SO_WIFI_STATUS:
+ sock_valbool_flag(sk, SOCK_WIFI_STATUS, valbool);
+ break;
+
default:
ret = -ENOPROTOOPT;
break;
@@ -961,6 +966,10 @@ int sock_getsockopt(struct socket *sock,
v.val = !!sock_flag(sk, SOCK_RXQ_OVFL);
break;
+ case SO_WIFI_STATUS:
+ v.val = !!sock_flag(sk, SOCK_WIFI_STATUS);
+ break;
+
default:
return -ENOPROTOOPT;
}
--- a/include/net/sock.h 2011-10-07 18:59:12.000000000 +0200
+++ b/include/net/sock.h 2011-10-07 18:59:12.000000000 +0200
@@ -564,6 +564,7 @@ enum sock_flags {
SOCK_FASYNC, /* fasync() active */
SOCK_RXQ_OVFL,
SOCK_ZEROCOPY, /* buffers from userspace */
+ SOCK_WIFI_STATUS, /* push wifi status to userspace */
};
static inline void sock_copy_flags(struct sock *nsk, struct sock *osk)
@@ -1705,7 +1706,10 @@ static inline int sock_intr_errno(long t
extern void __sock_recv_timestamp(struct msghdr *msg, struct sock *sk,
struct sk_buff *skb);
+extern void __sock_recv_wifi_status(struct msghdr *msg, struct sock *sk,
+ struct sk_buff *skb);
+/* XXX: rename this function now? */
static __inline__ void
sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb)
{
@@ -1732,6 +1736,9 @@ sock_recv_timestamp(struct msghdr *msg,
__sock_recv_timestamp(msg, sk, skb);
else
sk->sk_stamp = kt;
+
+ if (sock_flag(sk, SOCK_WIFI_STATUS) && skb->wifi_acked_valid)
+ __sock_recv_wifi_status(msg, sk, skb);
}
extern void __sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk,
--- a/arch/alpha/include/asm/socket.h 2011-10-07 18:59:11.000000000 +0200
+++ b/arch/alpha/include/asm/socket.h 2011-10-07 18:59:12.000000000 +0200
@@ -69,6 +69,9 @@
#define SO_RXQ_OVFL 40
+#define SO_WIFI_STATUS 41
+#define SCM_WIFI_STATUS SO_WIFI_STATUS
+
/* O_NONBLOCK clashes with the bits used for socket types. Therefore we
* have to define SOCK_NONBLOCK to a different value here.
*/
--- a/arch/arm/include/asm/socket.h 2011-10-07 18:59:11.000000000 +0200
+++ b/arch/arm/include/asm/socket.h 2011-10-07 18:59:12.000000000 +0200
@@ -62,4 +62,7 @@
#define SO_RXQ_OVFL 40
+#define SO_WIFI_STATUS 41
+#define SCM_WIFI_STATUS SO_WIFI_STATUS
+
#endif /* _ASM_SOCKET_H */
--- a/arch/avr32/include/asm/socket.h 2011-10-07 18:59:10.000000000 +0200
+++ b/arch/avr32/include/asm/socket.h 2011-10-07 18:59:12.000000000 +0200
@@ -62,4 +62,7 @@
#define SO_RXQ_OVFL 40
+#define SO_WIFI_STATUS 41
+#define SCM_WIFI_STATUS SO_WIFI_STATUS
+
#endif /* __ASM_AVR32_SOCKET_H */
--- a/arch/cris/include/asm/socket.h 2011-10-07 18:59:11.000000000 +0200
+++ b/arch/cris/include/asm/socket.h 2011-10-07 18:59:12.000000000 +0200
@@ -64,6 +64,9 @@
#define SO_RXQ_OVFL 40
+#define SO_WIFI_STATUS 41
+#define SCM_WIFI_STATUS SO_WIFI_STATUS
+
#endif /* _ASM_SOCKET_H */
--- a/arch/frv/include/asm/socket.h 2011-10-07 18:59:11.000000000 +0200
+++ b/arch/frv/include/asm/socket.h 2011-10-07 18:59:12.000000000 +0200
@@ -62,5 +62,8 @@
#define SO_RXQ_OVFL 40
+#define SO_WIFI_STATUS 41
+#define SCM_WIFI_STATUS SO_WIFI_STATUS
+
#endif /* _ASM_SOCKET_H */
--- a/arch/h8300/include/asm/socket.h 2011-10-07 18:59:10.000000000 +0200
+++ b/arch/h8300/include/asm/socket.h 2011-10-07 18:59:12.000000000 +0200
@@ -62,4 +62,7 @@
#define SO_RXQ_OVFL 40
+#define SO_WIFI_STATUS 41
+#define SCM_WIFI_STATUS SO_WIFI_STATUS
+
#endif /* _ASM_SOCKET_H */
--- a/arch/ia64/include/asm/socket.h 2011-10-07 18:59:11.000000000 +0200
+++ b/arch/ia64/include/asm/socket.h 2011-10-07 18:59:12.000000000 +0200
@@ -71,4 +71,7 @@
#define SO_RXQ_OVFL 40
+#define SO_WIFI_STATUS 41
+#define SCM_WIFI_STATUS SO_WIFI_STATUS
+
#endif /* _ASM_IA64_SOCKET_H */
--- a/arch/m32r/include/asm/socket.h 2011-10-07 18:59:11.000000000 +0200
+++ b/arch/m32r/include/asm/socket.h 2011-10-07 18:59:12.000000000 +0200
@@ -62,4 +62,7 @@
#define SO_RXQ_OVFL 40
+#define SO_WIFI_STATUS 41
+#define SCM_WIFI_STATUS SO_WIFI_STATUS
+
#endif /* _ASM_M32R_SOCKET_H */
--- a/arch/m68k/include/asm/socket.h 2011-10-07 18:59:11.000000000 +0200
+++ b/arch/m68k/include/asm/socket.h 2011-10-07 18:59:12.000000000 +0200
@@ -62,4 +62,7 @@
#define SO_RXQ_OVFL 40
+#define SO_WIFI_STATUS 41
+#define SCM_WIFI_STATUS SO_WIFI_STATUS
+
#endif /* _ASM_SOCKET_H */
--- a/arch/mips/include/asm/socket.h 2011-10-07 18:59:11.000000000 +0200
+++ b/arch/mips/include/asm/socket.h 2011-10-07 18:59:12.000000000 +0200
@@ -82,6 +82,9 @@ To add: #define SO_REUSEPORT 0x0200 /* A
#define SO_RXQ_OVFL 40
+#define SO_WIFI_STATUS 41
+#define SCM_WIFI_STATUS SO_WIFI_STATUS
+
#ifdef __KERNEL__
/** sock_type - Socket types
--- a/arch/mn10300/include/asm/socket.h 2011-10-07 18:59:10.000000000 +0200
+++ b/arch/mn10300/include/asm/socket.h 2011-10-07 18:59:12.000000000 +0200
@@ -62,4 +62,7 @@
#define SO_RXQ_OVFL 40
+#define SO_WIFI_STATUS 41
+#define SCM_WIFI_STATUS SO_WIFI_STATUS
+
#endif /* _ASM_SOCKET_H */
--- a/arch/parisc/include/asm/socket.h 2011-10-07 18:59:10.000000000 +0200
+++ b/arch/parisc/include/asm/socket.h 2011-10-07 18:59:12.000000000 +0200
@@ -61,6 +61,9 @@
#define SO_RXQ_OVFL 0x4021
+#define SO_WIFI_STATUS 0x4022
+#define SCM_WIFI_STATUS SO_WIFI_STATUS
+
/* O_NONBLOCK clashes with the bits used for socket types. Therefore we
* have to define SOCK_NONBLOCK to a different value here.
*/
--- a/arch/powerpc/include/asm/socket.h 2011-10-07 18:59:11.000000000 +0200
+++ b/arch/powerpc/include/asm/socket.h 2011-10-07 18:59:12.000000000 +0200
@@ -69,4 +69,7 @@
#define SO_RXQ_OVFL 40
+#define SO_WIFI_STATUS 41
+#define SCM_WIFI_STATUS SO_WIFI_STATUS
+
#endif /* _ASM_POWERPC_SOCKET_H */
--- a/arch/s390/include/asm/socket.h 2011-10-07 18:59:10.000000000 +0200
+++ b/arch/s390/include/asm/socket.h 2011-10-07 18:59:12.000000000 +0200
@@ -70,4 +70,7 @@
#define SO_RXQ_OVFL 40
+#define SO_WIFI_STATUS 41
+#define SCM_WIFI_STATUS SO_WIFI_STATUS
+
#endif /* _ASM_SOCKET_H */
--- a/arch/sparc/include/asm/socket.h 2011-10-07 18:59:10.000000000 +0200
+++ b/arch/sparc/include/asm/socket.h 2011-10-07 18:59:12.000000000 +0200
@@ -58,6 +58,9 @@
#define SO_RXQ_OVFL 0x0024
+#define SO_WIFI_STATUS 0x0025
+#define SCM_WIFI_STATUS SO_WIFI_STATUS
+
/* Security levels - as per NRL IPv6 - don't actually do anything */
#define SO_SECURITY_AUTHENTICATION 0x5001
#define SO_SECURITY_ENCRYPTION_TRANSPORT 0x5002
--- a/arch/xtensa/include/asm/socket.h 2011-10-07 18:59:10.000000000 +0200
+++ b/arch/xtensa/include/asm/socket.h 2011-10-07 18:59:12.000000000 +0200
@@ -73,4 +73,7 @@
#define SO_RXQ_OVFL 40
+#define SO_WIFI_STATUS 41
+#define SCM_WIFI_STATUS SO_WIFI_STATUS
+
#endif /* _XTENSA_SOCKET_H */
--- a/include/linux/errqueue.h 2011-10-07 18:59:11.000000000 +0200
+++ b/include/linux/errqueue.h 2011-10-07 18:59:12.000000000 +0200
@@ -17,7 +17,8 @@ struct sock_extended_err {
#define SO_EE_ORIGIN_LOCAL 1
#define SO_EE_ORIGIN_ICMP 2
#define SO_EE_ORIGIN_ICMP6 3
-#define SO_EE_ORIGIN_TIMESTAMPING 4
+#define SO_EE_ORIGIN_TXSTATUS 4
+#define SO_EE_ORIGIN_TIMESTAMPING SO_EE_ORIGIN_TXSTATUS
#define SO_EE_OFFENDER(ee) ((struct sockaddr*)((ee)+1))
--- a/include/linux/skbuff.h 2011-10-07 18:59:11.000000000 +0200
+++ b/include/linux/skbuff.h 2011-10-07 18:59:12.000000000 +0200
@@ -190,6 +190,9 @@ enum {
/* device driver supports TX zero-copy buffers */
SKBTX_DEV_ZEROCOPY = 1 << 4,
+
+ /* generate wifi status information (where possible) */
+ SKBTX_WIFI_STATUS = 1 << 5,
};
/*
@@ -322,6 +325,8 @@ typedef unsigned char *sk_buff_data_t;
* @queue_mapping: Queue mapping for multiqueue devices
* @ndisc_nodetype: router type (from link layer)
* @ooo_okay: allow the mapping of a socket to a queue to be changed
+ * @wifi_acked_valid: wifi_acked was set
+ * @wifi_acked: whether frame was acked on wifi or not
* @dma_cookie: a cookie to one of several possible DMA operations
* done by skb DMA functions
* @secmark: security marking
@@ -414,10 +419,10 @@ struct sk_buff {
__u8 ndisc_nodetype:2;
#endif
__u8 ooo_okay:1;
+ __u8 wifi_acked_valid:1;
+ __u8 wifi_acked:1;
kmemcheck_bitfield_end(flags2);
- /* 0/13 bit hole */
-
#ifdef CONFIG_NET_DMA
dma_cookie_t dma_cookie;
#endif
@@ -2062,6 +2067,15 @@ static inline void skb_tx_timestamp(stru
sw_tx_timestamp(skb);
}
+/**
+ * skb_complete_wifi_ack - deliver cloned skb with wifi status
+ *
+ * @skb: clone of the the original outgoing packet
+ * @acked: ack status
+ *
+ */
+void skb_complete_wifi_ack(struct sk_buff *skb, bool acked);
+
extern __sum16 __skb_checksum_complete_head(struct sk_buff *skb, int len);
extern __sum16 __skb_checksum_complete(struct sk_buff *skb);
--- a/net/core/skbuff.c 2011-10-07 18:59:12.000000000 +0200
+++ b/net/core/skbuff.c 2011-10-07 18:59:24.000000000 +0200
@@ -3150,6 +3150,26 @@ void skb_tstamp_tx(struct sk_buff *orig_
}
EXPORT_SYMBOL_GPL(skb_tstamp_tx);
+void skb_complete_wifi_ack(struct sk_buff *skb, bool acked)
+{
+ struct sock *sk = skb->sk;
+ struct sock_exterr_skb *serr;
+ int err;
+
+ skb->wifi_acked_valid = 1;
+ skb->wifi_acked = acked;
+
+ serr = SKB_EXT_ERR(skb);
+ memset(serr, 0, sizeof(*serr));
+ serr->ee.ee_errno = ENOMSG;
+ serr->ee.ee_origin = SO_EE_ORIGIN_TXSTATUS;
+
+ err = sock_queue_err_skb(sk, skb);
+ if (err)
+ kfree_skb(skb);
+}
+EXPORT_SYMBOL_GPL(skb_complete_wifi_ack);
+
/**
* skb_partial_csum_set - set up and verify partial csum values for packet
--- a/net/socket.c 2011-10-07 18:59:12.000000000 +0200
+++ b/net/socket.c 2011-10-07 18:59:12.000000000 +0200
@@ -531,6 +531,7 @@ void sock_release(struct socket *sock)
}
EXPORT_SYMBOL(sock_release);
+/* XXX: rename this function now */
int sock_tx_timestamp(struct sock *sk, __u8 *tx_flags)
{
*tx_flags = 0;
@@ -538,6 +539,8 @@ int sock_tx_timestamp(struct sock *sk, _
*tx_flags |= SKBTX_HW_TSTAMP;
if (sock_flag(sk, SOCK_TIMESTAMPING_TX_SOFTWARE))
*tx_flags |= SKBTX_SW_TSTAMP;
+ if (sock_flag(sk, SOCK_WIFI_STATUS))
+ *tx_flags |= SKBTX_WIFI_STATUS;
return 0;
}
EXPORT_SYMBOL(sock_tx_timestamp);
@@ -674,6 +677,22 @@ void __sock_recv_timestamp(struct msghdr
}
EXPORT_SYMBOL_GPL(__sock_recv_timestamp);
+void __sock_recv_wifi_status(struct msghdr *msg, struct sock *sk,
+ struct sk_buff *skb)
+{
+ int ack;
+
+ if (!sock_flag(sk, SOCK_WIFI_STATUS))
+ return;
+ if (!skb->wifi_acked_valid)
+ return;
+
+ ack = skb->wifi_acked;
+
+ put_cmsg(msg, SOL_SOCKET, SCM_WIFI_STATUS, sizeof(ack), &ack);
+}
+EXPORT_SYMBOL_GPL(__sock_recv_wifi_status);
+
static inline void sock_recv_drops(struct msghdr *msg, struct sock *sk,
struct sk_buff *skb)
{
--- a/net/mac80211/status.c 2011-10-07 18:59:12.000000000 +0200
+++ b/net/mac80211/status.c 2011-10-07 19:05:24.000000000 +0200
@@ -252,8 +252,9 @@ void ieee80211_tx_status(struct ieee8021
struct sta_info *sta, *tmp;
int retry_count = -1, i;
int rates_idx = -1;
- bool send_to_cooked;
+ bool send_to_cooked, need_for_monitors;
bool acked;
+ bool multicast;
struct ieee80211_bar *bar;
u16 tid;
@@ -278,6 +279,7 @@ void ieee80211_tx_status(struct ieee8021
sband = local->hw.wiphy->bands[info->band];
fc = hdr->frame_control;
+ multicast = is_multicast_ether_addr(hdr->addr1);
for_each_sta_info(local, hdr->addr1, sta, tmp) {
/* skip wrong virtual interface */
@@ -443,9 +445,6 @@ void ieee80211_tx_status(struct ieee8021
!!(info->flags & IEEE80211_TX_STAT_ACK), GFP_ATOMIC);
}
- /* this was a transmitted frame, but now we want to reuse it */
- skb_orphan(skb);
-
/* Need to make a copy before skb->cb gets cleared */
send_to_cooked = !!(info->flags & IEEE80211_TX_CTL_INJECTED) ||
(type != IEEE80211_FTYPE_DATA);
@@ -454,13 +453,33 @@ void ieee80211_tx_status(struct ieee8021
* This is a bit racy but we can avoid a lot of work
* with this test...
*/
- if (!local->monitors && (!send_to_cooked || !local->cooked_mntrs)) {
- dev_kfree_skb(skb);
- return;
- }
+ need_for_monitors = local->monitors ||
+ (send_to_cooked && local->cooked_mntrs);
/* send frame to monitor interfaces now */
+ if (!multicast && skb->sk &&
+ skb_shinfo(skb)->tx_flags & SKBTX_WIFI_STATUS) {
+ struct sk_buff *mon_skb = NULL;
+
+ if (need_for_monitors)
+ mon_skb = skb_clone(skb, GFP_ATOMIC);
+
+ /* consumes skb */
+ skb_complete_wifi_ack(skb, info->flags & IEEE80211_TX_STAT_ACK);
+
+ if (!mon_skb)
+ return;
+
+ skb = mon_skb;
+ } else if (!need_for_monitors) {
+ dev_kfree_skb(skb);
+ return;
+ } else {
+ /* this was a transmitted frame, but now we want to reuse it */
+ skb_orphan(skb);
+ }
+
if (skb_headroom(skb) < sizeof(*rthdr)) {
printk(KERN_ERR "ieee80211_tx_status: headroom too small\n");
dev_kfree_skb(skb);
--- a/net/mac80211/tx.c 2011-10-07 18:59:12.000000000 +0200
+++ b/net/mac80211/tx.c 2011-10-07 18:59:12.000000000 +0200
@@ -1686,6 +1686,7 @@ netdev_tx_t ieee80211_subif_start_xmit(s
bool wme_sta = false, authorized = false, tdls_auth = false;
struct sk_buff *tmp_skb;
bool tdls_direct = false;
+ bool multicast;
if (unlikely(skb->len < ETH_HLEN)) {
ret = NETDEV_TX_OK;
@@ -1872,7 +1873,8 @@ netdev_tx_t ieee80211_subif_start_xmit(s
* if it is a multicast address (which can only happen
* in AP mode)
*/
- if (!is_multicast_ether_addr(hdr.addr1)) {
+ multicast = is_multicast_ether_addr(hdr.addr1);
+ if (!multicast) {
rcu_read_lock();
sta = sta_info_get(sdata, hdr.addr1);
if (sta) {
@@ -2019,6 +2021,10 @@ netdev_tx_t ieee80211_subif_start_xmit(s
memset(info, 0, sizeof(*info));
dev->trans_start = jiffies;
+
+ if (!multicast && skb_shinfo(skb)->tx_flags & SKBTX_WIFI_STATUS)
+ info->flags = IEEE80211_TX_CTL_REQ_TX_STATUS;
+
ieee80211_xmit(sdata, skb);
return NETDEV_TX_OK;
^ permalink raw reply
* [PATCH v2 09/14] ath9k_hw: Fix ASPM L1 issue for AR9480
From: Rajkumar Manoharan @ 2011-10-07 17:04 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, Rajkumar Manoharan, stable
Because of not clearing Bit 14 of AR_WA, the ASPM L1 is not
enabled when entering into sleep mode. AR9480 does not need
bit 14 to be set.
Cc: stable@kernel.org
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
---
v2: Cc'd stable
drivers/net/wireless/ath/ath9k/hw.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 9c60132..1da6c9d 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -542,6 +542,9 @@ static int __ath9k_hw_init(struct ath_hw *ah)
return -EIO;
}
+ if (AR_SREV_9480(ah))
+ ah->WARegVal &= ~AR_WA_D3_L1_DISABLE;
+
ath9k_hw_init_defaults(ah);
ath9k_hw_init_config(ah);
@@ -1819,8 +1822,7 @@ static void ath9k_set_power_sleep(struct ath_hw *ah, int setChip)
}
/* Clear Bit 14 of AR_WA after putting chip into Full Sleep mode. */
- if (!AR_SREV_9480(ah))
- REG_WRITE(ah, AR_WA, ah->WARegVal & ~AR_WA_D3_L1_DISABLE);
+ REG_WRITE(ah, AR_WA, ah->WARegVal & ~AR_WA_D3_L1_DISABLE);
}
/*
--
1.7.7
^ permalink raw reply related
* [PATCH 5/5] rtlwifi: rtl8192de: Updates from latest Reaktek driver - Part III
From: Larry Finger @ 2011-10-07 16:43 UTC (permalink / raw)
To: linville; +Cc: Larry Finger, linux-wireless, Chaoming Li
In-Reply-To: <1318005802-29057-1-git-send-email-Larry.Finger@lwfinger.net>
From: Chaoming Li <chaoming_li@realsil.com.cn>
This patch incorporate the differences between the 06/20/2011 and
08/16/2011 Realtek releases of the rtl8192de driver.
The changes include:
1. Update for new chip versions
Signed-off-by: Chaoming Li <chaoming_li@realsil.com.cn>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
drivers/net/wireless/rtlwifi/rtl8192de/def.h | 124 ++++++++++++++++----------
drivers/net/wireless/rtlwifi/rtl8192de/hw.c | 19 ++---
2 files changed, 84 insertions(+), 59 deletions(-)
Index: wireless-testing-new/drivers/net/wireless/rtlwifi/rtl8192de/def.h
===================================================================
--- wireless-testing-new.orig/drivers/net/wireless/rtlwifi/rtl8192de/def.h
+++ wireless-testing-new/drivers/net/wireless/rtlwifi/rtl8192de/def.h
@@ -122,60 +122,99 @@
#define GET_C2H_CMD_FEEDBACK_CCX_SEQ(__pcmdfbhdr) \
LE_BITS_TO_4BYTE(((__pcmdfbhdr) + 4), 20, 12)
-/*
- * 92D chip ver:
- * BIT8: IS 92D
- * BIT9: single phy
- * BIT10: C-cut
- * BIT11: D-cut
- */
-
-/* Chip specific */
-#define CHIP_92C BIT(0)
-#define CHIP_92C_1T2R BIT(1)
-#define CHIP_8723 BIT(2) /* RTL8723 With BT feature */
-#define CHIP_8723_DRV_REV BIT(3) /* RTL8723 Driver Revised */
-#define NORMAL_CHIP BIT(4)
-#define CHIP_VENDOR_UMC BIT(5)
-#define CHIP_VENDOR_UMC_B_CUT BIT(6) /* Chip version for ECO */
+enum version_8192d {
+ VERSION_TEST_CHIP_88C = 0x0000,
+ VERSION_TEST_CHIP_92C = 0x0020,
+ VERSION_TEST_UMC_CHIP_8723 = 0x0081,
+ VERSION_NORMAL_TSMC_CHIP_88C = 0x0008,
+ VERSION_NORMAL_TSMC_CHIP_92C = 0x0028,
+ VERSION_NORMAL_TSMC_CHIP_92C_1T2R = 0x0018,
+ VERSION_NORMAL_UMC_CHIP_88C_A_CUT = 0x0088,
+ VERSION_NORMAL_UMC_CHIP_92C_A_CUT = 0x00a8,
+ VERSION_NORMAL_UMC_CHIP_92C_1T2R_A_CUT = 0x0098,
+ VERSION_NORMAL_UMC_CHIP_8723_1T1R_A_CUT = 0x0089,
+ VERSION_NORMAL_UMC_CHIP_8723_1T1R_B_CUT = 0x1089,
+ VERSION_NORMAL_UMC_CHIP_88C_B_CUT = 0x1088,
+ VERSION_NORMAL_UMC_CHIP_92C_B_CUT = 0x10a8,
+ VERSION_NORMAL_UMC_CHIP_92C_1T2R_B_CUT = 0x1090,
+ VERSION_TEST_CHIP_92D_SINGLEPHY = 0x0022,
+ VERSION_TEST_CHIP_92D_DUALPHY = 0x0002,
+ VERSION_NORMAL_CHIP_92D_SINGLEPHY = 0x002a,
+ VERSION_NORMAL_CHIP_92D_DUALPHY = 0x000a,
+ VERSION_NORMAL_CHIP_92D_C_CUT_SINGLEPHY = 0x202a,
+ VERSION_NORMAL_CHIP_92D_C_CUT_DUALPHY = 0x200a,
+ VERSION_NORMAL_CHIP_92D_D_CUT_SINGLEPHY = 0x302a,
+ VERSION_NORMAL_CHIP_92D_D_CUT_DUALPHY = 0x300a,
+ VERSION_NORMAL_CHIP_92D_E_CUT_SINGLEPHY = 0x402a,
+ VERSION_NORMAL_CHIP_92D_E_CUT_DUALPHY = 0x400a,
+};
/* for 92D */
-#define CHIP_92D BIT(8)
#define CHIP_92D_SINGLEPHY BIT(9)
+#define C_CUT_VERSION BIT(13)
+#define D_CUT_VERSION ((BIT(12)|BIT(13)))
+#define E_CUT_VERSION BIT(14)
+
+/* Chip specific */
+#define CHIP_BONDING_IDENTIFIER(_value) (((_value)>>22)&0x3)
+#define CHIP_BONDING_92C_1T2R 0x1
+#define CHIP_BONDING_88C_USB_MCARD 0x2
+#define CHIP_BONDING_88C_USB_HP 0x1
+
+/* [15:12] IC version(CUT): A-cut=0, B-cut=1, C-cut=2, D-cut=3 */
+/* [7] Manufacturer: TSMC=0, UMC=1 */
+/* [6:4] RF type: 1T1R=0, 1T2R=1, 2T2R=2 */
+/* [3] Chip type: TEST=0, NORMAL=1 */
+/* [2:0] IC type: 81xxC=0, 8723=1, 92D=2 */
+#define CHIP_8723 BIT(0)
+#define CHIP_92D BIT(1)
+#define NORMAL_CHIP BIT(3)
+#define RF_TYPE_1T1R (~(BIT(4)|BIT(5)|BIT(6)))
+#define RF_TYPE_1T2R BIT(4)
+#define RF_TYPE_2T2R BIT(5)
+#define CHIP_VENDOR_UMC BIT(7)
+#define B_CUT_VERSION BIT(12)
+
+/* MASK */
+#define IC_TYPE_MASK (BIT(0)|BIT(1)|BIT(2))
+#define CHIP_TYPE_MASK BIT(3)
+#define RF_TYPE_MASK (BIT(4)|BIT(5)|BIT(6))
+#define MANUFACTUER_MASK BIT(7)
+#define ROM_VERSION_MASK (BIT(11)|BIT(10)|BIT(9)|BIT(8))
+#define CUT_VERSION_MASK (BIT(15)|BIT(14)|BIT(13)|BIT(12))
+
+
+/* Get element */
+#define GET_CVID_IC_TYPE(version) ((version) & IC_TYPE_MASK)
+#define GET_CVID_CHIP_TYPE(version) ((version) & CHIP_TYPE_MASK)
+#define GET_CVID_RF_TYPE(version) ((version) & RF_TYPE_MASK)
+#define GET_CVID_MANUFACTUER(version) ((version) & MANUFACTUER_MASK)
+#define GET_CVID_ROM_VERSION(version) ((version) & ROM_VERSION_MASK)
+#define GET_CVID_CUT_VERSION(version) ((version) & CUT_VERSION_MASK)
+
+#define IS_1T1R(version) ((GET_CVID_RF_TYPE(version)) ? \
+ false : true)
+#define IS_1T2R(version) ((GET_CVID_RF_TYPE(version) == \
+ RF_TYPE_1T2R) ? true : false)
+#define IS_2T2R(version) ((GET_CVID_RF_TYPE(version) == \
+ RF_TYPE_2T2R) ? true : false)
+
+#define IS_92D_SINGLEPHY(version) ((IS_92D(version)) ? \
+ (IS_2T2R(version) ? true : false) : false)
+#define IS_92D(version) ((GET_CVID_IC_TYPE(version) == \
+ CHIP_92D) ? true : false)
+#define IS_92D_C_CUT(version) ((IS_92D(version)) ? \
+ ((GET_CVID_CUT_VERSION(version) == \
+ 0x2000) ? true : false) : false)
+#define IS_92D_D_CUT(version) ((IS_92D(version)) ? \
+ ((GET_CVID_CUT_VERSION(version) == \
+ 0x3000) ? true : false) : false)
+#define IS_92D_E_CUT(version) ((IS_92D(version)) ? \
+ ((GET_CVID_CUT_VERSION(version) == \
+ 0x4000) ? true : false) : false)
#define CHIP_92D_C_CUT BIT(10)
#define CHIP_92D_D_CUT BIT(11)
-enum version_8192d {
- VERSION_TEST_CHIP_88C = 0x00,
- VERSION_TEST_CHIP_92C = 0x01,
- VERSION_NORMAL_TSMC_CHIP_88C = 0x10,
- VERSION_NORMAL_TSMC_CHIP_92C = 0x11,
- VERSION_NORMAL_TSMC_CHIP_92C_1T2R = 0x13,
- VERSION_NORMAL_UMC_CHIP_88C_A_CUT = 0x30,
- VERSION_NORMAL_UMC_CHIP_92C_A_CUT = 0x31,
- VERSION_NORMAL_UMC_CHIP_92C_1T2R_A_CUT = 0x33,
- VERSION_NORMA_UMC_CHIP_8723_1T1R_A_CUT = 0x34,
- VERSION_NORMA_UMC_CHIP_8723_1T1R_B_CUT = 0x3c,
- VERSION_NORMAL_UMC_CHIP_88C_B_CUT = 0x70,
- VERSION_NORMAL_UMC_CHIP_92C_B_CUT = 0x71,
- VERSION_NORMAL_UMC_CHIP_92C_1T2R_B_CUT = 0x73,
- VERSION_TEST_CHIP_92D_SINGLEPHY = 0x300,
- VERSION_TEST_CHIP_92D_DUALPHY = 0x100,
- VERSION_NORMAL_CHIP_92D_SINGLEPHY = 0x310,
- VERSION_NORMAL_CHIP_92D_DUALPHY = 0x110,
- VERSION_NORMAL_CHIP_92D_C_CUT_SINGLEPHY = 0x710,
- VERSION_NORMAL_CHIP_92D_C_CUT_DUALPHY = 0x510,
- VERSION_NORMAL_CHIP_92D_D_CUT_SINGLEPHY = 0xB10,
- VERSION_NORMAL_CHIP_92D_D_CUT_DUALPHY = 0x910,
-};
-
-#define IS_92D_SINGLEPHY(version) \
- ((version & CHIP_92D_SINGLEPHY) ? true : false)
-#define IS_92D_C_CUT(version) \
- ((version & CHIP_92D_C_CUT) ? true : false)
-#define IS_92D_D_CUT(version) \
- ((version & CHIP_92D_D_CUT) ? true : false)
-
enum rf_optype {
RF_OP_BY_SW_3WIRE = 0,
RF_OP_BY_FW,
Index: wireless-testing-new/drivers/net/wireless/rtlwifi/rtl8192de/hw.c
===================================================================
--- wireless-testing-new.orig/drivers/net/wireless/rtlwifi/rtl8192de/hw.c
+++ wireless-testing-new/drivers/net/wireless/rtlwifi/rtl8192de/hw.c
@@ -1608,17 +1608,16 @@ static void _rtl92de_read_txpower_info(s
tempval[0] = hwinfo[EEPROM_IQK_DELTA] & 0x03;
tempval[1] = (hwinfo[EEPROM_LCK_DELTA] & 0x0C) >> 2;
rtlefuse->txpwr_fromeprom = true;
- if (IS_92D_D_CUT(rtlpriv->rtlhal.version)) {
+ if (IS_92D_D_CUT(rtlpriv->rtlhal.version) ||
+ IS_92D_E_CUT(rtlpriv->rtlhal.version)) {
rtlefuse->internal_pa_5g[0] =
- !((hwinfo[EEPROM_TSSI_A_5G] &
- BIT(6)) >> 6);
+ !((hwinfo[EEPROM_TSSI_A_5G] & BIT(6)) >> 6);
rtlefuse->internal_pa_5g[1] =
- !((hwinfo[EEPROM_TSSI_B_5G] &
- BIT(6)) >> 6);
- RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD,
+ !((hwinfo[EEPROM_TSSI_B_5G] & BIT(6)) >> 6);
+ RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG,
("Is D cut,Internal PA0 %d Internal PA1 %d\n",
- rtlefuse->internal_pa_5g[0],
- rtlefuse->internal_pa_5g[1]))
+ rtlefuse->internal_pa_5g[0],
+ rtlefuse->internal_pa_5g[1]))
}
rtlefuse->eeprom_c9 = hwinfo[EEPROM_RF_OPT6];
rtlefuse->eeprom_cc = hwinfo[EEPROM_RF_OPT7];
^ permalink raw reply
* [PATCH 4/5] rtlwifi: rtl8192se: Updates from latest Realtek driver version - Part II
From: Larry Finger @ 2011-10-07 16:43 UTC (permalink / raw)
To: linville; +Cc: Larry Finger, linux-wireless, Chaoming Li
In-Reply-To: <1318005802-29057-1-git-send-email-Larry.Finger@lwfinger.net>
From: Chaoming Li <chaoming_li@realsil.com.cn>
This patch incorporate the differences between the 06/20/2011 and
08/16/2011 Realtek releases of the rtl8192se driver.
The changes include:
1. Fixing some typos in register usage.
2. A change in the handling of decryption status for 802.11w packets.
Signed-off-by: Chaoming Li <chaoming_li@realsil.com.cn>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
drivers/net/wireless/rtlwifi/rtl8192se/hw.c | 22 +++++-----
drivers/net/wireless/rtlwifi/rtl8192se/reg.h | 1 +
drivers/net/wireless/rtlwifi/rtl8192se/sw.c | 1 +
drivers/net/wireless/rtlwifi/rtl8192se/trx.c | 53 +++++++++++++++----------
drivers/net/wireless/rtlwifi/wifi.h | 1 +
5 files changed, 46 insertions(+), 32 deletions(-)
Index: wireless-testing-new/drivers/net/wireless/rtlwifi/rtl8192se/hw.c
===================================================================
--- wireless-testing-new.orig/drivers/net/wireless/rtlwifi/rtl8192se/hw.c
+++ wireless-testing-new/drivers/net/wireless/rtlwifi/rtl8192se/hw.c
@@ -1382,7 +1382,7 @@ static void _rtl92se_power_domain_init(s
rtl_write_byte(rtlpriv, LDOA15_CTRL, 0x34);
/* Reset MAC-IO and CPU and Core Digital BIT10/11/15 */
- tmpu1b = rtl_read_byte(rtlpriv, SYS_FUNC_EN + 1);
+ tmpu1b = rtl_read_byte(rtlpriv, REG_SYS_FUNC_EN + 1);
/* If IPS we need to turn LED on. So we not
* not disable BIT 3/7 of reg3. */
@@ -1391,7 +1391,7 @@ static void _rtl92se_power_domain_init(s
else
tmpu1b &= 0x73;
- rtl_write_byte(rtlpriv, SYS_FUNC_EN + 1, tmpu1b);
+ rtl_write_byte(rtlpriv, REG_SYS_FUNC_EN + 1, tmpu1b);
/* wait for BIT 10/11/15 to pull high automatically!! */
mdelay(1);
@@ -1428,15 +1428,15 @@ static void _rtl92se_power_domain_init(s
rtl_write_byte(rtlpriv, LDOA15_CTRL, (tmpu1b | BIT(0)));
/* Set Digital Vdd to Retention isolation Path. */
- tmpu2b = rtl_read_word(rtlpriv, SYS_ISO_CTRL);
- rtl_write_word(rtlpriv, SYS_ISO_CTRL, (tmpu2b | BIT(11)));
+ tmpu2b = rtl_read_word(rtlpriv, REG_SYS_ISO_CTRL);
+ rtl_write_word(rtlpriv, REG_SYS_ISO_CTRL, (tmpu2b | BIT(11)));
/* For warm reboot NIC disappera bug. */
- tmpu2b = rtl_read_word(rtlpriv, SYS_FUNC_EN);
- rtl_write_word(rtlpriv, SYS_FUNC_EN, (tmpu2b | BIT(13)));
+ tmpu2b = rtl_read_word(rtlpriv, REG_SYS_FUNC_EN);
+ rtl_write_word(rtlpriv, REG_SYS_FUNC_EN, (tmpu2b | BIT(13)));
- rtl_write_byte(rtlpriv, SYS_ISO_CTRL + 1, 0x68);
+ rtl_write_byte(rtlpriv, REG_SYS_ISO_CTRL + 1, 0x68);
/* Enable AFE PLL Macro Block */
tmpu1b = rtl_read_byte(rtlpriv, AFE_PLL_CTRL);
@@ -1447,17 +1447,17 @@ static void _rtl92se_power_domain_init(s
mdelay(1);
/* Release isolation AFE PLL & MD */
- rtl_write_byte(rtlpriv, SYS_ISO_CTRL, 0xA6);
+ rtl_write_byte(rtlpriv, REG_SYS_ISO_CTRL, 0xA6);
/* Enable MAC clock */
tmpu2b = rtl_read_word(rtlpriv, SYS_CLKR);
rtl_write_word(rtlpriv, SYS_CLKR, (tmpu2b | BIT(12) | BIT(11)));
/* Enable Core digital and enable IOREG R/W */
- tmpu2b = rtl_read_word(rtlpriv, SYS_FUNC_EN);
- rtl_write_word(rtlpriv, SYS_FUNC_EN, (tmpu2b | BIT(11)));
+ tmpu2b = rtl_read_word(rtlpriv, REG_SYS_FUNC_EN);
+ rtl_write_word(rtlpriv, REG_SYS_FUNC_EN, (tmpu2b | BIT(11)));
/* enable REG_EN */
- rtl_write_word(rtlpriv, SYS_FUNC_EN, (tmpu2b | BIT(11) | BIT(15)));
+ rtl_write_word(rtlpriv, REG_SYS_FUNC_EN, (tmpu2b | BIT(11) | BIT(15)));
/* Switch the control path. */
tmpu2b = rtl_read_word(rtlpriv, SYS_CLKR);
Index: wireless-testing-new/drivers/net/wireless/rtlwifi/rtl8192se/reg.h
===================================================================
--- wireless-testing-new.orig/drivers/net/wireless/rtlwifi/rtl8192se/reg.h
+++ wireless-testing-new/drivers/net/wireless/rtlwifi/rtl8192se/reg.h
@@ -735,6 +735,7 @@
#define HWSET_MAX_SIZE_92S 128
#define EFUSE_MAX_SECTION 16
#define EFUSE_REAL_CONTENT_LEN 512
+#define EFUSE_OOB_PROTECT_BYTES 15
#define RTL8190_EEPROM_ID 0x8129
#define EEPROM_HPON 0x02
Index: wireless-testing-new/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
===================================================================
--- wireless-testing-new.orig/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
+++ wireless-testing-new/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
@@ -304,6 +304,7 @@ static struct rtl_hal_cfg rtl92se_hal_cf
.maps[EFUSE_HWSET_MAX_SIZE] = HWSET_MAX_SIZE_92S,
.maps[EFUSE_MAX_SECTION_MAP] = EFUSE_MAX_SECTION,
.maps[EFUSE_REAL_CONTENT_SIZE] = EFUSE_REAL_CONTENT_LEN,
+ .maps[EFUSE_OOB_PROTECT_BYTES_LEN] = EFUSE_OOB_PROTECT_BYTES,
.maps[RWCAM] = REG_RWCAM,
.maps[WCAMI] = REG_WCAMI,
Index: wireless-testing-new/drivers/net/wireless/rtlwifi/rtl8192se/trx.c
===================================================================
--- wireless-testing-new.orig/drivers/net/wireless/rtlwifi/rtl8192se/trx.c
+++ wireless-testing-new/drivers/net/wireless/rtlwifi/rtl8192se/trx.c
@@ -124,18 +124,15 @@ static void _rtl92se_query_rxphystatus(s
u8 i, max_spatial_stream;
u32 rssi, total_rssi = 0;
bool in_powersavemode = false;
- bool is_cck_rate;
+ bool is_cck = pstats->is_cck;
- is_cck_rate = SE_RX_HAL_IS_CCK_RATE(pdesc);
pstats->packet_matchbssid = packet_match_bssid;
pstats->packet_toself = packet_toself;
- pstats->is_cck = is_cck_rate;
pstats->packet_beacon = packet_beacon;
- pstats->is_cck = is_cck_rate;
pstats->rx_mimo_signalquality[0] = -1;
pstats->rx_mimo_signalquality[1] = -1;
- if (is_cck_rate) {
+ if (is_cck) {
u8 report, cck_highpwr;
cck_buf = (struct phy_sts_cck_8192s_t *)p_drvinfo;
@@ -246,9 +243,8 @@ static void _rtl92se_query_rxphystatus(s
pstats->rxpower = rx_pwr_all;
pstats->recvsignalpower = rx_pwr_all;
- if (GET_RX_STATUS_DESC_RX_HT(pdesc) &&
- GET_RX_STATUS_DESC_RX_MCS(pdesc) >= DESC92_RATEMCS8 &&
- GET_RX_STATUS_DESC_RX_MCS(pdesc) <= DESC92_RATEMCS15)
+ if (pstats->is_ht && pstats->rate >= DESC92_RATEMCS8 &&
+ pstats->rate <= DESC92_RATEMCS15)
max_spatial_stream = 2;
else
max_spatial_stream = 1;
@@ -266,7 +262,7 @@ static void _rtl92se_query_rxphystatus(s
}
}
- if (is_cck_rate)
+ if (is_cck)
pstats->signalstrength = (u8)(_rtl92se_signal_scale_mapping(hw,
pwdb_all));
else if (rf_rx_num != 0)
@@ -518,6 +514,7 @@ bool rtl92se_rx_query_desc(struct ieee80
{
struct rx_fwinfo *p_drvinfo;
u32 phystatus = (u32)GET_RX_STATUS_DESC_PHY_STATUS(pdesc);
+ struct ieee80211_hdr *hdr;
stats->length = (u16)GET_RX_STATUS_DESC_PKT_LEN(pdesc);
stats->rx_drvinfo_size = (u8)GET_RX_STATUS_DESC_DRVINFO_SIZE(pdesc) * 8;
@@ -530,8 +527,12 @@ bool rtl92se_rx_query_desc(struct ieee80
stats->rate = (u8)GET_RX_STATUS_DESC_RX_MCS(pdesc);
stats->shortpreamble = (u16)GET_RX_STATUS_DESC_SPLCP(pdesc);
stats->isampdu = (bool)(GET_RX_STATUS_DESC_PAGGR(pdesc) == 1);
+ stats->isfirst_ampdu = (bool) ((GET_RX_STATUS_DESC_PAGGR(pdesc) == 1)
+ && (GET_RX_STATUS_DESC_FAGGR(pdesc) == 1));
stats->timestamp_low = GET_RX_STATUS_DESC_TSFL(pdesc);
stats->rx_is40Mhzpacket = (bool)GET_RX_STATUS_DESC_BW(pdesc);
+ stats->is_ht = (bool)GET_RX_STATUS_DESC_RX_HT(pdesc);
+ stats->is_cck = SE_RX_HAL_IS_CCK_RATE(pdesc);
if (stats->hwerror)
return false;
@@ -539,29 +540,39 @@ bool rtl92se_rx_query_desc(struct ieee80
rx_status->freq = hw->conf.channel->center_freq;
rx_status->band = hw->conf.channel->band;
- if (GET_RX_STATUS_DESC_CRC32(pdesc))
- rx_status->flag |= RX_FLAG_FAILED_FCS_CRC;
+ hdr = (struct ieee80211_hdr *)(skb->data + stats->rx_drvinfo_size
+ + stats->rx_bufshift);
- if (!GET_RX_STATUS_DESC_SWDEC(pdesc))
- rx_status->flag |= RX_FLAG_DECRYPTED;
+ if (stats->crc)
+ rx_status->flag |= RX_FLAG_FAILED_FCS_CRC;
- if (GET_RX_STATUS_DESC_BW(pdesc))
+ if (stats->rx_is40Mhzpacket)
rx_status->flag |= RX_FLAG_40MHZ;
- if (GET_RX_STATUS_DESC_RX_HT(pdesc))
+ if (stats->is_ht)
rx_status->flag |= RX_FLAG_HT;
rx_status->flag |= RX_FLAG_MACTIME_MPDU;
- if (stats->decrypted)
- rx_status->flag |= RX_FLAG_DECRYPTED;
+ /* hw will set stats->decrypted true, if it finds the
+ * frame is open data frame or mgmt frame,
+ * hw will not decrypt robust managment frame
+ * for IEEE80211w but still set stats->decrypted
+ * true, so here we should set it back to undecrypted
+ * for IEEE80211w frame, and mac80211 sw will help
+ * to decrypt it */
+ if (stats->decrypted) {
+ if ((ieee80211_is_robust_mgmt_frame(hdr)) &&
+ (ieee80211_has_protected(hdr->frame_control)))
+ rx_status->flag &= ~RX_FLAG_DECRYPTED;
+ else
+ rx_status->flag |= RX_FLAG_DECRYPTED;
+ }
rx_status->rate_idx = rtlwifi_rate_mapping(hw,
- (bool)GET_RX_STATUS_DESC_RX_HT(pdesc),
- (u8)GET_RX_STATUS_DESC_RX_MCS(pdesc));
-
+ stats->is_ht, stats->rate);
- rx_status->mactime = GET_RX_STATUS_DESC_TSFL(pdesc);
+ rx_status->mactime = stats->timestamp_low;
if (phystatus) {
p_drvinfo = (struct rx_fwinfo *)(skb->data +
stats->rx_bufshift);
Index: wireless-testing-new/drivers/net/wireless/rtlwifi/wifi.h
===================================================================
--- wireless-testing-new.orig/drivers/net/wireless/rtlwifi/wifi.h
+++ wireless-testing-new/drivers/net/wireless/rtlwifi/wifi.h
@@ -450,6 +450,7 @@ enum rtl_var_map {
EFUSE_HWSET_MAX_SIZE,
EFUSE_MAX_SECTION_MAP,
EFUSE_REAL_CONTENT_SIZE,
+ EFUSE_OOB_PROTECT_BYTES_LEN,
/*CAM map */
RWCAM,
@@ -1324,6 +1325,7 @@ struct rtl_stats {
s8 rx_mimo_signalquality[2];
bool packet_matchbssid;
bool is_cck;
+ bool is_ht;
bool packet_toself;
bool packet_beacon; /*for rssi */
char cck_adc_pwdb[4]; /*for rx path selection */
^ permalink raw reply
* [PATCH 3/5] rtlwifi: rtl8192ce: Add new chip revisions
From: Larry Finger @ 2011-10-07 16:43 UTC (permalink / raw)
To: linville; +Cc: Larry Finger, linux-wireless, Chaoming Li
In-Reply-To: <1318005802-29057-1-git-send-email-Larry.Finger@lwfinger.net>
From: Chaoming Li <chaoming_li@realsil.com.cn>
This patch incorporate the differences between the 06/20/2011 and
08/16/2011 Realtek releases of the rtlwifi driver.
The changes include:
1. Adding new chip revisions including new firmware.
Signed-off-by: Chaoming Li <chaoming_li@realsil.com.cn>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
drivers/net/wireless/rtlwifi/rtl8192ce/def.h | 14 ++++++++++++++
drivers/net/wireless/rtlwifi/rtl8192ce/sw.c | 14 ++++++++++++--
drivers/net/wireless/rtlwifi/rtl8192cu/def.h | 4 ----
3 files changed, 26 insertions(+), 6 deletions(-)
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/def.h b/drivers/net/wireless/rtlwifi/rtl8192ce/def.h
index 11f4319..a816459 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/def.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/def.h
@@ -142,8 +142,22 @@ enum version_8192c {
VERSION_UNKNOWN = 0x88,
};
+#define CUT_VERSION_MASK (BIT(6)|BIT(7))
+#define CHIP_VENDOR_UMC BIT(5)
+#define CHIP_VENDOR_UMC_B_CUT BIT(6) /* Chip version for ECO */
+#define IS_VENDOR_UMC_A_CUT(version) ((IS_CHIP_VENDOR_UMC(version)) ? \
+ ((GET_CVID_CUT_VERSION(version)) ? false : true) : false)
#define IS_CHIP_VER_B(version) ((version & CHIP_VER_B) ? true : false)
+#define IS_VENDOR_UMC_A_CUT(version) ((IS_CHIP_VENDOR_UMC(version)) ? \
+ ((GET_CVID_CUT_VERSION(version)) ? false : true) : false)
#define IS_92C_SERIAL(version) ((version & CHIP_92C_BITMASK) ? true : false)
+#define IS_CHIP_VENDOR_UMC(version) \
+ ((version & CHIP_VENDOR_UMC) ? true : false)
+#define GET_CVID_CUT_VERSION(version) ((version) & CUT_VERSION_MASK)
+#define IS_81xxC_VENDOR_UMC_B_CUT(version) \
+ ((IS_CHIP_VENDOR_UMC(version)) ? \
+ ((GET_CVID_CUT_VERSION(version) == CHIP_VENDOR_UMC_B_CUT) ? \
+ true : false) : false)
enum rtl819x_loopback_e {
RTL819X_NO_LOOPBACK = 0,
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
index 07a75d3..f515bf7 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
@@ -92,6 +92,8 @@ int rtl92c_init_sw_vars(struct ieee80211_hw *hw)
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
const struct firmware *firmware;
+ struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
+ char *fw_name = NULL;
rtl8192ce_bt_reg_init(hw);
@@ -159,8 +161,14 @@ int rtl92c_init_sw_vars(struct ieee80211_hw *hw)
}
/* request fw */
- err = request_firmware(&firmware, rtlpriv->cfg->fw_name,
- rtlpriv->io.dev);
+ if (IS_VENDOR_UMC_A_CUT(rtlhal->version) &&
+ !IS_92C_SERIAL(rtlhal->version))
+ fw_name = "rtlwifi/rtl8192cfwU.bin";
+ else if (IS_81xxC_VENDOR_UMC_B_CUT(rtlhal->version))
+ fw_name = "rtlwifi/rtl8192cfwU_B.bin";
+ else
+ fw_name = rtlpriv->cfg->fw_name;
+ err = request_firmware(&firmware, fw_name, rtlpriv->io.dev);
if (err) {
RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
("Failed to request firmware!\n"));
@@ -355,6 +363,8 @@ MODULE_AUTHOR("Larry Finger <Larry.Finger@lwfinger.net>");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Realtek 8192C/8188C 802.11n PCI wireless");
MODULE_FIRMWARE("rtlwifi/rtl8192cfw.bin");
+MODULE_FIRMWARE("rtlwifi/rtl8192cfwU.bin");
+MODULE_FIRMWARE("rtlwifi/rtl8192cfwU_B.bin");
module_param_named(swenc, rtl92ce_mod_params.sw_crypto, bool, 0444);
module_param_named(ips, rtl92ce_mod_params.inactiveps, bool, 0444);
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/def.h b/drivers/net/wireless/rtlwifi/rtl8192cu/def.h
index c54940e..d097efb 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/def.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/def.h
@@ -50,10 +50,6 @@
#define IS_VENDOR_UMC(version) \
(((version) & CHIP_VENDOR_UMC) ? true : false)
-#define IS_VENDOR_UMC_A_CUT(version) \
- (((version) & CHIP_VENDOR_UMC) ? (((version) & (BIT(6) | BIT(7))) ? \
- false : true) : false)
-
#define IS_VENDOR_8723_A_CUT(version) \
(((version) & CHIP_VENDOR_UMC) ? (((version) & (BIT(6))) ? \
false : true) : false)
--
1.7.6.4
^ permalink raw reply related
* [PATCH 2/5] rtlwifi: Update to new Realtek version - Part I
From: Larry Finger @ 2011-10-07 16:43 UTC (permalink / raw)
To: linville; +Cc: Chaoming Li, linux-wireless, Larry Finger
In-Reply-To: <1318005802-29057-1-git-send-email-Larry.Finger@lwfinger.net>
From: Chaoming Li <chaoming_li@realsil.com.cn>
This patch incorporate the differences between the 06/20/2011 and
08/16/2011 Realtek releases of the rtlwifi driver.
The changes include:
1. Handling of IEEE80211_HW_CONNECTION_MONITOR.
2. Fix typo to get proper response to nullfunc frames.
Signed-off-by: Chaoming Li <chaoming_li@realsil.com.cn>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
drivers/net/wireless/rtlwifi/base.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/rtlwifi/base.c b/drivers/net/wireless/rtlwifi/base.c
index eafe980..a2704fb 100644
--- a/drivers/net/wireless/rtlwifi/base.c
+++ b/drivers/net/wireless/rtlwifi/base.c
@@ -311,6 +311,8 @@ static void _rtl_init_mac80211(struct ieee80211_hw *hw)
IEEE80211_HW_RX_INCLUDES_FCS |
IEEE80211_HW_BEACON_FILTER |
IEEE80211_HW_AMPDU_AGGREGATION |
+ IEEE80211_HW_CONNECTION_MONITOR |
+ /* IEEE80211_HW_SUPPORTS_CQM_RSSI | */
IEEE80211_HW_REPORTS_TX_ACK_STATUS | 0;
/* swlps or hwlps has been set in diff chip in init_sw_vars */
@@ -850,7 +852,7 @@ void rtl_get_tcb_desc(struct ieee80211_hw *hw,
*So tcb_desc->hw_rate is just used for
*special data and mgt frames
*/
- if (info->control.rates[0].idx == 0 &&
+ if (info->control.rates[0].idx == 0 ||
ieee80211_is_nullfunc(fc)) {
tcb_desc->use_driver_rate = true;
tcb_desc->ratr_index = RATR_INX_WIRELESS_MC;
@@ -1138,7 +1140,7 @@ void rtl_watchdog_wq_callback(void *data)
}
/*
- *<3> to check if traffic busy, if
+ *<2> to check if traffic busy, if
* busytraffic we don't change channel
*/
if (mac->link_state >= MAC80211_LINKED) {
--
1.7.6.4
^ permalink raw reply related
* [PATCH 1/5] rtlwifi: Change PCI drivers to use the new PM framework
From: Larry Finger @ 2011-10-07 16:43 UTC (permalink / raw)
To: linville; +Cc: Larry Finger, linux-wireless
In-Reply-To: <1318005802-29057-1-git-send-email-Larry.Finger@lwfinger.net>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
drivers/net/wireless/rtlwifi/pci.c | 19 ++++---------------
drivers/net/wireless/rtlwifi/pci.h | 4 ++--
drivers/net/wireless/rtlwifi/rtl8192ce/sw.c | 16 ++++++++++------
drivers/net/wireless/rtlwifi/rtl8192de/sw.c | 16 ++++++++++------
drivers/net/wireless/rtlwifi/rtl8192se/sw.c | 16 ++++++++++------
5 files changed, 36 insertions(+), 35 deletions(-)
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c
index 9983fa1..5380f3b 100644
--- a/drivers/net/wireless/rtlwifi/pci.c
+++ b/drivers/net/wireless/rtlwifi/pci.c
@@ -1993,36 +1993,25 @@ call rtl_mac_stop() from the mac80211
suspend function first, So there is
no need to call hw_disable here.
****************************************/
-int rtl_pci_suspend(struct pci_dev *pdev, pm_message_t state)
+int rtl_pci_suspend(struct device *dev)
{
+ struct pci_dev *pdev = to_pci_dev(dev);
struct ieee80211_hw *hw = pci_get_drvdata(pdev);
struct rtl_priv *rtlpriv = rtl_priv(hw);
rtlpriv->cfg->ops->hw_suspend(hw);
rtl_deinit_rfkill(hw);
- pci_save_state(pdev);
- pci_disable_device(pdev);
- pci_set_power_state(pdev, PCI_D3hot);
return 0;
}
EXPORT_SYMBOL(rtl_pci_suspend);
-int rtl_pci_resume(struct pci_dev *pdev)
+int rtl_pci_resume(struct device *dev)
{
- int ret;
+ struct pci_dev *pdev = to_pci_dev(dev);
struct ieee80211_hw *hw = pci_get_drvdata(pdev);
struct rtl_priv *rtlpriv = rtl_priv(hw);
- pci_set_power_state(pdev, PCI_D0);
- ret = pci_enable_device(pdev);
- if (ret) {
- RT_ASSERT(false, ("ERR: <======\n"));
- return ret;
- }
-
- pci_restore_state(pdev);
-
rtlpriv->cfg->ops->hw_resume(hw);
rtl_init_rfkill(hw);
return 0;
diff --git a/drivers/net/wireless/rtlwifi/pci.h b/drivers/net/wireless/rtlwifi/pci.h
index a24e505..ebe0b42 100644
--- a/drivers/net/wireless/rtlwifi/pci.h
+++ b/drivers/net/wireless/rtlwifi/pci.h
@@ -237,8 +237,8 @@ extern struct rtl_intf_ops rtl_pci_ops;
int __devinit rtl_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *id);
void rtl_pci_disconnect(struct pci_dev *pdev);
-int rtl_pci_suspend(struct pci_dev *pdev, pm_message_t state);
-int rtl_pci_resume(struct pci_dev *pdev);
+int rtl_pci_suspend(struct device *dev);
+int rtl_pci_resume(struct device *dev);
static inline u8 pci_read8_sync(struct rtl_priv *rtlpriv, u32 addr)
{
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
index b7ecb9e..07a75d3 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
@@ -365,17 +365,21 @@ MODULE_PARM_DESC(ips, "Set to 0 to not use link power save (default 1)\n");
MODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 0)\n");
MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n");
+static const struct dev_pm_ops rtlwifi_pm_ops = {
+ .suspend = rtl_pci_suspend,
+ .resume = rtl_pci_resume,
+ .freeze = rtl_pci_suspend,
+ .thaw = rtl_pci_resume,
+ .poweroff = rtl_pci_suspend,
+ .restore = rtl_pci_resume,
+};
+
static struct pci_driver rtl92ce_driver = {
.name = KBUILD_MODNAME,
.id_table = rtl92ce_pci_ids,
.probe = rtl_pci_probe,
.remove = rtl_pci_disconnect,
-
-#ifdef CONFIG_PM
- .suspend = rtl_pci_suspend,
- .resume = rtl_pci_resume,
-#endif
-
+ .driver.pm = &rtlwifi_pm_ops,
};
static int __init rtl92ce_module_init(void)
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/sw.c b/drivers/net/wireless/rtlwifi/rtl8192de/sw.c
index c681597..12042d8 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192de/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192de/sw.c
@@ -385,17 +385,21 @@ MODULE_PARM_DESC(ips, "Set to 0 to not use link power save (default 1)\n");
MODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 0)\n");
MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n");
+static const struct dev_pm_ops rtlwifi_pm_ops = {
+ .suspend = rtl_pci_suspend,
+ .resume = rtl_pci_resume,
+ .freeze = rtl_pci_suspend,
+ .thaw = rtl_pci_resume,
+ .poweroff = rtl_pci_suspend,
+ .restore = rtl_pci_resume,
+};
+
static struct pci_driver rtl92de_driver = {
.name = KBUILD_MODNAME,
.id_table = rtl92de_pci_ids,
.probe = rtl_pci_probe,
.remove = rtl_pci_disconnect,
-
-#ifdef CONFIG_PM
- .suspend = rtl_pci_suspend,
- .resume = rtl_pci_resume,
-#endif
-
+ .driver.pm = &rtlwifi_pm_ops,
};
/* add global spin lock to solve the problem that
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/sw.c b/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
index 24bd331..80facb5 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
@@ -396,17 +396,21 @@ MODULE_PARM_DESC(ips, "Set to 0 to not use link power save (default 1)\n");
MODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 0)\n");
MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n");
+static const struct dev_pm_ops rtlwifi_pm_ops = {
+ .suspend = rtl_pci_suspend,
+ .resume = rtl_pci_resume,
+ .freeze = rtl_pci_suspend,
+ .thaw = rtl_pci_resume,
+ .poweroff = rtl_pci_suspend,
+ .restore = rtl_pci_resume,
+};
+
static struct pci_driver rtl92se_driver = {
.name = KBUILD_MODNAME,
.id_table = rtl92se_pci_ids,
.probe = rtl_pci_probe,
.remove = rtl_pci_disconnect,
-
-#ifdef CONFIG_PM
- .suspend = rtl_pci_suspend,
- .resume = rtl_pci_resume,
-#endif
-
+ .driver.pm = &rtlwifi_pm_ops,
};
static int __init rtl92se_module_init(void)
--
1.7.6.4
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox