Lines Matching +full:data +full:- +full:ready

2  * Copyright (c) 2021 IP-Logix Inc.
5 * SPDX-License-Identifier: Apache-2.0
53 * Scan the entire 5-bit address space of the MDIO bus
61 uint16_t data; in cmd_mdio_scan() local
66 shell_error(sh, "MDIO: Device driver %s is not ready.", dev->name); in cmd_mdio_scan()
68 return -ENODEV; in cmd_mdio_scan()
85 data = 0; in cmd_mdio_scan()
86 if (mdio_read(dev, i, reg_addr, &data) >= 0 && in cmd_mdio_scan()
87 data != UINT16_MAX) { in cmd_mdio_scan()
95 shell_print(sh, "%u devices found on %s", cnt, dev->name); in cmd_mdio_scan()
100 /* mdio write <port_addr> <reg_addr> <data> */
104 uint16_t data; in cmd_mdio_write() local
110 shell_error(sh, "MDIO: Device driver %s is not ready.", dev->name); in cmd_mdio_write()
112 return -ENODEV; in cmd_mdio_write()
117 data = strtol(argv[3], NULL, 16); in cmd_mdio_write()
121 if (mdio_write(dev, port_addr, reg_addr, data) < 0) { in cmd_mdio_write()
122 shell_error(sh, "Failed to write to device: %s", dev->name); in cmd_mdio_write()
125 return -EIO; in cmd_mdio_write()
137 uint16_t data; in cmd_mdio_read() local
143 shell_error(sh, "MDIO: Device driver %s is not ready.", dev->name); in cmd_mdio_read()
145 return -ENODEV; in cmd_mdio_read()
153 if (mdio_read(dev, port_addr, reg_addr, &data) < 0) { in cmd_mdio_read()
154 shell_error(sh, "Failed to read from device: %s", dev->name); in cmd_mdio_read()
157 return -EIO; in cmd_mdio_read()
162 shell_print(sh, "%x[%x]: 0x%x", port_addr, reg_addr, data); in cmd_mdio_read()
171 uint16_t data; in cmd_mdio_write_45() local
178 shell_error(sh, "MDIO: Device driver %s is not ready.", dev->name); in cmd_mdio_write_45()
180 return -ENODEV; in cmd_mdio_write_45()
186 data = strtol(argv[4], NULL, 16); in cmd_mdio_write_45()
190 if (mdio_write_c45(dev, port_addr, dev_addr, reg_addr, data) < 0) { in cmd_mdio_write_45()
191 shell_error(sh, "Failed to write to device: %s", dev->name); in cmd_mdio_write_45()
194 return -EIO; in cmd_mdio_write_45()
206 uint16_t data; in cmd_mdio_read_c45() local
213 shell_error(sh, "MDIO: Device driver %s is not ready.", dev->name); in cmd_mdio_read_c45()
215 return -ENODEV; in cmd_mdio_read_c45()
224 if (mdio_read_c45(dev, port_addr, dev_addr, reg_addr, &data) < 0) { in cmd_mdio_read_c45()
225 shell_error(sh, "Failed to read from device: %s", dev->name); in cmd_mdio_read_c45()
228 return -EIO; in cmd_mdio_read_c45()
233 shell_print(sh, "%x[%x:%x]: 0x%x", port_addr, dev_addr, reg_addr, data); in cmd_mdio_read_c45()