Some driver are now requiring some be io functions, as noted in commit (06901bd83412db5a31de7526e637101ed0c2c472). Otherwise, it may lead to build errors like this one : drivers/net/mlx4/en_tx.c: In function ‘mlx4_en_xmit’: drivers/net/mlx4/en_tx.c:815: error: implicit declaration of function ‘iowrite32be’ make[3]: *** [drivers/net/mlx4/en_tx.o] Error 1 make[2]: *** [drivers/net/mlx4] Error 2 make[1]: *** [drivers/net] Error 2 Signed-off-by: Arnaud Patard Index: linux-2.6/arch/arm/mach-ixp4xx/include/mach/io.h =================================================================== --- linux-2.6.orig/arch/arm/mach-ixp4xx/include/mach/io.h 2011-10-27 22:19:37.000000000 +0200 +++ linux-2.6/arch/arm/mach-ixp4xx/include/mach/io.h 2011-12-01 09:23:47.000000000 +0100 @@ -385,6 +385,20 @@ static inline unsigned int ioread16(cons #endif } +#define ioread16be(p) ioread16be(p) +static inline unsigned int ioread16be(const void __iomem *addr) +{ + unsigned long port = (unsigned long __force)addr; + if (__is_io_address(port)) + return (unsigned int)inw(port & PIO_MASK); + else +#ifndef CONFIG_IXP4XX_INDIRECT_PCI + return be16_to_cpu((__force __be16)__raw_readw(addr)); +#else + return be16_to_cpu((__force __le16)(unsigned int)__indirect_readw(addr)); +#endif +} + #define ioread16_rep(p, v, c) ioread16_rep(p, v, c) static inline void ioread16_rep(const void __iomem *addr, void *vaddr, u32 count) @@ -415,6 +429,21 @@ static inline unsigned int ioread32(cons } } +#define ioread32be(p) ioread32be(p) +static inline unsigned int ioread32be(const void __iomem *addr) +{ + unsigned long port = (unsigned long __force)addr; + if (__is_io_address(port)) + return (unsigned int)inl(port & PIO_MASK); + else { +#ifndef CONFIG_IXP4XX_INDIRECT_PCI + return be32_to_cpu((__force __be32)__raw_readl(addr)); +#else + return be32_to_cpu((__force __be32)(unsigned int)__indirect_readl(addr)); +#endif + } +} + #define ioread32_rep(p, v, c) ioread32_rep(p, v, c) static inline void ioread32_rep(const void __iomem *addr, void *vaddr, u32 count) @@ -473,6 +502,20 @@ static inline void iowrite16(u16 value, #endif } +#define iowrite16be(v, p) iowrite16be(v, p) +static inline void iowrite16be(u16 value, void __iomem *addr) +{ + unsigned long port = (unsigned long __force)addr; + if (__is_io_address(port)) + outw(value, port & PIO_MASK); + else +#ifndef CONFIG_IXP4XX_INDIRECT_PCI + __raw_writew(cpu_to_be16(value), addr); +#else + __indirect_writew(cpu_to_be16(value), addr); +#endif +} + #define iowrite16_rep(p, v, c) iowrite16_rep(p, v, c) static inline void iowrite16_rep(void __iomem *addr, const void *vaddr, u32 count) @@ -502,6 +545,20 @@ static inline void iowrite32(u32 value, #endif } +#define iowrite32be(v, p) iowrite32be(v, p) +static inline void iowrite32be(u32 value, void __iomem *addr) +{ + unsigned long port = (unsigned long __force)addr; + if (__is_io_address(port)) + outl(value, port & PIO_MASK); + else +#ifndef CONFIG_IXP4XX_INDIRECT_PCI + __raw_writel((u32 __force)cpu_to_be32(value), addr); +#else + __indirect_writel((u32 __force)cpu_to_be32(value), addr); +#endif +} + #define iowrite32_rep(p, v, c) iowrite32_rep(p, v, c) static inline void iowrite32_rep(void __iomem *addr, const void *vaddr, u32 count)