Lines Matching +full:0 +full:x01 +full:- +full:negative
2 * Copyright (c) 2016-2019 Intel Corporation
5 * SPDX-License-Identifier: Apache-2.0
28 /* random GUID {FA611CC3-7057-42EE-9D82-4919639562B3} */
30 '{', 0x00, 'F', 0x00, 'A', 0x00, '6', 0x00, '1', 0x00, '1', 0x00, \
31 'C', 0x00, 'C', 0x00, '3', 0x00, '-', 0x00, '7', 0x00, '0', 0x00, \
32 '5', 0x00, '7', 0x00, '-', 0x00, '4', 0x00, '2', 0x00, 'E', 0x00, \
33 'E', 0x00, '-', 0x00, '9', 0x00, 'D', 0x00, '8', 0x00, '2', 0x00, \
34 '-', 0x00, '4', 0x00, '9', 0x00, '1', 0x00, '9', 0x00, '6', 0x00, \
35 '3', 0x00, '9', 0x00, '5', 0x00, '6', 0x00, '2', 0x00, 'B', 0x00, \
36 '3', 0x00, '}', 0x00, 0x00, 0x00, 0x00, 0x00
39 'W', 'I', 'N', 'U', 'S', 'B', 0x00, 0x00
55 .dwWindowsVersion = 0x06030000,
71 .bFirstInterface = 0,
96 * https://wicg.github.io/webusb/#webusb-platform-capability-descriptor
103 .bReserved = 0,
105 * 3408b638-09a9-47a0-8bfd-a0768815b665
108 0x38, 0xB6, 0x08, 0x34,
109 0xA9, 0x09,
110 0xA0, 0x47,
111 0x8B, 0xFD,
112 0xA0, 0x76, 0x88, 0x15, 0xB6, 0x65,
116 .bcdVersion = sys_cpu_to_le16(0x0100),
117 .bVendorCode = 0x01,
118 .iLandingPage = 0x01
127 * See https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/
128 * microsoft-defined-usb-descriptors
131 * (BSD-2) Thanks http://janaxelson.com/files/ms_os_20_descriptors.c
138 .bReserved = 0,
142 * D8DD60DF-4589-4CC7-9CD2-659D9E648A9F
144 0xDF, 0x60, 0xDD, 0xD8,
145 0x89, 0x45,
146 0xC7, 0x4C,
147 0x9C, 0xD2,
148 0x65, 0x9D, 0x9E, 0x64, 0x8A, 0x9F,
152 /* Windows version (8.1) (0x06030000) */
153 .dwWindowsVersion = sys_cpu_to_le32(0x06030000),
157 .bMS_VendorCode = 0x02,
158 .bAltEnumCode = 0x00
170 * BIT(1) - LPM support
171 * BIT(2) - BESL support
173 .bmAttributes = 0,
179 * https://wicg.github.io/webusb/#get-allowed-origins
181 0x05, 0x00, 0x0D, 0x00, 0x01,
184 * https://wicg.github.io/webusb/#configuration-subset-header
186 0x04, 0x01, 0x01, 0x01,
189 * https://wicg.github.io/webusb/#function-subset-header
191 0x04, 0x02, 0x02, 0x01
197 /* URL Descriptor: https://wicg.github.io/webusb/#url-descriptor */
200 0x11, 0x03, 0x00,
201 'l', 'o', 'c', 'a', 'l', 'h', 'o', 's', 't', ':', '8', '0', '0', '0'
219 'M', 0x00, 'S', 0x00, 'F', 0x00, 'T', 0x00,
220 '1', 0x00, '0', 0x00, '0', 0x00,
221 0x03, /* Vendor Code, used for a control request */
222 0x00, /* Padding byte for VendorCode looks like UTF16 */
227 /* See https://github.com/pbatard/libwdi/wiki/WCID-Devices */
229 0x28, 0x00, 0x00, 0x00, /* Descriptor size (40 bytes) */
230 0x00, 0x01, /* Version 1.00 */
231 0x04, 0x00, /* Type: Extended compat ID descriptor */
232 0x01, /* Number of function sections */
233 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* reserved */
236 0x02, /* Index of interface this section applies to. */
237 0x01, /* reserved */
238 /* 8-byte compatible ID string, then 8-byte sub-compatible ID string */
239 'W', 'I', 'N', 'U', 'S', 'B', 0x00, 0x00,
240 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
241 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* reserved */
253 * @return 0 on success, negative errno code on fail
259 return -ENOTSUP; in custom_handle_req()
262 if (USB_GET_DESCRIPTOR_TYPE(pSetup->wValue) == USB_DESC_STRING && in custom_handle_req()
263 USB_GET_DESCRIPTOR_INDEX(pSetup->wValue) == 0xEE) { in custom_handle_req()
269 return 0; in custom_handle_req()
272 return -EINVAL; in custom_handle_req()
283 * @return 0 on success, negative errno code on fail.
289 return -ENOTSUP; in vendor_handle_req()
293 if (pSetup->bRequest == 0x01 && pSetup->wIndex == 0x01) { in vendor_handle_req()
299 return 0; in vendor_handle_req()
300 } else if (pSetup->bRequest == 0x01 && pSetup->wIndex == 0x02) { in vendor_handle_req()
302 uint8_t index = USB_GET_DESCRIPTOR_INDEX(pSetup->wValue); in vendor_handle_req()
304 if (index == 0U || index > NUMBER_OF_ALLOWED_ORIGINS) { in vendor_handle_req()
305 return -ENOTSUP; in vendor_handle_req()
313 return 0; in vendor_handle_req()
314 } else if (pSetup->bRequest == bos_cap_msosv2.cap.bMS_VendorCode && in vendor_handle_req()
315 pSetup->wIndex == MS_OS_20_DESCRIPTOR_INDEX) { in vendor_handle_req()
322 return 0; in vendor_handle_req()
323 } else if (pSetup->bRequest == 0x03 && pSetup->wIndex == 0x04) { in vendor_handle_req()
325 /* 0x04 means "Extended compat ID". in vendor_handle_req()
326 * Use 0x05 instead for "Extended properties". in vendor_handle_req()
333 return 0; in vendor_handle_req()
336 return -ENOTSUP; in vendor_handle_req()
359 if (ret != 0) { in main()
361 return 0; in main()
363 return 0; in main()