staging/usbip: add new uapi header usbip.h
cover staging/usbip: add new uapi header usbip.h
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
Signature · 1 line
1.7.10.4
PATCH 1/3 staging/usbip: add uapi header to export usbip kernel interfaces
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.
--- include/uapi/linux/Kbuild | 1 + include/uapi/linux/usbip.h | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 include/uapi/linux/usbip.h
include/uapi/linux/Kbuild +1 -0
@@ -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
include/uapi/linux/usbip.h new file +26 -0
@@ -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 */
Signature · 1 line
1.7.10.4
Greg KH
maintainerRe: [PATCH 1/3] staging/usbip: add uapi header to export usbip kernel interfaces
Quoted 10 lines · Shuah Khan
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 <[email protected]>--- 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
Re: [PATCH 1/3] staging/usbip: add uapi header to export usbip kernel interfaces
Quoted 12 lines · Greg KH
Quoted 10 lines · Shuah Khan
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 <[email protected]>--- include/uapi/linux/Kbuild | 1 + include/uapi/linux/usbip.h | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+)create mode 100644
include/uapi/linux/usbip.h
Quoted 5 lines
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.
Quoted 4 lines
Look at how the
drivers/staging/androidcode 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
Signature · 4 lines
Shuah Khan Senior Linux Kernel Developer - Open Source Group Samsung Research America(Silicon Valley) [email protected] | (970) 672-0658
PATCH 2/3 staging/usbip: change usbip to include new uapi usbip.h
In reply to Shuah Khanusbip 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.
--- drivers/staging/usbip/usbip_common.h | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-)
drivers/staging/usbip/usbip_common.h +2 -17
@@ -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;
Signature · 1 line
1.7.10.4
PATCH 3/3 staging/usbip: change usbip userspace to include new uapi usbip.h
In reply to Shuah Khanusbip 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.
--- .../staging/usbip/userspace/libsrc/usbip_common.h | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-)
drivers/staging/usbip/userspace/libsrc/usbip_common.h +3 -17
@@ -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;
Signature · 1 line
1.7.10.4