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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1673992507-7823-2-git-send-email-quic_eserrao@quicinc.com>
Date:   Tue, 17 Jan 2023 13:55:03 -0800
From:   Elson Roy Serrao <quic_eserrao@...cinc.com>
To:     gregkh@...uxfoundation.org, Thinh.Nguyen@...opsys.com,
        balbi@...nel.org
Cc:     linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org,
        quic_wcheng@...cinc.com, quic_jackp@...cinc.com,
        Elson Roy Serrao <quic_eserrao@...cinc.com>
Subject: [PATCH v2 1/5] usb: gadget: Add remote wakeup capable flag

Add a flag to indicate whether the gadget is capable
of sending remote wakeup to the host.

Signed-off-by: Elson Roy Serrao <quic_eserrao@...cinc.com>
---
 drivers/usb/gadget/composite.c | 3 +++
 include/linux/usb/gadget.h     | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index 403563c..b83963a 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -965,6 +965,9 @@ static int set_config(struct usb_composite_dev *cdev,
 	else
 		usb_gadget_clear_selfpowered(gadget);
 
+	if (USB_CONFIG_ATT_WAKEUP & c->bmAttributes)
+		gadget->rw_capable = 1;
+
 	usb_gadget_vbus_draw(gadget, power);
 	if (result >= 0 && cdev->delayed_status)
 		result = USB_GADGET_DELAYED_STATUS;
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index dc3092c..15785f8 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -385,6 +385,7 @@ struct usb_gadget_ops {
  *	indicates that it supports LPM as per the LPM ECN & errata.
  * @irq: the interrupt number for device controller.
  * @id_number: a unique ID number for ensuring that gadget names are distinct
+ * @rw_capable: True if the gadget is capable of sending remote wakeup.
  *
  * Gadgets have a mostly-portable "gadget driver" implementing device
  * functions, handling all usb configurations and interfaces.  Gadget
@@ -446,6 +447,7 @@ struct usb_gadget {
 	unsigned			lpm_capable:1;
 	int				irq;
 	int				id_number;
+	unsigned			rw_capable:1;
 };
 #define work_to_gadget(w)	(container_of((w), struct usb_gadget, work))
 
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