mirror of
https://github.com/opnsense/src.git
synced 2026-06-13 18:50:31 -04:00
make pciconf understand it's own output as stated in the manpage.
pciconf -r none8@pci1:12:2: 0x0 now works. PR: bin/10312 Submitted by: Castor Fu
This commit is contained in:
parent
efe0afa930
commit
e07efa8aa5
1 changed files with 13 additions and 5 deletions
|
|
@ -425,9 +425,17 @@ load_vendors(void)
|
|||
static struct pcisel
|
||||
getsel(const char *str)
|
||||
{
|
||||
char *ep = (char*) str;
|
||||
char *ep = strchr(str, '@');
|
||||
char *epbase;
|
||||
struct pcisel sel;
|
||||
|
||||
|
||||
if (ep == NULL)
|
||||
ep = (char *)str;
|
||||
else
|
||||
ep++;
|
||||
|
||||
epbase = ep;
|
||||
|
||||
if (strncmp(ep, "pci", 3) == 0) {
|
||||
ep += 3;
|
||||
sel.pc_bus = strtoul(ep, &ep, 0);
|
||||
|
|
@ -440,10 +448,10 @@ getsel(const char *str)
|
|||
ep++;
|
||||
sel.pc_func = strtoul(ep, &ep, 0);
|
||||
}
|
||||
if (*ep == ':')
|
||||
ep++;
|
||||
}
|
||||
if (*ep == ':')
|
||||
ep++;
|
||||
if (*ep || ep == str)
|
||||
if (*ep != '\x0' || ep == epbase)
|
||||
errx(1, "cannot parse selector %s", str);
|
||||
return sel;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue