Merge "usb: gadget: Fix interface descriptor fields for QTI functions"

This commit is contained in:
qctecmdr 2020-07-23 19:13:20 -07:00 • committed by Gerrit - the friendly Code Review server
commit aab3d4b120
5 changed files with 23 additions and 16 deletions

View file

@ -143,6 +143,7 @@ struct f_cdev_opts {
struct f_cdev *port;
char *func_name;
u8 port_num;
u8 proto;
};
static int major, minors;
@ -165,8 +166,8 @@ static struct usb_interface_descriptor cser_interface_desc = {
/* .bInterfaceNumber = DYNAMIC */
.bNumEndpoints = 3,
.bInterfaceClass = USB_CLASS_VENDOR_SPEC,
.bInterfaceSubClass = 0,
.bInterfaceProtocol = 0,
.bInterfaceSubClass = USB_SUBCLASS_VENDOR_SPEC,
/* .bInterfaceProtocol = DYNAMIC */
/* .iInterface = DYNAMIC */
};
@ -762,6 +763,8 @@ static int usb_cser_bind(struct usb_configuration *c, struct usb_function *f)
struct f_cdev *port = func_to_port(f);
int status;
struct usb_ep *ep;
struct f_cdev_opts *opts =
container_of(f->fi, struct f_cdev_opts, func_inst);
if (cser_string_defs[0].id == 0) {
status = usb_string_id(c->cdev);
@ -775,6 +778,7 @@ static int usb_cser_bind(struct usb_configuration *c, struct usb_function *f)
goto fail;
port->port_usb.data_id = status;
cser_interface_desc.bInterfaceNumber = status;
cser_interface_desc.bInterfaceProtocol = opts->proto;
status = -ENODEV;
ep = usb_ep_autoconfig(cdev->gadget, &cser_fs_in_desc);
@ -1949,6 +1953,9 @@ static int cser_set_inst_name(struct usb_function_instance *f, const char *name)
port->port_usb.send_modem_ctrl_bits = dun_cser_send_ctrl_bits;
port->port_usb.disconnect = dun_cser_disconnect;
port->port_usb.send_break = dun_cser_send_break;
opts->proto = 0x40;
} else {
opts->proto = 0x60;
}
return 0;

View file

@ -57,8 +57,8 @@ static struct usb_interface_descriptor intf_desc = {
.bLength = sizeof(intf_desc),
.bDescriptorType = USB_DT_INTERFACE,
.bNumEndpoints = 2,
.bInterfaceClass = 0xFF,
.bInterfaceSubClass = 0xFF,
.bInterfaceClass = USB_CLASS_VENDOR_SPEC,
.bInterfaceSubClass = USB_SUBCLASS_VENDOR_SPEC,
.bInterfaceProtocol = 0x30,
};

View file

@ -349,8 +349,8 @@ static struct usb_interface_descriptor rmnet_gsi_interface_desc = {
.bDescriptorType = USB_DT_INTERFACE,
.bNumEndpoints = 3,
.bInterfaceClass = USB_CLASS_VENDOR_SPEC,
.bInterfaceSubClass = USB_CLASS_VENDOR_SPEC,
.bInterfaceProtocol = USB_CLASS_VENDOR_SPEC,
.bInterfaceSubClass = USB_SUBCLASS_VENDOR_SPEC,
.bInterfaceProtocol = 0x50,
/* .iInterface = DYNAMIC */
};
@ -1360,9 +1360,9 @@ static struct usb_interface_descriptor qdss_gsi_data_intf_desc = {
.bDescriptorType = USB_DT_INTERFACE,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 0xff,
.bInterfaceSubClass = 0xff,
.bInterfaceProtocol = 0xff,
.bInterfaceClass = USB_CLASS_VENDOR_SPEC,
.bInterfaceSubClass = USB_SUBCLASS_VENDOR_SPEC,
.bInterfaceProtocol = 0x80,
};
static struct usb_endpoint_descriptor qdss_gsi_fs_data_desc = {

View file

@ -23,9 +23,9 @@ static struct usb_interface_descriptor qdss_data_intf_desc = {
.bDescriptorType = USB_DT_INTERFACE,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = 0xff,
.bInterfaceSubClass = 0xff,
.bInterfaceProtocol = 0xff,
.bInterfaceClass = USB_CLASS_VENDOR_SPEC,
.bInterfaceSubClass = USB_SUBCLASS_VENDOR_SPEC,
.bInterfaceProtocol = 0x70,
};
static struct usb_endpoint_descriptor qdss_hs_data_desc = {
@ -57,9 +57,9 @@ static struct usb_interface_descriptor qdss_ctrl_intf_desc = {
.bDescriptorType = USB_DT_INTERFACE,
.bAlternateSetting = 0,
.bNumEndpoints = 2,
.bInterfaceClass = 0xff,
.bInterfaceSubClass = 0xff,
.bInterfaceProtocol = 0xff,
.bInterfaceClass = USB_CLASS_VENDOR_SPEC,
.bInterfaceSubClass = USB_SUBCLASS_VENDOR_SPEC,
.bInterfaceProtocol = 0x70,
};
static struct usb_endpoint_descriptor qdss_hs_ctrl_in_desc = {

View file

@ -46,7 +46,7 @@ static struct usb_interface_descriptor gser_interface_desc = {
.bNumEndpoints = 2,
.bInterfaceClass = USB_CLASS_VENDOR_SPEC,
.bInterfaceSubClass = 0,
.bInterfaceProtocol = 0,
.bInterfaceProtocol = 0x40,
/* .iInterface = DYNAMIC */
};