RE: [PATCH v5 1/6] staging: fsl-dpaa2/ethsw: Add APIs for DPSW object

2018-03-14 Thread Razvan Stefanescu
> 
> Can you resend this series and just use the correct SPDX identifiers for
> all of the new files, instead of all of this horrid boiler-plate code?
> 
> That will save me time when I have to go delete all of this in the near
> future :)
> 
> Also, why dual license it?  Are you _SURE_ you want to do that, and are
> totally aware of all of the crazy issues surrounding it?  Hint, it
> almost never means what you might think it does, and I have yet to know
> of anyone doing anything "real" with any dual-licensed Linux kernel
> code.
> 
> Remember, BSD is not the license you want/need for GPL header files that
> are exposed to userspace...
> 
> 
> thanks,
> 
> greg k-h

Thank you for your observation. I will update the patches with the SPDX 
identifiers.

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


Re: [PATCH v5 1/6] staging: fsl-dpaa2/ethsw: Add APIs for DPSW object

2018-03-14 Thread Greg KH
On Tue, Mar 13, 2018 at 08:51:51AM -0500, Razvan Stefanescu wrote:
> Add the command build/parse APIs for operating on DPSW objects through
> the DPAA2 Management Complex.
> 
> Signed-off-by: Razvan Stefanescu 
> ---
> Changelog:
>  v2:
> - use u8 for en parameter of dpsw_if_set_flooding/broadcast()
>  v3:
> - no changes
>  v4:
> - adjust to moving MC-bus out of staging
> - fix sparse warnings
>  v5:
>- no changes
> 
>  drivers/staging/fsl-dpaa2/Kconfig  |8 +
>  drivers/staging/fsl-dpaa2/Makefile |1 +
>  drivers/staging/fsl-dpaa2/ethsw/Makefile   |7 +
>  drivers/staging/fsl-dpaa2/ethsw/dpsw-cmd.h |  358 +
>  drivers/staging/fsl-dpaa2/ethsw/dpsw.c | 1116 
> 
>  drivers/staging/fsl-dpaa2/ethsw/dpsw.h |  579 +++
>  6 files changed, 2069 insertions(+)
>  create mode 100644 drivers/staging/fsl-dpaa2/ethsw/Makefile
>  create mode 100644 drivers/staging/fsl-dpaa2/ethsw/dpsw-cmd.h
>  create mode 100644 drivers/staging/fsl-dpaa2/ethsw/dpsw.c
>  create mode 100644 drivers/staging/fsl-dpaa2/ethsw/dpsw.h
> 
> diff --git a/drivers/staging/fsl-dpaa2/Kconfig 
> b/drivers/staging/fsl-dpaa2/Kconfig
> index dfff675..8a508ef 100644
> --- a/drivers/staging/fsl-dpaa2/Kconfig
> +++ b/drivers/staging/fsl-dpaa2/Kconfig
> @@ -16,3 +16,11 @@ config FSL_DPAA2_ETH
>   ---help---
> Ethernet driver for Freescale DPAA2 SoCs, using the
> Freescale MC bus driver
> +
> +config FSL_DPAA2_ETHSW
> + tristate "Freescale DPAA2 Ethernet Switch"
> + depends on FSL_DPAA2
> + depends on NET_SWITCHDEV
> + ---help---
> + Driver for Freescale DPAA2 Ethernet Switch. Select
> + BRIDGE to have support for bridge tools.
> diff --git a/drivers/staging/fsl-dpaa2/Makefile 
> b/drivers/staging/fsl-dpaa2/Makefile
> index 0836ba8..6cfd76b 100644
> --- a/drivers/staging/fsl-dpaa2/Makefile
> +++ b/drivers/staging/fsl-dpaa2/Makefile
> @@ -3,3 +3,4 @@
>  #
>  
>  obj-$(CONFIG_FSL_DPAA2_ETH)  += ethernet/
> +obj-$(CONFIG_FSL_DPAA2_ETHSW)+= ethsw/
> diff --git a/drivers/staging/fsl-dpaa2/ethsw/Makefile 
> b/drivers/staging/fsl-dpaa2/ethsw/Makefile
> new file mode 100644
> index 000..db137f7
> --- /dev/null
> +++ b/drivers/staging/fsl-dpaa2/ethsw/Makefile
> @@ -0,0 +1,7 @@
> +#
> +# Makefile for the Freescale DPAA2 Ethernet Switch
> +#
> +
> +obj-$(CONFIG_FSL_DPAA2_ETHSW) += dpaa2-ethsw.o
> +
> +dpaa2-ethsw-objs := dpsw.o
> diff --git a/drivers/staging/fsl-dpaa2/ethsw/dpsw-cmd.h 
> b/drivers/staging/fsl-dpaa2/ethsw/dpsw-cmd.h
> new file mode 100644
> index 000..36edef6
> --- /dev/null
> +++ b/drivers/staging/fsl-dpaa2/ethsw/dpsw-cmd.h
> @@ -0,0 +1,358 @@
> +/* Copyright 2013-2016 Freescale Semiconductor Inc.
> + * Copyright 2017-2018 NXP
> + *
> + * 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 the above-listed copyright holders nor the
> + *names of any contributors may be used to endorse or promote products
> + *derived from this software without specific prior written permission.
> + *
> + *
> + * ALTERNATIVELY, this software may be distributed under the terms of the
> + * GNU General Public License ("GPL") as published by the Free Software
> + * Foundation, either version 2 of that License or (at your option) any
> + * later version.
> + *
> + * 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 HOLDERS 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.
> + */

