Skip to content

Commit 6f27f4f

Browse files
Felipe Balbigregkh
authored andcommitted
usb: core: add Status Type definitions
USB 3.1 added a PTM_STATUS type. Let's add a define for it and following patches will let usb_get_status() accept the new argument. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent e79bfcb commit 6f27f4f

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎drivers/usb/core/message.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -946,8 +946,8 @@ int usb_get_status(struct usb_device *dev, int type, int target, void *data)
946946
return -ENOMEM;
947947

948948
ret = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
949-
USB_REQ_GET_STATUS, USB_DIR_IN | type, 0, target, status,
950-
sizeof(*status), USB_CTRL_GET_TIMEOUT);
949+
USB_REQ_GET_STATUS, USB_DIR_IN | type, USB_STATUS_TYPE_STANDARD,
950+
target, status, sizeof(*status), USB_CTRL_GET_TIMEOUT);
951951

952952
if (ret == 2) {
953953
*(u16 *) data = le16_to_cpu(*status);

‎include/uapi/linux/usb/ch9.h‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@
143143
#define TEST_PACKET 4
144144
#define TEST_FORCE_EN 5
145145

146+
/* Status Type */
147+
#define USB_STATUS_TYPE_STANDARD 0
148+
#define USB_STATUS_TYPE_PTM 1
149+
146150
/*
147151
* New Feature Selectors as added by USB 3.0
148152
* See USB 3.0 spec Table 9-7

0 commit comments

Comments
 (0)