lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y+Fft/vGfHxGrvC0@rowland.harvard.edu>
Date:   Mon, 6 Feb 2023 15:14:47 -0500
From:   Alan Stern <stern@...land.harvard.edu>
To:     Elson Roy Serrao <quic_eserrao@...cinc.com>
Cc:     gregkh@...uxfoundation.org, Thinh.Nguyen@...opsys.com,
        balbi@...nel.org, linux-kernel@...r.kernel.org,
        linux-usb@...r.kernel.org, quic_wcheng@...cinc.com,
        quic_jackp@...cinc.com
Subject: Re: [PATCH v3 1/5] usb: gadget: Properly configure the device for
 remote wakeup

On Mon, Feb 06, 2023 at 11:13:22AM -0800, Elson Roy Serrao wrote:
> The wakeup bit in the bmAttributes field indicates whether the device
> is configured for remote wakeup. But this field should be allowed to
> set only if the UDC supports such wakeup mechanism. So configure this
> field based on UDC capability. Also inform the UDC whether the device
> is configured for remote wakeup by implementing a gadget op.
> 
> Signed-off-by: Elson Roy Serrao <quic_eserrao@...cinc.com>
> ---
>  drivers/usb/gadget/composite.c | 24 +++++++++++++++++++++++-
>  drivers/usb/gadget/udc/core.c  | 27 +++++++++++++++++++++++++++
>  drivers/usb/gadget/udc/trace.h |  5 +++++
>  include/linux/usb/gadget.h     |  8 ++++++++
>  4 files changed, 63 insertions(+), 1 deletion(-)

> diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
> index dc3092c..05d1449 100644
> --- a/include/linux/usb/gadget.h
> +++ b/include/linux/usb/gadget.h
> @@ -309,6 +309,7 @@ struct usb_udc;
>  struct usb_gadget_ops {
>  	int	(*get_frame)(struct usb_gadget *);
>  	int	(*wakeup)(struct usb_gadget *);
> +	int	(*set_remotewakeup)(struct usb_gadget *, int set);
>  	int	(*set_selfpowered) (struct usb_gadget *, int is_selfpowered);
>  	int	(*vbus_session) (struct usb_gadget *, int is_active);
>  	int	(*vbus_draw) (struct usb_gadget *, unsigned mA);
> @@ -383,6 +384,8 @@ struct usb_gadget_ops {
>   * @connected: True if gadget is connected.
>   * @lpm_capable: If the gadget max_speed is FULL or HIGH, this flag
>   *	indicates that it supports LPM as per the LPM ECN & errata.
> + * @rw_capable: True if gadget is capable of sending remote wakeup.
> + * @rw_armed: True if gadget is armed by the host for remote wakeup.

Minor stylistic request: Could you choose something other than "rw" to 
start these field names?  For too many people, that abbreviation is 
firmly associated with "read/write".  Maybe just "wakeup"?

Alan Stern

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