Lines Matching refs:edev

201 	struct eeh_dev *edev, *tmp;  in eeh_pe_dev_traverse()  local
212 eeh_pe_for_each_dev(pe, edev, tmp) { in eeh_pe_dev_traverse()
213 ret = fn(edev, flag); in eeh_pe_dev_traverse()
299 static struct eeh_pe *eeh_pe_get_parent(struct eeh_dev *edev) in eeh_pe_get_parent() argument
302 struct pci_dn *pdn = eeh_dev_to_pdn(edev); in eeh_pe_get_parent()
309 if (edev->physfn) in eeh_pe_get_parent()
310 pdn = pci_get_pdn(edev->physfn); in eeh_pe_get_parent()
337 int eeh_add_to_parent_pe(struct eeh_dev *edev) in eeh_add_to_parent_pe() argument
340 struct pci_dn *pdn = eeh_dev_to_pdn(edev); in eeh_add_to_parent_pe()
344 if (!eeh_has_flag(EEH_VALID_PE_ZERO) && !edev->pe_config_addr) { in eeh_add_to_parent_pe()
356 pe = eeh_pe_get(pdn->phb, edev->pe_config_addr, config_addr); in eeh_add_to_parent_pe()
360 edev->pe = pe; in eeh_add_to_parent_pe()
363 list_add_tail(&edev->list, &pe->edevs); in eeh_add_to_parent_pe()
372 list_add_tail(&edev->list, &pe->edevs); in eeh_add_to_parent_pe()
373 edev->pe = pe; in eeh_add_to_parent_pe()
397 if (edev->physfn) in eeh_add_to_parent_pe()
405 pe->addr = edev->pe_config_addr; in eeh_add_to_parent_pe()
414 parent = eeh_pe_get_parent(edev); in eeh_add_to_parent_pe()
420 edev->pe = NULL; in eeh_add_to_parent_pe()
432 list_add_tail(&edev->list, &pe->edevs); in eeh_add_to_parent_pe()
433 edev->pe = pe; in eeh_add_to_parent_pe()
454 int eeh_rmv_from_parent_pe(struct eeh_dev *edev) in eeh_rmv_from_parent_pe() argument
458 struct pci_dn *pdn = eeh_dev_to_pdn(edev); in eeh_rmv_from_parent_pe()
460 if (!edev->pe) { in eeh_rmv_from_parent_pe()
470 pe = eeh_dev_to_pe(edev); in eeh_rmv_from_parent_pe()
471 edev->pe = NULL; in eeh_rmv_from_parent_pe()
472 list_del(&edev->list); in eeh_rmv_from_parent_pe()
555 struct eeh_dev *edev, *tmp; in __eeh_pe_state_mark() local
568 eeh_pe_for_each_dev(pe, edev, tmp) { in __eeh_pe_state_mark()
569 pdev = eeh_dev_to_pci_dev(edev); in __eeh_pe_state_mark()
595 static void *__eeh_pe_dev_mode_mark(struct eeh_dev *edev, void *flag) in __eeh_pe_dev_mode_mark() argument
599 edev->mode |= mode; in __eeh_pe_dev_mode_mark()
627 struct eeh_dev *edev, *tmp; in __eeh_pe_state_clear() local
645 eeh_pe_for_each_dev(pe, edev, tmp) { in __eeh_pe_state_clear()
646 pdev = eeh_dev_to_pci_dev(edev); in __eeh_pe_state_clear()
707 static void eeh_bridge_check_link(struct eeh_dev *edev) in eeh_bridge_check_link() argument
709 struct pci_dn *pdn = eeh_dev_to_pdn(edev); in eeh_bridge_check_link()
718 if (!(edev->mode & (EEH_DEV_ROOT_PORT | EEH_DEV_DS_PORT))) in eeh_bridge_check_link()
728 cap = edev->pcie_cap; in eeh_bridge_check_link()
780 #define SAVED_BYTE(OFF) (((u8 *)(edev->config_space))[BYTE_SWAP(OFF)])
782 static void eeh_restore_bridge_bars(struct eeh_dev *edev) in eeh_restore_bridge_bars() argument
784 struct pci_dn *pdn = eeh_dev_to_pdn(edev); in eeh_restore_bridge_bars()
792 eeh_ops->write_config(pdn, i*4, 4, edev->config_space[i]); in eeh_restore_bridge_bars()
794 eeh_ops->write_config(pdn, 14*4, 4, edev->config_space[14]); in eeh_restore_bridge_bars()
802 eeh_ops->write_config(pdn, 15*4, 4, edev->config_space[15]); in eeh_restore_bridge_bars()
805 eeh_ops->write_config(pdn, PCI_COMMAND, 4, edev->config_space[1] | in eeh_restore_bridge_bars()
809 eeh_bridge_check_link(edev); in eeh_restore_bridge_bars()
812 static void eeh_restore_device_bars(struct eeh_dev *edev) in eeh_restore_device_bars() argument
814 struct pci_dn *pdn = eeh_dev_to_pdn(edev); in eeh_restore_device_bars()
819 eeh_ops->write_config(pdn, i*4, 4, edev->config_space[i]); in eeh_restore_device_bars()
821 eeh_ops->write_config(pdn, 12*4, 4, edev->config_space[12]); in eeh_restore_device_bars()
829 eeh_ops->write_config(pdn, 15*4, 4, edev->config_space[15]); in eeh_restore_device_bars()
836 if (edev->config_space[1] & PCI_COMMAND_PARITY) in eeh_restore_device_bars()
840 if (edev->config_space[1] & PCI_COMMAND_SERR) in eeh_restore_device_bars()
856 static void *eeh_restore_one_device_bars(struct eeh_dev *edev, void *flag) in eeh_restore_one_device_bars() argument
858 struct pci_dn *pdn = eeh_dev_to_pdn(edev); in eeh_restore_one_device_bars()
861 if (edev->mode & EEH_DEV_BRIDGE) in eeh_restore_one_device_bars()
862 eeh_restore_bridge_bars(edev); in eeh_restore_one_device_bars()
864 eeh_restore_device_bars(edev); in eeh_restore_one_device_bars()
937 struct eeh_dev *edev; in eeh_pe_bus_get() local
948 edev = list_first_entry_or_null(&pe->edevs, struct eeh_dev, list); in eeh_pe_bus_get()
949 pdev = eeh_dev_to_pci_dev(edev); in eeh_pe_bus_get()