RE: [PATCH v3] video: hyperv: hyperv_fb: refresh the VM screen by force on VM panic

2014-07-25 Thread Dexuan Cui
 -Original Message-
 From: gre...@linuxfoundation.org [mailto:gre...@linuxfoundation.org]
 Sent: Thursday, July 24, 2014 11:53 AM
  So, hi Greg and all,
  If you think the patch itself is OK, may I know if it's OK for the patch to 
  go
  into Greg's char-misc.git tree, as some other hyper-v patches did?
 
 No, it needs to go through the fb tree, not mine, sorry.
 
 greg k-h

Hi Greg,
Thank you very much for the clarification!
It's clear to me now.
Let me just wait the framebuffer maintainers' reply. :-)

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


[PATCH 01/12] staging: comedi: amplc_pc236: reformat header comments

2014-07-25 Thread Ian Abbott
Use preferred style for copyright and driver description comments.

Signed-off-by: Ian Abbott abbo...@mev.co.uk
---
 drivers/staging/comedi/drivers/amplc_pc236.c | 92 ++--
 1 file changed, 46 insertions(+), 46 deletions(-)

diff --git a/drivers/staging/comedi/drivers/amplc_pc236.c 
b/drivers/staging/comedi/drivers/amplc_pc236.c
index 243b0f4..9d64e45 100644
--- a/drivers/staging/comedi/drivers/amplc_pc236.c
+++ b/drivers/staging/comedi/drivers/amplc_pc236.c
@@ -1,51 +1,51 @@
 /*
-comedi/drivers/amplc_pc236.c
-Driver for Amplicon PC36AT and PCI236 DIO boards.
-
-Copyright (C) 2002 MEV Ltd. http://www.mev.co.uk/
-
-COMEDI - Linux Control and Measurement Device Interface
-Copyright (C) 2000 David A. Schleef d...@schleef.org
-
-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.
-*/
+ * comedi/drivers/amplc_pc236.c
+ * Driver for Amplicon PC36AT and PCI236 DIO boards.
+ *
+ * Copyright (C) 2002 MEV Ltd. http://www.mev.co.uk/
+ *
+ * COMEDI - Linux Control and Measurement Device Interface
+ * Copyright (C) 2000 David A. Schleef d...@schleef.org
+ *
+ * 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.
+ */
 /*
-Driver: amplc_pc236
-Description: Amplicon PC36AT, PCI236
-Author: Ian Abbott abbo...@mev.co.uk
-Devices: [Amplicon] PC36AT (pc36at), PCI236 (pci236 or amplc_pc236)
-Updated: Wed, 01 Apr 2009 15:41:25 +0100
-Status: works
-
-Configuration options - PC36AT:
-  [0] - I/O port base address
-  [1] - IRQ (optional)
-
-Configuration options - PCI236:
-  [0] - PCI bus of device (optional)
-  [1] - PCI slot of device (optional)
-  If bus/slot is not specified, the first available PCI device will be
-  used.
-
-The PC36AT ISA board and PCI236 PCI board have a single 8255 appearing
-as subdevice 0.
-
-Subdevice 1 pretends to be a digital input device, but it always returns
-0 when read. However, if you run a command with scan_begin_src=TRIG_EXT,
-a rising edge on port C bit 3 acts as an external trigger, which can be
-used to wake up tasks.  This is like the comedi_parport device, but the
-only way to physically disable the interrupt on the PC36AT is to remove
-the IRQ jumper.  If no interrupt is connected, then subdevice 1 is
-unused.
-*/
+ * Driver: amplc_pc236
+ * Description: Amplicon PC36AT, PCI236
+ * Author: Ian Abbott abbo...@mev.co.uk
+ * Devices: [Amplicon] PC36AT (pc36at), PCI236 (pci236 or amplc_pc236)
+ * Updated: Wed, 01 Apr 2009 15:41:25 +0100
+ * Status: works
+ *
+ * Configuration options - PC36AT:
+ *   [0] - I/O port base address
+ *   [1] - IRQ (optional)
+ *
+ * Configuration options - PCI236:
+ *   [0] - PCI bus of device (optional)
+ *   [1] - PCI slot of device (optional)
+ *   If bus/slot is not specified, the first available PCI device will be
+ *   used.
+ *
+ * The PC36AT ISA board and PCI236 PCI board have a single 8255 appearing
+ * as subdevice 0.
+ *
+ * Subdevice 1 pretends to be a digital input device, but it always returns
+ * 0 when read. However, if you run a command with scan_begin_src=TRIG_EXT,
+ * a rising edge on port C bit 3 acts as an external trigger, which can be
+ * used to wake up tasks.  This is like the comedi_parport device, but the
+ * only way to physically disable the interrupt on the PC36AT is to remove
+ * the IRQ jumper.  If no interrupt is connected, then subdevice 1 is
+ * unused.
+ */
 
 #include linux/module.h
 #include linux/pci.h
-- 
2.0.0

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


[PATCH 12/12] staging: comedi: amplc_pc236: set board_name before common attach

2014-07-25 Thread Ian Abbott
For PCI boards, the `auto_attach` handler, `pc236_auto_attach()`,
initializes `dev-board_ptr` to point to a `struct pc236_board`, but
leaves `dev-board_name` unchanged.  The Comedi core will have
initialized `dev-board_name` to the `driver_name` string member of
`amplc_pc236_driver`.  For consistency with ISA boards manually
configured by the `COMEDI_DEVCONFIG` ioctl via the legacy `attach`
handler, `pc236_attach()`, set `dev-board_name` to the `name` member of
the `struct pc236_board` pointed to by `dev-board_ptr`.

Both `pc236_attach()` and `pc236_auto_attach()` call
`pc236_common_attach()`, which also sets `dev-board_name` to the `name`
member of the `struct pc236_board`.  Since this assignment no longer
changes anything, remove it.

A nice side-effect of this change is that the same owner name string is
used for requesting I/O regions (before the call the
`pc236_common_attach()`) as is used for requesting the IRQ handler
(during the call to `pc236_common_attach()`).  It was already the same
for (manually configured) ISA boards, but is now the same for
(automatically configured) PCI boards.

Signed-off-by: Ian Abbott abbo...@mev.co.uk
---
 drivers/staging/comedi/drivers/amplc_pc236.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/amplc_pc236.c 
b/drivers/staging/comedi/drivers/amplc_pc236.c
index 1a7fa45..b92fc6f 100644
--- a/drivers/staging/comedi/drivers/amplc_pc236.c
+++ b/drivers/staging/comedi/drivers/amplc_pc236.c
@@ -284,11 +284,9 @@ static irqreturn_t pc236_interrupt(int irq, void *d)
 static int pc236_common_attach(struct comedi_device *dev, unsigned long iobase,
   unsigned int irq, unsigned long req_irq_flags)
 {
-   const struct pc236_board *thisboard = comedi_board(dev);
struct comedi_subdevice *s;
int ret;
 
-   dev-board_name = thisboard-name;
dev-iobase = iobase;
 
ret = comedi_alloc_subdevices(dev, 2);
@@ -362,6 +360,7 @@ static int pc236_auto_attach(struct comedi_device *dev,
return -ENOMEM;
 
dev-board_ptr = pc236_pci_board;
+   dev-board_name = pc236_pci_board.name;
ret = comedi_pci_enable(dev);
if (ret)
return ret;
-- 
2.0.0

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


[PATCH 09/12] staging: comedi: amplc_pc236: don't check bus type in attach

2014-07-25 Thread Ian Abbott
Since the legacy attach routine `pc236_attach()` is only called for
board names matching an entry in our array of ISA boards
`pc236_isa_boards[]`, and it is reasonable to expect all elements of
`pc236_isa_boards[]` to have their `bustype` member initialized
correctly to `isa_bustype`, don't bother checking the bus type in
`pc236_attach()`.  Add `if (!DO_ISA) return -EINVAL` to optimize out the
remainder of the function if `CONFIG_COMEDI_AMPLC_PC236_ISA` is not
defined.

Similarly, don't bother checking the bus type in
`pc236_find_pci_board()` as it is reasonable to expect all elements of
`pc236_pci_boards[]` to have their `bustype` member initialized
correctly to `pci_bustype`.

Signed-off-by: Ian Abbott abbo...@mev.co.uk
---
 drivers/staging/comedi/drivers/amplc_pc236.c | 26 --
 1 file changed, 8 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/comedi/drivers/amplc_pc236.c 
b/drivers/staging/comedi/drivers/amplc_pc236.c
index 0a5ba10..51c22f9 100644
--- a/drivers/staging/comedi/drivers/amplc_pc236.c
+++ b/drivers/staging/comedi/drivers/amplc_pc236.c
@@ -129,8 +129,7 @@ static const struct pc236_board 
*pc236_find_pci_board(struct pci_dev *pci_dev)
unsigned int i;
 
for (i = 0; i  ARRAY_SIZE(pc236_pci_boards); i++)
-   if (is_pci_board(pc236_pci_boards[i]) 
-   pci_dev-device == pc236_pci_boards[i].devid)
+   if (pci_dev-device == pc236_pci_boards[i].devid)
return pc236_pci_boards[i];
return NULL;
 }
@@ -349,30 +348,21 @@ static int pc236_common_attach(struct comedi_device *dev, 
unsigned long iobase,
 
 static int pc236_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 {
-   const struct pc236_board *thisboard = comedi_board(dev);
struct pc236_private *devpriv;
int ret;
 
+   if (!DO_ISA)
+   return -EINVAL;
+
devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
if (!devpriv)
return -ENOMEM;
 
-   /* Process options according to bus type. */
-   if (is_isa_board(thisboard)) {
-   ret = comedi_request_region(dev, it-options[0], 0x4);
-   if (ret)
-   return ret;
-
-   return pc236_common_attach(dev, dev-iobase, it-options[1], 0);
-   } else if (is_pci_board(thisboard)) {
-   dev_err(dev-class_dev,
-   Manual configuration of PCI board '%s' is not 
supported\n,
-   thisboard-name);
-   return -EIO;
-   }
+   ret = comedi_request_region(dev, it-options[0], 0x4);
+   if (ret)
+   return ret;
 
-   dev_err(dev-class_dev, BUG! cannot determine board type!\n);
-   return -EINVAL;
+   return pc236_common_attach(dev, dev-iobase, it-options[1], 0);
 }
 
 static int pc236_auto_attach(struct comedi_device *dev,
-- 
2.0.0

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


[PATCH 03/12] staging: comedi: amplc_pc236: remove manual configuration of PCI boards

2014-07-25 Thread Ian Abbott
Remove the code that allows PCI boards to be manually attached by the
`COMEDI_DEVCONFIG` ioctl (or the comedi_config application).
Supported PCI boards (PCI236) will be attached automatically at probe
time via `comedi_pci_auto_config()` and the `auto_attach` hook in the
`struct comedi_driver`.

The wildcard entry in `pc236_boards[]` was only used when manually
attaching a PCI board using a driver name instead of a board name, so is
no longer needed.  Remove it.

Signed-off-by: Ian Abbott abbo...@mev.co.uk
---
 drivers/staging/comedi/drivers/amplc_pc236.c | 72 
 1 file changed, 9 insertions(+), 63 deletions(-)

diff --git a/drivers/staging/comedi/drivers/amplc_pc236.c 
b/drivers/staging/comedi/drivers/amplc_pc236.c
index 7600319..7331ae3 100644
--- a/drivers/staging/comedi/drivers/amplc_pc236.c
+++ b/drivers/staging/comedi/drivers/amplc_pc236.c
@@ -21,19 +21,16 @@
  * Driver: amplc_pc236
  * Description: Amplicon PC36AT, PCI236
  * Author: Ian Abbott abbo...@mev.co.uk
- * Devices: [Amplicon] PC36AT (pc36at), PCI236 (pci236 or amplc_pc236)
- * Updated: Wed, 01 Apr 2009 15:41:25 +0100
+ * Devices: [Amplicon] PC36AT (pc36at), PCI236 (pci236)
+ * Updated: Thu, 24 Jul 2014 14:25:26 +
  * Status: works
  *
  * Configuration options - PC36AT:
  *   [0] - I/O port base address
  *   [1] - IRQ (optional)
  *
- * Configuration options - PCI236:
- *   [0] - PCI bus of device (optional)
- *   [1] - PCI slot of device (optional)
- *   If bus/slot is not specified, the first available PCI device will be
- *   used.
+ * Manual configuration of PCI board (PCI236) is not supported; it is
+ * configured automatically.
  *
  * The PC36AT ISA board and PCI236 PCI board have a single 8255 appearing
  * as subdevice 0.
@@ -85,7 +82,7 @@
  */
 
 enum pc236_bustype { isa_bustype, pci_bustype };
-enum pc236_model { pc36at_model, pci236_model, anypci_model };
+enum pc236_model { pc36at_model, pci236_model };
 
 struct pc236_board {
const char *name;
@@ -108,12 +105,6 @@ static const struct pc236_board pc236_boards[] = {
.bustype = pci_bustype,
.model = pci236_model,
},
-   {
-   .name = amplc_pc236,
-   .devid = PCI_DEVICE_ID_INVALID,
-   .bustype = pci_bustype,
-   .model = anypci_model,  /* wildcard */
-   },
 #endif
 };
 
@@ -149,49 +140,6 @@ static const struct pc236_board 
*pc236_find_pci_board(struct pci_dev *pci_dev)
 }
 
 /*
- * This function looks for a PCI device matching the requested board name,
- * bus and slot.
- */
-static struct pci_dev *pc236_find_pci_dev(struct comedi_device *dev,
- struct comedi_devconfig *it)
-{
-   const struct pc236_board *thisboard = comedi_board(dev);
-   struct pci_dev *pci_dev = NULL;
-   int bus = it-options[0];
-   int slot = it-options[1];
-
-   for_each_pci_dev(pci_dev) {
-   if (bus || slot) {
-   if (bus != pci_dev-bus-number ||
-   slot != PCI_SLOT(pci_dev-devfn))
-   continue;
-   }
-   if (pci_dev-vendor != PCI_VENDOR_ID_AMPLICON)
-   continue;
-
-   if (thisboard-model == anypci_model) {
-   /* Wildcard board matches any supported PCI board. */
-   const struct pc236_board *foundboard;
-
-   foundboard = pc236_find_pci_board(pci_dev);
-   if (foundboard == NULL)
-   continue;
-   /* Replace wildcard board_ptr. */
-   dev-board_ptr = foundboard;
-   } else {
-   /* Match specific model name. */
-   if (pci_dev-device != thisboard-devid)
-   continue;
-   }
-   return pci_dev;
-   }
-   dev_err(dev-class_dev,
-   No supported board found! (req. bus %d, slot %d)\n,
-   bus, slot);
-   return NULL;
-}
-
-/*
  * This function is called to mark the interrupt as disabled (no command
  * configured on subdevice 1) and to physically disable the interrupt
  * (not possible on the PC36AT, except by removing the IRQ jumper!).
@@ -439,12 +387,10 @@ static int pc236_attach(struct comedi_device *dev, struct 
comedi_devconfig *it)
 
return pc236_common_attach(dev, dev-iobase, it-options[1], 0);
} else if (is_pci_board(thisboard)) {
-   struct pci_dev *pci_dev;
-
-   pci_dev = pc236_find_pci_dev(dev, it);
-   if (!pci_dev)
-   return -EIO;
-   return pc236_pci_common_attach(dev, pci_dev);
+   dev_err(dev-class_dev,
+   Manual configuration of PCI board '%s' is not 
supported\n,
+   thisboard-name);
+   return -EIO;
}
 
 

[PATCH 05/12] staging: comedi: amplc_pc236: no need to set hw_dev

2014-07-25 Thread Ian Abbott
The call to `comedi_set_hw_dev()` from `pc236_pci_common_attach()` is
now unnecessary since `pc236_pci_common_attach()` is now only called
from this driver's `auto_attach` hook `pc236_auto_attach()` and the
comedi core now calls `comedi_set_hw_dev()` before calling that.  Remove
the unnecessary call.

Signed-off-by: Ian Abbott abbo...@mev.co.uk
---
 drivers/staging/comedi/drivers/amplc_pc236.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/amplc_pc236.c 
b/drivers/staging/comedi/drivers/amplc_pc236.c
index cf45c58..f99c7f1 100644
--- a/drivers/staging/comedi/drivers/amplc_pc236.c
+++ b/drivers/staging/comedi/drivers/amplc_pc236.c
@@ -358,8 +358,6 @@ static int pc236_pci_common_attach(struct comedi_device 
*dev,
unsigned long iobase;
int ret;
 
-   comedi_set_hw_dev(dev, pci_dev-dev);
-
ret = comedi_pci_enable(dev);
if (ret)
return ret;
-- 
2.0.0

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


[PATCH 11/12] staging: comedi: amplc_pc236: remove PCI device ID macros

2014-07-25 Thread Ian Abbott
The `PCI_DEVICE_ID_AMPLICON_PCI236` macro is only used once, in the
module device table, so remove it and expand the macro in the table.

`The `PCI_DEVICE_ID_INVALID` macro is no longer used, so remove it.

Signed-off-by: Ian Abbott abbo...@mev.co.uk
---
 drivers/staging/comedi/drivers/amplc_pc236.c | 8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/comedi/drivers/amplc_pc236.c 
b/drivers/staging/comedi/drivers/amplc_pc236.c
index 1aae066..1a7fa45 100644
--- a/drivers/staging/comedi/drivers/amplc_pc236.c
+++ b/drivers/staging/comedi/drivers/amplc_pc236.c
@@ -57,10 +57,6 @@
 #define DO_ISA IS_ENABLED(CONFIG_COMEDI_AMPLC_PC236_ISA)
 #define DO_PCI IS_ENABLED(CONFIG_COMEDI_AMPLC_PC236_PCI)
 
-/* PCI236 PCI configuration register information */
-#define PCI_DEVICE_ID_AMPLICON_PCI236 0x0009
-#define PCI_DEVICE_ID_INVALID 0x
-
 /* PC36AT / PCI236 registers */
 
 /* Disable, and clear, interrupts */
@@ -407,8 +403,8 @@ static struct comedi_driver amplc_pc236_driver = {
 
 #if DO_PCI
 static const struct pci_device_id pc236_pci_table[] = {
-   { PCI_DEVICE(PCI_VENDOR_ID_AMPLICON, PCI_DEVICE_ID_AMPLICON_PCI236) },
-   {0}
+   { PCI_DEVICE(PCI_VENDOR_ID_AMPLICON, 0x0009) },
+   { 0 }
 };
 
 MODULE_DEVICE_TABLE(pci, pc236_pci_table);
-- 
2.0.0

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


[PATCH 08/12] staging: comedi: amplc_pc236: split pc236_boards[] into ISA PCI

2014-07-25 Thread Ian Abbott
Split `pc236_boards[]` into `pc236_isa_boards[]` for ISA cards and
`pc236_pci_boards[]` for PCI cards (there is only one of each).  Only
initialize the board name look-up members of `struct comedi_driver
amplc_pc236_driver` if the ISA part of the driver is enabled in the
kernel config (`CONFIG_COMEDI_AMPLC_PC236_ISA`) using the array of ISA
boards (`pc236_isa_boards[]`).  The driver doesn't allow manual
configuration of PCI devices, so there is no point having the comedi
core match the names of the PCI boards before it calls our driver's
legacy attach routine (`pc236_attach()`).

Signed-off-by: Ian Abbott abbo...@mev.co.uk
---
 drivers/staging/comedi/drivers/amplc_pc236.c | 24 +---
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/comedi/drivers/amplc_pc236.c 
b/drivers/staging/comedi/drivers/amplc_pc236.c
index 129578f..0a5ba10 100644
--- a/drivers/staging/comedi/drivers/amplc_pc236.c
+++ b/drivers/staging/comedi/drivers/amplc_pc236.c
@@ -88,20 +88,20 @@ struct pc236_board {
unsigned short devid;
enum pc236_bustype bustype;
 };
-static const struct pc236_board pc236_boards[] = {
-#if DO_ISA
+
+static const struct pc236_board pc236_isa_boards[] = {
{
.name = pc36at,
.bustype = isa_bustype,
},
-#endif
-#if DO_PCI
+};
+
+static const struct pc236_board pc236_pci_boards[] = {
{
.name = pci236,
.devid = PCI_DEVICE_ID_AMPLICON_PCI236,
.bustype = pci_bustype,
},
-#endif
 };
 
 struct pc236_private {
@@ -128,10 +128,10 @@ static const struct pc236_board 
*pc236_find_pci_board(struct pci_dev *pci_dev)
 {
unsigned int i;
 
-   for (i = 0; i  ARRAY_SIZE(pc236_boards); i++)
-   if (is_pci_board(pc236_boards[i]) 
-   pci_dev-device == pc236_boards[i].devid)
-   return pc236_boards[i];
+   for (i = 0; i  ARRAY_SIZE(pc236_pci_boards); i++)
+   if (is_pci_board(pc236_pci_boards[i]) 
+   pci_dev-device == pc236_pci_boards[i].devid)
+   return pc236_pci_boards[i];
return NULL;
 }
 
@@ -429,9 +429,11 @@ static struct comedi_driver amplc_pc236_driver = {
.attach = pc236_attach,
.auto_attach = pc236_auto_attach,
.detach = pc236_detach,
-   .board_name = pc236_boards[0].name,
+#if DO_ISA
+   .board_name = pc236_isa_boards[0].name,
.offset = sizeof(struct pc236_board),
-   .num_names = ARRAY_SIZE(pc236_boards),
+   .num_names = ARRAY_SIZE(pc236_isa_boards),
+#endif
 };
 
 #if DO_PCI
-- 
2.0.0

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


[PATCH 02/12] staging: comedi: amplc_pc236: remove some boilerplate comments

2014-07-25 Thread Ian Abbott
Signed-off-by: Ian Abbott abbo...@mev.co.uk
---
 drivers/staging/comedi/drivers/amplc_pc236.c | 21 -
 1 file changed, 21 deletions(-)

diff --git a/drivers/staging/comedi/drivers/amplc_pc236.c 
b/drivers/staging/comedi/drivers/amplc_pc236.c
index 9d64e45..7600319 100644
--- a/drivers/staging/comedi/drivers/amplc_pc236.c
+++ b/drivers/staging/comedi/drivers/amplc_pc236.c
@@ -117,10 +117,6 @@ static const struct pc236_board pc236_boards[] = {
 #endif
 };
 
-/* this structure is for data unique to this hardware driver.  If
-   several hardware drivers keep similar information in this structure,
-   feel free to suggest moving the variable to the struct comedi_device struct.
- */
 struct pc236_private {
unsigned long lcr_iobase; /* PLX PCI9052 config registers in PCIBAR1 */
int enable_irq;
@@ -425,12 +421,6 @@ static int pc236_pci_common_attach(struct comedi_device 
*dev,
return pc236_common_attach(dev, iobase, pci_dev-irq, IRQF_SHARED);
 }
 
-/*
- * Attach is called by the Comedi core to configure the driver
- * for a particular board.  If you specified a board_name array
- * in the driver structure, dev-board_ptr contains that
- * address.
- */
 static int pc236_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 {
const struct pc236_board *thisboard = comedi_board(dev);
@@ -461,11 +451,6 @@ static int pc236_attach(struct comedi_device *dev, struct 
comedi_devconfig *it)
return -EINVAL;
 }
 
-/*
- * The auto_attach hook is called at PCI probe time via
- * comedi_pci_auto_config().  dev-board_ptr is NULL on entry.
- * There should be a board entry matching the supplied PCI device.
- */
 static int pc236_auto_attach(struct comedi_device *dev,
   unsigned long context_unused)
 {
@@ -517,12 +502,6 @@ static void pc236_detach(struct comedi_device *dev)
}
 }
 
-/*
- * The struct comedi_driver structure tells the Comedi core module
- * which functions to call to configure/deconfigure (attach/detach)
- * the board, and also about the kernel module that contains
- * the device code.
- */
 static struct comedi_driver amplc_pc236_driver = {
.driver_name = amplc_pc236,
.module = THIS_MODULE,
-- 
2.0.0

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


[PATCH 10/12] staging: comedi: amplc_pc236: Simplify PCI board look-up

2014-07-25 Thread Ian Abbott
Since only a single PCI board is supported by the driver, there is no
need to call `pc236_find_pci_board()` to find the a board entry with
matching PCI device ID in `pc236_pci_boards[]`.  Just point to the entry
directly and remove the look-up function.  In fact, there is no reason
for `pc236_pci_boards[]` to be an array, so change it to a non-array
variable and rename it to `pc236_pci_board`.  Also, the `devid` member
of `struct pc236_board` is no longer needed as it was only used by the
look-up function, so remove it.

Signed-off-by: Ian Abbott abbo...@mev.co.uk
---
 drivers/staging/comedi/drivers/amplc_pc236.c | 29 
 1 file changed, 4 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/comedi/drivers/amplc_pc236.c 
b/drivers/staging/comedi/drivers/amplc_pc236.c
index 51c22f9..1aae066 100644
--- a/drivers/staging/comedi/drivers/amplc_pc236.c
+++ b/drivers/staging/comedi/drivers/amplc_pc236.c
@@ -85,7 +85,6 @@ enum pc236_bustype { isa_bustype, pci_bustype };
 
 struct pc236_board {
const char *name;
-   unsigned short devid;
enum pc236_bustype bustype;
 };
 
@@ -96,12 +95,9 @@ static const struct pc236_board pc236_isa_boards[] = {
},
 };
 
-static const struct pc236_board pc236_pci_boards[] = {
-   {
-   .name = pci236,
-   .devid = PCI_DEVICE_ID_AMPLICON_PCI236,
-   .bustype = pci_bustype,
-   },
+static const struct pc236_board pc236_pci_board = {
+   .name = pci236,
+   .bustype = pci_bustype,
 };
 
 struct pc236_private {
@@ -122,19 +118,6 @@ static inline bool is_pci_board(const struct pc236_board 
*board)
 }
 
 /*
- * This function looks for a board matching the supplied PCI device.
- */
-static const struct pc236_board *pc236_find_pci_board(struct pci_dev *pci_dev)
-{
-   unsigned int i;
-
-   for (i = 0; i  ARRAY_SIZE(pc236_pci_boards); i++)
-   if (pci_dev-device == pc236_pci_boards[i].devid)
-   return pc236_pci_boards[i];
-   return NULL;
-}
-
-/*
  * This function is called to mark the interrupt as disabled (no command
  * configured on subdevice 1) and to physically disable the interrupt
  * (not possible on the PC36AT, except by removing the IRQ jumper!).
@@ -382,11 +365,7 @@ static int pc236_auto_attach(struct comedi_device *dev,
if (!devpriv)
return -ENOMEM;
 
-   dev-board_ptr = pc236_find_pci_board(pci_dev);
-   if (dev-board_ptr == NULL) {
-   dev_err(dev-class_dev, BUG! cannot determine board type!\n);
-   return -EINVAL;
-   }
+   dev-board_ptr = pc236_pci_board;
ret = comedi_pci_enable(dev);
if (ret)
return ret;
-- 
2.0.0

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


[PATCH 06/12] staging: comedi: amplc_pc236: absorb pc236_pci_common_attach()

2014-07-25 Thread Ian Abbott
Absorb `pc236_pci_common_attach()` into `pc236_auto_attach()` since
that's the only place it is called from.

Signed-off-by: Ian Abbott abbo...@mev.co.uk
---
 drivers/staging/comedi/drivers/amplc_pc236.c | 26 +-
 1 file changed, 9 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/comedi/drivers/amplc_pc236.c 
b/drivers/staging/comedi/drivers/amplc_pc236.c
index f99c7f1..22d3b6f 100644
--- a/drivers/staging/comedi/drivers/amplc_pc236.c
+++ b/drivers/staging/comedi/drivers/amplc_pc236.c
@@ -351,22 +351,6 @@ static int pc236_common_attach(struct comedi_device *dev, 
unsigned long iobase,
return 0;
 }
 
-static int pc236_pci_common_attach(struct comedi_device *dev,
-  struct pci_dev *pci_dev)
-{
-   struct pc236_private *devpriv = dev-private;
-   unsigned long iobase;
-   int ret;
-
-   ret = comedi_pci_enable(dev);
-   if (ret)
-   return ret;
-
-   devpriv-lcr_iobase = pci_resource_start(pci_dev, 1);
-   iobase = pci_resource_start(pci_dev, 2);
-   return pc236_common_attach(dev, iobase, pci_dev-irq, IRQF_SHARED);
-}
-
 static int pc236_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 {
const struct pc236_board *thisboard = comedi_board(dev);
@@ -400,6 +384,8 @@ static int pc236_auto_attach(struct comedi_device *dev,
 {
struct pci_dev *pci_dev = comedi_to_pci_dev(dev);
struct pc236_private *devpriv;
+   unsigned long iobase;
+   int ret;
 
if (!DO_PCI)
return -EINVAL;
@@ -415,7 +401,13 @@ static int pc236_auto_attach(struct comedi_device *dev,
dev_err(dev-class_dev, BUG! cannot determine board type!\n);
return -EINVAL;
}
-   return pc236_pci_common_attach(dev, pci_dev);
+   ret = comedi_pci_enable(dev);
+   if (ret)
+   return ret;
+
+   devpriv-lcr_iobase = pci_resource_start(pci_dev, 1);
+   iobase = pci_resource_start(pci_dev, 2);
+   return pc236_common_attach(dev, iobase, pci_dev-irq, IRQF_SHARED);
 }
 
 static void pc236_detach(struct comedi_device *dev)
-- 
2.0.0

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


[PATCH] Staging: unisys: Fix code style

2014-07-25 Thread Arjun AK
From 8e7748dd81cf63c62dbef8f102e97da1d4d5d90a Mon Sep 17 00:00:00 2001
From: Arjun AK arjunak...@gmail.com
Date: Fri, 25 Jul 2014 15:09:11 +0530
Subject: [PATCH] Staging: unisys: Fix code style

Fixes code style in multiple files

Signed-off-by: Arjun AK arjunak...@gmail.com
---
 drivers/staging/unisys/channels/chanstub.c   |  2 ++
 .../unisys/common-spar/include/channels/channel.h|  2 ++
 .../unisys/common-spar/include/iovmcall_gnuc.h   | 14 --
 .../unisys/common-spar/include/vbusdeviceinfo.h  |  1 +
 drivers/staging/unisys/include/timskmod.h|  1 +
 drivers/staging/unisys/uislib/uislib.c   | 10 +-
 drivers/staging/unisys/uislib/uisthread.c|  1 +
 drivers/staging/unisys/uislib/uisutils.c |  5 +
 drivers/staging/unisys/virthba/virthba.c |  5 ++---
 drivers/staging/unisys/virtpci/virtpci.c |  8 
 .../staging/unisys/visorchannel/visorchannel_funcs.c |  3 +++
 drivers/staging/unisys/visorchipset/file.c   |  1 +
 drivers/staging/unisys/visorchipset/parser.c |  2 ++
 .../staging/unisys/visorchipset/visorchipset_main.c  | 20 
 14 files changed, 65 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/unisys/channels/chanstub.c 
b/drivers/staging/unisys/channels/chanstub.c
index 1e7d6a7..34b6ffe 100644
--- a/drivers/staging/unisys/channels/chanstub.c
+++ b/drivers/staging/unisys/channels/chanstub.c
@@ -47,6 +47,7 @@ SignalInsert_withLock(CHANNEL_HEADER __iomem *pChannel, U32 
Queue,
 {
unsigned char result;
unsigned long flags;
+
spin_lock_irqsave(lock, flags);
result = visor_signal_insert(pChannel, Queue, pSignal);
spin_unlock_irqrestore(lock, flags);
@@ -58,6 +59,7 @@ SignalRemove_withLock(CHANNEL_HEADER __iomem *pChannel, U32 
Queue,
  void *pSignal, spinlock_t *lock)
 {
unsigned char result;
+
spin_lock(lock);
result = visor_signal_remove(pChannel, Queue, pSignal);
spin_unlock(lock);
diff --git a/drivers/staging/unisys/common-spar/include/channels/channel.h 
b/drivers/staging/unisys/common-spar/include/channels/channel.h
index d19711d..6fcce3d 100644
--- a/drivers/staging/unisys/common-spar/include/channels/channel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/channel.h
@@ -399,6 +399,7 @@ PathName_Last_N_Nodes(U8 *s, unsigned int n)
 {
U8 *p = s;
unsigned int node_count = 0;
+
while (*p != '\0') {
if ((*p == '/') || (*p == '\\'))
node_count++;
@@ -542,6 +543,7 @@ ULTRA_channel_client_release_os(void __iomem *pChannel, U8 
*chanId,
void *logCtx, char *file, int line, char *func)
 {
CHANNEL_HEADER __iomem *pChan = pChannel;
+
if (readb(pChan-CliErrorOS) != 0) {
/* we are in an error msg throttling state; come out of it */
UltraLogEvent(logCtx, CHANNELSTATE_DIAG_EVENTID_TRANSITOK,
diff --git a/drivers/staging/unisys/common-spar/include/iovmcall_gnuc.h 
b/drivers/staging/unisys/common-spar/include/iovmcall_gnuc.h
index fe9598c..413796b 100644
--- a/drivers/staging/unisys/common-spar/include/iovmcall_gnuc.h
+++ b/drivers/staging/unisys/common-spar/include/iovmcall_gnuc.h
@@ -21,11 +21,12 @@ __unisys_vmcall_gnuc(unsigned long tuple, unsigned long 
reg_ebx,
unsigned long result = 0;
 
unsigned int cpuid_eax, cpuid_ebx, cpuid_ecx, cpuid_edx;
+
cpuid(0x0001, cpuid_eax, cpuid_ebx, cpuid_ecx, cpuid_edx);
if (cpuid_ecx  0x8000) {
- __asm__ __volatile__(.byte 0x00f, 0x001, 0x0c1 : =a(result) :
-  a(tuple), b(reg_ebx), c(reg_ecx)
- );
+   __asm__ __volatile__(.byte 0x00f, 0x001, 0x0c1 :
+=a(result) : a(tuple), b(reg_ebx),
+c(reg_ecx));
} else {
result = -1;
}
@@ -41,11 +42,12 @@ __unisys_extended_vmcall_gnuc(unsigned long long tuple,
unsigned long result = 0;
 
unsigned int cpuid_eax, cpuid_ebx, cpuid_ecx, cpuid_edx;
+
cpuid(0x0001, cpuid_eax, cpuid_ebx, cpuid_ecx, cpuid_edx);
if (cpuid_ecx  0x8000) {
- __asm__ __volatile__(.byte 0x00f, 0x001, 0x0c1 : =a(result) :
-  a(tuple), b(reg_ebx), c(reg_ecx),
-  d(reg_edx));
+   __asm__ __volatile__(.byte 0x00f, 0x001, 0x0c1 :
+=a(result) : a(tuple), b(reg_ebx),
+c(reg_ecx), d(reg_edx));
} else {
result = -1;
}
diff --git a/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h 
b/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h
index 8c0259a..a9d2a7b 100644
--- 

Re: [PATCH] Staging: unisys: Fix code style

2014-07-25 Thread Dan Carpenter
On Fri, Jul 25, 2014 at 03:37:41PM +0530, Arjun AK wrote:
 From 8e7748dd81cf63c62dbef8f102e97da1d4d5d90a Mon Sep 17 00:00:00 2001
 From: Arjun AK arjunak...@gmail.com
 Date: Fri, 25 Jul 2014 15:09:11 +0530
 Subject: [PATCH] Staging: unisys: Fix code style
 
 Fixes code style in multiple files
 
 Signed-off-by: Arjun AK arjunak...@gmail.com

Is your name really AK?
Does this even compile???
Read paragraph #1 of Documentation/email-clients.txt.
Break this up into patches that fix one kind of problem per patch.
Work against linux-next.

regards,
dan carpenter

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


Re: [PATCH 1/6 v3] staging: unisys: move installer to sysfs and split fields

2014-07-25 Thread Dan Carpenter
On Thu, Jul 24, 2014 at 02:08:42PM -0400, Benjamin Romer wrote:
 +static ssize_t error_store(struct device *dev, struct device_attribute *attr,
 + const char *buf, size_t count)
 +{
 + u32 error;
 +
 + if (sscanf(buf, %i\n, error) == 1) {
 + if (visorchannel_write(ControlVm_channel,
 + offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL,
 + InstallationError),
 + error, sizeof(u32)) == 1) {

visorchannel_write() returns either 0 or -EFAULT so this condition is
never true.  This bug occurs in several places.

 + return count;
 + }
 + }
 + return -EIO;
 +}

It's almost always better to have error handling instead of success
handling.  It should be a string of commands in a row and so we don't
have nested if statements.

ret = foo();
if (ret)
return ret;

ret = bar();
if (ret)
return ret;

ret = baz();
if (ret)
return ret;

ret = fizzbuzz();
if (ret)
return ret;

Look, Ma, no indenting!  Also -EIO is wrong-ish.  visorchannel_write()
should probably return -EIO instead of -EFAULT.  Do it like this:

static ssize_t error_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
u32 error;
int ret;

if (sscanf(buf, %u\n, error) != 1)
return -EINVAL;

ret = visorchannel_write(ControlVm_channel,
 offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL,
  InstallationError),
 error, sizeof(error));
if (ret)
return ret;

return count;
}

regards,
dan carpenter

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


Re: [PATCH 5/6 v3] staging: unisys: move parahotplug to sysfs

2014-07-25 Thread Dan Carpenter
On Thu, Jul 24, 2014 at 02:08:46PM -0400, Benjamin Romer wrote:
 + if (kstrtouint(buf, 10, id) != 1)
   return -EINVAL;

Obviously this doesn't work.  Btw, you should update your test suite to
prevent this kind of embarassing typo in the future.  ;)

Also I was reviewing enable_ints_write() earlier today and it does:

ret = kstrtouint(buf, 10, new_value);
if (ret != 0)
return ret;

Don't do the != 0, it's a double negative and it doesn't contribute
anything.  Just do if (ret) .

regards,
dan carpenter


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


Re: [PATCH 00/40] staging: comedi: ni_tio: clean up driver

2014-07-25 Thread Ian Abbott

On 2014-07-24 18:14, H Hartley Sweeten wrote:

Start cleaning up this driver by:
   1) fix all the checkpatch.pl warnings
  WARNING: line over 80 characters
  WARNING: Unnecessary space before function pointer arguments
  WARNING: Prefer [foo]_err to printk(KERN_ERR ...
   2) remove a bunch of unreachable BUG() code
   3) tidy up some of the CamelCase issues
   4) remove need for all the forward declarations
   5) general cleanup

H Hartley Sweeten (40):
   staging: comedi: ni_tio: fix ni_tio_insn_read()
   staging: comedi: ni_tio: fix  80 char comments
   staging: comedi: ni_tio: tidy up some function declarations
   staging: comedi: ni_tio: remove unnecessary ni_gpct_variant BUG() cases
   staging: comedi: ni_tio: tidy up ni_660x_set_second_gate()
   staging: comedi: ni_tio: tidy up ni_m_series_set_first_gate()
   staging: comedi: ni_tio: tidy up ni_660x_set_first_gate()
   staging: comedi: ni_tio: convert NI_M_Series_RTSI_Clock() to a macro
   staging: comedi: ni_tio: convert NI_M_Series_PFI_Clock() to a macro
   staging: comedi: ni_tio: convert NI_660x_Gate_Pin_Gate_Select() to a macro
   staging: comedi: ni_tio: convert NI_660x_RTSI_Gate_Select() to a macro
   staging: comedi: ni_tio: convert NI_M_Series_RTSI_Gate_Select() to a macro
   staging: comedi: ni_tio: convert NI_M_Series_PFI_Gate_Select() to a macro
   staging: comedi: ni_tio: convert NI_660x_Source_Pin_Clock() to a macro
   staging: comedi: ni_tio: convert NI_660x_RTSI_Clock() to a macro
   staging: comedi: ni_tio: convert NI_660x_RTSI_Second_Gate_Select() to a macro
   staging: comedi: ni_tio: convert NI_660x_Up_Down_Pin_Second_Gate_Select() to 
a macro
   staging: comedi: ni_tio: convert global static const variables to defines
   staging: comedi: ni_tio: remove counter_status_mask
   staging: comedi: ni_tio: tidy up enum ni_660x_second_gate_select
   staging: comedi: ni_tio: tidy up enum ni_m_series_gate_select
   staging: comedi: ni_tio: tidy up enum ni_660x_gate_select
   staging: comedi: ni_tio: tidy up enum ni_m_series_clock_source
   staging: comedi: ni_tio: tidy up enum ni_660x_clock_source
   staging: comedi: ni_tio: move defines to head of file
   staging: comedi: ni_tio: tidy up ni_gpct_device_{construct,destroy)()
   staging: comedi: ni_tio: tidy up ni_tio_init_counter()
   staging: comedi: ni_tio: rename ni_tio_second_gate_registers_present()
   staging: comedi: ni_tio: tidy up ni_m_series_source_select_bits()
   staging: comedi: ni_tio: tidy up ni_660x_source_select_bits()
   staging: comedi: ni_tio: tidy up ni_tio_set_sync_mode()
   staging: comedi: ni_tio: absorb ni_tio_counter_status()
   staging: comedi: ni_tio: tidy up ni_tio_get_gate_src() and helpers
   staging: comedi: ni_tio: tidy up ni_tio_set_other_src()
   staging: comedi: ni_tio: tidy up ni_tio_set_gate_src() and helpers
   staging: comedi: ni_tio: absorb ni_tio_set_first_gate_modifiers()
   staging: comedi: ni_tio: tidy up ni_tio_get_clock_src()
   staging: comedi: ni_tio: tidy up ni_tio_set_clock_src() and helpers
   staging: comedi: ni_tio: remove forward declarations
   staging: comedi: ni_tio: convert printk to pr_err

  drivers/staging/comedi/drivers/ni_tio.c | 1609 ++-
  1 file changed, 736 insertions(+), 873 deletions(-)


Reviewed-by: Ian Abbott abbo...@mev.co.uk

--
-=( Ian Abbott @ MEV Ltd.E-mail: abbo...@mev.co.uk)=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587 )=-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 00/14] staging: vt6655: Sparse and checkpatch fixes

2014-07-25 Thread Dan Carpenter
On Fri, Jul 25, 2014 at 01:06:14AM +0200, Guillaume Clement wrote:
 This patchset fixes a lot of minor checkpatch and sparse warnings.

These look nice.

regards,
dan carpenter

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


Re: [PATCH] staging: vt6655: tag data as __user in struct tagSCmdRequest

2014-07-25 Thread Dan Carpenter
On Fri, Jul 25, 2014 at 01:07:40AM +0200, Guillaume Clement wrote:
 diff --git a/drivers/staging/vt6655/iwctl.c b/drivers/staging/vt6655/iwctl.c
 index 501cd64..9291259 100644
 --- a/drivers/staging/vt6655/iwctl.c
 +++ b/drivers/staging/vt6655/iwctl.c
 @@ -1621,14 +1621,17 @@ int iwctl_giwauth(struct net_device *dev,
  int iwctl_siwgenie(struct net_device *dev,
  struct iw_request_info *info,
  struct iw_point *wrq,
 -char *extra)
 +char __user *extra)
  {
   PSDevicepDevice = (PSDevice)netdev_priv(dev);
   PSMgmtObjectpMgmt = (pDevice-sMgmtObj);
   int ret = 0;
 + char length;
  
   if (wrq-length) {
 - if ((wrq-length  2) || (extra[1]+2 != wrq-length)) {
 + if (get_user(length, extra + 1))
 + return -EFAULT;
 + if ((wrq-length  2) || (length != wrq-length)) {
   ret = -EINVAL;
   goto out;
   }

Wow, this is confusing code.  The patch description isn't clear enough
that this is a bugfix patch and not just a tag data patch.

I don't think this is correct.  We need to check the length of the input
buffer before we call get_user().  Can we return directly or do we
*need* to go to the mysteriously named out?  Also the + 2 is lost,
this would break everything if the current code works (not necessarily a
valid assumption).  Delete all my comments in the final code.

/* 2 because we skip the first byte and read length from the
   second byte */
if (wrq-length  2) {
ret = -EINVAL;
goto out;
}

ret = get_user(length, extra + 1);
if (ret)
goto out;

if (length + 2 != wrq-length) {
ret = -EINVAL;
goto out;
}

regards,
dan carpenter

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


Re: [PATCH] staging: vt6655: tag data as __user in struct tagSCmdRequest

2014-07-25 Thread Guillaume CLÉMENT
On Fri, Jul 25, 2014 at 02:52:34PM +0300, Dan Carpenter wrote:
 On Fri, Jul 25, 2014 at 01:07:40AM +0200, Guillaume Clement wrote:
  diff --git a/drivers/staging/vt6655/iwctl.c b/drivers/staging/vt6655/iwctl.c
  index 501cd64..9291259 100644
  --- a/drivers/staging/vt6655/iwctl.c
  +++ b/drivers/staging/vt6655/iwctl.c
  @@ -1621,14 +1621,17 @@ int iwctl_giwauth(struct net_device *dev,
   int iwctl_siwgenie(struct net_device *dev,
 struct iw_request_info *info,
 struct iw_point *wrq,
  -  char *extra)
  +  char __user *extra)
   {
  PSDevicepDevice = (PSDevice)netdev_priv(dev);
  PSMgmtObjectpMgmt = (pDevice-sMgmtObj);
  int ret = 0;
  +   char length;
 
  if (wrq-length) {
  -   if ((wrq-length  2) || (extra[1]+2 != wrq-length)) {
  +   if (get_user(length, extra + 1))
  +   return -EFAULT;
  +   if ((wrq-length  2) || (length != wrq-length)) {
  ret = -EINVAL;
  goto out;
  }

 Wow, this is confusing code.  The patch description isn't clear enough
 that this is a bugfix patch and not just a tag data patch.

 I don't think this is correct.  We need to check the length of the input
 buffer before we call get_user().  Can we return directly or do we
 *need* to go to the mysteriously named out?  Also the + 2 is lost,
 this would break everything if the current code works (not necessarily a
 valid assumption).  Delete all my comments in the final code.

In this case, the out label just does return ret;. But I agree this
is better practice to jump to out, in case this changes at a later time,
and to keep the code consistent.

About the missing + 2, and modifying the order of sorry about that, I
sent the patch too fast.

Thank you for your review, I will be submitting an updated patch with
your remarks.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: vt6655: tag data as __user in struct tagSCmdRequest

2014-07-25 Thread Dan Carpenter
On Fri, Jul 25, 2014 at 02:25:06PM +0200, Guillaume CLÉMENT wrote:
 On Fri, Jul 25, 2014 at 02:52:34PM +0300, Dan Carpenter wrote:
  On Fri, Jul 25, 2014 at 01:07:40AM +0200, Guillaume Clement wrote:
   diff --git a/drivers/staging/vt6655/iwctl.c 
   b/drivers/staging/vt6655/iwctl.c
   index 501cd64..9291259 100644
   --- a/drivers/staging/vt6655/iwctl.c
   +++ b/drivers/staging/vt6655/iwctl.c
   @@ -1621,14 +1621,17 @@ int iwctl_giwauth(struct net_device *dev,
int iwctl_siwgenie(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *wrq,
   -char *extra)
   +char __user *extra)
{
 PSDevicepDevice = (PSDevice)netdev_priv(dev);
 PSMgmtObjectpMgmt = (pDevice-sMgmtObj);
 int ret = 0;
   + char length;
  
 if (wrq-length) {
   - if ((wrq-length  2) || (extra[1]+2 != wrq-length)) {
   + if (get_user(length, extra + 1))
   + return -EFAULT;
   + if ((wrq-length  2) || (length != wrq-length)) {
 ret = -EINVAL;
 goto out;
 }
 
  Wow, this is confusing code.  The patch description isn't clear enough
  that this is a bugfix patch and not just a tag data patch.
 
  I don't think this is correct.  We need to check the length of the input
  buffer before we call get_user().  Can we return directly or do we
  *need* to go to the mysteriously named out?  Also the + 2 is lost,
  this would break everything if the current code works (not necessarily a
  valid assumption).  Delete all my comments in the final code.
 
 In this case, the out label just does return ret;. But I agree this
 is better practice to jump to out, in case this changes at a later time,
 and to keep the code consistent.


No, absolutely not.  out labels are the worst.  We shouldn't make the
code unreadable and mysterious *now* just because of something which
is possible but frankly unlikely at some later time.

Feel free to return directly if you want.

regards,
dan carpenter

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


[PATCH] staging: vt6655: fix direct dereferencing of user pointer

2014-07-25 Thread Guillaume Clement
Sparse reported that the data from tagSCmdRequest is given by
userspace, so it should be tagged as such.

Later, we were memcomparing and dereferencing it without first copying
it, fix that as well.

Signed-off-by: Guillaume Clement gclem...@baobob.org
---
 drivers/staging/vt6655/iocmd.h |  2 +-
 drivers/staging/vt6655/iwctl.c | 32 ++--
 drivers/staging/vt6655/iwctl.h |  6 +++---
 3 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/vt6655/iocmd.h b/drivers/staging/vt6655/iocmd.h
index e499f1b..dd12498 100644
--- a/drivers/staging/vt6655/iocmd.h
+++ b/drivers/staging/vt6655/iocmd.h
@@ -100,7 +100,7 @@ typedef enum tagWZONETYPE {
 #pragma pack(1)
 typedef struct tagSCmdRequest {
u8  name[16];
-   void*data;
+   void __user *data;
u16 wResult;
u16 wCmdCode;
 } SCmdRequest, *PSCmdRequest;
diff --git a/drivers/staging/vt6655/iwctl.c b/drivers/staging/vt6655/iwctl.c
index 501cd64..7ce23b5 100644
--- a/drivers/staging/vt6655/iwctl.c
+++ b/drivers/staging/vt6655/iwctl.c
@@ -1621,17 +1621,24 @@ int iwctl_giwauth(struct net_device *dev,
 int iwctl_siwgenie(struct net_device *dev,
   struct iw_request_info *info,
   struct iw_point *wrq,
-  char *extra)
+  char __user *extra)
 {
PSDevicepDevice = (PSDevice)netdev_priv(dev);
PSMgmtObjectpMgmt = (pDevice-sMgmtObj);
int ret = 0;
+   char length;
 
if (wrq-length) {
-   if ((wrq-length  2) || (extra[1]+2 != wrq-length)) {
-   ret = -EINVAL;
-   goto out;
-   }
+   if (wrq-length  2)
+   return -EINVAL;
+
+   ret = get_user(length, extra + 1);
+   if (ret)
+   return ret;
+
+   if (length + 2 != wrq-length)
+   return -EINVAL;
+
if (wrq-length  MAX_WPA_IE_LEN) {
ret = -ENOMEM;
goto out;
@@ -1654,7 +1661,7 @@ out://not completely ...not necessary in wpa_supplicant 
0.5.8
 int iwctl_giwgenie(struct net_device *dev,
   struct iw_request_info *info,
   struct iw_point *wrq,
-  char *extra)
+  char __user *extra)
 {
PSDevicepDevice = (PSDevice)netdev_priv(dev);
PSMgmtObjectpMgmt = (pDevice-sMgmtObj);
@@ -1801,18 +1808,23 @@ int iwctl_giwencodeext(struct net_device *dev,
 int iwctl_siwmlme(struct net_device *dev,
  struct iw_request_info *info,
  struct iw_point *wrq,
- char *extra)
+ char __user *extra)
 {
PSDevicepDevice = (PSDevice)netdev_priv(dev);
PSMgmtObjectpMgmt = (pDevice-sMgmtObj);
-   struct iw_mlme *mlme = (struct iw_mlme *)extra;
+   struct iw_mlme mime;
+
int ret = 0;
 
-   if (memcmp(pMgmt-abyCurrBSSID, mlme-addr.sa_data, ETH_ALEN)) {
+   ret = copy_from_user(mime, extra, sizeof(mime));
+   if (ret)
+   return -EFAULT;
+
+   if (memcmp(pMgmt-abyCurrBSSID, mime.addr.sa_data, ETH_ALEN)) {
ret = -EINVAL;
return ret;
}
-   switch (mlme-cmd) {
+   switch (mime.cmd) {
case IW_MLME_DEAUTH:
//this command seems to be not complete,please test it 
--einsnliu
//bScheduleCommand((void *) pDevice, WLAN_CMD_DEAUTH, (unsigned 
char *)reason);
diff --git a/drivers/staging/vt6655/iwctl.h b/drivers/staging/vt6655/iwctl.h
index de0a337..7dd6310 100644
--- a/drivers/staging/vt6655/iwctl.h
+++ b/drivers/staging/vt6655/iwctl.h
@@ -176,12 +176,12 @@ int iwctl_giwauth(struct net_device *dev,
 int iwctl_siwgenie(struct net_device *dev,
   struct iw_request_info *info,
   struct iw_point *wrq,
-  char *extra);
+  char __user *extra);
 
 int iwctl_giwgenie(struct net_device *dev,
   struct iw_request_info *info,
   struct iw_point *wrq,
-  char *extra);
+  char __user *extra);
 
 int iwctl_siwencodeext(struct net_device *dev,
   struct iw_request_info *info,
@@ -196,7 +196,7 @@ int iwctl_giwencodeext(struct net_device *dev,
 int iwctl_siwmlme(struct net_device *dev,
  struct iw_request_info *info,
  struct iw_point *wrq,
- char *extra);
+ char __user *extra);
 #endif // #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
 //End Add -- //2008-0409-07, Add by Einsn Liu
 
-- 
1.8.5.5

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


Re: [PATCH 1/6 v3] staging: unisys: move installer to sysfs and split fields

2014-07-25 Thread Romer, Benjamin M
On Fri, 2014-07-25 at 14:05 +0300, Dan Carpenter wrote:

 visorchannel_write() returns either 0 or -EFAULT so this condition is
 never true.  This bug occurs in several places.

Thank you for catching my mistake. I'll fix this and change
visorchannel_write() to return -EIO as you suggested.

 Look, Ma, no indenting!  Also -EIO is wrong-ish.  visorchannel_write()
 should probably return -EIO instead of -EFAULT.  Do it like this:

Will do. I'll also check for additional places where we can simplify the
code like that.

Thank you for the help!! :)

-- 
Ben Romer | Software Engineer |
Virtual Systems Development 

Unisys Corporation |  2476
Swedesford Rd |  Malvern, PA 19355
|  610-648-7140



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


Re: How to replace control code in gdm72xx?

2014-07-25 Thread Michalis Pappas
On 07/17/2014 01:59 AM, Ben Chan wrote:
 
 From what I read from the user-space code, the custom ioctl is to read
 the following information from the driver:
 
 enum {
 SIOC_DATA_FSM,   // Device/Connection State
 SIOC_DATA_NETLIST,   // Network list
 SIOC_DATA_CONNNSP, // Connected NSP
 SIOC_DATA_CONNCOMP,// Connection completion info
 SIOC_DATA_PROFILEID,// WiMAX profile ID
 SIOC_DATA_END
 };
 

Sorry for the late reply, I was away. 

I had a look at the library's source to clear things out a bit. From what I see 
the driver is tightly coupled -actually dependent- to the library, as all 
control operations are performed by the latter. So without the library, the 
driver is pretty much of no use.

The way control works is that the driver acts as a middleman between the 
library and the hci. All operations are initiated and handled by the library, 
through the netlink channel. So the information mentioned above, eg 
SIOC_DATA_NETLIST, are requested by the library, by sending the appropriate 
command to the driver via netlink. The driver will forward the request to the 
hci and forward the response back to userspace.

Here is where the ioctl part interface into play. The ioctl interface supports 
two commands: SIOCS_DATA and SIOCG_DATA (set data / get data). The above can 
store and retrieve data from the driver, which in turn keeps this information 
in the nic.sdk_data array. This array maintains one element for each one of the 
SIOC_DATA_* mentioned above.

So once received and processed, the library will store the received data (eg 
the network list) in the driver's memory via the ioctl, just to retrieve it 
again later(!) With the exception of SIOC_FSM_XXX, the driver does not inspect 
or process the contents of these objects by any means (see gdm_wimax_ioctl() in 
gdm_wimax.c).

Now, I have no clue why it was written this way, but as per its current 
status all this might as well (and probably should) be stored locally, in 
userspace memory. So the ioctl part can be completely removed, and the driver 
will then be in conformance with the interface defined by the wimax stack, in 
wimax.h.

 
 The driver has a corresponding user-space library, so I'd like to
 figure out a way to maintain backward compatibility if possible. But
 I'm happy to help make minor changes to  the user-space library in
 case we need to modify the ioctl / netlink part of the driver (caveat:
 I'm not the author of the driver or the user-space library).
 

Why maintain backwards compatibility? The only part to change is the
communication layer between the library and the driver. The applications
using the library won't notice any difference.

IMO the right thing to do is to push whatever changes made to the library 
upstream. Which brings us to the question of who is the library's maintainer 
and where is it officially hosted?

If the answers to the above are none and nowhere, then we have a bigger 
problem, as the updated driver will appear to be broken to anyone who hasn't 
been updated with the latest version of the library.

In conclusion, I am happy to fix the driver and even write a patch for the 
corresponding userspace parts, but only as long as:

* You are willing to help me with testing, as I do not own the hardware.

* My work will not be waisted. What I mean by that is, if the library has been 
distributed only to a few parties worldwide, then IMO we'd better delete the 
driver and let it be distributed along with the library, since they are 
interdependent anyway.

In any other case, I'd rather move on to some other driver that does not depend 
on third party stuff :)

Thanks,

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


[PATCH] staging: bcm: DDRInit.c: fixed coding style: lines over 80 char

2014-07-25 Thread Sudip Mukherjee

Signed-off-by: Sudip Mukherjee sudipm.mukher...@gmail.com
---
 drivers/staging/bcm/DDRInit.c | 59 ---
 1 file changed, 39 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/bcm/DDRInit.c b/drivers/staging/bcm/DDRInit.c
index 4564f40..4226c93 100644
--- a/drivers/staging/bcm/DDRInit.c
+++ b/drivers/staging/bcm/DDRInit.c
@@ -7,7 +7,8 @@
 
 /* DDR INIT-133Mhz */
 #define T3_SKIP_CLOCK_PROGRAM_DUMP_133MHZ 12  /* index for 0x0F007000 */
-static struct bcm_ddr_setting asT3_DDRSetting133MHz[] = {  /* DPLL Clock 
Setting */
+static struct bcm_ddr_setting asT3_DDRSetting133MHz[] = {
+   /* DPLL Clock Setting */
{0x0F000800, 0x7212},
{0x0f000820, 0x07F13FFF},
{0x0f000810, 0x0F95},
@@ -65,7 +66,8 @@ static struct bcm_ddr_setting asT3_DDRSetting133MHz[] = {  /* 
DPLL Clock Setting
 };
 /* 80Mhz */
 #define T3_SKIP_CLOCK_PROGRAM_DUMP_80MHZ 10  /* index for 0x0F007000 */
-static struct bcm_ddr_setting asT3_DDRSetting80MHz[] = {  /* DPLL Clock 
Setting */
+static struct bcm_ddr_setting asT3_DDRSetting80MHz[] = {
+  /* DPLL Clock Setting */
{0x0f000810, 0x0F95},
{0x0f000820, 0x07f1},
{0x0f000860, 0x},
@@ -117,7 +119,8 @@ static struct bcm_ddr_setting asT3_DDRSetting80MHz[] = {  
/* DPLL Clock Setting
 };
 /* 100Mhz */
 #define T3_SKIP_CLOCK_PROGRAM_DUMP_100MHZ 13  /* index for 0x0F007000 */
-static struct bcm_ddr_setting asT3_DDRSetting100MHz[] = {  /* DPLL Clock 
Setting */
+static struct bcm_ddr_setting asT3_DDRSetting100MHz[] = {
+  /* DPLL Clock Setting */
{0x0F000800, 0x7008},
{0x0f000810, 0x0F95},
{0x0f000820, 0x07F13E3F},
@@ -189,7 +192,8 @@ static struct bcm_ddr_setting asDPLL_266MHZ[] = {
 };
 
 #define T3B_SKIP_CLOCK_PROGRAM_DUMP_133MHZ 11  /* index for 0x0F007000 */
-static struct bcm_ddr_setting asT3B_DDRSetting133MHz[] = {  /* DPLL Clock 
Setting */
+static struct bcm_ddr_setting asT3B_DDRSetting133MHz[] = {
+  /* DPLL Clock Setting */
{0x0f000810, 0x0F95},
{0x0f000810, 0x0F95},
{0x0f000810, 0x0F95},
@@ -247,7 +251,8 @@ static struct bcm_ddr_setting asT3B_DDRSetting133MHz[] = {  
/* DPLL Clock Settin
};
 
 #define T3B_SKIP_CLOCK_PROGRAM_DUMP_80MHZ 9  /* index for 0x0F007000 */
-static struct bcm_ddr_setting asT3B_DDRSetting80MHz[] = {  /* DPLL Clock 
Setting */
+static struct bcm_ddr_setting asT3B_DDRSetting80MHz[] = {
+  /* DPLL Clock Setting */
{0x0f000810, 0x0F95},
{0x0f000820, 0x07F13FFF},
{0x0f000840, 0x0FFF1F00},
@@ -301,7 +306,8 @@ static struct bcm_ddr_setting asT3B_DDRSetting80MHz[] = {  
/* DPLL Clock Setting
 
 /* 100Mhz */
 #define T3B_SKIP_CLOCK_PROGRAM_DUMP_100MHZ 9  /* index for 0x0F007000 */
-static struct bcm_ddr_setting asT3B_DDRSetting100MHz[] = {  /* DPLL Clock 
Setting */
+static struct bcm_ddr_setting asT3B_DDRSetting100MHz[] = {
+  /* DPLL Clock Setting */
{0x0f000810, 0x0F95},
{0x0f000820, 0x07F1369B},
{0x0f000840, 0x0FFF0800},
@@ -356,7 +362,8 @@ static struct bcm_ddr_setting asT3B_DDRSetting100MHz[] = {  
/* DPLL Clock Settin
 
 
 #define T3LP_SKIP_CLOCK_PROGRAM_DUMP_133MHZ 9  /* index for 0x0F007000 */
-static struct bcm_ddr_setting asT3LP_DDRSetting133MHz[] = {  /* DPLL Clock 
Setting */
+static struct bcm_ddr_setting asT3LP_DDRSetting133MHz[] = {
+  /* DPLL Clock Setting */
{0x0f000820, 0x03F1365B},
{0x0f000810, 0x2F95},
{0x0f000880, 0x03DD},
@@ -416,7 +423,8 @@ static struct bcm_ddr_setting asT3LP_DDRSetting133MHz[] = { 
 /* DPLL Clock Setti
 };
 
 #define T3LP_SKIP_CLOCK_PROGRAM_DUMP_100MHZ 11  /* index for 0x0F007000 */
-static struct bcm_ddr_setting asT3LP_DDRSetting100MHz[] = {  /* DPLL Clock 
Setting */
+static struct bcm_ddr_setting asT3LP_DDRSetting100MHz[] = {
+  /* DPLL Clock Setting */
{0x0f000810, 0x2F95},
{0x0f000820, 0x03F1369B},
{0x0f000840, 0x0fff},
@@ -476,7 +484,8 @@ static struct bcm_ddr_setting asT3LP_DDRSetting100MHz[] = { 
 /* DPLL Clock Setti
 };
 
 #define T3LP_SKIP_CLOCK_PROGRAM_DUMP_80MHZ 9  /* index for 0x0F007000 */
-static struct bcm_ddr_setting asT3LP_DDRSetting80MHz[] = {  /* DPLL Clock 
Setting */
+static struct bcm_ddr_setting asT3LP_DDRSetting80MHz[] = {
+  /* DPLL Clock Setting */
{0x0f000820, 0x07F13FFF},
{0x0f000810, 0x2F95},
{0x0f000860, 0x},
@@ -536,7 +545,8 @@ static struct bcm_ddr_setting asT3LP_DDRSetting80MHz[] = {  
/* DPLL Clock Settin
 /* T3 LP-B (UMA-B) */
 
 #define T3LPB_SKIP_CLOCK_PROGRAM_DUMP_160MHZ 7  /* index for 0x0F007000 */
-static struct bcm_ddr_setting asT3LPB_DDRSetting160MHz[] = {  /* DPLL Clock 
Setting */
+static struct bcm_ddr_setting asT3LPB_DDRSetting160MHz[] = {
+  /* DPLL Clock Setting */
{0x0f000820, 0x03F137DB},
{0x0f000810, 0x01842795},
{0x0f000860, 0x},
@@ -544,7 +554,8 @@ static struct 

[PATCHv2] Staging: vt6655: remove redundant comments from card.h

2014-07-25 Thread Igor Bezukh
Removed redundant comments from card.h header file.

Signed-off-by: Igor Bezukh igb...@gmail.com
---
v2 changes: fixed diffstat output and fixed the
   diff itself.

 drivers/staging/vt6655/card.h |   10 +-
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/staging/vt6655/card.h b/drivers/staging/vt6655/card.h
index 829be92..443461d 100644
--- a/drivers/staging/vt6655/card.h
+++ b/drivers/staging/vt6655/card.h
@@ -32,7 +32,6 @@
 #include ttype.h
 #include linux/types.h
 
-/*-  Export Definitions -*/
 //
 // Loopback mode
 //
@@ -48,7 +47,7 @@
 #define DEFAULT_MGN_LIFETIME_RES_64us   125  // 64us
 
 #define CB_MAX_CHANNEL_24G  14
-#define CB_MAX_CHANNEL_5G   42 //[20050104] add channel9(5045MHz), 41==42
+#define CB_MAX_CHANNEL_5G   42
 #define CB_MAX_CHANNEL  (CB_MAX_CHANNEL_24G+CB_MAX_CHANNEL_5G)
 
 typedef enum _CARD_PHY_TYPE {
@@ -78,12 +77,6 @@ typedef enum _CARD_OP_MODE {
OP_MODE_UNKNOWN
 } CARD_OP_MODE, *PCARD_OP_MODE;
 
-/*-  Export Classes  */
-
-/*-  Export Variables  --*/
-
-/*-  Export Functions  --*/
-
 void CARDvSetRSPINF(void *pDeviceHandler, CARD_PHY_TYPE ePHYType);
 void vUpdateIFS(void *pDeviceHandler);
 void CARDvUpdateBasicTopRate(void *pDeviceHandler);
@@ -101,7 +94,6 @@ unsigned char CARDbyGetPktType(void *pDeviceHandler);
 void CARDvSafeResetTx(void *pDeviceHandler);
 void CARDvSafeResetRx(void *pDeviceHandler);
 
-//xxx
 bool CARDbRadioPowerOff(void *pDeviceHandler);
 bool CARDbRadioPowerOn(void *pDeviceHandler);
 bool CARDbIsShortPreamble(void *pDeviceHandler);
-- 
1.7.9.5

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


[PATCH] Staging: vt6655: removed redundant comments from channel.h

2014-07-25 Thread Igor Bezukh
Removed redundant comments from channel.h header file.

Signed-off-by: Igor Bezukh igb...@gmail.com
---
 drivers/staging/vt6655/channel.h |4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/vt6655/channel.h b/drivers/staging/vt6655/channel.h
index c9931d7..4f44c8a 100644
--- a/drivers/staging/vt6655/channel.h
+++ b/drivers/staging/vt6655/channel.h
@@ -26,8 +26,6 @@
 #include ttype.h
 #include card.h
 
-/*-  Export Classes  */
-
 typedef struct tagSChannelTblElement {
unsigned char byChannelNumber;
unsigned int uFrequency;
@@ -35,8 +33,6 @@ typedef struct tagSChannelTblElement {
unsigned char byMAP;
 } SChannelTblElement, *PSChannelTblElement;
 
-/*-  Export Functions  --*/
-
 bool is_channel_valid(unsigned int CountryCode);
 void init_channel_table(void *pDeviceHandler);
 unsigned char get_channel_mapping(void *pDeviceHandler, unsigned char 
byChannelNumber, CARD_PHY_TYPE ePhyType);
-- 
1.7.9.5

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


[PATCH] Staging: vt6655: removed redundant comments from country.h

2014-07-25 Thread Igor Bezukh
Removed redundant comments from country.h header file

Signed-off-by: Igor Bezukh igb...@gmail.com
---
 drivers/staging/vt6655/country.h |1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/vt6655/country.h b/drivers/staging/vt6655/country.h
index 415e767..2365fb1 100644
--- a/drivers/staging/vt6655/country.h
+++ b/drivers/staging/vt6655/country.h
@@ -32,7 +32,6 @@
 
 #include ttype.h
 
-/*-  Export Definitions -*/
 /
  * The definition here should be complied with the INF country order
  * Please check with VNWL.inf/VNWL64.inf/VNWL*.inf
-- 
1.7.9.5

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


[PATCH] Staging: vt6655: removed redundant comments from datarate.h

2014-07-25 Thread Igor Bezukh
Removed redundant comments from datarate.h header file.

Signed-off-by: Igor Bezukh igb...@gmail.com
---
 drivers/staging/vt6655/datarate.h |   28 +---
 1 file changed, 9 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/vt6655/datarate.h 
b/drivers/staging/vt6655/datarate.h
index e4fad05..0509c4f 100644
--- a/drivers/staging/vt6655/datarate.h
+++ b/drivers/staging/vt6655/datarate.h
@@ -29,25 +29,15 @@
 #ifndef __DATARATE_H__
 #define __DATARATE_H__
 
-/*-  Export Definitions -*/
-
-#define FALLBACK_PKT_COLLECT_TR_H  50   // pkts
-#define FALLBACK_PKT_COLLECT_TR_L  10   // pkts
-#define FALLBACK_POLL_SECOND   5// 5 sec
-#define FALLBACK_RECOVER_SECOND30   // 30 sec
-#define FALLBACK_THRESHOLD 15   // percent
-#define UPGRADE_THRESHOLD  5// percent
-#define UPGRADE_CNT_THRD   3// times
-#define RETRY_TIMES_THRD_H 2// times
-#define RETRY_TIMES_THRD_L 1// times
-
-/*-  Export Classes  */
-
-/*-  Export Variables  --*/
-
-/*-  Export Types  --*/
-
-/*-  Export Functions  --*/
+#define FALLBACK_PKT_COLLECT_TR_H  50
+#define FALLBACK_PKT_COLLECT_TR_L  10
+#define FALLBACK_POLL_SECOND   5
+#define FALLBACK_RECOVER_SECOND30
+#define FALLBACK_THRESHOLD 15
+#define UPGRADE_THRESHOLD  5
+#define UPGRADE_CNT_THRD   3
+#define RETRY_TIMES_THRD_H 2
+#define RETRY_TIMES_THRD_L 1
 
 void
 RATEvParseMaxRate(
-- 
1.7.9.5

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


[PATCH] Staging: vt6655: removed redundant comments from desc.h

2014-07-25 Thread Igor Bezukh
Removed redundant comments from desc.h header file.

Signed-off-by: Igor Bezukh igb...@gmail.com
C99 style comments will be fixed in further patches.
---
 drivers/staging/vt6655/desc.h |  185 +++--
 1 file changed, 87 insertions(+), 98 deletions(-)

diff --git a/drivers/staging/vt6655/desc.h b/drivers/staging/vt6655/desc.h
index c620cbfb..05efa4e 100644
--- a/drivers/staging/vt6655/desc.h
+++ b/drivers/staging/vt6655/desc.h
@@ -36,79 +36,77 @@
 #include ttype.h
 #include tether.h
 
-/*-  Export Definitions -*/
-
-#define B_OWNED_BY_CHIP 1   //
-#define B_OWNED_BY_HOST 0   //
+#define B_OWNED_BY_CHIP 1
+#define B_OWNED_BY_HOST 0
 
 //
 // Bits in the RSR register
 //
-#define RSR_ADDRBROAD   0x80// 1000 
-#define RSR_ADDRMULTI   0x40// 0100 
-#define RSR_ADDRUNI 0x00//  
-#define RSR_IVLDTYP 0x20// 0010  , invalid packet type
-#define RSR_IVLDLEN 0x10// 0001  , invalid len ( 2312 
byte)
-#define RSR_BSSIDOK 0x08//  1000
-#define RSR_CRCOK   0x04//  0100
-#define RSR_BCNSSIDOK   0x02//  0010
-#define RSR_ADDROK  0x01//  0001
+#define RSR_ADDRBROAD   0x80
+#define RSR_ADDRMULTI   0x40
+#define RSR_ADDRUNI 0x00
+#define RSR_IVLDTYP 0x20
+#define RSR_IVLDLEN 0x10// invalid len ( 2312 byte)
+#define RSR_BSSIDOK 0x08
+#define RSR_CRCOK   0x04
+#define RSR_BCNSSIDOK   0x02
+#define RSR_ADDROK  0x01
 
 //
 // Bits in the new RSR register
 //
-#define NEWRSR_DECRYPTOK0x10// 0001 
-#define NEWRSR_CFPIND   0x08//  1000
-#define NEWRSR_HWUTSF   0x04//  0100
-#define NEWRSR_BCNHITAID0x02//  0010
-#define NEWRSR_BCNHITAID0   0x01//  0001
+#define NEWRSR_DECRYPTOK0x10
+#define NEWRSR_CFPIND   0x08
+#define NEWRSR_HWUTSF   0x04
+#define NEWRSR_BCNHITAID0x02
+#define NEWRSR_BCNHITAID0   0x01
 
 //
 // Bits in the TSR0 register
 //
-#define TSR0_PWRSTS1_2  0xC0// 1100 
-#define TSR0_PWRSTS70x20// 0010 
-#define TSR0_NCR0x1F// 0001 
+#define TSR0_PWRSTS1_2  0xC0
+#define TSR0_PWRSTS70x20
+#define TSR0_NCR0x1F
 
 //
 // Bits in the TSR1 register
 //
-#define TSR1_TERR   0x80// 1000 
-#define TSR1_PWRSTS4_6  0x70// 0111 
-#define TSR1_RETRYTMO   0x08//  1000
-#define TSR1_TMO0x04//  0100
-#define TSR1_PWRSTS30x02//  0010
-#define ACK_DATA0x01//  
+#define TSR1_TERR   0x80
+#define TSR1_PWRSTS4_6  0x70
+#define TSR1_RETRYTMO   0x08
+#define TSR1_TMO0x04
+#define TSR1_PWRSTS30x02
+#define ACK_DATA0x01
 
 //
 // Bits in the TCR register
 //
-#define EDMSDU  0x04//  0100 end of sdu
-#define TCR_EDP 0x02//  0010 end of packet
-#define TCR_STP 0x01//  0001 start of packet
+#define EDMSDU  0x04// end of sdu
+#define TCR_EDP 0x02// end of packet
+#define TCR_STP 0x01// start of packet
 
 // max transmit or receive buffer size
-#define CB_MAX_BUF_SIZE 2900U   // max buffer size
+#define CB_MAX_BUF_SIZE 2900U
// NOTE: must be multiple of 4
-#define CB_MAX_TX_BUF_SIZE  CB_MAX_BUF_SIZE // max Tx buffer size
-#define CB_MAX_RX_BUF_SIZE_NORMAL   CB_MAX_BUF_SIZE // max Rx buffer size when 
not use Multi-RD
+#define CB_MAX_TX_BUF_SIZE  CB_MAX_BUF_SIZE
+#define CB_MAX_RX_BUF_SIZE_NORMAL   CB_MAX_BUF_SIZE
 
-#define CB_BEACON_BUF_SIZE  512U// default beacon buffer size
+#define CB_BEACON_BUF_SIZE  512U
 
-#define CB_MAX_RX_DESC  128 // max # of descriptor
-#define CB_MIN_RX_DESC  16  // min # of rx descriptor
-#define CB_MAX_TX_DESC  64  // max # of descriptor
-#define CB_MIN_TX_DESC  16  // min # of tx descriptor
+#define CB_MAX_RX_DESC  128
+#define CB_MIN_RX_DESC  16
+#define CB_MAX_TX_DESC  64
+#define CB_MIN_TX_DESC  16
 
-#define CB_MAX_RECEIVED_PACKETS 16  // max # of received packets at one 
time
+#define CB_MAX_RECEIVED_PACKETS 16
// limit our receive routine to 
indicating
// this many at a time for 2 reasons:
// 1. driver flow control to protocol 
layer
// 2. limit the time used in ISR routine
 
-#define CB_EXTRA_RD_NUM 32  // default # of Extra RD
-#define CB_RD_NUM   32  // default # of 

[PATCH] Staging: vt6655: removed redundant comments from device_cfg.h

2014-07-25 Thread Igor Bezukh
Removed redundant comments from device_cfg.h header file.

Signed-off-by: Igor Bezukh igb...@gmail.com
---
 drivers/staging/vt6655/device_cfg.h |3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/vt6655/device_cfg.h 
b/drivers/staging/vt6655/device_cfg.h
index 1137ade..6adc0dd 100644
--- a/drivers/staging/vt6655/device_cfg.h
+++ b/drivers/staging/vt6655/device_cfg.h
@@ -27,7 +27,6 @@
 #ifndef __DEVICE_CONFIG_H
 #define __DEVICE_CONFIG_H
 
-//#include linux/config.h
 #include linux/types.h
 
 #include ttype.h
@@ -60,14 +59,12 @@ struct _version {
 #define DEVICE_VERSION   1.19.12
 #endif
 
-//config file
 #include linux/fs.h
 #include linux/fcntl.h
 #ifndef CONFIG_PATH
 #define CONFIG_PATH/etc/vntconfiguration.dat
 #endif
 
-//Max: 2378=2312Payload + 30HD +4CRC + 2Padding + 4Len + 8TSF + 4RSR
 #define PKT_BUF_SZ  2390
 
 #define MAX_UINTS   8
-- 
1.7.9.5

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


[PATCH] Staging: vt6655: removed redundant comments from device.h

2014-07-25 Thread Igor Bezukh
Removed redundant comments from device.h header file.

Signed-off-by: Igor Bezukh igb...@gmail.com
---
 drivers/staging/vt6655/device.h |   82 ++-
 1 file changed, 21 insertions(+), 61 deletions(-)

diff --git a/drivers/staging/vt6655/device.h b/drivers/staging/vt6655/device.h
index 45fc8a0..201f5cd 100644
--- a/drivers/staging/vt6655/device.h
+++ b/drivers/staging/vt6655/device.h
@@ -49,7 +49,6 @@
 #include linux/sched.h
 #include linux/io.h
 #include linux/if.h
-//#include linux/config.h
 #include linux/uaccess.h
 #include linux/proc_fs.h
 #include linux/inetdevice.h
@@ -60,11 +59,9 @@
 #else
 #undef DEVICE_ETHTOOL_IOCTL_SUPPORT
 #endif
-/* Include Wireless Extension definition and check version - Jean II */
 #include linux/wireless.h
-#include net/iw_handler.h// New driver API
+#include net/iw_handler.h
 
-//2008-0409-07, Add by Einsn Liu
 #ifndef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
 #define WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
 #endif
@@ -86,8 +83,6 @@
 #include key.h
 #include mac.h
 
-/*-  Export Definitions -*/
-
 #define MAC_MAX_CONTEXT_REG (256+128)
 
 #define MAX_MULTICAST_ADDRESS_NUM   32
@@ -136,18 +131,12 @@
 // DMA related
 #define RESERV_AC0DMA   4
 
-// BUILD OBJ mode
-
 #defineAVAIL_TD(p, q)  ((p)-sOpts.nTxDescs[(q)] - ((p)-iTDUsed[(q)]))
 
-//PLICE_DEBUG -
 #defineNUM 64
-//PLICE_DEUBG -
 
 #define PRIVATE_Message 0
 
-/*-  Export Types  --*/
-
 #define DBG_PRT(l, p, args...) \
 do {   \
if (l = msglevel)  \
@@ -160,7 +149,6 @@ do {\
printk(p, ##args);  \
 } while (0)
 
-//0:11A 1:11B 2:11G
 typedef enum _VIA_BB_TYPE
 {
BB_TYPE_11A = 0,
@@ -168,7 +156,6 @@ typedef enum _VIA_BB_TYPE
BB_TYPE_11G
 } VIA_BB_TYPE, *PVIA_BB_TYPE;
 
-//0:11a,1:11b,2:11gb(only CCK in BasicRate),3:11ga(OFDM in Basic Rate)
 typedef enum _VIA_PKT_TYPE
 {
PK_TYPE_11A = 0,
@@ -178,21 +165,19 @@ typedef enum _VIA_PKT_TYPE
 } VIA_PKT_TYPE, *PVIA_PKT_TYPE;
 
 typedef enum __device_msg_level {
-   MSG_LEVEL_ERR = 0,//Errors that will cause abnormal 
operation.
-   MSG_LEVEL_NOTICE = 1, //Some errors need users to be notified.
-   MSG_LEVEL_INFO = 2,   //Normal message.
-   MSG_LEVEL_VERBOSE = 3,//Will report all trival errors.
-   MSG_LEVEL_DEBUG = 4   //Only for debug purpose.
+   MSG_LEVEL_ERR = 0,
+   MSG_LEVEL_NOTICE = 1,
+   MSG_LEVEL_INFO = 2,
+   MSG_LEVEL_VERBOSE = 3,
+   MSG_LEVEL_DEBUG = 4
 } DEVICE_MSG_LEVEL, *PDEVICE_MSG_LEVEL;
 
 typedef enum __device_init_type {
-   DEVICE_INIT_COLD = 0, // cold init
-   DEVICE_INIT_RESET,  // reset init or Dx to D0 power remain init
-   DEVICE_INIT_DXPL// Dx to D0 power lost init
+   DEVICE_INIT_COLD = 0,
+   DEVICE_INIT_RESET,
+   DEVICE_INIT_DXPL
 } DEVICE_INIT_TYPE, *PDEVICE_INIT_TYPE;
 
-//++ NDIS related
-
 #define MAX_BSSIDINFO_4_PMKID   16
 #define MAX_PMKIDLIST   5
 //Flags for PMKID Candidate list structure
@@ -246,14 +231,11 @@ typedef struct tagSPMKID {
 
 typedef struct tagSPMKIDCandidateEvent {
NDIS_802_11_STATUS_TYPE StatusType;
-   unsigned long Version;   // Version of the structure
-   unsigned long NumCandidates; // No. of pmkid candidates
+   unsigned long Version;
+   unsigned long NumCandidates;
PMKID_CANDIDATE CandidateList[MAX_PMKIDLIST];
 } SPMKIDCandidateEvent, *PSPMKIDCandidateEvent;
 
-//--
-
-//++ 802.11h related
 #define MAX_QUIET_COUNT 8
 
 typedef struct tagSQuietControl {
@@ -263,7 +245,6 @@ typedef struct tagSQuietControl {
unsigned short wDuration;
 } SQuietControl, *PSQuietControl;
 
-//--
 typedef struct __chip_info_tbl {
CHIP_TYPE   chip_id;
char *name;
@@ -287,7 +268,7 @@ typedef struct tagSCache {
 /* The receive cache is updated circularly.  The next entry to be written is
  * indexed by the InPtr.
  */
-   unsigned int uInPtr; // Place to use next
+   unsigned int uInPtr;
SCacheEntry asCacheEntry[DUPLICATE_RX_CACHE_LENGTH];
 } SCache, *PSCache;
 
@@ -332,8 +313,6 @@ typedef struct tagSDeFragControlBlock
 //for device_set_media_duplex
 #define DEVICE_LINK_CHANGE   0x0001UL
 
-//PLICE_DEBUG-
-
 typedefstruct _RxManagementQueue
 {
int packet_num;
@@ -341,14 +320,12 @@ typedef   struct _RxManagementQueue
PSRxMgmtPacket  Q[NUM];
 } RxManagementQueue, *PSRxManagementQueue;
 
-//PLICE_DEBUG-
-
 typedef struct __device_opt {
-   int nRxDescs0;//Number of RX descriptors0
-   int nRxDescs1;//Number of RX descriptors1
-   int nTxDescs[2];  //Number of TX descriptors 0, 1

[PATCH] Staging: vt6655: removed redundant comments from dpc.h

2014-07-25 Thread Igor Bezukh
Removed redundant comments from dpc.h header file.

Signed-off-by: Igor Bezukh igb...@gmail.com
---
 drivers/staging/vt6655/dpc.h |8 
 1 file changed, 8 deletions(-)

diff --git a/drivers/staging/vt6655/dpc.h b/drivers/staging/vt6655/dpc.h
index 0ce3155..0c7e0e7 100644
--- a/drivers/staging/vt6655/dpc.h
+++ b/drivers/staging/vt6655/dpc.h
@@ -33,14 +33,6 @@
 #include device.h
 #include wcmd.h
 
-/*-  Export Definitions -*/
-
-/*-  Export Classes  */
-
-/*-  Export Variables  --*/
-
-/*-  Export Functions  --*/
-
 bool
 device_receive_frame(
PSDevice pDevice,
-- 
1.7.9.5

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


[PATCH] Staging: vt6655: removed redundant comments from hostap.h

2014-07-25 Thread Igor Bezukh
Removed redundant comments from hostap.h header file.

Signed-off-by: Igor Bezukh igb...@gmail.com
---
 drivers/staging/vt6655/hostap.h |8 
 1 file changed, 8 deletions(-)

diff --git a/drivers/staging/vt6655/hostap.h b/drivers/staging/vt6655/hostap.h
index f1a4f2ef..6e801a4 100644
--- a/drivers/staging/vt6655/hostap.h
+++ b/drivers/staging/vt6655/hostap.h
@@ -31,8 +31,6 @@
 
 #include device.h
 
-/*-  Export Definitions -*/
-
 #define WLAN_RATE_1MBIT0
 #define WLAN_RATE_2MBIT1
 #define WLAN_RATE_5M5   BIT2
@@ -46,12 +44,6 @@
 #define WLAN_RATE_48M   BIT10
 #define WLAN_RATE_54M   BIT11
 
-/*-  Export Classes  */
-
-/*-  Export Variables  --*/
-
-/*-  Export Functions  --*/
-
 #ifndef ETH_P_PAE
 #define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */
 #endif /* ETH_P_PAE */
-- 
1.7.9.5

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


[PATCH] Staging: vt6655: removed redundant comments from IEEE11h.h

2014-07-25 Thread Igor Bezukh
Removed redundant comments from IEEE11h.h header file.

Signed-off-by: Igor Bezukh igb...@gmail.com
---
 drivers/staging/vt6655/IEEE11h.h |   10 --
 1 file changed, 10 deletions(-)

diff --git a/drivers/staging/vt6655/IEEE11h.h b/drivers/staging/vt6655/IEEE11h.h
index 8819fa1..5519220 100644
--- a/drivers/staging/vt6655/IEEE11h.h
+++ b/drivers/staging/vt6655/IEEE11h.h
@@ -35,16 +35,6 @@
 #include 80211hdr.h
 #include 80211mgr.h
 
-/*-  Export Definitions -*/
-
-/*-  Export Classes  */
-
-/*-  Export Variables  --*/
-
-/*-  Export Types  --*/
-
-/*-  Export Functions  --*/
-
 bool IEEE11hbMSRRepTx(
void *pMgmtHandle
 );
-- 
1.7.9.5

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


[PATCH] Staging: vt6655: removed redundant comments from iocmd.h

2014-07-25 Thread Igor Bezukh
Removed redundant comments from iocmd.h header file.

Signed-off-by: Igor Bezukh igb...@gmail.com
---
 drivers/staging/vt6655/iocmd.h |   23 +--
 1 file changed, 1 insertion(+), 22 deletions(-)

diff --git a/drivers/staging/vt6655/iocmd.h b/drivers/staging/vt6655/iocmd.h
index e499f1b..ae037ec 100644
--- a/drivers/staging/vt6655/iocmd.h
+++ b/drivers/staging/vt6655/iocmd.h
@@ -31,12 +31,6 @@
 
 #include ttype.h
 
-/*-  Export Definitions -*/
-
-//typedef uint32_t u32;
-//typedef uint16_t u16;
-//typedef uint8_t u8;
-
 // ioctl Command code
 #define MAGIC_CODE  0x3142
 #define IOCTL_CMD_TEST (SIOCDEVPRIVATE + 0)
@@ -167,10 +161,6 @@ typedef struct tagSBSSIDItem {
u32 uChannel;
u8  abyBSSID[BSSID_LEN];
u8  abySSID[SSID_MAXLEN + 1];
-   //2006-1116-01,Modify by NomadZhao
-   //u16   wBeaconInterval;
-   //u16   wCapInfo;
-   //u8  byNetType;
u8  byNetType;
u16 wBeaconInterval;
u16 wCapInfo;// for address of byNetType at align 4
@@ -228,9 +218,8 @@ typedef struct tagSStatMIBCount {
u32   dwIsrUnrecoverableError;
u32   dwIsrSoftInterrupt;
u32   dwIsrRxNoBuf;
-   /
 
-   u32   dwIsrUnknown;   // unknown interrupt count
+   u32   dwIsrUnknown;
 
// RSR status count
//
@@ -349,7 +338,6 @@ typedef struct tagSCmdValue {
 // hostapd  viawget ioctl related
 //
 
-// VIAGWET_IOCTL_HOSTAPD ioctl() cmd:
 enum {
VIAWGET_HOSTAPD_FLUSH = 1,
VIAWGET_HOSTAPD_ADD_STA = 2,
@@ -415,15 +403,6 @@ struct viawget_hostapd_param {
} u;
 };
 
-//2006-1116-01,Add by NomadZhao
 #pragma pack()
 
-/*-  Export Classes  */
-
-/*-  Export Variables  --*/
-
-/*-  Export Types  --*/
-
-/*-  Export Functions  --*/
-
 #endif //__IOCMD_H__
-- 
1.7.9.5

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


[PATCH] Staging: vt6655: removed redundant comments from ioctl.h

2014-07-25 Thread Igor Bezukh
Removed redundant comments from ioctl.h header file.

Signed-off-by: Igor Bezukh igb...@gmail.com
---
 drivers/staging/vt6655/ioctl.h |8 
 1 file changed, 8 deletions(-)

diff --git a/drivers/staging/vt6655/ioctl.h b/drivers/staging/vt6655/ioctl.h
index 2f0db92..187fc91 100644
--- a/drivers/staging/vt6655/ioctl.h
+++ b/drivers/staging/vt6655/ioctl.h
@@ -31,14 +31,6 @@
 
 #include device.h
 
-/*-  Export Definitions -*/
-
-/*-  Export Classes  */
-
-/*-  Export Variables  --*/
-
-/*-  Export Functions  --*/
-
 int private_ioctl(PSDevice pDevice, struct ifreq *rq);
 
 #endif // __IOCTL_H__
-- 
1.7.9.5

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


[PATCH] Staging: vt6655: removed redundant comments from iowpa.h

2014-07-25 Thread Igor Bezukh
Removed redundant comments from iowpa.h header file.

Signed-off-by: Igor Bezukh igb...@gmail.com
---
 drivers/staging/vt6655/iowpa.h |   10 --
 1 file changed, 10 deletions(-)

diff --git a/drivers/staging/vt6655/iowpa.h b/drivers/staging/vt6655/iowpa.h
index b7bd190..772bc4c 100644
--- a/drivers/staging/vt6655/iowpa.h
+++ b/drivers/staging/vt6655/iowpa.h
@@ -29,8 +29,6 @@
 #ifndef __IOWPA_H__
 #define __IOWPA_H__
 
-/*-  Export Definitions -*/
-
 #define WPA_IE_LEN 64
 
 //WPA related
@@ -127,14 +125,6 @@ struct viawget_scan_result {
int maxrate;
 };
 
-//2006-1116-01,Add by NomadZhao
 #pragma pack()
-/*-  Export Classes  */
-
-/*-  Export Variables  --*/
-
-/*-  Export Types  --*/
-
-/*-  Export Functions  --*/
 
 #endif //__IOWPA_H__
-- 
1.7.9.5

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


[PATCH] Staging: vt6655: removed redundant comments from iwctl.h

2014-07-25 Thread Igor Bezukh
Removed redundant comments from iwctl.h header file.

Signed-off-by: Igor Bezukh igb...@gmail.com
---
 drivers/staging/vt6655/iwctl.h |   12 +---
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/staging/vt6655/iwctl.h b/drivers/staging/vt6655/iwctl.h
index 871bd7c..83a5a2d 100644
--- a/drivers/staging/vt6655/iwctl.h
+++ b/drivers/staging/vt6655/iwctl.h
@@ -31,14 +31,6 @@
 
 #include device.h
 
-/*-  Export Definitions -*/
-
-/*-  Export Classes  */
-
-/*-  Export Variables  --*/
-
-/*-  Export Functions  --*/
-
 struct iw_statistics *iwctl_get_wireless_stats(struct net_device *dev);
 
 int iwctl_siwap(struct net_device *dev,
@@ -171,7 +163,6 @@ int iwctl_siwscan(struct net_device *dev,
  struct iw_param *wrq,
  char *extra);
 
-//2008-0409-07, Add by Einsn Liu
 #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
 int iwctl_siwauth(struct net_device *dev,
  struct iw_request_info *info,
@@ -207,8 +198,7 @@ int iwctl_siwmlme(struct net_device *dev,
  struct iw_request_info *info,
  struct iw_point *wrq,
  char *extra);
-#endif // #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
-//End Add -- //2008-0409-07, Add by Einsn Liu
+#endif
 
 extern const struct iw_handler_def iwctl_handler_def;
 extern const struct iw_priv_args   iwctl_private_args;
-- 
1.7.9.5

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


[PATCH] Staging: vt6655: removed redundant comments from key.h

2014-07-25 Thread Igor Bezukh
Removed redundant comments from key.h header file.

Signed-off-by: Igor Bezukh igb...@gmail.com
---
 drivers/staging/vt6655/key.h |   26 +++---
 1 file changed, 7 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/vt6655/key.h b/drivers/staging/vt6655/key.h
index 4b8b4b6..f0cbd75 100644
--- a/drivers/staging/vt6655/key.h
+++ b/drivers/staging/vt6655/key.h
@@ -34,7 +34,6 @@
 #include tether.h
 #include 80211mgr.h
 
-/*-  Export Definitions -*/
 #define MAX_GROUP_KEY   4
 #define MAX_KEY_TABLE   11
 #define MAX_KEY_LEN 32
@@ -65,38 +64,27 @@ typedef struct tagSKeyItem
unsigned char byReserved0;
unsigned long dwKeyIndex;
void *pvKeyTable;
-} SKeyItem, *PSKeyItem; //64
+} SKeyItem, *PSKeyItem;
 
 typedef struct tagSKeyTable
 {
-   unsigned char abyBSSID[ETH_ALEN];  //6
-   unsigned char byReserved0[2];  //8
+   unsigned char abyBSSID[ETH_ALEN];
+   unsigned char byReserved0[2];
SKeyItemPairwiseKey;
-   SKeyItemGroupKey[MAX_GROUP_KEY]; //64*5 = 320, 320+8=328
-   unsigned long dwGTKeyIndex;// GroupTransmitKey Index
+   SKeyItemGroupKey[MAX_GROUP_KEY];
+   unsigned long dwGTKeyIndex;
bool bInUse;
-   //2006-1116-01,Modify by NomadZhao
bool bSoftWEP;
-   unsigned short wKeyCtl;  // for address of wKeyCtl at align 4
+   unsigned short wKeyCtl;
 
unsigned char byReserved1[6];
-} SKeyTable, *PSKeyTable; //348
+} SKeyTable, *PSKeyTable;
 
 typedef struct tagSKeyManagement
 {
SKeyTable   KeyTable[MAX_KEY_TABLE];
 } SKeyManagement, *PSKeyManagement;
 
-/*-  Export Types  --*/
-
-/*-  Export Macros --*/
-
-/*-  Export Classes  */
-
-/*-  Export Variables  --*/
-
-/*-  Export Functions  --*/
-
 void KeyvInitTable(PSKeyManagement pTable, unsigned long dwIoBase);
 
 bool KeybGetKey(
-- 
1.7.9.5

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


[PATCH] Staging: vt6655: removed redundant comments from mac.h

2014-07-25 Thread Igor Bezukh
Removed redundant comments from mac.h header file.

Signed-off-by: Igor Bezukh igb...@gmail.com
---
 drivers/staging/vt6655/mac.h |  388 --
 1 file changed, 188 insertions(+), 200 deletions(-)

diff --git a/drivers/staging/vt6655/mac.h b/drivers/staging/vt6655/mac.h
index 7333b8b..e417742 100644
--- a/drivers/staging/vt6655/mac.h
+++ b/drivers/staging/vt6655/mac.h
@@ -38,7 +38,6 @@
 #include tmacro.h
 #include upc.h
 
-/*-  Export Definitions -*/
 //
 // Registers in the MAC
 //
@@ -72,14 +71,14 @@
 #define MAC_REG_TMCTL1  0x19
 #define MAC_REG_TMDATA0 0x1C
 // MAC Parameter related
-#define MAC_REG_LRT 0x20//
-#define MAC_REG_SRT 0x21//
-#define MAC_REG_SIFS0x22//
-#define MAC_REG_DIFS0x23//
-#define MAC_REG_EIFS0x24//
-#define MAC_REG_SLOT0x25//
-#define MAC_REG_BI  0x26//
-#define MAC_REG_CWMAXMIN0   0x28//
+#define MAC_REG_LRT 0x20
+#define MAC_REG_SRT 0x21
+#define MAC_REG_SIFS0x22
+#define MAC_REG_DIFS0x23
+#define MAC_REG_EIFS0x24
+#define MAC_REG_SLOT0x25
+#define MAC_REG_BI  0x26
+#define MAC_REG_CWMAXMIN0   0x28
 #define MAC_REG_LINKOFFTOTM 0x2A
 #define MAC_REG_SWTMOT  0x2B
 #define MAC_REG_MIBCNTR 0x2C
@@ -88,25 +87,25 @@
 #define MAC_REG_ACKFAILCNT  0x2E
 #define MAC_REG_FCSERRCNT   0x2F
 // TSF Related
-#define MAC_REG_TSFCNTR 0x30//
-#define MAC_REG_NEXTTBTT0x38//
-#define MAC_REG_TSFOFST 0x40//
-#define MAC_REG_TFTCTL  0x48//
+#define MAC_REG_TSFCNTR 0x30
+#define MAC_REG_NEXTTBTT0x38
+#define MAC_REG_TSFOFST 0x40
+#define MAC_REG_TFTCTL  0x48
 // WMAC Control/Status Related
-#define MAC_REG_ENCFG   0x4C//
-#define MAC_REG_PAGE1SEL0x4F//
-#define MAC_REG_CFG 0x50//
-#define MAC_REG_TEST0x52//
-#define MAC_REG_HOSTCR  0x54//
-#define MAC_REG_MACCR   0x55//
-#define MAC_REG_RCR 0x56//
-#define MAC_REG_TCR 0x57//
-#define MAC_REG_IMR 0x58//
+#define MAC_REG_ENCFG   0x4C
+#define MAC_REG_PAGE1SEL0x4F
+#define MAC_REG_CFG 0x50
+#define MAC_REG_TEST0x52
+#define MAC_REG_HOSTCR  0x54
+#define MAC_REG_MACCR   0x55
+#define MAC_REG_RCR 0x56
+#define MAC_REG_TCR 0x57
+#define MAC_REG_IMR 0x58
 #define MAC_REG_ISR 0x5C
 // Power Saving Related
-#define MAC_REG_PSCFG   0x60//
-#define MAC_REG_PSCTL   0x61//
-#define MAC_REG_PSPWRSIG0x62//
+#define MAC_REG_PSCFG   0x60
+#define MAC_REG_PSCTL   0x61
+#define MAC_REG_PSPWRSIG0x62
 #define MAC_REG_BBCR13  0x63
 #define MAC_REG_AIDATIM 0x64
 #define MAC_REG_PWBT0x66
@@ -115,30 +114,30 @@
 #define MAC_REG_SYNSPACCNT  0x6A
 #define MAC_REG_WAKSYNOPT   0x6B
 // Baseband/IF Control Group
-#define MAC_REG_BBREGCTL0x6C//
+#define MAC_REG_BBREGCTL0x6C
 #define MAC_REG_CHANNEL 0x6D
 #define MAC_REG_BBREGADR0x6E
 #define MAC_REG_BBREGDATA   0x6F
-#define MAC_REG_IFREGCTL0x70//
-#define MAC_REG_IFDATA  0x71//
-#define MAC_REG_ITRTMSET0x74//
+#define MAC_REG_IFREGCTL0x70
+#define MAC_REG_IFDATA  0x71
+#define MAC_REG_ITRTMSET0x74
 #define MAC_REG_PAPEDELAY   0x77
-#define MAC_REG_SOFTPWRCTL  0x78//
-#define MAC_REG_GPIOCTL00x7A//
-#define MAC_REG_GPIOCTL10x7B//
+#define MAC_REG_SOFTPWRCTL  0x78
+#define MAC_REG_GPIOCTL00x7A
+#define MAC_REG_GPIOCTL10x7B
 
 // MAC DMA Related Group
-#define MAC_REG_TXDMACTL0   0x7C//
-#define MAC_REG_TXDMAPTR0   0x80//
-#define MAC_REG_AC0DMACTL   0x84//
-#define MAC_REG_AC0DMAPTR   0x88//
-#define MAC_REG_BCNDMACTL   0x8C//
-#define MAC_REG_BCNDMAPTR   0x90//
-#define MAC_REG_RXDMACTL0   0x94//
-#define MAC_REG_RXDMAPTR0   0x98//
-#define MAC_REG_RXDMACTL1   0x9C//
-#define MAC_REG_RXDMAPTR1   0xA0//
-#define MAC_REG_SYNCDMACTL  0xA4//
+#define MAC_REG_TXDMACTL0   0x7C
+#define MAC_REG_TXDMAPTR0   0x80
+#define MAC_REG_AC0DMACTL   0x84
+#define MAC_REG_AC0DMAPTR   0x88
+#define MAC_REG_BCNDMACTL   0x8C
+#define MAC_REG_BCNDMAPTR   0x90
+#define MAC_REG_RXDMACTL0   0x94
+#define MAC_REG_RXDMAPTR0   0x98
+#define MAC_REG_RXDMACTL1   0x9C
+#define MAC_REG_RXDMAPTR1   0xA0
+#define MAC_REG_SYNCDMACTL  0xA4
 #define MAC_REG_SYNCDMAPTR  0xA8
 #define MAC_REG_ATIMDMACTL  0xAC
 #define MAC_REG_ATIMDMAPTR  0xB0
@@ -158,7 +157,6 @@
 #define MAC_REG_WAKE128_2   0xE4
 #define MAC_REG_WAKE128_3   0xF4
 
-/// Page 1 ///
 #define MAC_REG_CRC_128_0   0x04
 #define MAC_REG_CRC_128_1   0x06
 #define MAC_REG_CRC_128_2   0x08
@@ -219,20 +217,20 

RE: [PATCH v2 3/3] [SCSI] Make LBP quirk skip lbpme checks tests

2014-07-25 Thread KY Srinivasan


 -Original Message-
 From: Martin K. Petersen [mailto:martin.peter...@oracle.com]
 Sent: Thursday, July 24, 2014 8:54 AM
 To: Sitsofe Wheeler
 Cc: Martin K. Petersen; Christoph Hellwig; KY Srinivasan;
 gre...@linuxfoundation.org; linux-ker...@vger.kernel.org;
 de...@linuxdriverproject.org; oher...@suse.com; a...@canonical.com;
 jasow...@redhat.com; jbottom...@parallels.com; linux-
 s...@vger.kernel.org
 Subject: Re: [PATCH v2 3/3] [SCSI] Make LBP quirk skip lbpme checks tests
 
  Sitsofe == Sitsofe Wheeler sits...@gmail.com writes:
 
 Sitsofe So we can see it is really a SATA device that announces discard
 Sitsofe correctly and supports discard through WRITE_SAME(16).
 
 No, that's the SATA device that announces support for DSM TRIM, and as a
 result the Linux SATL reports support for WRITE SAME(16) w. the UNMAP bit
 set and LBPME.
 
 Sitsofe It is the act of passing it through Hyper-V that turned it into
 Sitsofe a SCSI device that supports UNMAP (but not WRITE_SAME(16)),
 Sitsofe doesn't announce its SCSI conformance number and doesn't
 Sitsofe correctly announce which features it supports. Surely in this
 Sitsofe case it's reasonable to quirk our way around the problem?
 
 No. That's an issue in Hyper-V that'll you'll have to take up with Microsoft. 
 I
 don't know what their passthrough limitations are for SCSI-ATA translation.
 Maybe K. Y. has some insight into this?

For the pass through case, the host validates the request and passes the 
request to the device.
However, not all scsi commands are passed through even though the device it is 
being passed through
may support the command. WRITE_SAME is one such command. Consequently, in the 
EVPD page,
we will set state indicating that WRITE_SAME is not supported (even if the 
device supports it).

Hope this helps.

K. Y 
 
 There must be a reason why the VPD page was added and yet the device not
 flagged as LBPME=1.
 
 Many vendors do not support UNMAP/WRITE SAME to DSM TRIM
 translation.
 Additionally, many vendors explicitly only whitelist drives that are known to
 be working correctly. Your drive is an ADATA and therefore very likely to be
 blacklisted by default by a vendor SATL.
 
 --
 Martin K. PetersenOracle Linux Engineering
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: dgnc: remove commented code

2014-07-25 Thread Seunghun Lee
This patch removes commented code in dgnc driver.

CC: Lidza Louina lidza.lou...@gmail.com
CC: Mark Hounschell ma...@compro.net
Signed-off-by: Seunghun Lee way...@gmail.com
---
 drivers/staging/dgnc/dgnc_cls.c   |5 +-
 drivers/staging/dgnc/dgnc_trace.c |  123 -
 drivers/staging/dgnc/dgnc_trace.h |   10 ---
 drivers/staging/dgnc/dgnc_tty.c   |   18 --
 drivers/staging/dgnc/digi.h   |1 -
 5 files changed, 1 insertion(+), 156 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c
index 8e265c2..4b65306 100644
--- a/drivers/staging/dgnc/dgnc_cls.c
+++ b/drivers/staging/dgnc/dgnc_cls.c
@@ -1046,10 +1046,7 @@ static void cls_flush_uart_read(struct channel_t *ch)
 * I believe this is a BUG in this UART.
 * So for now, we will leave the code #ifdef'ed out...
 */
-#if 0
-   writeb((UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR),
-ch-ch_cls_uart-isr_fcr);
-#endif
+
udelay(10);
 }
 
diff --git a/drivers/staging/dgnc/dgnc_trace.c 
b/drivers/staging/dgnc/dgnc_trace.c
index 2f62f2a..d764154 100644
--- a/drivers/staging/dgnc/dgnc_trace.c
+++ b/drivers/staging/dgnc/dgnc_trace.c
@@ -50,129 +50,6 @@ static int dgnc_trcbufi = 0;/* index of the 
tilde at the end of */
 static DEFINE_SPINLOCK(dgnc_tracef_lock);
 #endif
 
-
-#if 0
-
-#if !defined(TRC_TO_KMEM)  !defined(TRC_TO_CONSOLE)
-
-void dgnc_tracef(const char *fmt, ...)
-{
-   return;
-}
-
-#else /* !defined(TRC_TO_KMEM)  !defined(TRC_TO_CONSOLE) */
-
-void dgnc_tracef(const char *fmt, ...)
-{
-   va_list ap;
-   charbuf[TRC_MAXMSG+1];
-   size_t  lenbuf;
-   int i;
-   static int  failed = FALSE;
-# if defined(TRC_TO_KMEM)
-   unsigned longflags;
-#endif
-
-   if (failed)
-   return;
-# if defined(TRC_TO_KMEM)
-   DGNC_LOCK(dgnc_tracef_lock, flags);
-#endif
-
-   /* Format buf using fmt and arguments contained in ap. */
-   va_start(ap, fmt);
-   i = vsprintf(buf, fmt,  ap);
-   va_end(ap);
-   lenbuf = strlen(buf);
-
-# if defined(TRC_TO_KMEM)
-   {
-   static int   initd = 0;
-
-   /*
-* Now, in addition to (or instead of) printing this stuff out
-* (which is a buffered operation), also tuck it away into a
-* corner of memory which can be examined post-crash in kdb.
-*/
-   if (!initd) {
-   dgnc_trcbuf = (char *) vmalloc(dgnc_trcbuf_size);
-   if (!dgnc_trcbuf) {
-   failed = TRUE;
-   printk(dgnc: tracing init failed!\n);
-   return;
-   }
-
-   memset(dgnc_trcbuf, '\0',  dgnc_trcbuf_size);
-   dgnc_trcbufi = 0;
-   initd++;
-
-   printk(dgnc: tracing enabled -  TRC_DTRC
-0x%lx 0x%x\n,
-   (unsigned long)dgnc_trcbuf,
-   dgnc_trcbuf_size);
-   }
-
-#  if defined(TRC_ON_OVERFLOW_WRAP_AROUND)
-   /*
-* This is the less CPU-intensive way to do things.  We simply
-* wrap around before we fall off the end of the buffer.  A
-* tilde (~) demarcates the current end of the trace.
-*
-* This method should be used if you are concerned about race
-* conditions as it is less likely to affect the timing of
-* things.
-*/
-
-   if (dgnc_trcbufi + lenbuf = dgnc_trcbuf_size) {
-   /* We are wrapping, so wipe out the last tilde. */
-   dgnc_trcbuf[dgnc_trcbufi] = '\0';
-   /* put the new string at the beginning of the buffer */
-   dgnc_trcbufi = 0;
-   }
-
-   strcpy(dgnc_trcbuf[dgnc_trcbufi], buf);
-   dgnc_trcbufi += lenbuf;
-   dgnc_trcbuf[dgnc_trcbufi] = '~';
-
-#  elif defined(TRC_ON_OVERFLOW_SHIFT_BUFFER)
-   /*
-* This is the more CPU-intensive way to do things.  If we
-* venture into the last 1/8 of the buffer, we shift the
-* last 7/8 of the buffer forward, wiping out the first 1/8.
-* Advantage: No wrap-around, only truncation from the
-* beginning.
-*
-* This method should not be used if you are concerned about
-* timing changes affecting the behaviour of the driver (ie,
-* race conditions).
-*/
-   strcpy(dgnc_trcbuf[dgnc_trcbufi], buf);
-   dgnc_trcbufi += lenbuf;
-   

[PATCH] Staging: vt6655: removed redundant comments from mib.h

2014-07-25 Thread Igor Bezukh
Removed redundant comments from mib.h header file.

Signed-off-by: Igor Bezukh igb...@gmail.com
---
 drivers/staging/vt6655/mib.h |   45 +++---
 1 file changed, 16 insertions(+), 29 deletions(-)

diff --git a/drivers/staging/vt6655/mib.h b/drivers/staging/vt6655/mib.h
index c0a5948..732bdda 100644
--- a/drivers/staging/vt6655/mib.h
+++ b/drivers/staging/vt6655/mib.h
@@ -33,13 +33,12 @@
 #include tether.h
 #include desc.h
 
-/*-  Export Definitions -*/
 //
 // 802.11 counter
 //
 
 typedef struct tagSDot11Counters {
-   unsigned long Length; // Length of structure
+   unsigned long Length;
unsigned long long   TransmittedFragmentCount;
unsigned long long   MulticastTransmittedFrameCount;
unsigned long long   FailedCount;
@@ -68,8 +67,7 @@ typedef struct tagSDot11Counters {
 //
 typedef struct tagSMib2Counter {
longifIndex;
-   charifDescr[256];   // max size 255 plus zero ending
-   // e.g. interface 1
+   charifDescr[256];
longifType;
longifMtu;
unsigned long ifSpeed;
@@ -93,12 +91,12 @@ typedef struct tagSMib2Counter {
 } SMib2Counter, *PSMib2Counter;
 
 // Value in the ifType entry
-#define WIRELESSLANIEEE80211b  6   //
+#define WIRELESSLANIEEE80211b  6
 
 // Value in the ifAdminStatus/ifOperStatus entry
-#define UP  1   //
-#define DOWN2   //
-#define TESTING 3   //
+#define UP  1
+#define DOWN2
+#define TESTING 3
 
 //
 // RMON counter
@@ -182,7 +180,7 @@ typedef struct tagSISRCounters {
unsigned long dwIsrMIBNearfull;
unsigned long dwIsrRxNoBuf;
 
-   unsigned long dwIsrUnknown;   // unknown interrupt count
+   unsigned long dwIsrUnknown;
 
unsigned long dwIsrRx1OK;
unsigned long dwIsrATIMTxOK;
@@ -191,23 +189,18 @@ typedef struct tagSISRCounters {
unsigned long dwIsrATIMEnd;
unsigned long dwIsrSYNCFlushOK;
unsigned long dwIsrSTIMER1Int;
-   /
 } SISRCounters, *PSISRCounters;
 
 // Value in the etherStatsStatus entry
-#define VALID   1   //
-#define CREATE_REQUEST  2   //
-#define UNDER_CREATION  3   //
-#define INVALID 4   //
+#define VALID   1
+#define CREATE_REQUEST  2
+#define UNDER_CREATION  3
+#define INVALID 4
 
 //
 // statistic counter
 //
 typedef struct tagSStatCounter {
-   //
-   // ISR status count
-   //
-
// RSR status count
//
unsigned long dwRsrFrmAlgnErr;
@@ -306,24 +299,18 @@ typedef struct tagSStatCounter {
 
 #ifdef Calcu_LinkQual
//Tx count:
-   unsigned long TxNoRetryOkCount; //success tx no retry !
-   unsigned long TxRetryOkCount;  //success tx but retry !
-   unsigned long TxFailCount;  //fail tx ?
+   unsigned long TxNoRetryOkCount;
+   unsigned long TxRetryOkCount;
+   unsigned long TxFailCount;
//Rx count:
-   unsigned long RxOkCnt;  //success rx !
-   unsigned long RxFcsErrCnt;//fail rx ?
+   unsigned long RxOkCnt;
+   unsigned long RxFcsErrCnt;
//statistic
unsigned long SignalStren;
unsigned long LinkQuality;
 #endif
 } SStatCounter, *PSStatCounter;
 
-/*-  Export Classes  */
-
-/*-  Export Variables  --*/
-
-/*-  Export Functions  --*/
-
 void STAvClearAllCounter(PSStatCounter pStatistic);
 
 void STAvUpdateIsrStatCounter(PSStatCounter pStatistic, unsigned long dwIsr);
-- 
1.7.9.5

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


[PATCH] Staging: vt6655: removed redundant comments from michael.h

2014-07-25 Thread Igor Bezukh
Removed redundant comments from michael.h header file.

Signed-off-by: Igor Bezukh igb...@gmail.com
---
 drivers/staging/vt6655/michael.h |6 --
 1 file changed, 6 deletions(-)

diff --git a/drivers/staging/vt6655/michael.h b/drivers/staging/vt6655/michael.h
index f6c2c15..86cb140 100644
--- a/drivers/staging/vt6655/michael.h
+++ b/drivers/staging/vt6655/michael.h
@@ -33,10 +33,6 @@
 
 #include linux/types.h
 
-/*-  Export Definitions -*/
-
-/*-  Export Types  --*/
-
 void MIC_vInit(u32 dwK0, u32 dwK1);
 
 void MIC_vUnInit(void);
@@ -48,8 +44,6 @@ void MIC_vAppend(unsigned char *src, unsigned int nBytes);
 /* This also resets the message to empty. */
 void MIC_vGetMIC(u32 *pdwL, u32 *pdwR);
 
-/*-  Export Macros --*/
-
 /* Rotation functions on 32 bit values */
 #define ROL32(A, n)\
(((A)  (n)) | (((A)(32-(n)))   ((1UL  (n)) - 1)))
-- 
1.7.9.5

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


[PATCH] Staging: vt6655: removed redundant comments from power.h

2014-07-25 Thread Igor Bezukh
Removed redundant comments from power.h header file.

Signed-off-by: Igor Bezukh igb...@gmail.com
---
 drivers/staging/vt6655/power.h |9 -
 1 file changed, 9 deletions(-)

diff --git a/drivers/staging/vt6655/power.h b/drivers/staging/vt6655/power.h
index ce56124..936f171 100644
--- a/drivers/staging/vt6655/power.h
+++ b/drivers/staging/vt6655/power.h
@@ -29,19 +29,10 @@
 #ifndef __POWER_H__
 #define __POWER_H__
 
-/*-  Export Definitions -*/
 #define C_PWBT   1000  // micro sec. power up before 
TBTT
 #define PS_FAST_INTERVAL 1 // Fast power saving listen 
interval
 #define PS_MAX_INTERVAL  4 // MAX power saving listen 
interval
 
-/*-  Export Classes  */
-
-/*-  Export Variables  --*/
-
-/*-  Export Types  --*/
-
-/*-  Export Functions  --*/
-
 bool
 PSbConsiderPowerDown(
void *hDeviceContext,
-- 
1.7.9.5

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


Re: [PATCH v2 3/3] [SCSI] Make LBP quirk skip lbpme checks tests

2014-07-25 Thread Martin K. Petersen
 KY == KY Srinivasan k...@microsoft.com writes:

KY For the pass through case, the host validates the request and passes
KY the request to the device.  However, not all scsi commands are
KY passed through even though the device it is being passed through may
KY support the command. WRITE_SAME is one such command. Consequently,
KY in the EVPD page, we will set state indicating that WRITE_SAME is
KY not supported (even if the device supports it).

The LBP VPD page flags UNMAP as being supported. Do you actually support
UNMAP to DSM TRIM SCSI-ATA translation?

One challenge in that department is that a single UNMAP command may turn
into many, many, many DSM TRIM commands on the underlying SATA device.
That's why we went with WRITE SAME for the internal Linux SATL, capping
the maximum number of blocks to what we can fit in a single DSM TRIM
command.

-- 
Martin K. Petersen  Oracle Linux Engineering
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/3] staging: comedi: amplc_dio200_common: prevent extra free_irq()

2014-07-25 Thread Ian Abbott
`dio200_detach()` in amplc_dio200.c calls
`amplc_dio200_common_detach()` in amplc_dio200_common.c, followed by
`comedi_legacy_detach()` in ../drivers.c.  Both of those functions
call `free_irq()` if `dev-irq` is non-zero.  The second call produces a
warning message because the handler has already been freed.  Prevent
that by setting `dev-irq = 0` in `amplc_dio200_common_detach()`.

Signed-off-by: Ian Abbott abbo...@mev.co.uk
---
 drivers/staging/comedi/drivers/amplc_dio200_common.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/amplc_dio200_common.c 
b/drivers/staging/comedi/drivers/amplc_dio200_common.c
index 78700e8..3592e58 100644
--- a/drivers/staging/comedi/drivers/amplc_dio200_common.c
+++ b/drivers/staging/comedi/drivers/amplc_dio200_common.c
@@ -1202,8 +1202,10 @@ void amplc_dio200_common_detach(struct comedi_device 
*dev)
 
if (!thisboard || !devpriv)
return;
-   if (dev-irq)
+   if (dev-irq) {
free_irq(dev-irq, dev);
+   dev-irq = 0;
+   }
 }
 EXPORT_SYMBOL_GPL(amplc_dio200_common_detach);
 
-- 
2.0.0

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


[PATCH 3/3] staging: comedi: amplc_dio200_pci: no need to test board pointer in dio200_pci_detach()

2014-07-25 Thread Ian Abbott
`dio200_pci_detach()` doesn't need to check if the pointer to constant
board data (`thisboard`) and the pointer to private per-device data
(`devpriv`) are valid before calling `amplc_dio200_common_detach()`.  It
has no further need to check `thisboard` so remove the variable
altogether.  Move the test of `devpriv` to the first point it is needs
to be valid.

Signed-off-by: Ian Abbott abbo...@mev.co.uk
---
 drivers/staging/comedi/drivers/amplc_dio200_pci.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/amplc_dio200_pci.c 
b/drivers/staging/comedi/drivers/amplc_dio200_pci.c
index 3cec0e0..1954c1b 100644
--- a/drivers/staging/comedi/drivers/amplc_dio200_pci.c
+++ b/drivers/staging/comedi/drivers/amplc_dio200_pci.c
@@ -414,13 +414,10 @@ static int dio200_pci_auto_attach(struct comedi_device 
*dev,
 
 static void dio200_pci_detach(struct comedi_device *dev)
 {
-   const struct dio200_board *thisboard = comedi_board(dev);
struct dio200_private *devpriv = dev-private;
 
-   if (!thisboard || !devpriv)
-   return;
amplc_dio200_common_detach(dev);
-   if (devpriv-io.regtype == mmio_regtype)
+   if (devpriv  devpriv-io.regtype == mmio_regtype)
iounmap(devpriv-io.u.membase);
comedi_pci_disable(dev);
 }
-- 
2.0.0

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


[PATCH 2/3] staging: comedi: amplc_dio200_common: remove some tests from amplc_dio200_common_detach()

2014-07-25 Thread Ian Abbott
`amplc_dio200_common_detach()` doesn't do much apart from freeing the
IRQ handler that was requested by `amplc_dio200_common_attach()` if
`dev-irq` is non-zero.  There is no need to check if the pointer to
the constant board data or the pointer to private per-device data
exist, so remove those tests.

Signed-off-by: Ian Abbott abbo...@mev.co.uk
---
 drivers/staging/comedi/drivers/amplc_dio200_common.c | 5 -
 1 file changed, 5 deletions(-)

diff --git a/drivers/staging/comedi/drivers/amplc_dio200_common.c 
b/drivers/staging/comedi/drivers/amplc_dio200_common.c
index 3592e58..4cf9e9e 100644
--- a/drivers/staging/comedi/drivers/amplc_dio200_common.c
+++ b/drivers/staging/comedi/drivers/amplc_dio200_common.c
@@ -1197,11 +1197,6 @@ EXPORT_SYMBOL_GPL(amplc_dio200_common_attach);
 
 void amplc_dio200_common_detach(struct comedi_device *dev)
 {
-   const struct dio200_board *thisboard = comedi_board(dev);
-   struct dio200_private *devpriv = dev-private;
-
-   if (!thisboard || !devpriv)
-   return;
if (dev-irq) {
free_irq(dev-irq, dev);
dev-irq = 0;
-- 
2.0.0

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


Re: [PATCH v2 3/3] [SCSI] Make LBP quirk skip lbpme checks tests

2014-07-25 Thread James Bottomley
On Fri, 2014-07-25 at 16:47 +, KY Srinivasan wrote:
 
  -Original Message-
  From: Martin K. Petersen [mailto:martin.peter...@oracle.com]
  Sent: Thursday, July 24, 2014 8:54 AM
  To: Sitsofe Wheeler
  Cc: Martin K. Petersen; Christoph Hellwig; KY Srinivasan;
  gre...@linuxfoundation.org; linux-ker...@vger.kernel.org;
  de...@linuxdriverproject.org; oher...@suse.com; a...@canonical.com;
  jasow...@redhat.com; jbottom...@parallels.com; linux-
  s...@vger.kernel.org
  Subject: Re: [PATCH v2 3/3] [SCSI] Make LBP quirk skip lbpme checks tests
  
   Sitsofe == Sitsofe Wheeler sits...@gmail.com writes:
  
  Sitsofe So we can see it is really a SATA device that announces discard
  Sitsofe correctly and supports discard through WRITE_SAME(16).
  
  No, that's the SATA device that announces support for DSM TRIM, and as a
  result the Linux SATL reports support for WRITE SAME(16) w. the UNMAP bit
  set and LBPME.
  
  Sitsofe It is the act of passing it through Hyper-V that turned it into
  Sitsofe a SCSI device that supports UNMAP (but not WRITE_SAME(16)),
  Sitsofe doesn't announce its SCSI conformance number and doesn't
  Sitsofe correctly announce which features it supports. Surely in this
  Sitsofe case it's reasonable to quirk our way around the problem?
  
  No. That's an issue in Hyper-V that'll you'll have to take up with 
  Microsoft. I
  don't know what their passthrough limitations are for SCSI-ATA translation.
  Maybe K. Y. has some insight into this?
 
 For the pass through case, the host validates the request and passes
 the request to the device.
 However, not all scsi commands are passed through even though the
 device it is being passed through
 may support the command. WRITE_SAME is one such command. Consequently,
 in the EVPD page,
 we will set state indicating that WRITE_SAME is not supported (even if
 the device supports it).

I think you haven't appreciated the problem: He's passing a SATA SSD via
the SCSI hyper-v interface.  That means that the windows host is doing
SCSI-ATA translation.  The problem is that the Windows translation
layer (SATL) looks to be incomplete and it's not correctly translating
the IDENTIFY bit that corresponds to TRIM to the correct VPD pages so
consequently, Linux  won't send UNMAP commands to the device (to be
translated back to TRIM).

We already know this is a bug in the Windows SATL which needs fixing (if
you could report it and get a fix, that would be great) and that we're
not going to be able to work around this automatically in Linux because
the proposed patch would have us unconditionally try UNMAP for all
Hyper-V devices.  The current proposed fix is to enable UNMAP manually
via sysfs in the guest boot scripts, but obviously that means that
Hyper-V guests with direct pass through of SSDs need operator
intervention to turn on TRIM.

James

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


RE: [PATCH 01/12] staging: comedi: amplc_pc236: reformat header comments

2014-07-25 Thread Hartley Sweeten
On Friday, July 25, 2014 2:05 AM, Ian Abbott wrote:
 Use preferred style for copyright and driver description comments.

 Signed-off-by: Ian Abbott abbo...@mev.co.uk
 ---
  drivers/staging/comedi/drivers/amplc_pc236.c | 92 
 ++--
  1 file changed, 46 insertions(+), 46 deletions(-)

 diff --git a/drivers/staging/comedi/drivers/amplc_pc236.c 
 b/drivers/staging/comedi/drivers/amplc_pc236.c
 index 243b0f4..9d64e45 100644
 --- a/drivers/staging/comedi/drivers/amplc_pc236.c
 +++ b/drivers/staging/comedi/drivers/amplc_pc236.c
 @@ -1,51 +1,51 @@
  /*
 -comedi/drivers/amplc_pc236.c
 -Driver for Amplicon PC36AT and PCI236 DIO boards.
 -
 -Copyright (C) 2002 MEV Ltd. http://www.mev.co.uk/
 -
 -COMEDI - Linux Control and Measurement Device Interface
 -Copyright (C) 2000 David A. Schleef d...@schleef.org
 -
 -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.
 -*/
 + * comedi/drivers/amplc_pc236.c
 + * Driver for Amplicon PC36AT and PCI236 DIO boards.
 + *
 + * Copyright (C) 2002 MEV Ltd. http://www.mev.co.uk/
 + *
 + * COMEDI - Linux Control and Measurement Device Interface
 + * Copyright (C) 2000 David A. Schleef d...@schleef.org
 + *
 + * 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.
 + */
  /*
 -Driver: amplc_pc236
 -Description: Amplicon PC36AT, PCI236
 -Author: Ian Abbott abbo...@mev.co.uk
 -Devices: [Amplicon] PC36AT (pc36at), PCI236 (pci236 or amplc_pc236)
 -Updated: Wed, 01 Apr 2009 15:41:25 +0100
 -Status: works
 -
 -Configuration options - PC36AT:
 -  [0] - I/O port base address
 -  [1] - IRQ (optional)
 -
 -Configuration options - PCI236:
 -  [0] - PCI bus of device (optional)
 -  [1] - PCI slot of device (optional)
 -  If bus/slot is not specified, the first available PCI device will be
 -  used.
 -
 -The PC36AT ISA board and PCI236 PCI board have a single 8255 appearing -as 
 subdevice 0.
 -
 -Subdevice 1 pretends to be a digital input device, but it always returns
 -0 when read. However, if you run a command with scan_begin_src=TRIG_EXT, -a 
 rising edge on port C bit 3 acts as an external trigger, which can be -used 
 to wake up tasks.  This is like the comedi_parport device, but the -only way 
 to physically disable the interrupt on the PC36AT is to remove -the IRQ 
 jumper.  If no interrupt is connected, then subdevice 1 is -unused.
 -*/

Ian,

This patch appears to be corrupted.

 + * Driver: amplc_pc236
 + * Description: Amplicon PC36AT, PCI236
 + * Author: Ian Abbott abbo...@mev.co.uk
 + * Devices: [Amplicon] PC36AT (pc36at), PCI236 (pci236 or amplc_pc236)
 + * Updated: Wed, 01 Apr 2009 15:41:25 +0100
 + * Status: works
 + *
 + * Configuration options - PC36AT:
 + *   [0] - I/O port base address
 + *   [1] - IRQ (optional)
 + *
 + * Configuration options - PCI236:
 + *   [0] - PCI bus of device (optional)
 + *   [1] - PCI slot of device (optional)
 + *   If bus/slot is not specified, the first available PCI device will be
 + *   used.
 + *
 + * The PC36AT ISA board and PCI236 PCI board have a single 8255 
 + appearing

Patch corruption?

 + * as subdevice 0.
 + *
 + * Subdevice 1 pretends to be a digital input device, but it always 
 + returns

Again?

 + * 0 when read. However, if you run a command with 
 + scan_begin_src=TRIG_EXT,

Again?

 + * a rising edge on port C bit 3 acts as an external trigger, which can 
 + be

Again?
 + * used to wake up tasks.  This is like the comedi_parport device, but 
 + the

Again?

 + * only way to physically disable the interrupt on the PC36AT is to 
 + remove

Again?

 + * the IRQ jumper.  If no interrupt is connected, then subdevice 1 is
 + * unused.
 + */
  
  #include linux/module.h
  #include linux/pci.h

Not sure what happened..

Hartley

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


Re: Anybody working on sep?

2014-07-25 Thread Kristina Martšenko
On 23/06/14 23:32, Kristina Martšenko wrote:
 Hi Mark,
 
 I'm helping Greg do a bit of cleanup in the staging tree. I noticed that
 nobody seems to have worked towards moving sep out of staging in over a
 year. Are there any plans to clean it up and move it out soon?

No response from Mark here.

Alan, Jayant, either of you know what the status of the sep staging
driver is?

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


RE: [PATCH 00/12] staging: comedi: amplc_pc236: remove legacy PCI attach and tidy up

2014-07-25 Thread Hartley Sweeten
On Friday, July 25, 2014 2:05 AM, Ian Abbott wrote:
 The amplc_pc236 driver supports both ISA cards (Amplicon PC36AT) and PCI 
 cards (PCI236).  I plan to split it into separate drivers with a module for 
 common code, but let's reorganise it a bit first.

 The driver still supports manual attachment of PCI devices via the 
 `COMEDI_DEVCONFIG` ioctl and the comedi driver `attach` hook.  That can go, 
 though the attach hook is still needed for ISA devices.

 01) staging: comedi: amplc_pc236: reformat header comments
 02) staging: comedi: amplc_pc236: remove some boilerplate comments
 03) staging: comedi: amplc_pc236: remove manual configuration of PCI boards
 04) staging: comedi: amplc_pc236: no need to manipulate PCI ref count
 05) staging: comedi: amplc_pc236: no need to set hw_dev
 06) staging: comedi: amplc_pc236: absorb pc236_pci_common_attach()
 07) staging: comedi: amplc_pc236: remove 'model' member
 08) staging: comedi: amplc_pc236: split pc236_boards[] into ISA  PCI
 09) staging: comedi: amplc_pc236: don't check bus type in attach
 10) staging: comedi: amplc_pc236: Simplify PCI board look-up
 11) staging: comedi: amplc_pc236: remove PCI device ID macros
 12) staging: comedi: amplc_pc236: set board_name before common attach

  drivers/staging/comedi/drivers/amplc_pc236.c | 282 
 +++
  1 file changed, 74 insertions(+), 208 deletions(-)

Ian,

I'm not sure what happened but this entire series appears to be corrupt.

Can you check it and repost?

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


[PATCH] staging: unisys: fix visorchipset sysfs attribute functions

2014-07-25 Thread Benjamin Romer
This patch cleans up the style, error handling, and string handling in the sysfs
functions recently added to visorchipset:

- Use of sscanf() was changed to type-appropriate kstrto*() functions
- error handling was simplified
- the error return value of visorchannel_write() was corrected
- switch use of driver-specific types to kernel types

Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com
---
 .../unisys/visorchipset/visorchipset_main.c| 123 -
 .../staging/unisys/visorutil/memregion_direct.c|   2 +-
 2 files changed, 69 insertions(+), 56 deletions(-)

diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c 
b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index 58a441d..6f87e27 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -370,29 +370,31 @@ static void 
controlvm_respond_physdev_changestate(CONTROLVM_MESSAGE_HEADER *
 ssize_t toolaction_show(struct device *dev, struct device_attribute *attr,
char *buf)
 {
-   U8 toolAction;
+   u8 toolAction;
 
visorchannel_read(ControlVm_channel,
offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL,
-  ToolAction), toolAction, sizeof(U8));
+  ToolAction), toolAction, sizeof(u8));
return scnprintf(buf, PAGE_SIZE, %u\n, toolAction);
 }
 
 ssize_t toolaction_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
 {
-   U8 toolAction;
+   u8 toolAction;
+   int ret;
 
-   if (sscanf(buf, %hhu\n, toolAction) == 1) {
-   if (visorchannel_write(ControlVm_channel,
-   offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL,
-   ToolAction),
-   toolAction, sizeof(U8))  0)
-   return -EFAULT;
-   else
-   return count;
-   } else
-   return -EIO;
+   if (kstrtou8(buf, 10, toolAction) != 0)
+   return -EINVAL;
+
+   ret = visorchannel_write(ControlVm_channel,
+   offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL, ToolAction),
+   toolAction, sizeof(u8));
+
+   if (ret)
+   return ret;
+   else
+   return count;
 }
 
 ssize_t boottotool_show(struct device *dev, struct device_attribute *attr,
@@ -411,21 +413,23 @@ ssize_t boottotool_show(struct device *dev, struct 
device_attribute *attr,
 ssize_t boottotool_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
 {
-   int val;
+   int val, ret;
ULTRA_EFI_SPAR_INDICATION efiSparIndication;
 
-   if (sscanf(buf, %u\n, val) == 1) {
-   efiSparIndication.BootToTool = val;
-   if (visorchannel_write(ControlVm_channel,
+   if (kstrtoint(buf, 10, val) != 0)
+   return -EINVAL;
+
+   efiSparIndication.BootToTool = val;
+   ret = visorchannel_write(ControlVm_channel,
offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL,
-EfiSparIndication),
+   EfiSparIndication),
(efiSparIndication),
-   sizeof(ULTRA_EFI_SPAR_INDICATION))  0)
-   return -EFAULT;
-   else
-   return count;
-   } else
-   return -EIO;
+   sizeof(ULTRA_EFI_SPAR_INDICATION));
+
+   if (ret)
+   return ret;
+   else
+   return count;
 }
 
 static ssize_t error_show(struct device *dev, struct device_attribute *attr,
@@ -443,16 +447,19 @@ static ssize_t error_store(struct device *dev, struct 
device_attribute *attr,
const char *buf, size_t count)
 {
u32 error;
+   int ret;
 
-   if (sscanf(buf, %i\n, error) == 1) {
-   if (visorchannel_write(ControlVm_channel,
+   if (kstrtou32(buf, 10, error) != 0)
+   return -EINVAL;
+
+   ret = visorchannel_write(ControlVm_channel,
offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL,
InstallationError),
-   error, sizeof(u32)) == 1) {
-   return count;
-   }
-   }
-   return -EIO;
+   error, sizeof(u32));
+   if (ret)
+   return ret;
+   else
+   return count;
 }
 
 static ssize_t textid_show(struct device *dev, struct device_attribute *attr,
@@ -470,16 +477,19 @@ static ssize_t textid_store(struct device *dev, struct 
device_attribute *attr,
const char *buf, size_t count)
 {
u32 textId;
+   int ret;
 
-   if (sscanf(buf, %i\n, textId) == 1) {
-   if (visorchannel_write(ControlVm_channel,
+  

Re: [PATCH] staging: unisys: fix visorchipset sysfs attribute functions

2014-07-25 Thread Denis Kirjanov
On 7/25/14, Benjamin Romer benjamin.ro...@unisys.com wrote:
 This patch cleans up the style, error handling, and string handling in the
 sysfs
 functions recently added to visorchipset:

Split your changes and send one logical change per patch


 - Use of sscanf() was changed to type-appropriate kstrto*() functions
 - error handling was simplified
 - the error return value of visorchannel_write() was corrected
 - switch use of driver-specific types to kernel types

 Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com
 ---
  .../unisys/visorchipset/visorchipset_main.c| 123
 -
  .../staging/unisys/visorutil/memregion_direct.c|   2 +-
  2 files changed, 69 insertions(+), 56 deletions(-)

 diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c
 b/drivers/staging/unisys/visorchipset/visorchipset_main.c
 index 58a441d..6f87e27 100644
 --- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
 +++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
 @@ -370,29 +370,31 @@ static void
 controlvm_respond_physdev_changestate(CONTROLVM_MESSAGE_HEADER *
  ssize_t toolaction_show(struct device *dev, struct device_attribute *attr,
   char *buf)
  {
 - U8 toolAction;
 + u8 toolAction;

   visorchannel_read(ControlVm_channel,
   offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL,
 -ToolAction), toolAction, sizeof(U8));
 +ToolAction), toolAction, sizeof(u8));
   return scnprintf(buf, PAGE_SIZE, %u\n, toolAction);
  }

  ssize_t toolaction_store(struct device *dev, struct device_attribute
 *attr,
   const char *buf, size_t count)
  {
 - U8 toolAction;
 + u8 toolAction;
 + int ret;

 - if (sscanf(buf, %hhu\n, toolAction) == 1) {
 - if (visorchannel_write(ControlVm_channel,
 - offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL,
 - ToolAction),
 - toolAction, sizeof(U8))  0)
 - return -EFAULT;
 - else
 - return count;
 - } else
 - return -EIO;
 + if (kstrtou8(buf, 10, toolAction) != 0)
 + return -EINVAL;
 +
 + ret = visorchannel_write(ControlVm_channel,
 + offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL, ToolAction),
 + toolAction, sizeof(u8));
 +
 + if (ret)
 + return ret;
 + else
 + return count;
  }

  ssize_t boottotool_show(struct device *dev, struct device_attribute *attr,
 @@ -411,21 +413,23 @@ ssize_t boottotool_show(struct device *dev, struct
 device_attribute *attr,
  ssize_t boottotool_store(struct device *dev, struct device_attribute
 *attr,
   const char *buf, size_t count)
  {
 - int val;
 + int val, ret;
   ULTRA_EFI_SPAR_INDICATION efiSparIndication;

 - if (sscanf(buf, %u\n, val) == 1) {
 - efiSparIndication.BootToTool = val;
 - if (visorchannel_write(ControlVm_channel,
 + if (kstrtoint(buf, 10, val) != 0)
 + return -EINVAL;
 +
 + efiSparIndication.BootToTool = val;
 + ret = visorchannel_write(ControlVm_channel,
   offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL,
 -  EfiSparIndication),
 + EfiSparIndication),
   (efiSparIndication),
 - sizeof(ULTRA_EFI_SPAR_INDICATION))  0)
 - return -EFAULT;
 - else
 - return count;
 - } else
 - return -EIO;
 + sizeof(ULTRA_EFI_SPAR_INDICATION));
 +
 + if (ret)
 + return ret;
 + else
 + return count;
  }

  static ssize_t error_show(struct device *dev, struct device_attribute
 *attr,
 @@ -443,16 +447,19 @@ static ssize_t error_store(struct device *dev, struct
 device_attribute *attr,
   const char *buf, size_t count)
  {
   u32 error;
 + int ret;

 - if (sscanf(buf, %i\n, error) == 1) {
 - if (visorchannel_write(ControlVm_channel,
 + if (kstrtou32(buf, 10, error) != 0)
 + return -EINVAL;
 +
 + ret = visorchannel_write(ControlVm_channel,
   offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL,
   InstallationError),
 - error, sizeof(u32)) == 1) {
 - return count;
 - }
 - }
 - return -EIO;
 + error, sizeof(u32));
 + if (ret)
 + return ret;
 + else
 + return count;
  }

  static ssize_t textid_show(struct device *dev, struct device_attribute
 *attr,
 @@ -470,16 +477,19 @@ static ssize_t textid_store(struct device *dev, struct
 device_attribute *attr,
   const char *buf, size_t count)
  {
   u32 textId;
 + int ret;

 - if (sscanf(buf, %i\n, 

RE: [PATCH 00/12] staging: comedi: amplc_pc236: remove legacy PCI attach and tidy up

2014-07-25 Thread Hartley Sweeten
On Friday, July 25, 2014 10:37 AM, Hartley Sweeten wrote:
 On Friday, July 25, 2014 2:05 AM, Ian Abbott wrote:
 The amplc_pc236 driver supports both ISA cards (Amplicon PC36AT) and PCI
 cards (PCI236).  I plan to split it into separate drivers with a module for
 common code, but let's reorganise it a bit first.

 The driver still supports manual attachment of PCI devices via the
 `COMEDI_DEVCONFIG` ioctl and the comedi driver `attach` hook.  That can go,
 though the attach hook is still needed for ISA devices.

 01) staging: comedi: amplc_pc236: reformat header comments
 02) staging: comedi: amplc_pc236: remove some boilerplate comments
 03) staging: comedi: amplc_pc236: remove manual configuration of PCI boards
 04) staging: comedi: amplc_pc236: no need to manipulate PCI ref count
 05) staging: comedi: amplc_pc236: no need to set hw_dev
 06) staging: comedi: amplc_pc236: absorb pc236_pci_common_attach()
 07) staging: comedi: amplc_pc236: remove 'model' member
 08) staging: comedi: amplc_pc236: split pc236_boards[] into ISA  PCI
 09) staging: comedi: amplc_pc236: don't check bus type in attach
 10) staging: comedi: amplc_pc236: Simplify PCI board look-up
 11) staging: comedi: amplc_pc236: remove PCI device ID macros
 12) staging: comedi: amplc_pc236: set board_name before common attach

  drivers/staging/comedi/drivers/amplc_pc236.c | 282 
 +++
  1 file changed, 74 insertions(+), 208 deletions(-)

 Ian,

 I'm not sure what happened but this entire series appears to be corrupt.

 Can you check it and repost?

Ignore that... The problem was on my end.

Reviewed-by: H Hartley Sweeten hswee...@visionengravers.com

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


RE: [PATCH 0/3] staging: comedi: amplc_dio200 detach cleanups

2014-07-25 Thread Hartley Sweeten
On Friday, July 25, 2014 10:07 AM, Ian Abbott wrote:
 Fix a double free_irq() and do a bit more cleaning up of the detach
 routines.

 1) staging: comedi: amplc_dio200_common: prevent extra free_irq()
 2) staging: comedi: amplc_dio200_common: remove some tests from
amplc_dio200_common_detach()
 3) staging: comedi: amplc_dio200_pci: no need to test board pointer in
dio200_pci_detach()

  drivers/staging/comedi/drivers/amplc_dio200_common.c | 9 +++--
  drivers/staging/comedi/drivers/amplc_dio200_pci.c| 5 +
  2 files changed, 4 insertions(+), 10 deletions(-)

Reviewed-by: H Hartley Sweeten hswee...@visionengravers.com

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


RE: [PATCH 1/3] staging: comedi: amplc_dio200_common: prevent extra free_irq()

2014-07-25 Thread Hartley Sweeten
On Friday, July 25, 2014 10:07 AM, Ian Abbott wrote:
 `dio200_detach()` in amplc_dio200.c calls
 `amplc_dio200_common_detach()` in amplc_dio200_common.c, followed by
 `comedi_legacy_detach()` in ../drivers.c.  Both of those functions
 call `free_irq()` if `dev-irq` is non-zero.  The second call produces a
 warning message because the handler has already been freed.  Prevent
 that by setting `dev-irq = 0` in `amplc_dio200_common_detach()`.

 Signed-off-by: Ian Abbott abbo...@mev.co.uk
 ---
  drivers/staging/comedi/drivers/amplc_dio200_common.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

 diff --git a/drivers/staging/comedi/drivers/amplc_dio200_common.c 
 b/drivers/staging/comedi/drivers/amplc_dio200_common.c
 index 78700e8..3592e58 100644
 --- a/drivers/staging/comedi/drivers/amplc_dio200_common.c
 +++ b/drivers/staging/comedi/drivers/amplc_dio200_common.c
 @@ -1202,8 +1202,10 @@ void amplc_dio200_common_detach(struct comedi_device 
 *dev)
  
   if (!thisboard || !devpriv)
   return;
 - if (dev-irq)
 + if (dev-irq) {
   free_irq(dev-irq, dev);
 + dev-irq = 0;
 + }
  }
  EXPORT_SYMBOL_GPL(amplc_dio200_common_detach);
 
Ian,

I have already gave a Reviewed-by signoff for this series.

After looking over the code I think a cleaner solution would be to:

1) Use comedi_legacy_detach() directly for the (*detach) in the
   legacy ISA driver.
2) Move the code from amplc_dio200_common_detach() into the
   (*detach) function for the PCI driver.
3) Remove the exported function amplc_dio200_common_detach().

Regards,
Hartley

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


Re: Anybody working on sep?

2014-07-25 Thread Alan Cox
On Fri, 2014-07-25 at 20:17 +0300, Kristina Martšenko wrote:
 On 23/06/14 23:32, Kristina Martšenko wrote:
  Hi Mark,
  
  I'm helping Greg do a bit of cleanup in the staging tree. I noticed that
  nobody seems to have worked towards moving sep out of staging in over a
  year. Are there any plans to clean it up and move it out soon?
 
 No response from Mark here.
 
 Alan, Jayant, either of you know what the status of the sep staging
 driver is?

I believe works last time anyone checked. I don't think we have anyone
officially working on the early Intel phone cpus for upstream any more.

Alan


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


Re: [PATCH] staging: vt6655: fix direct dereferencing of user pointer

2014-07-25 Thread Malcolm Priestley

Hi Guillaume

On 25/07/14 13:47, Guillaume Clement wrote:

Sparse reported that the data from tagSCmdRequest is given by
userspace, so it should be tagged as such.

extra is not in user space

All Wireless Extensions ioctl extra calls originate from 
ioctl_standard_iw_point in wext-core.


Either through ioctl or iw_handler

All these functions should have been converted to iw_handler.

Regards


Malcolm



Later, we were memcomparing and dereferencing it without first copying
it, fix that as well.

Signed-off-by: Guillaume Clement gclem...@baobob.org
---
  drivers/staging/vt6655/iocmd.h |  2 +-
  drivers/staging/vt6655/iwctl.c | 32 ++--
  drivers/staging/vt6655/iwctl.h |  6 +++---
  3 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/vt6655/iocmd.h b/drivers/staging/vt6655/iocmd.h
index e499f1b..dd12498 100644
--- a/drivers/staging/vt6655/iocmd.h
+++ b/drivers/staging/vt6655/iocmd.h
@@ -100,7 +100,7 @@ typedef enum tagWZONETYPE {
  #pragma pack(1)
  typedef struct tagSCmdRequest {
u8  name[16];
-   void*data;
+   void __user *data;
u16 wResult;
u16 wCmdCode;
  } SCmdRequest, *PSCmdRequest;
diff --git a/drivers/staging/vt6655/iwctl.c b/drivers/staging/vt6655/iwctl.c
index 501cd64..7ce23b5 100644
--- a/drivers/staging/vt6655/iwctl.c
+++ b/drivers/staging/vt6655/iwctl.c
@@ -1621,17 +1621,24 @@ int iwctl_giwauth(struct net_device *dev,
  int iwctl_siwgenie(struct net_device *dev,
   struct iw_request_info *info,
   struct iw_point *wrq,
-  char *extra)
+  char __user *extra)
  {
PSDevicepDevice = (PSDevice)netdev_priv(dev);
PSMgmtObjectpMgmt = (pDevice-sMgmtObj);
int ret = 0;
+   char length;

if (wrq-length) {
-   if ((wrq-length  2) || (extra[1]+2 != wrq-length)) {
-   ret = -EINVAL;
-   goto out;
-   }
+   if (wrq-length  2)
+   return -EINVAL;
+
+   ret = get_user(length, extra + 1);
+   if (ret)
+   return ret;
+
+   if (length + 2 != wrq-length)
+   return -EINVAL;
+
if (wrq-length  MAX_WPA_IE_LEN) {
ret = -ENOMEM;
goto out;
@@ -1654,7 +1661,7 @@ out://not completely ...not necessary in wpa_supplicant 
0.5.8
  int iwctl_giwgenie(struct net_device *dev,
   struct iw_request_info *info,
   struct iw_point *wrq,
-  char *extra)
+  char __user *extra)
  {
PSDevicepDevice = (PSDevice)netdev_priv(dev);
PSMgmtObjectpMgmt = (pDevice-sMgmtObj);
@@ -1801,18 +1808,23 @@ int iwctl_giwencodeext(struct net_device *dev,
  int iwctl_siwmlme(struct net_device *dev,
  struct iw_request_info *info,
  struct iw_point *wrq,
- char *extra)
+ char __user *extra)
  {
PSDevicepDevice = (PSDevice)netdev_priv(dev);
PSMgmtObjectpMgmt = (pDevice-sMgmtObj);
-   struct iw_mlme *mlme = (struct iw_mlme *)extra;
+   struct iw_mlme mime;
+
int ret = 0;

-   if (memcmp(pMgmt-abyCurrBSSID, mlme-addr.sa_data, ETH_ALEN)) {
+   ret = copy_from_user(mime, extra, sizeof(mime));
+   if (ret)
+   return -EFAULT;
+
+   if (memcmp(pMgmt-abyCurrBSSID, mime.addr.sa_data, ETH_ALEN)) {
ret = -EINVAL;
return ret;
}
-   switch (mlme-cmd) {
+   switch (mime.cmd) {
case IW_MLME_DEAUTH:
//this command seems to be not complete,please test it 
--einsnliu
//bScheduleCommand((void *) pDevice, WLAN_CMD_DEAUTH, (unsigned 
char *)reason);
diff --git a/drivers/staging/vt6655/iwctl.h b/drivers/staging/vt6655/iwctl.h
index de0a337..7dd6310 100644
--- a/drivers/staging/vt6655/iwctl.h
+++ b/drivers/staging/vt6655/iwctl.h
@@ -176,12 +176,12 @@ int iwctl_giwauth(struct net_device *dev,
  int iwctl_siwgenie(struct net_device *dev,
   struct iw_request_info *info,
   struct iw_point *wrq,
-  char *extra);
+  char __user *extra);

  int iwctl_giwgenie(struct net_device *dev,
   struct iw_request_info *info,
   struct iw_point *wrq,
-  char *extra);
+  char __user *extra);

  int iwctl_siwencodeext(struct net_device *dev,
   struct iw_request_info *info,
@@ -196,7 +196,7 @@ int iwctl_giwencodeext(struct net_device *dev,
  int iwctl_siwmlme(struct net_device *dev,
  struct iw_request_info *info,
  struct iw_point *wrq,
- char *extra);
+ char __user *extra);

Re: [PATCH] staging: vt6655: fix direct dereferencing of user pointer

2014-07-25 Thread Malcolm Priestley

Hi Guillaume

On 25/07/14 13:47, Guillaume Clement wrote:

Sparse reported that the data from tagSCmdRequest is given by
userspace, so it should be tagged as such.

extra is not in user space

All Wireless Extensions ioctl extra calls originate from 
ioctl_standard_iw_point in wext-core.


Either through ioctl or iw_handler

All these functions should have been converted to iw_handler.

Regards


Malcolm



Later, we were memcomparing and dereferencing it without first copying
it, fix that as well.

Signed-off-by: Guillaume Clement gclem...@baobob.org
---
  drivers/staging/vt6655/iocmd.h |  2 +-
  drivers/staging/vt6655/iwctl.c | 32 ++--
  drivers/staging/vt6655/iwctl.h |  6 +++---
  3 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/vt6655/iocmd.h b/drivers/staging/vt6655/iocmd.h
index e499f1b..dd12498 100644
--- a/drivers/staging/vt6655/iocmd.h
+++ b/drivers/staging/vt6655/iocmd.h
@@ -100,7 +100,7 @@ typedef enum tagWZONETYPE {
  #pragma pack(1)
  typedef struct tagSCmdRequest {
u8  name[16];
-   void*data;
+   void __user *data;
u16 wResult;
u16 wCmdCode;
  } SCmdRequest, *PSCmdRequest;
diff --git a/drivers/staging/vt6655/iwctl.c b/drivers/staging/vt6655/iwctl.c
index 501cd64..7ce23b5 100644
--- a/drivers/staging/vt6655/iwctl.c
+++ b/drivers/staging/vt6655/iwctl.c
@@ -1621,17 +1621,24 @@ int iwctl_giwauth(struct net_device *dev,
  int iwctl_siwgenie(struct net_device *dev,
   struct iw_request_info *info,
   struct iw_point *wrq,
-  char *extra)
+  char __user *extra)
  {
PSDevicepDevice = (PSDevice)netdev_priv(dev);
PSMgmtObjectpMgmt = (pDevice-sMgmtObj);
int ret = 0;
+   char length;

if (wrq-length) {
-   if ((wrq-length  2) || (extra[1]+2 != wrq-length)) {
-   ret = -EINVAL;
-   goto out;
-   }
+   if (wrq-length  2)
+   return -EINVAL;
+
+   ret = get_user(length, extra + 1);
+   if (ret)
+   return ret;
+
+   if (length + 2 != wrq-length)
+   return -EINVAL;
+
if (wrq-length  MAX_WPA_IE_LEN) {
ret = -ENOMEM;
goto out;
@@ -1654,7 +1661,7 @@ out://not completely ...not necessary in wpa_supplicant 
0.5.8
  int iwctl_giwgenie(struct net_device *dev,
   struct iw_request_info *info,
   struct iw_point *wrq,
-  char *extra)
+  char __user *extra)
  {
PSDevicepDevice = (PSDevice)netdev_priv(dev);
PSMgmtObjectpMgmt = (pDevice-sMgmtObj);
@@ -1801,18 +1808,23 @@ int iwctl_giwencodeext(struct net_device *dev,
  int iwctl_siwmlme(struct net_device *dev,
  struct iw_request_info *info,
  struct iw_point *wrq,
- char *extra)
+ char __user *extra)
  {
PSDevicepDevice = (PSDevice)netdev_priv(dev);
PSMgmtObjectpMgmt = (pDevice-sMgmtObj);
-   struct iw_mlme *mlme = (struct iw_mlme *)extra;
+   struct iw_mlme mime;
+
int ret = 0;

-   if (memcmp(pMgmt-abyCurrBSSID, mlme-addr.sa_data, ETH_ALEN)) {
+   ret = copy_from_user(mime, extra, sizeof(mime));
+   if (ret)
+   return -EFAULT;
+
+   if (memcmp(pMgmt-abyCurrBSSID, mime.addr.sa_data, ETH_ALEN)) {
ret = -EINVAL;
return ret;
}
-   switch (mlme-cmd) {
+   switch (mime.cmd) {
case IW_MLME_DEAUTH:
//this command seems to be not complete,please test it 
--einsnliu
//bScheduleCommand((void *) pDevice, WLAN_CMD_DEAUTH, (unsigned 
char *)reason);
diff --git a/drivers/staging/vt6655/iwctl.h b/drivers/staging/vt6655/iwctl.h
index de0a337..7dd6310 100644
--- a/drivers/staging/vt6655/iwctl.h
+++ b/drivers/staging/vt6655/iwctl.h
@@ -176,12 +176,12 @@ int iwctl_giwauth(struct net_device *dev,
  int iwctl_siwgenie(struct net_device *dev,
   struct iw_request_info *info,
   struct iw_point *wrq,
-  char *extra);
+  char __user *extra);

  int iwctl_giwgenie(struct net_device *dev,
   struct iw_request_info *info,
   struct iw_point *wrq,
-  char *extra);
+  char __user *extra);

  int iwctl_siwencodeext(struct net_device *dev,
   struct iw_request_info *info,
@@ -196,7 +196,7 @@ int iwctl_giwencodeext(struct net_device *dev,
  int iwctl_siwmlme(struct net_device *dev,
  struct iw_request_info *info,
  struct iw_point *wrq,
- char *extra);
+ char __user *extra);

Re: Anybody working on sep?

2014-07-25 Thread Greg KH
On Fri, Jul 25, 2014 at 10:54:47PM +0100, Alan Cox wrote:
 On Fri, 2014-07-25 at 20:17 +0300, Kristina Martšenko wrote:
  On 23/06/14 23:32, Kristina Martšenko wrote:
   Hi Mark,
   
   I'm helping Greg do a bit of cleanup in the staging tree. I noticed that
   nobody seems to have worked towards moving sep out of staging in over a
   year. Are there any plans to clean it up and move it out soon?
  
  No response from Mark here.
  
  Alan, Jayant, either of you know what the status of the sep staging
  driver is?
 
 I believe works last time anyone checked. I don't think we have anyone
 officially working on the early Intel phone cpus for upstream any more.

So can we just drop it then?  If no one is working on moving it out of
staging, it should go.

thanks,

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