
Hi Andy,
The new mdio command doesn't have all of the features of the mii command, but it provides the necessary read/write primitives, and allows users to interact with 10G PHYs, and other PHYs which use Clause 45 of 802.3. This means that the mdio command requires a "Device Address" argument, though for clause 22 PHYs, the argument can be "-".
Signed-off-by: Andy Fleming afleming@freescale.com
common/Makefile | 3 + common/cmd_mdio.c | 293 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 296 insertions(+), 0 deletions(-) create mode 100644 common/cmd_mdio.c
[...]
+static int extract_range(char *input, int *plo, int *phi) +{
- char * end;
- *plo = simple_strtol(input, &end, 0);
- if (end == input)
return -1;
- if (*end == '-') {
What about the case of input="12-"? Shouldn't there be an "&& *(end+1)"?
end++;
*phi = simple_strtol(end, NULL, 0);
- } else if (*end == '\0') {
*phi = *plo;
- } else
return -1;
- return 0;
+}
Other than that, looks good, so once my above concern is addressed
Acked-by: Detlev Zundel dzu@denx.de
Thanks! Detlev