From b264dbd27739600955a365725f66ceae47e8a456 Mon Sep 17 00:00:00 2001 From: Joan Lledó Date: Sat, 15 Feb 2020 09:56:26 +0100 Subject: pci-arbiter: Rename command line options Rename some CLI options in order to add the new -D --device arg. Replace -s by -c for subclasses. Replace -D by -d for domains. Domains are optional from now on, default to 0. Replace -d by -s for devices. The formerly called "devices" are now called "slots", and "device" will refer to a combination of Domain + Bus + Slot + Function Only -G and -U options create new permission scopes. * pci-arbiter/options.c: parse_opts(): Rename options * pci-arbiter/options.h: struct argp_option options[]: Likewise --- pci-arbiter/options.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'pci-arbiter/options.c') diff --git a/pci-arbiter/options.c b/pci-arbiter/options.c index 76ce6460..01686fcd 100644 --- a/pci-arbiter/options.c +++ b/pci-arbiter/options.c @@ -114,25 +114,21 @@ parse_opt (int opt, char *arg, struct argp_state *state) switch (opt) { case 'C': - /* Init a new set if the current one already has a value for this option */ - if (h->curset->d_class >= 0) - parse_hook_add_set (h); - h->curset->d_class = strtol (arg, 0, 16); break; - case 's': + case 'c': h->curset->d_subclass = strtol (arg, 0, 16); break; - case 'D': - if (h->curset->domain >= 0) - parse_hook_add_set (h); - + case 'd': h->curset->domain = strtol (arg, 0, 16); break; case 'b': + if (h->curset->domain < 0) + h->curset->domain = 0; + h->curset->bus = strtol (arg, 0, 16); break; - case 'd': + case 's': h->curset->dev = strtol (arg, 0, 16); break; case 'f': @@ -261,7 +257,7 @@ netfs_append_args (char **argz, size_t * argz_len) if (p->bus >= 0) ADD_OPT ("--bus=0x%02x", p->bus); if (p->dev >= 0) - ADD_OPT ("--dev=0x%02x", p->dev); + ADD_OPT ("--slot=0x%02x", p->dev); if (p->func >= 0) ADD_OPT ("--func=%01u", p->func); if (p->uid >= 0) -- cgit v1.2.3