* Re: [RFC PATCH v7 01/19] Add a new structure for skb buffer from external.
From: Michael S. Tsirkin @ 2010-06-20 10:39 UTC (permalink / raw)
To: Herbert Xu
Cc: Xin, Xiaohui, Stephen Hemminger, netdev@vger.kernel.org,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org, mingo@elte.hu,
davem@davemloft.net, jdike@linux.intel.com, Rusty Russell
In-Reply-To: <20100620103235.GA31284@gondor.apana.org.au>
On Sun, Jun 20, 2010 at 08:32:35PM +1000, Herbert Xu wrote:
> On Sun, Jun 20, 2010 at 01:06:32PM +0300, Michael S. Tsirkin wrote:
> >
> > Changing the guest virtio to match the backend is a problem,
> > this breaks migration etc.
>
> As long as it's done in a backwards compatible way it should be
> fine.
Possibly, but to me the need to do this implies that
we'll need another change with different hardware at the backend.
> It's just like migrating from a backend that supports TSO
> to one that doesn't.
>
> Cheers,
Exactly. We don't support such migration.
> --
> Visit Openswan at http://www.openswan.org/
> Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* Re: [RFC PATCH v7 01/19] Add a new structure for skb buffer from external.
From: Herbert Xu @ 2010-06-20 10:32 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Xin, Xiaohui, Stephen Hemminger, netdev@vger.kernel.org,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org, mingo@elte.hu,
davem@davemloft.net, jdike@linux.intel.com, Rusty Russell
In-Reply-To: <20100620100631.GB4578@redhat.com>
On Sun, Jun 20, 2010 at 01:06:32PM +0300, Michael S. Tsirkin wrote:
>
> Changing the guest virtio to match the backend is a problem,
> this breaks migration etc.
As long as it's done in a backwards compatible way it should be
fine. It's just like migrating from a backend that supports TSO
to one that doesn't.
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* Re: [RFC PATCH v7 01/19] Add a new structure for skb buffer from external.
From: Michael S. Tsirkin @ 2010-06-20 10:06 UTC (permalink / raw)
To: Xin, Xiaohui
Cc: Herbert Xu, Stephen Hemminger, netdev@vger.kernel.org,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org, mingo@elte.hu,
davem@davemloft.net, jdike@linux.intel.com, Rusty Russell
In-Reply-To: <F2E9EB7348B8264F86B6AB8151CE2D7915089FE573@shsmsx502.ccr.corp.intel.com>
On Fri, Jun 18, 2010 at 03:14:18PM +0800, Xin, Xiaohui wrote:
> >-----Original Message-----
> >From: Herbert Xu [mailto:herbert@gondor.apana.org.au]
> >Sent: Friday, June 18, 2010 1:59 PM
> >To: Xin, Xiaohui
> >Cc: Stephen Hemminger; netdev@vger.kernel.org; kvm@vger.kernel.org;
> >linux-kernel@vger.kernel.org; mst@redhat.com; mingo@elte.hu; davem@davemloft.net;
> >jdike@linux.intel.com; Rusty Russell
> >Subject: Re: [RFC PATCH v7 01/19] Add a new structure for skb buffer from external.
> >
> >On Fri, Jun 18, 2010 at 01:26:49PM +0800, Xin, Xiaohui wrote:
> >>
> >> Herbert,
> >> I have questions about the idea above:
> >> 1) Since netdev_alloc_skb() is still there, and we only modify alloc_page(),
> >> then we don't need napi_gro_frags() any more, the driver's original receiving
> >> function is ok. Right?
> >
> >Well I was actually thinking about converting all drivers that
> >need this to napi_gro_frags. But now that you mention it, yes
> >we could still keep the old interface to minimise the work.
> >
> >> 2) Is napi_gro_frags() only suitable for TCP protocol packet?
> >> I have done a small test for ixgbe driver to let it only allocate paged buffers
> >> and found kernel hangs when napi_gro_frags() receives an ARP packet.
> >
> >It should work with any packet. In fact, I'm pretty sure the
> >other drivers (e.g., cxgb3) use that interface for all packets.
> >
> Thanks for the verification. By the way, does that mean that nearly all drivers can use the
> same napi_gro_frags() to receive buffers though currently each driver has it's own receiving
> function?
>
> >> 3) As I have mentioned above, with this idea, netdev_alloc_skb() will allocate
> >> as usual, the data pointed by skb->data will be copied into the first guest buffer.
> >> That means we should reserve sufficient room in guest buffer. For PS mode
> >> supported driver (for example ixgbe), the room will be more than 128. After 128bytes,
> >> we will put the first frag data. Look into virtio-net.c the function page_to_skb()
> >> and receive_mergeable(), that means we should modify guest virtio-net driver to
> >> compute the offset as the parameter for skb_set_frag().
> >>
> >> How do you think about this? Attached is a patch to how to modify the guest driver.
> >> I reserve 512 bytes as an example, and transfer the header len of the skb in hdr->hdr_len.
> >
> >Expanding the buffer size to 512 bytes to accomodate PS mode
> >looks reasonable to me.
> >
> >However, I don't think we should increase the copy threshold to
> >512 bytes at the same time. I don't have any figures myself but
> >I think if we are to make such a change it should be a separate
> >one and come with supporting numbers.
> >
> Let me have a look to see if I can retain the copy threshold as 128 bytes
> and copy the header data safely.
Changing the guest virtio to match the backend is a problem,
this breaks migration etc.
> >Cheers,
> >--
> >Visit Openswan at http://www.openswan.org/
> >Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
> >Home Page: http://gondor.apana.org.au/~herbert/
> >PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* Re: [PATCH] net: optimize Berkeley Packet Filter (BPF) processing
From: Hagen Paul Pfeifer @ 2010-06-20 9:50 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev, davem
In-Reply-To: <20100619221611.784f7dbc@nehalam>
* Stephen Hemminger | 2010-06-19 22:16:11 [-0700]:
>I don't think this works because it breaks ABI compatibility for applications tha
>use older versions.
Are you sure Stephen? It is a one-to-one mapping of the ABI but maybe it was
too late yesterday ... ;-)
--
Hagen Paul Pfeifer <hagen@jauu.net> || http://jauu.net/
Telephone: +49 174 5455209 || Key Id: 0x98350C22
Key Fingerprint: 490F 557B 6C48 6D7E 5706 2EA2 4A22 8D45 9835 0C22
^ permalink raw reply
* Re: [net-next-2.6 PATCH 1/8] e1000e: cleanup ethtool loopback setup code
From: Jeff Kirsher @ 2010-06-20 7:32 UTC (permalink / raw)
To: David Miller; +Cc: netdev, gospo, bphilips, bruce.w.allan
In-Reply-To: <20100618.221512.102550313.davem@davemloft.net>
On Fri, Jun 18, 2010 at 22:15, David Miller <davem@davemloft.net> wrote:
>
> I've applied this series however:
>
> 1) Please address Ben's concerns about turning EEE on by default
> given that standardization is not complete yet.
>
> 2) I hate module parameters, I'd rather you create a new ethtool
> feature bit and thus allow the setting to be modified at run
> time. Please create a new ethtool control flag, and remove
> this module option.
>
> Thanks.
> --
Thank you Dave. I know that Bruce (and company) are actively looking
into your first point. I would think that he would have either a
response or update on the status come Monday/Tuesday.
Regarding option 2, understood and I will work out with Bruce on when
and who will do the work. I will be taking a look at it tomorrow
(later today), if I am not able to come up with a patch in the near
future. I will return to working on it by Wednesday.
--
Cheers,
Jeff
^ permalink raw reply
* [PATCH] Driver-core: Always create class directories fixing the broken network drivers.
From: Eric W. Biederman @ 2010-06-20 6:20 UTC (permalink / raw)
To: Greg KH; +Cc: Johannes Berg, netdev, Kay Sievers
In-Reply-To: <AANLkTin2sci1gSmwx-tjazYGFAcUNRKhJFI7Bt0KvVe3@mail.gmail.com>
In get_device_parent there is a check to not add a class directory
when a class device was put under another class device. The check was
put in place as a just in case measure to not break old userspace if
any existing code happened to depend on it. Currently the only known
way that we get a class device under a class device is due to the
rearrangement of devices that happened when the new sysfs layout was
introduced.
With the introduction of tagged sysfs directories for properly
handling network namespace support this omission in creating the class
directories went from a bad thing in terms of namespace pollution, to
actually breaking device_remove.
Currently there are two reported network device drivers that break
because the class directory was not created by the device layer. The
usb bnep driver and the mac80211_hwsim driver.
Every solution proposed changes the sysfs layout for the affected
devices, and thus has the potential to break userspace.
Since we are changing the sysfs layout anyway, and since we are now
talking about several devices all with the same problem, all caused by
the same over conservative bit of code. Let's kill that bit of code.
There have been other proposals to fix this but they all have been
more complicated, and none of them have actually resulted in working
code.
Any userspace that works with both the old and the new sysfs layouts
should not be affected by this change, and even if someone depends
on it we are talking a very small number of drivers overall that
are affected.
My apologoies for not fully catching this hole in the logic the
when this code was originally added.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---
drivers/base/core.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 9630fbd..7b1c4d4 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -673,8 +673,6 @@ static struct kobject *get_device_parent(struct device *dev,
*/
if (parent == NULL)
parent_kobj = virtual_device_parent(dev);
- else if (parent->class)
- return &parent->kobj;
else
parent_kobj = &parent->kobj;
--
1.6.5.2.143.g8cc62
^ permalink raw reply related
* Re: [PATCH] net: optimize Berkeley Packet Filter (BPF) processing
From: Stephen Hemminger @ 2010-06-20 5:16 UTC (permalink / raw)
To: Hagen Paul Pfeifer; +Cc: netdev, davem
In-Reply-To: <1277003136-5522-1-git-send-email-hagen@jauu.net>
On Sun, 20 Jun 2010 05:05:36 +0200
Hagen Paul Pfeifer <hagen@jauu.net> wrote:
> Gcc is currenlty not in the ability to optimize the switch statement in
> sk_run_filter() because of dense case labels. This patch replace the
> OR'd labels with ordered sequenced case labels. The sk_chk_filter()
> function is modified to patch/replace the original OPCODES in a
> ordered but equivalent form. gcc is now in the ability to transform the
> switch statement in sk_run_filter into a jump table of complexity O(1).
>
> Until this patch gcc generates a sequence of conditional branches (O(n) of 567
> byte .text segment size (arch x86_64):
I don't think this works because it breaks ABI compatibility for applications tha
use older versions.
^ permalink raw reply
* [PATCH] net: optimize Berkeley Packet Filter (BPF) processing
From: Hagen Paul Pfeifer @ 2010-06-20 3:05 UTC (permalink / raw)
To: netdev; +Cc: davem, Hagen Paul Pfeifer
Gcc is currenlty not in the ability to optimize the switch statement in
sk_run_filter() because of dense case labels. This patch replace the
OR'd labels with ordered sequenced case labels. The sk_chk_filter()
function is modified to patch/replace the original OPCODES in a
ordered but equivalent form. gcc is now in the ability to transform the
switch statement in sk_run_filter into a jump table of complexity O(1).
Until this patch gcc generates a sequence of conditional branches (O(n) of 567
byte .text segment size (arch x86_64):
7ff: 8b 06 mov (%rsi),%eax
801: 66 83 f8 35 cmp $0x35,%ax
805: 0f 84 d0 02 00 00 je adb <sk_run_filter+0x31d>
80b: 0f 87 07 01 00 00 ja 918 <sk_run_filter+0x15a>
811: 66 83 f8 15 cmp $0x15,%ax
815: 0f 84 c5 02 00 00 je ae0 <sk_run_filter+0x322>
81b: 77 73 ja 890 <sk_run_filter+0xd2>
81d: 66 83 f8 04 cmp $0x4,%ax
821: 0f 84 17 02 00 00 je a3e <sk_run_filter+0x280>
827: 77 29 ja 852 <sk_run_filter+0x94>
829: 66 83 f8 01 cmp $0x1,%ax
[...]
With the modification the compiler translate the switch statement into
the following jump table fragment:
7ff: 66 83 3e 2c cmpw $0x2c,(%rsi)
803: 0f 87 1f 02 00 00 ja a28 <sk_run_filter+0x26a>
809: 0f b7 06 movzwl (%rsi),%eax
80c: ff 24 c5 00 00 00 00 jmpq *0x0(,%rax,8)
813: 44 89 e3 mov %r12d,%ebx
816: e9 43 03 00 00 jmpq b5e <sk_run_filter+0x3a0>
81b: 41 89 dc mov %ebx,%r12d
81e: e9 3b 03 00 00 jmpq b5e <sk_run_filter+0x3a0>
Furthermore, I reordered the instructions to reduce cache line misses by
order the most common instruction to the start.
Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>
---
include/linux/filter.h | 48 +++++++++++
net/core/filter.c | 212 ++++++++++++++++++++++++++++++++++++------------
2 files changed, 209 insertions(+), 51 deletions(-)
diff --git a/include/linux/filter.h b/include/linux/filter.h
index 151f5d7..69b43db 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -91,6 +91,54 @@ struct sock_fprog { /* Required for SO_ATTACH_FILTER. */
#define BPF_TAX 0x00
#define BPF_TXA 0x80
+enum {
+ BPF_S_RET_K = 0,
+ BPF_S_RET_A,
+ BPF_S_ALU_ADD_K,
+ BPF_S_ALU_ADD_X,
+ BPF_S_ALU_SUB_K,
+ BPF_S_ALU_SUB_X,
+ BPF_S_ALU_MUL_K,
+ BPF_S_ALU_MUL_X,
+ BPF_S_ALU_DIV_X,
+ BPF_S_ALU_AND_K,
+ BPF_S_ALU_AND_X,
+ BPF_S_ALU_OR_K,
+ BPF_S_ALU_OR_X,
+ BPF_S_ALU_LSH_K,
+ BPF_S_ALU_LSH_X,
+ BPF_S_ALU_RSH_K,
+ BPF_S_ALU_RSH_X,
+ BPF_S_ALU_NEG,
+ BPF_S_LD_W_ABS,
+ BPF_S_LD_H_ABS,
+ BPF_S_LD_B_ABS,
+ BPF_S_LD_W_LEN,
+ BPF_S_LD_W_IND,
+ BPF_S_LD_H_IND,
+ BPF_S_LD_B_IND,
+ BPF_S_LD_IMM,
+ BPF_S_LDX_W_LEN,
+ BPF_S_LDX_B_MSH,
+ BPF_S_LDX_IMM,
+ BPF_S_MISC_TAX,
+ BPF_S_MISC_TXA,
+ BPF_S_ALU_DIV_K,
+ BPF_S_LD_MEM,
+ BPF_S_LDX_MEM,
+ BPF_S_ST,
+ BPF_S_STX,
+ BPF_S_JMP_JA,
+ BPF_S_JMP_JEQ_K,
+ BPF_S_JMP_JEQ_X,
+ BPF_S_JMP_JGE_K,
+ BPF_S_JMP_JGE_X,
+ BPF_S_JMP_JGT_K,
+ BPF_S_JMP_JGT_X,
+ BPF_S_JMP_JSET_K,
+ BPF_S_JMP_JSET_X,
+};
+
#ifndef BPF_MAXINSNS
#define BPF_MAXINSNS 4096
#endif
diff --git a/net/core/filter.c b/net/core/filter.c
index da69fb7..6e3e322 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -128,87 +128,87 @@ unsigned int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int
fentry = &filter[pc];
switch (fentry->code) {
- case BPF_ALU|BPF_ADD|BPF_X:
+ case BPF_S_ALU_ADD_X:
A += X;
continue;
- case BPF_ALU|BPF_ADD|BPF_K:
+ case BPF_S_ALU_ADD_K:
A += fentry->k;
continue;
- case BPF_ALU|BPF_SUB|BPF_X:
+ case BPF_S_ALU_SUB_X:
A -= X;
continue;
- case BPF_ALU|BPF_SUB|BPF_K:
+ case BPF_S_ALU_SUB_K:
A -= fentry->k;
continue;
- case BPF_ALU|BPF_MUL|BPF_X:
+ case BPF_S_ALU_MUL_X:
A *= X;
continue;
- case BPF_ALU|BPF_MUL|BPF_K:
+ case BPF_S_ALU_MUL_K:
A *= fentry->k;
continue;
- case BPF_ALU|BPF_DIV|BPF_X:
+ case BPF_S_ALU_DIV_X:
if (X == 0)
return 0;
A /= X;
continue;
- case BPF_ALU|BPF_DIV|BPF_K:
+ case BPF_S_ALU_DIV_K:
A /= fentry->k;
continue;
- case BPF_ALU|BPF_AND|BPF_X:
+ case BPF_S_ALU_AND_X:
A &= X;
continue;
- case BPF_ALU|BPF_AND|BPF_K:
+ case BPF_S_ALU_AND_K:
A &= fentry->k;
continue;
- case BPF_ALU|BPF_OR|BPF_X:
+ case BPF_S_ALU_OR_X:
A |= X;
continue;
- case BPF_ALU|BPF_OR|BPF_K:
+ case BPF_S_ALU_OR_K:
A |= fentry->k;
continue;
- case BPF_ALU|BPF_LSH|BPF_X:
+ case BPF_S_ALU_LSH_X:
A <<= X;
continue;
- case BPF_ALU|BPF_LSH|BPF_K:
+ case BPF_S_ALU_LSH_K:
A <<= fentry->k;
continue;
- case BPF_ALU|BPF_RSH|BPF_X:
+ case BPF_S_ALU_RSH_X:
A >>= X;
continue;
- case BPF_ALU|BPF_RSH|BPF_K:
+ case BPF_S_ALU_RSH_K:
A >>= fentry->k;
continue;
- case BPF_ALU|BPF_NEG:
+ case BPF_S_ALU_NEG:
A = -A;
continue;
- case BPF_JMP|BPF_JA:
+ case BPF_S_JMP_JA:
pc += fentry->k;
continue;
- case BPF_JMP|BPF_JGT|BPF_K:
+ case BPF_S_JMP_JGT_K:
pc += (A > fentry->k) ? fentry->jt : fentry->jf;
continue;
- case BPF_JMP|BPF_JGE|BPF_K:
+ case BPF_S_JMP_JGE_K:
pc += (A >= fentry->k) ? fentry->jt : fentry->jf;
continue;
- case BPF_JMP|BPF_JEQ|BPF_K:
+ case BPF_S_JMP_JEQ_K:
pc += (A == fentry->k) ? fentry->jt : fentry->jf;
continue;
- case BPF_JMP|BPF_JSET|BPF_K:
+ case BPF_S_JMP_JSET_K:
pc += (A & fentry->k) ? fentry->jt : fentry->jf;
continue;
- case BPF_JMP|BPF_JGT|BPF_X:
+ case BPF_S_JMP_JGT_X:
pc += (A > X) ? fentry->jt : fentry->jf;
continue;
- case BPF_JMP|BPF_JGE|BPF_X:
+ case BPF_S_JMP_JGE_X:
pc += (A >= X) ? fentry->jt : fentry->jf;
continue;
- case BPF_JMP|BPF_JEQ|BPF_X:
+ case BPF_S_JMP_JEQ_X:
pc += (A == X) ? fentry->jt : fentry->jf;
continue;
- case BPF_JMP|BPF_JSET|BPF_X:
+ case BPF_S_JMP_JSET_X:
pc += (A & X) ? fentry->jt : fentry->jf;
continue;
- case BPF_LD|BPF_W|BPF_ABS:
+ case BPF_S_LD_W_ABS:
k = fentry->k;
load_w:
ptr = load_pointer(skb, k, 4, &tmp);
@@ -217,7 +217,7 @@ load_w:
continue;
}
break;
- case BPF_LD|BPF_H|BPF_ABS:
+ case BPF_S_LD_H_ABS:
k = fentry->k;
load_h:
ptr = load_pointer(skb, k, 2, &tmp);
@@ -226,7 +226,7 @@ load_h:
continue;
}
break;
- case BPF_LD|BPF_B|BPF_ABS:
+ case BPF_S_LD_B_ABS:
k = fentry->k;
load_b:
ptr = load_pointer(skb, k, 1, &tmp);
@@ -235,54 +235,54 @@ load_b:
continue;
}
break;
- case BPF_LD|BPF_W|BPF_LEN:
+ case BPF_S_LD_W_LEN:
A = skb->len;
continue;
- case BPF_LDX|BPF_W|BPF_LEN:
+ case BPF_S_LDX_W_LEN:
X = skb->len;
continue;
- case BPF_LD|BPF_W|BPF_IND:
+ case BPF_S_LD_W_IND:
k = X + fentry->k;
goto load_w;
- case BPF_LD|BPF_H|BPF_IND:
+ case BPF_S_LD_H_IND:
k = X + fentry->k;
goto load_h;
- case BPF_LD|BPF_B|BPF_IND:
+ case BPF_S_LD_B_IND:
k = X + fentry->k;
goto load_b;
- case BPF_LDX|BPF_B|BPF_MSH:
+ case BPF_S_LDX_B_MSH:
ptr = load_pointer(skb, fentry->k, 1, &tmp);
if (ptr != NULL) {
X = (*(u8 *)ptr & 0xf) << 2;
continue;
}
return 0;
- case BPF_LD|BPF_IMM:
+ case BPF_S_LD_IMM:
A = fentry->k;
continue;
- case BPF_LDX|BPF_IMM:
+ case BPF_S_LDX_IMM:
X = fentry->k;
continue;
- case BPF_LD|BPF_MEM:
+ case BPF_S_LD_MEM:
A = mem[fentry->k];
continue;
- case BPF_LDX|BPF_MEM:
+ case BPF_S_LDX_MEM:
X = mem[fentry->k];
continue;
- case BPF_MISC|BPF_TAX:
+ case BPF_S_MISC_TAX:
X = A;
continue;
- case BPF_MISC|BPF_TXA:
+ case BPF_S_MISC_TXA:
A = X;
continue;
- case BPF_RET|BPF_K:
+ case BPF_S_RET_K:
return fentry->k;
- case BPF_RET|BPF_A:
+ case BPF_S_RET_A:
return A;
- case BPF_ST:
+ case BPF_S_ST:
mem[fentry->k] = A;
continue;
- case BPF_STX:
+ case BPF_S_STX:
mem[fentry->k] = X;
continue;
default:
@@ -390,53 +390,128 @@ int sk_chk_filter(struct sock_filter *filter, int flen)
/* Only allow valid instructions */
switch (ftest->code) {
case BPF_ALU|BPF_ADD|BPF_K:
+ ftest->code = BPF_S_ALU_ADD_K;
+ break;
case BPF_ALU|BPF_ADD|BPF_X:
+ ftest->code = BPF_S_ALU_ADD_X;
+ break;
case BPF_ALU|BPF_SUB|BPF_K:
+ ftest->code = BPF_S_ALU_SUB_K;
+ break;
case BPF_ALU|BPF_SUB|BPF_X:
+ ftest->code = BPF_S_ALU_SUB_X;
+ break;
case BPF_ALU|BPF_MUL|BPF_K:
+ ftest->code = BPF_S_ALU_MUL_K;
+ break;
case BPF_ALU|BPF_MUL|BPF_X:
+ ftest->code = BPF_S_ALU_MUL_X;
+ break;
case BPF_ALU|BPF_DIV|BPF_X:
+ ftest->code = BPF_S_ALU_DIV_X;
+ break;
case BPF_ALU|BPF_AND|BPF_K:
+ ftest->code = BPF_S_ALU_AND_K;
+ break;
case BPF_ALU|BPF_AND|BPF_X:
+ ftest->code = BPF_S_ALU_AND_X;
+ break;
case BPF_ALU|BPF_OR|BPF_K:
+ ftest->code = BPF_S_ALU_OR_K;
+ break;
case BPF_ALU|BPF_OR|BPF_X:
+ ftest->code = BPF_S_ALU_OR_X;
+ break;
case BPF_ALU|BPF_LSH|BPF_K:
+ ftest->code = BPF_S_ALU_LSH_K;
+ break;
case BPF_ALU|BPF_LSH|BPF_X:
+ ftest->code = BPF_S_ALU_LSH_X;
+ break;
case BPF_ALU|BPF_RSH|BPF_K:
+ ftest->code = BPF_S_ALU_RSH_K;
+ break;
case BPF_ALU|BPF_RSH|BPF_X:
+ ftest->code = BPF_S_ALU_RSH_X;
+ break;
case BPF_ALU|BPF_NEG:
+ ftest->code = BPF_S_ALU_NEG;
+ break;
case BPF_LD|BPF_W|BPF_ABS:
+ ftest->code = BPF_S_LD_W_ABS;
+ break;
case BPF_LD|BPF_H|BPF_ABS:
+ ftest->code = BPF_S_LD_H_ABS;
+ break;
case BPF_LD|BPF_B|BPF_ABS:
+ ftest->code = BPF_S_LD_B_ABS;
+ break;
case BPF_LD|BPF_W|BPF_LEN:
+ ftest->code = BPF_S_LD_W_LEN;
+ break;
case BPF_LD|BPF_W|BPF_IND:
+ ftest->code = BPF_S_LD_W_IND;
+ break;
case BPF_LD|BPF_H|BPF_IND:
+ ftest->code = BPF_S_LD_H_IND;
+ break;
case BPF_LD|BPF_B|BPF_IND:
+ ftest->code = BPF_S_LD_B_IND;
+ break;
case BPF_LD|BPF_IMM:
+ ftest->code = BPF_S_LD_IMM;
+ break;
case BPF_LDX|BPF_W|BPF_LEN:
+ ftest->code = BPF_S_LDX_W_LEN;
+ break;
case BPF_LDX|BPF_B|BPF_MSH:
+ ftest->code = BPF_S_LDX_B_MSH;
+ break;
case BPF_LDX|BPF_IMM:
+ ftest->code = BPF_S_LDX_IMM;
+ break;
case BPF_MISC|BPF_TAX:
+ ftest->code = BPF_S_MISC_TAX;
+ break;
case BPF_MISC|BPF_TXA:
+ ftest->code = BPF_S_MISC_TXA;
+ break;
case BPF_RET|BPF_K:
+ ftest->code = BPF_S_RET_K;
+ break;
case BPF_RET|BPF_A:
+ ftest->code = BPF_S_RET_A;
break;
/* Some instructions need special checks */
- case BPF_ALU|BPF_DIV|BPF_K:
/* check for division by zero */
+ case BPF_ALU|BPF_DIV|BPF_K:
if (ftest->k == 0)
return -EINVAL;
+ ftest->code = BPF_S_ALU_DIV_K;
break;
+ /* check for invalid memory addresses */
case BPF_LD|BPF_MEM:
+ if (ftest->k >= BPF_MEMWORDS)
+ return -EINVAL;
+ ftest->code = BPF_S_LD_MEM;
+ break;
case BPF_LDX|BPF_MEM:
+ if (ftest->k >= BPF_MEMWORDS)
+ return -EINVAL;
+ ftest->code = BPF_S_LDX_MEM;
+ break;
case BPF_ST:
+ if (ftest->k >= BPF_MEMWORDS)
+ return -EINVAL;
+ ftest->code = BPF_S_ST;
+ break;
case BPF_STX:
- /* check for invalid memory addresses */
if (ftest->k >= BPF_MEMWORDS)
return -EINVAL;
+ ftest->code = BPF_S_STX;
break;
case BPF_JMP|BPF_JA:
@@ -447,28 +522,63 @@ int sk_chk_filter(struct sock_filter *filter, int flen)
*/
if (ftest->k >= (unsigned)(flen-pc-1))
return -EINVAL;
+ ftest->code = BPF_S_JMP_JA;
break;
case BPF_JMP|BPF_JEQ|BPF_K:
+ ftest->code = BPF_S_JMP_JEQ_K;
+ break;
case BPF_JMP|BPF_JEQ|BPF_X:
+ ftest->code = BPF_S_JMP_JEQ_X;
+ break;
case BPF_JMP|BPF_JGE|BPF_K:
+ ftest->code = BPF_S_JMP_JGE_K;
+ break;
case BPF_JMP|BPF_JGE|BPF_X:
+ ftest->code = BPF_S_JMP_JGE_X;
+ break;
case BPF_JMP|BPF_JGT|BPF_K:
+ ftest->code = BPF_S_JMP_JGT_K;
+ break;
case BPF_JMP|BPF_JGT|BPF_X:
+ ftest->code = BPF_S_JMP_JGT_X;
+ break;
case BPF_JMP|BPF_JSET|BPF_K:
+ ftest->code = BPF_S_JMP_JSET_K;
+ break;
case BPF_JMP|BPF_JSET|BPF_X:
+ ftest->code = BPF_S_JMP_JSET_X;
+ break;
+
+ default:
+ return -EINVAL;
+ }
+
/* for conditionals both must be safe */
+ switch (ftest->code) {
+ case BPF_S_JMP_JEQ_K:
+ case BPF_S_JMP_JEQ_X:
+ case BPF_S_JMP_JGE_K:
+ case BPF_S_JMP_JGE_X:
+ case BPF_S_JMP_JGT_K:
+ case BPF_S_JMP_JGT_X:
+ case BPF_S_JMP_JSET_X:
+ case BPF_S_JMP_JSET_K:
if (pc + ftest->jt + 1 >= flen ||
pc + ftest->jf + 1 >= flen)
return -EINVAL;
- break;
+ }
+ }
+ /* last instruction must be a RET code */
+ switch (filter[flen - 1].code) {
+ case BPF_S_RET_K:
+ case BPF_S_RET_A:
+ return 0;
+ break;
default:
return -EINVAL;
}
- }
-
- return (BPF_CLASS(filter[flen - 1].code) == BPF_RET) ? 0 : -EINVAL;
}
EXPORT_SYMBOL(sk_chk_filter);
--
1.6.6.196.g1f735.dirty
^ permalink raw reply related
* [PATCH kernel 2.6.35-rc3] smc91c92_cs: fix the problem that lan & modem does not work simultaneously
From: Ken Kawasaki @ 2010-06-20 1:24 UTC (permalink / raw)
To: netdev
In-Reply-To: <20100612191728.2d272cc1.ken_kawasaki@spring.nifty.jp>
smc91c92_cs:
Fix the problem that lan & modem does not work simultaneously
in the Megahertz multi-function card.
We need to write MEGAHERTZ_ISR to retrigger interrupt.
Signed-off-by: Ken Kawasaki <ken_kawasaki@spring.nifty.jp>
--
--- linux-2.6.35-rc3/drivers/net/pcmcia/smc91c92_cs.c.orig 2010-06-19 09:42:59.000000000 +0900
+++ linux-2.6.35-rc3/drivers/net/pcmcia/smc91c92_cs.c 2010-06-19 11:25:34.000000000 +0900
@@ -1505,12 +1505,20 @@ irq_done:
writeb(cor & ~COR_IREQ_ENA, smc->base + MOT_LAN + CISREG_COR);
writeb(cor, smc->base + MOT_LAN + CISREG_COR);
}
-#ifdef DOES_NOT_WORK
- if (smc->base != NULL) { /* Megahertz MFC's */
- readb(smc->base+MEGAHERTZ_ISR);
- readb(smc->base+MEGAHERTZ_ISR);
+
+ if ((smc->base != NULL) && /* Megahertz MFC's */
+ (smc->manfid == MANFID_MEGAHERTZ) &&
+ (smc->cardid == PRODID_MEGAHERTZ_EM3288)) {
+
+ u_char tmp;
+ tmp = readb(smc->base+MEGAHERTZ_ISR);
+ tmp = readb(smc->base+MEGAHERTZ_ISR);
+
+ /* Retrigger interrupt if needed */
+ writeb(tmp, smc->base + MEGAHERTZ_ISR);
+ writeb(tmp, smc->base + MEGAHERTZ_ISR);
}
-#endif
+
spin_unlock(&smc->lock);
return IRQ_RETVAL(handled);
}
^ permalink raw reply
* Re: [PATCH 0/2] net,man - IP_NODEFRAG option for IPv4 socket
From: Jiri Olsa @ 2010-06-19 23:32 UTC (permalink / raw)
To: eric.dumazet, jengelh, kaber; +Cc: netdev, netfilter-devel, linux-man
In-Reply-To: <1276600052-16499-1-git-send-email-jolsa@redhat.com>
hi,
any feedback?
thanks,
jirka
On Tue, Jun 15, 2010 at 01:07:30PM +0200, Jiri Olsa wrote:
> hi,
>
> this series contains patch for IP_NODEFRAG option for RAW sockets,
> and changes for man pages.
>
> I'm sending this together, hope it's ok.
>
> 1/2 - net - IP_NODEFRAG option for IPv4 socket
> 2/2 - man - IP_NODEFRAG option for IPv4 socket
>
> wbr,
> jirka
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH 3/3] drivers/net/wireless/b43: Rename b43_debug to b43_debugging
From: Joe Perches @ 2010-06-19 23:30 UTC (permalink / raw)
To: Stefano Brivio; +Cc: John W. Linville, linux-wireless, netdev, linux-kernel
In-Reply-To: <cover.1276988387.git.joe@perches.com>
Avoid using <foo>_debug function name because that is most commonly
used to emit logging messages.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/wireless/b43/debugfs.c | 2 +-
drivers/net/wireless/b43/debugfs.h | 4 ++--
drivers/net/wireless/b43/dma.c | 10 +++++-----
drivers/net/wireless/b43/lo.c | 6 +++---
drivers/net/wireless/b43/main.c | 16 ++++++++--------
drivers/net/wireless/b43/phy_g.c | 8 ++++----
6 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/drivers/net/wireless/b43/debugfs.c b/drivers/net/wireless/b43/debugfs.c
index 307802c..a9f8d48 100644
--- a/drivers/net/wireless/b43/debugfs.c
+++ b/drivers/net/wireless/b43/debugfs.c
@@ -645,7 +645,7 @@ B43_DEBUGFS_FOPS(restart, NULL, restart_write_file);
B43_DEBUGFS_FOPS(loctls, loctls_read_file, NULL);
-bool b43_debug(struct b43_wldev *dev, enum b43_dyndbg feature)
+bool b43_debugging(struct b43_wldev *dev, enum b43_dyndbg feature)
{
bool enabled;
diff --git a/drivers/net/wireless/b43/debugfs.h b/drivers/net/wireless/b43/debugfs.h
index 822aad8..f34da88 100644
--- a/drivers/net/wireless/b43/debugfs.h
+++ b/drivers/net/wireless/b43/debugfs.h
@@ -73,7 +73,7 @@ struct b43_dfsentry {
struct dentry *dyn_debug_dentries[__B43_NR_DYNDBG];
};
-bool b43_debug(struct b43_wldev *dev, enum b43_dyndbg feature);
+bool b43_debugging(struct b43_wldev *dev, enum b43_dyndbg feature);
void b43_debugfs_init(void);
void b43_debugfs_exit(void);
@@ -84,7 +84,7 @@ void b43_debugfs_log_txstat(struct b43_wldev *dev,
#else /* CONFIG_B43_DEBUG */
-static inline bool b43_debug(struct b43_wldev *dev, enum b43_dyndbg feature)
+static inline bool b43_debugging(struct b43_wldev *dev, enum b43_dyndbg feature)
{
return 0;
}
diff --git a/drivers/net/wireless/b43/dma.c b/drivers/net/wireless/b43/dma.c
index a6d15c4..6343378 100644
--- a/drivers/net/wireless/b43/dma.c
+++ b/drivers/net/wireless/b43/dma.c
@@ -265,7 +265,7 @@ static void update_max_used_slots(struct b43_dmaring *ring,
if (current_used_slots <= ring->max_used_slots)
return;
ring->max_used_slots = current_used_slots;
- if (b43_debug(ring->dev, B43_DBG_DMAVERBOSE)) {
+ if (b43_debugging(ring->dev, B43_DBG_DMAVERBOSE)) {
b43_dbg(ring->dev->wl,
"max_used_slots increased to %d on %s ring %d\n",
ring->max_used_slots,
@@ -1264,7 +1264,7 @@ out_unmap_hdr:
static inline int should_inject_overflow(struct b43_dmaring *ring)
{
#ifdef CONFIG_B43_DEBUG
- if (unlikely(b43_debug(ring->dev, B43_DBG_DMAOVERFLOW))) {
+ if (unlikely(b43_debugging(ring->dev, B43_DBG_DMAOVERFLOW))) {
/* Check if we should inject another ringbuffer overflow
* to test handling of this situation in the stack. */
unsigned long next_overflow;
@@ -1340,7 +1340,7 @@ int b43_dma_tx(struct b43_wldev *dev, struct sk_buff *skb)
* Because of a race, one packet may be queued after
* the queue is stopped, thus we got called when we shouldn't.
* For now, just refuse the transmit. */
- if (b43_debug(dev, B43_DBG_DMAVERBOSE))
+ if (b43_debugging(dev, B43_DBG_DMAVERBOSE))
b43_err(dev->wl, "Packet after queue stopped\n");
err = -ENOSPC;
goto out;
@@ -1376,7 +1376,7 @@ int b43_dma_tx(struct b43_wldev *dev, struct sk_buff *skb)
/* This TX ring is full. */
ieee80211_stop_queue(dev->wl->hw, skb_get_queue_mapping(skb));
ring->stopped = 1;
- if (b43_debug(dev, B43_DBG_DMAVERBOSE)) {
+ if (b43_debugging(dev, B43_DBG_DMAVERBOSE)) {
b43_dbg(dev->wl, "Stopped TX ring %d\n", ring->index);
}
}
@@ -1494,7 +1494,7 @@ void b43_dma_handle_txstatus(struct b43_wldev *dev,
B43_WARN_ON(free_slots(ring) < TX_SLOTS_PER_FRAME);
ieee80211_wake_queue(dev->wl->hw, ring->queue_prio);
ring->stopped = 0;
- if (b43_debug(dev, B43_DBG_DMAVERBOSE)) {
+ if (b43_debugging(dev, B43_DBG_DMAVERBOSE)) {
b43_dbg(dev->wl, "Woke up TX ring %d\n", ring->index);
}
}
diff --git a/drivers/net/wireless/b43/lo.c b/drivers/net/wireless/b43/lo.c
index c16c35c..b047edd 100644
--- a/drivers/net/wireless/b43/lo.c
+++ b/drivers/net/wireless/b43/lo.c
@@ -774,7 +774,7 @@ struct b43_lo_calib *b43_calibrate_lo_setting(struct b43_wldev *dev,
lo_measure_restore(dev, &saved_regs);
b43_mac_enable(dev);
- if (b43_debug(dev, B43_DBG_LO)) {
+ if (b43_debugging(dev, B43_DBG_LO)) {
b43_dbg(dev->wl, "LO: Calibrated for BB(%u), RF(%u,%u) "
"=> I=%d Q=%d\n",
bbatt->att, rfatt->att, rfatt->with_padmix,
@@ -971,7 +971,7 @@ void b43_lo_g_maintanance_work(struct b43_wldev *dev)
B43_WARN_ON(current_item_expired);
current_item_expired = 1;
}
- if (b43_debug(dev, B43_DBG_LO)) {
+ if (b43_debugging(dev, B43_DBG_LO)) {
b43_dbg(dev->wl, "LO: Item BB(%u), RF(%u,%u), "
"I=%d, Q=%d expired\n",
cal->bbatt.att, cal->rfatt.att,
@@ -983,7 +983,7 @@ void b43_lo_g_maintanance_work(struct b43_wldev *dev)
}
if (current_item_expired || unlikely(list_empty(&lo->calib_list))) {
/* Recalibrate currently used LO setting. */
- if (b43_debug(dev, B43_DBG_LO))
+ if (b43_debugging(dev, B43_DBG_LO))
b43_dbg(dev->wl, "LO: Recalibrating current LO setting\n");
cal = b43_calibrate_lo_setting(dev, &gphy->bbatt, &gphy->rfatt);
if (cal) {
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 6343873..3d2c655 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -839,9 +839,9 @@ static void rx_tkip_phase1_write(struct b43_wldev *dev, u8 index, u32 iv32,
index -= pairwise_keys_start;
B43_WARN_ON(index >= B43_NR_PAIRWISE_KEYS);
- if (b43_debug(dev, B43_DBG_KEYS)) {
+ if (b43_debugging(dev, B43_DBG_KEYS)) {
b43_dbg(dev->wl, "rx_tkip_phase1_write : idx 0x%x, iv32 0x%x\n",
- index, iv32);
+ index, iv32);
}
/* Write the key to the RX tkip shared mem */
offset = B43_SHM_SH_TKIPTSCTTAK + index * (10 + 4);
@@ -1014,7 +1014,7 @@ static void b43_dump_keymemory(struct b43_wldev *dev)
u64 hf;
struct b43_key *key;
- if (!b43_debug(dev, B43_DBG_KEYS))
+ if (!b43_debugging(dev, B43_DBG_KEYS))
return;
hf = b43_hf_read(dev);
@@ -1857,7 +1857,7 @@ static void b43_do_interrupt_thread(struct b43_wldev *dev)
b43_write32(dev, B43_MMIO_GEN_IRQ_MASK, dev->irq_mask);
#if B43_DEBUG
- if (b43_debug(dev, B43_DBG_VERBOSESTATS)) {
+ if (b43_debugging(dev, B43_DBG_VERBOSESTATS)) {
dev->irq_count++;
for (i = 0; i < ARRAY_SIZE(dev->irq_bit_count); i++) {
if (reason & (1 << i))
@@ -2587,7 +2587,7 @@ static void b43_gpio_cleanup(struct b43_wldev *dev)
/* http://bcm-specs.sipsolutions.net/EnableMac */
void b43_mac_enable(struct b43_wldev *dev)
{
- if (b43_debug(dev, B43_DBG_FIRMWARE)) {
+ if (b43_debugging(dev, B43_DBG_FIRMWARE)) {
u16 fwstate;
fwstate = b43_shm_read16(dev, B43_SHM_SHARED,
@@ -2944,7 +2944,7 @@ static void b43_periodic_every15sec(struct b43_wldev *dev)
wmb();
#if B43_DEBUG
- if (b43_debug(dev, B43_DBG_VERBOSESTATS)) {
+ if (b43_debugging(dev, B43_DBG_VERBOSESTATS)) {
unsigned int i;
b43_dbg(dev->wl, "Stats: %7u IRQs/sec, %7u TX/sec, %7u RX/sec\n",
@@ -2993,14 +2993,14 @@ static void b43_periodic_work_handler(struct work_struct *work)
if (unlikely(b43_status(dev) != B43_STAT_STARTED))
goto out;
- if (b43_debug(dev, B43_DBG_PWORK_STOP))
+ if (b43_debugging(dev, B43_DBG_PWORK_STOP))
goto out_requeue;
do_periodic_work(dev);
dev->periodic_state++;
out_requeue:
- if (b43_debug(dev, B43_DBG_PWORK_FAST))
+ if (b43_debugging(dev, B43_DBG_PWORK_FAST))
delay = msecs_to_jiffies(50);
else
delay = round_jiffies_relative(HZ * 15);
diff --git a/drivers/net/wireless/b43/phy_g.c b/drivers/net/wireless/b43/phy_g.c
index acadae6..ef539a5 100644
--- a/drivers/net/wireless/b43/phy_g.c
+++ b/drivers/net/wireless/b43/phy_g.c
@@ -236,7 +236,7 @@ static void b43_set_txpower_g(struct b43_wldev *dev,
gphy->rfatt.with_padmix = !!(tx_control & B43_TXCTL_TXMIX);
memmove(&gphy->bbatt, bbatt, sizeof(*bbatt));
- if (b43_debug(dev, B43_DBG_XMITPOWER)) {
+ if (b43_debugging(dev, B43_DBG_XMITPOWER)) {
b43_dbg(dev->wl, "Tuning TX-power to bbatt(%u), "
"rfatt(%u), tx_control(0x%02X), "
"tx_bias(0x%02X), tx_magn(0x%02X)\n",
@@ -2862,7 +2862,7 @@ static void b43_gphy_op_adjust_txpower(struct b43_wldev *dev)
gphy->rfatt.att = rfatt;
gphy->bbatt.att = bbatt;
- if (b43_debug(dev, B43_DBG_XMITPOWER))
+ if (b43_debugging(dev, B43_DBG_XMITPOWER))
b43_dbg(dev->wl, "Adjusting TX power\n");
/* Adjust the hardware */
@@ -2929,7 +2929,7 @@ static enum b43_txpwr_result b43_gphy_op_recalc_txpower(struct b43_wldev *dev,
desired_pwr = INT_TO_Q52(phy->desired_txpower);
/* And limit it. max_pwr already is Q5.2 */
desired_pwr = clamp_val(desired_pwr, 0, max_pwr);
- if (b43_debug(dev, B43_DBG_XMITPOWER)) {
+ if (b43_debugging(dev, B43_DBG_XMITPOWER)) {
b43_dbg(dev->wl,
"[TX power] current = " Q52_FMT
" dBm, desired = " Q52_FMT
@@ -2958,7 +2958,7 @@ static enum b43_txpwr_result b43_gphy_op_recalc_txpower(struct b43_wldev *dev,
bbatt_delta -= 4 * rfatt_delta;
#if B43_DEBUG
- if (b43_debug(dev, B43_DBG_XMITPOWER)) {
+ if (b43_debugging(dev, B43_DBG_XMITPOWER)) {
int dbm = pwr_adjust < 0 ? -pwr_adjust : pwr_adjust;
b43_dbg(dev->wl,
"[TX power deltas] %s" Q52_FMT " dBm => "
--
1.7.1.337.g6068.dirty
^ permalink raw reply related
* [PATCH 2/3] drivers/net/wireless/b43: Logging cleanups
From: Joe Perches @ 2010-06-19 23:30 UTC (permalink / raw)
To: Stefano Brivio; +Cc: John W. Linville, linux-wireless, netdev, linux-kernel
In-Reply-To: <cover.1276988387.git.joe@perches.com>
Convert the logging macros and printks to a more standardized style.
Add underscores to b43 logging macros:
b43info -> b43_info
b43err -> b43_err
b43warn -> b43_warn
b43dbg -> b43_dbg
Use pr_<level> in a few places.
Add KERN_<level> in a few places.
Coalesced some format strings.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/wireless/b43/b43.h | 17 +--
drivers/net/wireless/b43/debugfs.c | 14 +-
drivers/net/wireless/b43/dma.c | 115 ++++++++---------
drivers/net/wireless/b43/leds.c | 6 +-
drivers/net/wireless/b43/lo.c | 31 ++---
drivers/net/wireless/b43/main.c | 232 ++++++++++++++++----------------
drivers/net/wireless/b43/pcmcia.c | 3 +-
drivers/net/wireless/b43/phy_a.c | 11 +-
drivers/net/wireless/b43/phy_common.c | 7 +-
drivers/net/wireless/b43/phy_g.c | 54 ++++----
drivers/net/wireless/b43/phy_lp.c | 17 ++-
drivers/net/wireless/b43/phy_n.c | 30 ++--
drivers/net/wireless/b43/pio.c | 12 +-
drivers/net/wireless/b43/rfkill.c | 4 +-
drivers/net/wireless/b43/sysfs.c | 3 +-
drivers/net/wireless/b43/xmit.c | 10 +-
16 files changed, 278 insertions(+), 288 deletions(-)
diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h
index 8674a99..28bf8f2 100644
--- a/drivers/net/wireless/b43/b43.h
+++ b/drivers/net/wireless/b43/b43.h
@@ -895,15 +895,14 @@ static inline bool b43_using_pio_transfers(struct b43_wldev *dev)
#endif
/* Message printing */
-void b43info(struct b43_wl *wl, const char *fmt, ...)
- __attribute__ ((format(printf, 2, 3)));
-void b43err(struct b43_wl *wl, const char *fmt, ...)
- __attribute__ ((format(printf, 2, 3)));
-void b43warn(struct b43_wl *wl, const char *fmt, ...)
- __attribute__ ((format(printf, 2, 3)));
-void b43dbg(struct b43_wl *wl, const char *fmt, ...)
- __attribute__ ((format(printf, 2, 3)));
-
+void b43_info(struct b43_wl *wl, const char *fmt, ...)
+ __attribute__ ((format(printf, 2, 3)));
+void b43_err(struct b43_wl *wl, const char *fmt, ...)
+ __attribute__ ((format(printf, 2, 3)));
+void b43_warn(struct b43_wl *wl, const char *fmt, ...)
+ __attribute__ ((format(printf, 2, 3)));
+void b43_dbg(struct b43_wl *wl, const char *fmt, ...)
+ __attribute__ ((format(printf, 2, 3)));
/* A WARN_ON variant that vanishes when b43 debugging is disabled.
* This _also_ evaluates the arg with debugging disabled. */
diff --git a/drivers/net/wireless/b43/debugfs.c b/drivers/net/wireless/b43/debugfs.c
index 80b19a4..307802c 100644
--- a/drivers/net/wireless/b43/debugfs.c
+++ b/drivers/net/wireless/b43/debugfs.c
@@ -68,7 +68,7 @@ struct b43_dfs_file *fops_to_dfs_file(struct b43_wldev *dev,
bufsize - count, \
fmt , ##x); \
else \
- printk(KERN_ERR "b43: fappend overflow\n"); \
+ pr_err("b43: fappend overflow\n"); \
} while (0)
@@ -703,7 +703,7 @@ void b43_debugfs_add_device(struct b43_wldev *dev)
B43_WARN_ON(!dev);
e = kzalloc(sizeof(*e), GFP_KERNEL);
if (!e) {
- b43err(dev->wl, "debugfs: add device OOM\n");
+ b43_err(dev->wl, "debugfs: add device OOM\n");
return;
}
e->dev = dev;
@@ -711,7 +711,7 @@ void b43_debugfs_add_device(struct b43_wldev *dev)
log->log = kcalloc(B43_NR_LOGGED_TXSTATUS,
sizeof(struct b43_txstatus), GFP_KERNEL);
if (!log->log) {
- b43err(dev->wl, "debugfs: add device txstatus OOM\n");
+ b43_err(dev->wl, "debugfs: add device txstatus OOM\n");
kfree(e);
return;
}
@@ -723,11 +723,11 @@ void b43_debugfs_add_device(struct b43_wldev *dev)
e->subdir = debugfs_create_dir(devdir, rootdir);
if (!e->subdir || IS_ERR(e->subdir)) {
if (e->subdir == ERR_PTR(-ENODEV)) {
- b43dbg(dev->wl, "DebugFS (CONFIG_DEBUG_FS) not "
- "enabled in kernel config\n");
+ b43_dbg(dev->wl,
+ "DebugFS (CONFIG_DEBUG_FS) not enabled in kernel config\n");
} else {
- b43err(dev->wl, "debugfs: cannot create %s directory\n",
- devdir);
+ b43_err(dev->wl, "debugfs: cannot create %s directory\n",
+ devdir);
}
dev->dfsentry = NULL;
kfree(log->log);
diff --git a/drivers/net/wireless/b43/dma.c b/drivers/net/wireless/b43/dma.c
index 10d0aaf..a6d15c4 100644
--- a/drivers/net/wireless/b43/dma.c
+++ b/drivers/net/wireless/b43/dma.c
@@ -266,10 +266,10 @@ static void update_max_used_slots(struct b43_dmaring *ring,
return;
ring->max_used_slots = current_used_slots;
if (b43_debug(ring->dev, B43_DBG_DMAVERBOSE)) {
- b43dbg(ring->dev->wl,
- "max_used_slots increased to %d on %s ring %d\n",
- ring->max_used_slots,
- ring->tx ? "TX" : "RX", ring->index);
+ b43_dbg(ring->dev->wl,
+ "max_used_slots increased to %d on %s ring %d\n",
+ ring->max_used_slots,
+ ring->tx ? "TX" : "RX", ring->index);
}
}
#else
@@ -405,7 +405,7 @@ static int alloc_ringmemory(struct b43_dmaring *ring)
B43_DMA_RINGMEMSIZE,
&(ring->dmabase), flags);
if (!ring->descbase) {
- b43err(ring->dev->wl, "DMA ringmemory allocation failed\n");
+ b43_err(ring->dev->wl, "DMA ringmemory allocation failed\n");
return -ENOMEM;
}
memset(ring->descbase, 0, B43_DMA_RINGMEMSIZE);
@@ -456,7 +456,7 @@ static int b43_dmacontroller_rx_reset(struct b43_wldev *dev, u16 mmio_base,
msleep(1);
}
if (i != -1) {
- b43err(dev->wl, "DMA RX reset timed out\n");
+ b43_err(dev->wl, "DMA RX reset timed out\n");
return -ENODEV;
}
@@ -514,7 +514,7 @@ static int b43_dmacontroller_tx_reset(struct b43_wldev *dev, u16 mmio_base,
msleep(1);
}
if (i != -1) {
- b43err(dev->wl, "DMA TX reset timed out\n");
+ b43_err(dev->wl, "DMA TX reset timed out\n");
return -ENODEV;
}
/* ensure the reset is completed. */
@@ -605,7 +605,7 @@ static int setup_rx_descbuffer(struct b43_dmaring *ring,
dmaaddr = map_descbuffer(ring, skb->data,
ring->rx_buffersize, 0);
if (b43_dma_mapping_error(ring, dmaaddr, ring->rx_buffersize, 0)) {
- b43err(ring->dev->wl, "RX DMA buffer allocation failed\n");
+ b43_err(ring->dev->wl, "RX DMA buffer allocation failed\n");
dev_kfree_skb_any(skb);
return -EIO;
}
@@ -633,8 +633,8 @@ static int alloc_initial_descbuffers(struct b43_dmaring *ring)
err = setup_rx_descbuffer(ring, desc, meta, GFP_KERNEL);
if (err) {
- b43err(ring->dev->wl,
- "Failed to allocate initial descbuffers\n");
+ b43_err(ring->dev->wl,
+ "Failed to allocate initial descbuffers\n");
goto err_unwind;
}
}
@@ -897,8 +897,8 @@ struct b43_dmaring *b43_setup_dmaring(struct b43_wldev *dev,
if (b43_dma_mapping_error(ring, dma_test,
b43_txhdr_size(dev), 1)) {
- b43err(dev->wl,
- "TXHDR DMA allocation failed\n");
+ b43_err(dev->wl,
+ "TXHDR DMA allocation failed\n");
goto err_kfree_txhdr_cache;
}
}
@@ -961,18 +961,18 @@ static void b43_destroy_dmaring(struct b43_dmaring *ring,
if (nr_packets)
average_tries = divide(ring->nr_total_packet_tries * 100, nr_packets);
- b43dbg(ring->dev->wl, "DMA-%u %s: "
- "Used slots %d/%d, Failed frames %llu/%llu = %llu.%01llu%%, "
- "Average tries %llu.%02llu\n",
- (unsigned int)(ring->type), ringname,
- ring->max_used_slots,
- ring->nr_slots,
- (unsigned long long)failed_packets,
- (unsigned long long)nr_packets,
- (unsigned long long)divide(permille_failed, 10),
- (unsigned long long)modulo(permille_failed, 10),
- (unsigned long long)divide(average_tries, 100),
- (unsigned long long)modulo(average_tries, 100));
+ b43_dbg(ring->dev->wl, "DMA-%u %s: "
+ "Used slots %d/%d, Failed frames %llu/%llu = %llu.%01llu%%, "
+ "Average tries %llu.%02llu\n",
+ (unsigned int)(ring->type), ringname,
+ ring->max_used_slots,
+ ring->nr_slots,
+ (unsigned long long)failed_packets,
+ (unsigned long long)nr_packets,
+ (unsigned long long)divide(permille_failed, 10),
+ (unsigned long long)modulo(permille_failed, 10),
+ (unsigned long long)divide(average_tries, 100),
+ (unsigned long long)modulo(average_tries, 100));
}
#endif /* DEBUG */
@@ -1034,15 +1034,14 @@ static int b43_dma_set_mask(struct b43_wldev *dev, u64 mask)
fallback = 1;
continue;
}
- b43err(dev->wl, "The machine/kernel does not support "
- "the required %u-bit DMA mask\n",
- (unsigned int)dma_mask_to_engine_type(orig_mask));
+ b43_err(dev->wl, "The machine/kernel does not support the required %u-bit DMA mask\n",
+ (unsigned int)dma_mask_to_engine_type(orig_mask));
return -EOPNOTSUPP;
}
if (fallback) {
- b43info(dev->wl, "DMA mask fallback from %u-bit to %u-bit\n",
- (unsigned int)dma_mask_to_engine_type(orig_mask),
- (unsigned int)dma_mask_to_engine_type(mask));
+ b43_info(dev->wl, "DMA mask fallback from %u-bit to %u-bit\n",
+ (unsigned int)dma_mask_to_engine_type(orig_mask),
+ (unsigned int)dma_mask_to_engine_type(mask));
}
return 0;
@@ -1091,8 +1090,7 @@ int b43_dma_init(struct b43_wldev *dev)
/* No support for the TX status DMA ring. */
B43_WARN_ON(dev->dev->id.revision < 5);
- b43dbg(dev->wl, "%u-bit DMA initialized\n",
- (unsigned int)type);
+ b43_dbg(dev->wl, "%u-bit DMA initialized\n", (unsigned int)type);
err = 0;
out:
return err;
@@ -1156,8 +1154,8 @@ struct b43_dmaring *parse_cookie(struct b43_wldev *dev, u16 cookie, int *slot)
}
*slot = (cookie & 0x0FFF);
if (unlikely(!ring || *slot < 0 || *slot >= ring->nr_slots)) {
- b43dbg(dev->wl, "TX-status contains "
- "invalid cookie: 0x%04X\n", cookie);
+ b43_dbg(dev->wl, "TX-status contains invalid cookie: 0x%04X\n",
+ cookie);
return NULL;
}
@@ -1274,9 +1272,9 @@ static inline int should_inject_overflow(struct b43_dmaring *ring)
next_overflow = ring->last_injected_overflow + HZ;
if (time_after(jiffies, next_overflow)) {
ring->last_injected_overflow = jiffies;
- b43dbg(ring->dev->wl,
- "Injecting TX ring overflow on "
- "DMA controller %d\n", ring->index);
+ b43_dbg(ring->dev->wl,
+ "Injecting TX ring overflow on DMA controller %d\n",
+ ring->index);
return 1;
}
}
@@ -1343,7 +1341,7 @@ int b43_dma_tx(struct b43_wldev *dev, struct sk_buff *skb)
* the queue is stopped, thus we got called when we shouldn't.
* For now, just refuse the transmit. */
if (b43_debug(dev, B43_DBG_DMAVERBOSE))
- b43err(dev->wl, "Packet after queue stopped\n");
+ b43_err(dev->wl, "Packet after queue stopped\n");
err = -ENOSPC;
goto out;
}
@@ -1351,7 +1349,7 @@ int b43_dma_tx(struct b43_wldev *dev, struct sk_buff *skb)
if (unlikely(WARN_ON(free_slots(ring) < TX_SLOTS_PER_FRAME))) {
/* If we get here, we have a real error with the queue
* full, but queues not stopped. */
- b43err(dev->wl, "DMA queue overflow\n");
+ b43_err(dev->wl, "DMA queue overflow\n");
err = -ENOSPC;
goto out;
}
@@ -1370,7 +1368,7 @@ int b43_dma_tx(struct b43_wldev *dev, struct sk_buff *skb)
goto out;
}
if (unlikely(err)) {
- b43err(dev->wl, "DMA tx mapping failure\n");
+ b43_err(dev->wl, "DMA tx mapping failure\n");
goto out;
}
if ((free_slots(ring) < TX_SLOTS_PER_FRAME) ||
@@ -1379,7 +1377,7 @@ int b43_dma_tx(struct b43_wldev *dev, struct sk_buff *skb)
ieee80211_stop_queue(dev->wl->hw, skb_get_queue_mapping(skb));
ring->stopped = 1;
if (b43_debug(dev, B43_DBG_DMAVERBOSE)) {
- b43dbg(dev->wl, "Stopped TX ring %d\n", ring->index);
+ b43_dbg(dev->wl, "Stopped TX ring %d\n", ring->index);
}
}
out:
@@ -1411,9 +1409,9 @@ void b43_dma_handle_txstatus(struct b43_wldev *dev,
if (unlikely(slot != firstused)) {
/* This possibly is a firmware bug and will result in
* malfunction, memory leaks and/or stall of DMA functionality. */
- b43dbg(dev->wl, "Out of order TX status report on DMA ring %d. "
- "Expected %d, but got %d\n",
- ring->index, firstused, slot);
+ b43_dbg(dev->wl, "Out of order TX status report on DMA ring %d. "
+ "Expected %d, but got %d\n",
+ ring->index, firstused, slot);
return;
}
@@ -1423,9 +1421,8 @@ void b43_dma_handle_txstatus(struct b43_wldev *dev,
desc = ops->idx2desc(ring, slot, &meta);
if (b43_dma_ptr_is_poisoned(meta->skb)) {
- b43dbg(dev->wl, "Poisoned TX slot %d (first=%d) "
- "on ring %d\n",
- slot, firstused, ring->index);
+ b43_dbg(dev->wl, "Poisoned TX slot %d (first=%d) on ring %d\n",
+ slot, firstused, ring->index);
break;
}
if (meta->skb) {
@@ -1446,9 +1443,9 @@ void b43_dma_handle_txstatus(struct b43_wldev *dev,
if (unlikely(!meta->skb)) {
/* This is a scatter-gather fragment of a frame, so
* the skb pointer must not be NULL. */
- b43dbg(dev->wl, "TX status unexpected NULL skb "
- "at slot %d (first=%d) on ring %d\n",
- slot, firstused, ring->index);
+ b43_dbg(dev->wl,
+ "TX status unexpected NULL skb at slot %d (first=%d) on ring %d\n",
+ slot, firstused, ring->index);
break;
}
@@ -1476,9 +1473,9 @@ void b43_dma_handle_txstatus(struct b43_wldev *dev,
* this is only the txhdr, which is not allocated.
*/
if (unlikely(meta->skb)) {
- b43dbg(dev->wl, "TX status unexpected non-NULL skb "
- "at slot %d (first=%d) on ring %d\n",
- slot, firstused, ring->index);
+ b43_dbg(dev->wl,
+ "TX status unexpected non-NULL skb at slot %d (first=%d) on ring %d\n",
+ slot, firstused, ring->index);
break;
}
}
@@ -1498,7 +1495,7 @@ void b43_dma_handle_txstatus(struct b43_wldev *dev,
ieee80211_wake_queue(dev->wl->hw, ring->queue_prio);
ring->stopped = 0;
if (b43_debug(dev, B43_DBG_DMAVERBOSE)) {
- b43dbg(dev->wl, "Woke up TX ring %d\n", ring->index);
+ b43_dbg(dev->wl, "Woke up TX ring %d\n", ring->index);
}
}
}
@@ -1537,7 +1534,7 @@ static void dma_rx(struct b43_dmaring *ring, int *slot)
if (unlikely(b43_rx_buffer_is_poisoned(ring, skb))) {
/* Something went wrong with the DMA.
* The device did not touch the buffer and did not overwrite the poison. */
- b43dbg(ring->dev->wl, "DMA RX: Dropping poisoned buffer.\n");
+ b43_dbg(ring->dev->wl, "DMA RX: Dropping poisoned buffer\n");
dmaaddr = meta->dmaaddr;
goto drop_recycle_buffer;
}
@@ -1562,16 +1559,16 @@ static void dma_rx(struct b43_dmaring *ring, int *slot)
if (tmp <= 0)
break;
}
- b43err(ring->dev->wl, "DMA RX buffer too small "
- "(len: %u, buffer: %u, nr-dropped: %d)\n",
- len, ring->rx_buffersize, cnt);
+ b43_err(ring->dev->wl, "DMA RX buffer too small "
+ "(len: %u, buffer: %u, nr-dropped: %d)\n",
+ len, ring->rx_buffersize, cnt);
goto drop;
}
dmaaddr = meta->dmaaddr;
err = setup_rx_descbuffer(ring, desc, meta, GFP_ATOMIC);
if (unlikely(err)) {
- b43dbg(ring->dev->wl, "DMA RX: setup_rx_descbuffer() failed\n");
+ b43_dbg(ring->dev->wl, "DMA RX: setup_rx_descbuffer() failed\n");
goto drop_recycle_buffer;
}
diff --git a/drivers/net/wireless/b43/leds.c b/drivers/net/wireless/b43/leds.c
index c587115..4bf526e 100644
--- a/drivers/net/wireless/b43/leds.c
+++ b/drivers/net/wireless/b43/leds.c
@@ -140,7 +140,7 @@ static int b43_register_led(struct b43_wldev *dev, struct b43_led *led,
err = led_classdev_register(dev->dev->dev, &led->led_dev);
if (err) {
- b43warn(dev->wl, "LEDs: Failed to register %s\n", name);
+ b43_warn(dev->wl, "LEDs: Failed to register %s\n", name);
led->wl = NULL;
return err;
}
@@ -204,8 +204,8 @@ static void b43_map_led(struct b43_wldev *dev,
led_index, activelow);
break;
default:
- b43warn(dev->wl, "LEDs: Unknown behaviour 0x%02X\n",
- behaviour);
+ b43_warn(dev->wl, "LEDs: Unknown behaviour 0x%02X\n",
+ behaviour);
break;
}
}
diff --git a/drivers/net/wireless/b43/lo.c b/drivers/net/wireless/b43/lo.c
index 94e4f13..c16c35c 100644
--- a/drivers/net/wireless/b43/lo.c
+++ b/drivers/net/wireless/b43/lo.c
@@ -62,8 +62,8 @@ static void b43_lo_write(struct b43_wldev *dev, struct b43_loctl *control)
if (B43_DEBUG) {
if (unlikely(abs(control->i) > 16 || abs(control->q) > 16)) {
- b43dbg(dev->wl, "Invalid LO control pair "
- "(I: %d, Q: %d)\n", control->i, control->q);
+ b43_dbg(dev->wl, "Invalid LO control pair "
+ "(I: %d, Q: %d)\n", control->i, control->q);
dump_stack();
return;
}
@@ -775,15 +775,15 @@ struct b43_lo_calib *b43_calibrate_lo_setting(struct b43_wldev *dev,
b43_mac_enable(dev);
if (b43_debug(dev, B43_DBG_LO)) {
- b43dbg(dev->wl, "LO: Calibrated for BB(%u), RF(%u,%u) "
- "=> I=%d Q=%d\n",
- bbatt->att, rfatt->att, rfatt->with_padmix,
- loctl.i, loctl.q);
+ b43_dbg(dev->wl, "LO: Calibrated for BB(%u), RF(%u,%u) "
+ "=> I=%d Q=%d\n",
+ bbatt->att, rfatt->att, rfatt->with_padmix,
+ loctl.i, loctl.q);
}
cal = kmalloc(sizeof(*cal), GFP_KERNEL);
if (!cal) {
- b43warn(dev->wl, "LO calib: out of memory\n");
+ b43_warn(dev->wl, "LO calib: out of memory\n");
return NULL;
}
memcpy(&cal->bbatt, bbatt, sizeof(*bbatt));
@@ -857,8 +857,7 @@ void b43_gphy_dc_lt_init(struct b43_wldev *dev, bool update_all)
cal = b43_calibrate_lo_setting(dev, bbatt, rfatt);
if (!cal) {
- b43warn(dev->wl, "LO: Could not "
- "calibrate DC table entry\n");
+ b43_warn(dev->wl, "LO: Could not calibrate DC table entry\n");
continue;
}
/*FIXME: Is Q really in the low nibble? */
@@ -973,11 +972,11 @@ void b43_lo_g_maintanance_work(struct b43_wldev *dev)
current_item_expired = 1;
}
if (b43_debug(dev, B43_DBG_LO)) {
- b43dbg(dev->wl, "LO: Item BB(%u), RF(%u,%u), "
- "I=%d, Q=%d expired\n",
- cal->bbatt.att, cal->rfatt.att,
- cal->rfatt.with_padmix,
- cal->ctl.i, cal->ctl.q);
+ b43_dbg(dev->wl, "LO: Item BB(%u), RF(%u,%u), "
+ "I=%d, Q=%d expired\n",
+ cal->bbatt.att, cal->rfatt.att,
+ cal->rfatt.with_padmix,
+ cal->ctl.i, cal->ctl.q);
}
list_del(&cal->list);
kfree(cal);
@@ -985,13 +984,13 @@ void b43_lo_g_maintanance_work(struct b43_wldev *dev)
if (current_item_expired || unlikely(list_empty(&lo->calib_list))) {
/* Recalibrate currently used LO setting. */
if (b43_debug(dev, B43_DBG_LO))
- b43dbg(dev->wl, "LO: Recalibrating current LO setting\n");
+ b43_dbg(dev->wl, "LO: Recalibrating current LO setting\n");
cal = b43_calibrate_lo_setting(dev, &gphy->bbatt, &gphy->rfatt);
if (cal) {
list_add(&cal->list, &lo->calib_list);
b43_lo_write(dev, &cal->ctl);
} else
- b43warn(dev->wl, "Failed to recalibrate current LO setting\n");
+ b43_warn(dev->wl, "Failed to recalibrate current LO setting\n");
}
}
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 8031f24..6343873 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -331,13 +331,13 @@ void b43info(struct b43_wl *wl, const char *fmt, ...)
if (!b43_ratelimit(wl))
return;
va_start(args, fmt);
- printk(KERN_INFO "b43-%s: ",
- (wl && wl->hw) ? wiphy_name(wl->hw->wiphy) : "wlan");
+ pr_info("b43-%s: ",
+ (wl && wl->hw) ? wiphy_name(wl->hw->wiphy) : "wlan");
vprintk(fmt, args);
va_end(args);
}
-void b43err(struct b43_wl *wl, const char *fmt, ...)
+void b43_err(struct b43_wl *wl, const char *fmt, ...)
{
va_list args;
@@ -346,13 +346,13 @@ void b43err(struct b43_wl *wl, const char *fmt, ...)
if (!b43_ratelimit(wl))
return;
va_start(args, fmt);
- printk(KERN_ERR "b43-%s ERROR: ",
+ pr_err("b43-%s ERROR: ",
(wl && wl->hw) ? wiphy_name(wl->hw->wiphy) : "wlan");
vprintk(fmt, args);
va_end(args);
}
-void b43warn(struct b43_wl *wl, const char *fmt, ...)
+void b43_warn(struct b43_wl *wl, const char *fmt, ...)
{
va_list args;
@@ -361,13 +361,13 @@ void b43warn(struct b43_wl *wl, const char *fmt, ...)
if (!b43_ratelimit(wl))
return;
va_start(args, fmt);
- printk(KERN_WARNING "b43-%s warning: ",
- (wl && wl->hw) ? wiphy_name(wl->hw->wiphy) : "wlan");
+ pr_warning("b43-%s warning: ",
+ (wl && wl->hw) ? wiphy_name(wl->hw->wiphy) : "wlan");
vprintk(fmt, args);
va_end(args);
}
-void b43dbg(struct b43_wl *wl, const char *fmt, ...)
+void b43_dbg(struct b43_wl *wl, const char *fmt, ...)
{
va_list args;
@@ -840,7 +840,7 @@ static void rx_tkip_phase1_write(struct b43_wldev *dev, u8 index, u32 iv32,
B43_WARN_ON(index >= B43_NR_PAIRWISE_KEYS);
if (b43_debug(dev, B43_DBG_KEYS)) {
- b43dbg(dev->wl, "rx_tkip_phase1_write : idx 0x%x, iv32 0x%x\n",
+ b43_dbg(dev->wl, "rx_tkip_phase1_write : idx 0x%x, iv32 0x%x\n",
index, iv32);
}
/* Write the key to the RX tkip shared mem */
@@ -959,7 +959,7 @@ static int b43_key_write(struct b43_wldev *dev,
}
}
if (index < 0) {
- b43warn(dev->wl, "Out of hardware key memory\n");
+ b43_warn(dev->wl, "Out of hardware key memory\n");
return -ENOSPC;
}
} else
@@ -1018,7 +1018,7 @@ static void b43_dump_keymemory(struct b43_wldev *dev)
return;
hf = b43_hf_read(dev);
- b43dbg(dev->wl, "Hardware key memory dump: USEDEFKEYS=%u\n",
+ b43_dbg(dev->wl, "Hardware key memory dump: USEDEFKEYS=%u\n",
!!(hf & B43_HF_USEDEFKEYS));
if (b43_new_kidx_api(dev)) {
pairwise_keys_start = B43_NR_GROUP_KEYS;
@@ -1034,20 +1034,20 @@ static void b43_dump_keymemory(struct b43_wldev *dev)
offset = dev->ktp + (index * B43_SEC_KEYSIZE);
for (i = 0; i < B43_SEC_KEYSIZE; i += 2) {
u16 tmp = b43_shm_read16(dev, B43_SHM_SHARED, offset + i);
- printk("%02X%02X", (tmp & 0xFF), ((tmp >> 8) & 0xFF));
+ pr_cont("%02X%02X", (tmp & 0xFF), ((tmp >> 8) & 0xFF));
}
algo = b43_shm_read16(dev, B43_SHM_SHARED,
B43_SHM_SH_KEYIDXBLOCK + (index * 2));
- printk(" Algo: %04X/%02X", algo, key->algorithm);
+ pr_cont(" Algo: %04X/%02X", algo, key->algorithm);
if (index >= pairwise_keys_start) {
if (key->algorithm == B43_SEC_ALGO_TKIP) {
- printk(" TKIP: ");
+ pr_cont(" TKIP: ");
offset = B43_SHM_SH_TKIPTSCTTAK + (index - 4) * (10 + 4);
for (i = 0; i < 14; i += 2) {
u16 tmp = b43_shm_read16(dev, B43_SHM_SHARED, offset + i);
- printk("%02X%02X", (tmp & 0xFF), ((tmp >> 8) & 0xFF));
+ pr_cont("%02X%02X", (tmp & 0xFF), ((tmp >> 8) & 0xFF));
}
}
rcmta0 = b43_shm_read32(dev, B43_SHM_RCMTA,
@@ -1056,10 +1056,9 @@ static void b43_dump_keymemory(struct b43_wldev *dev)
((index - pairwise_keys_start) * 2) + 1);
*((__le32 *)(&mac[0])) = cpu_to_le32(rcmta0);
*((__le16 *)(&mac[4])) = cpu_to_le16(rcmta1);
- printk(" MAC: %pM", mac);
+ pr_cont(" MAC: %pM\n", mac);
} else
- printk(" DEFAULT KEY");
- printk("\n");
+ pr_cont(" DEFAULT KEY\n");
}
}
@@ -1511,7 +1510,7 @@ static void b43_write_beacon_template(struct b43_wldev *dev,
b43_shm_write16(dev, B43_SHM_SHARED,
B43_SHM_SH_DTIMPER, 0);
}
- b43dbg(dev->wl, "Updated beacon template at 0x%x\n", ram_offset);
+ b43_dbg(dev->wl, "Updated beacon template at 0x%x\n", ram_offset);
}
static void b43_upload_beacon0(struct b43_wldev *dev)
@@ -1666,7 +1665,7 @@ static void b43_set_beacon_int(struct b43_wldev *dev, u16 beacon_int)
b43_write16(dev, 0x610, beacon_int);
}
b43_time_unlock(dev);
- b43dbg(dev->wl, "Set beacon interval to %u\n", beacon_int);
+ b43_dbg(dev->wl, "Set beacon interval to %u\n", beacon_int);
}
static void b43_handle_firmware_panic(struct b43_wldev *dev)
@@ -1675,11 +1674,11 @@ static void b43_handle_firmware_panic(struct b43_wldev *dev)
/* Read the register that contains the reason code for the panic. */
reason = b43_shm_read16(dev, B43_SHM_SCRATCH, B43_FWPANIC_REASON_REG);
- b43err(dev->wl, "Whoopsy, firmware panic! Reason: %u\n", reason);
+ b43_err(dev->wl, "Whoopsy, firmware panic! Reason: %u\n", reason);
switch (reason) {
default:
- b43dbg(dev->wl, "The panic reason is unknown.\n");
+ b43_dbg(dev->wl, "The panic reason is unknown\n");
/* fallthrough */
case B43_FWPANIC_DIE:
/* Do not restart the controller or firmware.
@@ -1715,14 +1714,14 @@ static void handle_irq_ucode_debug(struct b43_wldev *dev)
break; /* Only with driver debugging enabled. */
buf = kmalloc(4096, GFP_ATOMIC);
if (!buf) {
- b43dbg(dev->wl, "SHM-dump: Failed to allocate memory\n");
+ b43_dbg(dev->wl, "SHM-dump: Failed to allocate memory\n");
goto out;
}
for (i = 0; i < 4096; i += 2) {
u16 tmp = b43_shm_read16(dev, B43_SHM_SHARED, i);
buf[i / 2] = cpu_to_le16(tmp);
}
- b43info(dev->wl, "Shared memory dump:\n");
+ b43_info(dev->wl, "Shared memory dump:\n");
print_hex_dump(KERN_INFO, "", DUMP_PREFIX_OFFSET,
16, 2, buf, 4096, 1);
kfree(buf);
@@ -1730,19 +1729,20 @@ static void handle_irq_ucode_debug(struct b43_wldev *dev)
case B43_DEBUGIRQ_DUMP_REGS:
if (!B43_DEBUG)
break; /* Only with driver debugging enabled. */
- b43info(dev->wl, "Microcode register dump:\n");
+ b43_info(dev->wl, "Microcode register dump:\n");
for (i = 0, cnt = 0; i < 64; i++) {
u16 tmp = b43_shm_read16(dev, B43_SHM_SCRATCH, i);
- if (cnt == 0)
- printk(KERN_INFO);
- printk("r%02u: 0x%04X ", i, tmp);
+ printk("%sr%02u: 0x%04X ",
+ cnt == 0 ? KERN_INFO : KERN_CONT,
+ i, tmp);
cnt++;
if (cnt == 6) {
- printk("\n");
+ pr_cont("\n");
cnt = 0;
}
}
- printk("\n");
+ if (cnt)
+ pr_cont("\n");
break;
case B43_DEBUGIRQ_MARKER:
if (!B43_DEBUG)
@@ -1751,12 +1751,12 @@ static void handle_irq_ucode_debug(struct b43_wldev *dev)
B43_MARKER_ID_REG);
marker_line = b43_shm_read16(dev, B43_SHM_SCRATCH,
B43_MARKER_LINE_REG);
- b43info(dev->wl, "The firmware just executed the MARKER(%u) "
+ b43_info(dev->wl, "The firmware just executed the MARKER(%u) "
"at line number %u\n",
marker_id, marker_line);
break;
default:
- b43dbg(dev->wl, "Debug-IRQ triggered for unknown reason: %u\n",
+ b43_dbg(dev->wl, "Debug-IRQ triggered for unknown reason: %u\n",
reason);
}
out:
@@ -1782,15 +1782,15 @@ static void b43_do_interrupt_thread(struct b43_wldev *dev)
}
if (unlikely(reason & B43_IRQ_MAC_TXERR))
- b43err(dev->wl, "MAC transmission error\n");
+ b43_err(dev->wl, "MAC transmission error\n");
if (unlikely(reason & B43_IRQ_PHY_TXERR)) {
- b43err(dev->wl, "PHY transmission error\n");
+ b43_err(dev->wl, "PHY transmission error\n");
rmb();
if (unlikely(atomic_dec_and_test(&dev->phy.txerr_cnt))) {
atomic_set(&dev->phy.txerr_cnt,
B43_PHY_TX_BADNESS_LIMIT);
- b43err(dev->wl, "Too many PHY TX errors, "
+ b43_err(dev->wl, "Too many PHY TX errors, "
"restarting the controller\n");
b43_controller_restart(dev, "PHY TX errors");
}
@@ -1799,13 +1799,13 @@ static void b43_do_interrupt_thread(struct b43_wldev *dev)
if (unlikely(merged_dma_reason & (B43_DMAIRQ_FATALMASK |
B43_DMAIRQ_NONFATALMASK))) {
if (merged_dma_reason & B43_DMAIRQ_FATALMASK) {
- b43err(dev->wl, "Fatal DMA error: "
+ b43_err(dev->wl, "Fatal DMA error: "
"0x%08X, 0x%08X, 0x%08X, "
"0x%08X, 0x%08X, 0x%08X\n",
dma_reason[0], dma_reason[1],
dma_reason[2], dma_reason[3],
dma_reason[4], dma_reason[5]);
- b43err(dev->wl, "This device does not support DMA "
+ b43_err(dev->wl, "This device does not support DMA "
"on your system. Please use PIO instead.\n");
/* Fall back to PIO transfers if we get fatal DMA errors! */
dev->use_pio = 1;
@@ -1813,7 +1813,7 @@ static void b43_do_interrupt_thread(struct b43_wldev *dev)
return;
}
if (merged_dma_reason & B43_DMAIRQ_NONFATALMASK) {
- b43err(dev->wl, "DMA error: "
+ b43_err(dev->wl, "DMA error: "
"0x%08X, 0x%08X, 0x%08X, "
"0x%08X, 0x%08X, 0x%08X\n",
dma_reason[0], dma_reason[1],
@@ -1978,15 +1978,15 @@ static void b43_release_firmware(struct b43_wldev *dev)
static void b43_print_fw_helptext(struct b43_wl *wl, bool error)
{
const char text[] =
- "You must go to " \
- "http://wireless.kernel.org/en/users/Drivers/b43#devicefirmware " \
- "and download the correct firmware for this driver version. " \
+ "You must go to "
+ "http://wireless.kernel.org/en/users/Drivers/b43#devicefirmware "
+ "and download the correct firmware for this driver version. "
"Please carefully read all instructions on this website.\n";
if (error)
- b43err(wl, text);
+ b43_err(wl, text);
else
- b43warn(wl, text);
+ b43_warn(wl, text);
}
int b43_do_request_fw(struct b43_request_fw_context *ctx,
@@ -2072,7 +2072,7 @@ int b43_do_request_fw(struct b43_request_fw_context *ctx,
err_format:
snprintf(ctx->errors[ctx->req_type],
sizeof(ctx->errors[ctx->req_type]),
- "Firmware file \"%s\" format error.\n", ctx->fwname);
+ "Firmware file \"%s\" format error\n", ctx->fwname);
release_firmware(blob);
return -EPROTO;
@@ -2211,19 +2211,19 @@ static int b43_try_request_fw(struct b43_request_fw_context *ctx)
err_no_ucode:
err = ctx->fatal_failure = -EOPNOTSUPP;
- b43err(dev->wl, "The driver does not know which firmware (ucode) "
+ b43_err(dev->wl, "The driver does not know which firmware (ucode) "
"is required for your device (wl-core rev %u)\n", rev);
goto error;
err_no_pcm:
err = ctx->fatal_failure = -EOPNOTSUPP;
- b43err(dev->wl, "The driver does not know which firmware (PCM) "
+ b43_err(dev->wl, "The driver does not know which firmware (PCM) "
"is required for your device (wl-core rev %u)\n", rev);
goto error;
err_no_initvals:
err = ctx->fatal_failure = -EOPNOTSUPP;
- b43err(dev->wl, "The driver does not know which firmware (initvals) "
+ b43_err(dev->wl, "The driver does not know which firmware (initvals) "
"is required for your device (wl-core rev %u)\n", rev);
goto error;
@@ -2270,7 +2270,7 @@ static int b43_request_firmware(struct b43_wldev *dev)
for (i = 0; i < B43_NR_FWTYPES; i++) {
errmsg = ctx->errors[i];
if (strlen(errmsg))
- b43err(dev->wl, errmsg);
+ b43_err(dev->wl, errmsg);
}
b43_print_fw_helptext(dev->wl, 1);
err = -ENOENT;
@@ -2339,7 +2339,7 @@ static int b43_upload_microcode(struct b43_wldev *dev)
break;
i++;
if (i >= 20) {
- b43err(dev->wl, "Microcode not responding\n");
+ b43_err(dev->wl, "Microcode not responding\n");
b43_print_fw_helptext(dev->wl, 1);
err = -ENODEV;
goto error;
@@ -2355,7 +2355,7 @@ static int b43_upload_microcode(struct b43_wldev *dev)
fwtime = b43_shm_read16(dev, B43_SHM_SHARED, B43_SHM_SH_UCODETIME);
if (fwrev <= 0x128) {
- b43err(dev->wl, "YOUR FIRMWARE IS TOO OLD. Firmware from "
+ b43_err(dev->wl, "YOUR FIRMWARE IS TOO OLD. Firmware from "
"binary drivers older than version 4.x is unsupported. "
"You must upgrade your firmware files.\n");
b43_print_fw_helptext(dev->wl, 1);
@@ -2377,17 +2377,17 @@ static int b43_upload_microcode(struct b43_wldev *dev)
/* Patchlevel info is encoded in the "time" field. */
dev->fw.patch = fwtime;
- b43info(dev->wl, "Loading OpenSource firmware version %u.%u\n",
+ b43_info(dev->wl, "Loading OpenSource firmware version %u.%u\n",
dev->fw.rev, dev->fw.patch);
fwcapa = b43_fwcapa_read(dev);
if (!(fwcapa & B43_FWCAPA_HWCRYPTO) || dev->fw.pcm_request_failed) {
- b43info(dev->wl, "Hardware crypto acceleration not supported by firmware\n");
+ b43_info(dev->wl, "Hardware crypto acceleration not supported by firmware\n");
/* Disable hardware crypto and fall back to software crypto. */
dev->hwcrypto_enabled = 0;
}
if (!(fwcapa & B43_FWCAPA_QOS)) {
- b43info(dev->wl, "QoS not supported by firmware\n");
+ b43_info(dev->wl, "QoS not supported by firmware\n");
/* Disable QoS. Tweak hw->queues to 1. It will be restored before
* ieee80211_unregister to make sure the networking core can
* properly free possible resources. */
@@ -2395,13 +2395,13 @@ static int b43_upload_microcode(struct b43_wldev *dev)
dev->qos_enabled = 0;
}
} else {
- b43info(dev->wl, "Loading firmware version %u.%u "
+ b43_info(dev->wl, "Loading firmware version %u.%u "
"(20%.2i-%.2i-%.2i %.2i:%.2i:%.2i)\n",
fwrev, fwpatch,
(fwdate >> 12) & 0xF, (fwdate >> 8) & 0xF, fwdate & 0xFF,
(fwtime >> 11) & 0x1F, (fwtime >> 5) & 0x3F, fwtime & 0x1F);
if (dev->fw.pcm_request_failed) {
- b43warn(dev->wl, "No \"pcm5.fw\" firmware file found. "
+ b43_warn(dev->wl, "No \"pcm5.fw\" firmware file found. "
"Hardware accelerated cryptography is disabled.\n");
b43_print_fw_helptext(dev->wl, 0);
}
@@ -2410,7 +2410,7 @@ static int b43_upload_microcode(struct b43_wldev *dev)
if (b43_is_old_txhdr_format(dev)) {
/* We're over the deadline, but we keep support for old fw
* until it turns out to be in major conflict with something new. */
- b43warn(dev->wl, "You are using an old firmware image. "
+ b43_warn(dev->wl, "You are using an old firmware image. "
"Support for old firmware will be removed soon "
"(official deadline was July 2008).\n");
b43_print_fw_helptext(dev->wl, 0);
@@ -2482,7 +2482,7 @@ static int b43_write_initvals(struct b43_wldev *dev,
return 0;
err_format:
- b43err(dev->wl, "Initial Values Firmware file-format error.\n");
+ b43_err(dev->wl, "Initial Values Firmware file-format error\n");
b43_print_fw_helptext(dev->wl, 1);
return -EPROTO;
@@ -2594,7 +2594,7 @@ void b43_mac_enable(struct b43_wldev *dev)
B43_SHM_SH_UCODESTAT);
if ((fwstate != B43_SHM_SH_UCODESTAT_SUSP) &&
(fwstate != B43_SHM_SH_UCODESTAT_SLEEP)) {
- b43err(dev->wl, "b43_mac_enable(): The firmware "
+ b43_err(dev->wl, "b43_mac_enable(): The firmware "
"should be suspended, but current state is %u\n",
fwstate);
}
@@ -2644,7 +2644,7 @@ void b43_mac_suspend(struct b43_wldev *dev)
goto out;
msleep(1);
}
- b43err(dev->wl, "MAC suspend failed\n");
+ b43_err(dev->wl, "MAC suspend failed\n");
}
out:
dev->mac_suspended++;
@@ -2892,7 +2892,7 @@ static int b43_chip_init(struct b43_wldev *dev)
dev->dev->bus->chipco.fast_pwrup_delay);
err = 0;
- b43dbg(dev->wl, "Chip initialized\n");
+ b43_dbg(dev->wl, "Chip initialized\n");
out:
return err;
@@ -2928,7 +2928,7 @@ static void b43_periodic_every15sec(struct b43_wldev *dev)
* It will reset the watchdog counter to 0 in its idle loop. */
wdr = b43_shm_read16(dev, B43_SHM_SCRATCH, B43_WATCHDOG_REG);
if (unlikely(wdr)) {
- b43err(dev->wl, "Firmware watchdog: The firmware died!\n");
+ b43_err(dev->wl, "Firmware watchdog: The firmware died!\n");
b43_controller_restart(dev, "Firmware watchdog");
return;
} else {
@@ -2947,7 +2947,7 @@ static void b43_periodic_every15sec(struct b43_wldev *dev)
if (b43_debug(dev, B43_DBG_VERBOSESTATS)) {
unsigned int i;
- b43dbg(dev->wl, "Stats: %7u IRQs/sec, %7u TX/sec, %7u RX/sec\n",
+ b43_dbg(dev->wl, "Stats: %7u IRQs/sec, %7u TX/sec, %7u RX/sec\n",
dev->irq_count / 15,
dev->tx_count / 15,
dev->rx_count / 15);
@@ -2956,7 +2956,7 @@ static void b43_periodic_every15sec(struct b43_wldev *dev)
dev->rx_count = 0;
for (i = 0; i < ARRAY_SIZE(dev->irq_bit_count); i++) {
if (dev->irq_bit_count[i]) {
- b43dbg(dev->wl, "Stats: %7u IRQ-%02u/sec (0x%08X)\n",
+ b43_dbg(dev->wl, "Stats: %7u IRQ-%02u/sec (0x%08X)\n",
dev->irq_bit_count[i] / 15, i, (1 << i));
dev->irq_bit_count[i] = 0;
}
@@ -3041,13 +3041,13 @@ static int b43_validate_chipaccess(struct b43_wldev *dev)
b43_shm_write16(dev, B43_SHM_SHARED, 4, 0x5566);
b43_shm_write16(dev, B43_SHM_SHARED, 6, 0x7788);
if (b43_shm_read32(dev, B43_SHM_SHARED, 2) != 0x55663344)
- b43warn(dev->wl, "Unaligned 32bit SHM read access is broken\n");
+ b43_warn(dev->wl, "Unaligned 32bit SHM read access is broken\n");
b43_shm_write32(dev, B43_SHM_SHARED, 2, 0xAABBCCDD);
if (b43_shm_read16(dev, B43_SHM_SHARED, 0) != 0x1122 ||
b43_shm_read16(dev, B43_SHM_SHARED, 2) != 0xCCDD ||
b43_shm_read16(dev, B43_SHM_SHARED, 4) != 0xAABB ||
b43_shm_read16(dev, B43_SHM_SHARED, 6) != 0x7788)
- b43warn(dev->wl, "Unaligned 32bit SHM write access is broken\n");
+ b43_warn(dev->wl, "Unaligned 32bit SHM write access is broken\n");
b43_shm_write32(dev, B43_SHM_SHARED, 0, backup0);
b43_shm_write32(dev, B43_SHM_SHARED, 4, backup4);
@@ -3071,7 +3071,7 @@ static int b43_validate_chipaccess(struct b43_wldev *dev)
return 0;
error:
- b43err(dev->wl, "Failed to validate the chipaccess\n");
+ b43_err(dev->wl, "Failed to validate the chipaccess\n");
return -ENODEV;
}
@@ -3129,7 +3129,7 @@ static int b43_rng_init(struct b43_wl *wl)
err = hwrng_register(&wl->rng);
if (err) {
wl->rng_initialized = 0;
- b43err(wl, "Failed to register the random "
+ b43_err(wl, "Failed to register the random "
"number generator (%d)\n", err);
}
#endif /* CONFIG_B43_HWRNG */
@@ -3310,7 +3310,7 @@ static void b43_qos_init(struct b43_wldev *dev)
b43_write16(dev, B43_MMIO_IFSCTL,
b43_read16(dev, B43_MMIO_IFSCTL)
& ~B43_MMIO_IFSCTL_USE_EDCF);
- b43dbg(dev->wl, "QoS disabled\n");
+ b43_dbg(dev->wl, "QoS disabled\n");
return;
}
@@ -3322,7 +3322,7 @@ static void b43_qos_init(struct b43_wldev *dev)
b43_write16(dev, B43_MMIO_IFSCTL,
b43_read16(dev, B43_MMIO_IFSCTL)
| B43_MMIO_IFSCTL_USE_EDCF);
- b43dbg(dev->wl, "QoS enabled\n");
+ b43_dbg(dev->wl, "QoS enabled\n");
}
static int b43_op_conf_tx(struct ieee80211_hw *hw, u16 _queue,
@@ -3471,7 +3471,7 @@ static int b43_switch_band(struct b43_wl *wl, struct ieee80211_channel *chan)
break;
}
if (!up_dev) {
- b43err(wl, "Could not find a device for %s-GHz band operation\n",
+ b43_err(wl, "Could not find a device for %s-GHz band operation\n",
band_to_string(chan->band));
return -ENODEV;
}
@@ -3480,7 +3480,7 @@ static int b43_switch_band(struct b43_wl *wl, struct ieee80211_channel *chan)
/* This device is already running. */
return 0;
}
- b43dbg(wl, "Switching to %s-GHz band\n",
+ b43_dbg(wl, "Switching to %s-GHz band\n",
band_to_string(chan->band));
down_dev = wl->current_dev;
@@ -3502,18 +3502,18 @@ static int b43_switch_band(struct b43_wl *wl, struct ieee80211_channel *chan)
if (prev_status >= B43_STAT_INITIALIZED) {
err = b43_wireless_core_init(up_dev);
if (err) {
- b43err(wl, "Fatal: Could not initialize device for "
- "selected %s-GHz band\n",
- band_to_string(chan->band));
+ b43_err(wl, "Fatal: Could not initialize device for "
+ "selected %s-GHz band\n",
+ band_to_string(chan->band));
goto init_failure;
}
}
if (prev_status >= B43_STAT_STARTED) {
err = b43_wireless_core_start(up_dev);
if (err) {
- b43err(wl, "Fatal: Coult not start device for "
- "selected %s-GHz band\n",
- band_to_string(chan->band));
+ b43_err(wl, "Fatal: Coult not start device for "
+ "selected %s-GHz band\n",
+ band_to_string(chan->band));
b43_wireless_core_exit(up_dev);
goto init_failure;
}
@@ -3604,15 +3604,15 @@ static int b43_op_config(struct ieee80211_hw *hw, u32 changed)
if (wl->radio_enabled != phy->radio_on) {
if (wl->radio_enabled) {
b43_software_rfkill(dev, false);
- b43info(dev->wl, "Radio turned on by software\n");
+ b43_info(dev->wl, "Radio turned on by software\n");
if (!dev->radio_hw_enable) {
- b43info(dev->wl, "The hardware RF-kill button "
- "still turns the radio physically off. "
- "Press the button to turn it on.\n");
+ b43_info(dev->wl, "The hardware RF-kill button "
+ "still turns the radio physically off. "
+ "Press the button to turn it on.\n");
}
} else {
b43_software_rfkill(dev, true);
- b43info(dev->wl, "Radio turned off by software\n");
+ b43_info(dev->wl, "Radio turned off by software\n");
}
}
@@ -3827,10 +3827,10 @@ static int b43_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
out_unlock:
if (!err) {
- b43dbg(wl, "%s hardware based encryption for keyidx: %d, "
- "mac: %pM\n",
- cmd == SET_KEY ? "Using" : "Disabling", key->keyidx,
- sta ? sta->addr : bcast_addr);
+ b43_dbg(wl, "%s hardware based encryption for keyidx: %d, "
+ "mac: %pM\n",
+ cmd == SET_KEY ? "Using" : "Disabling", key->keyidx,
+ sta ? sta->addr : bcast_addr);
b43_dump_keymemory(dev);
}
mutex_unlock(&wl->mutex);
@@ -3940,7 +3940,7 @@ redo:
b43_mac_suspend(dev);
b43_leds_exit(dev);
- b43dbg(wl, "Wireless interface stopped\n");
+ b43_dbg(wl, "Wireless interface stopped\n");
return dev;
}
@@ -3956,7 +3956,7 @@ static int b43_wireless_core_start(struct b43_wldev *dev)
if (dev->dev->bus->bustype == SSB_BUSTYPE_SDIO) {
err = b43_sdio_request_irq(dev, b43_sdio_interrupt_handler);
if (err) {
- b43err(dev->wl, "Cannot request SDIO IRQ\n");
+ b43_err(dev->wl, "Cannot request SDIO IRQ\n");
goto out;
}
} else {
@@ -3964,7 +3964,8 @@ static int b43_wireless_core_start(struct b43_wldev *dev)
b43_interrupt_thread_handler,
IRQF_SHARED, KBUILD_MODNAME, dev);
if (err) {
- b43err(dev->wl, "Cannot request IRQ-%d\n", dev->dev->irq);
+ b43_err(dev->wl, "Cannot request IRQ-%d\n",
+ dev->dev->irq);
goto out;
}
}
@@ -3982,7 +3983,7 @@ static int b43_wireless_core_start(struct b43_wldev *dev)
b43_leds_init(dev);
- b43dbg(dev->wl, "Wireless interface started\n");
+ b43_dbg(dev->wl, "Wireless interface started\n");
out:
return err;
}
@@ -4035,13 +4036,12 @@ static int b43_phy_versioning(struct b43_wldev *dev)
unsupported = 1;
};
if (unsupported) {
- b43err(dev->wl, "FOUND UNSUPPORTED PHY "
- "(Analog %u, Type %u, Revision %u)\n",
- analog_type, phy_type, phy_rev);
+ b43_err(dev->wl, "FOUND UNSUPPORTED PHY (Analog %u, Type %u, Revision %u)\n",
+ analog_type, phy_type, phy_rev);
return -EOPNOTSUPP;
}
- b43dbg(dev->wl, "Found PHY: Analog %u, Type %u, Revision %u\n",
- analog_type, phy_type, phy_rev);
+ b43_dbg(dev->wl, "Found PHY: Analog %u, Type %u, Revision %u\n",
+ analog_type, phy_type, phy_rev);
/* Get RADIO versioning */
if (dev->dev->bus->chip_id == 0x4317) {
@@ -4091,13 +4091,13 @@ static int b43_phy_versioning(struct b43_wldev *dev)
B43_WARN_ON(1);
}
if (unsupported) {
- b43err(dev->wl, "FOUND UNSUPPORTED RADIO "
- "(Manuf 0x%X, Version 0x%X, Revision %u)\n",
- radio_manuf, radio_ver, radio_rev);
+ b43_err(dev->wl, "FOUND UNSUPPORTED RADIO "
+ "(Manuf 0x%X, Version 0x%X, Revision %u)\n",
+ radio_manuf, radio_ver, radio_rev);
return -EOPNOTSUPP;
}
- b43dbg(dev->wl, "Found Radio: Manuf 0x%X, Version 0x%X, Revision %u\n",
- radio_manuf, radio_ver, radio_rev);
+ b43_dbg(dev->wl, "Found Radio: Manuf 0x%X, Version 0x%X, Revision %u\n",
+ radio_manuf, radio_ver, radio_rev);
phy->radio_manuf = radio_manuf;
phy->radio_ver = radio_ver;
@@ -4412,7 +4412,7 @@ static int b43_op_add_interface(struct ieee80211_hw *hw,
if (wl->operating)
goto out_mutex_unlock;
- b43dbg(wl, "Adding Interface type %d\n", vif->type);
+ b43_dbg(wl, "Adding Interface type %d\n", vif->type);
dev = wl->current_dev;
wl->operating = 1;
@@ -4438,7 +4438,7 @@ static void b43_op_remove_interface(struct ieee80211_hw *hw,
struct b43_wl *wl = hw_to_b43_wl(hw);
struct b43_wldev *dev = wl->current_dev;
- b43dbg(wl, "Removing Interface type %d\n", vif->type);
+ b43_dbg(wl, "Removing Interface type %d\n", vif->type);
mutex_lock(&wl->mutex);
@@ -4656,9 +4656,9 @@ out:
wl->current_dev = NULL; /* Failed to init the dev. */
mutex_unlock(&wl->mutex);
if (err)
- b43err(wl, "Controller restart FAILED\n");
+ b43_err(wl, "Controller restart FAILED\n");
else
- b43info(wl, "Controller restarted\n");
+ b43_info(wl, "Controller restarted\n");
}
static int b43_setup_bands(struct b43_wldev *dev,
@@ -4708,7 +4708,7 @@ static int b43_wireless_core_attach(struct b43_wldev *dev)
err = ssb_bus_powerup(bus, 0);
if (err) {
- b43err(wl, "Bus powerup failed\n");
+ b43_err(wl, "Bus powerup failed\n");
goto out;
}
/* Get the PHY type. */
@@ -4754,7 +4754,7 @@ static int b43_wireless_core_attach(struct b43_wldev *dev)
}
if (dev->phy.type == B43_PHYTYPE_A) {
/* FIXME */
- b43err(wl, "IEEE 802.11a devices are unsupported\n");
+ b43_err(wl, "IEEE 802.11a devices are unsupported\n");
err = -EOPNOTSUPP;
goto err_powerdown;
}
@@ -4836,7 +4836,7 @@ static int b43_one_core_attach(struct ssb_device *dev, struct b43_wl *wl)
if (!pdev ||
((pdev->device != 0x4321) &&
(pdev->device != 0x4313) && (pdev->device != 0x431A))) {
- b43dbg(wl, "Ignoring unconnected 802.11 core\n");
+ b43_dbg(wl, "Ignoring unconnected 802.11 core\n");
return -ENODEV;
}
}
@@ -4918,7 +4918,7 @@ static int b43_wireless_init(struct ssb_device *dev)
hw = ieee80211_alloc_hw(sizeof(*wl), &b43_hw_ops);
if (!hw) {
- b43err(NULL, "Could not allocate ieee80211 device\n");
+ b43_err(NULL, "Could not allocate ieee80211 device\n");
goto out;
}
wl = hw_to_b43_wl(hw);
@@ -4954,8 +4954,8 @@ static int b43_wireless_init(struct ssb_device *dev)
skb_queue_head_init(&wl->tx_queue);
ssb_set_devtypedata(dev, wl);
- b43info(wl, "Broadcom %04X WLAN found (core revision %u)\n",
- dev->bus->chip_id, dev->id.revision);
+ b43_info(wl, "Broadcom %04X WLAN found (core revision %u)\n",
+ dev->bus->chip_id, dev->id.revision);
err = 0;
out:
return err;
@@ -5037,7 +5037,7 @@ void b43_controller_restart(struct b43_wldev *dev, const char *reason)
/* Must avoid requeueing, if we are in shutdown. */
if (b43_status(dev) < B43_STAT_INITIALIZED)
return;
- b43info(dev->wl, "Controller RESET (%s) ...\n", reason);
+ b43_info(dev->wl, "Controller RESET (%s) ...\n", reason);
ieee80211_queue_work(dev->wl->hw, &dev->restart_work);
}
@@ -5068,11 +5068,11 @@ static void b43_print_driverinfo(void)
#ifdef CONFIG_B43_SDIO
feat_sdio = "S";
#endif
- printk(KERN_INFO "Broadcom 43xx driver loaded "
- "[ Features: %s%s%s%s%s, Firmware-ID: "
- B43_SUPPORTED_FIRMWARE_ID " ]\n",
- feat_pci, feat_pcmcia, feat_nphy,
- feat_leds, feat_sdio);
+ pr_info("Broadcom 43xx driver loaded "
+ "[ Features: %s%s%s%s%s, Firmware-ID: "
+ B43_SUPPORTED_FIRMWARE_ID " ]\n",
+ feat_pci, feat_pcmcia, feat_nphy,
+ feat_leds, feat_sdio);
}
static int __init b43_init(void)
diff --git a/drivers/net/wireless/b43/pcmcia.c b/drivers/net/wireless/b43/pcmcia.c
index 0e99b63..9dafa68 100644
--- a/drivers/net/wireless/b43/pcmcia.c
+++ b/drivers/net/wireless/b43/pcmcia.c
@@ -117,8 +117,7 @@ err_disable:
err_kfree_ssb:
kfree(ssb);
out_error:
- printk(KERN_ERR "b43-pcmcia: Initialization failed (%d, %d)\n",
- res, err);
+ pr_err("b43-pcmcia: Initialization failed (%d, %d)\n", res, err);
return err;
}
diff --git a/drivers/net/wireless/b43/phy_a.c b/drivers/net/wireless/b43/phy_a.c
index b6428ec..11062b7 100644
--- a/drivers/net/wireless/b43/phy_a.c
+++ b/drivers/net/wireless/b43/phy_a.c
@@ -344,8 +344,7 @@ static int b43_aphy_init_tssi2dbm_table(struct b43_wldev *dev)
/* pabX values not set in SPROM,
* but APHY needs a generated table. */
aphy->tssi2dbm = NULL;
- b43err(dev->wl, "Could not generate tssi2dBm "
- "table (wrong SPROM info)!\n");
+ b43_err(dev->wl, "Could not generate tssi2dBm table (wrong SPROM info)!\n");
return -ENODEV;
}
@@ -427,14 +426,14 @@ static inline u16 adjust_phyreg(struct b43_wldev *dev, u16 offset)
#if B43_DEBUG
if ((offset & B43_PHYROUTE) == B43_PHYROUTE_EXT_GPHY) {
/* Ext-G registers are only available on G-PHYs */
- b43err(dev->wl, "Invalid EXT-G PHY access at "
- "0x%04X on A-PHY\n", offset);
+ b43_err(dev->wl, "Invalid EXT-G PHY access at "
+ "0x%04X on A-PHY\n", offset);
dump_stack();
}
if ((offset & B43_PHYROUTE) == B43_PHYROUTE_N_BMODE) {
/* N-BMODE registers are only available on N-PHYs */
- b43err(dev->wl, "Invalid N-BMODE PHY access at "
- "0x%04X on A-PHY\n", offset);
+ b43_err(dev->wl, "Invalid N-BMODE PHY access at "
+ "0x%04X on A-PHY\n", offset);
dump_stack();
}
#endif /* B43_DEBUG */
diff --git a/drivers/net/wireless/b43/phy_common.c b/drivers/net/wireless/b43/phy_common.c
index 8f7d7ef..128ffff 100644
--- a/drivers/net/wireless/b43/phy_common.c
+++ b/drivers/net/wireless/b43/phy_common.c
@@ -87,14 +87,14 @@ int b43_phy_init(struct b43_wldev *dev)
ops->software_rfkill(dev, false);
err = ops->init(dev);
if (err) {
- b43err(dev->wl, "PHY init failed\n");
+ b43_err(dev->wl, "PHY init failed\n");
goto err_block_rf;
}
/* Make sure to switch hardware and firmware (SHM) to
* the default channel. */
err = b43_switch_channel(dev, ops->get_default_chan(dev));
if (err) {
- b43err(dev->wl, "PHY init: Channel switch to default failed\n");
+ b43_err(dev->wl, "PHY init: Channel switch to default failed\n");
goto err_phy_exit;
}
@@ -192,8 +192,7 @@ static inline void assert_mac_suspended(struct b43_wldev *dev)
return;
if ((b43_status(dev) >= B43_STAT_INITIALIZED) &&
(dev->mac_suspended <= 0)) {
- b43dbg(dev->wl, "PHY/RADIO register access with "
- "enabled MAC.\n");
+ b43_dbg(dev->wl, "PHY/RADIO register access with enabled MAC\n");
dump_stack();
}
}
diff --git a/drivers/net/wireless/b43/phy_g.c b/drivers/net/wireless/b43/phy_g.c
index 29bf34c..acadae6 100644
--- a/drivers/net/wireless/b43/phy_g.c
+++ b/drivers/net/wireless/b43/phy_g.c
@@ -237,10 +237,10 @@ static void b43_set_txpower_g(struct b43_wldev *dev,
memmove(&gphy->bbatt, bbatt, sizeof(*bbatt));
if (b43_debug(dev, B43_DBG_XMITPOWER)) {
- b43dbg(dev->wl, "Tuning TX-power to bbatt(%u), "
- "rfatt(%u), tx_control(0x%02X), "
- "tx_bias(0x%02X), tx_magn(0x%02X)\n",
- bb, rf, tx_control, tx_bias, tx_magn);
+ b43_dbg(dev->wl, "Tuning TX-power to bbatt(%u), "
+ "rfatt(%u), tx_control(0x%02X), "
+ "tx_bias(0x%02X), tx_magn(0x%02X)\n",
+ bb, rf, tx_control, tx_bias, tx_magn);
}
b43_gphy_set_baseband_attenuation(dev, bb);
@@ -1970,11 +1970,12 @@ static void b43_phy_init_pctl(struct b43_wldev *dev)
if (B43_DEBUG) {
/* Current-Idle-TSSI sanity check. */
if (abs(gphy->cur_idle_tssi - gphy->tgt_idle_tssi) >= 20) {
- b43dbg(dev->wl,
- "!WARNING! Idle-TSSI phy->cur_idle_tssi "
- "measuring failed. (cur=%d, tgt=%d). Disabling TX power "
- "adjustment.\n", gphy->cur_idle_tssi,
- gphy->tgt_idle_tssi);
+ b43_dbg(dev->wl,
+ "!WARNING! Idle-TSSI phy->cur_idle_tssi "
+ "measuring failed. (cur=%d, tgt=%d). "
+ "Disabling TX power adjustment.\n",
+ gphy->cur_idle_tssi,
+ gphy->tgt_idle_tssi);
gphy->cur_idle_tssi = 0;
}
}
@@ -2360,15 +2361,13 @@ u8 *b43_generate_dyn_tssi2dbm_tab(struct b43_wldev *dev,
tab = kmalloc(64, GFP_KERNEL);
if (!tab) {
- b43err(dev->wl, "Could not allocate memory "
- "for tssi2dbm table\n");
+ b43_err(dev->wl, "Could not allocate memory for tssi2dbm table\n");
return NULL;
}
for (i = 0; i < 64; i++) {
err = b43_tssi2dbm_entry(tab, i, pab0, pab1, pab2);
if (err) {
- b43err(dev->wl, "Could not generate "
- "tssi2dBm table\n");
+ b43_err(dev->wl, "Could not generate tssi2dBm table\n");
kfree(tab);
return NULL;
}
@@ -2864,7 +2863,7 @@ static void b43_gphy_op_adjust_txpower(struct b43_wldev *dev)
gphy->bbatt.att = bbatt;
if (b43_debug(dev, B43_DBG_XMITPOWER))
- b43dbg(dev->wl, "Adjusting TX power\n");
+ b43_dbg(dev->wl, "Adjusting TX power\n");
/* Adjust the hardware */
b43_phy_lock(dev);
@@ -2918,8 +2917,7 @@ static enum b43_txpwr_result b43_gphy_op_recalc_txpower(struct b43_wldev *dev,
if (dev->dev->bus->sprom.boardflags_lo & B43_BFL_PACTRL)
max_pwr -= 3; /* minus 0.75 */
if (unlikely(max_pwr >= INT_TO_Q52(30/*dBm*/))) {
- b43warn(dev->wl,
- "Invalid max-TX-power value in SPROM.\n");
+ b43_warn(dev->wl, "Invalid max-TX-power value in SPROM\n");
max_pwr = INT_TO_Q52(20); /* fake it */
dev->dev->bus->sprom.maxpwr_bg = max_pwr;
}
@@ -2932,13 +2930,13 @@ static enum b43_txpwr_result b43_gphy_op_recalc_txpower(struct b43_wldev *dev,
/* And limit it. max_pwr already is Q5.2 */
desired_pwr = clamp_val(desired_pwr, 0, max_pwr);
if (b43_debug(dev, B43_DBG_XMITPOWER)) {
- b43dbg(dev->wl,
- "[TX power] current = " Q52_FMT
- " dBm, desired = " Q52_FMT
- " dBm, max = " Q52_FMT "\n",
- Q52_ARG(estimated_pwr),
- Q52_ARG(desired_pwr),
- Q52_ARG(max_pwr));
+ b43_dbg(dev->wl,
+ "[TX power] current = " Q52_FMT
+ " dBm, desired = " Q52_FMT
+ " dBm, max = " Q52_FMT "\n",
+ Q52_ARG(estimated_pwr),
+ Q52_ARG(desired_pwr),
+ Q52_ARG(max_pwr));
}
/* Calculate the adjustment delta. */
@@ -2962,11 +2960,11 @@ static enum b43_txpwr_result b43_gphy_op_recalc_txpower(struct b43_wldev *dev,
#if B43_DEBUG
if (b43_debug(dev, B43_DBG_XMITPOWER)) {
int dbm = pwr_adjust < 0 ? -pwr_adjust : pwr_adjust;
- b43dbg(dev->wl,
- "[TX power deltas] %s" Q52_FMT " dBm => "
- "bbatt-delta = %d, rfatt-delta = %d\n",
- (pwr_adjust < 0 ? "-" : ""), Q52_ARG(dbm),
- bbatt_delta, rfatt_delta);
+ b43_dbg(dev->wl,
+ "[TX power deltas] %s" Q52_FMT " dBm => "
+ "bbatt-delta = %d, rfatt-delta = %d\n",
+ (pwr_adjust < 0 ? "-" : ""), Q52_ARG(dbm),
+ bbatt_delta, rfatt_delta);
}
#endif /* DEBUG */
diff --git a/drivers/net/wireless/b43/phy_lp.c b/drivers/net/wireless/b43/phy_lp.c
index c6afe9d..2b706a8 100644
--- a/drivers/net/wireless/b43/phy_lp.c
+++ b/drivers/net/wireless/b43/phy_lp.c
@@ -594,8 +594,9 @@ static void lpphy_2062_init(struct b43_wldev *dev)
}
if (!fd)
fd = &freqdata_tab[ARRAY_SIZE(freqdata_tab) - 1];
- b43dbg(dev->wl, "b2062: Using crystal tab entry %u kHz.\n",
- fd->freq); /* FIXME: Keep this printk until the code is fully debugged. */
+
+ /* FIXME: Keep this printk until the code is fully debugged. */
+ b43_dbg(dev->wl, "b2062: Using crystal tab entry %u kHz\n", fd->freq);
b43_radio_write(dev, B2062_S_RFPLL_CTL8,
((u16)(fd->data[1]) << 4) | fd->data[0]);
@@ -1210,9 +1211,9 @@ static void lpphy_rev0_1_rc_calib(struct b43_wldev *dev)
err = b43_lpphy_op_switch_channel(dev, 7);
if (err) {
- b43dbg(dev->wl,
- "RC calib: Failed to switch to channel 7, error = %d\n",
- err);
+ b43_dbg(dev->wl,
+ "RC calib: Failed to switch to channel 7, error = %d\n",
+ err);
}
old_txg_ovr = !!(b43_phy_read(dev, B43_LPPHY_AFE_CTL_OVR) & 0x40);
old_bbmult = lpphy_get_bb_mult(dev);
@@ -1590,7 +1591,7 @@ static void lpphy_pr41573_workaround(struct b43_wldev *dev)
saved_tab = kcalloc(saved_tab_size, sizeof(saved_tab[0]), GFP_KERNEL);
if (!saved_tab) {
- b43err(dev->wl, "PR41573 failed. Out of memory!\n");
+ b43_err(dev->wl, "PR41573 failed. Out of memory!\n");
return;
}
@@ -2676,8 +2677,8 @@ static int b43_lpphy_op_init(struct b43_wldev *dev)
lpphy_calibrate_rc(dev);
err = b43_lpphy_op_switch_channel(dev, 7);
if (err) {
- b43dbg(dev->wl, "Switch to channel 7 failed, error = %d.\n",
- err);
+ b43_dbg(dev->wl, "Switch to channel 7 failed, error = %d\n",
+ err);
}
lpphy_tx_pctl_init(dev);
lpphy_calibration(dev);
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index 3d6b337..3da6b59 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -221,7 +221,7 @@ static void b43_radio_init2055_post(struct b43_wldev *dev)
udelay(10);
}
if (i)
- b43err(dev->wl, "radio post init timeout\n");
+ b43_err(dev->wl, "radio post init timeout\n");
b43_radio_mask(dev, B2055_CAL_LPOCTL, 0xFF7F);
nphy_channel_switch(dev, dev->phy.channel);
b43_radio_write(dev, B2055_C1_RX_BB_LPF, 0x9);
@@ -1139,7 +1139,7 @@ static int b43_nphy_load_samples(struct b43_wldev *dev,
data = kzalloc(len * sizeof(u32), GFP_KERNEL);
if (!data) {
- b43err(dev->wl, "allocation for samples loading failed\n");
+ b43_err(dev->wl, "allocation for samples loading failed\n");
return -ENOMEM;
}
if (nphy->hang_avoid)
@@ -1183,7 +1183,7 @@ static u16 b43_nphy_gen_load_samples(struct b43_wldev *dev, u32 freq, u16 max,
samples = kzalloc(len * sizeof(struct b43_c32), GFP_KERNEL);
if (!samples) {
- b43err(dev->wl, "allocation for samples generation failed\n");
+ b43_err(dev->wl, "allocation for samples generation failed\n");
return 0;
}
rot = (((freq * 36) / bw) << 16) / 100;
@@ -1256,7 +1256,7 @@ static void b43_nphy_run_samples(struct b43_wldev *dev, u16 samps, u16 loops,
udelay(10);
}
if (i)
- b43err(dev->wl, "run samples timeout\n");
+ b43_err(dev->wl, "run samples timeout\n");
b43_phy_write(dev, B43_NPHY_RFSEQMODE, seq_mode);
}
@@ -1391,7 +1391,7 @@ static void b43_nphy_force_rf_sequence(struct b43_wldev *dev,
goto ok;
msleep(1);
}
- b43err(dev->wl, "RF sequence status timeout\n");
+ b43_err(dev->wl, "RF sequence status timeout\n");
ok:
b43_phy_write(dev, B43_NPHY_RFSEQMODE, seq_mode);
}
@@ -1410,7 +1410,7 @@ static void b43_nphy_rf_control_override(struct b43_wldev *dev, u16 field,
const struct nphy_rf_control_override_rev3 *rf_ctrl;
for (i = 0; i < 2; i++) {
if (index == 0 || index == 16) {
- b43err(dev->wl,
+ b43_err(dev->wl,
"Unsupported RF Ctrl Override call\n");
return;
}
@@ -1445,7 +1445,7 @@ static void b43_nphy_rf_control_override(struct b43_wldev *dev, u16 field,
for (i = 0; i < 2; i++) {
if (index <= 1 || index == 16) {
- b43err(dev->wl,
+ b43_err(dev->wl,
"Unsupported RF Ctrl Override call\n");
return;
}
@@ -1511,7 +1511,7 @@ static void b43_nphy_rf_control_intc_override(struct b43_wldev *dev, u8 field,
udelay(10);
}
if (j)
- b43err(dev->wl,
+ b43_err(dev->wl,
"intc override timeout\n");
b43_phy_mask(dev, B43_NPHY_TXF_40CO_B1S1,
0xFFFE);
@@ -1530,7 +1530,7 @@ static void b43_nphy_rf_control_intc_override(struct b43_wldev *dev, u8 field,
udelay(10);
}
if (j)
- b43err(dev->wl,
+ b43_err(dev->wl,
"intc override timeout\n");
b43_phy_mask(dev, B43_NPHY_RFCTL_OVER,
0xFFFE);
@@ -3265,7 +3265,7 @@ int b43_phy_initn(struct b43_wldev *dev)
if (phy->rev >= 3)
b43_nphy_spur_workaround(dev);
- b43err(dev->wl, "IEEE 802.11n devices are not supported, yet.\n");
+ b43_err(dev->wl, "IEEE 802.11n devices are not supported yet\n");
return 0;
}
@@ -3437,14 +3437,14 @@ static inline void check_phyreg(struct b43_wldev *dev, u16 offset)
#if B43_DEBUG
if ((offset & B43_PHYROUTE) == B43_PHYROUTE_OFDM_GPHY) {
/* OFDM registers are onnly available on A/G-PHYs */
- b43err(dev->wl, "Invalid OFDM PHY access at "
- "0x%04X on N-PHY\n", offset);
+ b43_err(dev->wl, "Invalid OFDM PHY access at "
+ "0x%04X on N-PHY\n", offset);
dump_stack();
}
if ((offset & B43_PHYROUTE) == B43_PHYROUTE_EXT_GPHY) {
/* Ext-G registers are only available on G-PHYs */
- b43err(dev->wl, "Invalid EXT-G PHY access at "
- "0x%04X on N-PHY\n", offset);
+ b43_err(dev->wl, "Invalid EXT-G PHY access at "
+ "0x%04X on N-PHY\n", offset);
dump_stack();
}
#endif /* B43_DEBUG */
@@ -3491,7 +3491,7 @@ static void b43_nphy_op_software_rfkill(struct b43_wldev *dev,
struct b43_phy_n *nphy = dev->phy.n;
if (b43_read32(dev, B43_MMIO_MACCTL) & B43_MACCTL_ENABLED)
- b43err(dev->wl, "MAC not suspended\n");
+ b43_err(dev->wl, "MAC not suspended\n");
if (blocked) {
b43_phy_mask(dev, B43_NPHY_RFCTL_CMD,
diff --git a/drivers/net/wireless/b43/pio.c b/drivers/net/wireless/b43/pio.c
index aa12273..3a7b487 100644
--- a/drivers/net/wireless/b43/pio.c
+++ b/drivers/net/wireless/b43/pio.c
@@ -278,7 +278,7 @@ int b43_pio_init(struct b43_wldev *dev)
if (!pio->rx_queue)
goto err_destroy_mcast;
- b43dbg(dev->wl, "PIO initialized\n");
+ b43_dbg(dev->wl, "PIO initialized\n");
err = 0;
out:
return err;
@@ -525,12 +525,12 @@ int b43_pio_tx(struct b43_wldev *dev, struct sk_buff *skb)
if (unlikely(total_len > q->buffer_size)) {
err = -ENOBUFS;
- b43dbg(dev->wl, "PIO: TX packet longer than queue.\n");
+ b43_dbg(dev->wl, "PIO: TX packet longer than queue\n");
goto out;
}
if (unlikely(q->free_packet_slots == 0)) {
err = -ENOBUFS;
- b43warn(dev->wl, "PIO: TX packet overflow.\n");
+ b43_warn(dev->wl, "PIO: TX packet overflow\n");
goto out;
}
B43_WARN_ON(q->buffer_used > q->buffer_size);
@@ -557,7 +557,7 @@ int b43_pio_tx(struct b43_wldev *dev, struct sk_buff *skb)
goto out;
}
if (unlikely(err)) {
- b43err(dev->wl, "PIO transmission failure\n");
+ b43_err(dev->wl, "PIO transmission failure\n");
goto out;
}
@@ -651,7 +651,7 @@ static bool pio_rx_frame(struct b43_pio_rxqueue *q)
udelay(10);
}
}
- b43dbg(q->dev->wl, "PIO RX timed out\n");
+ b43_dbg(q->dev->wl, "PIO RX timed out\n");
return 1;
data_ready:
@@ -745,7 +745,7 @@ data_ready:
rx_error:
if (err_msg)
- b43dbg(q->dev->wl, "PIO RX error: %s\n", err_msg);
+ b43_dbg(q->dev->wl, "PIO RX error: %s\n", err_msg);
if (q->rev >= 8)
b43_piorx_write32(q, B43_PIO8_RXCTL, B43_PIO8_RXCTL_DATARDY);
else
diff --git a/drivers/net/wireless/b43/rfkill.c b/drivers/net/wireless/b43/rfkill.c
index 78016ae..2a532a3 100644
--- a/drivers/net/wireless/b43/rfkill.c
+++ b/drivers/net/wireless/b43/rfkill.c
@@ -70,8 +70,8 @@ void b43_rfkill_poll(struct ieee80211_hw *hw)
if (unlikely(enabled != dev->radio_hw_enable)) {
dev->radio_hw_enable = enabled;
- b43info(wl, "Radio hardware status changed to %s\n",
- enabled ? "ENABLED" : "DISABLED");
+ b43_info(wl, "Radio hardware status changed to %s\n",
+ enabled ? "ENABLED" : "DISABLED");
wiphy_rfkill_set_hw_state(hw->wiphy, !enabled);
if (enabled != dev->phy.radio_on)
b43_software_rfkill(dev, !enabled);
diff --git a/drivers/net/wireless/b43/sysfs.c b/drivers/net/wireless/b43/sysfs.c
index f1ae4e0..b949e91 100644
--- a/drivers/net/wireless/b43/sysfs.c
+++ b/drivers/net/wireless/b43/sysfs.c
@@ -123,8 +123,7 @@ static ssize_t b43_attr_interfmode_store(struct device *dev,
if (wldev->phy.ops->interf_mitigation) {
err = wldev->phy.ops->interf_mitigation(wldev, mode);
if (err) {
- b43err(wldev->wl, "Interference Mitigation not "
- "supported by device\n");
+ b43_err(wldev->wl, "Interference Mitigation not supported by device\n");
}
} else
err = -ENOSYS;
diff --git a/drivers/net/wireless/b43/xmit.c b/drivers/net/wireless/b43/xmit.c
index e6b0528..3e416f3 100644
--- a/drivers/net/wireless/b43/xmit.c
+++ b/drivers/net/wireless/b43/xmit.c
@@ -573,14 +573,14 @@ void b43_rx(struct b43_wldev *dev, struct sk_buff *skb, const void *_rxhdr)
/* Skip PLCP and padding */
padding = (macstat & B43_RX_MAC_PADDING) ? 2 : 0;
if (unlikely(skb->len < (sizeof(struct b43_plcp_hdr6) + padding))) {
- b43dbg(dev->wl, "RX: Packet size underrun (1)\n");
+ b43_dbg(dev->wl, "RX: Packet size underrun (1)\n");
goto drop;
}
plcp = (struct b43_plcp_hdr6 *)(skb->data + padding);
skb_pull(skb, sizeof(struct b43_plcp_hdr6) + padding);
/* The skb contains the Wireless Header + payload data now */
if (unlikely(skb->len < (2 + 2 + 6 /*minimum hdr */ + FCS_LEN))) {
- b43dbg(dev->wl, "RX: Packet size underrun (2)\n");
+ b43_dbg(dev->wl, "RX: Packet size underrun (2)\n");
goto drop;
}
wlhdr = (struct ieee80211_hdr *)(skb->data);
@@ -601,8 +601,8 @@ void b43_rx(struct b43_wldev *dev, struct sk_buff *skb, const void *_rxhdr)
if (dev->key[keyidx].algorithm != B43_SEC_ALGO_NONE) {
wlhdr_len = ieee80211_hdrlen(fctl);
if (unlikely(skb->len < (wlhdr_len + 3))) {
- b43dbg(dev->wl,
- "RX: Packet size underrun (3)\n");
+ b43_dbg(dev->wl,
+ "RX: Packet size underrun (3)\n");
goto drop;
}
status.flag |= RX_FLAG_DECRYPTED;
@@ -695,7 +695,7 @@ void b43_rx(struct b43_wldev *dev, struct sk_buff *skb, const void *_rxhdr)
#endif
return;
drop:
- b43dbg(dev->wl, "RX: Packet dropped\n");
+ b43_dbg(dev->wl, "RX: Packet dropped\n");
dev_kfree_skb_any(skb);
}
--
1.7.1.337.g6068.dirty
^ permalink raw reply related
* [PATCH 1/3] drivers/net/wireless/b43: Use local ratelimit_state
From: Joe Perches @ 2010-06-19 23:30 UTC (permalink / raw)
To: Stefano Brivio
Cc: John W. Linville, linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <cover.1276988387.git.joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
Avoid limiting the logging output of other networking devices
Signed-off-by: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
---
drivers/net/wireless/b43/main.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 7965b70..8031f24 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -311,13 +311,15 @@ static int b43_wireless_core_start(struct b43_wldev *dev);
static int b43_ratelimit(struct b43_wl *wl)
{
+ static DEFINE_RATELIMIT_STATE(ratelimit, 5 * HZ, 10);
+
if (!wl || !wl->current_dev)
return 1;
if (b43_status(wl->current_dev) < B43_STAT_STARTED)
return 1;
/* We are up and running.
* Ratelimit the messages to avoid DoS over the net. */
- return net_ratelimit();
+ return __ratelimit(&ratelimit);
}
void b43info(struct b43_wl *wl, const char *fmt, ...)
--
1.7.1.337.g6068.dirty
--
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 related
* [PATCH 0/3] b43: logging cleanups
From: Joe Perches @ 2010-06-19 23:30 UTC (permalink / raw)
To: Stefano Brivio; +Cc: John W. Linville, linux-wireless, netdev, linux-kernel
Just some small cleanups
Joe Perches (3):
drivers/net/wireless/b43: Use local ratelimit_state
drivers/net/wireless/b43: Logging cleanups
drivers/net/wireless/b43: Rename b43_debug to b43_debugging
drivers/net/wireless/b43/b43.h | 17 +--
drivers/net/wireless/b43/debugfs.c | 16 +-
drivers/net/wireless/b43/debugfs.h | 4 +-
drivers/net/wireless/b43/dma.c | 125 ++++++++---------
drivers/net/wireless/b43/leds.c | 6 +-
drivers/net/wireless/b43/lo.c | 37 +++---
drivers/net/wireless/b43/main.c | 252 +++++++++++++++++----------------
drivers/net/wireless/b43/pcmcia.c | 3 +-
drivers/net/wireless/b43/phy_a.c | 11 +-
drivers/net/wireless/b43/phy_common.c | 7 +-
drivers/net/wireless/b43/phy_g.c | 62 ++++----
drivers/net/wireless/b43/phy_lp.c | 17 ++-
drivers/net/wireless/b43/phy_n.c | 30 ++--
drivers/net/wireless/b43/pio.c | 12 +-
drivers/net/wireless/b43/rfkill.c | 4 +-
drivers/net/wireless/b43/sysfs.c | 3 +-
drivers/net/wireless/b43/xmit.c | 10 +-
17 files changed, 304 insertions(+), 312 deletions(-)
^ permalink raw reply
* Re: Distributed Switch Architecture(DSA)
From: Lennert Buytenhek @ 2010-06-19 18:57 UTC (permalink / raw)
To: Joakim Tjernlund; +Cc: netdev
In-Reply-To: <OF9D3E1FC3.D7320E72-ONC1257747.0066095A-C1257747.006751E1@transmode.se>
On Sat, Jun 19, 2010 at 08:48:31PM +0200, Joakim Tjernlund wrote:
> > > > > Not sure how one would express whether VLAN tags should be stripped
> > > > > off or not when egressing the HW switch's physical port.
> > > >
> > > > If you transmit a packet onto 'lan', it will be sent to the switch chip
> > > > with an "untagged" DSA tag. If you transmit a packet onto 'lan.123',
> > > > it will be sent to the switch chip with a "tagged" DSA tag. See
> > > > net/dsa/tag_dsa.c for details.
> > >
> > > Ah, now I get it, thanks.
> > > However, how does this work for LAN to LAN pkgs? LAN1 and LAN2 could be
> > > in the same VLAN but one is implicit(port) VLAN and the
> > > other is explicit.
> >
> > If you tell the HW switch to forward these packets, they will never
> > appear at the CPU interface, so the DSA tagging/untagging doesn't enter
> > the picture.
>
> "tell the HW switch"? Doesn't DSA do that already?
Not in its current iteration, as I've explained in previous emails.
> If not, what is the point of DSA then if it doesn't use the native
> forwarding capabilities of the HW switch?
The point is and always was to provide a framework for proper integration
of hardware switch chips into the Linux kernel. This framework doesn't
become useless just because it doesn't already support every single
hardware feature at this point.
> > > How do I config the HW switch to do that?
> >
> > Tell the switch that the vlan is native on one of the ports but not on
> > the other. It's been a while since I looked at the chip docs but there
> > are ways of doing this.
>
> The current DSA impl. does not support this? There should be some
> way to manage this within the DSA framework.
Have you even tried the DSA code?
^ permalink raw reply
* Re: Distributed Switch Architecture(DSA)
From: Joakim Tjernlund @ 2010-06-19 18:48 UTC (permalink / raw)
To: Lennert Buytenhek; +Cc: netdev
In-Reply-To: <20100619165642.GP14513@mail.wantstofly.org>
Lennert Buytenhek <buytenh@wantstofly.org> wrote on 2010/06/19 18:56:43:
>
> On Sat, Jun 19, 2010 at 04:22:18PM +0200, Joakim Tjernlund wrote:
>
> > > > > > OK. With DSA, how does one configure VLANs, policing and
> > > > > > parameters in the HW switch that don't map or exist in the
> > > > > > linux bridge?
> > > > >
> > > > > The idea is to use existing kernel interface for this as much as
> > > > > possible. So e.g. if you do:
> > > > >
> > > > > vconfig add lan1 123
> > > > > vconfig add lan2 123
> > > > > brctl addbr br123
> > > > > brctl addif br123 lan1.123
> > > > > brctl addif br123 lan2.123
> > > > >
> > > > > Then the DSA code (or some userspace netlink listener helper, or some
> > > > > combination of both) should ideally also detect that VLAN 123 on
> > > > > interfaces lan1 and lan2 are to be bridged together, and program the
> > > > > switch chip accordingly. I think all VLAN configurations that at least
> > > > > the Marvell hardware supports can be expressed this way.
> > > >
> > > > Yes, but I image that this breaks down when you want to do something
> > > > a bit more advanced. For example I don't think linux VLANs supports
> > > > "shared VLAN learning"(SVL) and to configure a HW switch to do SVL
> > > > one would first have to impl. that in Linux VLAN and then add the DSA
> > > > code to get the config to the switch.
> > >
> > > Yes. But that's really the best way to do it, in my humble opinion.
> >
> > I will buy that for the moment. I can't see a better way either if
> > you truly want to integrate a HW switch into linux. I just wish
> > Linux VLANs had some support for SVL too
>
> You know how to fix that. :)
Possibly :)
>
>
> > > If you don't go the host networking stack integration route, you end
> > > up with something like the vendor drivers. Which work fine for most
> > > scenarios.. until you want to do something like talking TCP/IP using
> > > the host TCP stack over some of the switch ports, at which point the
> > > lack of host networking stack integration comes to bite you.
> >
> > Just doing STP will bite you :)
>
> Most people deal with this by running a userland STP daemon that uses
> raw sockets to inject manually (i.e. in userspace) DSA-tagged packets
> onto the eth0 (or whatever) interface. This "works" (for some
> definitions of 'works') for UDP apps such as a DHCP server as well --
> this crappy approach unfortunately only really breaks down for TCP.
>
>
> > > > Not sure how one would express whether VLAN tags should be stripped
> > > > off or not when egressing the HW switch's physical port.
> > >
> > > If you transmit a packet onto 'lan', it will be sent to the switch chip
> > > with an "untagged" DSA tag. If you transmit a packet onto 'lan.123',
> > > it will be sent to the switch chip with a "tagged" DSA tag. See
> > > net/dsa/tag_dsa.c for details.
> >
> > Ah, now I get it, thanks.
> > However, how does this work for LAN to LAN pkgs? LAN1 and LAN2 could be
> > in the same VLAN but one is implicit(port) VLAN and the
> > other is explicit.
>
> If you tell the HW switch to forward these packets, they will never
> appear at the CPU interface, so the DSA tagging/untagging doesn't enter
> the picture.
"tell the HW switch"? Doesn't DSA do that already? If not, what
is the point of DSA then if it doesn't use the native forwarding
capabilities of the HW switch?
>
>
> > How do I config the HW switch to do that?
>
> Tell the switch that the vlan is native on one of the ports but not on
> the other. It's been a while since I looked at the chip docs but there
> are ways of doing this.
The current DSA impl. does not support this? There should be some
way to manage this within the DSA framework.
>
>
> > > > Furthermore, suppose one have a big HW switch, 48 ports, and lots of
> > > > VLANs in that HW switch one would have to create a lot of virtual I/Fs
> > > > and VLANs in linux just to configure the HW switch. This wastes
> > > > resources on the CPU.
> > >
> > > Where the 'resource waste' is on the order of a couple of tens or
> > > hundreds of kilobytes of RAM. If this is a problem for your host
> > > CPU, I think you have bigger problems anyway.
> >
> > That is not a very good argument, this is how bloat builds.
>
> If you have a better way of getting all the features while spending
> less resources, please step forward with your ideas. The current design
> is the best I could come up with, but I'm sure it's not optimal in its
> current form.
I don't, I am not that familiar with the inner working of Linux
networking code.
>
>
> > > > > To configure things like ingress/egress rate limiting and such in the
> > > > > switch chip for which there is no Linux counterpart interface, I suppose
> > > > > some sysfs interface or so might suffice.
> > > >
> > > > Yes, there are aspects of a HW switch that doesn't map into DSA currently.
> > > > Perhaps one should add some framework to support this?
> > >
> > > Sounds good.
> >
> > Any idea how such an framework should look like? What transport
> > mechanism is suitable to talk to a user space daemon?
>
> Have a look at netlink.
I was afraid you would say that, I have no experience with netlink :)
^ permalink raw reply
* 2.6.34 + IPv6: Oops?
From: Andreas Klauer @ 2010-06-19 17:53 UTC (permalink / raw)
To: netdev
Hi,
I have a NULL pointer dereference Oops here which I can reproduce,
and I believe it's related to network / IPv6 somehow since sending a
ping from outside to the IPv6 address is what ultimately triggers it.
The box is a dedicated server with a /64 subnet assigned to it.
What I'm trying to do is tunnel part of it through IPv4 / OpenVPN.
I'm completely new to IPv6 so I'm probably doing this horribly wrong.
Unfortunately I only have a screenshot of the Oops.
I uploaded it along with other information here:
http://www.metamorpher.de/kernel/
Before the Oops I'm running a shell script (see link above)
which among other things sets up proxy_ndp on eth0 (r8169 driver).
The Oops is triggered by sending a ping from the outside world to
the IP which was intended to be tunneled (2a01:4f8:120:8221:ffff::2).
If you need more information, I'll try my best to provide it.
If it's a kernel bug, I'll also be happy to test any patches.
Regards
Andreas Klauer
^ permalink raw reply
* Re: [PATCH 1/1] Bluetooth: hidp: Add support for hidraw HIDIOCGFEATURE and HIDIOCSFEATURE
From: Jiri Kosina @ 2010-06-19 17:49 UTC (permalink / raw)
To: Alan Ott
Cc: Marcel Holtmann, David S Miller, Michael Poole, Bastien Nocera,
Eric Dumazet, linux-bluetooth, linux-kernel, netdev
In-Reply-To: <1276467601-9066-1-git-send-email-alan@signal11.us>
On Sun, 13 Jun 2010, Alan Ott wrote:
> This patch adds support or getting and setting feature reports for bluetooth
> HID devices from HIDRAW.
>
> Signed-off-by: Alan Ott <alan@signal11.us>
Marcel, any word on this please? We already have USB counterpart in, so
it'd be nice to finalize the Bluetooth part as well.
Thanks.
> ---
> net/bluetooth/hidp/core.c | 121 +++++++++++++++++++++++++++++++++++++++++++--
> net/bluetooth/hidp/hidp.h | 8 +++
> 2 files changed, 125 insertions(+), 4 deletions(-)
>
> diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
> index bfe641b..0f068a0 100644
> --- a/net/bluetooth/hidp/core.c
> +++ b/net/bluetooth/hidp/core.c
> @@ -36,6 +36,7 @@
> #include <linux/file.h>
> #include <linux/init.h>
> #include <linux/wait.h>
> +#include <linux/mutex.h>
> #include <net/sock.h>
>
> #include <linux/input.h>
> @@ -313,6 +314,93 @@ static int hidp_send_report(struct hidp_session *session, struct hid_report *rep
> return hidp_queue_report(session, buf, rsize);
> }
>
> +static int hidp_get_raw_report(struct hid_device *hid,
> + unsigned char report_number,
> + unsigned char *data, size_t count,
> + unsigned char report_type)
> +{
> + struct hidp_session *session = hid->driver_data;
> + struct sk_buff *skb;
> + size_t len;
> + int numbered_reports = hid->report_enum[report_type].numbered;
> +
> + switch (report_type) {
> + case HID_FEATURE_REPORT:
> + report_type = HIDP_TRANS_GET_REPORT | HIDP_DATA_RTYPE_FEATURE;
> + break;
> + case HID_INPUT_REPORT:
> + report_type = HIDP_TRANS_GET_REPORT | HIDP_DATA_RTYPE_INPUT;
> + break;
> + case HID_OUTPUT_REPORT:
> + report_type = HIDP_TRANS_GET_REPORT | HIDP_DATA_RTYPE_OUPUT;
> + break;
> + default:
> + return -EINVAL;
> + }
> +
> + if (mutex_lock_interruptible(&session->report_mutex))
> + return -ERESTARTSYS;
> +
> + /* Set up our wait, and send the report request to the device. */
> + session->waiting_report_type = report_type & HIDP_DATA_RTYPE_MASK;
> + session->waiting_report_number = numbered_reports ? report_number : -1;
> + set_bit(HIDP_WAITING_FOR_RETURN, &session->flags);
> + data[0] = report_number;
> + if (hidp_send_ctrl_message(hid->driver_data, report_type, data, 1))
> + goto err_eio;
> +
> + /* Wait for the return of the report. The returned report
> + gets put in session->report_return. */
> + while (test_bit(HIDP_WAITING_FOR_RETURN, &session->flags)) {
> + int res;
> +
> + res = wait_event_interruptible_timeout(session->report_queue,
> + !test_bit(HIDP_WAITING_FOR_RETURN, &session->flags),
> + 5*HZ);
> + if (res == 0) {
> + /* timeout */
> + goto err_eio;
> + }
> + if (res < 0) {
> + /* signal */
> + goto err_restartsys;
> + }
> + }
> +
> + skb = session->report_return;
> + if (skb) {
> + if (numbered_reports) {
> + /* Strip off the report number. */
> + size_t rpt_len = skb->len-1;
> + len = rpt_len < count ? rpt_len : count;
> + memcpy(data, skb->data+1, len);
> + } else {
> + len = skb->len < count ? skb->len : count;
> + memcpy(data, skb->data, len);
> + }
> +
> + kfree_skb(skb);
> + session->report_return = NULL;
> + } else {
> + /* Device returned a HANDSHAKE, indicating protocol error. */
> + len = -EIO;
> + }
> +
> + clear_bit(HIDP_WAITING_FOR_RETURN, &session->flags);
> + mutex_unlock(&session->report_mutex);
> +
> + return len;
> +
> +err_restartsys:
> + clear_bit(HIDP_WAITING_FOR_RETURN, &session->flags);
> + mutex_unlock(&session->report_mutex);
> + return -ERESTARTSYS;
> +err_eio:
> + clear_bit(HIDP_WAITING_FOR_RETURN, &session->flags);
> + mutex_unlock(&session->report_mutex);
> + return -EIO;
> +}
> +
> static int hidp_output_raw_report(struct hid_device *hid, unsigned char *data, size_t count,
> unsigned char report_type)
> {
> @@ -367,6 +455,10 @@ static void hidp_process_handshake(struct hidp_session *session,
> case HIDP_HSHK_ERR_INVALID_REPORT_ID:
> case HIDP_HSHK_ERR_UNSUPPORTED_REQUEST:
> case HIDP_HSHK_ERR_INVALID_PARAMETER:
> + if (test_bit(HIDP_WAITING_FOR_RETURN, &session->flags)) {
> + clear_bit(HIDP_WAITING_FOR_RETURN, &session->flags);
> + wake_up_interruptible(&session->report_queue);
> + }
> /* FIXME: Call into SET_ GET_ handlers here */
> break;
>
> @@ -403,9 +495,11 @@ static void hidp_process_hid_control(struct hidp_session *session,
> }
> }
>
> -static void hidp_process_data(struct hidp_session *session, struct sk_buff *skb,
> +/* Returns true if the passed-in skb should be freed by the caller. */
> +static int hidp_process_data(struct hidp_session *session, struct sk_buff *skb,
> unsigned char param)
> {
> + int done_with_skb = 1;
> BT_DBG("session %p skb %p len %d param 0x%02x", session, skb, skb->len, param);
>
> switch (param) {
> @@ -417,7 +511,6 @@ static void hidp_process_data(struct hidp_session *session, struct sk_buff *skb,
>
> if (session->hid)
> hid_input_report(session->hid, HID_INPUT_REPORT, skb->data, skb->len, 0);
> -
> break;
>
> case HIDP_DATA_RTYPE_OTHER:
> @@ -429,12 +522,27 @@ static void hidp_process_data(struct hidp_session *session, struct sk_buff *skb,
> __hidp_send_ctrl_message(session,
> HIDP_TRANS_HANDSHAKE | HIDP_HSHK_ERR_INVALID_PARAMETER, NULL, 0);
> }
> +
> + if (test_bit(HIDP_WAITING_FOR_RETURN, &session->flags) &&
> + param == session->waiting_report_type) {
> + if (session->waiting_report_number < 0 ||
> + session->waiting_report_number == skb->data[0]) {
> + /* hidp_get_raw_report() is waiting on this report. */
> + session->report_return = skb;
> + done_with_skb = 0;
> + clear_bit(HIDP_WAITING_FOR_RETURN, &session->flags);
> + wake_up_interruptible(&session->report_queue);
> + }
> + }
> +
> + return done_with_skb;
> }
>
> static void hidp_recv_ctrl_frame(struct hidp_session *session,
> struct sk_buff *skb)
> {
> unsigned char hdr, type, param;
> + int free_skb = 1;
>
> BT_DBG("session %p skb %p len %d", session, skb, skb->len);
>
> @@ -454,7 +562,7 @@ static void hidp_recv_ctrl_frame(struct hidp_session *session,
> break;
>
> case HIDP_TRANS_DATA:
> - hidp_process_data(session, skb, param);
> + free_skb = hidp_process_data(session, skb, param);
> break;
>
> default:
> @@ -463,7 +571,8 @@ static void hidp_recv_ctrl_frame(struct hidp_session *session,
> break;
> }
>
> - kfree_skb(skb);
> + if (free_skb)
> + kfree_skb(skb);
> }
>
> static void hidp_recv_intr_frame(struct hidp_session *session,
> @@ -797,6 +906,7 @@ static int hidp_setup_hid(struct hidp_session *session,
> hid->dev.parent = hidp_get_device(session);
> hid->ll_driver = &hidp_hid_driver;
>
> + hid->hid_get_raw_report = hidp_get_raw_report;
> hid->hid_output_raw_report = hidp_output_raw_report;
>
> err = hid_add_device(hid);
> @@ -857,6 +967,9 @@ int hidp_add_connection(struct hidp_connadd_req *req, struct socket *ctrl_sock,
> skb_queue_head_init(&session->ctrl_transmit);
> skb_queue_head_init(&session->intr_transmit);
>
> + mutex_init(&session->report_mutex);
> + init_waitqueue_head(&session->report_queue);
> +
> session->flags = req->flags & (1 << HIDP_BLUETOOTH_VENDOR_ID);
> session->idle_to = req->idle_to;
>
> diff --git a/net/bluetooth/hidp/hidp.h b/net/bluetooth/hidp/hidp.h
> index 8d934a1..00e71dd 100644
> --- a/net/bluetooth/hidp/hidp.h
> +++ b/net/bluetooth/hidp/hidp.h
> @@ -80,6 +80,7 @@
> #define HIDP_VIRTUAL_CABLE_UNPLUG 0
> #define HIDP_BOOT_PROTOCOL_MODE 1
> #define HIDP_BLUETOOTH_VENDOR_ID 9
> +#define HIDP_WAITING_FOR_RETURN 10
>
> struct hidp_connadd_req {
> int ctrl_sock; // Connected control socket
> @@ -154,6 +155,13 @@ struct hidp_session {
> struct sk_buff_head ctrl_transmit;
> struct sk_buff_head intr_transmit;
>
> + /* Used in hidp_get_raw_report() */
> + int waiting_report_type; /* HIDP_DATA_RTYPE_* */
> + int waiting_report_number; /* -1 for not numbered */
> + struct mutex report_mutex;
> + struct sk_buff *report_return;
> + wait_queue_head_t report_queue;
> +
> /* Report descriptor */
> __u8 *rd_data;
> uint rd_size;
> --
> 1.7.0.4
>
>
--
Jiri Kosina
SUSE Labs, Novell Inc.
^ permalink raw reply
* Re: Distributed Switch Architecture(DSA)
From: Lennert Buytenhek @ 2010-06-19 16:56 UTC (permalink / raw)
To: Joakim Tjernlund; +Cc: netdev
In-Reply-To: <OF27FDE4E4.06C565FF-ONC1257747.004A175A-C1257747.004EF252@transmode.se>
On Sat, Jun 19, 2010 at 04:22:18PM +0200, Joakim Tjernlund wrote:
> > > > > OK. With DSA, how does one configure VLANs, policing and
> > > > > parameters in the HW switch that don't map or exist in the
> > > > > linux bridge?
> > > >
> > > > The idea is to use existing kernel interface for this as much as
> > > > possible. So e.g. if you do:
> > > >
> > > > vconfig add lan1 123
> > > > vconfig add lan2 123
> > > > brctl addbr br123
> > > > brctl addif br123 lan1.123
> > > > brctl addif br123 lan2.123
> > > >
> > > > Then the DSA code (or some userspace netlink listener helper, or some
> > > > combination of both) should ideally also detect that VLAN 123 on
> > > > interfaces lan1 and lan2 are to be bridged together, and program the
> > > > switch chip accordingly. I think all VLAN configurations that at least
> > > > the Marvell hardware supports can be expressed this way.
> > >
> > > Yes, but I image that this breaks down when you want to do something
> > > a bit more advanced. For example I don't think linux VLANs supports
> > > "shared VLAN learning"(SVL) and to configure a HW switch to do SVL
> > > one would first have to impl. that in Linux VLAN and then add the DSA
> > > code to get the config to the switch.
> >
> > Yes. But that's really the best way to do it, in my humble opinion.
>
> I will buy that for the moment. I can't see a better way either if
> you truly want to integrate a HW switch into linux. I just wish
> Linux VLANs had some support for SVL too
You know how to fix that. :)
> > If you don't go the host networking stack integration route, you end
> > up with something like the vendor drivers. Which work fine for most
> > scenarios.. until you want to do something like talking TCP/IP using
> > the host TCP stack over some of the switch ports, at which point the
> > lack of host networking stack integration comes to bite you.
>
> Just doing STP will bite you :)
Most people deal with this by running a userland STP daemon that uses
raw sockets to inject manually (i.e. in userspace) DSA-tagged packets
onto the eth0 (or whatever) interface. This "works" (for some
definitions of 'works') for UDP apps such as a DHCP server as well --
this crappy approach unfortunately only really breaks down for TCP.
> > > Not sure how one would express whether VLAN tags should be stripped
> > > off or not when egressing the HW switch's physical port.
> >
> > If you transmit a packet onto 'lan', it will be sent to the switch chip
> > with an "untagged" DSA tag. If you transmit a packet onto 'lan.123',
> > it will be sent to the switch chip with a "tagged" DSA tag. See
> > net/dsa/tag_dsa.c for details.
>
> Ah, now I get it, thanks.
> However, how does this work for LAN to LAN pkgs? LAN1 and LAN2 could be
> in the same VLAN but one is implicit(port) VLAN and the
> other is explicit.
If you tell the HW switch to forward these packets, they will never
appear at the CPU interface, so the DSA tagging/untagging doesn't enter
the picture.
> How do I config the HW switch to do that?
Tell the switch that the vlan is native on one of the ports but not on
the other. It's been a while since I looked at the chip docs but there
are ways of doing this.
> > > Furthermore, suppose one have a big HW switch, 48 ports, and lots of
> > > VLANs in that HW switch one would have to create a lot of virtual I/Fs
> > > and VLANs in linux just to configure the HW switch. This wastes
> > > resources on the CPU.
> >
> > Where the 'resource waste' is on the order of a couple of tens or
> > hundreds of kilobytes of RAM. If this is a problem for your host
> > CPU, I think you have bigger problems anyway.
>
> That is not a very good argument, this is how bloat builds.
If you have a better way of getting all the features while spending
less resources, please step forward with your ideas. The current design
is the best I could come up with, but I'm sure it's not optimal in its
current form.
> > > > To configure things like ingress/egress rate limiting and such in the
> > > > switch chip for which there is no Linux counterpart interface, I suppose
> > > > some sysfs interface or so might suffice.
> > >
> > > Yes, there are aspects of a HW switch that doesn't map into DSA currently.
> > > Perhaps one should add some framework to support this?
> >
> > Sounds good.
>
> Any idea how such an framework should look like? What transport
> mechanism is suitable to talk to a user space daemon?
Have a look at netlink.
^ permalink raw reply
* Re: Distributed Switch Architecture(DSA)
From: Joakim Tjernlund @ 2010-06-19 14:22 UTC (permalink / raw)
To: Lennert Buytenhek; +Cc: netdev
In-Reply-To: <20100618201243.GK14513@mail.wantstofly.org>
Lennert Buytenhek <buytenh@wantstofly.org> wrote on 2010/06/18 22:12:43:
> From: Lennert Buytenhek <buytenh@wantstofly.org>
> To: Joakim Tjernlund <joakim.tjernlund@transmode.se>
> Cc: netdev@vger.kernel.org
> Date: 2010/06/18 22:12
> Subject: Re: Distributed Switch Architecture(DSA)
>
> On Fri, Jun 18, 2010 at 05:13:03PM +0200, Joakim Tjernlund wrote:
>
> > > > > > > > Now I want to add STP/RSTP to the switch. How would one do that?
> > > > > > >
> > > > > > > First, you'll want the hardware bridging patches that I posted to
> > > > > > > netdev@ a while back, e.g.:
> > > > > > >
> > > > > > > http://patchwork.ozlabs.org/patch/16578/
> > > > > >
> > > > > > I see, will have to study this a bit closer. One question though,
> > > > > > does this disable MAC learning in the linux bridge?
> > > > >
> > > > > No, why should it?
> > > >
> > > > Doesn't the HW switch handle all MAC leaning? Why duplicate
> > > > this in the SW bridge?
> > > > I figured the HW switch would offload the SW bridge this task.
> > >
> > > Imagine the case where you bridge lan1, lan2 (both on the switch chip)
> > > into br0, together with wlan0 (which is not on the switch chip).
> > >
> > > Now a packet is sent out of br0. Should it be sent to wlan0 or to the
> > > switch chip? How will you make this decision without an address database
> > > on the Linux side?
> >
> > True, in this case you need it, but for only HW switch I/Fs you don't
> > need it and there can be several hundreds of MAC addresses passing
> > trough the HW switch. It would be nice if one didn't need to pass
> > all those up to the SW bridge, especially if you have a small embedded
> > CPU.
>
> I think you overestimate the effect that address learning will have on
> the host CPU. It only needs to happen for the first packet for every
> new MAC address, and address flooding attacks is something you'll need
> to address in either case.
Possibly, I am just being careful.
>
> If you're really worried about this scenario, then just configure your
> boot loader to bridge all switch ports together, and don't load the DSA
> driver. The switch will then appear as a single interface, 'eth0' (or
> whatever your SoC calls it), over which you can talk directly without
> any form of tagging. You won't be able to use any advanced features,
> though.
Na, that is no fun :)
>
>
> > > > > > Do you have any idea how to do DSA on a Broadcom switch?
> > > > >
> > > > > I have no idea. When I originally submitted the DSA code for merging,
> > > > > I contacted Broadcom people about adding support for Broadcom switch
> > > > > chips to it, but I never heard back from them.
> > > >
> > > > OK. With DSA, how does one configure VLANs, policing and parameters in the
> > > > HW switch that don't map or exist in the linux bridge?
> > >
> > > The idea is to use existing kernel interface for this as much as
> > > possible. So e.g. if you do:
> > >
> > > vconfig add lan1 123
> > > vconfig add lan2 123
> > > brctl addbr br123
> > > brctl addif br123 lan1.123
> > > brctl addif br123 lan2.123
> > >
> > > Then the DSA code (or some userspace netlink listener helper, or some
> > > combination of both) should ideally also detect that VLAN 123 on
> > > interfaces lan1 and lan2 are to be bridged together, and program the
> > > switch chip accordingly. I think all VLAN configurations that at least
> > > the Marvell hardware supports can be expressed this way.
> >
> > Yes, but I image that this breaks down when you want to do something
> > a bit more advanced. For example I don't think linux VLANs supports
> > "shared VLAN learning"(SVL) and to configure a HW switch to do SVL
> > one would first have to impl. that in Linux VLAN and then add the DSA
> > code to get the config to the switch.
>
> Yes. But that's really the best way to do it, in my humble opinion.
I will buy that for the moment. I can't see a better way either if
you truly want to integrate a HW switch into linux. I just wish
Linux VLANs had some support for SVL too
>
> If you don't go the host networking stack integration route, you end
> up with something like the vendor drivers. Which work fine for most
> scenarios.. until you want to do something like talking TCP/IP using
> the host TCP stack over some of the switch ports, at which point the
> lack of host networking stack integration comes to bite you.
Just doing STP will bite you :)
>
>
> > Not sure how one would express whether VLAN tags should be stripped
> > off or not when egressing the HW switch's physical port.
>
> If you transmit a packet onto 'lan', it will be sent to the switch chip
> with an "untagged" DSA tag. If you transmit a packet onto 'lan.123',
> it will be sent to the switch chip with a "tagged" DSA tag. See
> net/dsa/tag_dsa.c for details.
Ah, now I get it, thanks.
However, how does this work for LAN to LAN pkgs? LAN1 and LAN2 could be
in the same VLAN but one is implicit(port) VLAN and the
other is explicit. How do I config the HW switch to do that?
>
>
> > Furthermore, suppose one have a big HW switch, 48 ports, and lots of
> > VLANs in that HW switch one would have to create a lot of virtual I/Fs
> > and VLANs in linux just to configure the HW switch. This wastes
> > resources on the CPU.
>
> Where the 'resource waste' is on the order of a couple of tens or
> hundreds of kilobytes of RAM. If this is a problem for your host
> CPU, I think you have bigger problems anyway.
That is not a very good argument, this is how bloat builds.
However, lets ignore this for now.
>
>
> > > To configure things like ingress/egress rate limiting and such in the
> > > switch chip for which there is no Linux counterpart interface, I suppose
> > > some sysfs interface or so might suffice.
> >
> > Yes, there are aspects of a HW switch that doesn't map into DSA currently.
> > Perhaps one should add some framework to support this?
>
> Sounds good.
Any idea how such an framework should look like? What transport
mechanism is suitable to talk to a user space daemon?
^ permalink raw reply
* Re: inconsistent lock state
From: Dominik Brodowski @ 2010-06-19 13:05 UTC (permalink / raw)
To: Andrew Morton
Cc: Sergey Senozhatsky, Alexander Viro, Peter Zijlstra, Sage Weil,
linux-fsdevel, linux-kernel, Maciej Rutecki, Eric Dumazet,
Paul E. McKenney, Lai Jiangshan, David S. Miller, netdev
In-Reply-To: <20100618133004.228c2223.akpm@linux-foundation.org>
Hey,
On Fri, Jun 18, 2010 at 01:30:04PM -0700, Andrew Morton wrote:
> From: Andrew Morton <akpm@linux-foundation.org>
>
> Fix a lockdep-splat-causing regression introduced by
>
> : commit 989a2979205dd34269382b357e6d4b4b6956b889
> : Author: Eric Dumazet <eric.dumazet@gmail.com>
> : AuthorDate: Wed Apr 14 09:55:35 2010 +0000
> : Commit: David S. Miller <davem@davemloft.net>
> : CommitDate: Wed Apr 21 16:19:29 2010 -0700
> :
> : fasync: RCU and fine grained locking
>
> kill_fasync() can be called from both process and hard-irq context, so
> fa_lock must be taken with IRQs disabled.
>
> Addresses https://bugzilla.kernel.org/show_bug.cgi?id=16230
Seems to work fine -- thanks!
Best,
Dominik
^ permalink raw reply
* Re: inconsistent lock state
From: Sergey Senozhatsky @ 2010-06-19 8:33 UTC (permalink / raw)
To: Andrew Morton
Cc: Sergey Senozhatsky, Alexander Viro, Peter Zijlstra, Sage Weil,
linux-fsdevel, linux-kernel, Dominik Brodowski, Maciej Rutecki,
Eric Dumazet, Paul E. McKenney, Lai Jiangshan, David S. Miller,
netdev
In-Reply-To: <20100618133004.228c2223.akpm@linux-foundation.org>
[-- Attachment #1: Type: text/plain, Size: 8190 bytes --]
Hello Andrew,
Thanks. I'll test.
Sergey
On (06/18/10 13:30), Andrew Morton wrote:
> This was also reported by Dominik and is being tracked at
> https://bugzilla.kernel.org/show_bug.cgi?id=16230
>
> On Tue, 15 Jun 2010 14:24:34 +0300
> Sergey Senozhatsky <sergey.senozhatsky@gmail.com> wrote:
>
> > Hello,
> >
> > kernel: [ 3272.351191]
> > kernel: [ 3272.351194] =================================
> > kernel: [ 3272.351199] [ INFO: inconsistent lock state ]
> > kernel: [ 3272.351204] 2.6.35-rc3-dbg-00106-ga75e02b-dirty #15
> > kernel: [ 3272.351206] ---------------------------------
> > kernel: [ 3272.351210] inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage.
> > kernel: [ 3272.351215] X/3827 [HC0[0]:SC0[0]:HE1:SE1] takes:
> > kernel: [ 3272.351218] (&(&new->fa_lock)->rlock){?.-...}, at: [<c10aefb4>] kill_fasync+0x37/0x71
> > kernel: [ 3272.351232] {IN-HARDIRQ-W} state was registered at:
> > kernel: [ 3272.351235] [<c104e95c>] __lock_acquire+0x281/0xbe1
> > kernel: [ 3272.351243] [<c104f652>] lock_acquire+0x59/0x70
> > kernel: [ 3272.351248] [<c12c6c48>] _raw_spin_lock+0x25/0x34
> > kernel: [ 3272.351255] [<c10aefb4>] kill_fasync+0x37/0x71
> > kernel: [ 3272.351261] [<fd220c81>] evdev_event+0x135/0x190 [evdev]
> > kernel: [ 3272.351275] [<c1232003>] input_pass_event+0x6f/0xae
> > kernel: [ 3272.351283] [<c1232ef5>] input_handle_event+0x38d/0x396
> > kernel: [ 3272.351288] [<c1232fbf>] input_event+0x4f/0x62
> > kernel: [ 3272.351293] [<c12368e4>] input_sync+0xe/0x11
> > kernel: [ 3272.351299] [<c1236d72>] atkbd_interrupt+0x48b/0x541
> > kernel: [ 3272.351304] [<c122ecb2>] serio_interrupt+0x35/0x68
> > kernel: [ 3272.351309] [<c122fbff>] i8042_interrupt+0x264/0x26e
> > kernel: [ 3272.351314] [<c106bb02>] handle_IRQ_event+0x1d/0x98
> > kernel: [ 3272.351321] [<c106d506>] handle_edge_irq+0xc0/0x107
> > kernel: [ 3272.351326] [<c10045ca>] handle_irq+0x1a/0x20
> > kernel: [ 3272.351332] [<c100435f>] do_IRQ+0x43/0x8d
> > kernel: [ 3272.351337] [<c1002d75>] common_interrupt+0x35/0x3c
> > kernel: [ 3272.351342] [<c124723d>] cpuidle_idle_call+0x6a/0xa0
> > kernel: [ 3272.351349] [<c100170d>] cpu_idle+0x89/0xbe
> > kernel: [ 3272.351354] [<c12b6d11>] rest_init+0xb5/0xba
> > kernel: [ 3272.351361] [<c148a7bf>] start_kernel+0x33b/0x340
> > kernel: [ 3272.351368] [<c148a0c9>] i386_start_kernel+0xc9/0xd0
> > kernel: [ 3272.351374] irq event stamp: 54104917
> > kernel: [ 3272.351377] hardirqs last enabled at (54104917): [<c12c70f2>] _raw_spin_unlock_irqrestore+0x36/0x5b
> > kernel: [ 3272.351384] hardirqs last disabled at (54104916): [<c12c6ced>] _raw_spin_lock_irqsave+0x13/0x42
> > kernel: [ 3272.351391] softirqs last enabled at (54104732): [<c1032cf2>] __do_softirq+0xfd/0x10c
> > kernel: [ 3272.351398] softirqs last disabled at (54104703): [<c1032d30>] do_softirq+0x2f/0x47
> > kernel: [ 3272.351404]
> > kernel: [ 3272.351405] other info that might help us debug this:
> > kernel: [ 3272.351409] 3 locks held by X/3827:
> > kernel: [ 3272.351412] #0: (rcu_read_lock){.+.+..}, at: [<c124fdfa>] rcu_read_lock+0x0/0x26
> > kernel: [ 3272.351423] #1: (rcu_read_lock){.+.+..}, at: [<c124d5d9>] rcu_read_lock+0x0/0x26
> > kernel: [ 3272.351432] #2: (rcu_read_lock){.+.+..}, at: [<c10ae429>] rcu_read_lock+0x0/0x26
> > kernel: [ 3272.351442]
> > kernel: [ 3272.351443] stack backtrace:
> > kernel: [ 3272.351448] Pid: 3827, comm: X Not tainted 2.6.35-rc3-dbg-00106-ga75e02b-dirty #15
> > kernel: [ 3272.351451] Call Trace:
> > kernel: [ 3272.351456] [<c12c4ff1>] ? printk+0xf/0x11
> > kernel: [ 3272.351462] [<c104e51a>] valid_state+0x133/0x141
> > kernel: [ 3272.351468] [<c104e5f7>] mark_lock+0xcf/0x1b3
> > kernel: [ 3272.351473] [<c104e54e>] ? mark_lock+0x26/0x1b3
> > kernel: [ 3272.351479] [<c104dfd2>] ? check_usage_backwards+0x0/0x68
> > kernel: [ 3272.351484] [<c104e9d0>] __lock_acquire+0x2f5/0xbe1
> > kernel: [ 3272.351489] [<c104ea44>] ? __lock_acquire+0x369/0xbe1
> > kernel: [ 3272.351495] [<c104ea44>] ? __lock_acquire+0x369/0xbe1
> > kernel: [ 3272.351502] [<c102ab40>] ? try_to_wake_up+0x2a8/0x2bb
> > kernel: [ 3272.351508] [<c104f652>] lock_acquire+0x59/0x70
> > kernel: [ 3272.351513] [<c10aefb4>] ? kill_fasync+0x37/0x71
> > kernel: [ 3272.351519] [<c12c6c48>] _raw_spin_lock+0x25/0x34
> > kernel: [ 3272.351524] [<c10aefb4>] ? kill_fasync+0x37/0x71
> > kernel: [ 3272.351529] [<c10aefb4>] kill_fasync+0x37/0x71
> > kernel: [ 3272.351534] [<c124d694>] sock_wake_async+0x77/0x83
> > kernel: [ 3272.351540] [<c124fe4d>] sk_wake_async+0x2d/0x32
> > kernel: [ 3272.351545] [<c1250004>] sock_def_readable+0x45/0x51
> > kernel: [ 3272.351551] [<c12b0247>] unix_stream_sendmsg+0x1e2/0x269
> > kernel: [ 3272.351557] [<c124fe6e>] ? rcu_read_unlock+0x1c/0x1e
> > kernel: [ 3272.351562] [<c124cf1a>] __sock_sendmsg+0x51/0x5a
> > kernel: [ 3272.351567] [<c124cff7>] sock_aio_write+0xd4/0xdd
> > kernel: [ 3272.351575] [<c10a4d95>] do_sync_readv_writev+0x84/0xb7
> > kernel: [ 3272.351582] [<c10a4288>] ? copy_from_user+0x8/0xa
> > kernel: [ 3272.351587] [<c10a4e69>] ? rw_copy_check_uvector+0x55/0xc7
> > kernel: [ 3272.351594] [<c1164082>] ? security_file_permission+0xf/0x11
> > kernel: [ 3272.351599] [<c10a47e5>] ? rw_verify_area+0x90/0xac
> > kernel: [ 3272.351605] [<c10a4f58>] do_readv_writev+0x7d/0xdf
> > kernel: [ 3272.351610] [<c124cf23>] ? sock_aio_write+0x0/0xdd
> > kernel: [ 3272.351615] [<c1164082>] ? security_file_permission+0xf/0x11
> > kernel: [ 3272.351621] [<c10a47e5>] ? rw_verify_area+0x90/0xac
> > kernel: [ 3272.351626] [<c10a4ff3>] vfs_writev+0x39/0x42
> > kernel: [ 3272.351632] [<c10a5102>] sys_writev+0x3b/0x8c
> > kernel: [ 3272.351637] [<c10027d3>] sysenter_do_call+0x12/0x32
> >
>
> This, I think?
>
>
> From: Andrew Morton <akpm@linux-foundation.org>
>
> Fix a lockdep-splat-causing regression introduced by
>
> : commit 989a2979205dd34269382b357e6d4b4b6956b889
> : Author: Eric Dumazet <eric.dumazet@gmail.com>
> : AuthorDate: Wed Apr 14 09:55:35 2010 +0000
> : Commit: David S. Miller <davem@davemloft.net>
> : CommitDate: Wed Apr 21 16:19:29 2010 -0700
> :
> : fasync: RCU and fine grained locking
>
> kill_fasync() can be called from both process and hard-irq context, so
> fa_lock must be taken with IRQs disabled.
>
> Addresses https://bugzilla.kernel.org/show_bug.cgi?id=16230
>
> Reported-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> Reported-by: Dominik Brodowski <linux@dominikbrodowski.net>
> Cc: Maciej Rutecki <maciej.rutecki@gmail.com>
> Cc: Eric Dumazet <eric.dumazet@gmail.com>
> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
> Cc: "David S. Miller" <davem@davemloft.net>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
>
> fs/fcntl.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff -puN fs/fcntl.c~fs-fcntlc-kill_fasync_rcu-fa_lock-must-be-irq-safe fs/fcntl.c
> --- a/fs/fcntl.c~fs-fcntlc-kill_fasync_rcu-fa_lock-must-be-irq-safe
> +++ a/fs/fcntl.c
> @@ -733,12 +733,14 @@ static void kill_fasync_rcu(struct fasyn
> {
> while (fa) {
> struct fown_struct *fown;
> + unsigned long flags;
> +
> if (fa->magic != FASYNC_MAGIC) {
> printk(KERN_ERR "kill_fasync: bad magic number in "
> "fasync_struct!\n");
> return;
> }
> - spin_lock(&fa->fa_lock);
> + spin_lock_irqsave(&fa->fa_lock, flags);
> if (fa->fa_file) {
> fown = &fa->fa_file->f_owner;
> /* Don't send SIGURG to processes which have not set a
> @@ -747,7 +749,7 @@ static void kill_fasync_rcu(struct fasyn
> if (!(sig == SIGURG && fown->signum == 0))
> send_sigio(fown, fa->fa_fd, band);
> }
> - spin_unlock(&fa->fa_lock);
> + spin_unlock_irqrestore(&fa->fa_lock, flags);
> fa = rcu_dereference(fa->fa_next);
> }
> }
> _
>
>
> afaict all other lockers of fa_lock are OK (but one never really knows
> with spin_lock_irq()).
>
> Guys, please review-and-ack and I'll get it merged up.
>
[-- Attachment #2: Type: application/pgp-signature, Size: 316 bytes --]
^ permalink raw reply
* Re: [net-next-2.6 PATCH 1/8] e1000e: cleanup ethtool loopback setup code
From: David Miller @ 2010-06-19 5:15 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, bphilips, bruce.w.allan
In-Reply-To: <20100616232523.4834.84849.stgit@localhost.localdomain>
I've applied this series however:
1) Please address Ben's concerns about turning EEE on by default
given that standardization is not complete yet.
2) I hate module parameters, I'd rather you create a new ethtool
feature bit and thus allow the setting to be modified at run
time. Please create a new ethtool control flag, and remove
this module option.
Thanks.
^ permalink raw reply
* Re: [PATCH net-next 0/9] cxgb4 update v2
From: David Miller @ 2010-06-19 5:12 UTC (permalink / raw)
To: dm; +Cc: netdev
In-Reply-To: <1276891535-13967-1-git-send-email-dm@chelsio.com>
From: Dimitris Michailidis <dm@chelsio.com>
Date: Fri, 18 Jun 2010 13:05:26 -0700
>
> Here's v2 of the cxgb4 series. Of the 9 patches patch 8 has been updated to
> fix the iw_cxgb4 breakage and the rest are as before.
All applied, thanks.
^ permalink raw reply
* [PATCH] Fix a typo in netlink.h
From: Justin P. Mattock @ 2010-06-19 4:29 UTC (permalink / raw)
To: trivial; +Cc: netdev, Justin P. Mattock
Fix a typo in include/net/netlink.h
should be finalize instead of finanlize
Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
---
include/net/netlink.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/net/netlink.h b/include/net/netlink.h
index 4fc05b5..f3b201d 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -35,7 +35,7 @@
* nlmsg_new() create a new netlink message
* nlmsg_put() add a netlink message to an skb
* nlmsg_put_answer() callback based nlmsg_put()
- * nlmsg_end() finanlize netlink message
+ * nlmsg_end() finalize netlink message
* nlmsg_get_pos() return current position in message
* nlmsg_trim() trim part of message
* nlmsg_cancel() cancel message construction
--
1.7.1.rc1.21.gf3bd6
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox