usb: port usb_serial control requests handling to new API
Change-Id: I1405c9279e0e8e490e2bb2d03ff192b36db2634b
This commit is contained in:
parent
77731c3579
commit
3318ba4795
1 changed files with 6 additions and 5 deletions
|
@ -296,8 +296,10 @@ bool usb_serial_control_request(struct usb_ctrlrequest* req, void* reqdata, unsi
|
||||||
if (req->wLength == sizeof(line_coding))
|
if (req->wLength == sizeof(line_coding))
|
||||||
{
|
{
|
||||||
/* Receive line coding into local copy */
|
/* Receive line coding into local copy */
|
||||||
usb_drv_recv_nonblocking(EP_CONTROL, &line_coding, sizeof(line_coding));
|
if(!reqdata)
|
||||||
usb_drv_send(EP_CONTROL, NULL, 0); /* ack */
|
usb_drv_control_response(USB_CONTROL_RECEIVE, &line_coding, sizeof(line_coding));
|
||||||
|
else
|
||||||
|
usb_drv_control_response(USB_CONTROL_ACK, NULL, 0);
|
||||||
handled = true;
|
handled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -306,7 +308,7 @@ bool usb_serial_control_request(struct usb_ctrlrequest* req, void* reqdata, unsi
|
||||||
if (req->wLength == 0)
|
if (req->wLength == 0)
|
||||||
{
|
{
|
||||||
/* wValue holds Control Signal Bitmap that is simply ignored here */
|
/* wValue holds Control Signal Bitmap that is simply ignored here */
|
||||||
usb_drv_send(EP_CONTROL, NULL, 0); /* ack */
|
usb_drv_control_response(USB_CONTROL_ACK, NULL, 0);
|
||||||
handled = true;
|
handled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -318,8 +320,7 @@ bool usb_serial_control_request(struct usb_ctrlrequest* req, void* reqdata, unsi
|
||||||
if (req->wLength == sizeof(line_coding))
|
if (req->wLength == sizeof(line_coding))
|
||||||
{
|
{
|
||||||
/* Send back line coding so host is happy */
|
/* Send back line coding so host is happy */
|
||||||
usb_drv_recv_nonblocking(EP_CONTROL, NULL, 0); /* ack */
|
usb_drv_control_response(USB_CONTROL_ACK, &line_coding, sizeof(line_coding));
|
||||||
usb_drv_send(EP_CONTROL, &line_coding, sizeof(line_coding));
|
|
||||||
handled = true;
|
handled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue