--- zzzz-none-000/linux-4.4.271/drivers/pci/pci-sysfs.c 2021-06-03 06:22:09.000000000 +0000 +++ dakota-7530ac-750/linux-4.4.271/drivers/pci/pci-sysfs.c 2023-01-11 09:25:42.000000000 +0000 @@ -324,8 +324,32 @@ } static BUS_ATTR(rescan, (S_IWUSR|S_IWGRP), NULL, bus_rescan_store); +#ifdef CONFIG_AVM_PCI_RECOVERY +static ssize_t bus_down_store(struct bus_type *bus, const char *buf, + size_t count) +{ + ath_pci_down(); + + return count; +} +static BUS_ATTR(down, (S_IWUSR|S_IWGRP), NULL, bus_down_store); + +static ssize_t bus_up_store(struct bus_type *bus, const char *buf, + size_t count) +{ + ath_pci_up(); + + return count; +} +static BUS_ATTR(up, (S_IWUSR|S_IWGRP), NULL, bus_up_store); +#endif + static struct attribute *pci_bus_attrs[] = { &bus_attr_rescan.attr, +#ifdef CONFIG_AVM_PCI_RECOVERY + &bus_attr_down.attr, + &bus_attr_up.attr, +#endif NULL, };