
On Tue, Nov 10, 2015 at 01:13:29PM +0100, jacquiot.aurelien@gmail.com wrote:
From: Aurelien Jacquiot a-jacquiot@ti.com
RapidIO is a high-performance packet-switched interconnect technology (www.rapidio.org) that can be used for messaging or memory transfers like Ethernet or PCIe.
[snip]
+config CMD_RIO
bool "rapidio"
help
RapidIO support.
Please expand this to include what is and is not supported in RapidIO right now with your patches.
[snip]
- /* hostid */
- if (argc >= 2) {
riohdid = simple_strtol(argv[2], NULL, 10);
- } else {
s = getenv("riohdid");
if (s != NULL)
riohdid = simple_strtol(s, NULL, 10);
goto call_init;
- }
Here and elsewhere, command inputs are in hex not decimal. 'sleep' is the one and only exception (and causes headaches) to this rule.
- /* dev-id size */
- if (argc >= 3) {
riosize = simple_strtol(argv[3], NULL, 10);
- } else {
s = getenv("riosize");
if (s != NULL)
riosize = simple_strtol(s, NULL, 10);
goto call_init;
- }
- /* port bitmask */
- if (argc >= 4) {
rioports = simple_strtoul(argv[4], NULL, 16);
- } else {
s = getenv("rioports");
if (s != NULL)
rioports = simple_strtoul(s, NULL, 16);
goto call_init;
- }
- /* port path mode */
- if (argc >= 5) {
riopmode = simple_strtol(argv[5], NULL, 10);
- } else {
s = getenv("riopathmode");
if (s != NULL)
riopmode = simple_strtol(s, NULL, 10);
goto call_init;
- }
- /* baudrate */
- if (argc >= 6) {
riobaudrate = simple_strtol(argv[6], NULL, 10);
- } else {
s = getenv("riobaudrate");
if (s != NULL)
riobaudrate = simple_strtol(s, NULL, 10);
- }
At first glance this seems broken for the case where one of riopathmode/riobaudrate/etc are neither passed nor in the environment. Or will rio_init handle this case correctly and pass back failure? Also, is there a usecase for having these be set in the environment rather than passed?