* [PATCH] ath9k: fix keycache leak in split tkip case
@ 2010-02-06 14:38 tom.leiming
2010-02-08 9:20 ` [ath9k-devel] can ath9k run on linux 2.6.25 Zhang Yanfei-B21500
2010-02-08 21:38 ` [PATCH] ath9k: fix keycache leak in split tkip case Luis R. Rodriguez
0 siblings, 2 replies; 12+ messages in thread
From: tom.leiming @ 2010-02-06 14:38 UTC (permalink / raw)
To: lrodriguez
Cc: linux-wireless, ath9k-devel, linville, johannes, stable, Ming Lei
From: Ming Lei <tom.leiming@gmail.com>
If split tkip key is used, ath_delete_key should delete
rx key and rx mic key. This patch fixes the leak of hw
keycache in the case.
---
The patch is against the latest wireless test tree.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
---
drivers/net/wireless/ath/ath9k/main.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 6796d5c..928402b 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -809,6 +809,7 @@ static void ath_key_delete(struct ath_common *common, struct ieee80211_key_conf
clear_bit(key->hw_key_idx + 64, common->keymap);
if (common->splitmic) {
+ ath9k_hw_keyreset(ah, key->hw_key_idx + 32);
clear_bit(key->hw_key_idx + 32, common->keymap);
clear_bit(key->hw_key_idx + 64 + 32, common->keymap);
}
--
1.6.2.5
^ permalink raw reply related [flat|nested] 12+ messages in thread
* RE: [ath9k-devel] can ath9k run on linux 2.6.25
2010-02-06 14:38 [PATCH] ath9k: fix keycache leak in split tkip case tom.leiming
@ 2010-02-08 9:20 ` Zhang Yanfei-B21500
2010-02-08 18:01 ` Luis R. Rodriguez
2010-02-08 21:38 ` [PATCH] ath9k: fix keycache leak in split tkip case Luis R. Rodriguez
1 sibling, 1 reply; 12+ messages in thread
From: Zhang Yanfei-B21500 @ 2010-02-08 9:20 UTC (permalink / raw)
To: linux-wireless, linville, ath9k-devel, johannes, stable
Hi All
Anyone have porting the ath9k to 2.6.25? Is it can work on
2.6.25?
Regards,
Yanfei Zhang
> -----Original Message-----
> From: ath9k-devel-bounces@venema.h4ckr.net
> [mailto:ath9k-devel-bounces@venema.h4ckr.net] On Behalf Of
> tom.leiming@gmail.com
> Sent: Saturday, February 06, 2010 10:38 PM
> To: lrodriguez@atheros.com
> Cc: linux-wireless@vger.kernel.org; linville@tuxdriver.com;
> ath9k-devel@venema.h4ckr.net; johannes@sipsolutions.net;
> stable@kernel.org
> Subject: [ath9k-devel] [PATCH] ath9k: fix keycache leak in
> split tkip case
>
> From: Ming Lei <tom.leiming@gmail.com>
>
> If split tkip key is used, ath_delete_key should delete rx
> key and rx mic key. This patch fixes the leak of hw keycache
> in the case.
>
> ---
> The patch is against the latest wireless test tree.
>
> Signed-off-by: Ming Lei <tom.leiming@gmail.com>
> ---
> drivers/net/wireless/ath/ath9k/main.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath9k/main.c
> b/drivers/net/wireless/ath/ath9k/main.c
> index 6796d5c..928402b 100644
> --- a/drivers/net/wireless/ath/ath9k/main.c
> +++ b/drivers/net/wireless/ath/ath9k/main.c
> @@ -809,6 +809,7 @@ static void ath_key_delete(struct
> ath_common *common, struct ieee80211_key_conf
>
> clear_bit(key->hw_key_idx + 64, common->keymap);
> if (common->splitmic) {
> + ath9k_hw_keyreset(ah, key->hw_key_idx + 32);
> clear_bit(key->hw_key_idx + 32, common->keymap);
> clear_bit(key->hw_key_idx + 64 + 32, common->keymap);
> }
> --
> 1.6.2.5
>
> _______________________________________________
> ath9k-devel mailing list
> ath9k-devel@lists.ath9k.org
> https://lists.ath9k.org/mailman/listinfo/ath9k-devel
>
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [ath9k-devel] can ath9k run on linux 2.6.25
2010-02-08 9:20 ` [ath9k-devel] can ath9k run on linux 2.6.25 Zhang Yanfei-B21500
@ 2010-02-08 18:01 ` Luis R. Rodriguez
2010-02-09 6:10 ` Jinsung Lee
0 siblings, 1 reply; 12+ messages in thread
From: Luis R. Rodriguez @ 2010-02-08 18:01 UTC (permalink / raw)
To: Zhang Yanfei-B21500; +Cc: linux-wireless, ath9k-devel
On Mon, Feb 8, 2010 at 1:20 AM, Zhang Yanfei-B21500
<B21500@freescale.com> wrote:
> Hi All
> Anyone have porting the ath9k to 2.6.25? Is it can work on
> 2.6.25?
>
This tarball has 2.6.25 enabled:
http://www.orbit-lab.org/kernel/compat-wireless-2.6-stable/v2.6.32/compat-wireless-2.6.32.3.tar.bz2
Newer stable kernels after this required multiqueue backported which I
gave a try but haven't gotten reports from users on:
http://bombadil.infradead.org/~mcgrof/tmp/compat-wireless-2.6.32.5-rc3.tar.bz2
After untarring you will have to select to compile only ath9k:
./scripts/driver-select ath9k
Luis
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] ath9k: fix keycache leak in split tkip case
2010-02-06 14:38 [PATCH] ath9k: fix keycache leak in split tkip case tom.leiming
2010-02-08 9:20 ` [ath9k-devel] can ath9k run on linux 2.6.25 Zhang Yanfei-B21500
@ 2010-02-08 21:38 ` Luis R. Rodriguez
2010-02-09 1:36 ` Ming Lei
1 sibling, 1 reply; 12+ messages in thread
From: Luis R. Rodriguez @ 2010-02-08 21:38 UTC (permalink / raw)
To: tom.leiming; +Cc: linux-wireless, ath9k-devel, linville, johannes, stable
On Sat, Feb 6, 2010 at 6:38 AM, <tom.leiming@gmail.com> wrote:
> From: Ming Lei <tom.leiming@gmail.com>
>
> If split tkip key is used, ath_delete_key should delete
> rx key and rx mic key. This patch fixes the leak of hw
> keycache in the case.
Can you please resend with Cc: stable@kernel.org on the commit log entry?
> ---
> The patch is against the latest wireless test tree.
>
> Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Luis
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] ath9k: fix keycache leak in split tkip case
2010-02-08 21:38 ` [PATCH] ath9k: fix keycache leak in split tkip case Luis R. Rodriguez
@ 2010-02-09 1:36 ` Ming Lei
2010-02-09 7:51 ` Johannes Berg
0 siblings, 1 reply; 12+ messages in thread
From: Ming Lei @ 2010-02-09 1:36 UTC (permalink / raw)
To: Luis R. Rodriguez; +Cc: linux-wireless, ath9k-devel, linville, johannes, stable
>From 67b0faf7e7a57c3e6a971ff43d1f03f8e939429b Mon Sep 17 00:00:00 2001
From: Ming Lei <tom.leiming@gmail.com>
Date: Sat, 6 Feb 2010 22:30:53 +0800
Subject: [PATCH] ath9k: fix keycache leak in split tkip case
If split tkip key is used, ath_delete_key should delete
rx key and rx mic key. This patch fixes the leak of hw
keycache in the case.
---
The patch is against the latest wireless test tree.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Cc: stable@kernel.org
---
drivers/net/wireless/ath/ath9k/main.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 6796d5c..928402b 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -809,6 +809,7 @@ static void ath_key_delete(struct ath_common *common, struct ieee80211_key_conf
clear_bit(key->hw_key_idx + 64, common->keymap);
if (common->splitmic) {
+ ath9k_hw_keyreset(ah, key->hw_key_idx + 32);
clear_bit(key->hw_key_idx + 32, common->keymap);
clear_bit(key->hw_key_idx + 64 + 32, common->keymap);
}
--
1.6.2.5
On Mon, 8 Feb 2010 13:38:02 -0800
"Luis R. Rodriguez" <lrodriguez@atheros.com> wrote:
> On Sat, Feb 6, 2010 at 6:38 AM, <tom.leiming@gmail.com> wrote:
> > From: Ming Lei <tom.leiming@gmail.com>
> >
> > If split tkip key is used, ath_delete_key should delete
> > rx key and rx mic key. This patch fixes the leak of hw
> > keycache in the case.
>
> Can you please resend with Cc: stable@kernel.org on the commit log
> entry?
>
> > ---
> > The patch is against the latest wireless test tree.
> >
> > Signed-off-by: Ming Lei <tom.leiming@gmail.com>
>
> Luis
^ permalink raw reply related [flat|nested] 12+ messages in thread
* RE: [ath9k-devel] can ath9k run on linux 2.6.25
2010-02-08 18:01 ` Luis R. Rodriguez
@ 2010-02-09 6:10 ` Jinsung Lee
2010-02-09 6:16 ` Luis R. Rodriguez
[not found] ` <25E8B46727291E4EB5A1CB88CBC4284E0100A779@zmy16exm21.fsl.freescale.net>
0 siblings, 2 replies; 12+ messages in thread
From: Jinsung Lee @ 2010-02-09 6:10 UTC (permalink / raw)
To: 'Luis R. Rodriguez', 'Zhang Yanfei-B21500'
Cc: ath9k-devel, linux-wireless
Dear Luis,
Is this tarball also working on kernel 2.6.24?
I've been trying, but it may have some problem.
Thanks.
-Jinsung
-----Original Message-----
From: ath9k-devel-bounces@lists.ath9k.org [mailto:ath9k-devel-bounces@lists.ath9k.org] On Behalf Of Luis R. Rodriguez
Sent: Tuesday, February 09, 2010 3:02 AM
To: Zhang Yanfei-B21500
Cc: ath9k-devel@venema.h4ckr.net; linux-wireless@vger.kernel.org
Subject: Re: [ath9k-devel] can ath9k run on linux 2.6.25
On Mon, Feb 8, 2010 at 1:20 AM, Zhang Yanfei-B21500
<B21500@freescale.com> wrote:
> Hi All
> Anyone have porting the ath9k to 2.6.25? Is it can work on
> 2.6.25?
>
This tarball has 2.6.25 enabled:
http://www.orbit-lab.org/kernel/compat-wireless-2.6-stable/v2.6.32/compat-wireless-2.6.32.3.tar.bz2
Newer stable kernels after this required multiqueue backported which I
gave a try but haven't gotten reports from users on:
http://bombadil.infradead.org/~mcgrof/tmp/compat-wireless-2.6.32.5-rc3.tar.bz2
After untarring you will have to select to compile only ath9k:
./scripts/driver-select ath9k
Luis
_______________________________________________
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [ath9k-devel] can ath9k run on linux 2.6.25
2010-02-09 6:10 ` Jinsung Lee
@ 2010-02-09 6:16 ` Luis R. Rodriguez
[not found] ` <25E8B46727291E4EB5A1CB88CBC4284E0100A779@zmy16exm21.fsl.freescale.net>
1 sibling, 0 replies; 12+ messages in thread
From: Luis R. Rodriguez @ 2010-02-09 6:16 UTC (permalink / raw)
To: Jinsung Lee; +Cc: Zhang Yanfei-B21500, ath9k-devel, linux-wireless
On Mon, Feb 8, 2010 at 10:10 PM, Jinsung Lee <ljs@netsys.kaist.ac.kr> wrote:
> Dear Luis,
>
> Is this tarball also working on kernel 2.6.24?
I think it should work down to 2.6.23 actually for ath9k.
Luis
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] ath9k: fix keycache leak in split tkip case
2010-02-09 1:36 ` Ming Lei
@ 2010-02-09 7:51 ` Johannes Berg
2010-02-09 14:30 ` Ming Lei
0 siblings, 1 reply; 12+ messages in thread
From: Johannes Berg @ 2010-02-09 7:51 UTC (permalink / raw)
To: Ming Lei; +Cc: Luis R. Rodriguez, linux-wireless, ath9k-devel, linville, stable
On Tue, 2010-02-09 at 09:36 +0800, Ming Lei wrote:
> From 67b0faf7e7a57c3e6a971ff43d1f03f8e939429b Mon Sep 17 00:00:00 2001
> From: Ming Lei <tom.leiming@gmail.com>
> Date: Sat, 6 Feb 2010 22:30:53 +0800
> Subject: [PATCH] ath9k: fix keycache leak in split tkip case
>
> If split tkip key is used, ath_delete_key should delete
> rx key and rx mic key. This patch fixes the leak of hw
> keycache in the case.
>
> ---
> The patch is against the latest wireless test tree.
>
> Signed-off-by: Ming Lei <tom.leiming@gmail.com>
> Cc: stable@kernel.org
This is ordered wrong, it needs to be
----------
From: foo
If split ...
Signed-off-by: ...
Cc: stable...
---
The patch is against...
(everything after --- is removed from the commit log when committing)
----------
johannes
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] ath9k: fix keycache leak in split tkip case
2010-02-09 7:51 ` Johannes Berg
@ 2010-02-09 14:30 ` Ming Lei
0 siblings, 0 replies; 12+ messages in thread
From: Ming Lei @ 2010-02-09 14:30 UTC (permalink / raw)
To: Johannes Berg
Cc: Luis R. Rodriguez, linux-wireless, ath9k-devel, linville, stable
>From 67b0faf7e7a57c3e6a971ff43d1f03f8e939429b Mon Sep 17 00:00:00 2001
From: Ming Lei <tom.leiming@gmail.com>
Date: Sat, 6 Feb 2010 22:30:53 +0800
Subject: [PATCH] ath9k: fix keycache leak in split tkip case
If split tkip key is used, ath_delete_key should delete
rx key and rx mic key. This patch fixes the leak of hw
keycache in the case.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Cc: stable@kernel.org
---
The patch is against the latest wireless test tree.
Thanks for the comments of Luis and johannes.
---
drivers/net/wireless/ath/ath9k/main.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 6796d5c..928402b 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -809,6 +809,7 @@ static void ath_key_delete(struct ath_common *common, struct ieee80211_key_conf
clear_bit(key->hw_key_idx + 64, common->keymap);
if (common->splitmic) {
+ ath9k_hw_keyreset(ah, key->hw_key_idx + 32);
clear_bit(key->hw_key_idx + 32, common->keymap);
clear_bit(key->hw_key_idx + 64 + 32, common->keymap);
}
--
1.6.2.5
On Tue, 09 Feb 2010 08:51:48 +0100
Johannes Berg <johannes@sipsolutions.net> wrote:
> On Tue, 2010-02-09 at 09:36 +0800, Ming Lei wrote:
> > From 67b0faf7e7a57c3e6a971ff43d1f03f8e939429b Mon Sep 17 00:00:00
> > 2001 From: Ming Lei <tom.leiming@gmail.com>
> > Date: Sat, 6 Feb 2010 22:30:53 +0800
> > Subject: [PATCH] ath9k: fix keycache leak in split tkip case
> >
> > If split tkip key is used, ath_delete_key should delete
> > rx key and rx mic key. This patch fixes the leak of hw
> > keycache in the case.
> >
> > ---
> > The patch is against the latest wireless test tree.
> >
> > Signed-off-by: Ming Lei <tom.leiming@gmail.com>
> > Cc: stable@kernel.org
>
> This is ordered wrong, it needs to be
>
> ----------
> From: foo
>
> If split ...
>
> Signed-off-by: ...
> Cc: stable...
> ---
> The patch is against...
> (everything after --- is removed from the commit log when committing)
> ----------
>
> johannes
>
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [ath9k-devel] can ath9k run on linux 2.6.25
[not found] ` <25E8B46727291E4EB5A1CB88CBC4284E0100A779@zmy16exm21.fsl.freescale.net>
@ 2010-02-09 17:10 ` Luis R. Rodriguez
2010-02-11 3:03 ` Zhang Yanfei-B21500
0 siblings, 1 reply; 12+ messages in thread
From: Luis R. Rodriguez @ 2010-02-09 17:10 UTC (permalink / raw)
To: Zhang Yanfei-B21500
Cc: Jinsung Lee, Luis R. Rodriguez, ath9k-devel@venema.h4ckr.net,
linux-wireless@vger.kernel.org
On Mon, Feb 08, 2010 at 10:36:09PM -0800, Zhang Yanfei-B21500 wrote:
> Hi Guys
>
> Thanks a lot... Good news. Do you have porting to 2.6.25
> successfully with good performace also ?
It should be OK for the release without the multiqueue backported.
Multiqueue was added back on the 2.6.32.4 release so 2.6.32.3 should
be the last release without it. That I believe was tested to work
well with ath9k.
After that I have not received any feedback with respect to the multiqueue
backport. Feedback on that is appreciated.
> I am going to porting it to a powerpc board base on 2.6.25 kernel.
You should not need to do much but just test. Can you please let me know.
This one should just work:
http://www.orbit-lab.org/kernel/compat-wireless-2.6-stable/v2.6.32/compat-wireless-2.6.32.3.tar.bz2
Newer stable kernels after this required multiqueue backported which I
gave a try but haven't gotten reports from users on:
http://bombadil.infradead.org/~mcgrof/tmp/compat-wireless-2.6.32.5-rc3.tar.bz2
Luis
^ permalink raw reply [flat|nested] 12+ messages in thread
* RE: [ath9k-devel] can ath9k run on linux 2.6.25
2010-02-09 17:10 ` Luis R. Rodriguez
@ 2010-02-11 3:03 ` Zhang Yanfei-B21500
2010-02-13 1:28 ` Luis R. Rodriguez
0 siblings, 1 reply; 12+ messages in thread
From: Zhang Yanfei-B21500 @ 2010-02-11 3:03 UTC (permalink / raw)
To: Luis R. Rodriguez
Cc: Jinsung Lee, Luis R. Rodriguez, ath9k-devel, linux-wireless
Hi Luis
I am porting the compat-wireless-2.6.32-3 to my powerpc platform
with 2.6.25 kernel. After disable the LED marco in config.mk i have
compile it sucess. but when i load it , it show below error messages,
anyone can help on this?
the kernel modules manually load order is below: am i right ?
1. rfkill_backport
2. cfg_802.11
3. mac80211
4. ath
5. ath9k
#insmod rfkill_backport.ko
rfkill_backport: Unknown symbol dev_set_name
insmod: cannot insert 'rfkill_backport.ko': unknown symbol in module
(-1): No such file or directory
i found that the compat-2.6.26 have the dev_set_name function, but
compat-2.6.25 don't have this.
In new kernel(2.6.29) it's is device/base/core.c, then i try to copy
the function into my 2.6.25 kernel.
but it loss the 'kobject_set_name_vargs', here is the compile
information.
$drivers/base/core.c: In function 'dev_set_name':
$drivers/base/core.c:880: error: implicit declaration of function
'kobject_set_name_vargs'
Regards
Yanfei
> -----Original Message-----
> From: Luis R. Rodriguez [mailto:lrodriguez@Atheros.com]
> Sent: Wednesday, February 10, 2010 1:10 AM
> To: Zhang Yanfei-B21500
> Cc: Jinsung Lee; Luis R. Rodriguez;
> ath9k-devel@venema.h4ckr.net; linux-wireless@vger.kernel.org
> Subject: Re: [ath9k-devel] can ath9k run on linux 2.6.25
>
> On Mon, Feb 08, 2010 at 10:36:09PM -0800, Zhang Yanfei-B21500 wrote:
> > Hi Guys
> >
> > Thanks a lot... Good news. Do you have porting to 2.6.25
> > successfully with good performace also ?
>
> It should be OK for the release without the multiqueue backported.
> Multiqueue was added back on the 2.6.32.4 release so 2.6.32.3
> should be the last release without it. That I believe was
> tested to work well with ath9k.
>
> After that I have not received any feedback with respect to
> the multiqueue backport. Feedback on that is appreciated.
>
> > I am going to porting it to a powerpc board base on 2.6.25 kernel.
>
> You should not need to do much but just test. Can you please
> let me know.
>
> This one should just work:
>
> http://www.orbit-lab.org/kernel/compat-wireless-2.6-stable/v2.
> 6.32/compat-wireless-2.6.32.3.tar.bz2
>
> Newer stable kernels after this required multiqueue
> backported which I gave a try but haven't gotten reports from
> users on:
>
> http://bombadil.infradead.org/~mcgrof/tmp/compat-wireless-2.6.
> 32.5-rc3.tar.bz2
>
> Luis
>
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [ath9k-devel] can ath9k run on linux 2.6.25
2010-02-11 3:03 ` Zhang Yanfei-B21500
@ 2010-02-13 1:28 ` Luis R. Rodriguez
0 siblings, 0 replies; 12+ messages in thread
From: Luis R. Rodriguez @ 2010-02-13 1:28 UTC (permalink / raw)
To: Zhang Yanfei-B21500; +Cc: Jinsung Lee, ath9k-devel, linux-wireless
On Wed, Feb 10, 2010 at 7:03 PM, Zhang Yanfei-B21500
<B21500@freescale.com> wrote:
> Hi Luis
>
> I am porting the compat-wireless-2.6.32-3 to my powerpc platform
> with 2.6.25 kernel. After disable the LED marco in config.mk i have
> compile it sucess. but when i load it , it show below error messages,
> anyone can help on this?
> the kernel modules manually load order is below: am i right ?
> 1. rfkill_backport
> 2. cfg_802.11
> 3. mac80211
> 4. ath
> 5. ath9k
> #insmod rfkill_backport.ko
> rfkill_backport: Unknown symbol dev_set_name
> insmod: cannot insert 'rfkill_backport.ko': unknown symbol in module
> (-1): No such file or directory
>
> i found that the compat-2.6.26 have the dev_set_name function, but
> compat-2.6.25 don't have this.
That is the point, so the way the compat-2.6.x files work is that say
you are on 2.6.25 it means you need backport work for 2.6.26, 2.6.27,
2.6.28, 2.6.29, 2.6.30, 2.6.31, 2.6.32 and 2.6.33.
So you get compiled the respective objects for each kernel and these
get linked into a compat module.
dev_set_name() was added as of the 2.6.26 kernel so having it defined
for kernels >= 2.6.25 is correct, and it is also exported.
Only thing I can think of is perhaps rfkill doesn't have the compat.h
header included? I'll check in a while.
> In new kernel(2.6.29) it's is device/base/core.c, then i try to copy
> the function into my 2.6.25 kernel.
> but it loss the 'kobject_set_name_vargs', here is the compile
> information.
> $drivers/base/core.c: In function 'dev_set_name':
> $drivers/base/core.c:880: error: implicit declaration of function
> 'kobject_set_name_vargs'
Senthil backported this on compat-2.6.26.c, there are two different
ways to backport this, one for kernels >= 2.6.25 which is at the top
and then for kernels older, at the bottom:
/* 2.6.24 does not have the struct kobject with a name */
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25))
/**
* kobject_set_name_vargs - Set the name of an kobject
* @kobj: struct kobject to set the name of
* @fmt: format string used to build the name
* @vargs: vargs to format the string.
*/
static
int kobject_set_name_vargs(struct kobject *kobj, const char *fmt,
va_list vargs)
{
const char *old_name = kobj->name;
char *s;
if (kobj->name && !fmt)
return 0;
kobj->name = kvasprintf(GFP_KERNEL, fmt, vargs);
if (!kobj->name)
return -ENOMEM;
/* ewww... some of these buggers have '/' in the name ... */
while ((s = strchr(kobj->name, '/')))
s[0] = '!';
kfree(old_name);
return 0;
}
#else
static
int kobject_set_name_vargs(struct kobject *kobj, const char *fmt,
va_list vargs)
{
struct device *dev;
unsigned int len;
va_list aq;
dev = container_of(kobj, struct device, kobj);
va_copy(aq, vargs);
len = vsnprintf(NULL, 0, fmt, aq);
va_end(aq);
len = len < BUS_ID_SIZE ? (len + 1) : BUS_ID_SIZE;
vsnprintf(dev->bus_id, len, fmt, vargs);
return 0;
}
#endif
Luis
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2010-02-13 1:29 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-06 14:38 [PATCH] ath9k: fix keycache leak in split tkip case tom.leiming
2010-02-08 9:20 ` [ath9k-devel] can ath9k run on linux 2.6.25 Zhang Yanfei-B21500
2010-02-08 18:01 ` Luis R. Rodriguez
2010-02-09 6:10 ` Jinsung Lee
2010-02-09 6:16 ` Luis R. Rodriguez
[not found] ` <25E8B46727291E4EB5A1CB88CBC4284E0100A779@zmy16exm21.fsl.freescale.net>
2010-02-09 17:10 ` Luis R. Rodriguez
2010-02-11 3:03 ` Zhang Yanfei-B21500
2010-02-13 1:28 ` Luis R. Rodriguez
2010-02-08 21:38 ` [PATCH] ath9k: fix keycache leak in split tkip case Luis R. Rodriguez
2010-02-09 1:36 ` Ming Lei
2010-02-09 7:51 ` Johannes Berg
2010-02-09 14:30 ` Ming Lei
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox