69,381
社区成员
发帖
与我相关
我的任务
分享
struct Name {
const int Base_Class1;
const int Sub_Class1;
const int Interface1;
const char *Meaning1;
} mean[17]={
{0x00,0x00,0x00,"All currently implemented devices"},
{0x00,0x01,0x00,"VGA-compatible device"},
{0x01,0x01,0x80,"IDE controller"},
{0x01,0x80,0x00,"Other mass storage controller"},
{0x02,0x00,0x00,"Ethernet controller"},
{0x02,0x80,0x00,"Other network controller"},
{0x03,0x00,0x00,"VGA-compatible controller"},
{0x03,0x80,0x00,"Other display controller"},
{0x06,0x00,0x00,"Host bridge"},
{0x06,0x01,0x00,"ISA bridge"},
{0x06,0x04,0x00,"PCI-to-PCI bridge"},
{0x06,0x04,0x01,"Subtractive Decode PCI-to-PCI bridge"},
{0x06,0x07,0x00,"CardBus bridge"},
{0x0c,0x00,0x10,"IEEE 1394 OpenHCI"},
{0x0c,0x03,0x00,"USB Universal Host Controller"},
{0x0c,0x03,0x20,"Intel USB2 Enhanced Host Controller"},
{0x0c,0x05,0x00,"SMBus"},
};
int i;
for (i=0;i<17;i++)
if (Base_Class == mean[i].Base_Class1
&& Sub_Class == mean[i]. Sub_Class1
&& Interface == mean[i]. Interface1) break;
if (i<17) puts(mean[i].Meaning1);
else printf("%s\t","Unknow Device");
for(i=0;i<17;i++)
{
if(Base_Class == mean[i].Base_Class1 && Sub_Class == mean[i].Sub_Class1 && Interface == mean[i].Interface1)
{
puts(mean[i].Meaning1);
break;
}
}
if(i == 17)
printf("%s\t","Unknow Device");