Can you resend this series and just use the correct SPDX identifiers for
all of the new files, instead of all of this horrid boiler-plate code?

That will save me time when I have to go delete all of this in the near
future :)

Also, why dual license it?  Are you _SURE_ you want to do that, and are
totally 

[PATCH v5 1/6] staging: fsl-dpaa2/ethsw: Add APIs for DPSW object

2018-03-13 Thread Razvan Stefanescu
Add the command build/parse APIs for operating on DPSW objects through
the DPAA2 Management Complex.

Signed-off-by: Razvan Stefanescu 
---
Changelog:
 v2:
- use u8 for en parameter of dpsw_if_set_flooding/broadcast()
 v3:
- no changes
 v4:
- adjust to moving MC-bus out of staging
- fix sparse warnings
 v5:
   - no changes

 drivers/staging/fsl-dpaa2/Kconfig  |8 +
 drivers/staging/fsl-dpaa2/Makefile |1 +
 drivers/staging/fsl-dpaa2/ethsw/Makefile   |7 +
 drivers/staging/fsl-dpaa2/ethsw/dpsw-cmd.h |  358 +
 drivers/staging/fsl-dpaa2/ethsw/dpsw.c | 1116 
 drivers/staging/fsl-dpaa2/ethsw/dpsw.h |  579 +++
 6 files changed, 2069 insertions(+)
 create mode 100644 drivers/staging/fsl-dpaa2/ethsw/Makefile
 create mode 100644 drivers/staging/fsl-dpaa2/ethsw/dpsw-cmd.h
 create mode 100644 drivers/staging/fsl-dpaa2/ethsw/dpsw.c
 create mode 100644 drivers/staging/fsl-dpaa2/ethsw/dpsw.h

diff --git a/drivers/staging/fsl-dpaa2/Kconfig 
b/drivers/staging/fsl-dpaa2/Kconfig
index dfff675..8a508ef 100644
--- a/drivers/staging/fsl-dpaa2/Kconfig
+++ b/drivers/staging/fsl-dpaa2/Kconfig
@@ -16,3 +16,11 @@ config FSL_DPAA2_ETH
---help---
  Ethernet driver for Freescale DPAA2 SoCs, using the
  Freescale MC bus driver
+
+config FSL_DPAA2_ETHSW
+   tristate "Freescale DPAA2 Ethernet Switch"
+   depends on FSL_DPAA2
+   depends on NET_SWITCHDEV
+   ---help---
+   Driver for Freescale DPAA2 Ethernet Switch. Select
+   BRIDGE to have support for bridge tools.
diff --git a/drivers/staging/fsl-dpaa2/Makefile 
b/drivers/staging/fsl-dpaa2/Makefile
index 0836ba8..6cfd76b 100644
--- a/drivers/staging/fsl-dpaa2/Makefile
+++ b/drivers/staging/fsl-dpaa2/Makefile
@@ -3,3 +3,4 @@
 #
 
 obj-$(CONFIG_FSL_DPAA2_ETH)+= ethernet/
+obj-$(CONFIG_FSL_DPAA2_ETHSW)  += ethsw/
diff --git a/drivers/staging/fsl-dpaa2/ethsw/Makefile 
b/drivers/staging/fsl-dpaa2/ethsw/Makefile
new file mode 100644
index 000..db137f7
--- /dev/null
+++ b/drivers/staging/fsl-dpaa2/ethsw/Makefile
@@ -0,0 +1,7 @@
+#
+# Makefile for the Freescale DPAA2 Ethernet Switch
+#
+
+obj-$(CONFIG_FSL_DPAA2_ETHSW) += dpaa2-ethsw.o
+
+dpaa2-ethsw-objs := dpsw.o
diff --git a/drivers/staging/fsl-dpaa2/ethsw/dpsw-cmd.h 
b/drivers/staging/fsl-dpaa2/ethsw/dpsw-cmd.h
new file mode 100644
index 000..36edef6
--- /dev/null
+++ b/drivers/staging/fsl-dpaa2/ethsw/dpsw-cmd.h
@@ -0,0 +1,358 @@
+/* Copyright 2013-2016 Freescale Semiconductor Inc.
+ * Copyright 2017-2018 NXP
+ *
+ * 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 the above-listed copyright holders nor the
+ *  names of any contributors may be used to endorse or promote products
+ *  derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * 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 HOLDERS 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 __FSL_DPSW_CMD_H
+#define __FSL_DPSW_CMD_H
+
+/* DPSW Version */
+#define DPSW_VER_MAJOR 8
+#define DPSW_VER_MINOR 0
+
+#define DPSW_CMD_BASE_VERSION  1
+#define DPSW_CMD_ID_OFFSET 4
+
+#define DPSW_CMD_ID(id)(((id) << DPSW_CMD_ID_OFFSET) | 
DPSW_CMD_BASE_VERSION)
+
+/* Command IDs */
+#define DPSW_CMDID_CLOSEDPSW_CMD_ID(0x800)
+#define DPSW_CMDID_OPEN DPSW_CMD_ID(0x802)
+
+#define DPSW_CMDID_GET_API_VERSION  DPSW_CMD_ID(0xa02)
+
+#define DPSW_CMDID_ENABLE