Re: [PATCH 3/3] hv_netvsc: Implement VF matching based on serial numbers

2016-12-10 Thread Greg KH
On Fri, Dec 09, 2016 at 04:21:48PM -0800, Stephen Hemminger wrote:
> On Fri, 9 Dec 2016 22:35:05 +
> Haiyang Zhang  wrote:
> 
> > > > >
> > > > > Emulated NIC is already excluded in start of netvc notifier handler.
> > > > >
> > > > > static int netvsc_netdev_event(struct notifier_block *this,
> > > > >  unsigned long event, void *ptr)
> > > > > {
> > > > >   struct net_device *event_dev = netdev_notifier_info_to_dev(ptr);
> > > > >
> > > > >   /* Skip our own events */
> > > > >   if (event_dev->netdev_ops == &device_ops)
> > > > >   return NOTIFY_DONE;
> > > > >  
> > > >
> > > > Emulated device is not based on netvsc. It's the native Linux  
> > > (dec100M?)  
> > > > Driver. So this line doesn't exclude it. And how about other NIC type
> > > > may be added in the future?  
> > > 
> > > Sorry, forgot about that haven't used emulated device in years.
> > > The emulated device should appear to be on a PCI bus, but the serial
> > > would not match??  
> > 
> > It's not a vmbus device, not a hv_pci device either. Hv_PCI is a subset
> > of vmbus devices. So emulated NIC won't have hv_pci serial number.
> > 
> > In my patch, the following code ensure, we only try to get serial number
> > after confirming it's vmbus and hv_pci device:
> > 
> > +   if (!dev_is_vmbus(dev))
> > +   continue;
> > +
> > +   hdev = device_to_hv_device(dev);
> > +   if (hdev->device_id != HV_PCIE)
> > +   continue;
> 
> Ok, the walk back up the device tree is logically ok, but I don't
> know enough about PCI device tree to be assured that it is safe.
> Also, you could short circuit away most of the unwanted devices
> by making sure the vf_netdev->dev.parent is a PCI device.

Ugh, this seems really really messy.  Can't we just have the
netdev_event interface pass back a pointer to something that we "know"
what it is?  This walking the device tree is a mess, and not good.

I'd even argue that dev_is_pci() needs to be removed from the tree too,
as it shouldn't be needed either.  We did a lot of work on the driver
model to prevent the need for having to declare the "type" of 'struct
device' at all, and by doing this type of thing it goes against the
basic design of the model.

Yes, it makes things a bit "tougher" in places, but you don't do crazy
things like walk device trees to try to find random devices and then
think it's safe to actually use them :(

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 10/14] rtlwifi: Add BTC_TRACE_STRING to new btcoex

2016-12-10 Thread Joe Perches
On Sat, 2016-12-10 at 00:56 +0100, Markus Böhme wrote:
> On 12/09/2016 09:50 AM, Kalle Valo wrote:
> > Dan Carpenter  writes:
> > 
> > > On Thu, Dec 08, 2016 at 02:50:49PM +0300, Dan Carpenter wrote:
> > > > On Thu, Dec 08, 2016 at 01:43:42PM +0200, Kalle Valo wrote:
> > > > > But it would make me very happy if someone would add a similar 
> > > > > grouping
> > > > > functionality to dyndbg to make it easy to enable a set of debug
> > > > > messages in a driver.
> > > > 
> > > > Thats seems like a reasonable thing as well.
> > > 
> > > I actually like the ath code...  We could easily change it to be more
> > > generic and make it a top level function for everyone to use.
> > 
> > That would be great. And maybe add a sysfs file with a description
> > different levels, like module parameters have. Too bad that I can't work
> > on that, too much stuff on my plate right now.
> > 
> 
> In this case I would like to step in and try to implement grouping of
> messages in the dynamic debug code. This seems to be an interesting
> learning opportunity.

Use bitmaps and levels.

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: iio: impedance-analyzer: ad5933: fix wrong comments

2016-12-10 Thread Jonathan Cameron
On 07/12/16 17:44, Nizam Haider wrote:
> according to datasheet complete control register is of 2 bytes.
> http://www.analog.com/media/en/technical-documentation/data-sheets/AD5933.pdf
> 
> Signed-off-by: Nizam Haider 
Applied to the togreg branch of iio.git - initially pushed out as testing so the
autobuilders can completely ignore this patch ;)

Jonathan
> ---
>  drivers/staging/iio/impedance-analyzer/ad5933.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/iio/impedance-analyzer/ad5933.c 
> b/drivers/staging/iio/impedance-analyzer/ad5933.c
> index 3892a74..f39e03a 100644
> --- a/drivers/staging/iio/impedance-analyzer/ad5933.c
> +++ b/drivers/staging/iio/impedance-analyzer/ad5933.c
> @@ -23,8 +23,8 @@
>  #include 
>  
>  /* AD5933/AD5934 Registers */
> -#define AD5933_REG_CONTROL_HB0x80/* R/W, 2 bytes */
> -#define AD5933_REG_CONTROL_LB0x81/* R/W, 2 bytes */
> +#define AD5933_REG_CONTROL_HB0x80/* R/W, 1 byte */
> +#define AD5933_REG_CONTROL_LB0x81/* R/W, 1 byte */
>  #define AD5933_REG_FREQ_START0x82/* R/W, 3 bytes */
>  #define AD5933_REG_FREQ_INC  0x85/* R/W, 3 bytes */
>  #define AD5933_REG_INC_NUM   0x88/* R/W, 2 bytes, 9 bit */
> 

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 0/5] Fix ups to make lustre_idl.h a proper UAPI header

2016-12-10 Thread James Simmons
From: James Simmons James Simmons 

Fix ups to make lustre_idl.h a proper UAPI header

The header lustre_idl.h is a UAPI header which contains extras
that don't belong. This patch set moves a bunch of very kernel
specific material out of the header. Lastly proper byteorder
functions are used so this file can build in user space as well.

Ben Evans (4):
  staging: lustre: obdclass: Create a header for obdo related functions
  staging: lustre: obdclass: style cleanup for obdo related functions
  staging: lustre: headers: sort headers affected by obdo move
  staging: lustre: headers: Move functions out of lustre_idl.h

James Simmons (1):
  staging: lustre: headers: use proper byteorder functions in lustre_idl.h

 .../lustre/lustre/include/lustre/lustre_idl.h  | 174 -
 drivers/staging/lustre/lustre/include/lustre_dlm.h |  13 ++
 .../staging/lustre/lustre/include/lustre_obdo.h|  54 +++
 .../staging/lustre/lustre/include/lustre_swab.h|   6 +
 drivers/staging/lustre/lustre/ldlm/ldlm_internal.h |   6 +
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c  |  27 
 drivers/staging/lustre/lustre/mdc/mdc_lib.c|   6 +
 drivers/staging/lustre/lustre/obdclass/obdo.c  |  54 +++
 drivers/staging/lustre/lustre/osc/osc_io.c |   2 +
 drivers/staging/lustre/lustre/osc/osc_request.c|  16 +-
 10 files changed, 206 insertions(+), 152 deletions(-)
 create mode 100644 drivers/staging/lustre/lustre/include/lustre_obdo.h

--
1.8.3.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 1/5] staging: lustre: obdclass: Create a header for obdo related functions

2016-12-10 Thread James Simmons
From: Ben Evans 

Remove all obdo related functions from lustre_idl.h
Create lustre_odbo.h. Include where appropriate.
Make the functions lustre_get_wire_obdo and
lustre_set_wire_obdo to not be inlined functions.

Signed-off-by: Ben Evans 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401
Reviewed-on: http://review.whamcloud.com/16917
Reviewed-on: http://review.whamcloud.com/19266
Reviewed-by: James Simmons 
Reviewed-by: Andreas Dilger 
Reviewed-by: John L. Hammond 
Reviewed-by: Oleg Drokin 
Signed-off-by: James Simmons 
---

Changelog:

v1) Initial patch from earlier version that broke build

v2) Include lustre_obdo.h to osc_request.c so it can
build. Next move style changes from moved functions
to separate patch.

 .../lustre/lustre/include/lustre/lustre_idl.h  | 46 --
 .../staging/lustre/lustre/include/lustre_obdo.h| 54 ++
 drivers/staging/lustre/lustre/obdclass/obdo.c  | 53 +
 drivers/staging/lustre/lustre/osc/osc_io.c |  2 +
 drivers/staging/lustre/lustre/osc/osc_request.c|  1 +
 5 files changed, 110 insertions(+), 46 deletions(-)
 create mode 100644 drivers/staging/lustre/lustre/include/lustre_obdo.h

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index 65ce503..b0eb80d 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -3130,52 +3130,6 @@ struct obdo {
 #define o_cksum   o_nlink
 #define o_grant_used o_data_version
 
-static inline void lustre_set_wire_obdo(const struct obd_connect_data *ocd,
-   struct obdo *wobdo,
-   const struct obdo *lobdo)
-{
-   *wobdo = *lobdo;
-   wobdo->o_flags &= ~OBD_FL_LOCAL_MASK;
-   if (!ocd)
-   return;
-
-   if (unlikely(!(ocd->ocd_connect_flags & OBD_CONNECT_FID)) &&
-   fid_seq_is_echo(ostid_seq(&lobdo->o_oi))) {
-   /* Currently OBD_FL_OSTID will only be used when 2.4 echo
-* client communicate with pre-2.4 server
-*/
-   wobdo->o_oi.oi.oi_id = fid_oid(&lobdo->o_oi.oi_fid);
-   wobdo->o_oi.oi.oi_seq = fid_seq(&lobdo->o_oi.oi_fid);
-   }
-}
-
-static inline void lustre_get_wire_obdo(const struct obd_connect_data *ocd,
-   struct obdo *lobdo,
-   const struct obdo *wobdo)
-{
-   __u32 local_flags = 0;
-
-   if (lobdo->o_valid & OBD_MD_FLFLAGS)
-   local_flags = lobdo->o_flags & OBD_FL_LOCAL_MASK;
-
-   *lobdo = *wobdo;
-   if (local_flags != 0) {
-   lobdo->o_valid |= OBD_MD_FLFLAGS;
-   lobdo->o_flags &= ~OBD_FL_LOCAL_MASK;
-   lobdo->o_flags |= local_flags;
-   }
-   if (!ocd)
-   return;
-
-   if (unlikely(!(ocd->ocd_connect_flags & OBD_CONNECT_FID)) &&
-   fid_seq_is_echo(wobdo->o_oi.oi.oi_seq)) {
-   /* see above */
-   lobdo->o_oi.oi_fid.f_seq = wobdo->o_oi.oi.oi_seq;
-   lobdo->o_oi.oi_fid.f_oid = wobdo->o_oi.oi.oi_id;
-   lobdo->o_oi.oi_fid.f_ver = 0;
-   }
-}
-
 /* request structure for OST's */
 struct ost_body {
struct  obdo oa;
diff --git a/drivers/staging/lustre/lustre/include/lustre_obdo.h 
b/drivers/staging/lustre/lustre/include/lustre_obdo.h
new file mode 100644
index 000..1e12f8c
--- /dev/null
+++ b/drivers/staging/lustre/lustre/include/lustre_obdo.h
@@ -0,0 +1,54 @@
+/*
+ * GPL HEADER START
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 only,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License version 2 for more details (a copy is included
+ * in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License
+ * version 2 along with this program; If not, see
+ * http://www.gnu.org/licenses/gpl-2.0.html
+ *
+ * GPL HEADER END
+ */
+/*
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Use is subject to license terms.
+ *
+ * Copyright (c) 2011, 2014, Intel Corporation.
+ *
+ * Copyright 2015 Cray Inc, all rights reserved.
+ * Author: Ben Evans.
+ *
+ * Define obdo associated functions
+ *   obdo:  OBject Device o...
+ */
+
+#ifndef _LUSTRE_OBDO_H_
+#define _LUSTRE_OBDO_H_
+
+#include "lustre/lustre_idl.h"
+
+/**
+ * Create an obdo to send over the wire
+ */
+void lustre_set_wire_obdo(const struct obd

[PATCH v2 5/5] staging: lustre: headers: use proper byteorder functions in lustre_idl.h

2016-12-10 Thread James Simmons
In order for lustre_idl.h to be usable for both user
land and kernel space it has to use the proper
byteorder functions.

Signed-off-by: James Simmons 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245
Reviewed-on: http://review.whamcloud.com/16916
Reviewed-by: Frank Zago 
Reviewed-by: Dmitry Eremin 
Reviewed-by: Oleg Drokin 
Reviewed-by: John L. Hammond 
Signed-off-by: James Simmons 
---
 .../lustre/lustre/include/lustre/lustre_idl.h  | 55 --
 1 file changed, 29 insertions(+), 26 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index cd2dbfb..3d74d56 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -69,6 +69,9 @@
 #ifndef _LUSTRE_IDL_H_
 #define _LUSTRE_IDL_H_
 
+#include 
+#include 
+
 #include "../../../include/linux/libcfs/libcfs.h"
 #include "../../../include/linux/lnet/types.h"
 
@@ -687,30 +690,30 @@ static inline void lu_igif_build(struct lu_fid *fid, 
__u32 ino, __u32 gen)
  */
 static inline void fid_cpu_to_le(struct lu_fid *dst, const struct lu_fid *src)
 {
-   dst->f_seq = cpu_to_le64(fid_seq(src));
-   dst->f_oid = cpu_to_le32(fid_oid(src));
-   dst->f_ver = cpu_to_le32(fid_ver(src));
+   dst->f_seq = __cpu_to_le64(fid_seq(src));
+   dst->f_oid = __cpu_to_le32(fid_oid(src));
+   dst->f_ver = __cpu_to_le32(fid_ver(src));
 }
 
 static inline void fid_le_to_cpu(struct lu_fid *dst, const struct lu_fid *src)
 {
-   dst->f_seq = le64_to_cpu(fid_seq(src));
-   dst->f_oid = le32_to_cpu(fid_oid(src));
-   dst->f_ver = le32_to_cpu(fid_ver(src));
+   dst->f_seq = __le64_to_cpu(fid_seq(src));
+   dst->f_oid = __le32_to_cpu(fid_oid(src));
+   dst->f_ver = __le32_to_cpu(fid_ver(src));
 }
 
 static inline void fid_cpu_to_be(struct lu_fid *dst, const struct lu_fid *src)
 {
-   dst->f_seq = cpu_to_be64(fid_seq(src));
-   dst->f_oid = cpu_to_be32(fid_oid(src));
-   dst->f_ver = cpu_to_be32(fid_ver(src));
+   dst->f_seq = __cpu_to_be64(fid_seq(src));
+   dst->f_oid = __cpu_to_be32(fid_oid(src));
+   dst->f_ver = __cpu_to_be32(fid_ver(src));
 }
 
 static inline void fid_be_to_cpu(struct lu_fid *dst, const struct lu_fid *src)
 {
-   dst->f_seq = be64_to_cpu(fid_seq(src));
-   dst->f_oid = be32_to_cpu(fid_oid(src));
-   dst->f_ver = be32_to_cpu(fid_ver(src));
+   dst->f_seq = __be64_to_cpu(fid_seq(src));
+   dst->f_oid = __be32_to_cpu(fid_oid(src));
+   dst->f_ver = __be32_to_cpu(fid_ver(src));
 }
 
 static inline bool fid_is_sane(const struct lu_fid *fid)
@@ -747,8 +750,8 @@ static inline void ostid_cpu_to_le(const struct ost_id 
*src_oi,
   struct ost_id *dst_oi)
 {
if (fid_seq_is_mdt0(ostid_seq(src_oi))) {
-   dst_oi->oi.oi_id = cpu_to_le64(src_oi->oi.oi_id);
-   dst_oi->oi.oi_seq = cpu_to_le64(src_oi->oi.oi_seq);
+   dst_oi->oi.oi_id = __cpu_to_le64(src_oi->oi.oi_id);
+   dst_oi->oi.oi_seq = __cpu_to_le64(src_oi->oi.oi_seq);
} else {
fid_cpu_to_le(&dst_oi->oi_fid, &src_oi->oi_fid);
}
@@ -758,8 +761,8 @@ static inline void ostid_le_to_cpu(const struct ost_id 
*src_oi,
   struct ost_id *dst_oi)
 {
if (fid_seq_is_mdt0(ostid_seq(src_oi))) {
-   dst_oi->oi.oi_id = le64_to_cpu(src_oi->oi.oi_id);
-   dst_oi->oi.oi_seq = le64_to_cpu(src_oi->oi.oi_seq);
+   dst_oi->oi.oi_id = __le64_to_cpu(src_oi->oi.oi_id);
+   dst_oi->oi.oi_seq = __le64_to_cpu(src_oi->oi.oi_seq);
} else {
fid_le_to_cpu(&dst_oi->oi_fid, &src_oi->oi_fid);
}
@@ -866,7 +869,7 @@ enum lu_dirpage_flags {
 
 static inline struct lu_dirent *lu_dirent_start(struct lu_dirpage *dp)
 {
-   if (le32_to_cpu(dp->ldp_flags) & LDF_EMPTY)
+   if (__le32_to_cpu(dp->ldp_flags) & LDF_EMPTY)
return NULL;
else
return dp->ldp_entries;
@@ -876,8 +879,8 @@ static inline struct lu_dirent *lu_dirent_next(struct 
lu_dirent *ent)
 {
struct lu_dirent *next;
 
-   if (le16_to_cpu(ent->lde_reclen) != 0)
-   next = ((void *)ent) + le16_to_cpu(ent->lde_reclen);
+   if (__le16_to_cpu(ent->lde_reclen) != 0)
+   next = ((void *)ent) + __le16_to_cpu(ent->lde_reclen);
else
next = NULL;
 
@@ -1438,15 +1441,15 @@ static inline __u64 lmm_oi_seq(const struct ost_id *oi)
 static inline void lmm_oi_le_to_cpu(struct ost_id *dst_oi,
const struct ost_id *src_oi)
 {
-   dst_oi->oi.oi_id = le64_to_cpu(src_oi->oi.oi_id);
-   dst_oi->oi.oi_seq = le64_to_cpu(src_oi->oi.oi_seq);
+   dst_oi->oi.oi_id = __le64_to_cpu(src_oi->oi.oi_id);
+   dst_oi->oi.oi_seq = __le64_to_cpu(src_oi->oi.oi_seq);
 }
 
 stati

[PATCH v2 2/5] staging: lustre: obdclass: style cleanup for obdo related functions

2016-12-10 Thread James Simmons
From: Ben Evans 

Change the style of lustre_get_wire_obdo and
lustre_set_wire_obdo to conform to linux kernel
standard.

Signed-off-by: Ben Evans 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401
Reviewed-on: http://review.whamcloud.com/16917
Reviewed-on: http://review.whamcloud.com/19266
Reviewed-by: James Simmons 
Reviewed-by: Andreas Dilger 
Reviewed-by: John L. Hammond 
Reviewed-by: Oleg Drokin 
Signed-off-by: James Simmons 
---
 drivers/staging/lustre/lustre/obdclass/obdo.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/obdo.c 
b/drivers/staging/lustre/lustre/obdclass/obdo.c
index 241e60b..b1dfa16 100644
--- a/drivers/staging/lustre/lustre/obdclass/obdo.c
+++ b/drivers/staging/lustre/lustre/obdclass/obdo.c
@@ -139,7 +139,8 @@ void lustre_set_wire_obdo(const struct obd_connect_data 
*ocd,
 
if (unlikely(!(ocd->ocd_connect_flags & OBD_CONNECT_FID)) &&
fid_seq_is_echo(ostid_seq(&lobdo->o_oi))) {
-   /* Currently OBD_FL_OSTID will only be used when 2.4 echo
+   /*
+* Currently OBD_FL_OSTID will only be used when 2.4 echo
 * client communicate with pre-2.4 server
 */
wobdo->o_oi.oi.oi_id = fid_oid(&lobdo->o_oi.oi_fid);
@@ -154,13 +155,13 @@ void lustre_set_wire_obdo(const struct obd_connect_data 
*ocd,
 void lustre_get_wire_obdo(const struct obd_connect_data *ocd,
  struct obdo *lobdo, const struct obdo *wobdo)
 {
-   __u32 local_flags = 0;
+   u32 local_flags = 0;
 
if (lobdo->o_valid & OBD_MD_FLFLAGS)
local_flags = lobdo->o_flags & OBD_FL_LOCAL_MASK;
 
*lobdo = *wobdo;
-   if (local_flags != 0) {
+   if (local_flags) {
lobdo->o_valid |= OBD_MD_FLFLAGS;
lobdo->o_flags &= ~OBD_FL_LOCAL_MASK;
lobdo->o_flags |= local_flags;
-- 
1.8.3.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 4/5] staging: lustre: headers: Move functions out of lustre_idl.h

2016-12-10 Thread James Simmons
From: Ben Evans 

Migrate functions set/get_mrc_cr_flags, ldlm_res_eq
ldlm_extent_overlap, ldlm_extent_contain,
ldlm_request_bufsize, and alll the PTLRPC dump_*
functions out of lustre_idl.h which is a UAPI header
to the places in the kernel code they are actually used.
Delete unused lmv_mds_md_stripe_count and
agent_req_in_final_state.

Signed-off-by: Ben Evans 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401
Reviewed-on: http://review.whamcloud.com/21484
Reviewed-by: Frank Zago 
Reviewed-by: James Simmons 
Reviewed-by: Andreas Dilger 
Reviewed-by: John L. Hammond 
Signed-off-by: James Simmons 
---
 .../lustre/lustre/include/lustre/lustre_idl.h  | 73 --
 drivers/staging/lustre/lustre/include/lustre_dlm.h | 13 
 .../staging/lustre/lustre/include/lustre_swab.h|  6 ++
 drivers/staging/lustre/lustre/ldlm/ldlm_internal.h |  6 ++
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c  | 27 
 drivers/staging/lustre/lustre/mdc/mdc_lib.c|  6 ++
 6 files changed, 58 insertions(+), 73 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index b0eb80d..cd2dbfb 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -2130,17 +2130,6 @@ struct mdt_rec_create {
__u32  cr_padding_4;   /* rr_padding_4 */
 };
 
-static inline void set_mrc_cr_flags(struct mdt_rec_create *mrc, __u64 flags)
-{
-   mrc->cr_flags_l = (__u32)(flags & 0xUll);
-   mrc->cr_flags_h = (__u32)(flags >> 32);
-}
-
-static inline __u64 get_mrc_cr_flags(struct mdt_rec_create *mrc)
-{
-   return ((__u64)(mrc->cr_flags_l) | ((__u64)mrc->cr_flags_h << 32));
-}
-
 /* instance of mdt_reint_rec */
 struct mdt_rec_link {
__u32  lk_opcode;
@@ -2403,25 +2392,6 @@ static inline int lmv_mds_md_stripe_count_get(const 
union lmv_mds_md *lmm)
}
 }
 
-static inline int lmv_mds_md_stripe_count_set(union lmv_mds_md *lmm,
- unsigned int stripe_count)
-{
-   int rc = 0;
-
-   switch (le32_to_cpu(lmm->lmv_magic)) {
-   case LMV_MAGIC_V1:
-   lmm->lmv_md_v1.lmv_stripe_count = cpu_to_le32(stripe_count);
-   break;
-   case LMV_USER_MAGIC:
-   lmm->lmv_user_md.lum_stripe_count = cpu_to_le32(stripe_count);
-   break;
-   default:
-   rc = -EINVAL;
-   break;
-   }
-   return rc;
-}
-
 enum fld_rpc_opc {
FLD_QUERY   = 900,
FLD_READ= 901,
@@ -2502,12 +2472,6 @@ struct ldlm_res_id {
 #define PLDLMRES(res)  (res)->lr_name.name[0], (res)->lr_name.name[1], \
(res)->lr_name.name[2], (res)->lr_name.name[3]
 
-static inline bool ldlm_res_eq(const struct ldlm_res_id *res0,
-  const struct ldlm_res_id *res1)
-{
-   return !memcmp(res0, res1, sizeof(*res0));
-}
-
 /* lock types */
 enum ldlm_mode {
LCK_MINMODE = 0,
@@ -2540,19 +2504,6 @@ struct ldlm_extent {
__u64 gid;
 };
 
-static inline int ldlm_extent_overlap(const struct ldlm_extent *ex1,
- const struct ldlm_extent *ex2)
-{
-   return (ex1->start <= ex2->end) && (ex2->start <= ex1->end);
-}
-
-/* check if @ex1 contains @ex2 */
-static inline int ldlm_extent_contain(const struct ldlm_extent *ex1,
- const struct ldlm_extent *ex2)
-{
-   return (ex1->start <= ex2->start) && (ex1->end >= ex2->end);
-}
-
 struct ldlm_inodebits {
__u64 bits;
 };
@@ -2627,18 +2578,6 @@ struct ldlm_request {
struct lustre_handle lock_handle[LDLM_LOCKREQ_HANDLES];
 };
 
-/* If LDLM_ENQUEUE, 1 slot is already occupied, 1 is available.
- * Otherwise, 2 are available.
- */
-#define ldlm_request_bufsize(count, type)  \
-({   \
-   int _avail = LDLM_LOCKREQ_HANDLES;\
-   _avail -= (type == LDLM_ENQUEUE ? LDLM_ENQUEUE_CANCEL_OFF : 0); \
-   sizeof(struct ldlm_request) +  \
-   (count > _avail ? count - _avail : 0) *  \
-   sizeof(struct lustre_handle);  \
-})
-
 struct ldlm_reply {
__u32 lock_flags;
__u32 lock_padding; /* also fix lustre_swab_ldlm_reply */
@@ -2942,12 +2881,6 @@ static inline const char *agent_req_status2name(const 
enum agent_req_status ars)
}
 }
 
-static inline bool agent_req_in_final_state(enum agent_req_status ars)
-{
-   return ((ars == ARS_SUCCEED) || (ars == ARS_FAILED) ||
-   (ars == ARS_CANCELED));
-}
-
 struct llog_agent_req_rec {
struct llog_rec_hdr arr_hdr;/**< record header */
__u32   arr_status; /**< status of the request */
@@ -

[PATCH v2 3/5] staging: lustre: headers: sort headers affected by obdo move

2016-12-10 Thread James Simmons
From: Ben Evans 

It was found if you sort the headers alphabetically
that it reduced patch conflicts. This patch sorts
the headers alphabetically and also place linux
header first, then uapi header and finally the
lustre kernel headers.

Signed-off-by: Ben Evans 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401
Reviewed-on: http://review.whamcloud.com/16917
Reviewed-on: http://review.whamcloud.com/19266
Reviewed-by: James Simmons 
Reviewed-by: Andreas Dilger 
Reviewed-by: John L. Hammond 
Reviewed-by: Oleg Drokin 
Signed-off-by: James Simmons 
---

Changelog:

v1) Initial patch
v2) rebase patch against newer base patch that now
includes lustre_obdo.h in osc_request.c.

 drivers/staging/lustre/lustre/osc/osc_request.c | 15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/lustre/lustre/osc/osc_request.c 
b/drivers/staging/lustre/lustre/osc/osc_request.c
index 99aefa5..0273ccd 100644
--- a/drivers/staging/lustre/lustre/osc/osc_request.c
+++ b/drivers/staging/lustre/lustre/osc/osc_request.c
@@ -34,20 +34,21 @@
 
 #include "../../include/linux/libcfs/libcfs.h"
 
-#include "../include/lustre_dlm.h"
-#include "../include/lustre_net.h"
+#include "../include/lustre/lustre_ioctl.h"
 #include "../include/lustre/lustre_user.h"
-#include "../include/obd_cksum.h"
 
-#include "../include/lustre_ha.h"
 #include "../include/lprocfs_status.h"
-#include "../include/lustre/lustre_ioctl.h"
 #include "../include/lustre_debug.h"
+#include "../include/lustre_dlm.h"
+#include "../include/lustre_fid.h"
+#include "../include/lustre_ha.h"
+#include "../include/lustre_net.h"
 #include "../include/lustre_obdo.h"
 #include "../include/lustre_param.h"
-#include "../include/lustre_fid.h"
-#include "../include/obd_class.h"
 #include "../include/obd.h"
+#include "../include/obd_cksum.h"
+#include "../include/obd_class.h"
+
 #include "osc_internal.h"
 #include "osc_cl_internal.h"
 
-- 
1.8.3.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 3/5] staging: lustre: headers: sort headers affected by obdo move

2016-12-10 Thread Greg Kroah-Hartman
On Sat, Dec 10, 2016 at 01:05:59PM -0500, James Simmons wrote:
> From: Ben Evans 
> 
> It was found if you sort the headers alphabetically
> that it reduced patch conflicts. This patch sorts
> the headers alphabetically and also place linux
> header first, then uapi header and finally the
> lustre kernel headers.

I still don't agree, when did you last have a patch conflict with this
file in the .h section?  And exactly how hard was it to fix it up?

I'm all for cleanups, but really, this is useless.  And I said so the
last time you sent it...

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 5/5] staging: lustre: headers: use proper byteorder functions in lustre_idl.h

2016-12-10 Thread Greg Kroah-Hartman
On Sat, Dec 10, 2016 at 01:06:01PM -0500, James Simmons wrote:
> In order for lustre_idl.h to be usable for both user
> land and kernel space it has to use the proper
> byteorder functions.

Why would userspace need/want all of these inline functions?  A uapi
header file should just have a the structures that are passed
user/kernel and any needed ioctls.  Why would they ever care about
strange byte flip functions and a ton of inline functions?

I don't think this is needed, of if it is, I really don't want to see
your crazy userspace code...

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] VME: Remove node entry from vme_driver

2016-12-10 Thread Martyn Welch
The vme_driver structure currently has a "node" entry. This entry is
never used and it's intended purpose has been lost to the mists of time.

Remove the entry from vme_driver to avoid confusion.

Signed-off-by: Martyn Welch 
---
 include/linux/vme.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/linux/vme.h b/include/linux/vme.h
index 8c58917..ec5e8bf 100644
--- a/include/linux/vme.h
+++ b/include/linux/vme.h
@@ -108,7 +108,6 @@ struct vme_dev {
 };
 
 struct vme_driver {
-   struct list_head node;
const char *name;
int (*match)(struct vme_dev *);
int (*probe)(struct vme_dev *);
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v3 2/2] staging: iio: ad7606: move out of staging

2016-12-10 Thread Eva Rachel Retuya
Move the ad7606 driver from staging/iio/adc to iio/adc. Also, update the
corresponding Makefile and Kconfig associated with the change.

Signed-off-by: Eva Rachel Retuya 
---
 drivers/iio/adc/Kconfig| 34 ++
 drivers/iio/adc/Makefile   |  3 +++
 drivers/{staging => }/iio/adc/ad7606.c |  0
 drivers/{staging => }/iio/adc/ad7606.h |  0
 drivers/{staging => }/iio/adc/ad7606_par.c |  0
 drivers/{staging => }/iio/adc/ad7606_spi.c |  0
 drivers/staging/iio/adc/Kconfig| 34 --
 drivers/staging/iio/adc/Makefile   |  4 
 8 files changed, 37 insertions(+), 38 deletions(-)
 rename drivers/{staging => }/iio/adc/ad7606.c (100%)
 rename drivers/{staging => }/iio/adc/ad7606.h (100%)
 rename drivers/{staging => }/iio/adc/ad7606_par.c (100%)
 rename drivers/{staging => }/iio/adc/ad7606_spi.c (100%)

diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig
index be81ba3..3fa2c60 100644
--- a/drivers/iio/adc/Kconfig
+++ b/drivers/iio/adc/Kconfig
@@ -58,6 +58,40 @@ config AD7476
  To compile this driver as a module, choose M here: the
  module will be called ad7476.
 
+config AD7606
+   tristate "Analog Devices AD7606 ADC driver"
+   depends on GPIOLIB || COMPILE_TEST
+   depends on HAS_IOMEM
+   select IIO_BUFFER
+   select IIO_TRIGGERED_BUFFER
+   help
+ Say yes here to build support for Analog Devices:
+ ad7606, ad7606-6, ad7606-4 analog to digital converters (ADC).
+
+ To compile this driver as a module, choose M here: the
+ module will be called ad7606.
+
+config AD7606_IFACE_PARALLEL
+   tristate "parallel interface support"
+   depends on AD7606
+   help
+ Say yes here to include parallel interface support on the AD7606
+ ADC driver.
+
+ To compile this driver as a module, choose M here: the
+ module will be called ad7606_parallel.
+
+config AD7606_IFACE_SPI
+   tristate "spi interface support"
+   depends on AD7606
+   depends on SPI
+   help
+ Say yes here to include parallel interface support on the AD7606
+ ADC driver.
+
+ To compile this driver as a module, choose M here: the
+ module will be called ad7606_spi.
+
 config AD7766
tristate "Analog Devices AD7766/AD7767 ADC driver"
depends on SPI_MASTER
diff --git a/drivers/iio/adc/Makefile b/drivers/iio/adc/Makefile
index f8e1218..dfe7dea 100644
--- a/drivers/iio/adc/Makefile
+++ b/drivers/iio/adc/Makefile
@@ -9,6 +9,9 @@ obj-$(CONFIG_AD7291) += ad7291.o
 obj-$(CONFIG_AD7298) += ad7298.o
 obj-$(CONFIG_AD7923) += ad7923.o
 obj-$(CONFIG_AD7476) += ad7476.o
+obj-$(CONFIG_AD7606_IFACE_PARALLEL) += ad7606_par.o
+obj-$(CONFIG_AD7606_IFACE_SPI) += ad7606_spi.o
+obj-$(CONFIG_AD7606) += ad7606.o
 obj-$(CONFIG_AD7766) += ad7766.o
 obj-$(CONFIG_AD7791) += ad7791.o
 obj-$(CONFIG_AD7793) += ad7793.o
diff --git a/drivers/staging/iio/adc/ad7606.c b/drivers/iio/adc/ad7606.c
similarity index 100%
rename from drivers/staging/iio/adc/ad7606.c
rename to drivers/iio/adc/ad7606.c
diff --git a/drivers/staging/iio/adc/ad7606.h b/drivers/iio/adc/ad7606.h
similarity index 100%
rename from drivers/staging/iio/adc/ad7606.h
rename to drivers/iio/adc/ad7606.h
diff --git a/drivers/staging/iio/adc/ad7606_par.c b/drivers/iio/adc/ad7606_par.c
similarity index 100%
rename from drivers/staging/iio/adc/ad7606_par.c
rename to drivers/iio/adc/ad7606_par.c
diff --git a/drivers/staging/iio/adc/ad7606_spi.c b/drivers/iio/adc/ad7606_spi.c
similarity index 100%
rename from drivers/staging/iio/adc/ad7606_spi.c
rename to drivers/iio/adc/ad7606_spi.c
diff --git a/drivers/staging/iio/adc/Kconfig b/drivers/staging/iio/adc/Kconfig
index deff899..995867b 100644
--- a/drivers/staging/iio/adc/Kconfig
+++ b/drivers/staging/iio/adc/Kconfig
@@ -3,40 +3,6 @@
 #
 menu "Analog to digital converters"
 
-config AD7606
-   tristate "Analog Devices AD7606 ADC driver"
-   depends on GPIOLIB || COMPILE_TEST
-   depends on HAS_IOMEM
-   select IIO_BUFFER
-   select IIO_TRIGGERED_BUFFER
-   help
- Say yes here to build support for Analog Devices:
- ad7606, ad7606-6, ad7606-4 analog to digital converters (ADC).
-
- To compile this driver as a module, choose M here: the
- module will be called ad7606.
-
-config AD7606_IFACE_PARALLEL
-   tristate "parallel interface support"
-   depends on AD7606
-   help
- Say yes here to include parallel interface support on the AD7606
- ADC driver.
-
- To compile this driver as a module, choose M here: the
- module will be called ad7606_parallel.
-
-config AD7606_IFACE_SPI
-   tristate "spi interface support"
-   depends on AD7606
-   depends on SPI
-   help
- Say yes here to include parallel interface support on the AD7606
- ADC driver.
-
- To compile this dri

[PATCH v3 1/2] staging: iio: ad7606: replace range/range_available with corresponding scale

2016-12-10 Thread Eva Rachel Retuya
Eliminate the non-standard attributes in_voltage_range and
in_voltage_range_available. Implement in_voltage_scale_available in place
of these attributes and update the SCALE accordingly. The array
scale_avail is introduced to hold the available scale values.

Signed-off-by: Eva Rachel Retuya 
---
Change in v3:
* Change incorrect type of 'scale' from unsigned int to unsigned long long

Changes in v2:
* Update commit message to reflect changes.
* Introduce scale_avail[] array to hold the available scales.
* Rewrite read_raw's SCALE to make use of the scale_avail[].
* Provide write_raw and write_raw_get_fmt for implementing SCALE.
* Populate the scale_avail[] with values in probe().

 drivers/staging/iio/adc/ad7606.c | 100 ---
 drivers/staging/iio/adc/ad7606.h |   1 +
 2 files changed, 62 insertions(+), 39 deletions(-)

diff --git a/drivers/staging/iio/adc/ad7606.c b/drivers/staging/iio/adc/ad7606.c
index 4531908..b878664 100644
--- a/drivers/staging/iio/adc/ad7606.c
+++ b/drivers/staging/iio/adc/ad7606.c
@@ -151,9 +151,9 @@ static int ad7606_read_raw(struct iio_dev *indio_dev,
*val = (short)ret;
return IIO_VAL_INT;
case IIO_CHAN_INFO_SCALE:
-   *val = st->range * 2;
-   *val2 = st->chip_info->channels[0].scan_type.realbits;
-   return IIO_VAL_FRACTIONAL_LOG2;
+   *val = st->scale_avail[st->range][0];
+   *val2 = st->scale_avail[st->range][1];
+   return IIO_VAL_INT_PLUS_NANO;
case IIO_CHAN_INFO_OVERSAMPLING_RATIO:
*val = st->oversampling;
return IIO_VAL_INT;
@@ -161,42 +161,24 @@ static int ad7606_read_raw(struct iio_dev *indio_dev,
return -EINVAL;
 }
 
-static ssize_t ad7606_show_range(struct device *dev,
-struct device_attribute *attr, char *buf)
+static ssize_t in_voltage_scale_available_show(struct device *dev,
+  struct device_attribute *attr,
+  char *buf)
 {
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct ad7606_state *st = iio_priv(indio_dev);
+   int i, len = 0;
 
-   return sprintf(buf, "%u\n", st->range);
-}
-
-static ssize_t ad7606_store_range(struct device *dev,
- struct device_attribute *attr,
- const char *buf, size_t count)
-{
-   struct iio_dev *indio_dev = dev_to_iio_dev(dev);
-   struct ad7606_state *st = iio_priv(indio_dev);
-   unsigned long lval;
-   int ret;
-
-   ret = kstrtoul(buf, 10, &lval);
-   if (ret)
-   return ret;
-
-   if (!(lval == 5000 || lval == 1))
-   return -EINVAL;
+   for (i = 0; i < ARRAY_SIZE(st->scale_avail); i++)
+   len += scnprintf(buf + len, PAGE_SIZE - len, "%d.%09u ",
+st->scale_avail[i][0], st->scale_avail[i][1]);
 
-   mutex_lock(&indio_dev->mlock);
-   gpiod_set_value(st->gpio_range, lval == 1);
-   st->range = lval;
-   mutex_unlock(&indio_dev->mlock);
+   buf[len - 1] = '\n';
 
-   return count;
+   return len;
 }
 
-static IIO_DEVICE_ATTR(in_voltage_range, S_IRUGO | S_IWUSR,
-  ad7606_show_range, ad7606_store_range, 0);
-static IIO_CONST_ATTR(in_voltage_range_available, "5000 1");
+static IIO_DEVICE_ATTR_RO(in_voltage_scale_available, 0);
 
 static int ad7606_oversampling_get_index(unsigned int val)
 {
@@ -218,9 +200,23 @@ static int ad7606_write_raw(struct iio_dev *indio_dev,
 {
struct ad7606_state *st = iio_priv(indio_dev);
int values[3];
-   int ret;
+   int ret, i;
 
switch (mask) {
+   case IIO_CHAN_INFO_SCALE:
+   ret = -EINVAL;
+   mutex_lock(&indio_dev->mlock);
+   for (i = 0; i < ARRAY_SIZE(st->scale_avail); i++)
+   if (val2 == st->scale_avail[i][1]) {
+   gpiod_set_value(st->gpio_range, i);
+   st->range = i;
+
+   ret = 0;
+   break;
+   }
+   mutex_unlock(&indio_dev->mlock);
+
+   return ret;
case IIO_CHAN_INFO_OVERSAMPLING_RATIO:
if (val2)
return -EINVAL;
@@ -244,11 +240,22 @@ static int ad7606_write_raw(struct iio_dev *indio_dev,
}
 }
 
+static int ad7606_write_raw_get_fmt(struct iio_dev *indio_dev,
+   struct iio_chan_spec const *chan,
+   long mask)
+{
+   switch (mask) {
+   case IIO_CHAN_INFO_SCALE:
+   return IIO_VAL_INT_PLUS_NANO;
+   default:
+   return -EINVAL;
+   }
+}
+
 static IIO_CONST_ATTR(oversampling_ratio_available, "1 2 4 8 16 32 64");
 
 static struct attribu

[PATCH v3 0/2] staging: iio: ad7606: move driver out of staging

2016-12-10 Thread Eva Rachel Retuya
Address the last remaining TODO [1] for this driver and move it from staging
into mainline.

[1] https://marc.info/?l=linux-iio&m=147689684332118&w=2 

Change in v3:
* Fix incorrect type of 'scale'. (Pointed out by kbuild test robot)

Change in v2:
* Address the incorrect way of implementing the scale. (Pointed out by Lars)

Eva Rachel Retuya (2):
  staging: iio: ad7606: replace range/range_available with corresponding
scale
  staging: iio: ad7606: move out of staging

 drivers/iio/adc/Kconfig|  34 ++
 drivers/iio/adc/Makefile   |   3 +
 drivers/{staging => }/iio/adc/ad7606.c | 100 ++---
 drivers/{staging => }/iio/adc/ad7606.h |   1 +
 drivers/{staging => }/iio/adc/ad7606_par.c |   0
 drivers/{staging => }/iio/adc/ad7606_spi.c |   0
 drivers/staging/iio/adc/Kconfig|  34 --
 drivers/staging/iio/adc/Makefile   |   4 --
 8 files changed, 99 insertions(+), 77 deletions(-)
 rename drivers/{staging => }/iio/adc/ad7606.c (86%)
 rename drivers/{staging => }/iio/adc/ad7606.h (98%)
 rename drivers/{staging => }/iio/adc/ad7606_par.c (100%)
 rename drivers/{staging => }/iio/adc/ad7606_spi.c (100%)

-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 01/14] rtlwifi: Replace local debug macro RT_ASSERT

2016-12-10 Thread Larry Finger
This macro can be replaced with WARN_ONCE. In addition to using a
standard debugging macro for these critical errors, we also get
a stack dump.

In rtl8821ae/hw.c, a senseless comment was removed, and an incorrect
indentation was fixed.

This patch also fixes two places in each of rtl8192ee, rtl8723be,
and rtl8821ae where the logical condition was incorrect.

Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
---
 drivers/net/wireless/realtek/rtlwifi/core.c  |  8 
 drivers/net/wireless/realtek/rtlwifi/debug.h | 14 --
 drivers/net/wireless/realtek/rtlwifi/pci.c   | 12 ++--
 drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c  |  4 ++--
 drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c  |  2 +-
 drivers/net/wireless/realtek/rtlwifi/rtl8188ee/phy.c | 10 +-
 drivers/net/wireless/realtek/rtlwifi/rtl8188ee/trx.c |  8 
 .../wireless/realtek/rtlwifi/rtl8192c/fw_common.c|  6 +++---
 .../wireless/realtek/rtlwifi/rtl8192c/phy_common.c   | 14 +++---
 drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c  |  2 +-
 drivers/net/wireless/realtek/rtlwifi/rtl8192ce/trx.c |  8 
 drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c  |  2 +-
 drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c |  2 +-
 drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c  |  2 +-
 drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c | 10 +-
 drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c  |  2 +-
 drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c |  8 
 drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c  |  4 ++--
 drivers/net/wireless/realtek/rtlwifi/rtl8192ee/hw.c  |  2 +-
 drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.c | 14 +++---
 drivers/net/wireless/realtek/rtlwifi/rtl8192ee/trx.c | 15 +--
 drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c  |  2 +-
 drivers/net/wireless/realtek/rtlwifi/rtl8192se/phy.c |  6 +++---
 drivers/net/wireless/realtek/rtlwifi/rtl8192se/trx.c |  8 
 drivers/net/wireless/realtek/rtlwifi/rtl8723ae/fw.c  |  4 ++--
 drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c  |  2 +-
 drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c | 10 +-
 drivers/net/wireless/realtek/rtlwifi/rtl8723ae/trx.c |  8 
 drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c  |  4 ++--
 drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c  |  2 +-
 drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c | 12 ++--
 drivers/net/wireless/realtek/rtlwifi/rtl8723be/trx.c | 14 +++---
 .../wireless/realtek/rtlwifi/rtl8723com/phy_common.c |  2 +-
 drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c  |  4 ++--
 drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c  | 16 
 drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c |  8 
 drivers/net/wireless/realtek/rtlwifi/rtl8821ae/trx.c | 20 
 drivers/net/wireless/realtek/rtlwifi/usb.c   |  2 +-
 38 files changed, 133 insertions(+), 140 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/core.c 
b/drivers/net/wireless/realtek/rtlwifi/core.c
index 2caa4ad..7ae774d 100644
--- a/drivers/net/wireless/realtek/rtlwifi/core.c
+++ b/drivers/net/wireless/realtek/rtlwifi/core.c
@@ -1613,8 +1613,8 @@ static int rtl_op_set_key(struct ieee80211_hw *hw, enum 
set_key_cmd cmd,
RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
 "set pairwise key\n");
if (!sta) {
-   RT_ASSERT(false,
- "pairwise key without mac_addr\n");
+   WARN_ONCE(true,
+ "rtlwifi: pairwise key without 
mac_addr\n");
 
err = -EOPNOTSUPP;
goto out_unlock;
@@ -1804,8 +1804,8 @@ bool rtl_hal_pwrseqcmdparsing(struct rtl_priv *rtlpriv, 
u8 cut_version,
 "rtl_hal_pwrseqcmdparsing(): 
PWR_CMD_END\n");
return true;
default:
-   RT_ASSERT(false,
- "rtl_hal_pwrseqcmdparsing(): Unknown 
CMD!!\n");
+   WARN_ONCE(true,
+ "rtlwifi: rtl_hal_pwrseqcmdparsing(): 
Unknown CMD!!\n");
break;
}
}
diff --git a/drivers/net/wireless/realtek/rtlwifi/debug.h 
b/drivers/net/wireless/realtek/rtlwifi/debug.h
index 6156a79..6f2e2b9 100644
--- a/drivers/net/wireless/realtek/rtlwifi/debug.h
+++ b/drivers/net/wireless/realtek/rtlwifi/debug.h
@@ -166,15 +166,6 @@ enum dbgp_flag_e {
 
 #ifdef CONFIG_RTLWIFI_DEBUG
 
-#define RT_ASSERT(_exp, fmt, ...)  \
-do {   \
-   if (!(_exp)) {  

[PATCH 02/14] rtlwifi: Remove RT_TRACE messages that use DBG_EMERG

2016-12-10 Thread Larry Finger
These messages are always logged and represent error conditions, thus
we can use pr_err().

Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
---
 drivers/net/wireless/realtek/rtlwifi/base.c  | 14 +++--
 drivers/net/wireless/realtek/rtlwifi/cam.c   | 14 +++--
 drivers/net/wireless/realtek/rtlwifi/core.c  | 20 +---
 drivers/net/wireless/realtek/rtlwifi/efuse.c |  3 +-
 drivers/net/wireless/realtek/rtlwifi/pci.c   | 36 --
 drivers/net/wireless/realtek/rtlwifi/ps.c|  3 +-
 drivers/net/wireless/realtek/rtlwifi/rc.c|  3 +-
 drivers/net/wireless/realtek/rtlwifi/usb.c   | 46 +---
 8 files changed, 47 insertions(+), 92 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/base.c 
b/drivers/net/wireless/realtek/rtlwifi/base.c
index 4ac928b..0a8553e 100644
--- a/drivers/net/wireless/realtek/rtlwifi/base.c
+++ b/drivers/net/wireless/realtek/rtlwifi/base.c
@@ -207,8 +207,7 @@ static void _rtl_init_hw_ht_capab(struct ieee80211_hw *hw,
 *highest supported RX rate
 */
if (rtlpriv->dm.supp_phymode_switch) {
-   RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG,
-"Support phy mode switch\n");
+   pr_info("Support phy mode switch\n");
 
ht_cap->mcs.rx_mask[0] = 0xFF;
ht_cap->mcs.rx_mask[1] = 0xFF;
@@ -389,8 +388,8 @@ static void _rtl_init_mac80211(struct ieee80211_hw *hw)
/* <4> set mac->sband to wiphy->sband */
hw->wiphy->bands[NL80211_BAND_5GHZ] = sband;
} else {
-   RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, "Err BAND %d\n",
-rtlhal->current_bandtype);
+   pr_err("rtlwifi: Err BAND %d\n",
+  rtlhal->current_bandtype);
}
}
/* <5> set hw caps */
@@ -544,7 +542,7 @@ int rtl_init_core(struct ieee80211_hw *hw)
 * mac80211 hw  in _rtl_init_mac80211.
 */
if (rtl_regd_init(hw, rtl_reg_notifier)) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "REGD init failed\n");
+   pr_err("rtlwifi: REGD init failed\n");
return 1;
}
 
@@ -1694,8 +1692,7 @@ void rtl_watchdog_wq_callback(void *data)
 * we should reconnect this AP
 */
if (rtlpriv->link_info.roam_times >= 5) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"AP off, try to reconnect now\n");
+   pr_err("rtlwifi: AP off, try to reconnect 
now\n");
rtlpriv->link_info.roam_times = 0;
ieee80211_connection_loss(
rtlpriv->mac80211.vif);
@@ -1886,8 +1883,7 @@ void rtl_phy_scan_operation_backup(struct ieee80211_hw 
*hw, u8 operation)
  (u8 *)&iotype);
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Unknown Scan Backup operation.\n");
+   pr_err("rtlwifi: Unknown Scan Backup operation.\n");
break;
}
}
diff --git a/drivers/net/wireless/realtek/rtlwifi/cam.c 
b/drivers/net/wireless/realtek/rtlwifi/cam.c
index 8fe8b4c..a0605d8 100644
--- a/drivers/net/wireless/realtek/rtlwifi/cam.c
+++ b/drivers/net/wireless/realtek/rtlwifi/cam.c
@@ -285,8 +285,7 @@ u8 rtl_cam_get_free_entry(struct ieee80211_hw *hw, u8 
*sta_addr)
u8 i, *addr;
 
if (NULL == sta_addr) {
-   RT_TRACE(rtlpriv, COMP_SEC, DBG_EMERG,
-"sta_addr is NULL.\n");
+   pr_err("rtlwifi: sta_addr is NULL.\n");
return TOTAL_CAM_ENTRY;
}
/* Does STA already exist? */
@@ -298,9 +297,8 @@ u8 rtl_cam_get_free_entry(struct ieee80211_hw *hw, u8 
*sta_addr)
/* Get a free CAM entry. */
for (entry_idx = 4; entry_idx < TOTAL_CAM_ENTRY; entry_idx++) {
if ((bitmap & BIT(0)) == 0) {
-   RT_TRACE(rtlpriv, COMP_SEC, DBG_EMERG,
-"-hwsec_cam_bitmap: 0x%x entry_idx=%d\n",
-rtlpriv->sec.hwsec_cam_bitmap, entry_idx);
+   pr_err("rtlwifi: -hwsec_cam_bitmap: 0x%x 
entry_idx=%d\n",
+  rtlpriv->sec.hwsec_cam_bitmap, entry_idx);
rtlpriv->sec.hwsec_cam_bitmap |= BIT(0) << entry_idx;
memcpy(rtlpriv->sec.hwsec_cam_sta_addr[entry_idx],
   sta_addr, ETH_ALEN);
@@ -319,14 +317,12 @@ void rtl_cam_del_entry(struct ieee80211_hw *hw, u8 
*sta_addr)
u8 i, *addr;
 
if (NULL == sta_addr) {
-   RT_TRACE(rtlpr

[PATCH 00/14] rtlwifi: Start reworking of debug system

2016-12-10 Thread Larry Finger
Following the discussion regarding the patch entitled "rtlwifi: Add
BTC_TRACE_STRING to new btcoex", we are reworking the entire debug
system. This set of patches does the following:

1. Replaces every invocation of RT_ASSERT with WARN_ON. With this
   change, triggering these conditions with now give a stack dump.
   Note that the logical condition between RT_ASSERT and WARN_ON
   is inverted. In making these changes, 6 logic errors were found.
2. Replaces every call of RT_TRACE with the level set to DBG_EMERG
   with the equivalent pr_err() call.
3. Removes some redundant logged conditions. For example, when the
   failure of firmware to start is logged, it is not necessary to
   log that the firmware did start.

The previous two patch sequences "[PATCH 00/14] rtlwifi: Various updates"
and "[PATCH 0/7] rtlwifi: btcoexist: Rewrite BT coexistence routines"
should be discarded. That material will be resubmitted later.

Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 

Larry Finger (14):
  rtlwifi: Replace local debug macro RT_ASSERT
  rtlwifi_new: Remove RT_TRACE messages that use DBG_EMERG
  rtlwifi_new: rtl8821ae: Remove all instances of DBG_EMERG
  rtlwifi_new: rtl8723be: Remove all instances of DBG_EMERG
  rtlwifi_new: rtl8723ae: Remove all instances of DBG_EMERG
  rtlwifi_new: rtl8192ee: Remove all instances of DBG_EMERG
  rtlwifi_new: rtl8723-common: Remove all instances of DBG_EMERG
  rtlwifi_new: rtl8192se: Remove all instances of DBG_EMERG
  rtlwifi_new: rtl8192de: Remove all instances of DBG_EMERG
  rtlwifi_new: rtl8192cu: Remove all instances of DBG_EMERG
  rtlwifi_new: rtl8192ce: Remove all instances of DBG_EMERG
  rtlwifi_new: rtl8192c-common: Remove all instances of DBG_EMERG
  rtlwifi_new: rtl8188ee: Remove all instances of DBG_EMERG
  rtlwifi: Remove some redundant code

 drivers/net/wireless/realtek/rtlwifi/base.c| 15 +++
 drivers/net/wireless/realtek/rtlwifi/cam.c | 14 +++---
 drivers/net/wireless/realtek/rtlwifi/core.c| 29 +---
 drivers/net/wireless/realtek/rtlwifi/debug.c   |  9 ++--
 drivers/net/wireless/realtek/rtlwifi/debug.h   | 18 +---
 drivers/net/wireless/realtek/rtlwifi/efuse.c   |  3 +-
 drivers/net/wireless/realtek/rtlwifi/pci.c | 48 
 drivers/net/wireless/realtek/rtlwifi/ps.c  |  3 +-
 drivers/net/wireless/realtek/rtlwifi/rc.c  |  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8188ee/fw.c| 43 +-
 .../net/wireless/realtek/rtlwifi/rtl8188ee/hw.c| 32 +-
 .../net/wireless/realtek/rtlwifi/rtl8188ee/phy.c   | 32 ++
 .../net/wireless/realtek/rtlwifi/rtl8188ee/rf.c|  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8188ee/sw.c|  8 ++--
 .../net/wireless/realtek/rtlwifi/rtl8188ee/trx.c   |  8 ++--
 .../wireless/realtek/rtlwifi/rtl8192c/fw_common.c  | 45 ++-
 .../wireless/realtek/rtlwifi/rtl8192c/phy_common.c | 27 ++--
 .../net/wireless/realtek/rtlwifi/rtl8192ce/hw.c| 38 ++--
 .../net/wireless/realtek/rtlwifi/rtl8192ce/led.c   |  6 +--
 .../net/wireless/realtek/rtlwifi/rtl8192ce/phy.c   | 13 +++---
 .../net/wireless/realtek/rtlwifi/rtl8192ce/rf.c|  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8192ce/sw.c|  8 ++--
 .../net/wireless/realtek/rtlwifi/rtl8192ce/trx.c   |  8 ++--
 .../net/wireless/realtek/rtlwifi/rtl8192cu/hw.c| 35 +--
 .../net/wireless/realtek/rtlwifi/rtl8192cu/led.c   |  6 +--
 .../net/wireless/realtek/rtlwifi/rtl8192cu/mac.c   | 12 ++---
 .../net/wireless/realtek/rtlwifi/rtl8192cu/phy.c   | 12 ++---
 .../net/wireless/realtek/rtlwifi/rtl8192cu/rf.c|  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8192cu/sw.c|  5 +--
 .../net/wireless/realtek/rtlwifi/rtl8192cu/trx.c   |  2 +-
 .../net/wireless/realtek/rtlwifi/rtl8192de/fw.c| 31 -
 .../net/wireless/realtek/rtlwifi/rtl8192de/hw.c| 34 +--
 .../net/wireless/realtek/rtlwifi/rtl8192de/led.c   |  6 +--
 .../net/wireless/realtek/rtlwifi/rtl8192de/phy.c   | 41 -
 .../net/wireless/realtek/rtlwifi/rtl8192de/rf.c|  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8192de/sw.c| 10 ++---
 .../net/wireless/realtek/rtlwifi/rtl8192de/trx.c   |  8 ++--
 .../net/wireless/realtek/rtlwifi/rtl8192ee/fw.c| 40 +
 .../net/wireless/realtek/rtlwifi/rtl8192ee/hw.c| 13 +++---
 .../net/wireless/realtek/rtlwifi/rtl8192ee/phy.c   | 36 +++
 .../net/wireless/realtek/rtlwifi/rtl8192ee/rf.c|  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8192ee/sw.c|  8 ++--
 .../net/wireless/realtek/rtlwifi/rtl8192ee/trx.c   | 15 ---
 .../net/wireless/realtek/rtlwifi/rtl8192se/fw.c| 46 ---
 .../net/wireless/realtek/rtlwifi/rtl8192se/hw.c| 42 +++---
 .../net/wireless/realtek/rtlwifi/rtl8192se/led.c   |  6 +--
 .../net/wireless/realtek/rtlwifi/rtl8192se/phy.c   | 42 +++---
 .../net/wireless/realtek/rtlwifi/rtl8192se/rf.c|  3 +-
 .../net/w

[PATCH 03/14] rtlwifi: rtl8821ae: Remove all instances of DBG_EMERG

2016-12-10 Thread Larry Finger
This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
---
 .../net/wireless/realtek/rtlwifi/rtl8821ae/dm.c|  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8821ae/fw.c| 11 ++
 .../net/wireless/realtek/rtlwifi/rtl8821ae/hw.c| 15 +++-
 .../net/wireless/realtek/rtlwifi/rtl8821ae/phy.c   | 43 --
 .../net/wireless/realtek/rtlwifi/rtl8821ae/rf.c|  5 +--
 .../net/wireless/realtek/rtlwifi/rtl8821ae/sw.c| 14 +++
 6 files changed, 33 insertions(+), 58 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c
index bdfd444..32900c5 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c
@@ -604,8 +604,7 @@ static void rtl8821ae_dm_find_minimum_rssi(struct 
ieee80211_hw *hw)
if ((mac->link_state < MAC80211_LINKED) &&
(rtlpriv->dm.entry_min_undec_sm_pwdb == 0)) {
rtl_dm_dig->min_undec_pwdb_for_dm = 0;
-   RT_TRACE(rtlpriv, COMP_BB_POWERSAVING, DBG_LOUD,
-"Not connected to any\n");
+   pr_debug("rtl8821ae: Not connected to any AP\n");
}
if (mac->link_state >= MAC80211_LINKED) {
if (mac->opmode == NL80211_IFTYPE_AP ||
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c
index c70face..602ac86 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c
@@ -125,8 +125,7 @@ static void _rtl8821ae_write_fw(struct ieee80211_hw *hw,
remainsize = size % FW_8821AE_PAGE_SIZE;
 
if (pagenums > 8) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Page numbers should not greater then 8\n");
+   pr_err("rtl8821ae: Page numbers should not greater then 8\n");
}
 
for (page = 0; page < pagenums; page++) {
@@ -162,8 +161,8 @@ static int _rtl8821ae_fw_free_to_go(struct ieee80211_hw *hw)
goto exit;
}
 
-   RT_TRACE(rtlpriv, COMP_FW, DBG_EMERG,
-"Checksum report OK ! REG_MCUFWDL:0x%08x .\n", value32);
+   pr_err("rtl8821ae: Checksum report OK! REG_MCUFWDL:0x%08x\n",
+  value32);
 
value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL);
value32 |= MCUFWDL_RDY;
@@ -186,9 +184,8 @@ static int _rtl8821ae_fw_free_to_go(struct ieee80211_hw *hw)
udelay(FW_8821AE_POLLING_DELAY);
} while (counter++ < FW_8821AE_POLLING_TIMEOUT_COUNT);
 
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Polling FW ready fail!! REG_MCUFWDL:0x%08x .\n",
-value32);
+   pr_err("rtl8821ae: Polling FW ready fail!! REG_MCUFWDL:0x%08x .\n",
+  value32);
 
 exit:
return err;
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
index b6dc2f3..3932a5d 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
@@ -822,9 +822,8 @@ static bool _rtl8821ae_llt_write(struct ieee80211_hw *hw, 
u32 address, u32 data)
break;
 
if (count > POLLING_LLT_THRESHOLD) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Failed to polling write LLT done at address 
%d!\n",
-address);
+   pr_err("rtl8821ae: Failed to polling write LLT done at 
address %d!\n",
+  address);
status = false;
break;
}
@@ -1927,7 +1926,7 @@ int rtl8821ae_hw_init(struct ieee80211_hw *hw)
 
rtstatus = _rtl8821ae_init_mac(hw);
if (rtstatus != true) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Init MAC failed\n");
+   pr_err("rtl8821ae: Init MAC failed\n");
err = 1;
return err;
}
@@ -2174,8 +2173,7 @@ static int _rtl8821ae_set_media_status(struct 
ieee80211_hw *hw,
 "Set Network type to AP!\n");
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Network type %d not support!\n", type);
+   pr_err("rtl8821ae: Network type %d not support!\n", type);
return 1;
}
 
@@ -3274,7 +3272,7 @@ void rtl8821ae_read_eeprom_info(struct ieee80211_hw *hw)
rtlefuse->autoload_failflag = false;
_rtl8821ae_read_adapter_info(hw, false);
} else {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Autoload ERR!

[PATCH 03/14] rtlwifi_new: rtl8821ae: Remove all instances of DBG_EMERG

2016-12-10 Thread Larry Finger
This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
---
 .../net/wireless/realtek/rtlwifi/rtl8821ae/dm.c|  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8821ae/fw.c| 11 ++
 .../net/wireless/realtek/rtlwifi/rtl8821ae/hw.c| 15 +++-
 .../net/wireless/realtek/rtlwifi/rtl8821ae/phy.c   | 43 --
 .../net/wireless/realtek/rtlwifi/rtl8821ae/rf.c|  5 +--
 .../net/wireless/realtek/rtlwifi/rtl8821ae/sw.c| 14 +++
 6 files changed, 33 insertions(+), 58 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c
index bdfd444..32900c5 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c
@@ -604,8 +604,7 @@ static void rtl8821ae_dm_find_minimum_rssi(struct 
ieee80211_hw *hw)
if ((mac->link_state < MAC80211_LINKED) &&
(rtlpriv->dm.entry_min_undec_sm_pwdb == 0)) {
rtl_dm_dig->min_undec_pwdb_for_dm = 0;
-   RT_TRACE(rtlpriv, COMP_BB_POWERSAVING, DBG_LOUD,
-"Not connected to any\n");
+   pr_debug("rtl8821ae: Not connected to any AP\n");
}
if (mac->link_state >= MAC80211_LINKED) {
if (mac->opmode == NL80211_IFTYPE_AP ||
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c
index e8688f4..536c12a 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c
@@ -125,8 +125,7 @@ static void _rtl8821ae_write_fw(struct ieee80211_hw *hw,
remainsize = size % FW_8821AE_PAGE_SIZE;
 
if (pagenums > 8) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Page numbers should not greater then 8\n");
+   pr_err("Page numbers should not greater then 8\n");
}
 
for (page = 0; page < pagenums; page++) {
@@ -162,8 +161,7 @@ static int _rtl8821ae_fw_free_to_go(struct ieee80211_hw *hw)
goto exit;
}
 
-   RT_TRACE(rtlpriv, COMP_FW, DBG_EMERG,
-"Checksum report OK ! REG_MCUFWDL:0x%08x .\n", value32);
+   pr_err("Checksum report OK ! REG_MCUFWDL:0x%08x .\n", value32);
 
value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL);
value32 |= MCUFWDL_RDY;
@@ -186,9 +184,8 @@ static int _rtl8821ae_fw_free_to_go(struct ieee80211_hw *hw)
udelay(FW_8821AE_POLLING_DELAY);
} while (counter++ < FW_8821AE_POLLING_TIMEOUT_COUNT);
 
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Polling FW ready fail!! REG_MCUFWDL:0x%08x .\n",
-value32);
+   pr_err("Polling FW ready fail!! REG_MCUFWDL:0x%08x .\n",
+  value32);
 
 exit:
return err;
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
index b045dd0..259984f 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
@@ -822,9 +822,8 @@ static bool _rtl8821ae_llt_write(struct ieee80211_hw *hw, 
u32 address, u32 data)
break;
 
if (count > POLLING_LLT_THRESHOLD) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Failed to polling write LLT done at address 
%d!\n",
-address);
+   pr_err("Failed to polling write LLT done at address 
%d!\n",
+  address);
status = false;
break;
}
@@ -1927,7 +1926,7 @@ int rtl8821ae_hw_init(struct ieee80211_hw *hw)
 
rtstatus = _rtl8821ae_init_mac(hw);
if (rtstatus != true) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Init MAC failed\n");
+   pr_err("Init MAC failed\n");
err = 1;
return err;
}
@@ -2174,8 +2173,7 @@ static int _rtl8821ae_set_media_status(struct 
ieee80211_hw *hw,
 "Set Network type to AP!\n");
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Network type %d not support!\n", type);
+   pr_err("Network type %d not support!\n", type);
return 1;
}
 
@@ -3275,7 +3273,7 @@ void rtl8821ae_read_eeprom_info(struct ieee80211_hw *hw)
rtlefuse->autoload_failflag = false;
_rtl8821ae_read_adapter_info(hw, false);
} else {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Autoload ERR!!\n");
+   pr_err("Autoload ERR!!\n");
}
/*hal_Rea

[PATCH 02/14] rtlwifi_new: Remove RT_TRACE messages that use DBG_EMERG

2016-12-10 Thread Larry Finger
These messages are always logged and reprresent error conditions, thus
we can use pr_err().

Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
---
 drivers/net/wireless/realtek/rtlwifi/base.c  | 15 -
 drivers/net/wireless/realtek/rtlwifi/cam.c   | 14 +++--
 drivers/net/wireless/realtek/rtlwifi/core.c  | 21 +
 drivers/net/wireless/realtek/rtlwifi/debug.c |  9 ++
 drivers/net/wireless/realtek/rtlwifi/debug.h |  2 +-
 drivers/net/wireless/realtek/rtlwifi/efuse.c |  3 +-
 drivers/net/wireless/realtek/rtlwifi/pci.c   | 36 --
 drivers/net/wireless/realtek/rtlwifi/ps.c|  3 +-
 drivers/net/wireless/realtek/rtlwifi/rc.c|  3 +-
 drivers/net/wireless/realtek/rtlwifi/usb.c   | 46 +---
 10 files changed, 53 insertions(+), 99 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/base.c 
b/drivers/net/wireless/realtek/rtlwifi/base.c
index 4ac928b..e7346cd 100644
--- a/drivers/net/wireless/realtek/rtlwifi/base.c
+++ b/drivers/net/wireless/realtek/rtlwifi/base.c
@@ -207,8 +207,7 @@ static void _rtl_init_hw_ht_capab(struct ieee80211_hw *hw,
 *highest supported RX rate
 */
if (rtlpriv->dm.supp_phymode_switch) {
-   RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG,
-"Support phy mode switch\n");
+   pr_err("rtlwifi: Support phy mode switch\n");
 
ht_cap->mcs.rx_mask[0] = 0xFF;
ht_cap->mcs.rx_mask[1] = 0xFF;
@@ -389,8 +388,8 @@ static void _rtl_init_mac80211(struct ieee80211_hw *hw)
/* <4> set mac->sband to wiphy->sband */
hw->wiphy->bands[NL80211_BAND_5GHZ] = sband;
} else {
-   RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, "Err BAND %d\n",
-rtlhal->current_bandtype);
+   pr_err("rtlwifi: Err BAND %d\n",
+  rtlhal->current_bandtype);
}
}
/* <5> set hw caps */
@@ -544,7 +543,7 @@ int rtl_init_core(struct ieee80211_hw *hw)
 * mac80211 hw  in _rtl_init_mac80211.
 */
if (rtl_regd_init(hw, rtl_reg_notifier)) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "REGD init failed\n");
+   pr_err("rtlwifi: REGD init failed\n");
return 1;
}
 
@@ -1694,8 +1693,7 @@ void rtl_watchdog_wq_callback(void *data)
 * we should reconnect this AP
 */
if (rtlpriv->link_info.roam_times >= 5) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"AP off, try to reconnect now\n");
+   pr_err("rtlwifi: AP off, try to reconnect 
now\n");
rtlpriv->link_info.roam_times = 0;
ieee80211_connection_loss(
rtlpriv->mac80211.vif);
@@ -1886,8 +1884,7 @@ void rtl_phy_scan_operation_backup(struct ieee80211_hw 
*hw, u8 operation)
  (u8 *)&iotype);
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Unknown Scan Backup operation.\n");
+   pr_err("rtlwifi: Unknown Scan Backup operation.\n");
break;
}
}
diff --git a/drivers/net/wireless/realtek/rtlwifi/cam.c 
b/drivers/net/wireless/realtek/rtlwifi/cam.c
index 8fe8b4c..ed67694 100644
--- a/drivers/net/wireless/realtek/rtlwifi/cam.c
+++ b/drivers/net/wireless/realtek/rtlwifi/cam.c
@@ -285,8 +285,7 @@ u8 rtl_cam_get_free_entry(struct ieee80211_hw *hw, u8 
*sta_addr)
u8 i, *addr;
 
if (NULL == sta_addr) {
-   RT_TRACE(rtlpriv, COMP_SEC, DBG_EMERG,
-"sta_addr is NULL.\n");
+   pr_err("rtlwifi: sta_addr is NULL.\n");
return TOTAL_CAM_ENTRY;
}
/* Does STA already exist? */
@@ -298,9 +297,8 @@ u8 rtl_cam_get_free_entry(struct ieee80211_hw *hw, u8 
*sta_addr)
/* Get a free CAM entry. */
for (entry_idx = 4; entry_idx < TOTAL_CAM_ENTRY; entry_idx++) {
if ((bitmap & BIT(0)) == 0) {
-   RT_TRACE(rtlpriv, COMP_SEC, DBG_EMERG,
-"-hwsec_cam_bitmap: 0x%x entry_idx=%d\n",
-rtlpriv->sec.hwsec_cam_bitmap, entry_idx);
+   pr_err("rtlwifi: -hwsec_cam_bitmap: 0x%x 
entry_idx=%d\n",
+  rtlpriv->sec.hwsec_cam_bitmap, entry_idx);
rtlpriv->sec.hwsec_cam_bitmap |= BIT(0) << entry_idx;
memcpy(rtlpriv->sec.hwsec_cam_sta_addr[entry_idx],
   sta_addr, ETH_ALEN);
@@ -319,14 +317,12 @@ void rtl_cam_del_entry(st

[PATCH 11/14] rtlwifi_new: rtl8192ce: Remove all instances of DBG_EMERG

2016-12-10 Thread Larry Finger
This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
---
 .../net/wireless/realtek/rtlwifi/rtl8192ce/hw.c| 36 --
 .../net/wireless/realtek/rtlwifi/rtl8192ce/led.c   |  6 ++--
 .../net/wireless/realtek/rtlwifi/rtl8192ce/phy.c   | 13 +++-
 .../net/wireless/realtek/rtlwifi/rtl8192ce/rf.c|  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8192ce/sw.c|  8 ++---
 5 files changed, 24 insertions(+), 42 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c
index b757a74..7ed33c2 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c
@@ -140,8 +140,7 @@ void rtl92ce_get_hw_reg(struct ieee80211_hw *hw, u8 
variable, u8 *val)
case HAL_DEF_WOWLAN:
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"switch case %#x not processed\n", variable);
+   pr_err("switch case %#x not processed\n", variable);
break;
}
 }
@@ -364,9 +363,8 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 
variable, u8 *val)
acm_ctrl &= (~AcmHw_VoqEn);
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"switch case %#x not 
processed\n",
-e_aci);
+   pr_err("switch case %#x not 
processed\n",
+  e_aci);
break;
}
}
@@ -551,8 +549,7 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 
variable, u8 *val)
rtl92c_fill_h2c_cmd(hw, H2C_92C_KEEP_ALIVE_CTRL, 2, array);
break; }
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"switch case %d not processed\n", variable);
+   pr_err("switch case %d not processed\n", variable);
break;
}
 }
@@ -573,9 +570,8 @@ static bool _rtl92ce_llt_write(struct ieee80211_hw *hw, u32 
address, u32 data)
break;
 
if (count > POLLING_LLT_THRESHOLD) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Failed to polling write LLT done at address 
%d!\n",
-address);
+   pr_err("Failed to polling write LLT done at address 
%d!\n",
+  address);
status = false;
break;
}
@@ -963,7 +959,7 @@ int rtl92ce_hw_init(struct ieee80211_hw *hw)
rtlpriv->intf_ops->disable_aspm(hw);
rtstatus = _rtl92ce_init_mac(hw);
if (!rtstatus) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Init MAC failed\n");
+   pr_err("Init MAC failed\n");
err = 1;
goto exit;
}
@@ -1128,8 +1124,7 @@ static enum version_8192c 
_rtl92ce_read_chip_version(struct ieee80211_hw *hw)
break;
}
 
-   RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG,
-"Chip Version ID: %s\n", versionid);
+   pr_info("Chip Version ID: %s\n", versionid);
 
switch (version & 0x3) {
case CHIP_88C:
@@ -1143,8 +1138,7 @@ static enum version_8192c 
_rtl92ce_read_chip_version(struct ieee80211_hw *hw)
break;
default:
rtlphy->rf_type = RF_1T1R;
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"ERROR RF_Type is set!!\n");
+   pr_err("ERROR RF_Type is set!!\n");
break;
}
 
@@ -1193,8 +1187,7 @@ static int _rtl92ce_set_media_status(struct ieee80211_hw 
*hw,
 "Set Network type to Mesh Point!\n");
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Network type %d not supported!\n", type);
+   pr_err("Network type %d not supported!\n", type);
return 1;
 
}
@@ -1780,7 +1773,7 @@ void rtl92ce_read_eeprom_info(struct ieee80211_hw *hw)
rtlefuse->autoload_failflag = false;
_rtl92ce_read_adapter_info(hw);
} else {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Autoload ERR!!\n");
+   pr_err("Autoload ERR!!\n");
}
_rtl92ce_hal_customized_behavior(hw);
 }
@@ -2152,8 +2145,7 @@ void rtl92ce_set_key(struct ieee80211_hw *hw, u32 
key_index,
 

[PATCH 10/14] rtlwifi: rtl8192cu: Remove all instances of DBG_EMERG

2016-12-10 Thread Larry Finger
This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
---
 .../net/wireless/realtek/rtlwifi/rtl8192cu/hw.c| 33 --
 .../net/wireless/realtek/rtlwifi/rtl8192cu/led.c   |  6 ++--
 .../net/wireless/realtek/rtlwifi/rtl8192cu/mac.c   | 12 +++-
 .../net/wireless/realtek/rtlwifi/rtl8192cu/phy.c   | 12 +++-
 .../net/wireless/realtek/rtlwifi/rtl8192cu/rf.c|  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8192cu/sw.c|  5 ++--
 6 files changed, 24 insertions(+), 47 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
index aa3d559..dce13d6 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
@@ -452,8 +452,7 @@ static int _rtl92cu_init_power_on(struct ieee80211_hw *hw)
break;
}
if (pollingCount++ > 100) {
-   RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG,
-"Failed to polling REG_APS_FSMCO[PFM_ALDN] 
done!\n");
+   pr_err("rtl8192cu: Failed to polling 
REG_APS_FSMCO[PFM_ALDN] done!\n");
return -ENODEV;
}
} while (true);
@@ -486,8 +485,7 @@ static int _rtl92cu_init_power_on(struct ieee80211_hw *hw)
break;
}
if (pollingCount++ > 1000) {
-   RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG,
-"Failed to polling REG_APS_FSMCO[APFM_ONMAC] 
done!\n");
+   pr_err("rtl8192cu: Failed to polling 
REG_APS_FSMCO[APFM_ONMAC] done!\n");
return -ENODEV;
}
} while (true);
@@ -687,7 +685,6 @@ static void 
_rtl92cu_init_chipN_three_out_ep_priority(struct ieee80211_hw *hw,
  u8 queue_sel)
 {
u16 beQ, bkQ, viQ, voQ, mgtQ, hiQ;
-   struct rtl_priv *rtlpriv = rtl_priv(hw);
 
if (!wmm_enable) { /* typical setting */
beQ = QUEUE_LOW;
@@ -705,8 +702,7 @@ static void 
_rtl92cu_init_chipN_three_out_ep_priority(struct ieee80211_hw *hw,
hiQ = QUEUE_HIGH;
}
_rtl92c_init_chipN_reg_priority(hw, beQ, bkQ, viQ, voQ, mgtQ, hiQ);
-   RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, "Tx queue select :0x%02x..\n",
-queue_sel);
+   pr_info("Tx queue select :0x%02x..\n", queue_sel);
 }
 
 static void _rtl92cu_init_chipN_queue_priority(struct ieee80211_hw *hw,
@@ -765,8 +761,7 @@ static void _rtl92cu_init_chipT_queue_priority(struct 
ieee80211_hw *hw,
break;
}
rtl_write_byte(rtlpriv, (REG_TRXDMA_CTRL+1), hq_sele);
-   RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, "Tx queue select :0x%02x..\n",
-hq_sele);
+   pr_info("Tx queue select :0x%02x..\n", hq_sele);
 }
 
 static void _rtl92cu_init_queue_priority(struct ieee80211_hw *hw,
@@ -848,8 +843,7 @@ static int _rtl92cu_init_mac(struct ieee80211_hw *hw)
err = _rtl92cu_init_power_on(hw);
 
if (err) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Failed to init power on!\n");
+   pr_err("rtl8192cu: Failed to init power on!\n");
return err;
}
if (!wmm_enable) {
@@ -860,8 +854,7 @@ static int _rtl92cu_init_mac(struct ieee80211_hw *hw)
: WMM_CHIP_A_TX_PAGE_BOUNDARY;
}
if (false == rtl92c_init_llt_table(hw, boundary)) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Failed to init LLT Table!\n");
+   pr_err("rtl8192cu: Failed to init LLT Table!\n");
return -EINVAL;
}
_rtl92cu_init_queue_reserved_page(hw, wmm_enable, out_ep_nums,
@@ -986,7 +979,7 @@ int rtl92cu_hw_init(struct ieee80211_hw *hw)
rtlhal->hw_type = HARDWARE_TYPE_RTL8192CU;
err = _rtl92cu_init_mac(hw);
if (err) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "init mac failed!\n");
+   pr_err("rtl8192cu: init mac failed!\n");
goto exit;
}
err = rtl92c_download_fw(hw);
@@ -1099,8 +1092,7 @@ static void  _ResetDigitalProcedure1(struct ieee80211_hw 
*hw, bool bWithoutHWSM)
udelay(50);
}
if (retry_cnts >= 100) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"#=> 8051 reset 
failed!.\n");
+   pr_err("rtl8192cu: 8051 reset 
failed!.\n");
  

[PATCH 12/14] rtlwifi: rtl8192c-common: Remove all instances of DBG_EMERG

2016-12-10 Thread Larry Finger
This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
---
 .../wireless/realtek/rtlwifi/rtl8192c/fw_common.c  | 33 ++
 .../wireless/realtek/rtlwifi/rtl8192c/phy_common.c | 13 -
 2 files changed, 15 insertions(+), 31 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c
index 4a49e66..e739e56 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c
@@ -145,10 +145,8 @@ static void _rtl92c_write_fw(struct ieee80211_hw *hw,
pageNums = size / FW_8192C_PAGE_SIZE;
remainsize = size % FW_8192C_PAGE_SIZE;
 
-   if (pageNums > 4) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Page numbers should not greater then 4\n");
-   }
+   if (pageNums > 4)
+   pr_err("rtl8192c-common: Page numbers should not 
greater then 4\n");
 
for (page = 0; page < pageNums; page++) {
offset = page * FW_8192C_PAGE_SIZE;
@@ -180,15 +178,10 @@ static int _rtl92c_fw_free_to_go(struct ieee80211_hw *hw)
 (!(value32 & FWDL_ChkSum_rpt)));
 
if (counter >= FW_8192C_POLLING_TIMEOUT_COUNT) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"chksum report faill ! REG_MCUFWDL:0x%08x .\n",
- value32);
+   pr_err("rtl8192c-common: chksum report fail! REG_MCUFWDL:0x%08x 
.\n",
+  value32);
goto exit;
}
-
-   RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
-"Checksum report OK ! REG_MCUFWDL:0x%08x .\n", value32);
-
value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL);
value32 |= MCUFWDL_RDY;
value32 &= ~WINTINI_RDY;
@@ -198,20 +191,15 @@ static int _rtl92c_fw_free_to_go(struct ieee80211_hw *hw)
 
do {
value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL);
-   if (value32 & WINTINI_RDY) {
-   RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
-"Polling FW ready success!! REG_MCUFWDL:0x%08x 
.\n",
-   value32);
-   err = 0;
-   goto exit;
-   }
+   if (value32 & WINTINI_RDY)
+   return 0;
 
mdelay(FW_8192C_POLLING_DELAY);
 
} while (counter++ < FW_8192C_POLLING_TIMEOUT_COUNT);
 
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Polling FW ready fail!! REG_MCUFWDL:0x%08x .\n", value32);
+   pr_err("rtl8192c-common: Polling FW ready fail! REG_MCUFWDL:0x%08x.\n",
+  value32);
 
 exit:
return err;
@@ -251,8 +238,7 @@ int rtl92c_download_fw(struct ieee80211_hw *hw)
 
err = _rtl92c_fw_free_to_go(hw);
if (err) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Firmware is not ready to run!\n");
+   pr_err("rtl8192c-common: Firmware is not ready to run!\n");
} else {
RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
 "Firmware is ready to run!\n");
@@ -327,8 +313,7 @@ static void _rtl92c_fill_h2c_command(struct ieee80211_hw 
*hw,
while (!bwrite_sucess) {
wait_writeh2c_limmit--;
if (wait_writeh2c_limmit == 0) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Write H2C fail because no trigger for FW 
INT!\n");
+   pr_err("rtl8192c-common: Write H2C fail because no 
trigger for FW INT!\n");
break;
}
 
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.c
index 30c2d12..5f8fa4a 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.c
@@ -104,7 +104,7 @@ u32 _rtl92c_phy_rf_serial_read(struct ieee80211_hw *hw,
offset &= 0x3f;
newoffset = offset;
if (RT_CANNOT_IO(hw)) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "return all one\n");
+   pr_err("rtl8192c-common: return all one\n");
return 0x;
}
tmplong = rtl_get_bbreg(hw, RFPGA0_XA_HSSIPARAMETER2, MASKDWORD);
@@ -152,7 +152,7 @@ void _rtl92c_phy_rf_serial_write(struct ieee80211_hw *hw,
struct bb_reg_def *pphyreg = &rtlphy->phyreg_def[rfpath];
 
if (RT_CANNOT_IO(hw)) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "stop\n");
+   pr_err("rtl8

[PATCH 12/14] rtlwifi_new: rtl8192c-common: Remove all instances of DBG_EMERG

2016-12-10 Thread Larry Finger
This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
---
 .../wireless/realtek/rtlwifi/rtl8192c/fw_common.c  | 33 ++
 .../wireless/realtek/rtlwifi/rtl8192c/phy_common.c | 13 -
 2 files changed, 15 insertions(+), 31 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c
index 54fcf5a..5c93ee0 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c
@@ -145,10 +145,8 @@ static void _rtl92c_write_fw(struct ieee80211_hw *hw,
pageNums = size / FW_8192C_PAGE_SIZE;
remainsize = size % FW_8192C_PAGE_SIZE;
 
-   if (pageNums > 4) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Page numbers should not greater then 4\n");
-   }
+   if (pageNums > 4)
+   pr_err("Page numbers should not greater then 4\n");
 
for (page = 0; page < pageNums; page++) {
offset = page * FW_8192C_PAGE_SIZE;
@@ -180,15 +178,10 @@ static int _rtl92c_fw_free_to_go(struct ieee80211_hw *hw)
 (!(value32 & FWDL_ChkSum_rpt)));
 
if (counter >= FW_8192C_POLLING_TIMEOUT_COUNT) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"chksum report faill ! REG_MCUFWDL:0x%08x .\n",
- value32);
+   pr_err("chksum report fail! REG_MCUFWDL:0x%08x .\n",
+  value32);
goto exit;
}
-
-   RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
-"Checksum report OK ! REG_MCUFWDL:0x%08x .\n", value32);
-
value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL);
value32 |= MCUFWDL_RDY;
value32 &= ~WINTINI_RDY;
@@ -198,20 +191,14 @@ static int _rtl92c_fw_free_to_go(struct ieee80211_hw *hw)
 
do {
value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL);
-   if (value32 & WINTINI_RDY) {
-   RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
-"Polling FW ready success!! REG_MCUFWDL:0x%08x 
.\n",
-   value32);
-   err = 0;
-   goto exit;
-   }
+   if (value32 & WINTINI_RDY)
+   return 0;
 
mdelay(FW_8192C_POLLING_DELAY);
 
} while (counter++ < FW_8192C_POLLING_TIMEOUT_COUNT);
 
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Polling FW ready fail!! REG_MCUFWDL:0x%08x .\n", value32);
+   pr_err("Polling FW ready fail!! REG_MCUFWDL:0x%08x .\n", value32);
 
 exit:
return err;
@@ -251,8 +238,7 @@ int rtl92c_download_fw(struct ieee80211_hw *hw)
 
err = _rtl92c_fw_free_to_go(hw);
if (err) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Firmware is not ready to run!\n");
+   pr_err("Firmware is not ready to run!\n");
} else {
RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
 "Firmware is ready to run!\n");
@@ -327,8 +313,7 @@ static void _rtl92c_fill_h2c_command(struct ieee80211_hw 
*hw,
while (!bwrite_sucess) {
wait_writeh2c_limmit--;
if (wait_writeh2c_limmit == 0) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Write H2C fail because no trigger for FW 
INT!\n");
+   pr_err("Write H2C fail because no trigger for FW 
INT!\n");
break;
}
 
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.c
index 32fc4b6..fb0ce16 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.c
@@ -104,7 +104,7 @@ u32 _rtl92c_phy_rf_serial_read(struct ieee80211_hw *hw,
offset &= 0x3f;
newoffset = offset;
if (RT_CANNOT_IO(hw)) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "return all one\n");
+   pr_err("return all one\n");
return 0x;
}
tmplong = rtl_get_bbreg(hw, RFPGA0_XA_HSSIPARAMETER2, MASKDWORD);
@@ -152,7 +152,7 @@ void _rtl92c_phy_rf_serial_write(struct ieee80211_hw *hw,
struct bb_reg_def *pphyreg = &rtlphy->phyreg_def[rfpath];
 
if (RT_CANNOT_IO(hw)) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "stop\n");
+   pr_err("stop\n");
return;
}
offset &= 0x3f;
@@ -209,7 +209,7 @@ bool _rtl92c_phy_bb8192c_config_p

[PATCH 06/14] rtlwifi: rtl8192ee: Remove all instances of DBG_EMERG

2016-12-10 Thread Larry Finger
This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
---
 .../net/wireless/realtek/rtlwifi/rtl8192ee/fw.c| 21 -
 .../net/wireless/realtek/rtlwifi/rtl8192ee/hw.c| 11 ---
 .../net/wireless/realtek/rtlwifi/rtl8192ee/phy.c   | 22 +-
 .../net/wireless/realtek/rtlwifi/rtl8192ee/rf.c|  3 +--
 .../net/wireless/realtek/rtlwifi/rtl8192ee/sw.c|  8 +++-
 5 files changed, 25 insertions(+), 40 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c
index c2dc26d..27f9608 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c
@@ -122,10 +122,8 @@ static void _rtl92ee_write_fw(struct ieee80211_hw *hw,
pagenums = size / FW_8192C_PAGE_SIZE;
remainsize = size % FW_8192C_PAGE_SIZE;
 
-   if (pagenums > 8) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Page numbers should not greater then 8\n");
-   }
+   if (pagenums > 8)
+   pr_err("rtl8192ee: Page numbers should not greater then 8\n");
 
for (page = 0; page < pagenums; page++) {
offset = page * FW_8192C_PAGE_SIZE;
@@ -155,14 +153,13 @@ static int _rtl92ee_fw_free_to_go(struct ieee80211_hw *hw)
 (!(value32 & FWDL_CHKSUM_RPT)));
 
if (counter >= FW_8192C_POLLING_TIMEOUT_COUNT) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"chksum report faill ! REG_MCUFWDL:0x%08x .\n",
- value32);
+   pr_err("rtl8192ee: chksum report fail! REG_MCUFWDL:0x%08x\n",
+  value32);
goto exit;
}
 
RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
-"Checksum report OK ! REG_MCUFWDL:0x%08x .\n", value32);
+"Checksum report OK! REG_MCUFWDL:0x%08x\n", value32);
 
value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL);
value32 |= MCUFWDL_RDY;
@@ -186,9 +183,8 @@ static int _rtl92ee_fw_free_to_go(struct ieee80211_hw *hw)
 
} while (counter++ < FW_8192C_POLLING_TIMEOUT_COUNT);
 
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Polling FW ready fail!! REG_MCUFWDL:0x%08x. count = %d\n",
-value32, counter);
+   pr_err("rtl8192ee: Polling FW ready fail!! REG_MCUFWDL:0x%08x. count = 
%d\n",
+  value32, counter);
 
 exit:
return err;
@@ -241,8 +237,7 @@ int rtl92ee_download_fw(struct ieee80211_hw *hw, bool 
buse_wake_on_wlan_fw)
 
err = _rtl92ee_fw_free_to_go(hw);
if (err) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Firmware is not ready to run!\n");
+   pr_err("rtl8192ee: Firmware is not ready to run!\n");
} else {
RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD ,
 "Firmware is ready to run!\n");
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/hw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/hw.c
index bd416b8..c2a7666 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/hw.c
@@ -1320,7 +1320,7 @@ int rtl92ee_hw_init(struct ieee80211_hw *hw)
rtl_write_byte(rtlpriv, 0x65, 1);
}
if (!rtstatus) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Init MAC failed\n");
+   pr_err("rtl8192ee: Init MAC failed\n");
err = 1;
return err;
}
@@ -1485,8 +1485,7 @@ static int _rtl92ee_set_media_status(struct ieee80211_hw 
*hw,
 "Set Network type to AP!\n");
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Network type %d not support!\n", type);
+   pr_err("rtl8192ee: Network type %d not support!\n", type);
return 1;
}
 
@@ -2206,7 +2205,7 @@ void rtl92ee_read_eeprom_info(struct ieee80211_hw *hw)
rtlefuse->autoload_failflag = false;
_rtl92ee_read_adapter_info(hw);
} else {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Autoload ERR!!\n");
+   pr_err("rtl8192ee: Autoload ERR!!\n");
}
_rtl92ee_hal_customized_behavior(hw);
 
@@ -2484,9 +2483,7 @@ void rtl92ee_set_key(struct ieee80211_hw *hw, u32 
key_index,
entry_id = rtl_cam_get_free_entry(hw,
 p_macaddr);
if (entry_id >=  TOTAL_CAM_ENTRY) {
-   RT_TRACE(rtlpriv, COMP_SEC,
- 

[PATCH 05/14] rtlwifi: rtl8723ae: Remove all instances of DBG_EMERG

2016-12-10 Thread Larry Finger
This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
---
 drivers/net/wireless/realtek/rtlwifi/rtl8723ae/fw.c  |  9 +++--
 drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c  | 19 +++
 drivers/net/wireless/realtek/rtlwifi/rtl8723ae/led.c |  6 ++
 drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c | 18 +++---
 drivers/net/wireless/realtek/rtlwifi/rtl8723ae/rf.c  |  3 +--
 drivers/net/wireless/realtek/rtlwifi/rtl8723ae/sw.c  |  8 +++-
 6 files changed, 23 insertions(+), 40 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/fw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/fw.c
index 2f398da..9136fb3 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/fw.c
@@ -99,8 +99,7 @@ static void _rtl8723e_fill_h2c_command(struct ieee80211_hw 
*hw, u8 element_id,
while (!bwrite_sucess) {
wait_writeh2c_limmit--;
if (wait_writeh2c_limmit == 0) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Write H2C fail because no trigger for FW 
INT!\n");
+   pr_err("rtl8723ae: Write H2C fail because no trigger 
for FW INT!\n");
break;
}
 
@@ -123,8 +122,8 @@ static void _rtl8723e_fill_h2c_command(struct ieee80211_hw 
*hw, u8 element_id,
box_extreg = REG_HMEBOX_EXT_3;
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"switch case %#x not processed\n", boxnum);
+   pr_err("rtl8723ae: switch case %#x not processed\n",
+  boxnum);
break;
}
 
@@ -229,8 +227,8 @@ static void _rtl8723e_fill_h2c_command(struct ieee80211_hw 
*hw, u8 element_id,
}
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"switch case %#x not processed\n", cmd_len);
+   pr_err("rtl8723ae: switch case %#x not processed\n",
+  cmd_len);
break;
}
 
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
index 6c51483..dff9ebb 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
@@ -570,9 +570,8 @@ static bool _rtl8723e_llt_write(struct ieee80211_hw *hw, 
u32 address, u32 data)
break;
 
if (count > POLLING_LLT_THRESHOLD) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Failed to polling write LLT done at address 
%d!\n",
-address);
+   pr_err("rtl8723ae: Failed to polling write LLT done at 
address %d!\n",
+  address);
status = false;
break;
}
@@ -961,7 +960,7 @@ int rtl8723e_hw_init(struct ieee80211_hw *hw)
rtlpriv->intf_ops->disable_aspm(hw);
rtstatus = _rtl8712e_init_mac(hw);
if (rtstatus != true) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Init MAC failed\n");
+   pr_err("rtl8723ae: Init MAC failed\n");
err = 1;
goto exit;
}
@@ -1107,8 +1106,7 @@ static enum version_8723e 
_rtl8723e_read_chip_version(struct ieee80211_hw *hw)
 "Chip Version ID: 
VERSION_NORMAL_UMC_CHIP_8723_1T1R_B_CUT.\n");
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Chip Version ID: Unknown. Bug?\n");
+   pr_err("rtl8723ae: Chip Version ID: Unknown. Bug?\n");
break;
}
 
@@ -1157,8 +1155,7 @@ static int _rtl8723e_set_media_status(struct ieee80211_hw 
*hw,
"Set Network type to AP!\n");
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-   "Network type %d not support!\n", type);
+   pr_err("rtl8723ae: Network type %d not support!\n", type);
return 1;
break;
}
@@ -1852,7 +1849,7 @@ void rtl8723e_read_eeprom_info(struct ieee80211_hw *hw)
} else {
rtlefuse->autoload_failflag = true;
_rtl8723e_read_adapter_info(hw, false);
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Autoload ERR!!\n");
+   pr_err("rtl8723ae: Autoload ERR!!\n");
}

[PATCH 08/14] rtlwifi: rtl8192se: Remove all instances of DBG_EMERG

2016-12-10 Thread Larry Finger
This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
---
 .../net/wireless/realtek/rtlwifi/rtl8192se/fw.c| 46 --
 .../net/wireless/realtek/rtlwifi/rtl8192se/hw.c| 40 +++
 .../net/wireless/realtek/rtlwifi/rtl8192se/led.c   |  6 +--
 .../net/wireless/realtek/rtlwifi/rtl8192se/phy.c   | 36 ++---
 .../net/wireless/realtek/rtlwifi/rtl8192se/rf.c|  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8192se/sw.c|  8 ++--
 6 files changed, 51 insertions(+), 88 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/fw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/fw.c
index 32f9207..1922e78 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/fw.c
@@ -113,8 +113,7 @@ static u8 _rtl92s_firmware_header_map_rftype(struct 
ieee80211_hw *hw)
case RF_2T2R:
return 0x22;
default:
-   RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, "Unknown RF type(%x)\n",
-rtlphy->rf_type);
+   pr_err("rtl8192se: Unknown RF type(%x)\n", rtlphy->rf_type);
break;
}
return 0x22;
@@ -168,9 +167,7 @@ static bool _rtl92s_firmware_downloadcode(struct 
ieee80211_hw *hw,
_rtl92s_fw_set_rqpn(hw);
 
if (buffer_len >= MAX_FIRMWARE_CODE_SIZE) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Size over FIRMWARE_CODE_SIZE!\n");
-
+   pr_err("rtl8192se: Size over FIRMWARE_CODE_SIZE!\n");
return false;
}
 
@@ -239,9 +236,8 @@ static bool _rtl92s_firmware_checkready(struct ieee80211_hw 
*hw,
} while (pollingcnt--);
 
if (!(cpustatus & IMEM_CHK_RPT) || (pollingcnt <= 0)) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"FW_STATUS_LOAD_IMEM FAIL CPU, Status=%x\n",
-cpustatus);
+   pr_err("rtl8192se: FW_STATUS_LOAD_IMEM FAIL CPU, 
Status=%x\n",
+  cpustatus);
goto status_check_fail;
}
break;
@@ -257,17 +253,15 @@ static bool _rtl92s_firmware_checkready(struct 
ieee80211_hw *hw,
} while (pollingcnt--);
 
if (!(cpustatus & EMEM_CHK_RPT) || (pollingcnt <= 0)) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"FW_STATUS_LOAD_EMEM FAIL CPU, Status=%x\n",
-cpustatus);
+   pr_err("rtl8192se: FW_STATUS_LOAD_EMEM FAIL CPU, 
Status=%x\n",
+  cpustatus);
goto status_check_fail;
}
 
/* Turn On CPU */
rtstatus = _rtl92s_firmware_enable_cpu(hw);
if (!rtstatus) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Enable CPU fail!\n");
+   pr_err("rtl8192se: Enable CPU fail!\n");
goto status_check_fail;
}
break;
@@ -282,9 +276,8 @@ static bool _rtl92s_firmware_checkready(struct ieee80211_hw 
*hw,
} while (pollingcnt--);
 
if (!(cpustatus & DMEM_CODE_DONE) || (pollingcnt <= 0)) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Polling DMEM code done fail ! 
cpustatus(%#x)\n",
-cpustatus);
+   pr_err("rtl8192se: Polling DMEM code done fail ! 
cpustatus(%#x)\n",
+  cpustatus);
goto status_check_fail;
}
 
@@ -308,9 +301,8 @@ static bool _rtl92s_firmware_checkready(struct ieee80211_hw 
*hw,
 
if (((cpustatus & LOAD_FW_READY) != LOAD_FW_READY) ||
(pollingcnt <= 0)) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Polling Load Firmware ready fail ! 
cpustatus(%x)\n",
-cpustatus);
+   pr_err("rtl8192se: Polling Load Firmware ready fail ! 
cpustatus(%x)\n",
+  cpustatus);
goto status_check_fail;
}
 
@@ -331,8 +323,7 @@ static bool _rtl92s_firmware_checkready(struct ieee80211_hw 
*hw,
break;
 
default:
-   RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG,
-"Unknown status check!\n");
+   pr_err("rtl8192se: Unknown status check!\n");
rtstatus = false;
break;
}
@@ -380,8 +371,7 @@ int rtl92s_download_

[PATCH 11/14] rtlwifi: rtl8192ce: Remove all instances of DBG_EMERG

2016-12-10 Thread Larry Finger
This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
---
 .../net/wireless/realtek/rtlwifi/rtl8192ce/hw.c| 36 --
 .../net/wireless/realtek/rtlwifi/rtl8192ce/led.c   |  6 ++--
 .../net/wireless/realtek/rtlwifi/rtl8192ce/phy.c   | 13 +++-
 .../net/wireless/realtek/rtlwifi/rtl8192ce/rf.c|  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8192ce/sw.c|  8 ++---
 5 files changed, 24 insertions(+), 42 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c
index ce07e5c..410d48bf 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c
@@ -140,8 +140,7 @@ void rtl92ce_get_hw_reg(struct ieee80211_hw *hw, u8 
variable, u8 *val)
case HAL_DEF_WOWLAN:
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"switch case %#x not processed\n", variable);
+   pr_err("rtl8192ce: switch case %#x not processed\n", variable);
break;
}
 }
@@ -364,9 +363,8 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 
variable, u8 *val)
acm_ctrl &= (~AcmHw_VoqEn);
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"switch case %#x not 
processed\n",
-e_aci);
+   pr_err("rtl8192ce: switch case %#x not 
processed\n",
+  e_aci);
break;
}
}
@@ -551,8 +549,7 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 
variable, u8 *val)
rtl92c_fill_h2c_cmd(hw, H2C_92C_KEEP_ALIVE_CTRL, 2, array);
break; }
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"switch case %d not processed\n", variable);
+   pr_err("rtl8192ce: switch case %d not processed\n", variable);
break;
}
 }
@@ -573,9 +570,8 @@ static bool _rtl92ce_llt_write(struct ieee80211_hw *hw, u32 
address, u32 data)
break;
 
if (count > POLLING_LLT_THRESHOLD) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Failed to polling write LLT done at address 
%d!\n",
-address);
+   pr_err("rtl8192ce: Failed to polling write LLT done at 
address %d!\n",
+  address);
status = false;
break;
}
@@ -963,7 +959,7 @@ int rtl92ce_hw_init(struct ieee80211_hw *hw)
rtlpriv->intf_ops->disable_aspm(hw);
rtstatus = _rtl92ce_init_mac(hw);
if (!rtstatus) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Init MAC failed\n");
+   pr_err("rtl8192ce: Init MAC failed\n");
err = 1;
goto exit;
}
@@ -1128,8 +1124,7 @@ static enum version_8192c 
_rtl92ce_read_chip_version(struct ieee80211_hw *hw)
break;
}
 
-   RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG,
-"Chip Version ID: %s\n", versionid);
+   pr_info("Chip Version ID: %s\n", versionid);
 
switch (version & 0x3) {
case CHIP_88C:
@@ -1143,8 +1138,7 @@ static enum version_8192c 
_rtl92ce_read_chip_version(struct ieee80211_hw *hw)
break;
default:
rtlphy->rf_type = RF_1T1R;
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"ERROR RF_Type is set!!\n");
+   pr_err("rtl8192ce: ERROR RF_Type is set!!\n");
break;
}
 
@@ -1193,8 +1187,7 @@ static int _rtl92ce_set_media_status(struct ieee80211_hw 
*hw,
 "Set Network type to Mesh Point!\n");
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Network type %d not supported!\n", type);
+   pr_err("rtl8192ce: Network type %d not supported!\n", type);
return 1;
 
}
@@ -1780,7 +1773,7 @@ void rtl92ce_read_eeprom_info(struct ieee80211_hw *hw)
rtlefuse->autoload_failflag = false;
_rtl92ce_read_adapter_info(hw);
} else {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Autoload ERR!!\n");
+   pr_err("rtl8192ce: Autoload ERR!!\n");
}
_rtl92ce_hal_customized_behavior(hw);

[PATCH 04/14] rtlwifi: rtl8723be: Remove all instances of DBG_EMERG

2016-12-10 Thread Larry Finger
This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
---
 drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c  |  9 +++--
 drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c  | 16 ++--
 drivers/net/wireless/realtek/rtlwifi/rtl8723be/led.c |  6 ++
 drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c | 18 +++---
 drivers/net/wireless/realtek/rtlwifi/rtl8723be/rf.c  |  3 +--
 drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c  |  8 +++-
 6 files changed, 22 insertions(+), 38 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c
index f9a2c8b..89bba11 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c
@@ -97,8 +97,7 @@ static void _rtl8723be_fill_h2c_command(struct ieee80211_hw 
*hw, u8 element_id,
while (!bwrite_sucess) {
wait_writeh2c_limmit--;
if (wait_writeh2c_limmit == 0) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Write H2C fail because no trigger for FW 
INT!\n");
+   pr_err("rtl8723be:Write H2C fail because no trigger for 
FW INT!\n");
break;
}
 
@@ -121,8 +120,8 @@ static void _rtl8723be_fill_h2c_command(struct ieee80211_hw 
*hw, u8 element_id,
box_extreg = REG_HMEBOX_EXT_3;
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"switch case %#x not processed\n", boxnum);
+   pr_err("rtl8723be:switch case %#x not processed\n",
+  boxnum);
break;
}
 
@@ -194,8 +192,8 @@ static void _rtl8723be_fill_h2c_command(struct ieee80211_hw 
*hw, u8 element_id,
}
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"switch case %#x not processed\n", cmd_len);
+   pr_err("rtl8723be:switch case %#x not processed\n",
+  cmd_len);
break;
}
 
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c
index 0ae5562..2fb39f6 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c
@@ -747,9 +747,8 @@ static bool _rtl8723be_llt_write(struct ieee80211_hw *hw, 
u32 address, u32 data)
break;
 
if (count > POLLING_LLT_THRESHOLD) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Failed to polling write LLT done at address 
%d!\n",
-address);
+   pr_err("rtl8723be:Failed to polling write LLT done at 
address %d!\n",
+  address);
status = false;
break;
}
@@ -1383,7 +1382,7 @@ int rtl8723be_hw_init(struct ieee80211_hw *hw)
}
rtstatus = _rtl8723be_init_mac(hw);
if (!rtstatus) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Init MAC failed\n");
+   pr_err("rtl8723be:Init MAC failed\n");
err = 1;
goto exit;
}
@@ -1532,8 +1531,7 @@ static int _rtl8723be_set_media_status(struct 
ieee80211_hw *hw,
 "Set Network type to AP!\n");
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Network type %d not support!\n", type);
+   pr_err("rtl8723be:Network type %d not support!\n", type);
return 1;
}
 
@@ -2247,7 +2245,7 @@ void rtl8723be_read_eeprom_info(struct ieee80211_hw *hw)
rtlefuse->autoload_failflag = false;
_rtl8723be_read_adapter_info(hw, false);
} else {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Autoload ERR!!\n");
+   pr_err("rtl8723be:Autoload ERR!!\n");
}
_rtl8723be_hal_customized_behavior(hw);
 }
@@ -2584,9 +2582,7 @@ void rtl8723be_set_key(struct ieee80211_hw *hw, u32 
key_index,
entry_id = rtl_cam_get_free_entry(hw,
p_macaddr);
if (entry_id >=  TOTAL_CAM_ENTRY) {
-   RT_TRACE(rtlpriv, COMP_SEC,
-DBG_EMERG,
- 

[PATCH 04/14] rtlwifi_new: rtl8723be: Remove all instances of DBG_EMERG

2016-12-10 Thread Larry Finger
This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
---
 drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c  |  9 +++--
 drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c  | 16 ++--
 drivers/net/wireless/realtek/rtlwifi/rtl8723be/led.c |  6 ++
 drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c | 18 +++---
 drivers/net/wireless/realtek/rtlwifi/rtl8723be/rf.c  |  3 +--
 drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c  |  8 +++-
 6 files changed, 22 insertions(+), 38 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c
index 6b03c7f..71d1e89 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c
@@ -97,8 +97,7 @@ static void _rtl8723be_fill_h2c_command(struct ieee80211_hw 
*hw, u8 element_id,
while (!bwrite_sucess) {
wait_writeh2c_limmit--;
if (wait_writeh2c_limmit == 0) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Write H2C fail because no trigger for FW 
INT!\n");
+   pr_err("Write H2C fail because no trigger for FW 
INT!\n");
break;
}
 
@@ -121,8 +120,7 @@ static void _rtl8723be_fill_h2c_command(struct ieee80211_hw 
*hw, u8 element_id,
box_extreg = REG_HMEBOX_EXT_3;
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"switch case %#x not processed\n", boxnum);
+   pr_err("switch case %#x not processed\n", boxnum);
break;
}
 
@@ -194,8 +192,7 @@ static void _rtl8723be_fill_h2c_command(struct ieee80211_hw 
*hw, u8 element_id,
}
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"switch case %#x not processed\n", cmd_len);
+   pr_err("switch case %#x not processed\n", cmd_len);
break;
}
 
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c
index 56a1ae4..ae2a38e 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c
@@ -747,9 +747,8 @@ static bool _rtl8723be_llt_write(struct ieee80211_hw *hw, 
u32 address, u32 data)
break;
 
if (count > POLLING_LLT_THRESHOLD) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Failed to polling write LLT done at address 
%d!\n",
-address);
+   pr_err("Failed to polling write LLT done at address 
%d!\n",
+  address);
status = false;
break;
}
@@ -1383,7 +1382,7 @@ int rtl8723be_hw_init(struct ieee80211_hw *hw)
}
rtstatus = _rtl8723be_init_mac(hw);
if (!rtstatus) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Init MAC failed\n");
+   pr_err("Init MAC failed\n");
err = 1;
goto exit;
}
@@ -1532,8 +1531,7 @@ static int _rtl8723be_set_media_status(struct 
ieee80211_hw *hw,
 "Set Network type to AP!\n");
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Network type %d not support!\n", type);
+   pr_err("Network type %d not support!\n", type);
return 1;
}
 
@@ -2247,7 +2245,7 @@ void rtl8723be_read_eeprom_info(struct ieee80211_hw *hw)
rtlefuse->autoload_failflag = false;
_rtl8723be_read_adapter_info(hw, false);
} else {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Autoload ERR!!\n");
+   pr_err("Autoload ERR!!\n");
}
_rtl8723be_hal_customized_behavior(hw);
 }
@@ -2584,9 +2582,7 @@ void rtl8723be_set_key(struct ieee80211_hw *hw, u32 
key_index,
entry_id = rtl_cam_get_free_entry(hw,
p_macaddr);
if (entry_id >=  TOTAL_CAM_ENTRY) {
-   RT_TRACE(rtlpriv, COMP_SEC,
-DBG_EMERG,
-"Can not find free hw 
security cam entry\n");
+ 

[PATCH 06/14] rtlwifi_new: rtl8192ee: Remove all instances of DBG_EMERG

2016-12-10 Thread Larry Finger
This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
---
 .../net/wireless/realtek/rtlwifi/rtl8192ee/fw.c| 21 -
 .../net/wireless/realtek/rtlwifi/rtl8192ee/hw.c| 11 ---
 .../net/wireless/realtek/rtlwifi/rtl8192ee/phy.c   | 22 +-
 .../net/wireless/realtek/rtlwifi/rtl8192ee/rf.c|  3 +--
 .../net/wireless/realtek/rtlwifi/rtl8192ee/sw.c|  8 +++-
 5 files changed, 25 insertions(+), 40 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c
index 9dfd74b..2959746 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c
@@ -122,10 +122,8 @@ static void _rtl92ee_write_fw(struct ieee80211_hw *hw,
pagenums = size / FW_8192C_PAGE_SIZE;
remainsize = size % FW_8192C_PAGE_SIZE;
 
-   if (pagenums > 8) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Page numbers should not greater then 8\n");
-   }
+   if (pagenums > 8)
+   pr_err("Page numbers should not greater then 8\n");
 
for (page = 0; page < pagenums; page++) {
offset = page * FW_8192C_PAGE_SIZE;
@@ -155,14 +153,13 @@ static int _rtl92ee_fw_free_to_go(struct ieee80211_hw *hw)
 (!(value32 & FWDL_CHKSUM_RPT)));
 
if (counter >= FW_8192C_POLLING_TIMEOUT_COUNT) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"chksum report faill ! REG_MCUFWDL:0x%08x .\n",
- value32);
+   pr_err("chksum report fail! REG_MCUFWDL:0x%08x\n",
+  value32);
goto exit;
}
 
RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
-"Checksum report OK ! REG_MCUFWDL:0x%08x .\n", value32);
+"Checksum report OK! REG_MCUFWDL:0x%08x\n", value32);
 
value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL);
value32 |= MCUFWDL_RDY;
@@ -186,9 +183,8 @@ static int _rtl92ee_fw_free_to_go(struct ieee80211_hw *hw)
 
} while (counter++ < FW_8192C_POLLING_TIMEOUT_COUNT);
 
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Polling FW ready fail!! REG_MCUFWDL:0x%08x. count = %d\n",
-value32, counter);
+   pr_err("Polling FW ready fail!! REG_MCUFWDL:0x%08x. count = %d\n",
+  value32, counter);
 
 exit:
return err;
@@ -241,8 +237,7 @@ int rtl92ee_download_fw(struct ieee80211_hw *hw, bool 
buse_wake_on_wlan_fw)
 
err = _rtl92ee_fw_free_to_go(hw);
if (err) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Firmware is not ready to run!\n");
+   pr_err("Firmware is not ready to run!\n");
} else {
RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD ,
 "Firmware is ready to run!\n");
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/hw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/hw.c
index 00b211b..f731f96 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/hw.c
@@ -1320,7 +1320,7 @@ int rtl92ee_hw_init(struct ieee80211_hw *hw)
rtl_write_byte(rtlpriv, 0x65, 1);
}
if (!rtstatus) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Init MAC failed\n");
+   pr_err("Init MAC failed\n");
err = 1;
return err;
}
@@ -1485,8 +1485,7 @@ static int _rtl92ee_set_media_status(struct ieee80211_hw 
*hw,
 "Set Network type to AP!\n");
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Network type %d not support!\n", type);
+   pr_err("Network type %d not support!\n", type);
return 1;
}
 
@@ -2206,7 +2205,7 @@ void rtl92ee_read_eeprom_info(struct ieee80211_hw *hw)
rtlefuse->autoload_failflag = false;
_rtl92ee_read_adapter_info(hw);
} else {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Autoload ERR!!\n");
+   pr_err("Autoload ERR!!\n");
}
_rtl92ee_hal_customized_behavior(hw);
 
@@ -2484,9 +2483,7 @@ void rtl92ee_set_key(struct ieee80211_hw *hw, u32 
key_index,
entry_id = rtl_cam_get_free_entry(hw,
 p_macaddr);
if (entry_id >=  TOTAL_CAM_ENTRY) {
-   RT_TRACE(rtlpriv, COMP_SEC,
-DBG_EMERG,
-   

[PATCH 07/14] rtlwifi_new: rtl8723-common: Remove all instances of DBG_EMERG

2016-12-10 Thread Larry Finger
This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
---
 .../net/wireless/realtek/rtlwifi/rtl8723com/fw_common.c  | 16 ++--
 .../net/wireless/realtek/rtlwifi/rtl8723com/phy_common.c |  4 ++--
 2 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723com/fw_common.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8723com/fw_common.c
index 108475e..a9cc67e 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723com/fw_common.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723com/fw_common.c
@@ -129,8 +129,7 @@ void rtl8723_write_fw(struct ieee80211_hw *hw,
remain_size = size % FW_8192C_PAGE_SIZE;
 
if (page_nums > max_page) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Page numbers should not greater than %d\n", max_page);
+   pr_err("Page numbers should not greater than %d\n", max_page);
}
for (page = 0; page < page_nums; page++) {
offset = page * FW_8192C_PAGE_SIZE;
@@ -209,9 +208,8 @@ int rtl8723_fw_free_to_go(struct ieee80211_hw *hw, bool 
is_8723be,
 (!(value32 & FWDL_CHKSUM_RPT)));
 
if (counter >= max_count) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"chksum report fail ! REG_MCUFWDL:0x%08x .\n",
-value32);
+   pr_err("chksum report fail ! REG_MCUFWDL:0x%08x .\n",
+  value32);
goto exit;
}
RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
@@ -239,9 +237,8 @@ int rtl8723_fw_free_to_go(struct ieee80211_hw *hw, bool 
is_8723be,
 
} while (counter++ < max_count);
 
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Polling FW ready fail!! REG_MCUFWDL:0x%08x .\n",
-value32);
+   pr_err("Polling FW ready fail!! REG_MCUFWDL:0x%08x .\n",
+  value32);
 
 exit:
return err;
@@ -294,8 +291,7 @@ int rtl8723_download_fw(struct ieee80211_hw *hw,
 
err = rtl8723_fw_free_to_go(hw, is_8723be, max_count);
if (err) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Firmware is not ready to run!\n");
+   pr_err("Firmware is not ready to run!\n");
} else {
RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
 "Firmware is ready to run!\n");
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723com/phy_common.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8723com/phy_common.c
index 6b80ddc..7503cf7 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723com/phy_common.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723com/phy_common.c
@@ -99,7 +99,7 @@ u32 rtl8723_phy_rf_serial_read(struct ieee80211_hw *hw,
offset &= 0xff;
newoffset = offset;
if (RT_CANNOT_IO(hw)) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "return all one\n");
+   pr_err("return all one\n");
return 0x;
}
tmplong = rtl_get_bbreg(hw, RFPGA0_XA_HSSIPARAMETER2, MASKDWORD);
@@ -147,7 +147,7 @@ void rtl8723_phy_rf_serial_write(struct ieee80211_hw *hw,
struct bb_reg_def *pphyreg = &rtlphy->phyreg_def[rfpath];
 
if (RT_CANNOT_IO(hw)) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "stop\n");
+   pr_err("rtl8723: stop\n");
return;
}
offset &= 0xff;
-- 
2.10.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 09/14] rtlwifi_new: rtl8192de: Remove all instances of DBG_EMERG

2016-12-10 Thread Larry Finger
This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
---
 .../net/wireless/realtek/rtlwifi/rtl8192de/fw.c| 19 
 .../net/wireless/realtek/rtlwifi/rtl8192de/hw.c| 34 --
 .../net/wireless/realtek/rtlwifi/rtl8192de/led.c   |  6 ++--
 .../net/wireless/realtek/rtlwifi/rtl8192de/phy.c   | 31 
 .../net/wireless/realtek/rtlwifi/rtl8192de/rf.c|  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8192de/sw.c|  8 ++---
 6 files changed, 36 insertions(+), 65 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c
index 452de25..5b33bed 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c
@@ -126,8 +126,7 @@ static void _rtl92d_write_fw(struct ieee80211_hw *hw,
pagenums = size / FW_8192D_PAGE_SIZE;
remainSize = size % FW_8192D_PAGE_SIZE;
if (pagenums > 8) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Page numbers should not greater then 8\n");
+   pr_err("Page numbers should not greater then 8\n");
}
for (page = 0; page < pagenums; page++) {
offset = page * FW_8192D_PAGE_SIZE;
@@ -153,9 +152,7 @@ static int _rtl92d_fw_free_to_go(struct ieee80211_hw *hw)
} while ((counter++ < FW_8192D_POLLING_TIMEOUT_COUNT) &&
 (!(value32 & FWDL_ChkSum_rpt)));
if (counter >= FW_8192D_POLLING_TIMEOUT_COUNT) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"chksum report faill ! REG_MCUFWDL:0x%08x\n",
-value32);
+   pr_err("chksum report fail! REG_MCUFWDL:0x%08x\n", value32);
return -EIO;
}
RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
@@ -327,8 +324,7 @@ int rtl92d_download_fw(struct ieee80211_hw *hw)
rtl_write_byte(rtlpriv, 0x1f, value);
spin_unlock_irqrestore(&globalmutex_for_fwdownload, flags);
if (err) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"fw is not ready to run!\n");
+   pr_err("fw is not ready to run!\n");
goto exit;
} else {
RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE, "fw is ready to run!\n");
@@ -407,8 +403,7 @@ static void _rtl92d_fill_h2c_command(struct ieee80211_hw 
*hw,
while (!bwrite_success) {
wait_writeh2c_limmit--;
if (wait_writeh2c_limmit == 0) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Write H2C fail because no trigger for FW 
INT!\n");
+   pr_err("Write H2C fail because no trigger for FW 
INT!\n");
break;
}
boxnum = rtlhal->last_hmeboxnum;
@@ -430,8 +425,7 @@ static void _rtl92d_fill_h2c_command(struct ieee80211_hw 
*hw,
box_extreg = REG_HMEBOX_EXT_3;
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"switch case %#x not processed\n", boxnum);
+   pr_err("switch case %#x not processed\n", boxnum);
break;
}
isfw_read = _rtl92d_check_fw_read_last_h2c(hw, boxnum);
@@ -507,8 +501,7 @@ static void _rtl92d_fill_h2c_command(struct ieee80211_hw 
*hw,
   boxcontent[idx]);
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"switch case %#x not processed\n", cmd_len);
+   pr_err("switch case %#x not processed\n", cmd_len);
break;
}
bwrite_success = true;
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c
index fcb14c5..2c92c33 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c
@@ -163,8 +163,7 @@ void rtl92de_get_hw_reg(struct ieee80211_hw *hw, u8 
variable, u8 *val)
case HAL_DEF_WOWLAN:
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"switch case %#x not processed\n", variable);
+   pr_err("switch case %#x not processed\n", variable);
break;
}
 }
@@ -358,9 +357,8 @@ void rtl92de_set_hw_reg(struct ieee80211_hw *hw, u8 
variable, u8 *val)
acm_ctrl &= (~ACMHW_VOQEN);
break;
default:
-

[PATCH 05/14] rtlwifi_new: rtl8723ae: Remove all instances of DBG_EMERG

2016-12-10 Thread Larry Finger
This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
---
 drivers/net/wireless/realtek/rtlwifi/rtl8723ae/fw.c  |  9 +++--
 drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c  | 19 +++
 drivers/net/wireless/realtek/rtlwifi/rtl8723ae/led.c |  6 ++
 drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c | 18 +++---
 drivers/net/wireless/realtek/rtlwifi/rtl8723ae/rf.c  |  3 +--
 drivers/net/wireless/realtek/rtlwifi/rtl8723ae/sw.c  |  8 +++-
 6 files changed, 23 insertions(+), 40 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/fw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/fw.c
index 164a27e..25a950e 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/fw.c
@@ -99,8 +99,7 @@ static void _rtl8723e_fill_h2c_command(struct ieee80211_hw 
*hw, u8 element_id,
while (!bwrite_sucess) {
wait_writeh2c_limmit--;
if (wait_writeh2c_limmit == 0) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Write H2C fail because no trigger for FW 
INT!\n");
+   pr_err("Write H2C fail because no trigger for FW 
INT!\n");
break;
}
 
@@ -123,8 +122,7 @@ static void _rtl8723e_fill_h2c_command(struct ieee80211_hw 
*hw, u8 element_id,
box_extreg = REG_HMEBOX_EXT_3;
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"switch case %#x not processed\n", boxnum);
+   pr_err("switch case %#x not processed\n", boxnum);
break;
}
 
@@ -229,8 +227,7 @@ static void _rtl8723e_fill_h2c_command(struct ieee80211_hw 
*hw, u8 element_id,
}
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"switch case %#x not processed\n", cmd_len);
+   pr_err("switch case %#x not processed\n", cmd_len);
break;
}
 
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
index e0da8dc..bb9de2f 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
@@ -570,9 +570,8 @@ static bool _rtl8723e_llt_write(struct ieee80211_hw *hw, 
u32 address, u32 data)
break;
 
if (count > POLLING_LLT_THRESHOLD) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Failed to polling write LLT done at address 
%d!\n",
-address);
+   pr_err("Failed to polling write LLT done at address 
%d!\n",
+  address);
status = false;
break;
}
@@ -961,7 +960,7 @@ int rtl8723e_hw_init(struct ieee80211_hw *hw)
rtlpriv->intf_ops->disable_aspm(hw);
rtstatus = _rtl8712e_init_mac(hw);
if (rtstatus != true) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Init MAC failed\n");
+   pr_err("Init MAC failed\n");
err = 1;
goto exit;
}
@@ -1107,8 +1106,7 @@ static enum version_8723e 
_rtl8723e_read_chip_version(struct ieee80211_hw *hw)
 "Chip Version ID: 
VERSION_NORMAL_UMC_CHIP_8723_1T1R_B_CUT.\n");
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Chip Version ID: Unknown. Bug?\n");
+   pr_err("Chip Version ID: Unknown. Bug?\n");
break;
}
 
@@ -1157,8 +1155,7 @@ static int _rtl8723e_set_media_status(struct ieee80211_hw 
*hw,
"Set Network type to AP!\n");
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-   "Network type %d not support!\n", type);
+   pr_err("Network type %d not support!\n", type);
return 1;
break;
}
@@ -1852,7 +1849,7 @@ void rtl8723e_read_eeprom_info(struct ieee80211_hw *hw)
} else {
rtlefuse->autoload_failflag = true;
_rtl8723e_read_adapter_info(hw, false);
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Autoload ERR!!\n");
+   pr_err("Autoload ERR!!\n");
}
_rtl8723e_hal_customized_behavior(hw);
 }
@@ -2245,9 +2242,7 @@ void rtl8723e_set_key(struct ieee80211_hw *hw, u32 
key_index,
  

[PATCH 13/14] rtlwifi: rtl8188ee: Remove all instances of DBG_EMERG

2016-12-10 Thread Larry Finger
This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
---
 .../net/wireless/realtek/rtlwifi/rtl8188ee/fw.c| 33 ++
 .../net/wireless/realtek/rtlwifi/rtl8188ee/hw.c| 30 
 .../net/wireless/realtek/rtlwifi/rtl8188ee/phy.c   | 22 ++-
 .../net/wireless/realtek/rtlwifi/rtl8188ee/rf.c|  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8188ee/sw.c|  8 ++
 5 files changed, 33 insertions(+), 63 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c
index c34cde2..009fd3b 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c
@@ -125,10 +125,8 @@ static void _rtl88e_write_fw(struct ieee80211_hw *hw,
pagenums = size / FW_8192C_PAGE_SIZE;
remainsize = size % FW_8192C_PAGE_SIZE;
 
-   if (pagenums > 8) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Page numbers should not greater then 8\n");
-   }
+   if (pagenums > 8)
+   pr_err("rtl8188ee: Page numbers should not greater then 8\n");
 
for (page = 0; page < pagenums; page++) {
offset = page * FW_8192C_PAGE_SIZE;
@@ -157,15 +155,10 @@ static int _rtl88e_fw_free_to_go(struct ieee80211_hw *hw)
 (!(value32 & FWDL_CHKSUM_RPT)));
 
if (counter >= FW_8192C_POLLING_TIMEOUT_COUNT) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"chksum report faill ! REG_MCUFWDL:0x%08x .\n",
- value32);
+   pr_err("rtl8188ee: chksum report fail! REG_MCUFWDL:0x%08x .\n",
+  value32);
goto exit;
}
-
-   RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
-"Checksum report OK ! REG_MCUFWDL:0x%08x .\n", value32);
-
value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL);
value32 |= MCUFWDL_RDY;
value32 &= ~WINTINI_RDY;
@@ -176,20 +169,15 @@ static int _rtl88e_fw_free_to_go(struct ieee80211_hw *hw)
 
do {
value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL);
-   if (value32 & WINTINI_RDY) {
-   RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
-"Polling FW ready success!! 
REG_MCUFWDL:0x%08x.\n",
- value32);
-   err = 0;
-   goto exit;
-   }
+   if (value32 & WINTINI_RDY)
+   return 0;
 
udelay(FW_8192C_POLLING_DELAY);
 
} while (counter++ < FW_8192C_POLLING_TIMEOUT_COUNT);
 
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Polling FW ready fail!! REG_MCUFWDL:0x%08x .\n", value32);
+   pr_err("rtl8188ee: Polling FW ready fail!! REG_MCUFWDL:0x%08x .\n",
+  value32);
 
 exit:
return err;
@@ -235,8 +222,7 @@ int rtl88e_download_fw(struct ieee80211_hw *hw,
 
err = _rtl88e_fw_free_to_go(hw);
if (err) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Firmware is not ready to run!\n");
+   pr_err("rtl8188ee: Firmware is not ready to run!\n");
} else {
RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD,
 "Firmware is ready to run!\n");
@@ -309,8 +295,7 @@ static void _rtl88e_fill_h2c_command(struct ieee80211_hw 
*hw,
while (!write_sucess) {
wait_writeh2c_limit--;
if (wait_writeh2c_limit == 0) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Write H2C fail because no trigger for FW 
INT!\n");
+   pr_err("rtl8188ee: Write H2C fail because no trigger 
for FW INT!\n");
break;
}
 
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
index d85fa67..6aa593d 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
@@ -358,8 +358,7 @@ void rtl88ee_get_hw_reg(struct ieee80211_hw *hw, u8 
variable, u8 *val)
case HAL_DEF_WOWLAN:
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"switch case %#x not processed\n", variable);
+   pr_err("rtl8188ee: switch case %#x not processed\n", variable);
break;
}
 }
@@ -572,9 +571,8 @@ void rtl88ee_set_hw_reg(struct ieee80211_hw *hw, u8 
variable, u8 *val)
acm_ctrl &= (~ACMHW_VOQEN);
break;
default:
- 

[PATCH 09/14] rtlwifi: rtl8192de: Remove all instances of DBG_EMERG

2016-12-10 Thread Larry Finger
This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
---
 .../net/wireless/realtek/rtlwifi/rtl8192de/fw.c| 19 
 .../net/wireless/realtek/rtlwifi/rtl8192de/hw.c| 34 --
 .../net/wireless/realtek/rtlwifi/rtl8192de/led.c   |  6 ++--
 .../net/wireless/realtek/rtlwifi/rtl8192de/phy.c   | 31 
 .../net/wireless/realtek/rtlwifi/rtl8192de/rf.c|  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8192de/sw.c|  8 ++---
 6 files changed, 36 insertions(+), 65 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c
index ddbb7e8..ed6aba0 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c
@@ -126,8 +126,7 @@ static void _rtl92d_write_fw(struct ieee80211_hw *hw,
pagenums = size / FW_8192D_PAGE_SIZE;
remainSize = size % FW_8192D_PAGE_SIZE;
if (pagenums > 8) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Page numbers should not greater then 8\n");
+   pr_err("rtl8192de: Page numbers should not greater then 8\n");
}
for (page = 0; page < pagenums; page++) {
offset = page * FW_8192D_PAGE_SIZE;
@@ -153,9 +152,8 @@ static int _rtl92d_fw_free_to_go(struct ieee80211_hw *hw)
} while ((counter++ < FW_8192D_POLLING_TIMEOUT_COUNT) &&
 (!(value32 & FWDL_ChkSum_rpt)));
if (counter >= FW_8192D_POLLING_TIMEOUT_COUNT) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"chksum report faill ! REG_MCUFWDL:0x%08x\n",
-value32);
+   pr_err("rtl8192de: chksum report fail! REG_MCUFWDL:0x%08x\n",
+  value32);
return -EIO;
}
RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
@@ -327,8 +324,7 @@ int rtl92d_download_fw(struct ieee80211_hw *hw)
rtl_write_byte(rtlpriv, 0x1f, value);
spin_unlock_irqrestore(&globalmutex_for_fwdownload, flags);
if (err) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"fw is not ready to run!\n");
+   pr_err("rtl8192de: fw is not ready to run!\n");
goto exit;
} else {
RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE, "fw is ready to run!\n");
@@ -407,8 +403,7 @@ static void _rtl92d_fill_h2c_command(struct ieee80211_hw 
*hw,
while (!bwrite_success) {
wait_writeh2c_limmit--;
if (wait_writeh2c_limmit == 0) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Write H2C fail because no trigger for FW 
INT!\n");
+   pr_err("rtl8192de: Write H2C fail because no trigger 
for FW INT!\n");
break;
}
boxnum = rtlhal->last_hmeboxnum;
@@ -430,8 +425,8 @@ static void _rtl92d_fill_h2c_command(struct ieee80211_hw 
*hw,
box_extreg = REG_HMEBOX_EXT_3;
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"switch case %#x not processed\n", boxnum);
+   pr_err("rtl8192de: switch case %#x not processed\n",
+  boxnum);
break;
}
isfw_read = _rtl92d_check_fw_read_last_h2c(hw, boxnum);
@@ -507,8 +501,8 @@ static void _rtl92d_fill_h2c_command(struct ieee80211_hw 
*hw,
   boxcontent[idx]);
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"switch case %#x not processed\n", cmd_len);
+   pr_err("rtl8192de: switch case %#x not processed\n",
+  cmd_len);
break;
}
bwrite_success = true;
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c
index fcb14c5..2c92c33 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/hw.c
@@ -163,8 +163,7 @@ void rtl92de_get_hw_reg(struct ieee80211_hw *hw, u8 
variable, u8 *val)
case HAL_DEF_WOWLAN:
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"switch case %#x not processed\n", variable);
+   pr_err("rtl8192de: switch case %#x not processed\n", variable);
break;
}
 }
@@ -358,9 +357,8 @@ void rtl92de_set_hw_reg(struct ieee80211_hw

[PATCH 07/14] rtlwifi: rtl8723-common: Remove all instances of DBG_EMERG

2016-12-10 Thread Larry Finger
This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
---
 .../net/wireless/realtek/rtlwifi/rtl8723com/fw_common.c  | 16 ++--
 .../net/wireless/realtek/rtlwifi/rtl8723com/phy_common.c |  4 ++--
 2 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723com/fw_common.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8723com/fw_common.c
index 108475e..a9cc67e 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723com/fw_common.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723com/fw_common.c
@@ -129,8 +129,8 @@ void rtl8723_write_fw(struct ieee80211_hw *hw,
remain_size = size % FW_8192C_PAGE_SIZE;
 
if (page_nums > max_page) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Page numbers should not greater than %d\n", max_page);
+   pr_err("rtl8723-common: Page numbers should not greater than 
%d\n",
+  max_page);
}
for (page = 0; page < page_nums; page++) {
offset = page * FW_8192C_PAGE_SIZE;
@@ -209,9 +208,8 @@ int rtl8723_fw_free_to_go(struct ieee80211_hw *hw, bool 
is_8723be,
 (!(value32 & FWDL_CHKSUM_RPT)));
 
if (counter >= max_count) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"chksum report fail ! REG_MCUFWDL:0x%08x .\n",
-value32);
+   pr_err("rtl8723-common: chksum report fail ! REG_MCUFWDL:0x%08x 
.\n",
+  value32);
goto exit;
}
RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
@@ -239,9 +237,8 @@ int rtl8723_fw_free_to_go(struct ieee80211_hw *hw, bool 
is_8723be,
 
} while (counter++ < max_count);
 
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Polling FW ready fail!! REG_MCUFWDL:0x%08x .\n",
-value32);
+   pr_err("rtl8723-common: Polling FW ready fail!! REG_MCUFWDL:0x%08x .\n",
+  value32);
 
 exit:
return err;
@@ -294,8 +291,7 @@ int rtl8723_download_fw(struct ieee80211_hw *hw,
 
err = rtl8723_fw_free_to_go(hw, is_8723be, max_count);
if (err) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Firmware is not ready to run!\n");
+   pr_err("rtl8723-common: Firmware is not ready to run!\n");
} else {
RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
 "Firmware is ready to run!\n");
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723com/phy_common.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8723com/phy_common.c
index 0adae58..91a1ef0 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723com/phy_common.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723com/phy_common.c
@@ -99,7 +99,7 @@ u32 rtl8723_phy_rf_serial_read(struct ieee80211_hw *hw,
offset &= 0xff;
newoffset = offset;
if (RT_CANNOT_IO(hw)) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "return all one\n");
+   pr_err("rtl8723-common: return all one\n");
return 0x;
}
tmplong = rtl_get_bbreg(hw, RFPGA0_XA_HSSIPARAMETER2, MASKDWORD);
@@ -147,7 +147,7 @@ void rtl8723_phy_rf_serial_write(struct ieee80211_hw *hw,
struct bb_reg_def *pphyreg = &rtlphy->phyreg_def[rfpath];
 
if (RT_CANNOT_IO(hw)) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "stop\n");
+   pr_err("rtl8723-common: rtl8723: stop\n");
return;
}
offset &= 0xff;
-- 
2.10.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 08/14] rtlwifi_new: rtl8192se: Remove all instances of DBG_EMERG

2016-12-10 Thread Larry Finger
This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
---
 .../net/wireless/realtek/rtlwifi/rtl8192se/fw.c| 46 --
 .../net/wireless/realtek/rtlwifi/rtl8192se/hw.c| 40 +++
 .../net/wireless/realtek/rtlwifi/rtl8192se/led.c   |  6 +--
 .../net/wireless/realtek/rtlwifi/rtl8192se/phy.c   | 36 ++---
 .../net/wireless/realtek/rtlwifi/rtl8192se/rf.c|  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8192se/sw.c|  8 ++--
 6 files changed, 51 insertions(+), 88 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/fw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/fw.c
index 32f9207..1922e78 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/fw.c
@@ -113,8 +113,7 @@ static u8 _rtl92s_firmware_header_map_rftype(struct 
ieee80211_hw *hw)
case RF_2T2R:
return 0x22;
default:
-   RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, "Unknown RF type(%x)\n",
-rtlphy->rf_type);
+   pr_err("Unknown RF type(%x)\n", rtlphy->rf_type);
break;
}
return 0x22;
@@ -168,9 +167,7 @@ static bool _rtl92s_firmware_downloadcode(struct 
ieee80211_hw *hw,
_rtl92s_fw_set_rqpn(hw);
 
if (buffer_len >= MAX_FIRMWARE_CODE_SIZE) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Size over FIRMWARE_CODE_SIZE!\n");
-
+   pr_err("Size over FIRMWARE_CODE_SIZE!\n");
return false;
}
 
@@ -239,9 +236,8 @@ static bool _rtl92s_firmware_checkready(struct ieee80211_hw 
*hw,
} while (pollingcnt--);
 
if (!(cpustatus & IMEM_CHK_RPT) || (pollingcnt <= 0)) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"FW_STATUS_LOAD_IMEM FAIL CPU, Status=%x\n",
-cpustatus);
+   pr_err("FW_STATUS_LOAD_IMEM FAIL CPU, Status=%x\n",
+  cpustatus);
goto status_check_fail;
}
break;
@@ -257,17 +253,15 @@ static bool _rtl92s_firmware_checkready(struct 
ieee80211_hw *hw,
} while (pollingcnt--);
 
if (!(cpustatus & EMEM_CHK_RPT) || (pollingcnt <= 0)) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"FW_STATUS_LOAD_EMEM FAIL CPU, Status=%x\n",
-cpustatus);
+   pr_err("FW_STATUS_LOAD_EMEM FAIL CPU, Status=%x\n",
+  cpustatus);
goto status_check_fail;
}
 
/* Turn On CPU */
rtstatus = _rtl92s_firmware_enable_cpu(hw);
if (!rtstatus) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Enable CPU fail!\n");
+   pr_err("Enable CPU fail!\n");
goto status_check_fail;
}
break;
@@ -282,9 +276,8 @@ static bool _rtl92s_firmware_checkready(struct ieee80211_hw 
*hw,
} while (pollingcnt--);
 
if (!(cpustatus & DMEM_CODE_DONE) || (pollingcnt <= 0)) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Polling DMEM code done fail ! 
cpustatus(%#x)\n",
-cpustatus);
+   pr_err("Polling DMEM code done fail ! cpustatus(%#x)\n",
+  cpustatus);
goto status_check_fail;
}
 
@@ -308,9 +301,8 @@ static bool _rtl92s_firmware_checkready(struct ieee80211_hw 
*hw,
 
if (((cpustatus & LOAD_FW_READY) != LOAD_FW_READY) ||
(pollingcnt <= 0)) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Polling Load Firmware ready fail ! 
cpustatus(%x)\n",
-cpustatus);
+   pr_err("Polling Load Firmware ready fail ! 
cpustatus(%x)\n",
+  cpustatus);
goto status_check_fail;
}
 
@@ -331,8 +323,7 @@ static bool _rtl92s_firmware_checkready(struct ieee80211_hw 
*hw,
break;
 
default:
-   RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG,
-"Unknown status check!\n");
+   pr_err("Unknown status check!\n");
rtstatus = false;
break;
}
@@ -380,8 +371,7 @@ int rtl92s_download_fw(struct ieee80211_hw *hw)
/* 2. Retrieve IMEM image. */
if ((pfwheader->i

[PATCH 10/14] rtlwifi_new: rtl8192cu: Remove all instances of DBG_EMERG

2016-12-10 Thread Larry Finger
This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
---
 .../net/wireless/realtek/rtlwifi/rtl8192cu/hw.c| 33 --
 .../net/wireless/realtek/rtlwifi/rtl8192cu/led.c   |  6 ++--
 .../net/wireless/realtek/rtlwifi/rtl8192cu/mac.c   | 12 +++-
 .../net/wireless/realtek/rtlwifi/rtl8192cu/phy.c   | 12 +++-
 .../net/wireless/realtek/rtlwifi/rtl8192cu/rf.c|  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8192cu/sw.c|  5 ++--
 6 files changed, 24 insertions(+), 47 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
index ddfcf994..9db6ec6 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
@@ -452,8 +452,7 @@ static int _rtl92cu_init_power_on(struct ieee80211_hw *hw)
break;
}
if (pollingCount++ > 100) {
-   RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG,
-"Failed to polling REG_APS_FSMCO[PFM_ALDN] 
done!\n");
+   pr_err("Failed to polling REG_APS_FSMCO[PFM_ALDN] 
done!\n");
return -ENODEV;
}
} while (true);
@@ -486,8 +485,7 @@ static int _rtl92cu_init_power_on(struct ieee80211_hw *hw)
break;
}
if (pollingCount++ > 1000) {
-   RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG,
-"Failed to polling REG_APS_FSMCO[APFM_ONMAC] 
done!\n");
+   pr_err("Failed to polling REG_APS_FSMCO[APFM_ONMAC] 
done!\n");
return -ENODEV;
}
} while (true);
@@ -687,7 +685,6 @@ static void 
_rtl92cu_init_chipN_three_out_ep_priority(struct ieee80211_hw *hw,
  u8 queue_sel)
 {
u16 beQ, bkQ, viQ, voQ, mgtQ, hiQ;
-   struct rtl_priv *rtlpriv = rtl_priv(hw);
 
if (!wmm_enable) { /* typical setting */
beQ = QUEUE_LOW;
@@ -705,8 +702,7 @@ static void 
_rtl92cu_init_chipN_three_out_ep_priority(struct ieee80211_hw *hw,
hiQ = QUEUE_HIGH;
}
_rtl92c_init_chipN_reg_priority(hw, beQ, bkQ, viQ, voQ, mgtQ, hiQ);
-   RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, "Tx queue select :0x%02x..\n",
-queue_sel);
+   pr_info("Tx queue select :0x%02x..\n", queue_sel);
 }
 
 static void _rtl92cu_init_chipN_queue_priority(struct ieee80211_hw *hw,
@@ -765,8 +761,7 @@ static void _rtl92cu_init_chipT_queue_priority(struct 
ieee80211_hw *hw,
break;
}
rtl_write_byte(rtlpriv, (REG_TRXDMA_CTRL+1), hq_sele);
-   RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, "Tx queue select :0x%02x..\n",
-hq_sele);
+   pr_info("Tx queue select :0x%02x..\n", hq_sele);
 }
 
 static void _rtl92cu_init_queue_priority(struct ieee80211_hw *hw,
@@ -848,8 +843,7 @@ static int _rtl92cu_init_mac(struct ieee80211_hw *hw)
err = _rtl92cu_init_power_on(hw);
 
if (err) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Failed to init power on!\n");
+   pr_err("Failed to init power on!\n");
return err;
}
if (!wmm_enable) {
@@ -860,8 +854,7 @@ static int _rtl92cu_init_mac(struct ieee80211_hw *hw)
: WMM_CHIP_A_TX_PAGE_BOUNDARY;
}
if (false == rtl92c_init_llt_table(hw, boundary)) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Failed to init LLT Table!\n");
+   pr_err("Failed to init LLT Table!\n");
return -EINVAL;
}
_rtl92cu_init_queue_reserved_page(hw, wmm_enable, out_ep_nums,
@@ -986,7 +979,7 @@ int rtl92cu_hw_init(struct ieee80211_hw *hw)
rtlhal->hw_type = HARDWARE_TYPE_RTL8192CU;
err = _rtl92cu_init_mac(hw);
if (err) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "init mac failed!\n");
+   pr_err("init mac failed!\n");
goto exit;
}
err = rtl92c_download_fw(hw);
@@ -1099,8 +1092,7 @@ static void  _ResetDigitalProcedure1(struct ieee80211_hw 
*hw, bool bWithoutHWSM)
udelay(50);
}
if (retry_cnts >= 100) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"#=> 8051 reset 
failed!.\n");
+   pr_err("8051 reset 
failed!.\n");
/* if 8051 reset fail, reset MAC. */
  

[PATCH 14/14] rtlwifi: Remove some redundant code

2016-12-10 Thread Larry Finger
The symbol DBG_EMERG is no longer used and is removed.

In a number of places, the code has redundant messages. For example, if
the failure for the firmware to run is logged, it is not necessary to
log that the firmware has been started. In addition, extraneous braces are
removed.

Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
---
 drivers/net/wireless/realtek/rtlwifi/debug.h  |  2 +-
 drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c   |  6 +-
 .../net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c |  6 +-
 drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c   | 10 ++
 drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c   | 19 ++-
 .../wireless/realtek/rtlwifi/rtl8723com/fw_common.c   |  9 +
 drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c   | 15 +++
 7 files changed, 11 insertions(+), 56 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/debug.h 
b/drivers/net/wireless/realtek/rtlwifi/debug.h
index 51794bc..75596e2 100644
--- a/drivers/net/wireless/realtek/rtlwifi/debug.h
+++ b/drivers/net/wireless/realtek/rtlwifi/debug.h
@@ -36,7 +36,7 @@
  *unexpected HW behavior, HW BUG
  *and so on.
  */
-#define DBG_EMERG  0
+/*#define DBG_EMERG0 */
 
 /*
  *Abnormal, rare, or unexpeted cases.
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c
index 3ba2a3f..2e22759 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c
@@ -221,12 +221,8 @@ int rtl88e_download_fw(struct ieee80211_hw *hw,
_rtl88e_enable_fw_download(hw, false);
 
err = _rtl88e_fw_free_to_go(hw);
-   if (err) {
+   if (err)
pr_err("Firmware is not ready to run!\n");
-   } else {
-   RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD,
-"Firmware is ready to run!\n");
-   }
 
return 0;
 }
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c
index 5c93ee0..eb4459c 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c
@@ -237,12 +237,8 @@ int rtl92c_download_fw(struct ieee80211_hw *hw)
_rtl92c_enable_fw_download(hw, false);
 
err = _rtl92c_fw_free_to_go(hw);
-   if (err) {
+   if (err)
pr_err("Firmware is not ready to run!\n");
-   } else {
-   RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
-"Firmware is ready to run!\n");
-   }
 
return 0;
 }
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c
index 5b33bed..e647605 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c
@@ -125,9 +125,8 @@ static void _rtl92d_write_fw(struct ieee80211_hw *hw,
_rtl92d_fill_dummy(bufferPtr, &size);
pagenums = size / FW_8192D_PAGE_SIZE;
remainSize = size % FW_8192D_PAGE_SIZE;
-   if (pagenums > 8) {
+   if (pagenums > 8)
pr_err("Page numbers should not greater then 8\n");
-   }
for (page = 0; page < pagenums; page++) {
offset = page * FW_8192D_PAGE_SIZE;
_rtl92d_fw_page_write(hw, page, (bufferPtr + offset),
@@ -155,8 +154,6 @@ static int _rtl92d_fw_free_to_go(struct ieee80211_hw *hw)
pr_err("chksum report fail! REG_MCUFWDL:0x%08x\n", value32);
return -EIO;
}
-   RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
-"Checksum report OK ! REG_MCUFWDL:0x%08x\n", value32);
value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL);
value32 |= MCUFWDL_RDY;
rtl_write_dword(rtlpriv, REG_MCUFWDL, value32);
@@ -323,12 +320,9 @@ int rtl92d_download_fw(struct ieee80211_hw *hw)
value &= (~BIT(5));
rtl_write_byte(rtlpriv, 0x1f, value);
spin_unlock_irqrestore(&globalmutex_for_fwdownload, flags);
-   if (err) {
+   if (err)
pr_err("fw is not ready to run!\n");
goto exit;
-   } else {
-   RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE, "fw is ready to run!\n");
-   }
 exit:
err = _rtl92d_fw_init(hw);
return err;
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c
index 2959746..e05b181 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c
@@ -157,10 +157,6 @@ static int _rtl92ee_fw_free_to_go(struct ieee80211_hw *hw)
   value32);
goto exit;
}
-
-   RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
-"Checksum report OK! REG_MCUFWDL:0x%08x\n", value32);
-
val

[PATCH 13/14] rtlwifi_new: rtl8188ee: Remove all instances of DBG_EMERG

2016-12-10 Thread Larry Finger
This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
---
 .../net/wireless/realtek/rtlwifi/rtl8188ee/fw.c| 33 ++
 .../net/wireless/realtek/rtlwifi/rtl8188ee/hw.c| 30 
 .../net/wireless/realtek/rtlwifi/rtl8188ee/phy.c   | 22 ++-
 .../net/wireless/realtek/rtlwifi/rtl8188ee/rf.c|  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8188ee/sw.c|  8 ++
 5 files changed, 33 insertions(+), 63 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c
index fbd3eea..3ba2a3f 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c
@@ -125,10 +125,8 @@ static void _rtl88e_write_fw(struct ieee80211_hw *hw,
pagenums = size / FW_8192C_PAGE_SIZE;
remainsize = size % FW_8192C_PAGE_SIZE;
 
-   if (pagenums > 8) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Page numbers should not greater then 8\n");
-   }
+   if (pagenums > 8)
+   pr_err("Page numbers should not greater then 8\n");
 
for (page = 0; page < pagenums; page++) {
offset = page * FW_8192C_PAGE_SIZE;
@@ -157,15 +155,10 @@ static int _rtl88e_fw_free_to_go(struct ieee80211_hw *hw)
 (!(value32 & FWDL_CHKSUM_RPT)));
 
if (counter >= FW_8192C_POLLING_TIMEOUT_COUNT) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"chksum report faill ! REG_MCUFWDL:0x%08x .\n",
- value32);
+   pr_err("chksum report fail! REG_MCUFWDL:0x%08x .\n",
+  value32);
goto exit;
}
-
-   RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
-"Checksum report OK ! REG_MCUFWDL:0x%08x .\n", value32);
-
value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL);
value32 |= MCUFWDL_RDY;
value32 &= ~WINTINI_RDY;
@@ -176,20 +169,14 @@ static int _rtl88e_fw_free_to_go(struct ieee80211_hw *hw)
 
do {
value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL);
-   if (value32 & WINTINI_RDY) {
-   RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
-"Polling FW ready success!! 
REG_MCUFWDL:0x%08x.\n",
- value32);
-   err = 0;
-   goto exit;
-   }
+   if (value32 & WINTINI_RDY)
+   return 0;
 
udelay(FW_8192C_POLLING_DELAY);
 
} while (counter++ < FW_8192C_POLLING_TIMEOUT_COUNT);
 
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Polling FW ready fail!! REG_MCUFWDL:0x%08x .\n", value32);
+   pr_err("Polling FW ready fail!! REG_MCUFWDL:0x%08x .\n", value32);
 
 exit:
return err;
@@ -235,8 +222,7 @@ int rtl88e_download_fw(struct ieee80211_hw *hw,
 
err = _rtl88e_fw_free_to_go(hw);
if (err) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Firmware is not ready to run!\n");
+   pr_err("Firmware is not ready to run!\n");
} else {
RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD,
 "Firmware is ready to run!\n");
@@ -309,8 +295,7 @@ static void _rtl88e_fill_h2c_command(struct ieee80211_hw 
*hw,
while (!write_sucess) {
wait_writeh2c_limit--;
if (wait_writeh2c_limit == 0) {
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"Write H2C fail because no trigger for FW 
INT!\n");
+   pr_err("Write H2C fail because no trigger for FW 
INT!\n");
break;
}
 
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c 
b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
index 1a17dfe..0dc1293 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
@@ -358,8 +358,7 @@ void rtl88ee_get_hw_reg(struct ieee80211_hw *hw, u8 
variable, u8 *val)
case HAL_DEF_WOWLAN:
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-"switch case %#x not processed\n", variable);
+   pr_err("switch case %#x not processed\n", variable);
break;
}
 }
@@ -572,9 +571,8 @@ void rtl88ee_set_hw_reg(struct ieee80211_hw *hw, u8 
variable, u8 *val)
acm_ctrl &= (~ACMHW_VOQEN);
break;
default:
-   RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-