All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] staging/usbip: add new uapi header usbip.h
@ 2014-02-28  0:27 Shuah Khan
  2014-02-28  0:27 ` [PATCH 1/3] staging/usbip: add uapi header to export usbip kernel interfaces Shuah Khan
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Shuah Khan @ 2014-02-28  0:27 UTC (permalink / raw)
  To: gregkh, ly80toro, andy.grover, valentina.manea.m
  Cc: Shuah Khan, linux-usb, devel, linux-kernel, shuahkhan

usbip userspace has duplicated enum definition to report usbip device
status maintained by the kernel. Adding an usbip uapi header file will
define the kernel - userspace interface for this device status.

Shuah Khan (3):
  staging/usbip: add uapi header to export usbip kernel interfaces
  staging/usbip: change usbip to include new uapi usbip.h
  staging/usbip: change usbip userspace to include new uapi usbip.h

 drivers/staging/usbip/usbip_common.h               |   19 ++------------
 .../staging/usbip/userspace/libsrc/usbip_common.h  |   20 +++------------
 include/uapi/linux/Kbuild                          |    1 +
 include/uapi/linux/usbip.h                         |   26 ++++++++++++++++++++
 4 files changed, 32 insertions(+), 34 deletions(-)
 create mode 100644 include/uapi/linux/usbip.h

-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/3] staging/usbip: add uapi header to export usbip kernel interfaces
  2014-02-28  0:27 [PATCH 0/3] staging/usbip: add new uapi header usbip.h Shuah Khan
@ 2014-02-28  0:27 ` Shuah Khan
  2014-02-28 22:15   ` Greg KH
  2014-02-28  0:27 ` [PATCH 2/3] staging/usbip: change usbip to include new uapi usbip.h Shuah Khan
  2014-02-28  0:27 ` [PATCH 3/3] staging/usbip: change usbip userspace " Shuah Khan
  2 siblings, 1 reply; 6+ messages in thread
From: Shuah Khan @ 2014-02-28  0:27 UTC (permalink / raw)
  To: gregkh, ly80toro, andy.grover, valentina.manea.m
  Cc: Shuah Khan, linux-usb, devel, linux-kernel, shuahkhan

usbip userspace has duplicated enum definition to report usbip device
status maintained by the kernel. Adding an usbip uapi header file will
define the kernel - userspace interface for this device status.

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
---
 include/uapi/linux/Kbuild  |    1 +
 include/uapi/linux/usbip.h |   26 ++++++++++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 include/uapi/linux/usbip.h

diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild
index 3ce25b5..4fb4800 100644
--- a/include/uapi/linux/Kbuild
+++ b/include/uapi/linux/Kbuild
@@ -393,6 +393,7 @@ header-y += un.h
 header-y += unistd.h
 header-y += unix_diag.h
 header-y += usbdevice_fs.h
+header-y += usbip.h
 header-y += utime.h
 header-y += utsname.h
 header-y += uuid.h
diff --git a/include/uapi/linux/usbip.h b/include/uapi/linux/usbip.h
new file mode 100644
index 0000000..fa5db30
--- /dev/null
+++ b/include/uapi/linux/usbip.h
@@ -0,0 +1,26 @@
+/*
+ *	usbip.h
+ *
+ *	USBIP uapi defines and function prototypes etc.
+*/
+
+#ifndef _UAPI_LINUX_USBIP_H
+#define _UAPI_LINUX_USBIP_H
+
+/* usbip device status - exported in usbip device sysfs status */
+enum usbip_device_status {
+	/* sdev is available. */
+	SDEV_ST_AVAILABLE = 0x01,
+	/* sdev is now used. */
+	SDEV_ST_USED,
+	/* sdev is unusable because of a fatal error. */
+	SDEV_ST_ERROR,
+
+	/* vdev does not connect a remote device. */
+	VDEV_ST_NULL,
+	/* vdev is used, but the USB address is not assigned yet */
+	VDEV_ST_NOTASSIGNED,
+	VDEV_ST_USED,
+	VDEV_ST_ERROR
+};
+#endif /* _UAPI_LINUX_USBIP_H */
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/3] staging/usbip: change usbip to include new uapi usbip.h
  2014-02-28  0:27 [PATCH 0/3] staging/usbip: add new uapi header usbip.h Shuah Khan
  2014-02-28  0:27 ` [PATCH 1/3] staging/usbip: add uapi header to export usbip kernel interfaces Shuah Khan
@ 2014-02-28  0:27 ` Shuah Khan
  2014-02-28  0:27 ` [PATCH 3/3] staging/usbip: change usbip userspace " Shuah Khan
  2 siblings, 0 replies; 6+ messages in thread
From: Shuah Khan @ 2014-02-28  0:27 UTC (permalink / raw)
  To: gregkh, ly80toro, andy.grover, valentina.manea.m
  Cc: Shuah Khan, linux-usb, devel, linux-kernel, shuahkhan

usbip userspace has duplicated enum definition to report usbip device
status maintained by the kernel. A new uapi usbip.h now defines the
usbip device status for kernel and userspace to use. Change usbip
kernel space to include uapi usbip.h for usbip device status.

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
---
 drivers/staging/usbip/usbip_common.h |   19 ++-----------------
 1 file changed, 2 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/usbip/usbip_common.h b/drivers/staging/usbip/usbip_common.h
index 7e6c543..846ef5b 100644
--- a/drivers/staging/usbip/usbip_common.h
+++ b/drivers/staging/usbip/usbip_common.h
@@ -29,6 +29,7 @@
 #include <linux/types.h>
 #include <linux/usb.h>
 #include <linux/wait.h>
+#include <uapi/linux/usbip.h>
 
 #define USBIP_VERSION "1.0.0"
 
@@ -235,22 +236,6 @@ enum usbip_side {
 	USBIP_STUB,
 };
 
-enum usbip_status {
-	/* sdev is available. */
-	SDEV_ST_AVAILABLE = 0x01,
-	/* sdev is now used. */
-	SDEV_ST_USED,
-	/* sdev is unusable because of a fatal error. */
-	SDEV_ST_ERROR,
-
-	/* vdev does not connect a remote device. */
-	VDEV_ST_NULL,
-	/* vdev is used, but the USB address is not assigned yet */
-	VDEV_ST_NOTASSIGNED,
-	VDEV_ST_USED,
-	VDEV_ST_ERROR
-};
-
 /* event handler */
 #define USBIP_EH_SHUTDOWN	(1 << 0)
 #define USBIP_EH_BYE		(1 << 1)
@@ -271,7 +256,7 @@ enum usbip_status {
 /* a common structure for stub_device and vhci_device */
 struct usbip_device {
 	enum usbip_side side;
-	enum usbip_status status;
+	enum usbip_device_status status;
 
 	/* lock for status */
 	spinlock_t lock;
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/3] staging/usbip: change usbip userspace to include new uapi usbip.h
  2014-02-28  0:27 [PATCH 0/3] staging/usbip: add new uapi header usbip.h Shuah Khan
  2014-02-28  0:27 ` [PATCH 1/3] staging/usbip: add uapi header to export usbip kernel interfaces Shuah Khan
  2014-02-28  0:27 ` [PATCH 2/3] staging/usbip: change usbip to include new uapi usbip.h Shuah Khan
@ 2014-02-28  0:27 ` Shuah Khan
  2 siblings, 0 replies; 6+ messages in thread
From: Shuah Khan @ 2014-02-28  0:27 UTC (permalink / raw)
  To: gregkh, ly80toro, andy.grover, valentina.manea.m
  Cc: Shuah Khan, linux-usb, devel, linux-kernel, shuahkhan

usbip userspace has duplicated enum definition to report usbip device
status maintained by the kernel. A new uapi usbip.h now defines the
usbip device status for kernel and userspace to use. Change usbip
userspace to include uapi usbip.h for usbip device status.

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
---
 .../staging/usbip/userspace/libsrc/usbip_common.h  |   20 +++-----------------
 1 file changed, 3 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/usbip/userspace/libsrc/usbip_common.h b/drivers/staging/usbip/userspace/libsrc/usbip_common.h
index 2cb81b3..d336f14 100644
--- a/drivers/staging/usbip/userspace/libsrc/usbip_common.h
+++ b/drivers/staging/usbip/userspace/libsrc/usbip_common.h
@@ -15,6 +15,9 @@
 #include <syslog.h>
 #include <unistd.h>
 #include <linux/usb/ch9.h>
+/* this is temporary to build in tree, once usbip.h
+ *  appears under linux headers - change it to <linux/usbip.h> */
+#include <../../../../../include/uapi/linux/usbip.h>
 
 #ifndef USBIDS_FILE
 #define USBIDS_FILE "/usr/share/hwdata/usb.ids"
@@ -77,23 +80,6 @@ extern int usbip_use_debug ;
 		abort();				\
 	} while (0)
 
-/* FIXME: how to sync with drivers/usbip_common.h ? */
-enum usbip_device_status {
-	/* sdev is available. */
-	SDEV_ST_AVAILABLE = 0x01,
-	/* sdev is now used. */
-	SDEV_ST_USED,
-	/* sdev is unusable because of a fatal error. */
-	SDEV_ST_ERROR,
-
-	/* vdev does not connect a remote device. */
-	VDEV_ST_NULL,
-	/* vdev is used, but the USB address is not assigned yet */
-	VDEV_ST_NOTASSIGNED,
-	VDEV_ST_USED,
-	VDEV_ST_ERROR
-};
-
 struct usbip_usb_interface {
 	uint8_t bInterfaceClass;
 	uint8_t bInterfaceSubClass;
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/3] staging/usbip: add uapi header to export usbip kernel interfaces
  2014-02-28  0:27 ` [PATCH 1/3] staging/usbip: add uapi header to export usbip kernel interfaces Shuah Khan
@ 2014-02-28 22:15   ` Greg KH
  2014-02-28 22:45     ` Shuah Khan
  0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2014-02-28 22:15 UTC (permalink / raw)
  To: Shuah Khan
  Cc: ly80toro, andy.grover, valentina.manea.m, linux-usb, devel,
	linux-kernel, shuahkhan

On Thu, Feb 27, 2014 at 05:27:25PM -0700, Shuah Khan wrote:
> usbip userspace has duplicated enum definition to report usbip device
> status maintained by the kernel. Adding an usbip uapi header file will
> define the kernel - userspace interface for this device status.
> 
> Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
> ---
>  include/uapi/linux/Kbuild  |    1 +
>  include/uapi/linux/usbip.h |   26 ++++++++++++++++++++++++++
>  2 files changed, 27 insertions(+)
>  create mode 100644 include/uapi/linux/usbip.h

Staging code should be self-contained within drivers/staging/

Now I know that a bunch of people are now working on this codebase, and
hopefully it will finally get moved out of staging someday soon, but
until then, I can't add this file in this location, sorry.

Look at how the drivers/staging/android code handles the uapi files, you
should try doing that instead.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/3] staging/usbip: add uapi header to export usbip kernel interfaces
  2014-02-28 22:15   ` Greg KH
@ 2014-02-28 22:45     ` Shuah Khan
  0 siblings, 0 replies; 6+ messages in thread
