[PATCH] staging: ks7010: remove me from CC list

2020-05-02 Thread Wolfram Sang
I lost interest in this driver years ago because I could't keep up with
testing the incoming janitorial patches. So, drop me from CC.

Signed-off-by: Wolfram Sang 
---
 drivers/staging/ks7010/TODO | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/ks7010/TODO b/drivers/staging/ks7010/TODO
index 87a6dac4890d..ab6f39175d99 100644
--- a/drivers/staging/ks7010/TODO
+++ b/drivers/staging/ks7010/TODO
@@ -30,5 +30,4 @@ Now the TODOs:
 
 Please send any patches to:
 Greg Kroah-Hartman 
-Wolfram Sang 
 Linux Driver Project Developer List 
-- 
2.20.1

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


Re: [PATCH 00/34] treewide: simplify getting the adapter of an I2C client

2019-06-10 Thread Wolfram Sang
Hi Peter,

> Similar things go on in:
> 
> drivers/hwmon/lm90.c
> drivers/leds/leds-is31fl319x.c
> drivers/of/unittest.c

Right. I'll fix them, too.

> And drivers/rtc/rtc-fm3130.c has a couple of these:

These are fixed in patch 26 of this series.

Thanks and happy hacking,

   Wolfram


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


[PATCH 31/34] staging: media: soc_camera: imx074: simplify getting the adapter of a client

2019-06-08 Thread Wolfram Sang
We have a dedicated pointer for that, so use it. Much easier to read and
less computation involved.

Signed-off-by: Wolfram Sang 
---

Please apply to your subsystem tree.

 drivers/staging/media/soc_camera/imx074.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/soc_camera/imx074.c 
b/drivers/staging/media/soc_camera/imx074.c
index d907aa62f898..14240b74cdd0 100644
--- a/drivers/staging/media/soc_camera/imx074.c
+++ b/drivers/staging/media/soc_camera/imx074.c
@@ -409,7 +409,7 @@ static int imx074_probe(struct i2c_client *client,
const struct i2c_device_id *did)
 {
struct imx074 *priv;
-   struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent);
+   struct i2c_adapter *adapter = client->adapter;
struct soc_camera_subdev_desc *ssdd = soc_camera_i2c_to_desc(client);
int ret;
 
-- 
2.19.1

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


[PATCH 32/34] staging: media: soc_camera: mt9t031: simplify getting the adapter of a client

2019-06-08 Thread Wolfram Sang
We have a dedicated pointer for that, so use it. Much easier to read and
less computation involved.

Signed-off-by: Wolfram Sang 
---

Please apply to your subsystem tree.

 drivers/staging/media/soc_camera/mt9t031.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/soc_camera/mt9t031.c 
