Commit f470ead8 authored by Fabien Parent's avatar Fabien Parent Committed by Johan Hovold

greybus: es{1,2}: remove control endpoint field

There is no need to store the endpoint number of the control requests since
the default control endpoint is used and the USB standard defines for it a fixed
endpoint number of 0.

Remove every instance of the field control_endpoint and replace it with a
hardcoded 0 value.
Signed-off-by: default avatarFabien Parent <fparent@baylibre.com>
Reviewed-by: default avatarJohan Hovold <johan@hovoldconsulting.com>
Signed-off-by: default avatarJohan Hovold <johan@hovoldconsulting.com>
parent 24a6112f
...@@ -59,7 +59,6 @@ static DEFINE_KFIFO(apb1_log_fifo, char, APB1_LOG_SIZE); ...@@ -59,7 +59,6 @@ static DEFINE_KFIFO(apb1_log_fifo, char, APB1_LOG_SIZE);
* @usb_dev: pointer to the USB device we are. * @usb_dev: pointer to the USB device we are.
* @usb_intf: pointer to the USB interface we are bound to. * @usb_intf: pointer to the USB interface we are bound to.
* @hd: pointer to our greybus_host_device structure * @hd: pointer to our greybus_host_device structure
* @control_endpoint: endpoint to send data to SVC
* @cport_in_endpoint: bulk in endpoint for CPort data * @cport_in_endpoint: bulk in endpoint for CPort data
* @cport-out_endpoint: bulk out endpoint for CPort data * @cport-out_endpoint: bulk out endpoint for CPort data
* @cport_in_urb: array of urbs for the CPort in messages * @cport_in_urb: array of urbs for the CPort in messages
...@@ -76,7 +75,6 @@ struct es1_ap_dev { ...@@ -76,7 +75,6 @@ struct es1_ap_dev {
struct usb_interface *usb_intf; struct usb_interface *usb_intf;
struct greybus_host_device *hd; struct greybus_host_device *hd;
__u8 control_endpoint;
__u8 cport_in_endpoint; __u8 cport_in_endpoint;
__u8 cport_out_endpoint; __u8 cport_out_endpoint;
...@@ -420,8 +418,7 @@ static void apb1_log_get(struct es1_ap_dev *es1, char *buf) ...@@ -420,8 +418,7 @@ static void apb1_log_get(struct es1_ap_dev *es1, char *buf)
/* SVC messages go down our control pipe */ /* SVC messages go down our control pipe */
do { do {
retval = usb_control_msg(es1->usb_dev, retval = usb_control_msg(es1->usb_dev,
usb_rcvctrlpipe(es1->usb_dev, usb_rcvctrlpipe(es1->usb_dev, 0),
es1->control_endpoint),
REQUEST_LOG, REQUEST_LOG,
USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_INTERFACE, USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
0x00, 0x00, 0x00, 0x00,
...@@ -577,10 +574,6 @@ static int ap_probe(struct usb_interface *interface, ...@@ -577,10 +574,6 @@ static int ap_probe(struct usb_interface *interface,
spin_lock_init(&es1->cport_out_urb_lock); spin_lock_init(&es1->cport_out_urb_lock);
usb_set_intfdata(interface, es1); usb_set_intfdata(interface, es1);
/* Control endpoint is the pipe to talk to this AP, so save it off */
endpoint = &udev->ep0.desc;
es1->control_endpoint = endpoint->bEndpointAddress;
/* find all 3 of our endpoints */ /* find all 3 of our endpoints */
iface_desc = interface->cur_altsetting; iface_desc = interface->cur_altsetting;
for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) { for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) {
......
...@@ -83,7 +83,6 @@ struct es1_cport_out { ...@@ -83,7 +83,6 @@ struct es1_cport_out {
* @usb_dev: pointer to the USB device we are. * @usb_dev: pointer to the USB device we are.
* @usb_intf: pointer to the USB interface we are bound to. * @usb_intf: pointer to the USB interface we are bound to.
* @hd: pointer to our greybus_host_device structure * @hd: pointer to our greybus_host_device structure
* @control_endpoint: endpoint to send data to SVC
* @cport_in: endpoint, urbs and buffer for cport in messages * @cport_in: endpoint, urbs and buffer for cport in messages
* @cport_out: endpoint for for cport out messages * @cport_out: endpoint for for cport out messages
...@@ -99,8 +98,6 @@ struct es1_ap_dev { ...@@ -99,8 +98,6 @@ struct es1_ap_dev {
struct usb_interface *usb_intf; struct usb_interface *usb_intf;
struct greybus_host_device *hd; struct greybus_host_device *hd;
__u8 control_endpoint;
struct es1_cport_in cport_in[NUM_BULKS]; struct es1_cport_in cport_in[NUM_BULKS];
struct es1_cport_out cport_out[NUM_BULKS]; struct es1_cport_out cport_out[NUM_BULKS];
struct urb *cport_out_urb[NUM_CPORT_OUT_URB]; struct urb *cport_out_urb[NUM_CPORT_OUT_URB];
...@@ -169,8 +166,7 @@ int map_cport_to_ep(struct es1_ap_dev *es1, ...@@ -169,8 +166,7 @@ int map_cport_to_ep(struct es1_ap_dev *es1,
cport_to_ep->endpoint_out = es1->cport_out[bulk_ep_set].endpoint; cport_to_ep->endpoint_out = es1->cport_out[bulk_ep_set].endpoint;
retval = usb_control_msg(es1->usb_dev, retval = usb_control_msg(es1->usb_dev,
usb_sndctrlpipe(es1->usb_dev, usb_sndctrlpipe(es1->usb_dev, 0),
es1->control_endpoint),
REQUEST_EP_MAPPING, REQUEST_EP_MAPPING,
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
0x00, 0x00, 0x00, 0x00,
...@@ -518,8 +514,7 @@ static void apb1_log_get(struct es1_ap_dev *es1, char *buf) ...@@ -518,8 +514,7 @@ static void apb1_log_get(struct es1_ap_dev *es1, char *buf)
/* SVC messages go down our control pipe */ /* SVC messages go down our control pipe */
do { do {
retval = usb_control_msg(es1->usb_dev, retval = usb_control_msg(es1->usb_dev,
usb_rcvctrlpipe(es1->usb_dev, usb_rcvctrlpipe(es1->usb_dev, 0),
es1->control_endpoint),
REQUEST_LOG, REQUEST_LOG,
USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_INTERFACE, USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
0x00, 0x00, 0x00, 0x00,
...@@ -714,10 +709,6 @@ static int ap_probe(struct usb_interface *interface, ...@@ -714,10 +709,6 @@ static int ap_probe(struct usb_interface *interface,
spin_lock_init(&es1->cport_out_urb_lock); spin_lock_init(&es1->cport_out_urb_lock);
usb_set_intfdata(interface, es1); usb_set_intfdata(interface, es1);
/* Control endpoint is the pipe to talk to this AP, so save it off */
endpoint = &udev->ep0.desc;
es1->control_endpoint = endpoint->bEndpointAddress;
es1->cport_to_ep = kcalloc(hd->num_cports, sizeof(*es1->cport_to_ep), es1->cport_to_ep = kcalloc(hd->num_cports, sizeof(*es1->cport_to_ep),
GFP_KERNEL); GFP_KERNEL);
if (!es1->cport_to_ep) { if (!es1->cport_to_ep) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment