From: Hauke Mehrtens Date: Sun, 8 Dec 2013 15:08:09 +0000 (+0100) Subject: backports: add LINUX_BACKPORT infront of functions X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=3f8c0a7df40f574eb20ecd79fb7fbd7b60bb66d5;p=openwrt%2Fstaging%2Fblogic.git backports: add LINUX_BACKPORT infront of functions This is needed to add support for SLES 11 SP3 support. Signed-off-by: Hauke Mehrtens Signed-off-by: Luis R. Rodriguez --- diff --git a/backport/backport-include/linux/pci.h b/backport/backport-include/linux/pci.h index 208278d42349..3a1815ace1b9 100644 --- a/backport/backport-include/linux/pci.h +++ b/backport/backport-include/linux/pci.h @@ -100,24 +100,28 @@ int pcie_capability_clear_and_set_word(struct pci_dev *dev, int pos, int pcie_capability_clear_and_set_dword(struct pci_dev *dev, int pos, u32 clear, u32 set); +#define pcie_capability_set_word LINUX_BACKPORT(pcie_capability_set_word) static inline int pcie_capability_set_word(struct pci_dev *dev, int pos, u16 set) { return pcie_capability_clear_and_set_word(dev, pos, 0, set); } +#define pcie_capability_set_dword LINUX_BACKPORT(pcie_capability_set_dword) static inline int pcie_capability_set_dword(struct pci_dev *dev, int pos, u32 set) { return pcie_capability_clear_and_set_dword(dev, pos, 0, set); } +#define pcie_capability_clear_word LINUX_BACKPORT(pcie_capability_clear_word) static inline int pcie_capability_clear_word(struct pci_dev *dev, int pos, u16 clear) { return pcie_capability_clear_and_set_word(dev, pos, clear, 0); } +#define pcie_capability_clear_dword LINUX_BACKPORT(pcie_capability_clear_dword) static inline int pcie_capability_clear_dword(struct pci_dev *dev, int pos, u32 clear) { diff --git a/backport/backport-include/linux/usb.h b/backport/backport-include/linux/usb.h index 7f5ba20c8722..08ae0f2ce767 100644 --- a/backport/backport-include/linux/usb.h +++ b/backport/backport-include/linux/usb.h @@ -144,6 +144,7 @@ extern int usb_anchor_empty(struct usb_anchor *anchor); #endif /* 2.6.23-2.6.27 */ #if LINUX_VERSION_CODE < KERNEL_VERSION(3,2,0) +#define usb_translate_errors LINUX_BACKPORT(usb_translate_errors) static inline int usb_translate_errors(int error_code) { switch (error_code) { diff --git a/backport/backport-include/linux/usb/ch9.h b/backport/backport-include/linux/usb/ch9.h index 222b3f9c1dee..33c595926f67 100644 --- a/backport/backport-include/linux/usb/ch9.h +++ b/backport/backport-include/linux/usb/ch9.h @@ -36,6 +36,7 @@ enum usb_device_speed { * * Returns @epd's max packet */ +#define usb_endpoint_maxp LINUX_BACKPORT(usb_endpoint_maxp) static inline int usb_endpoint_maxp(const struct usb_endpoint_descriptor *epd) { return __le16_to_cpu(epd->wMaxPacketSize); diff --git a/backport/backport-include/linux/watchdog.h b/backport/backport-include/linux/watchdog.h index fb6853533474..49f666934079 100644 --- a/backport/backport-include/linux/watchdog.h +++ b/backport/backport-include/linux/watchdog.h @@ -4,6 +4,7 @@ #if (RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(6,4)) #if LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0) +#define watchdog_device LINUX_BACKPORT(watchdog_device) struct watchdog_device { }; #endif diff --git a/backport/compat/compat-3.7.c b/backport/compat/compat-3.7.c index 2d739f93ec57..f7e7848b22ba 100644 --- a/backport/compat/compat-3.7.c +++ b/backport/compat/compat-3.7.c @@ -47,21 +47,18 @@ static inline u16 pcie_flags_reg(struct pci_dev *dev) return reg16; } +#define pci_pcie_type LINUX_BACKPORT(pci_pcie_type) static inline int pci_pcie_type(struct pci_dev *dev) { return (pcie_flags_reg(dev) & PCI_EXP_FLAGS_TYPE) >> 4; } +#define pcie_cap_version LINUX_BACKPORT(pcie_cap_version) static inline int pcie_cap_version(struct pci_dev *dev) { return pcie_flags_reg(dev) & PCI_EXP_FLAGS_VERS; } -static inline bool pcie_cap_has_devctl(const struct pci_dev *dev) -{ - return true; -} - static inline bool pcie_cap_has_lnkctl(struct pci_dev *dev) { int type = pci_pcie_type(dev); @@ -102,7 +99,7 @@ static bool pcie_capability_reg_implemented(struct pci_dev *dev, int pos) case PCI_EXP_DEVCAP: case PCI_EXP_DEVCTL: case PCI_EXP_DEVSTA: - return pcie_cap_has_devctl(dev); + return true; case PCI_EXP_LNKCAP: case PCI_EXP_LNKCTL: case PCI_EXP_LNKSTA: