FreeBSD Bugzilla – Attachment 11187 Details for
Bug 22124
patch to update pciconf to give a -v option
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 9.71 KB, created by
Steve.Roome
on 2000-10-19 16:30:00 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Steve.Roome
Created:
2000-10-19 16:30:00 UTC
Size:
9.71 KB
patch
obsolete
>*** /usr/src/usr.sbin/pciconf/pciconf.c.orig Wed Dec 8 17:43:20 1999 >--- /usr/src/usr.sbin/pciconf/pciconf.c Thu Oct 19 15:44:42 2000 >*************** >*** 29,35 **** > > #ifndef lint > static const char rcsid[] = >! "$FreeBSD: src/usr.sbin/pciconf/pciconf.c,v 1.11 1999/12/08 17:43:20 ken Exp $"; > #endif /* not lint */ > > #include <sys/types.h> >--- 29,35 ---- > > #ifndef lint > static const char rcsid[] = >! "$FreeBSD: /c/ncvs/src/usr.sbin/pciconf/pciconf.c,v 1.11 1999/12/08 17:43:20 ken Exp $"; > #endif /* not lint */ > > #include <sys/types.h> >*************** >*** 44,50 **** > > #include "pathnames.h" > >! static void list_devs(void); > static void readit(const char *, const char *, int); > static void writeit(const char *, const char *, const char *, int); > static void chkattached(const char *, int); >--- 44,50 ---- > > #include "pathnames.h" > >! static void list_devs(int); > static void readit(const char *, const char *, int); > static void writeit(const char *, const char *, const char *, int); > static void chkattached(const char *, int); >*************** >*** 55,61 **** > usage() > { > fprintf(stderr, "%s\n%s\n%s\n%s\n", >! "usage: pciconf -l", > " pciconf -a sel", > " pciconf -r [-b | -h] sel addr", > " pciconf -w [-b | -h] sel addr [value]"); >--- 55,61 ---- > usage() > { > fprintf(stderr, "%s\n%s\n%s\n%s\n", >! "usage: pciconf -l [-v]", > " pciconf -a sel", > " pciconf -r [-b | -h] sel addr", > " pciconf -w [-b | -h] sel addr [value]"); >*************** >*** 66,77 **** > main(int argc, char **argv) > { > int c; >! int listmode, readmode, writemode, attachedmode; > int byte, isshort; > >! listmode = readmode = writemode = attachedmode = byte = isshort = 0; > >! while ((c = getopt(argc, argv, "alrwbh")) != -1) { > switch(c) { > case 'a': > attachedmode = 1; >--- 66,77 ---- > main(int argc, char **argv) > { > int c; >! int listmode, readmode, writemode, attachedmode, verbose; > int byte, isshort; > >! verbose = listmode = readmode = writemode = attachedmode = byte = isshort = 0; > >! while ((c = getopt(argc, argv, "alvrwbh")) != -1) { > switch(c) { > case 'a': > attachedmode = 1; >*************** >*** 97,102 **** >--- 97,106 ---- > isshort = 1; > break; > >+ case 'v': >+ verbose = 1; >+ break; >+ > default: > usage(); > } >*************** >*** 109,115 **** > usage(); > > if (listmode) { >! list_devs(); > } else if(attachedmode) { > chkattached(argv[optind], > byte ? 1 : isshort ? 2 : 4); >--- 113,119 ---- > usage(); > > if (listmode) { >! list_devs(verbose); > } else if(attachedmode) { > chkattached(argv[optind], > byte ? 1 : isshort ? 2 : 4); >*************** >*** 127,133 **** > } > > static void >! list_devs(void) > { > int fd; > struct pci_conf_io pc; >--- 131,137 ---- > } > > static void >! list_devs(int verbose) > { > int fd; > struct pci_conf_io pc; >*************** >*** 166,187 **** > return; > } > for (p = conf; p < &conf[pc.num_matches]; p++) { >! >! printf("%s%d@pci%d:%d:%d:\tclass=0x%06x card=0x%08x " > "chip=0x%08x rev=0x%02x hdr=0x%02x\n", > (p->pd_name && *p->pd_name) ? p->pd_name : > "none", > (p->pd_name && *p->pd_name) ? (int)p->pd_unit : > none_count++, > p->pc_sel.pc_bus, p->pc_sel.pc_dev, >! p->pc_sel.pc_func, (p->pc_class << 16) | > (p->pc_subclass << 8) | p->pc_progif, > (p->pc_subdevice << 16) | p->pc_subvendor, > (p->pc_device << 16) | p->pc_vendor, > p->pc_revid, p->pc_hdr); > } > } while (pc.status == PCI_GETCONF_MORE_DEVS); >- > close(fd); > } > >--- 170,357 ---- > return; > } > for (p = conf; p < &conf[pc.num_matches]; p++) { >! if (!verbose) { >! int char_count; >! char_count=printf("%s%d@pci%d:%d:%d:", >! (p->pd_name && *p->pd_name) ? p->pd_name : >! "none", >! (p->pd_name && *p->pd_name) ? (int)p->pd_unit : >! none_count++, >! p->pc_sel.pc_bus, p->pc_sel.pc_dev, >! p->pc_sel.pc_func); >! if (char_count<20) while (char_count++<20) printf(" "); >! printf("class=0x%06x card=0x%08x " > "chip=0x%08x rev=0x%02x hdr=0x%02x\n", >+ (p->pc_class << 16) | >+ (p->pc_subclass << 8) | p->pc_progif, >+ (p->pc_subdevice << 16) | p->pc_subvendor, >+ (p->pc_device << 16) | p->pc_vendor, >+ p->pc_revid, p->pc_hdr); >+ } else { >+ int char_count; >+ printf("%s%d@pci%d:%d:%d\n\t", > (p->pd_name && *p->pd_name) ? p->pd_name : > "none", > (p->pd_name && *p->pd_name) ? (int)p->pd_unit : > none_count++, > p->pc_sel.pc_bus, p->pc_sel.pc_dev, >! p->pc_sel.pc_func); >! printf("class=0x%06x card=0x%08x " >! "chip=0x%08x rev=0x%02x hdr=0x%02x\n", >! (p->pc_class << 16) | > (p->pc_subclass << 8) | p->pc_progif, > (p->pc_subdevice << 16) | p->pc_subvendor, > (p->pc_device << 16) | p->pc_vendor, > p->pc_revid, p->pc_hdr); >+ >+ printf("\t"); >+ switch (p->pc_class) >+ { >+ case (0) : printf("Device not classified.\n"); break; >+ case (1) : >+ switch(p->pc_subclass) >+ { >+ case(0x00): printf("SCSI"); break; >+ case(0x01): printf("IDE"); break; >+ case(0x02): printf("FLOPPY"); break; >+ case(0x03): printf("IPI"); break; >+ case(0x04): printf("RAID"); break; >+ case(0x80): printf("OTHER"); break; >+ default : printf("Unknown"); break; >+ } >+ printf(" storage controller\n"); >+ break; >+ case (2) : >+ switch(p->pc_subclass) >+ { >+ case (0x00) : printf("Ethernet"); break; >+ case (0x01) : printf("Tokenring"); break; >+ case (0x02) : printf("FDDI"); break; >+ case (0x03) : printf("ATM"); break; >+ case (0x80) : printf("Other"); break; >+ default : printf("Unknown"); break; >+ } >+ printf(" network device\n"); >+ break; >+ case (3) : >+ switch (p->pc_subclass) >+ { >+ case (0x00) : printf ("VGA"); break; >+ case (0x01) : printf ("XGA"); break; >+ case (0x80) : printf ("Other"); break; >+ default : printf ("Unknown"); break; >+ } >+ printf(" display device\n"); >+ break; >+ case (4) : printf("Multimedia device - "); >+ switch (p->pc_subclass) >+ { >+ case (0x00) : printf("video\n"); break; >+ case (0x01) : printf("audio\n"); break; >+ case (0x80) : printf("other\n"); break; >+ default : printf("unkown type\n"); break; >+ } >+ break; >+ case (5) : >+ switch (p->pc_subclass) >+ { >+ case (0x00) : printf("RAM "); break; >+ case (0x01) : printf("Flash "); break; >+ case (0x80) : printf("'Other' "); break; >+ default : printf("Unknown type\n"); break; >+ } >+ printf("Memory\n"); >+ break; >+ case (6) : >+ switch (p->pc_subclass) >+ { >+ case (0x00) : printf("Host"); break; >+ case (0x01) : printf("ISA"); break; >+ case (0x02) : printf("EISA"); break; >+ case (0x03) : printf("MCA"); break; >+ case (0x04) : printf("PCI"); break; >+ case (0x05) : printf("PCMCIA"); break; >+ case (0x06) : printf("NUBUS"); break; >+ case (0x07) : printf("Cardbus"); break; >+ case (0x80) : printf("Other"); break; >+ default : printf("Unknown"); break; >+ } >+ printf(" bridge device\n"); >+ break; >+ case (7) : >+ switch (p->pc_subclass) >+ { >+ case (0x00) : printf("UART"); break; >+ case (0x01) : printf("PAR"); break; >+ case (0x80) : printf("Other"); break; >+ default : printf ("Unknown"); break; >+ } >+ printf(" simple communications device\n"); >+ break; >+ case (8) : >+ switch (p->pc_subclass) >+ { >+ case (0x00) : printf("PIC"); break; >+ case (0x01) : printf("DMA"); break; >+ case (0x02) : printf("Timer"); break; >+ case (0x03) : printf("RTC"); break; >+ case (0x80) : printf("other"); break; >+ default : printf("unknown"); break; >+ } >+ printf(" base peripheral device\n"); >+ break; >+ case (9) : >+ switch (p->pc_subclass) >+ { >+ case (0x00) : printf("keyboard"); break; >+ case (0x01) : printf("digitizer"); break; >+ case (0x02) : printf("mouse"); break; >+ case (0x80) : printf("other"); break; >+ default : printf("unknown"); break; >+ } >+ printf(" input device\n"); >+ break; >+ case (10) : >+ switch (p->pc_subclass) >+ { >+ case (0x00) : printf("generic"); break; >+ case (0x80) : printf("other"); break; >+ default : printf("unkown"); break; >+ } >+ printf(" docking device\n"); >+ break; >+ case (11) : >+ switch (p->pc_subclass) >+ { >+ case (0x00) : printf ("386"); break; >+ case (0x01) : printf ("486"); break; >+ case (0x02) : printf ("Pentium"); break; >+ case (0x10) : printf ("Alpha"); break; >+ case (0x20) : printf ("PowerPC"); break; >+ case (0x40) : printf ("Coprocessor"); break; >+ default : printf ("unkown"); >+ } >+ printf(" processor device\n"); >+ break; >+ case (12) : >+ switch (p->pc_subclass) >+ { >+ case (0x00) : printf ("Firewire"); break; >+ case (0x01) : printf ("Access"); break; >+ case (0x02) : printf ("SSA"); break; >+ case (0x03) : printf ("USB"); break; >+ case (0x04) : printf ("Fibrechannel"); break; >+ default : printf ("unkown"); >+ } >+ printf("Serial Bus device\n"); >+ break; >+ case (15) : printf ("'Other' device type\n"); break; >+ default : printf("Unknown device type\n"); break; >+ } >+ printf("\n"); >+ } > } > } while (pc.status == PCI_GETCONF_MORE_DEVS); > close(fd); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 22124
:
11186
| 11187