Re: [PATCH 6/8] usb: gadget: f_acm: add an ioctl to get the current line coding

From: Tal Shorer
Date: Mon Jun 12 2017 - 14:15:44 EST




On Mon, Jun 12, 2017 at 9:02 PM, Tal Shorer <tal.shorer@xxxxxxxxx> wrote:
> On Mon, Jun 12, 2017 at 8:26 PM, Tal Shorer <tal.shorer@xxxxxxxxx> wrote:
>> The user can issue USB_F_GET_LINE_CODING to get the current line coding
>> as set by the host (or the default if unset yet).
>>
>> Signed-off-by: Tal Shorer <tal.shorer@xxxxxxxxx>
>> ---
>
>> @@ -764,10 +783,10 @@ static struct usb_function *acm_alloc_func(struct usb_function_instance *fi)
>> acm->port.func.free_func = acm_free_func;
>>
>> /* initialize port_line_coding with something that makes sense */
>> - coding.dwDTERate = cpu_to_le32(9600);
>> - coding.bCharFormat = USB_CDC_1_STOP_BITS;
>> - coding.bParityType = USB_CDC_NO_PARITY;
>> - coding.bDataBits = 8;
>> + acm->port_line_coding.dwDTERate = cpu_to_le32(9600);
>> + acm->port_line_coding.bCharFormat = USB_CDC_1_STOP_BITS;
>> + acm->port_line_coding.bParityType = USB_CDC_NO_PARITY;
>> + acm->port_line_coding.bDataBits = 8;
>>
>> return &acm->port.func;
>> }
> This hunk was messed up somehow and will not apply. I can resend a v2 if necessary, but the correct patch is as follows:
Actually, it shouldn't even be in this patch. I somehow meshed 5 and 6 together.
The correct PATCH 6/8 is as follows: