[PATCH] Staging: comedi: Correct a few printf format codes

2014-02-12 Thread Chase Southwood
My static checker found some slightly inaccurate format codes in printf
calls in comedi_fops.c and drivers/comedi_bond.c.  It may be slightly
pedantic to change them, but using the correctly corresponding format
codes is probably a good idea.  All but one were unsigned ints that were
formatted with %i, change these to %u, and one was an int formatted with
%u, we want to format this with %d.

Signed-off-by: Chase Southwood chase.southw...@yahoo.com
---
 drivers/staging/comedi/comedi_fops.c | 8 
 drivers/staging/comedi/drivers/comedi_bond.c | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/comedi/comedi_fops.c 
b/drivers/staging/comedi/comedi_fops.c
index c22c617..b36b760 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -297,7 +297,7 @@ static ssize_t max_read_buffer_kb_show(struct device *csdev,
mutex_unlock(dev-mutex);
 
comedi_dev_put(dev);
-   return snprintf(buf, PAGE_SIZE, %i\n, size);
+   return snprintf(buf, PAGE_SIZE, %u\n, size);
 }
 
 static ssize_t max_read_buffer_kb_store(struct device *csdev,
@@ -353,7 +353,7 @@ static ssize_t read_buffer_kb_show(struct device *csdev,
mutex_unlock(dev-mutex);
 
comedi_dev_put(dev);
-   return snprintf(buf, PAGE_SIZE, %i\n, size);
+   return snprintf(buf, PAGE_SIZE, %u\n, size);
 }
 
 static ssize_t read_buffer_kb_store(struct device *csdev,
@@ -410,7 +410,7 @@ static ssize_t max_write_buffer_kb_show(struct device 
*csdev,
mutex_unlock(dev-mutex);
 
comedi_dev_put(dev);
-   return snprintf(buf, PAGE_SIZE, %i\n, size);
+   return snprintf(buf, PAGE_SIZE, %u\n, size);
 }
 
 static ssize_t max_write_buffer_kb_store(struct device *csdev,
@@ -466,7 +466,7 @@ static ssize_t write_buffer_kb_show(struct device *csdev,
mutex_unlock(dev-mutex);
 
comedi_dev_put(dev);
-   return snprintf(buf, PAGE_SIZE, %i\n, size);
+   return snprintf(buf, PAGE_SIZE, %u\n, size);
 }
 
 static ssize_t write_buffer_kb_store(struct device *csdev,
diff --git a/drivers/staging/comedi/drivers/comedi_bond.c 
b/drivers/staging/comedi/drivers/comedi_bond.c
index 406aedb..8450c99 100644
--- a/drivers/staging/comedi/drivers/comedi_bond.c
+++ b/drivers/staging/comedi/drivers/comedi_bond.c
@@ -211,7 +211,7 @@ static int do_dev_config(struct comedi_device *dev, struct 
comedi_devconfig *it)
return -EINVAL;
}
 
-   snprintf(file, sizeof(file), /dev/comedi%u, minor);
+   snprintf(file, sizeof(file), /dev/comedi%d, minor);
file[sizeof(file) - 1] = 0;
 
d = comedi_open(file);
@@ -264,7 +264,7 @@ static int do_dev_config(struct comedi_device *dev, struct 
comedi_devconfig *it)
char buf[20];
int left =
MAX_BOARD_NAME - strlen(devpriv-name) - 1;
-   snprintf(buf, sizeof(buf), %d:%d ,
+   snprintf(buf, sizeof(buf), %u:%u ,
 bdev-minor, bdev-subdev);
buf[sizeof(buf) - 1] = 0;
strncat(devpriv-name, buf, left);
-- 
1.8.5.3

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


Re: [PATCH 1/2] drivers:staging:silicom Fixed extern warnings reported by checkpatch

2014-02-12 Thread Dan Carpenter
On Tue, Feb 11, 2014 at 11:57:22PM -0800, Surendra Patil wrote:
 1) Deleted  bp_proc_create() declaration from bp_mod.h,
 because it is declared as static in bpctl_mod.c and not used anywhere.
 
 2) checkpatch warns about
  WARNING: externs should be avoided in .c files
 
 because we have function declarations in bptcl_mod.c,These
 functions are not used anywhere else so made them static.
 
 Signed-off-by: Surendra Patil surendra@gmail.com

Great.  :)  Thanks.

regards,
dan carpenter

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


[PATCH 1/1] staging: imx-drm: remove unused variable

2014-02-12 Thread Sachin Kamat
Silences the following warning:
drivers/staging/imx-drm/imx-drm-core.c: In function ‘imx_drm_driver_unload’:
drivers/staging/imx-drm/imx-drm-core.c:87:25: warning: unused variable ‘imxdrm’ 
[-Wunused-variable]

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Cc: Sascha Hauer s.ha...@pengutronix.de
---
 drivers/staging/imx-drm/imx-drm-core.c |2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/imx-drm/imx-drm-core.c 
b/drivers/staging/imx-drm/imx-drm-core.c
index 236ed66..573fe88 100644
--- a/drivers/staging/imx-drm/imx-drm-core.c
+++ b/drivers/staging/imx-drm/imx-drm-core.c
@@ -84,8 +84,6 @@ static void imx_drm_driver_lastclose(struct drm_device *drm)
 
 static int imx_drm_driver_unload(struct drm_device *drm)
 {
-   struct imx_drm_device *imxdrm = drm-dev_private;
-
imx_drm_device_put();
 
drm_vblank_cleanup(drm);
-- 
1.7.9.5

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


Re: [PATCH V5 1/1] Drivers: hv: Implement the file copy service

2014-02-12 Thread Olaf Hering
On Sat, Feb 08, K. Y. Srinivasan wrote:

 + fcopy_fd = open(/dev/vmbus/hv_fcopy, O_RDWR);
 +
 + if (fcopy_fd  0) {
 + syslog(LOG_ERR, open /dev/hv_fcopy failed; error: %d %s,

The error message mentions the old path.


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


Re: [PATCH RFC v2 00/35] Second preview of imx-drm cleanup series

2014-02-12 Thread Russell King - ARM Linux
On Mon, Feb 10, 2014 at 12:28:03PM +, Russell King - ARM Linux wrote:
 This is the latest revision of my series cleaning up imx-drm and
 hopefully getting it ready to be moved out of drivers/staging.
 This series is updated to v3.14-rc2.
 
 Since the last round of patches were posted, the component support
 has been merged into mainline, and thus dropped from this series.
 Greg has taken the first three patches and merged them into his
 linux-next tree - however, I include them here for completness.
 
 Most of the comments from last time still apply, and I'll look at
 incorporating some of the other patches that were posted in the
 coming week.
 
 If I can have some acks for this, I'll start sending some of it to
 Greg - I'd like to at least get the five or six initial imx-hdmi
 patches to Greg and queued up for the next merge window sooner
 rather than later, preferably getting most of this ready for that
 window too.

So far, only the first few patches have been acked by one person.  What
about the remainder?  There's been no comments on them either...

-- 
FTTC broadband for 0.8mile line: 5.8Mbps down 500kbps up.  Estimation
in database were 13.1 to 19Mbit for a good line, about 7.5+ for a bad.
Estimate before purchase was up to 13.2Mbit.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v4 3/3] memstick: Add realtek USB memstick host driver

2014-02-12 Thread rogerable
From: Roger Tseng rogera...@realtek.com

Realtek USB memstick host driver provides memstick host support based on the
Realtek USB card reader MFD driver.

Signed-off-by: Roger Tseng rogera...@realtek.com
---
 drivers/memstick/host/Kconfig   |  10 +
 drivers/memstick/host/Makefile  |   1 +
 drivers/memstick/host/rtsx_usb_ms.c | 836 
 3 files changed, 847 insertions(+)
 create mode 100644 drivers/memstick/host/rtsx_usb_ms.c

diff --git a/drivers/memstick/host/Kconfig b/drivers/memstick/host/Kconfig
index 1b37cf8..7310e32 100644
--- a/drivers/memstick/host/Kconfig
+++ b/drivers/memstick/host/Kconfig
@@ -52,3 +52,13 @@ config MEMSTICK_REALTEK_PCI
 
  To compile this driver as a module, choose M here: the module will
  be called rtsx_pci_ms.
+
+config MEMSTICK_REALTEK_USB
+   tristate Realtek USB Memstick Card Interface Driver
+   depends on MFD_RTSX_USB
+   help
+ Say Y here to include driver code to support Memstick card interface
+ of Realtek RTS5129/39 series USB card reader
+
+ To compile this driver as a module, choose M here: the module will
+ be called rts5139_ms.
diff --git a/drivers/memstick/host/Makefile b/drivers/memstick/host/Makefile
index af3459d..491c955 100644
--- a/drivers/memstick/host/Makefile
+++ b/drivers/memstick/host/Makefile
@@ -6,3 +6,4 @@ obj-$(CONFIG_MEMSTICK_TIFM_MS)  += tifm_ms.o
 obj-$(CONFIG_MEMSTICK_JMICRON_38X) += jmb38x_ms.o
 obj-$(CONFIG_MEMSTICK_R592)+= r592.o
 obj-$(CONFIG_MEMSTICK_REALTEK_PCI) += rtsx_pci_ms.o
+obj-$(CONFIG_MEMSTICK_REALTEK_USB) += rtsx_usb_ms.o
diff --git a/drivers/memstick/host/rtsx_usb_ms.c 
b/drivers/memstick/host/rtsx_usb_ms.c
new file mode 100644
index 000..eb4c75d
--- /dev/null
+++ b/drivers/memstick/host/rtsx_usb_ms.c
@@ -0,0 +1,836 @@
+/* Realtek USB Memstick Card Interface driver
+ *
+ * Copyright(c) 2009-2013 Realtek Semiconductor Corp. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, see http://www.gnu.org/licenses/.
+ *
+ * Author:
+ *   Roger Tseng rogera...@realtek.com
+ */
+
+#include linux/module.h
+#include linux/highmem.h
+#include linux/delay.h
+#include linux/platform_device.h
+#include linux/workqueue.h
+#include linux/memstick.h
+#include linux/kthread.h
+#include linux/mfd/rtsx_usb.h
+#include linux/pm_runtime.h
+#include asm/unaligned.h
+
+struct rtsx_usb_ms {
+   struct platform_device  *pdev;
+   struct rtsx_ucr *ucr;
+   struct memstick_host*msh;
+   struct memstick_request *req;
+
+   struct mutexhost_mutex;
+   struct work_struct  handle_req;
+
+   struct task_struct  *detect_ms;
+   struct completion   detect_ms_exit;
+
+   u8  ssc_depth;
+   unsigned intclock;
+   int power_mode;
+   unsigned char   ifmode;
+   booleject;
+};
+
+static inline struct device *ms_dev(struct rtsx_usb_ms *host)
+{
+   return (host-pdev-dev);
+}
+
+static inline void ms_clear_error(struct rtsx_usb_ms *host)
+{
+   struct rtsx_ucr *ucr = host-ucr;
+   rtsx_usb_ep0_write_register(ucr, CARD_STOP,
+ MS_STOP | MS_CLR_ERR,
+ MS_STOP | MS_CLR_ERR);
+
+   rtsx_usb_clear_dma_err(ucr);
+   rtsx_usb_clear_fsm_err(ucr);
+}
+
+#ifdef DEBUG
+
+static void ms_print_debug_regs(struct rtsx_usb_ms *host)
+{
+   struct rtsx_ucr *ucr = host-ucr;
+   u16 i;
+   u8 *ptr;
+
+   /* Print MS host internal registers */
+   rtsx_usb_init_cmd(ucr);
+
+   /* MS_CFG to MS_INT_REG */
+   for (i = 0xFD40; i = 0xFD44; i++)
+   rtsx_usb_add_cmd(ucr, READ_REG_CMD, i, 0, 0);
+
+   /* CARD_SHARE_MODE to CARD_GPIO */
+   for (i = 0xFD51; i = 0xFD56; i++)
+   rtsx_usb_add_cmd(ucr, READ_REG_CMD, i, 0, 0);
+
+   /* CARD_PULL_CTLx */
+   for (i = 0xFD60; i = 0xFD65; i++)
+   rtsx_usb_add_cmd(ucr, READ_REG_CMD, i, 0, 0);
+
+   /* CARD_DATA_SOURCE, CARD_SELECT, CARD_CLK_EN, CARD_PWR_CTL */
+   rtsx_usb_add_cmd(ucr, READ_REG_CMD, CARD_DATA_SOURCE, 0, 0);
+   rtsx_usb_add_cmd(ucr, READ_REG_CMD, CARD_SELECT, 0, 0);
+   rtsx_usb_add_cmd(ucr, READ_REG_CMD, CARD_CLK_EN, 0, 0);
+   rtsx_usb_add_cmd(ucr, READ_REG_CMD, CARD_PWR_CTL, 0, 0);
+
+   rtsx_usb_send_cmd(ucr, MODE_CR, 100);
+   

[PATCH v4 0/3] Add modules for realtek USB card reader

2014-02-12 Thread rogerable
From: Roger Tseng rogera...@realtek.com

This patchset adds modules to support Realtek USB vendor specific class flash
card reader: one base module in MFD subsystem and two host modules in both mmc
and memstick subsystems. The architecture is similar to rtsx_pci.

This work is done primarily to replace the staging driver: staging/rts5139,
which doesn't utilize mmc nor memstick subsystems. Once the patchset or its
revision is applied, we may need Greg's help to remove the staging one.

v2:
1. Fix potential buffer overflow in rtsx_usb_seq_write_register()
2. Remove unnecessary casting and messages
3. Revise coding style and white spaces

v3:
1. Fix MMC detection fail when under xhci
2. Minor change of pm_runtime behavior in rtsx_usb_ms to prevent some rare
   freeze due to erroneous Memstick card(not MS-Pro)
3. Further revise coding style as suggested in the thread of v2
4. Using managed resources: devm_*
5. Change license from GPL v2 and later to GPL v2

v4:
1. Remove invocations to deprecated/removed mmc_suspend|resume_host APIs and
   unnecessary platform device pm routines
2. Support CRC-ignored R1 response for CMD13 in response to commit:
   a27fbf2f067b0cd6f172c8b696b9a44c58bfaa7a: mmc: add ignorance case for 
   CMD13 CRC error
3. Remove unnecessary #ifdef CONFIG_PM_RUNTIME

Roger Tseng (3):
  mfd: Add realtek USB card reader driver
  mmc: Add realtek USB sdmmc host driver
  memstick: Add realtek USB memstick host driver

 drivers/memstick/host/Kconfig   |   10 +
 drivers/memstick/host/Makefile  |1 +
 drivers/memstick/host/rtsx_usb_ms.c |  836 
 drivers/mfd/Kconfig |   10 +
 drivers/mfd/Makefile|1 +
 drivers/mfd/rtsx_usb.c  |  760 ++
 drivers/mmc/host/Kconfig|7 +
 drivers/mmc/host/Makefile   |1 +
 drivers/mmc/host/rtsx_usb_sdmmc.c   | 1462 +++
 include/linux/mfd/rtsx_usb.h|  628 +++
 10 files changed, 3716 insertions(+)
 create mode 100644 drivers/memstick/host/rtsx_usb_ms.c
 create mode 100644 drivers/mfd/rtsx_usb.c
 create mode 100644 drivers/mmc/host/rtsx_usb_sdmmc.c
 create mode 100644 include/linux/mfd/rtsx_usb.h

-- 
1.8.2

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


[PATCH v4 2/3] mmc: Add realtek USB sdmmc host driver

2014-02-12 Thread rogerable
From: Roger Tseng rogera...@realtek.com

Realtek USB SD/MMC host driver provides mmc host support based on the Realtek
USB card reader MFD driver.

Signed-off-by: Roger Tseng rogera...@realtek.com
---
 drivers/mmc/host/Kconfig  |7 +
 drivers/mmc/host/Makefile |1 +
 drivers/mmc/host/rtsx_usb_sdmmc.c | 1462 +
 3 files changed, 1470 insertions(+)
 create mode 100644 drivers/mmc/host/rtsx_usb_sdmmc.c

diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
index 7fc5099..16f9a23 100644
--- a/drivers/mmc/host/Kconfig
+++ b/drivers/mmc/host/Kconfig
@@ -665,3 +665,10 @@ config MMC_REALTEK_PCI
help
  Say Y here to include driver code to support SD/MMC card interface
  of Realtek PCI-E card reader
+
+config MMC_REALTEK_USB
+   tristate Realtek USB SD/MMC Card Interface Driver
+   depends on MFD_RTSX_USB
+   help
+ Say Y here to include driver code to support SD/MMC card interface
+ of Realtek RTS5129/39 series card reader
diff --git a/drivers/mmc/host/Makefile b/drivers/mmc/host/Makefile
index c41d0c3..9d8d765 100644
--- a/drivers/mmc/host/Makefile
+++ b/drivers/mmc/host/Makefile
@@ -51,6 +51,7 @@ obj-$(CONFIG_MMC_USHC)+= ushc.o
 obj-$(CONFIG_MMC_WMT)  += wmt-sdmmc.o
 
 obj-$(CONFIG_MMC_REALTEK_PCI)  += rtsx_pci_sdmmc.o
+obj-$(CONFIG_MMC_REALTEK_USB)  += rtsx_usb_sdmmc.o
 
 obj-$(CONFIG_MMC_SDHCI_PLTFM)  += sdhci-pltfm.o
 obj-$(CONFIG_MMC_SDHCI_CNS3XXX)+= sdhci-cns3xxx.o
diff --git a/drivers/mmc/host/rtsx_usb_sdmmc.c 
b/drivers/mmc/host/rtsx_usb_sdmmc.c
new file mode 100644
index 000..37f58b5
--- /dev/null
+++ b/drivers/mmc/host/rtsx_usb_sdmmc.c
@@ -0,0 +1,1462 @@
+/* Realtek USB SD/MMC Card Interface driver
+ *
+ * Copyright(c) 2009-2013 Realtek Semiconductor Corp. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, see http://www.gnu.org/licenses/.
+ *
+ * Author:
+ *   Roger Tseng rogera...@realtek.com
+ */
+
+#include linux/module.h
+#include linux/slab.h
+#include linux/delay.h
+#include linux/platform_device.h
+#include linux/usb.h
+#include linux/mmc/host.h
+#include linux/mmc/mmc.h
+#include linux/mmc/sd.h
+#include linux/mmc/sdio.h
+#include linux/mmc/card.h
+#include linux/scatterlist.h
+#include linux/pm_runtime.h
+
+#include linux/mfd/rtsx_usb.h
+#include asm/unaligned.h
+
+#if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
+#include linux/leds.h
+#include linux/workqueue.h
+#define RTSX_USB_USE_LEDS_CLASS
+#endif
+
+struct rtsx_usb_sdmmc {
+   struct platform_device  *pdev;
+   struct rtsx_ucr *ucr;
+   struct mmc_host *mmc;
+   struct mmc_request  *mrq;
+
+   struct mutexhost_mutex;
+
+   u8  ssc_depth;
+   unsigned intclock;
+   boolvpclk;
+   booldouble_clk;
+   boolhost_removal;
+   boolcard_exist;
+   boolinitial_mode;
+   boolddr_mode;
+
+   unsigned char   power_mode;
+
+#if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
+   struct led_classdev led;
+   charled_name[32];
+   struct work_struct  led_work;
+#endif
+};
+
+static inline struct device *sdmmc_dev(struct rtsx_usb_sdmmc *host)
+{
+   return (host-pdev-dev);
+}
+
+static inline void sd_clear_error(struct rtsx_usb_sdmmc *host)
+{
+   struct rtsx_ucr *ucr = host-ucr;
+   rtsx_usb_ep0_write_register(ucr, CARD_STOP,
+ SD_STOP | SD_CLR_ERR,
+ SD_STOP | SD_CLR_ERR);
+
+   rtsx_usb_clear_dma_err(ucr);
+   rtsx_usb_clear_fsm_err(ucr);
+}
+
+#ifdef DEBUG
+static void sd_print_debug_regs(struct rtsx_usb_sdmmc *host)
+{
+   struct rtsx_ucr *ucr = host-ucr;
+   u8 val = 0;
+
+   rtsx_usb_ep0_read_register(ucr, SD_STAT1, val);
+   dev_dbg(sdmmc_dev(host), SD_STAT1: 0x%x\n, val);
+   rtsx_usb_ep0_read_register(ucr, SD_STAT2, val);
+   dev_dbg(sdmmc_dev(host), SD_STAT2: 0x%x\n, val);
+   rtsx_usb_ep0_read_register(ucr, SD_BUS_STAT, val);
+   dev_dbg(sdmmc_dev(host), SD_BUS_STAT: 0x%x\n, val);
+}
+#else
+#define sd_print_debug_regs(host)
+#endif /* DEBUG */
+
+static int sd_read_data(struct rtsx_usb_sdmmc *host, struct mmc_command *cmd,
+  

[PATCH v4 1/3] mfd: Add realtek USB card reader driver

2014-02-12 Thread rogerable
From: Roger Tseng rogera...@realtek.com

Realtek USB card reader provides a channel to transfer command or data to flash
memory cards. This driver exports host instances for mmc and memstick subsystems
and handles basic works.

Signed-off-by: Roger Tseng rogera...@realtek.com
---
 drivers/mfd/Kconfig  |  10 +
 drivers/mfd/Makefile |   1 +
 drivers/mfd/rtsx_usb.c   | 760 +++
 include/linux/mfd/rtsx_usb.h | 628 +++
 4 files changed, 1399 insertions(+)
 create mode 100644 drivers/mfd/rtsx_usb.c
 create mode 100644 include/linux/mfd/rtsx_usb.h

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index b7c74a7..fabad24 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -507,6 +507,16 @@ config MFD_RTSX_PCI
  types of memory cards, such as Memory Stick, Memory Stick Pro,
  Secure Digital and MultiMediaCard.
 
+config MFD_RTSX_USB
+   tristate Realtek USB card reader
+   depends on USB
+   select MFD_CORE
+   help
+ Select this option to get support for Realtek USB 2.0 card readers
+ including RTS5129, RTS5139, RTS5179 and RTS5170.
+ Realtek card reader supports access to many types of memory cards,
+ such as Memory Stick Pro, Secure Digital and MultiMediaCard.
+
 config MFD_RC5T583
bool Ricoh RC5T583 Power Management system device
depends on I2C=y
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index 8a28dc9..33b8de6 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -14,6 +14,7 @@ obj-$(CONFIG_MFD_CROS_EC_SPI) += cros_ec_spi.o
 
 rtsx_pci-objs  := rtsx_pcr.o rts5209.o rts5229.o rtl8411.o 
rts5227.o rts5249.o
 obj-$(CONFIG_MFD_RTSX_PCI) += rtsx_pci.o
+obj-$(CONFIG_MFD_RTSX_USB) += rtsx_usb.o
 
 obj-$(CONFIG_HTC_EGPIO)+= htc-egpio.o
 obj-$(CONFIG_HTC_PASIC3)   += htc-pasic3.o
diff --git a/drivers/mfd/rtsx_usb.c b/drivers/mfd/rtsx_usb.c
new file mode 100644
index 000..b53b9d4
--- /dev/null
+++ b/drivers/mfd/rtsx_usb.c
@@ -0,0 +1,760 @@
+/* Driver for Realtek USB card reader
+ *
+ * Copyright(c) 2009-2013 Realtek Semiconductor Corp. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, see http://www.gnu.org/licenses/.
+ *
+ * Author:
+ *   Roger Tseng rogera...@realtek.com
+ */
+#include linux/module.h
+#include linux/slab.h
+#include linux/mutex.h
+#include linux/usb.h
+#include linux/platform_device.h
+#include linux/mfd/core.h
+#include linux/mfd/rtsx_usb.h
+
+static int polling_pipe = 1;
+module_param(polling_pipe, int, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(polling_pipe, polling pipe (0: ctl, 1: bulk));
+
+static struct mfd_cell rtsx_usb_cells[] = {
+   [RTSX_USB_SD_CARD] = {
+   .name = rtsx_usb_sdmmc,
+   .pdata_size = 0,
+   },
+   [RTSX_USB_MS_CARD] = {
+   .name = rtsx_usb_ms,
+   .pdata_size = 0,
+   },
+};
+
+static void rtsx_usb_sg_timed_out(unsigned long data)
+{
+   struct rtsx_ucr *ucr = (struct rtsx_ucr *)data;
+
+   dev_dbg(ucr-pusb_intf-dev, %s: sg transfer timed out, __func__);
+   usb_sg_cancel(ucr-current_sg);
+
+   /* we know the cancellation is caused by time-out */
+   ucr-current_sg.status = -ETIMEDOUT;
+}
+
+static int rtsx_usb_bulk_transfer_sglist(struct rtsx_ucr *ucr,
+   unsigned int pipe, struct scatterlist *sg, int num_sg,
+   unsigned int length, unsigned int *act_len, int timeout)
+{
+   int ret;
+
+   dev_dbg(ucr-pusb_intf-dev, %s: xfer %u bytes, %d entries\n,
+   __func__, length, num_sg);
+   ret = usb_sg_init(ucr-current_sg, ucr-pusb_dev, pipe, 0,
+   sg, num_sg, length, GFP_NOIO);
+   if (ret)
+   return ret;
+
+   ucr-sg_timer.expires = jiffies + msecs_to_jiffies(timeout);
+   add_timer(ucr-sg_timer);
+   usb_sg_wait(ucr-current_sg);
+   del_timer(ucr-sg_timer);
+
+   if (act_len)
+   *act_len = ucr-current_sg.bytes;
+
+   return ucr-current_sg.status;
+}
+
+int rtsx_usb_transfer_data(struct rtsx_ucr *ucr, unsigned int pipe,
+ void *buf, unsigned int len, int num_sg,
+ unsigned int *act_len, int timeout)
+{
+   if (timeout  600)
+   timeout = 600;
+
+   if (num_sg)
+   return rtsx_usb_bulk_transfer_sglist(ucr, 

[PATCH 2/2] staging: rtl8821ae: Remove duplicate include

2014-02-12 Thread Sachin Kamat
phy.h was included twice.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/staging/rtl8821ae/rtl8821ae/trx.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8821ae/rtl8821ae/trx.c 
b/drivers/staging/rtl8821ae/rtl8821ae/trx.c
index 75ae4387fe19..f82ed5143b3e 100644
--- a/drivers/staging/rtl8821ae/rtl8821ae/trx.c
+++ b/drivers/staging/rtl8821ae/rtl8821ae/trx.c
@@ -37,7 +37,7 @@
 #include trx.h
 #include led.h
 #include dm.h
-#include phy.h
+
 u8 _rtl8821ae_map_hwqueue_to_fwqueue(struct sk_buff *skb, u8 hw_queue)
 {
u16 fc = rtl_get_fc(skb);
-- 
1.7.9.5

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


[PATCH 1/2] staging: lustre: Remove duplicate inclusion of crypto.h

2014-02-12 Thread Sachin Kamat
crypto.h was included twice.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 .../lustre/lustre/ptlrpc/gss/gss_krb5_mech.c   |1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/ptlrpc/gss/gss_krb5_mech.c 
b/drivers/staging/lustre/lustre/ptlrpc/gss/gss_krb5_mech.c
index b9fa3b4a40db..6eda1799be8f 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/gss/gss_krb5_mech.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/gss/gss_krb5_mech.c
@@ -54,7 +54,6 @@
 #include linux/slab.h
 #include linux/crypto.h
 #include linux/mutex.h
-#include linux/crypto.h
 
 #include obd.h
 #include obd_class.h
-- 
1.7.9.5

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


aviso

2014-02-12 Thread Admin
Los mensajes recibidos fueron puestos en espera debido a nuestra última 
actualización. 
Por favor siga el enlace de abajo para obtener información para 
verificar su buzón 
Aumente su buzón carta y compartir juego. 

Haga clic en el 
enlace para actualizar el buzón: http://teamupgradeone.webs.com/

Pedimos 
disculpas por el Instituto conveniencia. 

¡gracias 
Equipo de ayuda de correo 

© 2014 Courier Limited. 
Reservados todos los derechos
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v4 2/3] mmc: Add realtek USB sdmmc host driver

2014-02-12 Thread Ulf Hansson
On 12 February 2014 11:00,  rogera...@realtek.com wrote:
 From: Roger Tseng rogera...@realtek.com

 Realtek USB SD/MMC host driver provides mmc host support based on the Realtek
 USB card reader MFD driver.

 Signed-off-by: Roger Tseng rogera...@realtek.com

Reviewed-by: Ulf Hansson ulf.hans...@linaro.org


 ---
  drivers/mmc/host/Kconfig  |7 +
  drivers/mmc/host/Makefile |1 +
  drivers/mmc/host/rtsx_usb_sdmmc.c | 1462 
 +
  3 files changed, 1470 insertions(+)
  create mode 100644 drivers/mmc/host/rtsx_usb_sdmmc.c

 diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
 index 7fc5099..16f9a23 100644
 --- a/drivers/mmc/host/Kconfig
 +++ b/drivers/mmc/host/Kconfig
 @@ -665,3 +665,10 @@ config MMC_REALTEK_PCI
 help
   Say Y here to include driver code to support SD/MMC card interface
   of Realtek PCI-E card reader
 +
 +config MMC_REALTEK_USB
 +   tristate Realtek USB SD/MMC Card Interface Driver
 +   depends on MFD_RTSX_USB
 +   help
 + Say Y here to include driver code to support SD/MMC card interface
 + of Realtek RTS5129/39 series card reader
 diff --git a/drivers/mmc/host/Makefile b/drivers/mmc/host/Makefile
 index c41d0c3..9d8d765 100644
 --- a/drivers/mmc/host/Makefile
 +++ b/drivers/mmc/host/Makefile
 @@ -51,6 +51,7 @@ obj-$(CONFIG_MMC_USHC)+= ushc.o
  obj-$(CONFIG_MMC_WMT)  += wmt-sdmmc.o

  obj-$(CONFIG_MMC_REALTEK_PCI)  += rtsx_pci_sdmmc.o
 +obj-$(CONFIG_MMC_REALTEK_USB)  += rtsx_usb_sdmmc.o

  obj-$(CONFIG_MMC_SDHCI_PLTFM)  += sdhci-pltfm.o
  obj-$(CONFIG_MMC_SDHCI_CNS3XXX)+= sdhci-cns3xxx.o
 diff --git a/drivers/mmc/host/rtsx_usb_sdmmc.c 
 b/drivers/mmc/host/rtsx_usb_sdmmc.c
 new file mode 100644
 index 000..37f58b5
 --- /dev/null
 +++ b/drivers/mmc/host/rtsx_usb_sdmmc.c
 @@ -0,0 +1,1462 @@
 +/* Realtek USB SD/MMC Card Interface driver
 + *
 + * Copyright(c) 2009-2013 Realtek Semiconductor Corp. All rights reserved.
 + *
 + * This program is free software; you can redistribute it and/or modify it
 + * under the terms of the GNU General Public License version 2
 + * as published by the Free Software Foundation.
 + *
 + * This program is distributed in the hope that it will be useful, but
 + * WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 + * General Public License for more details.
 + *
 + * You should have received a copy of the GNU General Public License along
 + * with this program; if not, see http://www.gnu.org/licenses/.
 + *
 + * Author:
 + *   Roger Tseng rogera...@realtek.com
 + */
 +
 +#include linux/module.h
 +#include linux/slab.h
 +#include linux/delay.h
 +#include linux/platform_device.h
 +#include linux/usb.h
 +#include linux/mmc/host.h
 +#include linux/mmc/mmc.h
 +#include linux/mmc/sd.h
 +#include linux/mmc/sdio.h
 +#include linux/mmc/card.h
 +#include linux/scatterlist.h
 +#include linux/pm_runtime.h
 +
 +#include linux/mfd/rtsx_usb.h
 +#include asm/unaligned.h
 +
 +#if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
 +#include linux/leds.h
 +#include linux/workqueue.h
 +#define RTSX_USB_USE_LEDS_CLASS
 +#endif
 +
 +struct rtsx_usb_sdmmc {
 +   struct platform_device  *pdev;
 +   struct rtsx_ucr *ucr;
 +   struct mmc_host *mmc;
 +   struct mmc_request  *mrq;
 +
 +   struct mutexhost_mutex;
 +
 +   u8  ssc_depth;
 +   unsigned intclock;
 +   boolvpclk;
 +   booldouble_clk;
 +   boolhost_removal;
 +   boolcard_exist;
 +   boolinitial_mode;
 +   boolddr_mode;
 +
 +   unsigned char   power_mode;
 +
 +#if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
 +   struct led_classdev led;
 +   charled_name[32];
 +   struct work_struct  led_work;
 +#endif
 +};
 +
 +static inline struct device *sdmmc_dev(struct rtsx_usb_sdmmc *host)
 +{
 +   return (host-pdev-dev);
 +}
 +
 +static inline void sd_clear_error(struct rtsx_usb_sdmmc *host)
 +{
 +   struct rtsx_ucr *ucr = host-ucr;
 +   rtsx_usb_ep0_write_register(ucr, CARD_STOP,
 + SD_STOP | SD_CLR_ERR,
 + SD_STOP | SD_CLR_ERR);
 +
 +   rtsx_usb_clear_dma_err(ucr);
 +   rtsx_usb_clear_fsm_err(ucr);
 +}
 +
 +#ifdef DEBUG
 +static void sd_print_debug_regs(struct rtsx_usb_sdmmc *host)
 +{
 +   struct rtsx_ucr *ucr = host-ucr;
 +   u8 val = 0;
 +
 +   rtsx_usb_ep0_read_register(ucr, SD_STAT1, val);
 +   dev_dbg(sdmmc_dev(host), SD_STAT1: 0x%x\n, val);
 +   rtsx_usb_ep0_read_register(ucr, SD_STAT2, val);
 +   dev_dbg(sdmmc_dev(host), SD_STAT2: 0x%x\n, val);
 +   

Re: [PATCH RFC v2 00/35] Second preview of imx-drm cleanup series

2014-02-12 Thread Fabio Estevam
On Mon, Feb 10, 2014 at 10:28 AM, Russell King - ARM Linux
li...@arm.linux.org.uk wrote:
 This is the latest revision of my series cleaning up imx-drm and
 hopefully getting it ready to be moved out of drivers/staging.
 This series is updated to v3.14-rc2.

 Since the last round of patches were posted, the component support
 has been merged into mainline, and thus dropped from this series.
 Greg has taken the first three patches and merged them into his
 linux-next tree - however, I include them here for completness.

 Most of the comments from last time still apply, and I'll look at
 incorporating some of the other patches that were posted in the
 coming week.

 If I can have some acks for this, I'll start sending some of it to
 Greg - I'd like to at least get the five or six initial imx-hdmi
 patches to Greg and queued up for the next merge window sooner
 rather than later, preferably getting most of this ready for that
 window too.

Series looks good:

Reviewed-by: Fabio Estevam fabio.este...@freescale.com

Patch 04/35 will not be needed in the final submission, as there is
already a fix for the build issue in Greg's tree.

Regards,

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


Re: [PATCH RFC v2 00/35] Second preview of imx-drm cleanup series

2014-02-12 Thread Christian Gmeiner
2014-02-12 12:53 GMT+01:00 Fabio Estevam feste...@gmail.com:
 On Mon, Feb 10, 2014 at 10:28 AM, Russell King - ARM Linux
 li...@arm.linux.org.uk wrote:
 This is the latest revision of my series cleaning up imx-drm and
 hopefully getting it ready to be moved out of drivers/staging.
 This series is updated to v3.14-rc2.

 Since the last round of patches were posted, the component support
 has been merged into mainline, and thus dropped from this series.
 Greg has taken the first three patches and merged them into his
 linux-next tree - however, I include them here for completness.

 Most of the comments from last time still apply, and I'll look at
 incorporating some of the other patches that were posted in the
 coming week.

 If I can have some acks for this, I'll start sending some of it to
 Greg - I'd like to at least get the five or six initial imx-hdmi
 patches to Greg and queued up for the next merge window sooner
 rather than later, preferably getting most of this ready for that
 window too.

 Series looks good:

 Reviewed-by: Fabio Estevam fabio.este...@freescale.com

 Patch 04/35 will not be needed in the final submission, as there is
 already a fix for the build issue in Greg's tree.


I am the only one who does not get the whole series?

Even here ony a handfull of patches are listed:
http://www.spinics.net/lists/arm-kernel/threads.html#306292

--
Christian Gmeiner, MSc

https://soundcloud.com/christian-gmeiner
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH RFC v2 00/35] Second preview of imx-drm cleanup series

2014-02-12 Thread Russell King - ARM Linux
On Wed, Feb 12, 2014 at 01:04:30PM +0100, Christian Gmeiner wrote:
 2014-02-12 12:53 GMT+01:00 Fabio Estevam feste...@gmail.com:
  On Mon, Feb 10, 2014 at 10:28 AM, Russell King - ARM Linux
  li...@arm.linux.org.uk wrote:
  This is the latest revision of my series cleaning up imx-drm and
  hopefully getting it ready to be moved out of drivers/staging.
  This series is updated to v3.14-rc2.
 
  Since the last round of patches were posted, the component support
  has been merged into mainline, and thus dropped from this series.
  Greg has taken the first three patches and merged them into his
  linux-next tree - however, I include them here for completness.
 
  Most of the comments from last time still apply, and I'll look at
  incorporating some of the other patches that were posted in the
  coming week.
 
  If I can have some acks for this, I'll start sending some of it to
  Greg - I'd like to at least get the five or six initial imx-hdmi
  patches to Greg and queued up for the next merge window sooner
  rather than later, preferably getting most of this ready for that
  window too.
 
  Series looks good:
 
  Reviewed-by: Fabio Estevam fabio.este...@freescale.com
 
  Patch 04/35 will not be needed in the final submission, as there is
  already a fix for the build issue in Greg's tree.
 
 
 I am the only one who does not get the whole series?
 
 Even here ony a handfull of patches are listed:
 http://www.spinics.net/lists/arm-kernel/threads.html#306292

You will find it all on the de...@driverdev.osuosl.org archive.

-- 
FTTC broadband for 0.8mile line: 5.8Mbps down 500kbps up.  Estimation
in database were 13.1 to 19Mbit for a good line, about 7.5+ for a bad.
Estimate before purchase was up to 13.2Mbit.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH RFC v2 00/35] Second preview of imx-drm cleanup series

2014-02-12 Thread Shawn Guo
On Mon, Feb 10, 2014 at 12:28:03PM +, Russell King - ARM Linux wrote:
 This is the latest revision of my series cleaning up imx-drm and
 hopefully getting it ready to be moved out of drivers/staging.
 This series is updated to v3.14-rc2.
 
 Since the last round of patches were posted, the component support
 has been merged into mainline, and thus dropped from this series.
 Greg has taken the first three patches and merged them into his
 linux-next tree - however, I include them here for completness.
 
 Most of the comments from last time still apply, and I'll look at
 incorporating some of the other patches that were posted in the
 coming week.
 
 If I can have some acks for this, I'll start sending some of it to
 Greg - I'd like to at least get the five or six initial imx-hdmi
 patches to Greg and queued up for the next merge window sooner
 rather than later, preferably getting most of this ready for that
 window too.

For the series,

Acked-by: Shawn Guo shawn@linaro.org

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


Re: [PATCH RFC v2 00/35] Second preview of imx-drm cleanup series

2014-02-12 Thread Christian Gmeiner
2014-02-12 13:45 GMT+01:00 Russell King - ARM Linux li...@arm.linux.org.uk:
 On Wed, Feb 12, 2014 at 01:04:30PM +0100, Christian Gmeiner wrote:
 2014-02-12 12:53 GMT+01:00 Fabio Estevam feste...@gmail.com:
  On Mon, Feb 10, 2014 at 10:28 AM, Russell King - ARM Linux
  li...@arm.linux.org.uk wrote:
  This is the latest revision of my series cleaning up imx-drm and
  hopefully getting it ready to be moved out of drivers/staging.
  This series is updated to v3.14-rc2.
 
  Since the last round of patches were posted, the component support
  has been merged into mainline, and thus dropped from this series.
  Greg has taken the first three patches and merged them into his
  linux-next tree - however, I include them here for completness.
 
  Most of the comments from last time still apply, and I'll look at
  incorporating some of the other patches that were posted in the
  coming week.
 
  If I can have some acks for this, I'll start sending some of it to
  Greg - I'd like to at least get the five or six initial imx-hdmi
  patches to Greg and queued up for the next merge window sooner
  rather than later, preferably getting most of this ready for that
  window too.
 
  Series looks good:
 
  Reviewed-by: Fabio Estevam fabio.este...@freescale.com
 
  Patch 04/35 will not be needed in the final submission, as there is
  already a fix for the build issue in Greg's tree.
 

 I am the only one who does not get the whole series?

 Even here ony a handfull of patches are listed:
 http://www.spinics.net/lists/arm-kernel/threads.html#306292

 You will find it all on the de...@driverdev.osuosl.org archive.


thanks - thumbs up for this series.
--
Christian Gmeiner, MSc

https://soundcloud.com/christian-gmeiner
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/6] staging: r8188eu: Replace wrapper around _rtw_memcmp()

2014-02-12 Thread Dan Carpenter
I dropped netdev from the mailing list.  Wireless patches generally
should go through linux-wireless instead of netdev anyway.  They get
picked up from there and forwarded on to Dave Miller.

I reviewed these patches when they were posted to the list but I missed
this style issue which Smatch complains about.

On Sun, Feb 09, 2014 at 03:15:54PM -0600, Larry Finger wrote:
  int rtw_get_wpa_cipher_suite(u8 *s)
  {
 - if (_rtw_memcmp(s, WPA_CIPHER_SUITE_NONE, WPA_SELECTOR_LEN) == true)
 + if (!memcmp(s, WPA_CIPHER_SUITE_NONE, WPA_SELECTOR_LEN) == true)
   return WPA_CIPHER_NONE;
 - if (_rtw_memcmp(s, WPA_CIPHER_SUITE_WEP40, WPA_SELECTOR_LEN) == true)
 + if (!memcmp(s, WPA_CIPHER_SUITE_WEP40, WPA_SELECTOR_LEN) == true)
   return WPA_CIPHER_WEP40;
 - if (_rtw_memcmp(s, WPA_CIPHER_SUITE_TKIP, WPA_SELECTOR_LEN) == true)
 + if (!memcmp(s, WPA_CIPHER_SUITE_TKIP, WPA_SELECTOR_LEN) == true)
   return WPA_CIPHER_TKIP;
 - if (_rtw_memcmp(s, WPA_CIPHER_SUITE_CCMP, WPA_SELECTOR_LEN) == true)
 + if (!memcmp(s, WPA_CIPHER_SUITE_CCMP, WPA_SELECTOR_LEN) == true)
   return WPA_CIPHER_CCMP;
 - if (_rtw_memcmp(s, WPA_CIPHER_SUITE_WEP104, WPA_SELECTOR_LEN) == true)
 + if (!memcmp(s, WPA_CIPHER_SUITE_WEP104, WPA_SELECTOR_LEN) == true)
   return WPA_CIPHER_WEP104;

The (!foo == bar) is harmless here, but more often than not that
formulation indicates a precedence bug.

For memcmp() and to a larger extent for strcmp() then my prefered way
of doing it is:

if (memcmp(a, b, size) != 0) {

Normally, I rant and rave at code which does != 0 but for memcmp() it is
idiomatic *cmp() functions.  Think about it like this:

if (a == b) {

Translates to:

if (memcmp(a, b, size) == 0) {

In your head you move the == to the middle so it's obvious a == b.  Or
for strcmp():

if (strcmp(a, b, size)  0) {

means that a is less than b alphabetically.

regards,
dan carpenter

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


[PATCH v2 3/3] staging: rtl8188eu: remove header file ethernet.h

2014-02-12 Thread navin patidar
ethernet.h is included in three files but only rtw_recv.c using two macros
defined in ethernet.h, so move used macros in rtw_recv.c and
remove include/ethernet.h header file and inclusion of this header file.

v2:
First version of this patch failed to apply.

Signed-off-by: navin patidar navin.pati...@gmail.com
---
 drivers/staging/rtl8188eu/core/rtw_recv.c  |4 ++-
 drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c |1 -
 drivers/staging/rtl8188eu/include/ethernet.h   |   42 
 drivers/staging/rtl8188eu/os_dep/recv_linux.c  |1 -
 4 files changed, 3 insertions(+), 45 deletions(-)
 delete mode 100644 drivers/staging/rtl8188eu/include/ethernet.h

diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c 
b/drivers/staging/rtl8188eu/core/rtw_recv.c
index c8491f6..4de98b6 100644
--- a/drivers/staging/rtl8188eu/core/rtw_recv.c
+++ b/drivers/staging/rtl8188eu/core/rtw_recv.c
@@ -23,11 +23,13 @@
 #include drv_types.h
 #include recv_osdep.h
 #include mlme_osdep.h
-#include ethernet.h
 #include usb_ops.h
 #include wifi.h
 #include linux/vmalloc.h

+#define ETHERNET_HEADER_SIZE   14  /*  Ethernet Header Length */
+#define LLC_HEADER_SIZE6   /*  LLC Header Length */
+
 static u8 SNAP_ETH_TYPE_IPX[2] = {0x81, 0x37};
 static u8 SNAP_ETH_TYPE_APPLETALK_AARP[2] = {0x80, 0xf3};

diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c 
b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c
index 540c5ad..b1b1584 100644
--- a/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c
+++ b/drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c
@@ -22,7 +22,6 @@
 #include drv_types.h
 #include recv_osdep.h
 #include mlme_osdep.h
-#include ethernet.h

 #include usb_ops.h
 #include wifi.h
diff --git a/drivers/staging/rtl8188eu/include/ethernet.h 
b/drivers/staging/rtl8188eu/include/ethernet.h
deleted file mode 100644
index a59f912..000
--- a/drivers/staging/rtl8188eu/include/ethernet.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- *
- * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- *
- *
- 
**/
-/*! \file */
-#ifndef __INC_ETHERNET_H
-#define __INC_ETHERNET_H
-
-#define ETHERNET_ADDRESS_LENGTH6   /*  Ethernet Address 
Length */
-#define ETHERNET_HEADER_SIZE   14  /*  Ethernet Header Length */
-#define LLC_HEADER_SIZE6   /*  LLC Header Length */
-#define TYPE_LENGTH_FIELD_SIZE 2   /*  Type/Length Size */
-#define MINIMUM_ETHERNET_PACKET_SIZE   60  /*  Min Ethernet Packet Size */
-#define MAXIMUM_ETHERNET_PACKET_SIZE   1514/*  Max Ethernet Packet Size */
-
-/*  Is Multicast Address? */
-#define RT_ETH_IS_MULTICAST(_addr) u8 *)(_addr))[0]0x01) != 0)
-#define RT_ETH_IS_BROADCAST(_addr) (   \
-   ((u8 *)(_addr))[0] == 0xff\
-   ((u8 *)(_addr))[1] == 0xff\
-   ((u8 *)(_addr))[2] == 0xff\
-   ((u8 *)(_addr))[3] == 0xff\
-   ((u8 *)(_addr))[4] == 0xff\
-   ((u8 *)(_addr))[5] == 0xff) /*  Is Broadcast Address? */
-
-
-#endif /*  #ifndef __INC_ETHERNET_H */
diff --git a/drivers/staging/rtl8188eu/os_dep/recv_linux.c 
b/drivers/staging/rtl8188eu/os_dep/recv_linux.c
index fd8ca60..3eff225 100644
--- a/drivers/staging/rtl8188eu/os_dep/recv_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/recv_linux.c
@@ -26,7 +26,6 @@
 #include recv_osdep.h

 #include osdep_intf.h
-#include ethernet.h
 #include usb_ops.h

 /* init os related resource in struct recv_priv */
--
1.7.10.4

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


Re: [PATCH 3/3] staging: rtl8188eu: remove header file ethernet.h

2014-02-12 Thread navin patidar
I've submitted second version of this patch.

regards,
--navin-patidar

On Wed, Feb 12, 2014 at 2:03 AM, Greg KH gre...@linuxfoundation.org wrote:
 On Sun, Feb 09, 2014 at 02:10:46PM +0530, navin patidar wrote:
 ethernet.h is included in three files but only rtw_recv.c using two 
 macros
 defined in ethernet.h, so move used macros in rtw_recv.c and
 remove include/ethernet.h header file and inclusion of this header file.

 Signed-off-by: navin patidar navin.pati...@gmail.com
 ---
  drivers/staging/rtl8188eu/core/rtw_recv.c  |4 ++-
  drivers/staging/rtl8188eu/hal/rtl8188eu_recv.c |1 -
  drivers/staging/rtl8188eu/include/ethernet.h   |   42 
 
  drivers/staging/rtl8188eu/os_dep/recv_linux.c  |1 -
  4 files changed, 3 insertions(+), 45 deletions(-)
  delete mode 100644 drivers/staging/rtl8188eu/include/ethernet.h

 This patch fails to apply (2/3 had fuzz, but I fixed that up), can you
 redo this against linux-next and resend it?

 thanks,

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


Re: [PATCH 1/1] Tools: hv: vssdaemon: Ignore VFAT mounts during the Freeze operation

2014-02-12 Thread Greg KH
On Wed, Feb 12, 2014 at 08:40:22AM -0800, K. Y. Srinivasan wrote:
 If the guest has a FAT file system mounted, skip it during the FREEZE
 operation. With this change we can support host initiated backup of
 the guest even when the guest may have FAT file systems mounted.
 
 Signed-off-by: K. Y. Srinivasan k...@microsoft.com
 ---
  tools/hv/hv_vss_daemon.c |2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)
 
 diff --git a/tools/hv/hv_vss_daemon.c b/tools/hv/hv_vss_daemon.c
 index 520de3304..6a213b8 100644
 --- a/tools/hv/hv_vss_daemon.c
 +++ b/tools/hv/hv_vss_daemon.c
 @@ -87,6 +87,8 @@ static int vss_operate(int operation)
   continue;
   if (strcmp(ent-mnt_type, iso9660) == 0)
   continue;
 + if (strcmp(ent-mnt_type, vfat) == 0)
 + continue;

Why should the filesystem type matter here at all?

thanks,

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


Re: [PATCH] VME: Stop using memcpy_[to|from]io() due to unwanted behaviour

2014-02-12 Thread Greg Kroah-Hartman
On Wed, Feb 12, 2014 at 01:20:33PM +, Martyn Welch wrote:
 Hmm, can't see this patch on the mailing list, though get send-mail cc'ed me
 and I got it that way. As you've added a later patch that I wrote and not
 this one, can I assume that you didn't get it either Greg?

No, I didn't get this patch at all, care to resend it?  I only got the
VME: Correct read/write alignment algorithm patch from what I can
tell.

thanks,

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


Re: [PATCH 1/1] staging: imx-drm: remove unused variable

2014-02-12 Thread Greg KH
On Wed, Feb 12, 2014 at 02:47:39PM +0530, Sachin Kamat wrote:
 Silences the following warning:
 drivers/staging/imx-drm/imx-drm-core.c: In function ‘imx_drm_driver_unload’:
 drivers/staging/imx-drm/imx-drm-core.c:87:25: warning: unused variable 
 ‘imxdrm’ [-Wunused-variable]
 
 Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
 Cc: Sascha Hauer s.ha...@pengutronix.de
 ---
  drivers/staging/imx-drm/imx-drm-core.c |2 --
  1 file changed, 2 deletions(-)
 
 diff --git a/drivers/staging/imx-drm/imx-drm-core.c 
 b/drivers/staging/imx-drm/imx-drm-core.c
 index 236ed66..573fe88 100644
 --- a/drivers/staging/imx-drm/imx-drm-core.c
 +++ b/drivers/staging/imx-drm/imx-drm-core.c
 @@ -84,8 +84,6 @@ static void imx_drm_driver_lastclose(struct drm_device *drm)
  
  static int imx_drm_driver_unload(struct drm_device *drm)
  {
 - struct imx_drm_device *imxdrm = drm-dev_private;
 -

Please see the mailing list archives for why this patch has already been
rejected 3-4 times by now...

thanks,

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


RE: [PATCH 1/1] Tools: hv: vssdaemon: Ignore VFAT mounts during the Freeze operation

2014-02-12 Thread KY Srinivasan


 -Original Message-
 From: Greg KH [mailto:gre...@linuxfoundation.org]
 Sent: Wednesday, February 12, 2014 8:42 AM
 To: KY Srinivasan
 Cc: linux-ker...@vger.kernel.org; de...@linuxdriverproject.org; 
 o...@aepfle.de;
 a...@canonical.com; jasow...@redhat.com
 Subject: Re: [PATCH 1/1] Tools: hv: vssdaemon: Ignore VFAT mounts during the
 Freeze operation
 
 On Wed, Feb 12, 2014 at 08:40:22AM -0800, K. Y. Srinivasan wrote:
  If the guest has a FAT file system mounted, skip it during the FREEZE
  operation. With this change we can support host initiated backup of
  the guest even when the guest may have FAT file systems mounted.
 
  Signed-off-by: K. Y. Srinivasan k...@microsoft.com
  ---
   tools/hv/hv_vss_daemon.c |2 ++
   1 files changed, 2 insertions(+), 0 deletions(-)
 
  diff --git a/tools/hv/hv_vss_daemon.c b/tools/hv/hv_vss_daemon.c
  index 520de3304..6a213b8 100644
  --- a/tools/hv/hv_vss_daemon.c
  +++ b/tools/hv/hv_vss_daemon.c
  @@ -87,6 +87,8 @@ static int vss_operate(int operation)
  continue;
  if (strcmp(ent-mnt_type, iso9660) == 0)
  continue;
  +   if (strcmp(ent-mnt_type, vfat) == 0)
  +   continue;
 
 Why should the filesystem type matter here at all?

As part of snapshotting the guest, we want to freeze all mounted file systems 
in the guest.
FAT file system does not support the freeze operation and so we want to skip 
these mount
points. For VMs on UEFI firmware, the EFI partition is a FAT partition.

Regards,

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


Re: [PATCH 34/47 v2] staging: comedi: icp_multi: use comedi_timeout()

2014-02-12 Thread Greg KH
On Mon, Feb 10, 2014 at 11:49:33AM -0700, H Hartley Sweeten wrote:
 Use comedi_timeout() to wait for the analog input and output end-of-
 conversion.
 
 Use break to exit the loop when a timeout occurs during the analog
 input read so that common code can be used to disable the device.
 
 Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com
 Cc: Ian Abbott abbo...@mev.co.uk
 Cc: Greg Kroah-Hartman gre...@linuxfoundation.org
 ---
  drivers/staging/comedi/drivers/icp_multi.c | 104 
 +++--
  1 file changed, 54 insertions(+), 50 deletions(-)
 
 diff --git a/drivers/staging/comedi/drivers/icp_multi.c 
 b/drivers/staging/comedi/drivers/icp_multi.c
 index 19c586b..7fb6ca0 100644
 --- a/drivers/staging/comedi/drivers/icp_multi.c
 +++ b/drivers/staging/comedi/drivers/icp_multi.c
 @@ -171,12 +171,27 @@ static void setup_channel_list(struct comedi_device 
 *dev,
   }
  }
  
 +static int icp_multi_ai_eoc(struct comedi_device *dev,
 + struct comedi_subdevice *s,
 + struct comedi_insn *insn,
 + unsigned long context)
 +{
 + struct icp_multi_private *devpriv = dev-private;
 + unsigned int status;
 +
 + status = readw(devpriv-io_addr + ICP_MULTI_ADC_CSR);
 + if ((status  ADC_BSY) == 0)
 + return 0;
 + return -EBUSY;
 +}
 +
  static int icp_multi_insn_read_ai(struct comedi_device *dev,
 struct comedi_subdevice *s,
 struct comedi_insn *insn, unsigned int *data)
  {
   struct icp_multi_private *devpriv = dev-private;
 - int n, timeout;
 + int ret = 0;
 + int n;
  
   /*  Disable A/D conversion ready interrupt */
   devpriv-IntEnable = ~ADC_READY;
 @@ -199,33 +214,14 @@ static int icp_multi_insn_read_ai(struct comedi_device 
 *dev,
   udelay(1);
  
   /*  Wait for conversion to complete, or get fed up waiting */
 - timeout = 100;
 - while (timeout--) {
 - if (!(readw(devpriv-io_addr +
 - ICP_MULTI_ADC_CSR)  ADC_BSY))
 - goto conv_finish;
 -
 - udelay(1);
 + ret = comedi_timeout(dev, s, insn, icp_multi_ai_eoc, 0);
 + if (ret) {
 + comedi_error(dev, A/D insn timeout);
 + /*  Clear data received */
 + data[n] = 0;
 + break;
   }
  
 - /*  If we reach here, a timeout has occurred */
 - comedi_error(dev, A/D insn timeout);
 -
 - /*  Disable interrupt */
 - devpriv-IntEnable = ~ADC_READY;
 - writew(devpriv-IntEnable, devpriv-io_addr + ICP_MULTI_INT_EN);
 -
 - /*  Clear interrupt status */
 - devpriv-IntStatus |= ADC_READY;
 - writew(devpriv-IntStatus,
 -devpriv-io_addr + ICP_MULTI_INT_STAT);
 -

How come these writew() calls are removed?  Don't we still need to do
them in failure mode?

thanks,

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


[PATCH V6 1/1] Drivers: hv: Implement the file copy service

2014-02-12 Thread K. Y. Srinivasan
Implement the file copy service for Linux guests on Hyper-V. This permits the
host to copy a file (over VMBUS) into the guest. This facility is part of
guest integration services supported on the Windows platform.
Here is a link that provides additional details on this functionality:

http://technet.microsoft.com/en-us/library/dn464282.aspx

In V1 version of the patch I have addressed comments from
Olaf Hering o...@aepfle.de and Dan Carpenter dan.carpen...@oracle.com

In V2 version of this patch I did some minor cleanup (making some globals
static). In V4 version of the patch I have addressed all of Olaf's
most recent set of comments/concerns.

In V5 version of the patch I had addressed Greg's most recent comments.
I would like to thank Greg for suggesting that I use misc device; it has
significantly simplified the code.

In this version of the patch I have cleaned up error message based on Olaf's
comments. I have also rebased the patch based on the current tip.

Signed-off-by: K. Y. Srinivasan k...@microsoft.com
---
 drivers/hv/Makefile |2 +-
 drivers/hv/hv_fcopy.c   |  388 +++
 drivers/hv/hv_util.c|   10 +
 include/linux/hyperv.h  |   16 ++-
 include/uapi/linux/hyperv.h |   46 +
 tools/hv/hv_fcopy_daemon.c  |  195 ++
 6 files changed, 655 insertions(+), 2 deletions(-)
 create mode 100644 drivers/hv/hv_fcopy.c
 create mode 100644 tools/hv/hv_fcopy_daemon.c

diff --git a/drivers/hv/Makefile b/drivers/hv/Makefile
index 0a74b56..5e4dfa4 100644
--- a/drivers/hv/Makefile
+++ b/drivers/hv/Makefile
@@ -5,4 +5,4 @@ obj-$(CONFIG_HYPERV_BALLOON)+= hv_balloon.o
 hv_vmbus-y := vmbus_drv.o \
 hv.o connection.o channel.o \
 channel_mgmt.o ring_buffer.o
-hv_utils-y := hv_util.o hv_kvp.o hv_snapshot.o
+hv_utils-y := hv_util.o hv_kvp.o hv_snapshot.o hv_fcopy.o
diff --git a/drivers/hv/hv_fcopy.c b/drivers/hv/hv_fcopy.c
new file mode 100644
index 000..15cf35c
--- /dev/null
+++ b/drivers/hv/hv_fcopy.c
@@ -0,0 +1,388 @@
+/*
+ * An implementation of file copy service.
+ *
+ * Copyright (C) 2014, Microsoft, Inc.
+ *
+ * Author : K. Y. Srinivasan ksriniva...@novell.com
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
+ * NON INFRINGEMENT.  See the GNU General Public License for more
+ * details.
+ *
+ */
+
+#define pr_fmt(fmt) KBUILD_MODNAME :  fmt
+
+#include linux/semaphore.h
+#include linux/fs.h
+#include linux/nls.h
+#include linux/workqueue.h
+#include linux/cdev.h
+#include linux/hyperv.h
+#include linux/sched.h
+#include linux/uaccess.h
+#include linux/miscdevice.h
+
+#define WIN8_SRV_MAJOR 1
+#define WIN8_SRV_MINOR 1
+#define WIN8_SRV_VERSION   (WIN8_SRV_MAJOR  16 | WIN8_SRV_MINOR)
+
+/*
+ * Global state maintained for transaction that is being processed.
+ * For a class of integration services, including the file copy service,
+ * the specified protocol is a request/response protocol which means that
+ * there can only be single outstanding transaction from the host at any
+ * given point in time. We use this to simplify memory management in this
+ * driver - we cache and process only one message at a time.
+ *
+ * While the request/response protocol is guaranteed by the host, we further
+ * ensure this by serializing packet processing in this driver - we do not
+ * read additional packets from the VMBUs until the current packet is fully
+ * handled.
+ *
+ * The transaction active state is set when we receive a request from the
+ * host and we cleanup this state when the transaction is completed - when we
+ * respond to the host with our response. When the transaction active state is
+ * set, we defer handling incoming packets.
+ */
+
+static struct {
+   bool active; /* transaction status - active or not */
+   int recv_len; /* number of bytes received. */
+   struct hv_fcopy_hdr  *fcopy_msg; /* current message */
+   struct hv_start_fcopy  message; /*  sent to daemon */
+   struct vmbus_channel *recv_channel; /* chn we got the request */
+   u64 recv_req_id; /* request ID. */
+   void *fcopy_context; /* for the channel callback */
+   struct semaphore read_sema;
+} fcopy_transaction;
+
+static bool opened; /* currently device opened */
+
+/*
+ * Before we can accept copy messages from the host, we need
+ * to handshake with the user level daemon. This state tracks
+ * if we are in the handshake phase.
+ */
+static bool in_hand_shake = true;
+static void fcopy_send_data(void);
+static void fcopy_respond_to_host(int error);
+static void fcopy_work_func(struct work_struct *dummy);
+static 

Re: [PATCH RFC v2 00/35] Second preview of imx-drm cleanup series

2014-02-12 Thread Philipp Zabel
Am Mittwoch, den 12.02.2014, 09:56 + schrieb Russell King - ARM
Linux:
 On Mon, Feb 10, 2014 at 12:28:03PM +, Russell King - ARM Linux wrote:
  This is the latest revision of my series cleaning up imx-drm and
  hopefully getting it ready to be moved out of drivers/staging.
  This series is updated to v3.14-rc2.
  
  Since the last round of patches were posted, the component support
  has been merged into mainline, and thus dropped from this series.
  Greg has taken the first three patches and merged them into his
  linux-next tree - however, I include them here for completness.
  
  Most of the comments from last time still apply, and I'll look at
  incorporating some of the other patches that were posted in the
  coming week.
  
  If I can have some acks for this, I'll start sending some of it to
  Greg - I'd like to at least get the five or six initial imx-hdmi
  patches to Greg and queued up for the next merge window sooner
  rather than later, preferably getting most of this ready for that
  window too.
 
 So far, only the first few patches have been acked by one person.  What
 about the remainder?  There's been no comments on them either...

With the understanding that I loathe the current DT bindings, which are
not the fault of this series:

Acked-by: Philipp Zabel p.za...@pengutronix.de

regards
Philipp

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


[PATCH] staging: r8188eu: Fix Smatch warnings

2014-02-12 Thread Larry Finger
Smatch reports the following:

core/rtw_ieee80211.c:489 rtw_get_wpa_cipher_suite() warn: add some parenthesis 
here?
core/rtw_ieee80211.c:491 rtw_get_wpa_cipher_suite() warn: add some parenthesis 
here?
core/rtw_ieee80211.c:493 rtw_get_wpa_cipher_suite() warn: add some parenthesis 
here?
core/rtw_ieee80211.c:495 rtw_get_wpa_cipher_suite() warn: add some parenthesis 
here?
core/rtw_ieee80211.c:497 rtw_get_wpa_cipher_suite() warn: add some parenthesis 
here?
core/rtw_ieee80211.c:505 rtw_get_wpa2_cipher_suite() warn: add some parenthesis 
here?
core/rtw_ieee80211.c:507 rtw_get_wpa2_cipher_suite() warn: add some parenthesis 
here?
core/rtw_ieee80211.c:509 rtw_get_wpa2_cipher_suite() warn: add some parenthesis 
here?
core/rtw_ieee80211.c:511 rtw_get_wpa2_cipher_suite() warn: add some parenthesis 
here?
core/rtw_ieee80211.c:513 rtw_get_wpa2_cipher_suite() warn: add some parenthesis 
here?
core/rtw_ieee80211.c:534 rtw_parse_wpa_ie() warn: add some parenthesis here?
core/rtw_ieee80211.c:579 rtw_parse_wpa_ie() warn: add some parenthesis here?
core/rtw_ieee80211.c:649 rtw_parse_wpa2_ie() warn: add some parenthesis here?
core/rtw_ieee80211.c:803 rtw_get_wps_attr() warn: add some parenthesis here?
core/rtw_ieee80211.c:1213 rtw_get_p2p_ie() warn: add some parenthesis here?
core/rtw_ieee80211.c:1248 rtw_get_p2p_attr() warn: add some parenthesis here?
core/rtw_mlme.c:258 _rtw_find_network() warn: add some parenthesis here?
core/rtw_mlme.c:1581 rtw_check_join_candidate() warn: this array is probably 
non-NULL. 'pmlmepriv-assoc_ssid.Ssid'
core/rtw_mlme.c:1843 SecIsInPMKIDList() warn: add some parenthesis here?
core/rtw_mlme_ext.c:4189 on_action_public_vendor() warn: add some parenthesis 
here?
core/rtw_recv.c:1157 validate_recv_mgnt_frame() warn: add some parenthesis here?
core/rtw_xmit.c:671 xmitframe_addmic() warn: add some parenthesis here?
hal/rtl8188e_mp.c:206 Hal_MPT_CCKTxPowerAdjustbyIndex() error: buffer overflow 
'CCKSwingTable_Ch1_Ch13' 33 = 255
hal/rtl8188e_mp.c:215 Hal_MPT_CCKTxPowerAdjustbyIndex() error: buffer overflow 
'CCKSwingTable_Ch14' 33 = 255

Not listed here is one remaining buffer overflow message that I believe to be 
an error in Smatch.

These warnings were reported by the 0-DAY kernel build testing backend.

Signed-off-by: Larry Finger larry.fin...@lwfinger.net
---
 drivers/staging/rtl8188eu/core/rtw_ieee80211.c | 32 +-
 drivers/staging/rtl8188eu/core/rtw_mlme.c  |  6 ++---
 drivers/staging/rtl8188eu/core/rtw_mlme_ext.c  |  2 +-
 drivers/staging/rtl8188eu/core/rtw_recv.c  |  3 ++-
 drivers/staging/rtl8188eu/core/rtw_xmit.c  |  2 +-
 drivers/staging/rtl8188eu/hal/rtl8188e_mp.c|  2 ++
 6 files changed, 25 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c 
b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
index d779c80..4076c66 100644
--- a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
@@ -486,15 +486,15 @@ unsigned char *rtw_get_wpa2_ie(unsigned char *pie, int 
*rsn_ie_len, int limit)
 
 int rtw_get_wpa_cipher_suite(u8 *s)
 {
-   if (!memcmp(s, WPA_CIPHER_SUITE_NONE, WPA_SELECTOR_LEN) == true)
+   if (!memcmp(s, WPA_CIPHER_SUITE_NONE, WPA_SELECTOR_LEN))
return WPA_CIPHER_NONE;
-   if (!memcmp(s, WPA_CIPHER_SUITE_WEP40, WPA_SELECTOR_LEN) == true)
+   if (!memcmp(s, WPA_CIPHER_SUITE_WEP40, WPA_SELECTOR_LEN))
return WPA_CIPHER_WEP40;
-   if (!memcmp(s, WPA_CIPHER_SUITE_TKIP, WPA_SELECTOR_LEN) == true)
+   if (!memcmp(s, WPA_CIPHER_SUITE_TKIP, WPA_SELECTOR_LEN))
return WPA_CIPHER_TKIP;
-   if (!memcmp(s, WPA_CIPHER_SUITE_CCMP, WPA_SELECTOR_LEN) == true)
+   if (!memcmp(s, WPA_CIPHER_SUITE_CCMP, WPA_SELECTOR_LEN))
return WPA_CIPHER_CCMP;
-   if (!memcmp(s, WPA_CIPHER_SUITE_WEP104, WPA_SELECTOR_LEN) == true)
+   if (!memcmp(s, WPA_CIPHER_SUITE_WEP104, WPA_SELECTOR_LEN))
return WPA_CIPHER_WEP104;
 
return 0;
@@ -502,15 +502,15 @@ int rtw_get_wpa_cipher_suite(u8 *s)
 
 int rtw_get_wpa2_cipher_suite(u8 *s)
 {
-   if (!memcmp(s, RSN_CIPHER_SUITE_NONE, RSN_SELECTOR_LEN) == true)
+   if (!memcmp(s, RSN_CIPHER_SUITE_NONE, RSN_SELECTOR_LEN))
return WPA_CIPHER_NONE;
-   if (!memcmp(s, RSN_CIPHER_SUITE_WEP40, RSN_SELECTOR_LEN) == true)
+   if (!memcmp(s, RSN_CIPHER_SUITE_WEP40, RSN_SELECTOR_LEN))
return WPA_CIPHER_WEP40;
-   if (!memcmp(s, RSN_CIPHER_SUITE_TKIP, RSN_SELECTOR_LEN) == true)
+   if (!memcmp(s, RSN_CIPHER_SUITE_TKIP, RSN_SELECTOR_LEN))
return WPA_CIPHER_TKIP;
-   if (!memcmp(s, RSN_CIPHER_SUITE_CCMP, RSN_SELECTOR_LEN) == true)
+   if (!memcmp(s, RSN_CIPHER_SUITE_CCMP, RSN_SELECTOR_LEN))
return WPA_CIPHER_CCMP;
-   if (!memcmp(s, RSN_CIPHER_SUITE_WEP104, RSN_SELECTOR_LEN) == true)
+   if (!memcmp(s, RSN_CIPHER_SUITE_WEP104, RSN_SELECTOR_LEN))

[PATCH] staging: rtl8188eu: remove unused header files

2014-02-12 Thread navin patidar
Remove h2clbk.h and nic_spec.h header files.

Signed-off-by: navin patidar navin.pati...@gmail.com
---
 drivers/staging/rtl8188eu/include/h2clbk.h   |   35 
 drivers/staging/rtl8188eu/include/nic_spec.h |   44 --
 2 files changed, 79 deletions(-)
 delete mode 100644 drivers/staging/rtl8188eu/include/h2clbk.h
 delete mode 100644 drivers/staging/rtl8188eu/include/nic_spec.h

diff --git a/drivers/staging/rtl8188eu/include/h2clbk.h 
b/drivers/staging/rtl8188eu/include/h2clbk.h
deleted file mode 100644
index e595030..000
--- a/drivers/staging/rtl8188eu/include/h2clbk.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- *
- * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- *
- *
- 
**/
-
-
-#define _H2CLBK_H_
-
-
-#include rtl8711_spec.h
-#include TypeDef.h
-
-
-void _lbk_cmd(struct adapter *adapter);
-
-void _lbk_rsp(struct adapter *adapter);
-
-void _lbk_evt(IN struct adapter *adapter);
-
-void h2c_event_callback(unsigned char *dev, unsigned char *pbuf);
diff --git a/drivers/staging/rtl8188eu/include/nic_spec.h 
b/drivers/staging/rtl8188eu/include/nic_spec.h
deleted file mode 100644
index d422447..000
--- a/drivers/staging/rtl8188eu/include/nic_spec.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- *
- * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- *
- *
- 
**/
-
-
-#ifndef __NIC_SPEC_H__
-#define __NIC_SPEC_H__
-
-#define RTL8711_MCTRL_ (0x2)
-#define RTL8711_UART_  (0x3)
-#define RTL8711_TIMER_ (0x4)
-#define RTL8711_FINT_  (0x5)
-#define RTL8711_HINT_  (0x5)
-#define RTL8711_GPIO_  (0x6)
-#define RTL8711_WLANCTRL_  (0x20)
-#define RTL8711_WLANFF_(0xe0)
-#define RTL8711_HCICTRL_   (0x60)
-#define RTL8711_SYSCFG_(0x62)
-#define RTL8711_SYSCTRL_   (0x62)
-#define RTL8711_MCCTRL_(0x02)
-
-
-#include rtl8711_regdef.h
-
-#include rtl8711_bitdef.h
-
-
-#endif /*  __RTL8711_SPEC_H__ */
--
1.7.10.4

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


[PATCH RFC 02/17] staging: dgap: Merge dgap_fep5.h into dgap_driver.h

2014-02-12 Thread Mark Hounschell
Merge dgap_fep5.h into dgap_driver.h

Signed-off-by: Mark Hounschell ma...@compro.net
Cc: Greg Kroah-Hartman gre...@linuxfoundation.org

diff -urN linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.c 
linux-3.13.1-new/drivers/staging/dgap/dgap_driver.c
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.c2014-01-31 
10:53:58.955814989 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_driver.c 2014-01-31 
10:31:00.704520321 -0500
@@ -33,7 +33,6 @@
 
 #include dgap_driver.h
 #include dgap_pci.h
-#include dgap_fep5.h
 #include dgap_tty.h
 #include dgap_conf.h
 #include dgap_parse.h
diff -urN linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.h 
linux-3.13.1-new/drivers/staging/dgap/dgap_driver.h
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.h2014-01-29 
08:06:37.0 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_driver.h 2014-01-31 
10:27:53.968854369 -0500
@@ -618,4 +618,234 @@
 extern uintdgap_get_custom_baud(struct channel_t *ch);
 extern voiddgap_firmware_reset_port(struct channel_t *ch);
 
+
+/* 
+ ***   FEP Version 5 dependent definitions
+ /
+
+/
+ *  FEP memory offsets
+ /
+#define START   0x0004L /* Execution start address  */
+
+#define CMDBUF  0x0d10L /* Command (cm_t) structure offset */
+#define CMDSTART0x0400L /* Start of command buffer  */   
+#define CMDMAX  0x0800L /* End of command buffer*/
+
+#define EVBUF   0x0d18L /* Event (ev_t) structure   */
+#define EVSTART 0x0800L /* Start of event buffer*/
+#define EVMAX   0x0c00L /* End of event buffer  */
+#define FEP5_PLUS   0x0E40  /* ASCII '5' and ASCII 'A' is here  */
+#define ECS_SEG 0x0E44  /* Segment of the extended channel 
structure */
+#define LINE_SPEED  0x10/* Offset into ECS_SEG for line speed  
 */
+/* if the fep has extended 
capabilities */
+
+/* BIOS MAGIC SPOTS */
+#define ERROR   0x0C14L/* BIOS error code  
*/
+#define SEQUENCE   0x0C12L /* BIOS sequence indicator  */
+#define POSTAREA   0x0C00L /* POST complete message area   */
+
+/* FEP MAGIC SPOTS */
+#define FEPSTAT POSTAREA/* OS here when FEP comes up*/
+#define NCHAN   0x0C02L /* number of ports FEP sees */
+#define PANIC   0x0C10L /* PANIC area for FEP   */
+#define KMEMEM  0x0C30L /* Memory for KME use   */   
+#define CONFIG  0x0CD0L /* Concentrator configuration info */
+#define CONFIGSIZE  0x0030  /* configuration info size  */
+#define DOWNREQ 0x0D00  /* Download request buffer pointer */
+
+#define CHANBUF 0x1000L /* Async channel (bs_t) structs */
+#define FEPOSSIZE   0x1FFF  /* 8K FEPOS */
+
+#define XEMPORTS0xC02  /*
+* Offset in board memory where FEP5 stores
+* how many ports it has detected.
+* NOTE: FEP5 reports 64 ports when the user
+* has the cable in EBI OUT instead of EBI IN.
+*/
+
+#define FEPCLR  0x00
+#define FEPMEM  0x02 
+#define FEPRST  0x04 
+#define FEPINT  0x08
+#define FEPMASK 0x0e
+#define FEPWIN  0x80
+
+#define LOWMEM  0x0100
+#define HIGHMEM 0x7f00
+
+#define FEPTIMEOUT 20
+
+#define ENABLE_INTR0x0e04  /* Enable interrupts flag */
+#define FEPPOLL_MIN1   /* minimum of 1 millisecond */  
+#define FEPPOLL_MAX20  /* maximum of 20 milliseconds */
+#define FEPPOLL0x0c26  /* Fep event poll 
interval */   
+
+#defineIALTPIN 0x0080  /* Input flag to swap 
DSR - DCD */
+
+/ 
+ * Command structure definition.
+ /
+struct cm_t {
+   volatile unsigned short cm_head;/* Command buffer head offset   
*/
+   volatile unsigned short cm_tail;/* Command buffer tail offset   
*/
+   volatile unsigned short cm_start;   /* start offset of buffer   
*/
+   volatile unsigned short cm_max; /* last offset of buffer
*/
+};
+
+/
+ * Event structure definition.
+ 

[PATCH RFC 03/17] staging: dgap: Remove userland downld.c source file

2014-02-12 Thread Mark Hounschell
Remove userland downld.c source file.

Signed-off-by: Mark Hounschell ma...@compro.net
Cc: Greg Kroah-Hartman gre...@linuxfoundation.org

diff -urN linux-3.13.1-orig/drivers/staging/dgap/downld.c 
linux-3.13.1-new/drivers/staging/dgap/downld.c
--- linux-3.13.1-orig/drivers/staging/dgap/downld.c 2014-01-29 
08:06:37.0 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/downld.c  1969-12-31 
19:00:00.0 -0500
@@ -1,798 +0,0 @@
-/*
- * Copyright 2003 Digi International (www.digi.com)
- * Scott H Kilau Scott_Kilau at digi dot com
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: downld.c,v 1.6 2009/01/14 14:10:54 markh Exp $
- */
-
-/*
-** downld.c
-**
-**  This is the daemon that sends the fep, bios, and concentrator images
-**  from user space to the driver.
-** BUGS: 
-**  If the file changes in the middle of the download, you probably
-** will get what you deserve.
-**
-*/
-
-#include stdlib.h
-#include stdio.h
-#include fcntl.h
-#include sys/types.h
-#include sys/stat.h
-#include sys/errno.h
-
-#include dgap_types.h
-#include digi.h
-#include dgap_fep5.h
-
-#include dgap_downld.h
-
-#include string.h
-#include malloc.h
-#include stddef.h
-#include unistd.h
-
-char   *pgm;
-void   myperror();
-
-/*
-**  This structure is used to keep track of the different images available
-**  to give to the driver.  It is arranged so that the things that are
-**  constants or that have defaults are first inthe strucutre to simplify
-**  the table of initializers.
-*/
-struct image_info {
-   short   type;   /* bios, fep, conc */
-   short   family; /* boards this applies to */
-   short   subtype;/* subtype */
-   int len;/* size of image */
-   char*image; /* ioctl struct + image */
-   char*name;
-   char*fname; /* filename of binary (i.e. asfep.bin) */
-   char*pathname;  /* pathname to this binary 
(/etc/dgap/xrfep.bin); */
-   time_t  mtime;  /* Last modification time */
-};
-
-#define IBIOS  0
-#defineIFEP1
-#defineICONC   2
-#define ICONFIG3
-#defineIBAD4
-
-#define DEFAULT_LOC /lib/firmware/dgap/
-
-struct image_info  *image_list;
-intnimages, count;
-
-struct image_info images[] = {
-{IBIOS, T_EPC,  SUBTYPE, 0, NULL, EPC/X, fxbios.bin, DEFAULT_LOC 
fxbios.bin, 0 },
-{IFEP,  T_EPC,  SUBTYPE, 0, NULL, EPC/X, fxfep.bin, DEFAULT_LOC 
fxfep.bin, 0 },
-{ICONC, T_EPC,  SUBTYPE, 0, NULL, EPC/X, fxcon.bin, DEFAULT_LOC 
fxcon.bin, 0 },
-
-{IBIOS, T_CX,   SUBTYPE, 0, NULL, C/X,   cxbios.bin, DEFAULT_LOC 
cxbios.bin, 0 },
-{IFEP,  T_CX,   SUBTYPE, 0, NULL, C/X,   cxhost.bin, DEFAULT_LOC 
cxhost.bin, 0 },
-
-{IBIOS, T_CX,   T_PCIBUS, 0, NULL, C/X PCI, cxpbios.bin, DEFAULT_LOC 
cxpbios.bin, 0 },
-{IFEP,  T_CX,   T_PCIBUS, 0, NULL, C/X PCI, cxpfep.bin, DEFAULT_LOC 
cxpfep.bin, 0 },
-
-{ICONC, T_CX,   SUBTYPE, 0, NULL, C/X,   cxcon.bin, DEFAULT_LOC 
cxcon.bin, 0 },
-{ICONC, T_CX,   SUBTYPE, 0, NULL, C/X,   ibmcxcon.bin, DEFAULT_LOC 
ibmcxcon.bin, 0 },
-{ICONC, T_CX,   SUBTYPE, 0, NULL, C/X,   ibmencon.bin, DEFAULT_LOC 
ibmencon.bin, 0 },
-
-{IBIOS, FAMILY,   T_PCXR, 0, NULL, PCXR, xrbios.bin, DEFAULT_LOC 
xrbios.bin, 0 },
-{IFEP,  FAMILY,   T_PCXR, 0,  NULL,  PCXR,   xrfep.bin, DEFAULT_LOC 
xrfep.bin, 0  },
-
-{IBIOS, T_PCLITE,   SUBTYPE, 0, NULL, X/em,  sxbios.bin, DEFAULT_LOC 
sxbios.bin, 0 },
-{IFEP,  T_PCLITE,   SUBTYPE, 0,  NULL,  X/em,sxfep.bin, 
DEFAULT_LOC sxfep.bin, 0  },
-
-{IBIOS, T_EPC,  T_PCIBUS, 0, NULL, PCI,  pcibios.bin, DEFAULT_LOC 
pcibios.bin, 0 },
-{IFEP,  T_EPC,  T_PCIBUS, 0, NULL, PCI,  pcifep.bin, DEFAULT_LOC 
pcifep.bin, 0 },
-{ICONFIG, 0,   0, 0, NULL, NULL,   dgap.conf,
/etc/dgap.conf, 0 },
-
-/* IBAD/NULL entry indicating end-of-table */
-
-{IBAD,  0, 0, 0,  NULL,  NULL, NULL, NULL, 0 }
-
-} ;
-
-interrorprint = 1;
-intnodldprint = 1;
-intdebugflag;
-intfd;
-
-struct downld_t *ip;   /* Image pointer in current image  */
-struct downld_t *dp;   /* conc. download */
-
-
-/*
- * The same for either the FEP or the BIOS. 
- *  Append the downldio header, issue the ioctl, then free
- *  the buffer.  Not horribly CPU 

[PATCH RFC 04/17] staging: dgap: Add in kernel firmware loading support

2014-02-12 Thread Mark Hounschell
Add in kernel firmware loading support

Signed-off-by: Mark Hounschell ma...@compro.net
Cc: Greg Kroah-Hartman gre...@linuxfoundation.org

diff -urN linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.c 
linux-3.13.1-new/drivers/staging/dgap/dgap_driver.c
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.c2014-02-03 
13:34:50.489287314 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_driver.c 2014-02-03 
14:12:20.059076489 -0500
@@ -18,6 +18,33 @@
  *
  */
 
+/*
+ *  In the original out of kernel Digi dgap driver, firmware
+ *  loading was done via user land to driver handshaking.
+ *
+ *  For cards that support a concentrator (port expander),
+ *  I believe the concentrator its self told the card which
+ *  concentrator is actually attached and then that info
+ *  was used to tell user land which concentrator firmware
+ *  image was to be downloaded. I think even the BIOS or
+ *  FEP images required would change with the connection
+ *  of a particular concentrator. 
+ *
+ *  Since I have no access to any of these cards or
+ *  concentrators, I cannot put the correct concentrator
+ *  firmware file names into the firmware_info structure
+ *  as is now done for the BIOS and FEP images. 
+ *
+ *  I think, but am not certain, that the cards supporting
+ *  concentrators will function without them. So support
+ *  of these cards has been left in this driver.
+ *
+ *  In order to fully support those cards, they would
+ *  either have to be acquired for dissection or maybe
+ *  Digi International could provide some assistance.
+ */
+#undef DIGI_CONCENTRATORS_SUPPORTED
+
 #include linux/kernel.h
 #include linux/module.h
 #include linux/pci.h
@@ -26,6 +53,7 @@
 #include asm/uaccess.h   /* For copy_from_user/copy_to_user */
 #include linux/sched.h
 #include linux/sched.h
+#include linux/firmware.h
 
 #include linux/version.h
 #include linux/tty.h
@@ -72,10 +100,25 @@
 static voiddgap_mbuf(struct board_t *brd, const char *fmt, ...);
 static int dgap_do_remap(struct board_t *brd);
 static irqreturn_t dgap_intr(int irq, void *voidbrd);
-
+static voiddgap_cmdw_ext(struct channel_t *ch, u16 cmd, u16 word, 
uint ncmds);
+static int dgap_event(struct board_t *bd);
+static int dgap_firmware_load(struct pci_dev *pdev, int card_type);
+static voiddgap_do_bios_load(struct board_t *brd, uchar *ubios, 
int len);
+static voiddgap_do_fep_load(struct board_t *brd, uchar *ufep, int 
len);
+static voiddgap_sysfs_create(struct board_t *brd);
+static voiddgap_get_vpd(struct board_t *brd);
+static voiddgap_do_reset_board(struct board_t *brd);
+static voiddgap_do_wait_for_bios(struct board_t *brd);
+static voiddgap_do_wait_for_fep(struct board_t *brd);
+static int dgap_after_config_loaded(int brd);
+static int dgap_finalize_board_init(struct board_t *brd);
 static voiddgap_cmdw_ext(struct channel_t *ch, u16 cmd, u16 word, 
uint ncmds);
 static int dgap_event(struct board_t *bd);
 
+#ifdef DIGI_CONCENTRATORS_SUPPORTED
+static void dgap_do_conc_load(struct board_t *brd, uchar *uaddr, 
int len);
+#endif
+
 /* Driver load/unload functions */
 intdgap_init_module(void);
 void   dgap_cleanup_module(void);
@@ -110,9 +153,7 @@
  */
 static int dgap_Major_Control_Registered = FALSE;
 static uintdgap_driver_start = FALSE;
-
 static uintdgap_count = 500;
-
 static struct class *  dgap_class;
 
 /*
@@ -123,6 +164,24 @@
 static uintdgap_poll_stop; /* Used to tell 
poller to stop */
 static struct timer_list dgap_poll_timer;
 
+/*
+ SUPPORTED PRODUCTS
+
+ Card Model   Number of Ports  Interface
+ 
+ Acceleport Xem   4 - 64  (EIA232  EIA422)
+ Acceleport Xr4  8   (EIA232)
+ Acceleport Xr 9204  8   (EIA232)
+ Acceleport C/X   8 - 128 (EIA232)
+ Acceleport EPC/X 8 - 224 (EIA232)
+ Acceleport Xr/4224  8   (EIA422)
+ Acceleport 2r/9202   (EIA232)
+ Acceleport 4r/9204   (EIA232)
+ Acceleport 8r/9208   (EIA232)
+
+ IBM 8-Port Asynchronous PCI Adapter  (EIA232)
+ IBM 128-Port Asynchronous PCI Adapter(EIA232  EIA422)
+*/
 
 static struct pci_device_id dgap_pci_tbl[] = {
{   DIGI_VID, PCI_DEVICE_XEM_DID,   PCI_ANY_ID, PCI_ANY_ID, 0, 0,   
0 },
@@ -144,7 +203,6 @@
 };
 MODULE_DEVICE_TABLE(pci, dgap_pci_tbl);
 
-
 /*
  * A generic list of Product names, PCI Vendor ID, and PCI Device ID.
  */
@@ -182,6 

Re: [PATCH] VME: Stop using memcpy_[to|from]io() due to unwanted behaviour

2014-02-12 Thread Martyn Welch

On 12/02/14 16:43, Greg Kroah-Hartman wrote:

On Wed, Feb 12, 2014 at 01:20:33PM +, Martyn Welch wrote:

Hmm, can't see this patch on the mailing list, though get send-mail cc'ed me
and I got it that way. As you've added a later patch that I wrote and not
this one, can I assume that you didn't get it either Greg?


No, I didn't get this patch at all, care to resend it?  I only got the
VME: Correct read/write alignment algorithm patch from what I can
tell.



Resent. Oddly neither patch seems to have reached the mailing list, 
though you have received one of them. Both were sent exactly the same 
way (with git send-email, from the same machine). Confused.


Did you get the patch this time?

Martyn

--
Martyn Welch (Lead Software Engineer)  | Registered in England and Wales
GE Intelligent Platforms   | (3828642) at 100 Barbirolli Square
T +44(0)1327322748 | Manchester, M2 3AB
E martyn.we...@ge.com  | VAT:GB 927559189
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH RFC 05/17] staging: dgap: remove user land dgap_downld.h

2014-02-12 Thread Mark Hounschell
Remove user land dgap_downld.h

Signed-off-by: Mark Hounschell ma...@compro.net
Cc: Greg Kroah-Hartman gre...@linuxfoundation.org

diff -urpN linux-3.13.1-orig/drivers/staging/dgap/dgap_downld.h 
linux-3.13.1-new/drivers/staging/dgap/dgap_downld.h
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_downld.h2014-01-29 
08:06:37.0 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_downld.h 1969-12-31 
19:00:00.0 -0500
@@ -1,69 +0,0 @@
-/*
- * Copyright 2003 Digi International (www.digi.com)
- *  Scott H Kilau Scott_Kilau at digi dot com
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: dgap_downld.h,v 1.1 2009/10/23 14:01:57 markh Exp $
- *
- * NOTE: THIS IS A SHARED HEADER. DO NOT CHANGE CODING STYLE!!!
- *
- */
-
-/*
-** downld.h 
-**  - describes the interface between the user level download process
-**and the concentrator download driver.
-*/
-
-#ifndef _DGAP_DOWNLD_H_
-#define _DGAP_DOWNLD_H_
-
-
-struct fepimg {
-int type;  /* board type */
-intlen;/* length of image */
-char fepimage[1];  /* beginning of image */
-};
-
-struct downldio {
-unsigned int req_type; /* FEP or concentrator */
-unsigned int bdid; /* opaque board identifier */
-union {
-   struct downld_t dl; /* download structure */
-   struct fepimg   fi; /* fep/bios image structure */
-} image;
-};
-
-#define DIGI_DLREQ_GET (('d'8) | 220)
-#define DIGI_DLREQ_SET (('d'8) | 221)
-
-#define DIGI_DL_NUKE(('d'8) | 222) /* Not really a dl request, but
- dangerous enuff to not put in
- digi.h */
-/* Packed bits of intarg for DIGI_DL_NUKE */
-#define DIGI_NUKE_RESET_ALL (1  31)
-#define DIGI_NUKE_INHIBIT_POLLER (1  30)
-#define DIGI_NUKE_BRD_NUMB0x0f
-   
-
-
-#defineDLREQ_BIOS  0
-#defineDLREQ_FEP   1
-#defineDLREQ_CONC  2
-#defineDLREQ_CONFIG3
-#define DLREQ_DEVCREATE 4
-
-#endif



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


[PATCH RFC 07/17] staging: dgap: Merge dgap_parse.h into dgap-driver.h

2014-02-12 Thread Mark Hounschell
Merge dgap_parse.h into dgap-driver.h

Signed-off-by: Mark Hounschell ma...@compro.net
Cc: Greg Kroah-Hartman gre...@linuxfoundation.org

diff -urpN linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.c 
linux-3.13.1-new/drivers/staging/dgap/dgap_driver.c
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.c2014-02-10 
15:39:27.824827207 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_driver.c 2014-02-10 
16:13:01.708232345 -0500
@@ -64,7 +64,6 @@
 #include dgap_pci.h
 #include dgap_tty.h
 #include dgap_conf.h
-#include dgap_parse.h
 #include dgap_trace.h
 #include dgap_sysfs.h
 
diff -urpN linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.h 
linux-3.13.1-new/drivers/staging/dgap/dgap_driver.h
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.h2014-02-10 
15:05:14.805390665 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_driver.h 2014-02-10 
15:59:36.576837789 -0500
@@ -598,6 +598,17 @@ extern wait_queue_head_t dgap_dl_wait;
 extern int dgap_dl_action; /* Action flag for downloader   
*/
 extern int dgap_registerttyswithsysfs; /* Should we register the   
*/
/* ttys with sysfs or not   
*/
+   
+/*
+ * Functions from dgap_parsefile
+ */
+extern int dgap_parsefile(char **in, int Remove);
+extern struct cnode *dgap_find_config(int type, int bus, int slot);
+extern uint dgap_config_get_number_of_ports(struct board_t *bd);
+extern char *dgap_create_config_string(struct board_t *bd, char *string);
+extern char *dgap_get_config_letters(struct board_t *bd, char *string);
+extern uint dgap_config_get_useintr(struct board_t *bd);
+extern uint dgap_config_get_altpin(struct board_t *bd);

 
 /*
  * Global functions declared in dgap_fep5.c, but must be hidden from
diff -urpN linux-3.13.1-orig/drivers/staging/dgap/dgap_parse.h 
linux-3.13.1-new/drivers/staging/dgap/dgap_parse.h
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_parse.h 2014-01-29 
08:06:37.0 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_parse.h  1969-12-31 
19:00:00.0 -0500
@@ -1,35 +0,0 @@
-/*
- * Copyright 2003 Digi International (www.digi.com)
- * Scott H Kilau Scott_Kilau at digi dot com
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * NOTE: THIS IS A SHARED HEADER. DO NOT CHANGE CODING STYLE!!!
- */
-
-#ifndef _DGAP_PARSE_H
-#define _DGAP_PARSE_H
-
-#include dgap_driver.h
-
-extern int dgap_parsefile(char **in, int Remove);
-extern struct cnode *dgap_find_config(int type, int bus, int slot);
-extern uint dgap_config_get_number_of_ports(struct board_t *bd);
-extern char *dgap_create_config_string(struct board_t *bd, char *string);
-extern char *dgap_get_config_letters(struct board_t *bd, char *string);
-extern uint dgap_config_get_useintr(struct board_t *bd);
-extern uint dgap_config_get_altpin(struct board_t *bd);
-
-#endif
diff -urpN linux-3.13.1-orig/drivers/staging/dgap/dgap_sysfs.c 
linux-3.13.1-new/drivers/staging/dgap/dgap_sysfs.c
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_sysfs.c 2014-01-29 
08:06:37.0 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_sysfs.c  2014-02-10 
16:06:15.024308876 -0500
@@ -29,7 +29,7 @@
  *
  *
  * 
- * $Id: dgap_sysfs.c,v 1.1 2009/10/23 14:01:57 markh Exp $   
+ * $Id: dgap_sysfs.c,v 1.1.1.1 2014/01/31 07:33:31 markh Exp $   
  */
 
 
@@ -44,7 +44,6 @@
   
 #include dgap_driver.h
 #include dgap_conf.h
-#include dgap_parse.h
 
 
 static ssize_t dgap_driver_version_show(struct device_driver *ddp, char *buf)
diff -urpN linux-3.13.1-orig/drivers/staging/dgap/dgap_tty.c 
linux-3.13.1-new/drivers/staging/dgap/dgap_tty.c
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_tty.c   2014-02-10 
15:04:58.492436632 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_tty.c2014-02-10 
16:06:28.274003240 -0500
@@ -56,7 +56,6 @@
 #include dgap_driver.h
 #include dgap_tty.h
 #include dgap_types.h
-#include dgap_parse.h
 #include dgap_conf.h
 #include dgap_sysfs.h
 



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


[PATCH RFC 08/17] staging: dgap: Merge dgap_conf.h into dgap-driver.h

2014-02-12 Thread Mark Hounschell
Merge dgap_conf.h into dgap-driver.h

Signed-off-by: Mark Hounschell ma...@compro.net
Cc: Greg Kroah-Hartman gre...@linuxfoundation.org

diff -urpN linux-3.13.1-orig/drivers/staging/dgap/dgap_conf.h 
linux-3.13.1-new/drivers/staging/dgap/dgap_conf.h
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_conf.h  2014-01-29 
08:06:37.0 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_conf.h   1969-12-31 
19:00:00.0 -0500
@@ -1,290 +0,0 @@
-/*
- * Copyright 2003 Digi International (www.digi.com)
- * Scott H Kilau Scott_Kilau at digi dot com
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *
- *
- * dgap_conf.h - Header file for installations and parse files.
- *
- * $Id: dgap_conf.h,v 1.1 2009/10/23 14:01:57 markh Exp $
- *
- * NOTE: THIS IS A SHARED HEADER. DO NOT CHANGE CODING STYLE!!!
- */
-
-#ifndef _DGAP_CONF_H
-#define _DGAP_CONF_H
-
-#define NULLNODE 0 /* header node, not used */
-#define BNODE 1/* Board node */
-#define LNODE 2/* Line node */
-#define CNODE 3/* Concentrator node */
-#define MNODE 4/* EBI Module node */
-#define TNODE 5/* tty name prefix node */
-#defineCUNODE 6/* cu name prefix (non-SCO) */
-#define PNODE 7/* trans. print prefix node */
-#define JNODE 8/* maJor number node */
-#define ANODE 9/* altpin */
-#defineTSNODE 10   /* tty structure size */
-#define CSNODE 11  /* channel structure size */
-#define BSNODE 12  /* board structure size */
-#define USNODE 13  /* unit schedule structure size */
-#define FSNODE 14  /* f2200 structure size */
-#define VSNODE 15  /* size of VPIX structures */
-#define INTRNODE 16/* enable interrupt */
-
-/* Enumeration of tokens */
-#defineBEGIN   1
-#defineEND 2
-#defineBOARD   10
-
-#define EPCFS  11 /* start of EPC family definitions */
-#defineICX 11
-#defineMCX 13
-#define PCX14
-#defineIEPC15
-#defineEEPC16
-#defineMEPC17
-#defineIPCM18
-#defineEPCM19
-#defineMPCM20
-#define PEPC   21
-#define PPCM   22
-#ifdef CP
-#define ICP 23
-#define ECP 24
-#define MCP 25
-#endif
-#define EPCFE  25 /* end of EPC family definitions */
-#definePC2E26
-#definePC4E27
-#definePC4E8K  28
-#definePC8E29
-#definePC8E8K  30
-#definePC16E   31
-#define MC2E8K  34
-#define MC4E8K  35
-#define MC8E8K  36
-
-#define AVANFS 42  /* start of Avanstar family definitions */
-#define A8P42
-#define A16P   43
-#define AVANFE 43  /* end of Avanstar family definitions */
-
-#define DA2000FS   44  /* start of AccelePort 2000 family definitions 
*/
-#define DA22   44 /* AccelePort 2002 */
-#define DA24   45 /* AccelePort 2004 */
-#define DA28   46 /* AccelePort 2008 */
-#define DA216  47 /* AccelePort 2016 */
-#define DAR4   48 /* AccelePort RAS 4 port */
-#define DAR8   49 /* AccelePort RAS 8 port */
-#define DDR24  50 /* DataFire RAS 24 port */
-#define DDR30  51 /* DataFire RAS 30 port */
-#define DDR48  52 /* DataFire RAS 48 port */
-#define DDR60  53 /* DataFire RAS 60 port */
-#define DA2000FE   53 /* end of AccelePort 2000/RAS family definitions */
-
-#define PCXRFS 106 /* start of PCXR family definitions */
-#defineAPORT4  106
-#defineAPORT8  107
-#define PAPORT4 108
-#define PAPORT8 109
-#define APORT4_920I110
-#define APORT8_920I111
-#define APORT4_920P112
-#define APORT8_920P113
-#define APORT2_920P 114
-#define PCXRFE 117 /* end of PCXR family definitions */
-
-#defineLINE82
-#ifdef T1
-#define T1M83
-#define E1M84
-#endif
-#defineCONC64
-#defineCX  65
-#defineEPC 66
-#defineMOD 67
-#definePORTS   68
-#define METHOD 69
-#define CUSTOM 70
-#define BASIC  71

[PATCH RFC 09/17] staging: dgap: Merge digi.h into dgap_driver.h

2014-02-12 Thread Mark Hounschell
Merge digi.h into dgap_driver.h

Signed-off-by: Mark Hounschell ma...@compro.net
Cc: Greg Kroah-Hartman gre...@linuxfoundation.org

diff -urpN linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.h 
linux-3.13.1-new/drivers/staging/dgap/dgap_driver.h
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.h2014-02-10 
16:27:13.371869098 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_driver.h 2014-02-10 
16:59:46.233442157 -0500
@@ -33,7 +33,6 @@
 #include linux/interrupt.h/* For irqreturn_t type */
 
 #include dgap_types.h /* Additional types needed by the Digi header 
files */
-#include digi.h   /* Digi specific ioctl header */
 #include dgap_kcompat.h   /* Kernel 2.4/2.6 compat includes */
 #include dgap_sysfs.h/* Support for SYSFS */
 
@@ -66,6 +65,356 @@
 
 #define TRC_TO_CONSOLE 1
 
+/
+ ***   Definitions for Digi ditty(1) command.
+ /
+
+
+/*
+ * Copyright (c) 1988-96 Digi International Inc., All Rights Reserved.
+ */
+
+/
+ * This module provides application access to special Digi
+ * serial line enhancements which are not standard UNIX(tm) features.
+ /
+
+#if !defined(TIOCMODG)
+
+#defineTIOCMODG('d'8) | 250  /* get modem ctrl state 
*/
+#defineTIOCMODS('d'8) | 251  /* set modem ctrl state 
*/
+
+#ifndef TIOCM_LE 
+#defineTIOCM_LE0x01/* line enable  
*/
+#defineTIOCM_DTR   0x02/* data terminal ready  
*/
+#defineTIOCM_RTS   0x04/* request to send  
*/
+#defineTIOCM_ST0x08/* secondary transmit   
*/
+#defineTIOCM_SR0x10/* secondary receive
*/
+#defineTIOCM_CTS   0x20/* clear to send
*/
+#defineTIOCM_CAR   0x40/* carrier detect   
*/
+#defineTIOCM_RNG   0x80/* ring indicator   
*/
+#defineTIOCM_DSR   0x100   /* data set ready   
*/
+#defineTIOCM_RITIOCM_RNG   /* ring (alternate) 
*/
+#defineTIOCM_CDTIOCM_CAR   /* carrier detect (alt) 
*/
+#endif
+
+#endif
+
+#if !defined(TIOCMSET)
+#defineTIOCMSET('d'8) | 252  /* set modem ctrl state 
*/
+#defineTIOCMGET('d'8) | 253  /* set modem ctrl state 
*/
+#endif
+
+#if !defined(TIOCMBIC)
+#defineTIOCMBIC('d'8) | 254  /* set modem ctrl state 
*/
+#defineTIOCMBIS('d'8) | 255  /* set modem ctrl state 
*/
+#endif
+
+
+#if !defined(TIOCSDTR)
+#defineTIOCSDTR('e'8) | 0/* set DTR  
*/
+#defineTIOCCDTR('e'8) | 1/* clear DTR
*/
+#endif
+
+/
+ * Ioctl command arguments for DIGI parameters.
+ /
+#define DIGI_GETA  ('e'8) | 94   /* Read params  */
+
+#define DIGI_SETA  ('e'8) | 95   /* Set params   */
+#define DIGI_SETAW ('e'8) | 96   /* Drain  set params   */
+#define DIGI_SETAF ('e'8) | 97   /* Drain, flush  set params */
+
+#define DIGI_KME   ('e'8) | 98   /* Read/Write Host  */
+   /* Adapter Memory   */
+
+#defineDIGI_GETFLOW('e'8) | 99   /* Get startc/stopc 
flow */
+   /* control characters*/
+#defineDIGI_SETFLOW('e'8) | 100  /* Set startc/stopc 
flow */
+   /* control characters*/
+#defineDIGI_GETAFLOW   ('e'8) | 101  /* Get Aux. 
startc/stopc */
+   /* flow control chars*/
+#defineDIGI_SETAFLOW   ('e'8) | 102  /* Set Aux. 
startc/stopc */
+   /* flow control chars*/
+
+#define DIGI_GEDELAY   ('d'8) | 246  /* Get edelay */
+#define DIGI_SEDELAY   ('d'8) | 247  /* Set edelay */
+
+struct digiflow_t {
+   unsigned char   startc; /* flow cntl start char 
*/
+   unsigned char   stopc;  /* flow cntl stop char  
*/
+};
+
+
+#ifdef FLOW_2200
+#defineF2200_GETA  ('e'8) | 104  /* Get 2x36 flow cntl 
flags */
+#defineF2200_SETAW ('e'8) | 105  /* Set 2x36 flow cntl 
flags */
+#define   

[PATCH RFC 10/17] staging: dgap: Merge dgap_pci.h into dgap_driver.h

2014-02-12 Thread Mark Hounschell
Merge dgap_pci.h into dgap_driver.h

Signed-off-by: Mark Hounschell ma...@compro.net
Cc: Greg Kroah-Hartman gre...@linuxfoundation.org

diff -urpN linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.c 
linux-3.13.1-new/drivers/staging/dgap/dgap_driver.c
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.c2014-02-10 
16:27:48.504390913 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_driver.c 2014-02-11 
08:01:11.449483884 -0500
@@ -61,7 +61,6 @@
 #include linux/ctype.h
 
 #include dgap_driver.h
-#include dgap_pci.h
 #include dgap_tty.h
 #include dgap_trace.h
 #include dgap_sysfs.h
diff -urpN linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.h 
linux-3.13.1-new/drivers/staging/dgap/dgap_driver.h
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.h2014-02-10 
16:59:46.233442157 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_driver.h 2014-02-11 
07:57:51.427456456 -0500
@@ -66,6 +66,74 @@
 #define TRC_TO_CONSOLE 1
 
 /
+ * Stuff from dgap_pci.h
+ /
+#define PCIMAX 32  /* maximum number of PCI boards */
+
+#define DIGI_VID   0x114F
+
+#define PCI_DEVICE_EPC_DID 0x0002
+#define PCI_DEVICE_XEM_DID 0x0004
+#define PCI_DEVICE_XR_DID  0x0005
+#define PCI_DEVICE_CX_DID  0x0006
+#define PCI_DEVICE_XRJ_DID 0x0009  /* PLX-based Xr adapter */
+#define PCI_DEVICE_XR_IBM_DID  0x0011  /* IBM 8-port Async Adapter */
+#define PCI_DEVICE_XR_BULL_DID 0x0013  /* BULL 8-port Async Adapter */
+#define PCI_DEVICE_XR_SAIP_DID 0x001c  /* SAIP card - Xr adapter */
+#define PCI_DEVICE_XR_422_DID  0x0012  /* Xr-422 */
+#define PCI_DEVICE_920_2_DID   0x0034  /* XR-Plus 920 K, 2 port */
+#define PCI_DEVICE_920_4_DID   0x0026  /* XR-Plus 920 K, 4 port */
+#define PCI_DEVICE_920_8_DID   0x0027  /* XR-Plus 920 K, 8 port */
+#define PCI_DEVICE_EPCJ_DID0x000a  /* PLX 9060 chip for PCI  */
+#define PCI_DEVICE_CX_IBM_DID  0x001b  /* IBM 128-port Async Adapter */
+#define PCI_DEVICE_920_8_HP_DID0x0058  /* HP XR-Plus 920 K, 8 port */
+#define PCI_DEVICE_XEM_HP_DID  0x0059  /* HP Xem PCI */
+
+#define PCI_DEVICE_XEM_NAMEAccelePort XEM
+#define PCI_DEVICE_CX_NAME AccelePort CX
+#define PCI_DEVICE_XR_NAME AccelePort Xr
+#define PCI_DEVICE_XRJ_NAMEAccelePort Xr (PLX)
+#define PCI_DEVICE_XR_SAIP_NAMEAccelePort Xr (SAIP)
+#define PCI_DEVICE_920_2_NAME  AccelePort Xr920 2 port
+#define PCI_DEVICE_920_4_NAME  AccelePort Xr920 4 port
+#define PCI_DEVICE_920_8_NAME  AccelePort Xr920 8 port
+#define PCI_DEVICE_XR_422_NAME AccelePort Xr 422
+#define PCI_DEVICE_EPCJ_NAME   AccelePort EPC (PLX)
+#define PCI_DEVICE_XR_BULL_NAMEAccelePort Xr (BULL)
+#define PCI_DEVICE_XR_IBM_NAME AccelePort Xr (IBM)
+#define PCI_DEVICE_CX_IBM_NAME AccelePort CX (IBM)
+#define PCI_DEVICE_920_8_HP_NAME AccelePort Xr920 8 port (HP)
+#define PCI_DEVICE_XEM_HP_NAME AccelePort XEM (HP)
+
+
+/*
+ * On the PCI boards, there is no IO space allocated
+ * The I/O registers will be in the first 3 bytes of the
+ * upper 2MB of the 4MB memory space.  The board memory
+ * will be mapped into the low 2MB of the 4MB memory space
+ */
+
+/* Potential location of PCI Bios from E to F*/
+#define PCI_BIOS_SIZE  0x0002
+
+/* Size of Memory and I/O for PCI (4MB) */
+#define PCI_RAM_SIZE   0x0040
+
+/* Size of Memory (2MB) */
+#define PCI_MEM_SIZE   0x0020
+
+/* Max PCI Window Size (2MB) */
+#define PCI_WIN_SIZE   0x0020
+
+#define PCI_WIN_SHIFT  21 /* 21 bits max */
+
+/* Offset of I/0 in Memory (2MB) */
+#define PCI_IO_OFFSET  0x0020
+
+/* Size of IO (2MB) */
+#define PCI_IO_SIZE0x0020
+
+/
  ***   Definitions for Digi ditty(1) command.
  /
 
diff -urpN linux-3.13.1-orig/drivers/staging/dgap/dgap_pci.h 
linux-3.13.1-new/drivers/staging/dgap/dgap_pci.h
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_pci.h   2014-01-29 
08:06:37.0 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_pci.h1969-12-31 
19:00:00.0 -0500
@@ -1,92 +0,0 @@
-/*
- * Copyright 2003 Digi International (www.digi.com)
- * Scott H Kilau Scott_Kilau at digi dot com
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a 

[PATCH RFC 13/17] staging: dgap: Merge dgap_sysfs.c into dgap_driver.c

2014-02-12 Thread Mark Hounschell
Merge dgap_sysfs.c into dgap_driver.c

Signed-off-by: Mark Hounschell ma...@compro.net
Cc: Greg Kroah-Hartman gre...@linuxfoundation.org

diff -urpN linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.c 
linux-3.13.1-new/drivers/staging/dgap/dgap_driver.c
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.c2014-02-11 
09:03:36.616023262 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_driver.c 2014-02-11 
09:13:15.812797508 -0500
@@ -64,6 +64,10 @@
 #include asm/uaccess.h/* For copy_from_user/copy_to_user */
 #include asm/io.h /* For read[bwl]/write[bwl] */
 
+#include linux/string.h
+#include linux/device.h
+#include linux/kdev_t.h
+
 
 #include dgap_driver.h
 #include dgap_trace.h
@@ -7854,3 +7858,747 @@ static int dgap_tty_ioctl(struct tty_str
return(-ENOIOCTLCMD);
}
 }
+static ssize_t dgap_driver_version_show(struct device_driver *ddp, char *buf)
+{
+   return snprintf(buf, PAGE_SIZE, %s\n, DG_PART);
+}
+static DRIVER_ATTR(version, S_IRUSR, dgap_driver_version_show, NULL);
+
+
+static ssize_t dgap_driver_boards_show(struct device_driver *ddp, char *buf)
+{
+   return snprintf(buf, PAGE_SIZE, %d\n, dgap_NumBoards);
+}
+static DRIVER_ATTR(boards, S_IRUSR, dgap_driver_boards_show, NULL);
+
+
+static ssize_t dgap_driver_maxboards_show(struct device_driver *ddp, char *buf)
+{
+   return snprintf(buf, PAGE_SIZE, %d\n, MAXBOARDS);
+}
+static DRIVER_ATTR(maxboards, S_IRUSR, dgap_driver_maxboards_show, NULL);
+
+
+static ssize_t dgap_driver_pollcounter_show(struct device_driver *ddp, char 
*buf)
+{
+   return snprintf(buf, PAGE_SIZE, %ld\n, dgap_poll_counter);
+}
+static DRIVER_ATTR(pollcounter, S_IRUSR, dgap_driver_pollcounter_show, NULL);
+
+
+static ssize_t dgap_driver_state_show(struct device_driver *ddp, char *buf)
+{
+   return snprintf(buf, PAGE_SIZE, %s\n, 
dgap_driver_state_text[dgap_driver_state]);
+}
+static DRIVER_ATTR(state, S_IRUSR, dgap_driver_state_show, NULL);
+
+
+static ssize_t dgap_driver_debug_show(struct device_driver *ddp, char *buf)
+{
+   return snprintf(buf, PAGE_SIZE, 0x%x\n, dgap_debug);
+}
+
+static ssize_t dgap_driver_debug_store(struct device_driver *ddp, const char 
*buf, size_t count)
+{
+   sscanf(buf, 0x%x\n, dgap_debug);
+   return count;
+}
+static DRIVER_ATTR(debug, (S_IRUSR | S_IWUSR), dgap_driver_debug_show, 
dgap_driver_debug_store);
+
+
+static ssize_t dgap_driver_rawreadok_show(struct device_driver *ddp, char *buf)
+{
+   return snprintf(buf, PAGE_SIZE, 0x%x\n, dgap_rawreadok);
+}
+
+static ssize_t dgap_driver_rawreadok_store(struct device_driver *ddp, const 
char *buf, size_t count)
+{
+   sscanf(buf, 0x%x\n, dgap_rawreadok);
+   return count;
+}
+static DRIVER_ATTR(rawreadok, (S_IRUSR | S_IWUSR), dgap_driver_rawreadok_show, 
dgap_driver_rawreadok_store);
+
+
+static ssize_t dgap_driver_pollrate_show(struct device_driver *ddp, char *buf)
+{
+   return snprintf(buf, PAGE_SIZE, %dms\n, dgap_poll_tick);
+}
+
+static ssize_t dgap_driver_pollrate_store(struct device_driver *ddp, const 
char *buf, size_t count)
+{
+   sscanf(buf, %d\n, dgap_poll_tick);
+   return count;
+}
+static DRIVER_ATTR(pollrate, (S_IRUSR | S_IWUSR), dgap_driver_pollrate_show, 
dgap_driver_pollrate_store);
+
+
+void dgap_create_driver_sysfiles(struct pci_driver *dgap_driver)
+{
+   int rc = 0;
+   struct device_driver *driverfs = dgap_driver-driver;
+
+   rc |= driver_create_file(driverfs, driver_attr_version);
+   rc |= driver_create_file(driverfs, driver_attr_boards);
+   rc |= driver_create_file(driverfs, driver_attr_maxboards);
+   rc |= driver_create_file(driverfs, driver_attr_debug);
+   rc |= driver_create_file(driverfs, driver_attr_rawreadok); 
+   rc |= driver_create_file(driverfs, driver_attr_pollrate);
+   rc |= driver_create_file(driverfs, driver_attr_pollcounter);
+   rc |= driver_create_file(driverfs, driver_attr_state);
+   if (rc) {
+   printk(KERN_ERR DGAP: sysfs driver_create_file failed!\n);
+   }
+}
+
+
+void dgap_remove_driver_sysfiles(struct pci_driver *dgap_driver)
+{
+   struct device_driver *driverfs = dgap_driver-driver;
+   driver_remove_file(driverfs, driver_attr_version);
+   driver_remove_file(driverfs, driver_attr_boards);
+   driver_remove_file(driverfs, driver_attr_maxboards);
+   driver_remove_file(driverfs, driver_attr_debug);
+   driver_remove_file(driverfs, driver_attr_rawreadok);
+   driver_remove_file(driverfs, driver_attr_pollrate);
+   driver_remove_file(driverfs, driver_attr_pollcounter);
+   driver_remove_file(driverfs, driver_attr_state);
+}
+
+
+#define DGAP_VERIFY_BOARD(p, bd)   \
+   if (!p) \
+   return (0); \
+   \
+   bd = dev_get_drvdata(p);\
+   if (!bd || 

[PATCH RFC 14/17] staging: dgap: Merge dgap_sysfs.h into dgap_driver.h

2014-02-12 Thread Mark Hounschell
Merge dgap_sysfs.h into dgap_driver.h

Signed-off-by: Mark Hounschell ma...@compro.net
Cc: Greg Kroah-Hartman gre...@linuxfoundation.org

diff -urpN linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.c 
linux-3.13.1-new/drivers/staging/dgap/dgap_driver.c
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.c2014-02-11 
09:13:15.812797508 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_driver.c 2014-02-11 
09:33:16.665283807 -0500
@@ -71,7 +71,6 @@
 
 #include dgap_driver.h
 #include dgap_trace.h
-#include dgap_sysfs.h
 
 #include dgap_types.h
 
@@ -202,6 +201,16 @@ static const struct tty_operations dgap_
.send_xchar = dgap_tty_send_xchar
 };
 
+/*
+ * Function prototypes from dgap_sysfs.h
+ */
+static void dgap_create_ports_sysfiles(struct board_t *bd);
+static void dgap_remove_ports_sysfiles(struct board_t *bd);
+static void dgap_create_driver_sysfiles(struct pci_driver *);
+static void dgap_remove_driver_sysfiles(struct pci_driver *);
+static void dgap_create_tty_sysfs(struct un_t *un, struct device *c);
+static void dgap_remove_tty_sysfs(struct device *c);
+
 #ifdef DIGI_CONCENTRATORS_SUPPORTED
 static void dgap_do_conc_load(struct board_t *brd, uchar *uaddr, 
int len);
 #endif
@@ -7932,7 +7941,7 @@ static ssize_t dgap_driver_pollrate_stor
 static DRIVER_ATTR(pollrate, (S_IRUSR | S_IWUSR), dgap_driver_pollrate_show, 
dgap_driver_pollrate_store);
 
 
-void dgap_create_driver_sysfiles(struct pci_driver *dgap_driver)
+static void dgap_create_driver_sysfiles(struct pci_driver *dgap_driver)
 {
int rc = 0;
struct device_driver *driverfs = dgap_driver-driver;
@@ -7951,7 +7960,7 @@ void dgap_create_driver_sysfiles(struct
 }
 
 
-void dgap_remove_driver_sysfiles(struct pci_driver *dgap_driver)
+static void dgap_remove_driver_sysfiles(struct pci_driver *dgap_driver)
 {
struct device_driver *driverfs = dgap_driver-driver;
driver_remove_file(driverfs, driver_attr_version);
@@ -8161,7 +8170,7 @@ static DEVICE_ATTR(ports_txcount, S_IRUS
 /* this function creates the sys files that will export each signal status
  * to sysfs each value will be put in a separate filename
  */
-void dgap_create_ports_sysfiles(struct board_t *bd)
+static void dgap_create_ports_sysfiles(struct board_t *bd)
 {
int rc = 0;
 
@@ -8183,7 +8192,7 @@ void dgap_create_ports_sysfiles(struct b
 
 
 /* removes all the sys files created for that port */
-void dgap_remove_ports_sysfiles(struct board_t *bd)
+static void dgap_remove_ports_sysfiles(struct board_t *bd)
 {
device_remove_file((bd-pdev-dev), dev_attr_ports_state);
device_remove_file((bd-pdev-dev), dev_attr_ports_baud);
@@ -8582,7 +8591,7 @@ static struct attribute_group dgap_tty_a
 
 
 
-void dgap_create_tty_sysfs(struct un_t *un, struct device *c)
+static void dgap_create_tty_sysfs(struct un_t *un, struct device *c)
 {
int ret;
 
@@ -8598,7 +8607,7 @@ void dgap_create_tty_sysfs(struct un_t *
 }
 
 
-void dgap_remove_tty_sysfs(struct device *c)
+static void dgap_remove_tty_sysfs(struct device *c)
 {
sysfs_remove_group(c-kobj, dgap_tty_attribute_group);
 }
diff -urpN linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.h 
linux-3.13.1-new/drivers/staging/dgap/dgap_driver.h
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.h2014-02-11 
08:56:53.758605000 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_driver.h 2014-02-11 
09:34:25.247042563 -0500
@@ -34,7 +34,6 @@
 
 #include dgap_types.h /* Additional types needed by the Digi header 
files */
 #include dgap_kcompat.h   /* Kernel 2.4/2.6 compat includes */
-#include dgap_sysfs.h/* Support for SYSFS */
 
 /*
  *
diff -urpN linux-3.13.1-orig/drivers/staging/dgap/dgap_sysfs.h 
linux-3.13.1-new/drivers/staging/dgap/dgap_sysfs.h
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_sysfs.h 2014-01-29 
08:06:37.0 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_sysfs.h  1969-12-31 
19:00:00.0 -0500
@@ -1,48 +0,0 @@
-/*
- * Copyright 2003 Digi International (www.digi.com)
- * Scott H Kilau Scott_Kilau at digi dot com
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software

[PATCH RFC 16/17] staging: dgap: Remove dgap_kcompat.h and_dgap_types.h

2014-02-12 Thread Mark Hounschell
Remove dgap_kcompat.h and_dgap_types.h

Signed-off-by: Mark Hounschell ma...@compro.net
Cc: Greg Kroah-Hartman gre...@linuxfoundation.org

diff -urpN linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.c 
linux-3.13.1-new/drivers/staging/dgap/dgap_driver.c
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.c2014-02-11 
09:55:35.298027046 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_driver.c 2014-02-11 
10:07:00.122346031 -0500
@@ -69,8 +69,6 @@
 #include linux/kdev_t.h
 
 #include dgap_driver.h
-#include dgap_types.h
-
 
 /*
  * Function prototypes.
diff -urpN linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.h 
linux-3.13.1-new/drivers/staging/dgap/dgap_driver.h
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.h2014-02-11 
09:34:25.247042563 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_driver.h 2014-02-11 
10:17:49.137517346 -0500
@@ -32,8 +32,15 @@
 #include linux/tty.h  /* To pick up the various tty structs/defines 
*/
 #include linux/interrupt.h/* For irqreturn_t type */
 
-#include dgap_types.h /* Additional types needed by the Digi header 
files */
-#include dgap_kcompat.h   /* Kernel 2.4/2.6 compat includes */
+#if !defined(TTY_FLIPBUF_SIZE)
+# define TTY_FLIPBUF_SIZE 512
+#endif
+
+#define PARM_INT(VAR, INIT, PERM, DESC) \
+   static int VAR = INIT; \
+   int dgap_##VAR; \
+   module_param(VAR, int, PERM); \
+   MODULE_PARM_DESC(VAR, DESC);
 
 /*
  *
@@ -64,6 +71,17 @@
 
 #define TRC_TO_CONSOLE 1
 
+#ifndef TRUE
+# define TRUE 1
+#endif
+
+#ifndef FALSE
+# define FALSE 0
+#endif
+
+/* Required for our shared headers! */
+typedef unsigned char   uchar;
+
 /
  * Stuff from dgap_pci.h
  /
diff -urpN linux-3.13.1-orig/drivers/staging/dgap/dgap_kcompat.h 
linux-3.13.1-new/drivers/staging/dgap/dgap_kcompat.h
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_kcompat.h   2014-01-29 
08:06:37.0 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_kcompat.h1969-12-31 
19:00:00.0 -0500
@@ -1,64 +0,0 @@
-/*
- * Copyright 2004 Digi International (www.digi.com)
- *  Scott H Kilau Scott_Kilau at digi dot com
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * NOTE: THIS IS A SHARED HEADER. DO NOT CHANGE CODING STYLE!!!
- *
- *
- *
- * This file is intended to contain all the kernel differences between the
- * various kernels that we support.
- *
- */
-
-#ifndef __DGAP_KCOMPAT_H
-#define __DGAP_KCOMPAT_H
-
-#if !defined(TTY_FLIPBUF_SIZE)
-# define TTY_FLIPBUF_SIZE 512
-#endif
-
-
-/* Sparse stuff */
-# ifndef __user
-#  define __user
-#  define __kernel
-#  define __safe
-#  define __force
-#  define __chk_user_ptr(x) (void)0
-# endif
-
-
-#  define PARM_STR(VAR, INIT, PERM, DESC) \
-   static char *VAR = INIT; \
-   char *dgap_##VAR; \
-   module_param(VAR, charp, PERM); \
-   MODULE_PARM_DESC(VAR, DESC);
-
-#  define PARM_INT(VAR, INIT, PERM, DESC) \
-   static int VAR = INIT; \
-   int dgap_##VAR; \
-   module_param(VAR, int, PERM); \
-   MODULE_PARM_DESC(VAR, DESC);
-
-#  define PARM_ULONG(VAR, INIT, PERM, DESC) \
-   static ulong VAR = INIT; \
-   ulong dgap_##VAR; \
-   module_param(VAR, long, PERM); \
-   MODULE_PARM_DESC(VAR, DESC);
-
-#endif /* ! __DGAP_KCOMPAT_H */
diff -urpN linux-3.13.1-orig/drivers/staging/dgap/dgap_types.h 
linux-3.13.1-new/drivers/staging/dgap/dgap_types.h
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_types.h 2014-01-29 
08:06:37.0 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_types.h  1969-12-31 
19:00:00.0 -0500
@@ -1,36 +0,0 @@
-/*
- * Copyright 2003 Digi International (www.digi.com)
- * Scott H Kilau Scott_Kilau at digi dot com
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU 

RE: [PATCH 34/47 v2] staging: comedi: icp_multi: use comedi_timeout()

2014-02-12 Thread Hartley Sweeten
On Wednesday, February 12, 2014 10:15 AM, Greg KH wrote:
 On Mon, Feb 10, 2014 at 11:49:33AM -0700, H Hartley Sweeten wrote:
 Use comedi_timeout() to wait for the analog input and output end-of-
 conversion.
 
 Use break to exit the loop when a timeout occurs during the analog
 input read so that common code can be used to disable the device.

snip

 How come these writew() calls are removed?  Don't we still need to do
 them in failure mode?

The break causes the common exit code to be used to disable the interrupt
and clear the interrupt status when a timeout occurs.

Regards,
Hartley

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


Re: [PATCH RFC 01/17] staging: dgap: Merge dgap_fep5.c into dgap_driver.c

2014-02-12 Thread Greg Kroah-Hartman
On Wed, Feb 12, 2014 at 12:44:43PM -0500, Mark Hounschell wrote:
 Merge dgap_fep5.c into dgap_driver.c
 
 Signed-off-by: Mark Hounschell ma...@compro.net
 Cc: Greg Kroah-Hartman gre...@linuxfoundation.org

A good changelog comment doesn't just say what happens, but _why_ it is
happening.

Why are you merging these files?

 
 diff -urN linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.c 
 linux-3.13.1-new/drivers/staging/dgap/dgap_driver.c
 --- linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.c  2014-01-29 
 08:06:37.0 -0500
 +++ linux-3.13.1-new/drivers/staging/dgap/dgap_driver.c   2014-01-31 
 10:22:53.675819451 -0500

Did you generate this with git?  What happened to the diffstat?

thanks,

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


Re: [PATCH RFC 02/17] staging: dgap: Merge dgap_fep5.h into dgap_driver.h

2014-02-12 Thread Greg Kroah-Hartman
On Wed, Feb 12, 2014 at 12:46:31PM -0500, Mark Hounschell wrote:
 Merge dgap_fep5.h into dgap_driver.h
 
 Signed-off-by: Mark Hounschell ma...@compro.net
 Cc: Greg Kroah-Hartman gre...@linuxfoundation.org

Same here, why merge these files?

thanks,

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


Re: [PATCH RFC 04/17] staging: dgap: Add in kernel firmware loading support

2014-02-12 Thread Greg Kroah-Hartman
On Wed, Feb 12, 2014 at 12:49:46PM -0500, Mark Hounschell wrote:
 Add in kernel firmware loading support
 
 Signed-off-by: Mark Hounschell ma...@compro.net
 Cc: Greg Kroah-Hartman gre...@linuxfoundation.org

You also do other things in this patch, like coding style cleanups,
right?

That's fine for a staging driver, but it makes it hard to review, so you
should probably break this up into pieces (i.e. one that only does the
firmare stuff, and one that does the coding style stuff.

 
 diff -urN linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.c 
 linux-3.13.1-new/drivers/staging/dgap/dgap_driver.c
 --- linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.c  2014-02-03 
 13:34:50.489287314 -0500
 +++ linux-3.13.1-new/drivers/staging/dgap/dgap_driver.c   2014-02-03 
 14:12:20.059076489 -0500
 @@ -18,6 +18,33 @@
   *
   */
  
 +/*
 + *  In the original out of kernel Digi dgap driver, firmware
 + *  loading was done via user land to driver handshaking.
 + *
 + *  For cards that support a concentrator (port expander),
 + *  I believe the concentrator its self told the card which
 + *  concentrator is actually attached and then that info
 + *  was used to tell user land which concentrator firmware
 + *  image was to be downloaded. I think even the BIOS or
 + *  FEP images required would change with the connection
 + *  of a particular concentrator. 
 + *
 + *  Since I have no access to any of these cards or
 + *  concentrators, I cannot put the correct concentrator
 + *  firmware file names into the firmware_info structure
 + *  as is now done for the BIOS and FEP images. 

Trailing spaces on these paragraphs, checkpatch.pl should have
complained about this.

thanks,

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


[PATCH] VME: Stop using memcpy_[to|from]io() due to unwanted behaviour

2014-02-12 Thread Martyn Welch
The ca91cx42 and tsi148 VME bridges use the width of reads and writes on the
PCI bus in part to control the width of the cycles on the VME bus. It is
important that we can control the width of cycles on the VME bus as some VME
hardware requires cycles of a specific width. The memcpy_toio() and
memcpy_fromio() functions do not provide sufficient control, so instead loop
using ioread functions.

Reported-by: Michael Kenney mfken...@gmail.com
Signed-off-by: Martyn Welch martyn.we...@ge.com
---
 drivers/vme/bridges/vme_ca91cx42.c |   29 ++---
 drivers/vme/bridges/vme_tsi148.c   |   18 +-
 2 files changed, 23 insertions(+), 24 deletions(-)

diff --git a/drivers/vme/bridges/vme_ca91cx42.c 
b/drivers/vme/bridges/vme_ca91cx42.c
index a06edbf..92b5719 100644
--- a/drivers/vme/bridges/vme_ca91cx42.c
+++ b/drivers/vme/bridges/vme_ca91cx42.c
@@ -869,14 +869,13 @@ static ssize_t ca91cx42_master_read(struct 
vme_master_resource *image,
 
spin_lock(image-lock);
 
-   /* The following code handles VME address alignment problem
-* in order to assure the maximal data width cycle.
-* We cannot use memcpy_xxx directly here because it
-* may cut data transfer in 8-bits cycles, thus making
-* D16 cycle impossible.
-* From the other hand, the bridge itself assures that
-* maximal configured data cycle is used and splits it
-* automatically for non-aligned addresses.
+   /* The following code handles VME address alignment. We cannot use
+* memcpy_xxx here because it may cut data transfers in to 8-bit
+* cycles when D16 or D32 cycles are required on the VME bus.
+* On the other hand, the bridge itself assures that the maximum data
+* cycle configured for the transfer is used and splits it
+* automatically for non-aligned addresses, so we don't want the
+* overhead of needlessly forcing small transfers for the entire cycle.
 */
if ((uintptr_t)addr  0x1) {
*(u8 *)buf = ioread8(addr);
@@ -896,9 +895,9 @@ static ssize_t ca91cx42_master_read(struct 
vme_master_resource *image,
}
 
count32 = (count - done)  ~0x3;
-   if (count32  0) {
-   memcpy_fromio(buf + done, addr + done, (unsigned int)count);
-   done += count32;
+   while (done  count32) {
+   *(u32 *)(buf + done) = ioread32(addr + done);
+   done += 4;
}
 
if ((count - done)  0x2) {
@@ -930,7 +929,7 @@ static ssize_t ca91cx42_master_write(struct 
vme_master_resource *image,
spin_lock(image-lock);
 
/* Here we apply for the same strategy we do in master_read
-* function in order to assure D16 cycle when required.
+* function in order to assure the correct cycles.
 */
if ((uintptr_t)addr  0x1) {
iowrite8(*(u8 *)buf, addr);
@@ -950,9 +949,9 @@ static ssize_t ca91cx42_master_write(struct 
vme_master_resource *image,
}
 
count32 = (count - done)  ~0x3;
-   if (count32  0) {
-   memcpy_toio(addr + done, buf + done, count32);
-   done += count32;
+   while (done  count32) {
+   iowrite32(*(u32 *)(buf + done), addr + done);
+   done += 4;
}
 
if ((count - done)  0x2) {
diff --git a/drivers/vme/bridges/vme_tsi148.c b/drivers/vme/bridges/vme_tsi148.c
index 16830d8..21ac513 100644
--- a/drivers/vme/bridges/vme_tsi148.c
+++ b/drivers/vme/bridges/vme_tsi148.c
@@ -1276,8 +1276,8 @@ static ssize_t tsi148_master_read(struct 
vme_master_resource *image, void *buf,
spin_lock(image-lock);
 
/* The following code handles VME address alignment. We cannot use
-* memcpy_xxx directly here because it may cut small data transfers in
-* to 8-bit cycles, thus making D16 cycle impossible.
+* memcpy_xxx here because it may cut data transfers in to 8-bit
+* cycles when D16 or D32 cycles are required on the VME bus.
 * On the other hand, the bridge itself assures that the maximum data
 * cycle configured for the transfer is used and splits it
 * automatically for non-aligned addresses, so we don't want the
@@ -1301,9 +1301,9 @@ static ssize_t tsi148_master_read(struct 
vme_master_resource *image, void *buf,
}
 
count32 = (count - done)  ~0x3;
-   if (count32  0) {
-   memcpy_fromio(buf + done, addr + done, count32);
-   done += count32;
+   while (done  count32) {
+   *(u32 *)(buf + done) = ioread32(addr + done);
+   done += 4;
}
 
if ((count - done)  0x2) {
@@ -1363,7 +1363,7 @@ static ssize_t tsi148_master_write(struct 
vme_master_resource *image, void *buf,
spin_lock(image-lock);
 
/* Here we apply for the same strategy we do in master_read
-* function in order to assure D16 cycle when required.
+  

Re: [PATCH RFC 02/17] staging: dgap: Merge dgap_fep5.h into dgap_driver.h

2014-02-12 Thread Mark Hounschell
On 02/12/2014 01:40 PM, Greg Kroah-Hartman wrote:
 On Wed, Feb 12, 2014 at 12:46:31PM -0500, Mark Hounschell wrote:
 Merge dgap_fep5.h into dgap_driver.h

 Signed-off-by: Mark Hounschell ma...@compro.net
 Cc: Greg Kroah-Hartman gre...@linuxfoundation.org
 
 Same here, why merge these files?
 

There is a lot of cleanup work to do on these digi drivers and it will
make it easier. I also notice that many merged drivers are single source
and header. I thought it was the right thing to do.

Regards
Mark

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


Re: [PATCH RFC 04/17] staging: dgap: Add in kernel firmware loading support

2014-02-12 Thread Mark Hounschell
On 02/12/2014 01:41 PM, Greg Kroah-Hartman wrote:
 On Wed, Feb 12, 2014 at 12:49:46PM -0500, Mark Hounschell wrote:
 Add in kernel firmware loading support

 Signed-off-by: Mark Hounschell ma...@compro.net
 Cc: Greg Kroah-Hartman gre...@linuxfoundation.org
 
 You also do other things in this patch, like coding style cleanups,
 right?
 

Yes, and there is a lot more. I just hit the ones right in front of me.

 That's fine for a staging driver, but it makes it hard to review, so you
 should probably break this up into pieces (i.e. one that only does the
 firmare stuff, and one that does the coding style stuff.
 

Understood.


 diff -urN linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.c 
 linux-3.13.1-new/drivers/staging/dgap/dgap_driver.c
 --- linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.c 2014-02-03 
 13:34:50.489287314 -0500
 +++ linux-3.13.1-new/drivers/staging/dgap/dgap_driver.c  2014-02-03 
 14:12:20.059076489 -0500
 @@ -18,6 +18,33 @@
   *
   */
  
 +/*
 + *  In the original out of kernel Digi dgap driver, firmware
 + *  loading was done via user land to driver handshaking.
 + *
 + *  For cards that support a concentrator (port expander),
 + *  I believe the concentrator its self told the card which
 + *  concentrator is actually attached and then that info
 + *  was used to tell user land which concentrator firmware
 + *  image was to be downloaded. I think even the BIOS or
 + *  FEP images required would change with the connection
 + *  of a particular concentrator. 
 + *
 + *  Since I have no access to any of these cards or
 + *  concentrators, I cannot put the correct concentrator
 + *  firmware file names into the firmware_info structure
 + *  as is now done for the BIOS and FEP images. 
 
 Trailing spaces on these paragraphs, checkpatch.pl should have
 complained about this.
 

This code is so borked right now checkpatch.pl has MANY complaints. I
figured I would run the 2 files left though the checkfile.pl at a later
date. I think checkfile.pl was what is was called?

Regards
Mark

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


Re: [PATCH RFC 01/17] staging: dgap: Merge dgap_fep5.c into dgap_driver.c

2014-02-12 Thread Mark Hounschell
On 02/12/2014 01:39 PM, Greg Kroah-Hartman wrote:


 diff -urN linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.c 
 linux-3.13.1-new/drivers/staging/dgap/dgap_driver.c
 --- linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.c 2014-01-29 
 08:06:37.0 -0500
 +++ linux-3.13.1-new/drivers/staging/dgap/dgap_driver.c  2014-01-31 
 10:22:53.675819451 -0500
 
 Did you generate this with git?  What happened to the diffstat?
 

No, I did not use git. I used what was suggested in
Documentation/SubmittingPatches.

Regards
Mark

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


Re: [PATCH RFC 02/17] staging: dgap: Merge dgap_fep5.h into dgap_driver.h

2014-02-12 Thread Greg Kroah-Hartman
On Wed, Feb 12, 2014 at 02:00:01PM -0500, Mark Hounschell wrote:
 On 02/12/2014 01:40 PM, Greg Kroah-Hartman wrote:
  On Wed, Feb 12, 2014 at 12:46:31PM -0500, Mark Hounschell wrote:
  Merge dgap_fep5.h into dgap_driver.h
 
  Signed-off-by: Mark Hounschell ma...@compro.net
  Cc: Greg Kroah-Hartman gre...@linuxfoundation.org
  
  Same here, why merge these files?
  
 
 There is a lot of cleanup work to do on these digi drivers and it will
 make it easier. I also notice that many merged drivers are single source
 and header. I thought it was the right thing to do.

Ok, that's great, but say that in the changelog comment :)

Care to redo the series, with a bit better changelog comments so I can
apply them to the tree?

thanks,

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


Re: [PATCH RFC 04/17] staging: dgap: Add in kernel firmware loading support

2014-02-12 Thread Greg Kroah-Hartman
On Wed, Feb 12, 2014 at 02:04:41PM -0500, Mark Hounschell wrote:
 On 02/12/2014 01:41 PM, Greg Kroah-Hartman wrote:
  On Wed, Feb 12, 2014 at 12:49:46PM -0500, Mark Hounschell wrote:
  Add in kernel firmware loading support
 
  Signed-off-by: Mark Hounschell ma...@compro.net
  Cc: Greg Kroah-Hartman gre...@linuxfoundation.org
  
  You also do other things in this patch, like coding style cleanups,
  right?
  
 
 Yes, and there is a lot more. I just hit the ones right in front of me.
 
  That's fine for a staging driver, but it makes it hard to review, so you
  should probably break this up into pieces (i.e. one that only does the
  firmare stuff, and one that does the coding style stuff.
  
 
 Understood.
 
 
  diff -urN linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.c 
  linux-3.13.1-new/drivers/staging/dgap/dgap_driver.c
  --- linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.c   2014-02-03 
  13:34:50.489287314 -0500
  +++ linux-3.13.1-new/drivers/staging/dgap/dgap_driver.c2014-02-03 
  14:12:20.059076489 -0500
  @@ -18,6 +18,33 @@
*
*/
   
  +/*
  + *  In the original out of kernel Digi dgap driver, firmware
  + *  loading was done via user land to driver handshaking.
  + *
  + *  For cards that support a concentrator (port expander),
  + *  I believe the concentrator its self told the card which
  + *  concentrator is actually attached and then that info
  + *  was used to tell user land which concentrator firmware
  + *  image was to be downloaded. I think even the BIOS or
  + *  FEP images required would change with the connection
  + *  of a particular concentrator. 
  + *
  + *  Since I have no access to any of these cards or
  + *  concentrators, I cannot put the correct concentrator
  + *  firmware file names into the firmware_info structure
  + *  as is now done for the BIOS and FEP images. 
  
  Trailing spaces on these paragraphs, checkpatch.pl should have
  complained about this.
  
 
 This code is so borked right now checkpatch.pl has MANY complaints. I
 figured I would run the 2 files left though the checkfile.pl at a later
 date. I think checkfile.pl was what is was called?

Ok, yes, doing it at a later state is fine, but when adding new code
that you write, you should at least follow the proper coding style rules
(like the trailing space issues here.)

thanks,

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


Re: [PATCH RFC 02/17] staging: dgap: Merge dgap_fep5.h into dgap_driver.h

2014-02-12 Thread Mark Hounschell
On 02/12/2014 02:15 PM, Greg Kroah-Hartman wrote:
 On Wed, Feb 12, 2014 at 02:00:01PM -0500, Mark Hounschell wrote:
 On 02/12/2014 01:40 PM, Greg Kroah-Hartman wrote:
 On Wed, Feb 12, 2014 at 12:46:31PM -0500, Mark Hounschell wrote:
 Merge dgap_fep5.h into dgap_driver.h

 Signed-off-by: Mark Hounschell ma...@compro.net
 Cc: Greg Kroah-Hartman gre...@linuxfoundation.org

 Same here, why merge these files?


 There is a lot of cleanup work to do on these digi drivers and it will
 make it easier. I also notice that many merged drivers are single source
 and header. I thought it was the right thing to do.
 
 Ok, that's great, but say that in the changelog comment :)
 
 Care to redo the series, with a bit better changelog comments so I can
 apply them to the tree?
 

OK, I will redo the series. Should I go ahead and fix the trailing space
issue for patch 04? Should I wait for more comments also?

Thanks
Mark

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


Re: [PATCH RFC 02/17] staging: dgap: Merge dgap_fep5.h into dgap_driver.h

2014-02-12 Thread Greg Kroah-Hartman
On Wed, Feb 12, 2014 at 02:29:55PM -0500, Mark Hounschell wrote:
 On 02/12/2014 02:15 PM, Greg Kroah-Hartman wrote:
  On Wed, Feb 12, 2014 at 02:00:01PM -0500, Mark Hounschell wrote:
  On 02/12/2014 01:40 PM, Greg Kroah-Hartman wrote:
  On Wed, Feb 12, 2014 at 12:46:31PM -0500, Mark Hounschell wrote:
  Merge dgap_fep5.h into dgap_driver.h
 
  Signed-off-by: Mark Hounschell ma...@compro.net
  Cc: Greg Kroah-Hartman gre...@linuxfoundation.org
 
  Same here, why merge these files?
 
 
  There is a lot of cleanup work to do on these digi drivers and it will
  make it easier. I also notice that many merged drivers are single source
  and header. I thought it was the right thing to do.
  
  Ok, that's great, but say that in the changelog comment :)
  
  Care to redo the series, with a bit better changelog comments so I can
  apply them to the tree?
  
 
 OK, I will redo the series. Should I go ahead and fix the trailing space
 issue for patch 04? Should I wait for more comments also?

Go ahead and fix that and redo the series, I wouldn't wait for any more
comments just yet.

thanks,

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


[PATCH RFC 02/17 v2] staging: dgap: Merge dgap_fep5.h into dgap_driver.h

2014-02-12 Thread Mark Hounschell
There is a lot of cleanup work to do on these digi drivers and merging as
much as is possible will make it easier. I also notice that many merged 
drivers are single source and header.

Merge dgap_fep5.h into dgap_driver.h

Signed-off-by: Mark Hounschell ma...@compro.net
Cc: Greg Kroah-Hartman gre...@linuxfoundation.org

 drivers/staging/dgap/dgap_driver.c |1 
 drivers/staging/dgap/dgap_driver.h |  230 
 drivers/staging/dgap/dgap_fep5.h   |  253 ---
 drivers/staging/dgap/dgap_parse.c  |3 
 drivers/staging/dgap/dgap_tty.c|3 
 5 files changed, 232 insertions(+), 258 deletions(-)

diff -urN linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.c 
linux-3.13.1-new/drivers/staging/dgap/dgap_driver.c
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.c2014-01-31 
10:53:58.955814989 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_driver.c 2014-01-31 
10:31:00.704520321 -0500
@@ -33,7 +33,6 @@
 
 #include dgap_driver.h
 #include dgap_pci.h
-#include dgap_fep5.h
 #include dgap_tty.h
 #include dgap_conf.h
 #include dgap_parse.h
diff -urN linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.h 
linux-3.13.1-new/drivers/staging/dgap/dgap_driver.h
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.h2014-01-29 
08:06:37.0 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_driver.h 2014-01-31 
10:27:53.968854369 -0500
@@ -618,4 +618,234 @@
 extern uintdgap_get_custom_baud(struct channel_t *ch);
 extern voiddgap_firmware_reset_port(struct channel_t *ch);
 
+
+/* 
+ ***   FEP Version 5 dependent definitions
+ /
+
+/
+ *  FEP memory offsets
+ /
+#define START   0x0004L /* Execution start address  */
+
+#define CMDBUF  0x0d10L /* Command (cm_t) structure offset */
+#define CMDSTART0x0400L /* Start of command buffer  */   
+#define CMDMAX  0x0800L /* End of command buffer*/
+
+#define EVBUF   0x0d18L /* Event (ev_t) structure   */
+#define EVSTART 0x0800L /* Start of event buffer*/
+#define EVMAX   0x0c00L /* End of event buffer  */
+#define FEP5_PLUS   0x0E40  /* ASCII '5' and ASCII 'A' is here  */
+#define ECS_SEG 0x0E44  /* Segment of the extended channel 
structure */
+#define LINE_SPEED  0x10/* Offset into ECS_SEG for line speed  
 */
+/* if the fep has extended 
capabilities */
+
+/* BIOS MAGIC SPOTS */
+#define ERROR   0x0C14L/* BIOS error code  
*/
+#define SEQUENCE   0x0C12L /* BIOS sequence indicator  */
+#define POSTAREA   0x0C00L /* POST complete message area   */
+
+/* FEP MAGIC SPOTS */
+#define FEPSTAT POSTAREA/* OS here when FEP comes up*/
+#define NCHAN   0x0C02L /* number of ports FEP sees */
+#define PANIC   0x0C10L /* PANIC area for FEP   */
+#define KMEMEM  0x0C30L /* Memory for KME use   */   
+#define CONFIG  0x0CD0L /* Concentrator configuration info */
+#define CONFIGSIZE  0x0030  /* configuration info size  */
+#define DOWNREQ 0x0D00  /* Download request buffer pointer */
+
+#define CHANBUF 0x1000L /* Async channel (bs_t) structs */
+#define FEPOSSIZE   0x1FFF  /* 8K FEPOS */
+
+#define XEMPORTS0xC02  /*
+* Offset in board memory where FEP5 stores
+* how many ports it has detected.
+* NOTE: FEP5 reports 64 ports when the user
+* has the cable in EBI OUT instead of EBI IN.
+*/
+
+#define FEPCLR  0x00
+#define FEPMEM  0x02 
+#define FEPRST  0x04 
+#define FEPINT  0x08
+#define FEPMASK 0x0e
+#define FEPWIN  0x80
+
+#define LOWMEM  0x0100
+#define HIGHMEM 0x7f00
+
+#define FEPTIMEOUT 20
+
+#define ENABLE_INTR0x0e04  /* Enable interrupts flag */
+#define FEPPOLL_MIN1   /* minimum of 1 millisecond */  
+#define FEPPOLL_MAX20  /* maximum of 20 milliseconds */
+#define FEPPOLL0x0c26  /* Fep event poll 
interval */   
+
+#defineIALTPIN 0x0080  /* Input flag to swap 
DSR - DCD */
+
+/ 
+ * Command structure definition.
+ 

[PATCH RFC 03/17 v2] staging: dgap: Remove userland downld.c source file

2014-02-12 Thread Mark Hounschell
Remove userland downld.c source file. This file is not used by the kernel.

Signed-off-by: Mark Hounschell ma...@compro.net
Cc: Greg Kroah-Hartman gre...@linuxfoundation.org

 drivers/staging/dgap/downld.c |  798 
 1 file changed, 798 deletions(-)

diff -urN linux-3.13.1-orig/drivers/staging/dgap/downld.c 
linux-3.13.1-new/drivers/staging/dgap/downld.c
--- linux-3.13.1-orig/drivers/staging/dgap/downld.c 2014-01-29 
08:06:37.0 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/downld.c  1969-12-31 
19:00:00.0 -0500
@@ -1,798 +0,0 @@
-/*
- * Copyright 2003 Digi International (www.digi.com)
- * Scott H Kilau Scott_Kilau at digi dot com
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: downld.c,v 1.6 2009/01/14 14:10:54 markh Exp $
- */
-
-/*
-** downld.c
-**
-**  This is the daemon that sends the fep, bios, and concentrator images
-**  from user space to the driver.
-** BUGS: 
-**  If the file changes in the middle of the download, you probably
-** will get what you deserve.
-**
-*/
-
-#include stdlib.h
-#include stdio.h
-#include fcntl.h
-#include sys/types.h
-#include sys/stat.h
-#include sys/errno.h
-
-#include dgap_types.h
-#include digi.h
-#include dgap_fep5.h
-
-#include dgap_downld.h
-
-#include string.h
-#include malloc.h
-#include stddef.h
-#include unistd.h
-
-char   *pgm;
-void   myperror();
-
-/*
-**  This structure is used to keep track of the different images available
-**  to give to the driver.  It is arranged so that the things that are
-**  constants or that have defaults are first inthe strucutre to simplify
-**  the table of initializers.
-*/
-struct image_info {
-   short   type;   /* bios, fep, conc */
-   short   family; /* boards this applies to */
-   short   subtype;/* subtype */
-   int len;/* size of image */
-   char*image; /* ioctl struct + image */
-   char*name;
-   char*fname; /* filename of binary (i.e. asfep.bin) */
-   char*pathname;  /* pathname to this binary 
(/etc/dgap/xrfep.bin); */
-   time_t  mtime;  /* Last modification time */
-};
-
-#define IBIOS  0
-#defineIFEP1
-#defineICONC   2
-#define ICONFIG3
-#defineIBAD4
-
-#define DEFAULT_LOC /lib/firmware/dgap/
-
-struct image_info  *image_list;
-intnimages, count;
-
-struct image_info images[] = {
-{IBIOS, T_EPC,  SUBTYPE, 0, NULL, EPC/X, fxbios.bin, DEFAULT_LOC 
fxbios.bin, 0 },
-{IFEP,  T_EPC,  SUBTYPE, 0, NULL, EPC/X, fxfep.bin, DEFAULT_LOC 
fxfep.bin, 0 },
-{ICONC, T_EPC,  SUBTYPE, 0, NULL, EPC/X, fxcon.bin, DEFAULT_LOC 
fxcon.bin, 0 },
-
-{IBIOS, T_CX,   SUBTYPE, 0, NULL, C/X,   cxbios.bin, DEFAULT_LOC 
cxbios.bin, 0 },
-{IFEP,  T_CX,   SUBTYPE, 0, NULL, C/X,   cxhost.bin, DEFAULT_LOC 
cxhost.bin, 0 },
-
-{IBIOS, T_CX,   T_PCIBUS, 0, NULL, C/X PCI, cxpbios.bin, DEFAULT_LOC 
cxpbios.bin, 0 },
-{IFEP,  T_CX,   T_PCIBUS, 0, NULL, C/X PCI, cxpfep.bin, DEFAULT_LOC 
cxpfep.bin, 0 },
-
-{ICONC, T_CX,   SUBTYPE, 0, NULL, C/X,   cxcon.bin, DEFAULT_LOC 
cxcon.bin, 0 },
-{ICONC, T_CX,   SUBTYPE, 0, NULL, C/X,   ibmcxcon.bin, DEFAULT_LOC 
ibmcxcon.bin, 0 },
-{ICONC, T_CX,   SUBTYPE, 0, NULL, C/X,   ibmencon.bin, DEFAULT_LOC 
ibmencon.bin, 0 },
-
-{IBIOS, FAMILY,   T_PCXR, 0, NULL, PCXR, xrbios.bin, DEFAULT_LOC 
xrbios.bin, 0 },
-{IFEP,  FAMILY,   T_PCXR, 0,  NULL,  PCXR,   xrfep.bin, DEFAULT_LOC 
xrfep.bin, 0  },
-
-{IBIOS, T_PCLITE,   SUBTYPE, 0, NULL, X/em,  sxbios.bin, DEFAULT_LOC 
sxbios.bin, 0 },
-{IFEP,  T_PCLITE,   SUBTYPE, 0,  NULL,  X/em,sxfep.bin, 
DEFAULT_LOC sxfep.bin, 0  },
-
-{IBIOS, T_EPC,  T_PCIBUS, 0, NULL, PCI,  pcibios.bin, DEFAULT_LOC 
pcibios.bin, 0 },
-{IFEP,  T_EPC,  T_PCIBUS, 0, NULL, PCI,  pcifep.bin, DEFAULT_LOC 
pcifep.bin, 0 },
-{ICONFIG, 0,   0, 0, NULL, NULL,   dgap.conf,
/etc/dgap.conf, 0 },
-
-/* IBAD/NULL entry indicating end-of-table */
-
-{IBAD,  0, 0, 0,  NULL,  NULL, NULL, NULL, 0 }
-
-} ;
-
-interrorprint = 1;
-intnodldprint = 1;
-intdebugflag;
-intfd;
-
-struct downld_t *ip;   /* Image pointer in current image  */
-struct downld_t *dp;   /* conc. download */
-
-
-/*
- 

[PATCH RFC 05/17 v2] staging: dgap: remove user land dgap_downld.h

2014-02-12 Thread Mark Hounschell
Remove user land dgap_downld.h. This file is not used by the kernel.

Signed-off-by: Mark Hounschell ma...@compro.net
Cc: Greg Kroah-Hartman gre...@linuxfoundation.org

 drivers/staging/dgap/dgap_downld.h |   69 ---
 1 file changed, 69 deletions(-)

diff -urpN linux-3.13.1-orig/drivers/staging/dgap/dgap_downld.h 
linux-3.13.1-new/drivers/staging/dgap/dgap_downld.h
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_downld.h2014-01-29 
08:06:37.0 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_downld.h 1969-12-31 
19:00:00.0 -0500
@@ -1,69 +0,0 @@
-/*
- * Copyright 2003 Digi International (www.digi.com)
- *  Scott H Kilau Scott_Kilau at digi dot com
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: dgap_downld.h,v 1.1 2009/10/23 14:01:57 markh Exp $
- *
- * NOTE: THIS IS A SHARED HEADER. DO NOT CHANGE CODING STYLE!!!
- *
- */
-
-/*
-** downld.h 
-**  - describes the interface between the user level download process
-**and the concentrator download driver.
-*/
-
-#ifndef _DGAP_DOWNLD_H_
-#define _DGAP_DOWNLD_H_
-
-
-struct fepimg {
-int type;  /* board type */
-intlen;/* length of image */
-char fepimage[1];  /* beginning of image */
-};
-
-struct downldio {
-unsigned int req_type; /* FEP or concentrator */
-unsigned int bdid; /* opaque board identifier */
-union {
-   struct downld_t dl; /* download structure */
-   struct fepimg   fi; /* fep/bios image structure */
-} image;
-};
-
-#define DIGI_DLREQ_GET (('d'8) | 220)
-#define DIGI_DLREQ_SET (('d'8) | 221)
-
-#define DIGI_DL_NUKE(('d'8) | 222) /* Not really a dl request, but
- dangerous enuff to not put in
- digi.h */
-/* Packed bits of intarg for DIGI_DL_NUKE */
-#define DIGI_NUKE_RESET_ALL (1  31)
-#define DIGI_NUKE_INHIBIT_POLLER (1  30)
-#define DIGI_NUKE_BRD_NUMB0x0f
-   
-
-
-#defineDLREQ_BIOS  0
-#defineDLREQ_FEP   1
-#defineDLREQ_CONC  2
-#defineDLREQ_CONFIG3
-#define DLREQ_DEVCREATE 4
-
-#endif


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


[PATCH RFC 07/17 v2] staging: dgap: Merge dgap_parse.h into dgap-driver.h

2014-02-12 Thread Mark Hounschell
There is a lot of cleanup work to do on these digi drivers and merging as
much as is possible will make it easier. I also notice that many merged 
drivers are single source and header. 

Merge dgap_parse.h into dgap-driver.h

Signed-off-by: Mark Hounschell ma...@compro.net
Cc: Greg Kroah-Hartman gre...@linuxfoundation.org

 drivers/staging/dgap/dgap_driver.c |1 
 drivers/staging/dgap/dgap_driver.h |   11 
 drivers/staging/dgap/dgap_parse.h  |   35 ---
 drivers/staging/dgap/dgap_sysfs.c  |3 --
 drivers/staging/dgap/dgap_tty.c|1 
 5 files changed, 12 insertions(+), 39 deletions(-)

diff -urpN linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.c 
linux-3.13.1-new/drivers/staging/dgap/dgap_driver.c
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.c2014-02-10 
15:39:27.824827207 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_driver.c 2014-02-10 
16:13:01.708232345 -0500
@@ -64,7 +64,6 @@
 #include dgap_pci.h
 #include dgap_tty.h
 #include dgap_conf.h
-#include dgap_parse.h
 #include dgap_trace.h
 #include dgap_sysfs.h
 
diff -urpN linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.h 
linux-3.13.1-new/drivers/staging/dgap/dgap_driver.h
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.h2014-02-10 
15:05:14.805390665 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_driver.h 2014-02-10 
15:59:36.576837789 -0500
@@ -598,6 +598,17 @@ extern wait_queue_head_t dgap_dl_wait;
 extern int dgap_dl_action; /* Action flag for downloader   
*/
 extern int dgap_registerttyswithsysfs; /* Should we register the   
*/
/* ttys with sysfs or not   
*/
+   
+/*
+ * Functions from dgap_parsefile
+ */
+extern int dgap_parsefile(char **in, int Remove);
+extern struct cnode *dgap_find_config(int type, int bus, int slot);
+extern uint dgap_config_get_number_of_ports(struct board_t *bd);
+extern char *dgap_create_config_string(struct board_t *bd, char *string);
+extern char *dgap_get_config_letters(struct board_t *bd, char *string);
+extern uint dgap_config_get_useintr(struct board_t *bd);
+extern uint dgap_config_get_altpin(struct board_t *bd);

 
 /*
  * Global functions declared in dgap_fep5.c, but must be hidden from
diff -urpN linux-3.13.1-orig/drivers/staging/dgap/dgap_parse.h 
linux-3.13.1-new/drivers/staging/dgap/dgap_parse.h
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_parse.h 2014-01-29 
08:06:37.0 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_parse.h  1969-12-31 
19:00:00.0 -0500
@@ -1,35 +0,0 @@
-/*
- * Copyright 2003 Digi International (www.digi.com)
- * Scott H Kilau Scott_Kilau at digi dot com
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * NOTE: THIS IS A SHARED HEADER. DO NOT CHANGE CODING STYLE!!!
- */
-
-#ifndef _DGAP_PARSE_H
-#define _DGAP_PARSE_H
-
-#include dgap_driver.h
-
-extern int dgap_parsefile(char **in, int Remove);
-extern struct cnode *dgap_find_config(int type, int bus, int slot);
-extern uint dgap_config_get_number_of_ports(struct board_t *bd);
-extern char *dgap_create_config_string(struct board_t *bd, char *string);
-extern char *dgap_get_config_letters(struct board_t *bd, char *string);
-extern uint dgap_config_get_useintr(struct board_t *bd);
-extern uint dgap_config_get_altpin(struct board_t *bd);
-
-#endif
diff -urpN linux-3.13.1-orig/drivers/staging/dgap/dgap_sysfs.c 
linux-3.13.1-new/drivers/staging/dgap/dgap_sysfs.c
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_sysfs.c 2014-01-29 
08:06:37.0 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_sysfs.c  2014-02-10 
16:06:15.024308876 -0500
@@ -29,7 +29,7 @@
  *
  *
  * 
- * $Id: dgap_sysfs.c,v 1.1 2009/10/23 14:01:57 markh Exp $   
+ * $Id: dgap_sysfs.c,v 1.1.1.1 2014/01/31 07:33:31 markh Exp $   
  */
 
 
@@ -44,7 +44,6 @@
   
 #include dgap_driver.h
 #include dgap_conf.h
-#include dgap_parse.h
 
 
 static ssize_t dgap_driver_version_show(struct device_driver *ddp, char *buf)
diff -urpN linux-3.13.1-orig/drivers/staging/dgap/dgap_tty.c 
linux-3.13.1-new/drivers/staging/dgap/dgap_tty.c
--- 

[PATCH RFC 08/17 v2] staging: dgap: Merge dgap_conf.h into dgap-driver.h

2014-02-12 Thread Mark Hounschell
There is a lot of cleanup work to do on these digi drivers and merging as
much as is possible will make it easier. I also notice that many merged 
drivers are single source and header. 

Merge dgap_conf.h into dgap-driver.h

Signed-off-by: Mark Hounschell ma...@compro.net
Cc: Greg Kroah-Hartman gre...@linuxfoundation.org

diff -urpN linux-3.13.1-orig/drivers/staging/dgap/dgap_conf.h 
linux-3.13.1-new/drivers/staging/dgap/dgap_conf.h
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_conf.h  2014-01-29 
08:06:37.0 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_conf.h   1969-12-31 
19:00:00.0 -0500
@@ -1,290 +0,0 @@
-/*
- * Copyright 2003 Digi International (www.digi.com)
- * Scott H Kilau Scott_Kilau at digi dot com
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *
- *
- * dgap_conf.h - Header file for installations and parse files.
- *
- * $Id: dgap_conf.h,v 1.1 2009/10/23 14:01:57 markh Exp $
- *
- * NOTE: THIS IS A SHARED HEADER. DO NOT CHANGE CODING STYLE!!!
- */
-
-#ifndef _DGAP_CONF_H
-#define _DGAP_CONF_H
-
-#define NULLNODE 0 /* header node, not used */
-#define BNODE 1/* Board node */
-#define LNODE 2/* Line node */
-#define CNODE 3/* Concentrator node */
-#define MNODE 4/* EBI Module node */
-#define TNODE 5/* tty name prefix node */
-#defineCUNODE 6/* cu name prefix (non-SCO) */
-#define PNODE 7/* trans. print prefix node */
-#define JNODE 8/* maJor number node */
-#define ANODE 9/* altpin */
-#defineTSNODE 10   /* tty structure size */
-#define CSNODE 11  /* channel structure size */
-#define BSNODE 12  /* board structure size */
-#define USNODE 13  /* unit schedule structure size */
-#define FSNODE 14  /* f2200 structure size */
-#define VSNODE 15  /* size of VPIX structures */
-#define INTRNODE 16/* enable interrupt */
-
-/* Enumeration of tokens */
-#defineBEGIN   1
-#defineEND 2
-#defineBOARD   10
-
-#define EPCFS  11 /* start of EPC family definitions */
-#defineICX 11
-#defineMCX 13
-#define PCX14
-#defineIEPC15
-#defineEEPC16
-#defineMEPC17
-#defineIPCM18
-#defineEPCM19
-#defineMPCM20
-#define PEPC   21
-#define PPCM   22
-#ifdef CP
-#define ICP 23
-#define ECP 24
-#define MCP 25
-#endif
-#define EPCFE  25 /* end of EPC family definitions */
-#definePC2E26
-#definePC4E27
-#definePC4E8K  28
-#definePC8E29
-#definePC8E8K  30
-#definePC16E   31
-#define MC2E8K  34
-#define MC4E8K  35
-#define MC8E8K  36
-
-#define AVANFS 42  /* start of Avanstar family definitions */
-#define A8P42
-#define A16P   43
-#define AVANFE 43  /* end of Avanstar family definitions */
-
-#define DA2000FS   44  /* start of AccelePort 2000 family definitions 
*/
-#define DA22   44 /* AccelePort 2002 */
-#define DA24   45 /* AccelePort 2004 */
-#define DA28   46 /* AccelePort 2008 */
-#define DA216  47 /* AccelePort 2016 */
-#define DAR4   48 /* AccelePort RAS 4 port */
-#define DAR8   49 /* AccelePort RAS 8 port */
-#define DDR24  50 /* DataFire RAS 24 port */
-#define DDR30  51 /* DataFire RAS 30 port */
-#define DDR48  52 /* DataFire RAS 48 port */
-#define DDR60  53 /* DataFire RAS 60 port */
-#define DA2000FE   53 /* end of AccelePort 2000/RAS family definitions */
-
-#define PCXRFS 106 /* start of PCXR family definitions */
-#defineAPORT4  106
-#defineAPORT8  107
-#define PAPORT4 108
-#define PAPORT8 109
-#define APORT4_920I110
-#define APORT8_920I111
-#define APORT4_920P112
-#define APORT8_920P113
-#define APORT2_920P 114
-#define PCXRFE 117 /* end of PCXR family definitions */
-
-#defineLINE82
-#ifdef T1
-#define T1M83
-#define E1M84
-#endif
-#define  

[PATCH RFC 09/17 v2] staging: dgap: Merge digi.h into dgap_driver.h

2014-02-12 Thread Mark Hounschell
There is a lot of cleanup work to do on these digi drivers and merging as
much as is possible will make it easier. I also notice that many merged 
drivers are single source and header. 

Merge digi.h into dgap_driver.h

Signed-off-by: Mark Hounschell ma...@compro.net
Cc: Greg Kroah-Hartman gre...@linuxfoundation.org

 drivers/staging/dgap/dgap_driver.h |  351 +
 drivers/staging/dgap/digi.h|  376 ---
 2 files changed, 350 insertions(+), 377 deletions(-)

diff -urpN linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.h 
linux-3.13.1-new/drivers/staging/dgap/dgap_driver.h
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.h2014-02-10 
16:27:13.371869098 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_driver.h 2014-02-10 
16:59:46.233442157 -0500
@@ -33,7 +33,6 @@
 #include linux/interrupt.h/* For irqreturn_t type */
 
 #include dgap_types.h /* Additional types needed by the Digi header 
files */
-#include digi.h   /* Digi specific ioctl header */
 #include dgap_kcompat.h   /* Kernel 2.4/2.6 compat includes */
 #include dgap_sysfs.h/* Support for SYSFS */
 
@@ -66,6 +65,356 @@
 
 #define TRC_TO_CONSOLE 1
 
+/
+ ***   Definitions for Digi ditty(1) command.
+ /
+
+
+/*
+ * Copyright (c) 1988-96 Digi International Inc., All Rights Reserved.
+ */
+
+/
+ * This module provides application access to special Digi
+ * serial line enhancements which are not standard UNIX(tm) features.
+ /
+
+#if !defined(TIOCMODG)
+
+#defineTIOCMODG('d'8) | 250  /* get modem ctrl state 
*/
+#defineTIOCMODS('d'8) | 251  /* set modem ctrl state 
*/
+
+#ifndef TIOCM_LE 
+#defineTIOCM_LE0x01/* line enable  
*/
+#defineTIOCM_DTR   0x02/* data terminal ready  
*/
+#defineTIOCM_RTS   0x04/* request to send  
*/
+#defineTIOCM_ST0x08/* secondary transmit   
*/
+#defineTIOCM_SR0x10/* secondary receive
*/
+#defineTIOCM_CTS   0x20/* clear to send
*/
+#defineTIOCM_CAR   0x40/* carrier detect   
*/
+#defineTIOCM_RNG   0x80/* ring indicator   
*/
+#defineTIOCM_DSR   0x100   /* data set ready   
*/
+#defineTIOCM_RITIOCM_RNG   /* ring (alternate) 
*/
+#defineTIOCM_CDTIOCM_CAR   /* carrier detect (alt) 
*/
+#endif
+
+#endif
+
+#if !defined(TIOCMSET)
+#defineTIOCMSET('d'8) | 252  /* set modem ctrl state 
*/
+#defineTIOCMGET('d'8) | 253  /* set modem ctrl state 
*/
+#endif
+
+#if !defined(TIOCMBIC)
+#defineTIOCMBIC('d'8) | 254  /* set modem ctrl state 
*/
+#defineTIOCMBIS('d'8) | 255  /* set modem ctrl state 
*/
+#endif
+
+
+#if !defined(TIOCSDTR)
+#defineTIOCSDTR('e'8) | 0/* set DTR  
*/
+#defineTIOCCDTR('e'8) | 1/* clear DTR
*/
+#endif
+
+/
+ * Ioctl command arguments for DIGI parameters.
+ /
+#define DIGI_GETA  ('e'8) | 94   /* Read params  */
+
+#define DIGI_SETA  ('e'8) | 95   /* Set params   */
+#define DIGI_SETAW ('e'8) | 96   /* Drain  set params   */
+#define DIGI_SETAF ('e'8) | 97   /* Drain, flush  set params */
+
+#define DIGI_KME   ('e'8) | 98   /* Read/Write Host  */
+   /* Adapter Memory   */
+
+#defineDIGI_GETFLOW('e'8) | 99   /* Get startc/stopc 
flow */
+   /* control characters*/
+#defineDIGI_SETFLOW('e'8) | 100  /* Set startc/stopc 
flow */
+   /* control characters*/
+#defineDIGI_GETAFLOW   ('e'8) | 101  /* Get Aux. 
startc/stopc */
+   /* flow control chars*/
+#defineDIGI_SETAFLOW   ('e'8) | 102  /* Set Aux. 
startc/stopc */
+   /* flow control chars*/
+
+#define DIGI_GEDELAY   ('d'8) | 246  /* Get edelay */
+#define DIGI_SEDELAY   ('d'8) | 247  /* Set edelay */
+
+struct digiflow_t {
+  

[PATCH RFC 10/17 v2] staging: dgap: Merge dgap_pci.h into dgap_driver.h

2014-02-12 Thread Mark Hounschell
There is a lot of cleanup work to do on these digi drivers and merging as
much as is possible will make it easier. I also notice that many merged 
drivers are single source and header. 

Merge dgap_pci.h into dgap_driver.h

Signed-off-by: Mark Hounschell ma...@compro.net
Cc: Greg Kroah-Hartman gre...@linuxfoundation.org

 drivers/staging/dgap/dgap_driver.c |1 
 drivers/staging/dgap/dgap_driver.h |   68 +++
 drivers/staging/dgap/dgap_pci.h|   92 ---
 3 files changed, 68 insertions(+), 93 deletions(-)

diff -urpN linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.c 
linux-3.13.1-new/drivers/staging/dgap/dgap_driver.c
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.c2014-02-10 
16:27:48.504390913 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_driver.c 2014-02-11 
08:01:11.449483884 -0500
@@ -61,7 +61,6 @@
 #include linux/ctype.h
 
 #include dgap_driver.h
-#include dgap_pci.h
 #include dgap_tty.h
 #include dgap_trace.h
 #include dgap_sysfs.h
diff -urpN linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.h 
linux-3.13.1-new/drivers/staging/dgap/dgap_driver.h
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.h2014-02-10 
16:59:46.233442157 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_driver.h 2014-02-11 
07:57:51.427456456 -0500
@@ -66,6 +66,74 @@
 #define TRC_TO_CONSOLE 1
 
 /
+ * Stuff from dgap_pci.h
+ /
+#define PCIMAX 32  /* maximum number of PCI boards */
+
+#define DIGI_VID   0x114F
+
+#define PCI_DEVICE_EPC_DID 0x0002
+#define PCI_DEVICE_XEM_DID 0x0004
+#define PCI_DEVICE_XR_DID  0x0005
+#define PCI_DEVICE_CX_DID  0x0006
+#define PCI_DEVICE_XRJ_DID 0x0009  /* PLX-based Xr adapter */
+#define PCI_DEVICE_XR_IBM_DID  0x0011  /* IBM 8-port Async Adapter */
+#define PCI_DEVICE_XR_BULL_DID 0x0013  /* BULL 8-port Async Adapter */
+#define PCI_DEVICE_XR_SAIP_DID 0x001c  /* SAIP card - Xr adapter */
+#define PCI_DEVICE_XR_422_DID  0x0012  /* Xr-422 */
+#define PCI_DEVICE_920_2_DID   0x0034  /* XR-Plus 920 K, 2 port */
+#define PCI_DEVICE_920_4_DID   0x0026  /* XR-Plus 920 K, 4 port */
+#define PCI_DEVICE_920_8_DID   0x0027  /* XR-Plus 920 K, 8 port */
+#define PCI_DEVICE_EPCJ_DID0x000a  /* PLX 9060 chip for PCI  */
+#define PCI_DEVICE_CX_IBM_DID  0x001b  /* IBM 128-port Async Adapter */
+#define PCI_DEVICE_920_8_HP_DID0x0058  /* HP XR-Plus 920 K, 8 port */
+#define PCI_DEVICE_XEM_HP_DID  0x0059  /* HP Xem PCI */
+
+#define PCI_DEVICE_XEM_NAMEAccelePort XEM
+#define PCI_DEVICE_CX_NAME AccelePort CX
+#define PCI_DEVICE_XR_NAME AccelePort Xr
+#define PCI_DEVICE_XRJ_NAMEAccelePort Xr (PLX)
+#define PCI_DEVICE_XR_SAIP_NAMEAccelePort Xr (SAIP)
+#define PCI_DEVICE_920_2_NAME  AccelePort Xr920 2 port
+#define PCI_DEVICE_920_4_NAME  AccelePort Xr920 4 port
+#define PCI_DEVICE_920_8_NAME  AccelePort Xr920 8 port
+#define PCI_DEVICE_XR_422_NAME AccelePort Xr 422
+#define PCI_DEVICE_EPCJ_NAME   AccelePort EPC (PLX)
+#define PCI_DEVICE_XR_BULL_NAMEAccelePort Xr (BULL)
+#define PCI_DEVICE_XR_IBM_NAME AccelePort Xr (IBM)
+#define PCI_DEVICE_CX_IBM_NAME AccelePort CX (IBM)
+#define PCI_DEVICE_920_8_HP_NAME AccelePort Xr920 8 port (HP)
+#define PCI_DEVICE_XEM_HP_NAME AccelePort XEM (HP)
+
+
+/*
+ * On the PCI boards, there is no IO space allocated
+ * The I/O registers will be in the first 3 bytes of the
+ * upper 2MB of the 4MB memory space.  The board memory
+ * will be mapped into the low 2MB of the 4MB memory space
+ */
+
+/* Potential location of PCI Bios from E to F*/
+#define PCI_BIOS_SIZE  0x0002
+
+/* Size of Memory and I/O for PCI (4MB) */
+#define PCI_RAM_SIZE   0x0040
+
+/* Size of Memory (2MB) */
+#define PCI_MEM_SIZE   0x0020
+
+/* Max PCI Window Size (2MB) */
+#define PCI_WIN_SIZE   0x0020
+
+#define PCI_WIN_SHIFT  21 /* 21 bits max */
+
+/* Offset of I/0 in Memory (2MB) */
+#define PCI_IO_OFFSET  0x0020
+
+/* Size of IO (2MB) */
+#define PCI_IO_SIZE0x0020
+
+/
  ***   Definitions for Digi ditty(1) command.
  /
 
diff -urpN linux-3.13.1-orig/drivers/staging/dgap/dgap_pci.h 
linux-3.13.1-new/drivers/staging/dgap/dgap_pci.h
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_pci.h   2014-01-29 
08:06:37.0 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_pci.h1969-12-31 
19:00:00.0 -0500
@@ -1,92 +0,0 @@
-/*
- * Copyright 2003 Digi International (www.digi.com)
- * Scott H Kilau Scott_Kilau at digi dot com
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as 

[PATCH RFC 12/17 v2] staging: dgap: Merge dgap_tty.h into dgap_driver.h

2014-02-12 Thread Mark Hounschell
There is a lot of cleanup work to do on these digi drivers and merging as
much as is possible will make it easier. I also notice that many merged 
drivers are single source and header. 

Merge dgap_tty.h into dgap_driver.h

Signed-off-by: Mark Hounschell ma...@compro.net
Cc: Greg Kroah-Hartman gre...@linuxfoundation.org

 drivers/staging/dgap/dgap_driver.c |1 
 drivers/staging/dgap/dgap_driver.h |   13 +
 drivers/staging/dgap/dgap_tty.h|   39 ---
 3 files changed, 13 insertions(+), 40 deletions(-)

diff -urpN linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.c 
linux-3.13.1-new/drivers/staging/dgap/dgap_driver.c
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.c2014-02-11 
08:47:53.097813955 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_driver.c 2014-02-11 
09:03:36.616023262 -0500
@@ -66,7 +66,6 @@
 
 
 #include dgap_driver.h
-#include dgap_tty.h
 #include dgap_trace.h
 #include dgap_sysfs.h
 
diff -urpN linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.h 
linux-3.13.1-new/drivers/staging/dgap/dgap_driver.h
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.h2014-02-11 
07:57:51.427456456 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_driver.h 2014-02-11 
08:56:53.758605000 -0500
@@ -1040,6 +1040,19 @@ extern void  dgap_parity_scan(struct chan
 extern uintdgap_get_custom_baud(struct channel_t *ch);
 extern voiddgap_firmware_reset_port(struct channel_t *ch);
 
+/*
+ * Functions prototypes from dgap_tty.h
+ */
+intdgap_tty_register(struct board_t *brd);
+
+intdgap_tty_preinit(void);
+int dgap_tty_init(struct board_t *);
+
+void   dgap_tty_post_uninit(void);
+void   dgap_tty_uninit(struct board_t *);
+
+void   dgap_carrier(struct channel_t *ch);
+void   dgap_input(struct channel_t *ch);
 
 /* 
  ***   FEP Version 5 dependent definitions
diff -urpN linux-3.13.1-orig/drivers/staging/dgap/dgap_tty.h 
linux-3.13.1-new/drivers/staging/dgap/dgap_tty.h
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_tty.h   2014-01-29 
08:06:37.0 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_tty.h1969-12-31 
19:00:00.0 -0500
@@ -1,39 +0,0 @@
-/*
- * Copyright 2003 Digi International (www.digi.com)
- * Scott H Kilau Scott_Kilau at digi dot com
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * NOTE: THIS IS A SHARED HEADER. DO NOT CHANGE CODING STYLE!!!
- */
-
-#ifndef __DGAP_TTY_H
-#define __DGAP_TTY_H
-
-#include dgap_driver.h
-
-intdgap_tty_register(struct board_t *brd);
-
-intdgap_tty_preinit(void);
-int dgap_tty_init(struct board_t *);
-
-void   dgap_tty_post_uninit(void);
-void   dgap_tty_uninit(struct board_t *);
-
-void   dgap_carrier(struct channel_t *ch);
-void   dgap_input(struct channel_t *ch);
-
-
-#endif


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


[PATCH RFC 14/17 v2] staging: dgap: Merge dgap_sysfs.h into dgap_driver.h

2014-02-12 Thread Mark Hounschell
There is a lot of cleanup work to do on these digi drivers and merging as
much as is possible will make it easier. I also notice that many merged 
drivers are single source and header. 

Merge dgap_sysfs.h into dgap_driver.h

Signed-off-by: Mark Hounschell ma...@compro.net
Cc: Greg Kroah-Hartman gre...@linuxfoundation.org

 drivers/staging/dgap/dgap_driver.c |   23 +---
 drivers/staging/dgap/dgap_driver.h |1 
 drivers/staging/dgap/dgap_sysfs.h  |   48 ---
 3 files changed, 16 insertions(+), 56 deletions(-)

diff -urpN linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.c 
linux-3.13.1-new/drivers/staging/dgap/dgap_driver.c
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.c2014-02-11 
09:13:15.812797508 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_driver.c 2014-02-11 
09:33:16.665283807 -0500
@@ -71,7 +71,6 @@
 
 #include dgap_driver.h
 #include dgap_trace.h
-#include dgap_sysfs.h
 
 #include dgap_types.h
 
@@ -202,6 +201,16 @@ static const struct tty_operations dgap_
.send_xchar = dgap_tty_send_xchar
 };
 
+/*
+ * Function prototypes from dgap_sysfs.h
+ */
+static void dgap_create_ports_sysfiles(struct board_t *bd);
+static void dgap_remove_ports_sysfiles(struct board_t *bd);
+static void dgap_create_driver_sysfiles(struct pci_driver *);
+static void dgap_remove_driver_sysfiles(struct pci_driver *);
+static void dgap_create_tty_sysfs(struct un_t *un, struct device *c);
+static void dgap_remove_tty_sysfs(struct device *c);
+
 #ifdef DIGI_CONCENTRATORS_SUPPORTED
 static void dgap_do_conc_load(struct board_t *brd, uchar *uaddr, 
int len);
 #endif
@@ -7932,7 +7941,7 @@ static ssize_t dgap_driver_pollrate_stor
 static DRIVER_ATTR(pollrate, (S_IRUSR | S_IWUSR), dgap_driver_pollrate_show, 
dgap_driver_pollrate_store);
 
 
-void dgap_create_driver_sysfiles(struct pci_driver *dgap_driver)
+static void dgap_create_driver_sysfiles(struct pci_driver *dgap_driver)
 {
int rc = 0;
struct device_driver *driverfs = dgap_driver-driver;
@@ -7951,7 +7960,7 @@ void dgap_create_driver_sysfiles(struct
 }
 
 
-void dgap_remove_driver_sysfiles(struct pci_driver *dgap_driver)
+static void dgap_remove_driver_sysfiles(struct pci_driver *dgap_driver)
 {
struct device_driver *driverfs = dgap_driver-driver;
driver_remove_file(driverfs, driver_attr_version);
@@ -8161,7 +8170,7 @@ static DEVICE_ATTR(ports_txcount, S_IRUS
 /* this function creates the sys files that will export each signal status
  * to sysfs each value will be put in a separate filename
  */
-void dgap_create_ports_sysfiles(struct board_t *bd)
+static void dgap_create_ports_sysfiles(struct board_t *bd)
 {
int rc = 0;
 
@@ -8183,7 +8192,7 @@ void dgap_create_ports_sysfiles(struct b
 
 
 /* removes all the sys files created for that port */
-void dgap_remove_ports_sysfiles(struct board_t *bd)
+static void dgap_remove_ports_sysfiles(struct board_t *bd)
 {
device_remove_file((bd-pdev-dev), dev_attr_ports_state);
device_remove_file((bd-pdev-dev), dev_attr_ports_baud);
@@ -8582,7 +8591,7 @@ static struct attribute_group dgap_tty_a
 
 
 
-void dgap_create_tty_sysfs(struct un_t *un, struct device *c)
+static void dgap_create_tty_sysfs(struct un_t *un, struct device *c)
 {
int ret;
 
@@ -8598,7 +8607,7 @@ void dgap_create_tty_sysfs(struct un_t *
 }
 
 
-void dgap_remove_tty_sysfs(struct device *c)
+static void dgap_remove_tty_sysfs(struct device *c)
 {
sysfs_remove_group(c-kobj, dgap_tty_attribute_group);
 }
diff -urpN linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.h 
linux-3.13.1-new/drivers/staging/dgap/dgap_driver.h
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.h2014-02-11 
08:56:53.758605000 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_driver.h 2014-02-11 
09:34:25.247042563 -0500
@@ -34,7 +34,6 @@
 
 #include dgap_types.h /* Additional types needed by the Digi header 
files */
 #include dgap_kcompat.h   /* Kernel 2.4/2.6 compat includes */
-#include dgap_sysfs.h/* Support for SYSFS */
 
 /*
  *
diff -urpN linux-3.13.1-orig/drivers/staging/dgap/dgap_sysfs.h 
linux-3.13.1-new/drivers/staging/dgap/dgap_sysfs.h
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_sysfs.h 2014-01-29 
08:06:37.0 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_sysfs.h  1969-12-31 
19:00:00.0 -0500
@@ -1,48 +0,0 @@
-/*
- * Copyright 2003 Digi International (www.digi.com)
- * Scott H Kilau Scott_Kilau at digi dot com
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- 

[PATCH RFC 16/17 v2] staging: dgap: Remove dgap_kcompat.h and_dgap_types.h

2014-02-12 Thread Mark Hounschell
Remove dgap_kcompat.h and_dgap_types.h. These files are only required for 
older 2.x.x kernels.

Signed-off-by: Mark Hounschell ma...@compro.net
Cc: Greg Kroah-Hartman gre...@linuxfoundation.org

 drivers/staging/dgap/dgap_driver.c  |2 
 drivers/staging/dgap/dgap_driver.h  |   22 
 drivers/staging/dgap/dgap_kcompat.h |   64 --
 drivers/staging/dgap/dgap_types.h   |   36 --
 4 files changed, 20 insertions(+), 104 deletions(-)

diff -urpN linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.c 
linux-3.13.1-new/drivers/staging/dgap/dgap_driver.c
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.c2014-02-11 
09:55:35.298027046 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_driver.c 2014-02-11 
10:07:00.122346031 -0500
@@ -69,8 +69,6 @@
 #include linux/kdev_t.h
 
 #include dgap_driver.h
-#include dgap_types.h
-
 
 /*
  * Function prototypes.
diff -urpN linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.h 
linux-3.13.1-new/drivers/staging/dgap/dgap_driver.h
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_driver.h2014-02-11 
09:34:25.247042563 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_driver.h 2014-02-11 
10:17:49.137517346 -0500
@@ -32,8 +32,15 @@
 #include linux/tty.h  /* To pick up the various tty structs/defines 
*/
 #include linux/interrupt.h/* For irqreturn_t type */
 
-#include dgap_types.h /* Additional types needed by the Digi header 
files */
-#include dgap_kcompat.h   /* Kernel 2.4/2.6 compat includes */
+#if !defined(TTY_FLIPBUF_SIZE)
+# define TTY_FLIPBUF_SIZE 512
+#endif
+
+#define PARM_INT(VAR, INIT, PERM, DESC) \
+   static int VAR = INIT; \
+   int dgap_##VAR; \
+   module_param(VAR, int, PERM); \
+   MODULE_PARM_DESC(VAR, DESC);
 
 /*
  *
@@ -64,6 +71,17 @@
 
 #define TRC_TO_CONSOLE 1
 
+#ifndef TRUE
+# define TRUE 1
+#endif
+
+#ifndef FALSE
+# define FALSE 0
+#endif
+
+/* Required for our shared headers! */
+typedef unsigned char   uchar;
+
 /
  * Stuff from dgap_pci.h
  /
diff -urpN linux-3.13.1-orig/drivers/staging/dgap/dgap_kcompat.h 
linux-3.13.1-new/drivers/staging/dgap/dgap_kcompat.h
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_kcompat.h   2014-01-29 
08:06:37.0 -0500
+++ linux-3.13.1-new/drivers/staging/dgap/dgap_kcompat.h1969-12-31 
19:00:00.0 -0500
@@ -1,64 +0,0 @@
-/*
- * Copyright 2004 Digi International (www.digi.com)
- *  Scott H Kilau Scott_Kilau at digi dot com
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * NOTE: THIS IS A SHARED HEADER. DO NOT CHANGE CODING STYLE!!!
- *
- *
- *
- * This file is intended to contain all the kernel differences between the
- * various kernels that we support.
- *
- */
-
-#ifndef __DGAP_KCOMPAT_H
-#define __DGAP_KCOMPAT_H
-
-#if !defined(TTY_FLIPBUF_SIZE)
-# define TTY_FLIPBUF_SIZE 512
-#endif
-
-
-/* Sparse stuff */
-# ifndef __user
-#  define __user
-#  define __kernel
-#  define __safe
-#  define __force
-#  define __chk_user_ptr(x) (void)0
-# endif
-
-
-#  define PARM_STR(VAR, INIT, PERM, DESC) \
-   static char *VAR = INIT; \
-   char *dgap_##VAR; \
-   module_param(VAR, charp, PERM); \
-   MODULE_PARM_DESC(VAR, DESC);
-
-#  define PARM_INT(VAR, INIT, PERM, DESC) \
-   static int VAR = INIT; \
-   int dgap_##VAR; \
-   module_param(VAR, int, PERM); \
-   MODULE_PARM_DESC(VAR, DESC);
-
-#  define PARM_ULONG(VAR, INIT, PERM, DESC) \
-   static ulong VAR = INIT; \
-   ulong dgap_##VAR; \
-   module_param(VAR, long, PERM); \
-   MODULE_PARM_DESC(VAR, DESC);
-
-#endif /* ! __DGAP_KCOMPAT_H */
diff -urpN linux-3.13.1-orig/drivers/staging/dgap/dgap_types.h 
linux-3.13.1-new/drivers/staging/dgap/dgap_types.h
--- linux-3.13.1-orig/drivers/staging/dgap/dgap_types.h 2014-01-29 

Re: [PATCH RFC 01/17] staging: dgap: Merge dgap_fep5.c into dgap_driver.c

2014-02-12 Thread Mark Hounschell
On 02/12/2014 03:34 PM, Dan Carpenter wrote:
 Greg mentioned doing the checkpatch.pl fixes later and that applies
 here as well.  Leave the LINUX_VERSION_CODE code in for now and delete
 it in a later patch.
 
 On the other hand, I don't want to give you a lot of extra work to do if
 no one else cares...
 
 What I'm saying is that when you do moves, please *just* move the code
 exactly as unmodified as possible.  I have tools to review that the code
 just shifted but was not modified.
 
 The truth is that when I review patches, I always pretend submitters
 work for the US government to sabotage things and insert backdoors.  I
 want to verify that the patch does exactly what it says and nothing
 more.
 

Understood. I just sent v2 of the series. I hope all is OK.

Regards
Mark

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


[PATCH] staging: r8188eu: Fix more Smatch warnings and errors

2014-02-12 Thread Larry Finger
After updating Smatch, the following new errors and warnings are reported:

drivers/staging/rtl8188eu/core/rtw_recv.c:368 recvframe_chkmic() warn: variable 
dereferenced before check 'psecuritypriv' (see line 364)
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:2642 rtw_wps_start() warn: 
variable dereferenced before check 'pdata' (see line 2636)
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:4461 rtw_dbg_port() error: we 
previously assumed 'pregpriv' could be null (see line 4453)
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:4473 rtw_dbg_port() error: we 
previously assumed 'pregpriv' could be null (see line 4469)

Signed-off-by: Larry Finger larry.fin...@lwfinger.net
---
 drivers/staging/rtl8188eu/core/rtw_recv.c  |  7 +++
 drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 18 +-
 2 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c 
b/drivers/staging/rtl8188eu/core/rtw_recv.c
index 35397bd..bc5baf2 100644
--- a/drivers/staging/rtl8188eu/core/rtw_recv.c
+++ b/drivers/staging/rtl8188eu/core/rtw_recv.c
@@ -361,16 +361,15 @@ static int recvframe_chkmic(struct adapter *adapter,  
union recv_frame *precvfra
/* calculate mic code */
if (stainfo != NULL) {
if (IS_MCAST(prxattrib-ra)) {
-   mickey = 
psecuritypriv-dot118021XGrprxmickey[prxattrib-key_index].skey[0];
-
-   RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, 
(\n recvframe_chkmic: bcmc key\n));
-
if (!psecuritypriv) {
res = _FAIL;
RT_TRACE(_module_rtl871x_recv_c_, 
_drv_err_, (\n recvframe_chkmic:didn't install group key!!\n));
DBG_88E(\n recvframe_chkmic:didn't 
install group key!!\n);
goto exit;
}
+   mickey = 
psecuritypriv-dot118021XGrprxmickey[prxattrib-key_index].skey[0];
+
+   RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, 
(\n recvframe_chkmic: bcmc key\n));
} else {
mickey = stainfo-dot11tkiprxmickey.skey[0];
RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, 
(\n recvframe_chkmic: unicast key\n));
diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c 
b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
index 7de8139..3691007 100644
--- a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
@@ -2633,13 +2633,13 @@ static int rtw_wps_start(struct net_device *dev,
struct iw_point *pdata = wrqu-data;
u32   u32wps_start = 0;
 
-   ret = copy_from_user((void *)u32wps_start, pdata-pointer, 4);
-   if (ret) {
+   if ((padapter-bDriverStopped) || (pdata == NULL)) {
ret = -EINVAL;
goto exit;
}
 
-   if ((padapter-bDriverStopped) || (pdata == NULL)) {
+   ret = copy_from_user((void *)u32wps_start, pdata-pointer, 4);
+   if (ret) {
ret = -EINVAL;
goto exit;
}
@@ -4450,11 +4450,9 @@ static int rtw_dbg_port(struct net_device *dev,
struct registry_priv*pregpriv = 
padapter-registrypriv;
/*  0: disable, bit(0):enable 2.4g, bit(1):enable 5g, 
0x3: enable both 2.4g and 5g */
/* default is set to enable 2.4GHZ for IOT issue with 
bufflao's AP at 5GHZ */
-   if (pregpriv 
-   (extra_arg == 0 ||
-extra_arg == 1 ||
-extra_arg == 2 ||
-extra_arg == 3)) {
+   if (!pregpriv)
+   break;
+   if (extra_arg = 0  extra_arg = 3) {
pregpriv-rx_stbc = extra_arg;
DBG_88E(set rx_stbc =%d\n, pregpriv-rx_stbc);
} else {
@@ -4466,7 +4464,9 @@ static int rtw_dbg_port(struct net_device *dev,
{
struct registry_priv*pregpriv = 
padapter-registrypriv;
/*  0: disable, 0x1:enable (but wifi_spec should be 0), 
0x2: force enable (don't care wifi_spec) */
-   if (pregpriv  extra_arg = 0  extra_arg  3) {
+   if (!pregpriv)
+   break;
+   if (extra_arg = 0  extra_arg  3) {
pregpriv-ampdu_enable = extra_arg;
DBG_88E(set ampdu_enable =%d\n, 
pregpriv-ampdu_enable);
} else {
-- 
1.8.4.5

___
devel mailing list
de...@linuxdriverproject.org

[PATCH] hostap: fix hostap: proc: Use remove_proc_subtree()

2014-02-12 Thread Russell King - ARM Linux
remove_proc_subtree() doesn't work here as local-ddev has already
been removed, and NULLed out.  Use proc_remove() instead.

Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk
Tested-by: Russell King rmk+ker...@arm.linux.org.uk
---
I would include an oops, however the machine I discovered this on has
a page 0 populated - so the symptoms are multiple 'wlan0' entries in
/proc/net/hostap.  This is probably a candidate for stable too.

 drivers/net/wireless/hostap/hostap_proc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/hostap/hostap_proc.c 
b/drivers/net/wireless/hostap/hostap_proc.c
index aa7ad3a7a69b..4e5c0f8c9496 100644
--- a/drivers/net/wireless/hostap/hostap_proc.c
+++ b/drivers/net/wireless/hostap/hostap_proc.c
@@ -496,7 +496,7 @@ void hostap_init_proc(local_info_t *local)
 
 void hostap_remove_proc(local_info_t *local)
 {
-   remove_proc_subtree(local-ddev-name, hostap_proc);
+   proc_remove(local-proc);
 }
 
 

-- 
FTTC broadband for 0.8mile line: 5.8Mbps down 500kbps up.  Estimation
in database were 13.1 to 19Mbit for a good line, about 7.5+ for a bad.
Estimate before purchase was up to 13.2Mbit.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8821ae: Fix potential infinite loop

2014-02-12 Thread Larry Finger
Smatch reports the following:
drivers/staging/rtl8821ae/rtl8821ae/hw.c:153 _rtl8821ae_set_fw_clock_on() info: 
ignoring unreachable code.

Upon investigation, the code in this region has the capability of creating
an infinite loop.

Signed-off-by: Larry Finger larry.fin...@lwfinger.net
---
 drivers/staging/rtl8821ae/rtl8821ae/hw.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/rtl8821ae/rtl8821ae/hw.c 
b/drivers/staging/rtl8821ae/rtl8821ae/hw.c
index 5ed7a11..e8344be 100644
--- a/drivers/staging/rtl8821ae/rtl8821ae/hw.c
+++ b/drivers/staging/rtl8821ae/rtl8821ae/hw.c
@@ -147,6 +147,7 @@ static void _rtl8821ae_set_fw_clock_on(struct ieee80211_hw 
*hw,
} else {
rtlhal-bfw_clk_change_in_progress = false;
spin_unlock_bh(rtlpriv-locks.fw_ps_lock);
+   break;
}
}
 
-- 
1.8.4.5

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


[PATCH net,v3] hyperv: Fix the carrier status setting

2014-02-12 Thread Haiyang Zhang
Without this patch, the cat /sys/class/net/ethN/operstate shows
unknown, and ethtool ethN shows Link detected: yes, when VM
boots up with or without vNIC connected.

This patch fixed the problem.

Signed-off-by: Haiyang Zhang haiya...@microsoft.com
Reviewed-by: K. Y. Srinivasan k...@microsoft.com
---
 drivers/net/hyperv/netvsc_drv.c |   53 ---
 1 files changed, 38 insertions(+), 15 deletions(-)

diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 7756118..7141a19 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -88,8 +88,12 @@ static int netvsc_open(struct net_device *net)
 {
struct net_device_context *net_device_ctx = netdev_priv(net);
struct hv_device *device_obj = net_device_ctx-device_ctx;
+   struct netvsc_device *nvdev;
+   struct rndis_device *rdev;
int ret = 0;
 
+   netif_carrier_off(net);
+
/* Open up the device */
ret = rndis_filter_open(device_obj);
if (ret != 0) {
@@ -99,6 +103,11 @@ static int netvsc_open(struct net_device *net)
 
netif_start_queue(net);
 
+   nvdev = hv_get_drvdata(device_obj);
+   rdev = nvdev-extension;
+   if (!rdev-link_state)
+   netif_carrier_on(net);
+
return ret;
 }
 
@@ -229,23 +238,24 @@ void netvsc_linkstatus_callback(struct hv_device 
*device_obj,
struct net_device *net;
struct net_device_context *ndev_ctx;
struct netvsc_device *net_device;
+   struct rndis_device *rdev;
 
net_device = hv_get_drvdata(device_obj);
+   rdev = net_device-extension;
+
+   rdev-link_state = status != 1;
+
net = net_device-ndev;
 
-   if (!net) {
-   netdev_err(net, got link status but net device 
-   not initialized yet\n);
+   if (!net || net-reg_state != NETREG_REGISTERED)
return;
-   }
 
+   ndev_ctx = netdev_priv(net);
if (status == 1) {
-   netif_carrier_on(net);
-   ndev_ctx = netdev_priv(net);
schedule_delayed_work(ndev_ctx-dwork, 0);
schedule_delayed_work(ndev_ctx-dwork, msecs_to_jiffies(20));
} else {
-   netif_carrier_off(net);
+   schedule_delayed_work(ndev_ctx-dwork, 0);
}
 }
 
@@ -388,17 +398,35 @@ static const struct net_device_ops device_ops = {
  * current context when receiving RNDIS_STATUS_MEDIA_CONNECT event. So, add
  * another netif_notify_peers() into a delayed work, otherwise GARP packet
  * will not be sent after quick migration, and cause network disconnection.
+ * Also, we update the carrier status here.
  */
-static void netvsc_send_garp(struct work_struct *w)
+static void netvsc_link_change(struct work_struct *w)
 {
struct net_device_context *ndev_ctx;
struct net_device *net;
struct netvsc_device *net_device;
+   struct rndis_device *rdev;
+   bool notify;
+
+   rtnl_lock();
 
ndev_ctx = container_of(w, struct net_device_context, dwork.work);
net_device = hv_get_drvdata(ndev_ctx-device_ctx);
+   rdev = net_device-extension;
net = net_device-ndev;
-   netdev_notify_peers(net);
+
+   if (rdev-link_state) {
+   netif_carrier_off(net);
+   notify = false;
+   } else {
+   netif_carrier_on(net);
+   notify = true;
+   }
+
+   rtnl_unlock();
+
+   if (notify)
+   netdev_notify_peers(net);
 }
 
 
@@ -414,13 +442,10 @@ static int netvsc_probe(struct hv_device *dev,
if (!net)
return -ENOMEM;
 
-   /* Set initial state */
-   netif_carrier_off(net);
-
net_device_ctx = netdev_priv(net);
net_device_ctx-device_ctx = dev;
hv_set_drvdata(dev, net);
-   INIT_DELAYED_WORK(net_device_ctx-dwork, netvsc_send_garp);
+   INIT_DELAYED_WORK(net_device_ctx-dwork, netvsc_link_change);
INIT_WORK(net_device_ctx-work, do_set_multicast);
 
net-netdev_ops = device_ops;
@@ -443,8 +468,6 @@ static int netvsc_probe(struct hv_device *dev,
}
memcpy(net-dev_addr, device_info.mac_adr, ETH_ALEN);
 
-   netif_carrier_on(net);
-
ret = register_netdev(net);
if (ret != 0) {
pr_err(Unable to register netdev.\n);
-- 
1.7.4.1

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


RE: [PATCH net,v2] hyperv: Fix the carrier status setting

2014-02-12 Thread Haiyang Zhang


 -Original Message-
 From: Jason Wang [mailto:jasow...@redhat.com]
 Sent: Tuesday, February 11, 2014 4:51 AM
 To: Haiyang Zhang; da...@davemloft.net; net...@vger.kernel.org
 Cc: KY Srinivasan; o...@aepfle.de; linux-ker...@vger.kernel.org; driverdev-
 de...@linuxdriverproject.org
 Subject: Re: [PATCH net,v2] hyperv: Fix the carrier status setting
 
 On 02/11/2014 02:15 AM, Haiyang Zhang wrote:
  Without this patch, the cat /sys/class/net/ethN/operstate shows
  unknown, and ethtool ethN shows Link detected: yes, when VM
  boots up with or without vNIC connected.
 
  This patch fixed the problem.
 
  Signed-off-by: Haiyang Zhang haiya...@microsoft.com
  Reviewed-by: K. Y. Srinivasan k...@microsoft.com
  ---
   drivers/net/hyperv/netvsc_drv.c |   24 +++-
   1 files changed, 15 insertions(+), 9 deletions(-)
 
  diff --git a/drivers/net/hyperv/netvsc_drv.c
  b/drivers/net/hyperv/netvsc_drv.c index 7756118..18916f7 100644
  --- a/drivers/net/hyperv/netvsc_drv.c
  +++ b/drivers/net/hyperv/netvsc_drv.c
  @@ -88,8 +88,12 @@ static int netvsc_open(struct net_device *net)  {
  struct net_device_context *net_device_ctx = netdev_priv(net);
  struct hv_device *device_obj = net_device_ctx-device_ctx;
  +   struct netvsc_device *nvdev;
  +   struct rndis_device *rdev;
  int ret = 0;
 
  +   netif_carrier_off(net);
  +
  /* Open up the device */
  ret = rndis_filter_open(device_obj);
  if (ret != 0) {
  @@ -99,6 +103,11 @@ static int netvsc_open(struct net_device *net)
 
  netif_start_queue(net);
 
  +   nvdev = hv_get_drvdata(device_obj);
  +   rdev = nvdev-extension;
  +   if (!rdev-link_state)
 
 What if the link status interrupt comes here at this time?

Thank you for pointing this out. I have submitted an updated patch.
- Haiyang

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


[PATCH] Staging: comedi: clean up conditional statement in addi_apci_3xxx.c

2014-02-12 Thread Chase Southwood
In this if-else conditional statement, if (chan  16), but
(data[0] == INSN_CONFIG_DIO_QUERY), the function does not return early,
but the else-branch does not get executed either.  As a result, mask
would be used uninitialized in the next line.  What we want here is if
(chan  16) and (data[0] != INSN_CONFIG_DIO_QUERY), return an error, but
in every other case, initialize mask and then proceed.  Found by a static
checker.

Signed-off-by: Chase Southwood chase.southw...@yahoo.com
---
 drivers/staging/comedi/drivers/addi_apci_3xxx.c | 12 +---
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/comedi/drivers/addi_apci_3xxx.c 
b/drivers/staging/comedi/drivers/addi_apci_3xxx.c
index ceadf8e..04c5153 100644
--- a/drivers/staging/comedi/drivers/addi_apci_3xxx.c
+++ b/drivers/staging/comedi/drivers/addi_apci_3xxx.c
@@ -688,13 +688,11 @@ static int apci3xxx_dio_insn_config(struct comedi_device 
*dev,
 * Port 1 (channels 8-15) are always outputs
 * Port 2 (channels 16-23) are programmable i/o
 */
-   if (chan  16) {
-   if (data[0] != INSN_CONFIG_DIO_QUERY)
-   return -EINVAL;
-   } else {
-   /* changing any channel in port 2 changes the entire port */
-   mask = 0xff;
-   }
+   if ((chan  16)  (data[0] != INSN_CONFIG_DIO_QUERY))
+   return -EINVAL;
+
+   /* changing any channel in port 2 changes the entire port */
+   mask = 0xff;
 
ret = comedi_dio_insn_config(dev, s, insn, data, mask);
if (ret)
-- 
1.8.5.3

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


Re: [PATCH net,v3] hyperv: Fix the carrier status setting

2014-02-12 Thread Jason Wang
On 02/13/2014 08:54 AM, Haiyang Zhang wrote:
 Without this patch, the cat /sys/class/net/ethN/operstate shows
 unknown, and ethtool ethN shows Link detected: yes, when VM
 boots up with or without vNIC connected.

 This patch fixed the problem.

 Signed-off-by: Haiyang Zhang haiya...@microsoft.com
 Reviewed-by: K. Y. Srinivasan k...@microsoft.com
 ---
  drivers/net/hyperv/netvsc_drv.c |   53 
 ---
  1 files changed, 38 insertions(+), 15 deletions(-)

 diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
 index 7756118..7141a19 100644
 --- a/drivers/net/hyperv/netvsc_drv.c
 +++ b/drivers/net/hyperv/netvsc_drv.c
 @@ -88,8 +88,12 @@ static int netvsc_open(struct net_device *net)
  {
   struct net_device_context *net_device_ctx = netdev_priv(net);
   struct hv_device *device_obj = net_device_ctx-device_ctx;
 + struct netvsc_device *nvdev;
 + struct rndis_device *rdev;
   int ret = 0;
  
 + netif_carrier_off(net);
 +
   /* Open up the device */
   ret = rndis_filter_open(device_obj);
   if (ret != 0) {
 @@ -99,6 +103,11 @@ static int netvsc_open(struct net_device *net)
  
   netif_start_queue(net);
  
 + nvdev = hv_get_drvdata(device_obj);
 + rdev = nvdev-extension;
 + if (!rdev-link_state)
 + netif_carrier_on(net);
 +

Maybe you can just schedule the work here and then you can drop the
rtnl_lock in netvsc_link_change() ?
   return ret;
  }
  
 @@ -229,23 +238,24 @@ void netvsc_linkstatus_callback(struct hv_device 
 *device_obj,
   struct net_device *net;
   struct net_device_context *ndev_ctx;
   struct netvsc_device *net_device;
 + struct rndis_device *rdev;
  
   net_device = hv_get_drvdata(device_obj);
 + rdev = net_device-extension;
 +
 + rdev-link_state = status != 1;
 +
   net = net_device-ndev;
  
 - if (!net) {
 - netdev_err(net, got link status but net device 
 - not initialized yet\n);
 + if (!net || net-reg_state != NETREG_REGISTERED)
   return;
 - }
  
 + ndev_ctx = netdev_priv(net);
   if (status == 1) {
 - netif_carrier_on(net);
 - ndev_ctx = netdev_priv(net);
   schedule_delayed_work(ndev_ctx-dwork, 0);
   schedule_delayed_work(ndev_ctx-dwork, msecs_to_jiffies(20));
   } else {
 - netif_carrier_off(net);
 + schedule_delayed_work(ndev_ctx-dwork, 0);
   }
  }
  
 @@ -388,17 +398,35 @@ static const struct net_device_ops device_ops = {
   * current context when receiving RNDIS_STATUS_MEDIA_CONNECT event. So, add
   * another netif_notify_peers() into a delayed work, otherwise GARP packet
   * will not be sent after quick migration, and cause network disconnection.
 + * Also, we update the carrier status here.
   */
 -static void netvsc_send_garp(struct work_struct *w)
 +static void netvsc_link_change(struct work_struct *w)
  {
   struct net_device_context *ndev_ctx;
   struct net_device *net;
   struct netvsc_device *net_device;
 + struct rndis_device *rdev;
 + bool notify;
 +
 + rtnl_lock();
  
   ndev_ctx = container_of(w, struct net_device_context, dwork.work);
   net_device = hv_get_drvdata(ndev_ctx-device_ctx);
 + rdev = net_device-extension;
   net = net_device-ndev;
 - netdev_notify_peers(net);
 +
 + if (rdev-link_state) {
 + netif_carrier_off(net);
 + notify = false;
 + } else {
 + netif_carrier_on(net);
 + notify = true;
 + }
 +
 + rtnl_unlock();
 +
 + if (notify)
 + netdev_notify_peers(net);
  }
  

Looks like this forces arp_notify here. Is it expected?

Other looks good.
  
 @@ -414,13 +442,10 @@ static int netvsc_probe(struct hv_device *dev,
   if (!net)
   return -ENOMEM;
  
 - /* Set initial state */
 - netif_carrier_off(net);
 -
   net_device_ctx = netdev_priv(net);
   net_device_ctx-device_ctx = dev;
   hv_set_drvdata(dev, net);
 - INIT_DELAYED_WORK(net_device_ctx-dwork, netvsc_send_garp);
 + INIT_DELAYED_WORK(net_device_ctx-dwork, netvsc_link_change);
   INIT_WORK(net_device_ctx-work, do_set_multicast);
  
   net-netdev_ops = device_ops;
 @@ -443,8 +468,6 @@ static int netvsc_probe(struct hv_device *dev,
   }
   memcpy(net-dev_addr, device_info.mac_adr, ETH_ALEN);
  
 - netif_carrier_on(net);
 -
   ret = register_netdev(net);
   if (ret != 0) {
   pr_err(Unable to register netdev.\n);

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