Lines Matching refs:header

187 static int intel_vsec_add_dev(struct pci_dev *pdev, struct intel_vsec_header *header,  in intel_vsec_add_dev()  argument
195 if (!intel_vsec_supported(header->id, info->caps)) in intel_vsec_add_dev()
198 if (!header->num_entries) { in intel_vsec_add_dev()
199 dev_dbg(&pdev->dev, "Invalid 0 entry count for header id %d\n", header->id); in intel_vsec_add_dev()
203 if (!header->entry_size) { in intel_vsec_add_dev()
204 dev_dbg(&pdev->dev, "Invalid 0 entry size for header id %d\n", header->id); in intel_vsec_add_dev()
212 res = kcalloc(header->num_entries, sizeof(*res), GFP_KERNEL); in intel_vsec_add_dev()
219 header->offset >>= TABLE_OFFSET_SHIFT; in intel_vsec_add_dev()
226 for (i = 0, tmp = res; i < header->num_entries; i++, tmp++) { in intel_vsec_add_dev()
227 tmp->start = pdev->resource[header->tbir].start + in intel_vsec_add_dev()
228 header->offset + i * (header->entry_size * sizeof(u32)); in intel_vsec_add_dev()
229 tmp->end = tmp->start + (header->entry_size * sizeof(u32)) - 1; in intel_vsec_add_dev()
235 intel_vsec_dev->num_resources = header->num_entries; in intel_vsec_add_dev()
238 if (header->id == VSEC_ID_SDSI) in intel_vsec_add_dev()
244 intel_vsec_name(header->id)); in intel_vsec_add_dev()
250 struct intel_vsec_header **header = info->headers; in intel_vsec_walk_header() local
254 for ( ; *header; header++) { in intel_vsec_walk_header()
255 ret = intel_vsec_add_dev(pdev, *header, info); in intel_vsec_walk_header()
258 (*header)->id); in intel_vsec_walk_header()
273 struct intel_vsec_header header; in intel_vsec_walk_dvsec() local
288 header.rev = PCI_DVSEC_HEADER1_REV(hdr); in intel_vsec_walk_dvsec()
289 if (header.rev != 1) { in intel_vsec_walk_dvsec()
290 dev_info(&pdev->dev, "Unsupported DVSEC revision %d\n", header.rev); in intel_vsec_walk_dvsec()
294 header.length = PCI_DVSEC_HEADER1_LEN(hdr); in intel_vsec_walk_dvsec()
296 pci_read_config_byte(pdev, pos + INTEL_DVSEC_ENTRIES, &header.num_entries); in intel_vsec_walk_dvsec()
297 pci_read_config_byte(pdev, pos + INTEL_DVSEC_SIZE, &header.entry_size); in intel_vsec_walk_dvsec()
300 header.tbir = INTEL_DVSEC_TABLE_BAR(table); in intel_vsec_walk_dvsec()
301 header.offset = INTEL_DVSEC_TABLE_OFFSET(table); in intel_vsec_walk_dvsec()
304 header.id = PCI_DVSEC_HEADER2_ID(hdr); in intel_vsec_walk_dvsec()
306 ret = intel_vsec_add_dev(pdev, &header, info); in intel_vsec_walk_dvsec()
323 struct intel_vsec_header header; in intel_vsec_walk_vsec() local
334 header.rev = PCI_VNDR_HEADER_REV(hdr); in intel_vsec_walk_vsec()
335 if (header.rev != 1) { in intel_vsec_walk_vsec()
336 dev_info(&pdev->dev, "Unsupported VSEC revision %d\n", header.rev); in intel_vsec_walk_vsec()
340 header.id = PCI_VNDR_HEADER_ID(hdr); in intel_vsec_walk_vsec()
341 header.length = PCI_VNDR_HEADER_LEN(hdr); in intel_vsec_walk_vsec()
344 pci_read_config_byte(pdev, pos + INTEL_DVSEC_ENTRIES, &header.num_entries); in intel_vsec_walk_vsec()
345 pci_read_config_byte(pdev, pos + INTEL_DVSEC_SIZE, &header.entry_size); in intel_vsec_walk_vsec()
348 header.tbir = INTEL_DVSEC_TABLE_BAR(table); in intel_vsec_walk_vsec()
349 header.offset = INTEL_DVSEC_TABLE_OFFSET(table); in intel_vsec_walk_vsec()
351 ret = intel_vsec_add_dev(pdev, &header, info); in intel_vsec_walk_vsec()