Lines Matching refs:pdev

133 int intel_vsec_add_aux(struct pci_dev *pdev, struct device *parent,
159 parent = &pdev->dev;
187 static int intel_vsec_add_dev(struct pci_dev *pdev, struct intel_vsec_header *header,
199 dev_dbg(&pdev->dev, "Invalid 0 entry count for header id %d\n", header->id);
204 dev_dbg(&pdev->dev, "Invalid 0 entry size for header id %d\n", header->id);
227 tmp->start = pdev->resource[header->tbir].start +
233 intel_vsec_dev->pcidev = pdev;
243 return intel_vsec_add_aux(pdev, NULL, intel_vsec_dev,
247 static bool intel_vsec_walk_header(struct pci_dev *pdev,
255 ret = intel_vsec_add_dev(pdev, *header, info);
257 dev_info(&pdev->dev, "Could not add device for VSEC id %d\n",
266 static bool intel_vsec_walk_dvsec(struct pci_dev *pdev,
278 pos = pci_find_next_ext_capability(pdev, pos, PCI_EXT_CAP_ID_DVSEC);
282 pci_read_config_dword(pdev, pos + PCI_DVSEC_HEADER1, &hdr);
290 dev_info(&pdev->dev, "Unsupported DVSEC revision %d\n", header.rev);
296 pci_read_config_byte(pdev, pos + INTEL_DVSEC_ENTRIES, &header.num_entries);
297 pci_read_config_byte(pdev, pos + INTEL_DVSEC_SIZE, &header.entry_size);
298 pci_read_config_dword(pdev, pos + INTEL_DVSEC_TABLE, &table);
303 pci_read_config_dword(pdev, pos + PCI_DVSEC_HEADER2, &hdr);
306 ret = intel_vsec_add_dev(pdev, &header, info);
316 static bool intel_vsec_walk_vsec(struct pci_dev *pdev,
327 pos = pci_find_next_ext_capability(pdev, pos, PCI_EXT_CAP_ID_VNDR);
331 pci_read_config_dword(pdev, pos + PCI_VNDR_HEADER, &hdr);
336 dev_info(&pdev->dev, "Unsupported VSEC revision %d\n", header.rev);
344 pci_read_config_byte(pdev, pos + INTEL_DVSEC_ENTRIES, &header.num_entries);
345 pci_read_config_byte(pdev, pos + INTEL_DVSEC_SIZE, &header.entry_size);
346 pci_read_config_dword(pdev, pos + INTEL_DVSEC_TABLE, &table);
351 ret = intel_vsec_add_dev(pdev, &header, info);
361 static int intel_vsec_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
367 ret = pcim_enable_device(pdev);
371 pci_save_state(pdev);
376 if (intel_vsec_walk_dvsec(pdev, info))
379 if (intel_vsec_walk_vsec(pdev, info))
383 intel_vsec_walk_header(pdev, info))
448 static pci_ers_result_t intel_vsec_pci_error_detected(struct pci_dev *pdev,
453 dev_info(&pdev->dev, "PCI error detected, state %d", state);
458 pci_disable_device(pdev);
463 static pci_ers_result_t intel_vsec_pci_slot_reset(struct pci_dev *pdev)
470 dev_info(&pdev->dev, "Resetting PCI slot\n");
473 if (pci_enable_device(pdev)) {
474 dev_info(&pdev->dev,
482 /* check if pdev doesn't match */
483 if (pdev != intel_vsec_dev->pcidev)
485 devm_release_action(&pdev->dev, intel_vsec_remove_aux,
488 pci_disable_device(pdev);
489 pci_restore_state(pdev);
490 pci_dev_id = pci_match_id(intel_vsec_pci_ids, pdev);
491 intel_vsec_pci_probe(pdev, pci_dev_id);
497 static void intel_vsec_pci_resume(struct pci_dev *pdev)
499 dev_info(&pdev->dev, "Done resuming PCI device\n");