Lines Matching refs:pdev

43 	struct pci_dev *pdev;  in pci_enable_ats()  local
60 pdev = pci_physfn(dev); in pci_enable_ats()
61 if (pdev->ats_stu != ps) in pci_enable_ats()
64 atomic_inc(&pdev->ats_ref_cnt); /* count enabled VFs */ in pci_enable_ats()
82 struct pci_dev *pdev; in pci_disable_ats() local
92 pdev = pci_physfn(dev); in pci_disable_ats()
93 atomic_dec(&pdev->ats_ref_cnt); in pci_disable_ats()
156 int pci_ats_page_aligned(struct pci_dev *pdev) in pci_ats_page_aligned() argument
160 if (!pdev->ats_cap) in pci_ats_page_aligned()
163 pci_read_config_word(pdev, pdev->ats_cap + PCI_ATS_CAP, &cap); in pci_ats_page_aligned()
179 int pci_enable_pri(struct pci_dev *pdev, u32 reqs) in pci_enable_pri() argument
185 if (WARN_ON(pdev->pri_enabled)) in pci_enable_pri()
188 pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PRI); in pci_enable_pri()
192 pci_read_config_word(pdev, pos + PCI_PRI_STATUS, &status); in pci_enable_pri()
196 pci_read_config_dword(pdev, pos + PCI_PRI_MAX_REQ, &max_requests); in pci_enable_pri()
198 pdev->pri_reqs_alloc = reqs; in pci_enable_pri()
199 pci_write_config_dword(pdev, pos + PCI_PRI_ALLOC_REQ, reqs); in pci_enable_pri()
202 pci_write_config_word(pdev, pos + PCI_PRI_CTRL, control); in pci_enable_pri()
204 pdev->pri_enabled = 1; in pci_enable_pri()
216 void pci_disable_pri(struct pci_dev *pdev) in pci_disable_pri() argument
221 if (WARN_ON(!pdev->pri_enabled)) in pci_disable_pri()
224 pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PRI); in pci_disable_pri()
228 pci_read_config_word(pdev, pos + PCI_PRI_CTRL, &control); in pci_disable_pri()
230 pci_write_config_word(pdev, pos + PCI_PRI_CTRL, control); in pci_disable_pri()
232 pdev->pri_enabled = 0; in pci_disable_pri()
240 void pci_restore_pri_state(struct pci_dev *pdev) in pci_restore_pri_state() argument
243 u32 reqs = pdev->pri_reqs_alloc; in pci_restore_pri_state()
246 if (!pdev->pri_enabled) in pci_restore_pri_state()
249 pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PRI); in pci_restore_pri_state()
253 pci_write_config_dword(pdev, pos + PCI_PRI_ALLOC_REQ, reqs); in pci_restore_pri_state()
254 pci_write_config_word(pdev, pos + PCI_PRI_CTRL, control); in pci_restore_pri_state()
265 int pci_reset_pri(struct pci_dev *pdev) in pci_reset_pri() argument
270 if (WARN_ON(pdev->pri_enabled)) in pci_reset_pri()
273 pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PRI); in pci_reset_pri()
278 pci_write_config_word(pdev, pos + PCI_PRI_CTRL, control); in pci_reset_pri()
295 int pci_enable_pasid(struct pci_dev *pdev, int features) in pci_enable_pasid() argument
300 if (WARN_ON(pdev->pasid_enabled)) in pci_enable_pasid()
303 if (!pdev->eetlp_prefix_path) in pci_enable_pasid()
306 pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PASID); in pci_enable_pasid()
310 pci_read_config_word(pdev, pos + PCI_PASID_CAP, &supported); in pci_enable_pasid()
318 pdev->pasid_features = features; in pci_enable_pasid()
320 pci_write_config_word(pdev, pos + PCI_PASID_CTRL, control); in pci_enable_pasid()
322 pdev->pasid_enabled = 1; in pci_enable_pasid()
332 void pci_disable_pasid(struct pci_dev *pdev) in pci_disable_pasid() argument
337 if (WARN_ON(!pdev->pasid_enabled)) in pci_disable_pasid()
340 pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PASID); in pci_disable_pasid()
344 pci_write_config_word(pdev, pos + PCI_PASID_CTRL, control); in pci_disable_pasid()
346 pdev->pasid_enabled = 0; in pci_disable_pasid()
354 void pci_restore_pasid_state(struct pci_dev *pdev) in pci_restore_pasid_state() argument
359 if (!pdev->pasid_enabled) in pci_restore_pasid_state()
362 pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PASID); in pci_restore_pasid_state()
366 control = PCI_PASID_CTRL_ENABLE | pdev->pasid_features; in pci_restore_pasid_state()
367 pci_write_config_word(pdev, pos + PCI_PASID_CTRL, control); in pci_restore_pasid_state()
381 int pci_pasid_features(struct pci_dev *pdev) in pci_pasid_features() argument
386 pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PASID); in pci_pasid_features()
390 pci_read_config_word(pdev, pos + PCI_PASID_CAP, &supported); in pci_pasid_features()
410 int pci_prg_resp_pasid_required(struct pci_dev *pdev) in pci_prg_resp_pasid_required() argument
415 pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PRI); in pci_prg_resp_pasid_required()
419 pci_read_config_word(pdev, pos + PCI_PRI_STATUS, &status); in pci_prg_resp_pasid_required()
437 int pci_max_pasids(struct pci_dev *pdev) in pci_max_pasids() argument
442 pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PASID); in pci_max_pasids()
446 pci_read_config_word(pdev, pos + PCI_PASID_CAP, &supported); in pci_max_pasids()