Linux-USB Archive mirror
 help / color / mirror / Atom feed
From: Chris Wulff <Chris.Wulff@biamp.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: Re: [PATCH v2] usb: gadget: f_fs: add capability for dfu run-time descriptor
Date: Wed, 24 Apr 2024 20:39:36 +0000	[thread overview]
Message-ID: <CO1PR17MB54195AFDA60BED290BFE9F46E1102@CO1PR17MB5419.namprd17.prod.outlook.com> (raw)
In-Reply-To: <2024042153-timing-sassy-eab9@gregkh>


From: Greg KH <gregkh@linuxfoundation.org>
>>  drivers/usb/gadget/function/f_fs.c  | 11 +++++++++--
>>  include/uapi/linux/usb/ch9.h        |  4 ++++
>>  include/uapi/linux/usb/functionfs.h | 10 ++++++++++
>>  3 files changed, 23 insertions(+), 2 deletions(-)
>
> Does this require a Documentation/ABI/ update?

I haven't found anything in Documentation that talks about any of these structures or
constants. I will add kerneldoc sytle comments for the fields in the usb_dfu_functional_descriptor
structure though.

>> diff --git a/include/uapi/linux/usb/ch9.h b/include/uapi/linux/usb/ch9.h
>> index 44d73ba8788d..dcd962d1a75a 100644
>> --- a/include/uapi/linux/usb/ch9.h
>> +++ b/include/uapi/linux/usb/ch9.h
>> @@ -263,6 +263,9 @@ struct usb_ctrlrequest {
>>  /* From the USB 3.1 spec */
>>  #define      USB_DT_SSP_ISOC_ENDPOINT_COMP   0x31
>> 
>> +/* From USB Device Firmware Upgrade Specification, Revision 1.1 */
>> +#define USB_DT_DFU_FUNCTIONAL                0x21
>
>Why is this not in sorted order?
>

I will move it up so it is in order.

>And it really conflicts with USB_DT_WIRE_ADAPTER?  That seems odd given
>that DFU came first.  Hm, it is that value, odd.
>
>> +
>>  /* Conventional codes for class-specific descriptors.  The convention is
>>   * defined in the USB "Common Class" Spec (3.11).  Individual class specs
>>   * are authoritative for their usage, not the "common class" writeup.
>> @@ -332,6 +335,7 @@ struct usb_device_descriptor {
>>  #define USB_CLASS_VENDOR_SPEC                0xff
>> 
>>  #define USB_SUBCLASS_VENDOR_SPEC     0xff
>> +#define USB_SUBCLASS_DFU             0x01
>
>This should be up next to the other DFU stuff, right?  WHat about the
>DFU interface type?

I will re-group USB_SUBCLASS_DFU so it is associated with its corresponding
class code (USB_CLASS_APP_SPEC).

The DFU interface descriptor just uses the standard usb_interface_descriptor
structure so nothing new needed for that.

>> 
>>  /*-------------------------------------------------------------------------*/
>> 
>> diff --git a/include/uapi/linux/usb/functionfs.h b/include/uapi/linux/usb/functionfs.h
>> index 9f88de9c3d66..cf3f55234a5e 100644
>> --- a/include/uapi/linux/usb/functionfs.h
>> +++ b/include/uapi/linux/usb/functionfs.h
>> @@ -37,6 +37,16 @@ struct usb_endpoint_descriptor_no_audio {
>>        __u8  bInterval;
>>  } __attribute__((packed));
>> 
>> +/* DFU Functional descriptor */
>> +struct usb_dfu_functional_descriptor {
>> +     __u8  bLength;
>> +     __u8  bDescriptorType;
>> +     __u8  bmAttributes;
>
>Do you need #defines for the different attribute bits that DFU wants
>here?

I have them defined in the associated userspace program, but I will include
them here instead. The kernel doesn't need any of those constants, but I see a few
other structs that have bmAttributes related defines below them.

-- Chris Wulff

      reply	other threads:[~2024-04-24 20:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-18 20:39 [PATCH v2] usb: gadget: f_fs: add capability for dfu run-time descriptor Chris Wulff
2024-04-21 10:26 ` Greg KH
2024-04-24 20:39   ` Chris Wulff [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CO1PR17MB54195AFDA60BED290BFE9F46E1102@CO1PR17MB5419.namprd17.prod.outlook.com \
    --to=chris.wulff@biamp.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).