Save vital product data capability ptr.
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Sun, 28 Dec 2008 02:42:49 +0000 (10:42 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Sun, 28 Dec 2008 03:45:33 +0000 (11:45 +0800)
sys/bus/pci/pci.c
sys/bus/pci/pcivar.h

index 36aa3bc..f8b0622 100644 (file)
@@ -629,6 +629,9 @@ pci_read_capabilities(device_t pcib, pcicfgregs *cfg)
                case PCIY_EXPRESS:      /* PCI Express */
                        pci_read_cap_expr(pcib, ptr, cfg);
                        break;
+               case PCIY_VPD:          /* Vital Product Data */
+                       cfg->vpdcap_ptr = ptr;
+                       break;
                default:
                        break;
                }
@@ -1966,6 +1969,9 @@ pci_read_ivar(device_t dev, device_t child, int which, uintptr_t *result)
        case PCI_IVAR_PCIECAP_PTR:
                *result = cfg->expr.expr_ptr;
                break;
+       case PCI_IVAR_VPDCAP_PTR:
+               *result = cfg->vpdcap_ptr;
+               break;
        default:
                return ENOENT;
        }
index 46d4d66..4d524c9 100644 (file)
@@ -111,6 +111,7 @@ typedef struct pcicfg {
     struct pcicfg_pmgt pmgt;   /* power management capability */
     struct pcicfg_expr expr;   /* PCI Express capability */
     u_int8_t   pcixcap_ptr;    /* PCI-X capability PTR */
+    u_int8_t   vpdcap_ptr;     /* Vital Product Data capability */
 } pcicfgregs;
 
 /* additional type 1 device config header information (PCI to PCI bridge) */
@@ -213,7 +214,8 @@ enum pci_device_ivars {
        PCI_IVAR_SUBORDINATEBUS,
        PCI_IVAR_ETHADDR,
        PCI_IVAR_PCIXCAP_PTR,
-       PCI_IVAR_PCIECAP_PTR
+       PCI_IVAR_PCIECAP_PTR,
+       PCI_IVAR_VPDCAP_PTR
 };
 
 /*
@@ -257,6 +259,7 @@ PCI_ACCESSOR(subordinatebus,        SUBORDINATEBUS, u_int8_t)
 PCI_ACCESSOR(ether,            ETHADDR,        uint8_t *)
 PCI_ACCESSOR(pcixcap_ptr,      PCIXCAP_PTR,    uint8_t)
 PCI_ACCESSOR(pciecap_ptr,      PCIECAP_PTR,    uint8_t)
+PCI_ACCESSOR(vpdcap_ptr,       VPDCAP_PTR,     uint8_t)
 
 #undef PCI_ACCESSOR