* Re: linux-next: build failure after merge of the akpm tree
From: Greg KH @ 2012-01-05 23:19 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Andrew Morton, linux-next, linux-kernel, Kay Sievers,
Michael Holzheu
In-Reply-To: <20120105182937.58ec59c2fa2bc34e9e48542a@canb.auug.org.au>
On Thu, Jan 05, 2012 at 06:29:37PM +1100, Stephen Rothwell wrote:
> Hi Andrew,
>
> After merging the akpm tree, today's linux-next build (powerpc
> ppc64_defconfig) failed like this:
>
> drivers/base/memory.c: In function 'memory_block_change_state':
> drivers/base/memory.c:306:22: error: 'struct memory_block' has no member named 'sysdev'
> drivers/base/memory.c:309:22: error: 'struct memory_block' has no member named 'sysdev'
>
> Caused by commit 2691cc121386 ("kdump: add udev events for memory
> online/offline") interacting with commit 10fbcf4c6cb1 ("convert 'memory'
> sysdev_class to a regular subsystem") from the driver-core tree.
I can't recall this kdump patch coming through before, have I seen it?
creating new uevents is not something to be done lightly, has this been
tested with the existing userspace tools to make sure it doesn't cause
problems?
thanks,
greg k-h
^ permalink raw reply
* Re: linux-next: build failure after merge of the driver-core tree
From: Greg KH @ 2012-01-05 23:20 UTC (permalink / raw)
To: Stephen Rothwell
Cc: linux-next, linux-kernel, Srivatsa S. Bhat, Borislav Petkov,
Jan Beulich, Kay Sievers
In-Reply-To: <20120105172856.07fc66f37d76f16a88d22799@canb.auug.org.au>
On Thu, Jan 05, 2012 at 05:28:56PM +1100, Stephen Rothwell wrote:
> Hi Greg,
>
> After merging the driver-core tree, today's linux-next build (x86_64
> allmodconfig) failed like this:
>
> arch/x86/kernel/microcode_core.c: In function 'microcode_init':
> arch/x86/kernel/microcode_core.c:557:2: error: implicit declaration of function 'sysdev_driver_unregister' [-Werror=implicit-function-declaration]
> arch/x86/kernel/microcode_core.c:557:28: error: 'cpu_sysdev_class' undeclared (first use in this function)
> arch/x86/kernel/microcode_core.c:557:47: error: 'mc_sysdev_driver' undeclared (first use in this function)
>
> Caused by commit 8a25a2fd126c ("cpu: convert 'cpu' and 'machinecheck'
> sysdev_class to a regular subsystem") interacting with commit
> bd399063976c ("x86, microcode: Fix the failure path of microcode update
> driver init code") which was added to Linux' tree in v3.2-rc5,
>
> I have applied the following merge fix patch:
Thanks, this looks good, and I'll queue it up when push these to Linus.
greg k-h
^ permalink raw reply
* Re: linux-next: manual merge of the selinux tree with the net-next tree
From: Eric Paris @ 2012-01-05 22:51 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Paul Moore, linux-next, linux-kernel, Andrei Emeltchenko,
David Miller, netdev, Gustavo F. Padovan
In-Reply-To: <20120106091550.534131cb1fe6e3dee323699c@canb.auug.org.au>
On Fri, 2012-01-06 at 09:15 +1100, Stephen Rothwell wrote:
> Hi Paul,
>
> On Thu, 05 Jan 2012 16:25:53 -0500 Paul Moore <pmoore@redhat.com> wrote:
> >
> > On Thursday, January 05, 2012 03:12:55 PM Stephen Rothwell wrote:
> > >
> > > Today's linux-next merge of the selinux tree got a conflict in
> > > net/bluetooth/l2cap_sock.c between commit 15770b1ab974 ("Bluetooth:
> > > convert force_active variable to flag in l2cap chan") from the net-next
> > > tree and commit 53860f3d0499 ("bluetooth: Properly clone LSM attributes
> > > to newly created child connections") from the selinux tree.
> > >
> > > These both remove the same line, but there is probably something more
> > > subtle going on ... I just used the version from the net-next tree.
> >
> > Something is a bit odd. When I look in the current linux-next tree I see two
> > commits which fix a Bluetooth/LSM bug; the first is correct, the second one
> > appears to be some other commit which just hijacked the description from the
> > first ... I have no idea what is going on in the second commit; I'll leave
> > that to you git gurus :)
> >
> > * Correct commit -> 6230c9b4f8957c8938ee4cf2d03166d3c2dc89de
>
> That is a commit in Linus' tree before v3.1
>
> > * Garbage commit -> 53860f3d0499992855d58e33f0f79bfe642dfccb
>
> That is the commit in the selinux tree. This should be unnecessary as
> the selinux tree is based on v3.1 (and I basically ignored it in the
> merge resolution).
Thanks paul... This must be a result of me rebasing my tree onto 3.1.
No way I should have left this garbage. It doesn't make sense. I think
I'll rewrite history for tomorrow since noone is going to notice or
care...
-Eric
^ permalink raw reply
* Re: linux-next: manual merge of the selinux tree with the net-next tree
From: Stephen Rothwell @ 2012-01-05 22:15 UTC (permalink / raw)
To: Paul Moore
Cc: Eric Paris, linux-next, linux-kernel, Andrei Emeltchenko,
David Miller, netdev, Gustavo F. Padovan
In-Reply-To: <27624574.j8RvKjachg@sifl>
[-- Attachment #1: Type: text/plain, Size: 1489 bytes --]
Hi Paul,
On Thu, 05 Jan 2012 16:25:53 -0500 Paul Moore <pmoore@redhat.com> wrote:
>
> On Thursday, January 05, 2012 03:12:55 PM Stephen Rothwell wrote:
> >
> > Today's linux-next merge of the selinux tree got a conflict in
> > net/bluetooth/l2cap_sock.c between commit 15770b1ab974 ("Bluetooth:
> > convert force_active variable to flag in l2cap chan") from the net-next
> > tree and commit 53860f3d0499 ("bluetooth: Properly clone LSM attributes
> > to newly created child connections") from the selinux tree.
> >
> > These both remove the same line, but there is probably something more
> > subtle going on ... I just used the version from the net-next tree.
>
> Something is a bit odd. When I look in the current linux-next tree I see two
> commits which fix a Bluetooth/LSM bug; the first is correct, the second one
> appears to be some other commit which just hijacked the description from the
> first ... I have no idea what is going on in the second commit; I'll leave
> that to you git gurus :)
>
> * Correct commit -> 6230c9b4f8957c8938ee4cf2d03166d3c2dc89de
That is a commit in Linus' tree before v3.1
> * Garbage commit -> 53860f3d0499992855d58e33f0f79bfe642dfccb
That is the commit in the selinux tree. This should be unnecessary as
the selinux tree is based on v3.1 (and I basically ignored it in the
merge resolution).
--
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: linux-next: manual merge of the selinux tree with the net-next tree
From: Paul Moore @ 2012-01-05 21:25 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Eric Paris, linux-next, linux-kernel, Andrei Emeltchenko,
David Miller, netdev, Gustavo F. Padovan
In-Reply-To: <20120105151255.f72ad113a93493bb55844034@canb.auug.org.au>
On Thursday, January 05, 2012 03:12:55 PM Stephen Rothwell wrote:
> Hi Eric,
>
> Today's linux-next merge of the selinux tree got a conflict in
> net/bluetooth/l2cap_sock.c between commit 15770b1ab974 ("Bluetooth:
> convert force_active variable to flag in l2cap chan") from the net-next
> tree and commit 53860f3d0499 ("bluetooth: Properly clone LSM attributes
> to newly created child connections") from the selinux tree.
>
> These both remove the same line, but there is probably something more
> subtle going on ... I just used the version from the net-next tree.
Something is a bit odd. When I look in the current linux-next tree I see two
commits which fix a Bluetooth/LSM bug; the first is correct, the second one
appears to be some other commit which just hijacked the description from the
first ... I have no idea what is going on in the second commit; I'll leave
that to you git gurus :)
* Correct commit -> 6230c9b4f8957c8938ee4cf2d03166d3c2dc89de
* Garbage commit -> 53860f3d0499992855d58e33f0f79bfe642dfccb
--
paul moore
virtualization @ redhat
^ permalink raw reply
* Re: linux-next: build failure after merge of the ext4 tree
From: Stephen Rothwell @ 2012-01-05 21:06 UTC (permalink / raw)
To: Theodore Tso; +Cc: linux-next, linux-kernel, Yongqiang Yang, Jan Kara
In-Reply-To: <20120103113533.b2fdd68aff5b6d3c100d41b6@canb.auug.org.au>
[-- Attachment #1: Type: text/plain, Size: 3467 bytes --]
HI Ted,
On Tue, 3 Jan 2012 11:35:33 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> After merging the ext4 tree, today's linux-next build (powerpc
> ppc64_defconfig) failed like this:
>
> fs/jbd2/built-in.o: In function `journal_clear_buffer_revoked_flags':
> (.opd+0x5b8): multiple definition of `journal_clear_buffer_revoked_flags'
> fs/jbd/built-in.o:(.opd+0x570): first defined here
> fs/jbd2/built-in.o: In function `.journal_clear_buffer_revoked_flags':
> (.text+0x7e80): multiple definition of `.journal_clear_buffer_revoked_flags'
> fs/jbd/built-in.o:(.text+0x7970): first defined here
>
> Caused by commit 7834c98154f1 ("jbd2: clear revoked flag on buffers
> before a new transaction started") interacting with commit 8c111b3f5633
> ("jbd: clear revoked flag on buffers before a new transaction started")
> form the ext3 tree.
>
> I applied this merge fix patch:
>
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Tue, 3 Jan 2012 11:31:37 +1100
> Subject: [PATCH] jbd2: sanitize a new global symbol
> (journal_clear_buffer_revoked_flags)
>
> Fixes these build errors (when combined with the ext3 tree):
>
> fs/jbd2/built-in.o: In function `journal_clear_buffer_revoked_flags':
> (.opd+0x5b8): multiple definition of `journal_clear_buffer_revoked_flags'
> fs/jbd/built-in.o:(.opd+0x570): first defined here
>
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
> fs/jbd2/commit.c | 2 +-
> fs/jbd2/revoke.c | 2 +-
> include/linux/jbd2.h | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c
> index 7f99e17..3f5c545 100644
> --- a/fs/jbd2/commit.c
> +++ b/fs/jbd2/commit.c
> @@ -433,7 +433,7 @@ void jbd2_journal_commit_transaction(journal_t *journal)
> * Clear revoked flag to reflect there is no revoked buffers
> * in the next transaction which is going to be started.
> */
> - journal_clear_buffer_revoked_flags(journal);
> + jbd2_journal_clear_buffer_revoked_flags(journal);
>
> /*
> * Switch to a new revoke table.
> diff --git a/fs/jbd2/revoke.c b/fs/jbd2/revoke.c
> index 1c36138..c99d839 100644
> --- a/fs/jbd2/revoke.c
> +++ b/fs/jbd2/revoke.c
> @@ -487,7 +487,7 @@ int jbd2_journal_cancel_revoke(handle_t *handle, struct journal_head *jh)
> * revoke table to reflect there is no revoked buffers in the next
> * transaction which is going to be started.
> */
> -void journal_clear_buffer_revoked_flags(journal_t *journal)
> +void jbd2_journal_clear_buffer_revoked_flags(journal_t *journal)
> {
> struct jbd2_revoke_table_s *revoke = journal->j_revoke;
> int i = 0;
> diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
> index 17bf089..44b8072 100644
> --- a/include/linux/jbd2.h
> +++ b/include/linux/jbd2.h
> @@ -1151,7 +1151,7 @@ extern int jbd2_journal_set_revoke(journal_t *, unsigned long long, tid_t);
> extern int jbd2_journal_test_revoke(journal_t *, unsigned long long, tid_t);
> extern void jbd2_journal_clear_revoke(journal_t *);
> extern void jbd2_journal_switch_revoke_table(journal_t *journal);
> -extern void journal_clear_buffer_revoked_flags(journal_t *journal);
> +extern void jbd2_journal_clear_buffer_revoked_flags(journal_t *journal);
>
> /*
> * The log thread user interface:
Ping?
--
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 block/for-3.3/core] block: an exiting task should be allowed to create io_context
From: Tejun Heo @ 2012-01-05 18:38 UTC (permalink / raw)
To: Hugh Dickins
Cc: Jens Axboe, Shaohua Li, Andrew Morton, Stephen Rothwell,
linux-next, LKML, linux-scsi, linux-ide, x86
In-Reply-To: <alpine.LSU.2.00.1201051026090.2009@eggly.anvils>
Hello, Hugh.
On Thu, Jan 05, 2012 at 10:36:21AM -0800, Hugh Dickins wrote:
> I can vouch that it makes the list_debug.c:53 warnings go away: they
> used to come in half an hour, but I've run on two machines for 10
> hours so far without seeing any.
Yeah, my overnight test is pretty conclusive too. I can usually hit
the bug under 30mins without the patch.
> And I've not yet seen a cfq-iosched.c:2585 with that patch in; but
> those were more elusive - we'll have to run until tomorrow night
> before concluding that it makes those go away too.
>
> Or if you understand the connection between these, and would prefer
> to assume that it fixes them both, and want me to try another patch
> instead (I assume the one I'm running with is a workaround to narrow
> down the issue, rather than an intended fix?), let me know and I'll
> switch over.
Yeap, I can see the connections now and think I know where the bug is
too. I'll, hopefully, be able to post fix soon.
Thanks.
--
tejun
^ permalink raw reply
* Re: [PATCH block/for-3.3/core] block: an exiting task should be allowed to create io_context
From: Hugh Dickins @ 2012-01-05 18:36 UTC (permalink / raw)
To: Tejun Heo
Cc: Jens Axboe, Shaohua Li, Andrew Morton, Stephen Rothwell,
linux-next, LKML, linux-scsi, linux-ide, x86
In-Reply-To: <20120105012445.GP31746@google.com>
On Wed, 4 Jan 2012, Tejun Heo wrote:
> On Tue, Jan 03, 2012 at 02:35:05PM -0800, Tejun Heo wrote:
> > > Hmmm... I disabled cfqq merge logic (commented out
> > > cfq_close_cooperator() and the following cfq_setup_merge() calls) in
> > > cfq_select_queue() and neither is triggering for quite a while now.
> > > Maybe cfqq refcnt is getting borked over cfqq merging / splitting? It
> > > would also explain the low frequency of the issue too. I'll try to
> > > further isolate it but It would be awesome if someone more familiar
> > > with the logic can go over that part.
> >
> > Scrap that. It triggered and yeah cfq_get_next_queue() is retrieving
> > empty cfqq from the service tree.
>
> Update: I've been running with ELEVATOR_INSERT_SORT_MERGE disabled and
> none of the issues triggered for about three hours now. It usually
> triggers under an hour.
>
> Hugh, can you please verify whether the patch appended at the end
> makes the problem go away?
I can vouch that it makes the list_debug.c:53 warnings go away: they
used to come in half an hour, but I've run on two machines for 10
hours so far without seeing any.
And I've not yet seen a cfq-iosched.c:2585 with that patch in; but
those were more elusive - we'll have to run until tomorrow night
before concluding that it makes those go away too.
Or if you understand the connection between these, and would prefer
to assume that it fixes them both, and want me to try another patch
instead (I assume the one I'm running with is a workaround to narrow
down the issue, rather than an intended fix?), let me know and I'll
switch over.
Hugh
>
> Thanks.
>
> diff --git a/block/elevator.c b/block/elevator.c
> index 99838f4..2e172d2 100644
> --- a/block/elevator.c
> +++ b/block/elevator.c
> @@ -644,6 +644,9 @@ void __elv_add_request(struct request_queue *q, struct request *rq, int where)
>
> rq->q = q;
>
> + if (where == ELEVATOR_INSERT_SORT_MERGE)
> + where = ELEVATOR_INSERT_SORT;
> +
> if (rq->cmd_flags & REQ_SOFTBARRIER) {
> /* barriers are scheduling boundary, update end_sector */
> if (rq->cmd_type == REQ_TYPE_FS ||
>
^ permalink raw reply
* Re: [PATCH v2 5/6] ath6kl: convert ath6kl_dbg() and ath6kl_dbg_dump() into functions
From: Joe Perches @ 2012-01-05 16:38 UTC (permalink / raw)
To: Kalle Valo
Cc: linville, sfr, netdev, linux-wireless, linux-kernel, linux-next,
ath6kl-devel, davem
In-Reply-To: <20120105132834.22281.78822.stgit@x201>
On Thu, 2012-01-05 at 15:28 +0200, Kalle Valo wrote:
Hey Kalle.
> diff --git a/drivers/net/wireless/ath/ath6kl/debug.c b/drivers/net/wireless/ath/ath6kl/debug.c
[]
> +void ath6kl_dbg(enum ATH6K_DEBUG_MASK mask, const char *fmt, ...)
[]
> + ath6kl_printk(KERN_DEBUG, "%pV", &vaf);
[
> diff --git a/drivers/net/wireless/ath/ath6kl/debug.h b/drivers/net/wireless/ath/ath6kl/debug.h
[]
> +void ath6kl_dbg(enum ATH6K_DEBUG_MASK mask, const char *fmt, ...);
You need to add
__printf(2, 3)
to the prototype.
If it's not there, the printf formats and arguments aren't verified.
%pV could do the wrong/bad things.
^ permalink raw reply
* RE: [PATCH 5/6] ath6kl: convert ath6kl_dbg() and ath6kl_dbg_dump() into functions
From: Joe Perches @ 2012-01-05 16:30 UTC (permalink / raw)
To: David Laight
Cc: Kalle Valo, linville, sfr, netdev, linux-wireless, linux-kernel,
linux-next, ath6kl-devel, davem
In-Reply-To: <AE90C24D6B3A694183C094C60CF0A2F6D8AF2F@saturn3.aculab.com>
On Thu, 2012-01-05 at 10:41 +0000, David Laight wrote:
> > > + va_start(args, fmt);
> > > + ath6kl_printk(KERN_DEBUG, fmt, &args);
> > Passing a va_list as an argument?
> > I believe this doesn't work.
> > I think you'll need to add and use:
> Passing a va_list certainly does work - vprintf() etc.
> What is problematical is taking the address of a va_list.
Nope. This referred to this specific instance.
Taking the address of a va_list works fine.
Look at the provide example.
^ permalink raw reply
* Re: linux-next: build failure after merge of the battery tree
From: Greg KH @ 2012-01-05 15:53 UTC (permalink / raw)
To: Anton Vorontsov
Cc: Stephen Rothwell, Jeremy Fitzhardinge, linux-next, linux-kernel
In-Reply-To: <20120105152536.GB28629@oksana.dev.rtsoft.ru>
On Thu, Jan 05, 2012 at 07:25:36PM +0400, Anton Vorontsov wrote:
> On Thu, Jan 05, 2012 at 02:40:42PM +1100, Stephen Rothwell wrote:
> > Hi Anton,
> >
> > After merging the battery tree, today's linux-next build (x86_64
> > allmodconfig) failed like this:
> >
> > ERROR: "sysfs_create_link_nowarn" [drivers/power/power_supply.ko] undefined!
> >
> > Caused by commit 8351665195ce ("power_supply: allow a power supply to
> > explicitly point to powered device"). That symbol is not exported to
> > modules.
> >
> > I have used the battery tree from next-20120104 for today.
>
> Thanks for catching this, Stephen!
>
> I wonder why do we need to use _nowarn variant?..
>
> Something tells me that we actually want a warning.
Yes, no one other than the driver core should ever be calling this
function, that is why it is not exported.
And I'm guessing, hopefully, that this sysfs link you are creating, is
also being documented in Documentation/ABI/ right? If not, it must be.
thanks,
greg k-h
^ permalink raw reply
* Re: linux-next: build failure after merge of the battery tree
From: Anton Vorontsov @ 2012-01-05 15:25 UTC (permalink / raw)
To: Stephen Rothwell, Jeremy Fitzhardinge; +Cc: linux-next, linux-kernel
In-Reply-To: <20120105144042.4e03850089cce56a7e9312e4@canb.auug.org.au>
On Thu, Jan 05, 2012 at 02:40:42PM +1100, Stephen Rothwell wrote:
> Hi Anton,
>
> After merging the battery tree, today's linux-next build (x86_64
> allmodconfig) failed like this:
>
> ERROR: "sysfs_create_link_nowarn" [drivers/power/power_supply.ko] undefined!
>
> Caused by commit 8351665195ce ("power_supply: allow a power supply to
> explicitly point to powered device"). That symbol is not exported to
> modules.
>
> I have used the battery tree from next-20120104 for today.
Thanks for catching this, Stephen!
I wonder why do we need to use _nowarn variant?..
Something tells me that we actually want a warning.
Jeremy, are you OK with the patch down below?
- - - -
From: Anton Vorontsov <cbouatmailru@gmail.com>
Subject: power_supply: Drop usage of nowarn variant of sysfs_create_link()
The function is not exported to modules, plus we do want to catch anyone
who tries to create complex hierarchy (in that case we'd need to change
'powers' symlink to a directory, probably under a different name to not
break ABI).
This patch fixes the following build error:
ERROR: "sysfs_create_link_nowarn" [drivers/power/power_supply.ko] undefined!
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
---
drivers/power/power_supply_core.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/power/power_supply_core.c b/drivers/power/power_supply_core.c
index b10c121..47f4e11 100644
--- a/drivers/power/power_supply_core.c
+++ b/drivers/power/power_supply_core.c
@@ -149,7 +149,7 @@ EXPORT_SYMBOL_GPL(power_supply_get_by_name);
int power_supply_powers(struct power_supply *psy, struct device *dev)
{
- return sysfs_create_link_nowarn(&psy->dev->kobj, &dev->kobj, "powers");
+ return sysfs_create_link(&psy->dev->kobj, &dev->kobj, "powers");
}
EXPORT_SYMBOL_GPL(power_supply_powers);
--
1.7.7.3
^ permalink raw reply related
* RE: [PATCH v2 4/6] ath6kl: get rid of AR_DBG_LVL_CHECK()
From: David Laight @ 2012-01-05 14:14 UTC (permalink / raw)
To: Kalle Valo, linville
Cc: sfr, netdev, linux-wireless, linux-kernel, linux-next,
ath6kl-devel, davem
In-Reply-To: <20120105132812.22281.98859.stgit@x201>
> We don't need it as debug calls already have a log level and compiler
> should be smart enough to optimise away the code when ath6kl
> debug code is not enabled.
Have you checked?
I think you are assuming that because the called
function collapses, the call will be removed allowing
the loop to be removed.
I suspect this is only true if the function is inlined.
IIRC the normal linkage rules mean that only static
functions are candidates for inlining.
David
^ permalink raw reply
* [PATCH v2 6/6] ath6kl: create ath6kl_core.ko
From: Kalle Valo @ 2012-01-05 13:28 UTC (permalink / raw)
To: linville
Cc: sfr, netdev, linux-wireless, linux-kernel, linux-next,
ath6kl-devel, davem
In-Reply-To: <20120105132523.22281.95999.stgit@x201>
Now ath6kl is ready for splitting core code to ath6kl_core.ko module.
This also makes it possible to link both sdio and usb code to kernel
at the same time, which earlier failed miserably.
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/Makefile | 37 +++++++++++-----------------
drivers/net/wireless/ath/ath6kl/cfg80211.c | 3 ++
drivers/net/wireless/ath/ath6kl/core.c | 9 +++++++
drivers/net/wireless/ath/ath6kl/debug.c | 3 ++
drivers/net/wireless/ath/ath6kl/hif.c | 5 ++++
drivers/net/wireless/ath/ath6kl/init.c | 3 ++
6 files changed, 37 insertions(+), 23 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/Makefile b/drivers/net/wireless/ath/ath6kl/Makefile
index 9bb69a8..863b9f6 100644
--- a/drivers/net/wireless/ath/ath6kl/Makefile
+++ b/drivers/net/wireless/ath/ath6kl/Makefile
@@ -21,32 +21,23 @@
# Author(s): ="Atheros"
#------------------------------------------------------------------------------
-obj-$(CONFIG_ATH6KL_SDIO) := ath6kl_sdio.o
-ath6kl_sdio-y += debug.o
-ath6kl_sdio-y += hif.o
-ath6kl_sdio-y += htc.o
-ath6kl_sdio-y += bmi.o
-ath6kl_sdio-y += cfg80211.o
-ath6kl_sdio-y += init.o
-ath6kl_sdio-y += main.o
-ath6kl_sdio-y += txrx.o
-ath6kl_sdio-y += wmi.o
-ath6kl_sdio-y += core.o
+obj-$(CONFIG_ATH6KL) += ath6kl_core.o
+ath6kl_core-y += debug.o
+ath6kl_core-y += hif.o
+ath6kl_core-y += htc.o
+ath6kl_core-y += bmi.o
+ath6kl_core-y += cfg80211.o
+ath6kl_core-y += init.o
+ath6kl_core-y += main.o
+ath6kl_core-y += txrx.o
+ath6kl_core-y += wmi.o
+ath6kl_core-y += core.o
+ath6kl_core-$(CONFIG_NL80211_TESTMODE) += testmode.o
+
+obj-$(CONFIG_ATH6KL_SDIO) += ath6kl_sdio.o
ath6kl_sdio-y += sdio.o
-ath6kl_sdio-$(CONFIG_NL80211_TESTMODE) += testmode.o
obj-$(CONFIG_ATH6KL_USB) += ath6kl_usb.o
-ath6kl_usb-y += debug.o
-ath6kl_usb-y += hif.o
-ath6kl_usb-y += htc.o
-ath6kl_usb-y += bmi.o
-ath6kl_usb-y += cfg80211.o
-ath6kl_usb-y += init.o
-ath6kl_usb-y += main.o
-ath6kl_usb-y += txrx.o
-ath6kl_usb-y += wmi.o
-ath6kl_usb-y += core.o
ath6kl_usb-y += usb.o
-ath6kl_usb-$(CONFIG_NL80211_TESTMODE) += testmode.o
ccflags-y += -D__CHECK_ENDIAN__
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 64043f8..d4ed6d1 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -15,6 +15,7 @@
*/
#include <linux/moduleparam.h>
+#include <linux/export.h>
#include "core.h"
#include "cfg80211.h"
@@ -1907,6 +1908,7 @@ int ath6kl_cfg80211_suspend(struct ath6kl *ar,
return 0;
}
+EXPORT_SYMBOL(ath6kl_cfg80211_suspend);
int ath6kl_cfg80211_resume(struct ath6kl *ar)
{
@@ -1958,6 +1960,7 @@ int ath6kl_cfg80211_resume(struct ath6kl *ar)
return 0;
}
+EXPORT_SYMBOL(ath6kl_cfg80211_resume);
#ifdef CONFIG_PM
diff --git a/drivers/net/wireless/ath/ath6kl/core.c b/drivers/net/wireless/ath/ath6kl/core.c
index 7e3574e..0d00475 100644
--- a/drivers/net/wireless/ath/ath6kl/core.c
+++ b/drivers/net/wireless/ath/ath6kl/core.c
@@ -16,7 +16,9 @@
#include "core.h"
+#include <linux/module.h>
#include <linux/moduleparam.h>
+#include <linux/export.h>
#include "debug.h"
#include "hif-ops.h"
@@ -198,6 +200,7 @@ err_wq:
return ret;
}
+EXPORT_SYMBOL(ath6kl_core_init);
struct ath6kl *ath6kl_core_create(struct device *dev)
{
@@ -254,6 +257,7 @@ struct ath6kl *ath6kl_core_create(struct device *dev)
return ar;
}
+EXPORT_SYMBOL(ath6kl_core_create);
void ath6kl_core_cleanup(struct ath6kl *ar)
{
@@ -280,9 +284,14 @@ void ath6kl_core_cleanup(struct ath6kl *ar)
ath6kl_cfg80211_cleanup(ar);
ath6kl_cfg80211_destroy(ar);
}
+EXPORT_SYMBOL(ath6kl_core_cleanup);
void ath6kl_core_destroy(struct ath6kl *ar)
{
ath6kl_cfg80211_destroy(ar);
}
+EXPORT_SYMBOL(ath6kl_core_destroy);
+MODULE_AUTHOR("Qualcomm Atheros");
+MODULE_DESCRIPTION("Core module for AR600x SDIO and USB devices.");
+MODULE_LICENSE("Dual BSD/GPL");
diff --git a/drivers/net/wireless/ath/ath6kl/debug.c b/drivers/net/wireless/ath/ath6kl/debug.c
index f1fa57b..5430166 100644
--- a/drivers/net/wireless/ath/ath6kl/debug.c
+++ b/drivers/net/wireless/ath/ath6kl/debug.c
@@ -54,6 +54,7 @@ int ath6kl_printk(const char *level, const char *fmt, ...)
return rtn;
}
+EXPORT_SYMBOL(ath6kl_printk);
#ifdef CONFIG_ATH6KL_DEBUG
@@ -74,6 +75,7 @@ void ath6kl_dbg(enum ATH6K_DEBUG_MASK mask, const char *fmt, ...)
va_end(args);
}
+EXPORT_SYMBOL(ath6kl_dbg);
void ath6kl_dbg_dump(enum ATH6K_DEBUG_MASK mask,
const char *msg, const char *prefix,
@@ -86,6 +88,7 @@ void ath6kl_dbg_dump(enum ATH6K_DEBUG_MASK mask,
print_hex_dump_bytes(prefix, DUMP_PREFIX_OFFSET, buf, len);
}
}
+EXPORT_SYMBOL(ath6kl_dbg_dump);
#define REG_OUTPUT_LEN_PER_LINE 25
#define REGTYPE_STR_LEN 100
diff --git a/drivers/net/wireless/ath/ath6kl/hif.c b/drivers/net/wireless/ath/ath6kl/hif.c
index 3d26c14..e911737 100644
--- a/drivers/net/wireless/ath/ath6kl/hif.c
+++ b/drivers/net/wireless/ath/ath6kl/hif.c
@@ -15,6 +15,8 @@
*/
#include "hif.h"
+#include <linux/export.h>
+
#include "core.h"
#include "target.h"
#include "hif-ops.h"
@@ -59,6 +61,8 @@ int ath6kl_hif_rw_comp_handler(void *context, int status)
return 0;
}
+EXPORT_SYMBOL(ath6kl_hif_rw_comp_handler);
+
#define REG_DUMP_COUNT_AR6003 60
#define REGISTER_DUMP_LEN_MAX 60
@@ -560,6 +564,7 @@ int ath6kl_hif_intr_bh_handler(struct ath6kl *ar)
return status;
}
+EXPORT_SYMBOL(ath6kl_hif_intr_bh_handler);
static int ath6kl_hif_enable_intrs(struct ath6kl_device *dev)
{
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
index 5a92307..6183c42 100644
--- a/drivers/net/wireless/ath/ath6kl/init.c
+++ b/drivers/net/wireless/ath/ath6kl/init.c
@@ -17,8 +17,10 @@
#include <linux/moduleparam.h>
#include <linux/errno.h>
+#include <linux/export.h>
#include <linux/of.h>
#include <linux/mmc/sdio_func.h>
+
#include "core.h"
#include "cfg80211.h"
#include "target.h"
@@ -1596,3 +1598,4 @@ void ath6kl_stop_txrx(struct ath6kl *ar)
clear_bit(WLAN_ENABLED, &ar->flag);
}
+EXPORT_SYMBOL(ath6kl_stop_txrx);
^ permalink raw reply related
* [PATCH v2 5/6] ath6kl: convert ath6kl_dbg() and ath6kl_dbg_dump() into functions
From: Kalle Valo @ 2012-01-05 13:28 UTC (permalink / raw)
To: linville
Cc: sfr, netdev, linux-wireless, linux-kernel, linux-next,
ath6kl-devel, davem
In-Reply-To: <20120105132523.22281.95999.stgit@x201>
That way it's possible to not export debug_mask outside the upcoming
ath6kl_core.ko and that makes it easier to ath6kl_core.ko in the
following patch.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/debug.c | 30 ++++++++++++++++++++++++++++++
drivers/net/wireless/ath/ath6kl/debug.h | 25 ++++---------------------
2 files changed, 34 insertions(+), 21 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/debug.c b/drivers/net/wireless/ath/ath6kl/debug.c
index 0d77129..f1fa57b 100644
--- a/drivers/net/wireless/ath/ath6kl/debug.c
+++ b/drivers/net/wireless/ath/ath6kl/debug.c
@@ -57,6 +57,36 @@ int ath6kl_printk(const char *level, const char *fmt, ...)
#ifdef CONFIG_ATH6KL_DEBUG
+void ath6kl_dbg(enum ATH6K_DEBUG_MASK mask, const char *fmt, ...)
+{
+ struct va_format vaf;
+ va_list args;
+
+ if (!(debug_mask & mask))
+ return;
+
+ va_start(args, fmt);
+
+ vaf.fmt = fmt;
+ vaf.va = &args;
+
+ ath6kl_printk(KERN_DEBUG, "%pV", &vaf);
+
+ va_end(args);
+}
+
+void ath6kl_dbg_dump(enum ATH6K_DEBUG_MASK mask,
+ const char *msg, const char *prefix,
+ const void *buf, size_t len)
+{
+ if (debug_mask & mask) {
+ if (msg)
+ ath6kl_dbg(mask, "%s\n", msg);
+
+ print_hex_dump_bytes(prefix, DUMP_PREFIX_OFFSET, buf, len);
+ }
+}
+
#define REG_OUTPUT_LEN_PER_LINE 25
#define REGTYPE_STR_LEN 100
diff --git a/drivers/net/wireless/ath/ath6kl/debug.h b/drivers/net/wireless/ath/ath6kl/debug.h
index cb21d91..c4be6e5 100644
--- a/drivers/net/wireless/ath/ath6kl/debug.h
+++ b/drivers/net/wireless/ath/ath6kl/debug.h
@@ -61,28 +61,11 @@ enum ath6kl_war {
};
#ifdef CONFIG_ATH6KL_DEBUG
-#define ath6kl_dbg(mask, fmt, ...) \
- ({ \
- int rtn; \
- if (debug_mask & mask) \
- rtn = ath6kl_printk(KERN_DEBUG, fmt, ##__VA_ARGS__); \
- else \
- rtn = 0; \
- \
- rtn; \
- })
-static inline void ath6kl_dbg_dump(enum ATH6K_DEBUG_MASK mask,
- const char *msg, const char *prefix,
- const void *buf, size_t len)
-{
- if (debug_mask & mask) {
- if (msg)
- ath6kl_dbg(mask, "%s\n", msg);
-
- print_hex_dump_bytes(prefix, DUMP_PREFIX_OFFSET, buf, len);
- }
-}
+void ath6kl_dbg(enum ATH6K_DEBUG_MASK mask, const char *fmt, ...);
+void ath6kl_dbg_dump(enum ATH6K_DEBUG_MASK mask,
+ const char *msg, const char *prefix,
+ const void *buf, size_t len);
void ath6kl_dump_registers(struct ath6kl_device *dev,
struct ath6kl_irq_proc_registers *irq_proc_reg,
^ permalink raw reply related
* [PATCH v2 4/6] ath6kl: get rid of AR_DBG_LVL_CHECK()
From: Kalle Valo @ 2012-01-05 13:28 UTC (permalink / raw)
To: linville
Cc: sfr, netdev, linux-wireless, linux-kernel, linux-next,
ath6kl-devel, davem
In-Reply-To: <20120105132523.22281.95999.stgit@x201>
We don't need it as debug calls already have a log level and compiler
should be smart enough to optimise away the code when ath6kl debug code
is not enabled. Also it makes it easier to abstract core code to
ath6kl_core.ko.
In ath6kl_dump_registers() I had to change the debug level from ANY to IRQ
as I removed the AR_DBG_LVL_CHECK() check before calling the function.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/debug.c | 35 ++++++++++++++-----------------
drivers/net/wireless/ath/ath6kl/debug.h | 2 --
drivers/net/wireless/ath/ath6kl/hif.c | 5 ++--
drivers/net/wireless/ath/ath6kl/wmi.c | 3 ---
4 files changed, 18 insertions(+), 27 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/debug.c b/drivers/net/wireless/ath/ath6kl/debug.c
index eb808b4..0d77129 100644
--- a/drivers/net/wireless/ath/ath6kl/debug.c
+++ b/drivers/net/wireless/ath/ath6kl/debug.c
@@ -82,31 +82,31 @@ void ath6kl_dump_registers(struct ath6kl_device *dev,
struct ath6kl_irq_enable_reg *irq_enable_reg)
{
- ath6kl_dbg(ATH6KL_DBG_ANY, ("<------- Register Table -------->\n"));
+ ath6kl_dbg(ATH6KL_DBG_IRQ, ("<------- Register Table -------->\n"));
if (irq_proc_reg != NULL) {
- ath6kl_dbg(ATH6KL_DBG_ANY,
+ ath6kl_dbg(ATH6KL_DBG_IRQ,
"Host Int status: 0x%x\n",
irq_proc_reg->host_int_status);
- ath6kl_dbg(ATH6KL_DBG_ANY,
+ ath6kl_dbg(ATH6KL_DBG_IRQ,
"CPU Int status: 0x%x\n",
irq_proc_reg->cpu_int_status);
- ath6kl_dbg(ATH6KL_DBG_ANY,
+ ath6kl_dbg(ATH6KL_DBG_IRQ,
"Error Int status: 0x%x\n",
irq_proc_reg->error_int_status);
- ath6kl_dbg(ATH6KL_DBG_ANY,
+ ath6kl_dbg(ATH6KL_DBG_IRQ,
"Counter Int status: 0x%x\n",
irq_proc_reg->counter_int_status);
- ath6kl_dbg(ATH6KL_DBG_ANY,
+ ath6kl_dbg(ATH6KL_DBG_IRQ,
"Mbox Frame: 0x%x\n",
irq_proc_reg->mbox_frame);
- ath6kl_dbg(ATH6KL_DBG_ANY,
+ ath6kl_dbg(ATH6KL_DBG_IRQ,
"Rx Lookahead Valid: 0x%x\n",
irq_proc_reg->rx_lkahd_valid);
- ath6kl_dbg(ATH6KL_DBG_ANY,
+ ath6kl_dbg(ATH6KL_DBG_IRQ,
"Rx Lookahead 0: 0x%x\n",
irq_proc_reg->rx_lkahd[0]);
- ath6kl_dbg(ATH6KL_DBG_ANY,
+ ath6kl_dbg(ATH6KL_DBG_IRQ,
"Rx Lookahead 1: 0x%x\n",
irq_proc_reg->rx_lkahd[1]);
@@ -115,16 +115,16 @@ void ath6kl_dump_registers(struct ath6kl_device *dev,
* If the target supports GMBOX hardware, dump some
* additional state.
*/
- ath6kl_dbg(ATH6KL_DBG_ANY,
+ ath6kl_dbg(ATH6KL_DBG_IRQ,
"GMBOX Host Int status 2: 0x%x\n",
irq_proc_reg->host_int_status2);
- ath6kl_dbg(ATH6KL_DBG_ANY,
+ ath6kl_dbg(ATH6KL_DBG_IRQ,
"GMBOX RX Avail: 0x%x\n",
irq_proc_reg->gmbox_rx_avail);
- ath6kl_dbg(ATH6KL_DBG_ANY,
+ ath6kl_dbg(ATH6KL_DBG_IRQ,
"GMBOX lookahead alias 0: 0x%x\n",
irq_proc_reg->rx_gmbox_lkahd_alias[0]);
- ath6kl_dbg(ATH6KL_DBG_ANY,
+ ath6kl_dbg(ATH6KL_DBG_IRQ,
"GMBOX lookahead alias 1: 0x%x\n",
irq_proc_reg->rx_gmbox_lkahd_alias[1]);
}
@@ -132,13 +132,13 @@ void ath6kl_dump_registers(struct ath6kl_device *dev,
}
if (irq_enable_reg != NULL) {
- ath6kl_dbg(ATH6KL_DBG_ANY,
+ ath6kl_dbg(ATH6KL_DBG_IRQ,
"Int status Enable: 0x%x\n",
irq_enable_reg->int_status_en);
- ath6kl_dbg(ATH6KL_DBG_ANY, "Counter Int status Enable: 0x%x\n",
+ ath6kl_dbg(ATH6KL_DBG_IRQ, "Counter Int status Enable: 0x%x\n",
irq_enable_reg->cntr_int_status_en);
}
- ath6kl_dbg(ATH6KL_DBG_ANY, "<------------------------------->\n");
+ ath6kl_dbg(ATH6KL_DBG_IRQ, "<------------------------------->\n");
}
static void dump_cred_dist(struct htc_endpoint_credit_dist *ep_dist)
@@ -175,9 +175,6 @@ void dump_cred_dist_stats(struct htc_target *target)
{
struct htc_endpoint_credit_dist *ep_list;
- if (!AR_DBG_LVL_CHECK(ATH6KL_DBG_CREDIT))
- return;
-
list_for_each_entry(ep_list, &target->cred_dist_list, list)
dump_cred_dist(ep_list);
diff --git a/drivers/net/wireless/ath/ath6kl/debug.h b/drivers/net/wireless/ath/ath6kl/debug.h
index e569c65..cb21d91 100644
--- a/drivers/net/wireless/ath/ath6kl/debug.h
+++ b/drivers/net/wireless/ath/ath6kl/debug.h
@@ -56,8 +56,6 @@ int ath6kl_printk(const char *level, const char *fmt, ...);
#define ath6kl_warn(fmt, ...) \
ath6kl_printk(KERN_WARNING, fmt, ##__VA_ARGS__)
-#define AR_DBG_LVL_CHECK(mask) (debug_mask & mask)
-
enum ath6kl_war {
ATH6KL_WAR_INVALID_RATE,
};
diff --git a/drivers/net/wireless/ath/ath6kl/hif.c b/drivers/net/wireless/ath/ath6kl/hif.c
index 0772ef6..3d26c14 100644
--- a/drivers/net/wireless/ath/ath6kl/hif.c
+++ b/drivers/net/wireless/ath/ath6kl/hif.c
@@ -429,9 +429,8 @@ static int proc_pending_irqs(struct ath6kl_device *dev, bool *done)
if (status)
goto out;
- if (AR_DBG_LVL_CHECK(ATH6KL_DBG_IRQ))
- ath6kl_dump_registers(dev, &dev->irq_proc_reg,
- &dev->irq_en_reg);
+ ath6kl_dump_registers(dev, &dev->irq_proc_reg,
+ &dev->irq_en_reg);
/* Update only those registers that are enabled */
host_int_status = dev->irq_proc_reg.host_int_status &
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c
index f6f2aa2..fbd886a 100644
--- a/drivers/net/wireless/ath/ath6kl/wmi.c
+++ b/drivers/net/wireless/ath/ath6kl/wmi.c
@@ -419,9 +419,6 @@ static int ath6kl_wmi_tx_complete_event_rx(u8 *datap, int len)
ath6kl_dbg(ATH6KL_DBG_WMI, "comp: %d %d %d\n",
evt->num_msg, evt->msg_len, evt->msg_type);
- if (!AR_DBG_LVL_CHECK(ATH6KL_DBG_WMI))
- return 0;
-
for (index = 0; index < evt->num_msg; index++) {
size = sizeof(struct wmi_tx_complete_event) +
(index * sizeof(struct tx_complete_msg_v1));
^ permalink raw reply related
* [PATCH v2 3/6] ath6kl: create core.c
From: Kalle Valo @ 2012-01-05 13:27 UTC (permalink / raw)
To: linville
Cc: sfr, netdev, linux-wireless, linux-kernel, linux-next,
ath6kl-devel, davem
In-Reply-To: <20120105132523.22281.95999.stgit@x201>
Currently core functions are spread between various files, group all
the functions into file and rename the functions to follow the style
used elsewhere in the driver. This will make it easier to a separate core
module.
Also fix a bug where wiphy is freed too early.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/Makefile | 2
drivers/net/wireless/ath/ath6kl/cfg80211.c | 94 ++-------
drivers/net/wireless/ath/ath6kl/cfg80211.h | 4
drivers/net/wireless/ath/ath6kl/common.h | 3
drivers/net/wireless/ath/ath6kl/core.c | 288 ++++++++++++++++++++++++++++
drivers/net/wireless/ath/ath6kl/core.h | 9 +
drivers/net/wireless/ath/ath6kl/init.c | 205 --------------------
drivers/net/wireless/ath/ath6kl/sdio.c | 4
drivers/net/wireless/ath/ath6kl/usb.c | 8 -
9 files changed, 333 insertions(+), 284 deletions(-)
create mode 100644 drivers/net/wireless/ath/ath6kl/core.c
diff --git a/drivers/net/wireless/ath/ath6kl/Makefile b/drivers/net/wireless/ath/ath6kl/Makefile
index e14cef9..9bb69a8 100644
--- a/drivers/net/wireless/ath/ath6kl/Makefile
+++ b/drivers/net/wireless/ath/ath6kl/Makefile
@@ -31,6 +31,7 @@ ath6kl_sdio-y += init.o
ath6kl_sdio-y += main.o
ath6kl_sdio-y += txrx.o
ath6kl_sdio-y += wmi.o
+ath6kl_sdio-y += core.o
ath6kl_sdio-y += sdio.o
ath6kl_sdio-$(CONFIG_NL80211_TESTMODE) += testmode.o
@@ -44,6 +45,7 @@ ath6kl_usb-y += init.o
ath6kl_usb-y += main.o
ath6kl_usb-y += txrx.o
ath6kl_usb-y += wmi.o
+ath6kl_usb-y += core.o
ath6kl_usb-y += usb.o
ath6kl_usb-$(CONFIG_NL80211_TESTMODE) += testmode.o
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 5f2c137..64043f8 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -22,10 +22,6 @@
#include "hif-ops.h"
#include "testmode.h"
-static unsigned int ath6kl_p2p;
-
-module_param(ath6kl_p2p, uint, 0644);
-
#define RATETAB_ENT(_rate, _rateid, _flags) { \
.bitrate = (_rate), \
.flags = (_flags), \
@@ -2629,68 +2625,6 @@ void ath6kl_cfg80211_stop_all(struct ath6kl *ar)
ath6kl_cfg80211_stop(vif);
}
-struct ath6kl *ath6kl_core_alloc(struct device *dev)
-{
- struct ath6kl *ar;
- struct wiphy *wiphy;
- u8 ctr;
-
- /* create a new wiphy for use with cfg80211 */
- wiphy = wiphy_new(&ath6kl_cfg80211_ops, sizeof(struct ath6kl));
-
- if (!wiphy) {
- ath6kl_err("couldn't allocate wiphy device\n");
- return NULL;
- }
-
- ar = wiphy_priv(wiphy);
- ar->p2p = !!ath6kl_p2p;
- ar->wiphy = wiphy;
- ar->dev = dev;
-
- ar->vif_max = 1;
-
- ar->max_norm_iface = 1;
-
- spin_lock_init(&ar->lock);
- spin_lock_init(&ar->mcastpsq_lock);
- spin_lock_init(&ar->list_lock);
-
- init_waitqueue_head(&ar->event_wq);
- sema_init(&ar->sem, 1);
-
- INIT_LIST_HEAD(&ar->amsdu_rx_buffer_queue);
- INIT_LIST_HEAD(&ar->vif_list);
-
- clear_bit(WMI_ENABLED, &ar->flag);
- clear_bit(SKIP_SCAN, &ar->flag);
- clear_bit(DESTROY_IN_PROGRESS, &ar->flag);
-
- ar->listen_intvl_t = A_DEFAULT_LISTEN_INTERVAL;
- ar->listen_intvl_b = 0;
- ar->tx_pwr = 0;
-
- ar->intra_bss = 1;
- ar->lrssi_roam_threshold = DEF_LRSSI_ROAM_THRESHOLD;
-
- ar->state = ATH6KL_STATE_OFF;
-
- memset((u8 *)ar->sta_list, 0,
- AP_MAX_NUM_STA * sizeof(struct ath6kl_sta));
-
- /* Init the PS queues */
- for (ctr = 0; ctr < AP_MAX_NUM_STA; ctr++) {
- spin_lock_init(&ar->sta_list[ctr].psq_lock);
- skb_queue_head_init(&ar->sta_list[ctr].psq);
- }
-
- skb_queue_head_init(&ar->mcastpsq);
-
- memcpy(ar->ap_country_code, DEF_AP_COUNTRY_CODE, 3);
-
- return ar;
-}
-
static int ath6kl_cfg80211_vif_init(struct ath6kl_vif *vif)
{
vif->aggr_cntxt = aggr_init(vif->ndev);
@@ -2838,10 +2772,30 @@ int ath6kl_cfg80211_init(struct ath6kl *ar)
void ath6kl_cfg80211_cleanup(struct ath6kl *ar)
{
wiphy_unregister(ar->wiphy);
+}
- /*
- * FIXME: should be removed as we remove wiphy in
- * ath6kl_core_free(). Most likely this causes a use after free.
- */
+struct ath6kl *ath6kl_cfg80211_create(void)
+{
+ struct ath6kl *ar;
+ struct wiphy *wiphy;
+
+ /* create a new wiphy for use with cfg80211 */
+ wiphy = wiphy_new(&ath6kl_cfg80211_ops, sizeof(struct ath6kl));
+
+ if (!wiphy) {
+ ath6kl_err("couldn't allocate wiphy device\n");
+ return NULL;
+ }
+
+ ar = wiphy_priv(wiphy);
+ ar->wiphy = wiphy;
+
+ return ar;
+}
+
+/* Note: ar variable must not be accessed after calling this! */
+void ath6kl_cfg80211_destroy(struct ath6kl *ar)
+{
wiphy_free(ar->wiphy);
}
+
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.h b/drivers/net/wireless/ath/ath6kl/cfg80211.h
index 08d9769..3c693b7 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.h
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.h
@@ -27,7 +27,6 @@ enum ath6kl_cfg_suspend_mode {
struct net_device *ath6kl_interface_add(struct ath6kl *ar, char *name,
enum nl80211_iftype type,
u8 fw_vif_idx, u8 nw_type);
-struct ath6kl *ath6kl_core_alloc(struct device *dev);
void ath6kl_cfg80211_scan_complete_event(struct ath6kl_vif *vif, bool aborted);
void ath6kl_cfg80211_connect_event(struct ath6kl_vif *vif, u16 channel,
@@ -58,4 +57,7 @@ void ath6kl_cfg80211_stop_all(struct ath6kl *ar);
int ath6kl_cfg80211_init(struct ath6kl *ar);
void ath6kl_cfg80211_cleanup(struct ath6kl *ar);
+struct ath6kl *ath6kl_cfg80211_create(void);
+void ath6kl_cfg80211_destroy(struct ath6kl *ar);
+
#endif /* ATH6KL_CFG80211_H */
diff --git a/drivers/net/wireless/ath/ath6kl/common.h b/drivers/net/wireless/ath/ath6kl/common.h
index bfd6597..f89f1e1 100644
--- a/drivers/net/wireless/ath/ath6kl/common.h
+++ b/drivers/net/wireless/ath/ath6kl/common.h
@@ -79,8 +79,5 @@ struct ath6kl;
enum htc_credit_dist_reason;
struct ath6kl_htc_credit_info;
-struct ath6kl *ath6kl_core_alloc(struct device *sdev);
-int ath6kl_core_init(struct ath6kl *ar);
-void ath6kl_core_cleanup(struct ath6kl *ar);
struct sk_buff *ath6kl_buf_alloc(int size);
#endif /* COMMON_H */
diff --git a/drivers/net/wireless/ath/ath6kl/core.c b/drivers/net/wireless/ath/ath6kl/core.c
new file mode 100644
index 0000000..7e3574e
--- /dev/null
+++ b/drivers/net/wireless/ath/ath6kl/core.c
@@ -0,0 +1,288 @@
+/*
+ * Copyright (c) 2004-2011 Atheros Communications Inc.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include "core.h"
+
+#include <linux/moduleparam.h>
+
+#include "debug.h"
+#include "hif-ops.h"
+#include "cfg80211.h"
+
+unsigned int debug_mask;
+static bool suspend_cutpower;
+static unsigned int uart_debug;
+static unsigned int ath6kl_p2p;
+
+module_param(debug_mask, uint, 0644);
+module_param(suspend_cutpower, bool, 0444);
+module_param(uart_debug, uint, 0644);
+module_param(ath6kl_p2p, uint, 0644);
+
+int ath6kl_core_init(struct ath6kl *ar)
+{
+ struct ath6kl_bmi_target_info targ_info;
+ struct net_device *ndev;
+ int ret = 0, i;
+
+ ar->ath6kl_wq = create_singlethread_workqueue("ath6kl");
+ if (!ar->ath6kl_wq)
+ return -ENOMEM;
+
+ ret = ath6kl_bmi_init(ar);
+ if (ret)
+ goto err_wq;
+
+ /*
+ * Turn on power to get hardware (target) version and leave power
+ * on delibrately as we will boot the hardware anyway within few
+ * seconds.
+ */
+ ret = ath6kl_hif_power_on(ar);
+ if (ret)
+ goto err_bmi_cleanup;
+
+ ret = ath6kl_bmi_get_target_info(ar, &targ_info);
+ if (ret)
+ goto err_power_off;
+
+ ar->version.target_ver = le32_to_cpu(targ_info.version);
+ ar->target_type = le32_to_cpu(targ_info.type);
+ ar->wiphy->hw_version = le32_to_cpu(targ_info.version);
+
+ ret = ath6kl_init_hw_params(ar);
+ if (ret)
+ goto err_power_off;
+
+ ar->htc_target = ath6kl_htc_create(ar);
+
+ if (!ar->htc_target) {
+ ret = -ENOMEM;
+ goto err_power_off;
+ }
+
+ ret = ath6kl_init_fetch_firmwares(ar);
+ if (ret)
+ goto err_htc_cleanup;
+
+ /* FIXME: we should free all firmwares in the error cases below */
+
+ /* Indicate that WMI is enabled (although not ready yet) */
+ set_bit(WMI_ENABLED, &ar->flag);
+ ar->wmi = ath6kl_wmi_init(ar);
+ if (!ar->wmi) {
+ ath6kl_err("failed to initialize wmi\n");
+ ret = -EIO;
+ goto err_htc_cleanup;
+ }
+
+ ath6kl_dbg(ATH6KL_DBG_TRC, "%s: got wmi @ 0x%p.\n", __func__, ar->wmi);
+
+ ret = ath6kl_cfg80211_init(ar);
+ if (ret)
+ goto err_node_cleanup;
+
+ ret = ath6kl_debug_init(ar);
+ if (ret) {
+ wiphy_unregister(ar->wiphy);
+ goto err_node_cleanup;
+ }
+
+ for (i = 0; i < ar->vif_max; i++)
+ ar->avail_idx_map |= BIT(i);
+
+ rtnl_lock();
+
+ /* Add an initial station interface */
+ ndev = ath6kl_interface_add(ar, "wlan%d", NL80211_IFTYPE_STATION, 0,
+ INFRA_NETWORK);
+
+ rtnl_unlock();
+
+ if (!ndev) {
+ ath6kl_err("Failed to instantiate a network device\n");
+ ret = -ENOMEM;
+ wiphy_unregister(ar->wiphy);
+ goto err_debug_init;
+ }
+
+
+ ath6kl_dbg(ATH6KL_DBG_TRC, "%s: name=%s dev=0x%p, ar=0x%p\n",
+ __func__, ndev->name, ndev, ar);
+
+ /* setup access class priority mappings */
+ ar->ac_stream_pri_map[WMM_AC_BK] = 0; /* lowest */
+ ar->ac_stream_pri_map[WMM_AC_BE] = 1;
+ ar->ac_stream_pri_map[WMM_AC_VI] = 2;
+ ar->ac_stream_pri_map[WMM_AC_VO] = 3; /* highest */
+
+ /* give our connected endpoints some buffers */
+ ath6kl_rx_refill(ar->htc_target, ar->ctrl_ep);
+ ath6kl_rx_refill(ar->htc_target, ar->ac2ep_map[WMM_AC_BE]);
+
+ /* allocate some buffers that handle larger AMSDU frames */
+ ath6kl_refill_amsdu_rxbufs(ar, ATH6KL_MAX_AMSDU_RX_BUFFERS);
+
+ ath6kl_cookie_init(ar);
+
+ ar->conf_flags = ATH6KL_CONF_IGNORE_ERP_BARKER |
+ ATH6KL_CONF_ENABLE_11N | ATH6KL_CONF_ENABLE_TX_BURST;
+
+ if (suspend_cutpower)
+ ar->conf_flags |= ATH6KL_CONF_SUSPEND_CUTPOWER;
+
+ ar->wiphy->flags |= WIPHY_FLAG_SUPPORTS_FW_ROAM |
+ WIPHY_FLAG_HAVE_AP_SME |
+ WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL |
+ WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD;
+
+ if (test_bit(ATH6KL_FW_CAPABILITY_SCHED_SCAN, ar->fw_capabilities))
+ ar->wiphy->flags |= WIPHY_FLAG_SUPPORTS_SCHED_SCAN;
+
+ ar->wiphy->probe_resp_offload =
+ NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS |
+ NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS2 |
+ NL80211_PROBE_RESP_OFFLOAD_SUPPORT_P2P |
+ NL80211_PROBE_RESP_OFFLOAD_SUPPORT_80211U;
+
+ set_bit(FIRST_BOOT, &ar->flag);
+
+ ret = ath6kl_init_hw_start(ar);
+ if (ret) {
+ ath6kl_err("Failed to start hardware: %d\n", ret);
+ goto err_rxbuf_cleanup;
+ }
+
+ /*
+ * Set mac address which is received in ready event
+ * FIXME: Move to ath6kl_interface_add()
+ */
+ memcpy(ndev->dev_addr, ar->mac_addr, ETH_ALEN);
+
+ return ret;
+
+err_rxbuf_cleanup:
+ ath6kl_htc_flush_rx_buf(ar->htc_target);
+ ath6kl_cleanup_amsdu_rxbufs(ar);
+ rtnl_lock();
+ ath6kl_cfg80211_vif_cleanup(netdev_priv(ndev));
+ rtnl_unlock();
+ wiphy_unregister(ar->wiphy);
+err_debug_init:
+ ath6kl_debug_cleanup(ar);
+err_node_cleanup:
+ ath6kl_wmi_shutdown(ar->wmi);
+ clear_bit(WMI_ENABLED, &ar->flag);
+ ar->wmi = NULL;
+err_htc_cleanup:
+ ath6kl_htc_cleanup(ar->htc_target);
+err_power_off:
+ ath6kl_hif_power_off(ar);
+err_bmi_cleanup:
+ ath6kl_bmi_cleanup(ar);
+err_wq:
+ destroy_workqueue(ar->ath6kl_wq);
+
+ return ret;
+}
+
+struct ath6kl *ath6kl_core_create(struct device *dev)
+{
+ struct ath6kl *ar;
+ u8 ctr;
+
+ ar = ath6kl_cfg80211_create();
+
+ if (!ar)
+ return NULL;
+
+ ar->p2p = !!ath6kl_p2p;
+ ar->dev = dev;
+
+ ar->vif_max = 1;
+
+ ar->max_norm_iface = 1;
+
+ spin_lock_init(&ar->lock);
+ spin_lock_init(&ar->mcastpsq_lock);
+ spin_lock_init(&ar->list_lock);
+
+ init_waitqueue_head(&ar->event_wq);
+ sema_init(&ar->sem, 1);
+
+ INIT_LIST_HEAD(&ar->amsdu_rx_buffer_queue);
+ INIT_LIST_HEAD(&ar->vif_list);
+
+ clear_bit(WMI_ENABLED, &ar->flag);
+ clear_bit(SKIP_SCAN, &ar->flag);
+ clear_bit(DESTROY_IN_PROGRESS, &ar->flag);
+
+ ar->listen_intvl_t = A_DEFAULT_LISTEN_INTERVAL;
+ ar->listen_intvl_b = 0;
+ ar->tx_pwr = 0;
+
+ ar->intra_bss = 1;
+ ar->lrssi_roam_threshold = DEF_LRSSI_ROAM_THRESHOLD;
+
+ ar->state = ATH6KL_STATE_OFF;
+
+ memset((u8 *)ar->sta_list, 0,
+ AP_MAX_NUM_STA * sizeof(struct ath6kl_sta));
+
+ /* Init the PS queues */
+ for (ctr = 0; ctr < AP_MAX_NUM_STA; ctr++) {
+ spin_lock_init(&ar->sta_list[ctr].psq_lock);
+ skb_queue_head_init(&ar->sta_list[ctr].psq);
+ }
+
+ skb_queue_head_init(&ar->mcastpsq);
+
+ memcpy(ar->ap_country_code, DEF_AP_COUNTRY_CODE, 3);
+
+ return ar;
+}
+
+void ath6kl_core_cleanup(struct ath6kl *ar)
+{
+ ath6kl_hif_power_off(ar);
+
+ destroy_workqueue(ar->ath6kl_wq);
+
+ if (ar->htc_target)
+ ath6kl_htc_cleanup(ar->htc_target);
+
+ ath6kl_cookie_cleanup(ar);
+
+ ath6kl_cleanup_amsdu_rxbufs(ar);
+
+ ath6kl_bmi_cleanup(ar);
+
+ ath6kl_debug_cleanup(ar);
+
+ kfree(ar->fw_board);
+ kfree(ar->fw_otp);
+ kfree(ar->fw);
+ kfree(ar->fw_patch);
+
+ ath6kl_cfg80211_cleanup(ar);
+ ath6kl_cfg80211_destroy(ar);
+}
+
+void ath6kl_core_destroy(struct ath6kl *ar)
+{
+ ath6kl_cfg80211_destroy(ar);
+}
+
diff --git a/drivers/net/wireless/ath/ath6kl/core.h b/drivers/net/wireless/ath/ath6kl/core.h
index 93d05c0..5415358 100644
--- a/drivers/net/wireless/ath/ath6kl/core.h
+++ b/drivers/net/wireless/ath/ath6kl/core.h
@@ -723,11 +723,18 @@ void ath6kl_wakeup_event(void *dev);
void ath6kl_reset_device(struct ath6kl *ar, u32 target_type,
bool wait_fot_compltn, bool cold_reset);
void ath6kl_init_control_info(struct ath6kl_vif *vif);
-void ath6kl_core_free(struct ath6kl *ar);
struct ath6kl_vif *ath6kl_vif_first(struct ath6kl *ar);
void ath6kl_cleanup_vif(struct ath6kl_vif *vif, bool wmi_ready);
int ath6kl_init_hw_start(struct ath6kl *ar);
int ath6kl_init_hw_stop(struct ath6kl *ar);
+int ath6kl_init_fetch_firmwares(struct ath6kl *ar);
+int ath6kl_init_hw_params(struct ath6kl *ar);
+
void ath6kl_check_wow_status(struct ath6kl *ar);
+struct ath6kl *ath6kl_core_create(struct device *dev);
+int ath6kl_core_init(struct ath6kl *ar);
+void ath6kl_core_cleanup(struct ath6kl *ar);
+void ath6kl_core_destroy(struct ath6kl *ar);
+
#endif /* CORE_H */
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
index 32bd111..5a92307 100644
--- a/drivers/net/wireless/ath/ath6kl/init.c
+++ b/drivers/net/wireless/ath/ath6kl/init.c
@@ -25,13 +25,9 @@
#include "debug.h"
#include "hif-ops.h"
-unsigned int debug_mask;
static unsigned int testmode;
-static bool suspend_cutpower;
-module_param(debug_mask, uint, 0644);
module_param(testmode, uint, 0644);
-module_param(suspend_cutpower, bool, 0444);
static const struct ath6kl_hw hw_list[] = {
{
@@ -573,36 +569,6 @@ int ath6kl_configure_target(struct ath6kl *ar)
return 0;
}
-void ath6kl_core_free(struct ath6kl *ar)
-{
- wiphy_free(ar->wiphy);
-}
-
-void ath6kl_core_cleanup(struct ath6kl *ar)
-{
- ath6kl_hif_power_off(ar);
-
- destroy_workqueue(ar->ath6kl_wq);
-
- if (ar->htc_target)
- ath6kl_htc_cleanup(ar->htc_target);
-
- ath6kl_cookie_cleanup(ar);
-
- ath6kl_cleanup_amsdu_rxbufs(ar);
-
- ath6kl_bmi_cleanup(ar);
-
- ath6kl_debug_cleanup(ar);
-
- kfree(ar->fw_board);
- kfree(ar->fw_otp);
- kfree(ar->fw);
- kfree(ar->fw_patch);
-
- ath6kl_cfg80211_cleanup(ar);
-}
-
/* firmware upload */
static int ath6kl_get_fw(struct ath6kl *ar, const char *filename,
u8 **fw, size_t *fw_len)
@@ -1010,7 +976,7 @@ out:
return ret;
}
-static int ath6kl_fetch_firmwares(struct ath6kl *ar)
+int ath6kl_init_fetch_firmwares(struct ath6kl *ar)
{
int ret;
@@ -1372,7 +1338,7 @@ static int ath6kl_init_upload(struct ath6kl *ar)
return status;
}
-static int ath6kl_init_hw_params(struct ath6kl *ar)
+int ath6kl_init_hw_params(struct ath6kl *ar)
{
const struct ath6kl_hw *hw;
int i;
@@ -1549,173 +1515,6 @@ int ath6kl_init_hw_stop(struct ath6kl *ar)
return 0;
}
-int ath6kl_core_init(struct ath6kl *ar)
-{
- struct ath6kl_bmi_target_info targ_info;
- struct net_device *ndev;
- int ret = 0, i;
-
- ar->ath6kl_wq = create_singlethread_workqueue("ath6kl");
- if (!ar->ath6kl_wq)
- return -ENOMEM;
-
- ret = ath6kl_bmi_init(ar);
- if (ret)
- goto err_wq;
-
- /*
- * Turn on power to get hardware (target) version and leave power
- * on delibrately as we will boot the hardware anyway within few
- * seconds.
- */
- ret = ath6kl_hif_power_on(ar);
- if (ret)
- goto err_bmi_cleanup;
-
- ret = ath6kl_bmi_get_target_info(ar, &targ_info);
- if (ret)
- goto err_power_off;
-
- ar->version.target_ver = le32_to_cpu(targ_info.version);
- ar->target_type = le32_to_cpu(targ_info.type);
- ar->wiphy->hw_version = le32_to_cpu(targ_info.version);
-
- ret = ath6kl_init_hw_params(ar);
- if (ret)
- goto err_power_off;
-
- ar->htc_target = ath6kl_htc_create(ar);
-
- if (!ar->htc_target) {
- ret = -ENOMEM;
- goto err_power_off;
- }
-
- ret = ath6kl_fetch_firmwares(ar);
- if (ret)
- goto err_htc_cleanup;
-
- /* FIXME: we should free all firmwares in the error cases below */
-
- /* Indicate that WMI is enabled (although not ready yet) */
- set_bit(WMI_ENABLED, &ar->flag);
- ar->wmi = ath6kl_wmi_init(ar);
- if (!ar->wmi) {
- ath6kl_err("failed to initialize wmi\n");
- ret = -EIO;
- goto err_htc_cleanup;
- }
-
- ath6kl_dbg(ATH6KL_DBG_TRC, "%s: got wmi @ 0x%p.\n", __func__, ar->wmi);
-
- ret = ath6kl_cfg80211_init(ar);
- if (ret)
- goto err_node_cleanup;
-
- ret = ath6kl_debug_init(ar);
- if (ret) {
- wiphy_unregister(ar->wiphy);
- goto err_node_cleanup;
- }
-
- for (i = 0; i < ar->vif_max; i++)
- ar->avail_idx_map |= BIT(i);
-
- rtnl_lock();
-
- /* Add an initial station interface */
- ndev = ath6kl_interface_add(ar, "wlan%d", NL80211_IFTYPE_STATION, 0,
- INFRA_NETWORK);
-
- rtnl_unlock();
-
- if (!ndev) {
- ath6kl_err("Failed to instantiate a network device\n");
- ret = -ENOMEM;
- wiphy_unregister(ar->wiphy);
- goto err_debug_init;
- }
-
-
- ath6kl_dbg(ATH6KL_DBG_TRC, "%s: name=%s dev=0x%p, ar=0x%p\n",
- __func__, ndev->name, ndev, ar);
-
- /* setup access class priority mappings */
- ar->ac_stream_pri_map[WMM_AC_BK] = 0; /* lowest */
- ar->ac_stream_pri_map[WMM_AC_BE] = 1;
- ar->ac_stream_pri_map[WMM_AC_VI] = 2;
- ar->ac_stream_pri_map[WMM_AC_VO] = 3; /* highest */
-
- /* give our connected endpoints some buffers */
- ath6kl_rx_refill(ar->htc_target, ar->ctrl_ep);
- ath6kl_rx_refill(ar->htc_target, ar->ac2ep_map[WMM_AC_BE]);
-
- /* allocate some buffers that handle larger AMSDU frames */
- ath6kl_refill_amsdu_rxbufs(ar, ATH6KL_MAX_AMSDU_RX_BUFFERS);
-
- ath6kl_cookie_init(ar);
-
- ar->conf_flags = ATH6KL_CONF_IGNORE_ERP_BARKER |
- ATH6KL_CONF_ENABLE_11N | ATH6KL_CONF_ENABLE_TX_BURST;
-
- if (suspend_cutpower)
- ar->conf_flags |= ATH6KL_CONF_SUSPEND_CUTPOWER;
-
- ar->wiphy->flags |= WIPHY_FLAG_SUPPORTS_FW_ROAM |
- WIPHY_FLAG_HAVE_AP_SME |
- WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL |
- WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD;
-
- if (test_bit(ATH6KL_FW_CAPABILITY_SCHED_SCAN, ar->fw_capabilities))
- ar->wiphy->flags |= WIPHY_FLAG_SUPPORTS_SCHED_SCAN;
-
- ar->wiphy->probe_resp_offload =
- NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS |
- NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS2 |
- NL80211_PROBE_RESP_OFFLOAD_SUPPORT_P2P |
- NL80211_PROBE_RESP_OFFLOAD_SUPPORT_80211U;
-
- set_bit(FIRST_BOOT, &ar->flag);
-
- ret = ath6kl_init_hw_start(ar);
- if (ret) {
- ath6kl_err("Failed to start hardware: %d\n", ret);
- goto err_rxbuf_cleanup;
- }
-
- /*
- * Set mac address which is received in ready event
- * FIXME: Move to ath6kl_interface_add()
- */
- memcpy(ndev->dev_addr, ar->mac_addr, ETH_ALEN);
-
- return ret;
-
-err_rxbuf_cleanup:
- ath6kl_htc_flush_rx_buf(ar->htc_target);
- ath6kl_cleanup_amsdu_rxbufs(ar);
- rtnl_lock();
- ath6kl_cfg80211_vif_cleanup(netdev_priv(ndev));
- rtnl_unlock();
- wiphy_unregister(ar->wiphy);
-err_debug_init:
- ath6kl_debug_cleanup(ar);
-err_node_cleanup:
- ath6kl_wmi_shutdown(ar->wmi);
- clear_bit(WMI_ENABLED, &ar->flag);
- ar->wmi = NULL;
-err_htc_cleanup:
- ath6kl_htc_cleanup(ar->htc_target);
-err_power_off:
- ath6kl_hif_power_off(ar);
-err_bmi_cleanup:
- ath6kl_bmi_cleanup(ar);
-err_wq:
- destroy_workqueue(ar->ath6kl_wq);
-
- return ret;
-}
-
/* FIXME: move this to cfg80211.c and rename to ath6kl_cfg80211_vif_stop() */
void ath6kl_cleanup_vif(struct ath6kl_vif *vif, bool wmi_ready)
{
diff --git a/drivers/net/wireless/ath/ath6kl/sdio.c b/drivers/net/wireless/ath/ath6kl/sdio.c
index 15c3f56..08d2db4 100644
--- a/drivers/net/wireless/ath/ath6kl/sdio.c
+++ b/drivers/net/wireless/ath/ath6kl/sdio.c
@@ -1263,7 +1263,7 @@ static int ath6kl_sdio_probe(struct sdio_func *func,
for (count = 0; count < BUS_REQUEST_MAX_NUM; count++)
ath6kl_sdio_free_bus_req(ar_sdio, &ar_sdio->bus_req[count]);
- ar = ath6kl_core_alloc(&ar_sdio->func->dev);
+ ar = ath6kl_core_create(&ar_sdio->func->dev);
if (!ar) {
ath6kl_err("Failed to alloc ath6kl core\n");
ret = -ENOMEM;
@@ -1293,7 +1293,7 @@ static int ath6kl_sdio_probe(struct sdio_func *func,
return ret;
err_core_alloc:
- ath6kl_core_free(ar_sdio->ar);
+ ath6kl_core_destroy(ar_sdio->ar);
err_dma:
kfree(ar_sdio->dma_buffer);
err_hif:
diff --git a/drivers/net/wireless/ath/ath6kl/usb.c b/drivers/net/wireless/ath/ath6kl/usb.c
index e3cf397..38ac253 100644
--- a/drivers/net/wireless/ath/ath6kl/usb.c
+++ b/drivers/net/wireless/ath/ath6kl/usb.c
@@ -352,7 +352,7 @@ static int ath6kl_usb_probe(struct usb_interface *interface,
goto err_usb_put;
}
- ar = ath6kl_core_alloc(&ar_usb->udev->dev);
+ ar = ath6kl_core_create(&ar_usb->udev->dev);
if (ar == NULL) {
ath6kl_err("Failed to alloc ath6kl core\n");
ret = -ENOMEM;
@@ -370,13 +370,13 @@ static int ath6kl_usb_probe(struct usb_interface *interface,
ret = ath6kl_core_init(ar);
if (ret) {
ath6kl_err("Failed to init ath6kl core: %d\n", ret);
- goto err_core_free;
+ goto err_core_destroy;
}
return ret;
-err_core_free:
- ath6kl_core_free(ar);
+err_core_destroy:
+ ath6kl_core_destroy(ar);
err_usb_destroy:
ath6kl_usb_destroy(ar_usb);
err_usb_put:
^ permalink raw reply related
* [PATCH v2 2/6] ath6kl: unify cfg80211 init/cleanup functions
From: Kalle Valo @ 2012-01-05 13:26 UTC (permalink / raw)
To: linville
Cc: sfr, netdev, linux-wireless, linux-kernel, linux-next,
ath6kl-devel, davem
In-Reply-To: <20120105132523.22281.95999.stgit@x201>
Group them together and change the naming to follow the common style in
ath6kl. No functional changes.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/cfg80211.c | 109 +++++++++++++++-------------
drivers/net/wireless/ath/ath6kl/cfg80211.h | 6 +-
drivers/net/wireless/ath/ath6kl/init.c | 4 +
3 files changed, 62 insertions(+), 57 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index cd67cb6..5f2c137 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -2691,57 +2691,6 @@ struct ath6kl *ath6kl_core_alloc(struct device *dev)
return ar;
}
-int ath6kl_register_ieee80211_hw(struct ath6kl *ar)
-{
- struct wiphy *wiphy = ar->wiphy;
- int ret;
-
- wiphy->mgmt_stypes = ath6kl_mgmt_stypes;
-
- wiphy->max_remain_on_channel_duration = 5000;
-
- /* set device pointer for wiphy */
- set_wiphy_dev(wiphy, ar->dev);
-
- wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
- BIT(NL80211_IFTYPE_ADHOC) |
- BIT(NL80211_IFTYPE_AP);
- if (ar->p2p) {
- wiphy->interface_modes |= BIT(NL80211_IFTYPE_P2P_GO) |
- BIT(NL80211_IFTYPE_P2P_CLIENT);
- }
-
- /* max num of ssids that can be probed during scanning */
- wiphy->max_scan_ssids = MAX_PROBED_SSID_INDEX;
- wiphy->max_scan_ie_len = 1000; /* FIX: what is correct limit? */
- wiphy->bands[IEEE80211_BAND_2GHZ] = &ath6kl_band_2ghz;
- wiphy->bands[IEEE80211_BAND_5GHZ] = &ath6kl_band_5ghz;
- wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM;
-
- wiphy->cipher_suites = cipher_suites;
- wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites);
-
- wiphy->wowlan.flags = WIPHY_WOWLAN_MAGIC_PKT |
- WIPHY_WOWLAN_DISCONNECT |
- WIPHY_WOWLAN_GTK_REKEY_FAILURE |
- WIPHY_WOWLAN_SUPPORTS_GTK_REKEY |
- WIPHY_WOWLAN_EAP_IDENTITY_REQ |
- WIPHY_WOWLAN_4WAY_HANDSHAKE;
- wiphy->wowlan.n_patterns = WOW_MAX_FILTERS_PER_LIST;
- wiphy->wowlan.pattern_min_len = 1;
- wiphy->wowlan.pattern_max_len = WOW_PATTERN_SIZE;
-
- wiphy->max_sched_scan_ssids = 10;
-
- ret = wiphy_register(wiphy);
- if (ret < 0) {
- ath6kl_err("couldn't register wiphy device\n");
- return ret;
- }
-
- return 0;
-}
-
static int ath6kl_cfg80211_vif_init(struct ath6kl_vif *vif)
{
vif->aggr_cntxt = aggr_init(vif->ndev);
@@ -2835,8 +2784,64 @@ err:
return NULL;
}
-void ath6kl_deinit_ieee80211_hw(struct ath6kl *ar)
+int ath6kl_cfg80211_init(struct ath6kl *ar)
+{
+ struct wiphy *wiphy = ar->wiphy;
+ int ret;
+
+ wiphy->mgmt_stypes = ath6kl_mgmt_stypes;
+
+ wiphy->max_remain_on_channel_duration = 5000;
+
+ /* set device pointer for wiphy */
+ set_wiphy_dev(wiphy, ar->dev);
+
+ wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
+ BIT(NL80211_IFTYPE_ADHOC) |
+ BIT(NL80211_IFTYPE_AP);
+ if (ar->p2p) {
+ wiphy->interface_modes |= BIT(NL80211_IFTYPE_P2P_GO) |
+ BIT(NL80211_IFTYPE_P2P_CLIENT);
+ }
+
+ /* max num of ssids that can be probed during scanning */
+ wiphy->max_scan_ssids = MAX_PROBED_SSID_INDEX;
+ wiphy->max_scan_ie_len = 1000; /* FIX: what is correct limit? */
+ wiphy->bands[IEEE80211_BAND_2GHZ] = &ath6kl_band_2ghz;
+ wiphy->bands[IEEE80211_BAND_5GHZ] = &ath6kl_band_5ghz;
+ wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM;
+
+ wiphy->cipher_suites = cipher_suites;
+ wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites);
+
+ wiphy->wowlan.flags = WIPHY_WOWLAN_MAGIC_PKT |
+ WIPHY_WOWLAN_DISCONNECT |
+ WIPHY_WOWLAN_GTK_REKEY_FAILURE |
+ WIPHY_WOWLAN_SUPPORTS_GTK_REKEY |
+ WIPHY_WOWLAN_EAP_IDENTITY_REQ |
+ WIPHY_WOWLAN_4WAY_HANDSHAKE;
+ wiphy->wowlan.n_patterns = WOW_MAX_FILTERS_PER_LIST;
+ wiphy->wowlan.pattern_min_len = 1;
+ wiphy->wowlan.pattern_max_len = WOW_PATTERN_SIZE;
+
+ wiphy->max_sched_scan_ssids = 10;
+
+ ret = wiphy_register(wiphy);
+ if (ret < 0) {
+ ath6kl_err("couldn't register wiphy device\n");
+ return ret;
+ }
+
+ return 0;
+}
+
+void ath6kl_cfg80211_cleanup(struct ath6kl *ar)
{
wiphy_unregister(ar->wiphy);
+
+ /*
+ * FIXME: should be removed as we remove wiphy in
+ * ath6kl_core_free(). Most likely this causes a use after free.
+ */
wiphy_free(ar->wiphy);
}
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.h b/drivers/net/wireless/ath/ath6kl/cfg80211.h
index aa96169..08d9769 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.h
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.h
@@ -27,10 +27,7 @@ enum ath6kl_cfg_suspend_mode {
struct net_device *ath6kl_interface_add(struct ath6kl *ar, char *name,
enum nl80211_iftype type,
u8 fw_vif_idx, u8 nw_type);
-int ath6kl_register_ieee80211_hw(struct ath6kl *ar);
struct ath6kl *ath6kl_core_alloc(struct device *dev);
-void ath6kl_deinit_ieee80211_hw(struct ath6kl *ar);
-
void ath6kl_cfg80211_scan_complete_event(struct ath6kl_vif *vif, bool aborted);
void ath6kl_cfg80211_connect_event(struct ath6kl_vif *vif, u16 channel,
@@ -58,4 +55,7 @@ void ath6kl_cfg80211_vif_cleanup(struct ath6kl_vif *vif);
void ath6kl_cfg80211_stop(struct ath6kl_vif *vif);
void ath6kl_cfg80211_stop_all(struct ath6kl *ar);
+int ath6kl_cfg80211_init(struct ath6kl *ar);
+void ath6kl_cfg80211_cleanup(struct ath6kl *ar);
+
#endif /* ATH6KL_CFG80211_H */
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
index ffe6254..32bd111 100644
--- a/drivers/net/wireless/ath/ath6kl/init.c
+++ b/drivers/net/wireless/ath/ath6kl/init.c
@@ -600,7 +600,7 @@ void ath6kl_core_cleanup(struct ath6kl *ar)
kfree(ar->fw);
kfree(ar->fw_patch);
- ath6kl_deinit_ieee80211_hw(ar);
+ ath6kl_cfg80211_cleanup(ar);
}
/* firmware upload */
@@ -1608,7 +1608,7 @@ int ath6kl_core_init(struct ath6kl *ar)
ath6kl_dbg(ATH6KL_DBG_TRC, "%s: got wmi @ 0x%p.\n", __func__, ar->wmi);
- ret = ath6kl_register_ieee80211_hw(ar);
+ ret = ath6kl_cfg80211_init(ar);
if (ret)
goto err_node_cleanup;
^ permalink raw reply related
* [PATCH v2 1/6] ath6kl: rename vif init and cleanup functions
From: Kalle Valo @ 2012-01-05 13:26 UTC (permalink / raw)
To: linville
Cc: sfr, netdev, linux-wireless, linux-kernel, linux-next,
ath6kl-devel, davem
In-Reply-To: <20120105132523.22281.95999.stgit@x201>
ath6kl_cfg80211_vif_init/cleanup() follow more closely the style used
elsewhere in ath6kl.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath6kl/cfg80211.c | 9 ++++-----
drivers/net/wireless/ath/ath6kl/cfg80211.h | 2 ++
drivers/net/wireless/ath/ath6kl/core.h | 1 -
drivers/net/wireless/ath/ath6kl/init.c | 5 +++--
4 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 6c59a21..cd67cb6 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -1403,7 +1403,7 @@ static int ath6kl_cfg80211_del_iface(struct wiphy *wiphy,
ath6kl_cleanup_vif(vif, test_bit(WMI_READY, &ar->flag));
- ath6kl_deinit_if_data(vif);
+ ath6kl_cfg80211_vif_cleanup(vif);
return 0;
}
@@ -2742,7 +2742,7 @@ int ath6kl_register_ieee80211_hw(struct ath6kl *ar)
return 0;
}
-static int ath6kl_init_if_data(struct ath6kl_vif *vif)
+static int ath6kl_cfg80211_vif_init(struct ath6kl_vif *vif)
{
vif->aggr_cntxt = aggr_init(vif->ndev);
if (!vif->aggr_cntxt) {
@@ -2761,7 +2761,7 @@ static int ath6kl_init_if_data(struct ath6kl_vif *vif)
return 0;
}
-void ath6kl_deinit_if_data(struct ath6kl_vif *vif)
+void ath6kl_cfg80211_vif_cleanup(struct ath6kl_vif *vif)
{
struct ath6kl *ar = vif->ar;
@@ -2808,8 +2808,7 @@ struct net_device *ath6kl_interface_add(struct ath6kl *ar, char *name,
ath6kl_init_control_info(vif);
- /* TODO: Pass interface specific pointer instead of ar */
- if (ath6kl_init_if_data(vif))
+ if (ath6kl_cfg80211_vif_init(vif))
goto err;
if (register_netdevice(ndev))
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.h b/drivers/net/wireless/ath/ath6kl/cfg80211.h
index 81f20a5..aa96169 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.h
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.h
@@ -53,6 +53,8 @@ int ath6kl_cfg80211_suspend(struct ath6kl *ar,
int ath6kl_cfg80211_resume(struct ath6kl *ar);
+void ath6kl_cfg80211_vif_cleanup(struct ath6kl_vif *vif);
+
void ath6kl_cfg80211_stop(struct ath6kl_vif *vif);
void ath6kl_cfg80211_stop_all(struct ath6kl *ar);
diff --git a/drivers/net/wireless/ath/ath6kl/core.h b/drivers/net/wireless/ath/ath6kl/core.h
index c863a28..93d05c0 100644
--- a/drivers/net/wireless/ath/ath6kl/core.h
+++ b/drivers/net/wireless/ath/ath6kl/core.h
@@ -723,7 +723,6 @@ void ath6kl_wakeup_event(void *dev);
void ath6kl_reset_device(struct ath6kl *ar, u32 target_type,
bool wait_fot_compltn, bool cold_reset);
void ath6kl_init_control_info(struct ath6kl_vif *vif);
-void ath6kl_deinit_if_data(struct ath6kl_vif *vif);
void ath6kl_core_free(struct ath6kl *ar);
struct ath6kl_vif *ath6kl_vif_first(struct ath6kl *ar);
void ath6kl_cleanup_vif(struct ath6kl_vif *vif, bool wmi_ready);
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
index 368ecbd..ffe6254 100644
--- a/drivers/net/wireless/ath/ath6kl/init.c
+++ b/drivers/net/wireless/ath/ath6kl/init.c
@@ -1695,7 +1695,7 @@ err_rxbuf_cleanup:
ath6kl_htc_flush_rx_buf(ar->htc_target);
ath6kl_cleanup_amsdu_rxbufs(ar);
rtnl_lock();
- ath6kl_deinit_if_data(netdev_priv(ndev));
+ ath6kl_cfg80211_vif_cleanup(netdev_priv(ndev));
rtnl_unlock();
wiphy_unregister(ar->wiphy);
err_debug_init:
@@ -1716,6 +1716,7 @@ err_wq:
return ret;
}
+/* FIXME: move this to cfg80211.c and rename to ath6kl_cfg80211_vif_stop() */
void ath6kl_cleanup_vif(struct ath6kl_vif *vif, bool wmi_ready)
{
static u8 bcast_mac[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
@@ -1761,7 +1762,7 @@ void ath6kl_stop_txrx(struct ath6kl *ar)
spin_unlock_bh(&ar->list_lock);
ath6kl_cleanup_vif(vif, test_bit(WMI_READY, &ar->flag));
rtnl_lock();
- ath6kl_deinit_if_data(vif);
+ ath6kl_cfg80211_vif_cleanup(vif);
rtnl_unlock();
spin_lock_bh(&ar->list_lock);
}
^ permalink raw reply related
* [PATCH v2 0/6] ath6kl: create ath6kl_core.ko
From: Kalle Valo @ 2012-01-05 13:25 UTC (permalink / raw)
To: linville
Cc: sfr, netdev, linux-wireless, linux-kernel, linux-next,
ath6kl-devel, davem
Here's the patchset to fix the allyesconfig build breakage. The fix is to
create a separate module ath6kl_core.ko which both ath6kl_sdio.ko and
ath6kl_usb.ko use.
v2:
o fix ath6kl_dbg() to use va_format correctly (thanks to joe)
o improved commit log in patch 4
---
Kalle Valo (6):
ath6kl: rename vif init and cleanup functions
ath6kl: unify cfg80211 init/cleanup functions
ath6kl: create core.c
ath6kl: get rid of AR_DBG_LVL_CHECK()
ath6kl: convert ath6kl_dbg() and ath6kl_dbg_dump() into functions
ath6kl: create ath6kl_core.ko
drivers/net/wireless/ath/ath6kl/Makefile | 35 +--
drivers/net/wireless/ath/ath6kl/cfg80211.c | 207 ++++++++------------
drivers/net/wireless/ath/ath6kl/cfg80211.h | 12 +
drivers/net/wireless/ath/ath6kl/common.h | 3
drivers/net/wireless/ath/ath6kl/core.c | 297 ++++++++++++++++++++++++++++
drivers/net/wireless/ath/ath6kl/core.h | 10 +
drivers/net/wireless/ath/ath6kl/debug.c | 68 +++++-
drivers/net/wireless/ath/ath6kl/debug.h | 27 ---
drivers/net/wireless/ath/ath6kl/hif.c | 10 +
drivers/net/wireless/ath/ath6kl/init.c | 211 +-------------------
drivers/net/wireless/ath/ath6kl/sdio.c | 4
drivers/net/wireless/ath/ath6kl/usb.c | 8 -
drivers/net/wireless/ath/ath6kl/wmi.c | 3
13 files changed, 484 insertions(+), 411 deletions(-)
create mode 100644 drivers/net/wireless/ath/ath6kl/core.c
^ permalink raw reply
* Re: linux-next: build warning after merge of the vfs tree
From: Jan Kara @ 2012-01-05 11:34 UTC (permalink / raw)
To: Al Viro
Cc: Stephen Rothwell, linux-next, linux-kernel, Jan Kara,
reiserfs-devel
In-Reply-To: <20120105081418.GI23916@ZenIV.linux.org.uk>
On Thu 05-01-12 08:14:18, Al Viro wrote:
> On Thu, Jan 05, 2012 at 08:06:57AM +0000, Al Viro wrote:
> > On Thu, Jan 05, 2012 at 05:35:21PM +1100, Stephen Rothwell wrote:
> > > Hi Al,
> > >
> > > After merging the vfs tree, today's linux-next build (powerpc
> > > ppc64_defconfig) produced this warning:
> > >
> > > fs/reiserfs/super.c:701:2: warning: initialization from incompatible pointer type [enabled by default]
> > > fs/reiserfs/super.c:701:2: warning: (near initialization for 'reiserfs_sops.show_options') [enabled by default]
> > >
> > > Caused by commit 2ddeb2a58b11 ("vfs: switch ->show_options() to struct
> > > dentry *") interacting with commit f1823b7b87d1 ("reiserfs: Properly
> > > display mount options in /proc/mounts") from the ext3. This needs some
> > > merge fix ... (and will probably currently cause crashes :-()
> >
> > Grrr... Same as changes in the first commit, done to the function introduced
> > by the second (i.e. replace mnt->mnt_sb with dentry->d_sb). Incidentally,
> > what are reiserfs patches doing in ext3 tree, of all places?
>
> FWIW, an updated variant of Jan's patch would be this (on top of
> vfs.git#for-next; I can pull his commit there in such form):
Thanks. I'm removing the old version of the patch from my tree so please
carry the new version in your tree. I was just carrying the patch because
of lack of reiserfs maintainer and because I originally wrote the patch to
accommodate needs of quota tools...
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
^ permalink raw reply
* RE: [PATCH 5/6] ath6kl: convert ath6kl_dbg() and ath6kl_dbg_dump() into functions
From: David Laight @ 2012-01-05 10:41 UTC (permalink / raw)
To: Joe Perches, Kalle Valo
Cc: linville, sfr, netdev, linux-wireless, linux-kernel, linux-next,
ath6kl-devel, davem
In-Reply-To: <1325720472.4116.7.camel@joe2Laptop>
> > + va_start(args, fmt);
> > + ath6kl_printk(KERN_DEBUG, fmt, &args);
>
> Passing a va_list as an argument?
> I believe this doesn't work.
> I think you'll need to add and use:
Passing a va_list certainly does work - vprintf() etc.
What is problematical is taking the address of a va_list.
The likely problem is a 'levels of indirection' one
because, when va_list needs to be a struct (very
likely when arguments are passed in registers),
it is often declared as as array type.
David
^ permalink raw reply
* Re: [PATCH 4/6] ath6kl: get rid of AR_DBG_LVL_CHECK()
From: Kalle Valo @ 2012-01-05 8:57 UTC (permalink / raw)
To: Joe Perches
Cc: linville, sfr, netdev, linux-wireless, linux-kernel, linux-next,
ath6kl-devel, davem
In-Reply-To: <1325721515.4116.11.camel@joe2Laptop>
On 01/05/2012 01:58 AM, Joe Perches wrote:
> On Thu, 2012-01-05 at 01:09 +0200, Kalle Valo wrote:
>> We don't need it as debug calls already have a log level and compiler
>> should be smart enough to optimise away the code when ath6kl debug code
>> is not enabled. Also it makes it easier to abstract core code to
>> ath6kl_core.ko.
>
> Changelog isn't representative of code changes.
> ATH6KL_DBG_ANY -> ATH6KL_DBG_IRQ.
>
>> diff --git a/drivers/net/wireless/ath/ath6kl/debug.c b/drivers/net/wireless/ath/ath6kl/debug.c
> []
>> @@ -82,31 +82,31 @@ void ath6kl_dump_registers(struct ath6kl_device *dev,
>> struct ath6kl_irq_enable_reg *irq_enable_reg)
>> {
>>
>> - ath6kl_dbg(ATH6KL_DBG_ANY, ("<------- Register Table -------->\n"));
>> + ath6kl_dbg(ATH6KL_DBG_IRQ, ("<------- Register Table -------->\n"));
It's related to this change:
- if (AR_DBG_LVL_CHECK(ATH6KL_DBG_IRQ))
- ath6kl_dump_registers(dev, &dev->irq_proc_reg,
- &dev->irq_en_reg);
+ ath6kl_dump_registers(dev, &dev->irq_proc_reg,
+ &dev->irq_en_reg);
So instead of checking ATH6KL_DBG_IRQ before calling the function the
debug messages in function instead use ATH6KL_DBG_IRQ. I'll mention this
in the commit log.
I should get rid of that ATH6KL_DBG_ANY level completely, it's just
confusing. But I'll do that later.
Thank you for the review.
Kalle
^ permalink raw reply
* Re: [PATCH 5/6] ath6kl: convert ath6kl_dbg() and ath6kl_dbg_dump() into functions
From: Kalle Valo @ 2012-01-05 8:22 UTC (permalink / raw)
To: Joe Perches
Cc: linville-2XuSBdqkA4R54TAoqtyWWQ, sfr-3FnU+UHB4dNDw9hX6IcOSA,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-next-u79uwXL29TY76Z2rM5mHXA,
ath6kl-devel-zC7DfRvBq/JWk0Htik3J/w, davem-fT/PcQaiUtIeIZ0/mPfg9Q
In-Reply-To: <1325720472.4116.7.camel@joe2Laptop>
On 01/05/2012 01:41 AM, Joe Perches wrote:
> On Thu, 2012-01-05 at 01:09 +0200, Kalle Valo wrote:
>> That way it's possible to not export debug_mask outside the upcoming
>> ath6kl_core.ko and that makes it easier to ath6kl_core.ko in the
>> following patch.
> []
>> Signed-off-by: Kalle Valo <kvalo-A+ZNKFmMK5xy9aJCnZT0Uw@public.gmane.org>
> []
>> diff --git a/drivers/net/wireless/ath/ath6kl/debug.c b/drivers/net/wireless/ath/ath6kl/debug.c
> []
>> +void ath6kl_dbg(enum ATH6K_DEBUG_MASK mask, const char *fmt, ...)
>> +{
>> + va_list args;
>> +
>> + if (!(debug_mask & mask))
>> + return;
>> +
>> + va_start(args, fmt);
>> + ath6kl_printk(KERN_DEBUG, fmt, &args);
>
> Passing a va_list as an argument?
> I believe this doesn't work.
Doh, I was supposed to test this but then I forgot in the hurry. Thanks
for pointing this out. I will send v2 which will fix this.
Kalle
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: linux-next: build warning after merge of the vfs tree
From: Al Viro @ 2012-01-05 8:19 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: linux-next, linux-kernel, Jan Kara, reiserfs-devel
In-Reply-To: <20120105191434.6a21befed93e6ec39a3da62d@canb.auug.org.au>
On Thu, Jan 05, 2012 at 07:14:34PM +1100, Stephen Rothwell wrote:
> > by the second (i.e. replace mnt->mnt_sb with dentry->d_sb). Incidentally,
>
> OK, I may apply that fix tomorrow.
FWIW, incremental is simply
--- a/fs/reiserfs/super.c 2012-01-05 03:18:03.000000000 -0500
+++ b/fs/reiserfs/super.c 2012-01-05 03:09:45.000000000 -0500
@@ -598,9 +598,9 @@
reiserfs_write_unlock_once(inode->i_sb, lock_depth);
}
-static int reiserfs_show_options(struct seq_file *seq, struct vfsmount *vfs)
+static int reiserfs_show_options(struct seq_file *seq, struct dentry *root)
{
- struct super_block *s = vfs->mnt_sb;
+ struct super_block *s = root->d_sb;
struct reiserfs_journal *journal = SB_JOURNAL(s);
long opts = REISERFS_SB(s)->s_mount_opt;
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox