Re: [PATCH net-next 0/2] hv_netvsc: Implement NUMA aware memory allocation

2015-05-31 Thread David Miller
From: "K. Y. Srinivasan" 
Date: Thu, 28 May 2015 17:07:44 -0700

> Allocate both receive buffer and send buffer from the NUMA node assigned to 
> the
> primary channel.

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


[PATCH] staging: rtl8188eu: Kill dead calls to kill_pid()

2015-05-31 Thread Jakub Sitnicki
There is no interface to register PIDs of processes the driver should
send a signal to.  Remove it.

Signed-off-by: Jakub Sitnicki 
---
 drivers/staging/rtl8188eu/include/drv_types.h |  1 -
 drivers/staging/rtl8188eu/include/osdep_service.h |  2 --
 drivers/staging/rtl8188eu/include/rtw_ioctl.h |  2 --
 drivers/staging/rtl8188eu/os_dep/mlme_linux.c |  2 --
 drivers/staging/rtl8188eu/os_dep/usb_intf.c   | 12 
 5 files changed, 19 deletions(-)

diff --git a/drivers/staging/rtl8188eu/include/drv_types.h 
b/drivers/staging/rtl8188eu/include/drv_types.h
index c813179..bcc74dc 100644
--- a/drivers/staging/rtl8188eu/include/drv_types.h
+++ b/drivers/staging/rtl8188eu/include/drv_types.h
@@ -175,7 +175,6 @@ static inline struct device *dvobj_to_dev(struct dvobj_priv 
*dvobj)
 };
 
 struct adapter {
-   int pid[3];/* process id from UI, 0:wps, 1:hostapd, 2:dhcpcd */
u16 chip_type;
 
struct dvobj_priv *dvobj;
diff --git a/drivers/staging/rtl8188eu/include/osdep_service.h 
b/drivers/staging/rtl8188eu/include/osdep_service.h
index 515e949..00472e0 100644
--- a/drivers/staging/rtl8188eu/include/osdep_service.h
+++ b/drivers/staging/rtl8188eu/include/osdep_service.h
@@ -157,8 +157,6 @@ void rtw_free_netdev(struct net_device *netdev);
 #define FUNC_ADPT_FMT "%s(%s)"
 #define FUNC_ADPT_ARG(adapter) __func__, adapter->pnetdev->name
 
-#define rtw_signal_process(pid, sig) kill_pid(find_vpid((pid)), (sig), 1)
-
 u64 rtw_modular64(u64 x, u64 y);
 
 /* Macros for handling unaligned memory accesses */
diff --git a/drivers/staging/rtl8188eu/include/rtw_ioctl.h 
b/drivers/staging/rtl8188eu/include/rtw_ioctl.h
index f3aa924..ee2cb54 100644
--- a/drivers/staging/rtl8188eu/include/rtw_ioctl.h
+++ b/drivers/staging/rtl8188eu/include/rtw_ioctl.h
@@ -117,6 +117,4 @@ int drv_set_info(struct  net_device *MiniportAdapterContext,
 u32 informationbufferlength, u32 *bytesread,
 u32 *bytesneeded);
 
-extern int ui_pid[3];
-
 #endif /*  #ifndef __INC_CEINFO_ */
diff --git a/drivers/staging/rtl8188eu/os_dep/mlme_linux.c 
b/drivers/staging/rtl8188eu/os_dep/mlme_linux.c
index baff1e2..9099241 100644
--- a/drivers/staging/rtl8188eu/os_dep/mlme_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/mlme_linux.c
@@ -41,8 +41,6 @@ void rtw_os_indicate_connect(struct adapter *adapter)
 {
rtw_indicate_wx_assoc_event(adapter);
netif_carrier_on(adapter->pnetdev);
-   if (adapter->pid[2] != 0)
-   rtw_signal_process(adapter->pid[2], SIGALRM);
 }
 
 void rtw_os_indicate_scan_done(struct adapter *padapter, bool aborted)
diff --git a/drivers/staging/rtl8188eu/os_dep/usb_intf.c 
b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
index ef3c73e..d0d4335 100644
--- a/drivers/staging/rtl8188eu/os_dep/usb_intf.c
+++ b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
@@ -32,8 +32,6 @@
 #include 
 #include 
 
-int ui_pid[3] = {0, 0, 0};
-
 #define USB_VENDER_ID_REALTEK  0x0bda
 
 /* DID_USB_v916_20130116 */
@@ -330,11 +328,6 @@ static int rtw_resume_process(struct adapter *padapter)
 
_exit_pwrlock(&pwrpriv->lock);
 
-   if (padapter->pid[1] != 0) {
-   DBG_88E("pid[1]:%d\n", padapter->pid[1]);
-   rtw_signal_process(padapter->pid[1], SIGUSR2);
-   }
-
rtw_roaming(padapter, NULL);
 
ret = 0;
@@ -511,11 +504,6 @@ static int rtw_drv_init(struct usb_interface *pusb_intf, 
const struct usb_device
goto free_dvobj;
}
 
-   if (ui_pid[1] != 0) {
-   DBG_88E("ui_pid[1]:%d\n", ui_pid[1]);
-   rtw_signal_process(ui_pid[1], SIGUSR2);
-   }
-
RT_TRACE(_module_hci_intfs_c_, _drv_err_, ("-871x_drv - drv_init, 
success!\n"));
 
status = _SUCCESS;
-- 
2.1.0

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


[PATCH v2] staging: fbtft: Add support for Himax HX8357D controller

2015-05-31 Thread Heiner Kallweit
The Himax HX8357D is used e.g. by the Adafruit PITFT Plus 3.5".
Adafruit added HX8357D support to an own fork of fbtft and support
Raspbian only (https://github.com/adafruit/adafruit-rpi-fbtft/).
They don't intend to push it upstream but gave me the ok to do so.
Original author: Sean Cross 

I just applied small changes to the driver to align it with the other
fbtft drivers.
- add "compatible" argument to FBTFT_REGISTER_DRIVER call
- add missing MODULE_ALIAS declarations

Tested successfully with this display on an RPI2 under Arch Linux ARM
(kernel 3.18.13).

Signed-off-by: Heiner Kallweit 
---
v2: added author tag to the patch description
fixed checkpatch errors
adjusted waits in init_display to match the chip spec and changed
from mdelay to msleep
---
 drivers/staging/fbtft/Kconfig  |   6 +
 drivers/staging/fbtft/Makefile |   1 +
 drivers/staging/fbtft/fb_hx8357d.c | 222 +
 drivers/staging/fbtft/fb_hx8357d.h | 102 +
 4 files changed, 331 insertions(+)
 create mode 100644 drivers/staging/fbtft/fb_hx8357d.c
 create mode 100644 drivers/staging/fbtft/fb_hx8357d.h

diff --git a/drivers/staging/fbtft/Kconfig b/drivers/staging/fbtft/Kconfig
index 6cf0c58..3a0739d 100644
--- a/drivers/staging/fbtft/Kconfig
+++ b/drivers/staging/fbtft/Kconfig
@@ -38,6 +38,12 @@ config FB_TFT_HX8353D
help
  Generic Framebuffer support for HX8353D
 
+config FB_TFT_HX8357D
+   tristate "FB driver for the HX8357D LCD Controller"
+   depends on FB_TFT
+   help
+ Generic Framebuffer support for HX8357D
+
 config FB_TFT_ILI9163
tristate "FB driver for the ILI9163 LCD Controller"
depends on FB_TFT
diff --git a/drivers/staging/fbtft/Makefile b/drivers/staging/fbtft/Makefile
index 9e73bee..554b526 100644
--- a/drivers/staging/fbtft/Makefile
+++ b/drivers/staging/fbtft/Makefile
@@ -8,6 +8,7 @@ obj-$(CONFIG_FB_TFT_BD663474)+= fb_bd663474.o
 obj-$(CONFIG_FB_TFT_HX8340BN)+= fb_hx8340bn.o
 obj-$(CONFIG_FB_TFT_HX8347D) += fb_hx8347d.o
 obj-$(CONFIG_FB_TFT_HX8353D) += fb_hx8353d.o
+obj-$(CONFIG_FB_TFT_HX8357D) += fb_hx8357d.o
 obj-$(CONFIG_FB_TFT_ILI9163) += fb_ili9163.o
 obj-$(CONFIG_FB_TFT_ILI9320) += fb_ili9320.o
 obj-$(CONFIG_FB_TFT_ILI9325) += fb_ili9325.o
diff --git a/drivers/staging/fbtft/fb_hx8357d.c 
b/drivers/staging/fbtft/fb_hx8357d.c
new file mode 100644
index 000..8c7bb3a
--- /dev/null
+++ b/drivers/staging/fbtft/fb_hx8357d.c
@@ -0,0 +1,222 @@
+/*
+ * FB driver for the HX8357D LCD Controller
+ * Copyright (C) 2015 Adafruit Industries
+ *
+ * Based on the HX8347D FB driver
+ * Copyright (C) 2013 Christian Vogelgsang
+ *
+ * Based on driver code found here: 
https://github.com/watterott/r61505u-Adapter
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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 for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see .
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+#include "fbtft.h"
+#include "fb_hx8357d.h"
+
+#define DRVNAME"fb_hx8357d"
+#define WIDTH  320
+#define HEIGHT 480
+
+
+static int init_display(struct fbtft_par *par)
+{
+   fbtft_par_dbg(DEBUG_INIT_DISPLAY, par, "%s()\n", __func__);
+
+   par->fbtftops.reset(par);
+
+   /* Reset things like Gamma */
+   write_reg(par, HX8357B_SWRESET);
+   usleep_range(5000, 7000);
+
+   /* setextc */
+   write_reg(par, HX8357D_SETC, 0xFF, 0x83, 0x57);
+   msleep(150);
+
+   /* setRGB which also enables SDO */
+   write_reg(par, HX8357_SETRGB, 0x00, 0x00, 0x06, 0x06);
+
+   /* -1.52V */
+   write_reg(par, HX8357D_SETCOM, 0x25);
+
+   /* Normal mode 70Hz, Idle mode 55 Hz */
+   write_reg(par, HX8357_SETOSC, 0x68);
+
+   /* Set Panel - BGR, Gate direction swapped */
+   write_reg(par, HX8357_SETPANEL, 0x05);
+
+   write_reg(par, HX8357_SETPWR1,
+   0x00,  /* Not deep standby */
+   0x15,  /* BT */
+   0x1C,  /* VSPR */
+   0x1C,  /* VSNR */
+   0x83,  /* AP */
+   0xAA);  /* FS */
+
+   write_reg(par, HX8357D_SETSTBA,
+   0x50,  /* OPON normal */
+   0x50,  /* OPON idle */
+   0x01,  /* STBA */
+   0x3C,  /* STBA */
+   0x1E,  /* STBA */
+   0x08);  /* GEN */
+
+   write_reg(par, HX8357D_SETCYC,
+   0x02,  /* NW 0x02 */
+   0x

Re: [PATCH] staging: fbtft: Add support for Himax HX8357D controller

2015-05-31 Thread Heiner Kallweit
Am 31.05.2015 um 03:00 schrieb Greg KH:
> On Thu, May 21, 2015 at 10:10:35PM +0200, Heiner Kallweit wrote:
>> The Himax HX8357D is used e.g. by the Adafruit PITFT Plus 3.5".
>> They added HX8357D support to an own fork of fbtft and support Raspbian
>> only (https://github.com/adafruit/adafruit-rpi-fbtft/).
>> They don't intend to push it upstream but gave me the ok to do so.
> 
> Can you put a "author" type tag in here to show that you didn't
> originally write it?
> 
>>
>> I just applied small changes to the driver to align it with the other
>> fbtft drivers.
>> - add "compatible" argument to FBTFT_REGISTER_DRIVER call
>> - add missing MODULE_ALIAS declarations
> 
> Can you also fix up the checkpatch issues, I'd like to not add new
> problems that you then have to later fix up with future patches when
> it's so easy to fix them up now.
> 
> thanks,
> 
> greg k-h
Sure, will send a v2. Thanks for the feedback.
Heiner

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


Re: [PATCH] staging: Replace kzalloc and memcpy by kmemdup

2015-05-31 Thread Joe Perches
On Sun, 2015-05-31 at 11:35 +0900, gre...@linuxfoundation.org wrote:
> On Wed, May 20, 2015 at 07:04:27AM +, Dumbre, Nitesh Dilip (N.) wrote:
> > This patch was generated by coccicheck and replaces kzalloc followed
> > by memcpy with kmemdup
> > 
> > Signed-off-by: Nitesh Dumbre 
> 
> Name doesn't match the From: line, please fix your broken email client.
> 
> WHat is up with this company's email, there is a bunch of patches from
> different people, all of them broken like this.

Greg you are being a bit silly here.

The names match, but the company's email naming
policy is not "first last" but "last, first".

People generally sign their names "first last".

Nothing is broken but your desire for exact name
matching.

If this was an actual "From:" line in the body of
the email, you'd be more likely correct that the
names don't match, but this is not that case.


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


[PATCH] This patch fixes WARNING: please, no space before tabs given by checkpatch.pl

2015-05-31 Thread Joglekar Tejas
Signed-off-by: Joglekar Tejas 
---
 drivers/staging/comedi/drivers/ni_at_a2150.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/ni_at_a2150.c 
b/drivers/staging/comedi/drivers/ni_at_a2150.c
index 3a972d1..60469bb 100644
--- a/drivers/staging/comedi/drivers/ni_at_a2150.c
+++ b/drivers/staging/comedi/drivers/ni_at_a2150.c
@@ -106,7 +106,7 @@ TRIG_WAKE_EOS
 #define   IRQ_LVL_BITS(x)  (((x) & 0xf) << 4)  /*  sets irq 
level */
 #define   FIFO_INTR_EN_BIT 0x100   /*  enable fifo interrupts */
 #define   FIFO_INTR_FHF_BIT0x200   /*  interrupt fifo half full */
-#define   DMA_INTR_EN_BIT  0x800   /*  enable interrupt on dma 
terminal count */
+#define   DMA_INTR_EN_BIT  0x800   /*  enable interrupt on dma 
terminal count */
 #define   DMA_DEM_EN_BIT   0x1000  /*  enables demand mode dma */
 #define I8253_BASE_REG 0x14
 
-- 
1.9.1

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


Re: From Mr. Thomas Sann

2015-05-31 Thread Mr. Thomas Sann
I am Mr. Thomas Sann,  I am sorry for this interruption. I have no other way to 
reach you than these ways, please accept my apology.I am a personal account 
manager to one of our foreign late customer. It is my interest to contact you 
in respect of this our client who opened a draft account in my bank. It is with 
good spirit of heart I opened up this great opportunity to you. This deceased 
client of mine shares almost the same name as yours; He had heart-ttack while 
driving and died on a motor accident on 14th of November 2011. His heart 
condition was due to the death of all the members of his family in the 
fukushima earthquake and tsunami disaster on the March 11th, 2011 in 
northeastern Japan where they all lost their lives.

After his death, I sent a routine notification to his forwarding address, but 
got no reply. He died without making any WILL. His draft account opened in my 
bank before his unfortunate death is US$28,526,200.00 Twenty Eight Million Five 
Hundred and Twenty Six Thousand Two Hundred United States Dollars Only. I want 
to present you as the beneficiary of the deceased. I will use my position and 
influence in our bank to make sure they release this money to you for our 
mutual sharing. If I wait for days and did not hear from you, I shall look for 
another person.

Kindly get back to me for more details.

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


[PATCH RESEND] staging: rtl8192u: ieee80211: Fix sparse endianness warnings

2015-05-31 Thread Gaston Gonzalez
Fix the following sparse warnings:

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: warning: 
incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:expected 
restricted __le16 [usertype] frame_ctl
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:got int
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50: warning: invalid 
assignment: |=
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:left side has 
type restricted __le16
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:right side 
has type int


Signed-off-by: Gaston Gonzalez 
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index d2e8b12..0477ba1 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -660,2 +660,2 @@ inline struct sk_buff *ieee80211_authentication_req(struct 
ieee80211_network *be
auth = (struct ieee80211_authentication *)
skb_put(skb, sizeof(struct ieee80211_authentication));

-   auth->header.frame_ctl = IEEE80211_STYPE_AUTH;
-   if (challengelen) auth->header.frame_ctl |= IEEE80211_FCTL_WEP;
+   auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
+   if (challengelen)
+   auth->header.frame_ctl |= cpu_to_le16(IEEE80211_FCTL_WEP);

auth->header.duration_id = 0x013a; //FIXME

--
2.1.4

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


Re: [PATCH] staging: rtl8192u: ieee80211: Fix sparse endianness warnings

2015-05-31 Thread Gaston Gonzalez
On Sun, May 31, 2015 at 10:45:27AM +0900, Greg KH wrote:
> On Tue, May 26, 2015 at 06:47:14PM -0300, Gaston Gonzalez wrote:
> > Fix the following sparse warnings:
> > 
> > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: warning: 
> > incorrect type in assignment (different base types)
> > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:expected 
> > restricted __le16 [usertype] frame_ctl
> > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:got int
> > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50: warning: 
> > invalid assignment: |=
> > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:left side 
> > has type restricted __le16
> > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:right 
> > side has type int
> > 
> > 
> > Signed-off-by: Gaston Gonzalez 
> > ---
> >  drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
> > b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > index d2e8b12..0477ba1 100644
> > --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > @@ -660,2 +660,2 @@ inline struct sk_buff 
> > *ieee80211_authentication_req(struct ieee80211_network *be
> > auth = (struct ieee80211_authentication *)
> > skb_put(skb, sizeof(struct ieee80211_authentication));
> > 
> > -   auth->header.frame_ctl = IEEE80211_STYPE_AUTH;
> > -   if (challengelen) auth->header.frame_ctl |= IEEE80211_FCTL_WEP;
> > +   auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
> > +   if (challengelen)
> > +   auth->header.frame_ctl |= cpu_to_le16(IEEE80211_FCTL_WEP);
> > 
> > auth->header.duration_id = 0x013a; //FIXME
> > 
> 
> This patch doesn't apply properly for some reason, can you fix it up and
> resend?
> 
> thanks,
> 
> greg k-h
Hi Greg,

I couldn't find the problem with this patch. Just in case I redo the patch
against the updated staging-testing and resent it. To test it I did:

 - run checkpatch
 - git apply --check
 - email it to myself and then 'git am' from mutt 
 - git log

I've just sent the patch. Please let me know if I missed something.

Thanks,

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


Re: [PATCH] This patch fixes WARNING: please, no space before tabs given by checkpatch.pl

2015-05-31 Thread Joglekar Tejas
On Sun, May 31, 2015 at 07:09:56PM +0530, Joglekar Tejas wrote:
> Signed-off-by: Joglekar Tejas 
> ---
>  drivers/staging/comedi/drivers/ni_at_a2150.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/comedi/drivers/ni_at_a2150.c 
> b/drivers/staging/comedi/drivers/ni_at_a2150.c
> index 3a972d1..60469bb 100644
> --- a/drivers/staging/comedi/drivers/ni_at_a2150.c
> +++ b/drivers/staging/comedi/drivers/ni_at_a2150.c
> @@ -106,7 +106,7 @@ TRIG_WAKE_EOS
>  #define   IRQ_LVL_BITS(x)(((x) & 0xf) << 4)  /*  sets irq 
> level */
>  #define   FIFO_INTR_EN_BIT   0x100   /*  enable fifo interrupts */
>  #define   FIFO_INTR_FHF_BIT  0x200   /*  interrupt fifo half full */
> -#define   DMA_INTR_EN_BIT0x800   /*  enable interrupt on dma 
> terminal count */
> +#define   DMA_INTR_EN_BIT0x800   /*  enable interrupt on dma 
> terminal count */
>  #define   DMA_DEM_EN_BIT 0x1000  /*  enables demand mode dma */
>  #define I8253_BASE_REG   0x14
>  
> -- 
> 1.9.1
>
I would like to correct error in previous patch
please ignore this patch, I will send patch again.

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


[PATCH v5 00/34] staging: rtl8192e: Fix more checkpatch.pl warnings

2015-05-31 Thread Mateusz Kulikowski
Updated series of patches for rtl8192.
Rebased to latest staging-next (9535ebc5e). Built and target tested 
(tests like for v3 + download of 1Mb file over http).
Side note: quality/performance of this driver is still poor - it drops
a lot of packets (at least when talking to 802.11N/ 2.4G / WPA2 network).

Changes from v4:
- Rework v4 02/35 patch (__aligned(2)): Threw away __aligned(2) as they 
  don't look good. Instead:
  + Reorder local variables (if needed) - they are always aligned
  + Reorder members of unpacked structures if possible
  Alignment was verified with BUG_ON trap in ether_addr_copy and manually 
  with pahole.
- Remove v4 04/35 patch (Mark unaligned memcpy)
- Fix v4 06/35 patch (ether_addr_equal_unaligned()): use ether_addr_equal()
- Rebase to latest staging-next



Notes from v4:

Changes from v3:
- Inserted #1 patch (accept const MAC address) - needed for review-fixes
- #2 reworked as suggested by Joe: where possible, broadcast/zero addresses 
 are 'static const', re-indent MAC address (address in one line),
 use is_zero_ether_addr() instead of memcmp(). I left __aligned() in 
 most places though.
- #3 updated comment to explicitly state that code was tested
- #4 was left as is - I will post ether_addr_copy_unaligned later on
- #5 patch was re-done - most of original formatting is left intact except where
 change was obvious/needed
- #8 Fixed indentation 
- #21 Use netdev_dbg in few more places, drop function names in log messages
- #29 Removed condition that is always false
- #35 Fix another SPACING error that was not there when v3 was created

Notes from v3:

This series applies some of review comments by Dan (thanks!) as well as does
further cleanups.

Further series will probably focus more on changing driver architecture into
something that may get accepted into -wireless.

This series should apply cleanly to staging-testing(7192a5dd5)
branches.
One changeset - #14 will not apply cleanly if the following patch will be 
applied:
[PATCH v2] staging: rtl8192e: Change cpu_to_le16 to le16_to_cpu
It should apply via 3-way merge (only one line of context is different)

Target tested on netbook with rtl8192e card vs Linus master (1a9f064f):
- Module load/unload
- Interface up/down
- Network scanning
- Connect to WPA2 network + ping route
I've found one bug in the driver (it happens also on master) - rtllib doesn't 
handle rmmod of active (WPA) r8192e_pci - module refcount drops below 0.

Built-tested for each patch in series on staging-testing

New changes (patch numbers are valid for v3):
- #6 Removal of rtllib_crypt.[ch] - unused files are bad
- #10 Simplification of rtllib_proces_probe_response - fixing LONG_LINES in
process
- #24 Fix new checkpatch warnings (OOM_MESSAGE)
- #25 Remove another unused file (rtl_crypto.h)
- #26-#28 Replace ?: expression with min/max macros
- #29 Remove unused debug messages
- #30 Simplify/Optimize rtl8192_phy_checkBBAndRF()
- #31 Replace RT_TRACE(COMP_ERR,...) with netdev_* errors - this are error
messages that were (and should be) displayed, with this patch it will be
clearly visible where they belong (+log levels were changed to more
appropriate).
- #32 Trivial reindentations
- #33 Simplify awkward WoL reporting in rtl8192E_suspend()

What happened to v2 changesets (patch numbers are valid for v2 unless noted):
- Patches 1-9 were already applied by Greg - Thanks!
- Patch 10 was split and reworked into v3 patches: 1, 2, 3
- Patches 11, 12 were cherry-picked into v3 patches 4, 5
- Patch 13 became a series of patches removing whole RTLLIB_* debug "system"
(v3 patches 7-9, 11-19, 20). Where possible netdev_* was used, but in some
cases it would look awkward so I left with pr_*
- Patch 14 was cherry-picked into v3 patch 21 (Again - thanks for patience Dan)
- Patches 15, 17, 18, 19, 20 were thrown out - they fix some LONG_LINE
warnings, but it's not worth it as readability of code goes down -
I will remove remaining warnings while refactoring the driver
- Patch 16 was cherry-picked into v3 patch 22
- Patch 21 was cherry-picked into v3 patch 23

Notes from v2:

New cleanup patchset for rtl8192e. It fixes (mostly) checkpatch.pl warnings.
When applied, checkpatch.pl warning count drops to 34 (from ).
It should apply cleanly to staging-next/testing (c610f7f7) branches.

Series was smoke tested on rtl8192e card vs staging-next:
- Module load/unload
- Interface up/down

Most of changes are related to checkpatch.pl with the exception of
- bugfix - staging: rtl8192e: Fix DeviceID in rtl8192_pci_findadapter()
  This is clearly (in my opinion) typo - I checked two rtl8192e cards from
  different vendors and both had DeviceID == 0x8192.
- Removal of unimplemented/unused iwpriv handlers - they just give false sense
  of hope to iwpriv user

Additional changes in v2:
- Fix (most) LONG_LINE warnings
- Replace memcpy() with custom macro - later __aligned(2) will be added to
  structures (where possible) - I prefer not to d

[PATCH v5 04/34] staging: rtl8192e: Fix DEEP_INDENTATION warning in rtllib_parse_info_param()

2015-05-31 Thread Mateusz Kulikowski
Move MFIE_TYPE_GENERIC handler to rtllib_parse_mife_generic() function.
Code was not altered significantly, therefore in some places it generates
LONG_LINE checkpatch.pl warnings.

Signed-off-by: Mateusz Kulikowski 
---
 drivers/staging/rtl8192e/rtllib_rx.c | 397 ++-
 1 file changed, 210 insertions(+), 187 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib_rx.c 
b/drivers/staging/rtl8192e/rtllib_rx.c
index bde80c8..f8f1920 100644
--- a/drivers/staging/rtl8192e/rtllib_rx.c
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
@@ -1739,6 +1739,213 @@ static inline void rtllib_extract_country_ie(
 
 }
 
+static void rtllib_parse_mife_generic(struct rtllib_device *ieee,
+ struct rtllib_info_element *info_element,
+ struct rtllib_network *network,
+ u16 *tmp_htcap_len,
+ u16 *tmp_htinfo_len)
+{
+   u16 ht_realtek_agg_len = 0;
+   u8  ht_realtek_agg_buf[MAX_IE_LEN];
+
+   if (!rtllib_parse_qos_info_param_IE(info_element, network))
+   return;
+   if (info_element->len >= 4 &&
+   info_element->data[0] == 0x00 &&
+   info_element->data[1] == 0x50 &&
+   info_element->data[2] == 0xf2 &&
+   info_element->data[3] == 0x01) {
+   network->wpa_ie_len = min(info_element->len + 2,
+ MAX_WPA_IE_LEN);
+   memcpy(network->wpa_ie, info_element, network->wpa_ie_len);
+   return;
+   }
+   if (info_element->len == 7 &&
+   info_element->data[0] == 0x00 &&
+   info_element->data[1] == 0xe0 &&
+   info_element->data[2] == 0x4c &&
+   info_element->data[3] == 0x01 &&
+   info_element->data[4] == 0x02)
+   network->Turbo_Enable = 1;
+
+   if (*tmp_htcap_len == 0) {
+   if (info_element->len >= 4 &&
+  info_element->data[0] == 0x00 &&
+  info_element->data[1] == 0x90 &&
+  info_element->data[2] == 0x4c &&
+  info_element->data[3] == 0x033) {
+
+   *tmp_htcap_len = min_t(u8, info_element->len,
+  MAX_IE_LEN);
+   if (*tmp_htcap_len != 0) {
+   network->bssht.bdHTSpecVer = HT_SPEC_VER_EWC;
+   network->bssht.bdHTCapLen = min_t(u16, 
*tmp_htcap_len, sizeof(network->bssht.bdHTCapBuf));
+   memcpy(network->bssht.bdHTCapBuf,
+  info_element->data,
+  network->bssht.bdHTCapLen);
+   }
+   }
+   if (*tmp_htcap_len != 0) {
+   network->bssht.bdSupportHT = true;
+   network->bssht.bdHT1R = struct ht_capab_ele 
*)(network->bssht.bdHTCapBuf))->MCS[1]) == 0);
+   } else {
+   network->bssht.bdSupportHT = false;
+   network->bssht.bdHT1R = false;
+   }
+   }
+
+
+   if (*tmp_htinfo_len == 0) {
+   if (info_element->len >= 4 &&
+   info_element->data[0] == 0x00 &&
+   info_element->data[1] == 0x90 &&
+   info_element->data[2] == 0x4c &&
+   info_element->data[3] == 0x034) {
+   *tmp_htinfo_len = min_t(u8, info_element->len,
+   MAX_IE_LEN);
+   if (*tmp_htinfo_len != 0) {
+   network->bssht.bdHTSpecVer = HT_SPEC_VER_EWC;
+   network->bssht.bdHTInfoLen = min_t(u16, 
*tmp_htinfo_len, sizeof(network->bssht.bdHTInfoBuf));
+   memcpy(network->bssht.bdHTInfoBuf,
+  info_element->data,
+  network->bssht.bdHTInfoLen);
+   }
+
+   }
+   }
+
+   if (ieee->aggregation) {
+   if (network->bssht.bdSupportHT) {
+   if (info_element->len >= 4 &&
+   info_element->data[0] == 0x00 &&
+   info_element->data[1] == 0xe0 &&
+   info_element->data[2] == 0x4c &&
+   info_element->data[3] == 0x02) {
+   ht_realtek_agg_len = min_t(u8,
+  info_element->len,
+  MAX_IE_LEN);
+   memcpy(ht_realtek_agg_buf,
+  info_element->data,
+  info_element->len);
+   }
+   if (ht_realtek_agg_len >= 5) {

[PATCH v5 02/34] staging: rtl8192e: Make ethernet addresses properly aligned

2015-05-31 Thread Mateusz Kulikowski
Reorder ethernet addresses allocated on stack or in non-packed
structures to keep them aligned(2).
Use ETH_ALEN as array length in places where it was hardcoded to 6.

Alignment verified using pahole where possible and target-tested
with BUG_ON() trap in ether_addr_copy.

Signed-off-by: Mateusz Kulikowski 
---
 drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c |  3 +--
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c   |  6 ++
 drivers/staging/rtl8192e/rtl8192e/rtl_wx.c |  4 ++--
 drivers/staging/rtl8192e/rtl819x_Qos.h |  4 ++--
 drivers/staging/rtl8192e/rtl819x_TS.h  |  2 +-
 drivers/staging/rtl8192e/rtllib.h  | 10 +-
 drivers/staging/rtl8192e/rtllib_crypt_tkip.c   |  3 ++-
 drivers/staging/rtl8192e/rtllib_rx.c   |  6 +-
 drivers/staging/rtl8192e/rtllib_softmac.c  |  4 ++--
 drivers/staging/rtl8192e/rtllib_tx.c   |  3 ++-
 10 files changed, 24 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c 
b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
index aad5cc9..926fca7 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
@@ -316,12 +316,11 @@ void rtl8192e_SetHwReg(struct net_device *dev, u8 
variable, u8 *val)
 static void rtl8192_read_eeprom_info(struct net_device *dev)
 {
struct r8192_priv *priv = rtllib_priv(dev);
-
+   const u8 bMac_Tmp_Addr[ETH_ALEN] = {0x00, 0xe0, 0x4c, 0x00, 0x00, 0x01};
u8 tempval;
u8 ICVer8192, ICVer8256;
u16 i, usValue, IC_Version;
u16 EEPROMId;
-   u8 bMac_Tmp_Addr[6] = {0x00, 0xe0, 0x4c, 0x00, 0x00, 0x01};
 
RT_TRACE(COMP_INIT, "> rtl8192_read_eeprom_info\n");
 
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 6d60ac4..6f339cd 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -2573,8 +2573,7 @@ static int rtl8192_ioctl(struct net_device *dev, struct 
ifreq *rq, int cmd)
int ret = -1;
struct rtllib_device *ieee = priv->rtllib;
u32 key[4];
-   u8 broadcast_addr[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
-   u8 zero_addr[6] = {0};
+   const u8 broadcast_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 
0xff};
struct iw_point *p = &wrq->u.data;
struct ieee_param *ipw = NULL;
 
@@ -2611,8 +2610,7 @@ static int rtl8192_ioctl(struct net_device *dev, struct 
ifreq *rq, int cmd)
}
 
if (ieee->pairwise_key_type) {
-   if (memcmp(ieee->ap_mac_addr, zero_addr,
-   6) == 0)
+   if 
(is_zero_ether_addr(ieee->ap_mac_addr))
ieee->iw_mode = IW_MODE_ADHOC;
memcpy((u8 *)key, ipw->u.crypt.key, 16);
EnableHWSecurityConfig8192(dev);
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
index 8d6a109..43702df 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
@@ -987,8 +987,8 @@ static int r8192_wx_set_enc_ext(struct net_device *dev,
 
ret = rtllib_wx_set_encode_ext(ieee, info, wrqu, extra);
{
-   u8 broadcast_addr[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
-   u8 zero[6] = {0};
+   const u8 broadcast_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 
0xff, 0xff};
+   const u8 zero[ETH_ALEN] = {0};
u32 key[4] = {0};
struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
struct iw_point *encoding = &wrqu->encoding;
diff --git a/drivers/staging/rtl8192e/rtl819x_Qos.h 
b/drivers/staging/rtl8192e/rtl819x_Qos.h
index 55ef7ec..b3e7dae 100644
--- a/drivers/staging/rtl8192e/rtl819x_Qos.h
+++ b/drivers/staging/rtl8192e/rtl819x_Qos.h
@@ -255,8 +255,8 @@ union qos_tclas {
u8  Priority;
u8  ClassifierType;
u8  Mask;
-   u8  SrcAddr[6];
-   u8  DstAddr[6];
+   u8  SrcAddr[ETH_ALEN];
+   u8  DstAddr[ETH_ALEN];
u16 Type;
} TYPE0_ETH;
 
diff --git a/drivers/staging/rtl8192e/rtl819x_TS.h 
b/drivers/staging/rtl8192e/rtl819x_TS.h
index 8601b1a..b3e721b 100644
--- a/drivers/staging/rtl8192e/rtl819x_TS.h
+++ b/drivers/staging/rtl8192e/rtl819x_TS.h
@@ -35,7 +35,7 @@ struct ts_common_info {
struct list_headList;
struct timer_list   SetupTimer;
struct timer_list   InactTimer;
-   u8  Addr[6];
+   u8  

[PATCH v5 08/34] staging: rtl8192e: Remove RTLLIB_ERROR() and RTLLIB_WARNING()

2015-05-31 Thread Mateusz Kulikowski
Use pr_* where needed (rtllib init code).

Signed-off-by: Mateusz Kulikowski 
---
 drivers/staging/rtl8192e/rtllib.h| 2 --
 drivers/staging/rtl8192e/rtllib_module.c | 8 +++-
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib.h 
b/drivers/staging/rtl8192e/rtllib.h
index 411363c..42c37f8 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -701,8 +701,6 @@ do {
\
 #define RTLLIB_DL_TRACE   (1<<29)
 #define RTLLIB_DL_DATA(1<<30)
 #define RTLLIB_DL_ERR (1<<31)
-#define RTLLIB_ERROR(f, a...) pr_err("rtllib: " f, ## a)
-#define RTLLIB_WARNING(f, a...) pr_warn("rtllib: " f, ## a)
 #define RTLLIB_DEBUG_INFO(f, a...)   RTLLIB_DEBUG(RTLLIB_DL_INFO, f, ## a)
 
 #define RTLLIB_DEBUG_WX(f, a...) RTLLIB_DEBUG(RTLLIB_DL_WX, f, ## a)
diff --git a/drivers/staging/rtl8192e/rtllib_module.c 
b/drivers/staging/rtl8192e/rtllib_module.c
index 32cc8df..b8c7df5 100644
--- a/drivers/staging/rtl8192e/rtllib_module.c
+++ b/drivers/staging/rtl8192e/rtllib_module.c
@@ -107,7 +107,7 @@ struct net_device *alloc_rtllib(int sizeof_priv)
 
dev = alloc_etherdev(sizeof(struct rtllib_device) + sizeof_priv);
if (!dev) {
-   RTLLIB_ERROR("Unable to network device.\n");
+   pr_err("Unable to allocate net_device.\n");
return NULL;
}
ieee = (struct rtllib_device *)netdev_priv_rsl(dev);
@@ -116,8 +116,7 @@ struct net_device *alloc_rtllib(int sizeof_priv)
 
err = rtllib_networks_allocate(ieee);
if (err) {
-   RTLLIB_ERROR("Unable to allocate beacon storage: %d\n",
-   err);
+   pr_err("Unable to allocate beacon storage: %d\n", err);
goto failed;
}
rtllib_networks_initialize(ieee);
@@ -240,8 +239,7 @@ static int __init rtllib_init(void)
rtllib_debug_level = debug;
rtllib_proc = proc_mkdir(DRV_NAME, init_net.proc_net);
if (rtllib_proc == NULL) {
-   RTLLIB_ERROR("Unable to create " DRV_NAME
-   " proc directory\n");
+   pr_err("Unable to create " DRV_NAME " proc directory\n");
return -EIO;
}
e = proc_create("debug_level", S_IRUGO | S_IWUSR, rtllib_proc, &fops);
-- 
1.8.4.1

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


[PATCH v5 09/34] staging: rtl8192e: Remove RTLLIB_DEBUG_WX()

2015-05-31 Thread Mateusz Kulikowski
Use netdev_dbg() instead of RTLLIB_DEBUG_WX().
Rewrite some messages to be more readable.

Signed-off-by: Mateusz Kulikowski 
---
 drivers/staging/rtl8192e/rtllib.h|  1 -
 drivers/staging/rtl8192e/rtllib_wx.c | 33 -
 2 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib.h 
b/drivers/staging/rtl8192e/rtllib.h
index 42c37f8..392bcd5 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -703,7 +703,6 @@ do {
\
 #define RTLLIB_DL_ERR (1<<31)
 #define RTLLIB_DEBUG_INFO(f, a...)   RTLLIB_DEBUG(RTLLIB_DL_INFO, f, ## a)
 
-#define RTLLIB_DEBUG_WX(f, a...) RTLLIB_DEBUG(RTLLIB_DL_WX, f, ## a)
 #define RTLLIB_DEBUG_SCAN(f, a...)   RTLLIB_DEBUG(RTLLIB_DL_SCAN, f, ## a)
 #define RTLLIB_DEBUG_STATE(f, a...)  RTLLIB_DEBUG(RTLLIB_DL_STATE, f, ## a)
 #define RTLLIB_DEBUG_MGMT(f, a...)  RTLLIB_DEBUG(RTLLIB_DL_MGMT, f, ## a)
diff --git a/drivers/staging/rtl8192e/rtllib_wx.c 
b/drivers/staging/rtl8192e/rtllib_wx.c
index 6234aae..c2c5f0d 100644
--- a/drivers/staging/rtl8192e/rtllib_wx.c
+++ b/drivers/staging/rtl8192e/rtllib_wx.c
@@ -266,7 +266,7 @@ int rtllib_wx_get_scan(struct rtllib_device *ieee,
int i = 0;
int err = 0;
 
-   RTLLIB_DEBUG_WX("Getting scan\n");
+   netdev_dbg(ieee->dev, "Getting scan\n");
down(&ieee->wx_sem);
spin_lock_irqsave(&ieee->lock, flags);
 
@@ -293,7 +293,7 @@ int rtllib_wx_get_scan(struct rtllib_device *ieee,
wrqu->data.length = ev -  extra;
wrqu->data.flags = 0;
 
-   RTLLIB_DEBUG_WX("exit: %d networks returned.\n", i);
+   netdev_dbg(ieee->dev, "%s(): %d networks returned.\n", __func__, i);
 
return err;
 }
@@ -311,7 +311,7 @@ int rtllib_wx_set_encode(struct rtllib_device *ieee,
int i, key, key_provided, len;
struct lib80211_crypt_data **crypt;
 
-   RTLLIB_DEBUG_WX("SET_ENCODE\n");
+   netdev_dbg(ieee->dev, "%s()\n", __func__);
 
key = erq->flags & IW_ENCODE_INDEX;
if (key) {
@@ -324,16 +324,16 @@ int rtllib_wx_set_encode(struct rtllib_device *ieee,
key = ieee->crypt_info.tx_keyidx;
}
 
-   RTLLIB_DEBUG_WX("Key: %d [%s]\n", key, key_provided ?
+   netdev_dbg(ieee->dev, "Key: %d [%s]\n", key, key_provided ?
   "provided" : "default");
crypt = &ieee->crypt_info.crypt[key];
if (erq->flags & IW_ENCODE_DISABLED) {
if (key_provided && *crypt) {
-   RTLLIB_DEBUG_WX("Disabling encryption on key %d.\n",
-  key);
+   netdev_dbg(ieee->dev,
+  "Disabling encryption on key %d.\n", key);
lib80211_crypt_delayed_deinit(&ieee->crypt_info, crypt);
} else
-   RTLLIB_DEBUG_WX("Disabling encryption.\n");
+   netdev_dbg(ieee->dev, "Disabling encryption.\n");
 
/* Check all the keys to see if any are still configured,
 * and if no key index was provided, de-init them all
@@ -405,9 +405,9 @@ int rtllib_wx_set_encode(struct rtllib_device *ieee,
if (len > erq->length)
memset(sec.keys[key] + erq->length, 0,
   len - erq->length);
-   RTLLIB_DEBUG_WX("Setting key %d to '%s' (%d:%d bytes)\n",
-  key, escape_essid(sec.keys[key], len),
-  erq->length, len);
+   netdev_dbg(ieee->dev, "Setting key %d to '%s' (%d:%d bytes)\n",
+  key, escape_essid(sec.keys[key], len), erq->length,
+  len);
sec.key_sizes[key] = len;
(*crypt)->ops->set_key(sec.keys[key], len, NULL,
   (*crypt)->priv);
@@ -436,8 +436,8 @@ int rtllib_wx_set_encode(struct rtllib_device *ieee,
 
/* No key data - just set the default TX key index */
if (key_provided) {
-   RTLLIB_DEBUG_WX("Setting key %d to default Tx key.\n",
-   key);
+   netdev_dbg(ieee->dev,
+  "Setting key %d as default Tx key.\n", key);
ieee->crypt_info.tx_keyidx = key;
sec.active_key = key;
sec.flags |= SEC_ACTIVE_KEY;
@@ -449,7 +449,7 @@ int rtllib_wx_set_encode(struct rtllib_device *ieee,
  WLAN_AUTH_SHARED_KEY;
sec.auth_mode = ieee->open_wep ? WLAN_AUTH_OPEN : WLAN_AUTH_SHARED_KEY;
sec.flags |= SEC_AUTH_MODE;
-   RTLLIB_DEBUG_WX("Auth: %s\n", sec.auth_mode == WLAN_AUTH_OPEN ?
+   netdev_dbg(ieee->dev, "Auth: %s\n", sec.auth_mode == WLAN_AUTH_OPEN ?

[PATCH v5 10/34] staging: rtl8192e: Simplify rtllib_process_probe_response()

2015-05-31 Thread Mateusz Kulikowski
- Extract frame_ctl once and use it as variable.
- Drop endian conversion in is_beacon() function
  (used in simplified function only)
- Simplify debug messages
- Invert STYPE checks in debug messages - it is valid
  as only BEACON and PROBE_RESP are allowed

Signed-off-by: Mateusz Kulikowski 
---
 drivers/staging/rtl8192e/rtllib_rx.c | 37 +++-
 1 file changed, 15 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib_rx.c 
b/drivers/staging/rtl8192e/rtllib_rx.c
index 3dc0583..304404d 100644
--- a/drivers/staging/rtl8192e/rtllib_rx.c
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
@@ -2457,9 +2457,9 @@ static inline void update_network(struct rtllib_network 
*dst,
dst->BssCcxVerNumber = src->BssCcxVerNumber;
 }
 
-static inline int is_beacon(__le16 fc)
+static inline int is_beacon(u16 fc)
 {
-   return (WLAN_FC_GET_STYPE(le16_to_cpu(fc)) == RTLLIB_STYPE_BEACON);
+   return (WLAN_FC_GET_STYPE(fc) == RTLLIB_STYPE_BEACON);
 }
 
 static int IsPassiveChannel(struct rtllib_device *rtllib, u8 channel)
@@ -2500,6 +2500,7 @@ static inline void rtllib_process_probe_response(
short renew;
struct rtllib_network *network = kzalloc(sizeof(struct rtllib_network),
 GFP_ATOMIC);
+   u16 frame_ctl = le16_to_cpu(beacon->header.frame_ctl);
 
if (!network)
return;
@@ -2528,12 +2529,9 @@ static inline void rtllib_process_probe_response(
if (rtllib_network_init(ieee, beacon, network, stats)) {
RTLLIB_DEBUG_SCAN("Dropped '%s' ( %pM) via %s.\n",
  escape_essid(info_element->data,
- info_element->len),
- beacon->header.addr3,
- WLAN_FC_GET_STYPE(
- 
le16_to_cpu(beacon->header.frame_ctl)) ==
- RTLLIB_STYPE_PROBE_RESP ?
- "PROBE RESPONSE" : "BEACON");
+ info_element->len), beacon->header.addr3,
+ is_beacon(frame_ctl) ? "BEACON" :
+"PROBE RESPONSE");
goto free_network;
}
 
@@ -2541,8 +2539,7 @@ static inline void rtllib_process_probe_response(
if (!rtllib_legal_channel(ieee, network->channel))
goto free_network;
 
-   if (WLAN_FC_GET_STYPE(le16_to_cpu(beacon->header.frame_ctl)) ==
-   RTLLIB_STYPE_PROBE_RESP) {
+   if (WLAN_FC_GET_STYPE(frame_ctl) == RTLLIB_STYPE_PROBE_RESP) {
if (IsPassiveChannel(ieee, network->channel)) {
netdev_info(ieee->dev,
"GetScanInfo(): For Global Domain, filter 
probe response at channel(%d).\n",
@@ -2575,7 +2572,7 @@ static inline void rtllib_process_probe_response(
else
ieee->current_network.buseprotection = false;
}
-   if (is_beacon(beacon->header.frame_ctl)) {
+   if (is_beacon(frame_ctl)) {
if (ieee->state >= RTLLIB_LINKED)
ieee->LinkDetectInfo.NumRecvBcnInPeriod++;
}
@@ -2612,22 +2609,18 @@ static inline void rtllib_process_probe_response(
RTLLIB_DEBUG_SCAN("Adding '%s' ( %pM) via %s.\n",
  escape_essid(network->ssid,
  network->ssid_len), network->bssid,
- WLAN_FC_GET_STYPE(
- 
le16_to_cpu(beacon->header.frame_ctl)) ==
- RTLLIB_STYPE_PROBE_RESP ?
- "PROBE RESPONSE" : "BEACON");
+ is_beacon(frame_ctl) ? "BEACON" :
+"PROBE RESPONSE");
memcpy(target, network, sizeof(*target));
list_add_tail(&target->list, &ieee->network_list);
if (ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE)
rtllib_softmac_new_net(ieee, network);
} else {
RTLLIB_DEBUG_SCAN("Updating '%s' ( %pM) via %s.\n",
- escape_essid(target->ssid,
- target->ssid_len), target->bssid,
- WLAN_FC_GET_STYPE(
- 
le16_to_cpu(beacon->header.frame_ctl)) ==
- RTLLIB_STYPE_PROBE_RESP ?
- "PROBE RESPONSE" : "BEACON");
+ escape_essid(target->ssid, target->ssid_len),
+ target->bssid,
+ is_beacon(frame_ctl) ? "BEACON" :
+

[PATCH v5 12/34] staging: rtl8192e: Remove RTLLIB_DEBUG_(FRAG|EAP|DROP|STATE|TX|RX)()

2015-05-31 Thread Mateusz Kulikowski
Use netdev_dbg() instead.

Signed-off-by: Mateusz Kulikowski 
---
 drivers/staging/rtl8192e/rtllib.h|  6 
 drivers/staging/rtl8192e/rtllib_rx.c | 58 
 drivers/staging/rtl8192e/rtllib_tx.c |  5 ++--
 3 files changed, 35 insertions(+), 34 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib.h 
b/drivers/staging/rtl8192e/rtllib.h
index 6481919..b20090d 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -703,13 +703,7 @@ do {   
\
 #define RTLLIB_DL_ERR (1<<31)
 #define RTLLIB_DEBUG_INFO(f, a...)   RTLLIB_DEBUG(RTLLIB_DL_INFO, f, ## a)
 
-#define RTLLIB_DEBUG_STATE(f, a...)  RTLLIB_DEBUG(RTLLIB_DL_STATE, f, ## a)
 #define RTLLIB_DEBUG_MGMT(f, a...)  RTLLIB_DEBUG(RTLLIB_DL_MGMT, f, ## a)
-#define RTLLIB_DEBUG_FRAG(f, a...)  RTLLIB_DEBUG(RTLLIB_DL_FRAG, f, ## a)
-#define RTLLIB_DEBUG_EAP(f, a...)  RTLLIB_DEBUG(RTLLIB_DL_EAP, f, ## a)
-#define RTLLIB_DEBUG_DROP(f, a...)  RTLLIB_DEBUG(RTLLIB_DL_DROP, f, ## a)
-#define RTLLIB_DEBUG_TX(f, a...)  RTLLIB_DEBUG(RTLLIB_DL_TX, f, ## a)
-#define RTLLIB_DEBUG_RX(f, a...)  RTLLIB_DEBUG(RTLLIB_DL_RX, f, ## a)
 #define RTLLIB_DEBUG_QOS(f, a...)  RTLLIB_DEBUG(RTLLIB_DL_QOS, f, ## a)
 
 #ifndef ETH_P_PAE
diff --git a/drivers/staging/rtl8192e/rtllib_rx.c 
b/drivers/staging/rtl8192e/rtllib_rx.c
index a6dde35..8ea3e2f 100644
--- a/drivers/staging/rtl8192e/rtllib_rx.c
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
@@ -69,9 +69,9 @@ rtllib_frag_cache_find(struct rtllib_device *ieee, unsigned 
int seq,
entry = &ieee->frag_cache[tid][i];
if (entry->skb != NULL &&
time_after(jiffies, entry->first_frag_time + 2 * HZ)) {
-   RTLLIB_DEBUG_FRAG(
-   "expiring fragment cache entry seq=%u 
last_frag=%u\n",
-   entry->seq, entry->last_frag);
+   netdev_dbg(ieee->dev,
+  "expiring fragment cache entry seq=%u 
last_frag=%u\n",
+  entry->seq, entry->last_frag);
dev_kfree_skb_any(entry->skb);
entry->skb = NULL;
}
@@ -187,8 +187,9 @@ static int rtllib_frag_cache_invalidate(struct 
rtllib_device *ieee,
  hdr->addr1);
 
if (entry == NULL) {
-   RTLLIB_DEBUG_FRAG(
-   "could not invalidate fragment cache entry (seq=%u)\n", 
seq);
+   netdev_dbg(ieee->dev,
+  "Couldn't invalidate fragment cache entry 
(seq=%u)\n",
+  seq);
return -1;
}
 
@@ -305,11 +306,12 @@ rtllib_rx_frame_decrypt(struct rtllib_device *ieee, 
struct sk_buff *skb,
res = crypt->ops->decrypt_mpdu(skb, hdrlen, crypt->priv);
atomic_dec(&crypt->refcnt);
if (res < 0) {
-   RTLLIB_DEBUG_DROP(
-   "decryption failed (SA= %pM) res=%d\n", hdr->addr2, 
res);
+   netdev_dbg(ieee->dev, "decryption failed (SA= %pM) res=%d\n",
+  hdr->addr2, res);
if (res == -2)
-   RTLLIB_DEBUG_DROP("Decryption failed ICV mismatch (key 
%d)\n",
-skb->data[hdrlen + 3] >> 6);
+   netdev_dbg(ieee->dev,
+  "Decryption failed ICV mismatch (key %d)\n",
+  skb->data[hdrlen + 3] >> 6);
ieee->ieee_stats.rx_discards_undecryptable++;
return -1;
}
@@ -840,7 +842,8 @@ static u8 parse_subframe(struct rtllib_device *ieee, struct 
sk_buff *skb,
sub_skb->dev = ieee->dev;
rxb->subframes[rxb->nr_subframes++] = sub_skb;
if (rxb->nr_subframes >= MAX_SUBFRAME_COUNT) {
-   RTLLIB_DEBUG_RX("ParseSubframe(): Too many Subframes! 
Packets dropped!\n");
+   netdev_dbg(ieee->dev,
+  "ParseSubframe(): Too many Subframes! 
Packets dropped!\n");
break;
}
skb_pull(skb, nSubframe_Length);
@@ -991,9 +994,9 @@ static int rtllib_rx_data_filter(struct rtllib_device 
*ieee, u16 fc,
stype != RTLLIB_STYPE_DATA_CFACKPOLL &&
stype != RTLLIB_STYPE_QOS_DATA) {
if (stype != RTLLIB_STYPE_NULLFUNC)
-   RTLLIB_DEBUG_DROP(
-   "RX: dropped data frame with no data 
(type=0x%02x, subtype=0x%02x)\n",
-   type, stype);
+   netdev_dbg(ieee->dev,
+  "RX: dropped data frame with no data 
(type=0x%02x, subtype=0x%02x)\n",
+  

[PATCH v5 14/34] staging: rtl8192e: Remove RTLLIB_DEBUG_MGMT()

2015-05-31 Thread Mateusz Kulikowski
- Use netdev_dbg() instead of RTLLIB_DEBUG_MGMT()
- Remove RTLLIB_DEBUG_MGMT()
- Pass net_device to auth_parse(), auth_rq_parse() and assoc_rq_parse()
- Remove duplicated messages

Signed-off-by: Mateusz Kulikowski 
---
 drivers/staging/rtl8192e/rtllib.h |  2 -
 drivers/staging/rtl8192e/rtllib_rx.c  | 78 +++
 drivers/staging/rtl8192e/rtllib_softmac.c | 50 +---
 3 files changed, 61 insertions(+), 69 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib.h 
b/drivers/staging/rtl8192e/rtllib.h
index c7afb3e..82f4fd9 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -703,8 +703,6 @@ do {
\
 #define RTLLIB_DL_ERR (1<<31)
 #define RTLLIB_DEBUG_INFO(f, a...)   RTLLIB_DEBUG(RTLLIB_DL_INFO, f, ## a)
 
-#define RTLLIB_DEBUG_MGMT(f, a...)  RTLLIB_DEBUG(RTLLIB_DL_MGMT, f, ## a)
-
 #ifndef ETH_P_PAE
 #define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */
 #define ETH_P_IP   0x0800  /* Internet Protocol packet */
diff --git a/drivers/staging/rtl8192e/rtllib_rx.c 
b/drivers/staging/rtl8192e/rtllib_rx.c
index 5a3593b..f9863c4 100644
--- a/drivers/staging/rtl8192e/rtllib_rx.c
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
@@ -1951,12 +1951,10 @@ static void rtllib_parse_mife_generic(struct 
rtllib_device *ieee,
info_element->data[1] == 0x50 &&
info_element->data[2] == 0xf2 &&
info_element->data[3] == 0x04) {
-   RTLLIB_DEBUG_MGMT("MFIE_TYPE_WZC: %d bytes\n",
- info_element->len);
-   network->wzc_ie_len = min(info_element->len+2,
- MAX_WZC_IE_LEN);
-   memcpy(network->wzc_ie, info_element,
-  network->wzc_ie_len);
+   netdev_dbg(ieee->dev, "MFIE_TYPE_WZC: %d bytes\n",
+  info_element->len);
+   network->wzc_ie_len = min(info_element->len+2, MAX_WZC_IE_LEN);
+   memcpy(network->wzc_ie, info_element, network->wzc_ie_len);
}
 }
 
@@ -1975,10 +1973,10 @@ int rtllib_parse_info_param(struct rtllib_device *ieee,
 
while (length >= sizeof(*info_element)) {
if (sizeof(*info_element) + info_element->len > length) {
-   RTLLIB_DEBUG_MGMT("Info elem: parse failed: 
info_element->len + 2 > left : info_element->len+2=%zd left=%d, id=%d.\n",
-info_element->len +
-sizeof(*info_element),
-length, info_element->id);
+   netdev_dbg(ieee->dev,
+  "Info elem: parse failed: info_element->len 
+ 2 > left : info_element->len+2=%zd left=%d, id=%d.\n",
+  info_element->len + sizeof(*info_element),
+  length, info_element->id);
/* We stop processing but don't return an error here
 * because some misbehaviour APs break this rule. ie.
 * Orinoco AP1000.
@@ -2001,8 +1999,8 @@ int rtllib_parse_info_param(struct rtllib_device *ieee,
memset(network->ssid + network->ssid_len, 0,
   IW_ESSID_MAX_SIZE - network->ssid_len);
 
-   RTLLIB_DEBUG_MGMT("MFIE_TYPE_SSID: '%s' len=%d.\n",
-network->ssid, network->ssid_len);
+   netdev_dbg(ieee->dev, "MFIE_TYPE_SSID: '%s' len=%d.\n",
+  network->ssid, network->ssid_len);
break;
 
case MFIE_TYPE_RATES:
@@ -2029,8 +2027,8 @@ int rtllib_parse_info_param(struct rtllib_device *ieee,
}
}
 
-   RTLLIB_DEBUG_MGMT("MFIE_TYPE_RATES: '%s' (%d)\n",
-rates_str, network->rates_len);
+   netdev_dbg(ieee->dev, "MFIE_TYPE_RATES: '%s' (%d)\n",
+  rates_str, network->rates_len);
break;
 
case MFIE_TYPE_RATES_EX:
@@ -2052,22 +2050,22 @@ int rtllib_parse_info_param(struct rtllib_device *ieee,
}
}
 
-   RTLLIB_DEBUG_MGMT("MFIE_TYPE_RATES_EX: '%s' (%d)\n",
-rates_str, network->rates_ex_len);
+   netdev_dbg(ieee->dev, "MFIE_TYPE_RATES_EX: '%s' (%d)\n",
+  rates_str, network->rates_ex_len);
break;
 
case MFIE_TYPE_DS_SET:
-   RTLLIB_DEBUG_MGMT("MFIE_TYPE_DS_SET: %d\n",
-info

[PATCH v5 07/34] staging: rtl8192e: Replace RTLLIB_DEBUG(DL_ERR) with netdev_*()

2015-05-31 Thread Mateusz Kulikowski
Replace all RTLLIB_DEBUG(RTLLIB_DL_ERR, *) calls with netdev_err()
for errors that really should be reported to user.
Use netdev_warn() for the rest.
Rephrase some of the messages to make them more readable/compact.

Signed-off-by: Mateusz Kulikowski 
---
 drivers/staging/rtl8192e/rtl819x_BAProc.c| 79 +---
 drivers/staging/rtl8192e/rtl819x_HTProc.c| 23 
 drivers/staging/rtl8192e/rtl819x_TSProc.c| 19 ---
 drivers/staging/rtl8192e/rtllib_rx.c | 15 --
 drivers/staging/rtl8192e/rtllib_softmac.c|  6 +--
 drivers/staging/rtl8192e/rtllib_softmac_wx.c |  6 +--
 6 files changed, 75 insertions(+), 73 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl819x_BAProc.c 
b/drivers/staging/rtl8192e/rtl819x_BAProc.c
index 5b72bce..7d72c19 100644
--- a/drivers/staging/rtl8192e/rtl819x_BAProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_BAProc.c
@@ -88,12 +88,12 @@ static struct sk_buff *rtllib_ADDBA(struct rtllib_device 
*ieee, u8 *Dst,
 ">%s(), frame(%d) sentd to: %pM, ieee->dev:%p\n",
 __func__, type, Dst, ieee->dev);
if (pBA == NULL) {
-   RTLLIB_DEBUG(RTLLIB_DL_ERR, "pBA is NULL\n");
+   netdev_warn(ieee->dev, "pBA is NULL\n");
return NULL;
}
skb = dev_alloc_skb(len + sizeof(struct rtllib_hdr_3addr));
if (skb == NULL) {
-   RTLLIB_DEBUG(RTLLIB_DL_ERR, "can't alloc skb for ADDBA_REQ\n");
+   netdev_err(ieee->dev, "Can't alloc skb for ADDBA_REQ\n");
return NULL;
}
 
@@ -159,7 +159,7 @@ static struct sk_buff *rtllib_DELBA(struct rtllib_device 
*ieee, u8 *dst,
 
skb = dev_alloc_skb(len + sizeof(struct rtllib_hdr_3addr));
if (skb == NULL) {
-   RTLLIB_DEBUG(RTLLIB_DL_ERR, "can't alloc skb for ADDBA_REQ\n");
+   netdev_err(ieee->dev, "Can't alloc skb for DELBA_REQ\n");
return NULL;
}
 
@@ -247,10 +247,9 @@ int rtllib_rx_ADDBAReq(struct rtllib_device *ieee, struct 
sk_buff *skb)
struct rx_ts_record *pTS = NULL;
 
if (skb->len < sizeof(struct rtllib_hdr_3addr) + 9) {
-   RTLLIB_DEBUG(RTLLIB_DL_ERR,
-" Invalid skb len in BAREQ(%d / %d)\n",
-(int)skb->len,
-(int)(sizeof(struct rtllib_hdr_3addr) + 9));
+   netdev_warn(ieee->dev, "Invalid skb len in BAREQ(%d / %d)\n",
+   (int)skb->len,
+   (int)(sizeof(struct rtllib_hdr_3addr) + 9));
return -1;
}
 
@@ -270,24 +269,24 @@ int rtllib_rx_ADDBAReq(struct rtllib_device *ieee, struct 
sk_buff *skb)
(ieee->pHTInfo->bCurrentHTSupport == false) ||
(ieee->pHTInfo->IOTAction & HT_IOT_ACT_REJECT_ADDBA_REQ)) {
rc = ADDBA_STATUS_REFUSED;
-   RTLLIB_DEBUG(RTLLIB_DL_ERR,
-"Failed to reply on ADDBA_REQ as some capability 
is not ready(%d, %d)\n",
-ieee->current_network.qos_data.active,
-ieee->pHTInfo->bCurrentHTSupport);
+   netdev_warn(ieee->dev,
+   "Failed to reply on ADDBA_REQ as some capability is 
not ready(%d, %d)\n",
+   ieee->current_network.qos_data.active,
+   ieee->pHTInfo->bCurrentHTSupport);
goto OnADDBAReq_Fail;
}
if (!GetTs(ieee, (struct ts_common_info **)(&pTS), dst,
(u8)(pBaParamSet->field.TID), RX_DIR, true)) {
rc = ADDBA_STATUS_REFUSED;
-   RTLLIB_DEBUG(RTLLIB_DL_ERR, "can't get TS in %s()\n", __func__);
+   netdev_warn(ieee->dev, "%s(): can't get TS\n", __func__);
goto OnADDBAReq_Fail;
}
pBA = &pTS->RxAdmittedBARecord;
 
if (pBaParamSet->field.BAPolicy == BA_POLICY_DELAYED) {
rc = ADDBA_STATUS_INVALID_PARAM;
-   RTLLIB_DEBUG(RTLLIB_DL_ERR,
-"BA Policy is not correct in %s()\n", __func__);
+   netdev_warn(ieee->dev, "%s(): BA Policy is not correct\n",
+   __func__);
goto OnADDBAReq_Fail;
}
 
@@ -334,10 +333,9 @@ int rtllib_rx_ADDBARsp(struct rtllib_device *ieee, struct 
sk_buff *skb)
u16 ReasonCode;
 
if (skb->len < sizeof(struct rtllib_hdr_3addr) + 9) {
-   RTLLIB_DEBUG(RTLLIB_DL_ERR,
-"Invalid skb len in BARSP(%d / %d)\n",
-(int)skb->len,
-(int)(sizeof(struct rtllib_hdr_3addr) + 9));
+   netdev_warn(ieee->dev, "Invalid skb len in BARSP(%d / %d)\n",
+   (int)skb->len,
+   (int)(sizeof(struct rtllib_hdr_3addr) + 9));
return -1;
}

[PATCH v5 06/34] staging: rtl8192e: Remove rtllib_crypt.[ch]

2015-05-31 Thread Mateusz Kulikowski
It is neither compiled nor used in rtl8192e.

Signed-off-by: Mateusz Kulikowski 
---
 drivers/staging/rtl8192e/rtllib_crypt.c | 254 
 drivers/staging/rtl8192e/rtllib_crypt.h |  34 -
 2 files changed, 288 deletions(-)
 delete mode 100644 drivers/staging/rtl8192e/rtllib_crypt.c
 delete mode 100644 drivers/staging/rtl8192e/rtllib_crypt.h

diff --git a/drivers/staging/rtl8192e/rtllib_crypt.c 
b/drivers/staging/rtl8192e/rtllib_crypt.c
deleted file mode 100644
index 1e6ae9b..000
--- a/drivers/staging/rtl8192e/rtllib_crypt.c
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
- * Host AP crypto routines
- *
- * Copyright (c) 2002-2003, Jouni Malinen 
- * Portions Copyright (C) 2004, Intel Corporation 
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation. See README and COPYING for
- * more details.
- *
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include "rtllib.h"
-
-struct rtllib_crypto_alg {
-   struct list_head list;
-   struct lib80211_crypto_ops *ops;
-};
-
-
-struct rtllib_crypto {
-   struct list_head algs;
-   spinlock_t lock;
-};
-
-static struct rtllib_crypto *hcrypt;
-
-void rtllib_crypt_deinit_entries(struct lib80211_crypt_info *info,
-  int force)
-{
-   struct list_head *ptr, *n;
-   struct lib80211_crypt_data *entry;
-
-   for (ptr = info->crypt_deinit_list.next, n = ptr->next;
-ptr != &info->crypt_deinit_list; ptr = n, n = ptr->next) {
-   entry = list_entry(ptr, struct lib80211_crypt_data, list);
-
-   if (atomic_read(&entry->refcnt) != 0 && !force)
-   continue;
-
-   list_del(ptr);
-
-   if (entry->ops)
-   entry->ops->deinit(entry->priv);
-   kfree(entry);
-   }
-}
-EXPORT_SYMBOL(rtllib_crypt_deinit_entries);
-
-void rtllib_crypt_deinit_handler(unsigned long data)
-{
-   struct lib80211_crypt_info *info = (struct lib80211_crypt_info *)data;
-   unsigned long flags;
-
-   spin_lock_irqsave(info->lock, flags);
-   rtllib_crypt_deinit_entries(info, 0);
-   if (!list_empty(&info->crypt_deinit_list)) {
-   printk(KERN_DEBUG
-  "%s: entries remaining in delayed crypt deletion list\n",
-  info->name);
-   info->crypt_deinit_timer.expires = jiffies + HZ;
-   add_timer(&info->crypt_deinit_timer);
-   }
-   spin_unlock_irqrestore(info->lock, flags);
-
-}
-EXPORT_SYMBOL(rtllib_crypt_deinit_handler);
-
-void rtllib_crypt_delayed_deinit(struct lib80211_crypt_info *info,
-struct lib80211_crypt_data **crypt)
-{
-   struct lib80211_crypt_data *tmp;
-   unsigned long flags;
-
-   if (*crypt == NULL)
-   return;
-
-   tmp = *crypt;
-   *crypt = NULL;
-
-   /* must not run ops->deinit() while there may be pending encrypt or
-* decrypt operations. Use a list of delayed deinits to avoid needing
-* locking.
-*/
-
-   spin_lock_irqsave(info->lock, flags);
-   list_add(&tmp->list, &info->crypt_deinit_list);
-   if (!timer_pending(&info->crypt_deinit_timer)) {
-   info->crypt_deinit_timer.expires = jiffies + HZ;
-   add_timer(&info->crypt_deinit_timer);
-   }
-   spin_unlock_irqrestore(info->lock, flags);
-}
-EXPORT_SYMBOL(rtllib_crypt_delayed_deinit);
-
-int rtllib_register_crypto_ops(struct lib80211_crypto_ops *ops)
-{
-   unsigned long flags;
-   struct rtllib_crypto_alg *alg;
-
-   if (hcrypt == NULL)
-   return -1;
-
-   alg = kzalloc(sizeof(*alg), GFP_KERNEL);
-   if (alg == NULL)
-   return -ENOMEM;
-
-   alg->ops = ops;
-
-   spin_lock_irqsave(&hcrypt->lock, flags);
-   list_add(&alg->list, &hcrypt->algs);
-   spin_unlock_irqrestore(&hcrypt->lock, flags);
-
-   printk(KERN_DEBUG "rtllib_crypt: registered algorithm '%s'\n",
-  ops->name);
-
-   return 0;
-}
-EXPORT_SYMBOL(rtllib_register_crypto_ops);
-
-int rtllib_unregister_crypto_ops(struct lib80211_crypto_ops *ops)
-{
-   unsigned long flags;
-   struct list_head *ptr;
-   struct rtllib_crypto_alg *del_alg = NULL;
-
-   if (hcrypt == NULL)
-   return -1;
-
-   spin_lock_irqsave(&hcrypt->lock, flags);
-   for (ptr = hcrypt->algs.next; ptr != &hcrypt->algs; ptr = ptr->next) {
-   struct rtllib_crypto_alg *alg =
-   (struct rtllib_crypto_alg *) ptr;
-   if (alg->ops == ops) {
-   list_del(&alg->list);
-   del_alg = alg;
-   break;
-   }
-   }
-   spin_unlock_irqrestore(&hcrypt->lock, flags);
-
-   if (del_alg) {
-  

[PATCH v5 01/34] staging: rtl8192e: accept const MAC address

2015-05-31 Thread Mateusz Kulikowski
Make set_swcam, setKey and rtllib_probe_resp parameter (MAC address)
const.

Signed-off-by: Mateusz Kulikowski 
---
 drivers/staging/rtl8192e/rtl8192e/rtl_cam.c | 4 ++--
 drivers/staging/rtl8192e/rtl8192e/rtl_cam.h | 4 ++--
 drivers/staging/rtl8192e/rtllib_softmac.c   | 3 ++-
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c
index 41b025e..0ffade4 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c
@@ -81,7 +81,7 @@ void EnableHWSecurityConfig8192(struct net_device *dev)
 }
 
 void set_swcam(struct net_device *dev, u8 EntryNo, u8 KeyIndex, u16 KeyType,
-  u8 *MacAddr, u8 DefaultKey, u32 *KeyContent, u8 is_mesh)
+  const u8 *MacAddr, u8 DefaultKey, u32 *KeyContent, u8 is_mesh)
 {
struct r8192_priv *priv = rtllib_priv(dev);
struct rtllib_device *ieee = priv->rtllib;
@@ -100,7 +100,7 @@ void set_swcam(struct net_device *dev, u8 EntryNo, u8 
KeyIndex, u16 KeyType,
 }
 
 void setKey(struct net_device *dev, u8 EntryNo, u8 KeyIndex, u16 KeyType,
-   u8 *MacAddr, u8 DefaultKey, u32 *KeyContent)
+   const u8 *MacAddr, u8 DefaultKey, u32 *KeyContent)
 {
u32 TargetCommand = 0;
u32 TargetContent = 0;
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_cam.h 
b/drivers/staging/rtl8192e/rtl8192e/rtl_cam.h
index 3c4c0e6..864a7f6 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_cam.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_cam.h
@@ -31,9 +31,9 @@ struct net_device;
 void CamResetAllEntry(struct net_device *dev);
 void EnableHWSecurityConfig8192(struct net_device *dev);
 void setKey(struct net_device *dev, u8 EntryNo, u8 KeyIndex, u16 KeyType,
-   u8 *MacAddr, u8 DefaultKey, u32 *KeyContent);
+   const u8 *MacAddr, u8 DefaultKey, u32 *KeyContent);
 void set_swcam(struct net_device *dev, u8 EntryNo, u8 KeyIndex, u16 KeyType,
-  u8 *MacAddr, u8 DefaultKey, u32 *KeyContent, u8 is_mesh);
+  const u8 *MacAddr, u8 DefaultKey, u32 *KeyContent, u8 is_mesh);
 void CamPrintDbgReg(struct net_device *dev);
 
 u32 read_cam(struct net_device *dev, u8 addr);
diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c 
b/drivers/staging/rtl8192e/rtllib_softmac.c
index 98afd3b..cd758fe 100644
--- a/drivers/staging/rtl8192e/rtllib_softmac.c
+++ b/drivers/staging/rtl8192e/rtllib_softmac.c
@@ -832,7 +832,8 @@ inline struct sk_buff *rtllib_authentication_req(struct 
rtllib_network *beacon,
return skb;
 }
 
-static struct sk_buff *rtllib_probe_resp(struct rtllib_device *ieee, u8 *dest)
+static struct sk_buff *rtllib_probe_resp(struct rtllib_device *ieee,
+const u8 *dest)
 {
u8 *tag;
int beacon_size;
-- 
1.8.4.1

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


[PATCH v5 05/34] staging: rtl8192e: Replace memcmp() with ether_addr_equal()

2015-05-31 Thread Mateusz Kulikowski
Use dedicated macro to compare ethernet addresses in probe_rq_parse().

Signed-off-by: Mateusz Kulikowski 
---
 drivers/staging/rtl8192e/rtllib_softmac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c 
b/drivers/staging/rtl8192e/rtllib_softmac.c
index 2f562de..5d69f98b 100644
--- a/drivers/staging/rtl8192e/rtllib_softmac.c
+++ b/drivers/staging/rtl8192e/rtllib_softmac.c
@@ -1853,7 +1853,7 @@ static short probe_rq_parse(struct rtllib_device *ieee, 
struct sk_buff *skb,
return -1; /* corrupted */
 
bssid_match =
- (memcmp(header->addr3, ieee->current_network.bssid, ETH_ALEN) != 0) &&
+ (!ether_addr_equal(header->addr3, ieee->current_network.bssid)) &&
  (!is_broadcast_ether_addr(header->addr3));
if (bssid_match)
return -1;
-- 
1.8.4.1

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


[PATCH v5 03/34] staging: rtl8192e: Fix PREFER_ETHER_ADDR_COPY warnings

2015-05-31 Thread Mateusz Kulikowski
Replace memcpy() with ether_addr_copy() where possible to make
checkpatch.pl happy.
Change was target tested (download 1Mb file over WPA2 network)
with BUG trap for unaligned addresses in ether_addr_copy()

Signed-off-by: Mateusz Kulikowski 
---
 drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c |  2 +-
 drivers/staging/rtl8192e/rtl819x_BAProc.c  | 13 +++---
 drivers/staging/rtl8192e/rtllib_crypt_tkip.c   | 19 
 drivers/staging/rtl8192e/rtllib_rx.c   | 46 +-
 drivers/staging/rtl8192e/rtllib_softmac.c  | 64 +-
 drivers/staging/rtl8192e/rtllib_softmac_wx.c   |  4 +-
 drivers/staging/rtl8192e/rtllib_tx.c   | 24 +-
 7 files changed, 89 insertions(+), 83 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c 
b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
index 926fca7..f9c6153 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
@@ -382,7 +382,7 @@ static void rtl8192_read_eeprom_info(struct net_device *dev)
*(u16 *)(&dev->dev_addr[i]) = usValue;
}
} else {
-   memcpy(dev->dev_addr, bMac_Tmp_Addr, 6);
+   ether_addr_copy(dev->dev_addr, bMac_Tmp_Addr);
}
 
RT_TRACE(COMP_INIT, "Permanent Address = %pM\n",
diff --git a/drivers/staging/rtl8192e/rtl819x_BAProc.c 
b/drivers/staging/rtl8192e/rtl819x_BAProc.c
index 26258ea..5b72bce 100644
--- a/drivers/staging/rtl8192e/rtl819x_BAProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_BAProc.c
@@ -18,6 +18,7 @@
 **/
 #include 
 #include 
+#include 
 #include "rtllib.h"
 #include "rtl819x_BA.h"
 
@@ -103,10 +104,10 @@ static struct sk_buff *rtllib_ADDBA(struct rtllib_device 
*ieee, u8 *Dst,
BAReq = (struct rtllib_hdr_3addr *)skb_put(skb,
 sizeof(struct rtllib_hdr_3addr));
 
-   memcpy(BAReq->addr1, Dst, ETH_ALEN);
-   memcpy(BAReq->addr2, ieee->dev->dev_addr, ETH_ALEN);
+   ether_addr_copy(BAReq->addr1, Dst);
+   ether_addr_copy(BAReq->addr2, ieee->dev->dev_addr);
 
-   memcpy(BAReq->addr3, ieee->current_network.bssid, ETH_ALEN);
+   ether_addr_copy(BAReq->addr3, ieee->current_network.bssid);
BAReq->frame_ctl = cpu_to_le16(RTLLIB_STYPE_MANAGE_ACT);
 
tag = (u8 *)skb_put(skb, 9);
@@ -167,9 +168,9 @@ static struct sk_buff *rtllib_DELBA(struct rtllib_device 
*ieee, u8 *dst,
Delba = (struct rtllib_hdr_3addr *) skb_put(skb,
 sizeof(struct rtllib_hdr_3addr));
 
-   memcpy(Delba->addr1, dst, ETH_ALEN);
-   memcpy(Delba->addr2, ieee->dev->dev_addr, ETH_ALEN);
-   memcpy(Delba->addr3, ieee->current_network.bssid, ETH_ALEN);
+   ether_addr_copy(Delba->addr1, dst);
+   ether_addr_copy(Delba->addr2, ieee->dev->dev_addr);
+   ether_addr_copy(Delba->addr3, ieee->current_network.bssid);
Delba->frame_ctl = cpu_to_le16(RTLLIB_STYPE_MANAGE_ACT);
 
tag = (u8 *)skb_put(skb, 6);
diff --git a/drivers/staging/rtl8192e/rtllib_crypt_tkip.c 
b/drivers/staging/rtl8192e/rtllib_crypt_tkip.c
index cdad066..6b20479 100644
--- a/drivers/staging/rtl8192e/rtllib_crypt_tkip.c
+++ b/drivers/staging/rtl8192e/rtllib_crypt_tkip.c
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "rtllib.h"
 
@@ -533,20 +534,20 @@ static void michael_mic_hdr(struct sk_buff *skb, u8 *hdr)
switch (le16_to_cpu(hdr11->frame_ctl) &
(RTLLIB_FCTL_FROMDS | RTLLIB_FCTL_TODS)) {
case RTLLIB_FCTL_TODS:
-   memcpy(hdr, hdr11->addr3, ETH_ALEN); /* DA */
-   memcpy(hdr + ETH_ALEN, hdr11->addr2, ETH_ALEN); /* SA */
+   ether_addr_copy(hdr, hdr11->addr3); /* DA */
+   ether_addr_copy(hdr + ETH_ALEN, hdr11->addr2); /* SA */
break;
case RTLLIB_FCTL_FROMDS:
-   memcpy(hdr, hdr11->addr1, ETH_ALEN); /* DA */
-   memcpy(hdr + ETH_ALEN, hdr11->addr3, ETH_ALEN); /* SA */
+   ether_addr_copy(hdr, hdr11->addr1); /* DA */
+   ether_addr_copy(hdr + ETH_ALEN, hdr11->addr3); /* SA */
break;
case RTLLIB_FCTL_FROMDS | RTLLIB_FCTL_TODS:
-   memcpy(hdr, hdr11->addr3, ETH_ALEN); /* DA */
-   memcpy(hdr + ETH_ALEN, hdr11->addr4, ETH_ALEN); /* SA */
+   ether_addr_copy(hdr, hdr11->addr3); /* DA */
+   ether_addr_copy(hdr + ETH_ALEN, hdr11->addr4); /* SA */
break;
case 0:
-   memcpy(hdr, hdr11->addr1, ETH_ALEN); /* DA */
-   memcpy(hdr + ETH_ALEN, hdr11->addr2, ETH_ALEN); /* SA */
+   ether_addr_copy(hdr, hdr11->addr1); /* DA */
+   ether_addr_copy(hdr + ETH_ALEN, hdr11->addr2); /* SA */
break;
}
 
@@ -599,7 +600,7 @@ static void rtllib_michael_mic_failure(struct net_device 
*dev,
else

[PATCH v5 15/34] staging: rtl8192e: Remove RTLLIB_DEBUG_INFO()

2015-05-31 Thread Mateusz Kulikowski
Use pr_debug() instead.

Signed-off-by: Mateusz Kulikowski 
---
 drivers/staging/rtl8192e/rtllib.h| 1 -
 drivers/staging/rtl8192e/rtllib_module.c | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib.h 
b/drivers/staging/rtl8192e/rtllib.h
index 82f4fd9..655f5fa 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -701,7 +701,6 @@ do {
\
 #define RTLLIB_DL_TRACE   (1<<29)
 #define RTLLIB_DL_DATA(1<<30)
 #define RTLLIB_DL_ERR (1<<31)
-#define RTLLIB_DEBUG_INFO(f, a...)   RTLLIB_DEBUG(RTLLIB_DL_INFO, f, ## a)
 
 #ifndef ETH_P_PAE
 #define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */
diff --git a/drivers/staging/rtl8192e/rtllib_module.c 
b/drivers/staging/rtl8192e/rtllib_module.c
index b8c7df5..b61035b 100644
--- a/drivers/staging/rtl8192e/rtllib_module.c
+++ b/drivers/staging/rtl8192e/rtllib_module.c
@@ -103,7 +103,7 @@ struct net_device *alloc_rtllib(int sizeof_priv)
struct net_device *dev;
int i, err;
 
-   RTLLIB_DEBUG_INFO("Initializing...\n");
+   pr_debug("rtllib: Initializing...\n");
 
dev = alloc_etherdev(sizeof(struct rtllib_device) + sizeof_priv);
if (!dev) {
-- 
1.8.4.1

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


[PATCH v5 17/34] staging: rtl8192e: Remove RTLLIB_DEBUG_DATA()

2015-05-31 Thread Mateusz Kulikowski
Use print_hex_dump_bytes() if VERBOSE_DEBUG is enabled.

Signed-off-by: Mateusz Kulikowski 
---
 drivers/staging/rtl8192e/rtl819x_BAProc.c | 20 
 drivers/staging/rtl8192e/rtl819x_HTProc.c |  7 +--
 drivers/staging/rtl8192e/rtllib.h | 11 ---
 drivers/staging/rtl8192e/rtllib_tx.c  |  5 -
 4 files changed, 25 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl819x_BAProc.c 
b/drivers/staging/rtl8192e/rtl819x_BAProc.c
index 39d28e3..25765b8 100644
--- a/drivers/staging/rtl8192e/rtl819x_BAProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_BAProc.c
@@ -133,7 +133,10 @@ static struct sk_buff *rtllib_ADDBA(struct rtllib_device 
*ieee, u8 *Dst,
tag += 2;
}
 
-   RTLLIB_DEBUG_DATA(RTLLIB_DL_DATA|RTLLIB_DL_BA, skb->data, skb->len);
+#ifdef VERBOSE_DEBUG
+   print_hex_dump_bytes("rtllib_ADDBA(): ", DUMP_PREFIX_NONE, skb->data,
+skb->len);
+#endif
return skb;
 }
 
@@ -184,7 +187,10 @@ static struct sk_buff *rtllib_DELBA(struct rtllib_device 
*ieee, u8 *dst,
put_unaligned_le16(ReasonCode, tag);
tag += 2;
 
-   RTLLIB_DEBUG_DATA(RTLLIB_DL_DATA|RTLLIB_DL_BA, skb->data, skb->len);
+#ifdef VERBOSE_DEBUG
+   print_hex_dump_bytes("rtllib_DELBA(): ", DUMP_PREFIX_NONE, skb->data,
+skb->len);
+#endif
return skb;
 }
 
@@ -246,7 +252,10 @@ int rtllib_rx_ADDBAReq(struct rtllib_device *ieee, struct 
sk_buff *skb)
return -1;
}
 
-   RTLLIB_DEBUG_DATA(RTLLIB_DL_DATA|RTLLIB_DL_BA, skb->data, skb->len);
+#ifdef VERBOSE_DEBUG
+   print_hex_dump_bytes("rtllib_rx_ADDBAReq(): ", DUMP_PREFIX_NONE,
+skb->data, skb->len);
+#endif
 
req = (struct rtllib_hdr_3addr *) skb->data;
tag = (u8 *)req;
@@ -442,7 +451,10 @@ int rtllib_rx_DELBA(struct rtllib_device *ieee, struct 
sk_buff *skb)
return -1;
}
 
-   RTLLIB_DEBUG_DATA(RTLLIB_DL_DATA|RTLLIB_DL_BA, skb->data, skb->len);
+#ifdef VERBOSE_DEBUG
+   print_hex_dump_bytes("rtllib_rx_DELBA(): ", DUMP_PREFIX_NONE, skb->data,
+skb->len);
+#endif
delba = (struct rtllib_hdr_3addr *)skb->data;
dst = (u8 *)(&delba->addr2[0]);
delba += sizeof(struct rtllib_hdr_3addr);
diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c 
b/drivers/staging/rtl8192e/rtl819x_HTProc.c
index 584f7a9..3edd5d1 100644
--- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
@@ -553,8 +553,11 @@ void HTOnAssocRsp(struct rtllib_device *ieee)
else
pPeerHTInfo = (struct ht_info_ele *)(pHTInfo->PeerHTInfoBuf);
 
-   RTLLIB_DEBUG_DATA(RTLLIB_DL_DATA | RTLLIB_DL_HT, pPeerHTCap,
- sizeof(struct ht_capab_ele));
+
+#ifdef VERBOSE_DEBUG
+   print_hex_dump_bytes("HTOnAssocRsp(): ", DUMP_PREFIX_NONE,
+pPeerHTCap, sizeof(struct ht_capab_ele));
+#endif
HTSetConnectBwMode(ieee, (enum ht_channel_width)(pPeerHTCap->ChlWidth),
  (enum ht_extchnl_offset)(pPeerHTInfo->ExtChlOffset));
pHTInfo->bCurTxBW40MHz = ((pPeerHTInfo->RecommemdedTxWidth == 1) ?
diff --git a/drivers/staging/rtl8192e/rtllib.h 
b/drivers/staging/rtl8192e/rtllib.h
index da179a5..e26a236 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -642,17 +642,6 @@ enum wireless_network_type {
 #define OUI_SUBTYPE_QOS_CAPABI 5
 
 /* debug macros */
-extern u32 rtllib_debug_level;
-
-#define RTLLIB_DEBUG_DATA(level, data, datalen)\
-   do {\
-   if ((rtllib_debug_level & (level)) == (level)) {\
-   printk(KERN_DEBUG "rtllib: %s()\n", __func__);  \
-   print_hex_dump_bytes(KERN_DEBUG, DUMP_PREFIX_NONE, \
-data, datalen); \
-   }   \
-   } while (0)
-
 /* To use the debug system;
  *
  * If you are defining a new debug classification, simply add it to the #define
diff --git a/drivers/staging/rtl8192e/rtllib_tx.c 
b/drivers/staging/rtl8192e/rtllib_tx.c
index 8ef820d..7047d2c 100644
--- a/drivers/staging/rtl8192e/rtllib_tx.c
+++ b/drivers/staging/rtl8192e/rtllib_tx.c
@@ -260,7 +260,10 @@ static int rtllib_classify(struct sk_buff *skb, u8 
bIsAmsdu)
if (eth->h_proto != htons(ETH_P_IP))
return 0;
 
-   RTLLIB_DEBUG_DATA(RTLLIB_DL_DATA, skb->data, skb->len);
+#ifdef VERBOSE_DEBUG
+   print_hex_dump_bytes("rtllib_classify(): ", DUMP_PREFIX_NONE, skb->data,
+skb->len);
+#endif
ip = ip_hdr(skb);
switch (ip->tos & 0xfc) {
case 0x20:
-- 
1.8.4.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdri

[PATCH v5 13/34] staging: rtl8192e: Remove RTLLIB_DEBUG_QOS()

2015-05-31 Thread Mateusz Kulikowski
- Pass extra argument (rtllib_device) to rtllib_parse_qos_info_param_IE()
  and update_network()
- Replace RTLLIB_DEBUG_QOS() with netdev_dbg()
- Remove RTLLIB_DEBUG_QOS()

Signed-off-by: Mateusz Kulikowski 
---
 drivers/staging/rtl8192e/rtllib.h|  1 -
 drivers/staging/rtl8192e/rtllib_rx.c | 26 ++
 2 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib.h 
b/drivers/staging/rtl8192e/rtllib.h
index b20090d..c7afb3e 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -704,7 +704,6 @@ do {
\
 #define RTLLIB_DEBUG_INFO(f, a...)   RTLLIB_DEBUG(RTLLIB_DL_INFO, f, ## a)
 
 #define RTLLIB_DEBUG_MGMT(f, a...)  RTLLIB_DEBUG(RTLLIB_DL_MGMT, f, ## a)
-#define RTLLIB_DEBUG_QOS(f, a...)  RTLLIB_DEBUG(RTLLIB_DL_QOS, f, ## a)
 
 #ifndef ETH_P_PAE
 #define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */
diff --git a/drivers/staging/rtl8192e/rtllib_rx.c 
b/drivers/staging/rtl8192e/rtllib_rx.c
index 8ea3e2f..5a3593b 100644
--- a/drivers/staging/rtl8192e/rtllib_rx.c
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
@@ -1657,9 +1657,10 @@ static int rtllib_qos_convert_ac_to_parameters(struct 
rtllib_qos_parameter_info
  * parameters element. check the information element length to decide
  * which type to read
  */
-static int rtllib_parse_qos_info_param_IE(struct rtllib_info_element
+static int rtllib_parse_qos_info_param_IE(struct rtllib_device *ieee,
+ struct rtllib_info_element
 *info_element,
-struct rtllib_network *network)
+ struct rtllib_network *network)
 {
int rc = 0;
struct rtllib_qos_information_element qos_info_element;
@@ -1684,7 +1685,7 @@ static int rtllib_parse_qos_info_param_IE(struct 
rtllib_info_element
}
 
if (rc == 0) {
-   RTLLIB_DEBUG_QOS("QoS is supported\n");
+   netdev_dbg(ieee->dev, "QoS is supported\n");
network->qos_data.supported = 1;
}
return rc;
@@ -1761,7 +1762,7 @@ static void rtllib_parse_mife_generic(struct 
rtllib_device *ieee,
u16 ht_realtek_agg_len = 0;
u8  ht_realtek_agg_buf[MAX_IE_LEN];
 
-   if (!rtllib_parse_qos_info_param_IE(info_element, network))
+   if (!rtllib_parse_qos_info_param_IE(ieee, info_element, network))
return;
if (info_element->len >= 4 &&
info_element->data[0] == 0x00 &&
@@ -2352,7 +2353,8 @@ static inline int is_same_network(struct rtllib_network 
*src,
 }
 
 
-static inline void update_network(struct rtllib_network *dst,
+static inline void update_network(struct rtllib_device *ieee,
+ struct rtllib_network *dst,
  struct rtllib_network *src)
 {
int qos_active;
@@ -2426,12 +2428,12 @@ static inline void update_network(struct rtllib_network 
*dst,
   sizeof(struct rtllib_qos_data));
if (dst->qos_data.supported == 1) {
if (dst->ssid_len)
-   RTLLIB_DEBUG_QOS
-   ("QoS the network %s is QoS supported\n",
-   dst->ssid);
+   netdev_dbg(ieee->dev,
+  "QoS the network %s is QoS supported\n",
+  dst->ssid);
else
-   RTLLIB_DEBUG_QOS
-   ("QoS the network is QoS supported\n");
+   netdev_dbg(ieee->dev,
+  "QoS the network is QoS supported\n");
}
dst->qos_data.active = qos_active;
dst->qos_data.old_param_count = old_param;
@@ -2567,7 +2569,7 @@ static inline void rtllib_process_probe_response(
spin_lock_irqsave(&ieee->lock, flags);
if (is_same_network(&ieee->current_network, network,
   (network->ssid_len ? 1 : 0))) {
-   update_network(&ieee->current_network, network);
+   update_network(ieee, &ieee->current_network, network);
if ((ieee->current_network.mode == IEEE_N_24G ||
 ieee->current_network.mode == IEEE_G)
 && ieee->current_network.berp_info_valid) {
@@ -2637,7 +2639,7 @@ static inline void rtllib_process_probe_response(
network->ssid_len) == 0) &&
(ieee->state == RTLLIB_NOLINK
renew = 1;
-   update_network(target, network);
+   update_network(ieee, target, network);
if (renew && (ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE))
rtllib_softmac_new_net(ieee, network);
}
-- 
1.8.4.1

___
devel maili

[PATCH v5 30/34] staging: rtl8192e: rtl8192_phy_checkBBAndRF(): Don't check MAC

2015-05-31 Thread Mateusz Kulikowski
This function never supported checking of MAC block.
Instead of printing several warnings - print it once and exit.

Signed-off-by: Mateusz Kulikowski 
---
 drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c | 12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c 
b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
index 0765c97..6c4832c 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
@@ -504,13 +504,15 @@ bool rtl8192_phy_checkBBAndRF(struct net_device *dev,
WriteAddr[HW90_BLOCK_RF] = 0x3;
RT_TRACE(COMP_PHY, "===>%s(), CheckBlock:%d\n", __func__,
 CheckBlock);
+
+   if (CheckBlock == HW90_BLOCK_MAC) {
+   netdev_warn(dev, "%s(): No checks available for MAC block.\n",
+   __func__);
+   return ret;
+   }
+
for (i = 0; i < CheckTimes; i++) {
switch (CheckBlock) {
-   case HW90_BLOCK_MAC:
-   RT_TRACE(COMP_ERR,
-"PHY_CheckBBRFOK(): Never Write 0x100 here!");
-   break;
-
case HW90_BLOCK_PHY0:
case HW90_BLOCK_PHY1:
write_nic_dword(dev, WriteAddr[CheckBlock],
-- 
1.8.4.1

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


[PATCH v5 29/34] staging: rtl8192e: Remove unneeded RT_TRACE(COMP_ERR, ...)

2015-05-31 Thread Mateusz Kulikowski
This messages are not needed, as failure is reported earlier in code.

Signed-off-by: Mateusz Kulikowski 
---
 drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c  | 1 -
 drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c | 1 -
 2 files changed, 2 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c 
b/drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c
index 01d2201..f080a91 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c
@@ -239,7 +239,6 @@ bool phy_RF8256_Config_ParaFile(struct net_device *dev)
return true;
 
 phy_RF8256_Config_ParaFile_Fail:
-   RT_TRACE(COMP_ERR, "PHY Initialization failed\n");
return false;
 }
 
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c 
b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
index 02c5b0a..54e430e 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
@@ -171,7 +171,6 @@ static bool CPUcheck_firmware_ready(struct net_device *dev)
return rt_status;
 
 CPUCheckFirmwareReady_Fail:
-   RT_TRACE(COMP_ERR, "ERR in %s()\n", __func__);
rt_status = false;
return rt_status;
 
-- 
1.8.4.1

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


[PATCH v5 22/34] staging: rtl8192e: Fix LONG_LING in rtllib_parse_info_param()

2015-05-31 Thread Mateusz Kulikowski
Take out MIFE_TYPE_HT_CAP processing into separate function -
rtllib_parse_mfie_ht_cap()

Signed-off-by: Mateusz Kulikowski 
---
 drivers/staging/rtl8192e/rtllib_rx.c | 49 +---
 1 file changed, 29 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib_rx.c 
b/drivers/staging/rtl8192e/rtllib_rx.c
index 8e3aabf..588c6d7 100644
--- a/drivers/staging/rtl8192e/rtllib_rx.c
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
@@ -2010,6 +2010,33 @@ static void rtllib_parse_mife_generic(struct 
rtllib_device *ieee,
}
 }
 
+static void rtllib_parse_mfie_ht_cap(struct rtllib_info_element *info_element,
+struct rtllib_network *network,
+u16 *tmp_htcap_len)
+{
+   struct bss_ht *ht = &network->bssht;
+
+   *tmp_htcap_len = min_t(u8, info_element->len, MAX_IE_LEN);
+   if (*tmp_htcap_len != 0) {
+   ht->bdHTSpecVer = HT_SPEC_VER_EWC;
+   ht->bdHTCapLen = min_t(u16, *tmp_htcap_len,
+  sizeof(ht->bdHTCapBuf));
+   memcpy(ht->bdHTCapBuf, info_element->data, ht->bdHTCapLen);
+
+   ht->bdSupportHT = true;
+   ht->bdHT1R = struct ht_capab_ele *)
+   ht->bdHTCapBuf))->MCS[1]) == 0;
+
+   ht->bdBandWidth = (enum ht_channel_width)
+(((struct ht_capab_ele *)
+(ht->bdHTCapBuf))->ChlWidth);
+   } else {
+   ht->bdSupportHT = false;
+   ht->bdHT1R = false;
+   ht->bdBandWidth = HT_CHANNEL_WIDTH_20;
+   }
+}
+
 int rtllib_parse_info_param(struct rtllib_device *ieee,
struct rtllib_info_element *info_element,
u16 length,
@@ -2191,27 +2218,9 @@ int rtllib_parse_info_param(struct rtllib_device *ieee,
case MFIE_TYPE_HT_CAP:
netdev_dbg(ieee->dev, "MFIE_TYPE_HT_CAP: %d bytes\n",
   info_element->len);
-   tmp_htcap_len = min_t(u8, info_element->len, 
MAX_IE_LEN);
-   if (tmp_htcap_len != 0) {
-   network->bssht.bdHTSpecVer = HT_SPEC_VER_EWC;
-   network->bssht.bdHTCapLen = tmp_htcap_len > 
sizeof(network->bssht.bdHTCapBuf) ?
-   sizeof(network->bssht.bdHTCapBuf) : 
tmp_htcap_len;
-   memcpy(network->bssht.bdHTCapBuf,
-  info_element->data,
-  network->bssht.bdHTCapLen);
 
-   network->bssht.bdSupportHT = true;
-   network->bssht.bdHT1R = struct ht_capab_ele 
*)
-   
network->bssht.bdHTCapBuf))->MCS[1]) == 0;
-
-   network->bssht.bdBandWidth = (enum 
ht_channel_width)
-(((struct 
ht_capab_ele *)
-
(network->bssht.bdHTCapBuf))->ChlWidth);
-   } else {
-   network->bssht.bdSupportHT = false;
-   network->bssht.bdHT1R = false;
-   network->bssht.bdBandWidth = 
HT_CHANNEL_WIDTH_20;
-   }
+   rtllib_parse_mfie_ht_cap(info_element, network,
+&tmp_htcap_len);
break;
 
 
-- 
1.8.4.1

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


[PATCH v5 28/34] staging: rtl8192e: Replace ?: with max

2015-05-31 Thread Mateusz Kulikowski
All get_key implementations return either -1 or small buffers, so
cast int->u16 is not a problem.

Signed-off-by: Mateusz Kulikowski 
---
 drivers/staging/rtl8192e/rtllib_wx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/rtllib_wx.c 
b/drivers/staging/rtl8192e/rtllib_wx.c
index 2ac1617..f31d864 100644
--- a/drivers/staging/rtl8192e/rtllib_wx.c
+++ b/drivers/staging/rtl8192e/rtllib_wx.c
@@ -510,7 +510,8 @@ int rtllib_wx_get_encode(struct rtllib_device *ieee,
return 0;
}
len = crypt->ops->get_key(keybuf, SCM_KEY_LEN, NULL, crypt->priv);
-   erq->length = (len >= 0 ? len : 0);
+
+   erq->length = max(len, 0);
 
erq->flags |= IW_ENCODE_ENABLED;
 
-- 
1.8.4.1

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


[PATCH v5 16/34] staging: rtl8192e: Remove RTLLIB_DEBUG()

2015-05-31 Thread Mateusz Kulikowski
- Use netdev_dbg or netdev_vdbg instead of RTLLIB_DEBUG()
- Reformat some messages for better readability
- Remove RTLLIB_DEBUG messages that make no sense

Signed-off-by: Mateusz Kulikowski 
---
 drivers/staging/rtl8192e/rtl819x_BAProc.c | 35 +
 drivers/staging/rtl8192e/rtl819x_HTProc.c | 21 ++---
 drivers/staging/rtl8192e/rtl819x_TSProc.c | 35 +
 drivers/staging/rtl8192e/rtllib.h |  5 ---
 drivers/staging/rtl8192e/rtllib_rx.c  | 52 +--
 5 files changed, 67 insertions(+), 81 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl819x_BAProc.c 
b/drivers/staging/rtl8192e/rtl819x_BAProc.c
index 7d72c19..39d28e3 100644
--- a/drivers/staging/rtl8192e/rtl819x_BAProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_BAProc.c
@@ -84,9 +84,9 @@ static struct sk_buff *rtllib_ADDBA(struct rtllib_device 
*ieee, u8 *Dst,
u8 *tag = NULL;
u16 len = ieee->tx_headroom + 9;
 
-   RTLLIB_DEBUG(RTLLIB_DL_TRACE | RTLLIB_DL_BA,
-">%s(), frame(%d) sentd to: %pM, ieee->dev:%p\n",
-__func__, type, Dst, ieee->dev);
+   netdev_dbg(ieee->dev, "%s(): frame(%d) sentd to: %pM, ieee->dev:%p\n",
+  __func__, type, Dst, ieee->dev);
+
if (pBA == NULL) {
netdev_warn(ieee->dev, "pBA is NULL\n");
return NULL;
@@ -148,9 +148,8 @@ static struct sk_buff *rtllib_DELBA(struct rtllib_device 
*ieee, u8 *dst,
u16 len = 6 + ieee->tx_headroom;
 
if (net_ratelimit())
-   RTLLIB_DEBUG(RTLLIB_DL_TRACE | RTLLIB_DL_BA,
-">%s(), ReasonCode(%d) sentd to: %pM\n",
-__func__, ReasonCode, dst);
+   netdev_dbg(ieee->dev, "%s(): ReasonCode(%d) sentd to: %pM\n",
+  __func__, ReasonCode, dst);
 
memset(&DelbaParamSet, 0, 2);
 
@@ -186,9 +185,6 @@ static struct sk_buff *rtllib_DELBA(struct rtllib_device 
*ieee, u8 *dst,
tag += 2;
 
RTLLIB_DEBUG_DATA(RTLLIB_DL_DATA|RTLLIB_DL_BA, skb->data, skb->len);
-   if (net_ratelimit())
-   RTLLIB_DEBUG(RTLLIB_DL_TRACE | RTLLIB_DL_BA, "<=%s()\n",
-__func__);
return skb;
 }
 
@@ -203,8 +199,7 @@ static void rtllib_send_ADDBAReq(struct rtllib_device 
*ieee, u8 *dst,
RT_TRACE(COMP_DBG, ">to send ADDBAREQ!\n");
softmac_mgmt_xmit(skb, ieee);
} else {
-   RTLLIB_DEBUG(RTLLIB_DL_ERR,
-"alloc skb error in function %s()\n", __func__);
+   netdev_dbg(ieee->dev, "Failed to generate ADDBAReq packet.\n");
}
 }
 
@@ -217,8 +212,7 @@ static void rtllib_send_ADDBARsp(struct rtllib_device 
*ieee, u8 *dst,
if (skb)
softmac_mgmt_xmit(skb, ieee);
else
-   RTLLIB_DEBUG(RTLLIB_DL_ERR,
-"alloc skb error in function %s()\n", __func__);
+   netdev_dbg(ieee->dev, "Failed to generate ADDBARsp packet.\n");
 }
 
 static void rtllib_send_DELBA(struct rtllib_device *ieee, u8 *dst,
@@ -231,8 +225,7 @@ static void rtllib_send_DELBA(struct rtllib_device *ieee, 
u8 *dst,
if (skb)
softmac_mgmt_xmit(skb, ieee);
else
-   RTLLIB_DEBUG(RTLLIB_DL_ERR,
-"alloc skb error in function %s()\n", __func__);
+   netdev_dbg(ieee->dev, "Failed to generate DELBA packet.\n");
 }
 
 int rtllib_rx_ADDBAReq(struct rtllib_device *ieee, struct sk_buff *skb)
@@ -374,20 +367,20 @@ int rtllib_rx_ADDBARsp(struct rtllib_device *ieee, struct 
sk_buff *skb)
 
 
if (pAdmittedBA->bValid == true) {
-   RTLLIB_DEBUG(RTLLIB_DL_BA,
-"OnADDBARsp(): Recv ADDBA Rsp. Drop because 
already admit it!\n");
+   netdev_dbg(ieee->dev, "%s(): ADDBA response already admitted\n",
+  __func__);
return -1;
} else if ((pPendingBA->bValid == false) ||
   (*pDialogToken != pPendingBA->DialogToken)) {
netdev_warn(ieee->dev,
-   "%s(): Recv ADDBA Rsp. BA invalid, DELBA!\n",
+   "%s(): ADDBA Rsp. BA invalid, DELBA!\n",
__func__);
ReasonCode = DELBA_REASON_UNKNOWN_BA;
goto OnADDBARsp_Reject;
} else {
-   RTLLIB_DEBUG(RTLLIB_DL_BA,
-"OnADDBARsp(): Recv ADDBA Rsp. BA is admitted! 
Status code:%X\n",
-*pStatusCode);
+   netdev_dbg(ieee->dev,
+  "%s(): Recv ADDBA Rsp. BA is admitted! Status 
code:%X\n",
+  __func__, *pStatusCode);
DeActivateBAEntry(ieee, pPendingBA);
}
 
diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c 
b/drivers/staging/rtl

[PATCH v5 21/34] staging: rtl8192e: Fix LONG_LINE warnings

2015-05-31 Thread Mateusz Kulikowski
Fix most of simple LONG_LINE warnings. None of the changes should affect
behaviour of code, so several modifications are included in this patch:
- Code is reindented where needed
- Local variable names are compacted (priv -> p)
- Unnecessary casts are removed
- Nested ifs are replaced with logical and
- a = b = c = d expressions are split
- Replace if/then series with clamp_t()
- Removed unneeded scopes

Signed-off-by: Mateusz Kulikowski 
---
 drivers/staging/rtl8192e/dot11d.h  |   4 +-
 drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c |  22 +--
 .../staging/rtl8192e/rtl8192e/r8192E_firmware.c|  29 ++--
 drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c |   4 +-
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c   |   3 +-
 drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 191 +
 drivers/staging/rtl8192e/rtl8192e/rtl_wx.c |   3 +-
 drivers/staging/rtl8192e/rtl819x_HTProc.c  |   3 +-
 drivers/staging/rtl8192e/rtl819x_TSProc.c  |  21 ++-
 drivers/staging/rtl8192e/rtllib_rx.c   | 171 +++---
 drivers/staging/rtl8192e/rtllib_softmac.c  |  36 ++--
 drivers/staging/rtl8192e/rtllib_tx.c   |  41 ++---
 12 files changed, 314 insertions(+), 214 deletions(-)

diff --git a/drivers/staging/rtl8192e/dot11d.h 
b/drivers/staging/rtl8192e/dot11d.h
index aad3394..69e0f8f 100644
--- a/drivers/staging/rtl8192e/dot11d.h
+++ b/drivers/staging/rtl8192e/dot11d.h
@@ -74,8 +74,8 @@ static inline void cpMacAddr(unsigned char *des, unsigned 
char *src)
(GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen > 0)
 
 #define IS_EQUAL_CIE_SRC(__pIeeeDev, __pTa)\
-
ether_addr_equal_unaligned(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, \
-   __pTa)
+ether_addr_equal_unaligned( \
+   GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa)
 #define UPDATE_CIE_SRC(__pIeeeDev, __pTa)  \
cpMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa)
 
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c 
b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
index f9c6153..e023c70 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
@@ -30,7 +30,8 @@
 #include "rtl_dm.h"
 #include "rtl_wx.h"
 
-static int WDCAPARA_ADD[] = {EDCAPARA_BE, EDCAPARA_BK, EDCAPARA_VI, 
EDCAPARA_VO};
+static int WDCAPARA_ADD[] = {EDCAPARA_BE, EDCAPARA_BK, EDCAPARA_VI,
+EDCAPARA_VO};
 
 void rtl8192e_start_beacon(struct net_device *dev)
 {
@@ -187,22 +188,21 @@ void rtl8192e_SetHwReg(struct net_device *dev, u8 
variable, u8 *val)
u8  u1bAIFS;
u32 u4bAcParam;
u8 mode = priv->rtllib->mode;
-   struct rtllib_qos_parameters *qos_parameters =
+   struct rtllib_qos_parameters *qop =
 &priv->rtllib->current_network.qos_data.parameters;
 
-   u1bAIFS = qos_parameters->aifs[pAcParam] *
+   u1bAIFS = qop->aifs[pAcParam] *
  ((mode&(IEEE_G|IEEE_N_24G)) ? 9 : 20) + aSifsTime;
 
dm_init_edca_turbo(dev);
 
-   u4bAcParam = (((le16_to_cpu(
-   qos_parameters->tx_op_limit[pAcParam])) 
<<
-AC_PARAM_TXOP_LIMIT_OFFSET) |
-((le16_to_cpu(qos_parameters->cw_max[pAcParam])) <<
-AC_PARAM_ECW_MAX_OFFSET) |
-((le16_to_cpu(qos_parameters->cw_min[pAcParam])) <<
-AC_PARAM_ECW_MIN_OFFSET) |
-(((u32)u1bAIFS) << AC_PARAM_AIFS_OFFSET));
+   u4bAcParam = (le16_to_cpu(qop->tx_op_limit[pAcParam]) <<
+ AC_PARAM_TXOP_LIMIT_OFFSET) |
+   ((le16_to_cpu(qop->cw_max[pAcParam])) <<
+AC_PARAM_ECW_MAX_OFFSET) |
+   ((le16_to_cpu(qop->cw_min[pAcParam])) <<
+AC_PARAM_ECW_MIN_OFFSET) |
+   (((u32)u1bAIFS) << AC_PARAM_AIFS_OFFSET);
 
RT_TRACE(COMP_DBG, "%s():HW_VAR_AC_PARAM eACI:%x:%x\n",
 __func__, eACI, u4bAcParam);
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c 
b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
index c465f87..02c5b0a 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
@@ -230,7 +230,7 @@ bool init_firmware(struct net_device *dev)
 
u32 file_length = 0;
u8  *mapped_file = NULL;
-   u8  init_step = 0;
+   u8  i = 0;
enum opt_rst_type rst_opt = OPT_SYSTEM_RESET;
enum firmware_init_step starting_state = FW_INIT_STEP0_BOOT;
 
@@ -250,10 +250,9 @@ bool init_firmware(struct net_device 

[PATCH v5 18/34] staging: rtl8192e: Remove remains of RTLLIB_*_DEBUG() (including proc entry)

2015-05-31 Thread Mateusz Kulikowski
Remove rest of rtllib "debug" system - it is no longer used -
proper netdev_* functions are used in most cases.

Signed-off-by: Mateusz Kulikowski 
---
 drivers/staging/rtl8192e/rtllib.h| 45 --
 drivers/staging/rtl8192e/rtllib_module.c | 55 
 2 files changed, 100 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib.h 
b/drivers/staging/rtl8192e/rtllib.h
index e26a236..d5b5592 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -641,51 +641,6 @@ enum wireless_network_type {
 #define OUI_SUBTYPE_WMM_PARAM  1
 #define OUI_SUBTYPE_QOS_CAPABI 5
 
-/* debug macros */
-/* To use the debug system;
- *
- * If you are defining a new debug classification, simply add it to the #define
- * list here in the form of:
- *
- * #define RTLLIB_DL_ VALUE
- *
- * shifting value to the left one bit from the previous entry.   should be
- * the name of the classification (for example, WEP)
- *
- * You then need to either add a RTLLIB__DEBUG() macro definition for your
- * classification, or use RTLLIB_DEBUG(RTLLIB_DL_, ...) whenever you want
- * to send output to that classification.
- *
- * To add your debug level to the list of levels seen when you perform
- *
- * % cat /proc/net/ipw/debug_level
- *
- * you simply need to add your entry to the ipw_debug_levels array.
- */
-
-#define RTLLIB_DL_INFO   (1<<0)
-#define RTLLIB_DL_WX   (1<<1)
-#define RTLLIB_DL_SCAN   (1<<2)
-#define RTLLIB_DL_STATE (1<<3)
-#define RTLLIB_DL_MGMT   (1<<4)
-#define RTLLIB_DL_FRAG   (1<<5)
-#define RTLLIB_DL_EAP (1<<6)
-#define RTLLIB_DL_DROP   (1<<7)
-
-#define RTLLIB_DL_TX   (1<<8)
-#define RTLLIB_DL_RX   (1<<9)
-
-#define RTLLIB_DL_HT  (1<<10)
-#define RTLLIB_DL_BA  (1<<11)
-#define RTLLIB_DL_TS  (1<<12)
-#define RTLLIB_DL_QOS (1<<13)
-#define RTLLIB_DL_REORDER (1<<14)
-#define RTLLIB_DL_IOT (1<<15)
-#define RTLLIB_DL_IPS (1<<16)
-#define RTLLIB_DL_TRACE   (1<<29)
-#define RTLLIB_DL_DATA(1<<30)
-#define RTLLIB_DL_ERR (1<<31)
-
 #ifndef ETH_P_PAE
 #define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */
 #define ETH_P_IP   0x0800  /* Internet Protocol packet */
diff --git a/drivers/staging/rtl8192e/rtllib_module.c 
b/drivers/staging/rtl8192e/rtllib_module.c
index b61035b..845d9b8 100644
--- a/drivers/staging/rtl8192e/rtllib_module.c
+++ b/drivers/staging/rtl8192e/rtllib_module.c
@@ -196,68 +196,13 @@ void free_rtllib(struct net_device *dev)
 }
 EXPORT_SYMBOL(free_rtllib);
 
-u32 rtllib_debug_level;
-static int debug = RTLLIB_DL_ERR;
-static struct proc_dir_entry *rtllib_proc;
-
-static int show_debug_level(struct seq_file *m, void *v)
-{
-   seq_printf(m, "0x%08X\n", rtllib_debug_level);
-
-   return 0;
-}
-
-static ssize_t write_debug_level(struct file *file, const char __user *buffer,
-size_t count, loff_t *ppos)
-{
-   unsigned long val;
-   int err = kstrtoul_from_user(buffer, count, 0, &val);
-
-   if (err)
-   return err;
-   rtllib_debug_level = val;
-   return count;
-}
-
-static int open_debug_level(struct inode *inode, struct file *file)
-{
-   return single_open(file, show_debug_level, NULL);
-}
-
-static const struct file_operations fops = {
-   .open = open_debug_level,
-   .read = seq_read,
-   .llseek = seq_lseek,
-   .write = write_debug_level,
-   .release = single_release,
-};
-
 static int __init rtllib_init(void)
 {
-   struct proc_dir_entry *e;
-
-   rtllib_debug_level = debug;
-   rtllib_proc = proc_mkdir(DRV_NAME, init_net.proc_net);
-   if (rtllib_proc == NULL) {
-   pr_err("Unable to create " DRV_NAME " proc directory\n");
-   return -EIO;
-   }
-   e = proc_create("debug_level", S_IRUGO | S_IWUSR, rtllib_proc, &fops);
-   if (!e) {
-   remove_proc_entry(DRV_NAME, init_net.proc_net);
-   rtllib_proc = NULL;
-   return -EIO;
-   }
return 0;
 }
 
 static void __exit rtllib_exit(void)
 {
-   if (rtllib_proc) {
-   remove_proc_entry("debug_level", rtllib_proc);
-   remove_proc_entry(DRV_NAME, init_net.proc_net);
-   rtllib_proc = NULL;
-   }
 }
 
 module_init(rtllib_init);
-- 
1.8.4.1

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


[PATCH v5 26/34] staging: rtl8192e: Replace ?: with max_t

2015-05-31 Thread Mateusz Kulikowski
Improve readability and make checkpatch happy.

Signed-off-by: Mateusz Kulikowski 
---
 drivers/staging/rtl8192e/rtllib_rx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/rtllib_rx.c 
b/drivers/staging/rtl8192e/rtllib_rx.c
index 588c6d7..2280d18 100644
--- a/drivers/staging/rtl8192e/rtllib_rx.c
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
@@ -1685,7 +1685,7 @@ static int rtllib_qos_convert_ac_to_parameters(struct 
rtllib_qos_parameter_info
qos_param->aifs[aci] = (ac_params->aci_aifsn) & 0x0f;
 
/* WMM spec P.11: The minimum value for AIFSN shall be 2 */
-   qos_param->aifs[aci] = (qos_param->aifs[aci] < 2) ? 2 : 
qos_param->aifs[aci];
+   qos_param->aifs[aci] = max_t(u8, qos_param->aifs[aci], 2);
 
qos_param->cw_min[aci] = cpu_to_le16(ac_params->ecw_min_max &
 0x0F);
-- 
1.8.4.1

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


[PATCH v5 20/34] staging: rtl8192e: Fix PREFER_PR_LEVEL warnings

2015-05-31 Thread Mateusz Kulikowski
Fix most of remaining PREFER_PR_LEVEL warnings in rtllib.
Replace printk() with netdev_* if possible, pr_* in other cases.

Signed-off-by: Mateusz Kulikowski 
---
 drivers/staging/rtl8192e/rtllib_crypt_ccmp.c |  2 +-
 drivers/staging/rtl8192e/rtllib_crypt_tkip.c | 67 +---
 drivers/staging/rtl8192e/rtllib_rx.c |  5 ++-
 3 files changed, 35 insertions(+), 39 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c 
b/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c
index 7d486e8..496de4f 100644
--- a/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c
+++ b/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c
@@ -69,7 +69,7 @@ static void *rtllib_ccmp_init(int key_idx)
 
priv->tfm = (void *)crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC);
if (IS_ERR(priv->tfm)) {
-   pr_debug("rtllib_crypt_ccmp: could not allocate crypto API 
aes\n");
+   pr_debug("Could not allocate crypto API aes\n");
priv->tfm = NULL;
goto fail;
}
diff --git a/drivers/staging/rtl8192e/rtllib_crypt_tkip.c 
b/drivers/staging/rtl8192e/rtllib_crypt_tkip.c
index 6b20479..2096d78 100644
--- a/drivers/staging/rtl8192e/rtllib_crypt_tkip.c
+++ b/drivers/staging/rtl8192e/rtllib_crypt_tkip.c
@@ -68,8 +68,7 @@ static void *rtllib_tkip_init(int key_idx)
priv->tx_tfm_arc4 = crypto_alloc_blkcipher("ecb(arc4)", 0,
CRYPTO_ALG_ASYNC);
if (IS_ERR(priv->tx_tfm_arc4)) {
-   printk(KERN_DEBUG
-  "rtllib_crypt_tkip: could not allocate crypto API 
arc4\n");
+   pr_debug("Could not allocate crypto API arc4\n");
priv->tx_tfm_arc4 = NULL;
goto fail;
}
@@ -77,8 +76,7 @@ static void *rtllib_tkip_init(int key_idx)
priv->tx_tfm_michael = crypto_alloc_hash("michael_mic", 0,
CRYPTO_ALG_ASYNC);
if (IS_ERR(priv->tx_tfm_michael)) {
-   printk(KERN_DEBUG
-  "rtllib_crypt_tkip: could not allocate crypto API 
michael_mic\n");
+   pr_debug("Could not allocate crypto API michael_mic\n");
priv->tx_tfm_michael = NULL;
goto fail;
}
@@ -86,8 +84,7 @@ static void *rtllib_tkip_init(int key_idx)
priv->rx_tfm_arc4 = crypto_alloc_blkcipher("ecb(arc4)", 0,
CRYPTO_ALG_ASYNC);
if (IS_ERR(priv->rx_tfm_arc4)) {
-   printk(KERN_DEBUG
-  "rtllib_crypt_tkip: could not allocate crypto API 
arc4\n");
+   pr_debug("Could not allocate crypto API arc4\n");
priv->rx_tfm_arc4 = NULL;
goto fail;
}
@@ -95,8 +92,7 @@ static void *rtllib_tkip_init(int key_idx)
priv->rx_tfm_michael = crypto_alloc_hash("michael_mic", 0,
CRYPTO_ALG_ASYNC);
if (IS_ERR(priv->rx_tfm_michael)) {
-   printk(KERN_DEBUG
-  "rtllib_crypt_tkip: could not allocate crypto API 
michael_mic\n");
+   pr_debug("Could not allocate crypto API michael_mic\n");
priv->rx_tfm_michael = NULL;
goto fail;
}
@@ -403,24 +399,24 @@ static int rtllib_tkip_decrypt(struct sk_buff *skb, int 
hdr_len, void *priv)
keyidx = pos[3];
if (!(keyidx & (1 << 5))) {
if (net_ratelimit()) {
-   printk(KERN_DEBUG
-  "TKIP: received packet without ExtIV flag from 
%pM\n",
-  hdr->addr2);
+   netdev_dbg(skb->dev,
+  "Received packet without ExtIV flag from 
%pM\n",
+  hdr->addr2);
}
return -2;
}
keyidx >>= 6;
if (tkey->key_idx != keyidx) {
-   printk(KERN_DEBUG
-  "TKIP: RX tkey->key_idx=%d frame keyidx=%d priv=%p\n",
-  tkey->key_idx, keyidx, priv);
+   netdev_dbg(skb->dev,
+  "RX tkey->key_idx=%d frame keyidx=%d priv=%p\n",
+  tkey->key_idx, keyidx, priv);
return -6;
}
if (!tkey->key_set) {
if (net_ratelimit()) {
-   printk(KERN_DEBUG
-  "TKIP: received packet from %pM with keyid=%d 
that does not have a configured key\n",
-  hdr->addr2, keyidx);
+   netdev_dbg(skb->dev,
+  "Received packet from %pM with keyid=%d that 
does not have a configured key\n",
+  hdr->addr2, keyidx);
}
return -3;
}
@@ -433,10 +429,10 @@ static int rtllib_tkip_decrypt(struct sk_buff *skb, int 
hdr_len, void *priv)
(iv32 == tkey->rx_iv32 && iv16 <= tkey->rx_iv16)) &&
   

[PATCH v5 33/34] staging: rtl8192e: rtl8192E_suspend(): Fix WOL reporting

2015-05-31 Thread Mateusz Kulikowski
WOL capability was reported in an awkward way - print it nicely.

Signed-off-by: Mateusz Kulikowski 
---
 drivers/staging/rtl8192e/rtl8192e/rtl_pm.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_pm.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_pm.c
index ca6ecfc..e4908672 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_pm.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_pm.c
@@ -57,10 +57,8 @@ int rtl8192E_suspend(struct pci_dev *pdev, pm_message_t 
state)
write_nic_byte(dev, MacBlkCtrl, 0xa);
}
 out_pci_suspend:
-   netdev_info(dev, "r8192E support WOL call??\n");
-   if (priv->rtllib->bSupportRemoteWakeUp)
-   RT_TRACE(COMP_POWER,
-"r8192E support WOL call!!.\n");
+   netdev_info(dev, "WOL is %s\n", priv->rtllib->bSupportRemoteWakeUp ?
+   "Supported" : "Not supported");
pci_save_state(pdev);
pci_disable_device(pdev);
pci_enable_wake(pdev, pci_choose_state(pdev, state),
-- 
1.8.4.1

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


[PATCH v5 27/34] staging: rtl8192e: Replace ?: with min_t

2015-05-31 Thread Mateusz Kulikowski
Replace :? with min_t for readability. Remove check that is always false.

Signed-off-by: Mateusz Kulikowski 
---
 drivers/staging/rtl8192e/rtllib_softmac_wx.c | 8 +---
 drivers/staging/rtl8192e/rtllib_wx.c | 3 +--
 2 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c 
b/drivers/staging/rtl8192e/rtllib_softmac_wx.c
index d5e13a5..86f52ac7 100644
--- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c
+++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c
@@ -454,13 +454,7 @@ int rtllib_wx_set_essid(struct rtllib_device *ieee,
 
proto_started = ieee->proto_started;
 
-   len = (wrqu->essid.length < IW_ESSID_MAX_SIZE) ? wrqu->essid.length :
-  IW_ESSID_MAX_SIZE;
-
-   if (len > IW_ESSID_MAX_SIZE) {
-   ret = -E2BIG;
-   goto out;
-   }
+   len = min_t(__u16, wrqu->essid.length, IW_ESSID_MAX_SIZE);
 
if (ieee->iw_mode == IW_MODE_MONITOR) {
ret = -1;
diff --git a/drivers/staging/rtl8192e/rtllib_wx.c 
b/drivers/staging/rtl8192e/rtllib_wx.c
index 2812a77..2ac1617 100644
--- a/drivers/staging/rtl8192e/rtllib_wx.c
+++ b/drivers/staging/rtl8192e/rtllib_wx.c
@@ -851,8 +851,7 @@ int rtllib_wx_set_gen_ie(struct rtllib_device *ieee, u8 
*ie, size_t len)
if ((eid == MFIE_TYPE_GENERIC) && (!memcmp(&ie[2],
 wps_oui, 4))) {
 
-   ieee->wps_ie_len = (len < MAX_WZC_IE_LEN) ? (len) :
-  (MAX_WZC_IE_LEN);
+   ieee->wps_ie_len = min_t(size_t, len, MAX_WZC_IE_LEN);
buf = kmemdup(ie, ieee->wps_ie_len, GFP_KERNEL);
if (buf == NULL)
return -ENOMEM;
-- 
1.8.4.1

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


[PATCH v5 11/34] staging: rtl8192e: Remove RTLLIB_DEBUG_SCAN()

2015-05-31 Thread Mateusz Kulikowski
Use netdev_dbg() instead, remove duplicated logs.

Signed-off-by: Mateusz Kulikowski 
---
 drivers/staging/rtl8192e/rtllib.h|   1 -
 drivers/staging/rtl8192e/rtllib_rx.c | 101 ---
 drivers/staging/rtl8192e/rtllib_wx.c |  12 +++--
 3 files changed, 54 insertions(+), 60 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib.h 
b/drivers/staging/rtl8192e/rtllib.h
index 392bcd5..6481919 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -703,7 +703,6 @@ do {
\
 #define RTLLIB_DL_ERR (1<<31)
 #define RTLLIB_DEBUG_INFO(f, a...)   RTLLIB_DEBUG(RTLLIB_DL_INFO, f, ## a)
 
-#define RTLLIB_DEBUG_SCAN(f, a...)   RTLLIB_DEBUG(RTLLIB_DL_SCAN, f, ## a)
 #define RTLLIB_DEBUG_STATE(f, a...)  RTLLIB_DEBUG(RTLLIB_DL_STATE, f, ## a)
 #define RTLLIB_DEBUG_MGMT(f, a...)  RTLLIB_DEBUG(RTLLIB_DL_MGMT, f, ## a)
 #define RTLLIB_DEBUG_FRAG(f, a...)  RTLLIB_DEBUG(RTLLIB_DL_FRAG, f, ## a)
diff --git a/drivers/staging/rtl8192e/rtllib_rx.c 
b/drivers/staging/rtl8192e/rtllib_rx.c
index 304404d..a6dde35 100644
--- a/drivers/staging/rtl8192e/rtllib_rx.c
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
@@ -2130,8 +2130,8 @@ int rtllib_parse_info_param(struct rtllib_device *ieee,
break;
 
case MFIE_TYPE_HT_CAP:
-   RTLLIB_DEBUG_SCAN("MFIE_TYPE_HT_CAP: %d bytes\n",
-info_element->len);
+   netdev_dbg(ieee->dev, "MFIE_TYPE_HT_CAP: %d bytes\n",
+  info_element->len);
tmp_htcap_len = min_t(u8, info_element->len, 
MAX_IE_LEN);
if (tmp_htcap_len != 0) {
network->bssht.bdHTSpecVer = HT_SPEC_VER_EWC;
@@ -2157,8 +2157,8 @@ int rtllib_parse_info_param(struct rtllib_device *ieee,
 
 
case MFIE_TYPE_HT_INFO:
-   RTLLIB_DEBUG_SCAN("MFIE_TYPE_HT_INFO: %d bytes\n",
-info_element->len);
+   netdev_dbg(ieee->dev, "MFIE_TYPE_HT_INFO: %d bytes\n",
+  info_element->len);
tmp_htinfo_len = min_t(u8, info_element->len, 
MAX_IE_LEN);
if (tmp_htinfo_len) {
network->bssht.bdHTSpecVer = HT_SPEC_VER_IEEE;
@@ -2173,8 +2173,8 @@ int rtllib_parse_info_param(struct rtllib_device *ieee,
break;
 
case MFIE_TYPE_AIRONET:
-   RTLLIB_DEBUG_SCAN("MFIE_TYPE_AIRONET: %d bytes\n",
-info_element->len);
+   netdev_dbg(ieee->dev, "MFIE_TYPE_AIRONET: %d bytes\n",
+  info_element->len);
if (info_element->len > IE_CISCO_FLAG_POSITION) {
network->bWithAironetIE = true;
 
@@ -2196,8 +2196,8 @@ int rtllib_parse_info_param(struct rtllib_device *ieee,
break;
 
case MFIE_TYPE_COUNTRY:
-   RTLLIB_DEBUG_SCAN("MFIE_TYPE_COUNTRY: %d bytes\n",
-info_element->len);
+   netdev_dbg(ieee->dev, "MFIE_TYPE_COUNTRY: %d bytes\n",
+  info_element->len);
rtllib_extract_country_ie(ieee, info_element, network,
  network->bssid);
break;
@@ -2304,10 +2304,9 @@ static inline int rtllib_network_init(
}
 
if (network->mode == 0) {
-   RTLLIB_DEBUG_SCAN("Filtered out '%s (%pM)' network.\n",
-escape_essid(network->ssid,
- network->ssid_len),
-network->bssid);
+   netdev_dbg(ieee->dev, "Filtered out '%s (%pM)' network.\n",
+  escape_essid(network->ssid, network->ssid_len),
+  network->bssid);
return 1;
}
 
@@ -2505,33 +2504,32 @@ static inline void rtllib_process_probe_response(
if (!network)
return;
 
-   RTLLIB_DEBUG_SCAN(
-   "'%s' ( %pM ): %c%c%c%c %c%c%c%c-%c%c%c%c %c%c%c%c\n",
-   escape_essid(info_element->data, info_element->len),
-   beacon->header.addr3,
-   (le16_to_cpu(beacon->capability) & (1<<0xf)) ? '1' : '0',
-   (le16_to_cpu(beacon->capability) & (1<<0xe)) ? '1' : '0',
-   (le16_to_cpu(beacon->capability) & (1<<0xd)) ? '1' : '0',
-   (le16_to_cpu(beacon->capability) & (1<<0xc)) ? '1' : '0',
-   (le16_to_cpu(beacon->capability) & (1<<0xb)) ? '1' : '0',
-   (le16_to_cpu(beacon->capability) & (1<<0xa)) ? '1' : 

[PATCH v5 23/34] staging: rtl8192e: Remove unimplemented iwpriv handlers

2015-05-31 Thread Mateusz Kulikowski
Remove the following private variables:
- force_mic_error - changes force_mic_error that is not used
- radio - changes sw_radio_on that is not used
- adhoc_peer_list - unimplemented
- firm_ver - unimplemented

Signed-off-by: Mateusz Kulikowski 
---
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c |  1 -
 drivers/staging/rtl8192e/rtl8192e/rtl_core.h |  1 -
 drivers/staging/rtl8192e/rtl8192e/rtl_wx.c   | 86 ++--
 drivers/staging/rtl8192e/rtllib.h|  1 -
 4 files changed, 4 insertions(+), 85 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index d73dd57..abce472 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -1118,7 +1118,6 @@ static void rtl8192_init_priv_variable(struct net_device 
*dev)
priv->bDriverIsGoingToUnload = false;
priv->being_init_adapter = false;
priv->initialized_at_probe = false;
-   priv->sw_radio_on = true;
priv->bdisable_nic = false;
priv->bfirst_init = false;
priv->txringcount = 64;
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h 
b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
index 0640e76..6127e92 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
@@ -626,7 +626,6 @@ struct r8192_priv {
u8  RegCWinMin;
u8  keepAliveLevel;
 
-   boolsw_radio_on;
boolbHwRadioOff;
boolpwrdown;
boolblinked_ingpio;
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
index 2e6c4fa..26c2ad0 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
@@ -175,48 +175,6 @@ static int r8192_wx_force_reset(struct net_device *dev,
 
 }
 
-static int r8192_wx_force_mic_error(struct net_device *dev,
-   struct iw_request_info *info,
-   union iwreq_data *wrqu, char *extra)
-{
-   struct r8192_priv *priv = rtllib_priv(dev);
-   struct rtllib_device *ieee = priv->rtllib;
-
-   down(&priv->wx_sem);
-
-   RT_TRACE(COMP_DBG, "%s(): force mic error !\n", __func__);
-   ieee->force_mic_error = true;
-   up(&priv->wx_sem);
-   return 0;
-
-}
-
-#define MAX_ADHOC_PEER_NUM 64
-struct adhoc_peer_entry {
-   unsigned char MacAddr[ETH_ALEN];
-   unsigned char WirelessMode;
-   unsigned char bCurTxBW40MHz;
-};
-struct adhoc_peers_info {
-   struct adhoc_peer_entry Entry[MAX_ADHOC_PEER_NUM];
-   unsigned char num;
-};
-
-static int r8192_wx_get_adhoc_peers(struct net_device *dev,
-   struct iw_request_info *info,
-   union iwreq_data *wrqu, char *extra)
-{
-   return 0;
-}
-
-
-static int r8191se_wx_get_firm_version(struct net_device *dev,
-   struct iw_request_info *info,
-   struct iw_param *wrqu, char *extra)
-{
-   return 0;
-}
-
 static int r8192_wx_adapter_power_status(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra)
@@ -247,28 +205,6 @@ static int r8192_wx_adapter_power_status(struct net_device 
*dev,
return 0;
 }
 
-static int r8192se_wx_set_radio(struct net_device *dev,
-   struct iw_request_info *info,
-   union iwreq_data *wrqu, char *extra)
-{
-   struct r8192_priv *priv = rtllib_priv(dev);
-
-   down(&priv->wx_sem);
-
-   netdev_info(dev, "%s(): set radio ! extra is %d\n", __func__, *extra);
-   if ((*extra != 0) && (*extra != 1)) {
-   RT_TRACE(COMP_ERR,
-"%s(): set radio an err value,must 0(radio off) or 
1(radio on)\n",
-__func__);
-   up(&priv->wx_sem);
-   return -1;
-   }
-   priv->sw_radio_on = *extra;
-   up(&priv->wx_sem);
-   return 0;
-
-}
-
 static int r8192se_wx_set_lps_awake_interval(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra)
@@ -1240,21 +1176,10 @@ static const struct iw_priv_args r8192_private_args[] = 
{
SIOCIWFIRSTPRIV + 0x3,
IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "forcereset"
}, {
-   SIOCIWFIRSTPRIV + 0x4,
-   IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "force_mic_error"
-   }, {
-   SIOCIWFIRSTPRIV + 0x5,
-   IW_PRIV_TYPE_NONE, IW_PRIV_TYPE_INT|IW_PRIV_SIZE_FIXED|1,
-   "firm_ver"
-   }, {
SIOCIWFIRSTPRIV + 0x6,
IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED|1, IW_PRIV_TYPE_NONE,
"set_power"
}, {
-   SIOCIWFIRSTPRIV + 0x9,
-   IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED|1, IW_PRIV_TYPE_NONE,
-  

[PATCH v5 19/34] staging: rtl8192e: Remove assert() macro

2015-05-31 Thread Mateusz Kulikowski
Assert macro printed warning message (and was used once).
Remove it, and add netdev_warn() in place where it was called.

Signed-off-by: Mateusz Kulikowski 
---
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 5 +++--
 drivers/staging/rtl8192e/rtllib_debug.h  | 8 
 2 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 6f339cd..9a4f09d 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -1885,8 +1885,9 @@ void rtl8192_hard_data_xmit(struct sk_buff *skb, struct 
net_device *dev,
return;
}
 
-   assert(queue_index != TXCMD_QUEUE);
-
+   if (queue_index != TXCMD_QUEUE)
+   netdev_warn(dev, "%s(): queue index != TXCMD_QUEUE\n",
+   __func__);
 
memcpy((unsigned char *)(skb->cb), &dev, sizeof(dev));
skb_push(skb, priv->rtllib->tx_headroom);
diff --git a/drivers/staging/rtl8192e/rtllib_debug.h 
b/drivers/staging/rtl8192e/rtllib_debug.h
index 6df8df1..42e88d6 100644
--- a/drivers/staging/rtl8192e/rtllib_debug.h
+++ b/drivers/staging/rtl8192e/rtllib_debug.h
@@ -76,12 +76,4 @@ do { \
printk(KERN_DEBUG DRV_NAME ":" x "\n", ##args);\
 } while (0)
 
-#define assert(expr) \
-do {   \
-   if (!(expr)) {\
-   pr_info("Assertion failed! %s,%s,%s,line=%d\n", \
-   #expr, __FILE__, __func__, __LINE__); \
-   }   \
-} while (0)
-
 #endif
-- 
1.8.4.1

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


[PATCH v5 25/34] staging: rtl8192e: Remove unused rtl_crypto.h

2015-05-31 Thread Mateusz Kulikowski
This header is not used - remove it to make driver code smaller.

Signed-off-by: Mateusz Kulikowski 
---
 drivers/staging/rtl8192e/rtl8192e/rtl_crypto.h | 382 -
 1 file changed, 382 deletions(-)
 delete mode 100644 drivers/staging/rtl8192e/rtl8192e/rtl_crypto.h

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_crypto.h 
b/drivers/staging/rtl8192e/rtl8192e/rtl_crypto.h
deleted file mode 100644
index ee57c0f..000
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_crypto.h
+++ /dev/null
@@ -1,382 +0,0 @@
-/*
- * Scatterlist Cryptographic API.
- *
- * Copyright (c) 2002 James Morris 
- * Copyright (c) 2002 David S. Miller (da...@redhat.com)
- *
- * Portions derived from Cryptoapi, by Alexander Kjeldaas 
- * and Nettle, by Niels Mé°ˆler.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- */
-#ifndef _LINUX_CRYPTO_H
-#define _LINUX_CRYPTO_H
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#define crypto_register_alg crypto_register_alg_rsl
-#define crypto_unregister_alg crypto_unregister_alg_rsl
-#define crypto_alloc_tfm crypto_alloc_tfm_rsl
-#define crypto_free_tfm crypto_free_tfm_rsl
-#define crypto_alg_available crypto_alg_available_rsl
-
-/*
- * Algorithm masks and types.
- */
-#define CRYPTO_ALG_TYPE_MASK   0x00ff
-#define CRYPTO_ALG_TYPE_CIPHER 0x0001
-#define CRYPTO_ALG_TYPE_DIGEST 0x0002
-#define CRYPTO_ALG_TYPE_COMPRESS   0x0004
-
-/*
- * Transform masks and values (for crt_flags).
- */
-#define CRYPTO_TFM_MODE_MASK   0x00ff
-#define CRYPTO_TFM_REQ_MASK0x000fff00
-#define CRYPTO_TFM_RES_MASK0xfff0
-
-#define CRYPTO_TFM_MODE_ECB0x0001
-#define CRYPTO_TFM_MODE_CBC0x0002
-#define CRYPTO_TFM_MODE_CFB0x0004
-#define CRYPTO_TFM_MODE_CTR0x0008
-
-#define CRYPTO_TFM_REQ_WEAK_KEY0x0100
-#define CRYPTO_TFM_RES_WEAK_KEY0x0010
-#define CRYPTO_TFM_RES_BAD_KEY_LEN 0x0020
-#define CRYPTO_TFM_RES_BAD_KEY_SCHED   0x0040
-#define CRYPTO_TFM_RES_BAD_BLOCK_LEN   0x0080
-#define CRYPTO_TFM_RES_BAD_FLAGS   0x0100
-
-/*
- * Miscellaneous stuff.
- */
-#define CRYPTO_UNSPEC  0
-#define CRYPTO_MAX_ALG_NAME64
-
-struct scatterlist;
-
-/*
- * Algorithms: modular crypto algorithm implementations, managed
- * via crypto_register_alg() and crypto_unregister_alg().
- */
-struct cipher_alg {
-   unsigned int cia_min_keysize;
-   unsigned int cia_max_keysize;
-   int (*cia_setkey)(void *ctx, const u8 *key,
- unsigned int keylen, u32 *flags);
-   void (*cia_encrypt)(void *ctx, u8 *dst, const u8 *src);
-   void (*cia_decrypt)(void *ctx, u8 *dst, const u8 *src);
-};
-
-struct digest_alg {
-   unsigned int dia_digestsize;
-   void (*dia_init)(void *ctx);
-   void (*dia_update)(void *ctx, const u8 *data, unsigned int len);
-   void (*dia_final)(void *ctx, u8 *out);
-   int (*dia_setkey)(void *ctx, const u8 *key,
- unsigned int keylen, u32 *flags);
-};
-
-struct compress_alg {
-   int (*coa_init)(void *ctx);
-   void (*coa_exit)(void *ctx);
-   int (*coa_compress)(void *ctx, const u8 *src, unsigned int slen,
-   u8 *dst, unsigned int *dlen);
-   int (*coa_decompress)(void *ctx, const u8 *src, unsigned int slen,
- u8 *dst, unsigned int *dlen);
-};
-
-#define cra_cipher cra_u.cipher
-#define cra_digest cra_u.digest
-#define cra_compress   cra_u.compress
-
-struct crypto_alg {
-   struct list_head cra_list;
-   u32 cra_flags;
-   unsigned int cra_blocksize;
-   unsigned int cra_ctxsize;
-   const char cra_name[CRYPTO_MAX_ALG_NAME];
-
-   union {
-   struct cipher_alg cipher;
-   struct digest_alg digest;
-   struct compress_alg compress;
-   } cra_u;
-
-   struct module *cra_module;
-};
-
-/*
- * Algorithm registration interface.
- */
-int crypto_register_alg(struct crypto_alg *alg);
-int crypto_unregister_alg(struct crypto_alg *alg);
-
-/*
- * Algorithm query interface.
- */
-int crypto_alg_available(const char *name, u32 flags);
-
-/*
- * Transforms: user-instantiated objects which encapsulate algorithms
- * and core processing logic.  Managed via crypto_alloc_tfm() and
- * crypto_free_tfm(), as well as the various helpers below.
- */
-struct crypto_tfm;
-
-struct cipher_tfm {
-   void *cit_iv;
-   unsigned int cit_ivsize;
-   u32 cit_mode;
-   int (*cit_setkey)(struct crypto_tfm *tfm,
- const u8 *key, unsigned int keylen);
-   int (*cit_encrypt)(struct crypto_tfm *tfm,
-  

[PATCH v5 34/34] staging: rtl8192e: Fix SPACING error

2015-05-31 Thread Mateusz Kulikowski
Fix SPACING error in rtl8192_hw_to_sleep().

Signed-off-by: Mateusz Kulikowski 
---
 drivers/staging/rtl8192e/rtl8192e/rtl_ps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
index f6eb989..404cb83 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
@@ -101,7 +101,7 @@ void rtl8192_hw_to_sleep(struct net_device *dev, u64 time)
time -= msecs_to_jiffies(8 + 16 + 7);
 
timeout = jiffies + msecs_to_jiffies(MIN_SLEEP_TIME);
-   if (time_before((unsigned long)time,timeout)) {
+   if (time_before((unsigned long)time, timeout)) {
spin_unlock_irqrestore(&priv->ps_lock, flags);
netdev_info(dev, "too short to sleep::%lld < %ld\n",
time - jiffies, msecs_to_jiffies(MIN_SLEEP_TIME));
-- 
1.8.4.1

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


[PATCH v5 24/34] staging: rtl8192e: Fix OOM_MESSAGE warnings

2015-05-31 Thread Mateusz Kulikowski
Remove alloc failed messages where not needed to make checkpatch.pl happy.

Signed-off-by: Mateusz Kulikowski 
---
 drivers/staging/rtl8192e/rtl819x_BAProc.c | 8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl819x_BAProc.c 
b/drivers/staging/rtl8192e/rtl819x_BAProc.c
index 25765b8..60f536c 100644
--- a/drivers/staging/rtl8192e/rtl819x_BAProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_BAProc.c
@@ -92,10 +92,8 @@ static struct sk_buff *rtllib_ADDBA(struct rtllib_device 
*ieee, u8 *Dst,
return NULL;
}
skb = dev_alloc_skb(len + sizeof(struct rtllib_hdr_3addr));
-   if (skb == NULL) {
-   netdev_err(ieee->dev, "Can't alloc skb for ADDBA_REQ\n");
+   if (skb == NULL)
return NULL;
-   }
 
memset(skb->data, 0, sizeof(struct rtllib_hdr_3addr));
 
@@ -160,10 +158,8 @@ static struct sk_buff *rtllib_DELBA(struct rtllib_device 
*ieee, u8 *dst,
DelbaParamSet.field.TID = pBA->BaParamSet.field.TID;
 
skb = dev_alloc_skb(len + sizeof(struct rtllib_hdr_3addr));
-   if (skb == NULL) {
-   netdev_err(ieee->dev, "Can't alloc skb for DELBA_REQ\n");
+   if (skb == NULL)
return NULL;
-   }
 
skb_reserve(skb, ieee->tx_headroom);
 
-- 
1.8.4.1

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


[PATCH v5 31/34] staging: rtl8192e: Replace RT_TRACE(COMP_ERR, ...) with netdev_*

2015-05-31 Thread Mateusz Kulikowski
- Use netdev_* with log level depending on how serious error is
- Rework some messages to be more readable
- Pass net_device where needed for pretty prints

Signed-off-by: Mateusz Kulikowski 
---
 drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c |  24 +++--
 drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c |  31 ---
 .../staging/rtl8192e/rtl8192e/r8192E_firmware.c|  13 +--
 drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c | 100 ++---
 drivers/staging/rtl8192e/rtl8192e/rtl_cam.c|  18 ++--
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c   |  65 ++
 drivers/staging/rtl8192e/rtl8192e/rtl_ps.c |   4 +-
 drivers/staging/rtl8192e/rtl8192e/rtl_wx.c |  14 ++-
 8 files changed, 127 insertions(+), 142 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c 
b/drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c
index f080a91..facc6f1 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c
@@ -47,8 +47,8 @@ void PHY_SetRF8256Bandwidth(struct net_device *dev,
0x0e, bMask12Bits, 0x021);
 
} else {
-   RT_TRACE(COMP_ERR,
-"PHY_SetRF8256Bandwidth(): unknown 
hardware version\n");
+   netdev_warn(dev, "%s(): Unknown HW version.\n",
+   __func__);
}
 
break;
@@ -66,16 +66,15 @@ void PHY_SetRF8256Bandwidth(struct net_device *dev,
 0x0e, bMask12Bits, 0x0e1);
 
} else {
-   RT_TRACE(COMP_ERR,
-"PHY_SetRF8256Bandwidth(): unknown 
hardware version\n");
+   netdev_warn(dev, "%s(): Unknown HW version.\n",
+   __func__);
}
 
 
break;
default:
-   RT_TRACE(COMP_ERR,
-"PHY_SetRF8256Bandwidth(): unknown Bandwidth: 
%#X\n",
-Bandwidth);
+   netdev_err(dev, "%s(): Unknown bandwidth: %#X\n",
+  __func__, Bandwidth);
break;
 
}
@@ -139,9 +138,8 @@ bool phy_RF8256_Config_ParaFile(struct net_device *dev)
rtStatus = rtl8192_phy_checkBBAndRF(dev, HW90_BLOCK_RF,
(enum rf90_radio_path)eRFPath);
if (!rtStatus) {
-   RT_TRACE(COMP_ERR,
-"PHY_RF8256_Config():Check Radio[%d] Fail!!\n",
-eRFPath);
+   netdev_err(dev, "%s(): Failed to check RF Path %d.\n",
+  __func__, eRFPath);
goto phy_RF8256_Config_ParaFile_Fail;
}
 
@@ -227,9 +225,9 @@ bool phy_RF8256_Config_ParaFile(struct net_device *dev)
}
 
if (ret) {
-   RT_TRACE(COMP_ERR,
-"phy_RF8256_Config_ParaFile():Radio[%d] 
Fail!!",
-eRFPath);
+   netdev_err(dev,
+  "%s(): Failed to initialize RF Path %d.\n",
+  __func__, eRFPath);
goto phy_RF8256_Config_ParaFile_Fail;
}
 
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c 
b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
index e023c70..b5e4d35 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
@@ -326,8 +326,8 @@ static void rtl8192_read_eeprom_info(struct net_device *dev)
 
EEPROMId = eprom_read(dev, 0);
if (EEPROMId != RTL8190_EEPROM_ID) {
-   RT_TRACE(COMP_ERR, "EEPROM ID is invalid:%x, %x\n",
-EEPROMId, RTL8190_EEPROM_ID);
+   netdev_err(dev, "%s(): Invalid EEPROM ID: %x\n", __func__,
+  EEPROMId);
priv->AutoloadFailFlag = true;
} else {
priv->AutoloadFailFlag = false;
@@ -736,9 +736,8 @@ start:
else if (priv->pFirmware->firmware_status == FW_STATUS_5_READY)
ulRegRead |= CPU_GEN_FIRMWARE_RESET;
else
-   RT_TRACE(COMP_ERR,
-"ERROR in %s(): undefined firmware state(%d)\n",
-__func__,   priv->pFirmware->firmware_status);
+   netdev_err(dev, "%s(): undefined firmware state: %d.\n",
+  __func__, priv->pFirmware->firmware_status);
 
write_nic_dword(dev, CPU_GEN, ulRegRead);
 
@@ -754,7 +753,7 @@ s

[PATCH v5 32/34] staging: rtl8192e: Fix trivial LONG_LINE errors

2015-05-31 Thread Mateusz Kulikowski
Reindent lines to make checkpatch happy.

Signed-off-by: Mateusz Kulikowski 
---
 drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 83 +++---
 drivers/staging/rtl8192e/rtllib_rx.c   | 24 +
 2 files changed, 67 insertions(+), 40 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c 
b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
index a921857..d480229 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
@@ -403,16 +403,16 @@ static void dm_check_rate_adaptive(struct net_device *dev)
((bshort_gi_enabled) ? BIT31 : 0);
 
if (pra->ratr_state == DM_RATR_STA_HIGH) {
-   HighRSSIThreshForRA = 
pra->high2low_rssi_thresh_for_ra;
-   LowRSSIThreshForRA  = (priv->CurrentChannelBW != 
HT_CHANNEL_WIDTH_20) ?
+   HighRSSIThreshForRA = pra->high2low_rssi_thresh_for_ra;
+   LowRSSIThreshForRA = (priv->CurrentChannelBW != 
HT_CHANNEL_WIDTH_20) ?
(pra->low_rssi_thresh_for_ra40M) : 
(pra->low_rssi_thresh_for_ra20M);
} else if (pra->ratr_state == DM_RATR_STA_LOW) {
-   HighRSSIThreshForRA = pra->high_rssi_thresh_for_ra;
-   LowRSSIThreshForRA  = (priv->CurrentChannelBW != 
HT_CHANNEL_WIDTH_20) ?
+   HighRSSIThreshForRA = pra->high_rssi_thresh_for_ra;
+   LowRSSIThreshForRA = (priv->CurrentChannelBW != 
HT_CHANNEL_WIDTH_20) ?
(pra->low2high_rssi_thresh_for_ra40M) : 
(pra->low2high_rssi_thresh_for_ra20M);
} else {
-   HighRSSIThreshForRA = pra->high_rssi_thresh_for_ra;
-   LowRSSIThreshForRA  = (priv->CurrentChannelBW != 
HT_CHANNEL_WIDTH_20) ?
+   HighRSSIThreshForRA = pra->high_rssi_thresh_for_ra;
+   LowRSSIThreshForRA = (priv->CurrentChannelBW != 
HT_CHANNEL_WIDTH_20) ?
(pra->low_rssi_thresh_for_ra40M) : 
(pra->low_rssi_thresh_for_ra20M);
}
 
@@ -749,7 +749,8 @@ static void dm_TXPowerTrackingCallback_TSSI(struct 
net_device *dev)
 "Avg_TSSI_Meas_from_driver = %d\n",
 Avg_TSSI_Meas_from_driver);
TSSI_13dBm = priv->TSSI_13dBm;
-   RT_TRACE(COMP_POWER_TRACKING, "TSSI_13dBm = %d\n", 
TSSI_13dBm);
+   RT_TRACE(COMP_POWER_TRACKING, "TSSI_13dBm = %d\n",
+TSSI_13dBm);
 
if (Avg_TSSI_Meas_from_driver > TSSI_13dBm)
delta = Avg_TSSI_Meas_from_driver - TSSI_13dBm;
@@ -828,11 +829,13 @@ static void dm_TXPowerTrackingCallback_TSSI(struct 
net_device *dev)
 "priv->CCKPresentAttentuation = %d\n",
 priv->CCKPresentAttentuation);
 
-   if (priv->CCKPresentAttentuation_difference <= -12 || 
priv->CCKPresentAttentuation_difference >= 24) {
+   if (priv->CCKPresentAttentuation_difference <= -12 ||
+   priv->CCKPresentAttentuation_difference >= 24) {
priv->rtllib->bdynamic_txpower_enable = true;
write_nic_byte(dev, Pw_Track_Flag, 0);
write_nic_byte(dev, FW_Busy_Flag, 0);
-   RT_TRACE(COMP_POWER_TRACKING, "tx power 
track--->limited\n");
+   RT_TRACE(COMP_POWER_TRACKING,
+"tx power track--->limited\n");
return;
}
 
@@ -1233,18 +1236,28 @@ static void dm_bb_initialgain_restore(struct net_device 
*dev)
return;
 
rtl8192_setBBreg(dev, UFWP, bMaskByte1, 0x8);
-   rtl8192_setBBreg(dev, rOFDM0_XAAGCCore1, bit_mask, 
(u32)priv->initgain_backup.xaagccore1);
-   rtl8192_setBBreg(dev, rOFDM0_XBAGCCore1, bit_mask, 
(u32)priv->initgain_backup.xbagccore1);
-   rtl8192_setBBreg(dev, rOFDM0_XCAGCCore1, bit_mask, 
(u32)priv->initgain_backup.xcagccore1);
-   rtl8192_setBBreg(dev, rOFDM0_XDAGCCore1, bit_mask, 
(u32)priv->initgain_backup.xdagccore1);
+   rtl8192_setBBreg(dev, rOFDM0_XAAGCCore1, bit_mask,
+(u32)priv->initgain_backup.xaagccore1);
+   rtl8192_setBBreg(dev, rOFDM0_XBAGCCore1, bit_mask,
+(u32)priv->initgain_backup.xbagccore1);
+   rtl8192_setBBreg(dev, rOFDM0_XCAGCCore1, bit_mask,
+(u32)priv->initgain_backup.xcagccore1);
+   rtl8192_setBBreg(dev, rOFDM0_XDAGCCore1, bit_mask,
+(u32)priv->initgain_backup.xdagccore1);
bit_mask  = bMaskByte2;
-   rtl

RE: [PATCH V2 3/3] Drivers: hv: vmbus: Allocate ring buffer memory in NUMA aware fashion

2015-05-31 Thread KY Srinivasan


> -Original Message-
> From: Greg KH [mailto:gre...@linuxfoundation.org]
> Sent: Saturday, May 30, 2015 11:41 PM
> To: KY Srinivasan
> Cc: linux-ker...@vger.kernel.org; de...@linuxdriverproject.org;
> o...@aepfle.de; a...@canonical.com; vkuzn...@redhat.com;
> jasow...@redhat.com
> Subject: Re: [PATCH V2 3/3] Drivers: hv: vmbus: Allocate ring buffer memory
> in NUMA aware fashion
> 
> On Sat, May 30, 2015 at 11:37:49PM -0700, K. Y. Srinivasan wrote:
> > Allocate ring buffer memory from the NUMA node assigned to the
> channel.
> 
> But you do more than just that.  If there's a failure, you fall-back to
> the old allocation method.  Why not mention that as well?

I will mention this in the change log. 
> 
> And is that what you really want?  Do we ever fail allocation for a node
> but still have memory from another one?  Shouldn't the logic be in the
> allocator and not be forced to be in every caller?

I do want this behavior. The allocation from a specific node is just to 
maintain NUMA
locality and there is no correctness issue even if the allocation came from a 
non-preferred
node. So, I don't want to fail the load of the driver just because I could not 
allocate from
the preferred node.
To answer your second question,  I think the allocation can fail when we 
specify a specific node,
when there may be memory available on other zones and the specified node has no 
free memory.
I think it is good to have the caller deal with this case since in some cases 
we would rather fail if we cannot
allocate memory from the specified node.

Regards,

K. Y
> 
> thanks,
> 
> greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Patch to integrate RapidDisk and RapidCache RAM Drive / Caching modules into stating subsystem.

2015-05-31 Thread Petros Koutoupis
Attached is a patch for two modules: RapidDisk & RapidCache. RapidDisk is a 
Linux
RAM drive module which allows the user to dynamically create, remove, and resize
RAM-based block devices. RapidDisk is designed to work with both volatile and
non-volatile memory. In the case of volatile memory, memory is allocated only 
when
needed. The RapidCache module in turn utilizes a RapidDisk volume as a FIFO
Write-Through caching node to a slower block device.

Signed-off-by: Petros Koutoupis 
---
 Kconfig   |2 
 Makefile  |1 
 rapiddisk/Documentation/rxdsk.txt |   74 ++
 rapiddisk/Kconfig |   10 
 rapiddisk/Makefile|2 
 rapiddisk/rxcache.c   | 1181 ++
 rapiddisk/rxcommon.h  |   22 
 rapiddisk/rxdsk.c |  799 +
 8 files changed, 2091 insertions(+)

diff -uNpr linux-next.orig/drivers/staging/Kconfig 
linux-next/drivers/staging/Kconfig
--- linux-next.orig/drivers/staging/Kconfig 2015-05-30 13:37:03.929726967 
-0500
+++ linux-next/drivers/staging/Kconfig  2015-05-31 13:36:08.673757913 -0500
@@ -112,4 +112,6 @@ source "drivers/staging/fsl-mc/Kconfig"
 
 source "drivers/staging/wilc1000/Kconfig"
 
+source "drivers/staging/rapiddisk/Kconfig"
+
 endif # STAGING
diff -uNpr linux-next.orig/drivers/staging/Makefile 
linux-next/drivers/staging/Makefile
--- linux-next.orig/drivers/staging/Makefile2015-05-30 13:37:03.921726968 
-0500
+++ linux-next/drivers/staging/Makefile 2015-05-31 13:36:08.753757911 -0500
@@ -48,3 +48,4 @@ obj-$(CONFIG_COMMON_CLK_XLNX_CLKWZRD) +=
 obj-$(CONFIG_FB_TFT)   += fbtft/
 obj-$(CONFIG_FSL_MC_BUS)   += fsl-mc/
 obj-$(CONFIG_WILC1000) += wilc1000/
+obj-$(CONFIG_RXDSK)+= rapiddisk/
diff -uNpr linux-next.orig/drivers/staging/rapiddisk/Documentation/rxdsk.txt 
linux-next/drivers/staging/rapiddisk/Documentation/rxdsk.txt
--- linux-next.orig/drivers/staging/rapiddisk/Documentation/rxdsk.txt   
1969-12-31 18:00:00.0 -0600
+++ linux-next/drivers/staging/rapiddisk/Documentation/rxdsk.txt
2015-05-31 13:38:29.893753897 -0500
@@ -0,0 +1,74 @@
+RapidDisk (rxdsk) RAM disk and RapidCache (rxcache) Linux modules
+
+== Description ==
+
+RapidDisk or rxdsk was designed to be used in high performing environments
+and has been designed with simplicity in mind. Utilizing a user land binary,
+the system administrator is capable of dynamically adding new RAM based
+block devices of varying sizes, removing existing ones to even listing all
+existing RAM block devices. The rxdsk module has been designed to allocate
+from the system's memory pages and is capable of addressing memory to
+support Gigabytes if not a Terabyte of available Random Access Memory.
+
+RapidCache or rxcache is designed to leverage the high speed performing
+technologies of the RapidDisk RAM disk and utilizing the Device Mapper
+framework, map an rxdsk volume to act as a block device's Write/Read-through
+cache. This can significantly boost the performance of a local or remote
+disk device.
+
+
+== Module Parameters ==
+
+RapidDisk
+-
+max_rxcnt: Total RAM Disk devices available for use. (Default = 128 = MAX) 
(int)
+max_sectors: Maximum sectors (in KB) for the request queue. (Default = 127) 
(int)
+nr_requests: Number of requests at a given time for the request queue. 
(Default = 128) (int)
+
+RapidCache
+-
+None.
+
+
+== Usage ==
+
+RapidDisk
+-
+It is advised to utilize the userland utility, rxadm, but this is essentially 
what is
+written to the /proc/rxctl proc file to manage rxdsk volumes:
+
+Attach a new rxdsk volume by typing (size in sectors):
+# echo "rxdsk attach 0 8192" > /proc/rxctl
+
+Attach a non-volatile rxdsk volume by typing (starting / ending addresses
+in decimal format):
+# echo "rxdsk attach-nv 0 1234 56789" > /proc/rxctl
+
+Detach an existing rxdsk volume by typing:
+# echo "rxdsk detach 0" > /proc/rxctl
+
+Resize an existing rxdsk volume by typing (size in sectors):
+# echo "rxdsk resize 0 65536" > /proc/rxctl
+
+
+Note - the integer after the "rxdsk " is the RapidDisk volume number. 
"0"
+would signify "rxd0."
+
+RapidCache
+-
+It is advised to utilize the userland utility, rxadm, but this is essentially 
what is
+sent to the dmsetup command:
+
+Map an existing rxdsk volume to a block device by typing:
+# echo 0 4194303 rxcache /dev/sdb /dev/rxd0 0 8 196608|dmsetup create rxc0
+
+Parameter 1: Start block of source volume (in sectors).
+Parameter 2: End block of source volume (in sectors).
+Parameter 4: Source volume.
+Parameter 5: Cache volume.
+Parameter 7: Caching block size.
+Parameter 8: Cache size (in sectors).
+
+Unmap an rxdsk volume:
+
+# dmsetup remove rxc0
diff -uNpr linux-next.orig/drivers/staging/rapiddisk/Kconfig 
linux-next/drivers/staging/rapiddisk/Kconfig
--- linux-next.orig/drivers/staging/rapiddisk/Kconfig   1969-1

Re: [PATCH v5 00/34] staging: rtl8192e: Fix more checkpatch.pl warnings

2015-05-31 Thread Joe Perches
On Sun, 2015-05-31 at 20:19 +0200, Mateusz Kulikowski wrote:
> Updated series of patches for rtl8192.
[]
>  31 files changed, 1260 insertions(+), 2011 deletions(-)

Nice diffstat

btw:

If you have to resubmit this, please try to remove
the unnecessary periods after logging statements.

Things like:

-   RT_TRACE(COMP_ERR,
-"PHY_SetRF8256Bandwidth(): unknown 
hardware version\n");
+   netdev_warn(dev, "%s(): Unknown HW version.\n",
+   __func__);

aren't sentences and don't need punctuation.

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


Re: [PATCH] Patch to integrate RapidDisk and RapidCache RAM Drive / Caching modules into stating subsystem.

2015-05-31 Thread Greg KH
On Sun, May 31, 2015 at 02:43:16PM -0500, Petros Koutoupis wrote:
> Attached is a patch for two modules: RapidDisk & RapidCache. RapidDisk is a 
> Linux
> RAM drive module which allows the user to dynamically create, remove, and 
> resize
> RAM-based block devices. RapidDisk is designed to work with both volatile and
> non-volatile memory. In the case of volatile memory, memory is allocated only 
> when
> needed. The RapidCache module in turn utilizes a RapidDisk volume as a FIFO
> Write-Through caching node to a slower block device.
> 
> Signed-off-by: Petros Koutoupis 
> ---
>  Kconfig   |2 
>  Makefile  |1 
>  rapiddisk/Documentation/rxdsk.txt |   74 ++
>  rapiddisk/Kconfig |   10 
>  rapiddisk/Makefile|2 
>  rapiddisk/rxcache.c   | 1181 
> ++
>  rapiddisk/rxcommon.h  |   22 
>  rapiddisk/rxdsk.c |  799 +
>  8 files changed, 2091 insertions(+)

No TODO file or MAINTAINERS entry like I asked for?
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: Replace kzalloc and memcpy by kmemdup

2015-05-31 Thread gre...@linuxfoundation.org
On Sun, May 31, 2015 at 06:13:00AM -0700, Joe Perches wrote:
> On Sun, 2015-05-31 at 11:35 +0900, gre...@linuxfoundation.org wrote:
> > On Wed, May 20, 2015 at 07:04:27AM +, Dumbre, Nitesh Dilip (N.) wrote:
> > > This patch was generated by coccicheck and replaces kzalloc followed
> > > by memcpy with kmemdup
> > > 
> > > Signed-off-by: Nitesh Dumbre 
> > 
> > Name doesn't match the From: line, please fix your broken email client.
> > 
> > WHat is up with this company's email, there is a bunch of patches from
> > different people, all of them broken like this.
> 
> Greg you are being a bit silly here.
> 
> The names match, but the company's email naming
> policy is not "first last" but "last, first".
> 
> People generally sign their names "first last".
> 
> Nothing is broken but your desire for exact name
> matching.

There's also an odd "(H)." in the From line as well.

And yes, I do desire that as I know all about the tools we have that try
to check these things (numbers of developers, etc.) and some of them
don't like mismatched names.

Also, it's good for people to learn about "From:" in the body of the
email, that's what it is there for :)

thanks,

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


Re: [PATCH v5 09/34] staging: rtl8192e: Remove RTLLIB_DEBUG_WX()

2015-05-31 Thread Greg KH
On Sun, May 31, 2015 at 08:19:28PM +0200, Mateusz Kulikowski wrote:
> Use netdev_dbg() instead of RTLLIB_DEBUG_WX().
> Rewrite some messages to be more readable.
> 
> Signed-off-by: Mateusz Kulikowski 
> ---
>  drivers/staging/rtl8192e/rtllib.h|  1 -
>  drivers/staging/rtl8192e/rtllib_wx.c | 33 -
>  2 files changed, 16 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/staging/rtl8192e/rtllib.h 
> b/drivers/staging/rtl8192e/rtllib.h
> index 42c37f8..392bcd5 100644
> --- a/drivers/staging/rtl8192e/rtllib.h
> +++ b/drivers/staging/rtl8192e/rtllib.h
> @@ -703,7 +703,6 @@ do {  
> \
>  #define RTLLIB_DL_ERR   (1<<31)
>  #define RTLLIB_DEBUG_INFO(f, a...)   RTLLIB_DEBUG(RTLLIB_DL_INFO, f, ## a)
>  
> -#define RTLLIB_DEBUG_WX(f, a...) RTLLIB_DEBUG(RTLLIB_DL_WX, f, ## a)
>  #define RTLLIB_DEBUG_SCAN(f, a...)   RTLLIB_DEBUG(RTLLIB_DL_SCAN, f, ## a)
>  #define RTLLIB_DEBUG_STATE(f, a...)  RTLLIB_DEBUG(RTLLIB_DL_STATE, f, ## a)
>  #define RTLLIB_DEBUG_MGMT(f, a...)  RTLLIB_DEBUG(RTLLIB_DL_MGMT, f, ## a)
> diff --git a/drivers/staging/rtl8192e/rtllib_wx.c 
> b/drivers/staging/rtl8192e/rtllib_wx.c
> index 6234aae..c2c5f0d 100644
> --- a/drivers/staging/rtl8192e/rtllib_wx.c
> +++ b/drivers/staging/rtl8192e/rtllib_wx.c
> @@ -266,7 +266,7 @@ int rtllib_wx_get_scan(struct rtllib_device *ieee,
>   int i = 0;
>   int err = 0;
>  
> - RTLLIB_DEBUG_WX("Getting scan\n");
> + netdev_dbg(ieee->dev, "Getting scan\n");
>   down(&ieee->wx_sem);
>   spin_lock_irqsave(&ieee->lock, flags);
>  
> @@ -293,7 +293,7 @@ int rtllib_wx_get_scan(struct rtllib_device *ieee,
>   wrqu->data.length = ev -  extra;
>   wrqu->data.flags = 0;
>  
> - RTLLIB_DEBUG_WX("exit: %d networks returned.\n", i);
> + netdev_dbg(ieee->dev, "%s(): %d networks returned.\n", __func__, i);
>  
>   return err;
>  }
> @@ -311,7 +311,7 @@ int rtllib_wx_set_encode(struct rtllib_device *ieee,
>   int i, key, key_provided, len;
>   struct lib80211_crypt_data **crypt;
>  
> - RTLLIB_DEBUG_WX("SET_ENCODE\n");
> + netdev_dbg(ieee->dev, "%s()\n", __func__);

Why are you adding __func__?  Stuff like this, that is obviously a
"trace" function can just be deleted.

No error message should be showing the function name as it should be
"obvious" as to what driver / device that this message came from, which
is wht the netdev_* calls provide.  So the function name is just extra
noise.

I'll take these patches, but removing these types of things would be
good to do in future patches.

thanks,

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


Re: [PATCH v5 00/34] staging: rtl8192e: Fix more checkpatch.pl warnings

2015-05-31 Thread Greg KH
On Sun, May 31, 2015 at 08:19:19PM +0200, Mateusz Kulikowski wrote:
> Updated series of patches for rtl8192.
> Rebased to latest staging-next (9535ebc5e). Built and target tested 
> (tests like for v3 + download of 1Mb file over http).
> Side note: quality/performance of this driver is still poor - it drops
> a lot of packets (at least when talking to 802.11N/ 2.4G / WPA2 network).

Nice job, all now applied.

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


Re: [PATCH 0/6] use devicemodel with parport

2015-05-31 Thread Greg Kroah-Hartman
On Wed, May 20, 2015 at 08:56:56PM +0530, Sudip Mukherjee wrote:
> After 5 versions of WIP, finally a patch submission.
> parport subsystem is now in the transition stage and supports the old
> model and the new device model. 3 of the drivers have been converted
> into new model and tested.
> After other drivers are converted we can remove the old code from
> parport.

This looks good, very nice job.

Are you going to continue to fix up the other drivers?  I don't want us
to have a half-converted subsystem in the kernel.

thanks,

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


Re: [PATCH RESEND] staging: rtl8192u: ieee80211: Fix sparse endianness warnings

2015-05-31 Thread Greg KH
On Sun, May 31, 2015 at 12:17:48PM -0300, Gaston Gonzalez wrote:
> Fix the following sparse warnings:
> 
> drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: warning: 
> incorrect type in assignment (different base types)
> drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:expected 
> restricted __le16 [usertype] frame_ctl
> drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:got int
> drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50: warning: 
> invalid assignment: |=
> drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:left side 
> has type restricted __le16
> drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:right side 
> has type int
> 
> 
> Signed-off-by: Gaston Gonzalez 
> ---
>  drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

Still doesn't apply, but this might be a git bug, see below:

> diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
> b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> index d2e8b12..0477ba1 100644
> --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> @@ -660,2 +660,2 @@ inline struct sk_buff 
> *ieee80211_authentication_req(struct ieee80211_network *be
>   auth = (struct ieee80211_authentication *)
>   skb_put(skb, sizeof(struct ieee80211_authentication));
> 
> - auth->header.frame_ctl = IEEE80211_STYPE_AUTH;
> - if (challengelen) auth->header.frame_ctl |= IEEE80211_FCTL_WEP;
> + auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
> + if (challengelen)
> + auth->header.frame_ctl |= cpu_to_le16(IEEE80211_FCTL_WEP);
> 
>   auth->header.duration_id = 0x013a; //FIXME
> 
> --
> 2.1.4

This patch is not created properly.  Did you edit it by hand?  If not,
we need to report a bug as the diff is obviously wrong, look at the @@@
line.

Can you update your version of git to see if it's fixed there?

Also, patch tells you that this is broken:

checking file drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
patch:  malformed patch at line 132:skb_put(skb, 
sizeof(struct ieee80211_authentication));




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


Re: [PATCH RESEND] staging: rtl8192u: ieee80211: Fix sparse endianness warnings

2015-05-31 Thread Gaston Gonzalez
On Mon, Jun 01, 2015 at 07:17:39AM +0900, Greg KH wrote:
> On Sun, May 31, 2015 at 12:17:48PM -0300, Gaston Gonzalez wrote:
> > Fix the following sparse warnings:
> > 
> > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: warning: 
> > incorrect type in assignment (different base types)
> > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:expected 
> > restricted __le16 [usertype] frame_ctl
> > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:got int
> > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50: warning: 
> > invalid assignment: |=
> > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:left side 
> > has type restricted __le16
> > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:right 
> > side has type int
> > 
> > 
> > Signed-off-by: Gaston Gonzalez 
> > ---
> >  drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> Still doesn't apply, but this might be a git bug, see below:
> 
> > diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
> > b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > index d2e8b12..0477ba1 100644
> > --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > @@ -660,2 +660,2 @@ inline struct sk_buff 
> > *ieee80211_authentication_req(struct ieee80211_network *be
> > auth = (struct ieee80211_authentication *)
> > skb_put(skb, sizeof(struct ieee80211_authentication));
> > 
> > -   auth->header.frame_ctl = IEEE80211_STYPE_AUTH;
> > -   if (challengelen) auth->header.frame_ctl |= IEEE80211_FCTL_WEP;
> > +   auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
> > +   if (challengelen)
> > +   auth->header.frame_ctl |= cpu_to_le16(IEEE80211_FCTL_WEP);
> > 
> > auth->header.duration_id = 0x013a; //FIXME
> > 
> > --
> > 2.1.4
> 
> This patch is not created properly.  Did you edit it by hand?  If not,
> we need to report a bug as the diff is obviously wrong, look at the @@@
> line.
> 
> Can you update your version of git to see if it's fixed there?
> 
> Also, patch tells you that this is broken:
> 
> checking file drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> patch:  malformed patch at line 132:skb_put(skb, 
> sizeof(struct ieee80211_authentication));

Greg,

The patch was prepared using git format-patch. The git version I'm using:

gaston22:\-$ git --version 
git version 2.1.4

I did deleted 4 whitespaces by hand after running checkpatch.pl on the patch.
Could that drive the issue? However, I could properly apply the patch using 'git
am' from an email and get the git log right.

I'll try with a newer version of git as you suggest.
Any other check I could do before the submission? I really don't like making
noise :-(

Thanks,

Gaston 

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


Re: [PATCH RESEND] staging: rtl8192u: ieee80211: Fix sparse endianness warnings

2015-05-31 Thread Greg KH
On Sun, May 31, 2015 at 08:07:21PM -0300, Gaston Gonzalez wrote:
> On Mon, Jun 01, 2015 at 07:17:39AM +0900, Greg KH wrote:
> > On Sun, May 31, 2015 at 12:17:48PM -0300, Gaston Gonzalez wrote:
> > > Fix the following sparse warnings:
> > > 
> > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: warning: 
> > > incorrect type in assignment (different base types)
> > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:
> > > expected restricted __le16 [usertype] frame_ctl
> > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:got int
> > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50: warning: 
> > > invalid assignment: |=
> > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:left 
> > > side has type restricted __le16
> > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:right 
> > > side has type int
> > > 
> > > 
> > > Signed-off-by: Gaston Gonzalez 
> > > ---
> > >  drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 5 +++--
> > >  1 file changed, 3 insertions(+), 2 deletions(-)
> > 
> > Still doesn't apply, but this might be a git bug, see below:
> > 
> > > diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
> > > b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > > index d2e8b12..0477ba1 100644
> > > --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > > +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > > @@ -660,2 +660,2 @@ inline struct sk_buff 
> > > *ieee80211_authentication_req(struct ieee80211_network *be
> > >   auth = (struct ieee80211_authentication *)
> > >   skb_put(skb, sizeof(struct ieee80211_authentication));
> > > 
> > > - auth->header.frame_ctl = IEEE80211_STYPE_AUTH;
> > > - if (challengelen) auth->header.frame_ctl |= IEEE80211_FCTL_WEP;
> > > + auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
> > > + if (challengelen)
> > > + auth->header.frame_ctl |= cpu_to_le16(IEEE80211_FCTL_WEP);
> > > 
> > >   auth->header.duration_id = 0x013a; //FIXME
> > > 
> > > --
> > > 2.1.4
> > 
> > This patch is not created properly.  Did you edit it by hand?  If not,
> > we need to report a bug as the diff is obviously wrong, look at the @@@
> > line.
> > 
> > Can you update your version of git to see if it's fixed there?
> > 
> > Also, patch tells you that this is broken:
> > 
> > checking file drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > patch:  malformed patch at line 132:skb_put(skb, 
> > sizeof(struct ieee80211_authentication));
> 
> Greg,
> 
> The patch was prepared using git format-patch. The git version I'm using:
> 
> gaston22:\-$ git --version 
> git version 2.1.4
> 
> I did deleted 4 whitespaces by hand after running checkpatch.pl on the patch.
> Could that drive the issue? However, I could properly apply the patch using 
> 'git
> am' from an email and get the git log right.

Yes, but is there really a commit there?  That's what messed me up last
time, git applied it, but with no actual diff (which is probably a bug
too, just a different one...)

And if you edited it by hand, that might explain the issue, what did the
"original" patch look like?

> I'll try with a newer version of git as you suggest.
> Any other check I could do before the submission? I really don't like making
> noise :-(

Let's see the original version first before blaming git.  Odds are you
got something wrong when editing the patch by hand.

thanks,

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


Re: [PATCH RESEND] staging: rtl8192u: ieee80211: Fix sparse endianness warnings

2015-05-31 Thread Gaston Gonzalez
On Mon, Jun 01, 2015 at 08:24:17AM +0900, Greg KH wrote:
> On Sun, May 31, 2015 at 08:07:21PM -0300, Gaston Gonzalez wrote:
> > On Mon, Jun 01, 2015 at 07:17:39AM +0900, Greg KH wrote:
> > > On Sun, May 31, 2015 at 12:17:48PM -0300, Gaston Gonzalez wrote:
> > > > Fix the following sparse warnings:
> > > > 
> > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: warning: 
> > > > incorrect type in assignment (different base types)
> > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:
> > > > expected restricted __le16 [usertype] frame_ctl
> > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:got 
> > > > int
> > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50: warning: 
> > > > invalid assignment: |=
> > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:left 
> > > > side has type restricted __le16
> > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:right 
> > > > side has type int
> > > > 
> > > > 
> > > > Signed-off-by: Gaston Gonzalez 
> > > > ---
> > > >  drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 5 +++--
> > > >  1 file changed, 3 insertions(+), 2 deletions(-)
> > > 
> > > Still doesn't apply, but this might be a git bug, see below:
> > > 
> > > > diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
> > > > b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > > > index d2e8b12..0477ba1 100644
> > > > --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > > > +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > > > @@ -660,2 +660,2 @@ inline struct sk_buff 
> > > > *ieee80211_authentication_req(struct ieee80211_network *be
> > > > auth = (struct ieee80211_authentication *)
> > > > skb_put(skb, sizeof(struct ieee80211_authentication));
> > > > 
> > > > -   auth->header.frame_ctl = IEEE80211_STYPE_AUTH;
> > > > -   if (challengelen) auth->header.frame_ctl |= IEEE80211_FCTL_WEP;
> > > > +   auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
> > > > +   if (challengelen)
> > > > +   auth->header.frame_ctl |= 
> > > > cpu_to_le16(IEEE80211_FCTL_WEP);
> > > > 
> > > > auth->header.duration_id = 0x013a; //FIXME
> > > > 
> > > > --
> > > > 2.1.4
> > > 
> > > This patch is not created properly.  Did you edit it by hand?  If not,
> > > we need to report a bug as the diff is obviously wrong, look at the @@@
> > > line.
> > > 
> > > Can you update your version of git to see if it's fixed there?
> > > 
> > > Also, patch tells you that this is broken:
> > > 
> > > checking file drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > > patch:  malformed patch at line 132:skb_put(skb, 
> > > sizeof(struct ieee80211_authentication));
> > 
> > Greg,
> > 
> > The patch was prepared using git format-patch. The git version I'm using:
> > 
> > gaston22:\-$ git --version 
> > git version 2.1.4
> > 
> > I did deleted 4 whitespaces by hand after running checkpatch.pl on the 
> > patch.
> > Could that drive the issue? However, I could properly apply the patch using 
> > 'git
> > am' from an email and get the git log right.
> 
> Yes, but is there really a commit there?  That's what messed me up last
> time, git applied it, but with no actual diff (which is probably a bug
> too, just a different one...)
> 

Yes, there was a commit. In fact the patch prepare: git format-patch -1

> And if you edited it by hand, that might explain the issue, what did the
> "original" patch look like?

Attached the original patch I submitted:
0001-Regen-ieee80211_softmac.c-endianness-fix-patch.patch

Attached is also the patch without the hand-edited deletions:

ieee80211_softmac_fixes_v3.patch

My steps once having this were:

- run perl checkpatch -f 
- I got total: 4 errors, 0 warnings, 28 lines checked. The 4 warnings were 
extra white
  spaces. 
- Delete the spaces
- git send-email --annotate Patch

> 
> > I'll try with a newer version of git as you suggest.
> > Any other check I could do before the submission? I really don't like making
> > noise :-(
> 
> Let's see the original version first before blaming git.  Odds are you
> got something wrong when editing the patch by hand.
> 

Ok.
> thanks,
> 
> greg k-h

thanks,

Gaston
>From b689a6d0de2a2d483e012698996b7bda9a33d6e2 Mon Sep 17 00:00:00 2001
From: Gaston Gonzalez 
Date: Sun, 31 May 2015 01:07:54 -0300
Subject: [PATCH RESEND] staging: rtl8192u: ieee80211: Fix sparse endianness warnings

Fix the following sparse warnings:

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:expected restricted __le16 [usertype] frame_ctl
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:got int
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50: warning: invalid assignment: |=
driver

Re: [PATCH RESEND] staging: rtl8192u: ieee80211: Fix sparse endianness warnings

2015-05-31 Thread Greg KH
On Sun, May 31, 2015 at 10:41:52PM -0300, Gaston Gonzalez wrote:
> On Mon, Jun 01, 2015 at 08:24:17AM +0900, Greg KH wrote:
> > On Sun, May 31, 2015 at 08:07:21PM -0300, Gaston Gonzalez wrote:
> > > On Mon, Jun 01, 2015 at 07:17:39AM +0900, Greg KH wrote:
> > > > On Sun, May 31, 2015 at 12:17:48PM -0300, Gaston Gonzalez wrote:
> > > > > Fix the following sparse warnings:
> > > > > 
> > > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: 
> > > > > warning: incorrect type in assignment (different base types)
> > > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:
> > > > > expected restricted __le16 [usertype] frame_ctl
> > > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:got 
> > > > > int
> > > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50: 
> > > > > warning: invalid assignment: |=
> > > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:
> > > > > left side has type restricted __le16
> > > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:
> > > > > right side has type int
> > > > > 
> > > > > 
> > > > > Signed-off-by: Gaston Gonzalez 
> > > > > ---
> > > > >  drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 5 +++--
> > > > >  1 file changed, 3 insertions(+), 2 deletions(-)
> > > > 
> > > > Still doesn't apply, but this might be a git bug, see below:
> > > > 
> > > > > diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
> > > > > b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > > > > index d2e8b12..0477ba1 100644
> > > > > --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > > > > +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > > > > @@ -660,2 +660,2 @@ inline struct sk_buff 
> > > > > *ieee80211_authentication_req(struct ieee80211_network *be
> > > > >   auth = (struct ieee80211_authentication *)
> > > > >   skb_put(skb, sizeof(struct ieee80211_authentication));
> > > > > 
> > > > > - auth->header.frame_ctl = IEEE80211_STYPE_AUTH;
> > > > > - if (challengelen) auth->header.frame_ctl |= IEEE80211_FCTL_WEP;
> > > > > + auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
> > > > > + if (challengelen)
> > > > > + auth->header.frame_ctl |= 
> > > > > cpu_to_le16(IEEE80211_FCTL_WEP);
> > > > > 
> > > > >   auth->header.duration_id = 0x013a; //FIXME
> > > > > 
> > > > > --
> > > > > 2.1.4
> > > > 
> > > > This patch is not created properly.  Did you edit it by hand?  If not,
> > > > we need to report a bug as the diff is obviously wrong, look at the @@@
> > > > line.
> > > > 
> > > > Can you update your version of git to see if it's fixed there?
> > > > 
> > > > Also, patch tells you that this is broken:
> > > > 
> > > > checking file drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > > > patch:  malformed patch at line 132:skb_put(skb, 
> > > > sizeof(struct ieee80211_authentication));
> > > 
> > > Greg,
> > > 
> > > The patch was prepared using git format-patch. The git version I'm using:
> > > 
> > > gaston22:\-$ git --version 
> > > git version 2.1.4
> > > 
> > > I did deleted 4 whitespaces by hand after running checkpatch.pl on the 
> > > patch.
> > > Could that drive the issue? However, I could properly apply the patch 
> > > using 'git
> > > am' from an email and get the git log right.
> > 
> > Yes, but is there really a commit there?  That's what messed me up last
> > time, git applied it, but with no actual diff (which is probably a bug
> > too, just a different one...)
> > 
> 
> Yes, there was a commit. In fact the patch prepare: git format-patch -1
> 
> > And if you edited it by hand, that might explain the issue, what did the
> > "original" patch look like?
> 
> Attached the original patch I submitted:
> 0001-Regen-ieee80211_softmac.c-endianness-fix-patch.patch

Which is broken.

> Attached is also the patch without the hand-edited deletions:
> 
> ieee80211_softmac_fixes_v3.patch

That patch is correct.

Why did you edit the patch metadata in a way that was incorrect?

> 
> My steps once having this were:
> 
> - run perl checkpatch -f 
> - I got total: 4 errors, 0 warnings, 28 lines checked. The 4 warnings were 
> extra white
>   spaces. 
> - Delete the spaces
> - git send-email --annotate Patch

You did a few other things here, you hand-edited the patch, which broke
it.

Yes, 'git am' does apply it, but not really, as there's a bug in git
that you see I notified the git developers about.  So I still can't
apply this patch, please resend it in a way that is not broken, like
your attachment here :)

thanks,

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


[PATCH] staging: wlan-ng: fix long line

2015-05-31 Thread Douglas Barbonaglia Sathler Figueiredo
From: douglasbsf 

Style (line over 80 chars) in drivers/staging/wlan-ng/prism2fw.c

Signed-off-by: Douglas Barbonaglia Sathler Figueiredo 

---
 drivers/staging/wlan-ng/prism2fw.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wlan-ng/prism2fw.c 
b/drivers/staging/wlan-ng/prism2fw.c
index 9408644..fe36613 100644
--- a/drivers/staging/wlan-ng/prism2fw.c
+++ b/drivers/staging/wlan-ng/prism2fw.c
@@ -708,7 +708,10 @@ static int plugimage(struct imgchunk *fchunk, unsigned int 
nfchunks,
continue;
}
 
-   /* Validate plug address against chunk data and identify chunk 
*/
+   /*
+* Validate plug address against
+* chunk data and identify chunk
+*/
for (c = 0; c < nfchunks; c++) {
cstart = fchunk[c].addr;
cend = fchunk[c].addr + fchunk[c].len;
@@ -923,7 +926,8 @@ static int read_fwfile(const struct ihex_binrec *record)
  rcnt,
  s3info[ns3info].len,
  s3info[ns3info].type);
-   if (((s3info[ns3info].len - 1) * sizeof(u16)) > 
sizeof(s3info[ns3info].info)) {
+   if (((s3info[ns3info].len - 1) * sizeof(u16)) >
+  sizeof(s3info[ns3info].info)) {
pr_err("S3 inforec length too long - 
aborting\n");
return 1;
}
-- 
1.9.3

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


Re: [PATCH RESEND] staging: rtl8192u: ieee80211: Fix sparse endianness warnings

2015-05-31 Thread Gaston Gonzalez
On Mon, Jun 01, 2015 at 10:53:20AM +0900, Greg KH wrote:
> On Sun, May 31, 2015 at 10:41:52PM -0300, Gaston Gonzalez wrote:
> > On Mon, Jun 01, 2015 at 08:24:17AM +0900, Greg KH wrote:
> > > On Sun, May 31, 2015 at 08:07:21PM -0300, Gaston Gonzalez wrote:
> > > > On Mon, Jun 01, 2015 at 07:17:39AM +0900, Greg KH wrote:
> > > > > On Sun, May 31, 2015 at 12:17:48PM -0300, Gaston Gonzalez wrote:
> > > > > > Fix the following sparse warnings:
> > > > > > 
> > > > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: 
> > > > > > warning: incorrect type in assignment (different base types)
> > > > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:
> > > > > > expected restricted __le16 [usertype] frame_ctl
> > > > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:
> > > > > > got int
> > > > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50: 
> > > > > > warning: invalid assignment: |=
> > > > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:
> > > > > > left side has type restricted __le16
> > > > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:
> > > > > > right side has type int
> > > > > > 
> > > > > > 
> > > > > > Signed-off-by: Gaston Gonzalez 
> > > > > > ---
> > > > > >  drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 5 +++--
> > > > > >  1 file changed, 3 insertions(+), 2 deletions(-)
> > > > > 
> > > > > Still doesn't apply, but this might be a git bug, see below:
> > > > > 
> > > > > > diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
> > > > > > b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > > > > > index d2e8b12..0477ba1 100644
> > > > > > --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > > > > > +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > > > > > @@ -660,2 +660,2 @@ inline struct sk_buff 
> > > > > > *ieee80211_authentication_req(struct ieee80211_network *be
> > > > > > auth = (struct ieee80211_authentication *)
> > > > > > skb_put(skb, sizeof(struct ieee80211_authentication));
> > > > > > 
> > > > > > -   auth->header.frame_ctl = IEEE80211_STYPE_AUTH;
> > > > > > -   if (challengelen) auth->header.frame_ctl |= IEEE80211_FCTL_WEP;
> > > > > > +   auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
> > > > > > +   if (challengelen)
> > > > > > +   auth->header.frame_ctl |= 
> > > > > > cpu_to_le16(IEEE80211_FCTL_WEP);
> > > > > > 
> > > > > > auth->header.duration_id = 0x013a; //FIXME
> > > > > > 
> > > > > > --
> > > > > > 2.1.4
> > > > > 
> > > > > This patch is not created properly.  Did you edit it by hand?  If not,
> > > > > we need to report a bug as the diff is obviously wrong, look at the 
> > > > > @@@
> > > > > line.
> > > > > 
> > > > > Can you update your version of git to see if it's fixed there?
> > > > > 
> > > > > Also, patch tells you that this is broken:
> > > > > 
> > > > > checking file drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > > > > patch:  malformed patch at line 132:skb_put(skb, 
> > > > > sizeof(struct ieee80211_authentication));
> > > > 
> > > > Greg,
> > > > 
> > > > The patch was prepared using git format-patch. The git version I'm 
> > > > using:
> > > > 
> > > > gaston22:\-$ git --version 
> > > > git version 2.1.4
> > > > 
> > > > I did deleted 4 whitespaces by hand after running checkpatch.pl on the 
> > > > patch.
> > > > Could that drive the issue? However, I could properly apply the patch 
> > > > using 'git
> > > > am' from an email and get the git log right.
> > > 
> > > Yes, but is there really a commit there?  That's what messed me up last
> > > time, git applied it, but with no actual diff (which is probably a bug
> > > too, just a different one...)
> > > 
> > 
> > Yes, there was a commit. In fact the patch prepare: git format-patch -1
> > 
> > > And if you edited it by hand, that might explain the issue, what did the
> > > "original" patch look like?
> > 
> > Attached the original patch I submitted:
> > 0001-Regen-ieee80211_softmac.c-endianness-fix-patch.patch
> 
> Which is broken.
> 
> > Attached is also the patch without the hand-edited deletions:
> > 
> > ieee80211_softmac_fixes_v3.patch
> 
> That patch is correct.
> 
> Why did you edit the patch metadata in a way that was incorrect?

The only edit I did was from within git send-email --annotate. Nothing else. I
get now that that editor is not for everything... as I get the rest of the 
apply process 
 right, I thought it was ok that way. My bad :(
> 
> > 
> > My steps once having this were:
> > 
> > - run perl checkpatch -f 
> > - I got total: 4 errors, 0 warnings, 28 lines checked. The 4 warnings were 
> > extra white
> >   spaces. 
> > - Delete the spaces
> > - git send-email --annotate Patch
> 
> You did a few other things here, you hand-edited the patch, which broke
> it.
> 
> Yes, 'git am' does apply it, but not really, as there's a bug in gi

[PATCH] Patch to integrate RapidDisk and RapidCache RAM Drive / Caching modules into stating subsystem.

2015-05-31 Thread Petros Koutoupis
Attached is a patch for two modules: RapidDisk & RapidCache. RapidDisk is a 
Linux
RAM drive module which allows the user to dynamically create, remove, and resize
RAM-based block devices. RapidDisk is designed to work with both volatile and
non-volatile memory. In the case of volatile memory, memory is allocated only 
when
needed. The RapidCache module in turn utilizes a RapidDisk volume as a FIFO
Write-Through caching node to a slower block device.

Signed-off-by: Petros Koutoupis 
---
 Kconfig   |2 
 Makefile  |1 
 rapiddisk/Documentation/rxdsk.txt |   75 ++
 rapiddisk/Kconfig |   10 
 rapiddisk/Makefile|2 
 rapiddisk/TODO|5 
 rapiddisk/rxcache.c   | 1181 ++
 rapiddisk/rxcommon.h  |   22 
 rapiddisk/rxdsk.c |  799 +
 9 files changed, 2097 insertions(+)

diff -uNpr linux-next.orig/drivers/staging/Kconfig 
linux-next/drivers/staging/Kconfig
--- linux-next.orig/drivers/staging/Kconfig 2015-05-30 13:37:03.929726967 
-0500
+++ linux-next/drivers/staging/Kconfig  2015-05-31 21:35:12.923516166 -0500
@@ -112,4 +112,6 @@ source "drivers/staging/fsl-mc/Kconfig"
 
 source "drivers/staging/wilc1000/Kconfig"
 
+source "drivers/staging/rapiddisk/Kconfig"
+
 endif # STAGING
diff -uNpr linux-next.orig/drivers/staging/Makefile 
linux-next/drivers/staging/Makefile
--- linux-next.orig/drivers/staging/Makefile2015-05-30 13:37:03.921726968 
-0500
+++ linux-next/drivers/staging/Makefile 2015-05-31 21:35:12.923516166 -0500
@@ -48,3 +48,4 @@ obj-$(CONFIG_COMMON_CLK_XLNX_CLKWZRD) +=
 obj-$(CONFIG_FB_TFT)   += fbtft/
 obj-$(CONFIG_FSL_MC_BUS)   += fsl-mc/
 obj-$(CONFIG_WILC1000) += wilc1000/
+obj-$(CONFIG_RXDSK)+= rapiddisk/
diff -uNpr linux-next.orig/drivers/staging/rapiddisk/Documentation/rxdsk.txt 
linux-next/drivers/staging/rapiddisk/Documentation/rxdsk.txt
--- linux-next.orig/drivers/staging/rapiddisk/Documentation/rxdsk.txt   
1969-12-31 18:00:00.0 -0600
+++ linux-next/drivers/staging/rapiddisk/Documentation/rxdsk.txt
2015-05-31 21:38:14.191511011 -0500
@@ -0,0 +1,75 @@
+RapidDisk (rxdsk) RAM disk and RapidCache (rxcache) Linux modules
+
+== Description ==
+
+RapidDisk or rxdsk was designed to be used in high performing environments
+and has been designed with simplicity in mind. Utilizing a user land binary,
+the system administrator is capable of dynamically adding new RAM based
+block devices of varying sizes, removing existing ones to even listing all
+existing RAM block devices. The rxdsk module has been designed to allocate
+from the system's memory pages and is capable of addressing memory to
+support Gigabytes if not a Terabyte of available Random Access Memory.
+
+RapidCache or rxcache is designed to leverage the high speed performing
+technologies of the RapidDisk RAM disk and utilizing the Device Mapper
+framework, map an rxdsk volume to act as a block device's Write/Read-through
+cache. This can significantly boost the performance of a local or remote
+disk device.
+
+Project Home: www.rapiddisk.org
+
+== Module Parameters ==
+
+RapidDisk
+-
+max_rxcnt: Total RAM Disk devices available for use. (Default = 128 = MAX) 
(int)
+max_sectors: Maximum sectors (in KB) for the request queue. (Default = 127) 
(int)
+nr_requests: Number of requests at a given time for the request queue. 
(Default = 128) (int)
+
+RapidCache
+-
+None.
+
+
+== Usage ==
+
+RapidDisk
+-
+It is advised to utilize the userland utility, rxadm, but this is essentially 
what is
+written to the /proc/rxctl proc file to manage rxdsk volumes:
+
+Attach a new rxdsk volume by typing (size in sectors):
+# echo "rxdsk attach 0 8192" > /proc/rxctl
+
+Attach a non-volatile rxdsk volume by typing (starting / ending addresses
+in decimal format):
+# echo "rxdsk attach-nv 0 1234 56789" > /proc/rxctl
+
+Detach an existing rxdsk volume by typing:
+# echo "rxdsk detach 0" > /proc/rxctl
+
+Resize an existing rxdsk volume by typing (size in sectors):
+# echo "rxdsk resize 0 65536" > /proc/rxctl
+
+
+Note - the integer after the "rxdsk " is the RapidDisk volume number. 
"0"
+would signify "rxd0."
+
+RapidCache
+-
+It is advised to utilize the userland utility, rxadm, but this is essentially 
what is
+sent to the dmsetup command:
+
+Map an existing rxdsk volume to a block device by typing:
+# echo 0 4194303 rxcache /dev/sdb /dev/rxd0 0 8 196608|dmsetup create rxc0
+
+Parameter 1: Start block of source volume (in sectors).
+Parameter 2: End block of source volume (in sectors).
+Parameter 4: Source volume.
+Parameter 5: Cache volume.
+Parameter 7: Caching block size.
+Parameter 8: Cache size (in sectors).
+
+Unmap an rxdsk volume:
+
+# dmsetup remove rxc0
diff -uNpr linux-next.orig/drivers/staging/rapiddisk/Kconfig 
linux-next/drivers/staging/rapi

[PATCH 1/1] Drivers: hv: vmbus: Allocate ring buffer memory in NUMA aware fashion

2015-05-31 Thread K. Y. Srinivasan
Allocate ring buffer memory from the NUMA node assigned to the channel.
Since this is a performance and not a correctness issue, if the node specific
allocation were to fail, fall back and allocate without specifying the node.

Signed-off-by: K. Y. Srinivasan 
---
 drivers/hv/channel.c |   14 --
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c
index 7a1c2db..603ce97 100644
--- a/drivers/hv/channel.c
+++ b/drivers/hv/channel.c
@@ -73,6 +73,7 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 
send_ringbuffer_size,
unsigned long flags;
int ret, err = 0;
unsigned long t;
+   struct page *page;
 
spin_lock_irqsave(&newchannel->lock, flags);
if (newchannel->state == CHANNEL_OPEN_STATE) {
@@ -87,8 +88,17 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 
send_ringbuffer_size,
newchannel->channel_callback_context = context;
 
/* Allocate the ring buffer */
-   out = (void *)__get_free_pages(GFP_KERNEL|__GFP_ZERO,
-   get_order(send_ringbuffer_size + recv_ringbuffer_size));
+   page = alloc_pages_node(cpu_to_node(newchannel->target_cpu),
+   GFP_KERNEL|__GFP_ZERO,
+   get_order(send_ringbuffer_size +
+   recv_ringbuffer_size));
+
+   if (!page)
+   out = (void *)__get_free_pages(GFP_KERNEL|__GFP_ZERO,
+  get_order(send_ringbuffer_size +
+  recv_ringbuffer_size));
+   else
+   out = (void *)page_address(page);
 
if (!out) {
err = -ENOMEM;
-- 
1.7.4.1

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


Re: [PATCH] staging: wlan-ng: fix long line

2015-05-31 Thread Greg Kroah-Hartman
On Sun, May 31, 2015 at 11:00:28PM -0300, Douglas Barbonaglia Sathler 
Figueiredo wrote:
> From: douglasbsf 

That's not your "real name", please use the same name you use in the
signed-off-by line.

thanks,

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


Re: [PATCH RESEND] staging: rtl8192u: ieee80211: Fix sparse endianness warnings

2015-05-31 Thread Greg KH
On Sun, May 31, 2015 at 11:24:42PM -0300, Gaston Gonzalez wrote:
> On Mon, Jun 01, 2015 at 10:53:20AM +0900, Greg KH wrote:
> > On Sun, May 31, 2015 at 10:41:52PM -0300, Gaston Gonzalez wrote:
> > > On Mon, Jun 01, 2015 at 08:24:17AM +0900, Greg KH wrote:
> > > > On Sun, May 31, 2015 at 08:07:21PM -0300, Gaston Gonzalez wrote:
> > > > > On Mon, Jun 01, 2015 at 07:17:39AM +0900, Greg KH wrote:
> > > > > > On Sun, May 31, 2015 at 12:17:48PM -0300, Gaston Gonzalez wrote:
> > > > > > > Fix the following sparse warnings:
> > > > > > > 
> > > > > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: 
> > > > > > > warning: incorrect type in assignment (different base types)
> > > > > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:
> > > > > > > expected restricted __le16 [usertype] frame_ctl
> > > > > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:
> > > > > > > got int
> > > > > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50: 
> > > > > > > warning: invalid assignment: |=
> > > > > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:
> > > > > > > left side has type restricted __le16
> > > > > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:
> > > > > > > right side has type int
> > > > > > > 
> > > > > > > 
> > > > > > > Signed-off-by: Gaston Gonzalez 
> > > > > > > ---
> > > > > > >  drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 5 +++--
> > > > > > >  1 file changed, 3 insertions(+), 2 deletions(-)
> > > > > > 
> > > > > > Still doesn't apply, but this might be a git bug, see below:
> > > > > > 
> > > > > > > diff --git 
> > > > > > > a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
> > > > > > > b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > > > > > > index d2e8b12..0477ba1 100644
> > > > > > > --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > > > > > > +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > > > > > > @@ -660,2 +660,2 @@ inline struct sk_buff 
> > > > > > > *ieee80211_authentication_req(struct ieee80211_network *be
> > > > > > >   auth = (struct ieee80211_authentication *)
> > > > > > >   skb_put(skb, sizeof(struct ieee80211_authentication));
> > > > > > > 
> > > > > > > - auth->header.frame_ctl = IEEE80211_STYPE_AUTH;
> > > > > > > - if (challengelen) auth->header.frame_ctl |= IEEE80211_FCTL_WEP;
> > > > > > > + auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
> > > > > > > + if (challengelen)
> > > > > > > + auth->header.frame_ctl |= 
> > > > > > > cpu_to_le16(IEEE80211_FCTL_WEP);
> > > > > > > 
> > > > > > >   auth->header.duration_id = 0x013a; //FIXME
> > > > > > > 
> > > > > > > --
> > > > > > > 2.1.4
> > > > > > 
> > > > > > This patch is not created properly.  Did you edit it by hand?  If 
> > > > > > not,
> > > > > > we need to report a bug as the diff is obviously wrong, look at the 
> > > > > > @@@
> > > > > > line.
> > > > > > 
> > > > > > Can you update your version of git to see if it's fixed there?
> > > > > > 
> > > > > > Also, patch tells you that this is broken:
> > > > > > 
> > > > > > checking file drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > > > > > patch:  malformed patch at line 132:
> > > > > > skb_put(skb, sizeof(struct ieee80211_authentication));
> > > > > 
> > > > > Greg,
> > > > > 
> > > > > The patch was prepared using git format-patch. The git version I'm 
> > > > > using:
> > > > > 
> > > > > gaston22:\-$ git --version 
> > > > > git version 2.1.4
> > > > > 
> > > > > I did deleted 4 whitespaces by hand after running checkpatch.pl on 
> > > > > the patch.
> > > > > Could that drive the issue? However, I could properly apply the patch 
> > > > > using 'git
> > > > > am' from an email and get the git log right.
> > > > 
> > > > Yes, but is there really a commit there?  That's what messed me up last
> > > > time, git applied it, but with no actual diff (which is probably a bug
> > > > too, just a different one...)
> > > > 
> > > 
> > > Yes, there was a commit. In fact the patch prepare: git format-patch -1
> > > 
> > > > And if you edited it by hand, that might explain the issue, what did the
> > > > "original" patch look like?
> > > 
> > > Attached the original patch I submitted:
> > > 0001-Regen-ieee80211_softmac.c-endianness-fix-patch.patch
> > 
> > Which is broken.
> > 
> > > Attached is also the patch without the hand-edited deletions:
> > > 
> > > ieee80211_softmac_fixes_v3.patch
> > 
> > That patch is correct.
> > 
> > Why did you edit the patch metadata in a way that was incorrect?
> 
> The only edit I did was from within git send-email --annotate. Nothing else. I
> get now that that editor is not for everything... as I get the rest of the 
> apply process 
>  right, I thought it was ok that way. My bad :(

That's worrysome, why would --annotate change the lines that relate to
the patch linenumbers?  Did you do a search/repl

Re: [PATCH] Patch to integrate RapidDisk and RapidCache RAM Drive / Caching modules into stating subsystem.

2015-05-31 Thread Greg KH
On Sun, May 31, 2015 at 09:43:57PM -0500, Petros Koutoupis wrote:
  1969-12-31 18:00:00.0 -0600
> +++ linux-next/drivers/staging/rapiddisk/TODO   2015-05-31 21:35:26.683515775 
> -0500
> @@ -0,0 +1,5 @@
> +TODO:
> +- checkpatch.pl cleanups (warnings)

That's all that you need to do?  Why not just do it today, and get it
merged to the "real" part of the kernel?  Why put it into staging at
all?

That's really not a good reason for it to go into staging, have you
submitted it to the "real" part of the kernel already and did they tell
you to go here instead?  Why did you pick staging for this code?

thanks,

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


[PATCH] Staging: comedi: ni_at_a2150: remove extra spaces before tab

2015-05-31 Thread Joglekar Tejas
This patch fix warning given by checkpatch.pl abouts spaces given
before tab

Signed-off-by: Joglekar Tejas 
---
 drivers/staging/comedi/drivers/ni_at_a2150.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/ni_at_a2150.c 
b/drivers/staging/comedi/drivers/ni_at_a2150.c
index 3a972d1..60469bb 100644
--- a/drivers/staging/comedi/drivers/ni_at_a2150.c
+++ b/drivers/staging/comedi/drivers/ni_at_a2150.c
@@ -106,7 +106,7 @@ TRIG_WAKE_EOS
 #define   IRQ_LVL_BITS(x)  (((x) & 0xf) << 4)  /*  sets irq 
level */
 #define   FIFO_INTR_EN_BIT 0x100   /*  enable fifo interrupts */
 #define   FIFO_INTR_FHF_BIT0x200   /*  interrupt fifo half full */
-#define   DMA_INTR_EN_BIT  0x800   /*  enable interrupt on dma 
terminal count */
+#define   DMA_INTR_EN_BIT  0x800   /*  enable interrupt on dma 
terminal count */
 #define   DMA_DEM_EN_BIT   0x1000  /*  enables demand mode dma */
 #define I8253_BASE_REG 0x14
 
-- 
1.9.1

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


[PATCH] Staging: vt6655: Remove unnecessary equality checks in rxtx.c

2015-05-31 Thread Harisangam, Sharvari (S.)
From: Sharvari  Harisangam 

Modified the if-else statements to remove unnecessary comparisons in rxtx.c.
This change was detected with the help of coccinelle tool

Signed-off-by: Sharvari Harisangam 
---
 drivers/staging/vt6655/rxtx.c |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c 
index 7468776..7fedde3 100644
--- a/drivers/staging/vt6655/rxtx.c
+++ b/drivers/staging/vt6655/rxtx.c
@@ -1093,7 +1093,7 @@ s_cbFillTxBufHead(struct vnt_private *pDevice, unsigned 
char byPktType,
if (byPktType == PK_TYPE_11GB || byPktType == PK_TYPE_11GA) {/* 802.11g 
packet */
 
if (byFBOption == AUTO_FB_NONE) {
-   if (bRTS == true) {/* RTS_need */
+   if (bRTS) {/* RTS_need */
pvRrvTime = (void *)(pbyTxBufferAddr + 
wTxBufSize);
pMICHDR = (struct vnt_mic_hdr 
*)(pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_rts));
pvRTS = (void *)(pbyTxBufferAddr + wTxBufSize + 
sizeof(struct vnt_rrv_time_rts) + cbMICHDR); @@ -1115,7 +1115,7 @@ 
s_cbFillTxBufHead(struct vnt_private *pDevice, unsigned char byPktType,
}
} else {
/* Auto Fall Back */
-   if (bRTS == true) {/* RTS_need */
+   if (bRTS) {/* RTS_need */
pvRrvTime = (void *)(pbyTxBufferAddr + 
wTxBufSize);
pMICHDR = (struct vnt_mic_hdr *) 
(pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_rts));
pvRTS = (void *) (pbyTxBufferAddr + wTxBufSize 
+ sizeof(struct vnt_rrv_time_rts) + cbMICHDR); @@ -1138,7 +1138,7 @@ 
s_cbFillTxBufHead(struct vnt_private *pDevice, unsigned char byPktType,
} else {/* 802.11a/b packet */
 
if (byFBOption == AUTO_FB_NONE) {
-   if (bRTS == true) {
+   if (bRTS) {
pvRrvTime = (void *)(pbyTxBufferAddr + 
wTxBufSize);
pMICHDR = (struct vnt_mic_hdr *) 
(pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_ab));
pvRTS = (void *)(pbyTxBufferAddr + wTxBufSize + 
sizeof(struct vnt_rrv_time_ab) + cbMICHDR); @@ -1158,7 +1158,7 @@ 
s_cbFillTxBufHead(struct vnt_private *pDevice, unsigned char byPktType,
}
} else {
/* Auto Fall Back */
-   if (bRTS == true) { /* RTS_need */
+   if (bRTS) { /* RTS_need */
pvRrvTime = (void *)(pbyTxBufferAddr + 
wTxBufSize);
pMICHDR = (struct vnt_mic_hdr *) 
(pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_ab));
pvRTS = (void *)(pbyTxBufferAddr + wTxBufSize + 
sizeof(struct vnt_rrv_time_ab) + cbMICHDR);
--
1.7.9.5
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: rtl8192u: Patch to modify if, else conditions

2015-05-31 Thread Dhere, Chaitanya (C.)
On Sun, May 31, 2015 at 10:38:18AM +0900, gre...@linuxfoundation.org wrote:
> On Tue, May 19, 2015 at 04:55:57PM +, Dhere, Chaitanya (C.) wrote:
> > In this patch:
> > 1. the if condition is modified to remove
> > the unnecessary equality check.
> > 2. The else if condition is replaced by an else condition
> > since the variable checked in the if statement is a bool
> > making the else if unnecessary.
> > 3. Fixed indentation problem on line 1369.
> > These changes were detected with help of coccinelle tool.
> 
> 3 different things means you need to send 3 different patches.  Please
> only do one logical thing per patch.
> 
> thanks,
> 
> greg k-h

Ok Greg I will send a V2 of my patch split into 3 patches

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


Re: [PATCH 0/6] use devicemodel with parport

2015-05-31 Thread Sudip Mukherjee
On Mon, Jun 01, 2015 at 07:05:30AM +0900, Greg Kroah-Hartman wrote:
> On Wed, May 20, 2015 at 08:56:56PM +0530, Sudip Mukherjee wrote:
> > After 5 versions of WIP, finally a patch submission.
> > parport subsystem is now in the transition stage and supports the old
> > model and the new device model. 3 of the drivers have been converted
> > into new model and tested.
> > After other drivers are converted we can remove the old code from
> > parport.
> 
> This looks good, very nice job.
Thanks, but its not me alone. Dan, Jean, Alan has helped me a lot in this.
> 
> Are you going to continue to fix up the other drivers?  I don't want us
> to have a half-converted subsystem in the kernel.
ofcourse yes. I also donot want to be a maintainer of half converted
subsystem. :)
i am thinking, after it is in the linux-next for a few days and seeing
any effects of these changes I will start with the other drivers.
and after all drivers are converted and that is also in next for sufficient
days I will start with the cleanup of the old codes.
And then there are some pending bugs in bugzilla. I am also planning to
add the code for epst in paride (i saw in many forums that people are
not able to use their scanner on latest kernels).

regards
sudip

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


[PATCH] Staging: comedi: adv_pci1724: Remove redundant return statements

2015-05-31 Thread Sharma, Abhishek (A.)
From: Abhishek Sharma 

Replace unnecessary conditional checks for variable 'ret' and replace
by single return statement.

Signed-off-by: Abhishek Sharma 

diff --git a/drivers/staging/comedi/drivers/adv_pci1724.c 
b/drivers/staging/comedi/drivers/adv_pci1724.c
index f7a7dab..9677111 100644
--- a/drivers/staging/comedi/drivers/adv_pci1724.c
+++ b/drivers/staging/comedi/drivers/adv_pci1724.c
@@ -180,11 +180,7 @@ static int adv_pci1724_auto_attach(struct comedi_device 
*dev,
s->insn_write   = adv_pci1724_insn_write;
s->private  = (void *)PCI1724_DAC_CTRL_MODE_GAIN;
 
-   ret = comedi_alloc_subdev_readback(s);
-   if (ret)
-   return ret;
-
-   return 0;
+   return comedi_alloc_subdev_readback(s);
 }
 
 static struct comedi_driver adv_pci1724_driver = {
-- 
2.1.4
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 0/6] use devicemodel with parport

2015-05-31 Thread Greg Kroah-Hartman
On Mon, Jun 01, 2015 at 11:16:51AM +0530, Sudip Mukherjee wrote:
> On Mon, Jun 01, 2015 at 07:05:30AM +0900, Greg Kroah-Hartman wrote:
> > On Wed, May 20, 2015 at 08:56:56PM +0530, Sudip Mukherjee wrote:
> > > After 5 versions of WIP, finally a patch submission.
> > > parport subsystem is now in the transition stage and supports the old
> > > model and the new device model. 3 of the drivers have been converted
> > > into new model and tested.
> > > After other drivers are converted we can remove the old code from
> > > parport.
> > 
> > This looks good, very nice job.
> Thanks, but its not me alone. Dan, Jean, Alan has helped me a lot in this.
> > 
> > Are you going to continue to fix up the other drivers?  I don't want us
> > to have a half-converted subsystem in the kernel.
> ofcourse yes. I also donot want to be a maintainer of half converted
> subsystem. :)
> i am thinking, after it is in the linux-next for a few days and seeing
> any effects of these changes I will start with the other drivers.
> and after all drivers are converted and that is also in next for sufficient
> days I will start with the cleanup of the old codes.

Sounds like a good plan.

> And then there are some pending bugs in bugzilla. I am also planning to
> add the code for epst in paride (i saw in many forums that people are
> not able to use their scanner on latest kernels).

"epst"?  What's that?

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