linux-stable/include/linux/usb
Jó Ágila Bitsch 93c473948c usb: gadget: add WebUSB landing page support
There is a custom (non-USB IF) extension to the USB standard:

https://wicg.github.io/webusb/

This specification is published under the W3C Community Contributor
Agreement, which in particular allows to implement the specification
without any royalties.

The specification allows USB gadgets to announce an URL to landing
page and describes a Javascript interface for websites to interact
with the USB gadget, if the user allows it. It is currently
supported by Chromium-based browsers, such as Chrome, Edge and
Opera on all major operating systems including Linux.

This patch adds optional support for Linux-based USB gadgets
wishing to expose such a landing page.

During device enumeration, a host recognizes that the announced
USB version is at least 2.01, which means, that there are BOS
descriptors available. The device than announces WebUSB support
using a platform device capability. This includes a vendor code
under which the landing page URL can be retrieved using a
vendor-specific request.

Previously, the BOS descriptors would unconditionally include an
LPM related descriptor, as BOS descriptors were only ever sent
when the device was LPM capable. As this is no longer the case,
this patch puts this descriptor behind a lpm_capable condition.

Usage is modeled after os_desc descriptors:
echo 1 > webusb/use
echo "https://www.kernel.org" > webusb/landingPage

lsusb will report the device with the following lines:
  Platform Device Capability:
    bLength                24
    bDescriptorType        16
    bDevCapabilityType      5
    bReserved               0
    PlatformCapabilityUUID    {3408b638-09a9-47a0-8bfd-a0768815b665}
      WebUSB:
        bcdVersion    1.00
        bVendorCode      0
        iLandingPage     1 https://www.kernel.org

Signed-off-by: Jó Ágila Bitsch <jgilab@gmail.com>
Link: https://lore.kernel.org/r/Y8Crf8P2qAWuuk/F@jo-einhundert
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-19 14:14:44 +01:00
..
audio-v2.h
audio-v3.h
audio.h
c67x00.h
ccid.h
cdc-wdm.h
cdc.h
cdc_ncm.h
ch9.h
chipidea.h usb: chipidea: Add support for VBUS control with PHY 2022-08-31 09:07:52 +02:00
composite.h usb: gadget: add WebUSB landing page support 2023-01-19 14:14:44 +01:00
ehci-dbgp.h
ehci_def.h
ehci_pdriver.h
ezusb.h
functionfs.h
g_hid.h
gadget.h
gadget_configfs.h
hcd.h xhci: disable U3 suspended ports in S4 hibernate poweroff_late stage 2022-11-30 12:10:48 +01:00
input.h
iowarrior.h
irda.h
isp116x.h
isp1301.h
isp1362.h
m66592.h
musb-ux500.h
musb.h
net2280.h
of.h
ohci_pdriver.h
onboard_hub.h
otg-fsm.h
otg.h
pd.h
pd_ado.h
pd_bdo.h
pd_ext_sdb.h
pd_vdo.h
phy.h
phy_companion.h
quirks.h
r8a66597.h
r8152.h
renesas_usbhs.h
rndis_host.h
role.h
serial.h usb: serial: Make ->set_termios() old ktermios const 2022-08-30 14:22:35 +02:00
sl811.h
storage.h
tcpci.h usb: typec: tcpci: Add callback for evaluating contaminant presence 2023-01-17 17:29:23 +01:00
tcpm.h usb: typec: tcpm: Add callbacks to mitigate wakeups due to contaminant 2023-01-17 17:29:23 +01:00
tegra_usb_phy.h
typec.h usb: typec: Add partner PD object wrapper 2022-11-29 08:56:09 +01:00
typec_altmode.h
typec_dp.h usb: typec: altmodes/displayport: correct pin assignment for UFP receptacles 2022-08-18 21:20:07 +02:00
typec_mux.h
typec_retimer.h
typec_tbt.h
uas.h
ulpi.h
usb338x.h
usb_phy_generic.h
usbnet.h
webusb.h usb: gadget: add WebUSB landing page support 2023-01-19 14:14:44 +01:00
xhci-dbgp.h