Skip to content

Commit

Permalink
pcie: shell: add subcommands
Browse files Browse the repository at this point in the history
pcie has an all in one command for listing pci devices. Make it support
additional commands and move lspcie to `pcie ls`.

Signed-off-by: Anas Nashif <[email protected]>
  • Loading branch information
nashif committed Jun 25, 2020
1 parent ee985d8 commit de57d60
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions drivers/pcie/shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ static void show(const struct shell *shell, pcie_bdf_t bdf)
}
}

static int cmd_lspcie(const struct shell *shell, size_t argc, char **argv)
static int cmd_pcie_ls(const struct shell *shell, size_t argc, char **argv)
{
int bus;
int dev;
Expand All @@ -119,5 +119,11 @@ static int cmd_lspcie(const struct shell *shell, size_t argc, char **argv)

return 0;
}
SHELL_STATIC_SUBCMD_SET_CREATE(sub_pcie_cmds,
SHELL_CMD(ls, NULL,
"List PCIE devices", cmd_pcie_ls),
SHELL_SUBCMD_SET_END /* Array terminated. */
);

SHELL_CMD_REGISTER(lspcie, NULL, "List PCI(e) devices", cmd_lspcie);

SHELL_CMD_REGISTER(pcie, &sub_pcie_cmds, "PCI(e) device information", cmd_pcie_ls);

0 comments on commit de57d60

Please sign in to comment.