Lines Matching full:header
148 static int intel_vsec_add_dev(struct pci_dev *pdev, struct intel_vsec_header *header, in intel_vsec_add_dev() argument
164 if (!intel_vsec_supported(header->id, info->caps)) in intel_vsec_add_dev()
167 if (!header->num_entries) { in intel_vsec_add_dev()
168 dev_dbg(&pdev->dev, "Invalid 0 entry count for header id %d\n", header->id); in intel_vsec_add_dev()
172 if (!header->entry_size) { in intel_vsec_add_dev()
173 dev_dbg(&pdev->dev, "Invalid 0 entry size for header id %d\n", header->id); in intel_vsec_add_dev()
181 res = kcalloc(header->num_entries, sizeof(*res), GFP_KERNEL); in intel_vsec_add_dev()
186 header->offset >>= TABLE_OFFSET_SHIFT; in intel_vsec_add_dev()
191 base_addr = pdev->resource[header->tbir].start; in intel_vsec_add_dev()
198 for (i = 0, tmp = res; i < header->num_entries; i++, tmp++) { in intel_vsec_add_dev()
199 tmp->start = base_addr + header->offset + i * (header->entry_size * sizeof(u32)); in intel_vsec_add_dev()
200 tmp->end = tmp->start + (header->entry_size * sizeof(u32)) - 1; in intel_vsec_add_dev()
212 intel_vsec_dev->num_resources = header->num_entries; in intel_vsec_add_dev()
217 if (header->id == VSEC_ID_SDSI) in intel_vsec_add_dev()
227 intel_vsec_name(header->id)); in intel_vsec_add_dev()
233 struct intel_vsec_header **header = info->headers; in intel_vsec_walk_header() local
237 for ( ; *header; header++) { in intel_vsec_walk_header()
238 ret = intel_vsec_add_dev(pdev, *header, info); in intel_vsec_walk_header()
253 struct intel_vsec_header header; in intel_vsec_walk_dvsec() local
268 header.rev = PCI_DVSEC_HEADER1_REV(hdr); in intel_vsec_walk_dvsec()
269 if (header.rev != 1) { in intel_vsec_walk_dvsec()
270 dev_info(&pdev->dev, "Unsupported DVSEC revision %d\n", header.rev); in intel_vsec_walk_dvsec()
274 header.length = PCI_DVSEC_HEADER1_LEN(hdr); in intel_vsec_walk_dvsec()
276 pci_read_config_byte(pdev, pos + INTEL_DVSEC_ENTRIES, &header.num_entries); in intel_vsec_walk_dvsec()
277 pci_read_config_byte(pdev, pos + INTEL_DVSEC_SIZE, &header.entry_size); in intel_vsec_walk_dvsec()
280 header.tbir = INTEL_DVSEC_TABLE_BAR(table); in intel_vsec_walk_dvsec()
281 header.offset = INTEL_DVSEC_TABLE_OFFSET(table); in intel_vsec_walk_dvsec()
284 header.id = PCI_DVSEC_HEADER2_ID(hdr); in intel_vsec_walk_dvsec()
286 ret = intel_vsec_add_dev(pdev, &header, info); in intel_vsec_walk_dvsec()
303 struct intel_vsec_header header; in intel_vsec_walk_vsec() local
314 header.rev = PCI_VNDR_HEADER_REV(hdr); in intel_vsec_walk_vsec()
315 if (header.rev != 1) { in intel_vsec_walk_vsec()
316 dev_info(&pdev->dev, "Unsupported VSEC revision %d\n", header.rev); in intel_vsec_walk_vsec()
320 header.id = PCI_VNDR_HEADER_ID(hdr); in intel_vsec_walk_vsec()
321 header.length = PCI_VNDR_HEADER_LEN(hdr); in intel_vsec_walk_vsec()
324 pci_read_config_byte(pdev, pos + INTEL_DVSEC_ENTRIES, &header.num_entries); in intel_vsec_walk_vsec()
325 pci_read_config_byte(pdev, pos + INTEL_DVSEC_SIZE, &header.entry_size); in intel_vsec_walk_vsec()
328 header.tbir = INTEL_DVSEC_TABLE_BAR(table); in intel_vsec_walk_vsec()
329 header.offset = INTEL_DVSEC_TABLE_OFFSET(table); in intel_vsec_walk_vsec()
331 ret = intel_vsec_add_dev(pdev, &header, info); in intel_vsec_walk_vsec()