Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7288fe26 authored by Ajay Agarwal's avatar Ajay Agarwal Committed by Gerrit - the friendly Code Review server
Browse files

usb: gadget: Fix interface descriptor fields for QTI functions



Currently many QTI function drivers are exposing incorrect
interface descriptor fields. Fix the same.

Change-Id: I06bd30c0374d57f7e0fe407e74f89b6e7eaf2db8
Signed-off-by: default avatarAjay Agarwal <ajaya@codeaurora.org>
Signed-off-by: default avatarPratham Pratap <prathampratap@codeaurora.org>
parent 4027c201
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -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;
+2 −2
Original line number Diff line number Diff line
@@ -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,
};

+5 −5
Original line number Diff line number Diff line
@@ -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 = {
+6 −6
Original line number Diff line number Diff line
@@ -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 = {
+1 −1
Original line number Diff line number Diff line
@@ -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 */
};