Re: [PATCH v2 15/24] Staging: winbond: reg: seventh of the patches that fixes lines over 80 characters

2013-09-21 Thread Dan Carpenter
On Fri, Sep 20, 2013 at 04:45:08PM +0200, Iker Pedrosa wrote:
> On Tue, 17 Sep 2013 12:43:26 +0300
> Dan Carpenter  wrote:
> 
> > On Tue, Sep 17, 2013 at 02:29:22PM +0530, Adil Mujeeb wrote:
> > > Hi,
> > > 
> > > 
> > > >-   PowerData = (1 << 31) | (0 << 30) | (24 << 24) |
> > > BitReverse(w89rf242_txvga_data[i][0], 24);
> > > >+   PowerData = (1 << 31) | (0 << 30) | (24 << 24)
> > > >+   | BitReverse(w89rf242_txvga_data[i][0], 24);
> > > .
> > > .
> > > 
> > > >-   reg->M38_MacControl = (DEFAULT_RATE_RETRY_LIMIT << 8) |
> > > (DEFAULT_LONG_RETRY_LIMIT << 4) | DEFAULT_SHORT_RETRY_LIMIT;
> > > >+   reg->M38_MacControl = (DEFAULT_RATE_RETRY_LIMIT << 8) |
> > > >+  (DEFAULT_LONG_RETRY_LIMIT << 4) |
> > > >+  DEFAULT_SHORT_RETRY_LIMIT;
> > > 
> > > I think consistency is needed. Either break the lines putting the OR
> > > operator ( | ) at the start of new line or at the end of each line. People
> > > has its own preference but here you have used both style in single file.
> > > Just a suggestion.
> > > 
> > 
> > Put the '|' character at the end of the line.  That's the New Unwritten
> > Style Guidelines.  Most of the kernel does it this way and it's easier
> > to read.
> > 
> > But this could be fixed in a later patch instead of redoing the whole
> > series.
> > 
> > regards,
> > dan carpenter
> > 
> 
> I will change it for the new version of this patch but I want to wait
> some days until everybody looks the patches that I've sent.

If they haven't looked after three days then they won't look.  Greg will
look over the patches but everyone else is done.

If you can redo this patch without changing any of the others then just
redo it.  But otherwise I would prefer if you do it in a follow on
patch.  It gets tiresome to review patchsets over and over.

Joe's comment on [PATCH v2 21/24] is correct.  Technically the original
code was buggy as well, but using dev_err() means it will generate a
popup notification in Gnome so the new code is worse.  Redo that one.
Hopefully, you can just redo the one patch without redoing the following
3 patches.

So either send a single patch to Joe's comment, or send an email in
reply to Joe's comment, "Ok.  I will redo the last 4 patches".  Use the
--in-reply-to option of git to send email in reply to a thread.  Pratice
in an email to yourself before sending it to the list.

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


[PATCH] drivers: staging: dgap: Makefile: use 'ccflags-y' instead of EXTRA_FLAGS in Makefile

2013-09-21 Thread Chen Gang
Need use 'ccflags-y' instead of EXTRA_CFLAGS, or compiling issue will
be occurred with "EXTRA_CFLAGS=-W".

Also can reference scripts/checkpatch.pl (1755..1766) to know about it.


Signed-off-by: Chen Gang 
---
 drivers/staging/dgap/Makefile |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/dgap/Makefile b/drivers/staging/dgap/Makefile
index 9f1fce1..a991a2d 100644
--- a/drivers/staging/dgap/Makefile
+++ b/drivers/staging/dgap/Makefile
@@ -1,4 +1,4 @@
-EXTRA_CFLAGS += -DDG_NAME=\"dgap-1.3-16\" -DDG_PART=\"40002347_C\"
+ccflags-y += -DDG_NAME=\"dgap-1.3-16\" -DDG_PART=\"40002347_C\"
 
 obj-$(CONFIG_DGAP) += dgap.o
 
-- 
1.7.7.6
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] drivers: staging: dgap: Makefile: use 'ccflags-y' instead of EXTRA_FLAGS in Makefile

2013-09-21 Thread Dan Carpenter
On Sat, Sep 21, 2013 at 07:12:36PM +0800, Chen Gang wrote:
> Need use 'ccflags-y' instead of EXTRA_CFLAGS, or compiling issue will
> be occurred with "EXTRA_CFLAGS=-W".
> 

Just add it to drivers/staging/dgap/dgap_driver.c and delete it from the
Makefile.

regards,
dan carpenter

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


Re: [PATCH 5/7] Staging/iio/adc/touchscreen/MXS: add interrupt driven touch detection

2013-09-21 Thread Jonathan Cameron
On 09/19/13 13:22, Juergen Beisert wrote:
> For battery driven systems it is a very bad idea to collect the touchscreen
> data within a kernel busy loop.
> 
> This change uses the features of the hardware to delay and accumulate samples 
> in
> hardware to avoid a high interrupt and CPU load.
> 
> Note: this is only tested on an i.MX23 SoC yet.
> 
> Signed-off-by: Juergen Beisert 
> CC: linux-arm-ker...@lists.infradead.org
> CC: de...@driverdev.osuosl.org
> CC: Marek Vasut 
> CC: Fabio Estevam 
> CC: Jonathan Cameron 

Please repost with Dmitry Torokhov and the linux input list cc'd.

Whilst this looks fine to me, it is definitely an input patch even if
the code resides in iio.

Also, I'm not going to take this series until we have confirmation from Marek
or someone else that we aren't introducing regressions into the i.MX23 support.

> ---
>  drivers/staging/iio/adc/mxs-lradc.c | 532 
> 
>  1 file changed, 476 insertions(+), 56 deletions(-)
> 
> diff --git a/drivers/staging/iio/adc/mxs-lradc.c 
> b/drivers/staging/iio/adc/mxs-lradc.c
> index c70c31f..9f3f367 100644
> --- a/drivers/staging/iio/adc/mxs-lradc.c
> +++ b/drivers/staging/iio/adc/mxs-lradc.c
> @@ -129,6 +129,17 @@ enum mxs_lradc_ts {
>   MXS_LRADC_TOUCHSCREEN_5WIRE,
>  };
>  
> +/*
> + * Touchscreen handling
> + */
> +enum lradc_ts_plate {
> + LRADC_TOUCH = 0,
> + LRADC_SAMPLE_X,
> + LRADC_SAMPLE_Y,
> + LRADC_SAMPLE_PRESSURE,
> + LRADC_SAMPLE_VALID,
> +};
> +
>  struct mxs_lradc {
>   struct device   *dev;
>   void __iomem*base;
> @@ -169,13 +180,25 @@ struct mxs_lradc {
>  #define CHAN_MASK_TOUCHSCREEN_4WIRE  (0xf << 2)
>  #define CHAN_MASK_TOUCHSCREEN_5WIRE  (0x1f << 2)
>   enum mxs_lradc_ts   use_touchscreen;
> - boolstop_touchscreen;
>   booluse_touchbutton;
>  
>   struct input_dev*ts_input;
>   struct work_struct  ts_work;
>  
>   enum mxs_lradc_id   soc;
> + enum lradc_ts_plate cur_plate; /* statemachine */
> + boolts_valid;
> + unsignedts_x_pos;
> + unsignedts_y_pos;
> + unsignedts_pressure;
> +
> + /* handle touchscreen's physical behaviour */
> + /* samples per coordinate */
> + unsignedover_sample_cnt;
> + /* time clocks between samples */
> + unsignedover_sample_delay;
> + /* time in clocks to wait after the plates where switched */
> + unsignedsettling_delay;
>  };
>  
>  #define  LRADC_CTRL0 0x00
> @@ -227,19 +250,33 @@ struct mxs_lradc {
>  #define  LRADC_CH_ACCUMULATE (1 << 29)
>  #define  LRADC_CH_NUM_SAMPLES_MASK   (0x1f << 24)
>  #define  LRADC_CH_NUM_SAMPLES_OFFSET 24
> +#define  LRADC_CH_NUM_SAMPLES(x) \
> + ((x) << LRADC_CH_NUM_SAMPLES_OFFSET)
>  #define  LRADC_CH_VALUE_MASK 0x3
>  #define  LRADC_CH_VALUE_OFFSET   0
>  
>  #define  LRADC_DELAY(n)  (0xd0 + (0x10 * (n)))
>  #define  LRADC_DELAY_TRIGGER_LRADCS_MASK (0xff << 24)
>  #define  LRADC_DELAY_TRIGGER_LRADCS_OFFSET   24
> +#define  LRADC_DELAY_TRIGGER(x) \
> + (((x) << LRADC_DELAY_TRIGGER_LRADCS_OFFSET) & \
> + LRADC_DELAY_TRIGGER_LRADCS_MASK)
>  #define  LRADC_DELAY_KICK(1 << 20)
>  #define  LRADC_DELAY_TRIGGER_DELAYS_MASK (0xf << 16)
>  #define  LRADC_DELAY_TRIGGER_DELAYS_OFFSET   16
> +#define  LRADC_DELAY_TRIGGER_DELAYS(x) \
> + (((x) << LRADC_DELAY_TRIGGER_DELAYS_OFFSET) & \
> + LRADC_DELAY_TRIGGER_DELAYS_MASK)
>  #define  LRADC_DELAY_LOOP_COUNT_MASK (0x1f << 11)
>  #define  LRADC_DELAY_LOOP_COUNT_OFFSET   11
> +#define  LRADC_DELAY_LOOP(x) \
> + (((x) << LRADC_DELAY_LOOP_COUNT_OFFSET) & \
> + LRADC_DELAY_LOOP_COUNT_MASK)
>  #define  LRADC_DELAY_DELAY_MASK  0x7ff
>  #define  LRADC_DELAY_DELAY_OFFSET0
> +#define  LRADC_DELAY_DELAY(x) \
> + (((x) << LRADC_DELAY_DELAY_OFFSET) & \
> + LRADC_DELAY_DELAY_MASK)
>  
>  #define  LRADC_CTRL4 0x140
>  #define  LRADC_CTRL4_LRADCSELECT_MASK(n) (0xf << ((n) * 4))
> @@ -319,6 +356,404 @@ static u32 mxs_lradc_drive_pressure(struct mxs_lradc 
> *lradc)
>   return LRADC_CTRL0_MX28_YPPSW | LRADC_CTRL0_MX28_XNNSW;
>  }
>  
> +static bool mxs_lradc_check_touch_event(struct mxs_lradc *lradc)
> +{
> + return !!(readl(lradc->base + LRADC_STATUS) &
> +  

Re: [PATCH] drivers: staging: dgap: Makefile: use 'ccflags-y' instead of EXTRA_FLAGS in Makefile

2013-09-21 Thread Chen Gang
On 09/21/2013 07:22 PM, Dan Carpenter wrote:
> On Sat, Sep 21, 2013 at 07:12:36PM +0800, Chen Gang wrote:
>> Need use 'ccflags-y' instead of EXTRA_CFLAGS, or compiling issue will
>> be occurred with "EXTRA_CFLAGS=-W".
>>
> 
> Just add it to drivers/staging/dgap/dgap_driver.c and delete it from the
> Makefile.
> 

That sounds reasonable to me, I will send patch v2 for it, thanks.

> regards,
> dan carpenter
> 
> 
> 

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


Re: [PATCH 7/7] Staging/iio/adc/touchscreen/MXS: provide devicetree adaption

2013-09-21 Thread Jonathan Cameron
The device tree list has moved, so I've changed the cc.

Few comments inline.  Basically I'd go for longer more
descriptive names when the abreviation isn't a really
well known common one.


Note I'm not all that familiar with device tree conventions
so may be barking up the wrong tree ;)
On 09/19/13 13:22, Juergen Beisert wrote:
> This is an RFC for the new touchscreen properties.
> 
> Signed-off-by: Juergen Beisert 
> CC: linux-arm-ker...@lists.infradead.org
> CC: de...@driverdev.osuosl.org
> CC: Marek Vasut 
> CC: Fabio Estevam 
> CC: Jonathan Cameron 
> CC: devicetree-disc...@lists.ozlabs.org
> ---
>  .../bindings/staging/iio/adc/mxs-lradc.txt | 36 --
>  drivers/staging/iio/adc/mxs-lradc.c| 57 
> ++
>  2 files changed, 67 insertions(+), 26 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/staging/iio/adc/mxs-lradc.txt 
> b/Documentation/devicetree/bindings/staging/iio/adc/mxs-lradc.txt
> index 4688205..ee05dc3 100644
> --- a/Documentation/devicetree/bindings/staging/iio/adc/mxs-lradc.txt
> +++ b/Documentation/devicetree/bindings/staging/iio/adc/mxs-lradc.txt
> @@ -1,7 +1,8 @@
>  * Freescale i.MX28 LRADC device driver
>  
>  Required properties:
> -- compatible: Should be "fsl,imx28-lradc"
> +- compatible: Should be "fsl,imx23-lradc" for i.MX23 SoC and 
> "fsl,imx28-lradc"
> +  for i.MX28 SoC
>  - reg: Address and length of the register set for the device
>  - interrupts: Should contain the LRADC interrupts
>  
> @@ -9,13 +10,38 @@ Optional properties:
>  - fsl,lradc-touchscreen-wires: Number of wires used to connect the 
> touchscreen
> to LRADC. Valid value is either 4 or 5. If 
> this
> property is not present, then the touchscreen 
> is
> -   disabled.
Do we want that lradc prefix on these other properties?
> +   disabled. 5 wires is valid for i.MX28 SoC 
> only.
> +- fsl,ave-ctrl: number of samples per direction to calculate an average 
> value.
> +Allowed value is 1 ... 31, default is 4
This naming seems less than informative, what about fsl,average_num_samples of 
average_count
(ave isn't all that obvious an abrevaition of average).

> +- fsl,ave-delay: delay between consecutive samples. Allowed value is
> + 1 ... 2047. It is used if 'fsl,ave-ctrl' > 1, counts at
> + 2 kHz and its default is 2 (= 1 ms)
fsl,average_intersample_delay (I assume any limit of device tree property names 
is longer than that?)

> +- fsl,settling: delay between plate switch to next sample. Allowed value is
> +1 ... 2047. It counts at 2 kHz and its default is
> +10 (= 5 ms)
>  
> -Examples:
> +Example for i.MX23 SoC:
> +
> + lradc@8005 {
> + compatible = "fsl,imx23-lradc";
> + reg = <0x8005 0x2000>;
> + interrupts = <36 37 38 39 40 41 42 43 44>;
> + status = "okay";
> + fsl,lradc-touchscreen-wires = <4>;
> + fsl,ave-ctrl = <4>;
> + fsl,ave-delay = <2>;
> + fsl,settling = <10>;
> + };
> +
> +Example for i.MX28 SoC:
>  
>   lradc@8005 {
>   compatible = "fsl,imx28-lradc";
>   reg = <0x8005 0x2000>;
> - interrupts = <10 14 15 16 17 18 19
> - 20 21 22 23 24 25>;
> + interrupts = <10 14 15 16 17 18 19 20 21 22 23 24 25>;
> + status = "okay";
> + fsl,lradc-touchscreen-wires = <5>;
> + fsl,ave-ctrl = <4>;
> + fsl,ave-delay = <2>;
> + fsl,settling = <10>;
>   };
> diff --git a/drivers/staging/iio/adc/mxs-lradc.c 
> b/drivers/staging/iio/adc/mxs-lradc.c
> index 122475f..ffcb0dd 100644
> --- a/drivers/staging/iio/adc/mxs-lradc.c
> +++ b/drivers/staging/iio/adc/mxs-lradc.c
> @@ -1225,10 +1225,45 @@ MODULE_DEVICE_TABLE(of, mxs_lradc_dt_ids);
>  static int mxs_lradc_probe_touchscreen(struct mxs_lradc *lradc,
>   struct device_node *lradc_node)
>  {
> - /* TODO retrieve from device tree */
> + int ret;
> + u32 ts_wires = 0, adapt;
> +
> + ret = of_property_read_u32(lradc_node, "fsl,lradc-touchscreen-wires",
> + &ts_wires);
> + if (ret)
> + return -ENODEV; /* touchscreen feature disabled */
> +
> + switch (ts_wires) {
> + case 4:
> + lradc->use_touchscreen = MXS_LRADC_TOUCHSCREEN_4WIRE;
> + break;
> + case 5:
> + if (lradc->soc == IMX28_LRADC) {
> + lradc->use_touchscreen = MXS_LRADC_TOUCHSCREEN_5WIRE;
> + break;
> + }
> + /* fall through an error message for i.MX23 */
> + default:
> + dev_err(lradc->dev,
> + "Unsupported number of touchscreen wires (%d

[PATCH v2] drivers: staging: dgap: move DG_NAME and DG_PART from "Makefile" to "dgap_driver.h"

2013-09-21 Thread Chen Gang
Normally, the macros from command line are system specific macros (e.g
__linux, __KERNEL__ ...), and module own macros are usually defined in
their header files.

DG_NAME and DG_PART are driver 'dgap' owned macros which are used by
multiple files within driver, and need be defined in the driver main
header file.

So move DG_NAME and DG_PART to "dgap_driver.h", it not only can make
code clearer, but also can avoid compiling failure when EXTRA_CFLAGS
appended to make command line (e.g. "EXTRA_CFLAGS=-W").


Signed-off-by: Chen Gang 
---
 drivers/staging/dgap/Makefile  |2 --
 drivers/staging/dgap/dgap_driver.h |3 +++
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/dgap/Makefile b/drivers/staging/dgap/Makefile
index 9f1fce1..3abe8d2 100644
--- a/drivers/staging/dgap/Makefile
+++ b/drivers/staging/dgap/Makefile
@@ -1,5 +1,3 @@
-EXTRA_CFLAGS += -DDG_NAME=\"dgap-1.3-16\" -DDG_PART=\"40002347_C\"
-
 obj-$(CONFIG_DGAP) += dgap.o
 
 
diff --git a/drivers/staging/dgap/dgap_driver.h 
b/drivers/staging/dgap/dgap_driver.h
index 4b95385..7d631e8 100644
--- a/drivers/staging/dgap/dgap_driver.h
+++ b/drivers/staging/dgap/dgap_driver.h
@@ -53,6 +53,9 @@
  * DPR((fmt, args, ...));  Only prints if DGAP_TRACER is defined at
  *   compile time and dgap_debug!=0
  */
+#defineDG_NAME "dgap-1.3-16"
+#defineDG_PART "40002347_C"
+
 #definePROCSTR "dgap"  /* /proc entries
 */
 #defineDEVSTR  "/dev/dg/dgap"  /* /dev entries 
 */
 #defineDRVSTR  "dgap"  /* Driver name string 
-- 
1.7.7.6
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 18/51] DMA-API: staging: et131x: replace dma_set_mask()+dma_set_coherent_mask() with new helper

2013-09-21 Thread Russell King - ARM Linux
On Fri, Sep 20, 2013 at 04:42:08PM +0100, Ben Hutchings wrote:
> On Thu, 2013-09-19 at 22:43 +0100, Russell King wrote:
> > +   if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) ||
> > +   dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) {
> 
> Surely we want && here.

Good catch, exactly right.  Thanks for the review, here's the replacement
patch:

8<
From: Russell King 
Subject: [PATCH] DMA-API: staging: et131x: replace
 dma_set_mask()+dma_set_coherent_mask() with new helper

Replace the following sequence:

dma_set_mask(dev, mask);
dma_set_coherent_mask(dev, mask);

with a call to the new helper dma_set_mask_and_coherent().

Signed-off-by: Russell King 
---
 drivers/staging/et131x/et131x.c |   17 ++---
 1 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c
index f73e58f..61da7ee 100644
--- a/drivers/staging/et131x/et131x.c
+++ b/drivers/staging/et131x/et131x.c
@@ -4797,21 +4797,8 @@ static int et131x_pci_setup(struct pci_dev *pdev,
pci_set_master(pdev);
 
/* Check the DMA addressing support of this device */
-   if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(64))) {
-   rc = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64));
-   if (rc < 0) {
-   dev_err(&pdev->dev,
- "Unable to obtain 64 bit DMA for consistent 
allocations\n");
-   goto err_release_res;
-   }
-   } else if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(32))) {
-   rc = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
-   if (rc < 0) {
-   dev_err(&pdev->dev,
- "Unable to obtain 32 bit DMA for consistent 
allocations\n");
-   goto err_release_res;
-   }
-   } else {
+   if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) &&
+   dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) {
dev_err(&pdev->dev, "No usable DMA addressing method\n");
rc = -EIO;
goto err_release_res;
-- 
1.7.4.4


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


Re: [PATCH 24/51] DMA-API: dma: pl330: add dma_set_mask_and_coherent() call

2013-09-21 Thread Russell King - ARM Linux
On Fri, Sep 20, 2013 at 07:26:27PM +0200, Heiko Stübner wrote:
> Am Donnerstag, 19. September 2013, 23:49:01 schrieb Russell King:
> > The DMA API requires drivers to call the appropriate dma_set_mask()
> > functions before doing any DMA mapping.  Add this required call to
> > the AMBA PL08x driver.
>   ^--- copy and paste error - should of course be PL330

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


[PATCH 02/14] staging: rtl8192u: remove cmpk_message_handle_tx()

2013-09-21 Thread Xenia Ragiadakou
The function cmpk_message_handle_tx() is called only in r8192U_dm.c in two
places. The first call resides outside an #ifdef RTL8192U guard, and since
RTL8192U is defined this call can be removed. At the other site this function
is called, there is no check on its return value. Since cmpk_message_handle_tx()
does not do anything else other than returning true, it can be safely removed.

Signed-off-by: Xenia Ragiadakou 
---
 drivers/staging/rtl8192u/r8192U_dm.c |  8 
 drivers/staging/rtl8192u/r819xU_cmdpkt.c | 27 ---
 drivers/staging/rtl8192u/r819xU_cmdpkt.h |  2 --
 3 files changed, 37 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_dm.c 
b/drivers/staging/rtl8192u/r8192U_dm.c
index a6e4c37..5275131 100644
--- a/drivers/staging/rtl8192u/r8192U_dm.c
+++ b/drivers/staging/rtl8192u/r8192U_dm.c
@@ -620,16 +620,11 @@ static void dm_TXPowerTrackingCallback_TSSI(struct 
net_device *dev)
tx_cmd.Op   = TXCMD_SET_TX_PWR_TRACKING;
tx_cmd.Length   = 4;
tx_cmd.Value= Value;
-#ifdef RTL8192U
rtStatus = SendTxCommandPacket(dev, &tx_cmd, 12);
if (rtStatus == RT_STATUS_FAILURE)
{
RT_TRACE(COMP_POWER_TRACKING, "Set configuration with tx cmd 
queue fail!\n");
}
-#else
-   cmpk_message_handle_tx(dev, (u8 *)&tx_cmd,
-   
DESC_PACKET_TYPE_INIT, sizeof(DCMD_TXCMD_T));
-#endif
mdelay(1);
//DbgPrint("hi, vivi, strange\n");
for(i = 0;i <= 30; i++)
@@ -3885,9 +3880,6 @@ static void dm_send_rssi_tofw(struct net_device *dev)
tx_cmd.Op   = TXCMD_SET_RX_RSSI;
tx_cmd.Length   = 4;
tx_cmd.Value= priv->undecorated_smoothed_pwdb;
-
-   cmpk_message_handle_tx(dev, (u8 *)&tx_cmd,
-   
DESC_PACKET_TYPE_INIT, sizeof(DCMD_TXCMD_T));
 }
 
 /*---Define function 
prototype*/
diff --git a/drivers/staging/rtl8192u/r819xU_cmdpkt.c 
b/drivers/staging/rtl8192u/r819xU_cmdpkt.c
index 072f20d..f40f9c8 100644
--- a/drivers/staging/rtl8192u/r819xU_cmdpkt.c
+++ b/drivers/staging/rtl8192u/r819xU_cmdpkt.c
@@ -62,33 +62,6 @@ rt_status SendTxCommandPacket(struct net_device *dev, void 
*pData, u32 DataLen)
 }
 
 /*-
- * Function:   cmpk_message_handle_tx()
- *
- * Overview:   Driver internal module can call the API to send message to
- * firmware side. For example, you can send a debug command packet.
- * Or you can send a request for FW to modify RLX4181 LBUS HW bank.
- * Otherwise, you can change MAC/PHT/RF register by firmware at
- * run time. We do not support message more than one segment now.
- *
- * Input:  NONE
- *
- * Output: NONE
- *
- * Return: NONE
- *
- * Revised History:
- * WhenWho Remark
- * 05/06/2008  amy porting from windows code.
- *
- *---*/
-extern rt_status cmpk_message_handle_tx(struct net_device *dev,
-   u8 *codevirtualaddress,
-   u32 packettype, u32 buffer_len)
-{
-   return true;
-}
-
-/*-
  * Function:cmpk_counttxstatistic()
  *
  * Overview:
diff --git a/drivers/staging/rtl8192u/r819xU_cmdpkt.h 
b/drivers/staging/rtl8192u/r819xU_cmdpkt.h
index ebe4032..c79878a 100644
--- a/drivers/staging/rtl8192u/r819xU_cmdpkt.h
+++ b/drivers/staging/rtl8192u/r819xU_cmdpkt.h
@@ -192,8 +192,6 @@ typedef enum _rt_status{
RT_STATUS_RESOURCE
 }rt_status,*prt_status;
 
-extern rt_status cmpk_message_handle_tx(struct net_device *dev, u8 
*codevirtualaddress, u32 packettype, u32 buffer_len);
-
 extern  u32 cmpk_message_handle_rx(struct net_device *dev, struct 
ieee80211_rx_stats *pstats);
 extern rt_status SendTxCommandPacket( struct net_device *dev, void *pData, u32 
DataLen);
 
-- 
1.8.3.4

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


[PATCH 07/14] staging: rtl8192u: remove unused dm_gpio_change_rf_callback()

2013-09-21 Thread Xenia Ragiadakou
This patch removes dm_gpio_change_rf_callback() because it is not called
anywhere and it resides inside an #ifdef RTL8192E guard while RTL8192E
is not defined.

Signed-off-by: Xenia Ragiadakou 
---
 drivers/staging/rtl8192u/r8192U_dm.c | 73 
 1 file changed, 73 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_dm.c 
b/drivers/staging/rtl8192u/r8192U_dm.c
index 910bd4c..1a38085 100644
--- a/drivers/staging/rtl8192u/r8192U_dm.c
+++ b/drivers/staging/rtl8192u/r8192U_dm.c
@@ -2850,79 +2850,6 @@ static   voiddm_check_pbc_gpio(struct net_device 
*dev)
 
 }
 
-#ifdef RTL8192E
-
-/*-
- * Function:   dm_GPIOChangeRF
- * Overview:   PCI will not support workitem call back HW radio on-off control.
- *
- * Input:  NONE
- *
- * Output: NONE
- *
- * Return: NONE
- *
- * Revised History:
- * WhenWho Remark
- * 02/21/2008  MHC Create Version 0.
- *
- *---*/
-extern voiddm_gpio_change_rf_callback(struct work_struct *work)
-{
-   struct delayed_work *dwork = container_of(work,struct 
delayed_work,work);
-   struct r8192_priv *priv = container_of(dwork,struct 
r8192_priv,gpio_change_rf_wq);
-   struct net_device *dev = priv->ieee80211->dev;
-   u8 tmp1byte;
-   RT_RF_POWER_STATE   eRfPowerStateToSet;
-   bool bActuallySet = false;
-
-   do{
-   bActuallySet=false;
-
-   if(!priv->up)
-   {
-   RT_TRACE((COMP_INIT | COMP_POWER | 
COMP_RF),"dm_gpio_change_rf_callback(): Callback function breaks out!!\n");
-   }
-   else
-   {
-   // 0x108 GPIO input register is read only
-   //set 0x108 B1= 1: RF-ON; 0: RF-OFF.
-   read_nic_byte(dev, GPI, &tmp1byte);
-
-   eRfPowerStateToSet = (tmp1byte&BIT1) ?  eRfOn : eRfOff;
-
-   if((priv->bHwRadioOff == true) && (eRfPowerStateToSet 
== eRfOn))
-   {
-   RT_TRACE(COMP_RF, "gpiochangeRF  - HW Radio 
ON\n");
-
-   priv->bHwRadioOff = false;
-   bActuallySet = true;
-   }
-   else if ((priv->bHwRadioOff == false) && 
(eRfPowerStateToSet == eRfOff))
-   {
-   RT_TRACE(COMP_RF, "gpiochangeRF  - HW Radio 
OFF\n");
-   priv->bHwRadioOff = true;
-   bActuallySet = true;
-   }
-
-   if(bActuallySet)
-   {
-   #ifdef TO_DO
-   MgntActSet_RF_State(dev, eRfPowerStateToSet, 
RF_CHANGE_BY_HW);
-   //DrvIFIndicateCurrentPhyStatus(pAdapter);
-   #endif
-   }
-   else
-   {
-   msleep(2000);
-   }
-
-   }
-   }while(TRUE)
-
-}  /* dm_GPIOChangeRF */
-
-#endif
 /*-
  * Function:   DM_RFPathCheckWorkItemCallBack()
  *
-- 
1.8.3.4

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


[PATCH 13/14] staging: rtl8192u: remove code inside #ifdef RTL8190P in r8190_rtl8256.h

2013-09-21 Thread Xenia Ragiadakou
This patch removes the unused code inside #ifdef RTL8190P header guard,
since RTL8190P is not defined.

Signed-off-by: Xenia Ragiadakou 
---
 drivers/staging/rtl8192u/r8190_rtl8256.h | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8190_rtl8256.h 
b/drivers/staging/rtl8192u/r8190_rtl8256.h
index 592e780..fa6dd37 100644
--- a/drivers/staging/rtl8192u/r8190_rtl8256.h
+++ b/drivers/staging/rtl8192u/r8190_rtl8256.h
@@ -13,11 +13,7 @@
 #ifndef RTL8225H
 #define RTL8225H
 
-#ifdef RTL8190P
-#define RTL819X_TOTAL_RF_PATH 4 //for 90P
-#else
 #define RTL819X_TOTAL_RF_PATH 2 //for 8192U
-#endif
 extern void PHY_SetRF8256Bandwidth(struct net_device *dev , HT_CHANNEL_WIDTH 
Bandwidth);
 extern void PHY_RF8256_Config(struct net_device *dev);
 extern void phy_RF8256_Config_ParaFile(struct net_device *dev);
-- 
1.8.3.4

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


[PATCH 09/14] staging: rtl8192u: remove code inside #ifdef RTL8190P in r819xU_firmware.c

2013-09-21 Thread Xenia Ragiadakou
This patch removes the unused code that resides inside #ifdef RTL8190P since
RTL8190P is not defined.

Signed-off-by: Xenia Ragiadakou 
---
 drivers/staging/rtl8192u/r819xU_firmware.c | 15 ---
 1 file changed, 15 deletions(-)

diff --git a/drivers/staging/rtl8192u/r819xU_firmware.c 
b/drivers/staging/rtl8192u/r819xU_firmware.c
index 106740e..d6a6de3 100644
--- a/drivers/staging/rtl8192u/r819xU_firmware.c
+++ b/drivers/staging/rtl8192u/r819xU_firmware.c
@@ -295,16 +295,10 @@ bool init_firmware(struct net_device *dev)
mapped_file = pfirmware->firmware_buf;
file_length = fw_entry->size;
} else {
-#ifdef RTL8190P
-   
memcpy(pfirmware->firmware_buf,fw_entry->data,fw_entry->size);
-   mapped_file = pfirmware->firmware_buf;
-   file_length = fw_entry->size;
-#else
memset(pfirmware->firmware_buf,0,128);

memcpy(&pfirmware->firmware_buf[128],fw_entry->data,fw_entry->size);
mapped_file = pfirmware->firmware_buf;
file_length = fw_entry->size + 128;
-#endif
}
pfirmware->firmware_buf_size = file_length;
}else if (rst_opt == OPT_FIRMWARE_RESET ) {
@@ -336,15 +330,6 @@ bool init_firmware(struct net_device *dev)
 * will set polling bit when firmware code is also 
configured
 */
pfirmware->firmware_status = FW_STATUS_1_MOVE_BOOT_CODE;
-#ifdef RTL8190P
-   // To initialize IMEM, CPU move code  from 0x8080, 
hence, we send 0x80 byte packet
-   rt_status = fwSendNullPacket(dev, 
RTL8190_CPU_START_OFFSET);
-   if (rt_status != true)
-   {
-   RT_TRACE(COMP_INIT, "fwSendNullPacket() fail ! 
\n");
-   goto  download_firmware_fail;
-   }
-#endif
//mdelay(1000);
/*
 * To initialize IMEM, CPU move code  from 0x8080,
-- 
1.8.3.4

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


[PATCH 10/14] staging: rtl8192u: remove code inside #ifdef RTL8190P in r8192U_dm.c

2013-09-21 Thread Xenia Ragiadakou
This patch removes the unused code that resides inside #ifdef RTL8190P
header guard since RTL8190P is not defined.

Signed-off-by: Xenia Ragiadakou 
---
 drivers/staging/rtl8192u/r8192U_dm.c | 137 +++
 1 file changed, 12 insertions(+), 125 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_dm.c 
b/drivers/staging/rtl8192u/r8192U_dm.c
index 1a38085..42c2234 100644
--- a/drivers/staging/rtl8192u/r8192U_dm.c
+++ b/drivers/staging/rtl8192u/r8192U_dm.c
@@ -632,11 +632,7 @@ static void dm_TXPowerTrackingCallback_TSSI(struct 
net_device *dev)
mdelay(1);
continue;
}
-#ifdef RTL8190P
-   read_nic_word(dev, 0x1bc, &Avg_TSSI_Meas);
-#else
read_nic_word(dev, 0x13c, &Avg_TSSI_Meas);
-#endif
if(Avg_TSSI_Meas == 0)
{
write_nic_byte(dev, 0x1ba, 0);
@@ -645,14 +641,10 @@ static void dm_TXPowerTrackingCallback_TSSI(struct 
net_device *dev)
 
for(k = 0;k < 5; k++)
{
-#ifdef RTL8190P
-   read_nic_byte(dev, 0x1d8+k, &tmp_report[k]);
-#else
if(k !=4)
read_nic_byte(dev, 0x134+k, &tmp_report[k]);
else
read_nic_byte(dev, 0x13e, &tmp_report[k]);
-#endif
RT_TRACE(COMP_POWER_TRACKING, "TSSI_report_value = 
%d\n", tmp_report[k]);
}
 
@@ -699,10 +691,6 @@ static void dm_TXPowerTrackingCallback_TSSI(struct 
net_device *dev)
RT_TRACE(COMP_POWER_TRACKING, "tx power track is 
done\n");
RT_TRACE(COMP_POWER_TRACKING, 
"priv->rfa_txpowertrackingindex = %d\n", priv->rfa_txpowertrackingindex);
RT_TRACE(COMP_POWER_TRACKING, 
"priv->rfa_txpowertrackingindex_real = %d\n", 
priv->rfa_txpowertrackingindex_real);
-#ifdef RTL8190P
-   RT_TRACE(COMP_POWER_TRACKING, 
"priv->rfc_txpowertrackingindex = %d\n", priv->rfc_txpowertrackingindex);
-   RT_TRACE(COMP_POWER_TRACKING, 
"priv->rfc_txpowertrackingindex_real = %d\n", 
priv->rfc_txpowertrackingindex_real);
-#endif
RT_TRACE(COMP_POWER_TRACKING, 
"priv->cck_present_attentuation_difference = %d\n", 
priv->cck_present_attentuation_difference);
RT_TRACE(COMP_POWER_TRACKING, 
"priv->cck_present_attentuation = %d\n", priv->cck_present_attentuation);
return;
@@ -711,11 +699,7 @@ static void dm_TXPowerTrackingCallback_TSSI(struct 
net_device *dev)
{
if(Avg_TSSI_Meas_from_driver < TSSI_13dBm - 
E_FOR_TX_POWER_TRACK)
{
-   if((priv->rfa_txpowertrackingindex > 0)
-#ifdef RTL8190P
-   &&(priv->rfc_txpowertrackingindex > 0)
-#endif
-   )
+   if (priv->rfa_txpowertrackingindex > 0)
{
priv->rfa_txpowertrackingindex--;
if(priv->rfa_txpowertrackingindex_real 
> 4)
@@ -723,33 +707,16 @@ static void dm_TXPowerTrackingCallback_TSSI(struct 
net_device *dev)

priv->rfa_txpowertrackingindex_real--;
rtl8192_setBBreg(dev, 
rOFDM0_XATxIQImbalance, bMaskDWord, 
priv->txbbgain_table[priv->rfa_txpowertrackingindex_real].txbbgain_value);
}
-#ifdef RTL8190P
-   priv->rfc_txpowertrackingindex--;
-   if(priv->rfc_txpowertrackingindex_real 
> 4)
-   {
-   
priv->rfc_txpowertrackingindex_real--;
-   rtl8192_setBBreg(dev, 
rOFDM0_XCTxIQImbalance, bMaskDWord, 
priv->txbbgain_table[priv->rfc_txpowertrackingindex_real].txbbgain_value);
-   }
-#endif
}
}
else
{
-   if((priv->rfa_txpowertrackingindex < 36)
-#ifdef RTL8190P
-   &&(priv->rfc_txpowertrackingindex < 36)
-#endif
-   )
+   if (priv->rfa_txpowertrackingindex < 36)
{
priv->rfa_txpowertrackingindex++;
priv->rfa_txpowertrackingindex_real++;
rtl8192_setBBreg(dev, 
rOFDM0_XATxIQImbalance, bMaskDWord, 
priv->txbbgain_table[priv->rfa_txpowertrackingindex_real].txbbgain_value);
 
-#ifdef RTL8190P
- 

[PATCH 03/14] staging: rtl8192u: remove unused code in fw_download_code()

2013-09-21 Thread Xenia Ragiadakou
This patch removes the code that resides outside #ifdef RTL8192U,
since RTL8192U is defined in r8192U.h and removes, also, the header
guard itself.

Signed-off-by: Xenia Ragiadakou 
---
 drivers/staging/rtl8192u/r819xU_firmware.c | 6 --
 1 file changed, 6 deletions(-)

diff --git a/drivers/staging/rtl8192u/r819xU_firmware.c 
b/drivers/staging/rtl8192u/r819xU_firmware.c
index bb924ac..cde4365 100644
--- a/drivers/staging/rtl8192u/r819xU_firmware.c
+++ b/drivers/staging/rtl8192u/r819xU_firmware.c
@@ -61,20 +61,14 @@ bool fw_download_code(struct net_device *dev, u8 
*code_virtual_address, u32 buff
/* Allocate skb buffer to contain firmware info and tx 
descriptor info
 * add 4 to avoid packet appending overflow.
 * */
-   #ifdef RTL8192U
skb  = dev_alloc_skb(USB_HWDESC_HEADER_LEN + frag_length + 4);
-   #else
-   skb  = dev_alloc_skb(frag_length + 4);
-   #endif
memcpy((unsigned char *)(skb->cb),&dev,sizeof(dev));
tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
tcb_desc->queue_index = TXCMD_QUEUE;
tcb_desc->bCmdOrInit = DESC_PACKET_TYPE_INIT;
tcb_desc->bLastIniPkt = bLastIniPkt;
 
-   #ifdef RTL8192U
skb_reserve(skb, USB_HWDESC_HEADER_LEN);
-   #endif
seg_ptr = skb->data;
/*
 * Transform from little endian to big endian
-- 
1.8.3.4

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


[PATCH 14/14] staging: rt8192u: remove #ifdef RTL8192U in r8192U.h

2013-09-21 Thread Xenia Ragiadakou
This patch removes #ifdef RTL8192U header guard and the code that falls
outside it, since RTL8192U is defined.

Signed-off-by: Xenia Ragiadakou 
---
 drivers/staging/rtl8192u/r8192U.h | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U.h 
b/drivers/staging/rtl8192u/r8192U.h
index b484ee1..4c46bb2 100644
--- a/drivers/staging/rtl8192u/r8192U.h
+++ b/drivers/staging/rtl8192u/r8192U.h
@@ -409,15 +409,11 @@ typedef struct rx_drvinfo_819x_usb {
 #defineUSB_HWDESC_HEADER_LEN   sizeof(tx_desc_819x_usb)
 #define TX_PACKET_SHIFT_BYTES  (USB_HWDESC_HEADER_LEN + 
sizeof(tx_fwinfo_819x_usb))
 #define MAX_FRAGMENT_COUNT 8
-#ifdef RTL8192U
 #ifdef USB_TX_DRIVER_AGGREGATION_ENABLE
 #define MAX_TRANSMIT_BUFFER_SIZE   32000
 #else
 #define MAX_TRANSMIT_BUFFER_SIZE   8000
 #endif
-#else
-#define MAX_TRANSMIT_BUFFER_SIZE   
(1600+(MAX_802_11_HEADER_LENGTH+ENCRYPTION_MAX_OVERHEAD)*MAX_FRAGMENT_COUNT)
-#endif
 #ifdef USB_TX_DRIVER_AGGREGATION_ENABLE
 #define TX_PACKET_DRVAGGR_SUBFRAME_SHIFT_BYTES 
(sizeof(tx_desc_819x_usb_aggr_subframe) + sizeof(tx_fwinfo_819x_usb))
 #endif
-- 
1.8.3.4

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


[PATCH 04/14] staging: rtl8192u: check dev_alloc_skb() return value in fw_download_code()

2013-09-21 Thread Xenia Ragiadakou
This patch adds a check whether skb allocation, in fw_download_code(), was
successful.

Signed-off-by: Xenia Ragiadakou 
---
 drivers/staging/rtl8192u/r819xU_firmware.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/rtl8192u/r819xU_firmware.c 
b/drivers/staging/rtl8192u/r819xU_firmware.c
index cde4365..106740e 100644
--- a/drivers/staging/rtl8192u/r819xU_firmware.c
+++ b/drivers/staging/rtl8192u/r819xU_firmware.c
@@ -62,6 +62,8 @@ bool fw_download_code(struct net_device *dev, u8 
*code_virtual_address, u32 buff
 * add 4 to avoid packet appending overflow.
 * */
skb  = dev_alloc_skb(USB_HWDESC_HEADER_LEN + frag_length + 4);
+   if (!skb)
+   return false;
memcpy((unsigned char *)(skb->cb),&dev,sizeof(dev));
tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
tcb_desc->queue_index = TXCMD_QUEUE;
-- 
1.8.3.4

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


[PATCH 01/14] staging: rtl8192u: remove unused code from cmpk_message_handle_tx()

2013-09-21 Thread Xenia Ragiadakou
The file r819xU_cmdpkt.c includes header r8192U.h which defines RTL8192U.
This patch removes from cmpk_message_handle_tx() the part of the code that
is never used because it resides outside the header guard #ifdef RTL8192U.

Signed-off-by: Xenia Ragiadakou 
---
 drivers/staging/rtl8192u/r819xU_cmdpkt.c | 74 +---
 1 file changed, 1 insertion(+), 73 deletions(-)

diff --git a/drivers/staging/rtl8192u/r819xU_cmdpkt.c 
b/drivers/staging/rtl8192u/r819xU_cmdpkt.c
index 5614401..072f20d 100644
--- a/drivers/staging/rtl8192u/r819xU_cmdpkt.c
+++ b/drivers/staging/rtl8192u/r819xU_cmdpkt.c
@@ -85,79 +85,7 @@ extern rt_status cmpk_message_handle_tx(struct net_device 
*dev,
u8 *codevirtualaddress,
u32 packettype, u32 buffer_len)
 {
-
-   boolrt_status = true;
-#ifdef RTL8192U
-   return rt_status;
-#else
-   struct r8192_priv   *priv = ieee80211_priv(dev);
-   u16 frag_threshold;
-   u16 frag_length, frag_offset = 0;
-
-   rt_firmware *pfirmware = priv->pFirmware;
-   struct sk_buff  *skb;
-   unsigned char   *seg_ptr;
-   cb_desc *tcb_desc;
-   u8  bLastIniPkt;
-
-   firmware_init_param(dev);
-   /* Fragmentation might be required */
-   frag_threshold = pfirmware->cmdpacket_frag_thresold;
-   do {
-   if ((buffer_len - frag_offset) > frag_threshold) {
-   frag_length = frag_threshold;
-   bLastIniPkt = 0;
-
-   } else {
-   frag_length = buffer_len - frag_offset;
-   bLastIniPkt = 1;
-
-   }
-
-   /* Allocate skb buffer to contain firmware info and tx
-  descriptor info add 4 to avoid packet appending overflow. */
-#ifdef RTL8192U
-   skb  = dev_alloc_skb(USB_HWDESC_HEADER_LEN + frag_length + 4);
-#else
-   skb  = dev_alloc_skb(frag_length + 4);
-#endif
-   memcpy((unsigned char *)(skb->cb), &dev, sizeof(dev));
-   tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
-   tcb_desc->queue_index = TXCMD_QUEUE;
-   tcb_desc->bCmdOrInit = packettype;
-   tcb_desc->bLastIniPkt = bLastIniPkt;
-
-#ifdef RTL8192U
-   skb_reserve(skb, USB_HWDESC_HEADER_LEN);
-#endif
-
-   seg_ptr = skb_put(skb, buffer_len);
-   /*
-* Transform from little endian to big endian
-* and pending zero
-*/
-   memcpy(seg_ptr, codevirtualaddress, buffer_len);
-   tcb_desc->txbuf_size = (u16)buffer_len;
-
-
-   if (!priv->ieee80211->check_nic_enough_desc(dev, 
tcb_desc->queue_index) ||
-   
(!skb_queue_empty(&priv->ieee80211->skb_waitQ[tcb_desc->queue_index])) ||
-   (priv->ieee80211->queue_stop)) {
-   RT_TRACE(COMP_FIRMWARE, "==> tx full!\n");
-   
skb_queue_tail(&priv->ieee80211->skb_waitQ[tcb_desc->queue_index], skb);
-   } else {
-   priv->ieee80211->softmac_hard_start_xmit(skb, dev);
-   }
-
-   codevirtualaddress += frag_length;
-   frag_offset += frag_length;
-
-   } while (frag_offset < buffer_len);
-
-   return rt_status;
-
-
-#endif
+   return true;
 }
 
 /*-
-- 
1.8.3.4

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


[PATCH 06/14] staging: rtl8192u: remove #ifdef RTL8192U guard in r8192U_dm.c

2013-09-21 Thread Xenia Ragiadakou
This patch removes #ifdef RTL8192U header guards from r8192U_dm.c, since
RTL8192U is defined in the included r8192U.h header.

Signed-off-by: Xenia Ragiadakou 
---
 drivers/staging/rtl8192u/r8192U_dm.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_dm.c 
b/drivers/staging/rtl8192u/r8192U_dm.c
index 338c6f1..910bd4c 100644
--- a/drivers/staging/rtl8192u/r8192U_dm.c
+++ b/drivers/staging/rtl8192u/r8192U_dm.c
@@ -2832,7 +2832,6 @@ static void dm_ctstoself(struct net_device *dev)
  *---*/
 static voiddm_check_pbc_gpio(struct net_device *dev)
 {
-#ifdef RTL8192U
struct r8192_priv *priv = ieee80211_priv(dev);
u8 tmp1byte;
 
@@ -2848,7 +2847,6 @@ staticvoiddm_check_pbc_gpio(struct net_device 
*dev)
RT_TRACE(COMP_IO, "CheckPbcGPIO - PBC is pressed\n");
priv->bpbc_pressed = true;
}
-#endif
 
 }
 
@@ -3798,10 +3796,8 @@ static void dm_dynamic_txpower(struct net_device *dev)
SetTxPowerLevel8190(Adapter,pHalData->CurrentChannel);
 #endif
 
-#ifdef RTL8192U

rtl8192_phy_setTxPower(dev,priv->ieee80211->current_network.channel);
//pHalData->bStartTxCtrlByTPCNFR = FALSE;//Clear th flag of 
Set TX Power from Sitesurvey
-#endif
}
priv->bLastDTPFlag_High = priv->bDynamicTxHighPower;
priv->bLastDTPFlag_Low = priv->bDynamicTxLowPower;
-- 
1.8.3.4

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


[PATCH 05/14] staging: rtl8192u: remove dm_check_rfctrl_gpio()

2013-09-21 Thread Xenia Ragiadakou
This patch removes dm_check_rfctrl_gpio() because it does nothing when
RTL8192U is defined.

Signed-off-by: Xenia Ragiadakou 
---
 drivers/staging/rtl8192u/r8192U_dm.c | 42 
 1 file changed, 42 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_dm.c 
b/drivers/staging/rtl8192u/r8192U_dm.c
index 5275131..338c6f1 100644
--- a/drivers/staging/rtl8192u/r8192U_dm.c
+++ b/drivers/staging/rtl8192u/r8192U_dm.c
@@ -122,9 +122,6 @@ static  void dm_init_ctstoself(struct net_device *dev);
 // DM --> EDCA turbo mode control
 static voiddm_check_edca_turbo(struct net_device *dev);
 
-// DM --> HW RF control
-static voiddm_check_rfctrl_gpio(struct net_device *dev);
-
 #ifndef RTL8190P
 //static   voiddm_gpio_change_rf(struct net_device *dev);
 #endif
@@ -269,7 +266,6 @@ extern  voidhal_dm_watchdog(struct net_device *dev)
dm_ctrl_initgain_byrssi(dev);
dm_check_edca_turbo(dev);
dm_bandwidth_autoswitch(dev);
-   dm_check_rfctrl_gpio(dev);
dm_check_rx_path_selection(dev);
dm_check_fsync(dev);
 
@@ -2818,44 +2814,6 @@ static void dm_ctstoself(struct net_device *dev)
}
 }
 
-
-/*-
- * Function:   dm_check_rfctrl_gpio()
- *
- * Overview:   Copy 8187B template for 9xseries.
- *
- * Input:  NONE
- *
- * Output: NONE
- *
- * Return: NONE
- *
- * Revised History:
- * WhenWho Remark
- * 05/28/2008  amy Create Version 0 porting from windows 
code.
- *
- *---*/
-static void dm_check_rfctrl_gpio(struct net_device *dev)
-{
-   //struct r8192_priv *priv = ieee80211_priv(dev);
-
-   // Work around for DTM test, we will not enable HW - radio on/off 
because r/w
-   // page 1 register before extra bus is enabled causing system failures 
when resuming
-   // from S4. 20080218, Emily
-
-   // Stop to execute workitem to prevent S3/S4 bug.
-#ifdef RTL8190P
-   return;
-#endif
-#ifdef RTL8192U
-   return;
-#endif
-#ifdef RTL8192E
-   queue_delayed_work(priv->priv_wq,&priv->gpio_change_rf_wq,0);
-#endif
-
-}  /* dm_CheckRfCtrlGPIO */
-
 /*-
  * Function:   dm_check_pbc_gpio()
  *
-- 
1.8.3.4

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


[PATCH 11/14] staging: rtl8192u: remove #ifndef RTL8190P guard from r8192U_dm.c

2013-09-21 Thread Xenia Ragiadakou
This patch removes #ifndef RTL8190P header guard since RTL8190P is not
defined anywhere in rtl8192u code.

Signed-off-by: Xenia Ragiadakou 
---
 drivers/staging/rtl8192u/r8192U_dm.c | 6 --
 1 file changed, 6 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_dm.c 
b/drivers/staging/rtl8192u/r8192U_dm.c
index 42c2234..6c87178 100644
--- a/drivers/staging/rtl8192u/r8192U_dm.c
+++ b/drivers/staging/rtl8192u/r8192U_dm.c
@@ -122,9 +122,7 @@ static  void dm_init_ctstoself(struct net_device *dev);
 // DM --> EDCA turbo mode control
 static voiddm_check_edca_turbo(struct net_device *dev);
 
-#ifndef RTL8190P
 //static   voiddm_gpio_change_rf(struct net_device *dev);
-#endif
 // DM --> Check PBC
 static void dm_check_pbc_gpio(struct net_device *dev);
 
@@ -3285,9 +3283,7 @@ static void dm_EndSWFsync(struct net_device *dev)
}
 
priv->ContinueDiffCount = 0;
-#ifndef RTL8190P
write_nic_dword(dev, rOFDM0_RxDetector2, 0x465c52cd);
-#endif
 
 }
 
@@ -3326,9 +3322,7 @@ static void dm_StartSWFsync(struct net_device *dev)
priv->fsync_timer.expires = jiffies + 
MSECS(priv->ieee80211->fsync_time_interval);
add_timer(&priv->fsync_timer);
 
-#ifndef RTL8190P
write_nic_dword(dev, rOFDM0_RxDetector2, 0x465c12cd);
-#endif
 
 }
 
-- 
1.8.3.4

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


[PATCH 12/14] staging: rtl8192u: remove #ifndef RTL8192U and the code inside it

2013-09-21 Thread Xenia Ragiadakou
This patch removes the unused code inside #ifndef RTL8192U header guard
and the guard itself, since RTL8192U is defined.

Signed-off-by: Xenia Ragiadakou 
---
 drivers/staging/rtl8192u/r8192U_dm.c | 8 
 1 file changed, 8 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_dm.c 
b/drivers/staging/rtl8192u/r8192U_dm.c
index 6c87178..41fb67b 100644
--- a/drivers/staging/rtl8192u/r8192U_dm.c
+++ b/drivers/staging/rtl8192u/r8192U_dm.c
@@ -100,14 +100,6 @@ static voiddm_check_txpower_tracking(struct 
net_device *dev);
 //static   voiddm_txpower_reset_recovery(struct net_device *dev);
 
 
-// DM --> BB init gain restore
-#ifndef RTL8192U
-static voiddm_bb_initialgain_restore(struct net_device *dev);
-
-
-// DM --> BB init gain backup
-static voiddm_bb_initialgain_backup(struct net_device *dev);
-#endif
 // DM --> Dynamic Init Gain by RSSI
 static voiddm_dig_init(struct net_device *dev);
 static voiddm_ctrl_initgain_byrssi(struct net_device *dev);
-- 
1.8.3.4

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


[PATCH 08/14] staging: rtl8192u: remove code inside #ifdef RTL8190P/RTL8192E in r819xU_phy.c

2013-09-21 Thread Xenia Ragiadakou
This patch removes the unused code inside #ifdef RTL8190P and #ifdef RTL8192E
guards since RTL8190P and RTL8192E are not defined.

Signed-off-by: Xenia Ragiadakou 
---
 drivers/staging/rtl8192u/r819xU_phy.c | 6 --
 1 file changed, 6 deletions(-)

diff --git a/drivers/staging/rtl8192u/r819xU_phy.c 
b/drivers/staging/rtl8192u/r819xU_phy.c
index a6fac08..17ac120 100644
--- a/drivers/staging/rtl8192u/r819xU_phy.c
+++ b/drivers/staging/rtl8192u/r819xU_phy.c
@@ -1799,12 +1799,6 @@ extern void InitialGainOperateWorkItemCallBack(struct 
work_struct *work)
RT_TRACE(COMP_SCAN, "Scan BBInitialGainRestore 0xa0a is %x\n",
 priv->initgain_backup.cca);
 
-#ifdef RTL8190P
-   SetTxPowerLevel8190(Adapter, priv->CurrentChannel);
-#endif
-#ifdef RTL8192E
-   SetTxPowerLevel8190(Adapter, priv->CurrentChannel);
-#endif
rtl8192_phy_setTxPower(dev, 
priv->ieee80211->current_network.channel);
 
if (dm_digtable.dig_algorithm == DIG_ALGO_BY_FALSE_ALARM)
-- 
1.8.3.4

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


[PATCH 02/19] hv: Change variable type to bool

2013-09-21 Thread Peter Senna Tschudin
The variable execute_shutdown is only assigned the values true and
false. Change its type to bool.

The simplified semantic patch that find this problem is as
follows (http://coccinelle.lip6.fr/):

@exists@
type T;
identifier b;
@@
- T
+ bool
  b = ...;
  ... when any
  b = \(true\|false\)

Signed-off-by: Peter Senna Tschudin 
---
 drivers/hv/hv_util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hv/hv_util.c b/drivers/hv/hv_util.c
index cb82233..fa37369 100644
--- a/drivers/hv/hv_util.c
+++ b/drivers/hv/hv_util.c
@@ -82,7 +82,7 @@ static void shutdown_onchannelcallback(void *context)
struct vmbus_channel *channel = context;
u32 recvlen;
u64 requestid;
-   u8  execute_shutdown = false;
+   bool  execute_shutdown = false;
u8  *shut_txf_buf = util_shutdown.recv_buffer;
 
struct shutdown_msg_data *shutdown_msg;
-- 
1.8.3.1

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


[PATCH 15/19] staging: Change variable type to bool

2013-09-21 Thread Peter Senna Tschudin
The variable ownbit_flag is only assigned the values true and false.
Change its type to bool.

The simplified semantic patch that find this problem is as
follows (http://coccinelle.lip6.fr/):

@exists@
type T;
identifier b;
@@
- T
+ bool
  b = ...;
  ... when any
  b = \(true\|false\)

Signed-off-by: Peter Senna Tschudin 
---
 drivers/staging/rtl8187se/r8180_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8187se/r8180_core.c 
b/drivers/staging/rtl8187se/r8180_core.c
index 5947a6f..35412d2 100644
--- a/drivers/staging/rtl8187se/r8180_core.c
+++ b/drivers/staging/rtl8187se/r8180_core.c
@@ -1704,7 +1704,7 @@ short rtl8180_tx(struct net_device *dev, u8 *txbuf, int 
len, int priority,
u16 RtsDur = 0;
u16 ThisFrameTime = 0;
u16 TxDescDuration = 0;
-   u8  ownbit_flag = false;
+   boolownbit_flag = false;
 
switch (priority) {
case MANAGE_PRIORITY:
-- 
1.8.3.1

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


[PATCH 16/19] staging: Change variable type to bool

2013-09-21 Thread Peter Senna Tschudin
The variables bMultiBand and bKeyTableFull are only assigned the
values true and false. Change its type to bool.

The simplified semantic patch that find this problem is as
follows (http://coccinelle.lip6.fr/):

@exists@
type T;
identifier b;
@@
- T
+ bool
  b = ...;
  ... when any
  b = \(true\|false\)

Signed-off-by: Peter Senna Tschudin 
---
 drivers/staging/vt6656/channel.c | 2 +-
 drivers/staging/vt6656/hostap.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/vt6656/channel.c b/drivers/staging/vt6656/channel.c
index 5158ff4..e430b35 100644
--- a/drivers/staging/vt6656/channel.c
+++ b/drivers/staging/vt6656/channel.c
@@ -403,7 +403,7 @@ exit:
 
 void CHvInitChannelTable(struct vnt_private *pDevice)
 {
-   int bMultiBand = false;
+   bool bMultiBand = false;
int ii;
 
 for (ii = 1; ii <= CB_MAX_CHANNEL; ii++)
diff --git a/drivers/staging/vt6656/hostap.c b/drivers/staging/vt6656/hostap.c
index c699a30..7d96fe7 100644
--- a/drivers/staging/vt6656/hostap.c
+++ b/drivers/staging/vt6656/hostap.c
@@ -414,7 +414,7 @@ static int hostap_set_encryption(struct vnt_private 
*pDevice,
int ret = 0;
s32 iNodeIndex = -1;
int ii;
-   int bKeyTableFull = false;
+   bool bKeyTableFull = false;
u16 wKeyCtl = 0;
 
param->u.crypt.err = 0;
-- 
1.8.3.1

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


[PATCH 17/19] staging: Change variable type to bool

2013-09-21 Thread Peter Senna Tschudin
The variable Trigger is only assigned the values true and false.
Change its type to bool.

The simplified semantic patch that find this problem is as
follows (http://coccinelle.lip6.fr/):

@exists@
type T;
identifier b;
@@
- T
+ bool
  b = ...;
  ... when any
  b = \(true\|false\)

Signed-off-by: Peter Senna Tschudin 
---
 drivers/staging/winbond/wb35tx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/winbond/wb35tx.c b/drivers/staging/winbond/wb35tx.c
index 30a77cc..708c5b0 100644
--- a/drivers/staging/winbond/wb35tx.c
+++ b/drivers/staging/winbond/wb35tx.c
@@ -180,7 +180,7 @@ void Wb35Tx_CurrentTime(struct wbsoft_priv *adapter, u32 
TimeCount)
 {
struct hw_data *pHwData = &adapter->sHwData;
struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx;
-   unsigned char Trigger = false;
+   bool Trigger = false;
 
if (pWb35Tx->TxTimer > TimeCount)
Trigger = true;
-- 
1.8.3.1

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


Re: [PATCH 15/19] staging: Change variable type to bool

2013-09-21 Thread Greg KH
On Sun, Sep 22, 2013 at 12:27:47AM +0200, Peter Senna Tschudin wrote:
> The variable ownbit_flag is only assigned the values true and false.
> Change its type to bool.
> 
> The simplified semantic patch that find this problem is as
> follows (http://coccinelle.lip6.fr/):
> 
> @exists@
> type T;
> identifier b;
> @@
> - T
> + bool
>   b = ...;
>   ... when any
>   b = \(true\|false\)
> 
> Signed-off-by: Peter Senna Tschudin 
> ---
>  drivers/staging/rtl8187se/r8180_core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

You sent me 3 patches with the exact same subject: line, which doesn't
bode well for the changelog.  You should update your script to put the
driver name in the subject: to make it more unique and easier to
identify in the future.  I'll fix these 3 up for now.

thanks,

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


Reworking dm-writeboost [was: Re: staging: Add dm-writeboost]

2013-09-21 Thread Akira Hayakawa
Mike,

> We don't need to go through staging.  If the dm-writeboost target is
> designed well and provides a tangible benefit it doesn't need
> wide-spread users as justification for going in.  The users will come if
> it is implemented well.
OK.
The benefit of introducing writeboost will be documented.
1. READ often hit in page cache.
   That's what page cache is all about.
   READ cache only caches the rest that page cache couldn't cache.
2. Backing store in RAID mode crazily slow in WRITE,
   especially if it is RAID-5.
will be the points.
There is not a silver bullet as a cache software
but writeboost can fit in many situations I believe.


> Have you looked at how both dm-cache and dm-thinp handle this?
> Userspace takes care to write all zeroes to the start of the metadata
> device before the first use in the kernel.
Zeroing the first one sector is a sign of needing formatting
sounds nice to writeboost too.
It's simple and I like it.


> Could be the log structured nature of writeboost is very different.
> I'll review this closer tomorrow.
I should mention about the big design difference
between writeboost and dm-cache
to help you understand the nature of writeboost.

Writeboost doesn't have segregated metadata device like dm-cache does.
Data and metadata coexists in the same cache device.
That is what log-structured is.
Data and its relevant metadata are packed in a log segment
and written to cache device atomically
which makes writeboost reliable and fast.
So, 
> could be factored out.  I haven't yet looked close enough at that aspect
> of writeboost code to know if it could benefit from the existing
> bio-prison code or persistent-data library at all.  writeboost would
> obviously need a new space map type, etc.
what makes sense to dm-cache could not make sense to writeboost.
At a simple look, they don't fit to the design of writeboost.
But I will investigate these functionality further in later time.


> sounds like a step in the right direction.  Plus you can share the cache
> by layering multiple linear devices ontop of the dm-writeboost device.
They are theoretically different but it is actually a trade-off.
But it is not a big problem compared to fitting to device-mapper.


> Also managing dm-writeboost devices with lvm2 is a priority, so any
> interface similarities dm-writeboost has with dm-cache will be
> beneficial.
It sounds really good to me.
Huge benefit.


Akira

n 9/18/13 5:59 AM, Mike Snitzer wrote:
> On Tue, Sep 17 2013 at  8:43am -0400,
> Akira Hayakawa  wrote:
> 
>> Hi, Mike
>>
>> There are two designs in my mind
>> regarding the formatting cache.
>>
>> You said
>>>   administer the writeboost devices.  There is no need for this.  Just
>>>   have a normal DM target whose .ctr takes care of validation and
>>>   determines whether a device needs formatting, etc.  
>> makes me wonder how I format the cache device.
>>
>>
>> There are two choices for formatting cache and create a writeboost device
>> standing on the point of removing writeboost-mgr existing in the current 
>> design.
>> I will explain them from how the interface will look like.
>>
>> (1) dmsetup create myDevice ... "... $backing_path $cache_path"
>> which will returns error if the superblock of the given cache device
>> is invalid and needs formatting.
>> And then the user formats the cache device by some userland tool.
>>
>> (2) dmsetup create myDevice ... "... $backing_path $cache_path $do_format"
>> which also returns error if the superblock of the given cache device
>> is invalid and needs formatting when $do_format is 0.
>> And then user formats the cache device by setting $do_format to 1 and try 
>> again.
>>
>> There pros and cons about the design tradeoffs:
>> - (i)  (1) is simpler. do_format parameter in (2) doesn't seem to be sane.
>>(1) is like the interfaces of filesystems where dmsetup create is 
>> like mounting a filesystem.
>> - (ii) (2) can implement everything in kernel. It can gather all the 
>> information
>>about how the superblock in one place, kernel code.
>>
>> Excuse for the current design:
>> - The reason I design writeboost-mgr is almost regarding (ii) above.
>>   writeboost-mgr has a message "format_cache_device" and
>>   writeboost-format-cache userland command kicks the message to format cache.
>>
>> - writeboost-mgr has also a message "resume_cache"
>>   that validates and builds a in-memory structure according to the cache 
>> binding to given $cache_id
>>   and user later dmsetup create the writeboost device with the $cache_id.
>>   However, resuming the cache metadata should be done under .ctr like 
>> dm-cache does
>>   and should not relate LV to create and cache by external cache_id
>>   is what I realized by looking at the code of dm-cache which
>>   calls dm_cache_metadata_open() routines under .ctr .
> 
> Right, any in-core structures should be allocated in .ctr()
> 
>> writeboost-mgr is something like smell of over-engineering but
>> is useful for simplifying th