b/drivers/staging/media/soc_camera/mt9t031.c
index 615ae9df2c57..c14f23221544 100644
--- a/drivers/staging/media/soc_camera/mt9t031.c
+++ b/drivers/staging/media/soc_camera/mt9t031.c
@@ -751,7 +751,7 @@ static int mt9t031_probe(struct i2c_client *client,
 {
struct mt9t031 *mt9t031;
struct soc_camera_subdev_desc *ssdd = soc_camera_i2c_to_desc(client);
-   struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent);
+   struct i2c_adapter *adapter = client->adapter;
int ret;
 
if (!ssdd) {
-- 
2.19.1

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


[PATCH 00/34] treewide: simplify getting the adapter of an I2C client

2019-06-08 Thread Wolfram Sang
While preparing a refactoring series, I noticed that some drivers use a
complicated way of determining the adapter of a client. The easy way is
to use the intended pointer: client->adapter

These drivers do:
to_i2c_adapter(client->dev.parent);

The I2C core populates the parent pointer as:
client->dev.parent = >adapter->dev;

Now take into consideration that
to_i2c_adapter(>dev);

is a complicated way of saying 'adapter', then we can even formally
prove that the complicated expression can be simplified by using
client->adapter.

The conversion was done using a coccinelle script with some manual
indentation fixes applied on top.

To avoid a brown paper bag mistake, I double checked this on a Renesas
Salvator-XS board (R-Car M3N) and verified both expression result in the
same pointer. Other than that, the series is only build tested.

A branch can be found here:

git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/no_to_adapter

Please apply the patches to the individual subsystem trees. There are no
dependencies.

Thanks and kind regards,

   Wolfram


Wolfram Sang (34):
  clk: clk-cdce706: simplify getting the adapter of a client
  gpu: drm: bridge: sii9234: simplify getting the adapter of a client
  iio: light: bh1780: simplify getting the adapter of a client
  leds: leds-pca955x: simplify getting the adapter of a client
  leds: leds-tca6507: simplify getting the adapter of a client
  media: i2c: ak881x: simplify getting the adapter of a client
  media: i2c: mt9m001: simplify getting the adapter of a client
  media: i2c: mt9m111: simplify getting the adapter of a client
  media: i2c: mt9p031: simplify getting the adapter of a client
  media: i2c: ov2640: simplify getting the adapter of a client
  media: i2c: tw9910: simplify getting the adapter of a client
  misc: fsa9480: simplify getting the adapter of a client
  misc: isl29003: simplify getting the adapter of a client
  misc: tsl2550: simplify getting the adapter of a client
  mtd: maps: pismo: simplify getting the adapter of a client
  power: supply: bq24190_charger: simplify getting the adapter of a client
  power: supply: bq24257_charger: simplify getting the adapter of a client
  power: supply: bq25890_charger: simplify getting the adapter of a client
  power: supply: max14656_charger_detector: simplify getting the adapter
of a client
  power: supply: max17040_battery: simplify getting the adapter of a client
  power: supply: max17042_battery: simplify getting the adapter of a client
  power: supply: rt5033_battery: simplify getting the adapter of a client
  power: supply: rt9455_charger: simplify getting the adapter of a client
  power: supply: sbs-manager: simplify getting the adapter of a client
  regulator: max8952: simplify getting the adapter of a client
  rtc: fm3130: simplify getting the adapter of a client
  rtc: m41t80: simplify getting the adapter of a client
  rtc: rv8803: simplify getting the adapter of a client
  rtc: rx8010: simplify getting the adapter of a client
  rtc: rx8025: simplify getting the adapter of a client
  staging: media: soc_camera: imx074: simplify getting the adapter of a client
  staging: media: soc_camera: mt9t031: simplify getting the adapter of a client
  staging: media: soc_camera: soc_mt9v022: simplify getting the adapter
of a client
  usb: typec: tcpm: fusb302: simplify getting the adapter of a client

 drivers/clk/clk-cdce706.c| 2 +-
 drivers/gpu/drm/bridge/sii9234.c | 4 ++--
 drivers/iio/light/bh1780.c   | 2 +-
 drivers/leds/leds-pca955x.c  | 2 +-
 drivers/leds/leds-tca6507.c  | 2 +-
 drivers/media/i2c/ak881x.c   | 2 +-
 drivers/media/i2c/mt9m001.c  | 2 +-
 drivers/media/i2c/mt9m111.c  | 2 +-
 drivers/media/i2c/mt9p031.c  | 2 +-
 drivers/media/i2c/ov2640.c   | 2 +-
 drivers/media/i2c/tw9910.c   | 3 +--
 drivers/misc/fsa9480.c   | 2 +-
 drivers/misc/isl29003.c  | 2 +-
 drivers/misc/tsl2550.c   | 2 +-
 drivers/mtd/maps/pismo.c | 2 +-
 drivers/power/supply/bq24190_charger.c   | 2 +-
 drivers/power/supply/bq24257_charger.c   | 2 +-
 drivers/power/supply/bq25890_charger.c   | 2 +-
 drivers/power/supply/max14656_charger_detector.c | 2 +-
 drivers/power/supply/max17040_battery.c  | 2 +-
 drivers/power/supply/max17042_battery.c  | 2 +-
 drivers/power/supply/rt5033_battery.c| 2 +-
 drivers/power/supply/rt9455_charger.c| 2 +-
 drivers/power/supply/sbs-manager.c   | 2 +-
 drivers/regulator/max8952.c  | 2 +-
 drivers/rtc/rtc-fm3130.c | 8 +++-
 drivers/rtc/rtc-m41t80.c | 2 +-
 dri

[PATCH 33/34] staging: media: soc_camera: soc_mt9v022: simplify getting the adapter of a client

2019-06-08 Thread Wolfram Sang
We have a dedicated pointer for that, so use it. Much easier to read and
less computation involved.

Signed-off-by: Wolfram Sang 
---

Please apply to your subsystem tree.

 drivers/staging/media/soc_camera/soc_mt9v022.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/soc_camera/soc_mt9v022.c 
b/drivers/staging/media/soc_camera/soc_mt9v022.c
index e7e0d3d29499..1739a618846d 100644
--- a/drivers/staging/media/soc_camera/soc_mt9v022.c
+++ b/drivers/staging/media/soc_camera/soc_mt9v022.c
@@ -883,7 +883,7 @@ static int mt9v022_probe(struct i2c_client *client,
 {
struct mt9v022 *mt9v022;
struct soc_camera_subdev_desc *ssdd = soc_camera_i2c_to_desc(client);
-   struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent);
+   struct i2c_adapter *adapter = client->adapter;
struct mt9v022_platform_data *pdata;
int ret;
 
-- 
2.19.1

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


Re: [PATCH 10/10] docs: fix broken documentation links

2019-05-20 Thread Wolfram Sang
On Mon, May 20, 2019 at 11:47:39AM -0300, Mauro Carvalho Chehab wrote:
> Mostly due to x86 and acpi conversion, several documentation
> links are still pointing to the old file. Fix them.
> 
> Signed-off-by: Mauro Carvalho Chehab 

Thanks, didn't notice that.

>  Documentation/i2c/instantiating-devices  |  2 +-

...

> diff --git a/Documentation/i2c/instantiating-devices 
> b/Documentation/i2c/instantiating-devices
> index 0d85ac1935b7..5a3e2f331e8c 100644
> --- a/Documentation/i2c/instantiating-devices
> +++ b/Documentation/i2c/instantiating-devices
> @@ -85,7 +85,7 @@ Method 1c: Declare the I2C devices via ACPI
>  ---
>  
>  ACPI can also describe I2C devices. There is special documentation for this
> -which is currently located at Documentation/acpi/enumeration.txt.
> +which is currently located at 
> Documentation/firmware-guide/acpi/enumeration.rst.
>  
>  
>  Method 2: Instantiate the devices explicitly

For this I2C part:

Reviewed-by: Wolfram Sang 



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


[PATCH 1/1] staging: media: imx: imx7-mipi-csis: simplify getting .driver_data

2019-03-19 Thread Wolfram Sang
We should get 'driver_data' from 'struct device' directly. Going via
platform_device is an unneeded step back and forth.

Signed-off-by: Wolfram Sang 
---

Build tested only. buildbot is happy.

 drivers/staging/media/imx/imx7-mipi-csis.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/media/imx/imx7-mipi-csis.c 
b/drivers/staging/media/imx/imx7-mipi-csis.c
index 2ddcc42ab8ff..44569c63e4de 100644
--- a/drivers/staging/media/imx/imx7-mipi-csis.c
+++ b/drivers/staging/media/imx/imx7-mipi-csis.c
@@ -1039,8 +1039,7 @@ static int mipi_csis_probe(struct platform_device *pdev)
 
 static int mipi_csis_pm_suspend(struct device *dev, bool runtime)
 {
-   struct platform_device *pdev = to_platform_device(dev);
-   struct v4l2_subdev *mipi_sd = platform_get_drvdata(pdev);
+   struct v4l2_subdev *mipi_sd = dev_get_drvdata(dev);
struct csi_state *state = mipi_sd_to_csis_state(mipi_sd);
int ret = 0;
 
@@ -1064,8 +1063,7 @@ static int mipi_csis_pm_suspend(struct device *dev, bool 
runtime)
 
 static int mipi_csis_pm_resume(struct device *dev, bool runtime)
 {
-   struct platform_device *pdev = to_platform_device(dev);
-   struct v4l2_subdev *mipi_sd = platform_get_drvdata(pdev);
+   struct v4l2_subdev *mipi_sd = dev_get_drvdata(dev);
struct csi_state *state = mipi_sd_to_csis_state(mipi_sd);
int ret = 0;
 
-- 
2.11.0

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


[PATCH 48/61] staging: iio: adc: simplify getting .drvdata

2018-04-19 Thread Wolfram Sang
We should get drvdata from struct device directly. Going via
platform_device is an unneeded step back and forth.

Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com>
---

Build tested only. buildbot is happy. Please apply individually.

 drivers/staging/iio/adc/ad7606_par.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/iio/adc/ad7606_par.c 
b/drivers/staging/iio/adc/ad7606_par.c
index 3eb6f8f312dd..a34c2a1d5373 100644
--- a/drivers/staging/iio/adc/ad7606_par.c
+++ b/drivers/staging/iio/adc/ad7606_par.c
@@ -18,8 +18,7 @@
 static int ad7606_par16_read_block(struct device *dev,
   int count, void *buf)
 {
-   struct platform_device *pdev = to_platform_device(dev);
-   struct iio_dev *indio_dev = platform_get_drvdata(pdev);
+   struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct ad7606_state *st = iio_priv(indio_dev);
 
insw((unsigned long)st->base_address, buf, count);
@@ -34,8 +33,7 @@ static const struct ad7606_bus_ops ad7606_par16_bops = {
 static int ad7606_par8_read_block(struct device *dev,
  int count, void *buf)
 {
-   struct platform_device *pdev = to_platform_device(dev);
-   struct iio_dev *indio_dev = platform_get_drvdata(pdev);
+   struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct ad7606_state *st = iio_priv(indio_dev);
 
insb((unsigned long)st->base_address, buf, count * 2);
-- 
2.11.0

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


[PATCH 47/61] staging: greybus: simplify getting .drvdata

2018-04-19 Thread Wolfram Sang
We should get drvdata from struct device directly. Going via
platform_device is an unneeded step back and forth.

Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com>
---

Build tested only. buildbot is happy. Please apply individually.

 drivers/staging/greybus/arche-platform.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/greybus/arche-platform.c 
b/drivers/staging/greybus/arche-platform.c
index 83254a72a7bb..8fe8b6e35432 100644
--- a/drivers/staging/greybus/arche-platform.c
+++ b/drivers/staging/greybus/arche-platform.c
@@ -315,8 +315,7 @@ static ssize_t state_store(struct device *dev,
   struct device_attribute *attr,
   const char *buf, size_t count)
 {
-   struct platform_device *pdev = to_platform_device(dev);
-   struct arche_platform_drvdata *arche_pdata = platform_get_drvdata(pdev);
+   struct arche_platform_drvdata *arche_pdata = dev_get_drvdata(dev);
int ret = 0;
 
mutex_lock(_pdata->platform_state_mutex);
-- 
2.11.0

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


[PATCH 00/61] tree-wide: simplify getting .drvdata

2018-04-19 Thread Wolfram Sang
I got tired of fixing this in Renesas drivers manually, so I took the big
hammer. Remove this cumbersome code pattern which got copy-pasted too much
already:

-   struct platform_device *pdev = to_platform_device(dev);
-   struct ep93xx_keypad *keypad = platform_get_drvdata(pdev);
+   struct ep93xx_keypad *keypad = dev_get_drvdata(dev);

I send this out as one patch per directory per subsystem. I think they should
be applied individually. If you prefer a broken out series per subsystem, I can
provide this as well. Just mail me.

A branch (tested by buildbot; only with all commits squashed into one commit
before) can be found here:

git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git 
coccinelle/get_drvdata

Open for other comments, suggestions, too, of course.

Here is the cocci-script I created (after  iterations by manually checking
samples):

@@
struct device* d;
identifier pdev;
expression *ptr;
@@
(
-   struct platform_device *pdev = to_platform_device(d);
|
-   struct platform_device *pdev;
...
-   pdev = to_platform_device(d);
)
<... when != pdev
-   >dev
+   d
...>

ptr =
-   platform_get_drvdata(pdev)
+   dev_get_drvdata(d)

<... when != pdev
-   >dev
+   d
...>

Kind regards,

   Wolfram


Wolfram Sang (61):
  ARM: plat-samsung: simplify getting .drvdata
  ata: simplify getting .drvdata
  auxdisplay: simplify getting .drvdata
  bus: simplify getting .drvdata
  clk: samsung: simplify getting .drvdata
  crypto: simplify getting .drvdata
  dma: simplify getting .drvdata
  dmaengine: dw: simplify getting .drvdata
  dmaengine: qcom: simplify getting .drvdata
  gpio: simplify getting .drvdata
  gpu: drm: msm: simplify getting .drvdata
  gpu: drm: msm: adreno: simplify getting .drvdata
  gpu: drm: msm: disp: mdp5: simplify getting .drvdata
  gpu: drm: msm: dsi: simplify getting .drvdata
  gpu: drm: omapdrm: displays: simplify getting .drvdata
  gpu: drm: vc4: simplify getting .drvdata
  hid: simplify getting .drvdata
  iio: common: cros_ec_sensors: simplify getting .drvdata
  iio: common: hid-sensors: simplify getting .drvdata
  input: keyboard: simplify getting .drvdata
  input: misc: simplify getting .drvdata
  input: mouse: simplify getting .drvdata
  input: touchscreen: simplify getting .drvdata
  iommu: simplify getting .drvdata
  media: platform: am437x: simplify getting .drvdata
  media: platform: exynos4-is: simplify getting .drvdata
  media: platform: s5p-mfc: simplify getting .drvdata
  mmc: host: simplify getting .drvdata
  mtd: devices: simplify getting .drvdata
  mtd: nand: onenand: simplify getting .drvdata
  net: dsa: simplify getting .drvdata
  net: ethernet: cadence: simplify getting .drvdata
  net: ethernet: davicom: simplify getting .drvdata
  net: ethernet: smsc: simplify getting .drvdata
  net: ethernet: ti: simplify getting .drvdata
  net: ethernet: wiznet: simplify getting .drvdata
  perf: simplify getting .drvdata
  pinctrl: simplify getting .drvdata
  pinctrl: intel: simplify getting .drvdata
  platform: x86: simplify getting .drvdata
  power: supply: simplify getting .drvdata
  ptp: simplify getting .drvdata
  pwm: simplify getting .drvdata
  rtc: simplify getting .drvdata
  slimbus: simplify getting .drvdata
  spi: simplify getting .drvdata
  staging: greybus: simplify getting .drvdata
  staging: iio: adc: simplify getting .drvdata
  staging: nvec: simplify getting .drvdata
  thermal: simplify getting .drvdata
  thermal: int340x_thermal: simplify getting .drvdata
  thermal: st: simplify getting .drvdata
  tty: serial: simplify getting .drvdata
  uio: simplify getting .drvdata
  usb: mtu3: simplify getting .drvdata
  usb: phy: simplify getting .drvdata
  video: fbdev: simplify getting .drvdata
  video: fbdev: omap2: omapfb: displays: simplify getting .drvdata
  watchdog: simplify getting .drvdata
  net: dsa: simplify getting .drvdata
  ASoC: atmel: simplify getting .drvdata

 arch/arm/plat-samsung/adc.c|  3 +-
 drivers/ata/pata_samsung_cf.c  |  8 ++---
 drivers/auxdisplay/arm-charlcd.c   |  6 ++--
 drivers/bus/brcmstb_gisb.c | 12 +++
 drivers/clk/samsung/clk-s3c2410-dclk.c |  6 ++--
 drivers/crypto/exynos-rng.c|  6 ++--
 drivers/crypto/picoxcell_crypto.c  |  6 ++--
 drivers/dma/at_hdmac.c |  9 ++---
 drivers/dma/at_xdmac.c |  9 ++---
 drivers/dma/dw/platform.c  |  6 ++--
 drivers/dma/fsldma.c   |  6 ++--
 drivers/dma/idma64.c   |  6 ++--
 drivers/dma/qcom/hidma.c   |  3 +-
 drivers/dma/qcom/hidma_mgmt_sys.c  |  6 ++--
 drivers/dma/ste_dma40.c| 12 +++
 drivers/dma/txx9dmac.c |  8 ++---

[PATCH 49/61] staging: nvec: simplify getting .drvdata

2018-04-19 Thread Wolfram Sang
We should get drvdata from struct device directly. Going via
platform_device is an unneeded step back and forth.

Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com>
---

Build tested only. buildbot is happy. Please apply individually.

 drivers/staging/nvec/nvec.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c
index 52054a528723..2a5e0dcf4162 100644
--- a/drivers/staging/nvec/nvec.c
+++ b/drivers/staging/nvec/nvec.c
@@ -925,8 +925,7 @@ static int tegra_nvec_remove(struct platform_device *pdev)
 static int nvec_suspend(struct device *dev)
 {
int err;
-   struct platform_device *pdev = to_platform_device(dev);
-   struct nvec_chip *nvec = platform_get_drvdata(pdev);
+   struct nvec_chip *nvec = dev_get_drvdata(dev);
struct nvec_msg *msg;
char ap_suspend[] = { NVEC_SLEEP, AP_SUSPEND };
 
@@ -946,8 +945,7 @@ static int nvec_suspend(struct device *dev)
 
 static int nvec_resume(struct device *dev)
 {
-   struct platform_device *pdev = to_platform_device(dev);
-   struct nvec_chip *nvec = platform_get_drvdata(pdev);
+   struct nvec_chip *nvec = dev_get_drvdata(dev);
 
dev_dbg(nvec->dev, "resuming\n");
tegra_init_i2c_slave(nvec);
-- 
2.11.0

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


Re: [PATCH v3 07/20] i2c: Remove depends on HAS_DMA in case of platform dependency

2018-04-18 Thread Wolfram Sang
On Tue, Apr 17, 2018 at 07:49:07PM +0200, Geert Uytterhoeven wrote:
> Remove dependencies on HAS_DMA where a Kconfig symbol depends on another
> symbol that implies HAS_DMA, and, optionally, on "|| COMPILE_TEST".
> In most cases this other symbol is an architecture or platform specific
> symbol, or PCI.
> 
> Generic symbols and drivers without platform dependencies keep their
> dependencies on HAS_DMA, to prevent compiling subsystems or drivers that
> cannot work anyway.
> 
> This simplifies the dependencies, and allows to improve compile-testing.
> 
> Signed-off-by: Geert Uytterhoeven 
> Reviewed-by: Mark Brown 
> Acked-by: Robin Murphy 

Applied to for-current, thanks!



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


Re: [PATCH v2 00/21] Allow compile-testing NO_DMA (drivers)

2018-03-20 Thread Wolfram Sang

> To play it safe, you want to postpone the subsystem patches until the core
> part has landed upstream. I will rebase and resubmit after v4.17-rc1.

Thanks for the heads up. I'll wait for the rebased patch then and apply
it after rc1 for 4.17.



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


Re: [PATCH v2 00/21] Allow compile-testing NO_DMA (drivers)

2018-03-16 Thread Wolfram Sang

> To avoid allmodconfig/allyesconfig regressions on NO_DMA=y platforms,
> this (drivers) series should be applied after the previous (core)
> series (but not many people may notice/care ;-)

I still don't get if there is a dependency on the core patches. I.e.
shall I apply the subsystem patch now by myself or do you want to push
the series after the core patch and need my ack here?



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


Re: ks7010 firmware upload fail

2017-06-05 Thread Wolfram Sang
Tobin,

> My question is should I be digging further into the MMC code or be doing
> something else with the driver code?

So, you haven't found any branch that worked? No plain v4.9 or the
gen3-sdio branch from my tree?

Regards,

   Wolfram



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


Re: drivers/staging/ks7010 hardware test

2017-05-25 Thread Wolfram Sang
Hi Tobin,

> I began testing the card you sent today. I'm getting a firmware load
> error like you mentioned.

Nice. Firstly, that means the card is alive and survived the mailing.

> I checked out code from when you originally merged into staging,
> however I built the module in a 4.9 kernel.

I think building a vanilla 4.9 kernel is a good choice. I did test the
card with v4.9. I am quite (but not perfectly) sure, I also tested it
with v4.10.

> To help me track down the issue could you please tell me what testing
> you managed to do successfully in the past, and if you can,
> approximately the date you were doing the tests or the git commit of
> the code you tested.

The tests I did are described here:

http://elinux.org/Tests:SDIO-KS7010

The branch I used is mentioned there

https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git/log/?h=renesas/topic/gen3-sdio

but it is based on a branch called renesas-drivers (which is some kind
of stripped down linux-next targeted for Renesas R-Car hardware), so I'd
think v4.9 is the better choice.

The tests were all done End of May 2016.

> Thanks. Oh, also could you please indicate your level of interest my
> continued efforts. I don't want to send you copious emails if you
> would rather me not.

I'm definately interested. I might not be able to review patches, but
for high level questions like this, please CC me. However, give me a few
days for a response.

> The error code is -EILSEQ (Illegal byte sequence). It is returned by
> sdio_memcpy_fromio(). I do not know what it signifies?

I use it rarely, but in this case, I'd think bisecting from v4.9 onwards
is a good choice to tackle this down (given that v4.9 works; otherwise
we'll have to check the MMC layer).

Thanks and all the best,

   Wolfram



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


Re: [bug report] staging: ks7010: add driver from Nanonote extra-repository

2017-04-28 Thread Wolfram Sang
On Fri, Apr 28, 2017 at 04:41:33PM +0300, Dan Carpenter wrote:

Adding Tobin to CC, he is way more into the driver than I am these
days...

> Hello Wolfram Sang,
> 
> The patch 13a9930d15b4: "staging: ks7010: add driver from Nanonote
> extra-repository" from May 31, 2016, leads to the following static
> checker warning:
> 
>   drivers/staging/ks7010/ks_wlan_net.c:1141 ks_wlan_get_range()
>   warn: dead code because of 'i > 2' and 'i < 13'
> 
> drivers/staging/ks7010/ks_wlan_net.c
>   1062  static int ks_wlan_get_range(struct net_device *dev,
>   1063   struct iw_request_info *info,
>   1064   struct iw_point *dwrq, char *extra)
>   1065  {
>   1066  struct ks_wlan_private *priv =
>   1067  (struct ks_wlan_private *)netdev_priv(dev);
>   1068  struct iw_range *range = (struct iw_range *)extra;
>   1069  int i, k;
>   1070  
>   1071  DPRINTK(2, "\n");
>   1072  
>   1073  if (priv->sleep_mode == SLP_SLEEP)
>   1074  return -EPERM;
>   1075  
>   1076  /* for SLEEP MODE */
>   1077  dwrq->length = sizeof(struct iw_range);
>   1078  memset(range, 0, sizeof(*range));
>   1079  range->min_nwid = 0x;
>   1080  range->max_nwid = 0x;
>   1081  range->num_channels = 14;
>   1082  /* Should be based on cap_rid.country to give only
>   1083   * what the current card support
>   1084   */
>   1085  k = 0;
>   1086  for (i = 0; i < 13; i++) {  /* channel 1 -- 13 */
> ^^
>   1087  range->freq[k].i = i + 1;   /* List index */
>   1088  range->freq[k].m = frequency_list[i] * 10;
>   1089  range->freq[k++].e = 1; /* Values in table in MHz -> 
> * 10^5 * 10 */
>   1090  }
> 
> i is always 13 after the loop.
> 
>   1091  range->num_frequency = k;
>   1092  if (priv->reg.phy_type == D_11B_ONLY_MODE || 
> priv->reg.phy_type == D_11BG_COMPATIBLE_MODE) {/* channel 14 */
>   1093  range->freq[13].i = 14; /* List index */
>   1094  range->freq[13].m = frequency_list[13] * 10;
>   1095  range->freq[13].e = 1;  /* Values in table in MHz -> 
> * 10^5 * 10 */
>   1096  range->num_frequency = 14;
>   1097  }
>   1098  
>   1099  /* Hum... Should put the right values there */
>   1100  range->max_qual.qual = 100;
>   1101  range->max_qual.level = 256 - 128;  /* 0 dBm? */
>   1102  range->max_qual.noise = 256 - 128;
>   1103  range->sensitivity = 1;
>   1104  
>   1105  if (priv->reg.phy_type == D_11B_ONLY_MODE) {
>   1106  range->bitrate[0] = 1e6;
>   1107  range->bitrate[1] = 2e6;
>   1108  range->bitrate[2] = 5.5e6;
>   1109  range->bitrate[3] = 11e6;
>   1110  range->num_bitrates = 4;
>     } else {/* D_11G_ONLY_MODE or D_11BG_COMPATIBLE_MODE 
> */
>   1112  range->bitrate[0] = 1e6;
>   1113  range->bitrate[1] = 2e6;
>   1114  range->bitrate[2] = 5.5e6;
>   1115  range->bitrate[3] = 11e6;
>   1116  
>   1117  range->bitrate[4] = 6e6;
>   1118  range->bitrate[5] = 9e6;
>   1119  range->bitrate[6] = 12e6;
>   1120  if (IW_MAX_BITRATES < 9) {
>   1121  range->bitrate[7] = 54e6;
>   1122  range->num_bitrates = 8;
>   1123  } else {
>   1124  range->bitrate[7] = 18e6;
>   1125  range->bitrate[8] = 24e6;
>   1126  range->bitrate[9] = 36e6;
>   1127  range->bitrate[10] = 48e6;
>   1128  range->bitrate[11] = 54e6;
>   1129  
>   1130  range->num_bitrates = 12;
>   1131  }
>   1132  }
>   1133  
>   1134  /* Set an indication of the max TCP throughput
>   1135   * in bit/s that we can expect using this interface.
>   1136   * May be use for QoS stuff... Jean II
>   1137   */
>   1138  if (i > 2)
> ^
> So this condition is always true.  I'm not sure what was intended,
> though.
> 
>   1139  range->throughput = 5000 * 1000;
>   1140  else
>   1141  range->throughput = 1500 * 1000;
>   1142  
> 
> regards,
> dan carpenter


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


Re: [PATCH RFC] remove custom Michael MIC implementation

2017-04-28 Thread Wolfram Sang
Hi Tobin,

> over this last month :). This is the reason for this email. Can I
> please take you up on the offer of the SDW-823 card, if you can find
> it?

Sure, I have it here. Just mail me (privately) the address to send it
to and I'll ship right away.

> Secondly, I think I should spend some time studying the mwifiex
> (SoftMAC) and ath6kl (FullMAC) drivers to get a handle on cfg80211.

That sounds like a good plan. Great progress you made, really!

> Do you have any other data on the chipset? Have you had any
> interaction with Renesas?

Nope, sadly not. I do work for Renesas as a contractor, but it is a huge
company and I work for a totally different section (SoCs). Plus, it is 8
years old data and it might be only available in Japanese, so I wouldn't
have high hopes. Any specific information you are missing?

All the best,

   Wolfram


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


Re: ks7010 endianness question

2017-04-19 Thread Wolfram Sang

> I think we can call this question resolved. Remove the comment and
> change the hostif_hdr description to
> 
> struct hostif_hdr {
>   __be16 size;
>   __be16 event;
> } __packed;
> 
> Are you happy with this?

Yes, I trust you.



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


Re: [PATCH RFC] remove custom Michael MIC implementation

2017-03-31 Thread Wolfram Sang
Hi,

> The card I have is a Spectec FCC ID: S2Y-WLAN-11B-G which I believe is
> a SDW-823 and should use the ks7010 driver.

Sorry, likely not. It is an early SDW-821 and has a MediaTek chipset for
which no driver is known:
https://wikidevi.com/wiki/Spectec_SDW-821_%28MediaTek%29

For SDW-821 (SD size) and KS7010, you'd need a "S2Y-WLAN-11G-K" (but I
have never seen one yet):
https://wikidevi.com/wiki/Spectec_SDW-821_%28KeyStream%29

One can find an SDW-823 (microSD) "S2Y-MWLAN-11B-G" once in a while:
https://wikidevi.com/wiki/Spectec_SDW-823

> > Without the CFG80211 conversion, replacing the Michael custom
> > implementation with the in-kernel one makes the driver a tad better and
> > is good exercise. However, it will sadly not help to get the driver out
> > of staging.
> 
> I'll drop it then. Could you please tell me, is there any thing else
> more I need to do to let LKML know that this RFC is dropped? Or is
> this reply enough. I don't want to use any ones time unnecessarily.

That should do.

> Let's go for a CFG80211 driver and get out of staging :) So next step
> is I guess study the ath6kl driver, learn how CFG80211 is done and
> implement that interface in ks7010? Oh, and test that it works.

Yes, have a look around and check if you like that task. I might have a
spare SDW-823 lying around if you are up to it. But check first, it is
not a trivial task. On the pro side, there are tons of interesting
things about WiFI and kernel development to learn on the way :)

Regards,

   Wolfram



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


Re: [PATCH RFC] remove custom Michael MIC implementation

2017-03-31 Thread Wolfram Sang

> The code is untested, I have hardware in the mail.

Cool!

> If any one is interested and has any comments I would really like to
> hear them. I am open to all suggestions (even down to trivial coding
> style issues).

I'll just repeat that the key move to get this driver out of staging is
to get away from the WEXT interface to CFG80211. Otherwise no chance
that wireless maintainers will even look at it. This is a huge change
but once it is done, features like Michael MIC come with it for free
(from what I recall, I am not a wireless expert myself).

Without the CFG80211 conversion, replacing the Michael custom
implementation with the in-kernel one makes the driver a tad better and
is good exercise. However, it will sadly not help to get the driver out
of staging.

But if you want a clean WEXT driver first, this is a step in the right
direction.



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


Re: Michael MIC

2017-03-16 Thread Wolfram Sang
Hi,

> Is there some technical reason why module ks7010 includes a
> implementation of Michael MIC instead of using the implementation in
> crypto/?
> 
> Or is this covered by the statement from the TODO
> 
> - check what other upstream wireless mechanisms can be used instead of the
>   custom ones here

Exactly. Furthermore, for this driver to ever go upstream, it needs to
be converted from WEXT to cfg80211. I didn't look super much into it,
but from what I grasped, the Michael conversion comes with the above
conversion "for free".

Regards,

   Wolfram



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


Re: [PATCH 2/2] staging: ks7010: remove dead code

2017-03-15 Thread Wolfram Sang
On Wed, Mar 15, 2017 at 01:57:32PM +1100, Tobin C. Harding wrote:
> Driver has dead code compiled out using preprocessor directives. TODO
> file asks for these not to be removed - ignore this.

Why?



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


Re: [PATCH v2 00/10] staging: ks7010: Fine-tuning for a SDIO card driver

2016-08-13 Thread Wolfram Sang
On Thu, Aug 11, 2016 at 07:17:12AM +0200, SF Markus Elfring wrote:
> From: Markus Elfring 
> 
> Further update suggestions were taken into account

Which ones? Please describe them to ease review.

> after a patch was applied from static source code analysis.

I added some Acked- and Reviewed-by tags last time. Did the patches
change or why didn't you add them?



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


Re: staging: ks7010: Replace three printk() calls by pr_err()

2016-08-12 Thread Wolfram Sang

> Nothing what I would find noteworthy for increasing the usage of a function
> like "dev_err".
> 
> Are you on "a mission" to improve software around logging calls a bit more?

I have two of those cards and I would like to know which one caused an
error. dev_err helps with exactly that.



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


[PATCH 3/6] staging: media: lirc: lirc_sasem: don't print error when allocating urb fails

2016-08-11 Thread Wolfram Sang
kmalloc will print enough information in case of failure.

Signed-off-by: Wolfram Sang <wsa-...@sang-engineering.com>
---
 drivers/staging/media/lirc/lirc_sasem.c | 5 -
 1 file changed, 5 deletions(-)

diff --git a/drivers/staging/media/lirc/lirc_sasem.c 
b/drivers/staging/media/lirc/lirc_sasem.c
index 2218d0042030ed..b080fde6d740c9 100644
--- a/drivers/staging/media/lirc/lirc_sasem.c
+++ b/drivers/staging/media/lirc/lirc_sasem.c
@@ -758,17 +758,12 @@ static int sasem_probe(struct usb_interface *interface,
}
rx_urb = usb_alloc_urb(0, GFP_KERNEL);
if (!rx_urb) {
-   dev_err(>dev,
-   "%s: usb_alloc_urb failed for IR urb\n", __func__);
alloc_status = 5;
goto alloc_status_switch;
}
if (vfd_ep_found) {
tx_urb = usb_alloc_urb(0, GFP_KERNEL);
if (!tx_urb) {
-   dev_err(>dev,
-   "%s: usb_alloc_urb failed for VFD urb",
-   __func__);
alloc_status = 6;
goto alloc_status_switch;
}
-- 
2.8.1

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


[PATCH 2/6] staging: media: lirc: lirc_imon: don't print error when allocating urb fails

2016-08-11 Thread Wolfram Sang
kmalloc will print enough information in case of failure.

Signed-off-by: Wolfram Sang <wsa-...@sang-engineering.com>
---
 drivers/staging/media/lirc/lirc_imon.c | 9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/media/lirc/lirc_imon.c 
b/drivers/staging/media/lirc/lirc_imon.c
index ff1926ca1f96f5..a183e68ec32089 100644
--- a/drivers/staging/media/lirc/lirc_imon.c
+++ b/drivers/staging/media/lirc/lirc_imon.c
@@ -797,16 +797,11 @@ static int imon_probe(struct usb_interface *interface,
goto free_rbuf;
}
rx_urb = usb_alloc_urb(0, GFP_KERNEL);
-   if (!rx_urb) {
-   dev_err(dev, "%s: usb_alloc_urb failed for IR urb\n", __func__);
+   if (!rx_urb)
goto free_lirc_buf;
-   }
tx_urb = usb_alloc_urb(0, GFP_KERNEL);
-   if (!tx_urb) {
-   dev_err(dev, "%s: usb_alloc_urb failed for display urb\n",
-   __func__);
+   if (!tx_urb)
goto free_rx_urb;
-   }
 
mutex_init(>ctx_lock);
context->vfd_proto_6p = vfd_proto_6p;
-- 
2.8.1

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


[PATCH 6/6] staging: vt6656: main_usb: don't print error when allocating urb fails

2016-08-11 Thread Wolfram Sang
kmalloc will print enough information in case of failure.

Signed-off-by: Wolfram Sang <wsa-...@sang-engineering.com>
---
 drivers/staging/vt6656/main_usb.c | 12 +++-
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/vt6656/main_usb.c 
b/drivers/staging/vt6656/main_usb.c
index ac4fecb30d0e9c..0594828bdabf92 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -440,10 +440,8 @@ static bool vnt_alloc_bufs(struct vnt_private *priv)
 
/* allocate URBs */
tx_context->urb = usb_alloc_urb(0, GFP_KERNEL);
-   if (!tx_context->urb) {
-   dev_err(>usb->dev, "alloc tx urb failed\n");
+   if (!tx_context->urb)
goto free_tx;
-   }
 
tx_context->in_use = false;
}
@@ -462,10 +460,8 @@ static bool vnt_alloc_bufs(struct vnt_private *priv)
 
/* allocate URBs */
rcb->urb = usb_alloc_urb(0, GFP_KERNEL);
-   if (!rcb->urb) {
-   dev_err(>usb->dev, "Failed to alloc rx urb\n");
+   if (!rcb->urb)
goto free_rx_tx;
-   }
 
rcb->skb = dev_alloc_skb(priv->rx_buf_sz);
if (!rcb->skb)
@@ -479,10 +475,8 @@ static bool vnt_alloc_bufs(struct vnt_private *priv)
}
 
priv->interrupt_urb = usb_alloc_urb(0, GFP_KERNEL);
-   if (!priv->interrupt_urb) {
-   dev_err(>usb->dev, "Failed to alloc int urb\n");
+   if (!priv->interrupt_urb)
goto free_rx_tx;
-   }
 
priv->int_buf.data_buf = kmalloc(MAX_INTERRUPT_SIZE, GFP_KERNEL);
if (!priv->int_buf.data_buf) {
-- 
2.8.1

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


[PATCH 0/6] staging: don't print error when allocating urb fails

2016-08-11 Thread Wolfram Sang
This per-subsystem series is part of a tree wide cleanup. usb_alloc_urb() uses
kmalloc which already prints enough information on failure. So, let's simply
remove those "allocation failed" messages from drivers like we did already for
other -ENOMEM cases. gkh acked this approach when we talked about it at LCJ in
Tokyo a few weeks ago.


Wolfram Sang (6):
  staging: comedi: drivers: usbduxfast: don't print error when
allocating urb fails
  staging: media: lirc: lirc_imon: don't print error when allocating urb
fails
  staging: media: lirc: lirc_sasem: don't print error when allocating
urb fails
  staging: most: hdm-usb: hdm_usb: don't print error when allocating urb
fails
  staging: rtl8192u: r8192U_core: don't print error when allocating urb
fails
  staging: vt6656: main_usb: don't print error when allocating urb fails

 drivers/staging/comedi/drivers/usbduxfast.c |  4 +---
 drivers/staging/media/lirc/lirc_imon.c  |  9 ++---
 drivers/staging/media/lirc/lirc_sasem.c |  5 -
 drivers/staging/most/hdm-usb/hdm_usb.c  |  4 +---
 drivers/staging/rtl8192u/r8192U_core.c  |  5 +
 drivers/staging/vt6656/main_usb.c   | 12 +++-
 6 files changed, 8 insertions(+), 31 deletions(-)

-- 
2.8.1

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


[PATCH 4/6] staging: most: hdm-usb: hdm_usb: don't print error when allocating urb fails

2016-08-11 Thread Wolfram Sang
kmalloc will print enough information in case of failure.

Signed-off-by: Wolfram Sang <wsa-...@sang-engineering.com>
---
 drivers/staging/most/hdm-usb/hdm_usb.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/most/hdm-usb/hdm_usb.c 
b/drivers/staging/most/hdm-usb/hdm_usb.c
index aeae071f282321..9ec29788c0471f 100644
--- a/drivers/staging/most/hdm-usb/hdm_usb.c
+++ b/drivers/staging/most/hdm-usb/hdm_usb.c
@@ -650,10 +650,8 @@ static int hdm_enqueue(struct most_interface *iface, int 
channel,
return -ENODEV;
 
urb = usb_alloc_urb(NO_ISOCHRONOUS_URB, GFP_ATOMIC);
-   if (!urb) {
-   dev_err(dev, "Failed to allocate URB\n");
+   if (!urb)
return -ENOMEM;
-   }
 
anchor = kzalloc(sizeof(*anchor), GFP_ATOMIC);
if (!anchor) {
-- 
2.8.1

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


[PATCH 1/6] staging: comedi: drivers: usbduxfast: don't print error when allocating urb fails

2016-08-11 Thread Wolfram Sang
kmalloc will print enough information in case of failure.

Signed-off-by: Wolfram Sang <wsa-...@sang-engineering.com>
---
 drivers/staging/comedi/drivers/usbduxfast.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/comedi/drivers/usbduxfast.c 
b/drivers/staging/comedi/drivers/usbduxfast.c
index 10f94ec3453606..608403c7586b76 100644
--- a/drivers/staging/comedi/drivers/usbduxfast.c
+++ b/drivers/staging/comedi/drivers/usbduxfast.c
@@ -946,10 +946,8 @@ static int usbduxfast_auto_attach(struct comedi_device 
*dev,
}
 
devpriv->urb = usb_alloc_urb(0, GFP_KERNEL);
-   if (!devpriv->urb) {
-   dev_err(dev->class_dev, "Could not alloc. urb\n");
+   if (!devpriv->urb)
return -ENOMEM;
-   }
 
devpriv->inbuf = kmalloc(SIZEINBUF, GFP_KERNEL);
if (!devpriv->inbuf)
-- 
2.8.1

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


[PATCH 5/6] staging: rtl8192u: r8192U_core: don't print error when allocating urb fails

2016-08-11 Thread Wolfram Sang
kmalloc will print enough information in case of failure.

Signed-off-by: Wolfram Sang <wsa-...@sang-engineering.com>
---
 drivers/staging/rtl8192u/r8192U_core.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
b/drivers/staging/rtl8192u/r8192U_core.c
index dd0970facdf5bd..7af1af8c6616f4 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -1702,11 +1702,8 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff 
*skb)
}
if (bSend0Byte) {
tx_urb_zero = usb_alloc_urb(0, GFP_ATOMIC);
-   if (!tx_urb_zero) {
-   RT_TRACE(COMP_ERR,
-"can't alloc urb for zero byte\n");
+   if (!tx_urb_zero)
return -ENOMEM;
-   }
usb_fill_bulk_urb(tx_urb_zero, udev,
  usb_sndbulkpipe(udev, idx_pipe),
  , 0, tx_zero_isr, dev);
-- 
2.8.1

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


Re: staging: ks7010: Replace three printk() calls by pr_err()

2016-08-11 Thread Wolfram Sang
On Wed, Aug 10, 2016 at 09:41:37PM +0200, SF Markus Elfring wrote:
> >> Please and and use pr_fmt
> > 
> > Can't we use dev_* on the SDIO device?
> 
> How should a connection be constructed from the data structure 
> "sdio_device_id"
> to the corresponding device information for such an use case?

What did you try so far?



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


Re: [PATCH] staging: ks7010: declare private functions static

2016-07-26 Thread Wolfram Sang
On Tue, Jul 26, 2016 at 06:48:00AM +, Nicholas Mc Guire wrote:
> On Mon, Jul 25, 2016 at 11:04:18PM +0200, Wolfram Sang wrote:
> > On Mon, Jul 25, 2016 at 09:22:27PM +0200, Nicholas Mc Guire wrote:
> > > Private functions in ks_hostif.c can be declared static. 
> > > 
> > > Fixes: 13a9930d15b4 ("staging: ks7010: add driver from Nanonote 
> > > extra-repository")
> > > 
> > > Signed-off-by: Nicholas Mc Guire <hof...@osadl.org>
> > 
> > Reviewed-by: Wolfram Sang <w...@the-dreams.de>
> > 
> > drivers/staging/ks7010/ks7010_sdio.c and
> > drivers/staging/ks7010/ks_wlan_net.c have similar warnings in case you'd
> > like to fix those, too.)
> > 
> the cases found regarding completion were:
> ./drivers/staging/ks7010/ks_hostif.c:80 treating signal case as success
> ./drivers/staging/ks7010/ks_wlan_net.c:109 treating signal case as success
> ./drivers/staging/ks7010/ks7010_sdio.c:901 treating signal case as success
> ./drivers/staging/ks7010/ks7010_sdio.c:929 treating signal case as success
> ./drivers/video/fbdev/exynos/exynos_mipi_dsi_common.c:383 treating signal 
> case as success
> ./drivers/video/fbdev/exynos/exynos_mipi_dsi_common.c:247 treating signal 
> case as success
> 
> will be going through all of them in the next days. 

Awesome, thanks!

I meant the "should it be static?" sparse warnings here, though :)



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


Re: [PATCH] staging: ks7010: declare private functions static

2016-07-25 Thread Wolfram Sang
On Mon, Jul 25, 2016 at 09:22:27PM +0200, Nicholas Mc Guire wrote:
> Private functions in ks_hostif.c can be declared static. 
> 
> Fixes: 13a9930d15b4 ("staging: ks7010: add driver from Nanonote 
> extra-repository")
> 
> Signed-off-by: Nicholas Mc Guire <hof...@osadl.org>

Reviewed-by: Wolfram Sang <w...@the-dreams.de>

drivers/staging/ks7010/ks7010_sdio.c and
drivers/staging/ks7010/ks_wlan_net.c have similar warnings in case you'd
like to fix those, too.)



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


Re: [PATCH] staging: ks7010: fix wait_for_completion_interruptible_timeout return handling

2016-07-25 Thread Wolfram Sang
On Mon, Jul 25, 2016 at 09:21:50PM +0200, Nicholas Mc Guire wrote:
> wait_for_completion_interruptible_timeout return 0 on timeout and 
> -ERESTARTSYS if interrupted. The check for 
> !wait_for_completion_interruptible_timeout() would report an interrupt
> as timeout. Further, while HZ/50 will work most of the time it could 

Wouldn't it interpret -ERESTARTSYS as *no timeout*?

Anyway, the plain !0 comparison for me clearly shows that
'interruptible' was more copy then really planned or supported.
If it was, it would need to cancel something. Also, 20ms is pretty hard
to cancel for a user ;) Given all that and the troubles we had with
'interruptible' in the I2C subsystem, I'd much vote for dropping
interruptible here.

> fail for HZ < 50, so this is switched to msecs_to_jiffies(20).

Rest looks good, thanks!



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


Re: staging: ks7010: Return directly after a failed kmalloc()

2016-07-22 Thread Wolfram Sang
On Fri, Jul 22, 2016 at 09:36:53AM +0200, SF Markus Elfring wrote:
> >> I guess that further clarification might be needed for affected
> >> implementation details.
> > 
> > That's OK, too.
> > 
> > Acked-by: Wolfram Sang <w...@the-dreams.de>
> 
> Does this acknowledgement include also the acceptance for
> the suggested change around calls of the functions "sdio_claim_host"
> and "sdio_release_host" within the implementation of the
> function "ks7010_upload_firmware"?

Likely. Send a patch and we will see.



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


Re: staging: ks7010: Delete unnecessary uses of the variable "retval"

2016-07-21 Thread Wolfram Sang

> Do you find such a source code transformation useful?

No. I already gave that answer by agreeing to Julia's viewpoint.



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


Re: [PATCH] Staging: ks7010: michael_mic: fixed macros coding style issue

2016-07-21 Thread Wolfram Sang
On Tue, Jul 19, 2016 at 09:51:06AM +0800, Bing Sun wrote:
> Fixed coding style issue:
> Enclose multiple statements macros definition in a do while loop.
> Use one space around binary operators.
> 
> Signed-off-by: Bing Sun <sunb...@redflag-linux.com>

Reviewed-by: Wolfram Sang <w...@the-dreams.de>

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


Re: staging: ks7010: Delete unnecessary uses of the variable "retval"

2016-07-21 Thread Wolfram Sang
On Thu, Jul 21, 2016 at 03:35:03PM +0200, SF Markus Elfring wrote:
> > if (atomic_read(>sleepstatus.status) == 0) {
> > rw_data = GCR_B_DOZE;
> > -   retval =
> > -   ks7010_sdio_write(priv, GCR_B, _data, 
> > sizeof(rw_data));
> > -   if (retval) {
> > +   if (ks7010_sdio_write(priv,
> > + GCR_B,
> > + _data,
> > + sizeof(rw_data))) {
> 
>  A multi-line function call in an if test does not look nice at all.  The
>  original code was an easy-to-read expectable pattern.
> >>>
> >>> I agree. I am not strict on the 80 char limit, especially in cases like
> >>> the above.
> 
> Will this line length limitation trigger any more collateral evolution
> in the discussed software module?
> 
> 
> >> Would you try an other source code formatting for the suggested change 
> >> pattern?
> > 
> > I don't understand the question?
> 
> Can you follow expectations around the proposed refactoring of any
> function implementations?

I don't understand both questions. Maybe you need to give examples?



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


Re: staging: ks7010: Delete unnecessary uses of the variable "retval"

2016-07-21 Thread Wolfram Sang

> > * Do you really want to assign every return value from a function call
> >   to an extra variable before it is used again?
> 
> If it's a choice between 1) function call on many lines, 2) function call
> over 80 characters, and 3) extra variable, I definitely prefer the extra
> variable.

+1



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


Re: [PATCH 5/9] staging: ks7010: Delete unnecessary uses of the variable "retval"

2016-07-21 Thread Wolfram Sang
On Thu, Jul 21, 2016 at 09:26:33AM +0200, Julia Lawall wrote:
> 
> 
> On Thu, 21 Jul 2016, Wolfram Sang wrote:
> 
> >
> > > >>>   if (atomic_read(>sleepstatus.status) == 0) {
> > > >>>   rw_data = GCR_B_DOZE;
> > > >>> - retval =
> > > >>> - ks7010_sdio_write(priv, GCR_B, _data, 
> > > >>> sizeof(rw_data));
> > > >>> - if (retval) {
> > > >>> + if (ks7010_sdio_write(priv,
> > > >>> +   GCR_B,
> > > >>> +   _data,
> > > >>> +   sizeof(rw_data))) {
> > > >>
> > > >> A multi-line function call in an if test does not look nice at all.  
> > > >> The
> > > >> original code was an easy-to-read expectable pattern.
> > > >
> > > > I agree. I am not strict on the 80 char limit, especially in cases like
> > > > the above.
> > >
> > > Would you try an other source code formatting for the suggested change 
> > > pattern?
> >
> > I don't understand the question?
> 
> I think the original code was fine.  x = blah(); if (x) ... is a perfectly
> familiar kernel coding pattern.  There is no benefit in terms of
> performance or understandability in dropping the variable.

I certainly agree to that.



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


Re: [PATCH 5/9] staging: ks7010: Delete unnecessary uses of the variable "retval"

2016-07-21 Thread Wolfram Sang

> >>>   if (atomic_read(>sleepstatus.status) == 0) {
> >>>   rw_data = GCR_B_DOZE;
> >>> - retval =
> >>> - ks7010_sdio_write(priv, GCR_B, _data, sizeof(rw_data));
> >>> - if (retval) {
> >>> + if (ks7010_sdio_write(priv,
> >>> +   GCR_B,
> >>> +   _data,
> >>> +   sizeof(rw_data))) {
> >>
> >> A multi-line function call in an if test does not look nice at all.  The
> >> original code was an easy-to-read expectable pattern.
> > 
> > I agree. I am not strict on the 80 char limit, especially in cases like
> > the above.
> 
> Would you try an other source code formatting for the suggested change 
> pattern?

I don't understand the question?



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


Re: [PATCH 3/9] staging: ks7010: Return directly after a failed kmalloc()

2016-07-21 Thread Wolfram Sang
On Wed, Jul 20, 2016 at 08:40:11PM +0200, SF Markus Elfring wrote:
> >>> @@ -713,10 +713,8 @@ static int ks7010_sdio_update_index(struct 
> >>> ks_wlan_private *priv, u32 index)
> >>>   unsigned char *data_buf;
> >>>
> >>>   data_buf = kmalloc(sizeof(u32), GFP_KERNEL);
> >>> - if (!data_buf) {
> >>> - rc = 1;
> >>> - goto error_out;
> >>> - }
> >>> + if (!data_buf)
> >>> + return 1;
> >>
> >> One could rather wonder why the function has such strange error values...
> > 
> > Agreed. Markus, can you check if we can use -ENOMEM in those places.
> 
> I find that I do not know this software good enough at the moment
> so that I could safely decide on the shown special error values.
> I guess that further clarification might be needed for affected
> implementation details.

That's OK, too.

Acked-by: Wolfram Sang <w...@the-dreams.de>



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


Re: staging: ks7010: Rename jump labels

2016-07-21 Thread Wolfram Sang

Thank you very much for the heads up, Jean!



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


Re: [PATCH 9/9] staging: ks7010: Delete three unnecessary variable initialisations

2016-07-20 Thread Wolfram Sang
On Sun, Jul 17, 2016 at 08:51:39PM +0200, Julia Lawall wrote:
> 
> 
> On Sun, 17 Jul 2016, SF Markus Elfring wrote:
> 
> > From: Markus Elfring 
> > Date: Sun, 17 Jul 2016 19:40:47 +0200
> >
> > Three variables will be set to an appropriate value a bit later.
> > Thus omit the explicit initialisation at the beginning.
> >
> > Signed-off-by: Markus Elfring 
> > ---
> >  drivers/staging/ks7010/ks7010_sdio.c | 8 
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
> > b/drivers/staging/ks7010/ks7010_sdio.c
> > index e06bc3c..3c62c57 100644
> > --- a/drivers/staging/ks7010/ks7010_sdio.c
> > +++ b/drivers/staging/ks7010/ks7010_sdio.c
> > @@ -323,14 +323,14 @@ static void tx_device_task(void *dev)
> >  {
> > struct ks_wlan_private *priv = (struct ks_wlan_private *)dev;
> > struct tx_device_buffer *sp;
> > -   int rc = 0;
> >
> > DPRINTK(4, "\n");
> > if (cnt_txqbody(priv) > 0
> > && atomic_read(>psstatus.status) != PS_SNOOZE) {
> > sp = >tx_dev.tx_dev_buff[priv->tx_dev.qhead];
> > if (priv->dev_state >= DEVICE_STATE_BOOT) {
> > -   rc = write_to_device(priv, sp->sendp, sp->size);
> > +   int rc = write_to_device(priv, sp->sendp, sp->size);
> 
> This does not look appealing to me, neither the declaration in the middle
> of the function, nor the intiialization to the result of a complex
> expression, nor the separation of the call and the error checking code by
> a blank line.  There is nothing wrong with having the rc variable be
> declared at the the top of the function, in its normal place.

+1



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


Re: [PATCH] Staging: ks7010: michael_mic: fixed macros coding style issue

2016-07-20 Thread Wolfram Sang
On Tue, Jul 19, 2016 at 09:51:06AM +0800, Bing Sun wrote:
> Fixed coding style issue:
> Enclose multiple statements macros definition in a do while loop.
> Use one space around binary operators.
> 
> Signed-off-by: Bing Sun 

Looks good for what it is. One comment below. I will test this tomorrow.

> ---
>  drivers/staging/ks7010/michael_mic.c | 20 +---
>  1 file changed, 13 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/staging/ks7010/michael_mic.c 
> b/drivers/staging/ks7010/michael_mic.c
> index e14c109..d332678 100644
> --- a/drivers/staging/ks7010/michael_mic.c
> +++ b/drivers/staging/ks7010/michael_mic.c
> @@ -20,15 +20,21 @@
>  #define getUInt32( A, B )(uint32_t)(A[B+0] << 0) + (A[B+1] << 8) + 
> (A[B+2] << 16) + (A[B+3] << 24)
>  
>  // Convert from UInt32 to Byte[] in a portable way
> -#define putUInt32( A, B, C ) A[B+0] = (uint8_t) (C & 0xff);  
> \
> - A[B+1] = (uint8_t) ((C>>8) & 0xff); \
> - A[B+2] = (uint8_t) ((C>>16) & 0xff);\
> - A[B+3] = (uint8_t) ((C>>24) & 0xff)
> +#define putUInt32(A, B, C)   \
> +do { \
> + A[B + 0] = (uint8_t)(C & 0xff); \
> + A[B + 1] = (uint8_t)((C >> 8) & 0xff);  \
> + A[B + 2] = (uint8_t)((C >> 16) & 0xff); \
> + A[B + 3] = (uint8_t)((C >> 24) & 0xff); \
> +} while (0)

We surely have helper functions for this in the kernel?

>  
>  // Reset the state to the empty message.
> -#define MichaelClear( A )A->L = A->K0; \
> - A->R = A->K1; \
> - A->nBytesInM = 0;
> +#define MichaelClear(A)  \
> +do { \
> + A->L = A->K0;   \
> + A->R = A->K1;   \
> + A->nBytesInM = 0;   \
> +} while (0)
>  
>  static
>  void MichaelInitializeFunction(struct michel_mic_t *Mic, uint8_t * key)
> -- 
> 2.1.0
> 


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


Re: [PATCH 6/9] staging: ks7010: Delete unnecessary braces

2016-07-20 Thread Wolfram Sang
On Sun, Jul 17, 2016 at 08:55:41PM +0200, Julia Lawall wrote:
> 
> 
> On Sun, 17 Jul 2016, SF Markus Elfring wrote:
> 
> > From: Markus Elfring 
> > Date: Sun, 17 Jul 2016 18:39:03 +0200
> >
> > Do not use curly brackets at some source code places
> > where a single statement should be sufficient.
> >
> > Signed-off-by: Markus Elfring 
> > ---
> >  drivers/staging/ks7010/ks7010_sdio.c | 48 
> > 
> >  1 file changed, 16 insertions(+), 32 deletions(-)
> >
> > diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
> > b/drivers/staging/ks7010/ks7010_sdio.c
> > index b3ca8e2..1e072e3 100644
> > --- a/drivers/staging/ks7010/ks7010_sdio.c
> > +++ b/drivers/staging/ks7010/ks7010_sdio.c
> > @@ -109,9 +109,8 @@ void ks_wlan_hw_sleep_doze_request(struct 
> > ks_wlan_private *priv)
> > DPRINTK(3, "sleep_mode=SLP_SLEEP\n");
> > atomic_set(>sleepstatus.status, 1);
> > priv->last_doze = jiffies;
> > -   } else {
> > +   } else
> > DPRINTK(1, "sleep_mode=%d\n", priv->sleep_mode);
> > -   }
> 
> This is a violation of CodingStyle:

Julia is right again, I agree.



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


Re: [PATCH 4/9] staging: ks7010: Rename jump labels

2016-07-20 Thread Wolfram Sang
On Sun, Jul 17, 2016 at 08:20:12PM +0200, SF Markus Elfring wrote:
> From: Markus Elfring 
> Date: Sun, 17 Jul 2016 16:26:18 +0200
> 
> Adjust jump targets according to the Linux coding style convention.

Really? Is that documented somewhere?

Quoting Jean Delvare:

"> It is generally accepted to indent labels with a single space. This
 > avoids breaking the -p option of diff."

So, NACK for now unless we know 'diff' has been fixed.



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


Re: [PATCH 7/9] staging: ks7010: Replace three printk() calls by pr_err()

2016-07-20 Thread Wolfram Sang
On Sun, Jul 17, 2016 at 01:26:03PM -0700, Joe Perches wrote:
> On Sun, 2016-07-17 at 20:27 +0200, SF Markus Elfring wrote:
> > From: Markus Elfring 
> > Date: Sun, 17 Jul 2016 19:12:27 +0200
> > 
> > Prefer usage of the macro "pr_err" over the interface "printk".
> > Fix a typo in an error message.
> 
> Please and and use pr_fmt

Can't we use dev_* on the SDIO device?



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


Re: [PATCH 8/9] staging: ks7010: Delete a variable in write_to_device()

2016-07-20 Thread Wolfram Sang
On Sun, Jul 17, 2016 at 08:28:44PM +0200, SF Markus Elfring wrote:
> From 01291121668ccb54f1a784765a8d2b5811afa75a Mon Sep 17 00:00:00 2001
> From: Markus Elfring <elfr...@users.sourceforge.net>
> Date: Sun, 17 Jul 2016 19:26:15 +0200
> Subject: [PATCH 8/9] staging: ks7010: Delete a variable in write_to_device()
> 
> The local variable "rc" was assigned a zero at one place.
> But it was not read within this function. Thus delete it.
> 
> Signed-off-by: Markus Elfring <elfr...@users.sourceforge.net>

Reviewed-by: Wolfram Sang <w...@the-dreams.de>



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


Re: [PATCH 5/9] staging: ks7010: Delete unnecessary uses of the variable "retval"

2016-07-20 Thread Wolfram Sang
On Sun, Jul 17, 2016 at 08:56:59PM +0200, Julia Lawall wrote:
> 
> 
> On Sun, 17 Jul 2016, SF Markus Elfring wrote:
> 
> > From: Markus Elfring 
> > Date: Sun, 17 Jul 2016 18:15:23 +0200
> >
> > Some return values can also be directly used for various condition checks.
> > Thus remove a local variable for intermediate assignments.
> >
> > Signed-off-by: Markus Elfring 
> > ---
> >  drivers/staging/ks7010/ks7010_sdio.c | 81 
> > +++-
> >  1 file changed, 34 insertions(+), 47 deletions(-)
> >
> > diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
> > b/drivers/staging/ks7010/ks7010_sdio.c
> > index eea18fb..b3ca8e2 100644
> > --- a/drivers/staging/ks7010/ks7010_sdio.c
> > +++ b/drivers/staging/ks7010/ks7010_sdio.c
> > @@ -90,7 +90,6 @@ static int ks7010_sdio_write(struct ks_wlan_private 
> > *priv, unsigned int address,
> >  void ks_wlan_hw_sleep_doze_request(struct ks_wlan_private *priv)
> >  {
> > unsigned char rw_data;
> > -   int retval;
> >
> > DPRINTK(4, "\n");
> >
> > @@ -99,9 +98,10 @@ void ks_wlan_hw_sleep_doze_request(struct 
> > ks_wlan_private *priv)
> >
> > if (atomic_read(>sleepstatus.status) == 0) {
> > rw_data = GCR_B_DOZE;
> > -   retval =
> > -   ks7010_sdio_write(priv, GCR_B, _data, sizeof(rw_data));
> > -   if (retval) {
> > +   if (ks7010_sdio_write(priv,
> > + GCR_B,
> > + _data,
> > + sizeof(rw_data))) {
> 
> A multi-line function call in an if test does not look nice at all.  The
> original code was an easy-to-read expectable pattern.

I agree. I am not strict on the 80 char limit, especially in cases like
the above.



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


Re: [PATCH 3/9] staging: ks7010: Return directly after a failed kmalloc()

2016-07-20 Thread Wolfram Sang
On Sun, Jul 17, 2016 at 08:58:14PM +0200, Julia Lawall wrote:
> 
> 
> On Sun, 17 Jul 2016, SF Markus Elfring wrote:
> 
> > From: Markus Elfring 
> > Date: Sun, 17 Jul 2016 15:55:02 +0200
> >
> > Return directly after a memory allocation failed at the beginning.
> >
> > Signed-off-by: Markus Elfring 
> > ---
> >  drivers/staging/ks7010/ks7010_sdio.c | 19 +++
> >  1 file changed, 7 insertions(+), 12 deletions(-)
> >
> > diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
> > b/drivers/staging/ks7010/ks7010_sdio.c
> > index 3622fba..9b954cb 100644
> > --- a/drivers/staging/ks7010/ks7010_sdio.c
> > +++ b/drivers/staging/ks7010/ks7010_sdio.c
> > @@ -713,10 +713,8 @@ static int ks7010_sdio_update_index(struct 
> > ks_wlan_private *priv, u32 index)
> > unsigned char *data_buf;
> >
> > data_buf = kmalloc(sizeof(u32), GFP_KERNEL);
> > -   if (!data_buf) {
> > -   rc = 1;
> > -   goto error_out;
> > -   }
> > +   if (!data_buf)
> > +   return 1;
> 
> One could rather wonder why the function has such strange error values...

Agreed. Markus, can you check if we can use -ENOMEM in those places.



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


Re: [PATCH 2/9] staging: ks7010: Delete unnecessary assignments for buffer variables

2016-07-20 Thread Wolfram Sang
On Sun, Jul 17, 2016 at 08:15:11PM +0200, SF Markus Elfring wrote:
> From: Markus Elfring <elfr...@users.sourceforge.net>
> Date: Sun, 17 Jul 2016 13:38:46 +0200
> 
> A few variables were assigned a null pointer despite of the detail
> that they were immediately reassigned by the following statement.
> Thus remove such unnecessary assignments.
> 
> Signed-off-by: Markus Elfring <elfr...@users.sourceforge.net>

Reviewed-by: Wolfram Sang <w...@the-dreams.de>



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


Re: [PATCH 1/9] staging: ks7010: Delete unnecessary checks before the function call "kfree"

2016-07-20 Thread Wolfram Sang
On Sun, Jul 17, 2016 at 08:10:48PM +0200, SF Markus Elfring wrote:
> From: Markus Elfring <elfr...@users.sourceforge.net>
> Date: Sun, 17 Jul 2016 13:14:57 +0200
> 
> The kfree() function tests whether its argument is NULL and then
> returns immediately. Thus the test around the calls is not needed.
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Markus Elfring <elfr...@users.sourceforge.net>

Acked-by: Wolfram Sang <w...@the-dreams.de>



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


[PATCH 6/9] staging: ks7010: sdio: remove forward declarations

2016-06-17 Thread Wolfram Sang
Move read/write functions to the top and driver struct to the end, so we
can remove all forward declarations.

Signed-off-by: Wolfram Sang <w...@the-dreams.de>
---
 drivers/staging/ks7010/ks7010_sdio.c | 100 ---
 1 file changed, 46 insertions(+), 54 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
b/drivers/staging/ks7010/ks7010_sdio.c
index 8c2b62bc4d141a..16b9d76478b172 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -34,14 +34,6 @@ static const struct sdio_device_id ks7010_sdio_ids[] = {
 };
 MODULE_DEVICE_TABLE(sdio, ks7010_sdio_ids);
 
-static int ks7010_sdio_probe(struct sdio_func *function,
-const struct sdio_device_id *device);
-static void ks7010_sdio_remove(struct sdio_func *function);
-static void ks7010_rw_function(struct work_struct *work);
-static int ks7010_sdio_read(struct ks_wlan_private *priv, unsigned int address,
-   unsigned char *buffer, int length);
-static int ks7010_sdio_write(struct ks_wlan_private *priv, unsigned int 
address,
-unsigned char *buffer, int length);
 /* macro */
 
 #define inc_txqhead(priv) \
@@ -58,6 +50,45 @@ static int ks7010_sdio_write(struct ks_wlan_private *priv, 
unsigned int address,
 #define cnt_rxqbody(priv) \
 (((priv->rx_dev.qtail + RX_DEVICE_BUFF_SIZE) - (priv->rx_dev.qhead)) % 
RX_DEVICE_BUFF_SIZE )
 
+static int ks7010_sdio_read(struct ks_wlan_private *priv, unsigned int address,
+   unsigned char *buffer, int length)
+{
+   struct ks_sdio_card *card;
+   int rc;
+
+   card = priv->ks_wlan_hw.sdio_card;
+
+   if (length == 1)/* CMD52 */
+   *buffer = sdio_readb(card->func, address, );
+   else/* CMD53 multi-block transfer */
+   rc = sdio_memcpy_fromio(card->func, buffer, address, length);
+
+   if (rc != 0)
+   DPRINTK(1, "sdio error=%d size=%d\n", rc, length);
+
+   return rc;
+}
+
+static int ks7010_sdio_write(struct ks_wlan_private *priv, unsigned int 
address,
+unsigned char *buffer, int length)
+{
+   struct ks_sdio_card *card;
+   int rc;
+
+   card = priv->ks_wlan_hw.sdio_card;
+
+   if (length == 1)/* CMD52 */
+   sdio_writeb(card->func, *buffer, (unsigned int)address, );
+   else/* CMD53 */
+   rc = sdio_memcpy_toio(card->func, (unsigned int)address, buffer,
+ length);
+
+   if (rc != 0)
+   DPRINTK(1, "sdio error=%d size=%d\n", rc, length);
+
+   return rc;
+}
+
 void ks_wlan_hw_sleep_doze_request(struct ks_wlan_private *priv)
 {
unsigned char rw_data;
@@ -230,45 +261,6 @@ int ks_wlan_hw_power_save(struct ks_wlan_private *priv)
return 0;
 }
 
-static int ks7010_sdio_read(struct ks_wlan_private *priv, unsigned int address,
-   unsigned char *buffer, int length)
-{
-   struct ks_sdio_card *card;
-   int rc;
-
-   card = priv->ks_wlan_hw.sdio_card;
-
-   if (length == 1)/* CMD52 */
-   *buffer = sdio_readb(card->func, address, );
-   else/* CMD53 multi-block transfer */
-   rc = sdio_memcpy_fromio(card->func, buffer, address, length);
-
-   if (rc != 0)
-   DPRINTK(1, "sdio error=%d size=%d\n", rc, length);
-
-   return rc;
-}
-
-static int ks7010_sdio_write(struct ks_wlan_private *priv, unsigned int 
address,
-unsigned char *buffer, int length)
-{
-   struct ks_sdio_card *card;
-   int rc;
-
-   card = priv->ks_wlan_hw.sdio_card;
-
-   if (length == 1)/* CMD52 */
-   sdio_writeb(card->func, *buffer, (unsigned int)address, );
-   else/* CMD53 */
-   rc = sdio_memcpy_toio(card->func, (unsigned int)address, buffer,
- length);
-
-   if (rc != 0)
-   DPRINTK(1, "sdio error=%d size=%d\n", rc, length);
-
-   return rc;
-}
-
 static int enqueue_txdev(struct ks_wlan_private *priv, unsigned char *p,
 unsigned long size,
 void (*complete_handler) (void *arg1, void *arg2),
@@ -951,13 +943,6 @@ static void ks7010_card_init(struct ks_wlan_private *priv)
}
 }
 
-static struct sdio_driver ks7010_sdio_driver = {
-   .name = "ks7010_sdio",
-   .id_table = ks7010_sdio_ids,
-   .probe = ks7010_sdio_probe,
-   .remove = ks7010_sdio_remove,
-};
-
 static void ks7010_init_defaults(struct ks_wlan_private *priv)
 {
priv->reg.tx_rate = TX_RATE_AUTO;
@@ -1239,6 +1224,13 @@ static void ks7010_sdio_remove(struct sdio_func *func)
return;
 }
 
+static struct sdio_driver ks7010_sdio_driver = {
+   .name = &q

[PATCH 9/9] staging: ks7010: drop private handler for driver version

2016-06-17 Thread Wolfram Sang
We are upstream now, we don't need seperate driver versioning.

Signed-off-by: Wolfram Sang <w...@the-dreams.de>
---
 drivers/staging/ks7010/ks7010_sdio.h   |  1 -
 drivers/staging/ks7010/ks_wlan_ioctl.h |  2 +-
 drivers/staging/ks7010/ks_wlan_net.c   | 15 +--
 3 files changed, 2 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.h 
b/drivers/staging/ks7010/ks7010_sdio.h
index e71c0978986a13..c72064b48bd8fe 100644
--- a/drivers/staging/ks7010/ks7010_sdio.h
+++ b/drivers/staging/ks7010/ks7010_sdio.h
@@ -143,6 +143,5 @@ struct rx_device {
spinlock_t rx_dev_lock;
 };
 #defineROM_FILE "ks7010sd.rom"
-#defineKS_WLAN_DRIVER_VERSION_INFO  "ks7010 sdio linux 007"
 
 #endif /* _KS7010_SDIO_H */
diff --git a/drivers/staging/ks7010/ks_wlan_ioctl.h 
b/drivers/staging/ks7010/ks_wlan_ioctl.h
index f1fb2dd9a1bd3b..49369e49780874 100644
--- a/drivers/staging/ks7010/ks_wlan_ioctl.h
+++ b/drivers/staging/ks7010/ks_wlan_ioctl.h
@@ -16,7 +16,7 @@
 /* The low order bit identify a SET (0) or a GET (1) ioctl.  */
 
 /* SIOCIWFIRSTPRIV+0 */
-#define KS_WLAN_GET_DRIVER_VERSION SIOCIWFIRSTPRIV+1
+/* former KS_WLAN_GET_DRIVER_VERSION   SIOCIWFIRSTPRIV+1 */
 /* SIOCIWFIRSTPRIV+2 */
 #define KS_WLAN_GET_FIRM_VERSION   SIOCIWFIRSTPRIV+3
 #ifdef WPS
diff --git a/drivers/staging/ks7010/ks_wlan_net.c 
b/drivers/staging/ks7010/ks_wlan_net.c
index 8ef0f111cf39b1..26dbb75da8262f 100644
--- a/drivers/staging/ks7010/ks_wlan_net.c
+++ b/drivers/staging/ks7010/ks_wlan_net.c
@@ -2199,17 +2199,6 @@ static int ks_wlan_set_mlme(struct net_device *dev,
 }
 
 /*--*/
-/* Private handler : get driver version */
-static int ks_wlan_get_driver_version(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *dwrq, char *extra)
-{
-   strcpy(extra, KS_WLAN_DRIVER_VERSION_INFO);
-   dwrq->length = strlen(KS_WLAN_DRIVER_VERSION_INFO) + 1;
-   return 0;
-}
-
-/*--*/
 /* Private handler : get firemware version */
 static int ks_wlan_get_firmware_version(struct net_device *dev,
struct iw_request_info *info,
@@ -3128,8 +3117,6 @@ static int ks_wlan_hostt(struct net_device *dev, struct 
iw_request_info *info,
 
 static const struct iw_priv_args ks_wlan_private_args[] = {
 /*{ cmd, set_args, get_args, name[16] } */
-   {KS_WLAN_GET_DRIVER_VERSION, IW_PRIV_TYPE_NONE,
-IW_PRIV_TYPE_CHAR | (128 + 1), "GetDriverVer"},
{KS_WLAN_GET_FIRM_VERSION, IW_PRIV_TYPE_NONE,
 IW_PRIV_TYPE_CHAR | (128 + 1), "GetFirmwareVer"},
 #ifdef WPS
@@ -3258,7 +3245,7 @@ static const iw_handler ks_wlan_handler[] = {
 /* private_handler */
 static const iw_handler ks_wlan_private_handler[] = {
(iw_handler) NULL,  /*  0 */
-   (iw_handler) ks_wlan_get_driver_version,/*  1 
KS_WLAN_GET_DRIVER_VERSION */
+   (iw_handler) NULL,  /*  1, used to be: KS_WLAN_GET_DRIVER_VERSION */
(iw_handler) NULL,  /*  2 */
(iw_handler) ks_wlan_get_firmware_version,  /*  3 
KS_WLAN_GET_FIRM_VERSION */
 #ifdef WPS
-- 
2.8.1

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


[PATCH 5/9] staging: ks7010: unify naming to ks7010

2016-06-17 Thread Wolfram Sang
No 79xx anymore, this is confusing. Add a comment saying that old
versions were probably named 7910/79xx.

Signed-off-by: Wolfram Sang <w...@the-dreams.de>
---
 drivers/staging/ks7010/ks7010_sdio.c | 28 ++--
 drivers/staging/ks7010/ks7010_sdio.h |  1 +
 2 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
b/drivers/staging/ks7010/ks7010_sdio.c
index 280cbfb6aa7fbd..8c2b62bc4d141a 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -34,9 +34,9 @@ static const struct sdio_device_id ks7010_sdio_ids[] = {
 };
 MODULE_DEVICE_TABLE(sdio, ks7010_sdio_ids);
 
-static int ks7910_sdio_probe(struct sdio_func *function,
+static int ks7010_sdio_probe(struct sdio_func *function,
 const struct sdio_device_id *device);
-static void ks7910_sdio_remove(struct sdio_func *function);
+static void ks7010_sdio_remove(struct sdio_func *function);
 static void ks7010_rw_function(struct work_struct *work);
 static int ks7010_sdio_read(struct ks_wlan_private *priv, unsigned int address,
unsigned char *buffer, int length);
@@ -778,7 +778,7 @@ static int ks7010_sdio_data_compare(struct ks_wlan_private 
*priv, u32 address,
return rc;
 }
 
-static int ks79xx_upload_firmware(struct ks_wlan_private *priv,
+static int ks7010_upload_firmware(struct ks_wlan_private *priv,
  struct ks_sdio_card *card)
 {
unsigned int size, offset, n = 0;
@@ -952,10 +952,10 @@ static void ks7010_card_init(struct ks_wlan_private *priv)
 }
 
 static struct sdio_driver ks7010_sdio_driver = {
-   .name = "ks7910_sdio",
+   .name = "ks7010_sdio",
.id_table = ks7010_sdio_ids,
-   .probe = ks7910_sdio_probe,
-   .remove = ks7910_sdio_remove,
+   .probe = ks7010_sdio_probe,
+   .remove = ks7010_sdio_remove,
 };
 
 static void ks7010_init_defaults(struct ks_wlan_private *priv)
@@ -985,7 +985,7 @@ static void ks7010_init_defaults(struct ks_wlan_private 
*priv)
priv->reg.rate_set.size = 12;
 }
 
-static int ks7910_sdio_probe(struct sdio_func *func,
+static int ks7010_sdio_probe(struct sdio_func *func,
 const struct sdio_device_id *device)
 {
struct ks_wlan_private *priv;
@@ -994,7 +994,7 @@ static int ks7910_sdio_probe(struct sdio_func *func,
unsigned char rw_data;
int ret;
 
-   DPRINTK(5, "ks7910_sdio_probe()\n");
+   DPRINTK(5, "ks7010_sdio_probe()\n");
 
priv = NULL;
netdev = NULL;
@@ -1049,11 +1049,11 @@ static int ks7910_sdio_probe(struct sdio_func *func,
/* private memory allocate */
netdev = alloc_etherdev(sizeof(*priv));
if (netdev == NULL) {
-   printk(KERN_ERR "ks79xx : Unable to alloc new net device\n");
+   printk(KERN_ERR "ks7010 : Unable to alloc new net device\n");
goto error_release_irq;
}
if (dev_alloc_name(netdev, netdev->name) < 0) {
-   printk(KERN_ERR "ks79xx :  Couldn't get name!\n");
+   printk(KERN_ERR "ks7010 :  Couldn't get name!\n");
goto error_free_netdev;
}
 
@@ -1091,10 +1091,10 @@ static int ks7910_sdio_probe(struct sdio_func *func,
ks7010_init_defaults(priv);
 
/* Upload firmware */
-   ret = ks79xx_upload_firmware(priv, card);   /* firmware load */
+   ret = ks7010_upload_firmware(priv, card);   /* firmware load */
if (ret) {
printk(KERN_ERR
-  "ks79xx: firmware load failed !! retern code = %d\n",
+  "ks7010: firmware load failed !! retern code = %d\n",
   ret);
goto error_free_read_buf;
}
@@ -1151,13 +1151,13 @@ static int ks7910_sdio_probe(struct sdio_func *func,
return -ENODEV;
 }
 
-static void ks7910_sdio_remove(struct sdio_func *func)
+static void ks7010_sdio_remove(struct sdio_func *func)
 {
int ret;
struct ks_sdio_card *card;
struct ks_wlan_private *priv;
struct net_device *netdev;
-   DPRINTK(1, "ks7910_sdio_remove()\n");
+   DPRINTK(1, "ks7010_sdio_remove()\n");
 
card = sdio_get_drvdata(func);
 
diff --git a/drivers/staging/ks7010/ks7010_sdio.h 
b/drivers/staging/ks7010/ks7010_sdio.h
index 815ecf808171b6..e71c0978986a13 100644
--- a/drivers/staging/ks7010/ks7010_sdio.h
+++ b/drivers/staging/ks7010/ks7010_sdio.h
@@ -19,6 +19,7 @@
 /*  SDIO KeyStream vendor and device */
 #define SDIO_VENDOR_ID_KS_CODE_A   0x005b
 #define SDIO_VENDOR_ID_KS_CODE_B   0x0023
+/* Older sources suggest earlier versions were named 7910 or 79xx */
 #define SDIO_DEVICE_ID_KS_7010 0x7910
 
 /* Read Status Register */
-- 
2.8.1

___

[PATCH 7/9] staging: ks7010: bail out when registering netdevice fails

2016-06-17 Thread Wolfram Sang
There is no need to continue then. Also, this enables us to remove an
ugly static variable.

Signed-off-by: Wolfram Sang <w...@the-dreams.de>
---
 drivers/staging/ks7010/ks7010_sdio.c | 12 +---
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
b/drivers/staging/ks7010/ks7010_sdio.c
index 16b9d76478b172..c3035b80dac7cd 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -25,8 +25,6 @@
 #define KS7010_IO_BLOCK_SIZE 512
 #define KS7010_MAX_CLOCK 2500
 
-static int reg_net = 0;
-
 static const struct sdio_device_id ks7010_sdio_ids[] = {
{SDIO_DEVICE(SDIO_VENDOR_ID_KS_CODE_A, SDIO_DEVICE_ID_KS_7010)},
{SDIO_DEVICE(SDIO_VENDOR_ID_KS_CODE_B, SDIO_DEVICE_ID_KS_7010)},
@@ -936,8 +934,6 @@ static void ks7010_card_init(struct ks_wlan_private *priv)
if (priv->dev_state >= DEVICE_STATE_PREINIT) {
DPRINTK(1, "DEVICE READY!!\n");
priv->dev_state = DEVICE_STATE_READY;
-   reg_net = register_netdev(priv->net_dev);
-   DPRINTK(3, "register_netdev=%d\n", reg_net);
} else {
DPRINTK(1, "dev_state=%d\n", priv->dev_state);
}
@@ -1115,6 +,10 @@ static int ks7010_sdio_probe(struct sdio_func *func,
INIT_DELAYED_WORK(>ks_wlan_hw.rw_wq, ks7010_rw_function);
ks7010_card_init(priv);
 
+   ret = register_netdev(priv->net_dev);
+   if (ret)
+   goto error_free_read_buf;
+
return 0;
 
  error_free_read_buf:
@@ -1196,9 +1196,7 @@ static void ks7010_sdio_remove(struct sdio_func *func)
hostif_exit(priv);
DPRINTK(1, "hostif_exit\n");
 
-   if (!reg_net)
-   unregister_netdev(netdev);
-   DPRINTK(1, "unregister_netdev\n");
+   unregister_netdev(netdev);
 
trx_device_exit(priv);
if (priv->ks_wlan_hw.read_buf) {
-- 
2.8.1

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


[PATCH 2/9] staging: ks7010: function declaration should be in a header file

2016-06-17 Thread Wolfram Sang
Signed-off-by: Wolfram Sang <w...@the-dreams.de>
---
 drivers/staging/ks7010/ks7010_sdio.c | 3 ---
 drivers/staging/ks7010/ks_wlan.h | 3 +++
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
b/drivers/staging/ks7010/ks7010_sdio.c
index d4cce78106a736..714f933a7d85e7 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -958,9 +958,6 @@ static struct sdio_driver ks7010_sdio_driver = {
.remove = ks7910_sdio_remove,
 };
 
-extern int ks_wlan_net_start(struct net_device *dev);
-extern int ks_wlan_net_stop(struct net_device *dev);
-
 static void ks7010_init_defaults(struct ks_wlan_private *priv)
 {
priv->reg.tx_rate = TX_RATE_AUTO;
diff --git a/drivers/staging/ks7010/ks_wlan.h b/drivers/staging/ks7010/ks_wlan.h
index 019c43031d3b3c..f05dc0122fcbd1 100644
--- a/drivers/staging/ks7010/ks_wlan.h
+++ b/drivers/staging/ks7010/ks_wlan.h
@@ -499,4 +499,7 @@ struct ks_wlan_private {
uint wakeup_count;  /* for detect wakeup loop */
 };
 
+extern int ks_wlan_net_start(struct net_device *dev);
+extern int ks_wlan_net_stop(struct net_device *dev);
+
 #endif /* _KS_WLAN_H */
-- 
2.8.1

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


[PATCH 4/9] staging: ks7010: export sdio ids

2016-06-17 Thread Wolfram Sang
So the module will be loaded automatically on card insertion. Rename the
array while here.

Signed-off-by: Wolfram Sang <w...@the-dreams.de>
---
 drivers/staging/ks7010/ks7010_sdio.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
b/drivers/staging/ks7010/ks7010_sdio.c
index b3c98ebaec14e2..280cbfb6aa7fbd 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -27,11 +27,12 @@
 
 static int reg_net = 0;
 
-static const struct sdio_device_id if_sdio_ids[] = {
+static const struct sdio_device_id ks7010_sdio_ids[] = {
{SDIO_DEVICE(SDIO_VENDOR_ID_KS_CODE_A, SDIO_DEVICE_ID_KS_7010)},
{SDIO_DEVICE(SDIO_VENDOR_ID_KS_CODE_B, SDIO_DEVICE_ID_KS_7010)},
{ /* all zero */ }
 };
+MODULE_DEVICE_TABLE(sdio, ks7010_sdio_ids);
 
 static int ks7910_sdio_probe(struct sdio_func *function,
 const struct sdio_device_id *device);
@@ -952,7 +953,7 @@ static void ks7010_card_init(struct ks_wlan_private *priv)
 
 static struct sdio_driver ks7010_sdio_driver = {
.name = "ks7910_sdio",
-   .id_table = if_sdio_ids,
+   .id_table = ks7010_sdio_ids,
.probe = ks7910_sdio_probe,
.remove = ks7910_sdio_remove,
 };
-- 
2.8.1

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


[PATCH 8/9] staging: ks7010: report interface as wlan not eth

2016-06-17 Thread Wolfram Sang
Until we switch to cfg80211 (if ever), we must do this manually.

Signed-off-by: Wolfram Sang <w...@the-dreams.de>
---
 drivers/staging/ks7010/ks7010_sdio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
b/drivers/staging/ks7010/ks7010_sdio.c
index c3035b80dac7cd..b7337fd813d59d 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -1033,7 +1033,7 @@ static int ks7010_sdio_probe(struct sdio_func *func,
printk(KERN_ERR "ks7010 : Unable to alloc new net device\n");
goto error_release_irq;
}
-   if (dev_alloc_name(netdev, netdev->name) < 0) {
+   if (dev_alloc_name(netdev, "wlan%d") < 0) {
printk(KERN_ERR "ks7010 :  Couldn't get name!\n");
goto error_free_netdev;
}
-- 
2.8.1

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


[PATCH 1/9] staging: ks7010: remove cfg file handling

2016-06-17 Thread Wolfram Sang
I verified that all but two settings from the config file can be set up
also via 'iwconfig' or 'iwpriv'. The two missing are ROM_FILE and
PhyInformationTimer. ROM_FILE can be easily dropped. There is only one
known firmware floating on the net, so, the name is fix and we can make
this constant. Frankly, I don't know when PhyInformationTimer needs to
be set to non-zero. But if we need it somewhen, there is already
(currently commented out) code to add this as another private method, so
we could use that. Summa summarum: We can remove the config file
handling and the example config file. The only useful action,
initialization of the configuration struct, is now moved to the sdio
main file.

Signed-off-by: Wolfram Sang <w...@the-dreams.de>
---
 drivers/staging/ks7010/Makefile|   3 +-
 drivers/staging/ks7010/TODO|   1 -
 drivers/staging/ks7010/ks7010_config.c | 500 -
 drivers/staging/ks7010/ks7010_sdio.c   |  49 ++--
 drivers/staging/ks7010/ks7010_sdio.h   |   1 -
 drivers/staging/ks7010/ks79xx.cfg  | 116 
 drivers/staging/ks7010/ks_wlan.h   |   1 -
 7 files changed, 33 insertions(+), 638 deletions(-)
 delete mode 100644 drivers/staging/ks7010/ks7010_config.c
 delete mode 100644 drivers/staging/ks7010/ks79xx.cfg

diff --git a/drivers/staging/ks7010/Makefile b/drivers/staging/ks7010/Makefile
index f6a2cc8fd0276d..69fcf8d655c751 100644
--- a/drivers/staging/ks7010/Makefile
+++ b/drivers/staging/ks7010/Makefile
@@ -1,5 +1,4 @@
 obj-$(CONFIG_KS7010) += ks7010.o
 
 ccflags-y   += -DKS_WLAN_DEBUG=0
-ks7010-y:= michael_mic.o ks_hostif.o ks_wlan_net.o \
-   ks7010_sdio.o ks7010_config.o
+ks7010-y:= michael_mic.o ks_hostif.o ks_wlan_net.o ks7010_sdio.o
diff --git a/drivers/staging/ks7010/TODO b/drivers/staging/ks7010/TODO
index 5cbb4ca999747e..2938d35be5bbfc 100644
--- a/drivers/staging/ks7010/TODO
+++ b/drivers/staging/ks7010/TODO
@@ -26,7 +26,6 @@ Now the TODOs:
 - fix codechecker warnings (checkpatch, sparse, smatch). But PLEASE make sure
   that you are not only silencing the warning but really fixing code. You
   should understand the change you submit.
-- drop using a config file and use an upstream technique for configuration
 - fix the 'card removal' event when card is inserted when booting
 - check what other upstream wireless mechanisms can be used instead of the
   custom ones here
diff --git a/drivers/staging/ks7010/ks7010_config.c 
b/drivers/staging/ks7010/ks7010_config.c
deleted file mode 100644
index 4b495cbef48165..00
--- a/drivers/staging/ks7010/ks7010_config.c
+++ /dev/null
@@ -1,500 +0,0 @@
-#include 
-#include 
-
-#include "ks_wlan.h"
-#include "ks_hostif.h"
-#include "ks_wlan_ioctl.h"
-
-static int wep_on_off;
-#defineWEP_OFF 0
-#defineWEP_ON_64BIT1
-#defineWEP_ON_128BIT   2
-
-static int wep_type;
-#defineWEP_KEY_CHARACTER 0
-#defineWEP_KEY_HEX   1
-
-static
-void analyze_character_wep_key(struct ks_wlan_parameter *param,
-  int wep_key_index, char *value)
-{
-   int i;
-   unsigned char wep_key[26], key_length;
-
-   key_length = (wep_on_off == WEP_ON_64BIT) ? 5 : 13;
-   /* 64bit key_length = 5; 128bit key_length = 13; */
-
-   for (i = 0; i < key_length; i++) {
-   wep_key[i] = value[i];
-   }
-
-   if (wep_key_index < 0 || wep_key_index > 3)
-   return;
-
-   param->wep_key[wep_key_index].size = key_length;
-   for (i = 0; i < (param->wep_key[wep_key_index].size); i++) {
-   param->wep_key[wep_key_index].val[i] = wep_key[i];
-   }
-}
-
-static
-void analyze_hex_wep_key(struct ks_wlan_parameter *param, int wep_key_index,
-char *value)
-{
-   unsigned char wep_end[26], i, j, key_length;
-
-   key_length = (wep_on_off == WEP_ON_64BIT) ? 10 : 26;
-   /* 64bit key_length = 10; 128bit key_length = 26; */
-
-   for (i = 0; i < key_length; i++) {
-   wep_end[i] = value[i];
-   if (i % 2) {
-   /* Odd */
-   for (j = 0x00; j < 0x10; j++) {
-   if (j < 0x0a) {
-   if (wep_end[i] == j + 0x30)
-   wep_end[i] = j;
-   } else {
-   if ((wep_end[i] ==
-j + 0x37) | (wep_end[i] ==
- j + 0x57))
-   wep_end[i] = j;
-   }
-   }
-   } else {
-   /* Even */
-   for (j = 0x00; j < 0x10; j++) {
-   if (j 

[PATCH 0/9] staging: ks7010: cleanups

2016-06-17 Thread Wolfram Sang
So, here is a set of cleanups for the ks7010 driver. Biggest one is the removal
of the config file handling. But also some other improvements while playing
around with the driver. Please have a look, comment, apply. A branch can be
found here:

git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git staging/ks7010

Thanks,

   Wolfram

Wolfram Sang (9):
  staging: ks7010: remove cfg file handling
  staging: ks7010: function declaration should be in a header file
  staging: ks7010: collect all includes and sort them
  staging: ks7010: export sdio ids
  staging: ks7010: unify naming to ks7010
  staging: ks7010: sdio: remove forward declarations
  staging: ks7010: bail out when registering netdevice fails
  staging: ks7010: report interface as wlan not eth
  staging: ks7010: drop private handler for driver version

 drivers/staging/ks7010/Makefile|   3 +-
 drivers/staging/ks7010/TODO|   1 -
 drivers/staging/ks7010/ks7010_config.c | 500 -
 drivers/staging/ks7010/ks7010_sdio.c   | 192 ++---
 drivers/staging/ks7010/ks7010_sdio.h   |   3 +-
 drivers/staging/ks7010/ks79xx.cfg  | 116 
 drivers/staging/ks7010/ks_wlan.h   |   4 +-
 drivers/staging/ks7010/ks_wlan_ioctl.h |   2 +-
 drivers/staging/ks7010/ks_wlan_net.c   |  15 +-
 9 files changed, 104 insertions(+), 732 deletions(-)
 delete mode 100644 drivers/staging/ks7010/ks7010_config.c
 delete mode 100644 drivers/staging/ks7010/ks79xx.cfg

-- 
2.8.1

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


[PATCH 3/9] staging: ks7010: collect all includes and sort them

2016-06-17 Thread Wolfram Sang
Includes probably need a driver-wide clean up, but for now let's at
least group all includes from the sdio file together.

Signed-off-by: Wolfram Sang <w...@the-dreams.de>
---
 drivers/staging/ks7010/ks7010_sdio.c | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
b/drivers/staging/ks7010/ks7010_sdio.c
index 714f933a7d85e7..b3c98ebaec14e2 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -10,15 +10,15 @@
  *   published by the Free Software Foundation.
  */
 
-#include 
-#include 
+#include 
 #include 
 #include 
+#include 
+#include 
 
 #include "ks_wlan.h"
 #include "ks_wlan_ioctl.h"
 #include "ks_hostif.h"
-
 #include "ks7010_sdio.h"
 
 #define KS7010_FUNC_NUM 1
@@ -777,7 +777,6 @@ static int ks7010_sdio_data_compare(struct ks_wlan_private 
*priv, u32 address,
return rc;
 }
 
-#include 
 static int ks79xx_upload_firmware(struct ks_wlan_private *priv,
  struct ks_sdio_card *card)
 {
-- 
2.8.1

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


Re: [PATCH] staging: ks7010: honor 'const' qualifier

2016-06-17 Thread Wolfram Sang
On Wed, Jun 15, 2016 at 11:53:11PM +0200, Arnd Bergmann wrote:
> The recently-added ks7010 driver produces an annoying build warning:
> 
> drivers/staging/ks7010/ks7010_config.c: In function 
> 'ks_wlan_read_config_file':
> drivers/staging/ks7010/ks7010_config.c:263:8: error: assignment discards 
> 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
> 
> The problem here is that it assigns the firmware data to a non-const
> variable, and then goes on to modify it, which is clearly not the intended
> use case.
> 
> The only modification is to set the last byte to '\0', and as far as
> I can tell, this modification is unnecessary, as the parser always compares
> against the end pointer, rather than relying on zero-termination.
> 
> This patch therefore removes the modification of the const data and marks
> all the pointers 'const to avoid the warning.
> 
> Signed-off-by: Arnd Bergmann 

Thanks! I'll send in a second a patch, though, which removes the config
file handling completely.

   Wolfram



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


Re: [patch 1/2] staging: ks7010: parsing bugs in ks_wlan_read_config_file()

2016-06-14 Thread Wolfram Sang
On Tue, Jun 14, 2016 at 02:16:30PM +0300, Dan Carpenter wrote:
> The check for the NUL terminator is wrong so it looks like this could
> read beyond the end of the buffer.
> 
> Signed-off-by: Dan Carpenter 

Thanks, however I have a patch very soon to be submitted which removes
the config.c file completely.



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


[PATCH V2 18/31] staging: ks7010: indent ks_hostif.c

2016-05-31 Thread Wolfram Sang
From: Wolfram Sang <wsa+rene...@sang-engineering.com>

Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com>
---
 drivers/staging/ks7010/ks_hostif.c | 1960 
 1 file changed, 1080 insertions(+), 880 deletions(-)

diff --git a/drivers/staging/ks7010/ks_hostif.c 
b/drivers/staging/ks7010/ks_hostif.c
index 497b8aaf6daef8..f2a65c0ae630a2 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -23,9 +23,10 @@
 /* Include Wireless Extension definition and check version */
 #include /* New driver API */
 
-extern int ks_wlan_hw_tx(struct ks_wlan_private *priv, void *p, unsigned long 
size,
-void (*complete_handler)(void *arg1, void *arg2),
-void *arg1, void *arg2 );
+extern int ks_wlan_hw_tx(struct ks_wlan_private *priv, void *p,
+unsigned long size,
+void (*complete_handler) (void *arg1, void *arg2),
+void *arg1, void *arg2);
 extern void send_packet_complete(void *, void *);
 
 extern void ks_wlan_hw_wakeup_request(struct ks_wlan_private *priv);
@@ -55,7 +56,7 @@ static
 inline u16 get_WORD(struct ks_wlan_private *priv)
 {
u16 data;
-   data  = (get_BYTE(priv) & 0xff);
+   data = (get_BYTE(priv) & 0xff);
data |= ((get_BYTE(priv) << 8) & 0xff00);
return data;
 }
@@ -64,7 +65,7 @@ static
 inline u32 get_DWORD(struct ks_wlan_private *priv)
 {
u32 data;
-   data  = (get_BYTE(priv) & 0xff);
+   data = (get_BYTE(priv) & 0xff);
data |= ((get_BYTE(priv) << 8) & 0xff00);
data |= ((get_BYTE(priv) << 16) & 0x00ff);
data |= ((get_BYTE(priv) << 24) & 0xff00);
@@ -73,24 +74,24 @@ inline u32 get_DWORD(struct ks_wlan_private *priv)
 
 void ks_wlan_hw_wakeup_task(struct work_struct *work)
 {
-   struct ks_wlan_private *priv = container_of(work, struct 
ks_wlan_private, ks_wlan_wakeup_task);
+   struct ks_wlan_private *priv =
+   container_of(work, struct ks_wlan_private, ks_wlan_wakeup_task);
int ps_status = atomic_read(>psstatus.status);
 
-   if(ps_status==PS_SNOOZE){
+   if (ps_status == PS_SNOOZE) {
ks_wlan_hw_wakeup_request(priv);
-   
if(!wait_for_completion_interruptible_timeout(>psstatus.wakeup_wait,HZ/50)){
 /* 20ms timeout */
-   DPRINTK(1,"wake up timeout !!!\n");
+   if 
(!wait_for_completion_interruptible_timeout(>psstatus.wakeup_wait, HZ / 
50)) { /* 20ms timeout */
+   DPRINTK(1, "wake up timeout !!!\n");
schedule_work(>ks_wlan_wakeup_task);
return;
}
-   }
-   else{
-   DPRINTK(1,"ps_status=%d\n",ps_status);
+   } else {
+   DPRINTK(1, "ps_status=%d\n", ps_status);
}
 
/* power save */
-   if(atomic_read(>sme_task.count) > 0){
-   DPRINTK(4,"sme task enable.\n");
+   if (atomic_read(>sme_task.count) > 0) {
+   DPRINTK(4, "sme task enable.\n");
tasklet_enable(>sme_task);
}
 }
@@ -98,14 +99,13 @@ void ks_wlan_hw_wakeup_task(struct work_struct *work)
 static
 int ks_wlan_do_power_save(struct ks_wlan_private *priv)
 {
-   int rc=0;
+   int rc = 0;
 
-   DPRINTK(4,"psstatus.status=%d\n",atomic_read(>psstatus.status));
+   DPRINTK(4, "psstatus.status=%d\n", atomic_read(>psstatus.status));
 
-   if((priv->connect_status & CONNECT_STATUS_MASK) == CONNECT_STATUS){
+   if ((priv->connect_status & CONNECT_STATUS_MASK) == CONNECT_STATUS) {
hostif_sme_enqueue(priv, SME_POW_MNGMT_REQUEST);
-   }
-   else{
+   } else {
priv->dev_state = DEVICE_STATE_READY;
}
return rc;
@@ -116,26 +116,28 @@ int get_current_ap(struct ks_wlan_private *priv, struct 
link_ap_info_t *ap_info)
 {
struct local_ap_t *ap;
union iwreq_data wrqu;
-   struct net_device *netdev=priv->net_dev;
-   int rc=0;
+   struct net_device *netdev = priv->net_dev;
+   int rc = 0;
 
-   DPRINTK(3,"\n");
+   DPRINTK(3, "\n");
ap = &(priv->current_ap);
 
-   if((priv->connect_status & CONNECT_STATUS_MASK)== DISCONNECT_STATUS){
-   memset(ap,0,sizeof(struct local_ap_t));
+   if ((priv->connect_status & CONNECT_STATUS_MASK) == DISCONNECT_STATUS) {
+   memset(ap, 0, sizeof(struct local_ap_t));
return 1;
}
 
/* bssid */
-   memcpy(&(ap->bssid[0]),&(ap_info->bssid[0]),ETH_ALEN);
+   memcpy(&(ap->bssid[0]), &(ap_info->bssid[0]), ETH_AL

[PATCH V2 28/31] staging: ks7010: adapt to new trans_start handling

2016-05-31 Thread Wolfram Sang
From: Wolfram Sang <wsa+rene...@sang-engineering.com>

trans_start is gone from netdevice, so use the new helper function to
set the mark.

Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com>
---
 drivers/staging/ks7010/ks_wlan_net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/ks7010/ks_wlan_net.c 
b/drivers/staging/ks7010/ks_wlan_net.c
index 3e282833372305..ac3354bf6f8c8a 100644
--- a/drivers/staging/ks7010/ks_wlan_net.c
+++ b/drivers/staging/ks7010/ks_wlan_net.c
@@ -3398,7 +3398,7 @@ int ks_wlan_start_xmit(struct sk_buff *skb, struct 
net_device *dev)
netif_stop_queue(dev);
 
rc = hostif_data_request(priv, skb);
-   dev->trans_start = jiffies;
+   netif_trans_update(dev);
 
DPRINTK(4, "rc=%d\n", rc);
if (rc) {
-- 
2.8.1

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


[PATCH V2 30/31] staging: ks7010: drop counting sd errors

2016-05-31 Thread Wolfram Sang
From: Wolfram Sang <wsa+rene...@sang-engineering.com>

They were counted but never really used anywhere. Also change the printk
to a debug print, since it mostly shows on the expected -ENOMEDIUM on
card removal.

Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com>
---
 drivers/staging/ks7010/ks7010_sdio.c | 20 ++--
 drivers/staging/ks7010/ks_wlan.h |  2 --
 2 files changed, 6 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
b/drivers/staging/ks7010/ks7010_sdio.c
index a8a14f928d421b..c166022b652e3a 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -234,8 +234,8 @@ int ks_wlan_hw_power_save(struct ks_wlan_private *priv)
 static int ks7010_sdio_read(struct ks_wlan_private *priv, unsigned int address,
unsigned char *buffer, int length)
 {
-   int rc = -1;
struct ks_sdio_card *card;
+   int rc;
 
card = priv->ks_wlan_hw.sdio_card;
 
@@ -244,12 +244,8 @@ static int ks7010_sdio_read(struct ks_wlan_private *priv, 
unsigned int address,
else/* CMD53 multi-block transfer */
rc = sdio_memcpy_fromio(card->func, buffer, address, length);
 
-   if (rc != 0) {
-   printk("sdio error erorr=%d size=%d\n", rc, length);
-   ++priv->sdio_error_count;
-   } else {
-   priv->sdio_error_count = 0;
-   }
+   if (rc != 0)
+   DPRINTK(1, "sdio error=%d size=%d\n", rc, length);
 
return rc;
 }
@@ -257,8 +253,8 @@ static int ks7010_sdio_read(struct ks_wlan_private *priv, 
unsigned int address,
 static int ks7010_sdio_write(struct ks_wlan_private *priv, unsigned int 
address,
 unsigned char *buffer, int length)
 {
-   int rc = -1;
struct ks_sdio_card *card;
+   int rc;
 
card = priv->ks_wlan_hw.sdio_card;
 
@@ -268,12 +264,8 @@ static int ks7010_sdio_write(struct ks_wlan_private *priv, 
unsigned int address,
rc = sdio_memcpy_toio(card->func, (unsigned int)address, buffer,
  length);
 
-   if (rc != 0) {
-   printk("sdio error erorr=%d size=%d\n", rc, length);
-   ++priv->sdio_error_count;
-   } else {
-   priv->sdio_error_count = 0;
-   }
+   if (rc != 0)
+   DPRINTK(1, "sdio error=%d size=%d\n", rc, length);
 
return rc;
 }
diff --git a/drivers/staging/ks7010/ks_wlan.h b/drivers/staging/ks7010/ks_wlan.h
index f0f9f8ef7d6185..a2126c2e728d2d 100644
--- a/drivers/staging/ks7010/ks_wlan.h
+++ b/drivers/staging/ks7010/ks_wlan.h
@@ -500,9 +500,7 @@ struct ks_wlan_private {
unsigned long last_doze;
unsigned long last_wakeup;
 
-   uint sdio_error_count;  /* SDIO error */
uint wakeup_count;  /* for detect wakeup loop */
-
 };
 
 #endif /* _KS_WLAN_H */
-- 
2.8.1

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


[PATCH V2 25/31] staging: ks7010: indent ks7010_sdio.c

2016-05-31 Thread Wolfram Sang
From: Wolfram Sang <wsa+rene...@sang-engineering.com>

Unlike the previous patches which are plain indent outcomes, this has
some manual fixups to be not overly strict with the 80 char limit.

Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com>
---
 drivers/staging/ks7010/ks7010_sdio.c | 807 ---
 1 file changed, 460 insertions(+), 347 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
b/drivers/staging/ks7010/ks7010_sdio.c
index fb9f0b533d867e..ed4d579300ad96 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -30,31 +30,32 @@
 static int reg_net = 0;
 
 static const struct sdio_device_id if_sdio_ids[] = {
-   { SDIO_DEVICE(SDIO_VENDOR_ID_KS_CODE_A, SDIO_DEVICE_ID_KS_7010) },
-   { SDIO_DEVICE(SDIO_VENDOR_ID_KS_CODE_B, SDIO_DEVICE_ID_KS_7010) },
+   {SDIO_DEVICE(SDIO_VENDOR_ID_KS_CODE_A, SDIO_DEVICE_ID_KS_7010)},
+   {SDIO_DEVICE(SDIO_VENDOR_ID_KS_CODE_B, SDIO_DEVICE_ID_KS_7010)},
{ /* all zero */ }
 };
 
 struct ks_sdio_model {
-int model;
-const char *firmware;
+   int model;
+   const char *firmware;
 };
 
 static struct ks_sdio_model ks_sdio_models[] = {
-{
-/* ks7010 */
-.model = 0x10,
-.firmware = "ks7010sd.rom",
-},
+   {
+   /* ks7010 */
+   .model = 0x10,
+   .firmware = "ks7010sd.rom",
+   },
 };
 
-static int ks7910_sdio_probe(struct sdio_func *function, const struct 
sdio_device_id *device);
+static int ks7910_sdio_probe(struct sdio_func *function,
+const struct sdio_device_id *device);
 static void ks7910_sdio_remove(struct sdio_func *function);
 static void ks7010_rw_function(struct work_struct *work);
-static int ks7010_sdio_read( struct ks_wlan_private *priv, unsigned int 
address,
-unsigned char *buffer, int length );
-static int ks7010_sdio_write( struct ks_wlan_private *priv, unsigned int 
address,
- unsigned char *buffer, int length );
+static int ks7010_sdio_read(struct ks_wlan_private *priv, unsigned int address,
+   unsigned char *buffer, int length);
+static int ks7010_sdio_write(struct ks_wlan_private *priv, unsigned int 
address,
+unsigned char *buffer, int length);
 /* macro */
 
 #define inc_txqhead(priv) \
@@ -79,25 +80,25 @@ void ks_wlan_hw_sleep_doze_request(struct ks_wlan_private 
*priv)
DPRINTK(4, "\n");
 
/* clear request */
-   atomic_set(>sleepstatus.doze_request,0);
+   atomic_set(>sleepstatus.doze_request, 0);
 
-   if( atomic_read(>sleepstatus.status) == 0){
+   if (atomic_read(>sleepstatus.status) == 0) {
rw_data = GCR_B_DOZE;
-   retval = ks7010_sdio_write(priv, GCR_B, _data, 
sizeof(rw_data));
-   if(retval){
+   retval =
+   ks7010_sdio_write(priv, GCR_B, _data, sizeof(rw_data));
+   if (retval) {
DPRINTK(1, " error : GCR_B=%02X\n", rw_data);
goto out;
}
DPRINTK(4, "PMG SET!! : GCR_B=%02X\n", rw_data);
-   DPRINTK(3,"sleep_mode=SLP_SLEEP\n");
+   DPRINTK(3, "sleep_mode=SLP_SLEEP\n");
atomic_set(>sleepstatus.status, 1);
-   priv->last_doze = jiffies;
-   }
-   else{
-   DPRINTK(1,"sleep_mode=%d\n",priv->sleep_mode);
+   priv->last_doze = jiffies;
+   } else {
+   DPRINTK(1, "sleep_mode=%d\n", priv->sleep_mode);
}
 
-out:
+ out:
priv->sleep_mode = atomic_read(>sleepstatus.status);
return;
 }
@@ -110,110 +111,126 @@ void ks_wlan_hw_sleep_wakeup_request(struct 
ks_wlan_private *priv)
DPRINTK(4, "\n");
 
/* clear request */
-   atomic_set(>sleepstatus.wakeup_request,0);
+   atomic_set(>sleepstatus.wakeup_request, 0);
 
-   if( atomic_read(>sleepstatus.status) == 1){
+   if (atomic_read(>sleepstatus.status) == 1) {
rw_data = WAKEUP_REQ;
-   retval = ks7010_sdio_write(priv, WAKEUP, _data, 
sizeof(rw_data));
-   if(retval){
+   retval =
+   ks7010_sdio_write(priv, WAKEUP, _data, sizeof(rw_data));
+   if (retval) {
DPRINTK(1, " error : WAKEUP=%02X\n", rw_data);
goto out;
}
DPRINTK(4, "wake up : WAKEUP=%02X\n", rw_data);
atomic_set(>sleepstatus.status, 0);
-   priv->last_wakeup = jiffies;
+   priv->last_wakeup = jiffies;
++priv->wakeup_count;
-  

[PATCH V2 29/31] staging: ks7010: simplify module_init/exit

2016-05-31 Thread Wolfram Sang
From: Wolfram Sang <wsa+rene...@sang-engineering.com>

The printouts are not needed, the driver core has enough debug output
for this if wanted. So, use a helper to save boilerplate code.

Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com>
---
 drivers/staging/ks7010/ks7010_sdio.c | 25 +
 1 file changed, 1 insertion(+), 24 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
b/drivers/staging/ks7010/ks7010_sdio.c
index 8c0d1bb58dcd9c..a8a14f928d421b 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -1237,30 +1237,7 @@ static void ks7910_sdio_remove(struct sdio_func *func)
return;
 }
 
-static int __init ks7010_sdio_init(void)
-{
-   int status;
-
-   /* register with bus driver core */
-   status = sdio_register_driver(_sdio_driver);
-   if (status != 0) {
-   DPRINTK(1,
-   "ks79xx_sdio : failed to register with bus driver, 
%d\n",
-   status);
-   }
-   return status;
-}
-
-static void __exit ks7010_sdio_exit(void)
-{
-   DPRINTK(5, " \n");
-   sdio_unregister_driver(_sdio_driver);
-   return;
-}
-
-module_init(ks7010_sdio_init);
-module_exit(ks7010_sdio_exit);
-
+module_driver(ks7010_sdio_driver, sdio_register_driver, 
sdio_unregister_driver);
 MODULE_AUTHOR("Sang Engineering, Qi-Hardware, KeyStream");
 MODULE_DESCRIPTION("Driver for KeyStream KS7010 based SDIO cards");
 MODULE_LICENSE("GPL v2");
-- 
2.8.1

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


[PATCH V2 27/31] staging: ks7010: fix module annotations

2016-05-31 Thread Wolfram Sang
From: Wolfram Sang <wsa+rene...@sang-engineering.com>

List all authors, beautify description, match license to what is stated
in file headers, add firmware information.

Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com>
---
 drivers/staging/ks7010/ks7010_sdio.c | 10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
b/drivers/staging/ks7010/ks7010_sdio.c
index 8e8476b52cedbc..8c0d1bb58dcd9c 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -1261,9 +1261,7 @@ static void __exit ks7010_sdio_exit(void)
 module_init(ks7010_sdio_init);
 module_exit(ks7010_sdio_exit);
 
-MODULE_AUTHOR("Qi-Hardware based on KeyStream driver");
-MODULE_DESCRIPTION("Driver for KeyStream, KS7010 based SDIO cards. ");
-#ifdef MODULE_LICENSE
-MODULE_LICENSE("GPL");
-#endif
-MODULE_SUPPORTED_DEVICE("KS7910");
+MODULE_AUTHOR("Sang Engineering, Qi-Hardware, KeyStream");
+MODULE_DESCRIPTION("Driver for KeyStream KS7010 based SDIO cards");
+MODULE_LICENSE("GPL v2");
+MODULE_FIRMWARE(ROM_FILE);
-- 
2.8.1

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


[PATCH V2 26/31] staging: ks7010: remove supported card table with one element

2016-05-31 Thread Wolfram Sang
From: Wolfram Sang <wsa+rene...@sang-engineering.com>

There is only this card supported, no need to iterate over the table.
The resulting firmware filename wasn't used anyway, but came from the
config file or hardcoded default.

Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com>
---
 drivers/staging/ks7010/ks7010_sdio.c | 31 ++-
 drivers/staging/ks7010/ks7010_sdio.h |  2 --
 2 files changed, 2 insertions(+), 31 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
b/drivers/staging/ks7010/ks7010_sdio.c
index ed4d579300ad96..8e8476b52cedbc 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -35,19 +35,6 @@ static const struct sdio_device_id if_sdio_ids[] = {
{ /* all zero */ }
 };
 
-struct ks_sdio_model {
-   int model;
-   const char *firmware;
-};
-
-static struct ks_sdio_model ks_sdio_models[] = {
-   {
-   /* ks7010 */
-   .model = 0x10,
-   .firmware = "ks7010sd.rom",
-   },
-};
-
 static int ks7910_sdio_probe(struct sdio_func *function,
 const struct sdio_device_id *device);
 static void ks7910_sdio_remove(struct sdio_func *function);
@@ -996,7 +983,7 @@ static int ks7910_sdio_probe(struct sdio_func *func,
struct ks_sdio_card *card;
struct net_device *netdev;
unsigned char rw_data;
-   int i = 0, ret;
+   int ret;
 
DPRINTK(5, "ks7910_sdio_probe()\n");
 
@@ -1009,22 +996,8 @@ static int ks7910_sdio_probe(struct sdio_func *func,
return -ENOMEM;
 
card->func = func;
-   card->model = 0x10;
spin_lock_init(>lock);
 
-   /* select model */
-   for (i = 0; i < ARRAY_SIZE(ks_sdio_models); i++) {
-   if (card->model == ks_sdio_models[i].model)
-   break;
-   }
-
-   if (i == ARRAY_SIZE(ks_sdio_models)) {
-   DPRINTK(5, "unkown card model 0x%x\n", card->model);
-   goto error;
-   }
-
-   card->firmware = ks_sdio_models[i].firmware;
-
/*** Initialize  SDIO ***/
sdio_claim_host(func);
 
@@ -1172,7 +1145,7 @@ static int ks7910_sdio_probe(struct sdio_func *func,
sdio_release_host(func);
sdio_set_drvdata(func, NULL);
kfree(card);
- error:
+
return -ENODEV;
 }
 
diff --git a/drivers/staging/ks7010/ks7010_sdio.h 
b/drivers/staging/ks7010/ks7010_sdio.h
index aea3727caf483b..2d7be5dae157c7 100644
--- a/drivers/staging/ks7010/ks7010_sdio.h
+++ b/drivers/staging/ks7010/ks7010_sdio.h
@@ -109,8 +109,6 @@ struct ks_sdio_packet {
 struct ks_sdio_card {
struct sdio_func *func;
struct ks_wlan_private *priv;
-   int model;
-   const char *firmware;
spinlock_t lock;
 };
 
-- 
2.8.1

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


[PATCH V2 31/31] staging: ks7010: cleanup file headers

2016-05-31 Thread Wolfram Sang
From: Wolfram Sang <wsa+rene...@sang-engineering.com>

Remove svn-ids and fix typos in the licence declaration. Add my
copyright to the sdio code which I worked on mainly.

Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com>
---
 drivers/staging/ks7010/eap_packet.h| 6 --
 drivers/staging/ks7010/ks7010_sdio.c   | 8 +++-
 drivers/staging/ks7010/ks7010_sdio.h   | 8 ++--
 drivers/staging/ks7010/ks_hostif.c | 7 ++-
 drivers/staging/ks7010/ks_hostif.h | 7 ++-
 drivers/staging/ks7010/ks_wlan.h   | 7 ++-
 drivers/staging/ks7010/ks_wlan_ioctl.h | 7 ++-
 drivers/staging/ks7010/ks_wlan_net.c   | 7 ++-
 drivers/staging/ks7010/michael_mic.c   | 7 ++-
 drivers/staging/ks7010/michael_mic.h   | 7 ++-
 10 files changed, 19 insertions(+), 52 deletions(-)

diff --git a/drivers/staging/ks7010/eap_packet.h 
b/drivers/staging/ks7010/eap_packet.h
index 88384fb19d9580..16a392abdaec3b 100644
--- a/drivers/staging/ks7010/eap_packet.h
+++ b/drivers/staging/ks7010/eap_packet.h
@@ -1,9 +1,3 @@
-/*
- *
- *   eap_packet.h 
- *   $Id: eap_packet.h 991 2009-09-14 01:38:58Z sekine $
- *
- */
 #ifndef EAP_PACKET_H
 #define EAP_PACKET_H
 
diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
b/drivers/staging/ks7010/ks7010_sdio.c
index c166022b652e3a..c340254cc895a0 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -1,15 +1,13 @@
 /*
  *   Driver for KeyStream, KS7010 based SDIO cards.
  *
- *   ks7010_sdio.c
- *   $Id: ks7010_sdio.c 996 2009-09-14 02:54:21Z sekine $
- *
  *   Copyright (C) 2006-2008 KeyStream Corp.
  *   Copyright (C) 2009 Renesas Technology Corp.
+ *   Copyright (C) 2016 Sang Engineering, Wolfram Sang
  *
  *   This program is free software; you can redistribute it and/or modify
- *   it undr the terms of the GNU General Public License version 2 as
- *   published by the Free Sotware Foundation.
+ *   it under the terms of the GNU General Public License version 2 as
+ *   published by the Free Software Foundation.
  */
 
 #include 
diff --git a/drivers/staging/ks7010/ks7010_sdio.h 
b/drivers/staging/ks7010/ks7010_sdio.h
index 2d7be5dae157c7..987cfa724b9757 100644
--- a/drivers/staging/ks7010/ks7010_sdio.h
+++ b/drivers/staging/ks7010/ks7010_sdio.h
@@ -1,16 +1,12 @@
 /*
- *
  *   Driver for KeyStream, KS7010 based SDIO cards. 
- *   
- *   ks7010_sdio.h
- *   $Id: ks7010_sdio.h 1019 2009-09-28 05:41:07Z sekine $
  *
  *   Copyright (C) 2006-2008 KeyStream Corp.
  *   Copyright (C) 2009 Renesas Technology Corp.
  *
  *   This program is free software; you can redistribute it and/or modify
- *   it undr the terms of the GNU General Public License version 2 as
- *   published by the Free Sotware Foundation.
+ *   it under the terms of the GNU General Public License version 2 as
+ *   published by the Free Software Foundation.
  */
 #ifndef _KS7010_SDIO_H
 #define _KS7010_SDIO_H
diff --git a/drivers/staging/ks7010/ks_hostif.c 
b/drivers/staging/ks7010/ks_hostif.c
index f2a65c0ae630a2..a8822fe2bd6029 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -1,15 +1,12 @@
 /*
  *   Driver for KeyStream wireless LAN cards.
  *
- *   ks_hostif.c
- *   $Id: ks_hostif.c 996 2009-09-14 02:54:21Z sekine $
- *
  *   Copyright (C) 2005-2008 KeyStream Corp.
  *   Copyright (C) 2009 Renesas Technology Corp.
  *
  *   This program is free software; you can redistribute it and/or modify
- *   it undr the terms of the GNU General Public License version 2 as
- *   published by the Free Sotware Foundation.
+ *   it under the terms of the GNU General Public License version 2 as
+ *   published by the Free Software Foundation.
  */
 
 #include "ks_wlan.h"
diff --git a/drivers/staging/ks7010/ks_hostif.h 
b/drivers/staging/ks7010/ks_hostif.h
index 01de478d45ea60..dc806b5b47be8b 100644
--- a/drivers/staging/ks7010/ks_hostif.h
+++ b/drivers/staging/ks7010/ks_hostif.h
@@ -1,15 +1,12 @@
 /*
  *   Driver for KeyStream wireless LAN
  *   
- *   ks_hostif.h
- *   $Id: ks_hostif.h 994 2009-09-14 01:51:16Z sekine $
- *
  *   Copyright (c) 2005-2008 KeyStream Corp.
  *   Copyright (C) 2009 Renesas Technology Corp.
  *
  *   This program is free software; you can redistribute it and/or modify
- *   it undr the terms of the GNU General Public License version 2 as
- *   published by the Free Sotware Foundation.
+ *   it under the terms of the GNU General Public License version 2 as
+ *   published by the Free Software Foundation.
  */
 
 #ifndef _KS_HOSTIF_H_
diff --git a/drivers/staging/ks7010/ks_wlan.h b/drivers/staging/ks7010/ks_wlan.h
index a2126c2e728d2d..c42d99c6bc1fb2 100644
--- a/drivers/staging/ks7010/ks_wlan.h
+++ b/drivers/staging/ks7010/ks_wlan.h
@@ -1,15 +1,12 @@
 /*
  *   Driver for KeyStream IEEE802.11 b/g wireless LAN cards.
- *   
- *   ks_wlan.h
- *   $Id: ks_wlan.h 994 2009-09-14 01:51:16Z sekine $
  *
  *   Copyright (C) 2006-2008 KeyStream Corp.
  *   Copyright (C) 2009 R

[PATCH V2 16/31] staging: ks7010: indent ks7010_config.c

2016-05-31 Thread Wolfram Sang
From: Wolfram Sang <wsa+rene...@sang-engineering.com>

Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com>
---
 drivers/staging/ks7010/ks7010_config.c | 353 +
 1 file changed, 184 insertions(+), 169 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_config.c 
b/drivers/staging/ks7010/ks7010_config.c
index 48809bcc779739..4b495cbef48165 100644
--- a/drivers/staging/ks7010/ks7010_config.c
+++ b/drivers/staging/ks7010/ks7010_config.c
@@ -15,7 +15,8 @@ static int wep_type;
 #defineWEP_KEY_HEX   1
 
 static
-void analyze_character_wep_key(struct ks_wlan_parameter *param, int 
wep_key_index, char *value)
+void analyze_character_wep_key(struct ks_wlan_parameter *param,
+  int wep_key_index, char *value)
 {
int i;
unsigned char wep_key[26], key_length;
@@ -23,64 +24,69 @@ void analyze_character_wep_key(struct ks_wlan_parameter 
*param, int wep_key_inde
key_length = (wep_on_off == WEP_ON_64BIT) ? 5 : 13;
/* 64bit key_length = 5; 128bit key_length = 13; */
 
-   for (i=0; i<key_length; i++) {
+   for (i = 0; i < key_length; i++) {
wep_key[i] = value[i];
}
 
-   if(wep_key_index < 0 ||  wep_key_index > 3)
+   if (wep_key_index < 0 || wep_key_index > 3)
return;
 
param->wep_key[wep_key_index].size = key_length;
-   for (i=0; i<(param->wep_key[wep_key_index].size); i++) {
+   for (i = 0; i < (param->wep_key[wep_key_index].size); i++) {
param->wep_key[wep_key_index].val[i] = wep_key[i];
}
 }
 
 static
-void analyze_hex_wep_key(struct ks_wlan_parameter *param, int wep_key_index, 
char *value)
+void analyze_hex_wep_key(struct ks_wlan_parameter *param, int wep_key_index,
+char *value)
 {
unsigned char wep_end[26], i, j, key_length;
 
key_length = (wep_on_off == WEP_ON_64BIT) ? 10 : 26;
/* 64bit key_length = 10; 128bit key_length = 26; */
 
-   for (i=0; i<key_length; i++) {
+   for (i = 0; i < key_length; i++) {
wep_end[i] = value[i];
if (i % 2) {
/* Odd */
-   for (j=0x00; j<0x10; j++) {
-   if (j<0x0a) {
-   if (wep_end[i] == j+0x30)
+   for (j = 0x00; j < 0x10; j++) {
+   if (j < 0x0a) {
+   if (wep_end[i] == j + 0x30)
wep_end[i] = j;
} else {
-   if ((wep_end[i] == j+0x37) | 
(wep_end[i] == j+0x57))
+   if ((wep_end[i] ==
+j + 0x37) | (wep_end[i] ==
+ j + 0x57))
wep_end[i] = j;
}
}
} else {
/* Even */
-   for (j=0x00; j<0x10; j++) {
-   if (j<0x0a) {
-   if (wep_end[i] == j+0x30) {
-   wep_end[i] = j*16;
+   for (j = 0x00; j < 0x10; j++) {
+   if (j < 0x0a) {
+   if (wep_end[i] == j + 0x30) {
+   wep_end[i] = j * 16;
}
} else {
-   if ((wep_end[i] == j+0x37) | 
(wep_end[i] == j+0x57))
-   wep_end[i] = j*16;
+   if ((wep_end[i] ==
+j + 0x37) | (wep_end[i] ==
+ j + 0x57))
+   wep_end[i] = j * 16;
}
}
}
}
 
-   for (i=0; i 3)
-   return ;
+   if (wep_key_index < 0 || wep_key_index > 3)
+   return;
 
-   param->wep_key[wep_key_index].size = key_length/2;
-   for (i=0; i<(param->wep_key[wep_key_index].size); i++) {
+   param->wep_key[wep_key_index].size = key_length / 2;
+   for (i = 0; i < (param->wep_key[wep_key_index].size); i++) {
param->wep_key[wep_key_index].val[i] = wep_end[i];
}
 
@@ -89,62 +95,57 @@ void analyze_hex_wep_key(struct ks_wlan_parameter *param, 
int wep_key_index, cha
 static
 int rate_set_configuration(struct ks_wlan_private *priv, char *value)
 {
-   int rc=0;
+   int rc = 0;

[PATCH V2 17/31] staging: ks7010: indent ks7010_sdio.h

2016-05-31 Thread Wolfram Sang
From: Wolfram Sang <wsa+rene...@sang-engineering.com>

Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com>
---
 drivers/staging/ks7010/ks7010_sdio.h | 64 +---
 1 file changed, 30 insertions(+), 34 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.h 
b/drivers/staging/ks7010/ks7010_sdio.h
index 1d16673e5dae02..aea3727caf483b 100644
--- a/drivers/staging/ks7010/ks7010_sdio.h
+++ b/drivers/staging/ks7010/ks7010_sdio.h
@@ -21,7 +21,7 @@
 #define DEVICE_ALIGNMENT 32
 
 /*  SDIO KeyStream vendor and device */
-#define SDIO_VENDOR_ID_KS_CODE_A   0x005b 
+#define SDIO_VENDOR_ID_KS_CODE_A   0x005b
 #define SDIO_VENDOR_ID_KS_CODE_B   0x0023
 #define SDIO_DEVICE_ID_KS_7010 0x7910
 
@@ -48,8 +48,8 @@
  * for network packet (less than 2048 bytes data)
  */
 #define WSTATUS_RSIZE  0x14
-#define WSTATUS_MASK   0x80 /* Write Status Register value */
-#define RSIZE_MASK 0x7F /* Read Data Size Register value [10:4] */
+#define WSTATUS_MASK   0x80/* Write Status Register value */
+#define RSIZE_MASK 0x7F/* Read Data Size Register value [10:4] 
*/
 
 /* ARM to SD interrupt Enable */
 #define INT_ENABLE 0x20
@@ -88,52 +88,48 @@
 
 #define KS7010_IRAM_ADDRESS0x0600
 
-
 /* 
  * struct define
  */
 struct hw_info_t {
-   struct ks_sdio_card *sdio_card; 
+   struct ks_sdio_card *sdio_card;
struct completion ks7010_sdio_wait;
struct workqueue_struct *ks7010sdio_wq;
struct delayed_work rw_wq;
-   unsigned char   *read_buf;
+   unsigned char *read_buf;
struct tasklet_struct rx_bh_task;
 };
 
 struct ks_sdio_packet {
-struct ks_sdio_packet   *next;
-u16 nb;
-u8  buffer[0] __attribute__((aligned(4)));
+   struct ks_sdio_packet *next;
+   u16 nb;
+   u8 buffer[0] __attribute__ ((aligned(4)));
 };
 
-
 struct ks_sdio_card {
-   struct sdio_func*func;
+   struct sdio_func *func;
struct ks_wlan_private *priv;
-   int model;
-   const char  *firmware;
-spinlock_t  lock;
+   int model;
+   const char *firmware;
+   spinlock_t lock;
 };
 
-
-
 /* Tx Device struct */
-#defineTX_DEVICE_BUFF_SIZE 1024 
+#defineTX_DEVICE_BUFF_SIZE 1024
 
 struct tx_device_buffer {
-unsigned char *sendp;  /* pointer of send req data */
-unsigned int  size;
-   void(*complete_handler)(void *arg1, void *arg2);
-   void*arg1;
-   void*arg2;
+   unsigned char *sendp;   /* pointer of send req data */
+   unsigned int size;
+   void (*complete_handler) (void *arg1, void *arg2);
+   void *arg1;
+   void *arg2;
 };
 
-struct tx_device{
-struct tx_device_buffer tx_dev_buff[TX_DEVICE_BUFF_SIZE];
-unsigned int   qhead; /* tx buffer queue first pointer */
-unsigned int   qtail; /* tx buffer queue last pointer */
-spinlock_t  tx_dev_lock;
+struct tx_device {
+   struct tx_device_buffer tx_dev_buff[TX_DEVICE_BUFF_SIZE];
+   unsigned int qhead; /* tx buffer queue first pointer */
+   unsigned int qtail; /* tx buffer queue last pointer */
+   spinlock_t tx_dev_lock;
 };
 
 /* Rx Device struct */
@@ -141,15 +137,15 @@ struct tx_device{
 #defineRX_DEVICE_BUFF_SIZE 32
 
 struct rx_device_buffer {
-   unsigned char   data[RX_DATA_SIZE];
-   unsigned intsize;
+   unsigned char data[RX_DATA_SIZE];
+   unsigned int size;
 };
 
-struct rx_device{
-struct rx_device_buffer rx_dev_buff[RX_DEVICE_BUFF_SIZE];
-unsigned int   qhead; /* rx buffer queue first pointer */
-   unsigned intqtail; /* rx buffer queue last pointer */
-   spinlock_t  rx_dev_lock;
+struct rx_device {
+   struct rx_device_buffer rx_dev_buff[RX_DEVICE_BUFF_SIZE];
+   unsigned int qhead; /* rx buffer queue first pointer */
+   unsigned int qtail; /* rx buffer queue last pointer */
+   spinlock_t rx_dev_lock;
 };
 #defineROM_FILE "ks7010sd.rom"
 #defineCFG_FILE "ks79xx.cfg"
-- 
2.8.1

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


[PATCH V2 21/31] staging: ks7010: indent ks_wlan_ioctl.h

2016-05-31 Thread Wolfram Sang
From: Wolfram Sang <wsa+rene...@sang-engineering.com>

Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com>
---
 drivers/staging/ks7010/ks_wlan_ioctl.h | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/ks7010/ks_wlan_ioctl.h 
b/drivers/staging/ks7010/ks_wlan_ioctl.h
index e7469f7338f7af..cc4669eddcc1f7 100644
--- a/drivers/staging/ks7010/ks_wlan_ioctl.h
+++ b/drivers/staging/ks7010/ks_wlan_ioctl.h
@@ -36,8 +36,8 @@
 #define KS_WLAN_GET_SCAN_TYPE  SIOCIWFIRSTPRIV+13
 #define KS_WLAN_SET_RX_GAINSIOCIWFIRSTPRIV+14
 #define KS_WLAN_GET_RX_GAINSIOCIWFIRSTPRIV+15
-#define KS_WLAN_HOSTT  SIOCIWFIRSTPRIV+16  /* unused */
-//#define KS_WLAN_SET_REGION   SIOCIWFIRSTPRIV+17
+#define KS_WLAN_HOSTT  SIOCIWFIRSTPRIV+16  /* unused */
+//#define KS_WLAN_SET_REGIONSIOCIWFIRSTPRIV+17
 #define KS_WLAN_SET_BEACON_LOSTSIOCIWFIRSTPRIV+18
 #define KS_WLAN_GET_BEACON_LOSTSIOCIWFIRSTPRIV+19
 
@@ -51,8 +51,8 @@
 #define KS_WLAN_GET_CTS_MODE   SIOCIWFIRSTPRIV+25
 /* SIOCIWFIRSTPRIV+26 */
 /* SIOCIWFIRSTPRIV+27 */
-#define KS_WLAN_SET_SLEEP_MODE SIOCIWFIRSTPRIV+28 /* sleep mode */
-#define KS_WLAN_GET_SLEEP_MODE SIOCIWFIRSTPRIV+29 /* sleep mode */
+#define KS_WLAN_SET_SLEEP_MODE SIOCIWFIRSTPRIV+28  /* sleep mode */
+#define KS_WLAN_GET_SLEEP_MODE SIOCIWFIRSTPRIV+29  /* sleep mode */
 /* SIOCIWFIRSTPRIV+30 */
 /* SIOCIWFIRSTPRIV+31 */
 
@@ -62,7 +62,8 @@
 #include 
 
 extern int ks_wlan_read_config_file(struct ks_wlan_private *priv);
-extern int ks_wlan_setup_parameter(struct ks_wlan_private *priv, unsigned int 
commit_flag);
+extern int ks_wlan_setup_parameter(struct ks_wlan_private *priv,
+  unsigned int commit_flag);
 
 #endif /* __KERNEL__ */
 
-- 
2.8.1

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


[PATCH V2 20/31] staging: ks7010: indent ks_wlan.h

2016-05-31 Thread Wolfram Sang
From: Wolfram Sang <wsa+rene...@sang-engineering.com>

Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com>
---
 drivers/staging/ks7010/ks_wlan.h | 246 +++
 1 file changed, 121 insertions(+), 125 deletions(-)

diff --git a/drivers/staging/ks7010/ks_wlan.h b/drivers/staging/ks7010/ks_wlan.h
index 58e3a5a6b44472..f0f9f8ef7d6185 100644
--- a/drivers/staging/ks7010/ks_wlan.h
+++ b/drivers/staging/ks7010/ks_wlan.h
@@ -22,16 +22,16 @@
 #include 
 #include 
 
-#include /* spinlock_t   
*/
-#include/* wait_queue_head_t
*/
-#include/* pid_t
*/
-#include/* struct net_device_stats,  struct sk_buff 
*/
+#include /* spinlock_t   
*/
+#include/* wait_queue_head_t
*/
+#include/* pid_t
*/
+#include/* struct net_device_stats,  struct sk_buff 
*/
 #include 
 #include 
-#include /* struct atmic_t   
*/
+#include /* struct atmic_t   
*/
 #include/* struct timer_list */
 #include 
-#include/* struct completion */
+#include   /* struct completion */
 #include 
 
 #include 
@@ -46,37 +46,37 @@
 #endif
 
 struct ks_wlan_parameter {
-   uint8_t operation_mode;/* Operation Mode */
-   uint8_t channel;   /*  Channel */
-   uint8_t tx_rate;   /*  Transmit Rate */
+   uint8_t operation_mode; /* Operation Mode */
+   uint8_t channel;/*  Channel */
+   uint8_t tx_rate;/*  Transmit Rate */
struct {
uint8_t size;
uint8_t body[16];
} rate_set;
-   uint8_t bssid[ETH_ALEN];/* BSSID */
+   uint8_t bssid[ETH_ALEN];/* BSSID */
struct {
uint8_t size;
-   uint8_t body[32+1];
-   } ssid;/*  SSID */
-   uint8_t preamble;  /*  Preamble */
-   uint8_t powermgt;  /*  PowerManagementMode */
-   uint32_tscan_type; /*  AP List Scan Type */
+   uint8_t body[32 + 1];
+   } ssid; /*  SSID */
+   uint8_t preamble;   /*  Preamble */
+   uint8_t powermgt;   /*  PowerManagementMode */
+   uint32_t scan_type; /*  AP List Scan Type */
 #define BEACON_LOST_COUNT_MIN 0
 #define BEACON_LOST_COUNT_MAX 65535
-   uint32_tbeacon_lost_count; /*  Beacon Lost Count */
-   uint32_trts;   /*  RTS Threashold */
-   uint32_tfragment;  /*  Fragmentation Threashold */
-   uint32_tprivacy_invoked;
-   uint32_twep_index;
+   uint32_t beacon_lost_count; /*  Beacon Lost Count */
+   uint32_t rts;   /*  RTS Threashold */
+   uint32_t fragment;  /*  Fragmentation Threashold */
+   uint32_t privacy_invoked;
+   uint32_t wep_index;
struct {
uint8_t size;
-   uint8_t val[13*2+1];
+   uint8_t val[13 * 2 + 1];
} wep_key[4];
-   uint16_tauthenticate_type;  
-   uint16_tphy_type; /* 11b/11g/11bg mode type*/
-   uint16_tcts_mode; /* for 11g/11bg mode cts mode */
-   uint16_tphy_info_timer; /* phy information timer */
-   charrom_file[256];
+   uint16_t authenticate_type;
+   uint16_t phy_type;  /* 11b/11g/11bg mode type */
+   uint16_t cts_mode;  /* for 11g/11bg mode cts mode */
+   uint16_t phy_info_timer;/* phy information timer */
+   char rom_file[256];
 };
 
 enum {
@@ -157,7 +157,6 @@ enum {
SME_START_REQUEST,
SME_GET_EEPROM_CKSUM,
 
-
SME_MIC_FAILURE_CONFIRM,
SME_START_CONFIRM,
 
@@ -187,7 +186,7 @@ enum {
SME_WEP_SET_CONFIRM,
SME_TERMINATE,
 
-   SME_EVENT_SIZE/* end */
+   SME_EVENT_SIZE  /* end */
 };
 
 /* SME Status */
@@ -200,58 +199,58 @@ enum {
 
 #defineSME_EVENT_BUFF_SIZE 128
 
-struct sme_info{
-   int sme_status;
-   int event_buff[SME_EVENT_BUFF_SIZE];
-   unsigned intqhead;
-   unsigned intqtail;
+struct sme_info {
+   int sme_status;
+   int event_buff[SME_EVENT_BUFF_SIZE];
+   unsigned int qhead;
+   unsigned int qtail;
 #ifdef KS_WLAN_DEBUG
-  /* for debug */
+   /* for debug */
unsigned int max_event_count;
 #endif
-   spinlock_tsme_spin;
+   spinlock_t sme_spin;
unsigned long sme_flag;
 };
 
-struct hostt_t{
-   int buff[SME_EVENT_BUFF_SIZE];
-   unsigned intqhead;
-   unsigned intqtail;
+struct hostt_t {
+   int buff[SME_EVENT_BUFF_SIZE];
+   unsigned int qhead;
+   unsigned int qtail;
 }

[PATCH V2 19/31] staging: ks7010: indent ks_hostif.h

2016-05-31 Thread Wolfram Sang
From: Wolfram Sang <wsa+rene...@sang-engineering.com>

Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com>
---
 drivers/staging/ks7010/ks_hostif.h | 525 ++---
 1 file changed, 262 insertions(+), 263 deletions(-)

diff --git a/drivers/staging/ks7010/ks_hostif.h 
b/drivers/staging/ks7010/ks_hostif.h
index c333ce1a4baa6e..01de478d45ea60 100644
--- a/drivers/staging/ks7010/ks_hostif.h
+++ b/drivers/staging/ks7010/ks_hostif.h
@@ -62,141 +62,140 @@
  */
 
 struct hostif_hdr {
-   uint16_tsize;
-   uint16_tevent;
-} __attribute__((packed));
+   uint16_t size;
+   uint16_t event;
+} __attribute__ ((packed));
 
 struct hostif_data_request_t {
struct hostif_hdr header;
-   uint16_tauth_type;
+   uint16_t auth_type;
 #define TYPE_DATA 0x
 #define TYPE_AUTH 0x0001
-   uint16_treserved;
-   uint8_t data[0];
-} __attribute__((packed));
+   uint16_t reserved;
+   uint8_t data[0];
+} __attribute__ ((packed));
 
 struct hostif_data_indication_t {
struct hostif_hdr header;
-   uint16_tauth_type;
+   uint16_t auth_type;
 /* #define TYPE_DATA 0x */
 #define TYPE_PMK1 0x0001
 #define TYPE_GMK1 0x0002
 #define TYPE_GMK2 0x0003
-   uint16_treserved;
-   uint8_t data[0];
-} __attribute__((packed));
+   uint16_t reserved;
+   uint8_t data[0];
+} __attribute__ ((packed));
 
 #define CHANNEL_LIST_MAX_SIZE 14
 struct channel_list_t {
-   uint8_t size;
-   uint8_t body[CHANNEL_LIST_MAX_SIZE];
-   uint8_t pad;
-} __attribute__((packed));
+   uint8_t size;
+   uint8_t body[CHANNEL_LIST_MAX_SIZE];
+   uint8_t pad;
+} __attribute__ ((packed));
 
 /* MIB Attribute */
-#define DOT11_MAC_ADDRESS 0x21010100 /* MAC Address (R) */
-#define DOT11_PRODUCT_VERSION 0x31024100 /* FirmWare Version (R)*/
-#define DOT11_RTS_THRESHOLD   0x21020100 /* RTS Threshold (R/W) */
-#define DOT11_FRAGMENTATION_THRESHOLD 0x21050100 /* Fragment Threshold 
(R/W) */
-#define DOT11_PRIVACY_INVOKED 0x15010100 /* WEP ON/OFF (W) */
-#define DOT11_WEP_DEFAULT_KEY_ID  0x15020100 /* WEP Index (W) */
-#define DOT11_WEP_DEFAULT_KEY_VALUE1  0x13020101 /* WEP Key#1(TKIP AES: 
PairwiseTemporalKey) (W) */
-#define DOT11_WEP_DEFAULT_KEY_VALUE2  0x13020102 /* WEP Key#2(TKIP AES: 
GroupKey1) (W) */
-#define DOT11_WEP_DEFAULT_KEY_VALUE3  0x13020103 /* WEP Key#3(TKIP AES: 
GroupKey2) (W) */
-#define DOT11_WEP_DEFAULT_KEY_VALUE4  0x13020104 /* WEP Key#4 (W) */
-#define DOT11_WEP_LIST0x13020100 /* WEP LIST */
-#defineDOT11_DESIRED_SSID0x11090100 /* SSID */
-#defineDOT11_CURRENT_CHANNEL 0x45010100 /* channel set */
-#defineDOT11_OPERATION_RATE_SET  0x0100 /* rate set */
-
-#define LOCAL_AP_SEARCH_INTEAVAL  0xF1010100 /* AP search interval 
(R/W) */
-#define LOCAL_CURRENTADDRESS  0xF1050100 /* MAC Adress change (W) 
*/
-#define LOCAL_MULTICAST_ADDRESS   0xF1060100 /* Multicast Adress (W) */
-#define LOCAL_MULTICAST_FILTER0xF1060200 /* Multicast Adress 
Filter enable/disable (W) */
-#define LOCAL_SEARCHED_AP_LIST0xF1030100 /* AP list (R) */
-#define LOCAL_LINK_AP_STATUS  0xF1040100 /* Link AP status (R) */
-#defineLOCAL_PACKET_STATISTICS   0xF1020100 /* tx,rx packets 
statistics */
-#define LOCAL_AP_SCAN_LIST_TYPE_SET  0xF1030200 /* AP_SCAN_LIST_TYPE */
-
-#define DOT11_RSN_ENABLED 0x15070100 /* WPA enable/disable (W) 
*/
-#define LOCAL_RSN_MODE0x56010100 /* RSN mode WPA/WPA2 (W) 
*/
-#define DOT11_RSN_CONFIG_MULTICAST_CIPHER 0x51040100 /* GroupKeyCipherSuite 
(W) */
-#define DOT11_RSN_CONFIG_UNICAST_CIPHER   0x52020100 /* PairwiseKeyCipherSuite 
(W) */
-#define DOT11_RSN_CONFIG_AUTH_SUITE   0x53020100 /* 
AuthenticationKeyManagementSuite (W) */
-#define DOT11_RSN_CONFIG_VERSION  0x51020100 /* RSN version (W) */
-#define LOCAL_RSN_CONFIG_ALL  0x5F010100 /* RSN CONFIG ALL (W) */
-#define DOT11_PMK_TSC 0x55010100 /* PMK_TSC (W) */
-#define DOT11_GMK1_TSC0x55010101 /* GMK1_TSC (W) */
-#define DOT11_GMK2_TSC0x55010102 /* GMK2_TSC (W) */
-#define DOT11_GMK3_TSC   0x55010103 /* GMK3_TSC */
-#define LOCAL_PMK 0x58010100 /* Pairwise Master Key 
cache (W) */
-
-#define LOCAL_REGION  0xF10A0100 /* Region setting */
+#define DOT11_MAC_ADDRESS 0x21010100   /* MAC Address (R) */
+#define DOT11_PRODUCT_VERSION 0x31024100   /* FirmWare Version (R) 
*/
+#define DOT11_RTS_THRESHOLD   0x21020100   /* RTS Threshold (R/W) 
*/
+#define DOT11_FRAGMENTATION_THRESHOLD 0x21050100   /* Fragment Threshold 
(R/W)

[PATCH V2 15/31] staging: ks7010: indent eap_packet.h

2016-05-31 Thread Wolfram Sang
From: Wolfram Sang <wsa+rene...@sang-engineering.com>

Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com>
---
 drivers/staging/ks7010/eap_packet.h | 49 ++---
 1 file changed, 24 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/ks7010/eap_packet.h 
b/drivers/staging/ks7010/eap_packet.h
index b664bdd8c961db..88384fb19d9580 100644
--- a/drivers/staging/ks7010/eap_packet.h
+++ b/drivers/staging/ks7010/eap_packet.h
@@ -14,13 +14,13 @@
 #endif
 
 struct ether_hdr {
-   unsigned char   h_dest[ETH_ALEN];   /* destination eth addr */
-   unsigned char   h_source[ETH_ALEN]; /* source ether addr*/
-   unsigned char   h_dest_snap;
-   unsigned char   h_source_snap;
-   unsigned char   h_command;
-   unsigned char   h_vendor_id[3];
-   unsigned short  h_proto;/* packet type ID field */
+   unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
+   unsigned char h_source[ETH_ALEN];   /* source ether addr*/
+   unsigned char h_dest_snap;
+   unsigned char h_source_snap;
+   unsigned char h_command;
+   unsigned char h_vendor_id[3];
+   unsigned short h_proto; /* packet type ID field */
 #define ETHER_PROTOCOL_TYPE_EAP0x888e
 #define ETHER_PROTOCOL_TYPE_IP 0x0800
 #define ETHER_PROTOCOL_TYPE_ARP0x0806
@@ -37,15 +37,15 @@ struct ieee802_1x_hdr {
 #define EAPOL_VERSION 2
 
 enum { IEEE802_1X_TYPE_EAP_PACKET = 0,
-   IEEE802_1X_TYPE_EAPOL_START = 1,
-   IEEE802_1X_TYPE_EAPOL_LOGOFF = 2,
-   IEEE802_1X_TYPE_EAPOL_KEY = 3,
-   IEEE802_1X_TYPE_EAPOL_ENCAPSULATED_ASF_ALERT = 4
+   IEEE802_1X_TYPE_EAPOL_START = 1,
+   IEEE802_1X_TYPE_EAPOL_LOGOFF = 2,
+   IEEE802_1X_TYPE_EAPOL_KEY = 3,
+   IEEE802_1X_TYPE_EAPOL_ENCAPSULATED_ASF_ALERT = 4
 };
 
 enum { EAPOL_KEY_TYPE_RC4 = 1, EAPOL_KEY_TYPE_RSN = 2,
-   EAPOL_KEY_TYPE_WPA = 254 };
-
+   EAPOL_KEY_TYPE_WPA = 254
+};
 
 #define IEEE8021X_REPLAY_COUNTER_LEN 8
 #define IEEE8021X_KEY_SIGN_LEN 16
@@ -60,11 +60,11 @@ struct ieee802_1x_eapol_key {
/* does not repeat within the life of the keying material used to
 * encrypt the Key field; 64-bit NTP timestamp MAY be used here */
unsigned char replay_counter[IEEE8021X_REPLAY_COUNTER_LEN];
-   unsigned char key_iv[IEEE8021X_KEY_IV_LEN]; /* cryptographically random 
number */
-   unsigned char key_index; /* key flag in the most significant bit:
-  * 0 = broadcast (default key),
-  * 1 = unicast (key mapping key); key index is in the
-  * 7 least significant bits */
+   unsigned char key_iv[IEEE8021X_KEY_IV_LEN]; /* cryptographically 
random number */
+   unsigned char key_index;/* key flag in the most significant bit:
+* 0 = broadcast (default key),
+* 1 = unicast (key mapping key); key 
index is in the
+* 7 least significant bits */
/* HMAC-MD5 message integrity check computed with MS-MPPE-Send-Key as
 * the key */
unsigned char key_signature[IEEE8021X_KEY_SIGN_LEN];
@@ -77,19 +77,18 @@ struct ieee802_1x_eapol_key {
 * RC4 key used in encryption = Key-IV + MS-MPPE-Recv-Key */
 } __attribute__ ((packed));
 
-
 #define WPA_NONCE_LEN 32
 #define WPA_REPLAY_COUNTER_LEN 8
 
 struct wpa_eapol_key {
unsigned char type;
-   unsigned short key_info;
+   unsigned short key_info;
unsigned short key_length;
unsigned char replay_counter[WPA_REPLAY_COUNTER_LEN];
unsigned char key_nonce[WPA_NONCE_LEN];
unsigned char key_iv[16];
unsigned char key_rsc[8];
-   unsigned char key_id[8]; /* Reserved in IEEE 802.11i/RSN */
+   unsigned char key_id[8];/* Reserved in IEEE 802.11i/RSN */
unsigned char key_mic[16];
unsigned short key_data_length;
/* followed by key_data_length bytes of key_data */
@@ -98,18 +97,18 @@ struct wpa_eapol_key {
 #define WPA_KEY_INFO_TYPE_MASK (WBIT(0) | WBIT(1) | WBIT(2))
 #define WPA_KEY_INFO_TYPE_HMAC_MD5_RC4 WBIT(0)
 #define WPA_KEY_INFO_TYPE_HMAC_SHA1_AES WBIT(1)
-#define WPA_KEY_INFO_KEY_TYPE WBIT(3) /* 1 = Pairwise, 0 = Group key */
+#define WPA_KEY_INFO_KEY_TYPE WBIT(3)  /* 1 = Pairwise, 0 = Group key */
 /* bit4..5 is used in WPA, but is reserved in IEEE 802.11i/RSN */
 #define WPA_KEY_INFO_KEY_INDEX_MASK (WBIT(4) | WBIT(5))
 #define WPA_KEY_INFO_KEY_INDEX_SHIFT 4
-#define WPA_KEY_INFO_INSTALL WBIT(6) /* pairwise */
-#define WPA_KEY_INFO_TXRX WBIT(6) /* group */
+#define WPA_KEY_INFO_INSTALL WBIT(6)   /* pairwise */
+#define WPA_KEY_INFO_TXRX WBIT(6)  /* group */
 #define WPA_KEY_INFO_ACK WBIT(7)
 #define WPA_KEY_INFO_MIC WBIT(8)
 #define WPA_KEY_INFO_SECURE WBIT(9)
 #define WPA_KEY_INFO_ERROR WBIT(10)
 #define WPA_KEY_INFO_REQ

[PATCH V2 24/31] staging: ks7010: indent michael_mic.h

2016-05-31 Thread Wolfram Sang
From: Wolfram Sang <wsa+rene...@sang-engineering.com>

Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com>
---
 drivers/staging/ks7010/michael_mic.h | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/ks7010/michael_mic.h 
b/drivers/staging/ks7010/michael_mic.h
index f14f160ad46549..57ecbe34153202 100644
--- a/drivers/staging/ks7010/michael_mic.h
+++ b/drivers/staging/ks7010/michael_mic.h
@@ -16,14 +16,14 @@
 struct michel_mic_t {
uint32_t K0;// Key 
uint32_t K1;// Key 
-   uint32_t L; // Current state 
-   uint32_t R; // Current state 
-   uint8_t M[4];   // Message accumulator (single word) 
-   int nBytesInM;  // # bytes in M 
-   uint8_t Result[8];
+   uint32_t L; // Current state 
+   uint32_t R; // Current state 
+   uint8_t M[4];   // Message accumulator (single word) 
+   int nBytesInM;  // # bytes in M 
+   uint8_t Result[8];
 };
 
 extern
-void MichaelMICFunction( struct michel_mic_t *Mic, uint8_t *Key, 
-uint8_t *Data, int Len, uint8_t priority, 
-uint8_t *Result );
+void MichaelMICFunction(struct michel_mic_t *Mic, uint8_t * Key,
+   uint8_t * Data, int Len, uint8_t priority,
+   uint8_t * Result);
-- 
2.8.1

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


[PATCH V2 23/31] staging: ks7010: indent michael_mic.c

2016-05-31 Thread Wolfram Sang
From: Wolfram Sang <wsa+rene...@sang-engineering.com>

Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com>
---
 drivers/staging/ks7010/michael_mic.c | 43 ++--
 1 file changed, 21 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/ks7010/michael_mic.c 
b/drivers/staging/ks7010/michael_mic.c
index ec8769a974427a..adb17df46f939b 100644
--- a/drivers/staging/ks7010/michael_mic.c
+++ b/drivers/staging/ks7010/michael_mic.c
@@ -34,11 +34,11 @@
A->nBytesInM = 0;
 
 static
-void MichaelInitializeFunction( struct michel_mic_t *Mic, uint8_t *key )
+void MichaelInitializeFunction(struct michel_mic_t *Mic, uint8_t * key)
 {
// Set the key
-   Mic->K0 = getUInt32( key , 0 );
-   Mic->K1 = getUInt32( key , 4 );
+   Mic->K0 = getUInt32(key, 0);
+   Mic->K1 = getUInt32(key, 4);
 
//clear();
MichaelClear(Mic);
@@ -56,11 +56,10 @@ do{ 
\
L += R; \
 }while(0)
 
-
 static
-void MichaelAppend( struct michel_mic_t *Mic, uint8_t *src, int nBytes )
+void MichaelAppend(struct michel_mic_t *Mic, uint8_t * src, int nBytes)
 {
-   int addlen ;
+   int addlen;
if (Mic->nBytesInM) {
addlen = 4 - Mic->nBytesInM;
if (addlen > nBytes)
@@ -73,13 +72,13 @@ void MichaelAppend( struct michel_mic_t *Mic, uint8_t *src, 
int nBytes )
if (Mic->nBytesInM < 4)
return;
 
-   Mic->L ^= getUInt32(Mic->M,0);
+   Mic->L ^= getUInt32(Mic->M, 0);
MichaelBlockFunction(Mic->L, Mic->R);
Mic->nBytesInM = 0;
}
 
-   while(nBytes >= 4){
-   Mic->L ^= getUInt32(src,0);
+   while (nBytes >= 4) {
+   Mic->L ^= getUInt32(src, 0);
MichaelBlockFunction(Mic->L, Mic->R);
src += 4;
nBytes -= 4;
@@ -92,7 +91,7 @@ void MichaelAppend( struct michel_mic_t *Mic, uint8_t *src, 
int nBytes )
 }
 
 static
-void MichaelGetMIC( struct michel_mic_t *Mic, uint8_t *dst )
+void MichaelGetMIC(struct michel_mic_t *Mic, uint8_t * dst)
 {
uint8_t *data = Mic->M;
switch (Mic->nBytesInM) {
@@ -107,24 +106,24 @@ void MichaelGetMIC( struct michel_mic_t *Mic, uint8_t 
*dst )
break;
case 3:
Mic->L ^= data[0] | (data[1] << 8) | (data[2] << 16) |
-   0x5a00;
+   0x5a00;
break;
}
MichaelBlockFunction(Mic->L, Mic->R);
MichaelBlockFunction(Mic->L, Mic->R);
// The appendByte function has already computed the result.
-   putUInt32( dst, 0, Mic->L );
-   putUInt32( dst, 4, Mic->R );
+   putUInt32(dst, 0, Mic->L);
+   putUInt32(dst, 4, Mic->R);
 
// Reset to the empty message.
MichaelClear(Mic);
 }
 
-void MichaelMICFunction( struct michel_mic_t *Mic, uint8_t *Key,
-uint8_t *Data, int Len, uint8_t priority,
-uint8_t *Result )
+void MichaelMICFunction(struct michel_mic_t *Mic, uint8_t * Key,
+   uint8_t * Data, int Len, uint8_t priority,
+   uint8_t * Result)
 {
-   uint8_t pad_data[4] = {priority,0,0,0};
+   uint8_t pad_data[4] = { priority, 0, 0, 0 };
// Compute the MIC value
/*
 * IEEE802.11i  page 47
@@ -135,9 +134,9 @@ void MichaelMICFunction( struct michel_mic_t *Mic, uint8_t 
*Key,
 * |DA|SA|Priority|0 |Data|M0|M1|M2|M3|M4|M5|M6|M7|
 * +--+--++--++--+--+--+--+--+--+--+--+
 */
-   MichaelInitializeFunction( Mic, Key ) ;
-   MichaelAppend( Mic, (uint8_t*)Data, 12 ); /* |DA|SA| */
-   MichaelAppend( Mic, pad_data, 4 ); /* |Priority|0|0|0| */
-   MichaelAppend( Mic, (uint8_t*)(Data+12), Len -12 ); /* |Data| */
-   MichaelGetMIC( Mic, Result ) ;
+   MichaelInitializeFunction(Mic, Key);
+   MichaelAppend(Mic, (uint8_t *) Data, 12);   /* |DA|SA| */
+   MichaelAppend(Mic, pad_data, 4);/* |Priority|0|0|0| */
+   MichaelAppend(Mic, (uint8_t *) (Data + 12), Len - 12);  /* |Data| */
+   MichaelGetMIC(Mic, Result);
 }
-- 
2.8.1

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


[PATCH V2 14/31] staging: ks7010: remove unecessary typedef

2016-05-31 Thread Wolfram Sang
From: Wolfram Sang <wsa+rene...@sang-engineering.com>

Let's simply specify the struct to keep in sync with kernel coding
style.

Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com>
---
 drivers/staging/ks7010/ks7010_config.c |   4 +-
 drivers/staging/ks7010/ks7010_sdio.c   |  44 -
 drivers/staging/ks7010/ks7010_sdio.h   |   2 +-
 drivers/staging/ks7010/ks_hostif.c | 114 +++---
 drivers/staging/ks7010/ks_hostif.h |  10 +-
 drivers/staging/ks7010/ks_wlan.h   |   4 +-
 drivers/staging/ks7010/ks_wlan_ioctl.h |   4 +-
 drivers/staging/ks7010/ks_wlan_net.c   | 168 -
 8 files changed, 175 insertions(+), 175 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_config.c 
b/drivers/staging/ks7010/ks7010_config.c
index 4b00d25cd8f575..48809bcc779739 100644
--- a/drivers/staging/ks7010/ks7010_config.c
+++ b/drivers/staging/ks7010/ks7010_config.c
@@ -87,7 +87,7 @@ void analyze_hex_wep_key(struct ks_wlan_parameter *param, int 
wep_key_index, cha
 }
 
 static
-int rate_set_configuration(ks_wlan_private *priv, char *value)
+int rate_set_configuration(struct ks_wlan_private *priv, char *value)
 {
int rc=0;
 
@@ -169,7 +169,7 @@ int rate_set_configuration(ks_wlan_private *priv, char 
*value)
 }
 
 #include 
-int ks_wlan_read_config_file(ks_wlan_private *priv)
+int ks_wlan_read_config_file(struct ks_wlan_private *priv)
 {
struct {
const int key_len;
diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
b/drivers/staging/ks7010/ks7010_sdio.c
index 50364909449aec..fb9f0b533d867e 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -51,9 +51,9 @@ static struct ks_sdio_model ks_sdio_models[] = {
 static int ks7910_sdio_probe(struct sdio_func *function, const struct 
sdio_device_id *device);
 static void ks7910_sdio_remove(struct sdio_func *function);
 static void ks7010_rw_function(struct work_struct *work);
-static int ks7010_sdio_read( ks_wlan_private *priv, unsigned int address,
+static int ks7010_sdio_read( struct ks_wlan_private *priv, unsigned int 
address,
 unsigned char *buffer, int length );
-static int ks7010_sdio_write( ks_wlan_private *priv, unsigned int address,
+static int ks7010_sdio_write( struct ks_wlan_private *priv, unsigned int 
address,
  unsigned char *buffer, int length );
 /* macro */
 
@@ -71,7 +71,7 @@ static int ks7010_sdio_write( ks_wlan_private *priv, unsigned 
int address,
 #define cnt_rxqbody(priv) \
 (((priv->rx_dev.qtail + RX_DEVICE_BUFF_SIZE) - (priv->rx_dev.qhead)) % 
RX_DEVICE_BUFF_SIZE )
 
-void ks_wlan_hw_sleep_doze_request(ks_wlan_private *priv)
+void ks_wlan_hw_sleep_doze_request(struct ks_wlan_private *priv)
 {
unsigned char rw_data;
int retval;
@@ -102,7 +102,7 @@ out:
return;
 }
 
-void ks_wlan_hw_sleep_wakeup_request(ks_wlan_private *priv)
+void ks_wlan_hw_sleep_wakeup_request(struct ks_wlan_private *priv)
 {
unsigned char rw_data;
int retval;
@@ -134,7 +134,7 @@ out:
 }
 
 
-void ks_wlan_hw_wakeup_request(ks_wlan_private *priv)
+void ks_wlan_hw_wakeup_request(struct ks_wlan_private *priv)
 {
unsigned char rw_data;
int retval;
@@ -155,7 +155,7 @@ void ks_wlan_hw_wakeup_request(ks_wlan_private *priv)
}
 }
 
-int _ks_wlan_hw_power_save(ks_wlan_private *priv)
+int _ks_wlan_hw_power_save(struct ks_wlan_private *priv)
 {
int rc=0;
unsigned char rw_data;
@@ -220,13 +220,13 @@ int _ks_wlan_hw_power_save(ks_wlan_private *priv)
return rc;
 }
 
-int ks_wlan_hw_power_save(ks_wlan_private *priv)
+int ks_wlan_hw_power_save(struct ks_wlan_private *priv)
 {

queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,>ks_wlan_hw.rw_wq, 1);
return 0;
 }
 
-static int ks7010_sdio_read(ks_wlan_private *priv, unsigned int address,
+static int ks7010_sdio_read(struct ks_wlan_private *priv, unsigned int address,
unsigned char *buffer, int length)
 {
int rc = -1;
@@ -249,7 +249,7 @@ static int ks7010_sdio_read(ks_wlan_private *priv, unsigned 
int address,
return rc;
 }
 
-static int ks7010_sdio_write(ks_wlan_private *priv, unsigned int address,
+static int ks7010_sdio_write(struct ks_wlan_private *priv, unsigned int 
address,
 unsigned char *buffer, int length)
 {
int rc = -1;
@@ -272,7 +272,7 @@ static int ks7010_sdio_write(ks_wlan_private *priv, 
unsigned int address,
return rc;
 }
 
-static int enqueue_txdev(ks_wlan_private *priv, unsigned char *p, unsigned 
long size,
+static int enqueue_txdev(struct ks_wlan_private *priv, unsigned char *p, 
unsigned long size,
  void (*complete_handler)(void *arg1, void *arg2),
  void *arg1, void *arg2 )
 {
@@ -306,7 +306,7 @@ static int enqueue_txdev(ks_wlan_private *priv, unsigned 
char *p, unsigned long
 }
 
 /* w

[PATCH V2 04/31] staging: ks7010: remove checks for WIRELESS_EXT version

2016-05-31 Thread Wolfram Sang
From: Wolfram Sang <wsa+rene...@sang-engineering.com>

We are by far newer than that anyhow.

Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com>
---
 drivers/staging/ks7010/ks_hostif.c   | 23 ---
 drivers/staging/ks7010/ks_wlan_net.c | 14 --
 2 files changed, 37 deletions(-)

diff --git a/drivers/staging/ks7010/ks_hostif.c 
b/drivers/staging/ks7010/ks_hostif.c
index 0295bb4921fa20..6bea699655eec4 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -22,12 +22,7 @@
 #include 
 
 /* Include Wireless Extension definition and check version */
-#ifndef WIRELESS_EXT
-#include 
-#endif /* WIRELESS_EXT */
-#if WIRELESS_EXT > 12
 #include /* New driver API */
-#endif /* WIRELESS_EXT > 12 */
 
 extern int ks_wlan_hw_tx(ks_wlan_private *priv, void *p, unsigned long size,
 void (*complete_handler)(void *arg1, void *arg2),
@@ -121,10 +116,8 @@ static
 int get_current_ap(ks_wlan_private *priv, struct link_ap_info_t *ap_info)
 {
struct local_ap_t *ap;
-#if WIRELESS_EXT > 13
union iwreq_data wrqu;
struct net_device *netdev=priv->net_dev;
-#endif /* WIRELESS_EXT > 13 */
int rc=0;
 
DPRINTK(3,"\n");
@@ -190,7 +183,6 @@ int get_current_ap(ks_wlan_private *priv, struct 
link_ap_info_t *ap_info)
ap->wpa_ie.size = 0;
}
 
-#if WIRELESS_EXT > 13
wrqu.data.length = 0;
wrqu.data.flags = 0;
wrqu.ap_addr.sa_family = ARPHRD_ETHER;
@@ -203,7 +195,6 @@ int get_current_ap(ks_wlan_private *priv, struct 
link_ap_info_t *ap_info)
(unsigned char)wrqu.ap_addr.sa_data[4],(unsigned 
char)wrqu.ap_addr.sa_data[5]);
wireless_send_event(netdev, SIOCGIWAP, , NULL);
}
-#endif
DPRINTK(4,"\nLink AP\n");
DPRINTK(4,"bssid=%02X:%02X:%02X:%02X:%02X:%02X\n \
essid=%s\nrate_set=%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X\n
channel=%d\n \
@@ -338,9 +329,7 @@ void hostif_data_indication(ks_wlan_private *priv)
struct ieee802_1x_hdr *aa1x_hdr;
struct wpa_eapol_key *eap_key;
struct michel_mic_t michel_mic;
-#if WIRELESS_EXT > 14
union iwreq_data wrqu;
-#endif /* WIRELESS_EXT > 14 */
 
DPRINTK(3,"\n");
 
@@ -412,7 +401,6 @@ void hostif_data_indication(ks_wlan_private *priv)
mic_failure->counter = 
1;
}
priv->wpa.mic_failure.last_failure_time 
= now;
-#if WIRELESS_EXT > 14
/*  needed parameters: count, keyid, 
key type, TSC */
sprintf(buf, 
"MLME-MICHAELMICFAILURE.indication(keyid=%d %scast addr="

"%02x:%02x:%02x:%02x:%02x:%02x)",
@@ -424,7 +412,6 @@ void hostif_data_indication(ks_wlan_private *priv)
wrqu.data.length = strlen(buf);

DPRINTK(4,"IWEVENT:MICHAELMICFAILURE\n");
wireless_send_event(priv->net_dev, 
IWEVCUSTOM, , buf);
-#endif /* WIRELESS_EXT > 14 */
return;
}
}
@@ -754,9 +741,7 @@ void hostif_connect_indication(ks_wlan_private *priv)
unsigned int tmp=0;
unsigned int old_status=priv->connect_status;
struct net_device *netdev=priv->net_dev;
-#if WIRELESS_EXT > 13
union iwreq_data wrqu0;
-#endif /* WIRELESS_EXT > 13 */
connect_code = get_WORD(priv);
 
switch(connect_code){
@@ -791,7 +776,6 @@ void hostif_connect_indication(ks_wlan_private *priv)
}
ks_wlan_do_power_save(priv);
 
-#if WIRELESS_EXT > 13
wrqu0.data.length = 0;
wrqu0.data.flags = 0;
wrqu0.ap_addr.sa_family = ARPHRD_ETHER;
@@ -802,7 +786,6 @@ void hostif_connect_indication(ks_wlan_private *priv)
DPRINTK(3,"disconnect :: 
scan_ind_count=%d\n",priv->scan_ind_count);
wireless_send_event(netdev, SIOCGIWAP, , NULL);
}
-#endif /* WIRELESS_EXT > 13 */
priv->scan_ind_count=0;
 }
 
@@ -904,7 +887,6 @@ void hostif_adhoc_set_confirm(ks_wlan_private *priv)
 static
 void hostif_associate_indication(ks_wlan_private *priv)
 {
-#if WIRELESS_EXT > 14
struct association_request_t *assoc_req;
struct association_response_t *assoc_resp;
unsigned char *pb;
@@ -944,29 +926,24 @@ void hostif_associate_indication(ks_wlan_private *priv)
 
DPRINTK(3,"IWEVENT:ASSOCINFO\n");
wireless_send_event(priv->net_dev, IWEVCUSTOM, , buf);
-#endif /* WIRELESS_EXT > 14 */
 }
 
 static
 void hostif_bss_s

[PATCH V2 08/31] staging: ks7010: use kernel helper to print buffer

2016-05-31 Thread Wolfram Sang
From: Wolfram Sang <wsa+rene...@sang-engineering.com>

No need for an open coded one.

Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com>
---
 drivers/staging/ks7010/Makefile  |  2 +-
 drivers/staging/ks7010/ks7010_sdio.c |  9 +
 drivers/staging/ks7010/ks_debug.c| 30 --
 drivers/staging/ks7010/ks_debug.h|  2 --
 4 files changed, 6 insertions(+), 37 deletions(-)
 delete mode 100644 drivers/staging/ks7010/ks_debug.c

diff --git a/drivers/staging/ks7010/Makefile b/drivers/staging/ks7010/Makefile
index 32b0efc7bd00e8..f6a2cc8fd0276d 100644
--- a/drivers/staging/ks7010/Makefile
+++ b/drivers/staging/ks7010/Makefile
@@ -1,5 +1,5 @@
 obj-$(CONFIG_KS7010) += ks7010.o
 
 ccflags-y   += -DKS_WLAN_DEBUG=0
-ks7010-y:= michael_mic.o ks_hostif.o ks_wlan_net.o ks_debug.o \
+ks7010-y:= michael_mic.o ks_hostif.o ks_wlan_net.o \
ks7010_sdio.o ks7010_config.o
diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
b/drivers/staging/ks7010/ks7010_sdio.c
index 5b78522fad1ec1..1a1a43ff306aae 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -441,10 +441,11 @@ static void ks_wlan_hw_rx(void *dev, uint16_t size)
 
/* length check */
if(size > 2046 || size == 0){
-
-   DPRINTK(5,"-INVAILED DATA dump\n");
-   print_buffer(_buffer->data[0],32);
-
+#ifdef KS_WLAN_DEBUG
+   if (KS_WLAN_DEBUG > 5)
+   print_hex_dump_bytes("INVALID DATA dump: ", 
DUMP_PREFIX_OFFSET,
+rx_buffer->data, 32);
+#endif
/* rx_status update */
read_status = READ_STATUS_IDLE;
retval = ks7010_sdio_write(priv, READ_STATUS, _status, 
sizeof(read_status));
diff --git a/drivers/staging/ks7010/ks_debug.c 
b/drivers/staging/ks7010/ks_debug.c
deleted file mode 100644
index 009f5f6df8f4e6..00
--- a/drivers/staging/ks7010/ks_debug.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- *   Driver for KeyStream 11b/g wireless LAN cards.
- *   
- *   ks_debug.c
- *   $Id: ks_debug.c 991 2009-09-14 01:38:58Z sekine $
- *
- *   Copyright (C) 2005-2008 KeyStream Corp.
- *   Copyright (C) 2009 Renesas Technology Corp.
- *
- *   This program is free software; you can redistribute it and/or modify
- *   it undr the terms of the GNU General Public License version 2 as
- *   published by the Free Sotware Foundation.
- */
-#include "ks_wlan.h"
-#include "ks_debug.h"
-
-void print_buffer(unsigned char *p, int length)
-{
-#ifdef KS_WLAN_DEBUG
-int i;
-#define HEX_OFFSET "\
-   +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F"
-printk(HEX_OFFSET);
-for (i=0; i<length; i++) {
-if (i % 16 == 0) printk("\n%04X-%04X:", i, i+15);
-printk(" %02X", *(p+i));
-}
-printk("\n");
-#endif
-}
diff --git a/drivers/staging/ks7010/ks_debug.h 
b/drivers/staging/ks7010/ks_debug.h
index 2fd5d8484b7f04..adad5f927dfda9 100644
--- a/drivers/staging/ks7010/ks_debug.h
+++ b/drivers/staging/ks7010/ks_debug.h
@@ -25,6 +25,4 @@
 #define DPRINTK(n, fmt, args...)
 #endif
 
-extern void print_buffer(unsigned char *p, int size);
-
 #endif /* _KS_DEBUG_H */
-- 
2.8.1

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


[PATCH V2 10/31] staging: ks7010: really iterate over multicast addresses

2016-05-31 Thread Wolfram Sang
From: Wolfram Sang <wsa+rene...@sang-engineering.com>

The loop variable was defined but not really used. Fix this.

Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com>
---
 drivers/staging/ks7010/ks_hostif.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/ks7010/ks_hostif.c 
b/drivers/staging/ks7010/ks_hostif.c
index 367d487cef1ba8..b0a0a53d3a00bf 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -2105,7 +2105,7 @@ void hostif_sme_multicast_set(ks_wlan_private *priv)
struct netdev_hw_addr *ha;
charset_address[NIC_MAX_MCAST_LIST*ETH_ALEN];
unsigned long filter_type;
-   int i;
+   int i = 0;
 
DPRINTK(3,"\n");
 
@@ -2128,6 +2128,7 @@ void hostif_sme_multicast_set(ks_wlan_private *priv)
mc_count = netdev_mc_count(dev);
netdev_for_each_mc_addr(ha, dev) {
memcpy(_address[i*ETH_ALEN], ha->addr, 
ETH_ALEN);
+   i++;
}
priv->sme_i.sme_flag &= ~SME_MULTICAST;
hostif_mib_set_request(priv, LOCAL_MULTICAST_ADDRESS,
-- 
2.8.1

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


[PATCH V2 13/31] staging: ks7010: add example cfg file as a reference

2016-05-31 Thread Wolfram Sang
From: Wolfram Sang <wsa+rene...@sang-engineering.com>

We want to remove it, but to do so properly, it is good to have a
working example. Needs to be copied to /lib/firmware in order to be
used.

Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com>
---
 drivers/staging/ks7010/ks79xx.cfg | 116 ++
 1 file changed, 116 insertions(+)
 create mode 100644 drivers/staging/ks7010/ks79xx.cfg

diff --git a/drivers/staging/ks7010/ks79xx.cfg 
b/drivers/staging/ks7010/ks79xx.cfg
new file mode 100644
index 00..0f2d24d4e66a89
--- /dev/null
+++ b/drivers/staging/ks7010/ks79xx.cfg
@@ -0,0 +1,116 @@
+#ks79xx.cfg
+#KS79xx configuration file
+#
+
+#
+#BeaconLostCount   default 20
+BeaconLostCount=20
+#
+
+#
+#Ap List Scan Type default ACTIVE_SCAN ACTIVE_SCAN or PASSIVE_SCAN
+ScanType=ACTIVE_SCAN
+#
+
+#
+#Channel   default 10  min 1   max 14
+Channel=10
+#
+
+#
+#FragmentThreshold default 2346min 256 max 2346
+FragmentThreshold=2346
+#
+
+#
+#OperationMode default Infrastructure  Pseudo-Ad-Hoc or 802.11-Ad-Hoc 
or Infrastructure
+OperationMode=Infrastructure
+#
+
+#
+#PowerManagementMode   default ACTIVE ACTIVE or SAVE1 or SAVE2
+PowerManagementMode=ACTIVE
+#
+
+#
+#RTSThreshold  default 2347min 0   max 2347
+RTSThreshold=2347
+#
+
+#
+#SSID  default ""  max 32 character
+SSID="default"
+#
+
+#
+#TxRatedefault Auto1, 2, 5.5, 11   ex. 
TxRate=1,2 TxRate=11 TxRate=Auto ...
+TxRate=Auto
+#
+
+#
+#Wep   default OFF OFF or 64bit or 128bit
+Wep=OFF
+#
+
+#
+#WepType   default STRING  STRING or HEX
+WepType=STRING
+#
+
+#
+#WepIndex=1
+#
+
+#
+#WepKeyValue1
+#  character_wep_key:64bit key_length = 5;  128bit key_length = 13
+#hex_wep_key:64bit key_length = 10; 128bit key_length = 26
+#
+
+#
+#WepKeyValue2
+#  character_wep_key:64bit key_length = 5;  128bit key_length = 13
+#hex_wep_key:64bit key_length = 10; 128bit key_length = 26
+#
+
+#
+#WepKeyValue3
+#  character_wep_key:64bit key_length = 5;  128bit key_length = 13
+#hex_wep_key:64bit key_length = 10; 128bit key_length = 26
+#
+
+#
+#WepKeyValue4
+#  character_wep_key:64bit key_length = 5;  128bit key_length = 13
+#hex_wep_key:64bit key_length = 10; 128bit key_length = 26
+#
+
+#
+#AuthenticationAlgorithm default OPEN_SYSTEM   OPEN_SYSTEM or  SHARED_KEY
+AuthenticationAlgorithm=OPEN_SYSTEM
+#
+
+#
+#PREAMBLE_TYPE default LONGLONG or  SHORT
+PREAMBLE_TYPE=SHORT
+#
+
+#
+# PhyType default BG_MODE  B_MODE, G_MODE or BG_MODE
+PhyType=BG_MODE
+#
+
+#
+# CtsMode defalut FALSETURE or FALSE
+CtsMode=FALSE
+#
+
+#
+# PhyInformationTimer defalut 0  uint 100msec 
+PhyInformationTimer=0
+#
+
+#
+#ROM_FILE default "ks7010sd.rom"
+ROM_FILE="ks7010sd.rom"
+#
-- 
2.8.1

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


[PATCH V2 11/31] staging: ks7010: make loading config file optional

2016-05-31 Thread Wolfram Sang
From: Wolfram Sang <wsa+rene...@sang-engineering.com>

We have sane defaults, so we don't need to bail out if there is no
config file. Note that the config file should go away completely in
favour of configuration mechanisms already upstream.

Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com>
---
 drivers/staging/ks7010/ks7010_config.c | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_config.c 
b/drivers/staging/ks7010/ks7010_config.c
index 7f273dafaf3583..06ff8852e17f33 100644
--- a/drivers/staging/ks7010/ks7010_config.c
+++ b/drivers/staging/ks7010/ks7010_config.c
@@ -203,7 +203,6 @@ int ks_wlan_read_config_file(ks_wlan_private *priv)
 
const struct firmware *fw_entry;
struct device *dev = NULL;
-   int retval;
char cfg_file[]=CFG_FILE;
char *cur_p, *end_p;
char wk_buff[256], *wk_p;
@@ -254,10 +253,9 @@ int ks_wlan_read_config_file(ks_wlan_private *priv)
priv->reg.rate_set.size = 12;
 
dev = >ks_wlan_hw.sdio_card->func->dev;
-   if((retval = request_firmware(_entry, cfg_file, dev)) !=0 ){
-   DPRINTK(1, "error request_firmware() file=%s ret=%d\n", 
cfg_file, retval);
-   return 1;
-   }
+   /* If no cfg file, stay with the defaults */
+   if (request_firmware_direct(_entry, cfg_file, dev))
+   return 0;
 
DPRINTK(4, "success request_firmware() file=%s size=%d\n", cfg_file, 
fw_entry->size);
cur_p = fw_entry->data;
-- 
2.8.1

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


[PATCH V2 09/31] staging: ks7010: delete seperate debug header

2016-05-31 Thread Wolfram Sang
From: Wolfram Sang <wsa+rene...@sang-engineering.com>

Move the one debug macro to the generic wlan header.

Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com>
---
 drivers/staging/ks7010/ks7010_config.c |  1 -
 drivers/staging/ks7010/ks7010_sdio.c   |  1 -
 drivers/staging/ks7010/ks_debug.h  | 28 
 drivers/staging/ks7010/ks_hostif.c |  1 -
 drivers/staging/ks7010/ks_wlan.h   |  7 +++
 drivers/staging/ks7010/ks_wlan_net.c   |  1 -
 6 files changed, 7 insertions(+), 32 deletions(-)
 delete mode 100644 drivers/staging/ks7010/ks_debug.h

diff --git a/drivers/staging/ks7010/ks7010_config.c 
b/drivers/staging/ks7010/ks7010_config.c
index abe99a52ae1ad8..7f273dafaf3583 100644
--- a/drivers/staging/ks7010/ks7010_config.c
+++ b/drivers/staging/ks7010/ks7010_config.c
@@ -4,7 +4,6 @@
 #include "ks_wlan.h"
 #include "ks_hostif.h"
 #include "ks_wlan_ioctl.h"
-#include "ks_debug.h"
 
 static int wep_on_off;
 #defineWEP_OFF 0
diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
b/drivers/staging/ks7010/ks7010_sdio.c
index 1a1a43ff306aae..3fb432c9dd314d 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -19,7 +19,6 @@
 
 #include "ks_wlan.h"
 #include "ks_wlan_ioctl.h"
-#include "ks_debug.h"
 #include "ks_hostif.h"
 
 #include "ks7010_sdio.h"
diff --git a/drivers/staging/ks7010/ks_debug.h 
b/drivers/staging/ks7010/ks_debug.h
deleted file mode 100644
index adad5f927dfda9..00
--- a/drivers/staging/ks7010/ks_debug.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- *   Driver for KeyStream 11b/g wireless LAN cards.
- *   
- *   ks_debug.h
- *   $Id: ks_debug.h 991 2009-09-14 01:38:58Z sekine $
- *
- *   Copyright (C) 2005-2008 KeyStream Corp.
- *   Copyright (C) 2009 Renesas Technology Corp.
- *
- *   This program is free software; you can redistribute it and/or modify
- *   it undr the terms of the GNU General Public License version 2 as
- *   published by the Free Sotware Foundation.
- */
-
-#ifndef _KS_DEBUG_H
-#define _KS_DEBUG_H
-
-#include 
-
-
-#ifdef KS_WLAN_DEBUG
-#define DPRINTK(n, fmt, args...) \
- if (KS_WLAN_DEBUG>(n)) printk(KERN_NOTICE "%s: "fmt, 
__FUNCTION__, ## args)
-#else
-#define DPRINTK(n, fmt, args...)
-#endif
-
-#endif /* _KS_DEBUG_H */
diff --git a/drivers/staging/ks7010/ks_hostif.c 
b/drivers/staging/ks7010/ks_hostif.c
index 146a1357909b39..367d487cef1ba8 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -13,7 +13,6 @@
  */
 
 #include "ks_wlan.h"
-#include "ks_debug.h"
 #include "ks_hostif.h"
 #include "eap_packet.h"
 #include "michael_mic.h"
diff --git a/drivers/staging/ks7010/ks_wlan.h b/drivers/staging/ks7010/ks_wlan.h
index 6bd016414a4f1d..c460741c6606ee 100644
--- a/drivers/staging/ks7010/ks_wlan.h
+++ b/drivers/staging/ks7010/ks_wlan.h
@@ -38,6 +38,13 @@
 
 #include "ks7010_sdio.h"
 
+#ifdef KS_WLAN_DEBUG
+#define DPRINTK(n, fmt, args...) \
+ if (KS_WLAN_DEBUG>(n)) printk(KERN_NOTICE "%s: "fmt, 
__FUNCTION__, ## args)
+#else
+#define DPRINTK(n, fmt, args...)
+#endif
+
 struct ks_wlan_parameter {
uint8_t operation_mode;/* Operation Mode */
uint8_t channel;   /*  Channel */
diff --git a/drivers/staging/ks7010/ks_wlan_net.c 
b/drivers/staging/ks7010/ks_wlan_net.c
index 776a544031495f..1da2768ea9f31b 100644
--- a/drivers/staging/ks7010/ks_wlan_net.c
+++ b/drivers/staging/ks7010/ks_wlan_net.c
@@ -40,7 +40,6 @@ static int wep_on_off;
 #include "ks_wlan.h"
 #include "ks_hostif.h"
 #include "ks_wlan_ioctl.h"
-#include "ks_debug.h"
 
 /* Include Wireless Extension definition and check version */
 #include 
-- 
2.8.1

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


[PATCH V2 12/31] staging: ks7010: fix printk format warnings

2016-05-31 Thread Wolfram Sang
From: Wolfram Sang <wsa+rene...@sang-engineering.com>

Use proper type for size_t.

Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com>
---
 drivers/staging/ks7010/ks7010_config.c | 2 +-
 drivers/staging/ks7010/ks7010_sdio.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_config.c 
b/drivers/staging/ks7010/ks7010_config.c
index 06ff8852e17f33..4b00d25cd8f575 100644
--- a/drivers/staging/ks7010/ks7010_config.c
+++ b/drivers/staging/ks7010/ks7010_config.c
@@ -257,7 +257,7 @@ int ks_wlan_read_config_file(ks_wlan_private *priv)
if (request_firmware_direct(_entry, cfg_file, dev))
return 0;
 
-   DPRINTK(4, "success request_firmware() file=%s size=%d\n", cfg_file, 
fw_entry->size);
+   DPRINTK(4, "success request_firmware() file=%s size=%zu\n", cfg_file, 
fw_entry->size);
cur_p = fw_entry->data;
end_p = cur_p + fw_entry->size;
*end_p = '\0';
diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
b/drivers/staging/ks7010/ks7010_sdio.c
index 3fb432c9dd314d..50364909449aec 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -750,7 +750,7 @@ static int ks79xx_upload_firmware(ks_wlan_private *priv, 
struct ks_sdio_card *ca
DPRINTK(1,"error request_firmware() file=%s\n", 
priv->reg.rom_file);
return 1;
}
-   DPRINTK(4,"success request_firmware() file=%s size=%d\n", 
priv->reg.rom_file, fw_entry->size);
+   DPRINTK(4,"success request_firmware() file=%s size=%zu\n", 
priv->reg.rom_file, fw_entry->size);
length = fw_entry->size;
 
/* Load Program */
-- 
2.8.1

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


[PATCH V2 07/31] staging: ks7010: use long preamble as default

2016-05-31 Thread Wolfram Sang
From: Wolfram Sang <wsa+rene...@sang-engineering.com>

I had a problem connecting to a network with a short preamble, so let's
make the safer option the default.

Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com>
---
 drivers/staging/ks7010/ks7010_config.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_config.c 
b/drivers/staging/ks7010/ks7010_config.c
index 7d33070b3428e7..abe99a52ae1ad8 100644
--- a/drivers/staging/ks7010/ks7010_config.c
+++ b/drivers/staging/ks7010/ks7010_config.c
@@ -193,7 +193,7 @@ int ks_wlan_read_config_file(ks_wlan_private *priv)
{8,"WepIndex","1"}, /* 13 */
{7,"WepType","STRING"}, /* 14 */
{3,"Wep","OFF"},/* 15 */
-   {13,"PREAMBLE_TYPE","SHORT"},   /* 16 */
+   {13,"PREAMBLE_TYPE","LONG"},/* 16 */
{8,"ScanType","ACTIVE_SCAN"},   /* 17 */
{8,"ROM_FILE", ROM_FILE},   /* 18 */
{7,"PhyType", "BG_MODE"},   /* 19 */
@@ -216,7 +216,7 @@ int ks_wlan_read_config_file(ks_wlan_private *priv)
priv->reg.ssid.body[0] = '\0';  /* SSID */
priv->reg.ssid.size = 0;/* SSID size */
priv->reg.tx_rate = TX_RATE_AUTO;   /* TxRate Fully Auto */
-   priv->reg.preamble = SHORT_PREAMBLE;/* Preamble = SHORT */
+   priv->reg.preamble = LONG_PREAMBLE; /* Preamble = LONG */
priv->reg.powermgt = POWMGT_ACTIVE_MODE;/* POWMGT_ACTIVE_MODE */
priv->reg.scan_type = ACTIVE_SCAN;  /* Active */
priv->reg.beacon_lost_count = 20;   /* Beacon Lost Count */
-- 
2.8.1

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


[PATCH V2 06/31] staging: ks7010: avoid workqueue races

2016-05-31 Thread Wolfram Sang
From: Wolfram Sang <wsa+rene...@sang-engineering.com>

My Spectec SDW823 card oopsed when it was already inserted during boot.
When debugging this, I noticed that the card init was done in a seperate
workqueue which was only activated once in probe. After removing the
workqueue and calling the card init directly from probe, the OOPS went
away. It turned out this is the same OOPS which happened when removing
the card, so this seems possible now. Note: There is still a
not-understood card-removed event during boot, but at least it doesn't
crash anymore and the card will be re-probed right away.

Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com>
---
 drivers/staging/ks7010/TODO  |  1 -
 drivers/staging/ks7010/ks7010_sdio.c | 28 ++--
 drivers/staging/ks7010/ks7010_sdio.h |  2 --
 3 files changed, 2 insertions(+), 29 deletions(-)

diff --git a/drivers/staging/ks7010/TODO b/drivers/staging/ks7010/TODO
index 390e821efc0bcf..5cbb4ca999747e 100644
--- a/drivers/staging/ks7010/TODO
+++ b/drivers/staging/ks7010/TODO
@@ -28,7 +28,6 @@ Now the TODOs:
   should understand the change you submit.
 - drop using a config file and use an upstream technique for configuration
 - fix the 'card removal' event when card is inserted when booting
-- driver crashes when removing the card
 - check what other upstream wireless mechanisms can be used instead of the
   custom ones here
 
diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
b/drivers/staging/ks7010/ks7010_sdio.c
index 9300658c4aed8d..5b78522fad1ec1 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -817,14 +817,8 @@ static int ks79xx_upload_firmware(ks_wlan_private *priv, 
struct ks_sdio_card *ca
return rc;
 }
 
-static void card_init_task(struct work_struct *work)
+static void ks7010_card_init(struct ks_wlan_private *priv)
 {
-   struct hw_info_t *hw;
-   struct ks_wlan_private *priv;
-
-   hw = container_of(work, struct hw_info_t, init_task);
-   priv = container_of(hw, struct ks_wlan_private, ks_wlan_hw);
-
DPRINTK(5,"\ncard_init_task()\n");
 
/* init_waitqueue_head(>confirm_wait); */
@@ -1052,23 +1046,11 @@ static int ks7910_sdio_probe(struct sdio_func *func, 
const struct sdio_device_id
goto error_free_read_buf;
}
 
-   priv->ks_wlan_hw.ks7010sdio_init = 
create_singlethread_workqueue("ks7010sdio_init");
-   if(!priv->ks_wlan_hw.ks7010sdio_init){
-   DPRINTK(1, "create_workqueue failed !!\n");
-   goto error_free_sdio_wq;
-   }
-
-   INIT_WORK(>ks_wlan_hw.init_task, card_init_task);
INIT_DELAYED_WORK(>ks_wlan_hw.rw_wq, ks7010_rw_function);
-
-   queue_work(priv->ks_wlan_hw.ks7010sdio_init, 
>ks_wlan_hw.init_task);
+   ks7010_card_init(priv);
 
return 0;
 
-error_free_sdio_wq:
-   flush_workqueue(priv->ks_wlan_hw.ks7010sdio_wq);
-   destroy_workqueue(priv->ks_wlan_hw.ks7010sdio_wq);
-   priv->ks_wlan_hw.ks7010sdio_wq = NULL;
 error_free_read_buf:
kfree(priv->ks_wlan_hw.read_buf);
priv->ks_wlan_hw.read_buf = NULL;
@@ -1139,12 +1121,6 @@ static void ks7910_sdio_remove(struct sdio_func *func)
}
DPRINTK(1, 
"destroy_workqueue(priv->ks_wlan_hw.ks7010sdio_wq);\n");
 
-   if(priv->ks_wlan_hw.ks7010sdio_init){
-   flush_workqueue(priv->ks_wlan_hw.ks7010sdio_init);
-   destroy_workqueue(priv->ks_wlan_hw.ks7010sdio_init);
-   }
-   DPRINTK(1, 
"destroy_workqueue(priv->ks_wlan_hw.ks7010sdio_init);\n");
-
hostif_exit(priv);
DPRINTK(1, "hostif_exit\n");
 
diff --git a/drivers/staging/ks7010/ks7010_sdio.h 
b/drivers/staging/ks7010/ks7010_sdio.h
index 5bf01abbf2ab6c..93823837f19e65 100644
--- a/drivers/staging/ks7010/ks7010_sdio.h
+++ b/drivers/staging/ks7010/ks7010_sdio.h
@@ -96,8 +96,6 @@ struct hw_info_t {
struct ks_sdio_card *sdio_card; 
struct completion ks7010_sdio_wait;
struct workqueue_struct *ks7010sdio_wq;
-   struct workqueue_struct *ks7010sdio_init;
-   struct work_struct init_task;
struct delayed_work rw_wq;
unsigned char   *read_buf;
struct tasklet_struct rx_bh_task;
-- 
2.8.1

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


[PATCH V2 05/31] staging: ks7010: remove code for old kernel versions

2016-05-31 Thread Wolfram Sang
From: Wolfram Sang <wsa+rene...@sang-engineering.com>

No need to be backwards compatible.

Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com>
---
 drivers/staging/ks7010/ks_hostif.c   |  9 -
 drivers/staging/ks7010/ks_wlan.h | 28 +---
 drivers/staging/ks7010/ks_wlan_net.c |  3 ---
 3 files changed, 1 insertion(+), 39 deletions(-)

diff --git a/drivers/staging/ks7010/ks_hostif.c 
b/drivers/staging/ks7010/ks_hostif.c
index 6bea699655eec4..146a1357909b39 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -2103,11 +2103,7 @@ void hostif_sme_multicast_set(ks_wlan_private *priv)
 
 struct net_device *dev = priv->net_dev;
int mc_count;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)
struct netdev_hw_addr *ha;
-#else
-   struct dev_mc_list *mclist;
-#endif
charset_address[NIC_MAX_MCAST_LIST*ETH_ALEN];
unsigned long filter_type;
int i;
@@ -2131,14 +2127,9 @@ void hostif_sme_multicast_set(ks_wlan_private *priv)
else {
if (priv->sme_i.sme_flag & SME_MULTICAST){
mc_count = netdev_mc_count(dev);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)
netdev_for_each_mc_addr(ha, dev) {
memcpy(_address[i*ETH_ALEN], ha->addr, 
ETH_ALEN);
}
-#else
-   for (i = 0, mclist = dev->mc_list; mclist && i < 
mc_count; i++, mclist = mclist->next)
-   memcpy(_address[i*ETH_ALEN], 
mclist->dmi_addr, ETH_ALEN);
-#endif
priv->sme_i.sme_flag &= ~SME_MULTICAST;
hostif_mib_set_request(priv, LOCAL_MULTICAST_ADDRESS,
   (ETH_ALEN*mc_count), 
MIB_VALUE_TYPE_OSTRING, _address[0]);
diff --git a/drivers/staging/ks7010/ks_wlan.h b/drivers/staging/ks7010/ks_wlan.h
index 329a062419fe4a..6bd016414a4f1d 100644
--- a/drivers/staging/ks7010/ks_wlan.h
+++ b/drivers/staging/ks7010/ks_wlan.h
@@ -18,9 +18,6 @@
 #define WPS
 
 #include 
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)) 
-#include 
-#endif
 #include 
 #include 
 #include 
@@ -35,32 +32,9 @@
 #include/* struct timer_list */
 #include 
 #include/* struct completion */
-
-#include 
-
-/* Workqueue / task queue backwards compatibility stuff */
-#if ((LINUX_VERSION_CODE > KERNEL_VERSION(2,5,41)) || (defined _MVL31_) || 
(defined _CELF3_))
 #include 
-#else
-#include 
-#define work_struct tq_struct
-#define INIT_WORK INIT_TQUEUE
-#define schedule_work schedule_task
-#endif
 
-/* Interrupt handler backwards compatibility stuff */
-/*
-#ifndef IRQ_NONE
-#define IRQ_NONE
-#define IRQ_HANDLED
-typedef void irqreturn_t;
-#endif
-*/
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,23)
-#define free_netdev(x) kfree(x) 
-#define pci_name(x) x->slot_name 
-#endif
+#include 
 
 #include "ks7010_sdio.h"
 
diff --git a/drivers/staging/ks7010/ks_wlan_net.c 
b/drivers/staging/ks7010/ks_wlan_net.c
index 185630cb423d5e..776a544031495f 100644
--- a/drivers/staging/ks7010/ks_wlan_net.c
+++ b/drivers/staging/ks7010/ks_wlan_net.c
@@ -13,9 +13,6 @@
  */
 
 #include 
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
-#include 
-#endif
 #include 
 #include 
 #include 
-- 
2.8.1

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


[PATCH V2 03/31] staging: ks7010: remove custom firmware loader

2016-05-31 Thread Wolfram Sang
From: Wolfram Sang <wsa+rene...@sang-engineering.com>

FW_LOADER works fine, no need for a open coded fallback.

Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com>
---
 drivers/staging/ks7010/Kconfig |  1 +
 drivers/staging/ks7010/ks7010_config.c | 62 --
 drivers/staging/ks7010/ks7010_sdio.c   | 56 --
 drivers/staging/ks7010/ks7010_sdio.h   |  5 ---
 4 files changed, 1 insertion(+), 123 deletions(-)

diff --git a/drivers/staging/ks7010/Kconfig b/drivers/staging/ks7010/Kconfig
index dfd4eed539bebc..0b9217674d5b54 100644
--- a/drivers/staging/ks7010/Kconfig
+++ b/drivers/staging/ks7010/Kconfig
@@ -3,6 +3,7 @@ config KS7010
depends on MMC && WIRELESS
select WIRELESS_EXT
select WEXT_PRIV
+   select FW_LOADER
help
  This is a driver for KeyStream KS7010 based SDIO WIFI cards. It is
  found on at least later Spectec SDW-821 (FCC-ID "S2Y-WLAN-11G-K" only,
diff --git a/drivers/staging/ks7010/ks7010_config.c 
b/drivers/staging/ks7010/ks7010_config.c
index e8a42077a4b381..7d33070b3428e7 100644
--- a/drivers/staging/ks7010/ks7010_config.c
+++ b/drivers/staging/ks7010/ks7010_config.c
@@ -169,11 +169,7 @@ int rate_set_configuration(ks_wlan_private *priv, char 
*value)
return rc;
 }
 
-#ifndef NO_FIRMWARE_CLASS
 #include 
-#else
-#define MAX_CONFIG_FILE_SIZE (1024*10)
-#endif
 int ks_wlan_read_config_file(ks_wlan_private *priv)
 {
struct {
@@ -206,18 +202,9 @@ int ks_wlan_read_config_file(ks_wlan_private *priv)
{0,"",""},
};
 
-#ifndef NO_FIRMWARE_CLASS
const struct firmware *fw_entry;
struct device *dev = NULL;
int retval;
-#else
-   struct file *srcf;
-   int nr_read ;
-   int retval;
-   char *cfg_buf=NULL;
-   int orgfsuid, orgfsgid;
-   mm_segment_t orgfs;
-#endif
char cfg_file[]=CFG_FILE;
char *cur_p, *end_p;
char wk_buff[256], *wk_p;
@@ -267,7 +254,6 @@ int ks_wlan_read_config_file(ks_wlan_private *priv)
priv->reg.tx_rate = TX_RATE_FULL_AUTO;
priv->reg.rate_set.size = 12;
 
-#ifndef NO_FIRMWARE_CLASS
dev = >ks_wlan_hw.sdio_card->func->dev;
if((retval = request_firmware(_entry, cfg_file, dev)) !=0 ){
DPRINTK(1, "error request_firmware() file=%s ret=%d\n", 
cfg_file, retval);
@@ -277,46 +263,6 @@ int ks_wlan_read_config_file(ks_wlan_private *priv)
DPRINTK(4, "success request_firmware() file=%s size=%d\n", cfg_file, 
fw_entry->size);
cur_p = fw_entry->data;
end_p = cur_p + fw_entry->size;
-#else
-   orgfsuid=current->fsuid;
-   orgfsgid=current->fsgid;
-   orgfs=get_fs();
-   set_fs(KERNEL_DS);
-
-   srcf = filp_open(cfg_file, O_RDONLY, 0);
-   if (IS_ERR(srcf)) {
-   printk(KERN_ERR "error %ld opening %s\n", 
-PTR_ERR(srcf),cfg_file);
-   goto no_config_file;
-   }
-
-   if (!(srcf->f_op && srcf->f_op->read)) {
-   printk(KERN_ERR "%s does not have a read 
method\n", cfg_file);
-   goto no_config_file;
-   }
-
-   cfg_buf = (char *)kzalloc(MAX_CONFIG_FILE_SIZE, GFP_ATOMIC);
-   if (!cfg_buf) {
-   printk(KERN_ERR "%s does not read : out of 
memory \n", cfg_file);
-   goto no_config_file;
-   }
-
-   nr_read = srcf->f_op->read(srcf, (unsigned char *)cfg_buf, 
MAX_CONFIG_FILE_SIZE, >f_pos);
-
-   DPRINTK(1, "read retval=%d  file=%s\n", nr_read, priv->reg.cfg_file);
-   retval=filp_close(srcf ,NULL);
-   if (retval)
-   DPRINTK(1, "error %d closing %s\n", -retval,priv->reg.cfg_file);
-
-   if (nr_read < 1) {
-   printk(KERN_ERR "%s does not read : file is 
empty  num=%d\n", cfg_file, nr_read);
-   goto no_config_file;
-   }else if(nr_read > MAX_CONFIG_FILE_SIZE){
-   printk(KERN_ERR "%s does not read : file is too 
big \n", cfg_file);
-   goto no_config_file;
-   }
-   cur_p = cfg_buf;
-   end_p = cur_p + nr_read;
-#endif
*end_p = '\0';
 
while (cur_p < end_p) {
@@ -524,15 +470,7 @@ int ks_wlan_read_config_file(ks_wlan_private *priv)
}
 
}
-#ifndef NO_FIRMWARE_CLASS
release_firmware(fw_entry);
-#else
-no_config_file:
-   kfree(cfg_buf);
-   set_fs(orgfs);
-   current->fsuid=orgfsuid;
-   current->fsgid=orgfsgid;
-#endif
 
DPRINTK(3,"\noperation_mode = %d\nchannel = %d\nssid = %s\n 
   tx_rate = %d\n \
preamble = %d\npowermgt = %d\nscan_type = %d\nbeacon_los

[PATCH V2 02/31] staging: ks7010: remove non-SDIO code and #ifdefs

2016-05-31 Thread Wolfram Sang
From: Wolfram Sang <wsa+rene...@sang-engineering.com>

I couldn't find any trace of code or even products using ks7010 with
something else than SDIO. So, remove the conditionals.

Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com>
---
 drivers/staging/ks7010/Makefile|  2 +-
 drivers/staging/ks7010/ks7010_config.c |  6 ---
 drivers/staging/ks7010/ks_hostif.c | 70 --
 drivers/staging/ks7010/ks_wlan.h   | 10 -
 4 files changed, 1 insertion(+), 87 deletions(-)

diff --git a/drivers/staging/ks7010/Makefile b/drivers/staging/ks7010/Makefile
index 68b7ebf57bebd6..32b0efc7bd00e8 100644
--- a/drivers/staging/ks7010/Makefile
+++ b/drivers/staging/ks7010/Makefile
@@ -1,5 +1,5 @@
 obj-$(CONFIG_KS7010) += ks7010.o
 
-ccflags-y   += -D_SDIO_ -DKS_WLAN_DEBUG=0
+ccflags-y   += -DKS_WLAN_DEBUG=0
 ks7010-y:= michael_mic.o ks_hostif.o ks_wlan_net.o ks_debug.o \
ks7010_sdio.o ks7010_config.o
diff --git a/drivers/staging/ks7010/ks7010_config.c 
b/drivers/staging/ks7010/ks7010_config.c
index 4a8098452cdd28..e8a42077a4b381 100644
--- a/drivers/staging/ks7010/ks7010_config.c
+++ b/drivers/staging/ks7010/ks7010_config.c
@@ -268,13 +268,7 @@ int ks_wlan_read_config_file(ks_wlan_private *priv)
priv->reg.rate_set.size = 12;
 
 #ifndef NO_FIRMWARE_CLASS
-#if (defined _PCMCIA_)
-   dev = >ks_wlan_hw.pcmcia_dev->dev;
-#elif (defined _PCI_)
-   dev = >ks_wlan_hw.pci_dev->dev;
-#elif (defined _SDIO_)
dev = >ks_wlan_hw.sdio_card->func->dev;
-#endif
if((retval = request_firmware(_entry, cfg_file, dev)) !=0 ){
DPRINTK(1, "error request_firmware() file=%s ret=%d\n", 
cfg_file, retval);
return 1;
diff --git a/drivers/staging/ks7010/ks_hostif.c 
b/drivers/staging/ks7010/ks_hostif.c
index 402ddba400ffdd..0295bb4921fa20 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -108,51 +108,12 @@ int ks_wlan_do_power_save(ks_wlan_private *priv)
 
DPRINTK(4,"psstatus.status=%d\n",atomic_read(>psstatus.status));
 
-#ifdef _SDIO_
if((priv->connect_status & CONNECT_STATUS_MASK) == CONNECT_STATUS){
hostif_sme_enqueue(priv, SME_POW_MNGMT_REQUEST);
}
else{
priv->dev_state = DEVICE_STATE_READY;
}
-#else
-   if((priv->connect_status & CONNECT_STATUS_MASK) == CONNECT_STATUS){
-   switch(atomic_read(>psstatus.status)){
-   case PS_ACTIVE_SET:
-   case PS_WAKEUP:
-   case PS_SAVE_SET:
-   case PS_SNOOZE:
-   break;
-   case PS_CONF_WAIT:
-   atomic_set(>psstatus.confirm_wait,0);
-   break;
-   case PS_NONE:
-   default:
-   hostif_sme_enqueue(priv, SME_POW_MNGMT_REQUEST);
-   break;
-   }
-
-   }
-   else{
-   switch(atomic_read(>psstatus.status)){
-   case PS_ACTIVE_SET:
-   case PS_WAKEUP:
-   case PS_SAVE_SET:
-   break;
-   case PS_CONF_WAIT:
-   atomic_set(>psstatus.confirm_wait,0);
-   atomic_set(>psstatus.status, PS_WAKEUP);
-   break;
-   case PS_SNOOZE:
-   ks_wlan_hw_power_save(priv);
-   break;
-   case PS_NONE:
-   default:
-   hostif_sme_enqueue(priv, SME_POW_MNGMT_REQUEST);
-   break;
-   }
-   }
-#endif
return rc;
 }
 
@@ -750,17 +711,11 @@ void hostif_power_mngmt_confirm(ks_wlan_private *priv)
 
if(priv->reg.powermgt > POWMGT_ACTIVE_MODE &&
   priv->reg.operation_mode == MODE_INFRASTRUCTURE){
-#if !defined(_SDIO_)
-   atomic_set(>psstatus.status,PS_SAVE_SET);
-#endif
atomic_set(>psstatus.confirm_wait, 0);
priv->dev_state = DEVICE_STATE_SLEEP;
ks_wlan_hw_power_save(priv);
}else{
priv->dev_state = DEVICE_STATE_READY;
-#if !defined(_SDIO_)
-   atomic_set(>psstatus.status,PS_ACTIVE_SET);
-#endif
}
 
 }
@@ -833,9 +788,6 @@ void hostif_connect_indication(ks_wlan_private *priv)
/* for power save */
atomic_set(>psstatus.snooze_guard, 0);
atomic_set(>psstatus.confirm_wait,0);
-#if !defined(_SDIO_)
-   atomic_set(>psstatus.status, PS_NONE);
-#endif
}
ks_wlan_do_power_save(priv);
 
@@ -894,10 +846,8 @@ void hostif_stop_confirm(ks_wlan_private *priv)
union iwreq_data wrqu0;
 
DPRINTK(3,"\n");
-#ifdef _SDIO_

[PATCH V2 00/31] staging: add driver for KS7010 based SDIO WLAN cards

2016-05-31 Thread Wolfram Sang
This driver can be used with later Spectec SDW-821 and all SDW-823 cards. See
patch 1 and TODO for more details about its origin. The series can also be
found here:

git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git staging/ks7010

It worked out of the box with a Renesas Salvator-X (H3).

Note: I needed this driver to verify SDIO capabilities for the new Renesas H3
SoC. The fact that the original KS7010 driver also comes from Renesas is a
coincidence. It does not mean official support for this driver. Parts of this
work were backed by the above mentioned SDIO verification task while other
parts were my personal interest. Future patches and reviews will also done by
me as a private person (unless something very surprising happens ;))

Changes since V1:

* rebased to v4.7-rc1. That means the needed fix for the mmc-core
  (88ea46bcbfd677b779897bbada32ec0709a6c92f) and the netdev trans_start helper
  (ba162f8eed61a7e71e26455ce1cff5b5898a3579) are now both upstream.
* squashed the README->TODO rename into patch 1
* included the trans_start fixup which was sent seperately before
* last 3 patches are new, even more cleanups

Please comment, review, apply...

Thanks,

   Wolfram


Wolfram Sang (31):
  staging: ks7010: add driver from Nanonote extra-repository
  staging: ks7010: remove non-SDIO code and #ifdefs
  staging: ks7010: remove custom firmware loader
  staging: ks7010: remove checks for WIRELESS_EXT version
  staging: ks7010: remove code for old kernel versions
  staging: ks7010: avoid workqueue races
  staging: ks7010: use long preamble as default
  staging: ks7010: use kernel helper to print buffer
  staging: ks7010: delete seperate debug header
  staging: ks7010: really iterate over multicast addresses
  staging: ks7010: make loading config file optional
  staging: ks7010: fix printk format warnings
  staging: ks7010: add example cfg file as a reference
  staging: ks7010: remove unecessary typedef
  staging: ks7010: indent eap_packet.h
  staging: ks7010: indent ks7010_config.c
  staging: ks7010: indent ks7010_sdio.h
  staging: ks7010: indent ks_hostif.c
  staging: ks7010: indent ks_hostif.h
  staging: ks7010: indent ks_wlan.h
  staging: ks7010: indent ks_wlan_ioctl.h
  staging: ks7010: indent ks_wlan_net.c
  staging: ks7010: indent michael_mic.c
  staging: ks7010: indent michael_mic.h
  staging: ks7010: indent ks7010_sdio.c
  staging: ks7010: remove supported card table with one element
  staging: ks7010: fix module annotations
  staging: ks7010: adapt to new trans_start handling
  staging: ks7010: simplify module_init/exit
  staging: ks7010: drop counting sd errors
  staging: ks7010: cleanup file headers

 drivers/staging/Kconfig|2 +
 drivers/staging/Makefile   |1 +
 drivers/staging/ks7010/Kconfig |   10 +
 drivers/staging/ks7010/Makefile|5 +
 drivers/staging/ks7010/TODO|   37 +
 drivers/staging/ks7010/eap_packet.h|  129 ++
 drivers/staging/ks7010/ks7010_config.c |  500 +
 drivers/staging/ks7010/ks7010_sdio.c   | 1234 +++
 drivers/staging/ks7010/ks7010_sdio.h   |  148 ++
 drivers/staging/ks7010/ks79xx.cfg  |  116 ++
 drivers/staging/ks7010/ks_hostif.c | 2760 +
 drivers/staging/ks7010/ks_hostif.h |  644 ++
 drivers/staging/ks7010/ks_wlan.h   |  503 +
 drivers/staging/ks7010/ks_wlan_ioctl.h |   67 +
 drivers/staging/ks7010/ks_wlan_net.c   | 3544 
 drivers/staging/ks7010/michael_mic.c   |  139 ++
 drivers/staging/ks7010/michael_mic.h   |   26 +
 17 files changed, 9865 insertions(+)
 create mode 100644 drivers/staging/ks7010/Kconfig
 create mode 100644 drivers/staging/ks7010/Makefile
 create mode 100644 drivers/staging/ks7010/TODO
 create mode 100644 drivers/staging/ks7010/eap_packet.h
 create mode 100644 drivers/staging/ks7010/ks7010_config.c
 create mode 100644 drivers/staging/ks7010/ks7010_sdio.c
 create mode 100644 drivers/staging/ks7010/ks7010_sdio.h
 create mode 100644 drivers/staging/ks7010/ks79xx.cfg
 create mode 100644 drivers/staging/ks7010/ks_hostif.c
 create mode 100644 drivers/staging/ks7010/ks_hostif.h
 create mode 100644 drivers/staging/ks7010/ks_wlan.h
 create mode 100644 drivers/staging/ks7010/ks_wlan_ioctl.h
 create mode 100644 drivers/staging/ks7010/ks_wlan_net.c
 create mode 100644 drivers/staging/ks7010/michael_mic.c
 create mode 100644 drivers/staging/ks7010/michael_mic.h

-- 
2.8.1

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


Re: [PATCH 00/27] staging: add driver for KS7010 based SDIO cards

2016-05-20 Thread Wolfram Sang
Hi Greg,

> An add-on patch is probably easiest for everyone involved here.

Any chance for the new-driver-rule for this one?

Thanks,

   Wolfram



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


[PATCH 09/27] staging: ks7010: delete seperate debug header

2016-05-10 Thread Wolfram Sang
From: Wolfram Sang <wsa+rene...@sang-engineering.com>

Move the one debug macro to the generic wlan header.

Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com>
---
 drivers/staging/ks7010/ks7010_config.c |  1 -
 drivers/staging/ks7010/ks7010_sdio.c   |  1 -
 drivers/staging/ks7010/ks_debug.h  | 28 
 drivers/staging/ks7010/ks_hostif.c |  1 -
 drivers/staging/ks7010/ks_wlan.h   |  7 +++
 drivers/staging/ks7010/ks_wlan_net.c   |  1 -
 6 files changed, 7 insertions(+), 32 deletions(-)
 delete mode 100644 drivers/staging/ks7010/ks_debug.h

diff --git a/drivers/staging/ks7010/ks7010_config.c 
b/drivers/staging/ks7010/ks7010_config.c
index abe99a52ae1ad8..7f273dafaf3583 100644
--- a/drivers/staging/ks7010/ks7010_config.c
+++ b/drivers/staging/ks7010/ks7010_config.c
@@ -4,7 +4,6 @@
 #include "ks_wlan.h"
 #include "ks_hostif.h"
 #include "ks_wlan_ioctl.h"
-#include "ks_debug.h"
 
 static int wep_on_off;
 #defineWEP_OFF 0
diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
b/drivers/staging/ks7010/ks7010_sdio.c
index 1a1a43ff306aae..3fb432c9dd314d 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -19,7 +19,6 @@
 
 #include "ks_wlan.h"
 #include "ks_wlan_ioctl.h"
-#include "ks_debug.h"
 #include "ks_hostif.h"
 
 #include "ks7010_sdio.h"
diff --git a/drivers/staging/ks7010/ks_debug.h 
b/drivers/staging/ks7010/ks_debug.h
deleted file mode 100644
index adad5f927dfda9..00
--- a/drivers/staging/ks7010/ks_debug.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- *   Driver for KeyStream 11b/g wireless LAN cards.
- *   
- *   ks_debug.h
- *   $Id: ks_debug.h 991 2009-09-14 01:38:58Z sekine $
- *
- *   Copyright (C) 2005-2008 KeyStream Corp.
- *   Copyright (C) 2009 Renesas Technology Corp.
- *
- *   This program is free software; you can redistribute it and/or modify
- *   it undr the terms of the GNU General Public License version 2 as
- *   published by the Free Sotware Foundation.
- */
-
-#ifndef _KS_DEBUG_H
-#define _KS_DEBUG_H
-
-#include 
-
-
-#ifdef KS_WLAN_DEBUG
-#define DPRINTK(n, fmt, args...) \
- if (KS_WLAN_DEBUG>(n)) printk(KERN_NOTICE "%s: "fmt, 
__FUNCTION__, ## args)
-#else
-#define DPRINTK(n, fmt, args...)
-#endif
-
-#endif /* _KS_DEBUG_H */
diff --git a/drivers/staging/ks7010/ks_hostif.c 
b/drivers/staging/ks7010/ks_hostif.c
index 146a1357909b39..367d487cef1ba8 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -13,7 +13,6 @@
  */
 
 #include "ks_wlan.h"
-#include "ks_debug.h"
 #include "ks_hostif.h"
 #include "eap_packet.h"
 #include "michael_mic.h"
diff --git a/drivers/staging/ks7010/ks_wlan.h b/drivers/staging/ks7010/ks_wlan.h
index 6bd016414a4f1d..c460741c6606ee 100644
--- a/drivers/staging/ks7010/ks_wlan.h
+++ b/drivers/staging/ks7010/ks_wlan.h
@@ -38,6 +38,13 @@
 
 #include "ks7010_sdio.h"
 
+#ifdef KS_WLAN_DEBUG
+#define DPRINTK(n, fmt, args...) \
+ if (KS_WLAN_DEBUG>(n)) printk(KERN_NOTICE "%s: "fmt, 
__FUNCTION__, ## args)
+#else
+#define DPRINTK(n, fmt, args...)
+#endif
+
 struct ks_wlan_parameter {
uint8_t operation_mode;/* Operation Mode */
uint8_t channel;   /*  Channel */
diff --git a/drivers/staging/ks7010/ks_wlan_net.c 
b/drivers/staging/ks7010/ks_wlan_net.c
index 776a544031495f..1da2768ea9f31b 100644
--- a/drivers/staging/ks7010/ks_wlan_net.c
+++ b/drivers/staging/ks7010/ks_wlan_net.c
@@ -40,7 +40,6 @@ static int wep_on_off;
 #include "ks_wlan.h"
 #include "ks_hostif.h"
 #include "ks_wlan_ioctl.h"
-#include "ks_debug.h"
 
 /* Include Wireless Extension definition and check version */
 #include 
-- 
2.8.1

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


  1   2   >