@@ -65,9 +65,34 @@ void dmi_set_vendor(const char *s)
65
65
/*
66
66
* HP-specific data structures are decoded here.
67
67
*
68
- * Code contributed by John Cagle.
68
+ * Code contributed by John Cagle and Tyler Bell .
69
69
*/
70
70
71
+ static void dmi_print_hp_net_iface_rec (u8 id , u8 bus , u8 dev , const u8 * mac )
72
+ {
73
+ /* Some systems do not provide an id. nic_ctr provides an artificial
74
+ * id, and assumes the records will be provided "in order". Also,
75
+ * using 0xFF marker is not future proof. 256 NICs is a lot, but
76
+ * 640K ought to be enough for anybody(said no one, ever).
77
+ * */
78
+ static u8 nic_ctr ;
79
+
80
+ if (id == 0xFF )
81
+ id = ++ nic_ctr ;
82
+
83
+ if (dev == 0x00 && bus == 0x00 )
84
+ printf ("\tNIC %d: Disabled\n" , id );
85
+ else if (dev == 0xFF && bus == 0xFF )
86
+ printf ("\tNIC %d: Not Installed\n" , id );
87
+ else
88
+ {
89
+ printf ("\tNIC %d: PCI device %02x:%02x.%x, "
90
+ "MAC address %02X:%02X:%02X:%02X:%02X:%02X\n" ,
91
+ id , bus , dev >> 3 , dev & 7 ,
92
+ mac [0 ], mac [1 ], mac [2 ], mac [3 ], mac [4 ], mac [5 ]);
93
+ }
94
+ }
95
+
71
96
static int dmi_decode_hp (const struct dmi_header * h )
72
97
{
73
98
u8 * data = h -> data ;
@@ -98,6 +123,19 @@ static int dmi_decode_hp(const struct dmi_header *h)
98
123
*
99
124
* This prints the BIOS NIC number,
100
125
* PCI bus/device/function, and MAC address
126
+ *
127
+ * Type 209:
128
+ * Offset | Name | Width | Description
129
+ * -------------------------------------
130
+ * 0x00 | Type | BYTE | 0xD1, MAC Info
131
+ * 0x01 | Length | BYTE | Length of structure
132
+ * 0x02 | Handle | WORD | Unique handle
133
+ * 0x04 | Dev No | BYTE | PCI Device/Function No
134
+ * 0x05 | Bus No | BYTE | PCI Bus
135
+ * 0x06 | MAC | 6B | MAC addr
136
+ * 0x0C | NIC #2 | 8B | Repeat 0x04-0x0B
137
+ *
138
+ * Type 221: is deprecated in the latest docs
101
139
*/
102
140
printf (h -> type == 221 ?
103
141
"HP BIOS iSCSI NIC PCI and MAC Information\n" :
@@ -106,25 +144,43 @@ static int dmi_decode_hp(const struct dmi_header *h)
106
144
ptr = 4 ;
107
145
while (h -> length >= ptr + 8 )
108
146
{
109
- if (data [ptr ] == 0x00 && data [ptr + 1 ] == 0x00 )
110
- printf ("\tNIC %d: Disabled\n" , nic );
111
- else if (data [ptr ] == 0xFF && data [ptr + 1 ] == 0xFF )
112
- printf ("\tNIC %d: Not Installed\n" , nic );
113
- else
114
- {
115
- printf ("\tNIC %d: PCI device %02x:%02x.%x, "
116
- "MAC address %02X:%02X:%02X:%02X:%02X:%02X\n" ,
117
- nic , data [ptr + 1 ],
118
- data [ptr ] >> 3 , data [ptr ] & 7 ,
119
- data [ptr + 2 ], data [ptr + 3 ],
120
- data [ptr + 4 ], data [ptr + 5 ],
121
- data [ptr + 6 ], data [ptr + 7 ]);
122
- }
147
+ dmi_print_hp_net_iface_rec (nic ,
148
+ data [ptr + 0x01 ],
149
+ data [ptr ],
150
+ & data [ptr + 0x02 ]);
123
151
nic ++ ;
124
152
ptr += 8 ;
125
153
}
126
154
break ;
127
155
156
+ case 233 :
157
+ /*
158
+ * Vendor Specific: HP ProLiant NIC MAC Information
159
+ *
160
+ * This prints the BIOS NIC number,
161
+ * PCI bus/device/function, and MAC address
162
+ *
163
+ * Offset | Name | Width | Description
164
+ * -------------------------------------
165
+ * 0x00 | Type | BYTE | 0xE9, NIC structure
166
+ * 0x01 | Length | BYTE | Length of structure
167
+ * 0x02 | Handle | WORD | Unique handle
168
+ * 0x04 | Grp No | WORD | 0 for single segment
169
+ * 0x06 | Bus No | BYTE | PCI Bus
170
+ * 0x07 | Dev No | BYTE | PCI Device/Function No
171
+ * 0x08 | MAC | 32B | MAC addr padded w/ 0s
172
+ * 0x28 | Port No| BYTE | Each NIC maps to a Port
173
+ */
174
+ printf ("HP BIOS PXE NIC PCI and MAC Information\n" );
175
+ if (h -> length < 0x0E ) break ;
176
+ /* If the record isn't long enough, we don't have an ID
177
+ * use 0xFF to use the internal counter.
178
+ * */
179
+ nic = h -> length > 0x28 ? data [0x28 ] : 0xFF ;
180
+ dmi_print_hp_net_iface_rec (nic , data [0x06 ], data [0x07 ],
181
+ & data [0x08 ]);
182
+ break ;
183
+
128
184
case 212 :
129
185
/*
130
186
* Vendor Specific: HP 64-bit CRU Information
0 commit comments