From: Shuah Khan @ 2014-02-28 22:45 UTC (permalink / raw)
  To: Greg KH
  Cc: ly80toro, andy.grover, valentina.manea.m, linux-usb, devel,
	linux-kernel, shuahkhan, Shuah Khan

On 02/28/2014 03:15 PM, Greg KH wrote:
> On Thu, Feb 27, 2014 at 05:27:25PM -0700, Shuah Khan wrote:
>> usbip userspace has duplicated enum definition to report usbip device
>> status maintained by the kernel. Adding an usbip uapi header file will
>> define the kernel - userspace interface for this device status.
>>
>> Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
>> ---
>>   include/uapi/linux/Kbuild  |    1 +
>>   include/uapi/linux/usbip.h |   26 ++++++++++++++++++++++++++
>>   2 files changed, 27 insertions(+)
>>   create mode 100644 include/uapi/linux/usbip.h
>
> Staging code should be self-contained within drivers/staging/
>
> Now I know that a bunch of people are now working on this codebase, and
> hopefully it will finally get moved out of staging someday soon, but
> until then, I can't add this file in this location, sorry.

That makes sense.

>
> Look at how the drivers/staging/android code handles the uapi files, you
> should try doing that instead.
>

I will take a look at how android is handling uapi files and redo this 
patch series and resend it. Hope everybody is ok with the code itself, 
just the location of the uapi file is the issue, if not please let me 
know and give me feedback on the approach.

-- Shuah


-- 
Shuah Khan
Senior Linux Kernel Developer - Open Source Group
Samsung Research America(Silicon Valley)
shuah.kh@samsung.com | (970) 672-0658

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-02-28 22:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-28  0:27 [PATCH 0/3] staging/usbip: add new uapi header usbip.h Shuah Khan
2014-02-28  0:27 ` [PATCH 1/3] staging/usbip: add uapi header to export usbip kernel interfaces Shuah Khan
2014-02-28 22:15   ` Greg KH
2014-02-28 22:45     ` Shuah Khan
2014-02-28  0:27 ` [PATCH 2/3] staging/usbip: change usbip to include new uapi usbip.h Shuah Khan
2014-02-28  0:27 ` [PATCH 3/3] staging/usbip: change usbip userspace " Shuah Khan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.