Jocelyn Dang | 08bb3a9 | 2018-10-17 16:26:50 -0700 | [diff] [blame] | 1 | // Copyright 2018 The Fuchsia Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
Todd Eisenberger | 35f03c80 | 2018-12-27 14:16:00 -0800 | [diff] [blame] | 4 | library fuchsia.hardware.usb.fwloader; |
Jocelyn Dang | 08bb3a9 | 2018-10-17 16:26:50 -0700 | [diff] [blame] | 5 | |
Jocelyn Dang | b3dab2c | 2018-12-05 10:57:24 -0800 | [diff] [blame] | 6 | using fuchsia.mem; |
Jocelyn Dang | 08bb3a9 | 2018-10-17 16:26:50 -0700 | [diff] [blame] | 7 | using zx; |
| 8 | |
Alex Zaslavsky | e3b39f2 | 2021-07-17 18:09:45 +0000 | [diff] [blame] | 9 | type PrebuiltType = strict enum : uint8 { |
Jocelyn Dang | 9eea02b1 | 2018-12-07 10:06:03 -0800 | [diff] [blame] | 10 | /// Test firmware that can be loaded onto the USB test device for running USB tests. |
| 11 | TESTER = 1; |
| 12 | /// Flash programmer used for loading a new bootloader onto the USB test device I2C EEPROM. |
| 13 | FLASH = 2; |
| 14 | /// Bootloader for the USB test device. |
| 15 | BOOT = 3; |
| 16 | }; |
| 17 | |
Alex Zaslavsky | e3b39f2 | 2021-07-17 18:09:45 +0000 | [diff] [blame] | 18 | @for_deprecated_c_bindings |
Pascal Perez | faa49b2 | 2019-02-19 11:01:18 -0500 | [diff] [blame] | 19 | protocol Device { |
Jocelyn Dang | 08bb3a9 | 2018-10-17 16:26:50 -0700 | [diff] [blame] | 20 | /// Loads the prebuilt firmware onto the USB test device, and renumerates as the new device. |
Alex Zaslavsky | e3b39f2 | 2021-07-17 18:09:45 +0000 | [diff] [blame] | 21 | LoadPrebuiltFirmware(struct { |
| 22 | prebuilt_type PrebuiltType; |
| 23 | }) -> (struct { |
| 24 | s zx.status; |
| 25 | }); |
Jocelyn Dang | 08bb3a9 | 2018-10-17 16:26:50 -0700 | [diff] [blame] | 26 | |
| 27 | /// Loads the firmware onto the USB test device, and renumerates as the new device. |
Alex Zaslavsky | e3b39f2 | 2021-07-17 18:09:45 +0000 | [diff] [blame] | 28 | LoadFirmware(resource struct { |
| 29 | firmware fuchsia.mem.Buffer; |
| 30 | }) -> (struct { |
| 31 | s zx.status; |
| 32 | }); |
Jocelyn Dang | 08bb3a9 | 2018-10-17 16:26:50 -0700 | [diff] [blame] | 33 | }; |