mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/3] staging/usbip: add new uapi header usbip.h
@ 2014-03-03 23:38 Shuah Khan
  2014-03-03 23:38 ` [PATCH v2 1/3] staging/usbip: add uapi header to export usbip kernel interfaces Shuah Khan
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Shuah Khan @ 2014-03-03 23:38 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. This
new uapi file is added under usbip/uapi to keep the staging tree code
self-contained. When usbip moves to mainline drivers, this file should
be moved under uapi/linux

usbip kernel and userspace are changed to use this new header file.

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/uapi/usbip.h                 |   26 ++++++++++++++++++++
 drivers/staging/usbip/usbip_common.h               |   19 ++------------
 .../staging/usbip/userspace/libsrc/usbip_common.h  |   18 +-------------
 3 files changed, 29 insertions(+), 34 deletions(-)
 create mode 100644 drivers/staging/usbip/uapi/usbip.h

-- 
1.7.10.4


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

* [PATCH v2 1/3] staging/usbip: add uapi header to export usbip kernel interfaces
  2014-03-03 23:38 [PATCH v2 0/3] staging/usbip: add new uapi header usbip.h Shuah Khan
@ 2014-03-03 23:38 ` Shuah Khan
  2014-03-03 23:38 ` [PATCH v2 2/3] staging/usbip: change usbip to include new uapi usbip.h Shuah Khan
  2014-03-03 23:38 ` [PATCH v2 3/3] staging/usbip: change usbip userspace " Shuah Khan
  2 siblings, 0 replies; 4+ messages in thread
From: Shuah Khan @ 2014-03-03 23:38 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. This
new uapi file is added under usbip/uapi to keep the staging tree code
self-contained. When usbip moves to mainline drivers, this file should
be moved under uapi/linux

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
---
 drivers/staging/usbip/uapi/usbip.h |   26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 drivers/staging/usbip/uapi/usbip.h

diff --git a/drivers/staging/usbip/uapi/usbip.h b/drivers/staging/usbip/uapi/usbip.h
new file mode 100644
index 0000000..fa5db30
--- /dev/null
+++ b/drivers/staging/usbip/uapi/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	[flat|nested] 4+ messages in thread

* [PATCH v2 2/3] staging/usbip: change usbip to include new uapi usbip.h
  2014-03-03 23:38 [PATCH v2 0/3] staging/usbip: add new uapi header usbip.h Shuah Khan
  2014-03-03 23:38 ` [PATCH v2 1/3] staging/usbip: add uapi header to export usbip kernel interfaces Shuah Khan
@ 2014-03-03 23:38 ` Shuah Khan
  2014-03-03 23:38 ` [PATCH v2 3/3] staging/usbip: change usbip userspace " Shuah Khan
  2 siblings, 0 replies; 4+ messages in thread
From: Shuah Khan @ 2014-03-03 23:38 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..732fb63 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/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	[flat|nested] 4+ messages in thread

* [PATCH v2 3/3] staging/usbip: change usbip userspace to include new uapi usbip.h
  2014-03-03 23:38 [PATCH v2 0/3] staging/usbip: add new uapi header usbip.h Shuah Khan
  2014-03-03 23:38 ` [PATCH v2 1/3] staging/usbip: add uapi header to export usbip kernel interfaces Shuah Khan
  2014-03-03 23:38 ` [PATCH v2 2/3] staging/usbip: change usbip to include new uapi usbip.h Shuah Khan
@ 2014-03-03 23:38 ` Shuah Khan
  2 siblings, 0 replies; 4+ messages in thread
From: Shuah Khan @ 2014-03-03 23:38 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    |   18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/drivers/staging/usbip/userspace/libsrc/usbip_common.h b/drivers/staging/usbip/userspace/libsrc/usbip_common.h
index 2cb81b3..5af59d4 100644
--- a/drivers/staging/usbip/userspace/libsrc/usbip_common.h
+++ b/drivers/staging/usbip/userspace/libsrc/usbip_common.h
@@ -15,6 +15,7 @@
 #include <syslog.h>
 #include <unistd.h>
 #include <linux/usb/ch9.h>
+#include "../../uapi/usbip.h"
 
 #ifndef USBIDS_FILE
 #define USBIDS_FILE "/usr/share/hwdata/usb.ids"
@@ -77,23 +78,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	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-03-03 23:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-03 23:38 [PATCH v2 0/3] staging/usbip: add new uapi header usbip.h Shuah Khan
2014-03-03 23:38 ` [PATCH v2 1/3] staging/usbip: add uapi header to export usbip kernel interfaces Shuah Khan
2014-03-03 23:38 ` [PATCH v2 2/3] staging/usbip: change usbip to include new uapi usbip.h Shuah Khan
2014-03-03 23:38 ` [PATCH v2 3/3] staging/usbip: change usbip userspace " Shuah Khan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome