Netdev List
 help / color / mirror / Atom feed
* Re: [net-next PATCH 01/02] net/ipv4: VTI support rx-path hook in xfrm4_mode_tunnel.
From: Saurabh Mohan @ 2012-06-15  2:44 UTC (permalink / raw)
  To: Steffen Klassert; +Cc: netdev
In-Reply-To: <20120614092559.GU27795@secunet.com>

Steffen See inline (@SM)

-Saurabh.

----- Original Message -----
From: "Steffen Klassert" <steffen.klassert@secunet.com>
To: "Saurabh" <saurabh.mohan@vyatta.com>
Cc: netdev@vger.kernel.org
Sent: Thursday, June 14, 2012 2:25:59 AM
Subject: Re: [net-next PATCH 01/02] net/ipv4: VTI support rx-path hook in xfrm4_mode_tunnel.

On Fri, Jun 08, 2012 at 10:32:46AM -0700, Saurabh wrote:
> 
> 
> Add hook for rx-path xfmr4_mode_tunnel for VTI tunnel module.
> 
> Signed-off-by: Saurabh Mohan <saurabh.mohan@vyatta.com>
> Reviewed-by: Stephen Hemminger <shemminger@vyatta.com>
> 
> ---
> diff --git a/include/net/xfrm.h b/include/net/xfrm.h
> index e0a55df..04214c0 100644
> --- a/include/net/xfrm.h
> +++ b/include/net/xfrm.h
> @@ -1475,6 +1475,8 @@ extern int xfrm4_output(struct sk_buff *skb);
>  extern int xfrm4_output_finish(struct sk_buff *skb);
>  extern int xfrm4_tunnel_register(struct xfrm_tunnel *handler, unsigned short family);
>  extern int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler, unsigned short family);
> +extern int xfrm4_mode_tunnel_input_register(struct xfrm_tunnel *handler);
> +extern int xfrm4_mode_tunnel_input_deregister(struct xfrm_tunnel *handler);
>  extern int xfrm6_extract_header(struct sk_buff *skb);
>  extern int xfrm6_extract_input(struct xfrm_state *x, struct sk_buff *skb);
>  extern int xfrm6_rcv_spi(struct sk_buff *skb, int nexthdr, __be32 spi);
> diff --git a/net/ipv4/xfrm4_mode_tunnel.c b/net/ipv4/xfrm4_mode_tunnel.c
> index ed4bf11..4fc2944 100644
> --- a/net/ipv4/xfrm4_mode_tunnel.c
> +++ b/net/ipv4/xfrm4_mode_tunnel.c
> @@ -15,6 +15,68 @@
>  #include <net/ip.h>
>  #include <net/xfrm.h>
>  
> +/*
> + * Informational hook. The decap is still done here.
> + */
> +static struct xfrm_tunnel __rcu *rcv_notify_handlers __read_mostly;
> +static DEFINE_MUTEX(xfrm4_mode_tunnel_input_mutex);
> +
> +int xfrm4_mode_tunnel_input_register(struct xfrm_tunnel *handler)
> +{
> +	struct xfrm_tunnel __rcu **pprev;
> +	struct xfrm_tunnel *t;
> +
> +	int ret = -EEXIST;
> +	int priority = handler->priority;
> +
> +	mutex_lock(&xfrm4_mode_tunnel_input_mutex);
> +
> +	for (pprev = &rcv_notify_handlers;
> +		(t = rcu_dereference_protected(*pprev,
> +		lockdep_is_held(&xfrm4_mode_tunnel_input_mutex))) != NULL;
> +		pprev = &t->next) {
> +		if (t->priority > priority)
> +			break;
> +		if (t->priority == priority)
> +			goto err;
> +
> +	}
> +
> +	handler->next = *pprev;
> +	rcu_assign_pointer(*pprev, handler);
> +
> +	ret = 0;
> +
> +err:
> +	mutex_unlock(&xfrm4_mode_tunnel_input_mutex);
> +	return ret;
> +}
> +EXPORT_SYMBOL_GPL(xfrm4_mode_tunnel_input_register);
> +
> +int xfrm4_mode_tunnel_input_deregister(struct xfrm_tunnel *handler)
> +{
> +	struct xfrm_tunnel __rcu **pprev;
> +	struct xfrm_tunnel *t;
> +	int ret = -ENOENT;
> +
> +	mutex_lock(&xfrm4_mode_tunnel_input_mutex);
> +	for (pprev = &rcv_notify_handlers;
> +		(t = rcu_dereference_protected(*pprev,
> +		lockdep_is_held(&xfrm4_mode_tunnel_input_mutex))) != NULL;
> +		pprev = &t->next) {
> +		if (t == handler) {
> +			*pprev = handler->next;
> +			ret = 0;
> +			break;
> +		}
> +	}
> +	mutex_unlock(&xfrm4_mode_tunnel_input_mutex);
> +	synchronize_net();
> +
> +	return ret;
> +}
> +EXPORT_SYMBOL_GPL(xfrm4_mode_tunnel_input_deregister);
> +
>  static inline void ipip_ecn_decapsulate(struct sk_buff *skb)
>  {
>  	struct iphdr *inner_iph = ipip_hdr(skb);
> @@ -64,8 +126,14 @@ static int xfrm4_mode_tunnel_output(struct xfrm_state *x, struct sk_buff *skb)
>  	return 0;
>  }
>  
> +#define for_each_input_rcu(head, handler)	\
> +	for (handler = rcu_dereference(head);	\
> +		handler != NULL;		\
> +		handler = rcu_dereference(handler->next))  \
> +
>  static int xfrm4_mode_tunnel_input(struct xfrm_state *x, struct sk_buff *skb)
>  {
> +	struct xfrm_tunnel *handler;
>  	int err = -EINVAL;
>  
>  	if (XFRM_MODE_SKB_CB(skb)->protocol != IPPROTO_IPIP)
> @@ -74,6 +142,10 @@ static int xfrm4_mode_tunnel_input(struct xfrm_state *x, struct sk_buff *skb)
>  	if (!pskb_may_pull(skb, sizeof(struct iphdr)))
>  		goto out;
>  
> +	/* The handlers do not consume the skb. */
> +	for_each_input_rcu(rcv_notify_handlers, handler)
> +		handler->handler(skb);

I'm not sure if this is the right place to add your handler.
My understanding of an IPsec tunnel device would be to
receive the packet first and then do IPsec processing.
Here it happens the other way arround.

@SM: The intention is to get the packet post decrypt and post-esp-decap. Just like a GRE tunnel the rx-counters account for the payload and NOT the GRE header.

Why didn't you register a tunnel handler and call the
xfrm tunnel handler from that?

@SM: I did not want to repeat the work xfrm4_mode_tunnel already does. It does the decrypt and decap. Why repeat it..
All, vti tunnel module wants to do on the receive path is click the counters and change the input device to be the vti.

Reg
-Saurabh.
> +
>  	if (skb_cloned(skb) &&
>  	    (err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC)))
>  		goto out;
> --
> 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

* Re: [net-next PATCH 02/02] net/ipv4: VTI support new module for ip_vti.
From: David Miller @ 2012-06-15  3:50 UTC (permalink / raw)
  To: saurabh.mohan; +Cc: steffen.klassert, netdev
In-Reply-To: <c2becb86-be73-4668-be84-82293c6c56fc@tahiti.vyatta.com>

From: Saurabh Mohan <saurabh.mohan@vyatta.com>
Date: Thu, 14 Jun 2012 19:43:59 -0700 (PDT)

> Thanks for your feedback. Responses are inline (@SM)
 ...
> @SM: Yes, we do plan to do the same for ipv6. The timelines are not yet certain though.

Top-posting and using this special "@FOO" way of replying to other
people's emails is extremely hard to read and follow.

Please use normal email quotation mannerisms to reply to people,
otherwise many developers will simply give much lower precedence to
your postings or flat out ignore them altogether.

Thank you.

^ permalink raw reply

* Re: [patch] qlcnic: off by one in qlcnic_init_pci_info()
From: Anirban Chakraborty @ 2012-06-15  4:03 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Sony Chacko, Dept-Eng Linux Driver, netdev,
	kernel-janitors@vger.kernel.org
In-Reply-To: <20120614183424.GC6383@elgon.mountain>



On 6/14/12 11:34 AM, "Dan Carpenter" <dan.carpenter@oracle.com> wrote:

>The adapter->npars[] array has QLCNIC_MAX_PCI_FUNC elements.  We
>allocate it that way a few lines earlier in the function.  So this test
>is off by one.
>
>Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
>diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
>b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
>index 33c3e46..212c121 100644
>--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
>+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
>@@ -479,7 +479,7 @@ qlcnic_init_pci_info(struct qlcnic_adapter *adapter)
> 
> 	for (i = 0; i < QLCNIC_MAX_PCI_FUNC; i++) {
> 		pfn = pci_info[i].id;
>-		if (pfn > QLCNIC_MAX_PCI_FUNC) {
>+		if (pfn >= QLCNIC_MAX_PCI_FUNC) {
> 			ret = QL_STATUS_INVALID_PARAM;
> 			goto err_eswitch;
> 		}

Thanks for the patch.

Acked-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>

^ permalink raw reply

* [RFC] Introduce to batch variants of accept() and epoll_ctl() syscall
From: Li Yu @ 2012-06-15  4:13 UTC (permalink / raw)
  To: Linux Netdev List; +Cc: Linux Kernel Mailing List, davidel

Hi,

  We encounter a performance problem in a large scale computer
cluster, which needs to handle a lot of incoming concurrent TCP
connection requests.

  The top shows the kernel is most cpu hog, the testing is simple,
just a accept() -> epoll_ctl(ADD) loop, the ratio of cpu util sys% to
si% is about 2:5.

  I also asked some experienced webserver/proxy developers in my team
for suggestions, it seem that behavior of many userland programs already
called accept() multiple times after it is waked up by
epoll_wait(). And the common action is adding the fd that accept()
return into epoll interface by epoll_ctl() syscall then.

  Therefore, I think that we'd better to introduce to batch variants of
accept() and epoll_ctl() syscall, just like sendmmsg() or recvmmsg().

  For accept(), we may need a new syscall, it may like this,

  struct accept_result {
      int fd;
      struct sockaddr addr;
      socklen_t addr_len;
  };

  int maccept4(int fd, int flags, int nr_accept_result, struct
accept_result *results);

  For epoll_ctl(), there are two means to extend it, I prefer to extend
current interface instead of introduce to new syscall. We may introduce
to a new flag EPOLL_CTL_BATCH. If userland call epoll_ctl() with this
flag set, the meaning of last two arguments of epoll_ctl() change, .e.g:

  struct batch_epoll_event batch_event[] = {
         {
              .fd = a_newsock_fd;
              .epoll_event = { ... };
         },
         ...
  };

  ret = epoll_ctl(fd, EPOLL_CTL_ADD|EPOLL_CTL_BATCH, nr_batch_events,
batch_events);

  Thanks.

Yu

^ permalink raw reply

* Re: [RFC] Introduce to batch variants of accept() and epoll_ctl() syscall
From: Changli Gao @ 2012-06-15  4:29 UTC (permalink / raw)
  To: Li Yu; +Cc: Linux Netdev List, Linux Kernel Mailing List, davidel
In-Reply-To: <4FDAB652.6070201@gmail.com>

On Fri, Jun 15, 2012 at 12:13 PM, Li Yu <raise.sail@gmail.com> wrote:
> Hi,
>
>  We encounter a performance problem in a large scale computer
> cluster, which needs to handle a lot of incoming concurrent TCP
> connection requests.
>
>  The top shows the kernel is most cpu hog, the testing is simple,
> just a accept() -> epoll_ctl(ADD) loop, the ratio of cpu util sys% to
> si% is about 2:5.
>
>  I also asked some experienced webserver/proxy developers in my team
> for suggestions, it seem that behavior of many userland programs already
> called accept() multiple times after it is waked up by
> epoll_wait(). And the common action is adding the fd that accept()
> return into epoll interface by epoll_ctl() syscall then.
>
>  Therefore, I think that we'd better to introduce to batch variants of
> accept() and epoll_ctl() syscall, just like sendmmsg() or recvmmsg().
>
>  For accept(), we may need a new syscall, it may like this,
>
>  struct accept_result {
>      int fd;
>      struct sockaddr addr;
>      socklen_t addr_len;
>  };
>
>  int maccept4(int fd, int flags, int nr_accept_result, struct
> accept_result *results);
>
>  For epoll_ctl(), there are two means to extend it, I prefer to extend
> current interface instead of introduce to new syscall. We may introduce
> to a new flag EPOLL_CTL_BATCH. If userland call epoll_ctl() with this
> flag set, the meaning of last two arguments of epoll_ctl() change, .e.g:
>
>  struct batch_epoll_event batch_event[] = {
>         {
>              .fd = a_newsock_fd;
>              .epoll_event = { ... };
>         },
>         ...
>  };
>
>  ret = epoll_ctl(fd, EPOLL_CTL_ADD|EPOLL_CTL_BATCH, nr_batch_events,
> batch_events);
>

I think it is good idea. Would you please implement a prototype and
give some numbers? This kind of data may help selling this idea.
Thanks.

-- 
Regards,
Changli Gao(xiaosuo@gmail.com)

^ permalink raw reply

* RE: [PATCH 3/3] be2net: Increase statistics structure size for skyhawk.
From: Sarveshwar.Bandi @ 2012-06-15  4:58 UTC (permalink / raw)
  To: bhutchings; +Cc: davem, netdev, Vasundhara.Volam
In-Reply-To: <1339699802.2719.26.camel@bwh-desktop.uk.solarflarecom.com>

Ben,
  No, Buffer overrun doesn’t happen. The present NIC controller DMAs only as much information for which memory is 
allocated. The next version of controller will fail the request if sufficient memory is not available.

Thanks,
Sarvesh

-----Original Message-----
From: Ben Hutchings [mailto:bhutchings@solarflare.com] 
Sent: Friday, June 15, 2012 12:20 AM
To: Bandi,Sarveshwar
Cc: davem@davemloft.net; netdev@vger.kernel.org; Vasundhara, Volam
Subject: Re: [PATCH 3/3] be2net: Increase statistics structure size for skyhawk.

On Thu, 2012-06-14 at 11:21 +0530, sarveshwar.bandi@emulex.com wrote:
> From: Vasundhara Volam <vasundhara.volam@emulex.com>
> 
> Increasing the hardware statistics structure to accomodate statistics for skyhawk.
> 
> Signed-off-by: Vasundhara Volam <vasundhara.volam@emulex.com>
> ---
>  drivers/net/ethernet/emulex/benet/be_cmds.h |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.h 
> b/drivers/net/ethernet/emulex/benet/be_cmds.h
> index 2f6bb06..3c938f5 100644
> --- a/drivers/net/ethernet/emulex/benet/be_cmds.h
> +++ b/drivers/net/ethernet/emulex/benet/be_cmds.h
> @@ -1566,7 +1566,7 @@ struct be_hw_stats_v1 {
>  	u32 rsvd0[BE_TXP_SW_SZ];
>  	struct be_erx_stats_v1 erx;
>  	struct be_pmem_stats pmem;
> -	u32 rsvd1[3];
> +	u32 rsvd1[18];
>  };
>  
>  struct be_cmd_req_get_stats_v1 {

Doesn't this merit a 'struct be_hw_stats_v2'?

Does this mean that the driver wasn't currently allocating enough memory for the structure, and could that result in a buffer overrun?  If so then this fix would need to go into 3.5 and 3.4.y as well.

Ben.

--
Ben Hutchings, Staff Engineer, Solarflare Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


^ permalink raw reply

* [PATCH] ipv4: Handle PMTU in all ICMP error handlers.
From: David Miller @ 2012-06-15  5:28 UTC (permalink / raw)
  To: netdev; +Cc: steffen.klassert


With ip_rt_frag_needed() removed, we have to explicitly update PMTU
information in every ICMP error handler.

Create two helper functions to facilitate this.

1) ipv4_sk_update_pmtu()

   This updates the PMTU when we have a socket context to
   work with.

2) ipv4_update_pmtu()

   Raw version, used when no socket context is available.  For this
   interface, we essentially just pass in explicit arguments for
   the flow identity information we would have extracted from the
   socket.

   And you'll notice that ipv4_sk_update_pmtu() is simply implemented
   in terms of ipv4_update_pmtu()

Note that __ip_route_output_key() is used, rather than something like
ip_route_output_flow() or ip_route_output_key().  This is because we
absolutely do not want to end up with a route that does IPSEC
encapsulation and the like.  Instead, we only want the route that
would get us to the node described by the outermost IP header.

Reported-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---

Steffen, I've checked this patch into net-next, thanks for all of your
help.

I'm working on the ipv6 side of this problem next.

 include/net/route.h |    5 ++++-
 net/ipv4/ah4.c      |    1 +
 net/ipv4/esp4.c     |    1 +
 net/ipv4/ip_gre.c   |   14 ++++++++++----
 net/ipv4/ipcomp.c   |    1 +
 net/ipv4/ipip.c     |   15 +++++++++++----
 net/ipv4/ping.c     |    1 +
 net/ipv4/raw.c      |    3 +++
 net/ipv4/route.c    |   28 ++++++++++++++++++++++++++++
 net/ipv4/udp.c      |    1 +
 net/ipv6/sit.c      |   15 +++++++++++----
 11 files changed, 72 insertions(+), 13 deletions(-)

diff --git a/include/net/route.h b/include/net/route.h
index a36ae42..47eb25a 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -215,7 +215,10 @@ static inline int ip_route_input_noref(struct sk_buff *skb, __be32 dst, __be32 s
 	return ip_route_input_common(skb, dst, src, tos, devin, true);
 }
 
-extern void		ip_rt_send_redirect(struct sk_buff *skb);
+extern void ipv4_update_pmtu(struct sk_buff *skb, struct net *net, u32 mtu,
+			     int oif, u32 mark, u8 protocol, int flow_flags);
+extern void ipv4_sk_update_pmtu(struct sk_buff *skb, struct sock *sk, u32 mtu);
+extern void ip_rt_send_redirect(struct sk_buff *skb);
 
 extern unsigned int		inet_addr_type(struct net *net, __be32 addr);
 extern unsigned int		inet_dev_addr_type(struct net *net, const struct net_device *dev, __be32 addr);
diff --git a/net/ipv4/ah4.c b/net/ipv4/ah4.c
index e8f2617..916d5ec 100644
--- a/net/ipv4/ah4.c
+++ b/net/ipv4/ah4.c
@@ -408,6 +408,7 @@ static void ah4_err(struct sk_buff *skb, u32 info)
 		return;
 	pr_debug("pmtu discovery on SA AH/%08x/%08x\n",
 		 ntohl(ah->spi), ntohl(iph->daddr));
+	ipv4_update_pmtu(skb, net, info, 0, 0, IPPROTO_AH, 0);
 	xfrm_state_put(x);
 }
 
diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c
index cb982a6..7b95b49 100644
--- a/net/ipv4/esp4.c
+++ b/net/ipv4/esp4.c
@@ -494,6 +494,7 @@ static void esp4_err(struct sk_buff *skb, u32 info)
 		return;
 	NETDEBUG(KERN_DEBUG "pmtu discovery on SA ESP/%08x/%08x\n",
 		 ntohl(esph->spi), ntohl(iph->daddr));
+	ipv4_update_pmtu(skb, net, info, 0, 0, IPPROTO_ESP, 0);
 	xfrm_state_put(x);
 }
 
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index f49047b..594cec3 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -516,9 +516,6 @@ static void ipgre_err(struct sk_buff *skb, u32 info)
 		case ICMP_PORT_UNREACH:
 			/* Impossible event. */
 			return;
-		case ICMP_FRAG_NEEDED:
-			/* Soft state for pmtu is maintained by IP core. */
-			return;
 		default:
 			/* All others are translated to HOST_UNREACH.
 			   rfc2003 contains "deep thoughts" about NET_UNREACH,
@@ -538,7 +535,16 @@ static void ipgre_err(struct sk_buff *skb, u32 info)
 				flags & GRE_KEY ?
 				*(((__be32 *)p) + (grehlen / 4) - 1) : 0,
 				p[1]);
-	if (t == NULL || t->parms.iph.daddr == 0 ||
+	if (t == NULL)
+		goto out;
+
+	if (type == ICMP_DEST_UNREACH && code == ICMP_FRAG_NEEDED) {
+		ipv4_update_pmtu(skb, dev_net(skb->dev), info,
+				 t->parms.link, 0, IPPROTO_GRE, 0);
+		goto out;
+	}
+
+	if (t->parms.iph.daddr == 0 ||
 	    ipv4_is_multicast(t->parms.iph.daddr))
 		goto out;
 
diff --git a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c
index 63b64c4..b913754 100644
--- a/net/ipv4/ipcomp.c
+++ b/net/ipv4/ipcomp.c
@@ -42,6 +42,7 @@ static void ipcomp4_err(struct sk_buff *skb, u32 info)
 		return;
 	NETDEBUG(KERN_DEBUG "pmtu discovery on SA IPCOMP/%08x/%pI4\n",
 		 spi, &iph->daddr);
+	ipv4_update_pmtu(skb, net, info, 0, 0, IPPROTO_COMP, 0);
 	xfrm_state_put(x);
 }
 
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
index 2d0f99b..715338a 100644
--- a/net/ipv4/ipip.c
+++ b/net/ipv4/ipip.c
@@ -348,9 +348,6 @@ static int ipip_err(struct sk_buff *skb, u32 info)
 		case ICMP_PORT_UNREACH:
 			/* Impossible event. */
 			return 0;
-		case ICMP_FRAG_NEEDED:
-			/* Soft state for pmtu is maintained by IP core. */
-			return 0;
 		default:
 			/* All others are translated to HOST_UNREACH.
 			   rfc2003 contains "deep thoughts" about NET_UNREACH,
@@ -369,7 +366,17 @@ static int ipip_err(struct sk_buff *skb, u32 info)
 
 	rcu_read_lock();
 	t = ipip_tunnel_lookup(dev_net(skb->dev), iph->daddr, iph->saddr);
-	if (t == NULL || t->parms.iph.daddr == 0)
+	if (t == NULL)
+		goto out;
+
+	if (type == ICMP_DEST_UNREACH && code == ICMP_FRAG_NEEDED) {
+		ipv4_update_pmtu(skb, dev_net(skb->dev), info,
+				 t->dev->ifindex, 0, IPPROTO_IPIP, 0);
+		err = 0;
+		goto out;
+	}
+
+	if (t->parms.iph.daddr == 0)
 		goto out;
 
 	err = 0;
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
index 2c00e8b..340fcf2 100644
--- a/net/ipv4/ping.c
+++ b/net/ipv4/ping.c
@@ -371,6 +371,7 @@ void ping_err(struct sk_buff *skb, u32 info)
 		break;
 	case ICMP_DEST_UNREACH:
 		if (code == ICMP_FRAG_NEEDED) { /* Path MTU discovery */
+			ipv4_sk_update_pmtu(skb, sk, info);
 			if (inet_sock->pmtudisc != IP_PMTUDISC_DONT) {
 				err = EMSGSIZE;
 				harderr = 1;
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index 4032b81..659ddfb 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -216,6 +216,9 @@ static void raw_err(struct sock *sk, struct sk_buff *skb, u32 info)
 	int err = 0;
 	int harderr = 0;
 
+	if (type == ICMP_DEST_UNREACH && code == ICMP_FRAG_NEEDED)
+		ipv4_sk_update_pmtu(skb, sk, info);
+
 	/* Report error on raw socket, if:
 	   1. User requested ip_recverr.
 	   2. Socket is connected (otherwise the error indication
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 655506a..41df529 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1711,6 +1711,34 @@ static void ip_rt_update_pmtu(struct dst_entry *dst, u32 mtu)
 	}
 }
 
+void ipv4_update_pmtu(struct sk_buff *skb, struct net *net, u32 mtu,
+		      int oif, u32 mark, u8 protocol, int flow_flags)
+{
+	const struct iphdr *iph = (const struct iphdr *)skb->data;
+	struct flowi4 fl4;
+	struct rtable *rt;
+
+	flowi4_init_output(&fl4, oif, mark, RT_TOS(iph->tos), RT_SCOPE_UNIVERSE,
+			   protocol, flow_flags | FLOWI_FLAG_PRECOW_METRICS,
+			   iph->daddr, iph->saddr, 0, 0);
+	rt = __ip_route_output_key(net, &fl4);
+	if (!IS_ERR(rt)) {
+		ip_rt_update_pmtu(&rt->dst, mtu);
+		ip_rt_put(rt);
+	}
+}
+EXPORT_SYMBOL_GPL(ipv4_update_pmtu);
+
+void ipv4_sk_update_pmtu(struct sk_buff *skb, struct sock *sk, u32 mtu)
+{
+	const struct inet_sock *inet = inet_sk(sk);
+
+	return ipv4_update_pmtu(skb, sock_net(sk), mtu,
+				sk->sk_bound_dev_if, sk->sk_mark,
+				inet->hdrincl ? IPPROTO_RAW : sk->sk_protocol,
+				inet_sk_flowi_flags(sk));
+}
+EXPORT_SYMBOL_GPL(ipv4_sk_update_pmtu);
 
 static void ipv4_validate_peer(struct rtable *rt)
 {
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index eaca736..db017ef 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -615,6 +615,7 @@ void __udp4_lib_err(struct sk_buff *skb, u32 info, struct udp_table *udptable)
 		break;
 	case ICMP_DEST_UNREACH:
 		if (code == ICMP_FRAG_NEEDED) { /* Path MTU discovery */
+			ipv4_sk_update_pmtu(skb, sk, info);
 			if (inet->pmtudisc != IP_PMTUDISC_DONT) {
 				err = EMSGSIZE;
 				harderr = 1;
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index 6041571..49aea94 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -527,9 +527,6 @@ static int ipip6_err(struct sk_buff *skb, u32 info)
 		case ICMP_PORT_UNREACH:
 			/* Impossible event. */
 			return 0;
-		case ICMP_FRAG_NEEDED:
-			/* Soft state for pmtu is maintained by IP core. */
-			return 0;
 		default:
 			/* All others are translated to HOST_UNREACH.
 			   rfc2003 contains "deep thoughts" about NET_UNREACH,
@@ -551,7 +548,17 @@ static int ipip6_err(struct sk_buff *skb, u32 info)
 				skb->dev,
 				iph->daddr,
 				iph->saddr);
-	if (t == NULL || t->parms.iph.daddr == 0)
+	if (t == NULL)
+		goto out;
+
+	if (type == ICMP_DEST_UNREACH && code == ICMP_FRAG_NEEDED) {
+		ipv4_update_pmtu(skb, dev_net(skb->dev), info,
+				 t->dev->ifindex, 0, IPPROTO_IPV6, 0);
+		err = 0;
+		goto out;
+	}
+
+	if (t->parms.iph.daddr == 0)
 		goto out;
 
 	err = 0;
-- 
1.7.10

^ permalink raw reply related

* Re: [net-next PATCH 02/02] net/ipv4: VTI support new module for ip_vti.
From: Steffen Klassert @ 2012-06-15  5:37 UTC (permalink / raw)
  To: Saurabh Mohan; +Cc: netdev
In-Reply-To: <c2becb86-be73-4668-be84-82293c6c56fc@tahiti.vyatta.com>

On Thu, Jun 14, 2012 at 07:43:59PM -0700, Saurabh Mohan wrote:
> > +
> > +	iph->version		= 4;
> > +	iph->protocol		= IPPROTO_ESP;
> 
> Why IPPROTO_ESP? What's with the other IPsec protocols?
> Shouldn't this be IPPROTO_IPIP?
> 
> @SM: VTI will work only with ESP not with AH (at least I have never heard of any one using it with AH). Plus I wanted to keep this module separate from IPIP (ip-in-ip tunnels).
> 

VTI should be independent of the IPsec protocol.
Our IPsec implementation supports AH (and IPCOMP)
so VTI should support these protocols too.

^ permalink raw reply

* Re: [RFC] Introduce to batch variants of accept() and epoll_ctl() syscall
From: Li Yu @ 2012-06-15  5:37 UTC (permalink / raw)
  To: Changli Gao; +Cc: Linux Netdev List, Linux Kernel Mailing List, davidel
In-Reply-To: <CABa6K_H3NrvvZ3Bh7JqsR6h33BSqYPBenUDG5Yt1U=2VvP700g@mail.gmail.com>

于 2012年06月15日 12:29, Changli Gao 写道:
> On Fri, Jun 15, 2012 at 12:13 PM, Li Yu<raise.sail@gmail.com>  wrote:
>> Hi,
>>
>>   We encounter a performance problem in a large scale computer
>> cluster, which needs to handle a lot of incoming concurrent TCP
>> connection requests.
>>
>>   The top shows the kernel is most cpu hog, the testing is simple,
>> just a accept() ->  epoll_ctl(ADD) loop, the ratio of cpu util sys% to
>> si% is about 2:5.
>>
>>   I also asked some experienced webserver/proxy developers in my team
>> for suggestions, it seem that behavior of many userland programs already
>> called accept() multiple times after it is waked up by
>> epoll_wait(). And the common action is adding the fd that accept()
>> return into epoll interface by epoll_ctl() syscall then.
>>
>>   Therefore, I think that we'd better to introduce to batch variants of
>> accept() and epoll_ctl() syscall, just like sendmmsg() or recvmmsg().
>>
>>   For accept(), we may need a new syscall, it may like this,
>>
>>   struct accept_result {
>>       int fd;
>>       struct sockaddr addr;
>>       socklen_t addr_len;
>>   };
>>
>>   int maccept4(int fd, int flags, int nr_accept_result, struct
>> accept_result *results);
>>
>>   For epoll_ctl(), there are two means to extend it, I prefer to extend
>> current interface instead of introduce to new syscall. We may introduce
>> to a new flag EPOLL_CTL_BATCH. If userland call epoll_ctl() with this
>> flag set, the meaning of last two arguments of epoll_ctl() change, .e.g:
>>
>>   struct batch_epoll_event batch_event[] = {
>>          {
>>               .fd = a_newsock_fd;
>>               .epoll_event = { ... };
>>          },
>>          ...
>>   };
>>
>>   ret = epoll_ctl(fd, EPOLL_CTL_ADD|EPOLL_CTL_BATCH, nr_batch_events,
>> batch_events);
>>
>
> I think it is good idea. Would you please implement a prototype and
> give some numbers? This kind of data may help selling this idea.
> Thanks.
>

Of course, I think that implementing them should not be a hard work :)

Em. I really do not know whether it is necessary to introduce to a new 
syscall here. An alternative solution to add new socket option to handle 
such batch requirement, so applications also can detect if kernel has 
this extended ability with a easy getsockopt() call.

Any way, I am going to try to write a prototype first.

Thanks

Yu

^ permalink raw reply

* Re: [net-next PATCH 01/02] net/ipv4: VTI support rx-path hook in xfrm4_mode_tunnel.
From: Steffen Klassert @ 2012-06-15  5:46 UTC (permalink / raw)
  To: Saurabh Mohan; +Cc: netdev
In-Reply-To: <766b5544-ace1-44b5-ac14-14d0e7702b4f@tahiti.vyatta.com>

On Thu, Jun 14, 2012 at 07:44:11PM -0700, Saurabh Mohan wrote:
> > +
> >  static int xfrm4_mode_tunnel_input(struct xfrm_state *x, struct sk_buff *skb)
> >  {
> > +	struct xfrm_tunnel *handler;
> >  	int err = -EINVAL;
> >  
> >  	if (XFRM_MODE_SKB_CB(skb)->protocol != IPPROTO_IPIP)
> > @@ -74,6 +142,10 @@ static int xfrm4_mode_tunnel_input(struct xfrm_state *x, struct sk_buff *skb)
> >  	if (!pskb_may_pull(skb, sizeof(struct iphdr)))
> >  		goto out;
> >  
> > +	/* The handlers do not consume the skb. */
> > +	for_each_input_rcu(rcv_notify_handlers, handler)
> > +		handler->handler(skb);
> 
> I'm not sure if this is the right place to add your handler.
> My understanding of an IPsec tunnel device would be to
> receive the packet first and then do IPsec processing.
> Here it happens the other way arround.
> 
> @SM: The intention is to get the packet post decrypt and post-esp-decap. Just like a GRE tunnel the rx-counters account for the payload and NOT the GRE header.
> 

Well, I think a virtual interface should behave similar
to physical interfaces. And a physical interface has to
receive the packet before it can be processed.

I looked into the old klips IPsec implementation.
They had virtual IPsec interfaces and they did it like 
that, update the statistics and the input device first
and process the packet then.

^ permalink raw reply

* [PATCH wireless-next 00/20] Use pr_<level>
From: Joe Perches @ 2012-06-15  5:53 UTC (permalink / raw)
  To: linux-wireless, b43-dev, libertas-dev; +Cc: netdev, linux-kernel

Update logging style

Joe Perches (20):
  adm8211: Use pr_<level>
  airo_cs: Use pr_<level>
  at76c50x-usb: Use pr_<level>
  atmel: atmel_cs: Use pr_<level>
  b43: Use pr_<level>
  b43legacy: Use pr_<level>
  hostap: Use pr_<level>
  ipw2x00: Use pr_<level>
  libertas: Use pr_<level>
  libertas_tf: Use pr_<level>
  mac80211_hwsim: Use pr_<level>
  mwl8k: Use pr_<level>
  orinoco: Use pr_<level>
  p54: Use pr_<level>
  prism54: Use pr_<level>
  ray_cs: Use pr_<level>
  rtl818x: Use pr_<level>
  ti: Use pr_<level>
  wl3501_cs: Use pr_<level>
  zd_usb: Use pr_<level>

 drivers/net/wireless/adm8211.c                |   67 ++--
 drivers/net/wireless/airo_cs.c                |    4 +-
 drivers/net/wireless/at76c50x-usb.c           |   15 +-
 drivers/net/wireless/atmel.c                  |   71 ++--
 drivers/net/wireless/atmel_cs.c               |    4 +-
 drivers/net/wireless/b43/debugfs.c            |   20 +-
 drivers/net/wireless/b43/main.c               |   41 +--
 drivers/net/wireless/b43/pcmcia.c             |    5 +-
 drivers/net/wireless/b43legacy/b43legacy.h    |   14 +-
 drivers/net/wireless/b43legacy/debugfs.c      |    4 +-
 drivers/net/wireless/b43legacy/dma.c          |    2 +
 drivers/net/wireless/b43legacy/main.c         |   16 +-
 drivers/net/wireless/b43legacy/phy.c          |    2 +
 drivers/net/wireless/b43legacy/radio.c        |    5 +-
 drivers/net/wireless/b43legacy/xmit.c         |    2 +
 drivers/net/wireless/hostap/hostap_80211_rx.c |  125 ++++----
 drivers/net/wireless/hostap/hostap_80211_tx.c |   78 ++---
 drivers/net/wireless/hostap/hostap_ap.c       |   77 ++---
 drivers/net/wireless/hostap/hostap_cs.c       |   53 ++--
 drivers/net/wireless/hostap/hostap_download.c |  143 ++++-----
 drivers/net/wireless/hostap/hostap_hw.c       |  438 +++++++++++--------------
 drivers/net/wireless/hostap/hostap_info.c     |   36 +-
 drivers/net/wireless/hostap/hostap_ioctl.c    |  175 +++++------
 drivers/net/wireless/hostap/hostap_main.c     |  142 ++++-----
 drivers/net/wireless/hostap/hostap_pci.c      |   26 +-
 drivers/net/wireless/hostap/hostap_plx.c      |   69 ++---
 drivers/net/wireless/hostap/hostap_proc.c     |   18 +-
 drivers/net/wireless/hostap/hostap_wlan.h     |   16 +-
 drivers/net/wireless/ipw2x00/ipw2100.c        |  225 +++++--------
 drivers/net/wireless/ipw2x00/ipw2100.h        |    4 +-
 drivers/net/wireless/ipw2x00/ipw2200.c        |   54 ++--
 drivers/net/wireless/ipw2x00/ipw2200.h        |   36 ++-
 drivers/net/wireless/ipw2x00/libipw.h         |   24 +-
 drivers/net/wireless/ipw2x00/libipw_geo.c     |    3 +
 drivers/net/wireless/ipw2x00/libipw_module.c  |    9 +-
 drivers/net/wireless/ipw2x00/libipw_rx.c      |   49 ++--
 drivers/net/wireless/ipw2x00/libipw_tx.c      |   11 +-
 drivers/net/wireless/ipw2x00/libipw_wx.c      |    4 +-
 drivers/net/wireless/libertas/cmd.c           |    2 +
 drivers/net/wireless/libertas/cmdresp.c       |    2 +
 drivers/net/wireless/libertas/if_cs.c         |   14 +-
 drivers/net/wireless/libertas/if_sdio.c       |    6 +-
 drivers/net/wireless/libertas/if_spi.c        |    4 +-
 drivers/net/wireless/libertas/if_usb.c        |    4 +-
 drivers/net/wireless/libertas/tx.c            |    3 +
 drivers/net/wireless/libertas_tf/cmd.c        |   12 +-
 drivers/net/wireless/libertas_tf/deb_defs.h   |  105 ++++--
 drivers/net/wireless/libertas_tf/if_usb.c     |    2 +-
 drivers/net/wireless/libertas_tf/main.c       |   14 +-
 drivers/net/wireless/mac80211_hwsim.c         |   61 ++--
 drivers/net/wireless/mwl8k.c                  |   53 ++--
 drivers/net/wireless/orinoco/airport.c        |   28 +-
 drivers/net/wireless/orinoco/cfg.c            |    9 +-
 drivers/net/wireless/orinoco/hermes.c         |   71 ++--
 drivers/net/wireless/orinoco/hw.c             |   79 ++---
 drivers/net/wireless/orinoco/main.c           |  194 +++++------
 drivers/net/wireless/orinoco/mic.c            |   13 +-
 drivers/net/wireless/orinoco/orinoco.h        |   13 +-
 drivers/net/wireless/orinoco/orinoco_cs.c     |   11 +-
 drivers/net/wireless/orinoco/orinoco_nortel.c |   40 ++--
 drivers/net/wireless/orinoco/orinoco_pci.c    |   23 +-
 drivers/net/wireless/orinoco/orinoco_pci.h    |    6 +-
 drivers/net/wireless/orinoco/orinoco_plx.c    |   40 ++--
 drivers/net/wireless/orinoco/orinoco_tmd.c    |   25 +-
 drivers/net/wireless/orinoco/orinoco_usb.c    |  145 ++++-----
 drivers/net/wireless/orinoco/scan.c           |   16 +-
 drivers/net/wireless/orinoco/spectrum_cs.c    |    6 +-
 drivers/net/wireless/orinoco/wext.c           |   28 +-
 drivers/net/wireless/p54/fwio.c               |    6 +-
 drivers/net/wireless/p54/p54spi.c             |    4 +-
 drivers/net/wireless/prism54/isl_ioctl.c      |   69 ++--
 drivers/net/wireless/prism54/islpci_dev.c     |   57 ++--
 drivers/net/wireless/prism54/islpci_eth.c     |   25 +-
 drivers/net/wireless/prism54/islpci_hotplug.c |   34 +-
 drivers/net/wireless/prism54/islpci_mgt.c     |   75 ++---
 drivers/net/wireless/prism54/islpci_mgt.h     |    9 +-
 drivers/net/wireless/prism54/oid_mgt.c        |   23 +-
 drivers/net/wireless/ray_cs.c                 |  147 ++++-----
 drivers/net/wireless/rtl818x/rtl8180/dev.c    |   35 +--
 drivers/net/wireless/rtl818x/rtl8187/dev.c    |   15 +-
 drivers/net/wireless/rtl818x/rtl8187/leds.c   |    6 +-
 drivers/net/wireless/rtl818x/rtl8187/rfkill.c |    9 +-
 drivers/net/wireless/ti/wl1251/acx.c          |  151 +++++-----
 drivers/net/wireless/ti/wl1251/boot.c         |   51 ++--
 drivers/net/wireless/ti/wl1251/cmd.c          |   76 +++---
 drivers/net/wireless/ti/wl1251/init.c         |   16 +-
 drivers/net/wireless/ti/wl1251/io.c           |   27 +-
 drivers/net/wireless/ti/wl1251/main.c         |  103 +++---
 drivers/net/wireless/ti/wl1251/ps.c           |   16 +-
 drivers/net/wireless/ti/wl1251/rx.c           |    8 +-
 drivers/net/wireless/ti/wl1251/sdio.c         |   20 +-
 drivers/net/wireless/ti/wl1251/spi.c          |   20 +-
 drivers/net/wireless/ti/wl1251/tx.c           |   21 +-
 drivers/net/wireless/ti/wl1251/wl1251.h       |   20 +-
 drivers/net/wireless/ti/wl12xx/acx.c          |    2 +-
 drivers/net/wireless/ti/wl12xx/cmd.c          |   18 +-
 drivers/net/wireless/ti/wl12xx/main.c         |   39 ++-
 drivers/net/wireless/ti/wl18xx/acx.c          |   12 +-
 drivers/net/wireless/ti/wl18xx/main.c         |   54 ++--
 drivers/net/wireless/ti/wl18xx/tx.c           |   10 +-
 drivers/net/wireless/ti/wlcore/acx.c          |  229 +++++++-------
 drivers/net/wireless/ti/wlcore/boot.c         |   56 ++--
 drivers/net/wireless/ti/wlcore/cmd.c          |  164 +++++-----
 drivers/net/wireless/ti/wlcore/debug.h        |   22 +-
 drivers/net/wireless/ti/wlcore/debugfs.c      |   42 ++--
 drivers/net/wireless/ti/wlcore/event.c        |   16 +-
 drivers/net/wireless/ti/wlcore/main.c         |  281 ++++++++--------
 drivers/net/wireless/ti/wlcore/ps.c           |   34 +-
 drivers/net/wireless/ti/wlcore/rx.c           |   33 +-
 drivers/net/wireless/ti/wlcore/scan.c         |   68 ++--
 drivers/net/wireless/ti/wlcore/sdio.c         |    3 +-
 drivers/net/wireless/ti/wlcore/testmode.c     |   16 +-
 drivers/net/wireless/ti/wlcore/tx.c           |   23 +-
 drivers/net/wireless/wl3501_cs.c              |   80 +++---
 drivers/net/wireless/zd1211rw/zd_usb.c        |   13 +-
 115 files changed, 2579 insertions(+), 2795 deletions(-)

-- 
1.7.8.111.gad25c.dirty

^ permalink raw reply

* [PATCH wireless-next 01/20] adm8211: Use pr_<level>
From: Joe Perches @ 2012-06-15  5:53 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless, netdev, linux-kernel
In-Reply-To: <cover.1339739415.git.joe@perches.com>

Use a more current logging style.

Convert printks to pr_<level>.
Convert printk(KERN_DEBUG to pr_debug(.
Coalesce formats, align arguments.

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/wireless/adm8211.c |   67 ++++++++++++++++++----------------------
 1 files changed, 30 insertions(+), 37 deletions(-)

diff --git a/drivers/net/wireless/adm8211.c b/drivers/net/wireless/adm8211.c
index 0ac09a2..5d2d1b5 100644
--- a/drivers/net/wireless/adm8211.c
+++ b/drivers/net/wireless/adm8211.c
@@ -15,6 +15,8 @@
  * more details.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/if.h>
@@ -151,8 +153,8 @@ static int adm8211_read_eeprom(struct ieee80211_hw *dev)
 		else
 			priv->rf_type = ADM8211_TYPE_AIROHA;
 
-		printk(KERN_WARNING "%s (adm8211): Unknown RFtype %d\n",
-		       pci_name(priv->pdev), (cr49 >> 3) & 0x7);
+		pr_warn("%s: Unknown RFtype %d\n",
+			pci_name(priv->pdev), (cr49 >> 3) & 0x7);
 	}
 
 	priv->bbp_type = cr49 & 0x7;
@@ -169,20 +171,21 @@ static int adm8211_read_eeprom(struct ieee80211_hw *dev)
 		else
 			priv->bbp_type = ADM8211_TYPE_ADMTEK;
 
-		printk(KERN_WARNING "%s (adm8211): Unknown BBPtype: %d\n",
-		       pci_name(priv->pdev), cr49 >> 3);
+		pr_warn("%s: Unknown BBPtype: %d\n",
+			pci_name(priv->pdev), cr49 >> 3);
 	}
 
 	if (priv->eeprom->country_code >= ARRAY_SIZE(cranges)) {
-		printk(KERN_WARNING "%s (adm8211): Invalid country code (%d)\n",
-		       pci_name(priv->pdev), priv->eeprom->country_code);
+		pr_warn("%s: Invalid country code (%d)\n",
+			pci_name(priv->pdev), priv->eeprom->country_code);
 
 		chan_range = cranges[2];
 	} else
 		chan_range = cranges[priv->eeprom->country_code];
 
-	printk(KERN_DEBUG "%s (adm8211): Channel range: %d - %d\n",
-	       pci_name(priv->pdev), (int)chan_range.min, (int)chan_range.max);
+	pr_debug("%s: Channel range: %d - %d\n",
+		 pci_name(priv->pdev),
+		 (int)chan_range.min, (int)chan_range.max);
 
 	BUILD_BUG_ON(sizeof(priv->channels) != sizeof(adm8211_channels));
 
@@ -209,8 +212,8 @@ static int adm8211_read_eeprom(struct ieee80211_hw *dev)
 		else
 			priv->specific_bbptype = ADM8211_BBP_ADM8011;
 
-		printk(KERN_WARNING "%s (adm8211): Unknown specific BBP: %d\n",
-		       pci_name(priv->pdev), priv->eeprom->specific_bbptype);
+		pr_warn("%s: Unknown specific BBP: %d\n",
+			pci_name(priv->pdev), priv->eeprom->specific_bbptype);
 	}
 
 	switch (priv->eeprom->specific_rftype) {
@@ -230,15 +233,16 @@ static int adm8211_read_eeprom(struct ieee80211_hw *dev)
 		else if (priv->pdev->revision == ADM8211_REV_AB)
 			priv->transceiver_type = ADM8211_RFMD2948;
 
-		printk(KERN_WARNING "%s (adm8211): Unknown transceiver: %d\n",
-		       pci_name(priv->pdev), priv->eeprom->specific_rftype);
+		pr_warn("%s: Unknown transceiver: %d\n",
+			pci_name(priv->pdev), priv->eeprom->specific_rftype);
 
 		break;
 	}
 
-	printk(KERN_DEBUG "%s (adm8211): RFtype=%d BBPtype=%d Specific BBP=%d "
-               "Transceiver=%d\n", pci_name(priv->pdev), priv->rf_type,
-	       priv->bbp_type, priv->specific_bbptype, priv->transceiver_type);
+	pr_debug("%s: RFtype=%d BBPtype=%d Specific BBP=%d Transceiver=%d\n",
+		 pci_name(priv->pdev), priv->rf_type,
+		 priv->bbp_type, priv->specific_bbptype,
+		 priv->transceiver_type);
 
 	return 0;
 }
@@ -1773,8 +1777,7 @@ static int __devinit adm8211_probe(struct pci_dev *pdev,
 
 	err = pci_enable_device(pdev);
 	if (err) {
-		printk(KERN_ERR "%s (adm8211): Cannot enable new PCI device\n",
-		       pci_name(pdev));
+		pr_err("%s: Cannot enable new PCI device\n", pci_name(pdev));
 		return err;
 	}
 
@@ -1783,8 +1786,7 @@ static int __devinit adm8211_probe(struct pci_dev *pdev,
 	mem_addr = pci_resource_start(pdev, 1);
 	mem_len = pci_resource_len(pdev, 1);
 	if (io_len < 256 || mem_len < 1024) {
-		printk(KERN_ERR "%s (adm8211): Too short PCI resources\n",
-		       pci_name(pdev));
+		pr_err("%s: Too short PCI resources\n", pci_name(pdev));
 		goto err_disable_pdev;
 	}
 
@@ -1792,22 +1794,19 @@ static int __devinit adm8211_probe(struct pci_dev *pdev,
 	/* check signature */
 	pci_read_config_dword(pdev, 0x80 /* CR32 */, &reg);
 	if (reg != ADM8211_SIG1 && reg != ADM8211_SIG2) {
-		printk(KERN_ERR "%s (adm8211): Invalid signature (0x%x)\n",
-		       pci_name(pdev), reg);
+		pr_err("%s: Invalid signature (0x%x)\n", pci_name(pdev), reg);
 		goto err_disable_pdev;
 	}
 
 	err = pci_request_regions(pdev, "adm8211");
 	if (err) {
-		printk(KERN_ERR "%s (adm8211): Cannot obtain PCI resources\n",
-		       pci_name(pdev));
+		pr_err("%s: Cannot obtain PCI resources\n", pci_name(pdev));
 		return err; /* someone else grabbed it? don't disable it */
 	}
 
 	if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32)) ||
 	    pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32))) {
-		printk(KERN_ERR "%s (adm8211): No suitable DMA available\n",
-		       pci_name(pdev));
+		pr_err("%s: No suitable DMA available\n", pci_name(pdev));
 		goto err_free_reg;
 	}
 
@@ -1815,8 +1814,7 @@ static int __devinit adm8211_probe(struct pci_dev *pdev,
 
 	dev = ieee80211_alloc_hw(sizeof(*priv), &adm8211_ops);
 	if (!dev) {
-		printk(KERN_ERR "%s (adm8211): ieee80211 alloc failed\n",
-		       pci_name(pdev));
+		pr_err("%s: ieee80211 alloc failed\n", pci_name(pdev));
 		err = -ENOMEM;
 		goto err_free_reg;
 	}
@@ -1834,8 +1832,7 @@ static int __devinit adm8211_probe(struct pci_dev *pdev,
 		priv->map = pci_iomap(pdev, 0, io_len);
 
 	if (!priv->map) {
-		printk(KERN_ERR "%s (adm8211): Cannot map device memory\n",
-		       pci_name(pdev));
+		pr_err("%s: Cannot map device memory\n", pci_name(pdev));
 		goto err_free_dev;
 	}
 
@@ -1843,8 +1840,7 @@ static int __devinit adm8211_probe(struct pci_dev *pdev,
 	priv->tx_ring_size = tx_ring_size;
 
 	if (adm8211_alloc_rings(dev)) {
-		printk(KERN_ERR "%s (adm8211): Cannot allocate TX/RX ring\n",
-		       pci_name(pdev));
+		pr_err("%s: Cannot allocate TX/RX ring\n", pci_name(pdev));
 		goto err_iounmap;
 	}
 
@@ -1853,8 +1849,7 @@ static int __devinit adm8211_probe(struct pci_dev *pdev,
 		cpu_to_le16(ADM8211_CSR_READ(PAR1) & 0xFFFF);
 
 	if (!is_valid_ether_addr(perm_addr)) {
-		printk(KERN_WARNING "%s (adm8211): Invalid hwaddr in EEPROM!\n",
-		       pci_name(pdev));
+		pr_warn("%s: Invalid hwaddr in EEPROM!\n", pci_name(pdev));
 		random_ether_addr(perm_addr);
 	}
 	SET_IEEE80211_PERM_ADDR(dev, perm_addr);
@@ -1887,8 +1882,7 @@ static int __devinit adm8211_probe(struct pci_dev *pdev,
 
 	err = adm8211_read_eeprom(dev);
 	if (err) {
-		printk(KERN_ERR "%s (adm8211): Can't alloc eeprom buffer\n",
-		       pci_name(pdev));
+		pr_err("%s: Can't alloc eeprom buffer\n", pci_name(pdev));
 		goto err_free_desc;
 	}
 
@@ -1898,8 +1892,7 @@ static int __devinit adm8211_probe(struct pci_dev *pdev,
 
 	err = ieee80211_register_hw(dev);
 	if (err) {
-		printk(KERN_ERR "%s (adm8211): Cannot register device\n",
-		       pci_name(pdev));
+		pr_err("%s: Cannot register device\n", pci_name(pdev));
 		goto err_free_eeprom;
 	}
 
-- 
1.7.8.111.gad25c.dirty

^ permalink raw reply related

* [PATCH wireless-next 02/20] airo_cs: Use pr_<level>
From: Joe Perches @ 2012-06-15  5:53 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless, netdev, linux-kernel
In-Reply-To: <cover.1339739415.git.joe@perches.com>

Use a more current logging style.

Convert printks to pr_<level>.
Convert printk(KERN_DEBUG to pr_debug(.
Coalesce formats, align arguments.

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/wireless/airo_cs.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/airo_cs.c b/drivers/net/wireless/airo_cs.c
index 630577d..1a723be 100644
--- a/drivers/net/wireless/airo_cs.c
+++ b/drivers/net/wireless/airo_cs.c
@@ -20,6 +20,8 @@
 
 ======================================================================*/
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #ifdef __IN_PCMCIA_PACKAGE__
 #include <pcmcia/k_compat.h>
 #endif
@@ -70,7 +72,7 @@ static int airo_probe(struct pcmcia_device *p_dev)
 	/* Allocate space for private device-specific data */
 	local = kzalloc(sizeof(local_info_t), GFP_KERNEL);
 	if (!local) {
-		printk(KERN_ERR "airo_cs: no memory for new device\n");
+		pr_err("no memory for new device\n");
 		return -ENOMEM;
 	}
 	p_dev->priv = local;
-- 
1.7.8.111.gad25c.dirty

^ permalink raw reply related

* [PATCH wireless-next 03/20] at76c50x-usb: Use pr_<level>
From: Joe Perches @ 2012-06-15  5:53 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless, netdev, linux-kernel
In-Reply-To: <cover.1339739415.git.joe@perches.com>

Use a more current logging style.

Convert printks to pr_<level>.
Coalesce formats, align arguments.

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/wireless/at76c50x-usb.c |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/at76c50x-usb.c b/drivers/net/wireless/at76c50x-usb.c
index efc162e..817fd7b 100644
--- a/drivers/net/wireless/at76c50x-usb.c
+++ b/drivers/net/wireless/at76c50x-usb.c
@@ -25,6 +25,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -2120,8 +2122,7 @@ static struct at76_priv *at76_alloc_new_device(struct usb_device *udev)
 
 	hw = ieee80211_alloc_hw(sizeof(struct at76_priv), &at76_ops);
 	if (!hw) {
-		printk(KERN_ERR DRIVER_NAME ": could not register"
-		       " ieee80211_hw\n");
+		pr_err("could not register ieee80211_hw\n");
 		return NULL;
 	}
 
@@ -2301,8 +2302,7 @@ static int at76_init_new_device(struct at76_priv *priv,
 
 	ret = ieee80211_register_hw(priv->hw);
 	if (ret) {
-		printk(KERN_ERR "cannot register mac80211 hw (status %d)!\n",
-		       ret);
+		pr_err("cannot register mac80211 hw (status %d)!\n", ret);
 		goto exit;
 	}
 
@@ -2493,15 +2493,14 @@ static int __init at76_mod_init(void)
 {
 	int result;
 
-	printk(KERN_INFO DRIVER_DESC " " DRIVER_VERSION " loading\n");
+	pr_info(DRIVER_DESC " " DRIVER_VERSION " loading\n");
 
 	mutex_init(&fw_mutex);
 
 	/* register this driver with the USB subsystem */
 	result = usb_register(&at76_driver);
 	if (result < 0)
-		printk(KERN_ERR DRIVER_NAME
-		       ": usb_register failed (status %d)\n", result);
+		pr_err("usb_register failed (status %d)\n", result);
 
 	led_trigger_register_simple("at76_usb-tx", &ledtrig_tx);
 	return result;
@@ -2511,7 +2510,7 @@ static void __exit at76_mod_exit(void)
 {
 	int i;
 
-	printk(KERN_INFO DRIVER_DESC " " DRIVER_VERSION " unloading\n");
+	pr_info(DRIVER_DESC " " DRIVER_VERSION " unloading\n");
 	usb_deregister(&at76_driver);
 	for (i = 0; i < ARRAY_SIZE(firmwares); i++)
 		release_firmware(firmwares[i].fw);
-- 
1.7.8.111.gad25c.dirty

^ permalink raw reply related

* [PATCH wireless-next 04/20] atmel: atmel_cs: Use pr_<level>
From: Joe Perches @ 2012-06-15  5:53 UTC (permalink / raw)
  To: Simon Kelley, John W. Linville; +Cc: linux-wireless, netdev, linux-kernel
In-Reply-To: <cover.1339739415.git.joe@perches.com>

Use a more current logging style.

Convert printks to pr_<level>.
Coalesce formats, align arguments.

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/wireless/atmel.c    |   71 ++++++++++++++++++++-------------------
 drivers/net/wireless/atmel_cs.c |    4 ++-
 2 files changed, 39 insertions(+), 36 deletions(-)

diff --git a/drivers/net/wireless/atmel.c b/drivers/net/wireless/atmel.c
index d07c030..2688735 100644
--- a/drivers/net/wireless/atmel.c
+++ b/drivers/net/wireless/atmel.c
@@ -39,6 +39,8 @@
 
 ******************************************************************************/
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/init.h>
 #include <linux/interrupt.h>
 
@@ -1189,7 +1191,7 @@ static irqreturn_t service_interrupt(int irq, void *dev_id)
 	while (1) {
 		if (!atmel_lock_mac(priv)) {
 			/* failed to contact card */
-			printk(KERN_ALERT "%s: failed to contact MAC.\n", dev->name);
+			pr_alert("%s: failed to contact MAC\n", dev->name);
 			return IRQ_HANDLED;
 		}
 
@@ -1209,7 +1211,7 @@ static irqreturn_t service_interrupt(int irq, void *dev_id)
 
 		if (!atmel_lock_mac(priv)) {
 			/* failed to contact card */
-			printk(KERN_ALERT "%s: failed to contact MAC.\n", dev->name);
+			pr_alert("%s: failed to contact MAC\n", dev->name);
 			return IRQ_HANDLED;
 		}
 
@@ -1240,7 +1242,8 @@ static irqreturn_t service_interrupt(int irq, void *dev_id)
 			break;
 
 		case ISR_FATAL_ERROR:
-			printk(KERN_ALERT "%s: *** FATAL error interrupt ***\n", dev->name);
+			pr_alert("%s: *** FATAL error interrupt ***\n",
+				 dev->name);
 			atmel_enter_state(priv, STATION_STATE_MGMT_ERROR);
 			break;
 
@@ -1256,7 +1259,7 @@ static irqreturn_t service_interrupt(int irq, void *dev_id)
 				build_wpa_mib(priv);
 			break;
 		case ISR_GENERIC_IRQ:
-			printk(KERN_INFO "%s: Generic_irq received.\n", dev->name);
+			pr_info("%s: Generic_irq received\n", dev->name);
 			break;
 		}
 	}
@@ -1355,7 +1358,8 @@ int atmel_open(struct net_device *dev)
 				break;
 		if (i == ARRAY_SIZE(channel_table)) {
 			priv->reg_domain = REG_DOMAIN_MKK1;
-			printk(KERN_ALERT "%s: failed to get regulatory domain: assuming MKK1.\n", dev->name);
+			pr_alert("%s: failed to get regulatory domain: assuming MKK1\n",
+				 dev->name);
 		}
 	}
 
@@ -1536,7 +1540,7 @@ struct net_device *init_atmel_card(unsigned short irq, unsigned long port,
 		return NULL;
 
 	if (dev_alloc_name(dev, dev->name) < 0) {
-		printk(KERN_ERR "atmel: Couldn't get name!\n");
+		pr_err("Couldn't get name!\n");
 		goto err_out_free;
 	}
 
@@ -1611,7 +1615,8 @@ struct net_device *init_atmel_card(unsigned short irq, unsigned long port,
 	SET_NETDEV_DEV(dev, sys_dev);
 
 	if ((rc = request_irq(dev->irq, service_interrupt, IRQF_SHARED, dev->name, dev))) {
-		printk(KERN_ERR "%s: register interrupt %d failed, rc %d\n", dev->name, irq, rc);
+		pr_err("%s: register interrupt %d failed, rc %d\n",
+		       dev->name, irq, rc);
 		goto err_out_free;
 	}
 
@@ -1632,10 +1637,10 @@ struct net_device *init_atmel_card(unsigned short irq, unsigned long port,
 
 	ent = create_proc_read_entry ("driver/atmel", 0, NULL, atmel_read_proc, priv);
 	if (!ent)
-		printk(KERN_WARNING "atmel: unable to create /proc entry.\n");
+		pr_warn("unable to create /proc entry\n");
 
-	printk(KERN_INFO "%s: Atmel at76c50x. Version %d.%d. MAC %pM\n",
-	       dev->name, DRIVER_MAJOR, DRIVER_MINOR, dev->dev_addr);
+	pr_info("%s: Atmel at76c50x. Version %d.%d. MAC %pM\n",
+		dev->name, DRIVER_MAJOR, DRIVER_MINOR, dev->dev_addr);
 
 	return dev;
 
@@ -3642,12 +3647,12 @@ static int atmel_wakeup_firmware(struct atmel_private *priv)
 	}
 
 	if (i == 0) {
-		printk(KERN_ALERT "%s: MAC failed to boot.\n", priv->dev->name);
+		pr_alert("%s: MAC failed to boot\n", priv->dev->name);
 		return -EIO;
 	}
 
 	if ((priv->host_info_base = atmel_read16(priv->dev, MR2)) == 0xffff) {
-		printk(KERN_ALERT "%s: card missing.\n", priv->dev->name);
+		pr_alert("%s: card missing\n", priv->dev->name);
 		return -ENODEV;
 	}
 
@@ -3670,20 +3675,19 @@ static int atmel_wakeup_firmware(struct atmel_private *priv)
 	}
 
 	if (i == 0) {
-		printk(KERN_ALERT "%s: MAC failed to initialise.\n",
-				priv->dev->name);
+		pr_alert("%s: MAC failed to initialise\n", priv->dev->name);
 		return -EIO;
 	}
 
 	/* Check for MAC_INIT_OK only on the register that the MAC_INIT_OK was set */
 	if ((mr3 & MAC_INIT_COMPLETE) &&
 	    !(atmel_read16(priv->dev, MR3) & MAC_INIT_OK)) {
-		printk(KERN_ALERT "%s: MAC failed MR3 self-test.\n", priv->dev->name);
+		pr_alert("%s: MAC failed MR3 self-test\n", priv->dev->name);
 		return -EIO;
 	}
 	if ((mr1 & MAC_INIT_COMPLETE) &&
 	    !(atmel_read16(priv->dev, MR1) & MAC_INIT_OK)) {
-		printk(KERN_ALERT "%s: MAC failed MR1 self-test.\n", priv->dev->name);
+		pr_alert("%s: MAC failed MR1 self-test\n", priv->dev->name);
 		return -EIO;
 	}
 
@@ -3735,7 +3739,8 @@ static int probe_atmel_card(struct net_device *dev)
 			if (atmel_read16(dev, MR3) & MAC_BOOT_COMPLETE)
 				break;
 		if (i == 0) {
-			printk(KERN_ALERT "%s: MAC failed to boot MAC address reader.\n", dev->name);
+			pr_alert("%s: MAC failed to boot MAC address reader\n",
+				 dev->name);
 		} else {
 			atmel_copy_to_host(dev, dev->dev_addr, atmel_read16(dev, MR2), 6);
 			/* got address, now squash it again until the network
@@ -3773,7 +3778,8 @@ static int probe_atmel_card(struct net_device *dev)
 			static const u8 default_mac[] = {
 				0x00, 0x04, 0x25, 0x00, 0x00, 0x00
 			};
-			printk(KERN_ALERT "%s: *** Invalid MAC address. UPGRADE Firmware ****\n", dev->name);
+			pr_alert("%s: *** Invalid MAC address. UPGRADE Firmware ****\n",
+				 dev->name);
 			memcpy(dev->dev_addr, default_mac, 6);
 		}
 	}
@@ -3926,19 +3932,16 @@ static int reset_atmel_card(struct net_device *dev)
 		if (!(fw = priv->firmware)) {
 			if (priv->firmware_type == ATMEL_FW_TYPE_NONE) {
 				if (strlen(priv->firmware_id) == 0) {
-					printk(KERN_INFO
-					       "%s: card type is unknown: assuming at76c502 firmware is OK.\n",
-					       dev->name);
-					printk(KERN_INFO
-					       "%s: if not, use the firmware= module parameter.\n",
-					       dev->name);
+					pr_info("%s: card type is unknown: assuming at76c502 firmware is OK\n",
+						dev->name);
+					pr_info("%s: if not, use the firmware= module parameter\n",
+						dev->name);
 					strcpy(priv->firmware_id, "atmel_at76c502.bin");
 				}
 				err = request_firmware(&fw_entry, priv->firmware_id, priv->sys_dev);
 				if (err != 0) {
-					printk(KERN_ALERT
-					       "%s: firmware %s is missing, cannot continue.\n",
-					       dev->name, priv->firmware_id);
+					pr_alert("%s: firmware %s is missing, cannot continue\n",
+						 dev->name, priv->firmware_id);
 					return err;
 				}
 			} else {
@@ -3964,9 +3967,8 @@ static int reset_atmel_card(struct net_device *dev)
 					}
 				}
 				if (!success) {
-					printk(KERN_ALERT
-					       "%s: firmware %s is missing, cannot start.\n",
-					       dev->name, priv->firmware_id);
+					pr_alert("%s: firmware %s is missing, cannot start\n",
+						 dev->name, priv->firmware_id);
 					priv->firmware_id[0] = '\0';
 					return -ENOENT;
 				}
@@ -4035,8 +4037,7 @@ static int reset_atmel_card(struct net_device *dev)
 	if (!priv->radio_on_broken) {
 		if (atmel_send_command_wait(priv, CMD_EnableRadio, NULL, 0) ==
 		    CMD_STATUS_REJECTED_RADIO_OFF) {
-			printk(KERN_INFO "%s: cannot turn the radio on.\n",
-			       dev->name);
+			pr_info("%s: cannot turn the radio on\n", dev->name);
 			return -EIO;
 		}
 	}
@@ -4101,7 +4102,7 @@ static int atmel_send_command_wait(struct atmel_private *priv, int command,
 	}
 
 	if (i == 0) {
-		printk(KERN_ALERT "%s: failed to contact MAC.\n", priv->dev->name);
+		pr_alert("%s: failed to contact MAC\n", priv->dev->name);
 		status =  CMD_STATUS_HOST_ERROR;
 	} else {
 		if (command != CMD_EnableRadio)
@@ -4155,7 +4156,7 @@ static void atmel_set_mib(struct atmel_private *priv, u8 type, u8 index,
 	m.index = index;
 
 	if (data_len > MIB_MAX_DATA_BYTES)
-		printk(KERN_ALERT "%s: MIB buffer too small.\n", priv->dev->name);
+		pr_alert("%s: MIB buffer too small\n", priv->dev->name);
 
 	memcpy(m.data, data, data_len);
 	atmel_send_command_wait(priv, CMD_Set_MIB_Vars, &m, MIB_HEADER_SIZE + data_len);
@@ -4170,7 +4171,7 @@ static void atmel_get_mib(struct atmel_private *priv, u8 type, u8 index,
 	m.index = index;
 
 	if (data_len > MIB_MAX_DATA_BYTES)
-		printk(KERN_ALERT "%s: MIB buffer too small.\n", priv->dev->name);
+		pr_alert("%s: MIB buffer too small\n", priv->dev->name);
 
 	atmel_send_command_wait(priv, CMD_Get_MIB_Vars, &m, MIB_HEADER_SIZE + data_len);
 	atmel_copy_to_host(priv->dev, data,
diff --git a/drivers/net/wireless/atmel_cs.c b/drivers/net/wireless/atmel_cs.c
index ded03d2..2b85420 100644
--- a/drivers/net/wireless/atmel_cs.c
+++ b/drivers/net/wireless/atmel_cs.c
@@ -29,6 +29,8 @@
 
 ******************************************************************************/
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #ifdef __IN_PCMCIA_PACKAGE__
 #include <pcmcia/k_compat.h>
 #endif
@@ -80,7 +82,7 @@ static int atmel_probe(struct pcmcia_device *p_dev)
 	/* Allocate space for private device-specific data */
 	local = kzalloc(sizeof(local_info_t), GFP_KERNEL);
 	if (!local) {
-		printk(KERN_ERR "atmel_cs: no memory for new device\n");
+		pr_err("no memory for new device\n");
 		return -ENOMEM;
 	}
 	p_dev->priv = local;
-- 
1.7.8.111.gad25c.dirty

^ permalink raw reply related

* [PATCH wireless-next 05/20] b43: Use pr_<level>
From: Joe Perches @ 2012-06-15  5:53 UTC (permalink / raw)
  To: Stefano Brivio
  Cc: John W. Linville, linux-wireless, b43-dev, netdev, linux-kernel
In-Reply-To: <cover.1339739415.git.joe@perches.com>

Use a more current logging style.

Convert printks to pr_<level>.
Coalesce formats, align arguments.

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/wireless/b43/debugfs.c |   20 +++++++++--------
 drivers/net/wireless/b43/main.c    |   41 ++++++++++++++++-------------------
 drivers/net/wireless/b43/pcmcia.c  |    5 ++-
 3 files changed, 33 insertions(+), 33 deletions(-)

diff --git a/drivers/net/wireless/b43/debugfs.c b/drivers/net/wireless/b43/debugfs.c
index e807bd9..1feebd9 100644
--- a/drivers/net/wireless/b43/debugfs.c
+++ b/drivers/net/wireless/b43/debugfs.c
@@ -23,6 +23,8 @@
 
 */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/fs.h>
 #include <linux/debugfs.h>
 #include <linux/slab.h>
@@ -61,15 +63,15 @@ struct b43_dfs_file *fops_to_dfs_file(struct b43_wldev *dev,
 }
 
 
-#define fappend(fmt, x...)	\
-	do {							\
-		if (bufsize - count)				\
-			count += snprintf(buf + count,		\
-					  bufsize - count,	\
-					  fmt , ##x);		\
-		else						\
-			printk(KERN_ERR "b43: fappend overflow\n"); \
-	} while (0)
+#define fappend(fmt, x...)					\
+do {								\
+	if (bufsize - count)					\
+		count += snprintf(buf + count,			\
+				  bufsize - count,		\
+				  fmt , ##x);			\
+	else							\
+		pr_err("fappend overflow\n");			\
+} while (0)
 
 
 /* The biggest address values for SHM access from the debugfs files. */
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index acd03a4..2bcedce 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -32,6 +32,8 @@
 
 */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/module.h>
@@ -354,8 +356,8 @@ void b43info(struct b43_wl *wl, const char *fmt, ...)
 	vaf.fmt = fmt;
 	vaf.va = &args;
 
-	printk(KERN_INFO "b43-%s: %pV",
-	       (wl && wl->hw) ? wiphy_name(wl->hw->wiphy) : "wlan", &vaf);
+	pr_info("%s: %pV",
+		(wl && wl->hw) ? wiphy_name(wl->hw->wiphy) : "wlan", &vaf);
 
 	va_end(args);
 }
@@ -375,7 +377,7 @@ void b43err(struct b43_wl *wl, const char *fmt, ...)
 	vaf.fmt = fmt;
 	vaf.va = &args;
 
-	printk(KERN_ERR "b43-%s ERROR: %pV",
+	pr_err("%s ERROR: %pV",
 	       (wl && wl->hw) ? wiphy_name(wl->hw->wiphy) : "wlan", &vaf);
 
 	va_end(args);
@@ -396,8 +398,8 @@ void b43warn(struct b43_wl *wl, const char *fmt, ...)
 	vaf.fmt = fmt;
 	vaf.va = &args;
 
-	printk(KERN_WARNING "b43-%s warning: %pV",
-	       (wl && wl->hw) ? wiphy_name(wl->hw->wiphy) : "wlan", &vaf);
+	pr_warn("%s warning: %pV",
+		(wl && wl->hw) ? wiphy_name(wl->hw->wiphy) : "wlan", &vaf);
 
 	va_end(args);
 }
@@ -415,7 +417,7 @@ void b43dbg(struct b43_wl *wl, const char *fmt, ...)
 	vaf.fmt = fmt;
 	vaf.va = &args;
 
-	printk(KERN_DEBUG "b43-%s debug: %pV",
+	printk(KERN_DEBUG pr_fmt("%s debug: %pV"),
 	       (wl && wl->hw) ? wiphy_name(wl->hw->wiphy) : "wlan", &vaf);
 
 	va_end(args);
@@ -1069,7 +1071,7 @@ static void b43_dump_keymemory(struct b43_wldev *dev)
 	}
 	for (index = 0; index < count; index++) {
 		key = &(dev->key[index]);
-		printk(KERN_DEBUG "Key slot %02u: %s",
+		printk(KERN_DEBUG pr_fmt("Key slot %02u: %s"),
 		       index, (key->keyconf == NULL) ? " " : "*");
 		offset = dev->ktp + (index * B43_SEC_KEYSIZE);
 		for (i = 0; i < B43_SEC_KEYSIZE; i += 2) {
@@ -1794,7 +1796,7 @@ static void b43_handle_firmware_panic(struct b43_wldev *dev)
 
 static void handle_irq_ucode_debug(struct b43_wldev *dev)
 {
-	unsigned int i, cnt;
+	unsigned int i;
 	u16 reason, marker_id, marker_line;
 	__le16 *buf;
 
@@ -1830,18 +1832,15 @@ static void handle_irq_ucode_debug(struct b43_wldev *dev)
 		if (!B43_DEBUG)
 			break; /* Only with driver debugging enabled. */
 		b43info(dev->wl, "Microcode register dump:\n");
-		for (i = 0, cnt = 0; i < 64; i++) {
+		for (i = 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);
-			cnt++;
-			if (cnt == 6) {
-				printk("\n");
-				cnt = 0;
-			}
+			if (!(i % 6))
+				pr_info("");
+			
+			pr_cont("r%02u: 0x%04X%s",
+				i, tmp, (i % 6) != 5 ? "  " : "\n");
 		}
-		printk("\n");
+		pr_cont("\n");
 		break;
 	case B43_DEBUGIRQ_MARKER:
 		if (!B43_DEBUG)
@@ -5509,10 +5508,8 @@ 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 ]\n",
-	       feat_pci, feat_pcmcia, feat_nphy,
-	       feat_leds, feat_sdio);
+	pr_info("Broadcom 43xx driver loaded [ Features: %s%s%s%s%s ]\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 714cad6..0c0751a 100644
--- a/drivers/net/wireless/b43/pcmcia.c
+++ b/drivers/net/wireless/b43/pcmcia.c
@@ -21,6 +21,8 @@
 
 */
 
+#define pr_fmt(fmt) "b43-pcmcia: " fmt
+
 #include "pcmcia.h"
 
 #include <linux/ssb/ssb.h>
@@ -105,8 +107,7 @@ err_disable:
 err_kfree_ssb:
 	kfree(ssb);
 out_error:
-	printk(KERN_ERR "b43-pcmcia: Initialization failed (%d, %d)\n",
-	       res, err);
+	pr_err("Initialization failed (%d, %d)\n", res, err);
 	return err;
 }
 
-- 
1.7.8.111.gad25c.dirty

^ permalink raw reply related

* [PATCH wireless-next 06/20] b43legacy: Use pr_<level>
From: Joe Perches @ 2012-06-15  5:53 UTC (permalink / raw)
  To: Larry Finger, Stefano Brivio
  Cc: John W. Linville, linux-wireless, b43-dev, netdev, linux-kernel
In-Reply-To: <cover.1339739415.git.joe@perches.com>

Use a more current logging style.

Convert printks to pr_<level>.
Coalesce formats, align arguments.

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/wireless/b43legacy/b43legacy.h |   14 ++++++--------
 drivers/net/wireless/b43legacy/debugfs.c   |    4 +++-
 drivers/net/wireless/b43legacy/dma.c       |    2 ++
 drivers/net/wireless/b43legacy/main.c      |   16 +++++++++-------
 drivers/net/wireless/b43legacy/phy.c       |    2 ++
 drivers/net/wireless/b43legacy/radio.c     |    5 +++--
 drivers/net/wireless/b43legacy/xmit.c      |    2 ++
 7 files changed, 27 insertions(+), 18 deletions(-)

diff --git a/drivers/net/wireless/b43legacy/b43legacy.h b/drivers/net/wireless/b43legacy/b43legacy.h
index a29da67..e77083e 100644
--- a/drivers/net/wireless/b43legacy/b43legacy.h
+++ b/drivers/net/wireless/b43legacy/b43legacy.h
@@ -325,20 +325,18 @@ enum {
 #define B43legacy_SBIMSTATE_IB_ERROR		0x20000
 #define B43legacy_SBIMSTATE_TIMEOUT		0x40000
 
-#define PFX		KBUILD_MODNAME ": "
 #ifdef assert
 # undef assert
 #endif
 #ifdef CONFIG_B43LEGACY_DEBUG
 # define B43legacy_WARN_ON(x)	WARN_ON(x)
 # define B43legacy_BUG_ON(expr)						\
-	do {								\
-		if (unlikely((expr))) {					\
-			printk(KERN_INFO PFX "Test (%s) failed\n",	\
-					      #expr);			\
-			BUG_ON(expr);					\
-		}							\
-	} while (0)
+do {									\
+	if (unlikely((expr))) {						\
+		pr_info("Test (%s) failed\n", #expr);			\
+		BUG_ON(expr);						\
+	}								\
+} while (0)
 # define B43legacy_DEBUG	1
 #else
 /* This will evaluate the argument even if debugging is disabled. */
diff --git a/drivers/net/wireless/b43legacy/debugfs.c b/drivers/net/wireless/b43legacy/debugfs.c
index 1965edb..7678005 100644
--- a/drivers/net/wireless/b43legacy/debugfs.c
+++ b/drivers/net/wireless/b43legacy/debugfs.c
@@ -23,6 +23,8 @@
 
 */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/fs.h>
 #include <linux/debugfs.h>
 #include <linux/slab.h>
@@ -71,7 +73,7 @@ struct b43legacy_dfs_file * fops_to_dfs_file(struct b43legacy_wldev *dev,
 					  bufsize - count,	\
 					  fmt , ##x);		\
 		else						\
-			printk(KERN_ERR "b43legacy: fappend overflow\n"); \
+			pr_err("fappend overflow\n");		\
 	} while (0)
 
 
diff --git a/drivers/net/wireless/b43legacy/dma.c b/drivers/net/wireless/b43legacy/dma.c
index f1f8bd0..6b42488 100644
--- a/drivers/net/wireless/b43legacy/dma.c
+++ b/drivers/net/wireless/b43legacy/dma.c
@@ -27,6 +27,8 @@
 
 */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "b43legacy.h"
 #include "dma.h"
 #include "main.h"
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c
index 8b06ca5..b0536a5 100644
--- a/drivers/net/wireless/b43legacy/main.c
+++ b/drivers/net/wireless/b43legacy/main.c
@@ -29,6 +29,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/module.h>
@@ -190,8 +192,8 @@ void b43legacyinfo(struct b43legacy_wl *wl, const char *fmt, ...)
 	vaf.fmt = fmt;
 	vaf.va = &args;
 
-	printk(KERN_INFO "b43legacy-%s: %pV",
-	       (wl && wl->hw) ? wiphy_name(wl->hw->wiphy) : "wlan", &vaf);
+	pr_info("%s: %pV",
+		(wl && wl->hw) ? wiphy_name(wl->hw->wiphy) : "wlan", &vaf);
 
 	va_end(args);
 }
@@ -209,7 +211,7 @@ void b43legacyerr(struct b43legacy_wl *wl, const char *fmt, ...)
 	vaf.fmt = fmt;
 	vaf.va = &args;
 
-	printk(KERN_ERR "b43legacy-%s ERROR: %pV",
+	pr_err("%s ERROR: %pV",
 	       (wl && wl->hw) ? wiphy_name(wl->hw->wiphy) : "wlan", &vaf);
 
 	va_end(args);
@@ -228,8 +230,8 @@ void b43legacywarn(struct b43legacy_wl *wl, const char *fmt, ...)
 	vaf.fmt = fmt;
 	vaf.va = &args;
 
-	printk(KERN_WARNING "b43legacy-%s warning: %pV",
-	       (wl && wl->hw) ? wiphy_name(wl->hw->wiphy) : "wlan", &vaf);
+	pr_warn("%s warning: %pV",
+		(wl && wl->hw) ? wiphy_name(wl->hw->wiphy) : "wlan", &vaf);
 
 	va_end(args);
 }
@@ -245,7 +247,7 @@ void b43legacydbg(struct b43legacy_wl *wl, const char *fmt, ...)
 	vaf.fmt = fmt;
 	vaf.va = &args;
 
-	printk(KERN_DEBUG "b43legacy-%s debug: %pV",
+	printk(KERN_DEBUG pr_fmt("%s debug: %pV"),
 	       (wl && wl->hw) ? wiphy_name(wl->hw->wiphy) : "wlan", &vaf);
 
 	va_end(args);
@@ -4001,7 +4003,7 @@ static void b43legacy_print_driverinfo(void)
 #ifdef CONFIG_B43LEGACY_DMA
 	feat_dma = "D";
 #endif
-	printk(KERN_INFO "Broadcom 43xx-legacy driver loaded "
+	pr_info("Broadcom 43xx-legacy driver loaded "
 	       "[ Features: %s%s%s%s ]\n",
 	       feat_pci, feat_leds, feat_pio, feat_dma);
 }
diff --git a/drivers/net/wireless/b43legacy/phy.c b/drivers/net/wireless/b43legacy/phy.c
index 995c7d0..e03851d 100644
--- a/drivers/net/wireless/b43legacy/phy.c
+++ b/drivers/net/wireless/b43legacy/phy.c
@@ -29,6 +29,8 @@
 
 */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/delay.h>
 #include <linux/pci.h>
 #include <linux/sched.h>
diff --git a/drivers/net/wireless/b43legacy/radio.c b/drivers/net/wireless/b43legacy/radio.c
index 8961776..ff3f996 100644
--- a/drivers/net/wireless/b43legacy/radio.c
+++ b/drivers/net/wireless/b43legacy/radio.c
@@ -29,6 +29,8 @@
 
 */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/delay.h>
 
 #include "b43legacy.h"
@@ -78,8 +80,7 @@ u16 channel2freq_bg(u8 channel)
 	};
 
 	if (unlikely(channel < 1 || channel > 14)) {
-		printk(KERN_INFO "b43legacy: Channel %d is out of range\n",
-				  channel);
+		pr_info("Channel %d is out of range\n", channel);
 		dump_stack();
 		return 2412;
 	}
diff --git a/drivers/net/wireless/b43legacy/xmit.c b/drivers/net/wireless/b43legacy/xmit.c
index a8012f2..385eb72 100644
--- a/drivers/net/wireless/b43legacy/xmit.c
+++ b/drivers/net/wireless/b43legacy/xmit.c
@@ -28,6 +28,8 @@
 
 */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <net/dst.h>
 
 #include "xmit.h"
-- 
1.7.8.111.gad25c.dirty

^ permalink raw reply related

* [PATCH wireless-next 07/20] hostap: Use pr_<level>
From: Joe Perches @ 2012-06-15  5:53 UTC (permalink / raw)
  To: Jouni Malinen; +Cc: John W. Linville, linux-wireless, netdev, linux-kernel
In-Reply-To: <cover.1339739415.git.joe@perches.com>

Use a more current logging style.

Convert printks to pr_<level>.
Convert printk(KERN_DEBUG to pr_debug(.
Coalesce formats, align arguments.
Neaten debug logging macros.

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/wireless/hostap/hostap_80211_rx.c |  125 ++++----
 drivers/net/wireless/hostap/hostap_80211_tx.c |   78 ++---
 drivers/net/wireless/hostap/hostap_ap.c       |   77 ++---
 drivers/net/wireless/hostap/hostap_cs.c       |   53 ++--
 drivers/net/wireless/hostap/hostap_download.c |  143 ++++-----
 drivers/net/wireless/hostap/hostap_hw.c       |  438 +++++++++++--------------
 drivers/net/wireless/hostap/hostap_info.c     |   36 +-
 drivers/net/wireless/hostap/hostap_ioctl.c    |  175 +++++------
 drivers/net/wireless/hostap/hostap_main.c     |  142 ++++-----
 drivers/net/wireless/hostap/hostap_pci.c      |   26 +-
 drivers/net/wireless/hostap/hostap_plx.c      |   69 ++---
 drivers/net/wireless/hostap/hostap_proc.c     |   18 +-
 drivers/net/wireless/hostap/hostap_wlan.h     |   16 +-
 13 files changed, 629 insertions(+), 767 deletions(-)

diff --git a/drivers/net/wireless/hostap/hostap_80211_rx.c b/drivers/net/wireless/hostap/hostap_80211_rx.c
index df7050a..da1149c 100644
--- a/drivers/net/wireless/hostap/hostap_80211_rx.c
+++ b/drivers/net/wireless/hostap/hostap_80211_rx.c
@@ -1,3 +1,5 @@
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/etherdevice.h>
 #include <linux/slab.h>
 #include <linux/export.h>
@@ -25,35 +27,34 @@ void hostap_dump_rx_80211(const char *name, struct sk_buff *skb,
 
 	hdr = (struct ieee80211_hdr *) skb->data;
 
-	printk(KERN_DEBUG "%s: RX signal=%d noise=%d rate=%d len=%d "
-	       "jiffies=%ld\n",
-	       name, rx_stats->signal, rx_stats->noise, rx_stats->rate,
-	       skb->len, jiffies);
+	pr_debug("%s: RX signal=%d noise=%d rate=%d len=%d jiffies=%ld\n",
+		 name, rx_stats->signal, rx_stats->noise, rx_stats->rate,
+		 skb->len, jiffies);
 
 	if (skb->len < 2)
 		return;
 
 	fc = le16_to_cpu(hdr->frame_control);
-	printk(KERN_DEBUG "   FC=0x%04x (type=%d:%d)%s%s",
-	       fc, (fc & IEEE80211_FCTL_FTYPE) >> 2,
-	       (fc & IEEE80211_FCTL_STYPE) >> 4,
-	       fc & IEEE80211_FCTL_TODS ? " [ToDS]" : "",
-	       fc & IEEE80211_FCTL_FROMDS ? " [FromDS]" : "");
+	pr_debug("   FC=0x%04x (type=%d:%d)%s%s",
+		 fc, (fc & IEEE80211_FCTL_FTYPE) >> 2,
+		 (fc & IEEE80211_FCTL_STYPE) >> 4,
+		 fc & IEEE80211_FCTL_TODS ? " [ToDS]" : "",
+		 fc & IEEE80211_FCTL_FROMDS ? " [FromDS]" : "");
 
 	if (skb->len < IEEE80211_DATA_HDR3_LEN) {
-		printk("\n");
+		pr_cont("\n");
 		return;
 	}
 
-	printk(" dur=0x%04x seq=0x%04x\n", le16_to_cpu(hdr->duration_id),
-	       le16_to_cpu(hdr->seq_ctrl));
+	pr_cont(" dur=0x%04x seq=0x%04x\n",
+		le16_to_cpu(hdr->duration_id), le16_to_cpu(hdr->seq_ctrl));
 
-	printk(KERN_DEBUG "   A1=%pM", hdr->addr1);
-	printk(" A2=%pM", hdr->addr2);
-	printk(" A3=%pM", hdr->addr3);
+	pr_debug("   A1=%pM", hdr->addr1);
+	pr_cont(" A2=%pM", hdr->addr2);
+	pr_cont(" A3=%pM", hdr->addr3);
 	if (skb->len >= 30)
-		printk(" A4=%pM", hdr->addr4);
-	printk("\n");
+		pr_cont(" A4=%pM", hdr->addr4);
+	pr_cont("\n");
 }
 
 
@@ -92,8 +93,8 @@ int prism2_rx_80211(struct net_device *dev, struct sk_buff *skb,
 	fc = le16_to_cpu(fhdr->frame_control);
 
 	if (type == PRISM2_RX_MGMT && (fc & IEEE80211_FCTL_VERS)) {
-		printk(KERN_DEBUG "%s: dropped management frame with header "
-		       "version %d\n", dev->name, fc & IEEE80211_FCTL_VERS);
+		pr_debug("%s: dropped management frame with header version %d\n",
+			 dev->name, fc & IEEE80211_FCTL_VERS);
 		dev_kfree_skb_any(skb);
 		return 0;
 	}
@@ -115,8 +116,8 @@ int prism2_rx_80211(struct net_device *dev, struct sk_buff *skb,
 		if (pskb_expand_head(skb, head_need > 0 ? head_need : 0,
 				     tail_need > 0 ? tail_need : 0,
 				     GFP_ATOMIC)) {
-			printk(KERN_DEBUG "%s: prism2_rx_80211 failed to "
-			       "reallocate skb buffer\n", dev->name);
+			pr_debug("%s: prism2_rx_80211 failed to reallocate skb buffer\n",
+				 dev->name);
 			dev_kfree_skb_any(skb);
 			return 0;
 		}
@@ -229,9 +230,9 @@ prism2_frag_cache_find(local_info_t *local, unsigned int seq,
 		entry = &local->frag_cache[i];
 		if (entry->skb != NULL &&
 		    time_after(jiffies, entry->first_frag_time + 2 * HZ)) {
-			printk(KERN_DEBUG "%s: expiring fragment cache entry "
-			       "seq=%u last_frag=%u\n",
-			       local->dev->name, entry->seq, entry->last_frag);
+			pr_debug("%s: expiring fragment cache entry seq=%u last_frag=%u\n",
+				 local->dev->name, entry->seq,
+				 entry->last_frag);
 			dev_kfree_skb(entry->skb);
 			entry->skb = NULL;
 		}
@@ -313,9 +314,8 @@ static int prism2_frag_cache_invalidate(local_info_t *local,
 	entry = prism2_frag_cache_find(local, seq, -1, hdr->addr2, hdr->addr1);
 
 	if (entry == NULL) {
-		printk(KERN_DEBUG "%s: could not invalidate fragment cache "
-		       "entry (seq=%u)\n",
-		       local->dev->name, seq);
+		pr_debug("%s: could not invalidate fragment cache entry (seq=%u)\n",
+			 local->dev->name, seq);
 		return -1;
 	}
 
@@ -500,9 +500,8 @@ hostap_rx_frame_mgmt(local_info_t *local, struct sk_buff *skb,
 	if (local->iw_mode == IW_MODE_MASTER) {
 		if (type != IEEE80211_FTYPE_MGMT &&
 		    type != IEEE80211_FTYPE_CTL) {
-			printk(KERN_DEBUG "%s: unknown management frame "
-			       "(type=0x%02x, stype=0x%02x) dropped\n",
-			       skb->dev->name, type >> 2, stype >> 4);
+			pr_debug("%s: unknown management frame (type=0x%02x, stype=0x%02x) dropped\n",
+				 skb->dev->name, type >> 2, stype >> 4);
 			return -1;
 		}
 
@@ -521,9 +520,8 @@ hostap_rx_frame_mgmt(local_info_t *local, struct sk_buff *skb,
 		 */
 		return -1;
 	} else {
-		printk(KERN_DEBUG "%s: hostap_rx_frame_mgmt: dropped unhandled"
-		       " management frame in non-Host AP mode (type=%d:%d)\n",
-		       skb->dev->name, type >> 2, stype >> 4);
+		pr_debug("%s: hostap_rx_frame_mgmt: dropped unhandled management frame in non-Host AP mode (type=%d:%d)\n",
+			 skb->dev->name, type >> 2, stype >> 4);
 		return -1;
 	}
 }
@@ -662,9 +660,8 @@ hostap_rx_frame_decrypt(local_info_t *local, struct sk_buff *skb,
 	if (local->tkip_countermeasures &&
 	    strcmp(crypt->ops->name, "TKIP") == 0) {
 		if (net_ratelimit()) {
-			printk(KERN_DEBUG "%s: TKIP countermeasures: dropped "
-			       "received packet from %pM\n",
-			       local->dev->name, hdr->addr2);
+			pr_debug("%s: TKIP countermeasures: dropped received packet from %pM\n",
+				 local->dev->name, hdr->addr2);
 		}
 		return -1;
 	}
@@ -673,8 +670,8 @@ hostap_rx_frame_decrypt(local_info_t *local, struct sk_buff *skb,
 	res = crypt->ops->decrypt_mpdu(skb, hdrlen, crypt->priv);
 	atomic_dec(&crypt->refcnt);
 	if (res < 0) {
-		printk(KERN_DEBUG "%s: decryption failed (SA=%pM) res=%d\n",
-		       local->dev->name, hdr->addr2, res);
+		pr_debug("%s: decryption failed (SA=%pM) res=%d\n",
+			 local->dev->name, hdr->addr2, res);
 		local->comm_tallies.rx_discards_wep_undecryptable++;
 		return -1;
 	}
@@ -701,9 +698,8 @@ hostap_rx_frame_decrypt_msdu(local_info_t *local, struct sk_buff *skb,
 	res = crypt->ops->decrypt_msdu(skb, keyidx, hdrlen, crypt->priv);
 	atomic_dec(&crypt->refcnt);
 	if (res < 0) {
-		printk(KERN_DEBUG "%s: MSDU decryption/MIC verification failed"
-		       " (SA=%pM keyidx=%d)\n",
-		       local->dev->name, hdr->addr2, keyidx);
+		pr_debug("%s: MSDU decryption/MIC verification failed (SA=%pM keyidx=%d)\n",
+			 local->dev->name, hdr->addr2, keyidx);
 		return -1;
 	}
 
@@ -808,9 +804,8 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
 			 * frames from other than current BSS, so just drop the
 			 * frames silently instead of filling system log with
 			 * these reports. */
-			printk(KERN_DEBUG "%s: WEP decryption failed (not set)"
-			       " (SA=%pM)\n",
-			       local->dev->name, hdr->addr2);
+			pr_debug("%s: WEP decryption failed (not set) (SA=%pM)\n",
+				 local->dev->name, hdr->addr2);
 #endif
 			local->comm_tallies.rx_discards_wep_undecryptable++;
 			goto rx_dropped;
@@ -823,8 +818,8 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
 		    fc & IEEE80211_FCTL_PROTECTED && local->host_decrypt &&
 		    (keyidx = hostap_rx_frame_decrypt(local, skb, crypt)) < 0)
 		{
-			printk(KERN_DEBUG "%s: failed to decrypt mgmt::auth "
-			       "from %pM\n", dev->name, hdr->addr2);
+			pr_debug("%s: failed to decrypt mgmt::auth from %pM\n",
+				 dev->name, hdr->addr2);
 			/* TODO: could inform hostapd about this so that it
 			 * could send auth failure report */
 			goto rx_dropped;
@@ -901,9 +896,8 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
 	    stype != IEEE80211_STYPE_DATA_CFPOLL &&
 	    stype != IEEE80211_STYPE_DATA_CFACKPOLL) {
 		if (stype != IEEE80211_STYPE_NULLFUNC)
-			printk(KERN_DEBUG "%s: RX: dropped data frame "
-			       "with no data (type=0x%02x, subtype=0x%02x)\n",
-			       dev->name, type >> 2, stype >> 4);
+			pr_debug("%s: RX: dropped data frame with no data (type=0x%02x, subtype=0x%02x)\n",
+				 dev->name, type >> 2, stype >> 4);
 		goto rx_dropped;
 	}
 
@@ -922,10 +916,10 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
 		struct sk_buff *frag_skb =
 			prism2_frag_cache_get(local, hdr);
 		if (!frag_skb) {
-			printk(KERN_DEBUG "%s: Rx cannot get skb from "
-			       "fragment cache (morefrag=%d seq=%u frag=%u)\n",
-			       dev->name, (fc & IEEE80211_FCTL_MOREFRAGS) != 0,
-			       (sc & IEEE80211_SCTL_SEQ) >> 4, frag);
+			pr_debug("%s: Rx cannot get skb from fragment cache (morefrag=%d seq=%u frag=%u)\n",
+				 dev->name,
+				 (fc & IEEE80211_FCTL_MOREFRAGS) != 0,
+				 (sc & IEEE80211_SCTL_SEQ) >> 4, frag);
 			goto rx_dropped;
 		}
 
@@ -934,9 +928,8 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
 			flen -= hdrlen;
 
 		if (frag_skb->tail + flen > frag_skb->end) {
-			printk(KERN_WARNING "%s: host decrypted and "
-			       "reassembled frame did not fit skb\n",
-			       dev->name);
+			pr_warn("%s: host decrypted and reassembled frame did not fit skb\n",
+				dev->name);
 			prism2_frag_cache_invalidate(local, hdr);
 			goto rx_dropped;
 		}
@@ -986,9 +979,8 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
 			PDEBUG(DEBUG_EXTRA2, "%s: RX: IEEE 802.1X - passing "
 			       "unencrypted EAPOL frame\n", local->dev->name);
 		} else {
-			printk(KERN_DEBUG "%s: encryption configured, but RX "
-			       "frame not encrypted (SA=%pM)\n",
-			       local->dev->name, hdr->addr2);
+			pr_debug("%s: encryption configured, but RX frame not encrypted (SA=%pM)\n",
+				 local->dev->name, hdr->addr2);
 			goto rx_dropped;
 		}
 	}
@@ -996,9 +988,8 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
 	if (local->drop_unencrypted && !(fc & IEEE80211_FCTL_PROTECTED) &&
 	    !hostap_is_eapol_frame(local, skb)) {
 		if (net_ratelimit()) {
-			printk(KERN_DEBUG "%s: dropped unencrypted RX data "
-			       "frame from %pM (drop_unencrypted=1)\n",
-			       dev->name, hdr->addr2);
+			pr_debug("%s: dropped unencrypted RX data frame from %pM (drop_unencrypted=1)\n",
+				 dev->name, hdr->addr2);
 		}
 		goto rx_dropped;
 	}
@@ -1024,10 +1015,8 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
 				goto rx_exit;
 			}
 		} else if (!frame_authorized) {
-			printk(KERN_DEBUG "%s: dropped frame from "
-			       "unauthorized port (IEEE 802.1X): "
-			       "ethertype=0x%04x\n",
-			       dev->name, ethertype);
+			pr_debug("%s: dropped frame from unauthorized port (IEEE 802.1X): ethertype=0x%04x\n",
+				 dev->name, ethertype);
 			goto rx_dropped;
 		}
 	}
@@ -1074,8 +1063,8 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
 			local->ap->bridged_multicast++;
 			skb2 = skb_clone(skb, GFP_ATOMIC);
 			if (skb2 == NULL)
-				printk(KERN_DEBUG "%s: skb_clone failed for "
-				       "multicast frame\n", dev->name);
+				pr_debug("%s: skb_clone failed for multicast frame\n",
+					 dev->name);
 		} else if (hostap_is_sta_authorized(local->ap, dst)) {
 			/* send frame directly to the associated STA using
 			 * wireless media and not passing to higher layers */
diff --git a/drivers/net/wireless/hostap/hostap_80211_tx.c b/drivers/net/wireless/hostap/hostap_80211_tx.c
index 344a981..141a9bd 100644
--- a/drivers/net/wireless/hostap/hostap_80211_tx.c
+++ b/drivers/net/wireless/hostap/hostap_80211_tx.c
@@ -1,3 +1,5 @@
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/slab.h>
 #include <linux/export.h>
 
@@ -23,33 +25,32 @@ void hostap_dump_tx_80211(const char *name, struct sk_buff *skb)
 
 	hdr = (struct ieee80211_hdr *) skb->data;
 
-	printk(KERN_DEBUG "%s: TX len=%d jiffies=%ld\n",
-	       name, skb->len, jiffies);
+	pr_debug("%s: TX len=%d jiffies=%ld\n", name, skb->len, jiffies);
 
 	if (skb->len < 2)
 		return;
 
 	fc = le16_to_cpu(hdr->frame_control);
-	printk(KERN_DEBUG "   FC=0x%04x (type=%d:%d)%s%s",
-	       fc, (fc & IEEE80211_FCTL_FTYPE) >> 2,
-	       (fc & IEEE80211_FCTL_STYPE) >> 4,
-	       fc & IEEE80211_FCTL_TODS ? " [ToDS]" : "",
-	       fc & IEEE80211_FCTL_FROMDS ? " [FromDS]" : "");
+	pr_debug("   FC=0x%04x (type=%d:%d)%s%s",
+		 fc, (fc & IEEE80211_FCTL_FTYPE) >> 2,
+		 (fc & IEEE80211_FCTL_STYPE) >> 4,
+		 fc & IEEE80211_FCTL_TODS ? " [ToDS]" : "",
+		 fc & IEEE80211_FCTL_FROMDS ? " [FromDS]" : "");
 
 	if (skb->len < IEEE80211_DATA_HDR3_LEN) {
-		printk("\n");
+		pr_cont("\n");
 		return;
 	}
 
-	printk(" dur=0x%04x seq=0x%04x\n", le16_to_cpu(hdr->duration_id),
-	       le16_to_cpu(hdr->seq_ctrl));
+	pr_cont(" dur=0x%04x seq=0x%04x\n",
+	       le16_to_cpu(hdr->duration_id), le16_to_cpu(hdr->seq_ctrl));
 
-	printk(KERN_DEBUG "   A1=%pM", hdr->addr1);
-	printk(" A2=%pM", hdr->addr2);
-	printk(" A3=%pM", hdr->addr3);
+	pr_debug("   A1=%pM", hdr->addr1);
+	pr_cont(" A2=%pM", hdr->addr2);
+	pr_cont(" A3=%pM", hdr->addr3);
 	if (skb->len >= 30)
-		printk(" A4=%pM", hdr->addr4);
-	printk("\n");
+		pr_cont(" A4=%pM", hdr->addr4);
+	pr_cont("\n");
 }
 
 
@@ -76,8 +77,8 @@ netdev_tx_t hostap_data_start_xmit(struct sk_buff *skb,
 	local = iface->local;
 
 	if (skb->len < ETH_HLEN) {
-		printk(KERN_DEBUG "%s: hostap_data_start_xmit: short skb "
-		       "(len=%d)\n", dev->name, skb->len);
+		pr_debug("%s: hostap_data_start_xmit: short skb (len=%d)\n",
+			 dev->name, skb->len);
 		kfree_skb(skb);
 		return NETDEV_TX_OK;
 	}
@@ -90,15 +91,15 @@ netdev_tx_t hostap_data_start_xmit(struct sk_buff *skb,
 			to_assoc_ap = 1;
 			use_wds = WDS_NO;
 		} else if (dev == local->apdev) {
-			printk(KERN_DEBUG "%s: prism2_tx: trying to use "
-			       "AP device with Ethernet net dev\n", dev->name);
+			pr_debug("%s: prism2_tx: trying to use AP device with Ethernet net dev\n",
+				 dev->name);
 			kfree_skb(skb);
 			return NETDEV_TX_OK;
 		}
 	} else {
 		if (local->iw_mode == IW_MODE_REPEAT) {
-			printk(KERN_DEBUG "%s: prism2_tx: trying to use "
-			       "non-WDS link in Repeater mode\n", dev->name);
+			pr_debug("%s: prism2_tx: trying to use non-WDS link in Repeater mode\n",
+				 dev->name);
 			kfree_skb(skb);
 			return NETDEV_TX_OK;
 		} else if (local->iw_mode == IW_MODE_INFRA &&
@@ -278,8 +279,8 @@ netdev_tx_t hostap_mgmt_start_xmit(struct sk_buff *skb,
 	local = iface->local;
 
 	if (skb->len < 10) {
-		printk(KERN_DEBUG "%s: hostap_mgmt_start_xmit: short skb "
-		       "(len=%d)\n", dev->name, skb->len);
+		pr_debug("%s: hostap_mgmt_start_xmit: short skb (len=%d)\n",
+			 dev->name, skb->len);
 		kfree_skb(skb);
 		return NETDEV_TX_OK;
 	}
@@ -331,9 +332,8 @@ static struct sk_buff * hostap_tx_encrypt(struct sk_buff *skb,
 	    strcmp(crypt->ops->name, "TKIP") == 0) {
 		hdr = (struct ieee80211_hdr *) skb->data;
 		if (net_ratelimit()) {
-			printk(KERN_DEBUG "%s: TKIP countermeasures: dropped "
-			       "TX packet to %pM\n",
-			       local->dev->name, hdr->addr1);
+			pr_debug("%s: TKIP countermeasures: dropped TX packet to %pM\n",
+				 local->dev->name, hdr->addr1);
 		}
 		kfree_skb(skb);
 		return NULL;
@@ -399,9 +399,8 @@ netdev_tx_t hostap_master_start_xmit(struct sk_buff *skb,
 
 	meta = (struct hostap_skb_tx_data *) skb->cb;
 	if (meta->magic != HOSTAP_SKB_TX_DATA_MAGIC) {
-		printk(KERN_DEBUG "%s: invalid skb->cb magic (0x%08x, "
-		       "expected 0x%08x)\n",
-		       dev->name, meta->magic, HOSTAP_SKB_TX_DATA_MAGIC);
+		pr_debug("%s: invalid skb->cb magic (0x%08x, expected 0x%08x)\n",
+			 dev->name, meta->magic, HOSTAP_SKB_TX_DATA_MAGIC);
 		ret = NETDEV_TX_OK;
 		iface->stats.tx_dropped++;
 		goto fail;
@@ -418,8 +417,8 @@ netdev_tx_t hostap_master_start_xmit(struct sk_buff *skb,
 	}
 
 	if (skb->len < 24) {
-		printk(KERN_DEBUG "%s: hostap_master_start_xmit: short skb "
-		       "(len=%d)\n", dev->name, skb->len);
+		pr_debug("%s: hostap_master_start_xmit: short skb (len=%d)\n",
+			 dev->name, skb->len);
 		ret = NETDEV_TX_OK;
 		iface->stats.tx_dropped++;
 		goto fail;
@@ -442,9 +441,8 @@ netdev_tx_t hostap_master_start_xmit(struct sk_buff *skb,
 		    ieee80211_is_data(hdr->frame_control) &&
 		    meta->ethertype != ETH_P_PAE &&
 		    !(meta->flags & HOSTAP_TX_FLAGS_WDS)) {
-			printk(KERN_DEBUG "%s: dropped frame to unauthorized "
-			       "port (IEEE 802.1X): ethertype=0x%04x\n",
-			       dev->name, meta->ethertype);
+			pr_debug("%s: dropped frame to unauthorized port (IEEE 802.1X): ethertype=0x%04x\n",
+				 dev->name, meta->ethertype);
 			hostap_dump_tx_80211(dev->name, skb);
 
 			ret = NETDEV_TX_OK; /* drop packet */
@@ -503,8 +501,8 @@ netdev_tx_t hostap_master_start_xmit(struct sk_buff *skb,
 		   ieee80211_is_data(hdr->frame_control) &&
 		   meta->ethertype != ETH_P_PAE) {
 		if (net_ratelimit()) {
-			printk(KERN_DEBUG "%s: dropped unencrypted TX data "
-			       "frame (drop_unencrypted=1)\n", dev->name);
+			pr_debug("%s: dropped unencrypted TX data frame (drop_unencrypted=1)\n",
+				 dev->name);
 		}
 		iface->stats.tx_dropped++;
 		ret = NETDEV_TX_OK;
@@ -514,16 +512,14 @@ netdev_tx_t hostap_master_start_xmit(struct sk_buff *skb,
 	if (tx.crypt) {
 		skb = hostap_tx_encrypt(skb, tx.crypt);
 		if (skb == NULL) {
-			printk(KERN_DEBUG "%s: TX - encryption failed\n",
-			       dev->name);
+			pr_debug("%s: TX - encryption failed\n", dev->name);
 			ret = NETDEV_TX_OK;
 			goto fail;
 		}
 		meta = (struct hostap_skb_tx_data *) skb->cb;
 		if (meta->magic != HOSTAP_SKB_TX_DATA_MAGIC) {
-			printk(KERN_DEBUG "%s: invalid skb->cb magic (0x%08x, "
-			       "expected 0x%08x) after hostap_tx_encrypt\n",
-			       dev->name, meta->magic,
+			pr_debug("%s: invalid skb->cb magic (0x%08x, expected 0x%08x) after hostap_tx_encrypt\n",
+				 dev->name, meta->magic,
 			       HOSTAP_SKB_TX_DATA_MAGIC);
 			ret = NETDEV_TX_OK;
 			iface->stats.tx_dropped++;
diff --git a/drivers/net/wireless/hostap/hostap_ap.c b/drivers/net/wireless/hostap/hostap_ap.c
index e1f4102..82b2724 100644
--- a/drivers/net/wireless/hostap/hostap_ap.c
+++ b/drivers/net/wireless/hostap/hostap_ap.c
@@ -16,6 +16,8 @@
  *   (8802.11: 5.5)
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/proc_fs.h>
 #include <linux/delay.h>
 #include <linux/random.h>
@@ -550,7 +552,7 @@ static int prism2_ap_proc_read(char *page, char **start, off_t off,
 		p += sprintf(p, "\n");
 
 		if ((p - page) > PROC_LIMIT) {
-			printk(KERN_DEBUG "hostap: ap proc did not fit\n");
+			pr_debug("ap proc did not fit\n");
 			break;
 		}
 	}
@@ -581,9 +583,8 @@ void hostap_check_sta_fw_version(struct ap_data *ap, int sta_fw_ver)
 		ap->nullfunc_ack = 0;
 
 	if (sta_fw_ver == PRISM2_FW_VER(1,4,2)) {
-		printk(KERN_WARNING "%s: Warning: secondary station firmware "
-		       "version 1.4.2 does not seem to work in Host AP mode\n",
-		       ap->local->dev->name);
+		pr_warn("%s: Warning: secondary station firmware version 1.4.2 does not seem to work in Host AP mode\n",
+			ap->local->dev->name);
 	}
 }
 
@@ -635,8 +636,8 @@ static void hostap_ap_tx_cb_auth(struct sk_buff *skb, int ok, void *data)
 	hdr = (struct ieee80211_hdr *) skb->data;
 	if (!ieee80211_is_auth(hdr->frame_control) ||
 	    skb->len < IEEE80211_MGMT_HDR_LEN + 6) {
-		printk(KERN_DEBUG "%s: hostap_ap_tx_cb_auth received invalid "
-		       "frame\n", dev->name);
+		pr_debug("%s: hostap_ap_tx_cb_auth received invalid frame\n",
+			 dev->name);
 		dev_kfree_skb(skb);
 		return;
 	}
@@ -704,8 +705,8 @@ static void hostap_ap_tx_cb_assoc(struct sk_buff *skb, int ok, void *data)
 	if ((!ieee80211_is_assoc_resp(hdr->frame_control) &&
 	     !ieee80211_is_reassoc_resp(hdr->frame_control)) ||
 	    skb->len < IEEE80211_MGMT_HDR_LEN + 4) {
-		printk(KERN_DEBUG "%s: hostap_ap_tx_cb_assoc received invalid "
-		       "frame\n", dev->name);
+		pr_debug("%s: hostap_ap_tx_cb_assoc received invalid frame\n",
+			 dev->name);
 		dev_kfree_skb(skb);
 		return;
 	}
@@ -782,7 +783,7 @@ void hostap_init_data(local_info_t *local)
 	struct ap_data *ap = local->ap;
 
 	if (ap == NULL) {
-		printk(KERN_WARNING "hostap_init_data: ap == NULL\n");
+		pr_warn("%s: ap == NULL\n", __func__);
 		return;
 	}
 	memset(ap, 0, sizeof(struct ap_data));
@@ -803,8 +804,8 @@ void hostap_init_data(local_info_t *local)
 	ap->tx_callback_idx =
 		hostap_tx_callback_register(local, hostap_ap_tx_cb, ap);
 	if (ap->tx_callback_idx == 0)
-		printk(KERN_WARNING "%s: failed to register TX callback for "
-		       "AP\n", local->dev->name);
+		pr_warn("%s: failed to register TX callback for AP\n",
+			local->dev->name);
 #ifndef PRISM2_NO_KERNEL_IEEE80211_MGMT
 	INIT_WORK(&local->ap->wds_oper_queue, handle_wds_oper_queue);
 
@@ -816,8 +817,8 @@ void hostap_init_data(local_info_t *local)
 		hostap_tx_callback_register(local, hostap_ap_tx_cb_poll, ap);
 	if (ap->tx_callback_auth == 0 || ap->tx_callback_assoc == 0 ||
 		ap->tx_callback_poll == 0)
-		printk(KERN_WARNING "%s: failed to register TX callback for "
-		       "AP\n", local->dev->name);
+		pr_warn("%s: failed to register TX callback for AP\n",
+			local->dev->name);
 
 	spin_lock_init(&ap->mac_restrictions.lock);
 	INIT_LIST_HEAD(&ap->mac_restrictions.mac_list);
@@ -855,8 +856,8 @@ void hostap_free_data(struct ap_data *ap)
 	struct sta_info *n, *sta;
 
 	if (ap == NULL || !ap->initialized) {
-		printk(KERN_DEBUG "hostap_free_data: ap has not yet been "
-		       "initialized - skip resource freeing\n");
+		pr_debug("%s: ap has not yet been initialized - skip resource freeing\n",
+			__func__);
 		return;
 	}
 
@@ -1123,7 +1124,7 @@ static struct sta_info * ap_add_sta(struct ap_data *ap, u8 *addr)
 			ap->add_sta_proc_entries = entry;
 			schedule_work(&ap->add_sta_proc_queue);
 		} else
-			printk(KERN_DEBUG "Failed to add STA proc data\n");
+			pr_debug("Failed to add STA proc data\n");
 	}
 
 #ifndef PRISM2_NO_KERNEL_IEEE80211_MGMT
@@ -1222,8 +1223,7 @@ static void ap_crypt_init(struct ap_data *ap)
 	}
 
 	if (ap->crypt == NULL) {
-		printk(KERN_WARNING "AP could not initialize WEP: load module "
-		       "lib80211_crypt_wep.ko\n");
+		pr_warn("AP could not initialize WEP: load module lib80211_crypt_wep.ko\n");
 	}
 }
 
@@ -1795,7 +1795,7 @@ static void ap_handle_data_nullfunc(local_info_t *local,
 	 * not send this..
 	 * send control::ACK for the data::nullfunc */
 
-	printk(KERN_DEBUG "Sending control::ACK for data::nullfunc\n");
+	pr_debug("Sending control::ACK for data::nullfunc\n");
 	prism2_send_mgmt(dev, IEEE80211_FTYPE_CTL | IEEE80211_STYPE_ACK,
 			 NULL, 0, hdr->addr2, 0);
 }
@@ -1995,8 +1995,7 @@ static void handle_beacon(local_info_t *local, struct sk_buff *skb,
 	len = skb->len - IEEE80211_MGMT_HDR_LEN;
 
 	if (len < 8 + 2 + 2) {
-		printk(KERN_DEBUG "handle_beacon - too short payload "
-		       "(len=%d)\n", len);
+		pr_debug("handle_beacon - too short payload (len=%d)\n", len);
 		return;
 	}
 
@@ -2089,8 +2088,7 @@ static void handle_beacon(local_info_t *local, struct sk_buff *skb,
 		new_sta = 1;
 		sta = ap_add_sta(local->ap, hdr->addr2);
 		if (sta == NULL) {
-			printk(KERN_INFO "prism2: kmalloc failed for AP "
-			       "data structure\n");
+			pr_info("prism2: kmalloc failed for AP data structure\n");
 			return;
 		}
 		hostap_event_new_sta(local->dev, sta);
@@ -2296,8 +2294,8 @@ static void schedule_packet_send(local_info_t *local, struct sta_info *sta)
 
 	skb = dev_alloc_skb(16);
 	if (skb == NULL) {
-		printk(KERN_DEBUG "%s: schedule_packet_send: skb alloc "
-		       "failed\n", local->dev->name);
+		pr_debug("%s: %s: skb alloc failed\n",
+			 local->dev->name, __func__);
 		return;
 	}
 
@@ -2625,8 +2623,7 @@ int prism2_hostapd(struct ap_data *ap, struct prism2_hostapd_param *param)
 	case PRISM2_HOSTAPD_STA_CLEAR_STATS:
 		return prism2_hostapd_sta_clear_stats(ap, param);
 	default:
-		printk(KERN_WARNING "prism2_hostapd: unknown cmd=%d\n",
-		       param->cmd);
+		pr_warn("%s: unknown cmd=%d\n", __func__, param->cmd);
 		return -EOPNOTSUPP;
 	}
 }
@@ -2719,8 +2716,8 @@ ap_tx_ret hostap_handle_sta_tx(local_info_t *local, struct hostap_tx_data *tx)
 		 * ports of the bridge. Since this is a valid scenario, do not
 		 * print out any errors here. */
 		if (net_ratelimit()) {
-			printk(KERN_DEBUG "AP: drop packet to non-associated "
-			       "STA %pM\n", hdr->addr1);
+			pr_debug("drop packet to non-associated STA %pM\n",
+				 hdr->addr1);
 		}
 #endif
 		local->ap->tx_drop_nonassoc++;
@@ -2957,11 +2954,9 @@ ap_rx_ret hostap_handle_sta_rx(local_info_t *local, struct net_device *dev,
 						PRISM2_RX_NON_ASSOC);
 #ifndef PRISM2_NO_KERNEL_IEEE80211_MGMT
 			} else {
-				printk(KERN_DEBUG "%s: dropped received packet"
-				       " from non-associated STA %pM"
-				       " (type=0x%02x, subtype=0x%02x)\n",
-				       dev->name, hdr->addr2,
-				       type >> 2, stype >> 4);
+				pr_debug("%s: dropped received packet from non-associated STA %pM (type=0x%02x, subtype=0x%02x)\n",
+					 dev->name, hdr->addr2,
+					 type >> 2, stype >> 4);
 				hostap_rx(dev, skb, rx_stats);
 #endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */
 			}
@@ -2973,8 +2968,7 @@ ap_rx_ret hostap_handle_sta_rx(local_info_t *local, struct net_device *dev,
 			/* FromDS frame - not for us; probably
 			 * broadcast/multicast in another BSS - drop */
 			if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN) == 0) {
-				printk(KERN_DEBUG "Odd.. FromDS packet "
-				       "received with own BSSID\n");
+				pr_debug("Odd.. FromDS packet received with own BSSID\n");
 				hostap_dump_rx_80211(dev->name, skb, rx_stats);
 			}
 			ret = AP_RX_DROP;
@@ -2993,9 +2987,8 @@ ap_rx_ret hostap_handle_sta_rx(local_info_t *local, struct net_device *dev,
 			 * after being unavailable for some time. Speed up
 			 * re-association by informing the station about it not
 			 * being associated. */
-			printk(KERN_DEBUG "%s: rejected received nullfunc frame"
-			       " without ToDS from not associated STA %pM\n",
-			       dev->name, hdr->addr2);
+			pr_debug("%s: rejected received nullfunc frame without ToDS from not associated STA %pM\n",
+				 dev->name, hdr->addr2);
 			hostap_rx(dev, skb, rx_stats);
 #endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */
 		}
@@ -3011,10 +3004,8 @@ ap_rx_ret hostap_handle_sta_rx(local_info_t *local, struct net_device *dev,
 		 * broadcast frame from an IBSS network. Drop it silently.
 		 * If BSSID is own, report the dropping of this frame. */
 		if (memcmp(hdr->addr3, dev->dev_addr, ETH_ALEN) == 0) {
-			printk(KERN_DEBUG "%s: dropped received packet from %pM"
-			       " with no ToDS flag "
-			       "(type=0x%02x, subtype=0x%02x)\n", dev->name,
-			       hdr->addr2, type >> 2, stype >> 4);
+			pr_debug("%s: dropped received packet from %pM with no ToDS flag (type=0x%02x, subtype=0x%02x)\n",
+				 dev->name, hdr->addr2, type >> 2, stype >> 4);
 			hostap_dump_rx_80211(dev->name, skb, rx_stats);
 		}
 		ret = AP_RX_DROP;
diff --git a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c
index 89e9d3a..83e76ce 100644
--- a/drivers/net/wireless/hostap/hostap_cs.c
+++ b/drivers/net/wireless/hostap/hostap_cs.c
@@ -1,5 +1,7 @@
 #define PRISM2_PCCARD
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/if.h>
@@ -228,16 +230,16 @@ static void sandisk_set_iobase(local_info_t *local)
 	res = pcmcia_write_config_byte(hw_priv->link, 0x10,
 				hw_priv->link->resource[0]->start & 0x00ff);
 	if (res != 0) {
-		printk(KERN_DEBUG "Prism3 SanDisk - failed to set I/O base 0 -"
-		       " res=%d\n", res);
+		pr_debug("Prism3 SanDisk - failed to set I/O base 0 - res=%d\n",
+			 res);
 	}
 	udelay(10);
 
 	res = pcmcia_write_config_byte(hw_priv->link, 0x12,
 				(hw_priv->link->resource[0]->start >> 8) & 0x00ff);
 	if (res != 0) {
-		printk(KERN_DEBUG "Prism3 SanDisk - failed to set I/O base 1 -"
-		       " res=%d\n", res);
+		pr_debug("Prism3 SanDisk - failed to set I/O base 1 - res=%d\n",
+			 res);
 	}
 }
 
@@ -282,15 +284,15 @@ static int sandisk_enable_wireless(struct net_device *dev)
 		goto done;
 	}
 
-	printk(KERN_DEBUG "%s: Multi-function SanDisk ConnectPlus detected"
-	       " - using vendor-specific initialization\n", dev->name);
+	pr_debug("%s: Multi-function SanDisk ConnectPlus detected - using vendor-specific initialization\n",
+		 dev->name);
 	hw_priv->sandisk_connectplus = 1;
 
 	res = pcmcia_write_config_byte(hw_priv->link, CISREG_COR,
 				COR_SOFT_RESET);
 	if (res != 0) {
-		printk(KERN_DEBUG "%s: SanDisk - COR sreset failed (%d)\n",
-		       dev->name, res);
+		pr_debug("%s: SanDisk - COR sreset failed (%d)\n",
+			 dev->name, res);
 		goto done;
 	}
 	mdelay(5);
@@ -303,8 +305,8 @@ static int sandisk_enable_wireless(struct net_device *dev)
 				(COR_LEVEL_REQ | 0x8 | COR_ADDR_DECODE |
 					COR_FUNC_ENA));
 	if (res != 0) {
-		printk(KERN_DEBUG "%s: SanDisk - COR sreset failed (%d)\n",
-		       dev->name, res);
+		pr_debug("%s: SanDisk - COR sreset failed (%d)\n",
+			 dev->name, res);
 		goto done;
 	}
 	mdelay(5);
@@ -332,18 +334,15 @@ static void prism2_pccard_cor_sreset(local_info_t *local)
 
 	res = pcmcia_read_config_byte(hw_priv->link, CISREG_COR, &val);
 	if (res != 0) {
-		printk(KERN_DEBUG "prism2_pccard_cor_sreset failed 1 (%d)\n",
-		       res);
+		pr_debug("%s: failed 1 (%d)\n", __func__, res);
 		return;
 	}
-	printk(KERN_DEBUG "prism2_pccard_cor_sreset: original COR %02x\n",
-		val);
+	pr_debug("%s: original COR %02x\n", __func__, val);
 
 	val |= COR_SOFT_RESET;
 	res = pcmcia_write_config_byte(hw_priv->link, CISREG_COR, val);
 	if (res != 0) {
-		printk(KERN_DEBUG "prism2_pccard_cor_sreset failed 2 (%d)\n",
-		       res);
+		pr_debug("%s: failed 2 (%d)\n", __func__, res);
 		return;
 	}
 
@@ -354,8 +353,7 @@ static void prism2_pccard_cor_sreset(local_info_t *local)
 		val |= COR_IREQ_ENA;
 	res = pcmcia_write_config_byte(hw_priv->link, CISREG_COR, val);
 	if (res != 0) {
-		printk(KERN_DEBUG "prism2_pccard_cor_sreset failed 3 (%d)\n",
-		       res);
+		pr_debug("%s: failed 3 (%d)\n", __func__, res);
 		return;
 	}
 
@@ -382,18 +380,15 @@ static void prism2_pccard_genesis_reset(local_info_t *local, int hcr)
 
 	res = pcmcia_read_config_byte(hw_priv->link, CISREG_COR, &old_cor);
 	if (res != 0) {
-		printk(KERN_DEBUG "prism2_pccard_genesis_sreset failed 1 "
-		       "(%d)\n", res);
+		pr_debug("%s: failed 1 (%d)\n", __func__, res);
 		return;
 	}
-	printk(KERN_DEBUG "prism2_pccard_genesis_sreset: original COR %02x\n",
-		old_cor);
+	pr_debug("%s: original COR %02x\n", __func__, old_cor);
 
 	res = pcmcia_write_config_byte(hw_priv->link, CISREG_COR,
 				old_cor | COR_SOFT_RESET);
 	if (res != 0) {
-		printk(KERN_DEBUG "prism2_pccard_genesis_sreset failed 2 "
-		       "(%d)\n", res);
+		pr_debug("%s: failed 2 (%d)\n", __func__, res);
 		return;
 	}
 
@@ -402,8 +397,7 @@ static void prism2_pccard_genesis_reset(local_info_t *local, int hcr)
 	/* Setup Genesis mode */
 	res = pcmcia_write_config_byte(hw_priv->link, CISREG_CCSR, hcr);
 	if (res != 0) {
-		printk(KERN_DEBUG "prism2_pccard_genesis_sreset failed 3 "
-		       "(%d)\n", res);
+		pr_debug("%s: failed 3 (%d)\n", __func__, res);
 		return;
 	}
 	mdelay(10);
@@ -411,8 +405,7 @@ static void prism2_pccard_genesis_reset(local_info_t *local, int hcr)
 	res = pcmcia_write_config_byte(hw_priv->link, CISREG_COR,
 				old_cor & ~COR_SOFT_RESET);
 	if (res != 0) {
-		printk(KERN_DEBUG "prism2_pccard_genesis_sreset failed 4 "
-		       "(%d)\n", res);
+		pr_debug("%s: failed 4 (%d)\n", __func__, res);
 		return;
 	}
 
@@ -499,9 +492,7 @@ static int prism2_config(struct pcmcia_device *link)
 	ret = pcmcia_loop_config(link, prism2_config_check, NULL);
 	if (ret) {
 		if (!ignore_cis_vcc)
-			printk(KERN_ERR "GetNextTuple(): No matching "
-			       "CIS configuration.  Maybe you need the "
-			       "ignore_cis_vcc=1 parameter.\n");
+			pr_err("GetNextTuple(): No matching CIS configuration.  Maybe you need the ignore_cis_vcc=1 parameter.\n");
 		goto failed;
 	}
 
diff --git a/drivers/net/wireless/hostap/hostap_download.c b/drivers/net/wireless/hostap/hostap_download.c
index e73bf73..8090bc3 100644
--- a/drivers/net/wireless/hostap/hostap_download.c
+++ b/drivers/net/wireless/hostap/hostap_download.c
@@ -228,7 +228,7 @@ static u8 * prism2_read_pda(struct net_device *dev)
 	prism2_enable_aux_port(dev, 0);
 
 	if (!found) {
-		printk(KERN_DEBUG "%s: valid PDA not found\n", dev->name);
+		pr_debug("%s: valid PDA not found\n", dev->name);
 		kfree(buf);
 		buf = NULL;
 	}
@@ -245,8 +245,8 @@ static int prism2_download_volatile(local_info_t *local,
 	u16 param0, param1;
 
 	if (local->hw_downloading) {
-		printk(KERN_WARNING "%s: Already downloading - aborting new "
-		       "request\n", dev->name);
+		pr_warn("%s: Already downloading - aborting new request\n",
+			dev->name);
 		return -1;
 	}
 
@@ -257,16 +257,15 @@ static int prism2_download_volatile(local_info_t *local,
 		prism2_hw_shutdown(dev, 0);
 
 		if (prism2_hw_init(dev, 0)) {
-			printk(KERN_WARNING "%s: Could not initialize card for"
-			       " download\n", dev->name);
+			pr_warn("%s: Could not initialize card for download\n",
+				dev->name);
 			ret = -1;
 			goto out;
 		}
 	}
 
 	if (prism2_enable_aux_port(dev, 1)) {
-		printk(KERN_WARNING "%s: Could not enable AUX port\n",
-		       dev->name);
+		pr_warn("%s: Could not enable AUX port\n", dev->name);
 		ret = -1;
 		goto out;
 	}
@@ -279,8 +278,7 @@ static int prism2_download_volatile(local_info_t *local,
 	if (hfa384x_cmd_wait(dev, HFA384X_CMDCODE_DOWNLOAD |
 			     (HFA384X_PROGMODE_ENABLE_VOLATILE << 8),
 			     param0)) {
-		printk(KERN_WARNING "%s: Download command execution failed\n",
-		       dev->name);
+		pr_warn("%s: Download command execution failed\n", dev->name);
 		ret = -1;
 		goto out;
 	}
@@ -290,8 +288,8 @@ static int prism2_download_volatile(local_info_t *local,
 		       dev->name, param->data[i].len, param->data[i].addr);
 		if (hfa384x_to_aux(dev, param->data[i].addr,
 				   param->data[i].len, param->data[i].data)) {
-			printk(KERN_WARNING "%s: RAM download at 0x%08x "
-			       "(len=%d) failed\n", dev->name,
+			pr_warn("%s: RAM download at 0x%08x (len=%d) failed\n",
+				dev->name,
 			       param->data[i].addr, param->data[i].len);
 			ret = -1;
 			goto out;
@@ -302,8 +300,7 @@ static int prism2_download_volatile(local_info_t *local,
 	HFA384X_OUTW(0, HFA384X_PARAM2_OFF);
 	if (hfa384x_cmd_no_wait(dev, HFA384X_CMDCODE_DOWNLOAD |
 				(HFA384X_PROGMODE_DISABLE << 8), param0)) {
-		printk(KERN_WARNING "%s: Download command execution failed\n",
-		       dev->name);
+		pr_warn("%s: Download command execution failed\n", dev->name);
 		ret = -1;
 		goto out;
 	}
@@ -314,16 +311,15 @@ static int prism2_download_volatile(local_info_t *local,
 	HFA384X_OUTW(HFA384X_EV_CMD, HFA384X_EVACK_OFF);
 
 	if (prism2_enable_aux_port(dev, 0)) {
-		printk(KERN_DEBUG "%s: Disabling AUX port failed\n",
-		       dev->name);
+		pr_debug("%s: Disabling AUX port failed\n", dev->name);
 		/* continue anyway.. restart should have taken care of this */
 	}
 
 	mdelay(5);
 	local->hw_downloading = 0;
 	if (prism2_hw_config(dev, 2)) {
-		printk(KERN_WARNING "%s: Card configuration after RAM "
-		       "download failed\n", dev->name);
+		pr_warn("%s: Card configuration after RAM download failed\n",
+			dev->name);
 		ret = -1;
 		goto out;
 	}
@@ -340,8 +336,7 @@ static int prism2_enable_genesis(local_info_t *local, int hcr)
 	u8 initseq[4] = { 0x00, 0xe1, 0xa1, 0xff };
 	u8 readbuf[4];
 
-	printk(KERN_DEBUG "%s: test Genesis mode with HCR 0x%02x\n",
-	       dev->name, hcr);
+	pr_debug("%s: test Genesis mode with HCR 0x%02x\n", dev->name, hcr);
 	local->func->cor_sreset(local);
 	hfa384x_to_aux(dev, 0x7e0038, sizeof(initseq), initseq);
 	local->func->genesis_reset(local, hcr);
@@ -352,14 +347,12 @@ static int prism2_enable_genesis(local_info_t *local, int hcr)
 	hfa384x_from_aux(dev, 0x7e0038, sizeof(readbuf), readbuf);
 
 	if (memcmp(initseq, readbuf, sizeof(initseq)) == 0) {
-		printk(KERN_DEBUG "Readback test succeeded, HCR 0x%02x\n",
-		       hcr);
+		pr_debug("Readback test succeeded, HCR 0x%02x\n", hcr);
 		return 0;
 	} else {
-		printk(KERN_DEBUG "Readback test failed, HCR 0x%02x "
-		       "write %02x %02x %02x %02x read %02x %02x %02x %02x\n",
-		       hcr, initseq[0], initseq[1], initseq[2], initseq[3],
-		       readbuf[0], readbuf[1], readbuf[2], readbuf[3]);
+		pr_debug("Readback test failed, HCR 0x%02x write %02x %02x %02x %02x read %02x %02x %02x %02x\n",
+			 hcr, initseq[0], initseq[1], initseq[2], initseq[3],
+			 readbuf[0], readbuf[1], readbuf[2], readbuf[3]);
 		return 1;
 	}
 }
@@ -392,22 +385,21 @@ static int prism2_download_genesis(local_info_t *local,
 	int ret = 0;
 
 	if (local->hw_downloading) {
-		printk(KERN_WARNING "%s: Already downloading - aborting new "
-		       "request\n", dev->name);
+		pr_warn("%s: Already downloading - aborting new request\n",
+			dev->name);
 		return -EBUSY;
 	}
 
 	if (!local->func->genesis_reset || !local->func->cor_sreset) {
-		printk(KERN_INFO "%s: Genesis mode downloading not supported "
-		       "with this hwmodel\n", dev->name);
+		pr_info("%s: Genesis mode downloading not supported with this hwmodel\n",
+			dev->name);
 		return -EOPNOTSUPP;
 	}
 
 	local->hw_downloading = 1;
 
 	if (prism2_enable_aux_port(dev, 1)) {
-		printk(KERN_DEBUG "%s: failed to enable AUX port\n",
-		       dev->name);
+		pr_debug("%s: failed to enable AUX port\n", dev->name);
 		ret = -EIO;
 		goto out;
 	}
@@ -423,17 +415,16 @@ static int prism2_download_genesis(local_info_t *local,
 			PDEBUG(DEBUG_EXTRA2, "%s: Genesis mode OK using x16 "
 			       "SRAM\n", dev->name);
 		} else {
-			printk(KERN_DEBUG "%s: Could not initiate genesis "
-			       "mode\n", dev->name);
+			pr_debug("%s: Could not initiate genesis mode\n",
+				 dev->name);
 			ret = -EIO;
 			goto out;
 		}
 	} else {
 		if (prism2_enable_genesis(local, local->sram_type == 8 ?
 					  0x1f : 0x0f)) {
-			printk(KERN_DEBUG "%s: Failed to set Genesis "
-			       "mode (sram_type=%d)\n", dev->name,
-			       local->sram_type);
+			pr_debug("%s: Failed to set Genesis mode (sram_type=%d)\n",
+				 dev->name, local->sram_type);
 			ret = -EIO;
 			goto out;
 		}
@@ -445,9 +436,9 @@ static int prism2_download_genesis(local_info_t *local,
 		       dev->name, param->data[i].len, param->data[i].addr);
 		if (hfa384x_to_aux(dev, param->data[i].addr,
 				   param->data[i].len, param->data[i].data)) {
-			printk(KERN_WARNING "%s: RAM download at 0x%08x "
-			       "(len=%d) failed\n", dev->name,
-			       param->data[i].addr, param->data[i].len);
+			pr_warn("%s: RAM download at 0x%08x (len=%d) failed\n",
+				dev->name,
+				param->data[i].addr, param->data[i].len);
 			ret = -EIO;
 			goto out;
 		}
@@ -456,8 +447,7 @@ static int prism2_download_genesis(local_info_t *local,
 	PDEBUG(DEBUG_EXTRA2, "Disable genesis mode\n");
 	local->func->genesis_reset(local, ram16 ? 0x07 : 0x17);
 	if (prism2_enable_aux_port(dev, 0)) {
-		printk(KERN_DEBUG "%s: Failed to disable AUX port\n",
-		       dev->name);
+		pr_debug("%s: Failed to disable AUX port\n", dev->name);
 	}
 
 	mdelay(5);
@@ -470,16 +460,16 @@ static int prism2_download_genesis(local_info_t *local,
 	 */
 	hfa384x_disable_interrupts(dev);
 	if (prism2_hw_init(dev, 1)) {
-		printk(KERN_DEBUG "%s: Initialization after genesis mode "
-		       "download failed\n", dev->name);
+		pr_debug("%s: Initialization after genesis mode download failed\n",
+			 dev->name);
 		ret = -EIO;
 		goto out;
 	}
 
 	PDEBUG(DEBUG_EXTRA2, "Card initialized - running PRI only\n");
 	if (prism2_hw_init2(dev, 1)) {
-		printk(KERN_DEBUG "%s: Initialization(2) after genesis mode "
-		       "download failed\n", dev->name);
+		pr_debug("%s: Initialization(2) after genesis mode download failed\n",
+			 dev->name);
 		ret = -EIO;
 		goto out;
 	}
@@ -513,14 +503,14 @@ static inline int prism2_download_block(struct net_device *dev,
 	if (hfa384x_cmd_wait(dev, HFA384X_CMDCODE_DOWNLOAD |
 			     (HFA384X_PROGMODE_ENABLE_NON_VOLATILE << 8),
 			     param0)) {
-		printk(KERN_WARNING "%s: Flash download command execution "
-		       "failed\n", dev->name);
+		pr_warn("%s: Flash download command execution failed\n",
+			dev->name);
 		return -1;
 	}
 
 	if (hfa384x_to_aux(dev, bufaddr, block_len, data)) {
-		printk(KERN_WARNING "%s: flash download at 0x%08x "
-		       "(len=%d) failed\n", dev->name, addr, block_len);
+		pr_warn("%s: flash download at 0x%08x (len=%d) failed\n",
+			dev->name, addr, block_len);
 		return -1;
 	}
 
@@ -529,8 +519,8 @@ static inline int prism2_download_block(struct net_device *dev,
 	if (hfa384x_cmd_wait(dev, HFA384X_CMDCODE_DOWNLOAD |
 			     (HFA384X_PROGMODE_PROGRAM_NON_VOLATILE << 8),
 			     0)) {
-		printk(KERN_WARNING "%s: Flash write command execution "
-		       "failed\n", dev->name);
+		pr_warn("%s: Flash write command execution failed\n",
+			dev->name);
 		return -1;
 	}
 
@@ -551,8 +541,8 @@ static int prism2_download_nonvolatile(local_info_t *local,
 	u32 bufaddr;
 
 	if (local->hw_downloading) {
-		printk(KERN_WARNING "%s: Already downloading - aborting new "
-		       "request\n", dev->name);
+		pr_warn("%s: Already downloading - aborting new request\n",
+			dev->name);
 		return -1;
 	}
 
@@ -560,15 +550,14 @@ static int prism2_download_nonvolatile(local_info_t *local,
 				   &dlbuffer, 6, 0);
 
 	if (ret < 0) {
-		printk(KERN_WARNING "%s: Could not read download buffer "
-		       "parameters\n", dev->name);
+		pr_warn("%s: Could not read download buffer parameters\n",
+			dev->name);
 		goto out;
 	}
 
-	printk(KERN_DEBUG "Download buffer: %d bytes at 0x%04x:0x%04x\n",
-	       le16_to_cpu(dlbuffer.len),
-	       le16_to_cpu(dlbuffer.page),
-	       le16_to_cpu(dlbuffer.offset));
+	pr_debug("Download buffer: %d bytes at 0x%04x:0x%04x\n",
+		 le16_to_cpu(dlbuffer.len), le16_to_cpu(dlbuffer.page),
+		 le16_to_cpu(dlbuffer.offset));
 
 	bufaddr = (le16_to_cpu(dlbuffer.page) << 7) + le16_to_cpu(dlbuffer.offset);
 
@@ -578,8 +567,8 @@ static int prism2_download_nonvolatile(local_info_t *local,
 		prism2_hw_shutdown(dev, 0);
 
 		if (prism2_hw_init(dev, 0)) {
-			printk(KERN_WARNING "%s: Could not initialize card for"
-			       " download\n", dev->name);
+			pr_warn("%s: Could not initialize card for download\n",
+				dev->name);
 			ret = -1;
 			goto out;
 		}
@@ -588,13 +577,12 @@ static int prism2_download_nonvolatile(local_info_t *local,
 	hfa384x_disable_interrupts(dev);
 
 	if (prism2_enable_aux_port(dev, 1)) {
-		printk(KERN_WARNING "%s: Could not enable AUX port\n",
-		       dev->name);
+		pr_warn("%s: Could not enable AUX port\n", dev->name);
 		ret = -1;
 		goto out;
 	}
 
-	printk(KERN_DEBUG "%s: starting flash download\n", dev->name);
+	pr_debug("%s: starting flash download\n", dev->name);
 	for (i = 0; i < dl->num_areas; i++) {
 		int rest_len = dl->data[i].len;
 		int data_off = 0;
@@ -621,15 +609,13 @@ static int prism2_download_nonvolatile(local_info_t *local,
 	HFA384X_OUTW(0, HFA384X_PARAM2_OFF);
 	if (hfa384x_cmd_wait(dev, HFA384X_CMDCODE_DOWNLOAD |
 				(HFA384X_PROGMODE_DISABLE << 8), 0)) {
-		printk(KERN_WARNING "%s: Download command execution failed\n",
-		       dev->name);
+		pr_warn("%s: Download command execution failed\n", dev->name);
 		ret = -1;
 		goto out;
 	}
 
 	if (prism2_enable_aux_port(dev, 0)) {
-		printk(KERN_DEBUG "%s: Disabling AUX port failed\n",
-		       dev->name);
+		pr_debug("%s: Disabling AUX port failed\n", dev->name);
 		/* continue anyway.. restart should have taken care of this */
 	}
 
@@ -638,12 +624,12 @@ static int prism2_download_nonvolatile(local_info_t *local,
 	local->func->hw_reset(dev);
 	local->hw_downloading = 0;
 	if (prism2_hw_config(dev, 2)) {
-		printk(KERN_WARNING "%s: Card configuration after flash "
-		       "download failed\n", dev->name);
+		pr_warn("%s: Card configuration after flash download failed\n",
+			dev->name);
 		ret = -1;
 	} else {
-		printk(KERN_INFO "%s: Card initialized successfully after "
-		       "flash download\n", dev->name);
+		pr_info("%s: Card initialized successfully after flash download\n",
+			dev->name);
 	}
 
  out:
@@ -674,9 +660,8 @@ static int prism2_download(local_info_t *local,
 	u32 total_len = 0;
 	struct prism2_download_data *dl = NULL;
 
-	printk(KERN_DEBUG "prism2_download: dl_cmd=%d start_addr=0x%08x "
-	       "num_areas=%d\n",
-	       param->dl_cmd, param->start_addr, param->num_areas);
+	pr_debug("%s: dl_cmd=%d start_addr=0x%08x num_areas=%d\n",
+		 __func__, param->dl_cmd, param->start_addr, param->num_areas);
 
 	if (param->num_areas > 100) {
 		ret = -EINVAL;
@@ -734,14 +719,14 @@ static int prism2_download(local_info_t *local,
 #ifdef PRISM2_NON_VOLATILE_DOWNLOAD
 		ret = prism2_download_nonvolatile(local, dl);
 #else /* PRISM2_NON_VOLATILE_DOWNLOAD */
-		printk(KERN_INFO "%s: non-volatile downloading not enabled\n",
-		       local->dev->name);
+		pr_info("%s: non-volatile downloading not enabled\n",
+			local->dev->name);
 		ret = -EOPNOTSUPP;
 #endif /* PRISM2_NON_VOLATILE_DOWNLOAD */
 		break;
 	default:
-		printk(KERN_DEBUG "%s: unsupported download command %d\n",
-		       local->dev->name, param->dl_cmd);
+		pr_debug("%s: unsupported download command %d\n",
+			 local->dev->name, param->dl_cmd);
 		ret = -EINVAL;
 		break;
 	}
diff --git a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c
index 50f87b6..04e412d 100644
--- a/drivers/net/wireless/hostap/hostap_hw.c
+++ b/drivers/net/wireless/hostap/hostap_hw.c
@@ -29,8 +29,6 @@
  *   (spin_lock_bh) to prevent concurrent use.
  */
 
-
-
 #include <asm/delay.h>
 #include <asm/uaccess.h>
 
@@ -229,17 +227,16 @@ static void prism2_clear_cmd_queue(local_info_t *local)
 	list_for_each_safe(ptr, n, &local->cmd_queue) {
 		entry = list_entry(ptr, struct hostap_cmd_queue, list);
 		atomic_inc(&entry->usecnt);
-		printk(KERN_DEBUG "%s: removed pending cmd_queue entry "
-		       "(type=%d, cmd=0x%04x, param0=0x%04x)\n",
-		       local->dev->name, entry->type, entry->cmd,
-		       entry->param0);
+		pr_debug("%s: removed pending cmd_queue entry (type=%d, cmd=0x%04x, param0=0x%04x)\n",
+			 local->dev->name, entry->type, entry->cmd,
+			 entry->param0);
 		__hostap_cmd_queue_free(local, entry, 1);
 	}
 	if (local->cmd_queue_len) {
 		/* This should not happen; print debug message and clear
 		 * queue length. */
-		printk(KERN_DEBUG "%s: cmd_queue_len (%d) not zero after "
-		       "flush\n", local->dev->name, local->cmd_queue_len);
+		pr_debug("%s: cmd_queue_len (%d) not zero after flush\n",
+			 local->dev->name, local->cmd_queue_len);
 		local->cmd_queue_len = 0;
 	}
 	spin_unlock_irqrestore(&local->cmdlock, flags);
@@ -267,8 +264,8 @@ static int hfa384x_cmd_issue(struct net_device *dev,
 		return -ENODEV;
 
 	if (entry->issued) {
-		printk(KERN_DEBUG "%s: driver bug - re-issuing command @%p\n",
-		       dev->name, entry);
+		pr_debug("%s: driver bug - re-issuing command @%p\n",
+			 dev->name, entry);
 	}
 
 	/* wait until busy bit is clear; this should always be clear since the
@@ -281,16 +278,15 @@ static int hfa384x_cmd_issue(struct net_device *dev,
 #ifndef final_version
 	if (tries != HFA384X_CMD_BUSY_TIMEOUT) {
 		prism2_io_debug_error(dev, 1);
-		printk(KERN_DEBUG "%s: hfa384x_cmd_issue: cmd reg was busy "
-		       "for %d usec\n", dev->name,
-		       HFA384X_CMD_BUSY_TIMEOUT - tries);
+		pr_debug("%s: %s: cmd reg was busy for %d usec\n",
+			 dev->name, __func__, HFA384X_CMD_BUSY_TIMEOUT - tries);
 	}
 #endif
 	if (tries == 0) {
 		reg = HFA384X_INW(HFA384X_CMD_OFF);
 		prism2_io_debug_error(dev, 2);
-		printk(KERN_DEBUG "%s: hfa384x_cmd_issue - timeout - "
-		       "reg=0x%04x\n", dev->name, reg);
+		pr_debug("%s: %s: timeout - reg=0x%04x\n",
+			 dev->name, __func__, reg);
 		return -ETIMEDOUT;
 	}
 
@@ -332,14 +328,13 @@ static int hfa384x_cmd(struct net_device *dev, u16 cmd, u16 param0,
 	local = iface->local;
 
 	if (in_interrupt()) {
-		printk(KERN_DEBUG "%s: hfa384x_cmd called from interrupt "
-		       "context\n", dev->name);
+		pr_debug("%s: %s called from interrupt context\n",
+			 dev->name, __func__);
 		return -1;
 	}
 
 	if (local->cmd_queue_len >= HOSTAP_CMD_QUEUE_MAX_LEN) {
-		printk(KERN_DEBUG "%s: hfa384x_cmd: cmd_queue full\n",
-		       dev->name);
+		pr_debug("%s: %s: cmd_queue full\n", dev->name, __func__);
 		return -1;
 	}
 
@@ -426,34 +421,32 @@ static int hfa384x_cmd(struct net_device *dev, u16 cmd, u16 param0,
 
 	spin_lock_irqsave(&local->cmdlock, flags);
 	if (!list_empty(&entry->list)) {
-		printk(KERN_DEBUG "%s: hfa384x_cmd: entry still in list? "
-		       "(entry=%p, type=%d, res=%d)\n", dev->name, entry,
-		       entry->type, res);
+		pr_debug("%s: %s: entry still in list? (entry=%p, type=%d, res=%d)\n",
+			 dev->name, __func__, entry, entry->type, res);
 		list_del_init(&entry->list);
 		local->cmd_queue_len--;
 	}
 	spin_unlock_irqrestore(&local->cmdlock, flags);
 
 	if (err) {
-		printk(KERN_DEBUG "%s: hfa384x_cmd: interrupted; err=%d\n",
-		       dev->name, err);
+		pr_debug("%s: %s: interrupted; err=%d\n",
+			 dev->name, __func__, err);
 		res = err;
 		goto done;
 	}
 
 	if (entry->type != CMD_COMPLETED) {
 		u16 reg = HFA384X_INW(HFA384X_EVSTAT_OFF);
-		printk(KERN_DEBUG "%s: hfa384x_cmd: command was not "
-		       "completed (res=%d, entry=%p, type=%d, cmd=0x%04x, "
-		       "param0=0x%04x, EVSTAT=%04x INTEN=%04x)\n", dev->name,
-		       res, entry, entry->type, entry->cmd, entry->param0, reg,
-		       HFA384X_INW(HFA384X_INTEN_OFF));
+		pr_debug("%s: %s: command was not completed (res=%d, entry=%p, type=%d, cmd=0x%04x, param0=0x%04x, EVSTAT=%04x INTEN=%04x)\n",
+			 dev->name, __func__,
+			 res, entry, entry->type, entry->cmd, entry->param0,
+			 reg, HFA384X_INW(HFA384X_INTEN_OFF));
 		if (reg & HFA384X_EV_CMD) {
 			/* Command completion event is pending, but the
 			 * interrupt was not delivered - probably an issue
 			 * with pcmcia-cs configuration. */
-			printk(KERN_WARNING "%s: interrupt delivery does not "
-			       "seem to work\n", dev->name);
+			pr_warn("%s: interrupt delivery does not seem to work\n",
+				dev->name);
 		}
 		prism2_io_debug_error(dev, 3);
 		res = -ETIMEDOUT;
@@ -464,9 +457,8 @@ static int hfa384x_cmd(struct net_device *dev, u16 cmd, u16 param0,
 		*resp0 = entry->resp0;
 #ifndef final_version
 	if (entry->res) {
-		printk(KERN_DEBUG "%s: CMD=0x%04x => res=0x%02x, "
-		       "resp0=0x%04x\n",
-		       dev->name, cmd, entry->res, entry->resp0);
+		pr_debug("%s: CMD=0x%04x => res=0x%02x, resp0=0x%04x\n",
+			 dev->name, cmd, entry->res, entry->resp0);
 	}
 #endif /* final_version */
 
@@ -507,8 +499,7 @@ static int hfa384x_cmd_callback(struct net_device *dev, u16 cmd, u16 param0,
 	local = iface->local;
 
 	if (local->cmd_queue_len >= HOSTAP_CMD_QUEUE_MAX_LEN + 2) {
-		printk(KERN_DEBUG "%s: hfa384x_cmd: cmd_queue full\n",
-		       dev->name);
+		pr_debug("%s: %s: cmd_queue full\n", dev->name, __func__);
 		return -1;
 	}
 
@@ -567,8 +558,8 @@ static int __hfa384x_cmd_no_wait(struct net_device *dev, u16 cmd, u16 param0,
 	if (tries == 0) {
 		reg = HFA384X_INW(HFA384X_CMD_OFF);
 		prism2_io_debug_error(dev, io_debug_num);
-		printk(KERN_DEBUG "%s: __hfa384x_cmd_no_wait(%d) - timeout - "
-		       "reg=0x%04x\n", dev->name, io_debug_num, reg);
+		pr_debug("%s: %s(%d) - timeout - reg=0x%04x\n",
+			 dev->name, __func__, io_debug_num, reg);
 		return -ETIMEDOUT;
 	}
 
@@ -609,8 +600,8 @@ static int hfa384x_cmd_wait(struct net_device *dev, u16 cmd, u16 param0)
         if (tries == 0) {
                 reg = HFA384X_INW(HFA384X_EVSTAT_OFF);
 		prism2_io_debug_error(dev, 5);
-                printk(KERN_DEBUG "%s: hfa384x_cmd_wait - timeout2 - "
-		       "reg=0x%04x\n", dev->name, reg);
+		pr_debug("%s: %s: timeout2 - reg=0x%04x\n",
+			 dev->name, __func__, reg);
                 return -ETIMEDOUT;
         }
 
@@ -619,8 +610,7 @@ static int hfa384x_cmd_wait(struct net_device *dev, u16 cmd, u16 param0)
                 BIT(8))) >> 8;
 #ifndef final_version
 	if (res) {
-		printk(KERN_DEBUG "%s: CMD=0x%04x => res=0x%02x\n",
-		       dev->name, cmd, res);
+		pr_debug("%s: CMD=0x%04x => res=0x%02x\n", dev->name, cmd, res);
 	}
 #endif
 
@@ -671,8 +661,8 @@ static void prism2_cmd_ev(struct net_device *dev)
 		local->cmd_queue_len--;
 
 		if (!entry->issued) {
-			printk(KERN_DEBUG "%s: Command completion event, but "
-			       "cmd not issued\n", dev->name);
+			pr_debug("%s: Command completion event, but cmd not issued\n",
+				 dev->name);
 			__hostap_cmd_queue_free(local, entry, 1);
 			entry = NULL;
 		}
@@ -681,8 +671,8 @@ static void prism2_cmd_ev(struct net_device *dev)
 
 	if (!entry) {
 		HFA384X_OUTW(HFA384X_EV_CMD, HFA384X_EVACK_OFF);
-		printk(KERN_DEBUG "%s: Command completion event, but no "
-		       "pending commands\n", dev->name);
+		pr_debug("%s: Command completion event, but no pending commands\n",
+			 dev->name);
 		return;
 	}
 
@@ -701,8 +691,8 @@ static void prism2_cmd_ev(struct net_device *dev)
 			entry->callback(dev, entry->context, entry->resp0,
 					entry->res);
 	} else {
-		printk(KERN_DEBUG "%s: Invalid command completion type %d\n",
-		       dev->name, entry->type);
+		pr_debug("%s: Invalid command completion type %d\n",
+			 dev->name, entry->type);
 	}
 	hostap_cmd_queue_free(local, entry, 1);
 
@@ -767,8 +757,7 @@ static int hfa384x_setup_bap(struct net_device *dev, u16 bap, u16 id,
 
 	if (hfa384x_wait_offset(dev, o_off)) {
 		prism2_io_debug_error(dev, 7);
-		printk(KERN_DEBUG "%s: hfa384x_setup_bap - timeout before\n",
-		       dev->name);
+		pr_debug("%s: %s: timeout before\n", dev->name, __func__);
 		ret = -ETIMEDOUT;
 		goto out;
 	}
@@ -778,17 +767,16 @@ static int hfa384x_setup_bap(struct net_device *dev, u16 bap, u16 id,
 
 	if (hfa384x_wait_offset(dev, o_off)) {
 		prism2_io_debug_error(dev, 8);
-		printk(KERN_DEBUG "%s: hfa384x_setup_bap - timeout after\n",
-		       dev->name);
+		pr_debug("%s: %s: timeout after\n", dev->name, __func__);
 		ret = -ETIMEDOUT;
 		goto out;
 	}
 #ifndef final_version
 	if (HFA384X_INW(o_off) & HFA384X_OFFSET_ERR) {
 		prism2_io_debug_error(dev, 9);
-		printk(KERN_DEBUG "%s: hfa384x_setup_bap - offset error "
-		       "(%d,0x04%x,%d); reg=0x%04x\n",
-		       dev->name, bap, id, offset, HFA384X_INW(o_off));
+		pr_debug("%s: %s: offset error (%d,0x04%x,%d); reg=0x%04x\n",
+			 dev->name, __func__, bap, id, offset,
+			 HFA384X_INW(o_off));
 		ret = -EINVAL;
 	}
 #endif
@@ -810,8 +798,8 @@ static int hfa384x_get_rid(struct net_device *dev, u16 rid, void *buf, int len,
 	local = iface->local;
 
 	if (local->no_pri) {
-		printk(KERN_DEBUG "%s: cannot get RID %04x (len=%d) - no PRI "
-		       "f/w\n", dev->name, rid, len);
+		pr_debug("%s: cannot get RID %04x (len=%d) - no PRI f/w\n",
+			 dev->name, rid, len);
 		return -ENOTTY; /* Well.. not really correct, but return
 				 * something unique enough.. */
 	}
@@ -826,9 +814,8 @@ static int hfa384x_get_rid(struct net_device *dev, u16 rid, void *buf, int len,
 
 	res = hfa384x_cmd(dev, HFA384X_CMDCODE_ACCESS, rid, NULL, NULL);
 	if (res) {
-		printk(KERN_DEBUG "%s: hfa384x_get_rid: CMDCODE_ACCESS failed "
-		       "(res=%d, rid=%04x, len=%d)\n",
-		       dev->name, res, rid, len);
+		pr_debug("%s: %s: CMDCODE_ACCESS failed (res=%d, rid=%04x, len=%d)\n",
+			 dev->name, __func__, res, rid, len);
 		mutex_unlock(&local->rid_bap_mtx);
 		return res;
 	}
@@ -846,9 +833,8 @@ static int hfa384x_get_rid(struct net_device *dev, u16 rid, void *buf, int len,
 
 	rlen = (le16_to_cpu(rec.len) - 1) * 2;
 	if (!res && exact_len && rlen != len) {
-		printk(KERN_DEBUG "%s: hfa384x_get_rid - RID len mismatch: "
-		       "rid=0x%04x, len=%d (expected %d)\n",
-		       dev->name, rid, rlen, len);
+		pr_debug("%s: %s: RID len mismatch: rid=0x%04x, len=%d (expected %d)\n",
+			 dev->name, __func__, rid, rlen, len);
 		res = -ENODATA;
 	}
 
@@ -860,9 +846,8 @@ static int hfa384x_get_rid(struct net_device *dev, u16 rid, void *buf, int len,
 
 	if (res) {
 		if (res != -ENODATA)
-			printk(KERN_DEBUG "%s: hfa384x_get_rid (rid=%04x, "
-			       "len=%d) - failed - res=%d\n", dev->name, rid,
-			       len, res);
+			pr_debug("%s: %s: (rid=%04x, len=%d) - failed - res=%d\n",
+				 dev->name, __func__, rid, len, res);
 		if (res == -ETIMEDOUT)
 			prism2_hw_reset(dev);
 		return res;
@@ -883,8 +868,8 @@ static int hfa384x_set_rid(struct net_device *dev, u16 rid, void *buf, int len)
 	local = iface->local;
 
 	if (local->no_pri) {
-		printk(KERN_DEBUG "%s: cannot set RID %04x (len=%d) - no PRI "
-		       "f/w\n", dev->name, rid, len);
+		pr_debug("%s: cannot set RID %04x (len=%d) - no PRI f/w\n",
+			 dev->name, rid, len);
 		return -ENOTTY; /* Well.. not really correct, but return
 				 * something unique enough.. */
 	}
@@ -910,8 +895,8 @@ static int hfa384x_set_rid(struct net_device *dev, u16 rid, void *buf, int len)
 	spin_unlock_bh(&local->baplock);
 
 	if (res) {
-		printk(KERN_DEBUG "%s: hfa384x_set_rid (rid=%04x, len=%d) - "
-		       "failed - res=%d\n", dev->name, rid, len, res);
+		pr_debug("%s: %s: (rid=%04x, len=%d) - failed - res=%d\n",
+			 dev->name, __func__, rid, len, res);
 		mutex_unlock(&local->rid_bap_mtx);
 		return res;
 	}
@@ -920,9 +905,8 @@ static int hfa384x_set_rid(struct net_device *dev, u16 rid, void *buf, int len)
 	mutex_unlock(&local->rid_bap_mtx);
 
 	if (res) {
-		printk(KERN_DEBUG "%s: hfa384x_set_rid: CMDCODE_ACCESS_WRITE "
-		       "failed (res=%d, rid=%04x, len=%d)\n",
-		       dev->name, res, rid, len);
+		pr_debug("%s: %s: CMDCODE_ACCESS_WRITE failed (res=%d, rid=%04x, len=%d)\n",
+			 dev->name, __func__, res, rid, len);
 
 		if (res == -ETIMEDOUT)
 			prism2_hw_reset(dev);
@@ -976,8 +960,7 @@ static u16 hfa384x_allocate_fid(struct net_device *dev, int len)
 	 * below would be handled like CmdCompl event (sleep here, wake up from
 	 * interrupt handler */
 	if (hfa384x_cmd_wait(dev, HFA384X_CMDCODE_ALLOC, len)) {
-		printk(KERN_DEBUG "%s: cannot allocate fid, len=%d\n",
-		       dev->name, len);
+		pr_debug("%s: cannot allocate fid, len=%d\n", dev->name, len);
 		return 0xffff;
 	}
 
@@ -1012,14 +995,13 @@ static int prism2_reset_port(struct net_device *dev)
 	res = hfa384x_cmd(dev, HFA384X_CMDCODE_DISABLE, 0,
 			  NULL, NULL);
 	if (res)
-		printk(KERN_DEBUG "%s: reset port failed to disable port\n",
-		       dev->name);
+		pr_debug("%s: reset port failed to disable port\n", dev->name);
 	else {
 		res = hfa384x_cmd(dev, HFA384X_CMDCODE_ENABLE, 0,
 				  NULL, NULL);
 		if (res)
-			printk(KERN_DEBUG "%s: reset port failed to enable "
-			       "port\n", dev->name);
+			pr_debug("%s: reset port failed to enable port\n",
+				 dev->name);
 	}
 
 	/* It looks like at least some STA firmware versions reset
@@ -1028,9 +1010,8 @@ static int prism2_reset_port(struct net_device *dev)
 	if (local->fragm_threshold != 2346 &&
 	    hostap_set_word(dev, HFA384X_RID_FRAGMENTATIONTHRESHOLD,
 			    local->fragm_threshold)) {
-		printk(KERN_DEBUG "%s: failed to restore fragmentation "
-		       "threshold (%d) after Port0 enable\n",
-		       dev->name, local->fragm_threshold);
+		pr_debug("%s: failed to restore fragmentation threshold (%d) after Port0 enable\n",
+			 dev->name, local->fragm_threshold);
 	}
 
 	/* Some firmwares lose antenna selection settings on reset */
@@ -1055,13 +1036,14 @@ static int prism2_get_version_info(struct net_device *dev, u16 rid,
 		return -1;
 	}
 	if (hfa384x_get_rid(dev, rid, &comp, sizeof(comp), 1) < 0) {
-		printk(KERN_DEBUG "Could not get RID for component %s\n", txt);
+		pr_debug("Could not get RID for component %s\n", txt);
 		return -1;
 	}
 
-	printk(KERN_INFO "%s: %s: id=0x%02x v%d.%d.%d\n", dev->name, txt,
-	       __le16_to_cpu(comp.id), __le16_to_cpu(comp.major),
-	       __le16_to_cpu(comp.minor), __le16_to_cpu(comp.variant));
+	pr_info("%s: %s: id=0x%02x v%d.%d.%d\n",
+		dev->name, txt,
+		__le16_to_cpu(comp.id), __le16_to_cpu(comp.major),
+		__le16_to_cpu(comp.minor), __le16_to_cpu(comp.variant));
 	return 0;
 }
 
@@ -1116,8 +1098,8 @@ static int prism2_setup_rids(struct net_device *dev)
 
 	if (local->channel < 1 || local->channel > 14 ||
 	    !(local->channel_mask & (1 << (local->channel - 1)))) {
-		printk(KERN_WARNING "%s: Channel setting out of range "
-		       "(%d)!\n", dev->name, local->channel);
+		pr_warn("%s: Channel setting out of range (%d)!\n",
+			dev->name, local->channel);
 		ret = -EBUSY;
 		goto fail;
 	}
@@ -1152,8 +1134,8 @@ static int prism2_setup_rids(struct net_device *dev)
 	ret = hostap_set_word(dev, HFA384X_RID_PROMISCUOUSMODE,
 			      local->is_promisc);
 	if (ret)
-		printk(KERN_INFO "%s: Setting promiscuous mode (%d) failed\n",
-		       dev->name, local->is_promisc);
+		pr_info("%s: Setting promiscuous mode (%d) failed\n",
+			dev->name, local->is_promisc);
 
 	if (!local->fw_ap) {
 		ret = hostap_set_string(dev, HFA384X_RID_CNFDESIREDSSID,
@@ -1212,21 +1194,19 @@ static int prism2_setup_rids(struct net_device *dev)
 					 local->name);
 
 	if (hostap_set_encryption(local)) {
-		printk(KERN_INFO "%s: could not configure encryption\n",
-		       dev->name);
+		pr_info("%s: could not configure encryption\n", dev->name);
 	}
 
 	(void) hostap_set_antsel(local);
 
 	if (hostap_set_roaming(local)) {
-		printk(KERN_INFO "%s: could not set host roaming\n",
-		       dev->name);
+		pr_info("%s: could not set host roaming\n", dev->name);
 	}
 
 	if (local->sta_fw_ver >= PRISM2_FW_VER(1,6,3) &&
 	    hostap_set_word(dev, HFA384X_RID_CNFENHSECURITY, local->enh_sec))
-		printk(KERN_INFO "%s: cnfEnhSecurity setting to 0x%x failed\n",
-		       dev->name, local->enh_sec);
+		pr_info("%s: cnfEnhSecurity setting to 0x%x failed\n",
+			dev->name, local->enh_sec);
 
 	/* 32-bit tallies were added in STA f/w 0.8.0, but they were apparently
 	 * not working correctly (last seven counters report bogus values).
@@ -1236,8 +1216,8 @@ static int prism2_setup_rids(struct net_device *dev)
 	 * versions, too? */
 	if (local->sta_fw_ver >= PRISM2_FW_VER(0,8,2)) {
 		if (hostap_set_word(dev, HFA384X_RID_CNFTHIRTY2TALLY, 1)) {
-			printk(KERN_INFO "%s: cnfThirty2Tally setting "
-			       "failed\n", dev->name);
+			pr_info("%s: cnfThirty2Tally setting failed\n",
+				dev->name);
 			local->tallies32 = 0;
 		} else
 			local->tallies32 = 1;
@@ -1248,21 +1228,21 @@ static int prism2_setup_rids(struct net_device *dev)
 
 	if (hostap_set_word(dev, HFA384X_RID_FRAGMENTATIONTHRESHOLD,
 			    local->fragm_threshold)) {
-		printk(KERN_INFO "%s: setting FragmentationThreshold to %d "
-		       "failed\n", dev->name, local->fragm_threshold);
+		pr_info("%s: setting FragmentationThreshold to %d failed\n",
+			dev->name, local->fragm_threshold);
 	}
 
 	if (hostap_set_word(dev, HFA384X_RID_RTSTHRESHOLD,
 			    local->rts_threshold)) {
-		printk(KERN_INFO "%s: setting RTSThreshold to %d failed\n",
-		       dev->name, local->rts_threshold);
+		pr_info("%s: setting RTSThreshold to %d failed\n",
+			dev->name, local->rts_threshold);
 	}
 
 	if (local->manual_retry_count >= 0 &&
 	    hostap_set_word(dev, HFA384X_RID_CNFALTRETRYCOUNT,
 			    local->manual_retry_count)) {
-		printk(KERN_INFO "%s: setting cnfAltRetryCount to %d failed\n",
-		       dev->name, local->manual_retry_count);
+		pr_info("%s: setting cnfAltRetryCount to %d failed\n",
+			dev->name, local->manual_retry_count);
 	}
 
 	if (local->sta_fw_ver >= PRISM2_FW_VER(1,3,1) &&
@@ -1272,15 +1252,13 @@ static int prism2_setup_rids(struct net_device *dev)
 
 	if (local->sta_fw_ver >= PRISM2_FW_VER(1,7,0) && local->wpa &&
 	    hostap_set_word(dev, HFA384X_RID_SSNHANDLINGMODE, 1)) {
-		printk(KERN_INFO "%s: setting ssnHandlingMode to 1 failed\n",
-		       dev->name);
+		pr_info("%s: setting ssnHandlingMode to 1 failed\n", dev->name);
 	}
 
 	if (local->sta_fw_ver >= PRISM2_FW_VER(1,7,0) && local->generic_elem &&
 	    hfa384x_set_rid(dev, HFA384X_RID_GENERICELEMENT,
 			    local->generic_elem, local->generic_elem_len)) {
-		printk(KERN_INFO "%s: setting genericElement failed\n",
-		       dev->name);
+		pr_info("%s: setting genericElement failed\n", dev->name);
 	}
 
  fail:
@@ -1306,16 +1284,15 @@ static int prism2_hw_init(struct net_device *dev, int initial)
 	/* initialize HFA 384x */
 	ret = hfa384x_cmd_no_wait(dev, HFA384X_CMDCODE_INIT, 0);
 	if (ret) {
-		printk(KERN_INFO "%s: first command failed - assuming card "
-		       "does not have primary firmware\n", dev_info);
+		pr_info("first command failed - assuming card does not have primary firmware\n");
 	}
 
 	if (first && (HFA384X_INW(HFA384X_EVSTAT_OFF) & HFA384X_EV_CMD)) {
 		/* EvStat has Cmd bit set in some cases, so retry once if no
 		 * wait was needed */
 		HFA384X_OUTW(HFA384X_EV_CMD, HFA384X_EVACK_OFF);
-		printk(KERN_DEBUG "%s: init command completed too quickly - "
-		       "retrying\n", dev->name);
+		pr_debug("%s: init command completed too quickly - retrying\n",
+			 dev->name);
 		first = 0;
 		goto init;
 	}
@@ -1326,9 +1303,7 @@ static int prism2_hw_init(struct net_device *dev, int initial)
 	       time_before(jiffies, delay))
 		yield();
 	if (!(HFA384X_INW(HFA384X_EVSTAT_OFF) & HFA384X_EV_CMD)) {
-		printk(KERN_DEBUG "%s: assuming no Primary image in "
-		       "flash - card initialization not completed\n",
-		       dev_info);
+		pr_debug("assuming no Primary image in flash - card initialization not completed\n");
 		local->no_pri = 1;
 #ifdef PRISM2_DOWNLOAD_SUPPORT
 			if (local->sram_type == -1)
@@ -1337,8 +1312,8 @@ static int prism2_hw_init(struct net_device *dev, int initial)
 		return 1;
 	}
 	local->no_pri = 0;
-	printk(KERN_DEBUG "prism2_hw_init: initialized in %lu ms\n",
-	       (jiffies - start) * 1000 / HZ);
+	pr_debug("%s: initialized in %lu ms\n",
+		 __func__, (jiffies - start) * 1000 / HZ);
 	HFA384X_OUTW(HFA384X_EV_CMD, HFA384X_EVACK_OFF);
 	return 0;
 }
@@ -1382,8 +1357,8 @@ static int prism2_hw_init2(struct net_device *dev, int initial)
 		}
 
 		if (prism2_get_version_info(dev, HFA384X_RID_STAID, "STA")) {
-			printk(KERN_DEBUG "%s: Failed to read STA f/w version "
-			       "- only Primary f/w present\n", dev->name);
+			pr_debug("%s: Failed to read STA f/w version - only Primary f/w present\n",
+				 dev->name);
 			local->pri_only = 1;
 			return 0;
 		}
@@ -1402,8 +1377,8 @@ static int prism2_hw_init2(struct net_device *dev, int initial)
 		if (local->txfid[i] == 0xffff && local->txfid_len > 1600) {
 			local->txfid[i] = hfa384x_allocate_fid(dev, 1600);
 			if (local->txfid[i] != 0xffff) {
-				printk(KERN_DEBUG "%s: Using shorter TX FID "
-				       "(1600 bytes)\n", dev->name);
+				pr_debug("%s: Using shorter TX FID (1600 bytes)\n",
+					 dev->name);
 				local->txfid_len = 1600;
 			}
 		}
@@ -1437,7 +1412,7 @@ static int prism2_hw_init2(struct net_device *dev, int initial)
 
  failed:
 	if (!local->no_pri)
-		printk(KERN_WARNING "%s: Initialization failed\n", dev_info);
+		pr_warn("Initialization failed\n");
 	return 1;
 }
 
@@ -1530,14 +1505,14 @@ static void prism2_hw_shutdown(struct net_device *dev, int no_disable)
 	local->dev_enabled = 0;
 
 	if (local->func->card_present && !local->func->card_present(local)) {
-		printk(KERN_DEBUG "%s: card already removed or not configured "
-		       "during shutdown\n", dev->name);
+		pr_debug("%s: card already removed or not configured during shutdown\n",
+			 dev->name);
 		return;
 	}
 
 	if ((no_disable & HOSTAP_HW_NO_DISABLE) == 0 &&
 	    hfa384x_cmd(dev, HFA384X_CMDCODE_DISABLE, 0, NULL, NULL))
-		printk(KERN_WARNING "%s: Shutdown failed\n", dev_info);
+		pr_warn("Shutdown failed\n");
 
 	hfa384x_disable_interrupts(dev);
 
@@ -1567,8 +1542,8 @@ static void prism2_hw_reset(struct net_device *dev)
 	local = iface->local;
 
 	if (in_interrupt()) {
-		printk(KERN_DEBUG "%s: driver bug - prism2_hw_reset() called "
-		       "in interrupt context\n", dev->name);
+		pr_debug("%s: driver bug - prism2_hw_reset() called in interrupt context\n",
+			 dev->name);
 		return;
 	}
 
@@ -1576,19 +1551,18 @@ static void prism2_hw_reset(struct net_device *dev)
 		return;
 
 	if (local->hw_resetting) {
-		printk(KERN_WARNING "%s: %s: already resetting card - "
-		       "ignoring reset request\n", dev_info, dev->name);
+		pr_warn("%s: already resetting card - ignoring reset request\n",
+			dev->name);
 		return;
 	}
 
 	local->hw_reset_tries++;
 	if (local->hw_reset_tries > 10) {
-		printk(KERN_WARNING "%s: too many reset tries, skipping\n",
-		       dev->name);
+		pr_warn("%s: too many reset tries, skipping\n", dev->name);
 		return;
 	}
 
-	printk(KERN_WARNING "%s: %s: resetting card\n", dev_info, dev->name);
+	pr_warn("%s: resetting card\n", dev->name);
 	hfa384x_disable_interrupts(dev);
 	local->hw_resetting = 1;
 	if (local->func->cor_sreset) {
@@ -1608,19 +1582,17 @@ static void prism2_hw_reset(struct net_device *dev)
 
 #ifdef PRISM2_DOWNLOAD_SUPPORT
 	if (local->dl_pri) {
-		printk(KERN_DEBUG "%s: persistent download of primary "
-		       "firmware\n", dev->name);
+		pr_debug("%s: persistent download of primary firmware\n",
+			 dev->name);
 		if (prism2_download_genesis(local, local->dl_pri) < 0)
-			printk(KERN_WARNING "%s: download (PRI) failed\n",
-			       dev->name);
+			pr_warn("%s: download (PRI) failed\n", dev->name);
 	}
 
 	if (local->dl_sec) {
-		printk(KERN_DEBUG "%s: persistent download of secondary "
-		       "firmware\n", dev->name);
+		pr_debug("%s: persistent download of secondary firmware\n",
+			 dev->name);
 		if (prism2_download_volatile(local, local->dl_sec) < 0)
-			printk(KERN_WARNING "%s: download (SEC) failed\n",
-			       dev->name);
+			pr_warn("%s: download (SEC) failed\n", dev->name);
 	}
 #endif /* PRISM2_DOWNLOAD_SUPPORT */
 
@@ -1640,7 +1612,7 @@ static void handle_reset_queue(struct work_struct *work)
 {
 	local_info_t *local = container_of(work, local_info_t, reset_queue);
 
-	printk(KERN_DEBUG "%s: scheduled card reset\n", local->dev->name);
+	pr_debug("%s: scheduled card reset\n", local->dev->name);
 	prism2_hw_reset(local->dev);
 
 	if (netif_queue_stopped(local->dev)) {
@@ -1696,20 +1668,19 @@ static void prism2_transmit_cb(struct net_device *dev, long context,
 	local = iface->local;
 
 	if (res) {
-		printk(KERN_DEBUG "%s: prism2_transmit_cb - res=0x%02x\n",
-		       dev->name, res);
+		pr_debug("%s: %s: res=0x%02x\n", dev->name, __func__, res);
 		return;
 	}
 
 	if (idx < 0 || idx >= PRISM2_TXFID_COUNT) {
-		printk(KERN_DEBUG "%s: prism2_transmit_cb called with invalid "
-		       "idx=%d\n", dev->name, idx);
+		pr_debug("%s: %s: called with invalid idx=%d\n",
+			 dev->name, __func__, idx);
 		return;
 	}
 
 	if (!test_and_clear_bit(HOSTAP_BITS_TRANSMIT, &local->bits)) {
-		printk(KERN_DEBUG "%s: driver bug: prism2_transmit_cb called "
-		       "with no pending transmit\n", dev->name);
+		pr_debug("%s: driver bug: %s: called with no pending transmit\n",
+			 dev->name, __func__);
 	}
 
 	if (netif_queue_stopped(dev)) {
@@ -1767,8 +1738,8 @@ static int prism2_transmit(struct net_device *dev, int idx)
 	 * is really the case */
 
 	if (test_and_set_bit(HOSTAP_BITS_TRANSMIT, &local->bits)) {
-		printk(KERN_DEBUG "%s: driver bug - prism2_transmit() called "
-		       "when previous TX was pending\n", dev->name);
+		pr_debug("%s: driver bug - %s() called when previous TX was pending\n",
+			 dev->name, __func__);
 		return -1;
 	}
 
@@ -1783,8 +1754,8 @@ static int prism2_transmit(struct net_device *dev, int idx)
 		prism2_transmit_cb, (long) idx);
 
 	if (res) {
-		printk(KERN_DEBUG "%s: prism2_transmit: CMDCODE_TRANSMIT "
-		       "failed (res=%d)\n", dev->name, res);
+		pr_debug("%s: %s: CMDCODE_TRANSMIT failed (res=%d)\n",
+			 dev->name, __func__, res);
 		dev->stats.tx_dropped++;
 		netif_wake_queue(dev);
 		return -1;
@@ -1821,8 +1792,8 @@ static int prism2_tx_80211(struct sk_buff *skb, struct net_device *dev)
 	if ((local->func->card_present && !local->func->card_present(local)) ||
 	    !local->hw_ready || local->hw_downloading || local->pri_only) {
 		if (net_ratelimit()) {
-			printk(KERN_DEBUG "%s: prism2_tx_80211: hw not ready -"
-			       " skipping\n", dev->name);
+			pr_debug("%s: %s: hw not ready - skipping\n",
+				 dev->name, __func__);
 		}
 		goto fail;
 	}
@@ -1874,8 +1845,7 @@ static int prism2_tx_80211(struct sk_buff *skb, struct net_device *dev)
 	if (!res)
 		res = prism2_transmit(dev, idx);
 	if (res) {
-		printk(KERN_DEBUG "%s: prism2_tx_80211 - to BAP0 failed\n",
-		       dev->name);
+		pr_debug("%s: %s: to BAP0 failed\n", dev->name, __func__);
 		local->intransmitfid[idx] = PRISM2_TXFID_EMPTY;
 		schedule_work(&local->reset_queue);
 		goto fail;
@@ -1910,16 +1880,15 @@ static u16 prism2_read_fid_reg(struct net_device *dev, u16 reg)
 		if (val == val2 && val == val3)
 			return val;
 
-		printk(KERN_DEBUG "%s: detected fid change (try=%d, reg=%04x):"
-		       " %04x %04x %04x\n",
-		       dev->name, i, reg, val, val2, val3);
+		pr_debug("%s: detected fid change (try=%d, reg=%04x): %04x %04x %04x\n",
+			 dev->name, i, reg, val, val2, val3);
 		if ((val == val2 || val == val3) && val != 0)
 			return val;
 		if (val2 == val3 && val2 != 0)
 			return val2;
 	}
-	printk(KERN_WARNING "%s: Uhhuh.. could not read good fid from reg "
-	       "%04x (%04x %04x %04x)\n", dev->name, reg, val, val2, val3);
+	pr_warn("%s: Uhhuh.. could not read good fid from reg %04x (%04x %04x %04x)\n",
+		dev->name, reg, val, val2, val3);
 	return val;
 #else /* EXTRA_FID_READ_TESTS */
 	return HFA384X_INW(reg);
@@ -1942,8 +1911,7 @@ static void prism2_rx(local_info_t *local)
 #ifndef final_version
 	if (rxfid == 0) {
 		rxfid = HFA384X_INW(HFA384X_RXFID_OFF);
-		printk(KERN_DEBUG "prism2_rx: rxfid=0 (next 0x%04x)\n",
-		       rxfid);
+		pr_debug("%s: rxfid=0 (next 0x%04x)\n", __func__, rxfid);
 		if (rxfid == 0) {
 			schedule_work(&local->reset_queue);
 			goto rx_dropped;
@@ -1959,8 +1927,7 @@ static void prism2_rx(local_info_t *local)
 
 	if (res) {
 		spin_unlock(&local->baplock);
-		printk(KERN_DEBUG "%s: copy from BAP0 failed %d\n", dev->name,
-		       res);
+		pr_debug("%s: copy from BAP0 failed %d\n", dev->name, res);
 		if (res == -ETIMEDOUT) {
 			schedule_work(&local->reset_queue);
 		}
@@ -1985,8 +1952,8 @@ static void prism2_rx(local_info_t *local)
 			len = 0;
 		} else {
 			spin_unlock(&local->baplock);
-			printk(KERN_DEBUG "%s: Received frame with invalid "
-			       "length 0x%04x\n", dev->name, len);
+			pr_debug("%s: Received frame with invalid length 0x%04x\n",
+				 dev->name, len);
 			hostap_dump_rx_header(dev->name, &rxdesc);
 			goto rx_dropped;
 		}
@@ -1995,8 +1962,7 @@ static void prism2_rx(local_info_t *local)
 	skb = dev_alloc_skb(len + hdr_len);
 	if (!skb) {
 		spin_unlock(&local->baplock);
-		printk(KERN_DEBUG "%s: RX failed to allocate skb\n",
-		       dev->name);
+		pr_debug("%s: RX failed to allocate skb\n", dev->name);
 		goto rx_dropped;
 	}
 	skb->dev = dev;
@@ -2006,8 +1972,7 @@ static void prism2_rx(local_info_t *local)
 		res = hfa384x_from_bap(dev, BAP0, skb_put(skb, len), len);
 	spin_unlock(&local->baplock);
 	if (res) {
-		printk(KERN_DEBUG "%s: RX failed to read "
-		       "frame data\n", dev->name);
+		pr_debug("%s: RX failed to read frame data\n", dev->name);
 		goto rx_dropped;
 	}
 
@@ -2062,8 +2027,8 @@ static void hostap_rx_skb(local_info_t *local, struct sk_buff *skb)
 		goto drop;
 
 	if (skb->len > PRISM2_DATA_MAXLEN) {
-		printk(KERN_DEBUG "%s: RX: len(%d) > MAX(%d)\n",
-		       dev->name, skb->len, PRISM2_DATA_MAXLEN);
+		pr_debug("%s: RX: len(%d) > MAX(%d)\n",
+			 dev->name, skb->len, PRISM2_DATA_MAXLEN);
 		goto drop;
 	}
 
@@ -2148,13 +2113,12 @@ static void prism2_alloc_ev(struct net_device *dev)
 			idx = 0;
 	} while (idx != local->next_alloc);
 
-	printk(KERN_WARNING "%s: could not find matching txfid (0x%04x, new "
-	       "read 0x%04x) for alloc event\n", dev->name, fid,
-	       HFA384X_INW(HFA384X_ALLOCFID_OFF));
-	printk(KERN_DEBUG "TXFIDs:");
+	pr_warn("%s: could not find matching txfid (0x%04x, new read 0x%04x) for alloc event\n",
+		dev->name, fid, HFA384X_INW(HFA384X_ALLOCFID_OFF));
+	pr_debug("TXFIDs:");
 	for (idx = 0; idx < PRISM2_TXFID_COUNT; idx++)
-		printk(" %04x[%04x]", local->txfid[idx],
-		       local->intransmitfid[idx]);
+		printk(" %04x[%04x]",
+		       local->txfid[idx], local->intransmitfid[idx]);
 	printk("\n");
 	spin_unlock(&local->txfidlock);
 
@@ -2176,8 +2140,7 @@ static void hostap_tx_callback(local_info_t *local,
 
 	/* Make sure that frame was from us. */
 	if (memcmp(txdesc->addr2, local->dev->dev_addr, ETH_ALEN)) {
-		printk(KERN_DEBUG "%s: TX callback - foreign frame\n",
-		       local->dev->name);
+		pr_debug("%s: TX callback - foreign frame\n", local->dev->name);
 		return;
 	}
 
@@ -2190,8 +2153,8 @@ static void hostap_tx_callback(local_info_t *local,
 	spin_unlock(&local->lock);
 
 	if (cb == NULL) {
-		printk(KERN_DEBUG "%s: could not find TX callback (idx %d)\n",
-		       local->dev->name, sw_support);
+		pr_debug("%s: could not find TX callback (idx %d)\n",
+			 local->dev->name, sw_support);
 		return;
 	}
 
@@ -2199,8 +2162,8 @@ static void hostap_tx_callback(local_info_t *local,
 	len = le16_to_cpu(txdesc->data_len);
 	skb = dev_alloc_skb(hdrlen + len);
 	if (skb == NULL) {
-		printk(KERN_DEBUG "%s: hostap_tx_callback failed to allocate "
-		       "skb\n", local->dev->name);
+		pr_debug("%s: %s: failed to allocate skb\n",
+			 local->dev->name, __func__);
 		return;
 	}
 
@@ -2426,8 +2389,7 @@ static void prism2_info(local_info_t *local)
 		res = hfa384x_from_bap(dev, BAP0, &info, sizeof(info));
 	if (res) {
 		spin_unlock(&local->baplock);
-		printk(KERN_DEBUG "Could not get info frame (fid=0x%04x)\n",
-		       fid);
+		pr_debug("Could not get info frame (fid=0x%04x)\n", fid);
 		if (res == -ETIMEDOUT) {
 			schedule_work(&local->reset_queue);
 		}
@@ -2441,17 +2403,17 @@ static void prism2_info(local_info_t *local)
 		 * though busy bit is not set in offset register;
 		 * in addition, length must be at least 1 due to type field */
 		spin_unlock(&local->baplock);
-		printk(KERN_DEBUG "%s: Received info frame with invalid "
-		       "length 0x%04x (type 0x%04x)\n", dev->name,
-		       le16_to_cpu(info.len), le16_to_cpu(info.type));
+		pr_debug("%s: Received info frame with invalid length 0x%04x (type 0x%04x)\n",
+			 dev->name,
+			 le16_to_cpu(info.len), le16_to_cpu(info.type));
 		goto out;
 	}
 
 	skb = dev_alloc_skb(sizeof(info) + left);
 	if (skb == NULL) {
 		spin_unlock(&local->baplock);
-		printk(KERN_DEBUG "%s: Could not allocate skb for info "
-		       "frame\n", dev->name);
+		pr_debug("%s: Could not allocate skb for info frame\n",
+			 dev->name);
 		goto out;
 	}
 
@@ -2459,9 +2421,9 @@ static void prism2_info(local_info_t *local)
 	if (left > 0 && hfa384x_from_bap(dev, BAP0, skb_put(skb, left), left))
 	{
 		spin_unlock(&local->baplock);
-		printk(KERN_WARNING "%s: Info frame read failed (fid=0x%04x, "
-		       "len=0x%04x, type=0x%04x\n", dev->name, fid,
-		       le16_to_cpu(info.len), le16_to_cpu(info.type));
+		pr_warn("%s: Info frame read failed (fid=0x%04x, len=0x%04x, type=0x%04x\n",
+			dev->name, fid,
+			le16_to_cpu(info.len), le16_to_cpu(info.type));
 		dev_kfree_skb(skb);
 		goto out;
 	}
@@ -2549,15 +2511,14 @@ static void prism2_ev_tick(struct net_device *dev)
 		evstat = HFA384X_INW(HFA384X_EVSTAT_OFF);
 		inten = HFA384X_INW(HFA384X_INTEN_OFF);
 		if (!prev_stuck) {
-			printk(KERN_INFO "%s: SW TICK stuck? "
-			       "bits=0x%lx EvStat=%04x IntEn=%04x\n",
-			       dev->name, local->bits, evstat, inten);
+			pr_info("%s: SW TICK stuck? bits=0x%lx EvStat=%04x IntEn=%04x\n",
+				dev->name, local->bits, evstat, inten);
 		}
 		local->sw_tick_stuck++;
 		if ((evstat & HFA384X_BAP0_EVENTS) &&
 		    (inten & HFA384X_BAP0_EVENTS)) {
-			printk(KERN_INFO "%s: trying to recover from IRQ "
-			       "hang\n", dev->name);
+			pr_info("%s: trying to recover from IRQ hang\n",
+				dev->name);
 			hfa384x_events_no_bap0(dev);
 		}
 		prev_stuck = 1;
@@ -2591,10 +2552,10 @@ static void prism2_check_magic(local_info_t *local)
 			       HFA384X_MAGIC);
 			last_magic_err = jiffies;
 		} else if (net_ratelimit()) {
-			printk(KERN_DEBUG "%s: interrupt - SWSUPPORT0=%04x "
-			       "MAGIC=%04x\n", dev->name,
-			       HFA384X_INW(HFA384X_SWSUPPORT0_OFF),
-			       HFA384X_MAGIC);
+			pr_debug("%s: interrupt - SWSUPPORT0=%04x MAGIC=%04x\n",
+				 dev->name,
+				 HFA384X_INW(HFA384X_SWSUPPORT0_OFF),
+				 HFA384X_MAGIC);
 		}
 		if (HFA384X_INW(HFA384X_SWSUPPORT0_OFF) != 0xffff)
 			schedule_work(&local->reset_queue);
@@ -2621,8 +2582,8 @@ static irqreturn_t prism2_interrupt(int irq, void *dev_id)
 	spin_lock(&local->irq_init_lock);
 	if (!dev->base_addr) {
 		if (net_ratelimit()) {
-			printk(KERN_DEBUG "%s: Interrupt, but dev not configured\n",
-			       dev->name);
+			pr_debug("%s: Interrupt, but dev not configured\n",
+				 dev->name);
 		}
 		spin_unlock(&local->irq_init_lock);
 		return IRQ_HANDLED;
@@ -2633,8 +2594,7 @@ static irqreturn_t prism2_interrupt(int irq, void *dev_id)
 
 	if (local->func->card_present && !local->func->card_present(local)) {
 		if (net_ratelimit()) {
-			printk(KERN_DEBUG "%s: Interrupt, but dev not OK\n",
-			       dev->name);
+			pr_debug("%s: Interrupt, but dev not OK\n", dev->name);
 		}
 		return IRQ_HANDLED;
 	}
@@ -2647,8 +2607,7 @@ static irqreturn_t prism2_interrupt(int irq, void *dev_id)
 			if (local->shutdown)
 				return IRQ_HANDLED;
 			HFA384X_OUTW(0xffff, HFA384X_EVACK_OFF);
-			printk(KERN_DEBUG "%s: prism2_interrupt: ev=0xffff\n",
-			       dev->name);
+			pr_debug("%s: %s: ev=0xffff\n", dev->name, __func__);
 			return IRQ_HANDLED;
 		}
 
@@ -2673,16 +2632,14 @@ static irqreturn_t prism2_interrupt(int irq, void *dev_id)
 				return IRQ_HANDLED;
 			if (local->dev_enabled && (ev & ~HFA384X_EV_TICK) &&
 			    net_ratelimit()) {
-				printk(KERN_DEBUG "%s: prism2_interrupt: hw "
-				       "not ready; skipping events 0x%04x "
-				       "(IntEn=0x%04x)%s%s%s\n",
-				       dev->name, ev,
-				       HFA384X_INW(HFA384X_INTEN_OFF),
-				       !local->hw_ready ? " (!hw_ready)" : "",
-				       local->hw_resetting ?
-				       " (hw_resetting)" : "",
-				       !local->dev_enabled ?
-				       " (!dev_enabled)" : "");
+				pr_debug("%s: %s: hw not ready; skipping events 0x%04x (IntEn=0x%04x)%s%s%s\n",
+					 dev->name, __func__, ev,
+					 HFA384X_INW(HFA384X_INTEN_OFF),
+					 !local->hw_ready ? " (!hw_ready)" : "",
+					 local->hw_resetting
+					 ? " (hw_resetting)" : "",
+					 !local->dev_enabled
+					 ? " (!dev_enabled)" : "");
 			}
 			HFA384X_OUTW(ev, HFA384X_EVACK_OFF);
 			return IRQ_HANDLED;
@@ -2765,9 +2722,8 @@ static void prism2_check_sta_fw_version(local_info_t *local)
 
 	if (local->iw_mode == IW_MODE_MASTER && !local->host_encrypt &&
 	    !local->fw_encrypt_ok) {
-		printk(KERN_DEBUG "%s: defaulting to host-based encryption as "
-		       "a workaround for firmware bug in Host AP mode WEP\n",
-		       local->dev->name);
+		pr_debug("%s: defaulting to host-based encryption as a workaround for firmware bug in Host AP mode WEP\n",
+			 local->dev->name);
 		local->host_encrypt = 1;
 	}
 
@@ -2781,9 +2737,8 @@ static void prism2_check_sta_fw_version(local_info_t *local)
 	if (local->sta_fw_ver >= PRISM2_FW_VER(1,5,0))
 		local->wds_type |= HOSTAP_WDS_STANDARD_FRAME;
 	else {
-		printk(KERN_DEBUG "%s: defaulting to bogus WDS frame as a "
-		       "workaround for firmware bug in Host AP mode WDS\n",
-		       local->dev->name);
+		pr_debug("%s: defaulting to bogus WDS frame as a workaround for firmware bug in Host AP mode WDS\n",
+			 local->dev->name);
 	}
 
 	hostap_check_sta_fw_version(local->ap, local->sta_fw_ver);
@@ -2807,8 +2762,8 @@ static void hostap_passive_scan(unsigned long data)
 		 * passive scanning when a host-generated frame is being
 		 * transmitted */
 		if (test_bit(HOSTAP_BITS_TRANSMIT, &local->bits)) {
-			printk(KERN_DEBUG "%s: passive scan detected pending "
-			       "TX - delaying\n", dev->name);
+			pr_debug("%s: passive scan detected pending TX - delaying\n",
+				 dev->name);
 			local->passive_scan_timer.expires = jiffies + HZ / 10;
 			add_timer(&local->passive_scan_timer);
 			return;
@@ -2824,13 +2779,13 @@ static void hostap_passive_scan(unsigned long data)
 			 max_tries > 0);
 
 		if (max_tries == 0) {
-			printk(KERN_INFO "%s: no allowed passive scan channels"
-			       " found\n", dev->name);
+			pr_info("%s: no allowed passive scan channels found\n",
+				dev->name);
 			return;
 		}
 
-		printk(KERN_DEBUG "%s: passive scan channel %d\n",
-		       dev->name, local->passive_scan_channel);
+		pr_debug("%s: passive scan channel %d\n",
+			 dev->name, local->passive_scan_channel);
 		chan = local->passive_scan_channel;
 		local->passive_scan_state = PASSIVE_SCAN_WAIT;
 		local->passive_scan_timer.expires = jiffies + HZ / 10;
@@ -2844,8 +2799,8 @@ static void hostap_passive_scan(unsigned long data)
 	if (hfa384x_cmd_callback(dev, HFA384X_CMDCODE_TEST |
 				 (HFA384X_TEST_CHANGE_CHANNEL << 8),
 				 chan, NULL, 0))
-		printk(KERN_ERR "%s: passive scan channel set %d "
-		       "failed\n", dev->name, chan);
+		pr_err("%s: passive scan channel set %d failed\n",
+		       dev->name, chan);
 
 	add_timer(&local->passive_scan_timer);
 }
@@ -3029,9 +2984,8 @@ static void handle_set_tim_queue(struct work_struct *work)
 		if (entry->set)
 			val |= 0x8000;
 		if (hostap_set_word(local->dev, HFA384X_RID_CNFTIMCTRL, val)) {
-			printk(KERN_DEBUG "%s: set_tim failed (aid=%d "
-			       "set=%d)\n",
-			       local->dev->name, entry->aid, entry->set);
+			pr_debug("%s: set_tim failed (aid=%d set=%d)\n",
+				 local->dev->name, entry->aid, entry->set);
 		}
 
 		kfree(entry);
@@ -3089,8 +3043,7 @@ prism2_init_local_data(struct prism2_helper_functions *funcs, int card_idx,
 
 	len = strlen(dev_template);
 	if (len >= IFNAMSIZ || strstr(dev_template, "%d") == NULL) {
-		printk(KERN_WARNING "hostap: Invalid dev_template='%s'\n",
-		       dev_template);
+		pr_warn("Invalid dev_template='%s'\n", dev_template);
 		return NULL;
 	}
 
@@ -3160,8 +3113,8 @@ prism2_init_local_data(struct prism2_helper_functions *funcs, int card_idx,
 	    i == IW_MODE_MONITOR) {
 		local->iw_mode = i;
 	} else {
-		printk(KERN_WARNING "prism2: Unknown iw_mode %d; using "
-		       "IW_MODE_MASTER\n", i);
+		pr_warn("prism2: Unknown iw_mode %d; using IW_MODE_MASTER\n",
+			i);
 		local->iw_mode = IW_MODE_MASTER;
 	}
 	local->channel = GET_INT_PARM(channel, card_idx);
@@ -3241,11 +3194,10 @@ while (0)
 	prism2_set_lockdep_class(dev);
 	rtnl_unlock();
 	if (ret < 0) {
-		printk(KERN_WARNING "%s: register netdevice failed!\n",
-		       dev_info);
+		pr_warn("register netdevice failed!\n");
 		goto fail;
 	}
-	printk(KERN_INFO "%s: Registered netdevice %s\n", dev_info, dev->name);
+	pr_info("Registered netdevice %s\n", dev->name);
 
 	hostap_init_data(local);
 	return dev;
diff --git a/drivers/net/wireless/hostap/hostap_info.c b/drivers/net/wireless/hostap/hostap_info.c
index 47932b2..afdd08d 100644
--- a/drivers/net/wireless/hostap/hostap_info.c
+++ b/drivers/net/wireless/hostap/hostap_info.c
@@ -1,5 +1,7 @@
 /* Host AP driver Info Frame processing (part of hostap.o module) */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/if_arp.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
@@ -15,8 +17,8 @@ static void prism2_info_commtallies16(local_info_t *local, unsigned char *buf,
 	struct hfa384x_comm_tallies *tallies;
 
 	if (left < sizeof(struct hfa384x_comm_tallies)) {
-		printk(KERN_DEBUG "%s: too short (len=%d) commtallies "
-		       "info frame\n", local->dev->name, left);
+		pr_debug("%s: too short (len=%d) commtallies info frame\n",
+			 local->dev->name, left);
 		return;
 	}
 
@@ -55,8 +57,8 @@ static void prism2_info_commtallies32(local_info_t *local, unsigned char *buf,
 	struct hfa384x_comm_tallies32 *tallies;
 
 	if (left < sizeof(struct hfa384x_comm_tallies32)) {
-		printk(KERN_DEBUG "%s: too short (len=%d) commtallies32 "
-		       "info frame\n", local->dev->name, left);
+		pr_debug("%s: too short (len=%d) commtallies32 info frame\n",
+			 local->dev->name, left);
 		return;
 	}
 
@@ -135,8 +137,8 @@ static void prism2_info_linkstatus(local_info_t *local, unsigned char *buf,
 	local->last_join_time = 0;
 
 	if (left != 2) {
-		printk(KERN_DEBUG "%s: invalid linkstatus info frame "
-		       "length %d\n", local->dev->name, left);
+		pr_debug("%s: invalid linkstatus info frame length %d\n",
+			 local->dev->name, left);
 		return;
 	}
 
@@ -225,7 +227,7 @@ static void prism2_host_roaming(local_info_t *local)
 	       dev->name, req.bssid, le16_to_cpu(req.channel));
 	if (local->func->set_rid(dev, HFA384X_RID_JOINREQUEST, &req,
 				 sizeof(req))) {
-		printk(KERN_DEBUG "%s: JoinRequest failed\n", dev->name);
+		pr_debug("%s: JoinRequest failed\n", dev->name);
 	}
 	local->last_join_time = jiffies;
 }
@@ -258,8 +260,8 @@ static void prism2_info_scanresults(local_info_t *local, unsigned char *buf,
 	struct hfa384x_hostscan_result *results, *prev;
 
 	if (left < 4) {
-		printk(KERN_DEBUG "%s: invalid scanresult info frame "
-		       "length %d\n", local->dev->name, left);
+		pr_debug("%s: invalid scanresult info frame length %d\n",
+			 local->dev->name, left);
 		return;
 	}
 
@@ -311,16 +313,16 @@ static void prism2_info_hostscanresults(local_info_t *local,
 	wake_up_interruptible(&local->hostscan_wq);
 
 	if (left < 4) {
-		printk(KERN_DEBUG "%s: invalid hostscanresult info frame "
-		       "length %d\n", local->dev->name, left);
+		pr_debug("%s: invalid hostscanresult info frame length %d\n",
+			 local->dev->name, left);
 		return;
 	}
 
 	pos = (__le16 *) buf;
 	copy_len = result_size = le16_to_cpu(*pos);
 	if (result_size == 0) {
-		printk(KERN_DEBUG "%s: invalid result_size (0) in "
-		       "hostscanresults\n", local->dev->name);
+		pr_debug("%s: invalid result_size (0) in hostscanresults\n",
+			 local->dev->name);
 		return;
 	}
 	if (copy_len > sizeof(struct hfa384x_hostscan_result))
@@ -344,8 +346,8 @@ static void prism2_info_hostscanresults(local_info_t *local,
 	}
 
 	if (left) {
-		printk(KERN_DEBUG "%s: short HostScan result entry (%d/%d)\n",
-		       local->dev->name, left, result_size);
+		pr_debug("%s: short HostScan result entry (%d/%d)\n",
+			 local->dev->name, left, result_size);
 	}
 
 	spin_lock_irqsave(&local->lock, flags);
@@ -423,8 +425,8 @@ static void handle_info_queue_linkstatus(local_info_t *local)
 
 	if (local->func->get_rid(local->dev, HFA384X_RID_CURRENTBSSID,
 				 local->bssid, ETH_ALEN, 1) < 0) {
-		printk(KERN_DEBUG "%s: could not read CURRENTBSSID after "
-		       "LinkStatus event\n", local->dev->name);
+		pr_debug("%s: could not read CURRENTBSSID after LinkStatus event\n",
+			 local->dev->name);
 	} else {
 		PDEBUG(DEBUG_EXTRA, "%s: LinkStatus: BSSID=%pM\n",
 		       local->dev->name,
diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c
index 18054d9..c638047 100644
--- a/drivers/net/wireless/hostap/hostap_ioctl.c
+++ b/drivers/net/wireless/hostap/hostap_ioctl.c
@@ -1,5 +1,7 @@
 /* ioctl() (mostly Linux Wireless Extensions) routines for Host AP driver */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/slab.h>
 #include <linux/types.h>
 #include <linux/sched.h>
@@ -173,9 +175,8 @@ static int prism2_ioctl_siwencode(struct net_device *dev,
 			kfree(new_crypt);
 			new_crypt = NULL;
 
-			printk(KERN_WARNING "%s: could not initialize WEP: "
-			       "load module hostap_crypt_wep.o\n",
-			       dev->name);
+			pr_warn("%s: could not initialize WEP: load module hostap_crypt_wep.o\n",
+				dev->name);
 			return -EOPNOTSUPP;
 		}
 		*crypt = new_crypt;
@@ -204,7 +205,7 @@ static int prism2_ioctl_siwencode(struct net_device *dev,
 	local->open_wep = erq->flags & IW_ENCODE_OPEN;
 
 	if (hostap_set_encryption(local)) {
-		printk(KERN_DEBUG "%s: set_encryption failed\n", dev->name);
+		pr_debug("%s: set_encryption failed\n", dev->name);
 		return -EINVAL;
 	}
 
@@ -214,7 +215,7 @@ static int prism2_ioctl_siwencode(struct net_device *dev,
 	 * after WEP configuration. However, keys are apparently changed at
 	 * least in Managed mode. */
 	if (local->iw_mode != IW_MODE_INFRA && local->func->reset_port(dev)) {
-		printk(KERN_DEBUG "%s: reset_port failed\n", dev->name);
+		pr_debug("%s: reset_port failed\n", dev->name);
 		return -EINVAL;
 	}
 
@@ -295,17 +296,15 @@ static int hostap_set_rate(struct net_device *dev)
 
 	basic_rates = local->basic_rates & local->tx_rate_control;
 	if (!basic_rates || basic_rates != local->basic_rates) {
-		printk(KERN_INFO "%s: updating basic rate set automatically "
-		       "to match with the new supported rate set\n",
-		       dev->name);
+		pr_info("%s: updating basic rate set automatically to match with the new supported rate set\n",
+			dev->name);
 		if (!basic_rates)
 			basic_rates = local->tx_rate_control;
 
 		local->basic_rates = basic_rates;
 		if (hostap_set_word(dev, HFA384X_RID_CNFBASICRATES,
 				    basic_rates))
-			printk(KERN_WARNING "%s: failed to set "
-			       "cnfBasicRates\n", dev->name);
+			pr_warn("%s: failed to set cnfBasicRates\n", dev->name);
 	}
 
 	ret = (hostap_set_word(dev, HFA384X_RID_TXRATECONTROL,
@@ -315,9 +314,8 @@ static int hostap_set_rate(struct net_device *dev)
 	       local->func->reset_port(dev));
 
 	if (ret) {
-		printk(KERN_WARNING "%s: TXRateControl/cnfSupportedRates "
-		       "setting to 0x%x failed\n",
-		       dev->name, local->tx_rate_control);
+		pr_warn("%s: TXRateControl/cnfSupportedRates setting to 0x%x failed\n",
+			dev->name, local->tx_rate_control);
 	}
 
 	/* Update TX rate configuration for all STAs based on new operational
@@ -505,8 +503,7 @@ static int prism2_ioctl_giwaplist(struct net_device *dev,
 	local = iface->local;
 
 	if (local->iw_mode != IW_MODE_MASTER) {
-		printk(KERN_DEBUG "SIOCGIWAPLIST is currently only supported "
-		       "in Host AP mode\n");
+		pr_debug("SIOCGIWAPLIST is currently only supported in Host AP mode\n");
 		data->length = 0;
 		return -EOPNOTSUPP;
 	}
@@ -663,13 +660,13 @@ static int hostap_join_ap(struct net_device *dev)
 
 	if (local->func->set_rid(dev, HFA384X_RID_JOINREQUEST, &req,
 				 sizeof(req))) {
-		printk(KERN_DEBUG "%s: JoinRequest %pM failed\n",
-		       dev->name, local->preferred_ap);
+		pr_debug("%s: JoinRequest %pM failed\n",
+			 dev->name, local->preferred_ap);
 		return -1;
 	}
 
-	printk(KERN_DEBUG "%s: Trying to join BSSID %pM\n",
-	       dev->name, local->preferred_ap);
+	pr_debug("%s: Trying to join BSSID %pM\n",
+		 dev->name, local->preferred_ap);
 
 	return 0;
 }
@@ -698,18 +695,16 @@ static int prism2_ioctl_siwap(struct net_device *dev,
 		scan_req.txrate = cpu_to_le16(HFA384X_RATES_1MBPS);
 		if (local->func->set_rid(dev, HFA384X_RID_SCANREQUEST,
 					 &scan_req, sizeof(scan_req))) {
-			printk(KERN_DEBUG "%s: ScanResults request failed - "
-			       "preferred AP delayed to next unsolicited "
-			       "scan\n", dev->name);
+			pr_debug("%s: ScanResults request failed - preferred AP delayed to next unsolicited scan\n",
+				 dev->name);
 		}
 	} else if (local->host_roaming == 2 &&
 		   local->iw_mode == IW_MODE_INFRA) {
 		if (hostap_join_ap(dev))
 			return -EINVAL;
 	} else {
-		printk(KERN_DEBUG "%s: Preferred AP (SIOCSIWAP) is used only "
-		       "in Managed mode when host_roaming is enabled\n",
-		       dev->name);
+		pr_debug("%s: Preferred AP (SIOCSIWAP) is used only in Managed mode when host_roaming is enabled\n",
+			 dev->name);
 	}
 
 	return 0;
@@ -900,8 +895,8 @@ static int prism2_ioctl_siwessid(struct net_device *dev,
 	if (local->iw_mode == IW_MODE_MASTER && ssid[0] == '\0') {
 		/* Setting SSID to empty string seems to kill the card in
 		 * Host AP mode */
-		printk(KERN_DEBUG "%s: Host AP mode does not support "
-		       "'Any' essid\n", dev->name);
+		pr_debug("%s: Host AP mode does not support 'Any' essid\n",
+			 dev->name);
 		return -EINVAL;
 	}
 
@@ -1078,13 +1073,12 @@ static int hostap_monitor_mode_enable(local_info_t *local)
 {
 	struct net_device *dev = local->dev;
 
-	printk(KERN_DEBUG "Enabling monitor mode\n");
+	pr_debug("Enabling monitor mode\n");
 	hostap_monitor_set_type(local);
 
 	if (hostap_set_word(dev, HFA384X_RID_CNFPORTTYPE,
 			    HFA384X_PORTTYPE_PSEUDO_IBSS)) {
-		printk(KERN_DEBUG "Port type setting for monitor mode "
-		       "failed\n");
+		pr_debug("Port type setting for monitor mode failed\n");
 		return -EOPNOTSUPP;
 	}
 
@@ -1094,7 +1088,7 @@ static int hostap_monitor_mode_enable(local_info_t *local)
 	if (hostap_set_word(dev, HFA384X_RID_CNFWEPFLAGS,
 			    HFA384X_WEPFLAGS_HOSTENCRYPT |
 			    HFA384X_WEPFLAGS_HOSTDECRYPT)) {
-		printk(KERN_DEBUG "WEP flags setting failed\n");
+		pr_debug("WEP flags setting failed\n");
 		return -EOPNOTSUPP;
 	}
 
@@ -1102,7 +1096,7 @@ static int hostap_monitor_mode_enable(local_info_t *local)
 	    local->func->cmd(dev, HFA384X_CMDCODE_TEST |
 			     (HFA384X_TEST_MONITOR << 8),
 			     0, NULL, NULL)) {
-		printk(KERN_DEBUG "Setting monitor mode failed\n");
+		pr_debug("Setting monitor mode failed\n");
 		return -EOPNOTSUPP;
 	}
 
@@ -1117,7 +1111,7 @@ static int hostap_monitor_mode_disable(local_info_t *local)
 	if (dev == NULL)
 		return -1;
 
-	printk(KERN_DEBUG "%s: Disabling monitor mode\n", dev->name);
+	pr_debug("%s: Disabling monitor mode\n", dev->name);
 	dev->type = ARPHRD_ETHER;
 
 	if (local->func->cmd(dev, HFA384X_CMDCODE_TEST |
@@ -1153,8 +1147,8 @@ static int prism2_ioctl_siwmode(struct net_device *dev,
 		return 0;
 
 	if (*mode == IW_MODE_MASTER && local->essid[0] == '\0') {
-		printk(KERN_WARNING "%s: empty SSID not allowed in Master "
-		       "mode\n", dev->name);
+		pr_warn("%s: empty SSID not allowed in Master mode\n",
+			dev->name);
 		return -EINVAL;
 	}
 
@@ -1170,17 +1164,16 @@ static int prism2_ioctl_siwmode(struct net_device *dev,
 		double_reset = 1;
 	}
 
-	printk(KERN_DEBUG "prism2: %s: operating mode changed "
-	       "%d -> %d\n", dev->name, local->iw_mode, *mode);
+	pr_debug("prism2: %s: operating mode changed %d -> %d\n",
+		 dev->name, local->iw_mode, *mode);
 	local->iw_mode = *mode;
 
 	if (local->iw_mode == IW_MODE_MONITOR)
 		hostap_monitor_mode_enable(local);
 	else if (local->iw_mode == IW_MODE_MASTER && !local->host_encrypt &&
 		 !local->fw_encrypt_ok) {
-		printk(KERN_DEBUG "%s: defaulting to host-based encryption as "
-		       "a workaround for firmware bug in Host AP mode WEP\n",
-		       dev->name);
+		pr_debug("%s: defaulting to host-based encryption as a workaround for firmware bug in Host AP mode WEP\n",
+			 dev->name);
 		local->host_encrypt = 1;
 	}
 
@@ -1370,9 +1363,8 @@ static int prism2_ioctl_siwretry(struct net_device *dev,
 		} else {
 			if (hostap_set_word(dev, HFA384X_RID_CNFALTRETRYCOUNT,
 					    rrq->value)) {
-				printk(KERN_DEBUG "%s: Alternate retry count "
-				       "setting to %d failed\n",
-				       dev->name, rrq->value);
+				pr_debug("%s: Alternate retry count setting to %d failed\n",
+					 dev->name, rrq->value);
 				return -EOPNOTSUPP;
 			}
 
@@ -1522,8 +1514,8 @@ static int prism2_ioctl_siwtxpow(struct net_device *dev,
 			ret = local->func->cmd(dev, HFA384X_CMDCODE_WRITEMIF,
 					       HFA386X_CR_A_D_TEST_MODES2,
 					       &val, NULL);
-			printk(KERN_DEBUG "%s: Turning radio off: %s\n",
-			       dev->name, ret ? "failed" : "OK");
+			pr_debug("%s: Turning radio off: %s\n",
+				 dev->name, ret ? "failed" : "OK");
 			local->txpower_type = PRISM2_TXPOWER_OFF;
 		}
 		return (ret ? -EOPNOTSUPP : 0);
@@ -1533,14 +1525,14 @@ static int prism2_ioctl_siwtxpow(struct net_device *dev,
 		val = 0; /* disable all standby and sleep modes */
 		ret = local->func->cmd(dev, HFA384X_CMDCODE_WRITEMIF,
 				       HFA386X_CR_A_D_TEST_MODES2, &val, NULL);
-		printk(KERN_DEBUG "%s: Turning radio on: %s\n",
-		       dev->name, ret ? "failed" : "OK");
+		pr_debug("%s: Turning radio on: %s\n",
+			 dev->name, ret ? "failed" : "OK");
 		local->txpower_type = PRISM2_TXPOWER_UNKNOWN;
 	}
 
 #ifdef RAW_TXPOWER_SETTING
 	if (!rrq->fixed && local->txpower_type != PRISM2_TXPOWER_AUTO) {
-		printk(KERN_DEBUG "Setting ALC on\n");
+		pr_debug("Setting ALC on\n");
 		val = HFA384X_TEST_CFG_BIT_ALC;
 		local->func->cmd(dev, HFA384X_CMDCODE_TEST |
 				 (HFA384X_TEST_CFG_BITS << 8), 1, &val, NULL);
@@ -1549,7 +1541,7 @@ static int prism2_ioctl_siwtxpow(struct net_device *dev,
 	}
 
 	if (local->txpower_type != PRISM2_TXPOWER_FIXED) {
-		printk(KERN_DEBUG "Setting ALC off\n");
+		pr_debug("Setting ALC off\n");
 		val = HFA384X_TEST_CFG_BIT_ALC;
 		local->func->cmd(dev, HFA384X_CMDCODE_TEST |
 				 (HFA384X_TEST_CFG_BITS << 8), 0, &val, NULL);
@@ -1562,7 +1554,7 @@ static int prism2_ioctl_siwtxpow(struct net_device *dev,
 		tmp = "mW";
 	else
 		tmp = "UNKNOWN";
-	printk(KERN_DEBUG "Setting TX power to %d %s\n", rrq->value, tmp);
+	pr_debug("Setting TX power to %d %s\n", rrq->value, tmp);
 
 	if (rrq->flags != IW_TXPOW_DBM) {
 		printk("SIOCSIWTXPOW with mW is not supported; use dBm\n");
@@ -1652,7 +1644,7 @@ static int prism2_request_hostscan(struct net_device *dev,
 
 	if (local->func->set_rid(dev, HFA384X_RID_HOSTSCAN, &scan_req,
 				 sizeof(scan_req))) {
-		printk(KERN_DEBUG "%s: HOSTSCAN failed\n", dev->name);
+		pr_debug("%s: HOSTSCAN failed\n", dev->name);
 		return -EINVAL;
 	}
 	return 0;
@@ -1689,7 +1681,7 @@ static int prism2_request_scan(struct net_device *dev)
 
 	if (local->func->set_rid(dev, HFA384X_RID_SCANREQUEST, &scan_req,
 				 sizeof(scan_req))) {
-		printk(KERN_DEBUG "SCANREQUEST failed\n");
+		pr_debug("SCANREQUEST failed\n");
 		ret = -EINVAL;
 	}
 
@@ -2087,14 +2079,13 @@ static int prism2_ioctl_giwscan(struct net_device *dev,
 		/* Translate to WE format */
 		res = prism2_ap_translate_scan(dev, info, extra);
 		if (res >= 0) {
-			printk(KERN_DEBUG "Scan result translation succeeded "
-			       "(length=%d)\n", res);
+			pr_debug("Scan result translation succeeded (length=%d)\n",
+				 res);
 			data->length = res;
 			return 0;
 		} else {
-			printk(KERN_DEBUG
-			       "Scan result translation failed (res=%d)\n",
-			       res);
+			pr_debug("Scan result translation failed (res=%d)\n",
+				 res);
 			data->length = 0;
 			return res;
 		}
@@ -2349,8 +2340,8 @@ static int prism2_ioctl_priv_prism2_param(struct net_device *dev,
 			break;
 		}
 
-		printk(KERN_DEBUG "prism2: %s: pseudo IBSS change %d -> %d\n",
-		       dev->name, local->pseudo_adhoc, value);
+		pr_debug("prism2: %s: pseudo IBSS change %d -> %d\n",
+			 dev->name, local->pseudo_adhoc, value);
 		local->pseudo_adhoc = value;
 		if (local->iw_mode != IW_MODE_ADHOC)
 			break;
@@ -2367,8 +2358,8 @@ static int prism2_ioctl_priv_prism2_param(struct net_device *dev,
 #endif /* PRISM2_NO_STATION_MODES */
 
 	case PRISM2_PARAM_ALC:
-		printk(KERN_DEBUG "%s: %s ALC\n", dev->name,
-		       value == 0 ? "Disabling" : "Enabling");
+		pr_debug("%s: %s ALC\n",
+			 dev->name, value == 0 ? "Disabling" : "Enabling");
 		val = HFA384X_TEST_CFG_BIT_ALC;
 		local->func->cmd(dev, HFA384X_CMDCODE_TEST |
 				 (HFA384X_TEST_CFG_BITS << 8),
@@ -2533,13 +2524,12 @@ static int prism2_ioctl_priv_prism2_param(struct net_device *dev,
 			if (hostap_set_word(dev, HFA384X_RID_CNFPORTTYPE,
 					    HFA384X_PORTTYPE_BSS) ||
 			    local->func->reset_port(dev))
-				printk(KERN_DEBUG "Leaving Host AP mode "
-				       "for HostScan failed\n");
+				pr_debug("Leaving Host AP mode for HostScan failed\n");
 		}
 
 		if (local->func->set_rid(dev, HFA384X_RID_HOSTSCAN, &scan_req,
 					 sizeof(scan_req))) {
-			printk(KERN_DEBUG "HOSTSCAN failed\n");
+			pr_debug("HOSTSCAN failed\n");
 			ret = -EINVAL;
 		}
 		if (local->iw_mode == IW_MODE_MASTER) {
@@ -2556,8 +2546,7 @@ static int prism2_ioctl_priv_prism2_param(struct net_device *dev,
 			if (hostap_set_word(dev, HFA384X_RID_CNFPORTTYPE,
 					    HFA384X_PORTTYPE_HOSTAP) ||
 			    local->func->reset_port(dev))
-				printk(KERN_DEBUG "Returning to Host AP mode "
-				       "after HostScan failed\n");
+				pr_debug("Returning to Host AP mode after HostScan failed\n");
 		}
 		break;
 	}
@@ -2582,8 +2571,8 @@ static int prism2_ioctl_priv_prism2_param(struct net_device *dev,
 		if (hostap_set_word(dev, HFA384X_RID_CNFENHSECURITY,
 				    local->enh_sec) ||
 		    local->func->reset_port(dev)) {
-			printk(KERN_INFO "%s: cnfEnhSecurity requires STA f/w "
-			       "1.6.3 or newer\n", dev->name);
+			pr_info("%s: cnfEnhSecurity requires STA f/w 1.6.3 or newer\n",
+				dev->name);
 			ret = -EOPNOTSUPP;
 		}
 		break;
@@ -2596,9 +2585,8 @@ static int prism2_ioctl_priv_prism2_param(struct net_device *dev,
 
 	case PRISM2_PARAM_BASIC_RATES:
 		if ((value & local->tx_rate_control) != value || value == 0) {
-			printk(KERN_INFO "%s: invalid basic rate set - basic "
-			       "rates must be in supported rate set\n",
-			       dev->name);
+			pr_info("%s: invalid basic rate set - basic rates must be in supported rate set\n",
+				dev->name);
 			ret = -EINVAL;
 			break;
 		}
@@ -2652,8 +2640,8 @@ static int prism2_ioctl_priv_prism2_param(struct net_device *dev,
 		break;
 
 	default:
-		printk(KERN_DEBUG "%s: prism2_param: unknown param %d\n",
-		       dev->name, param);
+		pr_debug("%s: prism2_param: unknown param %d\n",
+			 dev->name, param);
 		ret = -EOPNOTSUPP;
 		break;
 	}
@@ -2839,8 +2827,8 @@ static int prism2_ioctl_priv_get_prism2_param(struct net_device *dev,
 		break;
 
 	default:
-		printk(KERN_DEBUG "%s: get_prism2_param: unknown param %d\n",
-		       dev->name, *param);
+		pr_debug("%s: get_prism2_param: unknown param %d\n",
+			 dev->name, *param);
 		ret = -EOPNOTSUPP;
 		break;
 	}
@@ -2900,9 +2888,8 @@ static int prism2_ioctl_priv_monitor(struct net_device *dev, int *i)
 	iface = netdev_priv(dev);
 	local = iface->local;
 
-	printk(KERN_DEBUG "%s: process %d (%s) used deprecated iwpriv monitor "
-	       "- update software to use iwconfig mode monitor\n",
-	       dev->name, task_pid_nr(current), current->comm);
+	pr_debug("%s: process %d (%s) used deprecated iwpriv monitor - update software to use iwconfig mode monitor\n",
+		 dev->name, task_pid_nr(current), current->comm);
 
 	/* Backward compatibility code - this can be removed at some point */
 
@@ -2944,7 +2931,7 @@ static int prism2_ioctl_priv_reset(struct net_device *dev, int *i)
 	iface = netdev_priv(dev);
 	local = iface->local;
 
-	printk(KERN_DEBUG "%s: manual reset request(%d)\n", dev->name, *i);
+	pr_debug("%s: manual reset request(%d)\n", dev->name, *i);
 	switch (*i) {
 	case 0:
 		/* Disable and enable card */
@@ -2976,7 +2963,7 @@ static int prism2_ioctl_priv_reset(struct net_device *dev, int *i)
 		break;
 
 	default:
-		printk(KERN_DEBUG "Unknown reset request %d\n", *i);
+		pr_debug("Unknown reset request %d\n", *i);
 		return -EOPNOTSUPP;
 	}
 
@@ -2989,7 +2976,7 @@ static int prism2_ioctl_priv_set_rid_word(struct net_device *dev, int *i)
 	int rid = *i;
 	int value = *(i + 1);
 
-	printk(KERN_DEBUG "%s: Set RID[0x%X] = %d\n", dev->name, rid, value);
+	pr_debug("%s: Set RID[0x%X] = %d\n", dev->name, rid, value);
 
 	if (hostap_set_word(dev, rid, value))
 		return -EINVAL;
@@ -3264,8 +3251,8 @@ static int prism2_ioctl_siwencodeext(struct net_device *dev,
 		module = "lib80211_crypt_ccmp";
 		break;
 	default:
-		printk(KERN_DEBUG "%s: unsupported algorithm %d\n",
-		       local->dev->name, ext->alg);
+		pr_debug("%s: unsupported algorithm %d\n",
+			 local->dev->name, ext->alg);
 		ret = -EOPNOTSUPP;
 		goto done;
 	}
@@ -3276,8 +3263,8 @@ static int prism2_ioctl_siwencodeext(struct net_device *dev,
 		ops = lib80211_get_crypto_ops(alg);
 	}
 	if (ops == NULL) {
-		printk(KERN_DEBUG "%s: unknown crypto alg '%s'\n",
-		       local->dev->name, alg);
+		pr_debug("%s: unknown crypto alg '%s'\n",
+			 local->dev->name, alg);
 		ret = -EOPNOTSUPP;
 		goto done;
 	}
@@ -3324,8 +3311,7 @@ static int prism2_ioctl_siwencodeext(struct net_device *dev,
 	    && (*crypt)->ops->set_key &&
 	    (*crypt)->ops->set_key(ext->key, ext->key_len, ext->rx_seq,
 				   (*crypt)->priv) < 0) {
-		printk(KERN_DEBUG "%s: key setting failed\n",
-		       local->dev->name);
+		pr_debug("%s: key setting failed\n", local->dev->name);
 		ret = -EINVAL;
 		goto done;
 	}
@@ -3497,8 +3483,8 @@ static int prism2_ioctl_set_encryption(local_info_t *local,
 		ops = lib80211_get_crypto_ops(param->u.crypt.alg);
 	}
 	if (ops == NULL) {
-		printk(KERN_DEBUG "%s: unknown crypto alg '%s'\n",
-		       local->dev->name, param->u.crypt.alg);
+		pr_debug("%s: unknown crypto alg '%s'\n",
+			 local->dev->name, param->u.crypt.alg);
 		param->u.crypt.err = HOSTAP_CRYPT_ERR_UNKNOWN_ALG;
 		ret = -EINVAL;
 		goto done;
@@ -3537,8 +3523,7 @@ static int prism2_ioctl_set_encryption(local_info_t *local,
 	    (*crypt)->ops->set_key(param->u.crypt.key,
 				   param->u.crypt.key_len, param->u.crypt.seq,
 				   (*crypt)->priv) < 0) {
-		printk(KERN_DEBUG "%s: key setting failed\n",
-		       local->dev->name);
+		pr_debug("%s: key setting failed\n", local->dev->name);
 		param->u.crypt.err = HOSTAP_CRYPT_ERR_KEY_SET_FAILED;
 		ret = -EINVAL;
 		goto done;
@@ -3548,8 +3533,8 @@ static int prism2_ioctl_set_encryption(local_info_t *local,
 		if (!sta_ptr)
 			local->crypt_info.tx_keyidx = param->u.crypt.idx;
 		else if (param->u.crypt.idx) {
-			printk(KERN_DEBUG "%s: TX key idx setting failed\n",
-			       local->dev->name);
+			pr_debug("%s: TX key idx setting failed\n",
+				 local->dev->name);
 			param->u.crypt.err =
 				HOSTAP_CRYPT_ERR_TX_KEY_SET_FAILED;
 			ret = -EINVAL;
@@ -3677,8 +3662,8 @@ static int prism2_ioctl_set_assoc_ap_addr(local_info_t *local,
 					  struct prism2_hostapd_param *param,
 					  int param_len)
 {
-	printk(KERN_DEBUG "%ssta: associated as client with AP %pM\n",
-	       local->dev->name, param->sta_addr);
+	pr_debug("%ssta: associated as client with AP %pM\n",
+		 local->dev->name, param->sta_addr);
 	memcpy(local->assoc_ap_addr, param->sta_addr, ETH_ALEN);
 	return 0;
 }
diff --git a/drivers/net/wireless/hostap/hostap_main.c b/drivers/net/wireless/hostap/hostap_main.c
index 627bc12..643c003 100644
--- a/drivers/net/wireless/hostap/hostap_main.c
+++ b/drivers/net/wireless/hostap/hostap_main.c
@@ -12,6 +12,8 @@
  * more details.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
@@ -86,14 +88,12 @@ struct net_device * hostap_add_interface(struct local_info *local,
 		rtnl_unlock();
 
 	if (ret < 0) {
-		printk(KERN_WARNING "%s: failed to add new netdevice!\n",
-		       dev->name);
+		pr_warn("%s: failed to add new netdevice!\n", dev->name);
 		free_netdev(dev);
 		return NULL;
 	}
 
-	printk(KERN_DEBUG "%s: registered netdevice %s\n",
-	       mdev->name, dev->name);
+	pr_debug("%s: registered netdevice %s\n", mdev->name, dev->name);
 
 	return dev;
 }
@@ -165,8 +165,8 @@ int prism2_wds_add(local_info_t *local, u8 *remote_addr,
 		/* take pre-allocated entry into use */
 		memcpy(empty->u.wds.remote_addr, remote_addr, ETH_ALEN);
 		read_unlock_bh(&local->iface_lock);
-		printk(KERN_DEBUG "%s: using pre-allocated WDS netdevice %s\n",
-		       local->dev->name, empty->dev->name);
+		pr_debug("%s: using pre-allocated WDS netdevice %s\n",
+			 local->dev->name, empty->dev->name);
 		return 0;
 	}
 	read_unlock_bh(&local->iface_lock);
@@ -182,8 +182,7 @@ int prism2_wds_add(local_info_t *local, u8 *remote_addr,
 
 	/* verify that there is room for wds# postfix in the interface name */
 	if (strlen(local->dev->name) >= IFNAMSIZ - 5) {
-		printk(KERN_DEBUG "'%s' too long base device name\n",
-		       local->dev->name);
+		pr_debug("'%s' too long base device name\n", local->dev->name);
 		return -EINVAL;
 	}
 
@@ -347,7 +346,7 @@ int hostap_set_encryption(local_info_t *local)
 
 	if (local->func->get_rid(local->dev, HFA384X_RID_CNFWEPFLAGS, &val, 2,
 				 1) < 0) {
-		printk(KERN_DEBUG "Could not read current WEP flags.\n");
+		pr_debug("Could not read current WEP flags\n");
 		goto fail;
 	}
 	le16_to_cpus(&val);
@@ -377,8 +376,7 @@ int hostap_set_encryption(local_info_t *local)
 
 	if (val != old_val &&
 	    hostap_set_word(local->dev, HFA384X_RID_CNFWEPFLAGS, val)) {
-		printk(KERN_DEBUG "Could not write new WEP flags (0x%x)\n",
-		       val);
+		pr_debug("Could not write new WEP flags (0x%x)\n", val);
 		goto fail;
 	}
 
@@ -403,20 +401,20 @@ int hostap_set_encryption(local_info_t *local)
 		if (local->func->set_rid(local->dev,
 					 HFA384X_RID_CNFDEFAULTKEY0 + i,
 					 keybuf, keylen)) {
-			printk(KERN_DEBUG "Could not set key %d (len=%d)\n",
-			       i, keylen);
+			pr_debug("Could not set key %d (len=%d)\n",
+				 i, keylen);
 			goto fail;
 		}
 	}
 	if (hostap_set_word(local->dev, HFA384X_RID_CNFWEPDEFAULTKEYID, idx)) {
-		printk(KERN_DEBUG "Could not set default keyid %d\n", idx);
+		pr_debug("Could not set default keyid %d\n", idx);
 		goto fail;
 	}
 
 	return 0;
 
  fail:
-	printk(KERN_DEBUG "%s: encryption setup failed\n", local->dev->name);
+	pr_debug("%s: encryption setup failed\n", local->dev->name);
 	return -1;
 }
 
@@ -444,8 +442,8 @@ int hostap_set_antsel(local_info_t *local)
 
 		if (local->func->cmd(local->dev, HFA384X_CMDCODE_WRITEMIF,
 				     HFA386X_CR_TX_CONFIGURE, &val, NULL)) {
-			printk(KERN_INFO "%s: setting TX AntSel failed\n",
-			       local->dev->name);
+			pr_info("%s: setting TX AntSel failed\n",
+				local->dev->name);
 			ret = -1;
 		}
 	}
@@ -468,8 +466,8 @@ int hostap_set_antsel(local_info_t *local)
 
 		if (local->func->cmd(local->dev, HFA384X_CMDCODE_WRITEMIF,
 				     HFA386X_CR_RX_CONFIGURE, &val, NULL)) {
-			printk(KERN_INFO "%s: setting RX AntSel failed\n",
-			       local->dev->name);
+			pr_info("%s: setting RX AntSel failed\n",
+				local->dev->name);
 			ret = -1;
 		}
 	}
@@ -512,8 +510,8 @@ int hostap_set_auth_algs(local_info_t *local)
 		val = PRISM2_AUTH_OPEN;
 
 	if (hostap_set_word(local->dev, HFA384X_RID_CNFAUTHENTICATION, val)) {
-		printk(KERN_INFO "%s: cnfAuthentication setting to 0x%x "
-		       "failed\n", local->dev->name, local->auth_algs);
+		pr_info("%s: cnfAuthentication setting to 0x%x failed\n",
+			local->dev->name, local->auth_algs);
 		return -EINVAL;
 	}
 
@@ -527,28 +525,24 @@ void hostap_dump_rx_header(const char *name, const struct hfa384x_rx_frame *rx)
 
 	status = __le16_to_cpu(rx->status);
 
-	printk(KERN_DEBUG "%s: RX status=0x%04x (port=%d, type=%d, "
-	       "fcserr=%d) silence=%d signal=%d rate=%d rxflow=%d; "
-	       "jiffies=%ld\n",
-	       name, status, (status >> 8) & 0x07, status >> 13, status & 1,
-	       rx->silence, rx->signal, rx->rate, rx->rxflow, jiffies);
+	pr_debug("%s: RX status=0x%04x (port=%d, type=%d, fcserr=%d) silence=%d signal=%d rate=%d rxflow=%d; jiffies=%ld\n",
+		 name, status, (status >> 8) & 0x07, status >> 13, status & 1,
+		 rx->silence, rx->signal, rx->rate, rx->rxflow, jiffies);
 
 	fc = __le16_to_cpu(rx->frame_control);
-	printk(KERN_DEBUG "   FC=0x%04x (type=%d:%d) dur=0x%04x seq=0x%04x "
-	       "data_len=%d%s%s\n",
-	       fc, (fc & IEEE80211_FCTL_FTYPE) >> 2,
-	       (fc & IEEE80211_FCTL_STYPE) >> 4,
-	       __le16_to_cpu(rx->duration_id), __le16_to_cpu(rx->seq_ctrl),
-	       __le16_to_cpu(rx->data_len),
-	       fc & IEEE80211_FCTL_TODS ? " [ToDS]" : "",
-	       fc & IEEE80211_FCTL_FROMDS ? " [FromDS]" : "");
-
-	printk(KERN_DEBUG "   A1=%pM A2=%pM A3=%pM A4=%pM\n",
-	       rx->addr1, rx->addr2, rx->addr3, rx->addr4);
-
-	printk(KERN_DEBUG "   dst=%pM src=%pM len=%d\n",
-	       rx->dst_addr, rx->src_addr,
-	       __be16_to_cpu(rx->len));
+	pr_debug("   FC=0x%04x (type=%d:%d) dur=0x%04x seq=0x%04x data_len=%d%s%s\n",
+		 fc, (fc & IEEE80211_FCTL_FTYPE) >> 2,
+		 (fc & IEEE80211_FCTL_STYPE) >> 4,
+		 __le16_to_cpu(rx->duration_id), __le16_to_cpu(rx->seq_ctrl),
+		 __le16_to_cpu(rx->data_len),
+		 fc & IEEE80211_FCTL_TODS ? " [ToDS]" : "",
+		 fc & IEEE80211_FCTL_FROMDS ? " [FromDS]" : "");
+
+	pr_debug("   A1=%pM A2=%pM A3=%pM A4=%pM\n",
+		 rx->addr1, rx->addr2, rx->addr3, rx->addr4);
+
+	pr_debug("   dst=%pM src=%pM len=%d\n",
+		 rx->dst_addr, rx->src_addr, __be16_to_cpu(rx->len));
 }
 
 
@@ -556,27 +550,24 @@ void hostap_dump_tx_header(const char *name, const struct hfa384x_tx_frame *tx)
 {
 	u16 fc;
 
-	printk(KERN_DEBUG "%s: TX status=0x%04x retry_count=%d tx_rate=%d "
-	       "tx_control=0x%04x; jiffies=%ld\n",
-	       name, __le16_to_cpu(tx->status), tx->retry_count, tx->tx_rate,
-	       __le16_to_cpu(tx->tx_control), jiffies);
+	pr_debug("%s: TX status=0x%04x retry_count=%d tx_rate=%d tx_control=0x%04x; jiffies=%ld\n",
+		 name, __le16_to_cpu(tx->status), tx->retry_count, tx->tx_rate,
+		 __le16_to_cpu(tx->tx_control), jiffies);
 
 	fc = __le16_to_cpu(tx->frame_control);
-	printk(KERN_DEBUG "   FC=0x%04x (type=%d:%d) dur=0x%04x seq=0x%04x "
-	       "data_len=%d%s%s\n",
-	       fc, (fc & IEEE80211_FCTL_FTYPE) >> 2,
-	       (fc & IEEE80211_FCTL_STYPE) >> 4,
-	       __le16_to_cpu(tx->duration_id), __le16_to_cpu(tx->seq_ctrl),
-	       __le16_to_cpu(tx->data_len),
-	       fc & IEEE80211_FCTL_TODS ? " [ToDS]" : "",
-	       fc & IEEE80211_FCTL_FROMDS ? " [FromDS]" : "");
-
-	printk(KERN_DEBUG "   A1=%pM A2=%pM A3=%pM A4=%pM\n",
-	       tx->addr1, tx->addr2, tx->addr3, tx->addr4);
-
-	printk(KERN_DEBUG "   dst=%pM src=%pM len=%d\n",
-	       tx->dst_addr, tx->src_addr,
-	       __be16_to_cpu(tx->len));
+	pr_debug("   FC=0x%04x (type=%d:%d) dur=0x%04x seq=0x%04x data_len=%d%s%s\n",
+		 fc, (fc & IEEE80211_FCTL_FTYPE) >> 2,
+		 (fc & IEEE80211_FCTL_STYPE) >> 4,
+		 __le16_to_cpu(tx->duration_id), __le16_to_cpu(tx->seq_ctrl),
+		 __le16_to_cpu(tx->data_len),
+		 fc & IEEE80211_FCTL_TODS ? " [ToDS]" : "",
+		 fc & IEEE80211_FCTL_FROMDS ? " [FromDS]" : "");
+
+	pr_debug("   A1=%pM A2=%pM A3=%pM A4=%pM\n",
+		 tx->addr1, tx->addr2, tx->addr3, tx->addr4);
+
+	pr_debug("   dst=%pM src=%pM len=%d\n",
+		 tx->dst_addr, tx->src_addr, __be16_to_cpu(tx->len));
 }
 
 
@@ -665,8 +656,8 @@ static int prism2_open(struct net_device *dev)
 	local = iface->local;
 
 	if (local->no_pri) {
-		printk(KERN_DEBUG "%s: could not set interface UP - no PRI "
-		       "f/w\n", dev->name);
+		pr_debug("%s: could not set interface UP - no PRI f/w\n",
+			 dev->name);
 		return 1;
 	}
 
@@ -679,8 +670,7 @@ static int prism2_open(struct net_device *dev)
 	local->num_dev_open++;
 
 	if (!local->dev_enabled && local->func->hw_enable(dev, 1)) {
-		printk(KERN_WARNING "%s: could not enable MAC port\n",
-		       dev->name);
+		pr_warn("%s: could not enable MAC port\n", dev->name);
 		prism2_close(dev);
 		return 1;
 	}
@@ -738,8 +728,8 @@ void hostap_set_multicast_list_queue(struct work_struct *work)
 
 	if (hostap_set_word(dev, HFA384X_RID_PROMISCUOUSMODE,
 			    local->is_promisc)) {
-		printk(KERN_INFO "%s: %sabling promiscuous mode failed\n",
-		       dev->name, local->is_promisc ? "en" : "dis");
+		pr_info("%s: %sabling promiscuous mode failed\n",
+			dev->name, local->is_promisc ? "en" : "dis");
 	}
 }
 
@@ -786,14 +776,13 @@ static void prism2_tx_timeout(struct net_device *dev)
 	iface = netdev_priv(dev);
 	local = iface->local;
 
-	printk(KERN_WARNING "%s Tx timed out! Resetting card\n", dev->name);
+	pr_warn("%s Tx timed out! Resetting card\n", dev->name);
 	netif_stop_queue(local->dev);
 
 	local->func->read_regs(dev, &regs);
-	printk(KERN_DEBUG "%s: CMD=%04x EVSTAT=%04x "
-	       "OFFSET0=%04x OFFSET1=%04x SWSUPPORT0=%04x\n",
-	       dev->name, regs.cmd, regs.evstat, regs.offset0, regs.offset1,
-	       regs.swsupport0);
+	pr_debug("%s: CMD=%04x EVSTAT=%04x OFFSET0=%04x OFFSET1=%04x SWSUPPORT0=%04x\n",
+		 dev->name, regs.cmd, regs.evstat, regs.offset0, regs.offset1,
+		 regs.swsupport0);
 
 	local->func->schedule_reset(local);
 }
@@ -895,7 +884,7 @@ static int hostap_enable_hostapd(local_info_t *local, int rtnl_locked)
 	if (local->apdev)
 		return -EEXIST;
 
-	printk(KERN_DEBUG "%s: enabling hostapd mode\n", dev->name);
+	pr_debug("%s: enabling hostapd mode\n", dev->name);
 
 	local->apdev = hostap_add_interface(local, HOSTAP_INTERFACE_AP,
 					    rtnl_locked, local->ddev->name,
@@ -911,7 +900,7 @@ static int hostap_disable_hostapd(local_info_t *local, int rtnl_locked)
 {
 	struct net_device *dev = local->dev;
 
-	printk(KERN_DEBUG "%s: disabling hostapd mode\n", dev->name);
+	pr_debug("%s: disabling hostapd mode\n", dev->name);
 
 	hostap_remove_interface(local->apdev, rtnl_locked, 1);
 	local->apdev = NULL;
@@ -927,7 +916,7 @@ static int hostap_enable_hostapd_sta(local_info_t *local, int rtnl_locked)
 	if (local->stadev)
 		return -EEXIST;
 
-	printk(KERN_DEBUG "%s: enabling hostapd STA mode\n", dev->name);
+	pr_debug("%s: enabling hostapd STA mode\n", dev->name);
 
 	local->stadev = hostap_add_interface(local, HOSTAP_INTERFACE_STA,
 					     rtnl_locked, local->ddev->name,
@@ -943,7 +932,7 @@ static int hostap_disable_hostapd_sta(local_info_t *local, int rtnl_locked)
 {
 	struct net_device *dev = local->dev;
 
-	printk(KERN_DEBUG "%s: disabling hostapd mode\n", dev->name);
+	pr_debug("%s: disabling hostapd mode\n", dev->name);
 
 	hostap_remove_interface(local->stadev, rtnl_locked, 1);
 	local->stadev = NULL;
@@ -1103,8 +1092,7 @@ static int __init hostap_init(void)
 	if (init_net.proc_net != NULL) {
 		hostap_proc = proc_mkdir("hostap", init_net.proc_net);
 		if (!hostap_proc)
-			printk(KERN_WARNING "Failed to mkdir "
-			       "/proc/net/hostap\n");
+			pr_warn("Failed to mkdir /proc/net/hostap\n");
 	} else
 		hostap_proc = NULL;
 
diff --git a/drivers/net/wireless/hostap/hostap_pci.c b/drivers/net/wireless/hostap/hostap_pci.c
index 05ca340..e5bd77e 100644
--- a/drivers/net/wireless/hostap/hostap_pci.c
+++ b/drivers/net/wireless/hostap/hostap_pci.c
@@ -4,6 +4,8 @@
  * driver patches from Reyk Floeter <reyk@vantronix.net> and
  * Andy Warner <andyw@pobox.com> */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/if.h>
@@ -20,10 +22,6 @@
 
 #include "hostap_wlan.h"
 
-
-static char *dev_info = "hostap_pci";
-
-
 MODULE_AUTHOR("Jouni Malinen");
 MODULE_DESCRIPTION("Support for Intersil Prism2.5-based 802.11 wireless LAN "
 		   "PCI cards.");
@@ -226,7 +224,7 @@ static void prism2_pci_cor_sreset(local_info_t *local)
 	u16 reg;
 
 	reg = HFA384X_INB(HFA384X_PCICOR_OFF);
-	printk(KERN_DEBUG "%s: Original COR value: 0x%0x\n", dev->name, reg);
+	pr_debug("%s: Original COR value: 0x%0x\n", dev->name, reg);
 
 	/* linux-wlan-ng uses extremely long hold and settle times for
 	 * COR sreset. A comment in the driver code mentions that the long
@@ -260,7 +258,7 @@ static void prism2_pci_cor_sreset(local_info_t *local)
 #endif /* PRISM2_PCI_USE_LONG_DELAYS */
 
 	if (HFA384X_INW(HFA384X_CMD_OFF) & HFA384X_CMD_BUSY) {
-		printk(KERN_DEBUG "%s: COR sreset timeout\n", dev->name);
+		pr_debug("%s: COR sreset timeout\n", dev->name);
 	}
 }
 
@@ -309,13 +307,13 @@ static int prism2_pci_probe(struct pci_dev *pdev,
 	phymem = pci_resource_start(pdev, 0);
 
 	if (!request_mem_region(phymem, pci_resource_len(pdev, 0), "Prism2")) {
-		printk(KERN_ERR "prism2: Cannot reserve PCI memory region\n");
+		pr_err("prism2: Cannot reserve PCI memory region\n");
 		goto err_out_disable;
 	}
 
 	mem = pci_ioremap_bar(pdev, 0);
 	if (mem == NULL) {
-		printk(KERN_ERR "prism2: Cannot remap PCI memory region\n") ;
+		pr_err("prism2: Cannot remap PCI memory region\n") ;
 		goto fail;
 	}
 
@@ -338,19 +336,18 @@ static int prism2_pci_probe(struct pci_dev *pdev,
 
 	if (request_irq(dev->irq, prism2_interrupt, IRQF_SHARED, dev->name,
 			dev)) {
-		printk(KERN_WARNING "%s: request_irq failed\n", dev->name);
+		pr_warn("%s: request_irq failed\n", dev->name);
 		goto fail;
 	} else
 		irq_registered = 1;
 
 	if (!local->pri_only && prism2_hw_config(dev, 1)) {
-		printk(KERN_DEBUG "%s: hardware initialization failed\n",
-		       dev_info);
+		pr_debug("hardware initialization failed\n");
 		goto fail;
 	}
 
-	printk(KERN_INFO "%s: Intersil Prism2.5 PCI: "
-	       "mem=0x%lx, irq=%d\n", dev->name, phymem, dev->irq);
+	pr_info("%s: Intersil Prism2.5 PCI: mem=0x%lx, irq=%d\n",
+		dev->name, phymem, dev->irq);
 
 	return hostap_hw_ready(dev);
 
@@ -428,8 +425,7 @@ static int prism2_pci_resume(struct pci_dev *pdev)
 
 	err = pci_enable_device(pdev);
 	if (err) {
-		printk(KERN_ERR "%s: pci_enable_device failed on resume\n",
-		       dev->name);
+		pr_err("%s: pci_enable_device failed on resume\n", dev->name);
 		return err;
 	}
 	pci_restore_state(pdev);
diff --git a/drivers/net/wireless/hostap/hostap_plx.c b/drivers/net/wireless/hostap/hostap_plx.c
index c3d067e..4cf0cfa 100644
--- a/drivers/net/wireless/hostap/hostap_plx.c
+++ b/drivers/net/wireless/hostap/hostap_plx.c
@@ -6,6 +6,7 @@
  * - linux-wlan-ng driver, Copyright (C) AbsoluteValue Systems, Inc.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
 #include <linux/module.h>
 #include <linux/init.h>
@@ -23,10 +24,6 @@
 
 #include "hostap_wlan.h"
 
-
-static char *dev_info = "hostap_plx";
-
-
 MODULE_AUTHOR("Jouni Malinen");
 MODULE_DESCRIPTION("Support for Intersil Prism2-based 802.11 wireless LAN "
 		   "cards (PLX).");
@@ -269,8 +266,7 @@ static void prism2_plx_cor_sreset(local_info_t *local)
 	unsigned char corsave;
 	struct hostap_plx_priv *hw_priv = local->hw_priv;
 
-	printk(KERN_DEBUG "%s: Doing reset via direct COR access.\n",
-	       dev_info);
+	pr_debug("Doing reset via direct COR access\n");
 
 	/* Set sreset bit of COR and clear it after hold time */
 
@@ -352,8 +348,8 @@ static int prism2_plx_check_cis(void __iomem *attr_mem, int attr_len,
 	/* read CIS; it is in even offsets in the beginning of attr_mem */
 	for (i = 0; i < CIS_MAX_LEN; i++)
 		cis[i] = readb(attr_mem + 2 * i);
-	printk(KERN_DEBUG "%s: CIS: %02x %02x %02x %02x %02x %02x ...\n",
-	       dev_info, cis[0], cis[1], cis[2], cis[3], cis[4], cis[5]);
+	pr_debug("CIS: %02x %02x %02x %02x %02x %02x ...\n",
+		 cis[0], cis[1], cis[2], cis[3], cis[4], cis[5]);
 
 	/* set reasonable defaults for Prism2 cards just in case CIS parsing
 	 * fails */
@@ -378,12 +374,10 @@ static int prism2_plx_check_cis(void __iomem *attr_mem, int attr_len,
 			*cor_offset = 0;
 			for (i = 0; i <= rasz; i++)
 				*cor_offset += cis[pos + 4 + i] << (8 * i);
-			printk(KERN_DEBUG "%s: cor_index=0x%x "
-			       "cor_offset=0x%x\n", dev_info,
-			       *cor_index, *cor_offset);
+			pr_debug("cor_index=0x%x cor_offset=0x%x\n",
+				 *cor_index, *cor_offset);
 			if (*cor_offset > attr_len) {
-				printk(KERN_ERR "%s: COR offset not within "
-				       "attr_mem\n", dev_info);
+				pr_err("COR offset not within attr_mem\n");
 				kfree(cis);
 				return -1;
 			}
@@ -394,8 +388,7 @@ static int prism2_plx_check_cis(void __iomem *attr_mem, int attr_len,
 				goto cis_error;
 			manfid1 = cis[pos + 2] + (cis[pos + 3] << 8);
 			manfid2 = cis[pos + 4] + (cis[pos + 5] << 8);
-			printk(KERN_DEBUG "%s: manfid=0x%04x, 0x%04x\n",
-			       dev_info, manfid1, manfid2);
+			pr_debug("manfid=0x%04x, 0x%04x\n", manfid1, manfid2);
 			break;
 		}
 
@@ -411,18 +404,17 @@ static int prism2_plx_check_cis(void __iomem *attr_mem, int attr_len,
 			return 0;
 		}
 
-	printk(KERN_INFO "%s: unknown manfid 0x%04x, 0x%04x - assuming this is"
-	       " not supported card\n", dev_info, manfid1, manfid2);
+	pr_info("unknown manfid 0x%04x, 0x%04x - assuming this is not supported card\n",
+		manfid1, manfid2);
 	goto fail;
 
  cis_error:
-	printk(KERN_WARNING "%s: invalid CIS data\n", dev_info);
+	pr_warn("invalid CIS data\n");
 
  fail:
 	kfree(cis);
 	if (ignore_cis) {
-		printk(KERN_INFO "%s: ignore_cis parameter set - ignoring "
-		       "errors during CIS verification\n", dev_info);
+		pr_info("ignore_cis parameter set - ignoring errors during CIS verification\n");
 		return 0;
 	}
 	return -1;
@@ -463,9 +455,8 @@ static int prism2_plx_probe(struct pci_dev *pdev,
 		/* TMD7160 */
 		attr_mem = NULL; /* no access to PC Card attribute memory */
 
-		printk(KERN_INFO "TMD7160 PCI/PCMCIA adapter: io=0x%x, "
-		       "irq=%d, pccard_io=0x%x\n",
-		       plx_ioaddr, pdev->irq, pccard_ioaddr);
+		pr_info("TMD7160 PCI/PCMCIA adapter: io=0x%x, irq=%d, pccard_io=0x%x\n",
+			plx_ioaddr, pdev->irq, pccard_ioaddr);
 
 		cor_offset = plx_ioaddr;
 		cor_index = 0x04;
@@ -474,8 +465,7 @@ static int prism2_plx_probe(struct pci_dev *pdev,
 		mdelay(1);
 		reg = inb(plx_ioaddr);
 		if (reg != (cor_index | COR_LEVLREQ | COR_ENABLE_FUNC)) {
-			printk(KERN_ERR "%s: Error setting COR (expected="
-			       "0x%02x, was=0x%02x)\n", dev_info,
+			pr_err("Error setting COR (expected=0x%02x, was=0x%02x)\n",
 			       cor_index | COR_LEVLREQ | COR_ENABLE_FUNC, reg);
 			goto fail;
 		}
@@ -489,24 +479,20 @@ static int prism2_plx_probe(struct pci_dev *pdev,
 
 		attr_mem = ioremap(pccard_attr_mem, pccard_attr_len);
 		if (attr_mem == NULL) {
-			printk(KERN_ERR "%s: cannot remap attr_mem\n",
-			       dev_info);
+			pr_err("cannot remap attr_mem\n");
 			goto fail;
 		}
 
-		printk(KERN_INFO "PLX9052 PCI/PCMCIA adapter: "
-		       "mem=0x%lx, plx_io=0x%x, irq=%d, pccard_io=0x%x\n",
-		       pccard_attr_mem, plx_ioaddr, pdev->irq, pccard_ioaddr);
+		pr_info("PLX9052 PCI/PCMCIA adapter: mem=0x%lx, plx_io=0x%x, irq=%d, pccard_io=0x%x\n",
+			pccard_attr_mem, plx_ioaddr, pdev->irq, pccard_ioaddr);
 
 		if (prism2_plx_check_cis(attr_mem, pccard_attr_len,
 					 &cor_offset, &cor_index)) {
-			printk(KERN_INFO "Unknown PC Card CIS - not a "
-			       "Prism2/2.5 card?\n");
+			pr_info("Unknown PC Card CIS - not a Prism2/2.5 card?\n");
 			goto fail;
 		}
 
-		printk(KERN_DEBUG "Prism2/2.5 PC Card detected in PLX9052 "
-		       "adapter\n");
+		pr_debug("Prism2/2.5 PC Card detected in PLX9052 adapter\n");
 
 		/* Write COR to enable PC Card */
 		writeb(cor_index | COR_LEVLREQ | COR_ENABLE_FUNC,
@@ -514,22 +500,20 @@ static int prism2_plx_probe(struct pci_dev *pdev,
 
 		/* Enable PCI interrupts if they are not already enabled */
 		reg = inl(plx_ioaddr + PLX_INTCSR);
-		printk(KERN_DEBUG "PLX_INTCSR=0x%x\n", reg);
+		pr_debug("PLX_INTCSR=0x%x\n", reg);
 		if (!(reg & PLX_INTCSR_PCI_INTEN)) {
 			outl(reg | PLX_INTCSR_PCI_INTEN,
 			     plx_ioaddr + PLX_INTCSR);
 			if (!(inl(plx_ioaddr + PLX_INTCSR) &
 			      PLX_INTCSR_PCI_INTEN)) {
-				printk(KERN_WARNING "%s: Could not enable "
-				       "Local Interrupts\n", dev_info);
+				pr_warn("Could not enable Local Interrupts\n");
 				goto fail;
 			}
 		}
 
 		reg = inl(plx_ioaddr + PLX_CNTRL);
-		printk(KERN_DEBUG "PLX_CNTRL=0x%x (Serial EEPROM "
-		       "present=%d)\n",
-		       reg, (reg & PLX_CNTRL_SERIAL_EEPROM_PRESENT) != 0);
+		pr_debug("PLX_CNTRL=0x%x (Serial EEPROM present=%d)\n",
+			 reg, (reg & PLX_CNTRL_SERIAL_EEPROM_PRESENT) != 0);
 		/* should set PLX_PCIIPR to 0x01 (INTA#) if Serial EEPROM is
 		 * not present; but are there really such cards in use(?) */
 	}
@@ -552,14 +536,13 @@ static int prism2_plx_probe(struct pci_dev *pdev,
 
 	if (request_irq(dev->irq, prism2_interrupt, IRQF_SHARED, dev->name,
 			dev)) {
-		printk(KERN_WARNING "%s: request_irq failed\n", dev->name);
+		pr_warn("%s: request_irq failed\n", dev->name);
 		goto fail;
 	} else
 		irq_registered = 1;
 
 	if (prism2_hw_config(dev, 1)) {
-		printk(KERN_DEBUG "%s: hardware initialization failed\n",
-		       dev_info);
+		pr_debug("hardware initialization failed\n");
 		goto fail;
 	}
 
diff --git a/drivers/net/wireless/hostap/hostap_proc.c b/drivers/net/wireless/hostap/hostap_proc.c
index 75ef8f0..eb4bab5 100644
--- a/drivers/net/wireless/hostap/hostap_proc.c
+++ b/drivers/net/wireless/hostap/hostap_proc.c
@@ -1,5 +1,7 @@
 /* /proc routines for Host AP driver */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/types.h>
 #include <linux/proc_fs.h>
 #include <linux/export.h>
@@ -123,8 +125,8 @@ static int prism2_wds_proc_read(char *page, char **start, off_t off,
 			     iface->dev->name,
 			     iface->u.wds.remote_addr);
 		if ((p - page) > PROC_LIMIT) {
-			printk(KERN_DEBUG "%s: wds proc did not fit\n",
-			       local->dev->name);
+			pr_debug("%s: wds proc did not fit\n",
+				 local->dev->name);
 			break;
 		}
 	}
@@ -178,8 +180,8 @@ static int prism2_bss_list_proc_read(char *page, char **start, off_t off,
 		}
 		p += sprintf(p, "\n");
 		if ((p - page) > PROC_LIMIT) {
-			printk(KERN_DEBUG "%s: BSS proc did not fit\n",
-			       local->dev->name);
+			pr_debug("%s: BSS proc did not fit\n",
+				 local->dev->name);
 			break;
 		}
 	}
@@ -391,15 +393,15 @@ void hostap_init_proc(local_info_t *local)
 	local->proc = NULL;
 
 	if (hostap_proc == NULL) {
-		printk(KERN_WARNING "%s: hostap proc directory not created\n",
-		       local->dev->name);
+		pr_warn("%s: hostap proc directory not created\n",
+			local->dev->name);
 		return;
 	}
 
 	local->proc = proc_mkdir(local->ddev->name, hostap_proc);
 	if (local->proc == NULL) {
-		printk(KERN_INFO "/proc/net/hostap/%s creation failed\n",
-		       local->ddev->name);
+		pr_info("/proc/net/hostap/%s creation failed\n",
+			local->ddev->name);
 		return;
 	}
 
diff --git a/drivers/net/wireless/hostap/hostap_wlan.h b/drivers/net/wireless/hostap/hostap_wlan.h
index 7bb0b4b..738adc7 100644
--- a/drivers/net/wireless/hostap/hostap_wlan.h
+++ b/drivers/net/wireless/hostap/hostap_wlan.h
@@ -946,15 +946,17 @@ struct hostap_skb_tx_data {
 #define DEBUG_EXTRA2 BIT(6)
 #define DEBUG_PS2 BIT(7)
 #define DEBUG_MASK (DEBUG_PS | DEBUG_AP | DEBUG_HW | DEBUG_EXTRA)
-#define PDEBUG(n, args...) \
-do { if ((n) & DEBUG_MASK) printk(KERN_DEBUG args); } while (0)
-#define PDEBUG2(n, args...) \
-do { if ((n) & DEBUG_MASK) printk(args); } while (0)
+#define PDEBUG(n, fmt, ...)						\
+	do { if ((n) & DEBUG_MASK) pr_debug(fmt, ##__VA_ARGS__); } while (0)
+#define PDEBUG2(n, fmt, ...)						\
+	do { if ((n) & DEBUG_MASK) printk(fmt, ##__VA_ARGS__); } while (0)
 
 #else /* PRISM2_NO_DEBUG */
 
-#define PDEBUG(n, args...)
-#define PDEBUG2(n, args...)
+#define PDEBUG(n, fmt, ...)
+	do { if (0) pr_debug(fmt, ##__VA_ARGS__); } while (0)
+#define PDEBUG2(n, fmt, ...)
+	do { if (0) printk(fmt, ##__VA_ARGS__); } while (0)
 
 #endif /* PRISM2_NO_DEBUG */
 
@@ -1006,7 +1008,7 @@ static inline void prism2_io_debug_error(struct net_device *dev, int err)
 	prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_ERROR, 0, err);
 	if (local->io_debug_enabled == 1) {
 		local->io_debug_enabled = 0;
-		printk(KERN_DEBUG "%s: I/O debug stopped\n", dev->name);
+		pr_debug("%s: I/O debug stopped\n", dev->name);
 	}
 	spin_unlock_irqrestore(&local->lock, flags);
 }
-- 
1.7.8.111.gad25c.dirty

^ permalink raw reply related

* [PATCH wireless-next 08/20] ipw2x00: Use pr_<level>
From: Joe Perches @ 2012-06-15  5:53 UTC (permalink / raw)
  To: Stanislav Yakovlev; +Cc: John W. Linville, linux-wireless, netdev, linux-kernel
In-Reply-To: <cover.1339739415.git.joe@perches.com>

Use a more current logging style.

Convert printks to pr_<level>.
Convert printk(KERN_DEBUG to pr_debug(.
Coalesce formats, align arguments.

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/wireless/ipw2x00/ipw2100.c       |  225 +++++++++++---------------
 drivers/net/wireless/ipw2x00/ipw2100.h       |    4 +-
 drivers/net/wireless/ipw2x00/ipw2200.c       |   54 +++----
 drivers/net/wireless/ipw2x00/ipw2200.h       |   36 +++--
 drivers/net/wireless/ipw2x00/libipw.h        |   24 ++-
 drivers/net/wireless/ipw2x00/libipw_geo.c    |    3 +
 drivers/net/wireless/ipw2x00/libipw_module.c |    9 +-
 drivers/net/wireless/ipw2x00/libipw_rx.c     |   49 +++---
 drivers/net/wireless/ipw2x00/libipw_tx.c     |   11 +-
 drivers/net/wireless/ipw2x00/libipw_wx.c     |    4 +-
 10 files changed, 197 insertions(+), 222 deletions(-)

diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
index 95aa8e1..064b16f 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
@@ -133,6 +133,8 @@ that only one external action is invoked at a time.
 
 */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/compiler.h>
 #include <linux/errno.h>
 #include <linux/if_arp.h>
@@ -212,16 +214,21 @@ MODULE_PARM_DESC(disable, "manually disable the radio (default 0 [radio on])");
 static u32 ipw2100_debug_level = IPW_DL_NONE;
 
 #ifdef CONFIG_IPW2100_DEBUG
-#define IPW_DEBUG(level, message...) \
-do { \
-	if (ipw2100_debug_level & (level)) { \
-		printk(KERN_DEBUG "ipw2100: %c %s ", \
-                       in_interrupt() ? 'I' : 'U',  __func__); \
-		printk(message); \
-	} \
+#define IPW_DEBUG(level, fmt, ...)					\
+do {									\
+	if (ipw2100_debug_level & (level))				\
+		pr_debug("%c %s " fmt,					\
+			 in_interrupt() ? 'I' : 'U',  __func__,		\
+			 ##__VA_ARGS__);				\
 } while (0)
 #else
-#define IPW_DEBUG(level, message...) do {} while (0)
+#define IPW_DEBUG(level, fmt, ...)					\
+do {									\
+	if (0)								\
+		pr_debug("%c %s " fmt,					\
+			 in_interrupt() ? 'I' : 'U',  __func__,		\
+			 ##__VA_ARGS__);				\
+} while (0)
 #endif				/* CONFIG_IPW2100_DEBUG */
 
 #ifdef CONFIG_IPW2100_DEBUG
@@ -539,8 +546,7 @@ static int ipw2100_get_ordinal(struct ipw2100_priv *priv, u32 ord,
 	u32 total_length;
 
 	if (ordinals->table1_addr == 0) {
-		printk(KERN_WARNING DRV_NAME ": attempt to use fw ordinals "
-		       "before they have been loaded.\n");
+		pr_warn("attempt to use fw ordinals before they have been loaded\n");
 		return -EINVAL;
 	}
 
@@ -548,9 +554,8 @@ static int ipw2100_get_ordinal(struct ipw2100_priv *priv, u32 ord,
 		if (*len < IPW_ORD_TAB_1_ENTRY_SIZE) {
 			*len = IPW_ORD_TAB_1_ENTRY_SIZE;
 
-			printk(KERN_WARNING DRV_NAME
-			       ": ordinal buffer length too small, need %zd\n",
-			       IPW_ORD_TAB_1_ENTRY_SIZE);
+			pr_warn("ordinal buffer length too small, need %zd\n",
+				IPW_ORD_TAB_1_ENTRY_SIZE);
 
 			return -EINVAL;
 		}
@@ -601,8 +606,7 @@ static int ipw2100_get_ordinal(struct ipw2100_priv *priv, u32 ord,
 		return 0;
 	}
 
-	printk(KERN_WARNING DRV_NAME ": ordinal %d neither in table 1 nor "
-	       "in table 2\n", ord);
+	pr_warn("ordinal %d neither in table 1 nor in table 2\n", ord);
 
 	return -EINVAL;
 }
@@ -680,9 +684,9 @@ static void printk_buf(int level, const u8 * data, u32 len)
 		return;
 
 	while (len) {
-		printk(KERN_DEBUG "%s\n",
-		       snprint_line(line, sizeof(line), &data[ofs],
-				    min(len, 16U), ofs));
+		pr_debug("%s\n",
+			 snprint_line(line, sizeof(line), &data[ofs],
+				      min(len, 16U), ofs));
 		ofs += 16;
 		len -= min(len, 16U);
 	}
@@ -820,8 +824,7 @@ static int ipw2100_hw_send_command(struct ipw2100_priv *priv,
 	}
 
 	if (priv->fatal_error) {
-		printk(KERN_WARNING DRV_NAME ": %s: firmware fatal error\n",
-		       priv->net_dev->name);
+		pr_warn("%s: firmware fatal error\n", priv->net_dev->name);
 		return -EIO;
 	}
 
@@ -1052,7 +1055,7 @@ static int ipw2100_download_firmware(struct ipw2100_priv *priv)
 	/* load microcode */
 	err = ipw2100_ucode_download(priv, &ipw2100_firmware);
 	if (err) {
-		printk(KERN_ERR DRV_NAME ": %s: Error loading microcode: %d\n",
+		pr_err("%s: Error loading microcode: %d\n",
 		       priv->net_dev->name, err);
 		goto fail;
 	}
@@ -1064,8 +1067,7 @@ static int ipw2100_download_firmware(struct ipw2100_priv *priv)
 	/* s/w reset and clock stabilization (again!!!) */
 	err = sw_reset_and_clock(priv);
 	if (err) {
-		printk(KERN_ERR DRV_NAME
-		       ": %s: sw_reset_and_clock failed: %d\n",
+		pr_err("%s: sw_reset_and_clock failed: %d\n",
 		       priv->net_dev->name, err);
 		goto fail;
 	}
@@ -1259,8 +1261,7 @@ static int ipw2100_start_adapter(struct ipw2100_priv *priv)
 	 * fw & dino ucode
 	 */
 	if (ipw2100_download_firmware(priv)) {
-		printk(KERN_ERR DRV_NAME
-		       ": %s: Failed to power on the adapter.\n",
+		pr_err("%s: Failed to power on the adapter\n",
 		       priv->net_dev->name);
 		return -EIO;
 	}
@@ -1319,9 +1320,8 @@ static int ipw2100_start_adapter(struct ipw2100_priv *priv)
 		     i ? "SUCCESS" : "FAILED");
 
 	if (!i) {
-		printk(KERN_WARNING DRV_NAME
-		       ": %s: Firmware did not initialize.\n",
-		       priv->net_dev->name);
+		pr_warn("%s: Firmware did not initialize\n",
+			priv->net_dev->name);
 		return -EIO;
 	}
 
@@ -1512,8 +1512,7 @@ static int ipw2100_hw_stop_adapter(struct ipw2100_priv *priv)
 
 		err = ipw2100_hw_phy_off(priv);
 		if (err)
-			printk(KERN_WARNING DRV_NAME
-			       ": Error disabling radio %d\n", err);
+			pr_warn("Error disabling radio %d\n", err);
 
 		/*
 		 * If in D0-standby mode going directly to D3 may cause a
@@ -1539,9 +1538,8 @@ static int ipw2100_hw_stop_adapter(struct ipw2100_priv *priv)
 
 		err = ipw2100_hw_send_command(priv, &cmd);
 		if (err)
-			printk(KERN_WARNING DRV_NAME ": "
-			       "%s: Power down command failed: Error %d\n",
-			       priv->net_dev->name, err);
+			pr_warn("%s: Power down command failed: Error %d\n",
+				priv->net_dev->name, err);
 		else
 			schedule_timeout_uninterruptible(HW_POWER_DOWN_DELAY);
 	}
@@ -1578,9 +1576,8 @@ static int ipw2100_hw_stop_adapter(struct ipw2100_priv *priv)
 	}
 
 	if (i == 0)
-		printk(KERN_WARNING DRV_NAME
-		       ": %s: Could now power down adapter.\n",
-		       priv->net_dev->name);
+		pr_warn("%s: Could now power down adapter\n",
+			priv->net_dev->name);
 
 	/* assert s/w reset */
 	write_register(priv->net_dev, IPW_REG_RESET_REG,
@@ -1617,15 +1614,13 @@ static int ipw2100_disable_adapter(struct ipw2100_priv *priv)
 
 	err = ipw2100_hw_send_command(priv, &cmd);
 	if (err) {
-		printk(KERN_WARNING DRV_NAME
-		       ": exit - failed to send CARD_DISABLE command\n");
+		pr_warn("exit - failed to send CARD_DISABLE command\n");
 		goto fail_up;
 	}
 
 	err = ipw2100_wait_for_card_state(priv, IPW_HW_STATE_DISABLED);
 	if (err) {
-		printk(KERN_WARNING DRV_NAME
-		       ": exit - card failed to change to DISABLED\n");
+		pr_warn("exit - card failed to change to DISABLED\n");
 		goto fail_up;
 	}
 
@@ -1758,9 +1753,8 @@ static int ipw2100_up(struct ipw2100_priv *priv, int deferred)
 	    (priv->status & STATUS_RESET_PENDING)) {
 		/* Power cycle the card ... */
 		if (ipw2100_power_cycle_adapter(priv)) {
-			printk(KERN_WARNING DRV_NAME
-			       ": %s: Could not cycle adapter.\n",
-			       priv->net_dev->name);
+			pr_warn("%s: Could not cycle adapter\n",
+				priv->net_dev->name);
 			rc = 1;
 			goto exit;
 		}
@@ -1769,8 +1763,7 @@ static int ipw2100_up(struct ipw2100_priv *priv, int deferred)
 
 	/* Load the firmware, start the clocks, etc. */
 	if (ipw2100_start_adapter(priv)) {
-		printk(KERN_ERR DRV_NAME
-		       ": %s: Failed to start the firmware.\n",
+		pr_err("%s: Failed to start the firmware\n",
 		       priv->net_dev->name);
 		rc = 1;
 		goto exit;
@@ -1780,8 +1773,7 @@ static int ipw2100_up(struct ipw2100_priv *priv, int deferred)
 
 	/* Determine capabilities of this particular HW configuration */
 	if (ipw2100_get_hw_features(priv)) {
-		printk(KERN_ERR DRV_NAME
-		       ": %s: Failed to determine HW features.\n",
+		pr_err("%s: Failed to determine HW features\n",
 		       priv->net_dev->name);
 		rc = 1;
 		goto exit;
@@ -1789,15 +1781,14 @@ static int ipw2100_up(struct ipw2100_priv *priv, int deferred)
 
 	/* Initialize the geo */
 	if (libipw_set_geo(priv->ieee, &ipw_geos[0])) {
-		printk(KERN_WARNING DRV_NAME "Could not set geo\n");
+		pr_warn("Could not set geo\n");
 		return 0;
 	}
 	priv->ieee->freq_band = LIBIPW_24GHZ_BAND;
 
 	lock = LOCK_NONE;
 	if (ipw2100_set_ordinal(priv, IPW_ORD_PERS_DB_LOCK, &lock, &ord_len)) {
-		printk(KERN_ERR DRV_NAME
-		       ": %s: Failed to clear ordinal lock.\n",
+		pr_err("%s: Failed to clear ordinal lock\n",
 		       priv->net_dev->name);
 		rc = 1;
 		goto exit;
@@ -1806,7 +1797,7 @@ static int ipw2100_up(struct ipw2100_priv *priv, int deferred)
 	priv->status &= ~STATUS_SCANNING;
 
 	if (rf_kill_active(priv)) {
-		printk(KERN_INFO "%s: Radio is disabled by RF switch.\n",
+		pr_info("%s: Radio is disabled by RF switch\n",
 		       priv->net_dev->name);
 
 		if (priv->stop_rf_kill) {
@@ -1824,7 +1815,7 @@ static int ipw2100_up(struct ipw2100_priv *priv, int deferred)
 	/* Send all of the commands that must be sent prior to
 	 * HOST_COMPLETE */
 	if (ipw2100_adapter_setup(priv)) {
-		printk(KERN_ERR DRV_NAME ": %s: Failed to start the card.\n",
+		pr_err("%s: Failed to start the card\n",
 		       priv->net_dev->name);
 		rc = 1;
 		goto exit;
@@ -1833,8 +1824,7 @@ static int ipw2100_up(struct ipw2100_priv *priv, int deferred)
 	if (!deferred) {
 		/* Enable the adapter - sends HOST_COMPLETE */
 		if (ipw2100_enable_adapter(priv)) {
-			printk(KERN_ERR DRV_NAME ": "
-			       "%s: failed in call to enable adapter.\n",
+			pr_err("%s: failed in call to enable adapter\n",
 			       priv->net_dev->name);
 			ipw2100_hw_stop_adapter(priv);
 			rc = 1;
@@ -1882,8 +1872,7 @@ static void ipw2100_down(struct ipw2100_priv *priv)
 	spin_unlock_irqrestore(&priv->low_lock, flags);
 
 	if (ipw2100_hw_stop_adapter(priv))
-		printk(KERN_ERR DRV_NAME ": %s: Error stopping adapter.\n",
-		       priv->net_dev->name);
+		pr_err("%s: Error stopping adapter\n", priv->net_dev->name);
 
 	/* Do not disable the interrupt until _after_ we disable
 	 * the adaptor.  Otherwise the CARD_DISABLE command will never
@@ -2540,9 +2529,8 @@ static void isr_rx(struct ipw2100_priv *priv, int i,
 
 	/* We need to allocate a new SKB and attach it to the RDB. */
 	if (unlikely(ipw2100_alloc_skb(priv, packet))) {
-		printk(KERN_WARNING DRV_NAME ": "
-		       "%s: Unable to allocate SKB onto RBD ring - disabling "
-		       "adapter.\n", dev->name);
+		pr_warn("%s: Unable to allocate SKB onto RBD ring - disabling adapter\n",
+			dev->name);
 		/* TODO: schedule adapter shutdown */
 		IPW_DEBUG_INFO("TODO: Shutdown adapter...\n");
 	}
@@ -2871,8 +2859,7 @@ static int __ipw2100_tx_process(struct ipw2100_priv *priv)
 		break;
 
 	default:
-		printk(KERN_WARNING DRV_NAME ": %s: Bad fw_pend_list entry!\n",
-		       priv->net_dev->name);
+		pr_warn("%s: Bad fw_pend_list entry!\n", priv->net_dev->name);
 		return 0;
 	}
 
@@ -2885,8 +2872,7 @@ static int __ipw2100_tx_process(struct ipw2100_priv *priv)
 	read_register(priv->net_dev, IPW_MEM_HOST_SHARED_TX_QUEUE_WRITE_INDEX,
 		      &w);
 	if (w != txq->next)
-		printk(KERN_WARNING DRV_NAME ": %s: write index mismatch\n",
-		       priv->net_dev->name);
+		pr_warn("%s: write index mismatch\n", priv->net_dev->name);
 
 	/*
 	 * txq->next is the index of the last packet written txq->oldest is
@@ -2942,10 +2928,9 @@ static int __ipw2100_tx_process(struct ipw2100_priv *priv)
 	switch (packet->type) {
 	case DATA:
 		if (txq->drv[txq->oldest].status.info.fields.txType != 0)
-			printk(KERN_WARNING DRV_NAME ": %s: Queue mismatch.  "
-			       "Expecting DATA TBD but pulled "
-			       "something else: ids %d=%d.\n",
-			       priv->net_dev->name, txq->oldest, packet->index);
+			pr_warn("%s: Queue mismatch.  Expecting DATA TBD but pulled something else: ids %d=%d\n",
+				priv->net_dev->name,
+				txq->oldest, packet->index);
 
 		/* DATA packet; we have to unmap and free the SKB */
 		for (i = 0; i < frag_num; i++) {
@@ -2979,10 +2964,9 @@ static int __ipw2100_tx_process(struct ipw2100_priv *priv)
 
 	case COMMAND:
 		if (txq->drv[txq->oldest].status.info.fields.txType != 1)
-			printk(KERN_WARNING DRV_NAME ": %s: Queue mismatch.  "
-			       "Expecting COMMAND TBD but pulled "
-			       "something else: ids %d=%d.\n",
-			       priv->net_dev->name, txq->oldest, packet->index);
+			pr_warn("%s: Queue mismatch.  Expecting COMMAND TBD but pulled something else: ids %d=%d\n",
+				priv->net_dev->name,
+				txq->oldest, packet->index);
 
 #ifdef CONFIG_IPW2100_DEBUG
 		if (packet->info.c_struct.cmd->host_command_reg <
@@ -3020,9 +3004,8 @@ static inline void __ipw2100_tx_complete(struct ipw2100_priv *priv)
 		i++;
 
 	if (i == 200) {
-		printk(KERN_WARNING DRV_NAME ": "
-		       "%s: Driver is running slow (%d iters).\n",
-		       priv->net_dev->name, i);
+		pr_warn("%s: Driver is running slow (%d iters)\n",
+			priv->net_dev->name, i);
 	}
 }
 
@@ -3258,8 +3241,7 @@ static void ipw2100_irq_tasklet(struct ipw2100_priv *priv)
 		      (unsigned long)inta & IPW_INTERRUPT_MASK);
 
 	if (inta & IPW2100_INTA_FATAL_ERROR) {
-		printk(KERN_WARNING DRV_NAME
-		       ": Fatal interrupt. Scheduling firmware restart.\n");
+		pr_warn("Fatal interrupt. Scheduling firmware restart.\n");
 		priv->inta_other++;
 		write_register(dev, IPW_REG_INTA, IPW2100_INTA_FATAL_ERROR);
 
@@ -3276,8 +3258,7 @@ static void ipw2100_irq_tasklet(struct ipw2100_priv *priv)
 	}
 
 	if (inta & IPW2100_INTA_PARITY_ERROR) {
-		printk(KERN_ERR DRV_NAME
-		       ": ***** PARITY ERROR INTERRUPT !!!!\n");
+		pr_err("***** PARITY ERROR INTERRUPT !!!!\n");
 		priv->inta_other++;
 		write_register(dev, IPW_REG_INTA, IPW2100_INTA_PARITY_ERROR);
 	}
@@ -3379,7 +3360,7 @@ static irqreturn_t ipw2100_interrupt(int irq, void *data)
 
 	if (inta == 0xFFFFFFFF) {
 		/* Hardware disappeared */
-		printk(KERN_WARNING DRV_NAME ": IRQ INTA == 0xFFFFFFFF\n");
+		pr_warn("IRQ INTA == 0xFFFFFFFF\n");
 		goto none;
 	}
 
@@ -3468,9 +3449,8 @@ static int ipw2100_msg_allocate(struct ipw2100_priv *priv)
 		v = pci_alloc_consistent(priv->pci_dev,
 					 sizeof(struct ipw2100_cmd_header), &p);
 		if (!v) {
-			printk(KERN_ERR DRV_NAME ": "
-			       "%s: PCI alloc failed for msg "
-			       "buffers.\n", priv->net_dev->name);
+			pr_err("%s: PCI alloc failed for msg buffers\n",
+			       priv->net_dev->name);
 			err = -ENOMEM;
 			break;
 		}
@@ -4040,7 +4020,7 @@ static int ipw2100_switch_mode(struct ipw2100_priv *priv, u32 mode)
 
 	err = ipw2100_disable_adapter(priv);
 	if (err) {
-		printk(KERN_ERR DRV_NAME ": %s: Could not disable adapter %d\n",
+		pr_err("%s: Could not disable adapter %d\n",
 		       priv->net_dev->name, err);
 		return err;
 	}
@@ -4068,7 +4048,7 @@ static int ipw2100_switch_mode(struct ipw2100_priv *priv, u32 mode)
 	ipw2100_firmware.version = 0;
 #endif
 
-	printk(KERN_INFO "%s: Resetting on mode change.\n", priv->net_dev->name);
+	pr_info("%s: Resetting on mode change\n", priv->net_dev->name);
 	priv->reset_backoff = 0;
 	schedule_reset(priv);
 
@@ -4486,8 +4466,7 @@ static int ipw2100_tx_allocate(struct ipw2100_priv *priv)
 	    kmalloc(TX_PENDED_QUEUE_LENGTH * sizeof(struct ipw2100_tx_packet),
 		    GFP_ATOMIC);
 	if (!priv->tx_buffers) {
-		printk(KERN_ERR DRV_NAME
-		       ": %s: alloc failed form tx buffers.\n",
+		pr_err("%s: alloc failed form tx buffers\n",
 		       priv->net_dev->name);
 		bd_queue_free(priv, &priv->tx_queue);
 		return -ENOMEM;
@@ -4498,8 +4477,7 @@ static int ipw2100_tx_allocate(struct ipw2100_priv *priv)
 					 sizeof(struct ipw2100_data_header),
 					 &p);
 		if (!v) {
-			printk(KERN_ERR DRV_NAME
-			       ": %s: PCI alloc failed for tx " "buffers.\n",
+			pr_err("%s: PCI alloc failed for tx buffers\n",
 			       priv->net_dev->name);
 			err = -ENOMEM;
 			break;
@@ -4809,8 +4787,7 @@ static int ipw2100_set_port_type(struct ipw2100_priv *priv, u32 port_type,
 	if (!batch_mode) {
 		err = ipw2100_disable_adapter(priv);
 		if (err) {
-			printk(KERN_ERR DRV_NAME
-			       ": %s: Could not disable adapter %d\n",
+			pr_err("%s: Could not disable adapter %d\n",
 			       priv->net_dev->name, err);
 			return err;
 		}
@@ -5390,8 +5367,7 @@ static int ipw2100_set_wep_flags(struct ipw2100_priv *priv, u32 flags,
 	if (!batch_mode) {
 		err = ipw2100_disable_adapter(priv);
 		if (err) {
-			printk(KERN_ERR DRV_NAME
-			       ": %s: Could not disable adapter %d\n",
+			pr_err("%s: Could not disable adapter %d\n",
 			       priv->net_dev->name, err);
 			return err;
 		}
@@ -5478,8 +5454,7 @@ static int ipw2100_set_key(struct ipw2100_priv *priv,
 		err = ipw2100_disable_adapter(priv);
 		/* FIXME: IPG: shouldn't this prink be in _disable_adapter()? */
 		if (err) {
-			printk(KERN_ERR DRV_NAME
-			       ": %s: Could not disable adapter %d\n",
+			pr_err("%s: Could not disable adapter %d\n",
 			       priv->net_dev->name, err);
 			return err;
 		}
@@ -5515,8 +5490,7 @@ static int ipw2100_set_key_index(struct ipw2100_priv *priv,
 	if (!batch_mode) {
 		err = ipw2100_disable_adapter(priv);
 		if (err) {
-			printk(KERN_ERR DRV_NAME
-			       ": %s: Could not disable adapter %d\n",
+			pr_err("%s: Could not disable adapter %d\n",
 			       priv->net_dev->name, err);
 			return err;
 		}
@@ -6232,8 +6206,7 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
 
 	ioaddr = pci_iomap(pci_dev, 0, 0);
 	if (!ioaddr) {
-		printk(KERN_WARNING DRV_NAME
-		       "Error calling ioremap_nocache.\n");
+		pr_warn("Error calling ioremap_nocache\n");
 		err = -EIO;
 		goto fail;
 	}
@@ -6241,8 +6214,7 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
 	/* allocate and initialize our net_device */
 	dev = ipw2100_alloc_device(pci_dev, ioaddr);
 	if (!dev) {
-		printk(KERN_WARNING DRV_NAME
-		       "Error calling ipw2100_alloc_device.\n");
+		pr_warn("Error calling ipw2100_alloc_device\n");
 		err = -ENOMEM;
 		goto fail;
 	}
@@ -6250,8 +6222,7 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
 	/* set up PCI mappings for device */
 	err = pci_enable_device(pci_dev);
 	if (err) {
-		printk(KERN_WARNING DRV_NAME
-		       "Error calling pci_enable_device.\n");
+		pr_warn("Error calling pci_enable_device\n");
 		return err;
 	}
 
@@ -6262,16 +6233,14 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
 
 	err = pci_set_dma_mask(pci_dev, DMA_BIT_MASK(32));
 	if (err) {
-		printk(KERN_WARNING DRV_NAME
-		       "Error calling pci_set_dma_mask.\n");
+		pr_warn("Error calling pci_set_dma_mask\n");
 		pci_disable_device(pci_dev);
 		return err;
 	}
 
 	err = pci_request_regions(pci_dev, DRV_NAME);
 	if (err) {
-		printk(KERN_WARNING DRV_NAME
-		       "Error calling pci_request_regions.\n");
+		pr_warn("Error calling pci_request_regions\n");
 		pci_disable_device(pci_dev);
 		return err;
 	}
@@ -6285,8 +6254,7 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
 	pci_set_power_state(pci_dev, PCI_D0);
 
 	if (!ipw2100_hw_is_adapter_in_system(dev)) {
-		printk(KERN_WARNING DRV_NAME
-		       "Device not found via register read.\n");
+		pr_warn("Device not found via register read\n");
 		err = -ENODEV;
 		goto fail;
 	}
@@ -6299,8 +6267,7 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
 
 	/* Allocate and initialize the Tx/Rx queues and lists */
 	if (ipw2100_queues_allocate(priv)) {
-		printk(KERN_WARNING DRV_NAME
-		       "Error calling ipw2100_queues_allocate.\n");
+		pr_warn("Error calling ipw2100_queues_allocate\n");
 		err = -ENOMEM;
 		goto fail;
 	}
@@ -6309,16 +6276,14 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
 	err = request_irq(pci_dev->irq,
 			  ipw2100_interrupt, IRQF_SHARED, dev->name, priv);
 	if (err) {
-		printk(KERN_WARNING DRV_NAME
-		       "Error calling request_irq: %d.\n", pci_dev->irq);
+		pr_warn("Error calling request_irq: %d\n", pci_dev->irq);
 		goto fail;
 	}
 	dev->irq = pci_dev->irq;
 
 	IPW_DEBUG_INFO("Attempting to register device...\n");
 
-	printk(KERN_INFO DRV_NAME
-	       ": Detected Intel PRO/Wireless 2100 Network Connection\n");
+	pr_info("Detected Intel PRO/Wireless 2100 Network Connection\n");
 
 	err = ipw2100_up(priv, 1);
 	if (err)
@@ -6336,8 +6301,7 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
 	 */
 	err = register_netdev(dev);
 	if (err) {
-		printk(KERN_WARNING DRV_NAME
-		       "Error calling register_netdev.\n");
+		pr_warn("Error calling register_netdev\n");
 		goto fail;
 	}
 	registered = 2;
@@ -6356,9 +6320,8 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
 	if (!(priv->status & STATUS_RF_KILL_MASK)) {
 		/* Enable the adapter - sends HOST_COMPLETE */
 		if (ipw2100_enable_adapter(priv)) {
-			printk(KERN_WARNING DRV_NAME
-			       ": %s: failed in call to enable adapter.\n",
-			       priv->net_dev->name);
+			pr_warn("%s: failed in call to enable adapter\n",
+				priv->net_dev->name);
 			ipw2100_hw_stop_adapter(priv);
 			err = -EIO;
 			goto fail_unlock;
@@ -6509,7 +6472,7 @@ static int ipw2100_resume(struct pci_dev *pci_dev)
 	pci_set_power_state(pci_dev, PCI_D0);
 	err = pci_enable_device(pci_dev);
 	if (err) {
-		printk(KERN_ERR "%s: pci_enable_device failed on resume\n",
+		pr_err("%s: pci_enable_device failed on resume\n",
 		       dev->name);
 		mutex_unlock(&priv->action_mutex);
 		return err;
@@ -6631,8 +6594,8 @@ static int __init ipw2100_init(void)
 {
 	int ret;
 
-	printk(KERN_INFO DRV_NAME ": %s, %s\n", DRV_DESCRIPTION, DRV_VERSION);
-	printk(KERN_INFO DRV_NAME ": %s\n", DRV_COPYRIGHT);
+	pr_info("%s, %s\n", DRV_DESCRIPTION, DRV_VERSION);
+	pr_info("%s\n", DRV_COPYRIGHT);
 
 	pm_qos_add_request(&ipw2100_pm_qos_req, PM_QOS_CPU_DMA_LATENCY,
 			   PM_QOS_DEFAULT_VALUE);
@@ -8433,10 +8396,8 @@ static int ipw2100_mod_firmware_load(struct ipw2100_fw *fw)
 	    (struct ipw2100_fw_header *)fw->fw_entry->data;
 
 	if (IPW2100_FW_MAJOR(h->version) != IPW2100_FW_MAJOR_VERSION) {
-		printk(KERN_WARNING DRV_NAME ": Firmware image not compatible "
-		       "(detected version id of %u). "
-		       "See Documentation/networking/README.ipw2100\n",
-		       h->version);
+		pr_warn("Firmware image not compatible (detected version id of %u). See Documentation/networking/README.ipw2100\n",
+			h->version);
 		return 1;
 	}
 
@@ -8476,8 +8437,7 @@ static int ipw2100_get_firmware(struct ipw2100_priv *priv,
 	rc = request_firmware(&fw->fw_entry, fw_name, &priv->pci_dev->dev);
 
 	if (rc < 0) {
-		printk(KERN_ERR DRV_NAME ": "
-		       "%s: Firmware '%s' not available or load failed.\n",
+		pr_err("%s: Firmware '%s' not available or load failed\n",
 		       priv->net_dev->name, fw_name);
 		return rc;
 	}
@@ -8562,8 +8522,7 @@ static int ipw2100_fw_download(struct ipw2100_priv *priv, struct ipw2100_fw *fw)
 		firmware_data_left -= 2;
 
 		if (len > 32) {
-			printk(KERN_ERR DRV_NAME ": "
-			       "Invalid firmware run-length of %d bytes\n",
+			pr_err("Invalid firmware run-length of %d bytes\n",
 			       len);
 			return -EINVAL;
 		}
@@ -8674,8 +8633,7 @@ static int ipw2100_ucode_download(struct ipw2100_priv *priv,
 	}
 
 	if (i == 10) {
-		printk(KERN_ERR DRV_NAME ": %s: Error initializing Symbol\n",
-		       dev->name);
+		pr_err("%s: Error initializing Symbol\n", dev->name);
 		return -EIO;
 	}
 
@@ -8692,8 +8650,7 @@ static int ipw2100_ucode_download(struct ipw2100_priv *priv,
 	}
 
 	if (i == 30) {
-		printk(KERN_ERR DRV_NAME
-		       ": %s: No response from Symbol - hw not alive\n",
+		pr_err("%s: No response from Symbol - hw not alive\n",
 		       dev->name);
 		printk_buf(IPW_DL_ERROR, (u8 *) & response, sizeof(response));
 		return -EIO;
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.h b/drivers/net/wireless/ipw2x00/ipw2100.h
index 9731252..a978791 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.h
+++ b/drivers/net/wireless/ipw2x00/ipw2100.h
@@ -108,8 +108,8 @@ struct ipw2100_rx_packet;
 #define IPW_DL_IO            (1<<26)
 #define IPW_DL_TRACE         (1<<28)
 
-#define IPW_DEBUG_ERROR(f, a...) printk(KERN_ERR DRV_NAME ": " f, ## a)
-#define IPW_DEBUG_WARNING(f, a...) printk(KERN_WARNING DRV_NAME ": " f, ## a)
+#define IPW_DEBUG_ERROR(f, a...) pr_err(f, ## a)
+#define IPW_DEBUG_WARNING(f, a...) pr_warn(f, ## a)
 #define IPW_DEBUG_INFO(f...)    IPW_DEBUG(IPW_DL_INFO, ## f)
 #define IPW_DEBUG_WX(f...)     IPW_DEBUG(IPW_DL_WX, ## f)
 #define IPW_DEBUG_SCAN(f...)   IPW_DEBUG(IPW_DL_SCAN, ## f)
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
index 254b892..43e2e51 100644
--- a/drivers/net/wireless/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/ipw2x00/ipw2200.c
@@ -30,6 +30,8 @@
 
 ******************************************************************************/
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/sched.h>
 #include <linux/slab.h>
 #include <net/cfg80211-wext.h>
@@ -1214,8 +1216,7 @@ static ssize_t store_debug_level(struct device_driver *d, const char *buf,
 	} else
 		val = simple_strtoul(p, &p, 10);
 	if (p == buf)
-		printk(KERN_INFO DRV_NAME
-		       ": %s is not in hex or decimal form.\n", buf);
+		pr_info("%s is not in hex or decimal form\n", buf);
 	else
 		ipw_debug_level = val;
 
@@ -5229,8 +5230,8 @@ static void ipw_rx_queue_replenish(void *data)
 		rxb = list_entry(element, struct ipw_rx_mem_buffer, list);
 		rxb->skb = alloc_skb(IPW_RX_BUF_SIZE, GFP_ATOMIC);
 		if (!rxb->skb) {
-			printk(KERN_CRIT "%s: Can not allocate SKB buffers.\n",
-			       priv->net_dev->name);
+			pr_crit("%s: Can not allocate SKB buffers\n",
+				priv->net_dev->name);
 			/* We don't reschedule replenish work here -- we will
 			 * call the restock method and if it still needs
 			 * more buffers it will schedule replenish */
@@ -7795,8 +7796,7 @@ static void ipw_rebuild_decrypted_skb(struct ipw_priv *priv,
 	case SEC_LEVEL_0:
 		break;
 	default:
-		printk(KERN_ERR "Unknown security level %d\n",
-		       priv->ieee->sec.level);
+		pr_err("Unknown security level %d\n", priv->ieee->sec.level);
 		break;
 	}
 }
@@ -8394,7 +8394,7 @@ static void ipw_rx(struct ipw_priv *priv)
 	while (i != r) {
 		rxb = priv->rxq->queue[i];
 		if (unlikely(rxb == NULL)) {
-			printk(KERN_CRIT "Queue not allocated!\n");
+			pr_crit("Queue not allocated!\n");
 			break;
 		}
 		priv->rxq->queue[i] = NULL;
@@ -8666,9 +8666,7 @@ static int ipw_sw_reset(struct ipw_priv *priv, int option)
 	if ((priv->pci_dev->device == 0x4223) ||
 	    (priv->pci_dev->device == 0x4224)) {
 		if (option == 1)
-			printk(KERN_INFO DRV_NAME
-			       ": Detected Intel PRO/Wireless 2915ABG Network "
-			       "Connection\n");
+			pr_info("Detected Intel PRO/Wireless 2915ABG Network Connection\n");
 		priv->ieee->abg_true = 1;
 		band = LIBIPW_52GHZ_BAND | LIBIPW_24GHZ_BAND;
 		modulation = LIBIPW_OFDM_MODULATION |
@@ -8677,9 +8675,7 @@ static int ipw_sw_reset(struct ipw_priv *priv, int option)
 		priv->ieee->mode = IEEE_A | IEEE_G | IEEE_B;
 	} else {
 		if (option == 1)
-			printk(KERN_INFO DRV_NAME
-			       ": Detected Intel PRO/Wireless 2200BG Network "
-			       "Connection\n");
+			pr_info("Detected Intel PRO/Wireless 2200BG Network Connection\n");
 
 		priv->ieee->abg_true = 0;
 		band = LIBIPW_24GHZ_BAND;
@@ -10333,7 +10329,7 @@ static int ipw_tx_skb(struct ipw_priv *priv, struct libipw_txb *txb,
 		case SEC_LEVEL_0:
 			break;
 		default:
-			printk(KERN_ERR "Unknown security level %d\n",
+			pr_err("Unknown security level %d\n",
 			       priv->ieee->sec.level);
 			break;
 		}
@@ -10379,16 +10375,14 @@ static int ipw_tx_skb(struct ipw_priv *priv, struct libipw_txb *txb,
 		for (j = i; j < txb->nr_frags; j++)
 			remaining_bytes += txb->fragments[j]->len - hdr_len;
 
-		printk(KERN_INFO "Trying to reallocate for %d bytes\n",
-		       remaining_bytes);
+		pr_info("Trying to reallocate for %d bytes\n", remaining_bytes);
 		skb = alloc_skb(remaining_bytes, GFP_ATOMIC);
 		if (skb != NULL) {
 			tfd->u.data.chunk_len[i] = cpu_to_le16(remaining_bytes);
 			for (j = i; j < txb->nr_frags; j++) {
 				int size = txb->fragments[j]->len - hdr_len;
 
-				printk(KERN_INFO "Adding frag %d %d...\n",
-				       j, size);
+				pr_info("Adding frag %d %d...\n", j, size);
 				memcpy(skb_put(skb, size),
 				       txb->fragments[j]->data + hdr_len, size);
 			}
@@ -10555,8 +10549,8 @@ static int ipw_net_set_mac_address(struct net_device *dev, void *p)
 	mutex_lock(&priv->mutex);
 	priv->config |= CFG_CUSTOM_MAC;
 	memcpy(priv->mac_addr, addr->sa_data, ETH_ALEN);
-	printk(KERN_INFO "%s: Setting MAC to %pM\n",
-	       priv->net_dev->name, priv->mac_addr);
+	pr_info("%s: Setting MAC to %pM\n",
+		priv->net_dev->name, priv->mac_addr);
 	schedule_work(&priv->adapter_restart);
 	mutex_unlock(&priv->mutex);
 	return 0;
@@ -11770,7 +11764,7 @@ static int __devinit ipw_pci_probe(struct pci_dev *pdev,
 	if (!err)
 		err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
 	if (err) {
-		printk(KERN_WARNING DRV_NAME ": No suitable DMA available.\n");
+		pr_warn("No suitable DMA available\n");
 		goto out_pci_disable_device;
 	}
 
@@ -11876,10 +11870,9 @@ static int __devinit ipw_pci_probe(struct pci_dev *pdev,
 	}
 #endif
 
-	printk(KERN_INFO DRV_NAME ": Detected geography %s (%d 802.11bg "
-	       "channels, %d 802.11a channels)\n",
-	       priv->ieee->geo.name, priv->ieee->geo.bg_channels,
-	       priv->ieee->geo.a_channels);
+	pr_info("Detected geography %s (%d 802.11bg channels, %d 802.11a channels)\n",
+		priv->ieee->geo.name, priv->ieee->geo.bg_channels,
+		priv->ieee->geo.a_channels);
 
 	return 0;
 
@@ -11993,7 +11986,7 @@ static int ipw_pci_suspend(struct pci_dev *pdev, pm_message_t state)
 	struct ipw_priv *priv = pci_get_drvdata(pdev);
 	struct net_device *dev = priv->net_dev;
 
-	printk(KERN_INFO "%s: Going into suspend...\n", dev->name);
+	pr_info("%s: Going into suspend...\n", dev->name);
 
 	/* Take down the device; powers it off, etc. */
 	ipw_down(priv);
@@ -12017,13 +12010,12 @@ static int ipw_pci_resume(struct pci_dev *pdev)
 	int err;
 	u32 val;
 
-	printk(KERN_INFO "%s: Coming out of suspend...\n", dev->name);
+	pr_info("%s: Coming out of suspend...\n", dev->name);
 
 	pci_set_power_state(pdev, PCI_D0);
 	err = pci_enable_device(pdev);
 	if (err) {
-		printk(KERN_ERR "%s: pci_enable_device failed on resume\n",
-		       dev->name);
+		pr_err("%s: pci_enable_device failed on resume\n", dev->name);
 		return err;
 	}
 	pci_restore_state(pdev);
@@ -12078,8 +12070,8 @@ static int __init ipw_init(void)
 {
 	int ret;
 
-	printk(KERN_INFO DRV_NAME ": " DRV_DESCRIPTION ", " DRV_VERSION "\n");
-	printk(KERN_INFO DRV_NAME ": " DRV_COPYRIGHT "\n");
+	pr_info(DRV_DESCRIPTION ", " DRV_VERSION "\n");
+	pr_info(DRV_COPYRIGHT "\n");
 
 	ret = pci_register_driver(&ipw_driver);
 	if (ret) {
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.h b/drivers/net/wireless/ipw2x00/ipw2200.h
index 570d6fb..4fe0811 100644
--- a/drivers/net/wireless/ipw2x00/ipw2200.h
+++ b/drivers/net/wireless/ipw2x00/ipw2200.h
@@ -1395,18 +1395,30 @@ BITC(x,19),BITC(x,18),BITC(x,17),BITC(x,16),\
 BIT_ARG16(x)
 
 
-#define IPW_DEBUG(level, fmt, args...) \
-do { if (ipw_debug_level & (level)) \
-  printk(KERN_DEBUG DRV_NAME": %c %s " fmt, \
-         in_interrupt() ? 'I' : 'U', __func__ , ## args); } while (0)
+#define IPW_DEBUG(level, fmt, ...)					\
+do {									\
+	if (ipw_debug_level & (level))					\
+		pr_debug("%c %s " fmt,					\
+			 in_interrupt() ? 'I' : 'U', __func__,		\
+			 ##__VA_ARGS__);				\
+} while (0)
 
 #ifdef CONFIG_IPW2200_DEBUG
-#define IPW_LL_DEBUG(level, fmt, args...) \
-do { if (ipw_debug_level & (level)) \
-  printk(KERN_DEBUG DRV_NAME": %c %s " fmt, \
-         in_interrupt() ? 'I' : 'U', __func__ , ## args); } while (0)
+#define IPW_LL_DEBUG(level, fmt, ...)					\
+do {									\
+	if (ipw_debug_level & (level))					\
+		pr_debug("%c %s " fmt,					\
+			 in_interrupt() ? 'I' : 'U', __func__,		\
+			 ##__VA_ARGS__);				\
+} while (0)
 #else
-#define IPW_LL_DEBUG(level, fmt, args...) do {} while (0)
+#define IPW_LL_DEBUG(level, fmt, ...)					\
+do {									\
+	if (0)								\
+		pr_debug("%c %s " fmt,					\
+			 in_interrupt() ? 'I' : 'U', __func__,		\
+			 ##__VA_ARGS__);				\
+} while (0)
 #endif				/* CONFIG_IPW2200_DEBUG */
 
 /*
@@ -1470,10 +1482,10 @@ do { if (ipw_debug_level & (level)) \
 #define IPW_DL_MERGE         (1<<30)
 #define IPW_DL_QOS           (1<<31)
 
-#define IPW_ERROR(f, a...) printk(KERN_ERR DRV_NAME ": " f, ## a)
-#define IPW_WARNING(f, a...) printk(KERN_WARNING DRV_NAME ": " f, ## a)
-#define IPW_DEBUG_INFO(f, a...)    IPW_DEBUG(IPW_DL_INFO, f, ## a)
+#define IPW_ERROR(fmt, ...)		pr_err(fmt, ##__VA_ARGS__)
+#define IPW_WARNING(fmt, ...)		pr_warn(fmt, ##__VA_ARGS__)
 
+#define IPW_DEBUG_INFO(f, a...)   IPW_DEBUG(IPW_DL_INFO, f, ## a)
 #define IPW_DEBUG_WX(f, a...)     IPW_DEBUG(IPW_DL_WX, f, ## a)
 #define IPW_DEBUG_SCAN(f, a...)   IPW_DEBUG(IPW_DL_SCAN, f, ## a)
 #define IPW_DEBUG_TRACE(f, a...)  IPW_LL_DEBUG(IPW_DL_TRACE, f, ## a)
diff --git a/drivers/net/wireless/ipw2x00/libipw.h b/drivers/net/wireless/ipw2x00/libipw.h
index 0b22fb4..1b4bfa2 100644
--- a/drivers/net/wireless/ipw2x00/libipw.h
+++ b/drivers/net/wireless/ipw2x00/libipw.h
@@ -62,12 +62,21 @@
 
 #ifdef CONFIG_LIBIPW_DEBUG
 extern u32 libipw_debug_level;
-#define LIBIPW_DEBUG(level, fmt, args...) \
-do { if (libipw_debug_level & (level)) \
-  printk(KERN_DEBUG "libipw: %c %s " fmt, \
-         in_interrupt() ? 'I' : 'U', __func__ , ## args); } while (0)
+#define LIBIPW_DEBUG(level, fmt, ...)					\
+do {									\
+	if (libipw_debug_level & (level))				\
+		pr_debug("%c %s " fmt,					\
+			 in_interrupt() ? 'I' : 'U', __func__ ,		\
+			 ##__VA_ARGS__);				\
+} while (0)
 #else
-#define LIBIPW_DEBUG(level, fmt, args...) do {} while (0)
+#define LIBIPW_DEBUG(level, fmt, ...)					\
+do {									\
+	if (0)								\
+		pr_debug("%c %s " fmt,					\
+			 in_interrupt() ? 'I' : 'U', __func__ ,		\
+			 ##__VA_ARGS__);				\
+} while (0)
 #endif				/* CONFIG_LIBIPW_DEBUG */
 
 /*
@@ -108,8 +117,9 @@ do { if (libipw_debug_level & (level)) \
 #define LIBIPW_DL_RX            (1<<9)
 #define LIBIPW_DL_QOS           (1<<31)
 
-#define LIBIPW_ERROR(f, a...) printk(KERN_ERR "libipw: " f, ## a)
-#define LIBIPW_WARNING(f, a...) printk(KERN_WARNING "libipw: " f, ## a)
+#define LIBIPW_ERROR(f, a...) pr_err(f, ## a)
+#define LIBIPW_WARNING(f, a...) pr_warn(f, ## a)
+
 #define LIBIPW_DEBUG_INFO(f, a...)   LIBIPW_DEBUG(LIBIPW_DL_INFO, f, ## a)
 
 #define LIBIPW_DEBUG_WX(f, a...)     LIBIPW_DEBUG(LIBIPW_DL_WX, f, ## a)
diff --git a/drivers/net/wireless/ipw2x00/libipw_geo.c b/drivers/net/wireless/ipw2x00/libipw_geo.c
index c9fe3c9..c3465a6 100644
--- a/drivers/net/wireless/ipw2x00/libipw_geo.c
+++ b/drivers/net/wireless/ipw2x00/libipw_geo.c
@@ -23,6 +23,9 @@
   Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
 
 ******************************************************************************/
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/compiler.h>
 #include <linux/errno.h>
 #include <linux/if_arp.h>
diff --git a/drivers/net/wireless/ipw2x00/libipw_module.c b/drivers/net/wireless/ipw2x00/libipw_module.c
index 3adb240..854298d 100644
--- a/drivers/net/wireless/ipw2x00/libipw_module.c
+++ b/drivers/net/wireless/ipw2x00/libipw_module.c
@@ -30,6 +30,8 @@
 
 *******************************************************************************/
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/compiler.h>
 #include <linux/errno.h>
 #include <linux/if_arp.h>
@@ -269,8 +271,7 @@ static ssize_t debug_level_proc_write(struct file *file,
 		return count;
 	buf[len] = 0;
 	if (sscanf(buf, "%li", &val) != 1)
-		printk(KERN_INFO DRV_NAME
-		       ": %s is not in hex or decimal form.\n", buf);
+		pr_info("%s is not in hex or decimal form\n", buf);
 	else
 		libipw_debug_level = val;
 
@@ -308,8 +309,8 @@ static int __init libipw_init(void)
 	}
 #endif				/* CONFIG_LIBIPW_DEBUG */
 
-	printk(KERN_INFO DRV_NAME ": " DRV_DESCRIPTION ", " DRV_VERSION "\n");
-	printk(KERN_INFO DRV_NAME ": " DRV_COPYRIGHT "\n");
+	pr_info(DRV_DESCRIPTION ", " DRV_VERSION "\n");
+	pr_info(DRV_COPYRIGHT "\n");
 
 	return 0;
 }
diff --git a/drivers/net/wireless/ipw2x00/libipw_rx.c b/drivers/net/wireless/ipw2x00/libipw_rx.c
index 02e0579..9d03758 100644
--- a/drivers/net/wireless/ipw2x00/libipw_rx.c
+++ b/drivers/net/wireless/ipw2x00/libipw_rx.c
@@ -13,6 +13,8 @@
  * more details.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/compiler.h>
 #include <linux/errno.h>
 #include <linux/if_arp.h>
@@ -172,8 +174,8 @@ libipw_rx_frame_mgmt(struct libipw_device *ieee, struct sk_buff *skb,
 			u16 stype)
 {
 	if (ieee->iw_mode == IW_MODE_MASTER) {
-		printk(KERN_DEBUG "%s: Master mode not yet supported.\n",
-		       ieee->dev->name);
+		pr_debug("%s: Master mode not yet supported\n",
+			 ieee->dev->name);
 		return 0;
 /*
   hostap_update_sta_ps(ieee, (struct hostap_libipw_hdr_4addr *)
@@ -201,9 +203,8 @@ libipw_rx_frame_mgmt(struct libipw_device *ieee, struct sk_buff *skb,
 
 	if (ieee->iw_mode == IW_MODE_MASTER) {
 		if (type != WLAN_FC_TYPE_MGMT && type != WLAN_FC_TYPE_CTRL) {
-			printk(KERN_DEBUG "%s: unknown management frame "
-			       "(type=0x%02x, stype=0x%02x) dropped\n",
-			       skb->dev->name, type, stype);
+			pr_debug("%s: unknown management frame (type=0x%02x, stype=0x%02x) dropped\n",
+				 skb->dev->name, type, stype);
 			return -1;
 		}
 
@@ -211,8 +212,8 @@ libipw_rx_frame_mgmt(struct libipw_device *ieee, struct sk_buff *skb,
 		return 0;
 	}
 
-	printk(KERN_DEBUG "%s: hostap_rx_frame_mgmt: management frame "
-	       "received in non-Host AP mode\n", skb->dev->name);
+	pr_debug("%s: %s: management frame received in non-Host AP mode\n",
+		 __func__, skb->dev->name);
 	return -1;
 }
 #endif
@@ -317,9 +318,8 @@ libipw_rx_frame_decrypt_msdu(struct libipw_device *ieee,
 	res = crypt->ops->decrypt_msdu(skb, keyidx, hdrlen, crypt->priv);
 	atomic_dec(&crypt->refcnt);
 	if (res < 0) {
-		printk(KERN_DEBUG "%s: MSDU decryption/MIC verification failed"
-		       " (SA=%pM keyidx=%d)\n", ieee->dev->name, hdr->addr2,
-		       keyidx);
+		pr_debug("%s: MSDU decryption/MIC verification failed (SA=%pM keyidx=%d)\n",
+			 ieee->dev->name, hdr->addr2, keyidx);
 		return -1;
 	}
 
@@ -355,7 +355,7 @@ int libipw_rx(struct libipw_device *ieee, struct sk_buff *skb,
 
 	hdr = (struct libipw_hdr_4addr *)skb->data;
 	if (skb->len < 10) {
-		printk(KERN_INFO "%s: SKB length < 10\n", dev->name);
+		pr_info("%s: SKB length < 10\n", dev->name);
 		goto rx_dropped;
 	}
 
@@ -367,8 +367,7 @@ int libipw_rx(struct libipw_device *ieee, struct sk_buff *skb,
 	hdrlen = libipw_get_hdrlen(fc);
 
 	if (skb->len < hdrlen) {
-		printk(KERN_INFO "%s: invalid SKB length %d\n",
-			dev->name, skb->len);
+		pr_info("%s: invalid SKB length %d\n", dev->name, skb->len);
 		goto rx_dropped;
 	}
 
@@ -469,8 +468,8 @@ int libipw_rx(struct libipw_device *ieee, struct sk_buff *skb,
 		if (type == WLAN_FC_TYPE_MGMT && stype == WLAN_FC_STYPE_AUTH &&
 		    fc & IEEE80211_FCTL_PROTECTED && ieee->host_decrypt &&
 		    (keyidx = hostap_rx_frame_decrypt(ieee, skb, crypt)) < 0) {
-			printk(KERN_DEBUG "%s: failed to decrypt mgmt::auth "
-			       "from %pM\n", dev->name, hdr->addr2);
+			pr_debug("%s: failed to decrypt mgmt::auth from %pM\n",
+				 dev->name, hdr->addr2);
 			/* TODO: could inform hostapd about this so that it
 			 * could send auth failure report */
 			goto rx_dropped;
@@ -598,9 +597,8 @@ int libipw_rx(struct libipw_device *ieee, struct sk_buff *skb,
 			flen -= hdrlen;
 
 		if (frag_skb->tail + flen > frag_skb->end) {
-			printk(KERN_WARNING "%s: host decrypted and "
-			       "reassembled frame did not fit skb\n",
-			       dev->name);
+			pr_warn("%s: host decrypted and reassembled frame did not fit skb\n",
+				dev->name);
 			libipw_frag_cache_invalidate(ieee, hdr);
 			goto rx_dropped;
 		}
@@ -715,8 +713,7 @@ int libipw_rx(struct libipw_device *ieee, struct sk_buff *skb,
 	 * the received frame. */
 	if (ieee->ieee802_1x && ieee->iw_mode == IW_MODE_MASTER) {
 		if (ethertype == ETH_P_PAE) {
-			printk(KERN_DEBUG "%s: RX: IEEE 802.1X frame\n",
-			       dev->name);
+			pr_debug("%s: RX: IEEE 802.1X frame\n", dev->name);
 			if (ieee->hostapd && ieee->apdev) {
 				/* Send IEEE 802.1X frames to the user
 				 * space daemon for processing */
@@ -727,9 +724,8 @@ int libipw_rx(struct libipw_device *ieee, struct sk_buff *skb,
 				goto rx_exit;
 			}
 		} else if (!frame_authorized) {
-			printk(KERN_DEBUG "%s: dropped frame from "
-			       "unauthorized port (IEEE 802.1X): "
-			       "ethertype=0x%04x\n", dev->name, ethertype);
+			pr_debug("%s: dropped frame from unauthorized port (IEEE 802.1X): ethertype=0x%04x\n",
+				 dev->name, ethertype);
 			goto rx_dropped;
 		}
 	}
@@ -778,8 +774,8 @@ int libipw_rx(struct libipw_device *ieee, struct sk_buff *skb,
 			ieee->ap->bridged_multicast++;
 			skb2 = skb_clone(skb, GFP_ATOMIC);
 			if (skb2 == NULL)
-				printk(KERN_DEBUG "%s: skb_clone failed for "
-				       "multicast frame\n", dev->name);
+				pr_debug("%s: skb_clone failed for multicast frame\n",
+					 dev->name);
 		} else if (hostap_is_sta_assoc(ieee->ap, dst)) {
 			/* send frame directly to the associated STA using
 			 * wireless media and not passing to higher layers */
@@ -1277,8 +1273,7 @@ static int libipw_parse_info_param(struct libipw_info_element
 			break;
 
 		case WLAN_EID_QOS_PARAMETER:
-			printk(KERN_ERR
-			       "QoS Error need to parse QOS_PARAMETER IE\n");
+			pr_err("QoS Error need to parse QOS_PARAMETER IE\n");
 			break;
 			/* 802.11h */
 		case WLAN_EID_PWR_CONSTRAINT:
diff --git a/drivers/net/wireless/ipw2x00/libipw_tx.c b/drivers/net/wireless/ipw2x00/libipw_tx.c
index e8c0398..a06e081 100644
--- a/drivers/net/wireless/ipw2x00/libipw_tx.c
+++ b/drivers/net/wireless/ipw2x00/libipw_tx.c
@@ -23,6 +23,9 @@
   Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
 
 ******************************************************************************/
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/compiler.h>
 #include <linux/errno.h>
 #include <linux/if_arp.h>
@@ -168,7 +171,7 @@ static int libipw_encrypt_fragment(struct libipw_device *ieee,
 
 	atomic_dec(&crypt->refcnt);
 	if (res < 0) {
-		printk(KERN_INFO "%s: Encryption failed: len=%d.\n",
+		pr_info("%s: Encryption failed: len=%d.\n",
 		       ieee->dev->name, frag->len);
 		ieee->ieee_stats.tx_discards++;
 		return -1;
@@ -282,12 +285,12 @@ netdev_tx_t libipw_xmit(struct sk_buff *skb, struct net_device *dev)
 	/* If there is no driver handler to take the TXB, dont' bother
 	 * creating it... */
 	if (!ieee->hard_start_xmit) {
-		printk(KERN_WARNING "%s: No xmit handler.\n", ieee->dev->name);
+		pr_warn("%s: No xmit handler.\n", ieee->dev->name);
 		goto success;
 	}
 
 	if (unlikely(skb->len < SNAP_SIZE + sizeof(u16))) {
-		printk(KERN_WARNING "%s: skb too small (%d).\n",
+		pr_warn("%s: skb too small (%d).\n",
 		       ieee->dev->name, skb->len);
 		goto success;
 	}
@@ -426,7 +429,7 @@ netdev_tx_t libipw_xmit(struct sk_buff *skb, struct net_device *dev)
 	txb = libipw_alloc_txb(nr_frags, frag_size,
 				  ieee->tx_headroom, GFP_ATOMIC);
 	if (unlikely(!txb)) {
-		printk(KERN_WARNING "%s: Could not allocate TXB\n",
+		pr_warn("%s: Could not allocate TXB\n",
 		       ieee->dev->name);
 		goto failed;
 	}
diff --git a/drivers/net/wireless/ipw2x00/libipw_wx.c b/drivers/net/wireless/ipw2x00/libipw_wx.c
index 1571505..631a1a1 100644
--- a/drivers/net/wireless/ipw2x00/libipw_wx.c
+++ b/drivers/net/wireless/ipw2x00/libipw_wx.c
@@ -30,6 +30,8 @@
 
 ******************************************************************************/
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/hardirq.h>
 #include <linux/kmod.h>
 #include <linux/slab.h>
@@ -403,7 +405,7 @@ int libipw_wx_set_encode(struct libipw_device *ieee,
 			kfree(new_crypt);
 			new_crypt = NULL;
 
-			printk(KERN_WARNING "%s: could not initialize WEP: "
+			pr_warn("%s: could not initialize WEP: "
 			       "load module lib80211_crypt_wep\n", dev->name);
 			return -EOPNOTSUPP;
 		}
-- 
1.7.8.111.gad25c.dirty

^ permalink raw reply related

* [PATCH wireless-next 09/20] libertas: Use pr_<level>
From: Joe Perches @ 2012-06-15  5:53 UTC (permalink / raw)
  To: Dan Williams
  Cc: John W. Linville, libertas-dev, linux-wireless, netdev,
	linux-kernel
In-Reply-To: <cover.1339739415.git.joe@perches.com>

Use a more current logging style.

Convert printks to pr_<level>.
Convert printk(KERN_DEBUG to pr_debug(.
Coalesce formats, align arguments.

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/wireless/libertas/cmd.c     |    2 ++
 drivers/net/wireless/libertas/cmdresp.c |    2 ++
 drivers/net/wireless/libertas/if_cs.c   |   14 ++++++--------
 drivers/net/wireless/libertas/if_sdio.c |    6 +++---
 drivers/net/wireless/libertas/if_spi.c  |    4 ++--
 drivers/net/wireless/libertas/if_usb.c  |    4 ++--
 drivers/net/wireless/libertas/tx.c      |    3 +++
 7 files changed, 20 insertions(+), 15 deletions(-)

diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index d798bcc..7f7da1f 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -3,6 +3,8 @@
  * It prepares command and sends it to firmware when it is ready.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/hardirq.h>
 #include <linux/kfifo.h>
 #include <linux/sched.h>
diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c
index 178b222..a15ac8e 100644
--- a/drivers/net/wireless/libertas/cmdresp.c
+++ b/drivers/net/wireless/libertas/cmdresp.c
@@ -3,6 +3,8 @@
  * responses as well as events generated by firmware.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/hardirq.h>
 #include <linux/slab.h>
 #include <linux/delay.h>
diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c
index 16beaf3..79ed0d0 100644
--- a/drivers/net/wireless/libertas/if_cs.c
+++ b/drivers/net/wireless/libertas/if_cs.c
@@ -110,14 +110,14 @@ static inline unsigned int if_cs_read8(struct if_cs_card *card, uint reg)
 {
 	unsigned int val = ioread8(card->iobase + reg);
 	if (debug_output)
-		printk(KERN_INFO "inb %08x<%02x\n", reg, val);
+		pr_info("inb %08x<%02x\n", reg, val);
 	return val;
 }
 static inline unsigned int if_cs_read16(struct if_cs_card *card, uint reg)
 {
 	unsigned int val = ioread16(card->iobase + reg);
 	if (debug_output)
-		printk(KERN_INFO "inw %08x<%04x\n", reg, val);
+		pr_info("inw %08x<%04x\n", reg, val);
 	return val;
 }
 static inline void if_cs_read16_rep(
@@ -127,22 +127,21 @@ static inline void if_cs_read16_rep(
 	unsigned long count)
 {
 	if (debug_output)
-		printk(KERN_INFO "insw %08x<(0x%lx words)\n",
-			reg, count);
+		pr_info("insw %08x<(0x%lx words)\n", reg, count);
 	ioread16_rep(card->iobase + reg, buf, count);
 }
 
 static inline void if_cs_write8(struct if_cs_card *card, uint reg, u8 val)
 {
 	if (debug_output)
-		printk(KERN_INFO "outb %08x>%02x\n", reg, val);
+		pr_info("outb %08x>%02x\n", reg, val);
 	iowrite8(val, card->iobase + reg);
 }
 
 static inline void if_cs_write16(struct if_cs_card *card, uint reg, u16 val)
 {
 	if (debug_output)
-		printk(KERN_INFO "outw %08x>%04x\n", reg, val);
+		pr_info("outw %08x>%04x\n", reg, val);
 	iowrite16(val, card->iobase + reg);
 }
 
@@ -153,8 +152,7 @@ static inline void if_cs_write16_rep(
 	unsigned long count)
 {
 	if (debug_output)
-		printk(KERN_INFO "outsw %08x>(0x%lx words)\n",
-			reg, count);
+		pr_info("outsw %08x>(0x%lx words)\n", reg, count);
 	iowrite16_rep(card->iobase + reg, buf, count);
 }
 
diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c
index 76caeba..860555a 100644
--- a/drivers/net/wireless/libertas/if_sdio.c
+++ b/drivers/net/wireless/libertas/if_sdio.c
@@ -1063,7 +1063,7 @@ static void if_sdio_reset_card_worker(struct work_struct *work)
 	 * instance for that reason.
 	 */
 
-	pr_info("Resetting card...");
+	pr_info("Resetting card...\n");
 	mmc_remove_host(reset_host);
 	mmc_add_host(reset_host);
 }
@@ -1391,8 +1391,8 @@ static int __init if_sdio_init_module(void)
 
 	lbs_deb_enter(LBS_DEB_SDIO);
 
-	printk(KERN_INFO "libertas_sdio: Libertas SDIO driver\n");
-	printk(KERN_INFO "libertas_sdio: Copyright Pierre Ossman\n");
+	pr_info("Libertas SDIO driver\n");
+	pr_info("Copyright Pierre Ossman\n");
 
 	ret = sdio_register_driver(&if_sdio_driver);
 
diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
index 9604a1c..aca22aa 100644
--- a/drivers/net/wireless/libertas/if_spi.c
+++ b/drivers/net/wireless/libertas/if_spi.c
@@ -624,7 +624,7 @@ static int if_spi_prog_main_firmware(struct if_spi_card *card,
 		if (crc_err) {
 			/* Previous transfer failed. */
 			if (++num_crc_errs > MAX_MAIN_FW_LOAD_CRC_ERR) {
-				pr_err("Too many CRC errors encountered in firmware load.\n");
+				pr_err("Too many CRC errors encountered in firmware load\n");
 				err = -EIO;
 				goto out;
 			}
@@ -1301,7 +1301,7 @@ static int __init if_spi_init_module(void)
 {
 	int ret = 0;
 	lbs_deb_enter(LBS_DEB_SPI);
-	printk(KERN_INFO "libertas_spi: Libertas SPI driver\n");
+	pr_info("Libertas SPI driver\n");
 	ret = spi_register_driver(&libertas_spi_driver);
 	lbs_deb_leave(LBS_DEB_SPI);
 	return ret;
diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
index cd3b0d4..8b5d0f3 100644
--- a/drivers/net/wireless/libertas/if_usb.c
+++ b/drivers/net/wireless/libertas/if_usb.c
@@ -180,7 +180,7 @@ static void if_usb_fw_timeo(unsigned long priv)
 #ifdef CONFIG_OLPC
 static void if_usb_reset_olpc_card(struct lbs_private *priv)
 {
-	printk(KERN_CRIT "Resetting OLPC wireless via EC...\n");
+	pr_crit("Resetting OLPC wireless via EC...\n");
 	olpc_ec_cmd(0x25, NULL, 0, NULL, 0);
 }
 #endif
@@ -544,7 +544,7 @@ static void if_usb_receive_fwload(struct urb *urb)
 				cardp->bootcmdresp = -1;
 			} else {
 				pr_info("boot cmd response wrong magic number (0x%x)\n",
-					    le32_to_cpu(bootcmdresp.magic));
+					le32_to_cpu(bootcmdresp.magic));
 			}
 		} else if ((bootcmdresp.cmd != BOOT_CMD_FW_BY_USB) &&
 			   (bootcmdresp.cmd != BOOT_CMD_UPDATE_FW) &&
diff --git a/drivers/net/wireless/libertas/tx.c b/drivers/net/wireless/libertas/tx.c
index c025f9c..cb60fa4 100644
--- a/drivers/net/wireless/libertas/tx.c
+++ b/drivers/net/wireless/libertas/tx.c
@@ -1,6 +1,9 @@
 /*
  * This file contains the handling of TX in wlan driver.
  */
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/hardirq.h>
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
-- 
1.7.8.111.gad25c.dirty

^ permalink raw reply related

* [PATCH wireless-next 10/20] libertas_tf: Use pr_<level>
From: Joe Perches @ 2012-06-15  5:53 UTC (permalink / raw)
  To: linux-kernel; +Cc: John W. Linville, linux-wireless, netdev
In-Reply-To: <cover.1339739415.git.joe@perches.com>

Use a more current logging style.

Convert printks to pr_<level>.
Convert printk(KERN_DEBUG to pr_debug(.
Coalesce formats, align arguments.
Neaten debug logging macros.

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/wireless/libertas_tf/cmd.c      |   12 ++--
 drivers/net/wireless/libertas_tf/deb_defs.h |  105 ++++++++++++++++++---------
 drivers/net/wireless/libertas_tf/if_usb.c   |    2 +-
 drivers/net/wireless/libertas_tf/main.c     |   14 ++--
 4 files changed, 83 insertions(+), 50 deletions(-)

diff --git a/drivers/net/wireless/libertas_tf/cmd.c b/drivers/net/wireless/libertas_tf/cmd.c
index 909ac36..d72e1a5 100644
--- a/drivers/net/wireless/libertas_tf/cmd.c
+++ b/drivers/net/wireless/libertas_tf/cmd.c
@@ -7,6 +7,7 @@
  *  the Free Software Foundation; either version 2 of the License, or (at
  *  your option) any later version.
  */
+
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
 #include <linux/hardirq.h>
@@ -103,7 +104,7 @@ int lbtf_update_hw_spec(struct lbtf_private *priv)
 	priv->fwrelease = (priv->fwrelease << 8) |
 		(priv->fwrelease >> 24 & 0xff);
 
-	printk(KERN_INFO "libertastf: %pM, fw %u.%u.%up%u, cap 0x%08x\n",
+	pr_info("%pM, fw %u.%u.%up%u, cap 0x%08x\n",
 		cmd.permanentaddr,
 		priv->fwrelease >> 24 & 0xff,
 		priv->fwrelease >> 16 & 0xff,
@@ -686,15 +687,14 @@ int __lbtf_cmd(struct lbtf_private *priv, uint16_t command,
 				       cmdnode->cmdwaitqwoken);
 	if (ret) {
 		pr_info("PREP_CMD: command 0x%04x interrupted by signal: %d\n",
-			    command, ret);
+			command, ret);
 		goto done;
 	}
 
 	spin_lock_irqsave(&priv->driver_lock, flags);
 	ret = cmdnode->result;
 	if (ret)
-		pr_info("PREP_CMD: command 0x%04x failed: %d\n",
-			    command, ret);
+		pr_info("PREP_CMD: command 0x%04x failed: %d\n", command, ret);
 
 	__lbtf_cleanup_and_insert_cmd(priv, cmdnode);
 	spin_unlock_irqrestore(&priv->driver_lock, flags);
@@ -738,7 +738,7 @@ int lbtf_process_rx_command(struct lbtf_private *priv)
 	result = le16_to_cpu(resp->result);
 
 	if (net_ratelimit())
-		pr_info("libertastf: cmd response 0x%04x, seq %d, size %d\n",
+		pr_info("cmd response 0x%04x, seq %d, size %d\n",
 			respcmd, le16_to_cpu(resp->seqnum),
 			le16_to_cpu(resp->size));
 
@@ -775,7 +775,7 @@ int lbtf_process_rx_command(struct lbtf_private *priv)
 		switch (respcmd) {
 		case CMD_RET(CMD_GET_HW_SPEC):
 		case CMD_RET(CMD_802_11_RESET):
-			pr_info("libertastf: reset failed\n");
+			pr_info("reset failed\n");
 			break;
 
 		}
diff --git a/drivers/net/wireless/libertas_tf/deb_defs.h b/drivers/net/wireless/libertas_tf/deb_defs.h
index 4bd3dc5..643c31d 100644
--- a/drivers/net/wireless/libertas_tf/deb_defs.h
+++ b/drivers/net/wireless/libertas_tf/deb_defs.h
@@ -45,45 +45,78 @@ extern unsigned int lbtf_debug;
 
 
 #ifdef DEBUG
-#define LBTF_DEB_LL(grp, grpnam, fmt, args...) \
-do { if ((lbtf_debug & (grp)) == (grp)) \
-  printk(KERN_DEBUG DRV_NAME grpnam "%s: " fmt, \
-         in_interrupt() ? " (INT)" : "", ## args); } while (0)
+#define LBTF_DEB_LL(grp, grpnam, fmt, ...)				\
+do {									\
+	if ((lbtf_debug & (grp)) == (grp))				\
+		pr_debug(grpnam "%s: " fmt,				\
+			 in_interrupt() ? " (INT)" : "",		\
+			 ##__VA_ARGS__);				\
+} while (0)
 #else
-#define LBTF_DEB_LL(grp, grpnam, fmt, args...) do {} while (0)
+#define LBTF_DEB_LL(grp, grpnam, fmt, ...)				\
+do {									\
+	if (0)								\
+		pr_debug(grpnam "%s: " fmt,				\
+			 in_interrupt() ? " (INT)" : "",		\
+			 ##__VA_ARGS__);				\
+} while (0)
 #endif
 
-#define lbtf_deb_enter(grp) \
-  LBTF_DEB_LL(grp | LBTF_DEB_ENTER, " enter", "%s()\n", __func__);
-#define lbtf_deb_enter_args(grp, fmt, args...) \
-  LBTF_DEB_LL(grp | LBTF_DEB_ENTER, " enter", "%s(" fmt ")\n", __func__, ## args);
-#define lbtf_deb_leave(grp) \
-  LBTF_DEB_LL(grp | LBTF_DEB_LEAVE, " leave", "%s()\n", __func__);
-#define lbtf_deb_leave_args(grp, fmt, args...) \
-  LBTF_DEB_LL(grp | LBTF_DEB_LEAVE, " leave", "%s(), " fmt "\n", \
-  __func__, ##args);
-#define lbtf_deb_main(fmt, args...)      LBTF_DEB_LL(LBTF_DEB_MAIN, " main", fmt, ##args)
-#define lbtf_deb_net(fmt, args...)       LBTF_DEB_LL(LBTF_DEB_NET, " net", fmt, ##args)
-#define lbtf_deb_mesh(fmt, args...)      LBTF_DEB_LL(LBTF_DEB_MESH, " mesh", fmt, ##args)
-#define lbtf_deb_wext(fmt, args...)      LBTF_DEB_LL(LBTF_DEB_WEXT, " wext", fmt, ##args)
-#define lbtf_deb_ioctl(fmt, args...)     LBTF_DEB_LL(LBTF_DEB_IOCTL, " ioctl", fmt, ##args)
-#define lbtf_deb_scan(fmt, args...)      LBTF_DEB_LL(LBTF_DEB_SCAN, " scan", fmt, ##args)
-#define lbtf_deb_assoc(fmt, args...)     LBTF_DEB_LL(LBTF_DEB_ASSOC, " assoc", fmt, ##args)
-#define lbtf_deb_join(fmt, args...)      LBTF_DEB_LL(LBTF_DEB_JOIN, " join", fmt, ##args)
-#define lbtf_deb_11d(fmt, args...)       LBTF_DEB_LL(LBTF_DEB_11D, " 11d", fmt, ##args)
-#define lbtf_deb_debugfs(fmt, args...)   LBTF_DEB_LL(LBTF_DEB_DEBUGFS, " debugfs", fmt, ##args)
-#define lbtf_deb_ethtool(fmt, args...)   LBTF_DEB_LL(LBTF_DEB_ETHTOOL, " ethtool", fmt, ##args)
-#define lbtf_deb_host(fmt, args...)      LBTF_DEB_LL(LBTF_DEB_HOST, " host", fmt, ##args)
-#define lbtf_deb_cmd(fmt, args...)       LBTF_DEB_LL(LBTF_DEB_CMD, " cmd", fmt, ##args)
-#define lbtf_deb_rx(fmt, args...)        LBTF_DEB_LL(LBTF_DEB_RX, " rx", fmt, ##args)
-#define lbtf_deb_tx(fmt, args...)        LBTF_DEB_LL(LBTF_DEB_TX, " tx", fmt, ##args)
-#define lbtf_deb_fw(fmt, args...)        LBTF_DEB_LL(LBTF_DEB_FW, " fw", fmt, ##args)
-#define lbtf_deb_usb(fmt, args...)       LBTF_DEB_LL(LBTF_DEB_USB, " usb", fmt, ##args)
-#define lbtf_deb_usbd(dev, fmt, args...) LBTF_DEB_LL(LBTF_DEB_USB, " usbd", "%s:" fmt, dev_name(dev), ##args)
-#define lbtf_deb_cs(fmt, args...)        LBTF_DEB_LL(LBTF_DEB_CS, " cs", fmt, ##args)
-#define lbtf_deb_thread(fmt, args...)    LBTF_DEB_LL(LBTF_DEB_THREAD, " thread", fmt, ##args)
-#define lbtf_deb_sdio(fmt, args...)      LBTF_DEB_LL(LBTF_DEB_SDIO, " thread", fmt, ##args)
-#define lbtf_deb_macops(fmt, args...)      LBTF_DEB_LL(LBTF_DEB_MACOPS, " thread", fmt, ##args)
+#define lbtf_deb_enter(grp)						\
+	LBTF_DEB_LL(grp | LBTF_DEB_ENTER, "enter", "%s()\n", __func__);
+#define lbtf_deb_enter_args(grp, fmt, ...)				\
+	LBTF_DEB_LL(grp | LBTF_DEB_ENTER, "enter", "%s(" fmt ")\n",	\
+		    __func__, ##__VA_ARGS__);
+#define lbtf_deb_leave(grp)						\
+	LBTF_DEB_LL(grp | LBTF_DEB_LEAVE, "leave", "%s()\n", __func__);
+#define lbtf_deb_leave_args(grp, fmt, ...)				\
+	LBTF_DEB_LL(grp | LBTF_DEB_LEAVE, "leave", "%s(), " fmt "\n",	\
+		    __func__, ##__VA_ARGS__);
+#define lbtf_deb_main(fmt, ...)						\
+	LBTF_DEB_LL(LBTF_DEB_MAIN, "main", fmt, ##__VA_ARGS__)
+#define lbtf_deb_net(fmt, ...)						\
+	LBTF_DEB_LL(LBTF_DEB_NET, "net", fmt, ##__VA_ARGS__)
+#define lbtf_deb_mesh(fmt, ...)						\
+	LBTF_DEB_LL(LBTF_DEB_MESH, "mesh", fmt, ##__VA_ARGS__)
+#define lbtf_deb_wext(fmt, ...)						\
+	LBTF_DEB_LL(LBTF_DEB_WEXT, "wext", fmt, ##__VA_ARGS__)
+#define lbtf_deb_ioctl(fmt, ...)					\
+	LBTF_DEB_LL(LBTF_DEB_IOCTL, "ioctl", fmt, ##__VA_ARGS__)
+#define lbtf_deb_scan(fmt, ...)						\
+	LBTF_DEB_LL(LBTF_DEB_SCAN, "scan", fmt, ##__VA_ARGS__)
+#define lbtf_deb_assoc(fmt, ...)					\
+	LBTF_DEB_LL(LBTF_DEB_ASSOC, "assoc", fmt, ##__VA_ARGS__)
+#define lbtf_deb_join(fmt, ...)						\
+	LBTF_DEB_LL(LBTF_DEB_JOIN, "join", fmt, ##__VA_ARGS__)
+#define lbtf_deb_11d(fmt, ...)						\
+	LBTF_DEB_LL(LBTF_DEB_11D, "11d", fmt, ##__VA_ARGS__)
+#define lbtf_deb_debugfs(fmt, ...)					\
+	LBTF_DEB_LL(LBTF_DEB_DEBUGFS, "debugfs", fmt, ##__VA_ARGS__)
+#define lbtf_deb_ethtool(fmt, ...)					\
+	LBTF_DEB_LL(LBTF_DEB_ETHTOOL, "ethtool", fmt, ##__VA_ARGS__)
+#define lbtf_deb_host(fmt, ...)						\
+	LBTF_DEB_LL(LBTF_DEB_HOST, "host", fmt, ##__VA_ARGS__)
+#define lbtf_deb_cmd(fmt, ...)						\
+	LBTF_DEB_LL(LBTF_DEB_CMD, "cmd", fmt, ##__VA_ARGS__)
+#define lbtf_deb_rx(fmt, ...)						\
+        LBTF_DEB_LL(LBTF_DEB_RX, "rx", fmt, ##__VA_ARGS__)
+#define lbtf_deb_tx(fmt, ...)						\
+        LBTF_DEB_LL(LBTF_DEB_TX, "tx", fmt, ##__VA_ARGS__)
+#define lbtf_deb_fw(fmt, ...)						\
+        LBTF_DEB_LL(LBTF_DEB_FW, "fw", fmt, ##__VA_ARGS__)
+#define lbtf_deb_usb(fmt, ...)						\
+	LBTF_DEB_LL(LBTF_DEB_USB, "usb", fmt, ##__VA_ARGS__)
+#define lbtf_deb_usbd(dev, fmt, ...)					\
+	LBTF_DEB_LL(LBTF_DEB_USB, "usbd", "%s:" fmt,			\
+		    dev_name(dev), ##__VA_ARGS__)
+#define lbtf_deb_cs(fmt, ...)						\
+        LBTF_DEB_LL(LBTF_DEB_CS, "cs", fmt, ##__VA_ARGS__)
+#define lbtf_deb_thread(fmt, ...)					\
+	LBTF_DEB_LL(LBTF_DEB_THREAD, "thread", fmt, ##__VA_ARGS__)
+#define lbtf_deb_sdio(fmt, ...)						\
+	LBTF_DEB_LL(LBTF_DEB_SDIO, "thread", fmt, ##__VA_ARGS__)
+#define lbtf_deb_macops(fmt, ...)					\
+	LBTF_DEB_LL(LBTF_DEB_MACOPS, "thread", fmt, ##__VA_ARGS__)
 
 #ifdef DEBUG
 static inline void lbtf_deb_hex(unsigned int grp, const char *prompt, u8 *buf, int len)
diff --git a/drivers/net/wireless/libertas_tf/if_usb.c b/drivers/net/wireless/libertas_tf/if_usb.c
index 19a5a92..eb1e917 100644
--- a/drivers/net/wireless/libertas_tf/if_usb.c
+++ b/drivers/net/wireless/libertas_tf/if_usb.c
@@ -524,7 +524,7 @@ static void if_usb_receive_fwload(struct urb *urb)
 				cardp->bootcmdresp = -1;
 			} else {
 				pr_info("boot cmd response wrong magic number (0x%x)\n",
-					    le32_to_cpu(bcmdresp.magic));
+					le32_to_cpu(bcmdresp.magic));
 			}
 		} else if (bcmdresp.cmd != BOOT_CMD_FW_BY_USB) {
 			pr_info("boot cmd response cmd_tag error (%d)\n",
diff --git a/drivers/net/wireless/libertas_tf/main.c b/drivers/net/wireless/libertas_tf/main.c
index a034572..b6ef46c 100644
--- a/drivers/net/wireless/libertas_tf/main.c
+++ b/drivers/net/wireless/libertas_tf/main.c
@@ -7,6 +7,7 @@
  *  the Free Software Foundation; either version 2 of the License, or (at
  *  your option) any later version.
  */
+
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
 #include <linux/hardirq.h>
@@ -181,13 +182,12 @@ static void command_timer_fn(unsigned long data)
 	spin_lock_irqsave(&priv->driver_lock, flags);
 
 	if (!priv->cur_cmd) {
-		printk(KERN_DEBUG "libertastf: command timer expired; "
-				  "no pending command\n");
+		pr_debug("command timer expired; no pending command\n");
 		goto out;
 	}
 
-	printk(KERN_DEBUG "libertas: command %x timed out\n",
-		le16_to_cpu(priv->cur_cmd->cmdbuf->command));
+	pr_debug("command %x timed out\n",
+		 le16_to_cpu(priv->cur_cmd->cmdbuf->command));
 
 	priv->cmd_timed_out = 1;
 	queue_work(lbtf_wq, &priv->cmd_work);
@@ -292,7 +292,7 @@ static void lbtf_tx_work(struct work_struct *work)
 	if (err) {
 		dev_kfree_skb_any(skb);
 		priv->tx_skb = NULL;
-		pr_err("TX error: %d", err);
+		pr_err("TX error: %d\n", err);
 	}
 	lbtf_deb_leave(LBTF_DEB_MACOPS | LBTF_DEB_TX);
 }
@@ -324,7 +324,7 @@ static int lbtf_op_start(struct ieee80211_hw *hw)
 		goto err_prog_firmware;
 	}
 
-	printk(KERN_INFO "libertastf: Marvell WLAN 802.11 thinfirm adapter\n");
+	pr_info("Marvell WLAN 802.11 thinfirm adapter\n");
 	lbtf_deb_leave(LBTF_DEB_MACOPS);
 	return 0;
 
@@ -745,7 +745,7 @@ static int __init lbtf_init_module(void)
 	lbtf_deb_enter(LBTF_DEB_MAIN);
 	lbtf_wq = create_workqueue("libertastf");
 	if (lbtf_wq == NULL) {
-		printk(KERN_ERR "libertastf: couldn't create workqueue\n");
+		pr_err("couldn't create workqueue\n");
 		return -ENOMEM;
 	}
 	lbtf_deb_leave(LBTF_DEB_MAIN);
-- 
1.7.8.111.gad25c.dirty

^ permalink raw reply related

* [PATCH wireless-next 11/20] mac80211_hwsim: Use pr_<level>
From: Joe Perches @ 2012-06-15  5:53 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless, netdev, linux-kernel
In-Reply-To: <cover.1339739415.git.joe@perches.com>

Use a more current logging style.

Convert printks to pr_<level>.
Convert printk(KERN_DEBUG to pr_debug(.
Coalesce formats, align arguments.

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/wireless/mac80211_hwsim.c |   61 ++++++++++++++------------------
 1 files changed, 27 insertions(+), 34 deletions(-)

diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index a0b7cfd..eae77d2 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -15,6 +15,8 @@
  * - RX filtering based on filter configuration (data->rx_filter)
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/list.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
@@ -578,7 +580,7 @@ static void mac80211_hwsim_tx_frame_nl(struct ieee80211_hw *hw,
 	msg_head = genlmsg_put(skb, 0, 0, &hwsim_genl_family, 0,
 			       HWSIM_CMD_FRAME);
 	if (msg_head == NULL) {
-		printk(KERN_DEBUG "mac80211_hwsim: problem with msg_head\n");
+		pr_debug("problem with msg_head\n");
 		goto nla_put_failure;
 	}
 
@@ -626,7 +628,7 @@ static void mac80211_hwsim_tx_frame_nl(struct ieee80211_hw *hw,
 	return;
 
 nla_put_failure:
-	printk(KERN_DEBUG "mac80211_hwsim: error occurred in %s\n", __func__);
+	pr_debug("error occurred in %s\n", __func__);
 }
 
 static bool mac80211_hwsim_tx_frame_no_nl(struct ieee80211_hw *hw,
@@ -1189,12 +1191,10 @@ static int mac80211_hwsim_hw_scan(struct ieee80211_hw *hw,
 	hsd->hw = hw;
 	INIT_DELAYED_WORK(&hsd->w, hw_scan_done);
 
-	printk(KERN_DEBUG "hwsim hw_scan request\n");
+	pr_debug("hw_scan request\n");
 	for (i = 0; i < req->n_channels; i++)
-		printk(KERN_DEBUG "hwsim hw_scan freq %d\n",
-			req->channels[i]->center_freq);
-	print_hex_dump(KERN_DEBUG, "scan IEs: ", DUMP_PREFIX_OFFSET,
-			16, 1, req->ie, req->ie_len, 1);
+		pr_debug("hw_scan freq %d\n", req->channels[i]->center_freq);
+	print_hex_dump_bytes("scan IEs: ", DUMP_PREFIX_OFFSET, req->ie, req->ie_len);
 
 	ieee80211_queue_delayed_work(hw, &hsd->w, 2 * HZ);
 
@@ -1208,11 +1208,11 @@ static void mac80211_hwsim_sw_scan(struct ieee80211_hw *hw)
 	mutex_lock(&hwsim->mutex);
 
 	if (hwsim->scanning) {
-		printk(KERN_DEBUG "two hwsim sw_scans detected!\n");
+		pr_debug("two hwsim sw_scans detected!\n");
 		goto out;
 	}
 
-	printk(KERN_DEBUG "hwsim sw_scan request, prepping stuff\n");
+	pr_debug("sw_scan request, prepping stuff\n");
 	hwsim->scanning = true;
 
 out:
@@ -1225,7 +1225,7 @@ static void mac80211_hwsim_sw_scan_complete(struct ieee80211_hw *hw)
 
 	mutex_lock(&hwsim->mutex);
 
-	printk(KERN_DEBUG "hwsim sw_scan_complete\n");
+	pr_debug("sw_scan_complete\n");
 	hwsim->scanning = false;
 
 	mutex_unlock(&hwsim->mutex);
@@ -1338,7 +1338,7 @@ static void hwsim_send_ps_poll(void *dat, u8 *mac, struct ieee80211_vif *vif)
 		return mac80211_hwsim_tx_frame_nl(data->hw, skb, _pid);
 
 	if (!mac80211_hwsim_tx_frame_no_nl(data->hw, skb))
-		printk(KERN_DEBUG "%s: PS-poll frame not ack'ed\n", __func__);
+		pr_debug("%s: PS-poll frame not ack'ed\n", __func__);
 	dev_kfree_skb(skb);
 }
 
@@ -1377,7 +1377,7 @@ static void hwsim_send_nullfunc(struct mac80211_hwsim_data *data, u8 *mac,
 		return mac80211_hwsim_tx_frame_nl(data->hw, skb, _pid);
 
 	if (!mac80211_hwsim_tx_frame_no_nl(data->hw, skb))
-		printk(KERN_DEBUG "%s: nullfunc frame not ack'ed\n", __func__);
+		pr_debug("%s: nullfunc frame not ack'ed\n", __func__);
 	dev_kfree_skb(skb);
 }
 
@@ -1621,7 +1621,7 @@ static int hwsim_cloned_frame_received_nl(struct sk_buff *skb_2,
 
 	return 0;
 err:
-	printk(KERN_DEBUG "mac80211_hwsim: error occurred in %s\n", __func__);
+	pr_debug("error occurred in %s\n", __func__);
 	goto out;
 out:
 	dev_kfree_skb(skb);
@@ -1636,12 +1636,12 @@ static int hwsim_register_received_nl(struct sk_buff *skb_2,
 
 	wmediumd_pid = info->snd_pid;
 
-	printk(KERN_DEBUG "mac80211_hwsim: received a REGISTER, "
-	       "switching to wmediumd mode with pid %d\n", info->snd_pid);
+	pr_debug("received a REGISTER, switching to wmediumd mode with pid %d\n",
+		 info->snd_pid);
 
 	return 0;
 out:
-	printk(KERN_DEBUG "mac80211_hwsim: error occurred in %s\n", __func__);
+	pr_debug("error occurred in %s\n", __func__);
 	return -EINVAL;
 }
 
@@ -1675,8 +1675,7 @@ static int mac80211_hwsim_netlink_notify(struct notifier_block *nb,
 		return NOTIFY_DONE;
 
 	if (notify->pid == wmediumd_pid) {
-		printk(KERN_INFO "mac80211_hwsim: wmediumd released netlink"
-		       " socket, switching to perfect channel medium\n");
+		pr_info("wmediumd released netlink socket, switching to perfect channel medium\n");
 		wmediumd_pid = 0;
 	}
 	return NOTIFY_DONE;
@@ -1690,7 +1689,7 @@ static struct notifier_block hwsim_netlink_notifier = {
 static int hwsim_init_netlink(void)
 {
 	int rc;
-	printk(KERN_INFO "mac80211_hwsim: initializing netlink\n");
+	pr_info("initializing netlink\n");
 
 	rc = genl_register_family_with_ops(&hwsim_genl_family,
 		hwsim_ops, ARRAY_SIZE(hwsim_ops));
@@ -1704,7 +1703,7 @@ static int hwsim_init_netlink(void)
 	return 0;
 
 failure:
-	printk(KERN_DEBUG "mac80211_hwsim: error occurred in %s\n", __func__);
+	pr_debug("error occurred in %s\n", __func__);
 	return -EINVAL;
 }
 
@@ -1712,14 +1711,13 @@ static void hwsim_exit_netlink(void)
 {
 	int ret;
 
-	printk(KERN_INFO "mac80211_hwsim: closing netlink\n");
+	pr_info("closing netlink\n");
 	/* unregister the notifier */
 	netlink_unregister_notifier(&hwsim_netlink_notifier);
 	/* unregister the family */
 	ret = genl_unregister_family(&hwsim_genl_family);
 	if (ret)
-		printk(KERN_DEBUG "mac80211_hwsim: "
-		       "unregister family %i\n", ret);
+		pr_debug("unregister family %i\n", ret);
 }
 
 static const struct ieee80211_iface_limit hwsim_if_limits[] = {
@@ -1768,12 +1766,10 @@ static int __init init_mac80211_hwsim(void)
 	addr[0] = 0x02;
 
 	for (i = 0; i < radios; i++) {
-		printk(KERN_DEBUG "mac80211_hwsim: Initializing radio %d\n",
-		       i);
+		pr_debug("Initializing radio %d\n", i);
 		hw = ieee80211_alloc_hw(sizeof(*data), &mac80211_hwsim_ops);
 		if (!hw) {
-			printk(KERN_DEBUG "mac80211_hwsim: ieee80211_alloc_hw "
-			       "failed\n");
+			pr_debug("ieee80211_alloc_hw failed\n");
 			err = -ENOMEM;
 			goto failed;
 		}
@@ -1783,9 +1779,7 @@ static int __init init_mac80211_hwsim(void)
 		data->dev = device_create(hwsim_class, NULL, 0, hw,
 					  "hwsim%d", i);
 		if (IS_ERR(data->dev)) {
-			printk(KERN_DEBUG
-			       "mac80211_hwsim: device_create "
-			       "failed (%ld)\n", PTR_ERR(data->dev));
+			pr_debug("device_create failed (%ld)\n", PTR_ERR(data->dev));
 			err = -ENOMEM;
 			goto failed_drvdata;
 		}
@@ -1946,8 +1940,7 @@ static int __init init_mac80211_hwsim(void)
 			schedule_timeout_interruptible(1);
 		err = ieee80211_register_hw(hw);
 		if (err < 0) {
-			printk(KERN_DEBUG "mac80211_hwsim: "
-			       "ieee80211_register_hw failed (%d)\n", err);
+			pr_debug("ieee80211_register_hw failed (%d)\n", err);
 			goto failed_hw;
 		}
 
@@ -2039,7 +2032,7 @@ static int __init init_mac80211_hwsim(void)
 	return 0;
 
 failed_nl:
-	printk(KERN_DEBUG "mac_80211_hwsim: failed initializing netlink\n");
+	pr_debug("failed initializing netlink\n");
 	return err;
 
 failed_mon:
@@ -2060,7 +2053,7 @@ failed:
 
 static void __exit exit_mac80211_hwsim(void)
 {
-	printk(KERN_DEBUG "mac80211_hwsim: unregister radios\n");
+	pr_debug("unregister radios\n");
 
 	hwsim_exit_netlink();
 
-- 
1.7.8.111.gad25c.dirty

^ permalink raw reply related

* [PATCH wireless-next 12/20] mwl8k: Use pr_<level>
From: Joe Perches @ 2012-06-15  5:53 UTC (permalink / raw)
  To: Lennert Buytenhek, John W. Linville; +Cc: linux-wireless, netdev, linux-kernel
In-Reply-To: <cover.1339739415.git.joe@perches.com>

Use a more current logging style.

Convert printks to pr_<level>.
Coalesce formats, align arguments.
Add missing newline terminations.

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/wireless/mwl8k.c |   53 ++++++++++++++++++++---------------------
 1 files changed, 26 insertions(+), 27 deletions(-)

diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index cf7bdc6..7197e80 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -9,6 +9,8 @@
  * warranty of any kind, whether express or implied.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/module.h>
@@ -522,7 +524,7 @@ static int mwl8k_request_firmware(struct mwl8k_priv *priv, char *fw_image,
 			rc = mwl8k_request_fw(priv, di->helper_image,
 					      &priv->fw_helper, false);
 		if (rc)
-			printk(KERN_ERR "%s: Error requesting helper fw %s\n",
+			pr_err("%s: Error requesting helper fw %s\n",
 			       pci_name(priv->pdev), di->helper_image);
 
 		if (rc || nowait)
@@ -542,7 +544,7 @@ static int mwl8k_request_firmware(struct mwl8k_priv *priv, char *fw_image,
 		rc = mwl8k_request_fw(priv, fw_image,
 				      &priv->fw_ucode, false);
 	if (rc) {
-		printk(KERN_ERR "%s: Error requesting firmware file %s\n",
+		pr_err("%s: Error requesting firmware file %s\n",
 		       pci_name(priv->pdev), fw_image);
 		mwl8k_release_fw(&priv->fw_helper);
 		return rc;
@@ -712,15 +714,15 @@ static int mwl8k_load_firmware(struct ieee80211_hw *hw)
 		const struct firmware *helper = priv->fw_helper;
 
 		if (helper == NULL) {
-			printk(KERN_ERR "%s: helper image needed but none "
-			       "given\n", pci_name(priv->pdev));
+			pr_err("%s: helper image needed but none given\n",
+			       pci_name(priv->pdev));
 			return -EINVAL;
 		}
 
 		rc = mwl8k_load_fw_image(priv, helper->data, helper->size);
 		if (rc) {
-			printk(KERN_ERR "%s: unable to load firmware "
-			       "helper image\n", pci_name(priv->pdev));
+			pr_err("%s: unable to load firmware helper image\n",
+			       pci_name(priv->pdev));
 			return rc;
 		}
 		msleep(20);
@@ -731,7 +733,7 @@ static int mwl8k_load_firmware(struct ieee80211_hw *hw)
 	}
 
 	if (rc) {
-		printk(KERN_ERR "%s: unable to load firmware image\n",
+		pr_err("%s: unable to load firmware image\n",
 		       pci_name(priv->pdev));
 		return rc;
 	}
@@ -2425,8 +2427,7 @@ static int mwl8k_cmd_get_hw_spec_ap(struct ieee80211_hw *hw)
 
 		api_version = le32_to_cpu(cmd->fw_api_version);
 		if (priv->device_info->fw_api_ap != api_version) {
-			printk(KERN_ERR "%s: Unsupported fw API version for %s."
-			       "  Expected %d got %d.\n", MWL8K_NAME,
+			pr_err("Unsupported fw API version for %s.  Expected %d got %d.\n",
 			       priv->device_info->part_name,
 			       priv->device_info->fw_api_ap,
 			       api_version);
@@ -5278,12 +5279,12 @@ MODULE_DEVICE_TABLE(pci, mwl8k_pci_id_table);
 static int mwl8k_request_alt_fw(struct mwl8k_priv *priv)
 {
 	int rc;
-	printk(KERN_ERR "%s: Error requesting preferred fw %s.\n"
-	       "Trying alternative firmware %s\n", pci_name(priv->pdev),
-	       priv->fw_pref, priv->fw_alt);
+	pr_err("%s: Error requesting preferred fw %s.\n"
+	       "Trying alternative firmware %s\n",
+	       pci_name(priv->pdev), priv->fw_pref, priv->fw_alt);
 	rc = mwl8k_request_fw(priv, priv->fw_alt, &priv->fw_ucode, true);
 	if (rc) {
-		printk(KERN_ERR "%s: Error requesting alt fw %s\n",
+		pr_err("%s: Error requesting alt fw %s\n",
 		       pci_name(priv->pdev), priv->fw_alt);
 		return rc;
 	}
@@ -5300,7 +5301,7 @@ static void mwl8k_fw_state_machine(const struct firmware *fw, void *context)
 	switch (priv->fw_state) {
 	case FW_STATE_INIT:
 		if (!fw) {
-			printk(KERN_ERR "%s: Error requesting helper fw %s\n",
+			pr_err("%s: Error requesting helper fw %s\n",
 			       pci_name(priv->pdev), di->helper_image);
 			goto fail;
 		}
@@ -5339,7 +5340,7 @@ static void mwl8k_fw_state_machine(const struct firmware *fw, void *context)
 
 	case FW_STATE_LOADING_ALT:
 		if (!fw) {
-			printk(KERN_ERR "%s: Error requesting alt fw %s\n",
+			pr_err("%s: Error requesting alt fw %s\n",
 			       pci_name(priv->pdev), di->helper_image);
 			goto fail;
 		}
@@ -5352,8 +5353,8 @@ static void mwl8k_fw_state_machine(const struct firmware *fw, void *context)
 		break;
 
 	default:
-		printk(KERN_ERR "%s: Unexpected firmware loading state: %d\n",
-		       MWL8K_NAME, priv->fw_state);
+		pr_err("Unexpected firmware loading state: %d\n",
+		       priv->fw_state);
 		BUG_ON(1);
 	}
 
@@ -5607,7 +5608,7 @@ static int mwl8k_reload_firmware(struct ieee80211_hw *hw, char *fw_image)
 	return rc;
 
 fail:
-	printk(KERN_WARNING "mwl8k: Failed to reload firmware image.\n");
+	pr_warn("Failed to reload firmware image\n");
 	return rc;
 }
 
@@ -5725,22 +5726,20 @@ static int __devinit mwl8k_probe(struct pci_dev *pdev,
 	int rc;
 
 	if (!printed_version) {
-		printk(KERN_INFO "%s version %s\n", MWL8K_DESC, MWL8K_VERSION);
+		pr_info("%s version %s\n", MWL8K_DESC, MWL8K_VERSION);
 		printed_version = 1;
 	}
 
 
 	rc = pci_enable_device(pdev);
 	if (rc) {
-		printk(KERN_ERR "%s: Cannot enable new PCI device\n",
-		       MWL8K_NAME);
+		pr_err("Cannot enable new PCI device\n");
 		return rc;
 	}
 
 	rc = pci_request_regions(pdev, MWL8K_NAME);
 	if (rc) {
-		printk(KERN_ERR "%s: Cannot obtain PCI resources\n",
-		       MWL8K_NAME);
+		pr_err("Cannot obtain PCI resources\n");
 		goto err_disable_device;
 	}
 
@@ -5749,7 +5748,7 @@ static int __devinit mwl8k_probe(struct pci_dev *pdev,
 
 	hw = ieee80211_alloc_hw(sizeof(*priv), &mwl8k_ops);
 	if (hw == NULL) {
-		printk(KERN_ERR "%s: ieee80211 alloc failed\n", MWL8K_NAME);
+		pr_err("ieee80211 alloc failed\n");
 		rc = -ENOMEM;
 		goto err_free_reg;
 	}
@@ -5796,10 +5795,10 @@ static int __devinit mwl8k_probe(struct pci_dev *pdev,
 		priv->fw_pref = di->fw_image_sta;
 		priv->fw_alt = di->fw_image_ap;
 	} else if (ap_mode_default && !di->fw_image_ap && di->fw_image_sta) {
-		printk(KERN_WARNING "AP fw is unavailable.  Using STA fw.");
+		pr_warn("AP fw is unavailable.  Using STA fw.\n");
 		priv->fw_pref = di->fw_image_sta;
 	} else if (!ap_mode_default && !di->fw_image_sta && di->fw_image_ap) {
-		printk(KERN_WARNING "STA fw is unavailable.  Using AP fw.");
+		pr_warn("STA fw is unavailable.  Using AP fw.\n");
 		priv->fw_pref = di->fw_image_ap;
 	}
 	rc = mwl8k_init_firmware(hw, priv->fw_pref, true);
@@ -5834,7 +5833,7 @@ err_disable_device:
 
 static void __devexit mwl8k_shutdown(struct pci_dev *pdev)
 {
-	printk(KERN_ERR "===>%s(%u)\n", __func__, __LINE__);
+	pr_err("===>%s(%u)\n", __func__, __LINE__);
 }
 
 static void __devexit mwl8k_remove(struct pci_dev *pdev)
-- 
1.7.8.111.gad25c.dirty

^ permalink raw reply related

* [PATCH wireless-next 13/20] orinoco: Use pr_<level>
From: Joe Perches @ 2012-06-15  5:53 UTC (permalink / raw)
  To: linux-kernel; +Cc: John W. Linville, linux-wireless, netdev
In-Reply-To: <cover.1339739415.git.joe@perches.com>

Use a more current logging style.

Convert printks to pr_<level>.
Convert printk(KERN_DEBUG to pr_debug(.
Coalesce formats, align arguments.

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/wireless/orinoco/airport.c        |   28 ++--
 drivers/net/wireless/orinoco/cfg.c            |    9 +-
 drivers/net/wireless/orinoco/hermes.c         |   71 +++++-----
 drivers/net/wireless/orinoco/hw.c             |   79 +++++------
 drivers/net/wireless/orinoco/main.c           |  194 +++++++++++-------------
 drivers/net/wireless/orinoco/mic.c            |   13 +-
 drivers/net/wireless/orinoco/orinoco.h        |   13 +-
 drivers/net/wireless/orinoco/orinoco_cs.c     |   11 +-
 drivers/net/wireless/orinoco/orinoco_nortel.c |   40 +++---
 drivers/net/wireless/orinoco/orinoco_pci.c    |   23 ++--
 drivers/net/wireless/orinoco/orinoco_pci.h    |    6 +-
 drivers/net/wireless/orinoco/orinoco_plx.c    |   40 +++---
 drivers/net/wireless/orinoco/orinoco_tmd.c    |   25 ++--
 drivers/net/wireless/orinoco/orinoco_usb.c    |  145 +++++++++----------
 drivers/net/wireless/orinoco/scan.c           |   16 +-
 drivers/net/wireless/orinoco/spectrum_cs.c    |    6 +-
 drivers/net/wireless/orinoco/wext.c           |   28 ++--
 17 files changed, 361 insertions(+), 386 deletions(-)

diff --git a/drivers/net/wireless/orinoco/airport.c b/drivers/net/wireless/orinoco/airport.c
index 0ca8b14..a6cea29 100644
--- a/drivers/net/wireless/orinoco/airport.c
+++ b/drivers/net/wireless/orinoco/airport.c
@@ -11,8 +11,9 @@
  *  0.06 : fix possible hang on powerup, add sleep support
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #define DRIVER_NAME "airport"
-#define PFX DRIVER_NAME ": "
 
 #include <linux/module.h>
 #include <linux/kernel.h>
@@ -41,12 +42,11 @@ airport_suspend(struct macio_dev *mdev, pm_message_t state)
 	unsigned long flags;
 	int err;
 
-	printk(KERN_DEBUG "%s: Airport entering sleep mode\n", dev->name);
+	pr_debug("%s: Airport entering sleep mode\n", dev->name);
 
 	err = orinoco_lock(priv, &flags);
 	if (err) {
-		printk(KERN_ERR "%s: hw_unavailable on PBOOK_SLEEP_NOW\n",
-		       dev->name);
+		pr_err("%s: hw_unavailable on PBOOK_SLEEP_NOW\n", dev->name);
 		return 0;
 	}
 
@@ -69,7 +69,7 @@ airport_resume(struct macio_dev *mdev)
 	unsigned long flags;
 	int err;
 
-	printk(KERN_DEBUG "%s: Airport waking up\n", dev->name);
+	pr_debug("%s: Airport waking up\n", dev->name);
 
 	pmac_call_feature(PMAC_FTR_AIRPORT_ENABLE,
 			  macio_get_of_node(mdev), 0, 1);
@@ -153,7 +153,7 @@ airport_attach(struct macio_dev *mdev, const struct of_device_id *match)
 	struct hermes *hw;
 
 	if (macio_resource_count(mdev) < 1 || macio_irq_count(mdev) < 1) {
-		printk(KERN_ERR PFX "Wrong interrupt/addresses in OF tree\n");
+		pr_err("Wrong interrupt/addresses in OF tree\n");
 		return -ENODEV;
 	}
 
@@ -161,7 +161,7 @@ airport_attach(struct macio_dev *mdev, const struct of_device_id *match)
 	priv = alloc_orinocodev(sizeof(*card), &mdev->ofdev.dev,
 				airport_hard_reset, NULL);
 	if (!priv) {
-		printk(KERN_ERR PFX "Cannot allocate network device\n");
+		pr_err("Cannot allocate network device\n");
 		return -ENODEV;
 	}
 	card = priv->card;
@@ -170,7 +170,7 @@ airport_attach(struct macio_dev *mdev, const struct of_device_id *match)
 	card->mdev = mdev;
 
 	if (macio_request_resource(mdev, 0, DRIVER_NAME)) {
-		printk(KERN_ERR PFX "can't request IO resource !\n");
+		pr_err("can't request IO resource !\n");
 		free_orinocodev(priv);
 		return -EBUSY;
 	}
@@ -180,10 +180,10 @@ airport_attach(struct macio_dev *mdev, const struct of_device_id *match)
 	/* Setup interrupts & base address */
 	card->irq = macio_irq(mdev, 0);
 	phys_addr = macio_resource_start(mdev, 0);  /* Physical address */
-	printk(KERN_DEBUG PFX "Physical address %lx\n", phys_addr);
+	pr_debug("Physical address %lx\n", phys_addr);
 	card->vaddr = ioremap(phys_addr, AIRPORT_IO_LEN);
 	if (!card->vaddr) {
-		printk(KERN_ERR PFX "ioremap() failed\n");
+		pr_err("ioremap() failed\n");
 		goto failed;
 	}
 
@@ -198,20 +198,20 @@ airport_attach(struct macio_dev *mdev, const struct of_device_id *match)
 	hw->ops->init(hw);
 
 	if (request_irq(card->irq, orinoco_interrupt, 0, DRIVER_NAME, priv)) {
-		printk(KERN_ERR PFX "Couldn't get IRQ %d\n", card->irq);
+		pr_err("Couldn't get IRQ %d\n", card->irq);
 		goto failed;
 	}
 	card->irq_requested = 1;
 
 	/* Initialise the main driver */
 	if (orinoco_init(priv) != 0) {
-		printk(KERN_ERR PFX "orinoco_init() failed\n");
+		pr_err("orinoco_init() failed\n");
 		goto failed;
 	}
 
 	/* Register an interface with the stack */
 	if (orinoco_if_add(priv, phys_addr, card->irq, NULL) != 0) {
-		printk(KERN_ERR PFX "orinoco_if_add() failed\n");
+		pr_err("orinoco_if_add() failed\n");
 		goto failed;
 	}
 	card->ndev_registered = 1;
@@ -252,7 +252,7 @@ static struct macio_driver airport_driver = {
 static int __init
 init_airport(void)
 {
-	printk(KERN_DEBUG "%s\n", version);
+	pr_debug("%s\n", version);
 
 	return macio_register_driver(&airport_driver);
 }
diff --git a/drivers/net/wireless/orinoco/cfg.c b/drivers/net/wireless/orinoco/cfg.c
index e156755..8d2ad86 100644
--- a/drivers/net/wireless/orinoco/cfg.c
+++ b/drivers/net/wireless/orinoco/cfg.c
@@ -2,6 +2,9 @@
  *
  * See copyright notice in main.c
  */
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/ieee80211.h>
 #include <net/cfg80211.h>
 #include "hw.h"
@@ -223,10 +226,8 @@ static int orinoco_set_wiphy_params(struct wiphy *wiphy, u32 changed)
 			if (wiphy->frag_threshold < 0)
 				frag_value = 0;
 			else {
-				printk(KERN_WARNING "%s: Fixed fragmentation "
-				       "is not supported on this firmware. "
-				       "Using MWO robust instead.\n",
-				       priv->ndev->name);
+				pr_warn("%s: Fixed fragmentation is not supported on this firmware. Using MWO robust instead.\n",
+					priv->ndev->name);
 				frag_value = 1;
 			}
 		} else {
diff --git a/drivers/net/wireless/orinoco/hermes.c b/drivers/net/wireless/orinoco/hermes.c
index 75c15bc..e6d0246 100644
--- a/drivers/net/wireless/orinoco/hermes.c
+++ b/drivers/net/wireless/orinoco/hermes.c
@@ -38,6 +38,8 @@
  * under either the MPL or the GPL.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
@@ -75,18 +77,26 @@
  * Debugging helpers
  */
 
-#define DMSG(stuff...) do {printk(KERN_DEBUG "hermes @ %p: " , hw->iobase); \
-			printk(stuff); } while (0)
+#define DMSG(fmt, ...)						\
+	pr_debug("@ %p: " fmt, hw->iobase, ##__VA_ARGS__)
 
 #undef HERMES_DEBUG
 #ifdef HERMES_DEBUG
 #include <stdarg.h>
 
-#define DEBUG(lvl, stuff...) if ((lvl) <= HERMES_DEBUG) DMSG(stuff)
+#define DEBUG(lvl, fmt, ...)				\
+do {							\
+	if ((lvl) <= HERMES_DEBUG)			\
+		DMSG(fmt, ##__VA_ARGS__);		\
+} while (0)
 
 #else /* ! HERMES_DEBUG */
 
-#define DEBUG(lvl, stuff...) do { } while (0)
+#define DEBUG(lvl, fmt, ...)				\
+do {							\
+	if (0)						\
+		DMSG(fmt, ##__VA_ARGS__);		\
+} while (0)
 
 #endif /* ! HERMES_DEBUG */
 
@@ -155,15 +165,13 @@ static int hermes_doicmd_wait(struct hermes *hw, u16 cmd,
 	hermes_write_regn(hw, SWSUPPORT0, HERMES_MAGIC);
 
 	if (!hermes_present(hw)) {
-		DEBUG(0, "hermes @ 0x%x: Card removed during reset.\n",
-		       hw->iobase);
+		DEBUG(0, "Card removed during reset\n");
 		err = -ENODEV;
 		goto out;
 	}
 
 	if (!(reg & HERMES_EV_CMD)) {
-		printk(KERN_ERR "hermes @ %p: "
-		       "Timeout waiting for card to reset (reg=0x%04x)!\n",
+		pr_err("@ %p: Timeout waiting for card to reset (reg=0x%04x)!\n",
 		       hw->iobase, reg);
 		err = -ETIMEDOUT;
 		goto out;
@@ -262,14 +270,12 @@ static int hermes_docmd_wait(struct hermes *hw, u16 cmd, u16 parm0,
 	if (err) {
 		if (!hermes_present(hw)) {
 			if (net_ratelimit())
-				printk(KERN_WARNING "hermes @ %p: "
-				       "Card removed while issuing command "
-				       "0x%04x.\n", hw->iobase, cmd);
+				pr_warn("@ %p: Card removed while issuing command 0x%04x\n",
+					hw->iobase, cmd);
 			err = -ENODEV;
 		} else
 			if (net_ratelimit())
-				printk(KERN_ERR "hermes @ %p: "
-				       "Error %d issuing command 0x%04x.\n",
+				pr_err("@ %p: Error %d issuing command 0x%04x\n",
 				       hw->iobase, err, cmd);
 		goto out;
 	}
@@ -283,16 +289,15 @@ static int hermes_docmd_wait(struct hermes *hw, u16 cmd, u16 parm0,
 	}
 
 	if (!hermes_present(hw)) {
-		printk(KERN_WARNING "hermes @ %p: Card removed "
-		       "while waiting for command 0x%04x completion.\n",
-		       hw->iobase, cmd);
+		pr_warn("@ %p: Card removed while waiting for command 0x%04x completion\n",
+			hw->iobase, cmd);
 		err = -ENODEV;
 		goto out;
 	}
 
 	if (!(reg & HERMES_EV_CMD)) {
-		printk(KERN_ERR "hermes @ %p: Timeout waiting for "
-		       "command 0x%04x completion.\n", hw->iobase, cmd);
+		pr_err("@ %p: Timeout waiting for command 0x%04x completion\n",
+		       hw->iobase, cmd);
 		err = -ETIMEDOUT;
 		goto out;
 	}
@@ -336,15 +341,13 @@ static int hermes_allocate(struct hermes *hw, u16 size, u16 *fid)
 	}
 
 	if (!hermes_present(hw)) {
-		printk(KERN_WARNING "hermes @ %p: "
-		       "Card removed waiting for frame allocation.\n",
-		       hw->iobase);
+		pr_warn("@ %p: Card removed waiting for frame allocation\n",
+			hw->iobase);
 		return -ENODEV;
 	}
 
 	if (!(reg & HERMES_EV_ALLOC)) {
-		printk(KERN_ERR "hermes @ %p: "
-		       "Timeout waiting for frame allocation\n",
+		pr_err("@ %p: Timeout waiting for frame allocation\n",
 		       hw->iobase);
 		return -ETIMEDOUT;
 	}
@@ -400,8 +403,8 @@ static int hermes_bap_seek(struct hermes *hw, int bap, u16 id, u16 offset)
 	}
 
 	if (reg != offset) {
-		printk(KERN_ERR "hermes @ %p: BAP%d offset %s: "
-		       "reg=0x%x id=0x%x offset=0x%x\n", hw->iobase, bap,
+		pr_err("@ %p: BAP%d offset %s: reg=0x%x id=0x%x offset=0x%x\n",
+		       hw->iobase, bap,
 		       (reg & HERMES_OFFSET_BUSY) ? "timeout" : "error",
 		       reg, id, offset);
 
@@ -509,14 +512,12 @@ static int hermes_read_ltv(struct hermes *hw, int bap, u16 rid,
 		*length = rlength;
 
 	if (rtype != rid)
-		printk(KERN_WARNING "hermes @ %p: %s(): "
-		       "rid (0x%04x) does not match type (0x%04x)\n",
-		       hw->iobase, __func__, rid, rtype);
+		pr_warn("@ %p: %s(): rid (0x%04x) does not match type (0x%04x)\n",
+			hw->iobase, __func__, rid, rtype);
 	if (HERMES_RECLEN_TO_BYTES(rlength) > bufsize)
-		printk(KERN_WARNING "hermes @ %p: "
-		       "Truncating LTV record from %d to %d bytes. "
-		       "(rid=0x%04x, len=0x%04x)\n", hw->iobase,
-		       HERMES_RECLEN_TO_BYTES(rlength), bufsize, rid, rlength);
+		pr_warn("@ %p: Truncating LTV record from %d to %d bytes. (rid=0x%04x, len=0x%04x)\n",
+			hw->iobase,
+			HERMES_RECLEN_TO_BYTES(rlength), bufsize, rid, rlength);
 
 	nwords = min((unsigned)rlength - 1, bufsize / 2);
 	hermes_read_words(hw, dreg, buf, nwords);
@@ -652,8 +653,7 @@ static int hermesi_program_end(struct hermes *hw)
 
 	rc = hw->ops->cmd_wait(hw, HERMES_PROGRAM_DISABLE, 0, &resp);
 
-	pr_debug("PROGRAM_DISABLE returned %d, "
-		 "r0 0x%04x, r1 0x%04x, r2 0x%04x\n",
+	pr_debug("PROGRAM_DISABLE returned %d, r0 0x%04x, r1 0x%04x, r2 0x%04x\n",
 		 rc, resp.resp0, resp.resp1, resp.resp2);
 
 	if ((rc == 0) &&
@@ -727,8 +727,7 @@ static int hermes_read_pda(struct hermes *hw, __le16 *pda, u32 pda_addr,
 
 	/* Check PDA length */
 	pda_size = le16_to_cpu(pda[0]);
-	pr_debug("Actual PDA length %d, Max allowed %d\n",
-		 pda_size, pda_len);
+	pr_debug("Actual PDA length %d, Max allowed %d\n", pda_size, pda_len);
 	if (pda_size > pda_len)
 		return -EINVAL;
 
diff --git a/drivers/net/wireless/orinoco/hw.c b/drivers/net/wireless/orinoco/hw.c
index c09c843..5202845 100644
--- a/drivers/net/wireless/orinoco/hw.c
+++ b/drivers/net/wireless/orinoco/hw.c
@@ -2,6 +2,9 @@
  *
  * See copyright notice in main.c
  */
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/kernel.h>
 #include <linux/device.h>
 #include <linux/if_arp.h>
@@ -467,8 +470,7 @@ int orinoco_hw_program_rids(struct orinoco_private *priv)
 				 HERMES_BYTES_TO_RECLEN(ETH_ALEN),
 				 dev->dev_addr);
 	if (err) {
-		printk(KERN_ERR "%s: Error %d setting MAC address\n",
-		       dev->name, err);
+		pr_err("%s: Error %d setting MAC address\n", dev->name, err);
 		return err;
 	}
 
@@ -476,8 +478,7 @@ int orinoco_hw_program_rids(struct orinoco_private *priv)
 	err = hermes_write_wordrec(hw, USER_BAP, HERMES_RID_CNFPORTTYPE,
 				   priv->port_type);
 	if (err) {
-		printk(KERN_ERR "%s: Error %d setting port type\n",
-		       dev->name, err);
+		pr_err("%s: Error %d setting port type\n", dev->name, err);
 		return err;
 	}
 	/* Set the channel/frequency */
@@ -486,7 +487,7 @@ int orinoco_hw_program_rids(struct orinoco_private *priv)
 					   HERMES_RID_CNFOWNCHANNEL,
 					   priv->channel);
 		if (err) {
-			printk(KERN_ERR "%s: Error %d setting channel %d\n",
+			pr_err("%s: Error %d setting channel %d\n",
 			       dev->name, err, priv->channel);
 			return err;
 		}
@@ -496,8 +497,8 @@ int orinoco_hw_program_rids(struct orinoco_private *priv)
 		u16 createibss;
 
 		if ((strlen(priv->desired_essid) == 0) && (priv->createibss)) {
-			printk(KERN_WARNING "%s: This firmware requires an "
-			       "ESSID in IBSS-Ad-Hoc mode.\n", dev->name);
+			pr_warn("%s: This firmware requires an ESSID in IBSS-Ad-Hoc mode\n",
+				dev->name);
 			/* With wvlan_cs, in this case, we would crash.
 			 * hopefully, this driver will behave better...
 			 * Jean II */
@@ -510,7 +511,7 @@ int orinoco_hw_program_rids(struct orinoco_private *priv)
 					   HERMES_RID_CNFCREATEIBSS,
 					   createibss);
 		if (err) {
-			printk(KERN_ERR "%s: Error %d setting CREATEIBSS\n",
+			pr_err("%s: Error %d setting CREATEIBSS\n",
 			       dev->name, err);
 			return err;
 		}
@@ -519,8 +520,7 @@ int orinoco_hw_program_rids(struct orinoco_private *priv)
 	/* Set the desired BSSID */
 	err = __orinoco_hw_set_wap(priv);
 	if (err) {
-		printk(KERN_ERR "%s: Error %d setting AP address\n",
-		       dev->name, err);
+		pr_err("%s: Error %d setting AP address\n", dev->name, err);
 		return err;
 	}
 
@@ -532,16 +532,14 @@ int orinoco_hw_program_rids(struct orinoco_private *priv)
 			HERMES_BYTES_TO_RECLEN(strlen(priv->desired_essid) + 2),
 			&idbuf);
 	if (err) {
-		printk(KERN_ERR "%s: Error %d setting OWNSSID\n",
-		       dev->name, err);
+		pr_err("%s: Error %d setting OWNSSID\n", dev->name, err);
 		return err;
 	}
 	err = hw->ops->write_ltv(hw, USER_BAP, HERMES_RID_CNFDESIREDSSID,
 			HERMES_BYTES_TO_RECLEN(strlen(priv->desired_essid) + 2),
 			&idbuf);
 	if (err) {
-		printk(KERN_ERR "%s: Error %d setting DESIREDSSID\n",
-		       dev->name, err);
+		pr_err("%s: Error %d setting DESIREDSSID\n", dev->name, err);
 		return err;
 	}
 
@@ -552,8 +550,7 @@ int orinoco_hw_program_rids(struct orinoco_private *priv)
 				 HERMES_BYTES_TO_RECLEN(strlen(priv->nick) + 2),
 				 &idbuf);
 	if (err) {
-		printk(KERN_ERR "%s: Error %d setting nickname\n",
-		       dev->name, err);
+		pr_err("%s: Error %d setting nickname\n", dev->name, err);
 		return err;
 	}
 
@@ -563,9 +560,8 @@ int orinoco_hw_program_rids(struct orinoco_private *priv)
 					   HERMES_RID_CNFSYSTEMSCALE,
 					   priv->ap_density);
 		if (err) {
-			printk(KERN_WARNING "%s: Error %d setting SYSTEMSCALE. "
-			       "Disabling sensitivity control\n",
-			       dev->name, err);
+			pr_warn("%s: Error %d setting SYSTEMSCALE. Disabling sensitivity control.\n",
+				dev->name, err);
 
 			priv->has_sensitivity = 0;
 		}
@@ -575,8 +571,7 @@ int orinoco_hw_program_rids(struct orinoco_private *priv)
 	err = hermes_write_wordrec(hw, USER_BAP, HERMES_RID_CNFRTSTHRESHOLD,
 				   priv->rts_thresh);
 	if (err) {
-		printk(KERN_ERR "%s: Error %d setting RTS threshold\n",
-		       dev->name, err);
+		pr_err("%s: Error %d setting RTS threshold\n", dev->name, err);
 		return err;
 	}
 
@@ -590,16 +585,14 @@ int orinoco_hw_program_rids(struct orinoco_private *priv)
 					   HERMES_RID_CNFFRAGMENTATIONTHRESHOLD,
 					   priv->frag_thresh);
 	if (err) {
-		printk(KERN_ERR "%s: Error %d setting fragmentation\n",
-		       dev->name, err);
+		pr_err("%s: Error %d setting fragmentation\n", dev->name, err);
 		return err;
 	}
 
 	/* Set bitrate */
 	err = __orinoco_hw_set_bitrate(priv);
 	if (err) {
-		printk(KERN_ERR "%s: Error %d setting bitrate\n",
-		       dev->name, err);
+		pr_err("%s: Error %d setting bitrate\n", dev->name, err);
 		return err;
 	}
 
@@ -609,8 +602,7 @@ int orinoco_hw_program_rids(struct orinoco_private *priv)
 					   HERMES_RID_CNFPMENABLED,
 					   priv->pm_on);
 		if (err) {
-			printk(KERN_ERR "%s: Error %d setting up PM\n",
-			       dev->name, err);
+			pr_err("%s: Error %d setting up PM\n", dev->name, err);
 			return err;
 		}
 
@@ -618,24 +610,21 @@ int orinoco_hw_program_rids(struct orinoco_private *priv)
 					   HERMES_RID_CNFMULTICASTRECEIVE,
 					   priv->pm_mcast);
 		if (err) {
-			printk(KERN_ERR "%s: Error %d setting up PM\n",
-			       dev->name, err);
+			pr_err("%s: Error %d setting up PM\n", dev->name, err);
 			return err;
 		}
 		err = hermes_write_wordrec(hw, USER_BAP,
 					   HERMES_RID_CNFMAXSLEEPDURATION,
 					   priv->pm_period);
 		if (err) {
-			printk(KERN_ERR "%s: Error %d setting up PM\n",
-			       dev->name, err);
+			pr_err("%s: Error %d setting up PM\n", dev->name, err);
 			return err;
 		}
 		err = hermes_write_wordrec(hw, USER_BAP,
 					   HERMES_RID_CNFPMHOLDOVERDURATION,
 					   priv->pm_timeout);
 		if (err) {
-			printk(KERN_ERR "%s: Error %d setting up PM\n",
-			       dev->name, err);
+			pr_err("%s: Error %d setting up PM\n", dev->name, err);
 			return err;
 		}
 	}
@@ -646,7 +635,7 @@ int orinoco_hw_program_rids(struct orinoco_private *priv)
 					   HERMES_RID_CNFPREAMBLE_SYMBOL,
 					   priv->preamble);
 		if (err) {
-			printk(KERN_ERR "%s: Error %d setting preamble\n",
+			pr_err("%s: Error %d setting preamble\n",
 			       dev->name, err);
 			return err;
 		}
@@ -656,7 +645,7 @@ int orinoco_hw_program_rids(struct orinoco_private *priv)
 	if (priv->has_wep || priv->has_wpa) {
 		err = __orinoco_hw_setup_enc(priv);
 		if (err) {
-			printk(KERN_ERR "%s: Error %d activating encryption\n",
+			pr_err("%s: Error %d activating encryption\n",
 			       dev->name, err);
 			return err;
 		}
@@ -711,7 +700,7 @@ int __orinoco_hw_set_bitrate(struct orinoco_private *priv)
 	int err = 0;
 
 	if (ratemode >= BITRATE_TABLE_SIZE) {
-		printk(KERN_ERR "%s: BUG: Invalid bitrate mode %d\n",
+		pr_err("%s: BUG: Invalid bitrate mode %d\n",
 		       priv->ndev->name, ratemode);
 		return -EINVAL;
 	}
@@ -768,8 +757,8 @@ int orinoco_hw_get_act_bitrate(struct orinoco_private *priv, int *bitrate)
 			}
 
 		if (i >= BITRATE_TABLE_SIZE) {
-			printk(KERN_INFO "%s: Unable to determine current bitrate (0x%04hx)\n",
-			       priv->ndev->name, val);
+			pr_info("%s: Unable to determine current bitrate (0x%04hx)\n",
+				priv->ndev->name, val);
 			err = -EIO;
 		}
 
@@ -862,7 +851,7 @@ int __orinoco_hw_setup_wepkeys(struct orinoco_private *priv)
 			keylen = priv->keys[priv->tx_key].key_len;
 
 			if (keylen > LARGE_KEY_SIZE) {
-				printk(KERN_ERR "%s: BUG: Key %d has oversize length %d.\n",
+				pr_err("%s: BUG: Key %d has oversize length %d\n",
 				       priv->ndev->name, priv->tx_key, keylen);
 				return -E2BIG;
 			} else if (keylen > SMALL_KEY_SIZE)
@@ -1059,8 +1048,8 @@ int orinoco_clear_tkip_key(struct orinoco_private *priv, int key_idx)
 				   HERMES_RID_CNFREMDEFAULTTKIPKEY_AGERE,
 				   key_idx);
 	if (err)
-		printk(KERN_WARNING "%s: Error %d clearing TKIP key %d\n",
-		       priv->ndev->name, err, key_idx);
+		pr_warn("%s: Error %d clearing TKIP key %d\n",
+			priv->ndev->name, err, key_idx);
 	return err;
 }
 
@@ -1076,7 +1065,7 @@ int __orinoco_hw_set_multicast_list(struct orinoco_private *priv,
 					   HERMES_RID_CNFPROMISCUOUSMODE,
 					   promisc);
 		if (err) {
-			printk(KERN_ERR "%s: Error %d setting PROMISCUOUSMODE to 1.\n",
+			pr_err("%s: Error %d setting PROMISCUOUSMODE to 1\n",
 			       priv->ndev->name, err);
 		} else
 			priv->promiscuous = promisc;
@@ -1101,7 +1090,7 @@ int __orinoco_hw_set_multicast_list(struct orinoco_private *priv,
 				   HERMES_BYTES_TO_RECLEN(mc_count * ETH_ALEN),
 				   &mclist);
 		if (err)
-			printk(KERN_ERR "%s: Error %d setting multicast list.\n",
+			pr_err("%s: Error %d setting multicast list\n",
 			       priv->ndev->name, err);
 		else
 			priv->mc_count = mc_count;
@@ -1187,8 +1176,8 @@ int orinoco_hw_get_freq(struct orinoco_private *priv)
 	}
 
 	if ((channel < 1) || (channel > NUM_CHANNELS)) {
-		printk(KERN_WARNING "%s: Channel out of range (%d)!\n",
-		       priv->ndev->name, channel);
+		pr_warn("%s: Channel out of range (%d)!\n",
+			priv->ndev->name, channel);
 		err = -EBUSY;
 		goto out;
 
diff --git a/drivers/net/wireless/orinoco/main.c b/drivers/net/wireless/orinoco/main.c
index 88e3ad2..b9c2ab9 100644
--- a/drivers/net/wireless/orinoco/main.c
+++ b/drivers/net/wireless/orinoco/main.c
@@ -74,6 +74,8 @@
  * hw_unavailable is non-zero).
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #define DRIVER_NAME "orinoco"
 
 #include <linux/module.h>
@@ -245,7 +247,7 @@ void set_port_type(struct orinoco_private *priv)
 		priv->createibss = 0;
 		break;
 	default:
-		printk(KERN_ERR "%s: Invalid priv->iw_mode in set_port_type()\n",
+		pr_err("%s: Invalid priv->iw_mode in set_port_type()\n",
 		       priv->ndev->name);
 	}
 }
@@ -308,8 +310,8 @@ void orinoco_set_multicast_list(struct net_device *dev)
 	unsigned long flags;
 
 	if (orinoco_lock(priv, &flags) != 0) {
-		printk(KERN_DEBUG "%s: orinoco_set_multicast_list() "
-		       "called when hw_unavailable\n", dev->name);
+		pr_debug("%s: orinoco_set_multicast_list() called when hw_unavailable\n",
+			 dev->name);
 		return;
 	}
 
@@ -395,8 +397,7 @@ int orinoco_process_xmit_skb(struct sk_buff *skb,
 
 		if (skb_headroom(skb) < ENCAPS_OVERHEAD) {
 			if (net_ratelimit())
-				printk(KERN_ERR
-				       "%s: Not enough headroom for 802.2 headers %d\n",
+				pr_err("%s: Not enough headroom for 802.2 headers %d\n",
 				       dev->name, skb_headroom(skb));
 			return -ENOMEM;
 		}
@@ -445,19 +446,17 @@ static netdev_tx_t orinoco_xmit(struct sk_buff *skb, struct net_device *dev)
 	u8 mic_buf[MICHAEL_MIC_LEN + 1];
 
 	if (!netif_running(dev)) {
-		printk(KERN_ERR "%s: Tx on stopped device!\n",
-		       dev->name);
+		pr_err("%s: Tx on stopped device!\n", dev->name);
 		return NETDEV_TX_BUSY;
 	}
 
 	if (netif_queue_stopped(dev)) {
-		printk(KERN_DEBUG "%s: Tx while transmitter busy!\n",
-		       dev->name);
+		pr_debug("%s: Tx while transmitter busy!\n", dev->name);
 		return NETDEV_TX_BUSY;
 	}
 
 	if (orinoco_lock(priv, &flags) != 0) {
-		printk(KERN_ERR "%s: orinoco_xmit() called while hw_unavailable\n",
+		pr_err("%s: orinoco_xmit() called while hw_unavailable\n",
 		       dev->name);
 		return NETDEV_TX_BUSY;
 	}
@@ -496,8 +495,8 @@ static netdev_tx_t orinoco_xmit(struct sk_buff *skb, struct net_device *dev)
 					  txfid, 0);
 		if (err) {
 			if (net_ratelimit())
-				printk(KERN_ERR "%s: Error %d writing Tx "
-				       "descriptor to BAP\n", dev->name, err);
+				pr_err("%s: Error %d writing Tx descriptor to BAP\n",
+				       dev->name, err);
 			goto busy;
 		}
 	} else {
@@ -510,8 +509,8 @@ static netdev_tx_t orinoco_xmit(struct sk_buff *skb, struct net_device *dev)
 					  txfid, 0);
 		if (err) {
 			if (net_ratelimit())
-				printk(KERN_ERR "%s: Error %d writing Tx "
-				       "descriptor to BAP\n", dev->name, err);
+				pr_err("%s: Error %d writing Tx descriptor to BAP\n",
+				       dev->name, err);
 			goto busy;
 		}
 
@@ -525,8 +524,7 @@ static netdev_tx_t orinoco_xmit(struct sk_buff *skb, struct net_device *dev)
 	err = hw->ops->bap_pwrite(hw, USER_BAP, skb->data, skb->len,
 				  txfid, HERMES_802_3_OFFSET);
 	if (err) {
-		printk(KERN_ERR "%s: Error %d writing packet to BAP\n",
-		       dev->name, err);
+		pr_err("%s: Error %d writing packet to BAP\n", dev->name, err);
 		goto busy;
 	}
 
@@ -541,7 +539,7 @@ static netdev_tx_t orinoco_xmit(struct sk_buff *skb, struct net_device *dev)
 		err = hw->ops->bap_pwrite(hw, USER_BAP, &mic_buf[0], len,
 					  txfid, offset);
 		if (err) {
-			printk(KERN_ERR "%s: Error %d writing MIC to BAP\n",
+			pr_err("%s: Error %d writing MIC to BAP\n",
 			       dev->name, err);
 			goto busy;
 		}
@@ -555,8 +553,8 @@ static netdev_tx_t orinoco_xmit(struct sk_buff *skb, struct net_device *dev)
 	if (err) {
 		netif_start_queue(dev);
 		if (net_ratelimit())
-			printk(KERN_ERR "%s: Error %d transmitting packet\n",
-				dev->name, err);
+			pr_err("%s: Error %d transmitting packet\n",
+			       dev->name, err);
 		goto busy;
 	}
 
@@ -586,8 +584,8 @@ static void __orinoco_ev_alloc(struct net_device *dev, struct hermes *hw)
 
 	if (fid != priv->txfid) {
 		if (fid != DUMMY_FID)
-			printk(KERN_WARNING "%s: Allocate event on unexpected fid (%04X)\n",
-			       dev->name, fid);
+			pr_warn("%s: Allocate event on unexpected fid (%04X)\n",
+				dev->name, fid);
 		return;
 	}
 
@@ -627,9 +625,8 @@ static void __orinoco_ev_txexc(struct net_device *dev, struct hermes *hw)
 	stats->tx_errors++;
 
 	if (err) {
-		printk(KERN_WARNING "%s: Unable to read descriptor on Tx error "
-		       "(FID=%04X error %d)\n",
-		       dev->name, fid, err);
+		pr_warn("%s: Unable to read descriptor on Tx error (FID=%04X error %d)\n",
+			dev->name, fid, err);
 		return;
 	}
 
@@ -668,10 +665,9 @@ void orinoco_tx_timeout(struct net_device *dev)
 	struct net_device_stats *stats = &priv->stats;
 	struct hermes *hw = &priv->hw;
 
-	printk(KERN_WARNING "%s: Tx timeout! "
-	       "ALLOCFID=%04x, TXCOMPLFID=%04x, EVSTAT=%04x\n",
-	       dev->name, hermes_read_regn(hw, ALLOCFID),
-	       hermes_read_regn(hw, TXCOMPLFID), hermes_read_regn(hw, EVSTAT));
+	pr_warn("%s: Tx timeout! ALLOCFID=%04x, TXCOMPLFID=%04x, EVSTAT=%04x\n",
+		dev->name, hermes_read_regn(hw, ALLOCFID),
+		hermes_read_regn(hw, TXCOMPLFID), hermes_read_regn(hw, EVSTAT));
 
 	stats->tx_errors++;
 
@@ -793,16 +789,16 @@ static void orinoco_rx_monitor(struct net_device *dev, u16 rxfid,
 
 	/* sanity check the length */
 	if (datalen > IEEE80211_MAX_DATA_LEN + 12) {
-		printk(KERN_DEBUG "%s: oversized monitor frame, "
-		       "data length = %d\n", dev->name, datalen);
+		pr_debug("%s: oversized monitor frame, data length = %d\n",
+			 dev->name, datalen);
 		stats->rx_length_errors++;
 		goto update_stats;
 	}
 
 	skb = dev_alloc_skb(hdrlen + datalen);
 	if (!skb) {
-		printk(KERN_WARNING "%s: Cannot allocate skb for monitor frame\n",
-		       dev->name);
+		pr_warn("%s: Cannot allocate skb for monitor frame\n",
+			dev->name);
 		goto update_stats;
 	}
 
@@ -816,7 +812,7 @@ static void orinoco_rx_monitor(struct net_device *dev, u16 rxfid,
 					 ALIGN(datalen, 2), rxfid,
 					 HERMES_802_2_OFFSET);
 		if (err) {
-			printk(KERN_ERR "%s: error %d reading monitor frame\n",
+			pr_err("%s: error %d reading monitor frame\n",
 			       dev->name, err);
 			goto drop;
 		}
@@ -854,9 +850,8 @@ void __orinoco_ev_rx(struct net_device *dev, struct hermes *hw)
 
 	desc = kmalloc(sizeof(*desc), GFP_ATOMIC);
 	if (!desc) {
-		printk(KERN_WARNING
-		       "%s: Can't allocate space for RX descriptor\n",
-		       dev->name);
+		pr_warn("%s: Can't allocate space for RX descriptor\n",
+			dev->name);
 		goto update_stats;
 	}
 
@@ -865,8 +860,8 @@ void __orinoco_ev_rx(struct net_device *dev, struct hermes *hw)
 	err = hw->ops->bap_pread(hw, IRQ_BAP, desc, sizeof(*desc),
 				 rxfid, 0);
 	if (err) {
-		printk(KERN_ERR "%s: error %d reading Rx descriptor. "
-		       "Frame dropped.\n", dev->name, err);
+		pr_err("%s: error %d reading Rx descriptor. Frame dropped.\n",
+		       dev->name, err);
 		goto update_stats;
 	}
 
@@ -902,8 +897,8 @@ void __orinoco_ev_rx(struct net_device *dev, struct hermes *hw)
 		goto out;
 	}
 	if (length > IEEE80211_MAX_DATA_LEN) {
-		printk(KERN_WARNING "%s: Oversized frame received (%d bytes)\n",
-		       dev->name, length);
+		pr_warn("%s: Oversized frame received (%d bytes)\n",
+			dev->name, length);
 		stats->rx_length_errors++;
 		goto update_stats;
 	}
@@ -920,8 +915,7 @@ void __orinoco_ev_rx(struct net_device *dev, struct hermes *hw)
 	   bits */
 	skb = dev_alloc_skb(length + ETH_HLEN + 2 + 1);
 	if (!skb) {
-		printk(KERN_WARNING "%s: Can't allocate skb for Rx\n",
-		       dev->name);
+		pr_warn("%s: Can't allocate skb for Rx\n", dev->name);
 		goto update_stats;
 	}
 
@@ -934,8 +928,8 @@ void __orinoco_ev_rx(struct net_device *dev, struct hermes *hw)
 				 ALIGN(length, 2), rxfid,
 				 HERMES_802_2_OFFSET);
 	if (err) {
-		printk(KERN_ERR "%s: error %d reading frame. "
-		       "Frame dropped.\n", dev->name, err);
+		pr_err("%s: error %d reading frame. Frame dropped.\n",
+		       dev->name, err);
 		goto drop;
 	}
 
@@ -994,9 +988,8 @@ static void orinoco_rx(struct net_device *dev,
 		key = (struct orinoco_tkip_key *) priv->keys[key_id].key;
 
 		if (!key) {
-			printk(KERN_WARNING "%s: Received encrypted frame from "
-			       "%pM using key %i, but key is not installed\n",
-			       dev->name, src, key_id);
+			pr_warn("%s: Received encrypted frame from %pM using key %i, but key is not installed\n",
+				dev->name, src, key_id);
 			goto drop;
 		}
 
@@ -1009,10 +1002,8 @@ static void orinoco_rx(struct net_device *dev,
 			union iwreq_data wrqu;
 			struct iw_michaelmicfailure wxmic;
 
-			printk(KERN_WARNING "%s: "
-			       "Invalid Michael MIC in data frame from %pM, "
-			       "using key %i\n",
-			       dev->name, src, key_id);
+			pr_warn("%s: Invalid Michael MIC in data frame from %pM, using key %i\n",
+				dev->name, src, key_id);
 
 			/* TODO: update stats */
 
@@ -1152,8 +1143,7 @@ static void print_linkstatus(struct net_device *dev, u16 status)
 		s = "UNKNOWN";
 	}
 
-	printk(KERN_DEBUG "%s: New link status: %s (%04x)\n",
-	       dev->name, s, status);
+	pr_debug("%s: New link status: %s (%04x)\n", dev->name, s, status);
 }
 
 /* Search scan results for requested BSSID, join it if found */
@@ -1196,8 +1186,7 @@ static void orinoco_join_ap(struct work_struct *work)
 				HERMES_RID_SCANRESULTSTABLE,
 				MAX_SCAN_LEN, &len, buf);
 	if (err) {
-		printk(KERN_ERR "%s: Cannot read scan results\n",
-		       dev->name);
+		pr_err("%s: Cannot read scan results\n", dev->name);
 		goto out;
 	}
 
@@ -1224,7 +1213,7 @@ static void orinoco_join_ap(struct work_struct *work)
 	err = HERMES_WRITE_RECORD(hw, USER_BAP, HERMES_RID_CNFJOINREQUEST,
 				  &req);
 	if (err)
-		printk(KERN_ERR "%s: Error issuing join request\n", dev->name);
+		pr_err("%s: Error issuing join request\n", dev->name);
 
  out:
 	orinoco_unlock(priv, &flags);
@@ -1337,7 +1326,7 @@ static void qbuf_scan(struct orinoco_private *priv, void *buf,
 
 	sd = kmalloc(sizeof(*sd), GFP_ATOMIC);
 	if (!sd) {
-		printk(KERN_ERR "%s: failed to alloc memory\n", __func__);
+		pr_err("%s: failed to alloc memory\n", __func__);
 		return;
 	}
 	sd->buf = buf;
@@ -1358,7 +1347,7 @@ static void qabort_scan(struct orinoco_private *priv)
 
 	sd = kmalloc(sizeof(*sd), GFP_ATOMIC);
 	if (!sd) {
-		printk(KERN_ERR "%s: failed to alloc memory\n", __func__);
+		pr_err("%s: failed to alloc memory\n", __func__);
 		return;
 	}
 	sd->len = -1; /* Abort */
@@ -1429,8 +1418,8 @@ void __orinoco_ev_info(struct net_device *dev, struct hermes *hw)
 	err = hw->ops->bap_pread(hw, IRQ_BAP, &info, sizeof(info),
 				 infofid, 0);
 	if (err) {
-		printk(KERN_ERR "%s: error %d reading info frame. "
-		       "Frame dropped.\n", dev->name, err);
+		pr_err("%s: error %d reading info frame. Frame dropped.\n",
+		       dev->name, err);
 		return;
 	}
 
@@ -1443,8 +1432,8 @@ void __orinoco_ev_info(struct net_device *dev, struct hermes *hw)
 		struct iw_statistics *wstats = &priv->wstats;
 
 		if (len > sizeof(tallies)) {
-			printk(KERN_WARNING "%s: Tallies frame too long (%d bytes)\n",
-			       dev->name, len);
+			pr_warn("%s: Tallies frame too long (%d bytes)\n",
+				dev->name, len);
 			len = sizeof(tallies);
 		}
 
@@ -1479,8 +1468,8 @@ void __orinoco_ev_info(struct net_device *dev, struct hermes *hw)
 			break;
 
 		if (len != sizeof(linkstatus)) {
-			printk(KERN_WARNING "%s: Unexpected size for linkstatus frame (%d bytes)\n",
-			       dev->name, len);
+			pr_warn("%s: Unexpected size for linkstatus frame (%d bytes)\n",
+				dev->name, len);
 			break;
 		}
 
@@ -1534,8 +1523,8 @@ void __orinoco_ev_info(struct net_device *dev, struct hermes *hw)
 
 		/* Sanity check */
 		if (len > 4096) {
-			printk(KERN_WARNING "%s: Scan results too large (%d bytes)\n",
-			       dev->name, len);
+			pr_warn("%s: Scan results too large (%d bytes)\n",
+				dev->name, len);
 			qabort_scan(priv);
 			break;
 		}
@@ -1560,10 +1549,10 @@ void __orinoco_ev_info(struct net_device *dev, struct hermes *hw)
 #ifdef ORINOCO_DEBUG
 		{
 			int	i;
-			printk(KERN_DEBUG "Scan result [%02X", buf[0]);
+			pr_debug("Scan result [%02X", buf[0]);
 			for (i = 1; i < (len * 2); i++)
-				printk(":%02X", buf[i]);
-			printk("]\n");
+				pr_cont(":%02X", buf[i]);
+			pr_cont("]\n");
 		}
 #endif	/* ORINOCO_DEBUG */
 
@@ -1575,8 +1564,8 @@ void __orinoco_ev_info(struct net_device *dev, struct hermes *hw)
 		struct agere_ext_scan_info *bss;
 
 		if (!priv->scan_request) {
-			printk(KERN_DEBUG "%s: Got chaninfo without scan, "
-			       "len=%d\n", dev->name, len);
+			pr_debug("%s: Got chaninfo without scan, len=%d\n",
+				 dev->name, len);
 			break;
 		}
 
@@ -1591,9 +1580,8 @@ void __orinoco_ev_info(struct net_device *dev, struct hermes *hw)
 					   data) + 2)) {
 			/* Drop this result now so we don't have to
 			 * keep checking later */
-			printk(KERN_WARNING
-			       "%s: Ext scan results too short (%d bytes)\n",
-			       dev->name, len);
+			pr_warn("%s: Ext scan results too short (%d bytes)\n",
+				dev->name, len);
 			break;
 		}
 
@@ -1618,8 +1606,8 @@ void __orinoco_ev_info(struct net_device *dev, struct hermes *hw)
 			break;
 		/* fall through */
 	default:
-		printk(KERN_DEBUG "%s: Unknown information frame received: "
-		       "type 0x%04x, length %d\n", dev->name, type, len);
+		pr_debug("%s: Unknown information frame received: type 0x%04x, length %d\n",
+			 dev->name, type, len);
 		/* We don't actually do anything about it */
 		break;
 	}
@@ -1629,7 +1617,7 @@ EXPORT_SYMBOL(__orinoco_ev_info);
 static void __orinoco_ev_infdrop(struct net_device *dev, struct hermes *hw)
 {
 	if (net_ratelimit())
-		printk(KERN_DEBUG "%s: Information frame lost.\n", dev->name);
+		pr_debug("%s: Information frame lost\n", dev->name);
 }
 
 /********************************************************************/
@@ -1646,8 +1634,7 @@ static int __orinoco_up(struct orinoco_private *priv)
 
 	err = __orinoco_commit(priv);
 	if (err) {
-		printk(KERN_ERR "%s: Error %d configuring card\n",
-		       dev->name, err);
+		pr_err("%s: Error %d configuring card\n", dev->name, err);
 		return err;
 	}
 
@@ -1655,8 +1642,7 @@ static int __orinoco_up(struct orinoco_private *priv)
 	hermes_set_irqmask(hw, ORINOCO_INTEN);
 	err = hermes_enable_port(hw, 0);
 	if (err) {
-		printk(KERN_ERR "%s: Error %d enabling MAC port\n",
-		       dev->name, err);
+		pr_err("%s: Error %d enabling MAC port\n", dev->name, err);
 		return err;
 	}
 
@@ -1680,8 +1666,8 @@ static int __orinoco_down(struct orinoco_private *priv)
 				/* Some firmwares (e.g. Intersil 1.3.x) seem
 				 * to have problems disabling the port, oh
 				 * well, too bad. */
-				printk(KERN_WARNING "%s: Error %d disabling MAC port\n",
-				       dev->name, err);
+				pr_warn("%s: Error %d disabling MAC port\n",
+					dev->name, err);
 				priv->broken_disableport = 1;
 			}
 		}
@@ -1774,15 +1760,15 @@ void orinoco_reset(struct work_struct *work)
 	if (priv->hard_reset) {
 		err = (*priv->hard_reset)(priv);
 		if (err) {
-			printk(KERN_ERR "%s: orinoco_reset: Error %d "
-			       "performing hard reset\n", dev->name, err);
+			pr_err("%s: orinoco_reset: Error %d performing hard reset\n",
+			       dev->name, err);
 			goto disable;
 		}
 	}
 
 	err = orinoco_reinit_firmware(priv);
 	if (err) {
-		printk(KERN_ERR "%s: orinoco_reset: Error %d re-initializing firmware\n",
+		pr_err("%s: orinoco_reset: Error %d re-initializing firmware\n",
 		       dev->name, err);
 		goto disable;
 	}
@@ -1797,7 +1783,7 @@ void orinoco_reset(struct work_struct *work)
 	if (priv->open && (!priv->hw_unavailable)) {
 		err = __orinoco_up(priv);
 		if (err) {
-			printk(KERN_ERR "%s: orinoco_reset: Error %d reenabling card\n",
+			pr_err("%s: orinoco_reset: Error %d reenabling card\n",
 			       dev->name, err);
 		} else
 			dev->trans_start = jiffies;
@@ -1809,7 +1795,7 @@ void orinoco_reset(struct work_struct *work)
  disable:
 	hermes_set_irqmask(hw, 0);
 	netif_device_detach(dev);
-	printk(KERN_ERR "%s: Device has been disabled!\n", dev->name);
+	pr_err("%s: Device has been disabled!\n", dev->name);
 }
 
 static int __orinoco_commit(struct orinoco_private *priv)
@@ -1847,29 +1833,28 @@ int orinoco_commit(struct orinoco_private *priv)
 
 	err = hermes_disable_port(hw, 0);
 	if (err) {
-		printk(KERN_WARNING "%s: Unable to disable port "
-		       "while reconfiguring card\n", dev->name);
+		pr_warn("%s: Unable to disable port while reconfiguring card\n",
+			dev->name);
 		priv->broken_disableport = 1;
 		goto out;
 	}
 
 	err = __orinoco_commit(priv);
 	if (err) {
-		printk(KERN_WARNING "%s: Unable to reconfigure card\n",
-		       dev->name);
+		pr_warn("%s: Unable to reconfigure card\n", dev->name);
 		goto out;
 	}
 
 	err = hermes_enable_port(hw, 0);
 	if (err) {
-		printk(KERN_WARNING "%s: Unable to enable port while reconfiguring card\n",
-		       dev->name);
+		pr_warn("%s: Unable to enable port while reconfiguring card\n",
+			dev->name);
 		goto out;
 	}
 
  out:
 	if (err) {
-		printk(KERN_WARNING "%s: Resetting instead...\n", dev->name);
+		pr_warn("%s: Resetting instead...\n", dev->name);
 		schedule_work(&priv->reset_work);
 		err = 0;
 	}
@@ -1882,15 +1867,15 @@ int orinoco_commit(struct orinoco_private *priv)
 
 static void __orinoco_ev_tick(struct net_device *dev, struct hermes *hw)
 {
-	printk(KERN_DEBUG "%s: TICK\n", dev->name);
+	pr_debug("%s: TICK\n", dev->name);
 }
 
 static void __orinoco_ev_wterr(struct net_device *dev, struct hermes *hw)
 {
 	/* This seems to happen a fair bit under load, but ignoring it
 	   seems to work fine...*/
-	printk(KERN_DEBUG "%s: MAC controller error (WTERR). Ignoring.\n",
-	       dev->name);
+	pr_debug("%s: MAC controller error (WTERR). Ignoring.\n",
+		 dev->name);
 }
 
 irqreturn_t orinoco_interrupt(int irq, void *dev_id)
@@ -1929,8 +1914,8 @@ irqreturn_t orinoco_interrupt(int irq, void *dev_id)
 
 	while (events && count--) {
 		if (++loops_this_jiffy > MAX_IRQLOOPS_PER_JIFFY) {
-			printk(KERN_WARNING "%s: IRQ handler is looping too "
-			       "much! Resetting.\n", dev->name);
+			pr_warn("%s: IRQ handler is looping too much! Resetting.\n",
+				dev->name);
 			/* Disable interrupts for now */
 			hermes_set_irqmask(hw, 0);
 			schedule_work(&priv->reset_work);
@@ -2374,7 +2359,7 @@ int orinoco_up(struct orinoco_private *priv)
 
 	err = orinoco_reinit_firmware(priv);
 	if (err) {
-		printk(KERN_ERR "%s: Error %d re-initializing firmware\n",
+		pr_err("%s: Error %d re-initializing firmware\n",
 		       dev->name, err);
 		goto exit;
 	}
@@ -2385,7 +2370,7 @@ int orinoco_up(struct orinoco_private *priv)
 	if (priv->open && !priv->hw_unavailable) {
 		err = __orinoco_up(priv);
 		if (err)
-			printk(KERN_ERR "%s: Error %d restarting card\n",
+			pr_err("%s: Error %d restarting card\n",
 			       dev->name, err);
 	}
 
@@ -2405,8 +2390,7 @@ void orinoco_down(struct orinoco_private *priv)
 	priv->hw.ops->lock_irqsave(&priv->lock, &flags);
 	err = __orinoco_down(priv);
 	if (err)
-		printk(KERN_WARNING "%s: Error %d downing interface\n",
-		       dev->name, err);
+		pr_warn("%s: Error %d downing interface\n", dev->name, err);
 
 	netif_device_detach(dev);
 	priv->hw_unavailable++;
@@ -2426,7 +2410,7 @@ static char version[] __initdata = DRIVER_NAME " " DRIVER_VERSION
 
 static int __init init_orinoco(void)
 {
-	printk(KERN_DEBUG "%s\n", version);
+	pr_debug("%s\n", version);
 	return 0;
 }
 
diff --git a/drivers/net/wireless/orinoco/mic.c b/drivers/net/wireless/orinoco/mic.c
index fce4a84..2263c14 100644
--- a/drivers/net/wireless/orinoco/mic.c
+++ b/drivers/net/wireless/orinoco/mic.c
@@ -2,6 +2,9 @@
  *
  * See copyright notice in main.c
  */
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/kernel.h>
 #include <linux/string.h>
 #include <linux/if_ether.h>
@@ -18,16 +21,16 @@ int orinoco_mic_init(struct orinoco_private *priv)
 {
 	priv->tx_tfm_mic = crypto_alloc_hash("michael_mic", 0, 0);
 	if (IS_ERR(priv->tx_tfm_mic)) {
-		printk(KERN_DEBUG "orinoco_mic_init: could not allocate "
-		       "crypto API michael_mic\n");
+		pr_debug("%s: could not allocate crypto API michael_mic\n",
+			 __func__);
 		priv->tx_tfm_mic = NULL;
 		return -ENOMEM;
 	}
 
 	priv->rx_tfm_mic = crypto_alloc_hash("michael_mic", 0, 0);
 	if (IS_ERR(priv->rx_tfm_mic)) {
-		printk(KERN_DEBUG "orinoco_mic_init: could not allocate "
-		       "crypto API michael_mic\n");
+		pr_debug("%s: could not allocate crypto API michael_mic\n",
+			 __func__);
 		priv->rx_tfm_mic = NULL;
 		return -ENOMEM;
 	}
@@ -52,7 +55,7 @@ int orinoco_mic(struct crypto_hash *tfm_michael, u8 *key,
 	u8 hdr[ETH_HLEN + 2]; /* size of header + padding */
 
 	if (tfm_michael == NULL) {
-		printk(KERN_WARNING "orinoco_mic: tfm_michael == NULL\n");
+		pr_warn("%s: tfm_michael == NULL\n", __func__);
 		return -1;
 	}
 
diff --git a/drivers/net/wireless/orinoco/orinoco.h b/drivers/net/wireless/orinoco/orinoco.h
index 3bb936b..b63a71a 100644
--- a/drivers/net/wireless/orinoco/orinoco.h
+++ b/drivers/net/wireless/orinoco/orinoco.h
@@ -170,12 +170,17 @@ struct orinoco_private {
 
 #ifdef ORINOCO_DEBUG
 extern int orinoco_debug;
-#define DEBUG(n, args...) do { \
-	if (orinoco_debug > (n)) \
-		printk(KERN_DEBUG args); \
+#define DEBUG(n, fmt, ...)				\
+do {							\
+	if (orinoco_debug > (n))			\
+		pr_debug(fmt, ##__VA_ARGS__);		\
 } while (0)
 #else
-#define DEBUG(n, args...) do { } while (0)
+#define DEBUG(n, fmt, ...)				\
+do {							\
+	if (0)						\
+		pr_debug(fmt, ##__VA_ARGS__);		\
+} while (0)
 #endif	/* ORINOCO_DEBUG */
 
 /********************************************************************/
diff --git a/drivers/net/wireless/orinoco/orinoco_cs.c b/drivers/net/wireless/orinoco/orinoco_cs.c
index d7dbc00..ed4b834 100644
--- a/drivers/net/wireless/orinoco/orinoco_cs.c
+++ b/drivers/net/wireless/orinoco/orinoco_cs.c
@@ -10,8 +10,9 @@
  * Copyright notice & release notes in file main.c
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #define DRIVER_NAME "orinoco_cs"
-#define PFX DRIVER_NAME ": "
 
 #include <linux/module.h>
 #include <linux/kernel.h>
@@ -145,9 +146,7 @@ orinoco_cs_config(struct pcmcia_device *link)
 	ret = pcmcia_loop_config(link, orinoco_cs_config_check, NULL);
 	if (ret) {
 		if (!ignore_cis_vcc)
-			printk(KERN_ERR PFX "GetNextTuple(): No matching "
-			       "CIS configuration.  Maybe you need the "
-			       "ignore_cis_vcc=1 parameter.\n");
+			pr_err("GetNextTuple(): No matching CIS configuration.  Maybe you need the ignore_cis_vcc=1 parameter.\n");
 		goto failed;
 	}
 
@@ -171,14 +170,14 @@ orinoco_cs_config(struct pcmcia_device *link)
 
 	/* Initialise the main driver */
 	if (orinoco_init(priv) != 0) {
-		printk(KERN_ERR PFX "orinoco_init() failed\n");
+		pr_err("orinoco_init() failed\n");
 		goto failed;
 	}
 
 	/* Register an interface with the stack */
 	if (orinoco_if_add(priv, link->resource[0]->start,
 			   link->irq, NULL) != 0) {
-		printk(KERN_ERR PFX "orinoco_if_add() failed\n");
+		pr_err("orinoco_if_add() failed\n");
 		goto failed;
 	}
 
diff --git a/drivers/net/wireless/orinoco/orinoco_nortel.c b/drivers/net/wireless/orinoco/orinoco_nortel.c
index 326396b..1a2750f 100644
--- a/drivers/net/wireless/orinoco/orinoco_nortel.c
+++ b/drivers/net/wireless/orinoco/orinoco_nortel.c
@@ -37,8 +37,9 @@
  * under either the MPL or the GPL.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #define DRIVER_NAME "orinoco_nortel"
-#define PFX DRIVER_NAME ": "
 
 #include <linux/module.h>
 #include <linux/kernel.h>
@@ -94,7 +95,7 @@ static int orinoco_nortel_hw_init(struct orinoco_pci_card *card)
 
 	/* Setup bridge */
 	if (ioread16(card->bridge_io) & 1) {
-		printk(KERN_ERR PFX "brg1 answer1 wrong\n");
+		pr_err("brg1 answer1 wrong\n");
 		return -EBUSY;
 	}
 	iowrite16(0x118, card->bridge_io + 2);
@@ -107,19 +108,19 @@ static int orinoco_nortel_hw_init(struct orinoco_pci_card *card)
 			break;
 	}
 	if (i == 30) {
-		printk(KERN_ERR PFX "brg1 timed out\n");
+		pr_err("brg1 timed out\n");
 		return -EBUSY;
 	}
 	if (ioread16(card->attr_io + COR_OFFSET) & 1) {
-		printk(KERN_ERR PFX "brg2 answer1 wrong\n");
+		pr_err("brg2 answer1 wrong\n");
 		return -EBUSY;
 	}
 	if (ioread16(card->attr_io + COR_OFFSET + 2) & 1) {
-		printk(KERN_ERR PFX "brg2 answer2 wrong\n");
+		pr_err("brg2 answer2 wrong\n");
 		return -EBUSY;
 	}
 	if (ioread16(card->attr_io + COR_OFFSET + 4) & 1) {
-		printk(KERN_ERR PFX "brg2 answer3 wrong\n");
+		pr_err("brg2 answer3 wrong\n");
 		return -EBUSY;
 	}
 
@@ -128,8 +129,7 @@ static int orinoco_nortel_hw_init(struct orinoco_pci_card *card)
 	mdelay(1);
 	reg = ioread16(card->attr_io + COR_OFFSET);
 	if (reg != COR_VALUE) {
-		printk(KERN_ERR PFX "Error setting COR value (reg=%x)\n",
-		       reg);
+		pr_err("Error setting COR value (reg=%x)\n", reg);
 		return -EBUSY;
 	}
 
@@ -148,33 +148,33 @@ static int orinoco_nortel_init_one(struct pci_dev *pdev,
 
 	err = pci_enable_device(pdev);
 	if (err) {
-		printk(KERN_ERR PFX "Cannot enable PCI device\n");
+		pr_err("Cannot enable PCI device\n");
 		return err;
 	}
 
 	err = pci_request_regions(pdev, DRIVER_NAME);
 	if (err) {
-		printk(KERN_ERR PFX "Cannot obtain PCI resources\n");
+		pr_err("Cannot obtain PCI resources\n");
 		goto fail_resources;
 	}
 
 	bridge_io = pci_iomap(pdev, 0, 0);
 	if (!bridge_io) {
-		printk(KERN_ERR PFX "Cannot map bridge registers\n");
+		pr_err("Cannot map bridge registers\n");
 		err = -EIO;
 		goto fail_map_bridge;
 	}
 
 	attr_io = pci_iomap(pdev, 1, 0);
 	if (!attr_io) {
-		printk(KERN_ERR PFX "Cannot map PCMCIA attributes\n");
+		pr_err("Cannot map PCMCIA attributes\n");
 		err = -EIO;
 		goto fail_map_attr;
 	}
 
 	hermes_io = pci_iomap(pdev, 2, 0);
 	if (!hermes_io) {
-		printk(KERN_ERR PFX "Cannot map chipset registers\n");
+		pr_err("Cannot map chipset registers\n");
 		err = -EIO;
 		goto fail_map_hermes;
 	}
@@ -183,7 +183,7 @@ static int orinoco_nortel_init_one(struct pci_dev *pdev,
 	priv = alloc_orinocodev(sizeof(*card), &pdev->dev,
 				orinoco_nortel_cor_reset, NULL);
 	if (!priv) {
-		printk(KERN_ERR PFX "Cannot allocate network device\n");
+		pr_err("Cannot allocate network device\n");
 		err = -ENOMEM;
 		goto fail_alloc;
 	}
@@ -197,32 +197,32 @@ static int orinoco_nortel_init_one(struct pci_dev *pdev,
 	err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED,
 			  DRIVER_NAME, priv);
 	if (err) {
-		printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq);
+		pr_err("Cannot allocate IRQ %d\n", pdev->irq);
 		err = -EBUSY;
 		goto fail_irq;
 	}
 
 	err = orinoco_nortel_hw_init(card);
 	if (err) {
-		printk(KERN_ERR PFX "Hardware initialization failed\n");
+		pr_err("Hardware initialization failed\n");
 		goto fail;
 	}
 
 	err = orinoco_nortel_cor_reset(priv);
 	if (err) {
-		printk(KERN_ERR PFX "Initial reset failed\n");
+		pr_err("Initial reset failed\n");
 		goto fail;
 	}
 
 	err = orinoco_init(priv);
 	if (err) {
-		printk(KERN_ERR PFX "orinoco_init() failed\n");
+		pr_err("orinoco_init() failed\n");
 		goto fail;
 	}
 
 	err = orinoco_if_add(priv, 0, 0, NULL);
 	if (err) {
-		printk(KERN_ERR PFX "orinoco_if_add() failed\n");
+		pr_err("orinoco_if_add() failed\n");
 		goto fail;
 	}
 
@@ -301,7 +301,7 @@ MODULE_LICENSE("Dual MPL/GPL");
 
 static int __init orinoco_nortel_init(void)
 {
-	printk(KERN_DEBUG "%s\n", version);
+	pr_debug("%s\n", version);
 	return pci_register_driver(&orinoco_nortel_driver);
 }
 
diff --git a/drivers/net/wireless/orinoco/orinoco_pci.c b/drivers/net/wireless/orinoco/orinoco_pci.c
index 6058c66..fd7b0ed 100644
--- a/drivers/net/wireless/orinoco/orinoco_pci.c
+++ b/drivers/net/wireless/orinoco/orinoco_pci.c
@@ -41,8 +41,9 @@
  * under either the MPL or the GPL.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #define DRIVER_NAME "orinoco_pci"
-#define PFX DRIVER_NAME ": "
 
 #include <linux/module.h>
 #include <linux/kernel.h>
@@ -103,7 +104,7 @@ static int orinoco_pci_cor_reset(struct orinoco_private *priv)
 
 	/* Still busy? */
 	if (reg & HERMES_CMD_BUSY) {
-		printk(KERN_ERR PFX "Busy timeout\n");
+		pr_err("Busy timeout\n");
 		return -ETIMEDOUT;
 	}
 
@@ -120,19 +121,19 @@ static int orinoco_pci_init_one(struct pci_dev *pdev,
 
 	err = pci_enable_device(pdev);
 	if (err) {
-		printk(KERN_ERR PFX "Cannot enable PCI device\n");
+		pr_err("Cannot enable PCI device\n");
 		return err;
 	}
 
 	err = pci_request_regions(pdev, DRIVER_NAME);
 	if (err) {
-		printk(KERN_ERR PFX "Cannot obtain PCI resources\n");
+		pr_err("Cannot obtain PCI resources\n");
 		goto fail_resources;
 	}
 
 	hermes_io = pci_iomap(pdev, 0, 0);
 	if (!hermes_io) {
-		printk(KERN_ERR PFX "Cannot remap chipset registers\n");
+		pr_err("Cannot remap chipset registers\n");
 		err = -EIO;
 		goto fail_map_hermes;
 	}
@@ -141,7 +142,7 @@ static int orinoco_pci_init_one(struct pci_dev *pdev,
 	priv = alloc_orinocodev(sizeof(*card), &pdev->dev,
 				orinoco_pci_cor_reset, NULL);
 	if (!priv) {
-		printk(KERN_ERR PFX "Cannot allocate network device\n");
+		pr_err("Cannot allocate network device\n");
 		err = -ENOMEM;
 		goto fail_alloc;
 	}
@@ -153,26 +154,26 @@ static int orinoco_pci_init_one(struct pci_dev *pdev,
 	err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED,
 			  DRIVER_NAME, priv);
 	if (err) {
-		printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq);
+		pr_err("Cannot allocate IRQ %d\n", pdev->irq);
 		err = -EBUSY;
 		goto fail_irq;
 	}
 
 	err = orinoco_pci_cor_reset(priv);
 	if (err) {
-		printk(KERN_ERR PFX "Initial reset failed\n");
+		pr_err("Initial reset failed\n");
 		goto fail;
 	}
 
 	err = orinoco_init(priv);
 	if (err) {
-		printk(KERN_ERR PFX "orinoco_init() failed\n");
+		pr_err("orinoco_init() failed\n");
 		goto fail;
 	}
 
 	err = orinoco_if_add(priv, 0, 0, NULL);
 	if (err) {
-		printk(KERN_ERR PFX "orinoco_if_add() failed\n");
+		pr_err("orinoco_if_add() failed\n");
 		goto fail;
 	}
 
@@ -244,7 +245,7 @@ MODULE_LICENSE("Dual MPL/GPL");
 
 static int __init orinoco_pci_init(void)
 {
-	printk(KERN_DEBUG "%s\n", version);
+	pr_debug("%s\n", version);
 	return pci_register_driver(&orinoco_pci_driver);
 }
 
diff --git a/drivers/net/wireless/orinoco/orinoco_pci.h b/drivers/net/wireless/orinoco/orinoco_pci.h
index ea7231a..8985975 100644
--- a/drivers/net/wireless/orinoco/orinoco_pci.h
+++ b/drivers/net/wireless/orinoco/orinoco_pci.h
@@ -41,8 +41,7 @@ static int orinoco_pci_resume(struct pci_dev *pdev)
 	pci_set_power_state(pdev, 0);
 	err = pci_enable_device(pdev);
 	if (err) {
-		printk(KERN_ERR "%s: pci_enable_device failed on resume\n",
-		       dev->name);
+		pr_err("%s: pci_enable_device failed on resume\n", dev->name);
 		return err;
 	}
 	pci_restore_state(pdev);
@@ -50,8 +49,7 @@ static int orinoco_pci_resume(struct pci_dev *pdev)
 	err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED,
 			  dev->name, priv);
 	if (err) {
-		printk(KERN_ERR "%s: cannot re-allocate IRQ on resume\n",
-		       dev->name);
+		pr_err("%s: cannot re-allocate IRQ on resume\n", dev->name);
 		pci_disable_device(pdev);
 		return -EBUSY;
 	}
diff --git a/drivers/net/wireless/orinoco/orinoco_plx.c b/drivers/net/wireless/orinoco/orinoco_plx.c
index 2bac824..4d20f62 100644
--- a/drivers/net/wireless/orinoco/orinoco_plx.c
+++ b/drivers/net/wireless/orinoco/orinoco_plx.c
@@ -83,8 +83,9 @@
  * radio card's firmware locks up).
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #define DRIVER_NAME "orinoco_plx"
-#define PFX DRIVER_NAME ": "
 
 #include <linux/module.h>
 #include <linux/kernel.h>
@@ -130,7 +131,7 @@ static int orinoco_plx_cor_reset(struct orinoco_private *priv)
 
 	/* Still busy? */
 	if (reg & HERMES_CMD_BUSY) {
-		printk(KERN_ERR PFX "Busy timeout\n");
+		pr_err("Busy timeout\n");
 		return -ETIMEDOUT;
 	}
 
@@ -145,17 +146,16 @@ static int orinoco_plx_hw_init(struct orinoco_pci_card *card)
 		0x01, 0x03, 0x00, 0x00, 0xff, 0x17, 0x04, 0x67
 	};
 
-	printk(KERN_DEBUG PFX "CIS: ");
+	pr_debug("CIS: ");
 	for (i = 0; i < 16; i++)
-		printk("%02X:", ioread8(card->attr_io + (i << 1)));
-	printk("\n");
+		pr_cont("%02X:", ioread8(card->attr_io + (i << 1)));
+	pr_cont("\n");
 
 	/* Verify whether a supported PC card is present */
 	/* FIXME: we probably need to be smarted about this */
 	for (i = 0; i < sizeof(cis_magic); i++) {
 		if (cis_magic[i] != ioread8(card->attr_io + (i << 1))) {
-			printk(KERN_ERR PFX "The CIS value of Prism2 PC "
-			       "card is unexpected\n");
+			pr_err("The CIS value of Prism2 PC card is unexpected\n");
 			return -ENODEV;
 		}
 	}
@@ -169,7 +169,7 @@ static int orinoco_plx_hw_init(struct orinoco_pci_card *card)
 		iowrite32(csr_reg, card->bridge_io + PLX_INTCSR);
 		csr_reg = ioread32(card->bridge_io + PLX_INTCSR);
 		if (!(csr_reg & PLX_INTCSR_INTEN)) {
-			printk(KERN_ERR PFX "Cannot enable interrupts\n");
+			pr_err("Cannot enable interrupts\n");
 			return -EIO;
 		}
 	}
@@ -187,33 +187,33 @@ static int orinoco_plx_init_one(struct pci_dev *pdev,
 
 	err = pci_enable_device(pdev);
 	if (err) {
-		printk(KERN_ERR PFX "Cannot enable PCI device\n");
+		pr_err("Cannot enable PCI device\n");
 		return err;
 	}
 
 	err = pci_request_regions(pdev, DRIVER_NAME);
 	if (err) {
-		printk(KERN_ERR PFX "Cannot obtain PCI resources\n");
+		pr_err("Cannot obtain PCI resources\n");
 		goto fail_resources;
 	}
 
 	bridge_io = pci_iomap(pdev, 1, 0);
 	if (!bridge_io) {
-		printk(KERN_ERR PFX "Cannot map bridge registers\n");
+		pr_err("Cannot map bridge registers\n");
 		err = -EIO;
 		goto fail_map_bridge;
 	}
 
 	attr_io = pci_iomap(pdev, 2, 0);
 	if (!attr_io) {
-		printk(KERN_ERR PFX "Cannot map PCMCIA attributes\n");
+		pr_err("Cannot map PCMCIA attributes\n");
 		err = -EIO;
 		goto fail_map_attr;
 	}
 
 	hermes_io = pci_iomap(pdev, 3, 0);
 	if (!hermes_io) {
-		printk(KERN_ERR PFX "Cannot map chipset registers\n");
+		pr_err("Cannot map chipset registers\n");
 		err = -EIO;
 		goto fail_map_hermes;
 	}
@@ -222,7 +222,7 @@ static int orinoco_plx_init_one(struct pci_dev *pdev,
 	priv = alloc_orinocodev(sizeof(*card), &pdev->dev,
 				orinoco_plx_cor_reset, NULL);
 	if (!priv) {
-		printk(KERN_ERR PFX "Cannot allocate network device\n");
+		pr_err("Cannot allocate network device\n");
 		err = -ENOMEM;
 		goto fail_alloc;
 	}
@@ -236,32 +236,32 @@ static int orinoco_plx_init_one(struct pci_dev *pdev,
 	err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED,
 			  DRIVER_NAME, priv);
 	if (err) {
-		printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq);
+		pr_err("Cannot allocate IRQ %d\n", pdev->irq);
 		err = -EBUSY;
 		goto fail_irq;
 	}
 
 	err = orinoco_plx_hw_init(card);
 	if (err) {
-		printk(KERN_ERR PFX "Hardware initialization failed\n");
+		pr_err("Hardware initialization failed\n");
 		goto fail;
 	}
 
 	err = orinoco_plx_cor_reset(priv);
 	if (err) {
-		printk(KERN_ERR PFX "Initial reset failed\n");
+		pr_err("Initial reset failed\n");
 		goto fail;
 	}
 
 	err = orinoco_init(priv);
 	if (err) {
-		printk(KERN_ERR PFX "orinoco_init() failed\n");
+		pr_err("orinoco_init() failed\n");
 		goto fail;
 	}
 
 	err = orinoco_if_add(priv, 0, 0, NULL);
 	if (err) {
-		printk(KERN_ERR PFX "orinoco_if_add() failed\n");
+		pr_err("orinoco_if_add() failed\n");
 		goto fail;
 	}
 
@@ -349,7 +349,7 @@ MODULE_LICENSE("Dual MPL/GPL");
 
 static int __init orinoco_plx_init(void)
 {
-	printk(KERN_DEBUG "%s\n", version);
+	pr_debug("%s\n", version);
 	return pci_register_driver(&orinoco_plx_driver);
 }
 
diff --git a/drivers/net/wireless/orinoco/orinoco_tmd.c b/drivers/net/wireless/orinoco/orinoco_tmd.c
index 93159d6..be6883c 100644
--- a/drivers/net/wireless/orinoco/orinoco_tmd.c
+++ b/drivers/net/wireless/orinoco/orinoco_tmd.c
@@ -37,8 +37,9 @@
  * Pheecom sells cards with the TMD chip as "ASIC version"
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #define DRIVER_NAME "orinoco_tmd"
-#define PFX DRIVER_NAME ": "
 
 #include <linux/module.h>
 #include <linux/kernel.h>
@@ -80,7 +81,7 @@ static int orinoco_tmd_cor_reset(struct orinoco_private *priv)
 
 	/* Still busy? */
 	if (reg & HERMES_CMD_BUSY) {
-		printk(KERN_ERR PFX "Busy timeout\n");
+		pr_err("Busy timeout\n");
 		return -ETIMEDOUT;
 	}
 
@@ -98,26 +99,26 @@ static int orinoco_tmd_init_one(struct pci_dev *pdev,
 
 	err = pci_enable_device(pdev);
 	if (err) {
-		printk(KERN_ERR PFX "Cannot enable PCI device\n");
+		pr_err("Cannot enable PCI device\n");
 		return err;
 	}
 
 	err = pci_request_regions(pdev, DRIVER_NAME);
 	if (err) {
-		printk(KERN_ERR PFX "Cannot obtain PCI resources\n");
+		pr_err("Cannot obtain PCI resources\n");
 		goto fail_resources;
 	}
 
 	bridge_io = pci_iomap(pdev, 1, 0);
 	if (!bridge_io) {
-		printk(KERN_ERR PFX "Cannot map bridge registers\n");
+		pr_err("Cannot map bridge registers\n");
 		err = -EIO;
 		goto fail_map_bridge;
 	}
 
 	hermes_io = pci_iomap(pdev, 2, 0);
 	if (!hermes_io) {
-		printk(KERN_ERR PFX "Cannot map chipset registers\n");
+		pr_err("Cannot map chipset registers\n");
 		err = -EIO;
 		goto fail_map_hermes;
 	}
@@ -126,7 +127,7 @@ static int orinoco_tmd_init_one(struct pci_dev *pdev,
 	priv = alloc_orinocodev(sizeof(*card), &pdev->dev,
 				orinoco_tmd_cor_reset, NULL);
 	if (!priv) {
-		printk(KERN_ERR PFX "Cannot allocate network device\n");
+		pr_err("Cannot allocate network device\n");
 		err = -ENOMEM;
 		goto fail_alloc;
 	}
@@ -139,26 +140,26 @@ static int orinoco_tmd_init_one(struct pci_dev *pdev,
 	err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED,
 			  DRIVER_NAME, priv);
 	if (err) {
-		printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq);
+		pr_err("Cannot allocate IRQ %d\n", pdev->irq);
 		err = -EBUSY;
 		goto fail_irq;
 	}
 
 	err = orinoco_tmd_cor_reset(priv);
 	if (err) {
-		printk(KERN_ERR PFX "Initial reset failed\n");
+		pr_err("Initial reset failed\n");
 		goto fail;
 	}
 
 	err = orinoco_init(priv);
 	if (err) {
-		printk(KERN_ERR PFX "orinoco_init() failed\n");
+		pr_err("orinoco_init() failed\n");
 		goto fail;
 	}
 
 	err = orinoco_if_add(priv, 0, 0, NULL);
 	if (err) {
-		printk(KERN_ERR PFX "orinoco_if_add() failed\n");
+		pr_err("orinoco_if_add() failed\n");
 		goto fail;
 	}
 
@@ -227,7 +228,7 @@ MODULE_LICENSE("Dual MPL/GPL");
 
 static int __init orinoco_tmd_init(void)
 {
-	printk(KERN_DEBUG "%s\n", version);
+	pr_debug("%s\n", version);
 	return pci_register_driver(&orinoco_tmd_driver);
 }
 
diff --git a/drivers/net/wireless/orinoco/orinoco_usb.c b/drivers/net/wireless/orinoco/orinoco_usb.c
index 7f53cea2..99b0972 100644
--- a/drivers/net/wireless/orinoco/orinoco_usb.c
+++ b/drivers/net/wireless/orinoco/orinoco_usb.c
@@ -43,8 +43,9 @@
  * gone so MPL/GPL applies.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #define DRIVER_NAME "orinoco_usb"
-#define PFX DRIVER_NAME ": "
 
 #include <linux/module.h>
 #include <linux/kernel.h>
@@ -109,12 +110,12 @@ static int debug;
 
 /* Debugging macros */
 #undef dbg
-#define dbg(format, arg...) \
-	do { if (debug) printk(KERN_DEBUG PFX "%s: " format "\n", \
-			       __func__ , ## arg); } while (0)
-#undef err
-#define err(format, arg...) \
-	do { printk(KERN_ERR PFX format "\n", ## arg); } while (0)
+#define dbg(format, ...)					\
+do {								\
+	if (debug)						\
+		pr_debug("%s: " format,				\
+			 __func__, ##__VA_ARGS__);		\
+} while (0)
 
 /* Module paramaters */
 module_param(debug, int, 0644);
@@ -439,13 +440,13 @@ static void ezusb_ctx_complete(struct request_context *ctx)
 		if (!upriv->udev) {
 			/* This is normal, as all request contexts get flushed
 			 * when the device is disconnected */
-			err("Called, CTX not terminating, but device gone");
+			pr_err("Called, CTX not terminating, but device gone\n");
 			ezusb_complete_all(&ctx->done);
 			ezusb_request_context_put(ctx);
 			break;
 		}
 
-		err("Called, CTX not in terminating state.");
+		pr_err("Called, CTX not in terminating state\n");
 		/* Things are really bad if this happens. Just leak
 		 * the CTX because it may still be linked to the
 		 * queue or the OUT urb may still be active.
@@ -494,8 +495,8 @@ static void ezusb_req_queue_run(struct ezusb_priv *upriv)
 
 			spin_unlock_irqrestore(&upriv->req_lock, flags);
 
-			err("Fatal, failed to submit command urb."
-			    " error=%d\n", result);
+			pr_err("Fatal, failed to submit command urb. error=%d\n",
+			       result);
 
 			ezusb_ctx_complete(ctx);
 			ezusb_request_context_put(ctx);
@@ -549,7 +550,7 @@ static void ezusb_request_out_callback(struct urb *urb)
 
 	if (ctx->killed) {
 		spin_unlock_irqrestore(&upriv->req_lock, flags);
-		pr_warning("interrupt called with dead ctx");
+		pr_warn("interrupt called with dead ctx");
 		goto out;
 	}
 
@@ -577,8 +578,8 @@ static void ezusb_request_out_callback(struct urb *urb)
 
 		default:
 			spin_unlock_irqrestore(&upriv->req_lock, flags);
-			err("Unexpected state(0x%x, %d) in OUT URB",
-			    state, urb->status);
+			pr_err("Unexpected state(0x%x, %d) in OUT URB\n",
+			       state, urb->status);
 			break;
 		}
 	} else {
@@ -601,8 +602,8 @@ static void ezusb_request_out_callback(struct urb *urb)
 		default:
 			spin_unlock_irqrestore(&upriv->req_lock, flags);
 
-			err("Unexpected state(0x%x, %d) in OUT URB",
-			    state, urb->status);
+			pr_err("Unexpected state(0x%x, %d) in OUT URB\n",
+			       state, urb->status);
 			break;
 		}
 	}
@@ -643,8 +644,8 @@ static void ezusb_request_in_callback(struct ezusb_priv *upriv,
 
 	if (ctx == NULL) {
 		spin_unlock_irqrestore(&upriv->req_lock, flags);
-		err("%s: got unexpected RID: 0x%04X", __func__,
-		    le16_to_cpu(ans->hermes_rid));
+		pr_err("%s: got unexpected RID: 0x%04X\n",
+		       __func__, le16_to_cpu(ans->hermes_rid));
 		ezusb_req_queue_run(upriv);
 		return;
 	}
@@ -686,7 +687,7 @@ static void ezusb_request_in_callback(struct ezusb_priv *upriv,
 	default:
 		spin_unlock_irqrestore(&upriv->req_lock, flags);
 
-		pr_warning("Matched IN URB, unexpected context state(0x%x)",
+		pr_warn("Matched IN URB, unexpected context state(0x%x)",
 		     state);
 		/* Throw this CTX away and try submitting another */
 		del_timer(&ctx->timer);
@@ -779,7 +780,7 @@ static int ezusb_submit_in_urb(struct ezusb_priv *upriv)
 	upriv->read_urb->transfer_flags = 0;
 	retval = usb_submit_urb(upriv->read_urb, GFP_ATOMIC);
 	if (retval)
-		err("%s submit failed %d", __func__, retval);
+		pr_err("%s submit failed %d\n", __func__, retval);
 
  exit:
 	return retval;
@@ -790,7 +791,7 @@ static inline int ezusb_8051_cpucs(struct ezusb_priv *upriv, int reset)
 	u8 res_val = reset;	/* avoid argument promotion */
 
 	if (!upriv->udev) {
-		err("%s: !upriv->udev", __func__);
+		pr_err("%s: !upriv->udev\n", __func__);
 		return -EFAULT;
 	}
 	return usb_control_msg(upriv->udev,
@@ -816,8 +817,8 @@ static int ezusb_firmware_download(struct ezusb_priv *upriv,
 	 */
 	variant_offset = be16_to_cpup((__be16 *) &fw->code[FW_VAR_OFFSET_PTR]);
 	if (variant_offset >= fw->size) {
-		printk(KERN_ERR PFX "Invalid firmware variant offset: "
-		       "0x%04x\n", variant_offset);
+		pr_err("Invalid firmware variant offset: 0x%04x\n",
+		       variant_offset);
 		retval = -EINVAL;
 		goto fail;
 	}
@@ -856,8 +857,7 @@ static int ezusb_firmware_download(struct ezusb_priv *upriv,
 
 	goto exit;
  fail:
-	printk(KERN_ERR PFX "Firmware download failed, error %d\n",
-	       retval);
+	pr_err("Firmware download failed, error %d\n", retval);
  exit:
 	return retval;
 }
@@ -879,7 +879,7 @@ static int ezusb_access_ltv(struct ezusb_priv *upriv,
 	}
 
 	if (upriv->read_urb->status != -EINPROGRESS)
-		err("%s: in urb not pending", __func__);
+		pr_err("%s: in urb not pending\n", __func__);
 
 	/* protect upriv->reply_count, guarantee sequential numbers */
 	spin_lock_bh(&upriv->reply_count_lock);
@@ -910,22 +910,21 @@ static int ezusb_access_ltv(struct ezusb_priv *upriv,
 		if (!ctx->in_rid)
 			break;
 	default:
-		err("%s: Unexpected context state %d", __func__,
-		    state);
+		pr_err("%s: Unexpected context state %d\n", __func__, state);
 		/* fall though */
 	case EZUSB_CTX_REQ_TIMEOUT:
 	case EZUSB_CTX_REQ_FAILED:
 	case EZUSB_CTX_RESP_TIMEOUT:
 	case EZUSB_CTX_REQSUBMIT_FAIL:
-		printk(KERN_ERR PFX "Access failed, resetting (state %d,"
-		       " reply_count %d)\n", state, upriv->reply_count);
+		pr_err("Access failed, resetting (state %d, reply_count %d)\n",
+		       state, upriv->reply_count);
 		upriv->reply_count = 0;
 		if (state == EZUSB_CTX_REQ_TIMEOUT
 		    || state == EZUSB_CTX_RESP_TIMEOUT) {
-			printk(KERN_ERR PFX "ctx timed out\n");
+			pr_err("ctx timed out\n");
 			retval = -ETIMEDOUT;
 		} else {
-			printk(KERN_ERR PFX "ctx failed\n");
+			pr_err("ctx failed\n");
 			retval = -EFAULT;
 		}
 		goto exit;
@@ -941,9 +940,8 @@ static int ezusb_access_ltv(struct ezusb_priv *upriv,
 			exp_len = 14;
 
 		if (exp_len != ctx->buf_length) {
-			err("%s: length mismatch for RID 0x%04x: "
-			    "expected %d, got %d", __func__,
-			    ctx->in_rid, exp_len, ctx->buf_length);
+			pr_err("%s: length mismatch for RID 0x%04x: expected %d, got %d\n",
+			       __func__, ctx->in_rid, exp_len, ctx->buf_length);
 			retval = -EIO;
 			goto exit;
 		}
@@ -1058,8 +1056,7 @@ static int ezusb_bap_pread(struct hermes *hw, int bap,
 
 	if (id == EZUSB_RID_RX) {
 		if ((sizeof(*ans) + offset + len) > actual_length) {
-			printk(KERN_ERR PFX "BAP read beyond buffer end "
-			       "in rx frame\n");
+			pr_err("BAP read beyond buffer end in rx frame\n");
 			return -EINVAL;
 		}
 		memcpy(buf, ans->data + offset, len);
@@ -1069,13 +1066,12 @@ static int ezusb_bap_pread(struct hermes *hw, int bap,
 	if (EZUSB_IS_INFO(id)) {
 		/* Include 4 bytes for length/type */
 		if ((sizeof(*ans) + offset + len - 4) > actual_length) {
-			printk(KERN_ERR PFX "BAP read beyond buffer end "
-			       "in info frame\n");
+			pr_err("BAP read beyond buffer end in info frame\n");
 			return -EFAULT;
 		}
 		memcpy(buf, ans->data + offset - 4, len);
 	} else {
-		printk(KERN_ERR PFX "Unexpected fid 0x%04x\n", id);
+		pr_err("Unexpected fid 0x%04x\n", id);
 		return -EINVAL;
 	}
 
@@ -1205,20 +1201,17 @@ static netdev_tx_t ezusb_xmit(struct sk_buff *skb, struct net_device *dev)
 	int tx_size;
 
 	if (!netif_running(dev)) {
-		printk(KERN_ERR "%s: Tx on stopped device!\n",
-		       dev->name);
+		pr_err("%s: Tx on stopped device!\n", dev->name);
 		return NETDEV_TX_BUSY;
 	}
 
 	if (netif_queue_stopped(dev)) {
-		printk(KERN_DEBUG "%s: Tx while transmitter busy!\n",
-		       dev->name);
+		pr_debug("%s: Tx while transmitter busy!\n", dev->name);
 		return NETDEV_TX_BUSY;
 	}
 
 	if (orinoco_lock(priv, &flags) != 0) {
-		printk(KERN_ERR
-		       "%s: ezusb_xmit() called while hw_unavailable\n",
+		pr_err("%s: ezusb_xmit() called while hw_unavailable\n",
 		       dev->name);
 		return NETDEV_TX_BUSY;
 	}
@@ -1281,7 +1274,7 @@ static netdev_tx_t ezusb_xmit(struct sk_buff *skb, struct net_device *dev)
 	if (err) {
 		netif_start_queue(dev);
 		if (net_ratelimit())
-			printk(KERN_ERR "%s: Error %d transmitting packet\n",
+			pr_err("%s: Error %d transmitting packet\n",
 				dev->name, err);
 		goto busy;
 	}
@@ -1317,13 +1310,13 @@ static int ezusb_hard_reset(struct orinoco_private *priv)
 	int retval = ezusb_8051_cpucs(upriv, 1);
 
 	if (retval < 0) {
-		err("Failed to reset");
+		pr_err("Failed to reset\n");
 		return retval;
 	}
 
 	retval = ezusb_8051_cpucs(upriv, 0);
 	if (retval < 0) {
-		err("Failed to unreset");
+		pr_err("Failed to unreset\n");
 		return retval;
 	}
 
@@ -1335,7 +1328,7 @@ static int ezusb_hard_reset(struct orinoco_private *priv)
 				 USB_DIR_OUT, 0x0, 0x0, NULL, 0,
 				 DEF_TIMEOUT);
 	if (retval < 0) {
-		err("EZUSB_REQUEST_TRIGER failed retval %d", retval);
+		pr_err("EZUSB_REQUEST_TRIGER failed retval %d\n", retval);
 		return retval;
 	}
 #if 0
@@ -1347,7 +1340,7 @@ static int ezusb_hard_reset(struct orinoco_private *priv)
 				 USB_DIR_OUT, 0x00FA, 0x0, NULL, 0,
 				 DEF_TIMEOUT);
 	if (retval < 0) {
-		err("EZUSB_REQUEST_TRIG_AC failed retval %d", retval);
+		pr_err("EZUSB_REQUEST_TRIG_AC failed retval %d\n", retval);
 		return retval;
 	}
 #endif
@@ -1376,13 +1369,13 @@ static int ezusb_init(struct hermes *hw)
 	retval = ezusb_write_ltv(hw, 0, EZUSB_RID_INIT1,
 				 HERMES_BYTES_TO_RECLEN(2), "\x10\x00");
 	if (retval < 0) {
-		printk(KERN_ERR PFX "EZUSB_RID_INIT1 error %d\n", retval);
+		pr_err("EZUSB_RID_INIT1 error %d\n", retval);
 		return retval;
 	}
 
 	retval = ezusb_docmd_wait(hw, HERMES_CMD_INIT, 0, NULL);
 	if (retval < 0) {
-		printk(KERN_ERR PFX "HERMES_CMD_INIT error %d\n", retval);
+		pr_err("HERMES_CMD_INIT error %d\n", retval);
 		return retval;
 	}
 
@@ -1405,11 +1398,11 @@ static void ezusb_bulk_in_callback(struct urb *urb)
 		/* When a device gets unplugged we get this every time
 		 * we resubmit, flooding the logs.  Since we don't use
 		 * USB timeouts, it shouldn't happen any other time*/
-		pr_warning("%s: urb timed out, not resubmiting", __func__);
+		pr_warn("%s: urb timed out, not resubmiting", __func__);
 		return;
 	}
 	if (urb->status == -ECONNABORTED) {
-		pr_warning("%s: connection abort, resubmiting urb",
+		pr_warn("%s: connection abort, resubmiting urb",
 		     __func__);
 		goto resubmit;
 	}
@@ -1423,12 +1416,12 @@ static void ezusb_bulk_in_callback(struct urb *urb)
 		dbg("status: %d length: %d",
 		    urb->status, urb->actual_length);
 	if (urb->actual_length < sizeof(*ans)) {
-		err("%s: short read, ignoring", __func__);
+		pr_err("%s: short read, ignoring\n", __func__);
 		goto resubmit;
 	}
 	crc = build_crc(ans);
 	if (le16_to_cpu(ans->crc) != crc) {
-		err("CRC error, ignoring packet");
+		pr_err("CRC error, ignoring packet\n");
 		goto resubmit;
 	}
 
@@ -1502,7 +1495,7 @@ static inline void ezusb_delete(struct ezusb_priv *upriv)
 					  struct request_context, list));
 
 	if (upriv->read_urb && upriv->read_urb->status == -EINPROGRESS)
-		printk(KERN_ERR PFX "Some URB in progress\n");
+		pr_err("Some URB in progress\n");
 
 	mutex_unlock(&upriv->mtx);
 
@@ -1586,7 +1579,7 @@ static int ezusb_probe(struct usb_interface *interface,
 	priv = alloc_orinocodev(sizeof(*upriv), &udev->dev,
 				ezusb_hard_reset, NULL);
 	if (!priv) {
-		err("Couldn't allocate orinocodev");
+		pr_err("Couldn't allocate orinocodev\n");
 		goto exit;
 	}
 
@@ -1621,19 +1614,19 @@ static int ezusb_probe(struct usb_interface *interface,
 		     == USB_ENDPOINT_XFER_BULK)) {
 			/* we found a bulk in endpoint */
 			if (upriv->read_urb != NULL) {
-				pr_warning("Found a second bulk in ep, ignored");
+				pr_warn("Found a second bulk in ep, ignored");
 				continue;
 			}
 
 			upriv->read_urb = usb_alloc_urb(0, GFP_KERNEL);
 			if (!upriv->read_urb) {
-				err("No free urbs available");
+				pr_err("No free urbs available\n");
 				goto error;
 			}
 			if (le16_to_cpu(ep->wMaxPacketSize) != 64)
-				pr_warning("bulk in: wMaxPacketSize!= 64");
+				pr_warn("bulk in: wMaxPacketSize!= 64");
 			if (ep->bEndpointAddress != (2 | USB_DIR_IN))
-				pr_warning("bulk in: bEndpointAddress: %d",
+				pr_warn("bulk in: bEndpointAddress: %d",
 				     ep->bEndpointAddress);
 			upriv->read_pipe = usb_rcvbulkpipe(udev,
 							 ep->
@@ -1641,7 +1634,7 @@ static int ezusb_probe(struct usb_interface *interface,
 			upriv->read_urb->transfer_buffer =
 			    kmalloc(BULK_BUF_SIZE, GFP_KERNEL);
 			if (!upriv->read_urb->transfer_buffer) {
-				err("Couldn't allocate IN buffer");
+				pr_err("Couldn't allocate IN buffer\n");
 				goto error;
 			}
 		}
@@ -1652,27 +1645,27 @@ static int ezusb_probe(struct usb_interface *interface,
 		     == USB_ENDPOINT_XFER_BULK)) {
 			/* we found a bulk out endpoint */
 			if (upriv->bap_buf != NULL) {
-				pr_warning("Found a second bulk out ep, ignored");
+				pr_warn("Found a second bulk out ep, ignored");
 				continue;
 			}
 
 			if (le16_to_cpu(ep->wMaxPacketSize) != 64)
-				pr_warning("bulk out: wMaxPacketSize != 64");
+				pr_warn("bulk out: wMaxPacketSize != 64");
 			if (ep->bEndpointAddress != 2)
-				pr_warning("bulk out: bEndpointAddress: %d",
+				pr_warn("bulk out: bEndpointAddress: %d",
 				     ep->bEndpointAddress);
 			upriv->write_pipe = usb_sndbulkpipe(udev,
 							  ep->
 							  bEndpointAddress);
 			upriv->bap_buf = kmalloc(BULK_BUF_SIZE, GFP_KERNEL);
 			if (!upriv->bap_buf) {
-				err("Couldn't allocate bulk_out_buffer");
+				pr_err("Couldn't allocate bulk_out_buffer\n");
 				goto error;
 			}
 		}
 	}
 	if (!upriv->bap_buf || !upriv->read_urb) {
-		err("Didn't find the required bulk endpoints");
+		pr_err("Didn't find the required bulk endpoints\n");
 		goto error;
 	}
 
@@ -1684,12 +1677,12 @@ static int ezusb_probe(struct usb_interface *interface,
 	if (firmware.size && firmware.code) {
 		ezusb_firmware_download(upriv, &firmware);
 	} else {
-		err("No firmware to download");
+		pr_err("No firmware to download\n");
 		goto error;
 	}
 
 	if (ezusb_hard_reset(priv) < 0) {
-		err("Cannot reset the device");
+		pr_err("Cannot reset the device\n");
 		goto error;
 	}
 
@@ -1698,20 +1691,20 @@ static int ezusb_probe(struct usb_interface *interface,
 	 * the kernel very unstable, so we try initializing here and quit in
 	 * case of error */
 	if (ezusb_init(hw) < 0) {
-		err("Couldn't initialize the device");
-		err("Firmware may not be downloaded or may be wrong.");
+		pr_err("Couldn't initialize the device\n");
+		pr_err("Firmware may not be downloaded or may be wrong\n");
 		goto error;
 	}
 
 	/* Initialise the main driver */
 	if (orinoco_init(priv) != 0) {
-		err("orinoco_init() failed\n");
+		pr_err("orinoco_init() failed\n");
 		goto error;
 	}
 
 	if (orinoco_if_add(priv, 0, 0, &ezusb_netdev_ops) != 0) {
 		upriv->dev = NULL;
-		err("%s: orinoco_if_add() failed", __func__);
+		pr_err("%s: orinoco_if_add() failed\n", __func__);
 		goto error;
 	}
 	upriv->dev = priv->ndev;
@@ -1742,7 +1735,7 @@ static void ezusb_disconnect(struct usb_interface *intf)
 	struct ezusb_priv *upriv = usb_get_intfdata(intf);
 	usb_set_intfdata(intf, NULL);
 	ezusb_delete(upriv);
-	printk(KERN_INFO PFX "Disconnected\n");
+	pr_info("Disconnected\n");
 }
 
 
diff --git a/drivers/net/wireless/orinoco/scan.c b/drivers/net/wireless/orinoco/scan.c
index 96e39ed..afa6f79 100644
--- a/drivers/net/wireless/orinoco/scan.c
+++ b/drivers/net/wireless/orinoco/scan.c
@@ -3,6 +3,8 @@
  * See copyright notice in main.c
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/gfp.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
@@ -113,8 +115,8 @@ static void orinoco_add_hostscan_result(struct orinoco_private *priv,
 	freq = ieee80211_dsss_chan_to_freq(le16_to_cpu(bss->a.channel));
 	channel = ieee80211_get_channel(wiphy, freq);
 	if (!channel) {
-		printk(KERN_DEBUG "Invalid channel designation %04X(%04X)",
-			bss->a.channel, freq);
+		pr_debug("Invalid channel designation %04X(%04X)\n",
+			 bss->a.channel, freq);
 		return;	/* Then ignore it for now */
 	}
 	timestamp = 0;
@@ -199,9 +201,8 @@ void orinoco_add_hostscan_results(struct orinoco_private *priv,
 			atom_len = le16_to_cpup((__le16 *)buf);
 			/* Sanity check for atom_len */
 			if (atom_len < sizeof(struct prism2_scan_apinfo)) {
-				printk(KERN_ERR "%s: Invalid atom_len in scan "
-				       "data: %zu\n", priv->ndev->name,
-				       atom_len);
+				pr_err("%s: Invalid atom_len in scan data: %zu\n",
+				       priv->ndev->name, atom_len);
 				abort = true;
 				goto scan_abort;
 			}
@@ -216,9 +217,8 @@ void orinoco_add_hostscan_results(struct orinoco_private *priv,
 
 	/* Check that we got an whole number of atoms */
 	if ((len - offset) % atom_len) {
-		printk(KERN_ERR "%s: Unexpected scan data length %zu, "
-		       "atom_len %zu, offset %d\n", priv->ndev->name, len,
-		       atom_len, offset);
+		pr_err("%s: Unexpected scan data length %zu, atom_len %zu, offset %d\n",
+		       priv->ndev->name, len, atom_len, offset);
 		abort = true;
 		goto scan_abort;
 	}
diff --git a/drivers/net/wireless/orinoco/spectrum_cs.c b/drivers/net/wireless/orinoco/spectrum_cs.c
index 6e28ee4..4722aa5 100644
--- a/drivers/net/wireless/orinoco/spectrum_cs.c
+++ b/drivers/net/wireless/orinoco/spectrum_cs.c
@@ -208,7 +208,7 @@ spectrum_cs_config(struct pcmcia_device *link)
 	ret = pcmcia_loop_config(link, spectrum_cs_config_check, NULL);
 	if (ret) {
 		if (!ignore_cis_vcc)
-			printk(KERN_ERR PFX "GetNextTuple(): No matching "
+			pr_err(PFX "GetNextTuple(): No matching "
 			       "CIS configuration.  Maybe you need the "
 			       "ignore_cis_vcc=1 parameter.\n");
 		goto failed;
@@ -239,14 +239,14 @@ spectrum_cs_config(struct pcmcia_device *link)
 
 	/* Initialise the main driver */
 	if (orinoco_init(priv) != 0) {
-		printk(KERN_ERR PFX "orinoco_init() failed\n");
+		pr_err(PFX "orinoco_init() failed\n");
 		goto failed;
 	}
 
 	/* Register an interface with the stack */
 	if (orinoco_if_add(priv, link->resource[0]->start,
 			   link->irq, NULL) != 0) {
-		printk(KERN_ERR PFX "orinoco_if_add() failed\n");
+		pr_err(PFX "orinoco_if_add() failed\n");
 		goto failed;
 	}
 
diff --git a/drivers/net/wireless/orinoco/wext.c b/drivers/net/wireless/orinoco/wext.c
index 33747e1..b48ec31 100644
--- a/drivers/net/wireless/orinoco/wext.c
+++ b/drivers/net/wireless/orinoco/wext.c
@@ -2,6 +2,9 @@
  *
  * See copyright notice in main.c
  */
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/slab.h>
 #include <linux/kernel.h>
 #include <linux/if_arp.h>
@@ -94,8 +97,8 @@ static struct iw_statistics *orinoco_get_wireless_stats(struct net_device *dev)
 	unsigned long flags;
 
 	if (!netif_device_present(dev)) {
-		printk(KERN_WARNING "%s: get_wireless_stats() called while device not present\n",
-		       dev->name);
+		pr_warn("%s: get_wireless_stats() called while device not present\n",
+			dev->name);
 		return NULL; /* FIXME: Can we do better than this? */
 	}
 
@@ -180,16 +183,15 @@ static int orinoco_ioctl_setwap(struct net_device *dev,
 	}
 
 	if (priv->firmware_type == FIRMWARE_TYPE_AGERE) {
-		printk(KERN_WARNING "%s: Lucent/Agere firmware doesn't "
-		       "support manual roaming\n",
-		       dev->name);
+		pr_warn("%s: Lucent/Agere firmware doesn't support manual roaming\n",
+			dev->name);
 		err = -EOPNOTSUPP;
 		goto out;
 	}
 
 	if (priv->iw_mode != NL80211_IFTYPE_STATION) {
-		printk(KERN_WARNING "%s: Manual roaming supported only in "
-		       "managed mode\n", dev->name);
+		pr_warn("%s: Manual roaming supported only in managed mode\n",
+			dev->name);
 		err = -EOPNOTSUPP;
 		goto out;
 	}
@@ -197,8 +199,8 @@ static int orinoco_ioctl_setwap(struct net_device *dev,
 	/* Intersil firmware hangs without Desired ESSID */
 	if (priv->firmware_type == FIRMWARE_TYPE_INTERSIL &&
 	    strlen(priv->desired_essid) == 0) {
-		printk(KERN_WARNING "%s: Desired ESSID must be set for "
-		       "manual roaming\n", dev->name);
+		pr_warn("%s: Desired ESSID must be set for manual roaming\n",
+			dev->name);
 		err = -EOPNOTSUPP;
 		goto out;
 	}
@@ -795,8 +797,8 @@ static int orinoco_ioctl_set_encodeext(struct net_device *dev,
 				 priv->keys[idx].key,
 				 tkip_iv, ORINOCO_SEQ_LEN, NULL, 0);
 			if (err)
-				printk(KERN_ERR "%s: Error %d setting TKIP key"
-				       "\n", dev->name, err);
+				pr_err("%s: Error %d setting TKIP key\n",
+				       dev->name, err);
 
 			goto out;
 		}
@@ -1107,12 +1109,12 @@ static int orinoco_ioctl_reset(struct net_device *dev,
 		return -EPERM;
 
 	if (info->cmd == (SIOCIWFIRSTPRIV + 0x1)) {
-		printk(KERN_DEBUG "%s: Forcing reset!\n", dev->name);
+		pr_debug("%s: Forcing reset!\n", dev->name);
 
 		/* Firmware reset */
 		orinoco_reset(&priv->reset_work);
 	} else {
-		printk(KERN_DEBUG "%s: Force scheduling reset!\n", dev->name);
+		pr_debug("%s: Force scheduling reset!\n", dev->name);
 
 		schedule_work(&priv->reset_work);
 	}
-- 
1.7.8.111.gad25c.dirty

^ permalink raw reply related

* [PATCH wireless-next 14/20] p54: Use pr_<level>
From: Joe Perches @ 2012-06-15  5:53 UTC (permalink / raw)
  To: Christian Lamparter
  Cc: John W. Linville, linux-wireless, netdev, linux-kernel
In-Reply-To: <cover.1339739415.git.joe@perches.com>

Use a more current logging style.

Convert printks to pr_<level>.
Coalesce formats, align arguments.

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/wireless/p54/fwio.c   |    6 ++++--
 drivers/net/wireless/p54/p54spi.c |    4 +++-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/p54/fwio.c b/drivers/net/wireless/p54/fwio.c
index 18e82b3..ea64d5d 100644
--- a/drivers/net/wireless/p54/fwio.c
+++ b/drivers/net/wireless/p54/fwio.c
@@ -16,6 +16,8 @@
  * published by the Free Software Foundation.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/firmware.h>
@@ -100,8 +102,8 @@ int p54_parse_firmware(struct ieee80211_hw *dev, const struct firmware *fw)
 				 4 + /* rx alignment */
 				 IEEE80211_MAX_FRAG_THRESHOLD;
 			if (priv->rx_mtu > maxlen && PAGE_SIZE == 4096) {
-				printk(KERN_INFO "p54: rx_mtu reduced from %d "
-				       "to %d\n", priv->rx_mtu, maxlen);
+				pr_info("rx_mtu reduced from %d to %d\n",
+					priv->rx_mtu, maxlen);
 				priv->rx_mtu = maxlen;
 			}
 			break;
diff --git a/drivers/net/wireless/p54/p54spi.c b/drivers/net/wireless/p54/p54spi.c
index f792990..8bf4a01 100644
--- a/drivers/net/wireless/p54/p54spi.c
+++ b/drivers/net/wireless/p54/p54spi.c
@@ -20,6 +20,8 @@
  * 02110-1301 USA
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/interrupt.h>
@@ -719,7 +721,7 @@ static int __init p54spi_init(void)
 
 	ret = spi_register_driver(&p54spi_driver);
 	if (ret < 0) {
-		printk(KERN_ERR "failed to register SPI driver: %d", ret);
+		pr_err("failed to register SPI driver: %d\n", ret);
 		goto out;
 	}
 
-- 
1.7.8.111.gad25c.dirty

^ permalink raw reply related


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