Lines Matching full:sh
28 static void print_dev_desc(const struct shell *sh, in print_dev_desc() argument
31 shell_print(sh, "bLength\t\t\t%u", desc->bLength); in print_dev_desc()
32 shell_print(sh, "bDescriptorType\t\t%u", desc->bDescriptorType); in print_dev_desc()
33 shell_print(sh, "bcdUSB\t\t\t%x", desc->bcdUSB); in print_dev_desc()
34 shell_print(sh, "bDeviceClass\t\t%u", desc->bDeviceClass); in print_dev_desc()
35 shell_print(sh, "bDeviceSubClass\t\t%u", desc->bDeviceSubClass); in print_dev_desc()
36 shell_print(sh, "bDeviceProtocol\t\t%u", desc->bDeviceProtocol); in print_dev_desc()
37 shell_print(sh, "bMaxPacketSize0\t\t%u", desc->bMaxPacketSize0); in print_dev_desc()
38 shell_print(sh, "idVendor\t\t%x", desc->idVendor); in print_dev_desc()
39 shell_print(sh, "idProduct\t\t%x", desc->idProduct); in print_dev_desc()
40 shell_print(sh, "bcdDevice\t\t%x", desc->bcdDevice); in print_dev_desc()
41 shell_print(sh, "iManufacturer\t\t%u", desc->iManufacturer); in print_dev_desc()
42 shell_print(sh, "iProduct\t\t%u", desc->iProduct); in print_dev_desc()
43 shell_print(sh, "iSerial\t\t\t%u", desc->iSerialNumber); in print_dev_desc()
44 shell_print(sh, "bNumConfigurations\t%u", desc->bNumConfigurations); in print_dev_desc()
47 static void print_cfg_desc(const struct shell *sh, in print_cfg_desc() argument
50 shell_print(sh, "bLength\t\t\t%u", desc->bLength); in print_cfg_desc()
51 shell_print(sh, "bDescriptorType\t\t%u", desc->bDescriptorType); in print_cfg_desc()
52 shell_print(sh, "wTotalLength\t\t%x", desc->wTotalLength); in print_cfg_desc()
53 shell_print(sh, "bNumInterfaces\t\t%u", desc->bNumInterfaces); in print_cfg_desc()
54 shell_print(sh, "bConfigurationValue\t%u", desc->bConfigurationValue); in print_cfg_desc()
55 shell_print(sh, "iConfiguration\t\t%u", desc->iConfiguration); in print_cfg_desc()
56 shell_print(sh, "bmAttributes\t\t%02x", desc->bmAttributes); in print_cfg_desc()
57 shell_print(sh, "bMaxPower\t\t%u mA", desc->bMaxPower * 2); in print_cfg_desc()
60 static int cmd_bulk(const struct shell *sh, size_t argc, char **argv) in cmd_bulk() argument
88 static int cmd_vendor_in(const struct shell *sh, in cmd_vendor_in() argument
102 shell_print(sh, "host: Failed to allocate buffer"); in cmd_vendor_in()
116 static int cmd_vendor_out(const struct shell *sh, in cmd_vendor_out() argument
130 shell_print(sh, "host: Failed to allocate buffer"); in cmd_vendor_out()
141 static int cmd_desc_device(const struct shell *sh, in cmd_desc_device() argument
149 shell_print(sh, "host: Failed to request device descriptor"); in cmd_desc_device()
151 print_dev_desc(sh, &desc); in cmd_desc_device()
157 static int cmd_desc_config(const struct shell *sh, in cmd_desc_config() argument
168 shell_print(sh, "host: Failed to request configuration descriptor"); in cmd_desc_config()
170 print_cfg_desc(sh, &desc); in cmd_desc_config()
176 static int cmd_desc_string(const struct shell *sh, in cmd_desc_string() argument
195 shell_print(sh, "host: Failed to request configuration descriptor"); in cmd_desc_string()
197 shell_hexdump(sh, buf->data, buf->len); in cmd_desc_string()
205 static int cmd_feature_set_halt(const struct shell *sh, in cmd_feature_set_halt() argument
216 shell_error(sh, "host: Failed to set halt feature"); in cmd_feature_set_halt()
218 shell_print(sh, "host: Device 0x%02x, ep 0x%02x halt feature set", in cmd_feature_set_halt()
225 static int cmd_feature_clear_rwup(const struct shell *sh, in cmd_feature_clear_rwup() argument
232 shell_error(sh, "host: Failed to clear rwup feature"); in cmd_feature_clear_rwup()
234 shell_print(sh, "host: Device 0x%02x, rwup feature cleared", udev->addr); in cmd_feature_clear_rwup()
240 static int cmd_feature_set_rwup(const struct shell *sh, in cmd_feature_set_rwup() argument
247 shell_error(sh, "host: Failed to set rwup feature"); in cmd_feature_set_rwup()
249 shell_print(sh, "host: Device 0x%02x, rwup feature set", udev->addr); in cmd_feature_set_rwup()
255 static int cmd_feature_set_ppwr(const struct shell *sh, in cmd_feature_set_ppwr() argument
265 shell_error(sh, "host: Failed to set ppwr feature"); in cmd_feature_set_ppwr()
267 shell_print(sh, "host: Device 0x%02x, port %d, ppwr feature set", in cmd_feature_set_ppwr()
274 static int cmd_feature_set_prst(const struct shell *sh, in cmd_feature_set_prst() argument
284 shell_error(sh, "host: Failed to set prst feature"); in cmd_feature_set_prst()
286 shell_print(sh, "host: Device 0x%02x, port %d, prst feature set", in cmd_feature_set_prst()
293 static int cmd_config_set(const struct shell *sh, in cmd_config_set() argument
303 shell_error(sh, "host: Failed to set configuration"); in cmd_config_set()
305 shell_print(sh, "host: Device 0x%02x, new configuration %u", in cmd_config_set()
312 static int cmd_config_get(const struct shell *sh, in cmd_config_get() argument
320 shell_error(sh, "host: Failed to set configuration"); in cmd_config_get()
322 shell_print(sh, "host: Device 0x%02x, current configuration %u", in cmd_config_get()
329 static int cmd_device_interface(const struct shell *sh, in cmd_device_interface() argument
341 shell_error(sh, "host: Failed to set interface alternate"); in cmd_device_interface()
343 shell_print(sh, "host: Device 0x%02x, new %u alternate %u", in cmd_device_interface()
350 static int cmd_device_address(const struct shell *sh, in cmd_device_address() argument
360 shell_error(sh, "host: Failed to set address"); in cmd_device_address()
362 shell_print(sh, "host: New device address is 0x%02x", addr); in cmd_device_address()
368 static int cmd_bus_suspend(const struct shell *sh, in cmd_bus_suspend() argument
375 shell_error(sh, "host: Failed to perform bus suspend %d", err); in cmd_bus_suspend()
377 shell_print(sh, "host: USB bus suspended"); in cmd_bus_suspend()
383 static int cmd_bus_resume(const struct shell *sh, in cmd_bus_resume() argument
390 shell_error(sh, "host: Failed to perform bus resume %d", err); in cmd_bus_resume()
392 shell_print(sh, "host: USB bus resumed"); in cmd_bus_resume()
397 shell_error(sh, "host: Failed to start SoF generator %d", err); in cmd_bus_resume()
403 static int cmd_bus_reset(const struct shell *sh, in cmd_bus_reset() argument
410 shell_error(sh, "host: Failed to perform bus reset %d", err); in cmd_bus_reset()
412 shell_print(sh, "host: USB bus reset"); in cmd_bus_reset()
417 shell_error(sh, "host: Failed to start SoF generator %d", err); in cmd_bus_reset()
423 static int cmd_usbh_init(const struct shell *sh, in cmd_usbh_init() argument
432 shell_error(sh, "host: USB host already initialized"); in cmd_usbh_init()
434 shell_error(sh, "host: Failed to initialize %d", err); in cmd_usbh_init()
436 shell_print(sh, "host: USB host initialized"); in cmd_usbh_init()
442 static int cmd_usbh_enable(const struct shell *sh, in cmd_usbh_enable() argument
449 shell_error(sh, "host: Failed to enable USB host support"); in cmd_usbh_enable()
451 shell_print(sh, "host: USB host enabled"); in cmd_usbh_enable()
457 static int cmd_usbh_disable(const struct shell *sh, in cmd_usbh_disable() argument
464 shell_error(sh, "host: Failed to disable USB host support"); in cmd_usbh_disable()
466 shell_print(sh, "host: USB host disabled"); in cmd_usbh_disable()