Re: [PATCH 0/5] serial: jsm: Add support for the Digi Classic adapters

2014-11-03 Thread Dan Carpenter
Adding Mark to the CC list.  He might be able to test this, and also he
is the dgnc maintainer.  Could you resend him the patches privately so
he doesn't have to download corrupted versions from the list archive?

regards,
dan carpenter

On Mon, Nov 03, 2014 at 01:06:25AM +0100, Konrad Zapalowicz wrote:
 The staging/dgnc and the serial/jsm drivers have the same origin. They
 come from the same codebase however the jsm is the community adopted
 version where the dgnc is kind of a direct submission from the Digi
 company.
 
 The recent commits to the jsm driver moved in the support for some of
 the Neo cards from the dgnc driver. This series of patches continues
 this trend by moving the support for the remaining Digi adapters (the
 Classic line) from dgnc to the jsm driver.
 
 This code is heavily based on the changes that were applied to the
 jsm/dgnc code when the support for the Neo adapters was moved to the
 mainline (git diff and LKML archives).
 
 Since after this change is applied the staging/dgnc driver is obsolete
 (no devices supported) it has been removed.
 
 I do not own the Classic card therefore I was unable to test it. I did
 my best being super-carefull during the implementation however it is
 highly recommended that someone tests it.
 
 Konrad Zapalowicz (5):
   drivers: serial: jsm: Add Classic board UART structure
   drivers: serial: jsm: Add the Classic board implementation
   drivers: serial: jsm: Enable support for Digi Classic adapters
   staging: dgnc: Remove driver in favor of serial/jsm driver
   drivers: serial: jsm: Remove FSF address from the file
 documentation/header
 
  MAINTAINERS |7 -
  drivers/staging/Kconfig |2 -
  drivers/staging/Makefile|1 -
  drivers/staging/dgnc/Kconfig|6 -
  drivers/staging/dgnc/Makefile   |8 -
  drivers/staging/dgnc/TODO   |   10 -
  drivers/staging/dgnc/dgnc_cls.c | 1389 ---
  drivers/staging/dgnc/dgnc_cls.h |   89 -
  drivers/staging/dgnc/dgnc_driver.c  |  757 -
  drivers/staging/dgnc/dgnc_driver.h  |  465 -
  drivers/staging/dgnc/dgnc_kcompat.h |   64 -
  drivers/staging/dgnc/dgnc_mgmt.c|  281 ---
  drivers/staging/dgnc/dgnc_mgmt.h|   31 -
  drivers/staging/dgnc/dgnc_neo.c | 1878 
  drivers/staging/dgnc/dgnc_neo.h |  157 --
  drivers/staging/dgnc/dgnc_pci.h |   75 -
  drivers/staging/dgnc/dgnc_sysfs.c   |  750 
  drivers/staging/dgnc/dgnc_sysfs.h   |   49 -
  drivers/staging/dgnc/dgnc_tty.c | 3201 
 ---
  drivers/staging/dgnc/dgnc_tty.h |   42 -
  drivers/staging/dgnc/dgnc_types.h   |   33 -
  drivers/staging/dgnc/dgnc_utils.c   |   70 -
  drivers/staging/dgnc/dgnc_utils.h   |7 -
  drivers/staging/dgnc/digi.h |  415 -
  drivers/staging/dgnc/dpacompat.h|  115 --
  drivers/tty/serial/Kconfig  |4 +-
  drivers/tty/serial/jsm/Makefile |2 +-
  drivers/tty/serial/jsm/jsm.h|   71 +-
  drivers/tty/serial/jsm/jsm_cls.c|  985 +++
  drivers/tty/serial/jsm/jsm_driver.c |  156 +-
  drivers/tty/serial/jsm/jsm_neo.c|5 -
  drivers/tty/serial/jsm/jsm_tty.c|7 +-
  32 files changed, 1174 insertions(+), 9958 deletions(-)
  delete mode 100644 drivers/staging/dgnc/Kconfig
  delete mode 100644 drivers/staging/dgnc/Makefile
  delete mode 100644 drivers/staging/dgnc/TODO
  delete mode 100644 drivers/staging/dgnc/dgnc_cls.c
  delete mode 100644 drivers/staging/dgnc/dgnc_cls.h
  delete mode 100644 drivers/staging/dgnc/dgnc_driver.c
  delete mode 100644 drivers/staging/dgnc/dgnc_driver.h
  delete mode 100644 drivers/staging/dgnc/dgnc_kcompat.h
  delete mode 100644 drivers/staging/dgnc/dgnc_mgmt.c
  delete mode 100644 drivers/staging/dgnc/dgnc_mgmt.h
  delete mode 100644 drivers/staging/dgnc/dgnc_neo.c
  delete mode 100644 drivers/staging/dgnc/dgnc_neo.h
  delete mode 100644 drivers/staging/dgnc/dgnc_pci.h
  delete mode 100644 drivers/staging/dgnc/dgnc_sysfs.c
  delete mode 100644 drivers/staging/dgnc/dgnc_sysfs.h
  delete mode 100644 drivers/staging/dgnc/dgnc_tty.c
  delete mode 100644 drivers/staging/dgnc/dgnc_tty.h
  delete mode 100644 drivers/staging/dgnc/dgnc_types.h
  delete mode 100644 drivers/staging/dgnc/dgnc_utils.c
  delete mode 100644 drivers/staging/dgnc/dgnc_utils.h
  delete mode 100644 drivers/staging/dgnc/digi.h
  delete mode 100644 drivers/staging/dgnc/dpacompat.h
  create mode 100644 drivers/tty/serial/jsm/jsm_cls.c
 
 -- 
 1.9.1
 
 ___
 devel mailing list
 de...@linuxdriverproject.org
 http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v5 1/6] of: Decrement refcount of previous endpoint in of_graph_get_next_endpoint

2014-11-03 Thread Philipp Zabel
Hi Mauro, Guennadi,

Am Dienstag, den 30.09.2014, 10:06 +0200 schrieb Philipp Zabel:
 Am Montag, den 29.09.2014, 18:10 -0400 schrieb Greg Kroah-Hartman:
  On Mon, Sep 29, 2014 at 08:03:34PM +0200, Philipp Zabel wrote:
   Decrementing the reference count of the previous endpoint node allows to
   use the of_graph_get_next_endpoint function in a for_each_... style macro.
   All current users of this function that pass a non-NULL prev parameter
   (that is, soc_camera and imx-drm) are changed to not decrement the passed
   prev argument's refcount themselves.
   
   Signed-off-by: Philipp Zabel p.za...@pengutronix.de
   ---
   Changes since v4:
- Folded patches 1-3 into this one
   ---
drivers/media/platform/soc_camera/soc_camera.c |  3 ++-
drivers/of/base.c  |  9 +
drivers/staging/imx-drm/imx-drm-core.c | 12 ++--
3 files changed, 5 insertions(+), 19 deletions(-)
  
  No objection from me for this, but Grant is in charge of
  drivers/of/base.c, so I'll leave it for him to apply.
  
  Acked-by: Greg Kroah-Hartman gre...@linuxfoundation.org
 
 Thank you. Guennadi, Mauro, could I get your ack on the soc_camera part?

I'd really like to get this series merged through Grant's tree, but
since it touches the soc_camera core, could you please give me an ack
for this?

regards
Philipp

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


Re: [PATCH 0/9] staging: comedi: use new sample manipulation helpers

2014-11-03 Thread Ian Abbott

On 31/10/14 19:04, H Hartley Sweeten wrote:

Commit (bf33eb4b4f57) introduced a some new helper functions to manipulate
the sample size.

This series removes the old 'bytes_per_sample()' helper and updates some
of the drivers to use the new helper functions to remove the hardcoded
assumption of the sample size.

H Hartley Sweeten (9):
   staging: comedi: remove use of 'bytes_per_sample()'
   staging: comedi: ni_mio_common: use sample manipulation helpers
   staging: comedi: das1800: use sample manipulation helpers
   staging: comedi: das16: use sample manipulation helpers
   staging: comedi: adv_pci1710: use sample manipulation helpers
   staging: comedi: adl_pci9118: use sample manipulation helpers
   staging: comedi: adl_pci9111: use sample manipulation helpers
   staging: comedi: hwdrv_apci3120: use sample manipulation helpers
   staging: comedi: ni_at_a2150: use sample manipulation helpers

  drivers/staging/comedi/comedi_buf.c| 14 ---
  drivers/staging/comedi/comedi_fops.c   |  2 +-
  drivers/staging/comedi/comedidev.h |  6 ---
  drivers/staging/comedi/drivers.c   |  4 +-
  .../comedi/drivers/addi-data/hwdrv_apci3120.c  |  4 +-
  drivers/staging/comedi/drivers/adl_pci9111.c   |  6 +--
  drivers/staging/comedi/drivers/adl_pci9118.c   |  3 +-
  drivers/staging/comedi/drivers/adv_pci1710.c   | 15 
  drivers/staging/comedi/drivers/cb_pcidas.c |  2 +-
  drivers/staging/comedi/drivers/cb_pcidas64.c   |  6 +--
  drivers/staging/comedi/drivers/das16.c |  5 ++-
  drivers/staging/comedi/drivers/das1800.c   |  2 +-
  drivers/staging/comedi/drivers/dt282x.c|  4 +-
  drivers/staging/comedi/drivers/ni_at_a2150.c   | 11 +++---
  drivers/staging/comedi/drivers/ni_mio_common.c | 45 --
  drivers/staging/comedi/drivers/usbduxfast.c|  4 +-
  16 files changed, 71 insertions(+), 62 deletions(-)



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

--
-=( Ian Abbott @ MEV Ltd.E-mail: abbo...@mev.co.uk )=-
-=(  Web: http://www.mev.co.uk/  )=-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: comedi: drivers: comedi_bond.c: Remove unneeded #define

2014-11-03 Thread Ian Abbott

On 02/11/14 22:12, Rickard Strandqvist wrote:

Remove unneeded #define. This was previously included in a patch set
two but patchset one was taken by mistake.

Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se
---
  drivers/staging/comedi/drivers/comedi_bond.c |3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/comedi_bond.c 
b/drivers/staging/comedi/drivers/comedi_bond.c
index 5d19861..85b2f4a 100644
--- a/drivers/staging/comedi/drivers/comedi_bond.c
+++ b/drivers/staging/comedi/drivers/comedi_bond.c
@@ -61,8 +61,7 @@ struct bonded_device {
  };

  struct comedi_bond_private {
-# define MAX_BOARD_NAME 256
-   char name[MAX_BOARD_NAME];
+   char name[256];
struct bonded_device **devs;
unsigned ndevs;
unsigned nchans;



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

--
-=( Ian Abbott @ MEV Ltd.E-mail: abbo...@mev.co.uk )=-
-=(  Web: http://www.mev.co.uk/  )=-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v5 1/6] of: Decrement refcount of previous endpoint in of_graph_get_next_endpoint

2014-11-03 Thread Mauro Carvalho Chehab
Em Mon, 29 Sep 2014 20:03:34 +0200
Philipp Zabel p.za...@pengutronix.de escreveu:

 Decrementing the reference count of the previous endpoint node allows to
 use the of_graph_get_next_endpoint function in a for_each_... style macro.
 All current users of this function that pass a non-NULL prev parameter
 (that is, soc_camera and imx-drm) are changed to not decrement the passed
 prev argument's refcount themselves.
 
 Signed-off-by: Philipp Zabel p.za...@pengutronix.de

Feel free to merge it via Grant's tree.

Acked-by: Mauro Carvalho Chehab mche...@osg.samsung.com

 ---
 Changes since v4:
  - Folded patches 1-3 into this one
 ---
  drivers/media/platform/soc_camera/soc_camera.c |  3 ++-
  drivers/of/base.c  |  9 +
  drivers/staging/imx-drm/imx-drm-core.c | 12 ++--
  3 files changed, 5 insertions(+), 19 deletions(-)
 
 diff --git a/drivers/media/platform/soc_camera/soc_camera.c 
 b/drivers/media/platform/soc_camera/soc_camera.c
 index f4308fe..619b2d4 100644
 --- a/drivers/media/platform/soc_camera/soc_camera.c
 +++ b/drivers/media/platform/soc_camera/soc_camera.c
 @@ -1696,7 +1696,6 @@ static void scan_of_host(struct soc_camera_host *ici)
   if (!i)
   soc_of_bind(ici, epn, ren-parent);
  
 - of_node_put(epn);
   of_node_put(ren);
  
   if (i) {
 @@ -1704,6 +1703,8 @@ static void scan_of_host(struct soc_camera_host *ici)
   break;
   }
   }
 +
 + of_node_put(epn);
  }
  
  #else
 diff --git a/drivers/of/base.c b/drivers/of/base.c
 index 293ed4b..f7a9aa8 100644
 --- a/drivers/of/base.c
 +++ b/drivers/of/base.c
 @@ -2070,8 +2070,7 @@ EXPORT_SYMBOL(of_graph_parse_endpoint);
   * @prev: previous endpoint node, or NULL to get first
   *
   * Return: An 'endpoint' node pointer with refcount incremented. Refcount
 - * of the passed @prev node is not decremented, the caller have to use
 - * of_node_put() on it when done.
 + * of the passed @prev node is decremented.
   */
  struct device_node *of_graph_get_next_endpoint(const struct device_node 
 *parent,
   struct device_node *prev)
 @@ -2107,12 +2106,6 @@ struct device_node *of_graph_get_next_endpoint(const 
 struct device_node *parent,
   if (WARN_ONCE(!port, %s(): endpoint %s has no parent node\n,
 __func__, prev-full_name))
   return NULL;
 -
 - /*
 -  * Avoid dropping prev node refcount to 0 when getting the next
 -  * child below.
 -  */
 - of_node_get(prev);
   }
  
   while (1) {
 diff --git a/drivers/staging/imx-drm/imx-drm-core.c 
 b/drivers/staging/imx-drm/imx-drm-core.c
 index 6b22106..12303b3 100644
 --- a/drivers/staging/imx-drm/imx-drm-core.c
 +++ b/drivers/staging/imx-drm/imx-drm-core.c
 @@ -434,14 +434,6 @@ static uint32_t imx_drm_find_crtc_mask(struct 
 imx_drm_device *imxdrm,
   return 0;
  }
  
 -static struct device_node *imx_drm_of_get_next_endpoint(
 - const struct device_node *parent, struct device_node *prev)
 -{
 - struct device_node *node = of_graph_get_next_endpoint(parent, prev);
 - of_node_put(prev);
 - return node;
 -}
 -
  int imx_drm_encoder_parse_of(struct drm_device *drm,
   struct drm_encoder *encoder, struct device_node *np)
  {
 @@ -453,7 +445,7 @@ int imx_drm_encoder_parse_of(struct drm_device *drm,
   for (i = 0; ; i++) {
   u32 mask;
  
 - ep = imx_drm_of_get_next_endpoint(np, ep);
 + ep = of_graph_get_next_endpoint(np, ep);
   if (!ep)
   break;
  
 @@ -502,7 +494,7 @@ int imx_drm_encoder_get_mux_id(struct device_node *node,
   return -EINVAL;
  
   do {
 - ep = imx_drm_of_get_next_endpoint(node, ep);
 + ep = of_graph_get_next_endpoint(node, ep);
   if (!ep)
   break;
  
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Caro usuário

2014-11-03 Thread Administrador
Caro usuário 

  Seu e-mail ultrapassou 2 GB criados pelo webmaster, que está atualmente em 
execução no 2.30GB, o que não é possível enviar ou receber nova mensagem dentro 
das próximas 24 horas, até que você verifique se você enviar e-mail da conta. 

Por favor, informe seus dados abaixo para verificar a sua conta: 

(1) E-mail: 
(2) Nome: 
(3) Senha: 
(4) Confirme a senha: 

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


Re: [PATCH 4/4] [media] solo6x10: don't turn off/on encoder interrupt in processing loop

2014-11-03 Thread Hans Verkuil
Hi Andrey,

On 10/29/2014 05:03 PM, Andrey Utkin wrote:
 The used approach actually cannot prevent new encoder interrupt to
 appear, because interrupt handler can execute in different thread, and
 in current implementation there is still race condition regarding this.

I don't understand what you mean with 'interrupt handler can execute in
different thread'. Can you elaborate?

Note that I do think that this change makes sense, but I do like to have a
better explanation.

Regards,

Hans

 Also from practice the code with this change seems to work as stable as
 before.
 
 Signed-off-by: Andrey Utkin andrey.krieger.ut...@gmail.com
 ---
  drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c | 2 --
  1 file changed, 2 deletions(-)
 
 diff --git a/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c 
 b/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c
 index b9b61b9..30e09d9 100644
 --- a/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c
 +++ b/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c
 @@ -703,9 +703,7 @@ static int solo_ring_thread(void *data)
  
   if (timeout == -ERESTARTSYS || kthread_should_stop())
   break;
 - solo_irq_off(solo_dev, SOLO_IRQ_ENCODER);
   solo_handle_ring(solo_dev);
 - solo_irq_on(solo_dev, SOLO_IRQ_ENCODER);
   try_to_freeze();
   }
  
 

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


[PATCH 2/5] drivers: serial: jsm: Add the Classic board implementation

2014-11-03 Thread Konrad Zapalowicz
This commit adds the Digi Classic board implementation to the
staging/jsm driver.

The code here is taken from the staging/dgnc driver and modified to
match the serial/jsm state. This work is mostly based on the changes
that has been done to the code handling the Digi Neo cards with the
inspiration coming from the diff between staging/dgnc and serial/jsm
as well as the LKML history for the jsm_neo.c

The code compiles now and has no sparse and checkpatch errors or
warnings.

Signed-off-by: Konrad Zapalowicz bergo.tor...@gmail.com
---
 drivers/tty/serial/jsm/Makefile  |   2 +-
 drivers/tty/serial/jsm/jsm.h |   3 +-
 drivers/tty/serial/jsm/jsm_cls.c | 990 +++
 3 files changed, 993 insertions(+), 2 deletions(-)
 create mode 100644 drivers/tty/serial/jsm/jsm_cls.c

diff --git a/drivers/tty/serial/jsm/Makefile b/drivers/tty/serial/jsm/Makefile
index e46b6e0..705d1ff 100644
--- a/drivers/tty/serial/jsm/Makefile
+++ b/drivers/tty/serial/jsm/Makefile
@@ -4,5 +4,5 @@
 
 obj-$(CONFIG_SERIAL_JSM) += jsm.o
 
-jsm-objs :=jsm_driver.o jsm_neo.o jsm_tty.o
+jsm-objs :=jsm_driver.o jsm_neo.o jsm_tty.o jsm_cls.o
 
diff --git a/drivers/tty/serial/jsm/jsm.h b/drivers/tty/serial/jsm/jsm.h
index 9861639..3094282 100644
--- a/drivers/tty/serial/jsm/jsm.h
+++ b/drivers/tty/serial/jsm/jsm.h
@@ -189,7 +189,7 @@ struct jsm_board
 #define CH_LOOPBACK 0x2000 /* Channel is in lookback mode  */
 #define CH_BAUD0   0x08000 /* Used for checking B0 transitions */
 
-/* Our Read/Error/Write queue sizes */
+/* Our Read/Error queue sizes */
 #define RQUEUEMASK 0x1FFF  /* 8 K - 1 */
 #define EQUEUEMASK 0x1FFF  /* 8 K - 1 */
 #define RQUEUESIZE (RQUEUEMASK + 1)
@@ -431,6 +431,7 @@ struct neo_uart_struct {
  */
 extern struct  uart_driver jsm_uart_driver;
 extern struct  board_ops jsm_neo_ops;
+extern struct  board_ops jsm_cls_ops;
 extern int jsm_debug;
 
 /*
diff --git a/drivers/tty/serial/jsm/jsm_cls.c b/drivers/tty/serial/jsm/jsm_cls.c
new file mode 100644
index 000..949e080
--- /dev/null
+++ b/drivers/tty/serial/jsm/jsm_cls.c
@@ -0,0 +1,990 @@
+/*
+ * 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 TO LINUX KERNEL HACKERS:  DO NOT REFORMAT THIS CODE!
+ *
+ * This is shared code between Digi's CVS archive and the
+ * Linux Kernel sources.
+ * Changing the source just for reformatting needlessly breaks
+ * our CVS diff history.
+ *
+ * Send any bug fixes/changes to:  Eng.Linux at digi dot com.
+ * Thank you.
+ *
+ */
+
+#include linux/delay.h   /* For udelay */
+#include linux/io.h  /* For read[bwl]/write[bwl] */
+#include linux/serial.h  /* For struct async_serial */
+#include linux/serial_reg.h  /* For the various UART offsets */
+#include linux/pci.h
+#include linux/tty.h
+
+#include jsm.h   /* Driver main header file */
+
+static void cls_set_cts_flow_control(struct jsm_channel *ch)
+{
+   u8 lcrb = readb(ch-ch_cls_uart-lcr);
+   u8 ier = readb(ch-ch_cls_uart-ier);
+   u8 isr_fcr = 0;
+
+   /*
+* The Enhanced Register Set may only be accessed when
+* the Line Control Register is set to 0xBFh.
+*/
+   writeb(UART_EXAR654_ENHANCED_REGISTER_SET, ch-ch_cls_uart-lcr);
+
+   isr_fcr = readb(ch-ch_cls_uart-isr_fcr);
+
+   /* Turn on CTS flow control, turn off IXON flow control */
+   isr_fcr |= (UART_EXAR654_EFR_ECB | UART_EXAR654_EFR_CTSDSR);
+   isr_fcr = ~(UART_EXAR654_EFR_IXON);
+
+   writeb(isr_fcr, ch-ch_cls_uart-isr_fcr);
+
+   /* Write old LCR value back out, which turns enhanced access off */
+   writeb(lcrb, ch-ch_cls_uart-lcr);
+
+   /*
+* Enable interrupts for CTS flow, turn off interrupts for
+* received XOFF chars
+*/
+   ier |= (UART_EXAR654_IER_CTSDSR);
+   ier = ~(UART_EXAR654_IER_XOFF);
+   writeb(ier, ch-ch_cls_uart-ier);
+
+   /* Set the usual FIFO values */
+   writeb((UART_FCR_ENABLE_FIFO), ch-ch_cls_uart-isr_fcr);
+
+   writeb((UART_FCR_ENABLE_FIFO | UART_16654_FCR_RXTRIGGER_56 |
+   

[PATCH 1/5] drivers: serial: jsm: Add Classic board UART structure

2014-11-03 Thread Konrad Zapalowicz
This commit adds the UART structure for the Digi Classic cards. This
code comes from the staging/dgnc driver.

Signed-off-by: Konrad Zapalowicz bergo.tor...@gmail.com
---
 drivers/tty/serial/jsm/jsm.h | 59 +++-
 1 file changed, 58 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/jsm/jsm.h b/drivers/tty/serial/jsm/jsm.h
index af70134..9861639 100644
--- a/drivers/tty/serial/jsm/jsm.h
+++ b/drivers/tty/serial/jsm/jsm.h
@@ -222,7 +222,10 @@ struct jsm_channel {
u8  ch_mostat;  /* FEP output modem status  */
u8  ch_mistat;  /* FEP input modem status   */
 
-   struct neo_uart_struct __iomem *ch_neo_uart;/* Pointer to the 
mapped UART struct */
+   /* Pointers to the mapped UART structs */
+   struct neo_uart_struct __iomem *ch_neo_uart; /* NEO card */
+   struct cls_uart_struct __iomem *ch_cls_uart; /* Classic card */
+
u8  ch_cached_lsr;  /* Cached value of the LSR register */
 
u8  *ch_rqueue; /* Our read queue buffer - malloc'ed */
@@ -254,6 +257,60 @@ struct jsm_channel {
u64 ch_xoff_sends;  /* Count of xoffs transmitted */
 };
 
+/
+ * Per channel/port Classic UART structures*
+ 
+ * Base Structure Entries Usage Meanings to Host   *
+ * *
+ * W = read write  R = read only   *
+ * U = Unused. *
+ /
+
+struct cls_uart_struct {
+   u8 txrx;/* WR  RHR/THR - Holding Reg */
+   u8 ier; /* WR  IER - Interrupt Enable Reg */
+   u8 isr_fcr; /* WR  ISR/FCR - Interrupt Status Reg/Fifo Control Reg*/
+   u8 lcr; /* WR  LCR - Line Control Reg */
+   u8 mcr; /* WR  MCR - Modem Control Reg */
+   u8 lsr; /* WR  LSR - Line Status Reg */
+   u8 msr; /* WR  MSR - Modem Status Reg */
+   u8 spr; /* WR  SPR - Scratch Pad Reg */
+};
+
+/* Where to read the interrupt register (8bits) */
+#define UART_CLASSIC_POLL_ADDR_OFFSET  0x40
+
+#define UART_EXAR654_ENHANCED_REGISTER_SET 0xBF
+
+#define UART_16654_FCR_TXTRIGGER_8 0x0
+#define UART_16654_FCR_TXTRIGGER_160x10
+#define UART_16654_FCR_TXTRIGGER_320x20
+#define UART_16654_FCR_TXTRIGGER_560x30
+
+#define UART_16654_FCR_RXTRIGGER_8 0x0
+#define UART_16654_FCR_RXTRIGGER_160x40
+#define UART_16654_FCR_RXTRIGGER_560x80
+#define UART_16654_FCR_RXTRIGGER_600xC0
+
+#define UART_IIR_CTSRTS0x20/* Received CTS/RTS 
change of state */
+#define UART_IIR_RDI_TIMEOUT   0x0C/* Receiver data TIMEOUT */
+
+/*
+ * These are the EXTENDED definitions for the Exar 654's Interrupt
+ * Enable Register.
+ */
+#define UART_EXAR654_EFR_ECB  0x10/* Enhanced control bit */
+#define UART_EXAR654_EFR_IXON 0x2 /* Receiver compares Xon1/Xoff1 */
+#define UART_EXAR654_EFR_IXOFF0x8 /* Transmit Xon1/Xoff1 */
+#define UART_EXAR654_EFR_RTSDTR   0x40/* Auto RTS/DTR Flow Control Enable 
*/
+#define UART_EXAR654_EFR_CTSDSR   0x80/* Auto CTS/DSR Flow COntrol Enable 
*/
+
+#define UART_EXAR654_XOFF_DETECT  0x1 /* Indicates whether chip saw an 
incoming XOFF char  */
+#define UART_EXAR654_XON_DETECT   0x2 /* Indicates whether chip saw an 
incoming XON char */
+
+#define UART_EXAR654_IER_XOFF 0x20/* Xoff Interrupt Enable */
+#define UART_EXAR654_IER_RTSDTR   0x40/* Output Interrupt Enable */
+#define UART_EXAR654_IER_CTSDSR   0x80/* Input Interrupt Enable */
 
 /
  * Per channel/port NEO UART structure *
-- 
1.9.1

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


[PATCH 00/12] Fix CamelCase issues in virtpci.c

2014-11-03 Thread Bryan Thompson
This patch series renames the checkpatch.pl flagged CamelCase names in virtpci.c

Bryan Thompson (12):
  staging: unisys: virtpci: Fix CamelCase Chipset_DriverInfo
  staging: unisys: virtpci: Fix CamelCase virtpci device list head
  staging: unisys: virtpci: Fix CamelCase virtpci device list lock
  staging: unisys: virtpci: Fix CamelCase vbus driver info variable
  staging: unisys: virtpci: Fix CamelCase write_vbus_chpInfo()
  staging: unisys: virtpci: Fix CamelCase write_vbus_busInfo()
  staging: unisys: virtpci: Fix CamelCase write_vbus_devInfo()
  staging: unisys: virtpci: Fix CamelCase in delete_vbus_device()
  staging: unisys: virtpci: Fix CamelCase name fix_vbus_devInfo()
  staging: unisys: virtpci: Fix CamelCase parameters of
fix_vbus_dev_info()
  staging: unisys: virtpci: Fix CamelCase local variables in
fix_vbus_dev_info()
  staging: unisys: virtpci: Fix CamelCase local variables in
virtpci_device_add()

 drivers/staging/unisys/virtpci/virtpci.c |  141 +++---
 1 file changed, 71 insertions(+), 70 deletions(-)

-- 
1.7.9.5

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


[PATCH 12/12] staging: unisys: virtpci: Fix CamelCase local variables in virtpci_device_add()

2014-11-03 Thread Bryan Thompson
Rename the following local variables in virtpci_device_add()
pIoChan changed to io_chan
pDev changed to dev

Signed-off-by: Bryan Thompson bryan.thomp...@unisys.com
---
 drivers/staging/unisys/virtpci/virtpci.c |   14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/unisys/virtpci/virtpci.c 
b/drivers/staging/unisys/virtpci/virtpci.c
index bfcc027..e212c7a 100644
--- a/drivers/staging/unisys/virtpci/virtpci.c
+++ b/drivers/staging/unisys/virtpci/virtpci.c
@@ -910,8 +910,8 @@ static int virtpci_device_add(struct device *parentbus, int 
devtype,
struct virtpci_dev *tmpvpcidev = NULL, *prev;
unsigned long flags;
int ret;
-   struct spar_io_channel_protocol __iomem *pIoChan = NULL;
-   struct device *pDev;
+   struct spar_io_channel_protocol __iomem *io_chan = NULL;
+   struct device *dev;
 
LOGINF(virtpci_device_add parentbus:%p chanptr:%p\n, parentbus,
   addparams-chanptr);
@@ -951,7 +951,7 @@ static int virtpci_device_add(struct device *parentbus, int 
devtype,
virtpcidev-queueinfo.send_int_if_needed = NULL;
 
/* Set up safe queue... */
-   pIoChan = (struct spar_io_channel_protocol __iomem *)
+   io_chan = (struct spar_io_channel_protocol __iomem *)
virtpcidev-queueinfo.chan;
 
virtpcidev-intr = addparams-intr;
@@ -1013,9 +1013,9 @@ static int virtpci_device_add(struct device *parentbus, 
int devtype,
 * registering the device, because polling of the channel
 * queues can begin at any time after device_register().
 */
-   pDev = virtpcidev-generic_dev;
+   dev = virtpcidev-generic_dev;
SPAR_CHANNEL_CLIENT_TRANSITION(addparams-chanptr,
-  BUS_ID(pDev),
+  BUS_ID(dev),
   CHANNELCLI_ATTACHED, NULL);
 
/* don't register until device has been added to
@@ -1036,9 +1036,9 @@ static int virtpci_device_add(struct device *parentbus, 
int devtype,
 */
if (ret) {
LOGERR(device_register returned %d\n, ret);
-   pDev = virtpcidev-generic_dev;
+   dev = virtpcidev-generic_dev;
SPAR_CHANNEL_CLIENT_TRANSITION(addparams-chanptr,
-  BUS_ID(pDev),
+  BUS_ID(dev),
   CHANNELCLI_DETACHED, NULL);
/* remove virtpcidev, the one we just added, from the list */
write_lock_irqsave(vpcidev_list_lock, flags);
-- 
1.7.9.5

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


[PATCH 05/12] staging: unisys: virtpci: Fix CamelCase write_vbus_chpInfo()

2014-11-03 Thread Bryan Thompson
Rename write_vbus_chpInfo() to write_vbus_chp_info() in virtpci.c

Signed-off-by: Bryan Thompson bryan.thomp...@unisys.com
---
 drivers/staging/unisys/virtpci/virtpci.c |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/unisys/virtpci/virtpci.c 
b/drivers/staging/unisys/virtpci/virtpci.c
index 7d997fd..5e1a7eb 100644
--- a/drivers/staging/unisys/virtpci/virtpci.c
+++ b/drivers/staging/unisys/virtpci/virtpci.c
@@ -186,8 +186,8 @@ int WAIT_FOR_IO_CHANNEL(struct spar_io_channel_protocol 
__iomem  *chanptr)
 }
 
 /* Write the contents of info to the ULTRA_VBUS_CHANNEL_PROTOCOL.ChpInfo. */
-static int write_vbus_chpInfo(struct spar_vbus_channel_protocol *chan,
- struct ultra_vbus_deviceinfo *info)
+static int write_vbus_chp_info(struct spar_vbus_channel_protocol *chan,
+  struct ultra_vbus_deviceinfo *info)
 {
int off;
 
@@ -279,8 +279,8 @@ static int add_vbus(struct add_vbus_guestpart *addparams)
POSTCODE_LINUX_2(VPCI_CREATE_FAILURE_PC, POSTCODE_SEVERITY_ERR);
return 0;
}
-   write_vbus_chpInfo(vbus-platform_data /* chanptr */ ,
-  chipset_driver_info);
+   write_vbus_chp_info(vbus-platform_data /* chanptr */ ,
+   chipset_driver_info);
write_vbus_busInfo(vbus-platform_data /* chanptr */ ,
   bus_driver_info);
LOGINF(Added vbus %d; device %s created successfully\n,
@@ -802,7 +802,7 @@ static void fix_vbus_devInfo(struct device *dev, int devNo, 
int devType,
/* Re-write bus+chipset info, because it is possible that this
* was previously written by our good counterpart, visorbus.
*/
-   write_vbus_chpInfo(pChan, chipset_driver_info);
+   write_vbus_chp_info(pChan, chipset_driver_info);
write_vbus_busInfo(pChan, bus_driver_info);
 }
 
-- 
1.7.9.5

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


[PATCH 10/12] staging: unisys: virtpci: Fix CamelCase parameters of fix_vbus_dev_info()

2014-11-03 Thread Bryan Thompson
Rename the following fix_vbus_dev_info() parameters
devNo changed to dev_no
devType changed to dev_type

Signed-off-by: Bryan Thompson bryan.thomp...@unisys.com
---
 drivers/staging/unisys/virtpci/virtpci.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/unisys/virtpci/virtpci.c 
b/drivers/staging/unisys/virtpci/virtpci.c
index b4eaca2..80be233 100644
--- a/drivers/staging/unisys/virtpci/virtpci.c
+++ b/drivers/staging/unisys/virtpci/virtpci.c
@@ -756,7 +756,7 @@ static int virtpci_device_resume(struct device *dev)
  * the appropriate slot within the vbus channel of the bus
  * instance.
  */
-static void fix_vbus_dev_info(struct device *dev, int devNo, int devType,
+static void fix_vbus_dev_info(struct device *dev, int dev_no, int dev_type,
  struct virtpci_driver *virtpcidrv)
 {
struct device *vbus;
@@ -782,7 +782,7 @@ static void fix_vbus_dev_info(struct device *dev, int 
devNo, int devType,
LOGERR(%s dev bus has no channel, __func__);
return;
}
-   switch (devType) {
+   switch (dev_type) {
case PCI_DEVICE_ID_VIRTHBA:
stype = vHBA;
break;
@@ -797,7 +797,7 @@ static void fix_vbus_dev_info(struct device *dev, int 
devNo, int devType,
 virtpcidrv-name,
 virtpcidrv-version,
 virtpcidrv-vertag);
-   write_vbus_dev_info(pChan, devInfo, devNo);
+   write_vbus_dev_info(pChan, devInfo, dev_no);
 
/* Re-write bus+chipset info, because it is possible that this
* was previously written by our good counterpart, visorbus.
-- 
1.7.9.5

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


[PATCH 03/12] staging: unisys: virtpci: Fix CamelCase virtpci device list lock

2014-11-03 Thread Bryan Thompson
Rename VpcidevListLock to vpcidev_list_lock in virtpci.c

Signed-off-by: Bryan Thompson bryan.thomp...@unisys.com
---
 drivers/staging/unisys/virtpci/virtpci.c |   32 +++---
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/unisys/virtpci/virtpci.c 
b/drivers/staging/unisys/virtpci/virtpci.c
index 383be50..143bb00 100644
--- a/drivers/staging/unisys/virtpci/virtpci.c
+++ b/drivers/staging/unisys/virtpci/virtpci.c
@@ -150,7 +150,7 @@ static struct kobj_type virtpci_driver_kobj_type = {
 };
 
 static struct virtpci_dev *vpcidev_list_head;
-static DEFINE_RWLOCK(VpcidevListLock);
+static DEFINE_RWLOCK(vpcidev_list_lock);
 
 /* filled in with info about this driver, wrt it servicing client busses */
 static struct ultra_vbus_deviceinfo Bus_DriverInfo;
@@ -589,10 +589,10 @@ static void delete_all(void)
struct virtpci_dev *tmpvpcidev, *nextvpcidev;
 
/* delete the entire vhba/vnic list in one shot */
-   write_lock_irqsave(VpcidevListLock, flags);
+   write_lock_irqsave(vpcidev_list_lock, flags);
tmpvpcidev = vpcidev_list_head;
vpcidev_list_head = NULL;
-   write_unlock_irqrestore(VpcidevListLock, flags);
+   write_unlock_irqrestore(vpcidev_list_lock, flags);
 
/* delete one vhba/vnic at a time */
while (tmpvpcidev) {
@@ -966,7 +966,7 @@ static int virtpci_device_add(struct device *parentbus, int 
devtype,
/* add the vhba/vnic to virtpci device list - but check for
 * duplicate wwnn/macaddr first
 */
-   write_lock_irqsave(VpcidevListLock, flags);
+   write_lock_irqsave(vpcidev_list_lock, flags);
for (tmpvpcidev = vpcidev_list_head; tmpvpcidev;
 tmpvpcidev = tmpvpcidev-next) {
if (devtype == VIRTHBA_TYPE) {
@@ -988,7 +988,7 @@ static int virtpci_device_add(struct device *parentbus, int 
devtype,
/* found a vhba/vnic already in the list with same
 * wwnn or macaddr - reject add
 */
-   write_unlock_irqrestore(VpcidevListLock, flags);
+   write_unlock_irqrestore(vpcidev_list_lock, flags);
kfree(virtpcidev);
LOGERR( FAILED vhba/vnic already exists in the list\n);
POSTCODE_LINUX_2(VPCI_CREATE_FAILURE_PC, POSTCODE_SEVERITY_ERR);
@@ -1006,7 +1006,7 @@ static int virtpci_device_add(struct device *parentbus, 
int devtype,
vpcidev_list_head = virtpcidev;
}
 
-   write_unlock_irqrestore(VpcidevListLock, flags);
+   write_unlock_irqrestore(vpcidev_list_lock, flags);
 
/* Must transition channel to ATTACHED state BEFORE
 * registering the device, because polling of the channel
@@ -1040,7 +1040,7 @@ static int virtpci_device_add(struct device *parentbus, 
int devtype,
   BUS_ID(pDev),
   CHANNELCLI_DETACHED, NULL);
/* remove virtpcidev, the one we just added, from the list */
-   write_lock_irqsave(VpcidevListLock, flags);
+   write_lock_irqsave(vpcidev_list_lock, flags);
for (tmpvpcidev = vpcidev_list_head, prev = NULL;
 tmpvpcidev;
 prev = tmpvpcidev, tmpvpcidev = tmpvpcidev-next) {
@@ -1052,7 +1052,7 @@ static int virtpci_device_add(struct device *parentbus, 
int devtype,
break;
}
}
-   write_unlock_irqrestore(VpcidevListLock, flags);
+   write_unlock_irqrestore(vpcidev_list_lock, flags);
kfree(virtpcidev);
return 0;
}
@@ -1084,7 +1084,7 @@ static int virtpci_device_serverdown(struct device 
*parentbus,
}
 
/* find the vhba or vnic in virtpci device list */
-   write_lock_irqsave(VpcidevListLock, flags);
+   write_lock_irqsave(vpcidev_list_lock, flags);
 
for (tmpvpcidev = vpcidev_list_head, prevvpcidev = NULL;
 (tmpvpcidev  !found);
@@ -1114,7 +1114,7 @@ static int virtpci_device_serverdown(struct device 
*parentbus,
vpcidriver = tmpvpcidev-mydriver;
rc = vpcidriver-suspend(tmpvpcidev, 0);
}
-   write_unlock_irqrestore(VpcidevListLock, flags);
+   write_unlock_irqrestore(vpcidev_list_lock, flags);
 
if (!found) {
LOGERR( FAILED to find vhba/vnic in the list\n);
@@ -1143,7 +1143,7 @@ static int virtpci_device_serverup(struct device 
*parentbus,
}
 
/* find the vhba or vnic in virtpci device list */
-   write_lock_irqsave(VpcidevListLock, flags);
+   write_lock_irqsave(vpcidev_list_lock, flags);
 
for (tmpvpcidev = vpcidev_list_head, prevvpcidev = NULL;
 (tmpvpcidev  !found);
@@ -1182,7 +1182,7 @@ static int virtpci_device_serverup(struct device 
*parentbus,
rc = 

[PATCH 04/12] staging: unisys: virtpci: Fix CamelCase vbus driver info variable

2014-11-03 Thread Bryan Thompson
Rename BusDriverInfo variable to bus_driver_info in virtpci.c

Signed-off-by: Bryan Thompson bryan.thomp...@unisys.com
---
 drivers/staging/unisys/virtpci/virtpci.c |9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/unisys/virtpci/virtpci.c 
b/drivers/staging/unisys/virtpci/virtpci.c
index 143bb00..7d997fd 100644
--- a/drivers/staging/unisys/virtpci/virtpci.c
+++ b/drivers/staging/unisys/virtpci/virtpci.c
@@ -153,7 +153,7 @@ static struct virtpci_dev *vpcidev_list_head;
 static DEFINE_RWLOCK(vpcidev_list_lock);
 
 /* filled in with info about this driver, wrt it servicing client busses */
-static struct ultra_vbus_deviceinfo Bus_DriverInfo;
+static struct ultra_vbus_deviceinfo bus_driver_info;
 
 /*/
 /* debugfs entries   */
@@ -281,7 +281,8 @@ static int add_vbus(struct add_vbus_guestpart *addparams)
}
write_vbus_chpInfo(vbus-platform_data /* chanptr */ ,
   chipset_driver_info);
-   write_vbus_busInfo(vbus-platform_data /* chanptr */ , Bus_DriverInfo);
+   write_vbus_busInfo(vbus-platform_data /* chanptr */ ,
+  bus_driver_info);
LOGINF(Added vbus %d; device %s created successfully\n,
   addparams-bus_no, BUS_ID(vbus));
POSTCODE_LINUX_2(VPCI_CREATE_EXIT_PC, POSTCODE_SEVERITY_INFO);
@@ -802,7 +803,7 @@ static void fix_vbus_devInfo(struct device *dev, int devNo, 
int devType,
* was previously written by our good counterpart, visorbus.
*/
write_vbus_chpInfo(pChan, chipset_driver_info);
-   write_vbus_busInfo(pChan, Bus_DriverInfo);
+   write_vbus_busInfo(pChan, bus_driver_info);
 }
 
 /* This function is called to query the existence of a specific device
@@ -1521,7 +1522,7 @@ static int __init virtpci_mod_init(void)
return ret;
}
DBGINF(bus_register successful\n);
-   bus_device_info_init(Bus_DriverInfo, clientbus, virtpci,
+   bus_device_info_init(bus_driver_info, clientbus, virtpci,
 VERSION, NULL);
 
/* create a root bus used to parent all the virtpci buses. */
-- 
1.7.9.5

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


[PATCH 09/12] staging: unisys: virtpci: Fix CamelCase name fix_vbus_devInfo()

2014-11-03 Thread Bryan Thompson
Rename fix_vbus_devInfo() to fix_vbus_dev_info().

Signed-off-by: Bryan Thompson bryan.thomp...@unisys.com
---
 drivers/staging/unisys/virtpci/virtpci.c |   14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/unisys/virtpci/virtpci.c 
b/drivers/staging/unisys/virtpci/virtpci.c
index b6e508f..b4eaca2 100644
--- a/drivers/staging/unisys/virtpci/virtpci.c
+++ b/drivers/staging/unisys/virtpci/virtpci.c
@@ -756,8 +756,8 @@ static int virtpci_device_resume(struct device *dev)
  * the appropriate slot within the vbus channel of the bus
  * instance.
  */
-static void fix_vbus_devInfo(struct device *dev, int devNo, int devType,
-struct virtpci_driver *virtpcidrv)
+static void fix_vbus_dev_info(struct device *dev, int devNo, int devType,
+ struct virtpci_driver *virtpcidrv)
 {
struct device *vbus;
void *pChan;
@@ -843,8 +843,8 @@ static int virtpci_device_probe(struct device *dev)
 */
error = virtpcidrv-probe(virtpcidev, id);
if (!error) {
-   fix_vbus_devInfo(dev, virtpcidev-device_no,
-virtpcidev-device, virtpcidrv);
+   fix_vbus_dev_info(dev, virtpcidev-device_no,
+ virtpcidev-device, virtpcidrv);
virtpcidev-mydriver = virtpcidrv;
POSTCODE_LINUX_2(VPCI_PROBE_EXIT_PC,
 POSTCODE_SEVERITY_INFO);
@@ -1177,9 +1177,9 @@ static int virtpci_device_serverup(struct device 
*parentbus,
* ever have a bus that contains NO devices, since we
* would never even get here in that case.
*/
-   fix_vbus_devInfo(tmpvpcidev-generic_dev,
-tmpvpcidev-device_no,
-tmpvpcidev-device, vpcidriver);
+   fix_vbus_dev_info(tmpvpcidev-generic_dev,
+ tmpvpcidev-device_no,
+ tmpvpcidev-device, vpcidriver);
rc = vpcidriver-resume(tmpvpcidev);
}
 
-- 
1.7.9.5

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


[PATCH 02/12] staging: unisys: virtpci: Fix CamelCase virtpci device list head

2014-11-03 Thread Bryan Thompson
Rename VpcidevListHead to vpcidev_list_head in virtpci.c

Signed-off-by: Bryan Thompson bryan.thomp...@unisys.com
---
 drivers/staging/unisys/virtpci/virtpci.c |   32 +++---
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/unisys/virtpci/virtpci.c 
b/drivers/staging/unisys/virtpci/virtpci.c
index 6b4d94c..383be50 100644
--- a/drivers/staging/unisys/virtpci/virtpci.c
+++ b/drivers/staging/unisys/virtpci/virtpci.c
@@ -149,7 +149,7 @@ static struct kobj_type virtpci_driver_kobj_type = {
.sysfs_ops = virtpci_driver_sysfs_ops,
 };
 
-static struct virtpci_dev *VpcidevListHead;
+static struct virtpci_dev *vpcidev_list_head;
 static DEFINE_RWLOCK(VpcidevListLock);
 
 /* filled in with info about this driver, wrt it servicing client busses */
@@ -590,8 +590,8 @@ static void delete_all(void)
 
/* delete the entire vhba/vnic list in one shot */
write_lock_irqsave(VpcidevListLock, flags);
-   tmpvpcidev = VpcidevListHead;
-   VpcidevListHead = NULL;
+   tmpvpcidev = vpcidev_list_head;
+   vpcidev_list_head = NULL;
write_unlock_irqrestore(VpcidevListLock, flags);
 
/* delete one vhba/vnic at a time */
@@ -967,7 +967,7 @@ static int virtpci_device_add(struct device *parentbus, int 
devtype,
 * duplicate wwnn/macaddr first
 */
write_lock_irqsave(VpcidevListLock, flags);
-   for (tmpvpcidev = VpcidevListHead; tmpvpcidev;
+   for (tmpvpcidev = vpcidev_list_head; tmpvpcidev;
 tmpvpcidev = tmpvpcidev-next) {
if (devtype == VIRTHBA_TYPE) {
if ((tmpvpcidev-scsi.wwnn.wwnn1 == scsi-wwnn.wwnn1) 
@@ -996,14 +996,14 @@ static int virtpci_device_add(struct device *parentbus, 
int devtype,
}
 
/* add it at the head */
-   if (!VpcidevListHead) {
-   VpcidevListHead = virtpcidev;
+   if (!vpcidev_list_head) {
+   vpcidev_list_head = virtpcidev;
} else {
/* insert virtpcidev at the head of our linked list of
 * vpcidevs
 */
-   virtpcidev-next = VpcidevListHead;
-   VpcidevListHead = virtpcidev;
+   virtpcidev-next = vpcidev_list_head;
+   vpcidev_list_head = virtpcidev;
}
 
write_unlock_irqrestore(VpcidevListLock, flags);
@@ -1041,14 +1041,14 @@ static int virtpci_device_add(struct device *parentbus, 
int devtype,
   CHANNELCLI_DETACHED, NULL);
/* remove virtpcidev, the one we just added, from the list */
write_lock_irqsave(VpcidevListLock, flags);
-   for (tmpvpcidev = VpcidevListHead, prev = NULL;
+   for (tmpvpcidev = vpcidev_list_head, prev = NULL;
 tmpvpcidev;
 prev = tmpvpcidev, tmpvpcidev = tmpvpcidev-next) {
if (tmpvpcidev == virtpcidev) {
if (prev)
prev-next = tmpvpcidev-next;
else
-   VpcidevListHead = tmpvpcidev-next;
+   vpcidev_list_head = tmpvpcidev-next;
break;
}
}
@@ -1086,7 +1086,7 @@ static int virtpci_device_serverdown(struct device 
*parentbus,
/* find the vhba or vnic in virtpci device list */
write_lock_irqsave(VpcidevListLock, flags);
 
-   for (tmpvpcidev = VpcidevListHead, prevvpcidev = NULL;
+   for (tmpvpcidev = vpcidev_list_head, prevvpcidev = NULL;
 (tmpvpcidev  !found);
 prevvpcidev = tmpvpcidev, tmpvpcidev = tmpvpcidev-next) {
if (tmpvpcidev-devtype != devtype)
@@ -1145,7 +1145,7 @@ static int virtpci_device_serverup(struct device 
*parentbus,
/* find the vhba or vnic in virtpci device list */
write_lock_irqsave(VpcidevListLock, flags);
 
-   for (tmpvpcidev = VpcidevListHead, prevvpcidev = NULL;
+   for (tmpvpcidev = vpcidev_list_head, prevvpcidev = NULL;
 (tmpvpcidev  !found);
 prevvpcidev = tmpvpcidev, tmpvpcidev = tmpvpcidev-next) {
if (tmpvpcidev-devtype != devtype)
@@ -1224,7 +1224,7 @@ static int virtpci_device_del(struct device *parentbus,
* encounter schedule while atomic
*/
write_lock_irqsave(VpcidevListLock, flags);
-   for (tmpvpcidev = VpcidevListHead, prevvpcidev = NULL; tmpvpcidev;) {
+   for (tmpvpcidev = vpcidev_list_head, prevvpcidev = NULL; tmpvpcidev;) {
if (tmpvpcidev-devtype != devtype)
DEL_CONTINUE;
 
@@ -1258,7 +1258,7 @@ static int virtpci_device_del(struct device *parentbus,
/* not at head */
prevvpcidev-next = tmpvpcidev-next;
else
-   

[PATCH 07/12] staging: unisys: virtpci: Fix CamelCase write_vbus_devInfo()

2014-11-03 Thread Bryan Thompson
Rename write_vbus_devInfo() to write_vbus_dev_info() in virtpci.c

Signed-off-by: Bryan Thompson bryan.thomp...@unisys.com
---
 drivers/staging/unisys/virtpci/virtpci.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/unisys/virtpci/virtpci.c 
b/drivers/staging/unisys/virtpci/virtpci.c
index c992b9f..a299b32 100644
--- a/drivers/staging/unisys/virtpci/virtpci.c
+++ b/drivers/staging/unisys/virtpci/virtpci.c
@@ -227,8 +227,8 @@ static int write_vbus_bus_info(struct 
spar_vbus_channel_protocol *chan,
  * ULTRA_VBUS_CHANNEL_PROTOCOL.DevInfo[devix].
  */
 static int
-write_vbus_devInfo(struct spar_vbus_channel_protocol *chan,
-  struct ultra_vbus_deviceinfo *info, int devix)
+write_vbus_dev_info(struct spar_vbus_channel_protocol *chan,
+   struct ultra_vbus_deviceinfo *info, int devix)
 {
int off;
 
@@ -797,7 +797,7 @@ static void fix_vbus_devInfo(struct device *dev, int devNo, 
int devType,
 virtpcidrv-name,
 virtpcidrv-version,
 virtpcidrv-vertag);
-   write_vbus_devInfo(pChan, devInfo, devNo);
+   write_vbus_dev_info(pChan, devInfo, devNo);
 
/* Re-write bus+chipset info, because it is possible that this
* was previously written by our good counterpart, visorbus.
-- 
1.7.9.5

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


[PATCH 11/12] staging: unisys: virtpci: Fix CamelCase local variables in fix_vbus_dev_info()

2014-11-03 Thread Bryan Thompson
Rename the following local variables in fix_vbus_dev_info()
Change pChan to chan
Change devInfo to dev_info

Signed-off-by: Bryan Thompson bryan.thomp...@unisys.com
---
 drivers/staging/unisys/virtpci/virtpci.c |   16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/unisys/virtpci/virtpci.c 
b/drivers/staging/unisys/virtpci/virtpci.c
index 80be233..bfcc027 100644
--- a/drivers/staging/unisys/virtpci/virtpci.c
+++ b/drivers/staging/unisys/virtpci/virtpci.c
@@ -760,8 +760,8 @@ static void fix_vbus_dev_info(struct device *dev, int 
dev_no, int dev_type,
  struct virtpci_driver *virtpcidrv)
 {
struct device *vbus;
-   void *pChan;
-   struct ultra_vbus_deviceinfo devInfo;
+   void *chan;
+   struct ultra_vbus_deviceinfo dev_info;
const char *stype;
 
if (!dev) {
@@ -777,8 +777,8 @@ static void fix_vbus_dev_info(struct device *dev, int 
dev_no, int dev_type,
LOGERR(%s dev has no parent bus, __func__);
return;
}
-   pChan = vbus-platform_data;
-   if (!pChan) {
+   chan = vbus-platform_data;
+   if (!chan) {
LOGERR(%s dev bus has no channel, __func__);
return;
}
@@ -793,17 +793,17 @@ static void fix_vbus_dev_info(struct device *dev, int 
dev_no, int dev_type,
stype = unknown;
break;
}
-   bus_device_info_init(devInfo, stype,
+   bus_device_info_init(dev_info, stype,
 virtpcidrv-name,
 virtpcidrv-version,
 virtpcidrv-vertag);
-   write_vbus_dev_info(pChan, devInfo, dev_no);
+   write_vbus_dev_info(chan, dev_info, dev_no);
 
/* Re-write bus+chipset info, because it is possible that this
* was previously written by our good counterpart, visorbus.
*/
-   write_vbus_chp_info(pChan, chipset_driver_info);
-   write_vbus_bus_info(pChan, bus_driver_info);
+   write_vbus_chp_info(chan, chipset_driver_info);
+   write_vbus_bus_info(chan, bus_driver_info);
 }
 
 /* This function is called to query the existence of a specific device
-- 
1.7.9.5

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


[PATCH 08/12] staging: unisys: virtpci: Fix CamelCase in delete_vbus_device()

2014-11-03 Thread Bryan Thompson
Rename pDev to dev in delete_vbus_device()

Signed-off-by: Bryan Thompson bryan.thomp...@unisys.com
---
 drivers/staging/unisys/virtpci/virtpci.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/virtpci/virtpci.c 
b/drivers/staging/unisys/virtpci/virtpci.c
index a299b32..b6e508f 100644
--- a/drivers/staging/unisys/virtpci/virtpci.c
+++ b/drivers/staging/unisys/virtpci/virtpci.c
@@ -430,9 +430,9 @@ static int
 delete_vbus_device(struct device *vbus, void *data)
 {
int checkforroot = (data != NULL);
-   struct device *pDev = virtpci_rootbus_device;
+   struct device *dev = virtpci_rootbus_device;
 
-   if ((checkforroot)  match_busid(vbus, (void *)BUS_ID(pDev))) {
+   if ((checkforroot)  match_busid(vbus, (void *)BUS_ID(dev))) {
/* skip it - don't delete root bus */
LOGINF(skipping root bus\n);
return 0;   /* pretend no error */
-- 
1.7.9.5

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


[PATCH 06/12] staging: unisys: virtpci: Fix CamelCase write_vbus_busInfo()

2014-11-03 Thread Bryan Thompson
Rename write_vbus_busInfo() to write_vbus_bus_info() in virtpci.c

Signed-off-by: Bryan Thompson bryan.thomp...@unisys.com
---
 drivers/staging/unisys/virtpci/virtpci.c |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/unisys/virtpci/virtpci.c 
b/drivers/staging/unisys/virtpci/virtpci.c
index 5e1a7eb..c992b9f 100644
--- a/drivers/staging/unisys/virtpci/virtpci.c
+++ b/drivers/staging/unisys/virtpci/virtpci.c
@@ -205,8 +205,8 @@ static int write_vbus_chp_info(struct 
spar_vbus_channel_protocol *chan,
 }
 
 /* Write the contents of info to the ULTRA_VBUS_CHANNEL_PROTOCOL.BusInfo. */
-static int write_vbus_busInfo(struct spar_vbus_channel_protocol *chan,
- struct ultra_vbus_deviceinfo *info)
+static int write_vbus_bus_info(struct spar_vbus_channel_protocol *chan,
+  struct ultra_vbus_deviceinfo *info)
 {
int off;
 
@@ -281,8 +281,8 @@ static int add_vbus(struct add_vbus_guestpart *addparams)
}
write_vbus_chp_info(vbus-platform_data /* chanptr */ ,
chipset_driver_info);
-   write_vbus_busInfo(vbus-platform_data /* chanptr */ ,
-  bus_driver_info);
+   write_vbus_bus_info(vbus-platform_data /* chanptr */ ,
+   bus_driver_info);
LOGINF(Added vbus %d; device %s created successfully\n,
   addparams-bus_no, BUS_ID(vbus));
POSTCODE_LINUX_2(VPCI_CREATE_EXIT_PC, POSTCODE_SEVERITY_INFO);
@@ -803,7 +803,7 @@ static void fix_vbus_devInfo(struct device *dev, int devNo, 
int devType,
* was previously written by our good counterpart, visorbus.
*/
write_vbus_chp_info(pChan, chipset_driver_info);
-   write_vbus_busInfo(pChan, bus_driver_info);
+   write_vbus_bus_info(pChan, bus_driver_info);
 }
 
 /* This function is called to query the existence of a specific device
-- 
1.7.9.5

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


[PATCH 01/12] staging: unisys: virtpci: Fix CamelCase Chipset_DriverInfo

2014-11-03 Thread Bryan Thompson
Rename Chipset_DriverInfo to chipset_driver_info in virtpci.c

Signed-off-by: Bryan Thompson bryan.thomp...@unisys.com
---
 drivers/staging/unisys/virtpci/virtpci.c |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/unisys/virtpci/virtpci.c 
b/drivers/staging/unisys/virtpci/virtpci.c
index b6c3130..6b4d94c 100644
--- a/drivers/staging/unisys/virtpci/virtpci.c
+++ b/drivers/staging/unisys/virtpci/virtpci.c
@@ -138,7 +138,7 @@ static struct device virtpci_rootbus_device = {
 };
 
 /* filled in with info about parent chipset driver when we register with it */
-static struct ultra_vbus_deviceinfo Chipset_DriverInfo;
+static struct ultra_vbus_deviceinfo chipset_driver_info;
 
 static const struct sysfs_ops virtpci_driver_sysfs_ops = {
.show = virtpci_driver_attr_show,
@@ -280,7 +280,7 @@ static int add_vbus(struct add_vbus_guestpart *addparams)
return 0;
}
write_vbus_chpInfo(vbus-platform_data /* chanptr */ ,
-  Chipset_DriverInfo);
+  chipset_driver_info);
write_vbus_busInfo(vbus-platform_data /* chanptr */ , Bus_DriverInfo);
LOGINF(Added vbus %d; device %s created successfully\n,
   addparams-bus_no, BUS_ID(vbus));
@@ -801,7 +801,7 @@ static void fix_vbus_devInfo(struct device *dev, int devNo, 
int devType,
/* Re-write bus+chipset info, because it is possible that this
* was previously written by our good counterpart, visorbus.
*/
-   write_vbus_chpInfo(pChan, Chipset_DriverInfo);
+   write_vbus_chpInfo(pChan, chipset_driver_info);
write_vbus_busInfo(pChan, Bus_DriverInfo);
 }
 
@@ -1536,7 +1536,7 @@ static int __init virtpci_mod_init(void)
DBGINF(device_register successful ret:%x\n, ret);
 
if (!uisctrl_register_req_handler(2, (void *)virtpci_ctrlchan_func,
- Chipset_DriverInfo)) {
+ chipset_driver_info)) {
LOGERR(uisctrl_register_req_handler FAILED.\n);
POSTCODE_LINUX_2(VPCI_CREATE_FAILURE_PC, POSTCODE_SEVERITY_ERR);
device_unregister(virtpci_rootbus_device);
-- 
1.7.9.5

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


[PATCH] staging: unisys: Remove unneeded spaces from channel.c

2014-11-03 Thread Ken Depro
From: Ken Depro kenneth.de...@unisys.com

This patch removes some unneeded white space after casts within the
channel.c file.  The checkpatch script was run after these changes,
and no further checks or warnings were seen.

Signed-off-by: Ken Depro kenneth.de...@unisys.com
Signed-off-by: Ben Romer benjamin.ro...@unisys.com
---
 drivers/staging/unisys/channels/channel.c |   14 +++---
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/unisys/channels/channel.c 
b/drivers/staging/unisys/channels/channel.c
index 2fc61a7..74cc4d6 100644
--- a/drivers/staging/unisys/channels/channel.c
+++ b/drivers/staging/unisys/channels/channel.c
@@ -51,7 +51,7 @@ unsigned char spar_signal_insert(struct channel_header 
__iomem *ch, u32 queue,
 
struct signal_queue_header __iomem *pqhdr =
(struct signal_queue_header __iomem *)
-   ((char __iomem *) ch + readq(ch-ch_space_offset))
+   ((char __iomem *)ch + readq(ch-ch_space_offset))
+ queue;
 
/* capture current head and tail */
@@ -107,7 +107,7 @@ spar_signal_remove(struct channel_header __iomem *ch, u32 
queue, void *sig)
void __iomem *psource;
unsigned int head, tail;
struct signal_queue_header __iomem *pqhdr =
-   (struct signal_queue_header __iomem *) ((char __iomem *) ch +
+   (struct signal_queue_header __iomem *)((char __iomem *)ch +
readq(ch-ch_space_offset)) + queue;
 
/* capture current head and tail */
@@ -124,7 +124,7 @@ spar_signal_remove(struct channel_header __iomem *ch, u32 
queue, void *sig)
tail = (tail + 1) % readl(pqhdr-max_slots);
 
/* copy signal from tail location to the area pointed to by pSignal */
-   psource = (char __iomem *) pqhdr + readq(pqhdr-sig_base_offset) +
+   psource = (char __iomem *)pqhdr + readq(pqhdr-sig_base_offset) +
(tail * readl(pqhdr-signal_size));
memcpy_fromio(sig, psource, readl(pqhdr-signal_size));
 
@@ -162,7 +162,7 @@ unsigned int spar_signal_remove_all(struct channel_header 
*ch, u32 queue,
void *psource;
unsigned int head, tail, count = 0;
struct signal_queue_header *pqhdr =
-   (struct signal_queue_header *) ((char *) ch +
+   (struct signal_queue_header *)((char *)ch +
ch-ch_space_offset) + queue;
 
/* capture current head and tail */
@@ -181,9 +181,9 @@ unsigned int spar_signal_remove_all(struct channel_header 
*ch, u32 queue,
 * to by pSignal
 */
psource =
-   (char *) pqhdr + pqhdr-sig_base_offset +
+   (char *)pqhdr + pqhdr-sig_base_offset +
(tail * pqhdr-signal_size);
-   memcpy((char *) sig + (pqhdr-signal_size * count),
+   memcpy((char *)sig + (pqhdr-signal_size * count),
   psource, pqhdr-signal_size);
 
mb(); /* channel synch */
@@ -211,7 +211,7 @@ unsigned char spar_signalqueue_empty(struct channel_header 
__iomem *ch,
 u32 queue)
 {
struct signal_queue_header __iomem *pqhdr =
-   (struct signal_queue_header __iomem *) ((char __iomem *) ch +
+   (struct signal_queue_header __iomem *)((char __iomem *)ch +
readq(ch-ch_space_offset)) + queue;
return readl(pqhdr-head) == readl(pqhdr-tail);
 }
-- 
1.7.1

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


[PATCH 02/10] added media agnostic (MA) USB HCD roothubs

2014-11-03 Thread Stephanie Wallick
This is where we implement USB 2.0 and 3.0 roothubs. From the host's 
perspective,
hub state is set and tracked just like any other USB roothub. Likewise, requests
to the roothub appear to be handled like any other wired USB request.

Signed-off-by: Sean O. Stalley sean.stal...@intel.com
Signed-off-by: Stephanie Wallick stephanie.s.wall...@intel.com
---
 drivers/staging/mausb/drivers/mausb_hub.c | 851 ++
 drivers/staging/mausb/drivers/mausb_hub.h | 128 +
 2 files changed, 979 insertions(+)
 create mode 100644 drivers/staging/mausb/drivers/mausb_hub.c
 create mode 100644 drivers/staging/mausb/drivers/mausb_hub.h

diff --git a/drivers/staging/mausb/drivers/mausb_hub.c 
b/drivers/staging/mausb/drivers/mausb_hub.c
new file mode 100644
index 000..aebca54
--- /dev/null
+++ b/drivers/staging/mausb/drivers/mausb_hub.c
@@ -0,0 +1,851 @@
+/* Name: mausb_hub.c
+ * Description:  mausb hub structures and functions
+ *
+ * This file is provided under a dual BSD/GPLv2 license.  When using or
+ * redistributing this file, you may do so under either license.
+ *
+ * GPL LICENSE SUMMARY
+ *
+ * Copyright(c) 2014 Intel Corporation.
+ *
+ * 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.
+ *
+ * Contact Information:
+ * Sean Stalley, sean.stal...@intel.com
+ * Stephanie Wallick, stephanie.s.wall...@intel.com
+ * 2111 NE 25th Avenue
+ * Hillsboro, Oregon 97124
+ *
+ * BSD LICENSE
+ *
+ * Copyright(c) 2014 Intel Corporation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+* Redistributions of source code must retain the above copyright
+  notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+  notice, this list of conditions and the following disclaimer in
+  the documentation and/or other materials provided with the
+  distribution.
+* Neither the name of Intel Corporation nor the names of its
+  contributors may be used to endorse or promote products derived
+  from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#define DEBUG
+
+#include linux/init.h
+#include linux/module.h
+#include linux/usb.h
+#include linux/usb/hcd.h
+#include linux/platform_device.h
+#include linux/usb/ch11.h
+#include linux/usb/ch9.h
+
+#include mausb_hub.h
+#include mausb_hcd.h
+
+/**
+ * Returns MA USB roothub data structure for a USB HCD.
+ */
+struct mausb_root_hub *usb_hcd_to_roothub(struct usb_hcd *hcd)
+{
+   struct mausb_hcd *mhcd = usb_hcd_to_mausb_hcd(hcd);
+
+   if (usb_hcd_is_primary_hcd(hcd))
+   return mhcd-root_hub;
+   else
+   return mhcd-shared_root_hub;
+}
+
+/**
+ * Returns true if the given is the superspeed HCD. Note: The primary HCD is
+ * High Speed and the shared HCD is SuperSpeed.
+ */
+bool mausb_is_ss_hcd(struct usb_hcd *hcd)
+{
+   if (usb_hcd_is_primary_hcd(hcd))
+   return false;
+   else
+   return true;
+}
+
+/**
+ * Sets downstream port link state.
+ *
+ * @mhcd:  MA USB hcd that owns port.
+ * @state: Link state to be set (see USB 3.0 spec for link state values).
+ * @portnum:   Port number of link state to be set.
+ */
+void set_link_state(struct mausb_root_hub *roothub, int state, int portnum)
+{
+   struct usb_port_status   *port_stat;
+
+   port_stat = roothub-port_status[portnum];
+
+   port_stat-wPortStatus = LINK_STATE_MASK;
+   port_stat-wPortStatus |= state;
+}
+
+/**
+ * Generates connect or disconnect event for a roothub.
+ *
+ * @hcd:   HCD associated with roothub.
+ * @do_connect: 1 for connect, 0 for disconnect.
+ * @_portnum:  Port 

[PATCH 10/10] added kernel build, configuration, and TODO files

2014-11-03 Thread Stephanie Wallick
Signed-off-by: Sean O. Stalley sean.stal...@intel.com
Signed-off-by: Stephanie Wallick stephanie.s.wall...@intel.com
---
 drivers/staging/Kconfig|  2 ++
 drivers/staging/Makefile   |  1 +
 drivers/staging/mausb/Kconfig  | 16 
 drivers/staging/mausb/Makefile |  3 +++
 drivers/staging/mausb/TODO | 14 ++
 drivers/staging/mausb/drivers/Kconfig  | 34 ++
 drivers/staging/mausb/drivers/Makefile | 20 
 7 files changed, 90 insertions(+)
 create mode 100644 drivers/staging/mausb/Kconfig
 create mode 100644 drivers/staging/mausb/Makefile
 create mode 100644 drivers/staging/mausb/TODO
 create mode 100644 drivers/staging/mausb/drivers/Kconfig
 create mode 100644 drivers/staging/mausb/drivers/Makefile

diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig
index 35b494f..f57621b 100644
--- a/drivers/staging/Kconfig
+++ b/drivers/staging/Kconfig
@@ -24,6 +24,8 @@ menuconfig STAGING
 
 if STAGING
 
+source drivers/staging/mausb/Kconfig
+
 source drivers/staging/et131x/Kconfig
 
 source drivers/staging/slicoss/Kconfig
diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile
index e66a5db..7615c85 100644
--- a/drivers/staging/Makefile
+++ b/drivers/staging/Makefile
@@ -51,3 +51,4 @@ obj-$(CONFIG_GS_FPGABOOT) += gs_fpgaboot/
 obj-$(CONFIG_BT_NOKIA_H4P) += nokia_h4p/
 obj-$(CONFIG_CRYPTO_SKEIN) += skein/
 obj-$(CONFIG_UNISYSSPAR)   += unisys/
+obj-$(CONFIG_MAUSB)+= mausb/
diff --git a/drivers/staging/mausb/Kconfig b/drivers/staging/mausb/Kconfig
new file mode 100644
index 000..095c08b
--- /dev/null
+++ b/drivers/staging/mausb/Kconfig
@@ -0,0 +1,16 @@
+
+menuconfig MAUSB
+   bool MA USB drivers
+   depends on USB
+   ---help---
+ This option allows you to select from the various MA USB
+ drivers. Note that a media-specific driver (e.g. tcp or SNAP)
+ is needed in addition to the media agnostic host or device driver.
+
+
+if MAUSB
+
+source drivers/staging/mausb/drivers/Kconfig
+
+endif
+
diff --git a/drivers/staging/mausb/Makefile b/drivers/staging/mausb/Makefile
new file mode 100644
index 000..b559322
--- /dev/null
+++ b/drivers/staging/mausb/Makefile
@@ -0,0 +1,3 @@
+#obj-$(CONFIG_MAUSB) += drivers/
+obj-y += drivers/
+
diff --git a/drivers/staging/mausb/TODO b/drivers/staging/mausb/TODO
new file mode 100644
index 000..dd124ed
--- /dev/null
+++ b/drivers/staging/mausb/TODO
@@ -0,0 +1,14 @@
+TODO:
+   - checkpatch.pl cleanups
+   - address miscellaneous TODO statements in code
+   - add support for multiple media agnostic (MA) devices
+   - add/improve support for unimplemented packet types
+   - handle errors and failure with more grace and less crash
+
+Please send patches to Greg Kroah-Hartman g...@kroah.com and cc:
+
+   Sean Stalley sean.stal...@intel.com
+   Stephanie Wallick stephanie.s.wall...@intel.com
+
+
+
diff --git a/drivers/staging/mausb/drivers/Kconfig 
b/drivers/staging/mausb/drivers/Kconfig
new file mode 100644
index 000..9e12e22
--- /dev/null
+++ b/drivers/staging/mausb/drivers/Kconfig
@@ -0,0 +1,34 @@
+config MA_CORE
+   tristate MA USB core
+   ---help---
+ This builds ma_core module.
+
+config MAUSB_HOST
+   tristate MA USB host
+   depends on MA_CORE
+   ---help---
+ This builds MA USB host driver module.
+
+config MAUSB_DEVICE
+   tristate MA USB device
+   depends on MA_CORE  USB_GADGET
+   ---help---
+ This builds MA USB device driver module.
+
+config MATCP_CORE
+   tristate MA USB tcp core
+   ---help---
+ This builds tcp_core module.
+
+config MATCP_HOST
+   tristate MA USB host tcp
+   depends on MATCP_CORE
+   ---help---
+ This builds tcp_host module.
+
+config MATCP_DEVICE
+   tristate MA USB device tcp
+   depends on MATCP_CORE
+   ---help---
+ This builds tcp_dev module.
+
diff --git a/drivers/staging/mausb/drivers/Makefile 
b/drivers/staging/mausb/drivers/Makefile
new file mode 100644
index 000..a38491e
--- /dev/null
+++ b/drivers/staging/mausb/drivers/Makefile
@@ -0,0 +1,20 @@
+#MY_CFLAGS =-g -O0 -DEBUG_OUTPUT
+
+obj-$(CONFIG_MA_CORE) += ma_core.o
+ma_core-y := mausb_pkt.o mausb_tx.o mausb_msapi.o mausb_mem.o mausb_mgmt.o
+
+obj-$(CONFIG_MAUSB_HOST) += mausb.o
+mausb-y := mausb_hcd.o mausb_hub.o mausb_tx-host.o mausb_mem-host.o
+
+obj-$(CONFIG_MAUSB_DEVICE) += maudc.o
+maudc-y := mausb_udc.o mausb_tx-device.o
+
+obj-$(CONFIG_MATCP_HOST) += matcp_host.o
+matcp_host-y := mausb_tcp-host.o
+
+obj-$(CONFIG_MATCP_DEVICE) += matcp_dev.o
+matcp_dev-y := mausb_tcp-device.o
+
+obj-$(CONFIG_MATCP_CORE) += matcp_core.o
+matcp_core-y := mausb_tcp.o mausb_ioctl.o
+
-- 
1.9.1

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

[PATCH 07/10] added media agnostic (MA) USB management packet handling

2014-11-03 Thread Stephanie Wallick
The Media Agnostic USB Specification outlines a number of managment
packet types for management and control functions. Each function is
initiated with a particular type of managment request packet and
completed with the corresponding management response packet. This
is where we fill the fields for outgoing management packets and parse
and handle incoming management packets.

Signed-off-by: Sean O. Stalley sean.stal...@intel.com
Signed-off-by: Stephanie Wallick stephanie.s.wall...@intel.com
---
 drivers/staging/mausb/drivers/mausb_mgmt.c | 888 +
 drivers/staging/mausb/drivers/mausb_mgmt.h |  90 +++
 2 files changed, 978 insertions(+)
 create mode 100755 drivers/staging/mausb/drivers/mausb_mgmt.c
 create mode 100644 drivers/staging/mausb/drivers/mausb_mgmt.h

diff --git a/drivers/staging/mausb/drivers/mausb_mgmt.c 
b/drivers/staging/mausb/drivers/mausb_mgmt.c
new file mode 100755
index 000..7301ae3
--- /dev/null
+++ b/drivers/staging/mausb/drivers/mausb_mgmt.c
@@ -0,0 +1,888 @@
+/* name:   mausb_mgmt.c
+ * description: Handles management packet operations common to both
+ *  hosts and devices. This includes parsing incoming packets,
+ *  as well as creating outgoing packets.
+ *
+ * This file is provided under a dual BSD/GPLv2 license.  When using or
+ * redistributing this file, you may do so under either license.
+ *
+ * GPL LICENSE SUMMARY
+ *
+ * Copyright(c) 2014 Intel Corporation.
+ *
+ * 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.
+ *
+ * Contact Information:
+ * Sean Stalley, sean.stal...@intel.com
+ * Stephanie Wallick, stephanie.s.wall...@intel.com
+ * 2111 NE 25th Avenue
+ * Hillsboro, Oregon 97124
+ *
+ * BSD LICENSE
+ *
+ * Copyright(c) 2014 Intel Corporation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+* Redistributions of source code must retain the above copyright
+  notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+  notice, this list of conditions and the following disclaimer in
+  the documentation and/or other materials provided with the
+  distribution.
+* Neither the name of Intel Corporation nor the names of its
+  contributors may be used to endorse or promote products derived
+  from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include linux/usb.h
+#include linux/slab.h
+
+#include mausb_pkt.h
+#include mausb_mgmt.h
+#include mausb_mem.h
+#include mausb_msapi.h
+#include mausb_const.h
+
+/**
+ * Returns the ma_dev structure for a given device.
+ */
+struct ma_dev *mausb_mgmt_to_ma_dev(struct mausb_mgmt *mgmt)
+{
+   return container_of(mgmt, struct ma_dev, mgmt);
+}
+EXPORT_SYMBOL(mausb_mgmt_to_ma_dev);
+
+/**
+ * Opens a connection to the Media Specific driver to pass management packets
+ * to a particular MA device.
+ *
+ * The caller should be holding the lock protecting the MA device's data.
+ *
+ * Returns 0 on success, or a negative errno on failure.
+ *
+ * @mgmt:  The struct for the management channel to the MA device.
+ * after this function
+ * @drv:   The specific medium we are communicating with
+ * @transfer_pkt:  A pointer to the function that should be called by the
+ * MS driver to pass incoming management packets to the
+ * MA driver.
+ * @pkt_sent:  Completion callback for outgoing management packets.
+ * This function will be called by the MS driver once a
+ * packet has been sent to the medium to indicate that
+ * it 

[PATCH 06/10] added media agnostic (MA) UDC

2014-11-03 Thread Stephanie Wallick
This is where we implement the behavior of a USB device controller for
the MA USB device-side driver. The MA UDC interfaces with a gadget driver
and appears to the driver as a regular UDC. However, instead of sending
USB packets over a wired USB bus, the MA UDC hands MA USB packets off to
a media specific layer for transport.

Signed-off-by: Sean O. Stalley sean.stal...@intel.com
Signed-off-by: Stephanie Wallick stephanie.s.wall...@intel.com
---
 drivers/staging/mausb/drivers/mausb_udc.c | 1488 +
 drivers/staging/mausb/drivers/mausb_udc.h |  147 +++
 2 files changed, 1635 insertions(+)
 create mode 100644 drivers/staging/mausb/drivers/mausb_udc.c
 create mode 100644 drivers/staging/mausb/drivers/mausb_udc.h

diff --git a/drivers/staging/mausb/drivers/mausb_udc.c 
b/drivers/staging/mausb/drivers/mausb_udc.c
new file mode 100644
index 000..dd8bd02
--- /dev/null
+++ b/drivers/staging/mausb/drivers/mausb_udc.c
@@ -0,0 +1,1488 @@
+/* name:   mausb_udc.c
+ * description: Implements a USB device controller(UDC) for interfacing with
+ * gadget drivers. The gadget driver uses this interface to return
+ * descriptors and to implement configuration and data transfer
+ * protocols with the pHCD. The UDC also allocates and initializes
+ * endpoints to support gadget/pHCD interfacing.
+ *
+ * This file is provided under a dual BSD/GPLv2 license.  When using or
+ * redistributing this file, you may do so under either license.
+ *
+ * GPL LICENSE SUMMARY
+ *
+ * Copyright(c) 2014 Intel Corporation.
+ *
+ * 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.
+ *
+ * Contact Information:
+ * Sean Stalley, sean.o.stal...@intel.com
+ * Stephanie Wallick, stephanie.s.wall...@intel.com
+ * 2111 NE 25th Avenue
+ * Hillsboro, Oregon 97124
+ *
+ * BSD LICENSE
+ *
+ * Copyright(c) 2014 Intel Corporation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+* Redistributions of source code must retain the above copyright
+  notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+  notice, this list of conditions and the following disclaimer in
+  the documentation and/or other materials provided with the
+  distribution.
+* Neither the name of Intel Corporation nor the names of its
+  contributors may be used to endorse or promote products derived
+  from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#define DEBUG
+
+#include linux/init.h
+#include linux/module.h
+#include linux/usb.h
+#include linux/usb/hcd.h
+#include linux/platform_device.h
+#include linux/usb/ch11.h
+#include linux/usb/gadget.h
+#include linux/device.h
+#include linux/usb/composite.h
+#include linux/spinlock.h
+
+#include mausb_udc.h
+#include mausb_mgmt.h
+#include mausb_mem.h
+#include mausb_msapi.h
+#include mausb_tx.h
+
+static const char   ep0[] = ep0;
+static const char *const ep_name[] = {ep0, ep1, ep2};
+
+static struct platform_device udc_pdev;
+
+void udc_dev_release(struct device *dev)
+{
+   /* free any dynamically allocated structures here */
+}
+
+static inline struct mausb_udc *gadget_to_udc(struct usb_gadget *gadget)
+{
+   return container_of(gadget, struct mausb_udc, gadget);
+}
+
+static inline struct mausb_udc *gadget_dev_to_mausb_udc(struct device *dev)
+{
+   return container_of(dev, struct mausb_udc, gadget.dev);
+}
+
+static inline struct mausb_request *usb_req_to_mausb_req(
+   struct usb_request *req)
+{
+   return container_of(req, struct mausb_request, req);
+}
+
+static inline struct mausb_udc 

[PATCH 09/10] added tools for building/loading media agnostic (MA) USB drivers

2014-11-03 Thread Stephanie Wallick
Adds various scripts for building, loading and unloading the MA USB
drivers and a utility that can be used for connecting and disconnecting
the host and device drivers.

Signed-off-by: Sean O. Stalley sean.stal...@intel.com
Signed-off-by: Stephanie Wallick stephanie.s.wall...@intel.com
---
 .../staging/mausb/scripts/build_load_connect.sh|  69 +++
 drivers/staging/mausb/scripts/load_gzero.sh|   5 +
 drivers/staging/mausb/scripts/load_script.sh   | 125 +
 drivers/staging/mausb/scripts/modprobify.sh|  10 ++
 drivers/staging/mausb/scripts/unload_all.sh|  15 ++
 drivers/staging/mausb/scripts/unload_gzero.sh  |   5 +
 drivers/staging/mausb/tools/mausb-util/Makefile|  14 ++
 drivers/staging/mausb/tools/mausb-util/README  |  30 
 drivers/staging/mausb/tools/mausb-util/config.mk   |  17 ++
 .../staging/mausb/tools/mausb-util/src/Android.mk  |  13 ++
 .../staging/mausb/tools/mausb-util/src/Makefile|  18 ++
 .../staging/mausb/tools/mausb-util/src/connect.c   |  72 
 .../staging/mausb/tools/mausb-util/src/connect.h   |  22 +++
 drivers/staging/mausb/tools/mausb-util/src/mausb.c | 200 +
 drivers/staging/mausb/tools/mausb-util/src/mausb.h |  64 +++
 .../mausb/tools/mausb-util/src/mausb_ioctl.h   |  37 
 drivers/staging/mausb/tools/mausb-util/src/utils.c |  94 ++
 17 files changed, 810 insertions(+)
 create mode 100644 drivers/staging/mausb/scripts/build_load_connect.sh
 create mode 100644 drivers/staging/mausb/scripts/load_gzero.sh
 create mode 100644 drivers/staging/mausb/scripts/load_script.sh
 create mode 100644 drivers/staging/mausb/scripts/modprobify.sh
 create mode 100644 drivers/staging/mausb/scripts/unload_all.sh
 create mode 100644 drivers/staging/mausb/scripts/unload_gzero.sh
 create mode 100644 drivers/staging/mausb/tools/mausb-util/Makefile
 create mode 100644 drivers/staging/mausb/tools/mausb-util/README
 create mode 100644 drivers/staging/mausb/tools/mausb-util/config.mk
 create mode 100644 drivers/staging/mausb/tools/mausb-util/src/Android.mk
 create mode 100644 drivers/staging/mausb/tools/mausb-util/src/Makefile
 create mode 100644 drivers/staging/mausb/tools/mausb-util/src/connect.c
 create mode 100644 drivers/staging/mausb/tools/mausb-util/src/connect.h
 create mode 100644 drivers/staging/mausb/tools/mausb-util/src/mausb.c
 create mode 100644 drivers/staging/mausb/tools/mausb-util/src/mausb.h
 create mode 100644 drivers/staging/mausb/tools/mausb-util/src/mausb_ioctl.h
 create mode 100644 drivers/staging/mausb/tools/mausb-util/src/utils.c

diff --git a/drivers/staging/mausb/scripts/build_load_connect.sh 
b/drivers/staging/mausb/scripts/build_load_connect.sh
new file mode 100644
index 000..d055241
--- /dev/null
+++ b/drivers/staging/mausb/scripts/build_load_connect.sh
@@ -0,0 +1,69 @@
+#!/bin/bash
+
+side=invalid
+mode=invalid
+addr=invalid
+
+while getopts hdbtsa: opt; do
+   case $opt in
+   h) side=-h
+  ;;
+   d) side=-d
+  ;;
+   b) side=-b
+  ;;
+   t) mode=-t
+  ;;
+   s) mode=-s
+  ;;
+   a) addr=$OPTARG
+  ;;
+   esac
+done
+
+
+if [ $side == invalid ]
+then
+   echo $side
+   echo please choose host (-h) or device (-d)
+   exit
+fi
+
+if [ $mode == invalid ]
+then
+   echo $mode
+   echo please choose tcp (-t) or snap (-s)
+   exit
+fi
+
+if [ $addr == invalid ]
+then
+   echo $addr
+   echo please enter a valid address (-a 1.2.3.4, -a 01:23:45:67:89:0a)
+   exit
+fi
+
+
+cd ../
+# make clean  make
+make -j8
+cd drivers/
+
+wireshark -k -Y tcp -i eth0 
+
+sudo ../scripts/load_script.sh $side $mode
+
+sudo cat /proc/modules | grep ma
+
+if [ $mode == -s ]
+then
+   echo connecting mausb
+   ../tools/mausb-util/mausb -c -m llc -a $addr
+fi
+
+if [ $mode == -t ]
+then
+   echo connecting mausb
+   ../tools/mausb-util/mausb -c -m ip -p 9001 -a $addr
+fi
+
diff --git a/drivers/staging/mausb/scripts/load_gzero.sh 
b/drivers/staging/mausb/scripts/load_gzero.sh
new file mode 100644
index 000..9266199
--- /dev/null
+++ b/drivers/staging/mausb/scripts/load_gzero.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+modprobe g_zero
+
+echo g_zero load process complete
\ No newline at end of file
diff --git a/drivers/staging/mausb/scripts/load_script.sh 
b/drivers/staging/mausb/scripts/load_script.sh
new file mode 100644
index 000..7c92afa
--- /dev/null
+++ b/drivers/staging/mausb/scripts/load_script.sh
@@ -0,0 +1,125 @@
+#!/bin/bash
+# This script is used for loading  unloading the mausb_driver
+
+# note: this script must be run with root priviledge (for the modprobes)
+
+side=invalid
+mode=invalid
+load=load
+
+# Determine weather to load a host or device in TCP mode or snap mode
+while getopts hdbtslu opt; do
+   case $opt in
+   h) side=host
+  ;;
+   d) side=device
+  ;;
+   b) side=both
+  ;;
+   t) mode=tcp
+  

[PATCH 05/10] added media specific (MS) TCP drivers

2014-11-03 Thread Stephanie Wallick
This is where we handle media specific packets and transport. The MS driver
interfaces with a media agnostic (MA) driver via a series of transfer pairs.
Transfer pairs consist of a set of functions to pass MA USB packets back
and forth between MA and MS drivers. There is one transfer pair per device
endpoint and one transfer pair for control/management traffic. When the MA
driver needs to send an MA USB packet, it hands the packet off to the MS
layer where the packet is converted into an MS form and sent via TCP over
the underlying ethernet or wireless medium. When the MS driver receives a
packet, it converts it into an MA USB packet and hands it off the the MA
driver for handling.

In addition, the MS driver provides an interface to inititate connection events.
Because there are no physical MA USB ports in an MA USB host, the host must be
notified via software when a device is connected.

Lastly, the MS driver contains a number of ioctl functions that are used by a
utility to adjust medium-related driver parameters and connect or disconnect the
MA USB host and device drivers.

Signed-off-by: Sean O. Stalley sean.stal...@intel.com
Signed-off-by: Stephanie Wallick stephanie.s.wall...@intel.com
---
 drivers/staging/mausb/drivers/mausb_ioctl.c  | 373 +++
 drivers/staging/mausb/drivers/mausb_ioctl.h  |  99 +
 drivers/staging/mausb/drivers/mausb_msapi.c  | 110 ++
 drivers/staging/mausb/drivers/mausb_msapi.h  | 232 
 drivers/staging/mausb/drivers/mausb_tcp-device.c | 147 
 drivers/staging/mausb/drivers/mausb_tcp-host.c   | 144 
 drivers/staging/mausb/drivers/mausb_tcp.c| 446 +++
 drivers/staging/mausb/drivers/mausb_tcp.h| 129 +++
 8 files changed, 1680 insertions(+)
 create mode 100644 drivers/staging/mausb/drivers/mausb_ioctl.c
 create mode 100644 drivers/staging/mausb/drivers/mausb_ioctl.h
 create mode 100644 drivers/staging/mausb/drivers/mausb_msapi.c
 create mode 100644 drivers/staging/mausb/drivers/mausb_msapi.h
 create mode 100644 drivers/staging/mausb/drivers/mausb_tcp-device.c
 create mode 100644 drivers/staging/mausb/drivers/mausb_tcp-host.c
 create mode 100644 drivers/staging/mausb/drivers/mausb_tcp.c
 create mode 100644 drivers/staging/mausb/drivers/mausb_tcp.h

diff --git a/drivers/staging/mausb/drivers/mausb_ioctl.c 
b/drivers/staging/mausb/drivers/mausb_ioctl.c
new file mode 100644
index 000..0c6c6bd
--- /dev/null
+++ b/drivers/staging/mausb/drivers/mausb_ioctl.c
@@ -0,0 +1,373 @@
+/* Name: mausb_ioctl.c
+ * Description:  ioctl functions for MA USB media specific driver
+ *
+ * This file is provided under a dual BSD/GPLv2 license.  When using or
+ * redistributing this file, you may do so under either license.
+ *
+ * GPL LICENSE SUMMARY
+ *
+ * Copyright(c) 2014 Intel Corporation.
+ *
+ * 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.
+ *
+ * Contact Information:
+ * Sean Stalley, sean.stal...@intel.com
+ * Stephanie Wallick, stephanie.s.wall...@intel.com
+ * 2111 NE 25th Avenue
+ * Hillsboro, Oregon 97124
+ *
+ * BSD LICENSE
+ *
+ * Copyright(c) 2014 Intel Corporation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+* Redistributions of source code must retain the above copyright
+  notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+  notice, this list of conditions and the following disclaimer in
+  the documentation and/or other materials provided with the
+  distribution.
+* Neither the name of Intel Corporation nor the names of its
+  contributors may be used to endorse or promote products derived
+  from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 

[PATCH 03/10] added media agnostic (MA) data structures and handling

2014-11-03 Thread Stephanie Wallick
This is where we create, store and handle endpoint and device structures
that are specific to the MA USB drivers. Each MA USB structure maps 1:1
with it's corresponding USB structure (e.g. there is one MA USB endpoint
per USB endpoint).

Signed-off-by: Sean O. Stalley sean.stal...@intel.com
Signed-off-by: Stephanie Wallick stephanie.s.wall...@intel.com
---
 drivers/staging/mausb/drivers/mausb_const.h| 109 
 drivers/staging/mausb/drivers/mausb_mem-host.c | 404 
 drivers/staging/mausb/drivers/mausb_mem-host.h |  74 +++
 drivers/staging/mausb/drivers/mausb_mem.c  | 844 +
 drivers/staging/mausb/drivers/mausb_mem.h  | 509 +++
 drivers/staging/mausb/drivers/mausb_state.h| 184 ++
 6 files changed, 2124 insertions(+)
 create mode 100755 drivers/staging/mausb/drivers/mausb_const.h
 create mode 100644 drivers/staging/mausb/drivers/mausb_mem-host.c
 create mode 100644 drivers/staging/mausb/drivers/mausb_mem-host.h
 create mode 100644 drivers/staging/mausb/drivers/mausb_mem.c
 create mode 100644 drivers/staging/mausb/drivers/mausb_mem.h
 create mode 100644 drivers/staging/mausb/drivers/mausb_state.h

diff --git a/drivers/staging/mausb/drivers/mausb_const.h 
b/drivers/staging/mausb/drivers/mausb_const.h
new file mode 100755
index 000..1089f81
--- /dev/null
+++ b/drivers/staging/mausb/drivers/mausb_const.h
@@ -0,0 +1,109 @@
+/* Name:   mausb_const.h
+ * Description: This header describes the Media Agnostic USB constants
+ *  that must be known by the both the host and device side 
drivers.
+ *
+ * This file is provided under a dual BSD/GPLv2 license.  When using or
+ * redistributing this file, you may do so under either license.
+ *
+ * GPL LICENSE SUMMARY
+ *
+ * Copyright(c) 2014 Intel Corporation.
+ *
+ * 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.
+ *
+ * Contact Information:
+ * Sean Stalley, sean.stal...@intel.com
+ * Stephanie Wallick, stephanie.s.wall...@intel.com
+ * 2111 NE 25th Avenue
+ * Hillsboro, Oregon 97124
+ *
+ * BSD LICENSE
+ *
+ * Copyright(c) 2014 Intel Corporation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+* Redistributions of source code must retain the above copyright
+  notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+  notice, this list of conditions and the following disclaimer in
+  the documentation and/or other materials provided with the
+  distribution.
+* Neither the name of Intel Corporation nor the names of its
+  contributors may be used to endorse or promote products derived
+  from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef __MAUSB_CONST_H
+#define __MAUSB_CONST_H
+
+/* MA USB protocol constants per Table 68 of the MA USB Spec */
+#define MAUSB_DATA_CHANNEL_DELAY   400 /* temp value */
+#define MAUSB_MGMT_CHANNEL_DELAY   ((100 * HZ)/1000 + 1)
+#define MAUSB_MGMT_RESPONSE_DELAY  ((5 * HZ)/1000 + 1) /* 5 msec */
+#define MAUSB_MGMT_RT_DELAY \
+   ((MAUSB_MGMT_RESPONSE_DELAY + (2 * MAUSB_MGMT_CHANNEL_DELAY)))
+#define MAUSB_TRANSFER_RESPONSE_TIME   10  /* 10 msec */
+#define MAUSB_TRANSFER_TIMEOUT \
+   (MAUSB_TRANSFER_RESPONSE_TIME + (2 * MAUSB_DATA_CHANNEL_DELAY))
+#define MAUSB_TRANSFER_KEEP_ALIVE \
+   (MAUSB_TRANSFER_RESPONSE_TIME + MAUSB_DATA_CHANNEL_DELAY)
+#define MAUSB_DEFAULT_KEEP_ALIVE0
+#define MAUSB_MAX_TRANSFER_LIFETIME 1000   /* 1 sec */
+#define MAUSB_TRANSFER_REPEAT_TIME  10 /* 10 msec */
+
+#define MAUSB_MAX_REQ_ID((1  8) - 1)
+#define MAUSB_MAX_SEQ_NUM   

[PATCH 00/10] MA USB drivers cover letter

2014-11-03 Thread Stephanie Wallick

Media Agnostic (MA) USB enables the USB protocol to be used over a wide
range of physical media. MA USB is a relatively new protocol and is
currently unsupported in the Linux kernel. This patch set adds the
following drivers with the following capabilities:

1) MA USB Host:
- provides functionality of a USB Host Controller.
- implements MA USB protocol for a MA USB host.
- provides MA USB packet transport over TCP

2) MA USB Device:
- provides functionality of a USB Device Controller.
- implements MA USB protocol for a MA USB device.
- provides MA USB packet transport over TCP


Driver overview:

The MA USB Host and Device stacks each consists of two drivers. The first
driver is the Media Agnostic (MA) layer, which interfaces with the existing
USB stack and implements the MA USB protocol as defined in the MA USB
Specification Release 1.0. The second driver is the Media Specific (MS) layer.
The MS layer interfaces with the network stack to send and receive MA USB
packets via TCP.

When an MA USB driver is loaded, the MA layer loads first and registers
itself as a USB host controller with the USB Core. The MS layer then loads
and registers itself with the MA layer. Once the MS layer is registered,
the MA layer initiates creation of a communication channel for managment/control
packets. In the case of the MA USB host, the driver the opens a TCP socket
and polls periodically for a device. In the case of the MA USB device, the
driver identifies the MA USB host by IP address, then looks for and binds to
the open TCP socket of the MA USB host. When a connection event is initiated,
the MA USB host notifies the USB core and normal USB enumeration and
configuration results with each respective USB packet translated into its
MA USB equivalent.

Tools:

1) various scripts are included to help load and unload the MA USB host and
   device drivers.

2) a utility is included to help connect, disconnect, and test the MA USB 
   host and device drivers.

References:

MA USB Specification v1.0 available at 
www.usb.org/developers/docs/devclass_docs/


Stephanie Wallick (10):
  added media agnostic (MA) USB HCD driver
  added media agnostic (MA) USB HCD roothubs
  added media agnostic (MA) data structures and handling
  added media agnostic (MA) USB packet handling
  added media specific (MS) TCP drivers
  added media agnostic (MA) UDC
  added media agnostic (MA) USB management packet handling
  added media agnostic (MA) USB data packet handling
  added tools for building/loading media agnostic (MA) USB drivers
  added kernel build, configuration, and TODO files

 drivers/staging/Kconfig|2 +
 drivers/staging/Makefile   |1 +
 drivers/staging/mausb/Kconfig  |   16 +
 drivers/staging/mausb/Makefile |3 +
 drivers/staging/mausb/TODO |   14 +
 drivers/staging/mausb/drivers/Kconfig  |   34 +
 drivers/staging/mausb/drivers/Makefile |   20 +
 drivers/staging/mausb/drivers/mausb_const.h|  109 ++
 drivers/staging/mausb/drivers/mausb_hcd.c  |  970 +
 drivers/staging/mausb/drivers/mausb_hcd.h  |  171 +++
 drivers/staging/mausb/drivers/mausb_hub.c  |  851 +++
 drivers/staging/mausb/drivers/mausb_hub.h  |  128 ++
 drivers/staging/mausb/drivers/mausb_ioctl.c|  373 +
 drivers/staging/mausb/drivers/mausb_ioctl.h|   99 ++
 drivers/staging/mausb/drivers/mausb_mem-host.c |  404 ++
 drivers/staging/mausb/drivers/mausb_mem-host.h |   74 +
 drivers/staging/mausb/drivers/mausb_mem.c  |  844 +++
 drivers/staging/mausb/drivers/mausb_mem.h  |  509 +++
 drivers/staging/mausb/drivers/mausb_mgmt.c |  888 
 drivers/staging/mausb/drivers/mausb_mgmt.h |   90 ++
 drivers/staging/mausb/drivers/mausb_msapi.c|  110 ++
 drivers/staging/mausb/drivers/mausb_msapi.h|  232 +++
 drivers/staging/mausb/drivers/mausb_pkt.c  | 1038 ++
 drivers/staging/mausb/drivers/mausb_pkt.h  |  914 
 drivers/staging/mausb/drivers/mausb_state.h|  184 +++
 drivers/staging/mausb/drivers/mausb_tcp-device.c   |  147 ++
 drivers/staging/mausb/drivers/mausb_tcp-host.c |  144 ++
 drivers/staging/mausb/drivers/mausb_tcp.c  |  446 ++
 drivers/staging/mausb/drivers/mausb_tcp.h  |  129 ++
 drivers/staging/mausb/drivers/mausb_tx-device.c|  847 +++
 drivers/staging/mausb/drivers/mausb_tx-host.c  | 1211 
 drivers/staging/mausb/drivers/mausb_tx.c   |  318 +
 drivers/staging/mausb/drivers/mausb_tx.h   |  129 ++
 drivers/staging/mausb/drivers/mausb_udc.c  | 1488 
 drivers/staging/mausb/drivers/mausb_udc.h  |  147 ++
 .../staging/mausb/scripts/build_load_connect.sh|   69 +
 

[PATCH 04/10] added media agnostic (MA) USB packet handling

2014-11-03 Thread Stephanie Wallick
This is where we handle MA USB packets. The structure and types of MA USB
packets are defined in the MA USB specification. When an MA USB driver
receives a USB packet, it translates it into a MA USB packet (or packets
if urb exceeds maximum USB packet size). When an MA USB packet is received,
the data from that packet is given to the waiting USB packet and the USB
packet is released.

Signed-off-by: Sean O. Stalley sean.stal...@intel.com
Signed-off-by: Stephanie Wallick stephanie.s.wall...@intel.com
---
 drivers/staging/mausb/drivers/mausb_pkt.c | 1038 +
 drivers/staging/mausb/drivers/mausb_pkt.h |  914 +
 2 files changed, 1952 insertions(+)
 create mode 100644 drivers/staging/mausb/drivers/mausb_pkt.c
 create mode 100644 drivers/staging/mausb/drivers/mausb_pkt.h

diff --git a/drivers/staging/mausb/drivers/mausb_pkt.c 
b/drivers/staging/mausb/drivers/mausb_pkt.c
new file mode 100644
index 000..c78cfc2
--- /dev/null
+++ b/drivers/staging/mausb/drivers/mausb_pkt.c
@@ -0,0 +1,1038 @@
+/* name:   mausb_pkt.c
+ * description: MA USB packet helper functions
+ *
+ * This file is provided under a dual BSD/GPLv2 license.  When using or
+ * redistributing this file, you may do so under either license.
+ *
+ * GPL LICENSE SUMMARY
+ *
+ * Copyright(c) 2014 Intel Corporation.
+ *
+ * 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.
+ *
+ * Contact Information:
+ * Sean Stalley, sean.stal...@intel.com
+ * Stephanie Wallick, stephanie.s.wall...@intel.com
+ * 2111 NE 25th Avenue
+ * Hillsboro, Oregon 97124
+ *
+ * BSD LICENSE
+ *
+ * Copyright(c) 2014 Intel Corporation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+* Redistributions of source code must retain the above copyright
+  notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+  notice, this list of conditions and the following disclaimer in
+  the documentation and/or other materials provided with the
+  distribution.
+* Neither the name of Intel Corporation nor the names of its
+  contributors may be used to endorse or promote products derived
+  from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include linux/slab.h
+#include linux/usb/ch9.h
+#include linux/usb.h
+
+#include mausb_mem.h
+#include mausb_pkt.h
+#include mausb_const.h
+
+/**
+ * Translates numerical packet type into corresponding string (for printing).
+ */
+const char *mausb_type_to_string(enum mausb_pkt_type type)
+{
+   switch (type) {
+   case CapReq:
+   return CapReq;
+   case CapResp:
+   return CapResp;
+   case USBDevHandleReq:
+   return USBDevHandleReq;
+   case USBDevHandleResp:
+   return USBDevHandleResp;
+   case EPHandleReq:
+   return EPHandleReq;
+   case EPHandleResp:
+   return EPHandleResp;
+   case EPActivateReq:
+   return EPActivateReq;
+   case EPActivateResp:
+   return EPActivateResp;
+   case EPInactivateReq:
+   return EPInactivateReq;
+   case EPInactivateResp:
+   return EPInactivateResp;
+   case EPResetReq:
+   return EPResetReq;
+   case EPResetResp:
+   return EPResetResp;
+   case EPClearTransferReq:
+   return EPClearTransferReq;
+   case EPClearTransferResp:
+   return EPClearTransferResp;
+   case EPHandleDeleteReq:
+   return EPHandleDeleteReq;
+   case EPHandleDeleteResp:
+   return EPHandleDeleteResp;
+   case 

[PATCH 01/10] added media agnostic (MA) USB HCD driver

2014-11-03 Thread Stephanie Wallick
This is where we interface with the existing USB stack and implement the
functionality of a USB host controller driver. From the host's perspective,
we appear as just another USB host controller. However, instead of passing
traffic along a wired USB bus, the driver hands USB packets off for transport
per Media Agnostic USB protocol.

Signed-off-by: Sean O. Stalley sean.stal...@intel.com
Signed-off-by: Stephanie Wallick stephanie.s.wall...@intel.com
---
 drivers/staging/mausb/drivers/mausb_hcd.c | 970 ++
 drivers/staging/mausb/drivers/mausb_hcd.h | 171 ++
 2 files changed, 1141 insertions(+)
 create mode 100755 drivers/staging/mausb/drivers/mausb_hcd.c
 create mode 100644 drivers/staging/mausb/drivers/mausb_hcd.h

diff --git a/drivers/staging/mausb/drivers/mausb_hcd.c 
b/drivers/staging/mausb/drivers/mausb_hcd.c
new file mode 100755
index 000..03e8f0f
--- /dev/null
+++ b/drivers/staging/mausb/drivers/mausb_hcd.c
@@ -0,0 +1,970 @@
+/* Name:   mausb_hcd.c
+ * Description: Creates and initializes a virtual USB host controller driver
+ * for the Media Agnostic USB host driver.
+ *
+ * This file is provided under a dual BSD/GPLv2 license.  When using or
+ * redistributing this file, you may do so under either license.
+ *
+ * GPL LICENSE SUMMARY
+ *
+ * Copyright(c) 2014 Intel Corporation.
+ *
+ * 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.
+ *
+ * Contact Information:
+ * Sean Stalley, sean.stal...@intel.com
+ * Stephanie Wallick, stephanie.s.wall...@intel.com
+ * 2111 NE 25th Avenue
+ * Hillsboro, Oregon 97124
+ *
+ * BSD LICENSE
+ *
+ * Copyright(c) 2014 Intel Corporation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+* Redistributions of source code must retain the above copyright
+  notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+  notice, this list of conditions and the following disclaimer in
+  the documentation and/or other materials provided with the
+  distribution.
+* Neither the name of Intel Corporation nor the names of its
+  contributors may be used to endorse or promote products derived
+  from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#define DEBUG
+
+#include linux/init.h
+#include linux/wait.h
+#include linux/module.h
+#include linux/usb.h
+#include linux/usb/hcd.h
+#include linux/platform_device.h
+#include linux/usb/ch11.h
+#include linux/pm_runtime.h
+#include linux/usb/gadget.h
+#include linux/kthread.h
+#include linux/random.h
+
+#include mausb_hcd.h
+#include mausb_hub.h
+#include mausb_pkt.h
+#include mausb_mem-host.h
+#include mausb_msapi.h
+#include mausb_mgmt.h
+#include mausb_state.h
+#include mausb_tx.h
+
+static struct platform_device mausb_pdev;
+
+struct api_context {
+   struct completion   done;
+   int status;
+};
+
+/*
+ * pointer conversion functions
+ */
+inline struct mausb_hcd *usb_hcd_to_mausb_hcd(struct usb_hcd *hcd)
+{
+   if (usb_hcd_is_primary_hcd(hcd))
+   return *((struct mausb_hcd **) (hcd-hcd_priv));
+   else
+   return *((struct mausb_hcd **) (hcd-primary_hcd-hcd_priv));
+}
+
+inline struct usb_hcd *mausb_hcd_to_usb_hcd(struct mausb_hcd *mhcd)
+{
+   if (mhcd-shared_hcd  !usb_hcd_is_primary_hcd(mhcd-shared_hcd))
+   return mhcd-shared_hcd;
+   else
+   return mhcd-usb_hcd;
+}
+
+inline struct device *mausb_hcd_to_dev(struct mausb_hcd *mhcd)
+{
+   return mausb_hcd_to_usb_hcd(mhcd)-self.controller;
+}
+
+inline struct mausb_urb *usb_urb_to_mausb_urb(struct urb *urb)
+{
+   

[PATCH 08/10] added media agnostic (MA) USB data packet handling

2014-11-03 Thread Stephanie Wallick
The MA USB Specification outlines packet types and a protocol for
bulk and interrupt transfers. This is where we implement that protocol.
MA USB transfers are initiated by the host via a TransferRequest packet.
The host then either sends data to the device via subsequent
TransferRequest packets (OUT transfer) or receives data from the device
via TransferResponse packets (IN transfer). Each data transfer is
identified by a Request ID number that increments up for each new transfer.
One URB maps to one MA USB transfer. A transfer can consist of one or
more MA USB packets depending on total transfer size. Each MA USB packet
is assigned a Sequence Number with sequence numbers incrementing up for
each new packet. The host sends a TransferAck packet to acknowledge the
end of a transfer or when requested to do so by the device.

Signed-off-by: Sean O. Stalley sean.stal...@intel.com
Signed-off-by: Stephanie Wallick stephanie.s.wall...@intel.com
---
 drivers/staging/mausb/drivers/mausb_tx-device.c |  847 
 drivers/staging/mausb/drivers/mausb_tx-host.c   | 1211 +++
 drivers/staging/mausb/drivers/mausb_tx.c|  318 ++
 drivers/staging/mausb/drivers/mausb_tx.h|  129 +++
 4 files changed, 2505 insertions(+)
 create mode 100644 drivers/staging/mausb/drivers/mausb_tx-device.c
 create mode 100644 drivers/staging/mausb/drivers/mausb_tx-host.c
 create mode 100644 drivers/staging/mausb/drivers/mausb_tx.c
 create mode 100644 drivers/staging/mausb/drivers/mausb_tx.h

diff --git a/drivers/staging/mausb/drivers/mausb_tx-device.c 
b/drivers/staging/mausb/drivers/mausb_tx-device.c
new file mode 100644
index 000..a14df54
--- /dev/null
+++ b/drivers/staging/mausb/drivers/mausb_tx-device.c
@@ -0,0 +1,847 @@
+/* Name:mausb_tx_device.c
+ * Description: implements MA USB transfers on device side
+ *
+ * This file is provided under a dual BSD/GPLv2 license.  When using or
+ * redistributing this file, you may do so under either license.
+ *
+ * GPL LICENSE SUMMARY
+ *
+ * Copyright(c) 2014 Intel Corporation.
+ *
+ * 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.
+ *
+ * Contact Information:
+ * Sean Stalley, sean.stal...@intel.com
+ * Stephanie Wallick, stephanie.s.wall...@intel.com
+ * 2111 NE 25th Avenue
+ * Hillsboro, Oregon 97124
+ *
+ * BSD LICENSE
+ *
+ * Copyright(c) 2014 Intel Corporation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+   * Redistributions of source code must retain the above copyright
+  notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+  notice, this list of conditions and the following disclaimer in
+  the documentation and/or other materials provided with the
+  distribution.
+* Neither the name of Intel Corporation nor the names of its
+  contributors may be used to endorse or promote products derived
+  from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#define DEBUG
+
+#include mausb_hcd.h
+#include mausb_udc.h
+#include mausb_pkt.h
+#include mausb_tx.h
+
+#include linux/kthread.h
+
+int device_transfer_timeout(void *data)
+{
+   struct mausb_host_ep*ep = (struct mausb_host_ep *) data;
+   struct mausb_udc*udc = mausb_host_ep_to_maudc(ep);
+
+   while (!kthread_should_stop()) {
+   /*
+* make sure actual transfer timeout (i.e. not thread
+* setup)
+*/
+   if (ep-tx_timed_out) {
+   if (ep-state.retry_counter  0) {
+   maudc_dbg(udc, %s: device timed out,
+

Re: [PATCH 01/10] added media agnostic (MA) USB HCD driver

2014-11-03 Thread Greg KH
On Mon, Nov 03, 2014 at 12:42:48PM -0800, Stephanie Wallick wrote:
 +#define DEBUG

I doubt you want this in the driver enabled by default :(

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


Re: [PATCH 01/10] added media agnostic (MA) USB HCD driver

2014-11-03 Thread Greg KH
On Mon, Nov 03, 2014 at 12:42:48PM -0800, Stephanie Wallick wrote:
 +EXPORT_SYMBOL(mausb_register_ms_driver);

EXPORT_SYMBOL_GPL()?  I have to ask...

 +static int mausb_hcd_init(void)
 +{
 + int ret;
 +
 + /* register HCD driver */
 + ret = platform_driver_register(mausb_driver);

Why is this a platform driver?  How does this relate to platform
hardware?

 + if (ret  0) {
 + printk(KERN_DEBUG %s: failed to register HC driver: 
 +  error number %d\n, __func__, ret);

pr_err()?

return here, that way you don't need:

 + } else {

This indentation.

 + /* register HCD device */
 + ret = platform_device_register(mausb_pdev);

But again, why is this a platform device?  What platform resources does
it have / require?

 +
 + if (ret  0) {
 + printk(KERN_DEBUG %s: failed to register HC device:
 + error number %d\n, __func__, ret);

pr_err()?

 + platform_driver_unregister(mausb_driver);
 + } else {
 + /* direct the release function (for exiting) */
 + mausb_pdev.dev.release = mausb_dev_release;

That seems like a serious hack, why do you need to do this in this
manner?

 +
 + if (ret  0) {
 + printk(KERN_DEBUG failed to register HC
 +  chardev: error number %d\n, ret);

pr_err()?

thanks,

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


Re: [PATCH 10/10] added kernel build, configuration, and TODO files

2014-11-03 Thread Greg KH
On Mon, Nov 03, 2014 at 12:42:57PM -0800, Stephanie Wallick wrote:
 --- /dev/null
 +++ b/drivers/staging/mausb/drivers/Makefile
 @@ -0,0 +1,20 @@
 +#MY_CFLAGS =-g -O0 -DEBUG_OUTPUT

Please remove that line, it's not ever to be used.


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


Re: [PATCH 10/10] added kernel build, configuration, and TODO files

2014-11-03 Thread Greg KH
On Mon, Nov 03, 2014 at 12:42:57PM -0800, Stephanie Wallick wrote:
 --- /dev/null
 +++ b/drivers/staging/mausb/TODO
 @@ -0,0 +1,14 @@
 +TODO:
 + - checkpatch.pl cleanups

Is this still true?

And why does this need to be a staging driver?  What's wrong with making
it a real driver now?


 + - address miscellaneous TODO statements in code
 + - add support for multiple media agnostic (MA) devices
 + - add/improve support for unimplemented packet types
 + - handle errors and failure with more grace and less crash
 +
 +Please send patches to Greg Kroah-Hartman g...@kroah.com and cc:

You didn't use this email address...

 + Sean Stalley sean.stal...@intel.com
 + Stephanie Wallick stephanie.s.wall...@intel.com
 +

Just make a MAINTAINERS entry please for this info.

thanks,

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


Re: [PATCH 01/10] added media agnostic (MA) USB HCD driver

2014-11-03 Thread steph
On Mon, Nov 03, 2014 at 01:18:16PM -0800, Greg KH wrote:
 On Mon, Nov 03, 2014 at 12:42:48PM -0800, Stephanie Wallick wrote:
  +#define DEBUG
 
 I doubt you want this in the driver enabled by default :(
 

Thank you for catching, will remove in the next patch version.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 11/24] staging: unisys: refactor VISORCHIPSET_EXTERNALPORT_INFO

2014-11-03 Thread Greg KH
On Fri, Oct 31, 2014 at 09:57:30AM -0400, Benjamin Romer wrote:
 Remove the typedef and just use struct visorchipset_externalport_info instead.
 Fix all CamelCase names:
 
 switchNo = switch_no
 externalPortNo = external_port_no
 networkZoneGuid = network_zone_uuid
 pdPort = pd_port
 ipNetmask = ip_netmask
 ipBroadcast = ip_broadcast
 ipNetwork = ip_network
 ipGateway = ip_gateway
 ipDNS = ip_dns
 Reserved1 = reserved1
 Reserved2 = reserved2
 pendingMsgHdr = pending_msg_hdr
 
 Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com
 ---
  drivers/staging/unisys/visorchipset/visorchipset.h | 31 
 +++---
  1 file changed, 15 insertions(+), 16 deletions(-)
 
 diff --git a/drivers/staging/unisys/visorchipset/visorchipset.h 
 b/drivers/staging/unisys/visorchipset/visorchipset.h
 index 762bc13..e20eb10 100644
 --- a/drivers/staging/unisys/visorchipset/visorchipset.h
 +++ b/drivers/staging/unisys/visorchipset/visorchipset.h
 @@ -178,25 +178,24 @@ struct visorchipset_switch_info {
  /** Attributes for a particular Supervisor external port, which is connected
   *  to a specific switch.
   */
 -typedef struct {
 - u32 switchNo;
 - u32 externalPortNo;
 +struct visorchipset_externalport_info {
 + u32 switch_no;
 + u32 external_port_no;
   struct visorchipset_state state;
 - uuid_le networkZoneGuid;
 - int pdPort;
 + uuid_le network_zone_uuid;
 + int pd_port;
   u8 *ip;
 - u8 *ipNetmask;
 - u8 *ipBroadcast;
 - u8 *ipNetwork;
 - u8 *ipGateway;
 - u8 *ipDNS;
 - u64 Reserved1;
 - u32 Reserved2;  /* control_vm_id */
 + u8 *ip_netmask;
 + u8 *ip_broadcast;
 + u8 *ip_network;
 + u8 *ip_gateway;
 + u8 *ip_dns;
 + u64 reserved1;
 + u32 reserved2;  /* control_vm_id */
   struct device dev;
   BOOL dev_exists;
 - struct controlvm_message_header pendingMsgHdr;
 -
 -} VISORCHIPSET_EXTERNALPORT_INFO;
 + struct controlvm_message_header pending_msg_hdr;
 +};
  
  /** Attributes for a particular Supervisor internal port, which is how a
   *  device connects to a particular switch.
 @@ -278,7 +277,7 @@ BOOL visorchipset_get_device_info(ulong busNo, ulong 
 devNo,
  BOOL visorchipset_get_switch_info(ulong switchNo,
 struct visorchipset_switch_info *switchInfo);
  BOOL visorchipset_get_externalport_info(ulong switchNo, ulong externalPortNo,
 - VISORCHIPSET_EXTERNALPORT_INFO
 + struct visorchipset_externalport_info
   *externalPortInfo);
  BOOL visorchipset_set_bus_context(ulong busNo, void *context);
  BOOL visorchipset_set_device_context(ulong busNo, ulong devNo, void 
 *context);

Same here, can it just be deleted?
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 12/24] staging: unisys: refactor VISORCHIPSET_INTERNALPORT_INFO

2014-11-03 Thread Greg KH
On Fri, Oct 31, 2014 at 09:57:31AM -0400, Benjamin Romer wrote:
 Get rid of the typedef and use struct visorchipset_internalport_info and fix
 CamelCase member names:
 
 switchNo = switch_no
 internalPortNo = internal_port_no
 busNo = bus_no
 devNo = dev_no
 Reserved1 = reserved1
 Reserved2 = reserved2
 pendingMsgHdr = pending_msg_hdr
 procObject = proc_object
 
 Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com
 ---
  drivers/staging/unisys/visorchipset/visorchipset.h | 22 
 +++---
  1 file changed, 11 insertions(+), 11 deletions(-)
 
 diff --git a/drivers/staging/unisys/visorchipset/visorchipset.h 
 b/drivers/staging/unisys/visorchipset/visorchipset.h
 index e20eb10..7d3b2c1 100644
 --- a/drivers/staging/unisys/visorchipset/visorchipset.h
 +++ b/drivers/staging/unisys/visorchipset/visorchipset.h
 @@ -200,18 +200,18 @@ struct visorchipset_externalport_info {
  /** Attributes for a particular Supervisor internal port, which is how a
   *  device connects to a particular switch.
   */
 -typedef struct {
 - u32 switchNo;
 - u32 internalPortNo;
 +struct visorchipset_internalport_info {
 + u32 switch_no;
 + u32 internal_port_no;
   struct visorchipset_state state;
 - u32 busNo;  /* valid only when state.attached == 1 */
 - u32 devNo;  /* valid only when state.attached == 1 */
 - u64 Reserved1;
 - u32 Reserved2;  /* CONTROLVM_ID */
 - struct controlvm_message_header pendingMsgHdr;
 - MYPROCOBJECT *procObject;
 -
 -} VISORCHIPSET_INTERNALPORT_INFO;
 + u32 bus_no; /* valid only when state.attached == 1 */
 + u32 dev_no; /* valid only when state.attached == 1 */
 + u64 reserved1;
 + u32 reserved2;  /* CONTROLVM_ID */
 + struct controlvm_message_header pending_msg_hdr;
 + MYPROCOBJECT *proc_object;
 +
 +};
  
  /*  These functions will be called from within visorchipset when certain
   *  events happen.  (The implementation of these functions is outside of

And here, deleted?
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 10/24] staging: unisys: refactor VISORCHIPSET_SWITCH_INFO

2014-11-03 Thread Greg KH
On Fri, Oct 31, 2014 at 09:57:29AM -0400, Benjamin Romer wrote:
 Remove the typedef and use struct visorchipset_switch_info instead. Fix all
 CamelCase member names:
 
 switchNo = switch_no
 switchTypeGuid = switch_type_uuid
 authService1 = authservice1
 authService2 = authservice2
 authService3 = authservice3
 securityContext = security_context
 Reserved = reserved
 Reserved2 = reserved2
 pendingMsgHdr = pending_msg_hdr
 
 Signed-off-by: Benjamin Romer benjamin.ro...@unisys.com
 ---
  drivers/staging/unisys/visorchipset/visorchipset.h | 25 
 +++---
  1 file changed, 12 insertions(+), 13 deletions(-)
 
 diff --git a/drivers/staging/unisys/visorchipset/visorchipset.h 
 b/drivers/staging/unisys/visorchipset/visorchipset.h
 index a578d0a..762bc13 100644
 --- a/drivers/staging/unisys/visorchipset/visorchipset.h
 +++ b/drivers/staging/unisys/visorchipset/visorchipset.h
 @@ -160,21 +160,20 @@ findbus(struct list_head *list, u32 bus_no)
  
  /** Attributes for a particular Supervisor switch.
   */
 -typedef struct {
 - u32 switchNo;
 +struct visorchipset_switch_info {
 + u32 switch_no;
   struct visorchipset_state state;
 - uuid_le switchTypeGuid;
 - u8 *authService1;
 - u8 *authService2;
 - u8 *authService3;
 - u8 *securityContext;
 - u64 Reserved;
 - u32 Reserved2;  /* control_vm_id */
 + uuid_le switch_type_uuid;
 + u8 *authservice1;
 + u8 *authservice2;
 + u8 *authservice3;
 + u8 *security_context;
 + u64 reserved;
 + u32 reserved2;  /* control_vm_id */
   struct device dev;
   BOOL dev_exists;
 - struct controlvm_message_header pendingMsgHdr;
 -
 -} VISORCHIPSET_SWITCH_INFO;
 + struct controlvm_message_header pending_msg_hdr;
 +};
  
  /** Attributes for a particular Supervisor external port, which is connected
   *  to a specific switch.
 @@ -277,7 +276,7 @@ BOOL visorchipset_get_bus_info(ulong busNo,
  BOOL visorchipset_get_device_info(ulong busNo, ulong devNo,
 struct visorchipset_device_info *devInfo);
  BOOL visorchipset_get_switch_info(ulong switchNo,
 -   VISORCHIPSET_SWITCH_INFO *switchInfo);
 +   struct visorchipset_switch_info *switchInfo);
  BOOL visorchipset_get_externalport_info(ulong switchNo, ulong externalPortNo,
   VISORCHIPSET_EXTERNALPORT_INFO
   *externalPortInfo);

Does no one do anythign with this structure?  If so, why not just delete
it?

In future patches, don't worry about it in this series.

thanks,

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


Re: [PATCH 01/10] added media agnostic (MA) USB HCD driver

2014-11-03 Thread steph
On Mon, Nov 03, 2014 at 01:21:39PM -0800, Greg KH wrote:
 On Mon, Nov 03, 2014 at 12:42:48PM -0800, Stephanie Wallick wrote:
  +EXPORT_SYMBOL(mausb_register_ms_driver);
 
 EXPORT_SYMBOL_GPL()?  I have to ask...

The source is dual-licenced under BSD and GPL. It was our understanding
that dual-licensed should use EXPORT_SYMBOL() instead. Is that wrong?
 
  +static int mausb_hcd_init(void)
  +{
  +   int ret;
  +
  +   /* register HCD driver */
  +   ret = platform_driver_register(mausb_driver);
 
 Why is this a platform driver?  How does this relate to platform
 hardware?
 
The driver doesn't require platform resources. It looks like a host
controller driver but communicates over the network instead of to
a physical host controller. There is no MA USB-specific hardware.

Should we use a struct device instead of a struct platform_device?

  +   if (ret  0) {
  +   printk(KERN_DEBUG %s: failed to register HC driver: 
  +error number %d\n, __func__, ret);
 
 pr_err()?

Will change all printk() to pr_err() in next patch.
 
 return here, that way you don't need:
 
  +   } else {
 
 This indentation.
 
Will fix in next patch.

  +   /* register HCD device */
  +   ret = platform_device_register(mausb_pdev);
 
 But again, why is this a platform device?  What platform resources does
 it have / require?
 
See above.

  +
  +   if (ret  0) {
  +   printk(KERN_DEBUG %s: failed to register HC device:
  +   error number %d\n, __func__, ret);
 
 pr_err()?
 
See above.

  +   platform_driver_unregister(mausb_driver);
  +   } else {
  +   /* direct the release function (for exiting) */
  +   mausb_pdev.dev.release = mausb_dev_release;
 
 That seems like a serious hack, why do you need to do this in this
 manner?
 
This will go away when we get rid of the platform device.

  +
  +   if (ret  0) {
  +   printk(KERN_DEBUG failed to register HC
  +chardev: error number %d\n, ret);
 
 pr_err()?

See above.
 
 thanks,
 
 greg k-h

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


Re: [PATCH v2 1/6] staging: ft1000: spaces required around that '=', '' and '=='

2014-11-03 Thread Greg Kroah-Hartman
On Sat, Nov 01, 2014 at 10:47:22AM +0800, Chen Weixiang wrote:
 Remove following code style errors from ft1000/ft1000-usb/ft1000_debug.c
 and ft1000/ft1000-pcmcia/ft1000_hw.c:
 ERROR: spaces required around that '=' (ctx:VxV)
 ERROR: spaces required around that '' (ctx:VxV)
 ERROR: spaces required around that '==' (ctx:VxV)
 
 Signed-off-by: Chen Weixiang weixiang.c...@gmail.com
 ---
  drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c |  6 ++---
  drivers/staging/ft1000/ft1000-usb/ft1000_debug.c | 28 
 
  2 files changed, 17 insertions(+), 17 deletions(-)

This patch doesn't apply against my staging.git tree on git.kernel.org
Please refresh the series against the staging-testing and resend.

thanks,

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


Re: [PATCH 1/2] staging: ft1000: Whitespace neatening

2014-11-03 Thread Greg Kroah-Hartman
On Sat, Nov 01, 2014 at 04:53:38PM -0700, Joe Perches wrote:
 Use normal kernel style, indentation and alignment.
 
 git diff -w shows no difference
 
 Signed-off-by: Joe Perches j...@perches.com
 ---
  drivers/staging/ft1000/ft1000-pcmcia/boot.h|   34 +-
  drivers/staging/ft1000/ft1000-pcmcia/ft1000.h  |   30 +-
  drivers/staging/ft1000/ft1000-pcmcia/ft1000_cs.c   |   50 +-
  drivers/staging/ft1000/ft1000-pcmcia/ft1000_dnld.c |  204 ++--
  drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c   |  688 +--
  drivers/staging/ft1000/ft1000-usb/ft1000_debug.c   | 1190 
 ++--
  .../staging/ft1000/ft1000-usb/ft1000_download.c|  300 ++---
  drivers/staging/ft1000/ft1000-usb/ft1000_hw.c  |  244 ++--
  drivers/staging/ft1000/ft1000-usb/ft1000_ioctl.h   |   60 +-
  drivers/staging/ft1000/ft1000-usb/ft1000_usb.c |   14 +-
  drivers/staging/ft1000/ft1000-usb/ft1000_usb.h |2 +-
  11 files changed, 1408 insertions(+), 1408 deletions(-)

Fails to apply here:

checking file drivers/staging/ft1000/ft1000-pcmcia/boot.h
checking file drivers/staging/ft1000/ft1000-pcmcia/ft1000.h
checking file drivers/staging/ft1000/ft1000-pcmcia/ft1000_cs.c
checking file drivers/staging/ft1000/ft1000-pcmcia/ft1000_dnld.c
checking file drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
Hunk #41 FAILED at 992.
Hunk #49 FAILED at 1220.
Hunk #64 FAILED at 1743.
3 out of 78 hunks FAILED

Care to refresh it and resend both of these?

thanks,

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


[no subject]

2014-11-03 Thread Aya Mahfouz
Dan Carpenter dan.carpen...@oracle.com, Gulsah Kose gulsah.1...@gmail.com, 
Tuomas Tynkkynen tuomas.tynkky...@iki.fi,
Matina Maria Trompouki mtrom...@gmail.com
Cc: linux-me...@vger.kernel.org, de...@driverdev.osuosl.org, 
linux-ker...@vger.kernel.org
Bcc: 
Subject: [PATCH] staging: media: lirc: replace dev_err by pr_err
Reply-To: 

This patch replaces dev_err by pr_err since the value 
of ir is NULL when the message is displayed.

Signed-off-by: Aya Mahfouz mahfouz.saif.elya...@gmail.com
---
 drivers/staging/media/lirc/lirc_zilog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/lirc/lirc_zilog.c 
b/drivers/staging/media/lirc/lirc_zilog.c
index 11a7cb1..ecdd71e 100644
--- a/drivers/staging/media/lirc/lirc_zilog.c
+++ b/drivers/staging/media/lirc/lirc_zilog.c
@@ -1633,7 +1633,7 @@ out_put_xx:
 out_put_ir:
put_ir_device(ir, true);
 out_no_ir:
-   dev_err(ir-l.dev, %s: probing IR %s on %s (i2c-%d) failed with %d\n,
+   pr_err(%s: probing IR %s on %s (i2c-%d) failed with %d\n,
__func__, tx_probe ? Tx : Rx, adap-name, adap-nr,
   ret);
mutex_unlock(ir_devices_lock);
-- 
1.9.3

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


[PATCH] staging: media: lirc: replace dev_err by pr_err

2014-11-03 Thread Aya Mahfouz
This patch replaces dev_err by pr_err since the value
of ir is NULL when the message is displayed.

Signed-off-by: Aya Mahfouz mahfouz.saif.elya...@gmail.com
---
 drivers/staging/media/lirc/lirc_zilog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/lirc/lirc_zilog.c 
b/drivers/staging/media/lirc/lirc_zilog.c
index 11a7cb1..ecdd71e 100644
--- a/drivers/staging/media/lirc/lirc_zilog.c
+++ b/drivers/staging/media/lirc/lirc_zilog.c
@@ -1633,7 +1633,7 @@ out_put_xx:
 out_put_ir:
put_ir_device(ir, true);
 out_no_ir:
-   dev_err(ir-l.dev, %s: probing IR %s on %s (i2c-%d) failed with %d\n,
+   pr_err(%s: probing IR %s on %s (i2c-%d) failed with %d\n,
__func__, tx_probe ? Tx : Rx, adap-name, adap-nr,
   ret);
mutex_unlock(ir_devices_lock);
-- 
1.9.3

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


Re: [PATCH 01/10] added media agnostic (MA) USB HCD driver

2014-11-03 Thread Greg KH
On Mon, Nov 03, 2014 at 04:04:42PM -0800, steph wrote:
 On Mon, Nov 03, 2014 at 01:21:39PM -0800, Greg KH wrote:
  On Mon, Nov 03, 2014 at 12:42:48PM -0800, Stephanie Wallick wrote:
   +EXPORT_SYMBOL(mausb_register_ms_driver);
  
  EXPORT_SYMBOL_GPL()?  I have to ask...
 
 The source is dual-licenced under BSD and GPL. It was our understanding
 that dual-licensed should use EXPORT_SYMBOL() instead. Is that wrong?

Talk to your company lawyers please to get confirmation of what you want
to do here, I can't answer this question, I just have to ask...

   +static int mausb_hcd_init(void)
   +{
   + int ret;
   +
   + /* register HCD driver */
   + ret = platform_driver_register(mausb_driver);
  
  Why is this a platform driver?  How does this relate to platform
  hardware?
  
 The driver doesn't require platform resources. It looks like a host
 controller driver but communicates over the network instead of to
 a physical host controller. There is no MA USB-specific hardware.
 
 Should we use a struct device instead of a struct platform_device?

Yes, please make it a virtual device.

thanks,

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


Re: [PATCH] staging: media: lirc: lirc_zilog.c: adjust debug messages

2014-11-03 Thread Aya Mahfouz
On Sun, Nov 02, 2014 at 12:40:13PM +0100, Konrad Zapalowicz wrote:
 On 11/01, Aya Mahfouz wrote:
  This patch removes one debug message and replaces a dev_err
  call by pr_err.
 
 Usually you would like to send this as two separate patches because
 replacing a debug message is way different than removing some code. It
 should look like:
 
   PATCH 0/2 staging: media: adjust debug messages
   PATCH 1/2 staging: media: replace dev_err...
   PATCH 2/2 staging: media: remove debug message..
 
 The lirc_zilog.c is not necessary in the topic line, as this can be seen
 from the diff.
 

Thanks Konrad for your pieces of advice.

Kind Regards,
Aya Saif El-yazal Mahfouz
 
  Signed-off-by: Aya Mahfouz mahfouz.saif.elya...@gmail.com
  ---
   drivers/staging/media/lirc/lirc_zilog.c | 7 +--
   1 file changed, 1 insertion(+), 6 deletions(-)
  
  diff --git a/drivers/staging/media/lirc/lirc_zilog.c 
  b/drivers/staging/media/lirc/lirc_zilog.c
  index 11a7cb1..ba538cd4 100644
  --- a/drivers/staging/media/lirc/lirc_zilog.c
  +++ b/drivers/staging/media/lirc/lirc_zilog.c
  @@ -1336,11 +1336,6 @@ static int close(struct inode *node, struct file 
  *filep)
  /* find our IR struct */
  struct IR *ir = filep-private_data;
   
  -   if (ir == NULL) {
  -   dev_err(ir-l.dev, close: no private_data attached to the 
  file!\n);
  -   return -ENODEV;
  -   }
  -
 
 What is the reason behind this change? What would happen if the
 filep-private_data is NULL? Are the callers of this function aware that
 it will not return ENODEV anymore?
 
 thanks,
 konrad
 
  atomic_dec(ir-open_count);
   
  put_ir_device(ir, false);
  @@ -1633,7 +1628,7 @@ out_put_xx:
   out_put_ir:
  put_ir_device(ir, true);
   out_no_ir:
  -   dev_err(ir-l.dev, %s: probing IR %s on %s (i2c-%d) failed with %d\n,
  +   pr_err(%s: probing IR %s on %s (i2c-%d) failed with %d\n,
  __func__, tx_probe ? Tx : Rx, adap-name, adap-nr,
 ret);
  mutex_unlock(ir_devices_lock);
  -- 
  1.9.3
  
  ___
  devel mailing list
  de...@linuxdriverproject.org
  http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH V3] staging: dgap: re-arrange functions for removing forward declarations

2014-11-03 Thread Greg KH
On Tue, Nov 04, 2014 at 08:07:01AM +0900, DaeSeok Youn wrote:
 Greg,
 
 check this patch, please.
 This patch was rebased on staging-testing tree.
 
 Thanks.
 
 regards,
 Daeseok Youn
 
 
 2014-10-31 10:20 GMT+09:00 Daeseok Youn daeseok.y...@gmail.com:

3 days after sending this?  Please give me a chance, I get hundreds of
patches a week...

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


Re: [PATCH v2] Fix error handling in dgnc_start()

2014-11-03 Thread Greg Kroah-Hartman
On Sun, Oct 19, 2014 at 02:37:28AM +0530, Devendra Naga wrote:
 The error_handling for class_create, device_create are taken care
 by the respective goto statements. The failure code from class_create and
 device_create are assigned to the variable rc to return a proper value.
 
 Also removed the rc initialisation to 0 as it gets changed in the call to
 register_chrdev.
 
 Signed-off-by: Devendra Naga devendrana...@gmail.com
 ---
 
  Changes since v2: (added solutions for Dan's comments)
 
  1. removed error message print
  2. added error handling in device_create
  3. added goto err_device_destroy when dgnc_tty_preinit fails

Doesn't apply to my tree :(
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH V2 0/2] staging: ft1000: generic neatening

2014-11-03 Thread Joe Perches
Joe Perches (2):
  staging: ft1000: Whitespace neatening
  ASoC: staging: ft1000: Logging message neatening

 drivers/staging/ft1000/ft1000-pcmcia/boot.h|   34 +-
 drivers/staging/ft1000/ft1000-pcmcia/ft1000.h  |   30 +-
 drivers/staging/ft1000/ft1000-pcmcia/ft1000_cs.c   |   50 +-
 drivers/staging/ft1000/ft1000-pcmcia/ft1000_dnld.c |  208 ++--
 drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c   |  894 +++
 drivers/staging/ft1000/ft1000-usb/ft1000_debug.c   | 1198 ++--
 .../staging/ft1000/ft1000-usb/ft1000_download.c|  394 +++
 drivers/staging/ft1000/ft1000-usb/ft1000_hw.c  |  436 ---
 drivers/staging/ft1000/ft1000-usb/ft1000_ioctl.h   |   60 +-
 drivers/staging/ft1000/ft1000-usb/ft1000_usb.c |   97 +-
 drivers/staging/ft1000/ft1000-usb/ft1000_usb.h |4 +-
 11 files changed, 1635 insertions(+), 1770 deletions(-)

-- 
2.1.2

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


Re: [PATCH V2 2/2] ASoC: staging: ft1000: Logging message neatening

2014-11-03 Thread Greg Kroah-Hartman
On Mon, Nov 03, 2014 at 04:25:44PM -0800, Joe Perches wrote:
 Use a more common logging style.
 
 o Convert DEBUG macros to pr_debug
 o Add pr_fmt
 o Remove embedded function names from pr_debug
 o Convert printks to pr_level
 o Coalesce formats and align arguments
 o Add missing terminating newlines
 
 Signed-off-by: Joe Perches j...@perches.com

ASoC???

I'll go edit that by hand...

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


Re: [PATCH 01/10] added media agnostic (MA) USB HCD driver

2014-11-03 Thread steph
On Mon, Nov 03, 2014 at 04:13:55PM -0800, Greg KH wrote:
 On Mon, Nov 03, 2014 at 04:04:42PM -0800, steph wrote:
  On Mon, Nov 03, 2014 at 01:21:39PM -0800, Greg KH wrote:
   On Mon, Nov 03, 2014 at 12:42:48PM -0800, Stephanie Wallick wrote:
+EXPORT_SYMBOL(mausb_register_ms_driver);
   
   EXPORT_SYMBOL_GPL()?  I have to ask...
  
  The source is dual-licenced under BSD and GPL. It was our understanding
  that dual-licensed should use EXPORT_SYMBOL() instead. Is that wrong?
 
 Talk to your company lawyers please to get confirmation of what you want
 to do here, I can't answer this question, I just have to ask...

We have permission to go forward with the dual BSD/GPL license. I will leave
as is unless there is a future issue.
 
+static int mausb_hcd_init(void)
+{
+   int ret;
+
+   /* register HCD driver */
+   ret = platform_driver_register(mausb_driver);
   
   Why is this a platform driver?  How does this relate to platform
   hardware?
   
  The driver doesn't require platform resources. It looks like a host
  controller driver but communicates over the network instead of to
  a physical host controller. There is no MA USB-specific hardware.
  
  Should we use a struct device instead of a struct platform_device?
 
 Yes, please make it a virtual device.
 
Will do.

Thanks,
Stephanie

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


[PATCH V2 2/2] ASoC: staging: ft1000: Logging message neatening

2014-11-03 Thread Joe Perches
Use a more common logging style.

o Convert DEBUG macros to pr_debug
o Add pr_fmt
o Remove embedded function names from pr_debug
o Convert printks to pr_level
o Coalesce formats and align arguments
o Add missing terminating newlines

Signed-off-by: Joe Perches j...@perches.com
---
 drivers/staging/ft1000/ft1000-pcmcia/ft1000_dnld.c |   6 +-
 drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c   | 340 -
 drivers/staging/ft1000/ft1000-usb/ft1000_debug.c   | 136 -
 .../staging/ft1000/ft1000-usb/ft1000_download.c| 138 -
 drivers/staging/ft1000/ft1000-usb/ft1000_hw.c  | 194 +---
 drivers/staging/ft1000/ft1000-usb/ft1000_usb.c |  85 +++---
 drivers/staging/ft1000/ft1000-usb/ft1000_usb.h |   2 -
 7 files changed, 383 insertions(+), 518 deletions(-)

diff --git a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_dnld.c 
b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_dnld.c
index deb1256..1150050 100644
--- a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_dnld.c
+++ b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_dnld.c
@@ -20,6 +20,8 @@
 
   ---*/
 
+#define pr_fmt(fmt) KBUILD_MODNAME :  fmt
+
 #define __KERNEL_SYSCALLS__
 
 #include linux/module.h
@@ -316,7 +318,7 @@ int card_download(struct net_device *dev, const u8 
*pFileStart,
 
file_version = *(long *)pFileStart;
if (file_version != 6) {
-   printk(KERN_ERR ft1000: unsupported firmware version %ld\n, 
file_version);
+   pr_err(unsupported firmware version %ld\n, file_version);
Status = FAILURE;
}
 
@@ -688,7 +690,7 @@ int card_download(struct net_device *dev, const u8 
*pFileStart,
uiState = STATE_SECTION_PROV;
} else {
netdev_dbg(dev,
-  FT1000:download:Download error: Bad 
Port IDs in Pseudo Record\n);
+  Download error: Bad Port IDs in 
Pseudo Record\n);
netdev_dbg(dev, \t Port Source = 0x%2.2x\n,
   pHdr-portsrc);
netdev_dbg(dev, \t Port Destination = 
0x%2.2x\n,
diff --git a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c 
b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
index c6bee28..11dbe36 100644
--- a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
+++ b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
@@ -17,6 +17,8 @@
   Suite 330, Boston, MA 02111-1307, USA.
   -*/
 
+#define pr_fmt(fmt) KBUILD_MODNAME :  fmt
+
 #include linux/kernel.h
 #include linux/module.h
 #include linux/sched.h
@@ -44,12 +46,6 @@
 #include pcmcia/cisreg.h
 #include pcmcia/ds.h
 
-#ifdef FT_DEBUG
-#define DEBUG(n, args...) printk(KERN_DEBUG args);
-#else
-#define DEBUG(n, args...)
-#endif
-
 #include linux/delay.h
 #include ft1000.h
 
@@ -282,12 +278,9 @@ static void ft1000_enable_interrupts(struct net_device 
*dev)
 {
u16 tempword;
 
-   DEBUG(1, ft1000_hw:ft1000_enable_interrupts()\n);
ft1000_write_reg(dev, FT1000_REG_SUP_IMASK, ISR_DEFAULT_MASK);
tempword = ft1000_read_reg(dev, FT1000_REG_SUP_IMASK);
-   DEBUG(1,
- ft1000_hw:ft1000_enable_interrupts:current interrupt enable mask 
= 0x%x\n,
- tempword);
+   pr_debug(current interrupt enable mask = 0x%x\n, tempword);
 }
 
 /*---
@@ -304,12 +297,9 @@ static void ft1000_disable_interrupts(struct net_device 
*dev)
 {
u16 tempword;
 
-   DEBUG(1, ft1000_hw: ft1000_disable_interrupts()\n);
ft1000_write_reg(dev, FT1000_REG_SUP_IMASK, ISR_MASK_ALL);
tempword = ft1000_read_reg(dev, FT1000_REG_SUP_IMASK);
-   DEBUG(1,
- ft1000_hw:ft1000_disable_interrupts:current interrupt enable 
mask = 0x%x\n,
- tempword);
+   pr_debug(current interrupt enable mask = 0x%x\n, tempword);
 }
 
 /*---
@@ -329,8 +319,6 @@ static void ft1000_reset_asic(struct net_device *dev)
struct ft1000_pcmcia *pcmcia = info-priv;
u16 tempword;
 
-   DEBUG(1, ft1000_hw:ft1000_reset_asic called\n);
-
(*info-ft1000_reset) (pcmcia-link);
 
/*
@@ -351,10 +339,10 @@ static void ft1000_reset_asic(struct net_device *dev)
}
/* clear interrupts */
tempword = ft1000_read_reg(dev, FT1000_REG_SUP_ISR);
-   DEBUG(1, ft1000_hw: interrupt status register = 0x%x\n, tempword);
+   pr_debug(interrupt status register = 0x%x\n, tempword);
ft1000_write_reg(dev, FT1000_REG_SUP_ISR, tempword);
tempword = ft1000_read_reg(dev, FT1000_REG_SUP_ISR);
-   DEBUG(1, ft1000_hw: interrupt status register = 0x%x\n, tempword);
+   

Re: XVME 6300 with TSI148 bridge on 64 bit Debian (Linux 3.2.57) vme_user issue

2014-11-03 Thread Maurice Moss
Hi Martyn,

Thanks for your help from previous emails.  I managed to talk to my
board using a VME-USB board. Now I am back to working with an SBC, and
I have a different setup this time around, let me describe it:

1. SBC in slot 0 of a VME64 chassis (with 2 slots), and the bottom one
being a slot for an SBC.  The SBC is has a Universe-II and when I load
the kernel module manually, everything seems fine, and I see this in
dmesg:
[   76.192738] vme_ca91cx42 :02:04.0: enabling device (0140 - 0143)
[   76.192893] vme_ca91cx42 :02:04.0: Board is the VME system controller
[   76.192902] vme_ca91cx42 :02:04.0: Slot ID is 0
[   76.192907] vme_ca91cx42 :02:04.0: CR/CSR Offset: 0
[   76.192911] vme_ca91cx42 :02:04.0: Slot number is unset, not
configuring CR/CSR space
[   76.195956] vme_ca91cx42 :02:04.0: CR/CSR configuration failed.

I don't intend to use CR/CSR feature.  The linux kernel I am running
is 3.13, the board is essentially this:
http://www.onestopsystems.com/documents/OSS-PCIe-KIT-6400.pdf

2. Now I would like to talk to a passive Slave board in slot 1 (I am
not sure about this numbering, basically the board in the other slot).
This slave board essentially talks only A24 and D16 in
user/super/data.  It's address space internally begins at 0x114000. In
my test code, I essentially have the following:

master.enable = 1;
//master.vme_addr = 0x114000;
master.vme_addr = 0x114000;
master.size = 0x1;
master.aspace = 0x2; // VME_A24
master.cycle = 0x2000 | 0x8000;// user/data access
master.dwidth = 0x2; // 16 bit word access
retval = ioctl(fd, VME_SET_MASTER, master);

The call doesn't fail, and when I make a pread, all I get are 0xff s
on every byte.
I feel like I just can't seem to get the vme_addr to point in the
right direction. I know it's not the slave board, as I have verified
that it works with the VME-to-USB.

In my mind, I have to set the SBC as a VME master and make a read at
A24 address.  However, in vme_user.c I notice that the master resource
is allocated as A32.  Which is why I just can't seem to get the whole
addressing schema right!

Here is my lspci -v

02:04.0 Bridge: Tundra Semiconductor Corp. CA91C042 [Universe] (rev 02)
Flags: medium devsel, IRQ 16
Memory at f7d0 (32-bit, non-prefetchable) [size=4K]
I/O ports at e000 [size=4K]
Kernel driver in use: vme_ca91cx42
08:00.0 PCI bridge: Tundra Semiconductor Corp. Device 8113 (rev 01)
(prog-if 01 [Subtractive decode])
Flags: bus master, fast devsel, latency 0
Bus: primary=08, secondary=09, subordinate=09, sec-latency=64
Memory behind bridge: f700-f78f
Prefetchable memory behind bridge: f600-f6ff
Capabilities: access denied

Any help is as usual thoroughly appreciated. And in addition thanks
for all your help already!

Cheers,
Maurice





On Thu, Jul 24, 2014 at 1:45 AM, Martyn Welch martyn.we...@ge.com wrote:
 On 23/07/14 03:09, Maurice Moss wrote:

 Hi Martyn,

 Thanks for your patience with me.  I have a couple of questions for you:

 0. I put the SBC with the right settings for Geographical addressing.
 I did 2 tests by setting the board in each of the 2 slots available on
 my rack and the geo address was detected as 0 in both the cases.  This
 means my backplane isn't working or that my SBC isn't talking to the
 backplane.


 What settings did you apply to set geographical addressing? Is this the
 drivers or something board specific?

 1. Is there a way I can test whether the PCI bridge is working?


 I assume you mean whether the PCI bridges are passing the PCI address ranges
 used by the VME windows through to the device?

 It think lspci -v will show you what ranges the bridges have, you will
 probably need to stick some debug into vme_tsi148.c to get the pci_base
 address as allocated in tsi148_master_set().

 This can be very board dependant, so I'm afraid I can't help much here.

 2. I don't understand what should be the exact vme base address of my
 slave board.  I am now using VDIS8004 set in slot 2,
 (http://www.ifh.de/~wischnew/amanda/daq/ces_8004_v10_.pdf) set to VME
 short A16 (The static rotatory switches set to 2 and 2).  Based on
 this my address would be 0x2200?  Any clarification or pointing me in
 the right direction would be sincerely appreciated :-/


 There are limitations to the granularity of windows bases and lengths. This
 is especially acute when using the A16 address space.

 To debug this, try mapping the entirety of the A16 address space using
 master_set. Then when calling read, read from offset 0x2200.

 3. When I do reads with what I believe is the correct address, I get
 back '0xff' characters all the time, and if I do it frequently enough
 I manage to crash the computer (with no logs on the dmesg, and reboot
 needed with a forced fsck).  I am now trying to probe the kernel
 module adding print 

RE: [PATCH v3 RESEND] Tools: hv: vssdaemon: ignore the EBUSY on multiple freezing the same partition

2014-11-03 Thread Dexuan Cui
 -Original Message-
 From: devel [mailto:driverdev-devel-boun...@linuxdriverproject.org] On
 Behalf Of Dexuan Cui
 Sent: Tuesday, October 21, 2014 17:56 PM
 To: gre...@linuxfoundation.org; linux-ker...@vger.kernel.org; driverdev-
 de...@linuxdriverproject.org; o...@aepfle.de; a...@canonical.com;
 jasow...@redhat.com
 Cc: Haiyang Zhang
 Subject: [PATCH v3 RESEND] Tools: hv: vssdaemon: ignore the EBUSY on
 multiple freezing the same partition
 
 If a partition appears mounted more than once in /proc/mounts,
 vss_do_freeze()
 succeeds only for the first time and gets EBUSY (on freeze) or EINVAL (on
 thaw) for the second time. The patch ignores these to make the backup
 feature
 work.
 
 Also improved the error handling in case a freeze operation fails.
 
 Signed-off-by: Dexuan Cui de...@microsoft.com
 Reviewed-by: K. Y. Srinivasan k...@microsoft.com
 ---
 
 v2: Add errno = 0; before the ioctl()
 (Unnecessary and removed now since we remove syslog() in vss_do_freeze()
 in v3)
 
 v3: Remove the unsafe syslog() in vss_do_freeze(): that could write the disk.
 Thaw the filesystems in case the freezing operation fails.
 In main(), add syslog() when we check the return value of vss_operate().
 
 [Oct 21, 2014] This is just a RESEND since the previous one I sent about a
 month
 ago seems neglected. :-(
 
  tools/hv/hv_vss_daemon.c | 48
 
  1 file changed, 40 insertions(+), 8 deletions(-)
 
 diff --git a/tools/hv/hv_vss_daemon.c b/tools/hv/hv_vss_daemon.c
 index 6a213b8..1db9430 100644
 --- a/tools/hv/hv_vss_daemon.c
 +++ b/tools/hv/hv_vss_daemon.c
 @@ -44,21 +44,39 @@ static struct sockaddr_nl addr;
  #endif
 
 
 -static int vss_do_freeze(char *dir, unsigned int cmd, char *fs_op)
 +/* Don't use syslog() in the function since that can cause write to disk */
 +static int vss_do_freeze(char *dir, unsigned int cmd)
  {
   int ret, fd = open(dir, O_RDONLY);
 
   if (fd  0)
   return 1;
 +
   ret = ioctl(fd, cmd, 0);
 - syslog(LOG_INFO, VSS: %s of %s: %s\n, fs_op, dir, strerror(errno));
 +
 + /*
 +  * If a partition is mounted more than once, only the first
 +  * FREEZE/THAW can succeed and the later ones will get
 +  * EBUSY/EINVAL respectively: there could be 2 cases:
 +  * 1) a user may mount the same partition to differnt directories
 +  *  by mistake or on purpose;
 +  * 2) The subvolume of btrfs appears to have the same partition
 +  * mounted more than once.
 +  */
 + if (ret) {
 + if ((cmd == FIFREEZE  errno == EBUSY) ||
 + (cmd == FITHAW  errno == EINVAL)) {
 + close(fd);
 + return 0;
 + }
 + }
 +
   close(fd);
   return !!ret;
  }
 
  static int vss_operate(int operation)
  {
 - char *fs_op;
   char match[] = /dev/;
   FILE *mounts;
   struct mntent *ent;
 @@ -68,11 +86,9 @@ static int vss_operate(int operation)
   switch (operation) {
   case VSS_OP_FREEZE:
   cmd = FIFREEZE;
 - fs_op = freeze;
   break;
   case VSS_OP_THAW:
   cmd = FITHAW;
 - fs_op = thaw;
   break;
   default:
   return -1;
 @@ -93,15 +109,23 @@ static int vss_operate(int operation)
   root_seen = 1;
   continue;
   }
 - error |= vss_do_freeze(ent-mnt_dir, cmd, fs_op);
 + error |= vss_do_freeze(ent-mnt_dir, cmd);
 + if (error  operation == VSS_OP_FREEZE)
 + goto err;
   }
   endmntent(mounts);
 
   if (root_seen) {
 - error |= vss_do_freeze(/, cmd, fs_op);
 + error |= vss_do_freeze(/, cmd);
 + if (error  operation == VSS_OP_FREEZE)
 + goto err;
   }
 
   return error;
 +err:
 + endmntent(mounts);
 + vss_operate(VSS_OP_THAW);
 + return error;
  }
 
  static int netlink_send(int fd, struct cn_msg *msg)
 @@ -249,8 +273,16 @@ int main(void)
   case VSS_OP_FREEZE:
   case VSS_OP_THAW:
   error = vss_operate(op);
 - if (error)
 + syslog(LOG_INFO, VSS: op=%s: %s\n,
 + op == VSS_OP_FREEZE ? FREEZE : THAW,
 + error ? failed : succeeded);
 +
 + if (error) {
   error = HV_E_FAIL;
 + syslog(LOG_ERR, op=%d failed!, op);
 + syslog(LOG_ERR, report it with these files:);
 + syslog(LOG_ERR, /etc/fstab and
 /proc/mounts);
 + }
   break;
   default:
   syslog(LOG_ERR, Illegal op:%d\n, op);
 --
 1.9.1

Hi Greg,
ping. 
(I saw you replying in the lists 3 minutes ago. :-)

Thanks,
-- Dexuan

Re: [PATCH V2 2/2] ASoC: staging: ft1000: Logging message neatening

2014-11-03 Thread Joe Perches
On Mon, 2014-11-03 at 16:36 -0800, Greg Kroah-Hartman wrote:
 On Mon, Nov 03, 2014 at 04:25:44PM -0800, Joe Perches wrote:
  Use a more common logging style.
  
  o Convert DEBUG macros to pr_debug
  o Add pr_fmt
  o Remove embedded function names from pr_debug
  o Convert printks to pr_level
  o Coalesce formats and align arguments
  o Add missing terminating newlines
  
  Signed-off-by: Joe Perches j...@perches.com
 
 ASoC???
 
 I'll go edit that by hand...

How odd.  It must be some git weirdness I don't understand.

That's just from doing: (after a git pull of your staging-next tree)

$ patch -p1  
../next/patches/ft1000/0001-staging-ft1000-Whitespace-neatening.patch
$ emacs drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c.rej 
$ git commit -s drivers/staging/ft1000
$ git am 
../next/patches/ft1000/0002-staging-ft1000-Logging-message-neatening.patch
$ git format-patch -2 --subject-prefix=PATCH V2 -o patches/ft1000 
--cover-letter

I didn't touch either output patch but did edit the cover letter.

and ../next/patches/ft1000/0002-etc... doesn't have ASoC in it.

$ grep -i asoc 
../next/patches/ft1000/0002-staging-ft1000-Logging-message-neatening.patch 
$ 

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