--- /dev/null
+--- a/drivers/net/ethernet/atheros/ar231x/ar231x.h
++++ b/drivers/net/ethernet/atheros/ar231x/ar231x.h
+@@ -26,16 +26,9 @@
+ /* probe link timer - 5 secs */
+ #define LINK_TIMER (5*HZ)
+
+-#define IS_DMA_TX_INT(X) (((X) & (DMA_STATUS_TI)) != 0)
+-#define IS_DMA_RX_INT(X) (((X) & (DMA_STATUS_RI)) != 0)
+-#define IS_DRIVER_OWNED(X) (((X) & (DMA_TX_OWN)) == 0)
+-
+ #define ath25_dma_cache_inv(_start,_size) do { } while (0)
+
+-#define AR2313_TX_TIMEOUT (HZ/4)
+-
+ /* Rings */
+-#define DSC_RING_ENTRIES_SIZE (AR2313_DESCR_ENTRIES * sizeof(struct desc))
+ #define DSC_NEXT(idx) ((idx + 1) & (AR2313_DESCR_ENTRIES - 1))
+
+ #define AR2313_MBGET 2
+@@ -273,9 +266,7 @@ struct ar231x_private {
+
+ /* Prototypes */
+ static int ar231x_init(struct net_device *dev);
+-#ifdef TX_TIMEOUT
+ static void ar231x_tx_timeout(struct net_device *dev);
+-#endif
+ static int ar231x_restart(struct net_device *dev);
+ static void ar231x_load_rx_ring(struct net_device *dev, int bufs);
+ static irqreturn_t ar231x_interrupt(int irq, void *dev_id);
+--- a/drivers/net/ethernet/atheros/ar231x/ar231x.c
++++ b/drivers/net/ethernet/atheros/ar231x/ar231x.c
+@@ -40,16 +40,10 @@
+ #define AR2313_QUEUES (2*AR2313_PRIOS)
+ #define AR2313_DESCR_ENTRIES 64
+
+-#ifndef min
+-#define min(a, b) (((a) < (b)) ? (a) : (b))
+-#endif
+-
+ #ifndef SMP_CACHE_BYTES
+ #define SMP_CACHE_BYTES L1_CACHE_BYTES
+ #endif
+
+-#define AR2313_MBOX_SET_BIT 0x8
+-
+ #include "ar231x.h"
+
+ /**
+@@ -101,8 +95,6 @@
+ * cache.
+ */
+ #define RX_RING_SIZE AR2313_DESCR_ENTRIES
+-#define RX_PANIC_THRES (RX_RING_SIZE/4)
+-#define RX_LOW_THRES ((3*RX_RING_SIZE)/4)
+ #define CRC_LEN 4
+ #define RX_OFFSET 2
+
--- /dev/null
+--- a/drivers/net/ethernet/atheros/ar231x/ar231x.h
++++ b/drivers/net/ethernet/atheros/ar231x/ar231x.h
+@@ -23,6 +23,38 @@
+ #include <linux/bitops.h>
+ #include <ath25_platform.h>
+
++#define AR2313_MTU 1692
++#define AR2313_PRIOS 1
++#define AR2313_QUEUES (2*AR2313_PRIOS)
++#define AR2313_DESCR_ENTRIES 64
++#define AR2313_MAX_PKTS_PER_CALL 64
++
++#ifndef SMP_CACHE_BYTES
++#define SMP_CACHE_BYTES L1_CACHE_BYTES
++#endif
++
++#define RX_RING_SIZE AR2313_DESCR_ENTRIES
++#define CRC_LEN 4
++#define RX_OFFSET 2
++
++#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
++#define VLAN_HDR 4
++#else
++#define VLAN_HDR 0
++#endif
++
++#define AR2313_BUFSIZE (AR2313_MTU + VLAN_HDR + ETH_HLEN + CRC_LEN + \
++ RX_OFFSET)
++
++#define MII_ADDR(phy, reg) \
++ ((reg << MII_ADDR_REG_SHIFT) | (phy << MII_ADDR_PHY_SHIFT))
++
++#define virt_to_phys(x) ((u32)(x) & 0x1fffffff)
++
++#ifndef ERR
++#define ERR(fmt, args...) printk("%s: " fmt, __func__, ##args)
++#endif
++
+ /* probe link timer - 5 secs */
+ #define LINK_TIMER (5*HZ)
+
+--- a/drivers/net/ethernet/atheros/ar231x/ar231x.c
++++ b/drivers/net/ethernet/atheros/ar231x/ar231x.c
+@@ -35,15 +35,6 @@
+ #include <linux/platform_device.h>
+ #include <linux/io.h>
+
+-#define AR2313_MTU 1692
+-#define AR2313_PRIOS 1
+-#define AR2313_QUEUES (2*AR2313_PRIOS)
+-#define AR2313_DESCR_ENTRIES 64
+-
+-#ifndef SMP_CACHE_BYTES
+-#define SMP_CACHE_BYTES L1_CACHE_BYTES
+-#endif
+-
+ #include "ar231x.h"
+
+ /**
+@@ -94,27 +85,13 @@
+ * one running the interrupt handler just got the slab code hot in its
+ * cache.
+ */
+-#define RX_RING_SIZE AR2313_DESCR_ENTRIES
+-#define CRC_LEN 4
+-#define RX_OFFSET 2
+-
+-#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
+-#define VLAN_HDR 4
+-#else
+-#define VLAN_HDR 0
+-#endif
+-
+-#define AR2313_BUFSIZE (AR2313_MTU + VLAN_HDR + ETH_HLEN + CRC_LEN + \
+- RX_OFFSET)
+
+ #ifdef MODULE
+ MODULE_LICENSE("GPL");
+-MODULE_AUTHOR("Sameer Dekate <sdekate@arubanetworks.com>, Imre Kaloz <kaloz@openwrt.org>, Felix Fietkau <nbd@openwrt.org>");
++MODULE_AUTHOR("Sameer Dekate <sdekate@arubanetworks.com>, Imre Kaloz <kaloz@openwrt.org>, Felix Fietkau <nbd@openwrt.org>, Alexandros C. Couloumbis <alex@ozo.com>");
+ MODULE_DESCRIPTION("AR231x Ethernet driver");
+ #endif
+
+-#define virt_to_phys(x) ((u32)(x) & 0x1fffffff)
+-
+ /* prototypes */
+ static void ar231x_halt(struct net_device *dev);
+ static void rx_tasklet_func(unsigned long data);
+@@ -129,10 +106,6 @@ static int ar231x_mdiobus_reset(struct m
+ static int ar231x_mdiobus_probe(struct net_device *dev);
+ static void ar231x_adjust_link(struct net_device *dev);
+
+-#ifndef ERR
+-#define ERR(fmt, args...) printk("%s: " fmt, __func__, ##args)
+-#endif
+-
+ #ifdef CONFIG_NET_POLL_CONTROLLER
+ static void
+ ar231x_netpoll(struct net_device *dev)
+@@ -749,8 +722,6 @@ static void ar231x_load_rx_ring(struct n
+ sp->rx_skbprd = idx;
+ }
+
+-#define AR2313_MAX_PKTS_PER_CALL 64
+-
+ static int ar231x_rx_int(struct net_device *dev)
+ {
+ struct ar231x_private *sp = netdev_priv(dev);
+@@ -1123,9 +1094,6 @@ static void ar231x_adjust_link(struct ne
+ }
+ }
+
+-#define MII_ADDR(phy, reg) \
+- ((reg << MII_ADDR_REG_SHIFT) | (phy << MII_ADDR_PHY_SHIFT))
+-
+ static int
+ ar231x_mdiobus_read(struct mii_bus *bus, int phy_addr, int regnum)
+ {
--- /dev/null
+--- a/drivers/net/ethernet/atheros/ar231x/ar231x.h
++++ b/drivers/net/ethernet/atheros/ar231x/ar231x.h
+@@ -176,10 +176,10 @@
+ #define DMA_CONTROL_SF BIT(21) /* store and forward */
+
+ typedef struct {
+- volatile unsigned int status; /* OWN, Device control and status. */
+- volatile unsigned int devcs; /* pkt Control bits + Length */
+- volatile unsigned int addr; /* Current Address. */
+- volatile unsigned int descr; /* Next descriptor in chain. */
++ volatile u32 status; /* OWN, Device control and status. */
++ volatile u32 devcs; /* pkt Control bits + Length */
++ volatile u32 addr; /* Current Address. */
++ volatile u32 descr; /* Next descriptor in chain. */
+ } ar231x_descr_t;
+
+ /**
+@@ -189,20 +189,20 @@ typedef struct {
+ * connected to another ethernet block.
+ */
+ typedef struct {
+- volatile unsigned int mac_control; /* 0x00 */
+- volatile unsigned int mac_addr[2]; /* 0x04 - 0x08 */
+- volatile unsigned int mcast_table[2]; /* 0x0c - 0x10 */
+- volatile unsigned int __mii_addr; /* 0x14 */
+- volatile unsigned int __mii_data; /* 0x18 */
+- volatile unsigned int flow_control; /* 0x1c */
+- volatile unsigned int vlan_tag; /* 0x20 */
+- volatile unsigned int pad[7]; /* 0x24 - 0x3c */
+- volatile unsigned int ucast_table[8]; /* 0x40-0x5c */
++ volatile u32 mac_control; /* 0x00 */
++ volatile u32 mac_addr[2]; /* 0x04 - 0x08 */
++ volatile u32 mcast_table[2]; /* 0x0c - 0x10 */
++ volatile u32 __mii_addr; /* 0x14 */
++ volatile u32 __mii_data; /* 0x18 */
++ volatile u32 flow_control; /* 0x1c */
++ volatile u32 vlan_tag; /* 0x20 */
++ volatile u32 pad[7]; /* 0x24 - 0x3c */
++ volatile u32 ucast_table[8]; /* 0x40-0x5c */
+ } ETHERNET_STRUCT;
+
+ typedef struct {
+- volatile unsigned int mii_addr;
+- volatile unsigned int mii_data;
++ volatile u32 mii_addr;
++ volatile u32 mii_data;
+ } MII;
+
+ /********************************************************************
+@@ -210,31 +210,31 @@ typedef struct {
+ ********************************************************************/
+
+ typedef struct {
+- volatile unsigned int wdog_control; /* 0x08 */
+- volatile unsigned int wdog_timer; /* 0x0c */
+- volatile unsigned int misc_status; /* 0x10 */
+- volatile unsigned int misc_mask; /* 0x14 */
+- volatile unsigned int global_status; /* 0x18 */
+- volatile unsigned int reserved; /* 0x1c */
+- volatile unsigned int reset_control; /* 0x20 */
++ volatile u32 wdog_control; /* 0x08 */
++ volatile u32 wdog_timer; /* 0x0c */
++ volatile u32 misc_status; /* 0x10 */
++ volatile u32 misc_mask; /* 0x14 */
++ volatile u32 global_status; /* 0x18 */
++ volatile u32 reserved; /* 0x1c */
++ volatile u32 reset_control; /* 0x20 */
+ } INTERRUPT;
+
+ /********************************************************************
+ * DMA controller
+ ********************************************************************/
+ typedef struct {
+- volatile unsigned int bus_mode; /* 0x00 (CSR0) */
+- volatile unsigned int xmt_poll; /* 0x04 (CSR1) */
+- volatile unsigned int rcv_poll; /* 0x08 (CSR2) */
+- volatile unsigned int rcv_base; /* 0x0c (CSR3) */
+- volatile unsigned int xmt_base; /* 0x10 (CSR4) */
+- volatile unsigned int status; /* 0x14 (CSR5) */
+- volatile unsigned int control; /* 0x18 (CSR6) */
+- volatile unsigned int intr_ena; /* 0x1c (CSR7) */
+- volatile unsigned int rcv_missed; /* 0x20 (CSR8) */
+- volatile unsigned int reserved[11]; /* 0x24-0x4c (CSR9-19) */
+- volatile unsigned int cur_tx_buf_addr; /* 0x50 (CSR20) */
+- volatile unsigned int cur_rx_buf_addr; /* 0x50 (CSR21) */
++ volatile u32 bus_mode; /* 0x00 (CSR0) */
++ volatile u32 xmt_poll; /* 0x04 (CSR1) */
++ volatile u32 rcv_poll; /* 0x08 (CSR2) */
++ volatile u32 rcv_base; /* 0x0c (CSR3) */
++ volatile u32 xmt_base; /* 0x10 (CSR4) */
++ volatile u32 status; /* 0x14 (CSR5) */
++ volatile u32 control; /* 0x18 (CSR6) */
++ volatile u32 intr_ena; /* 0x1c (CSR7) */
++ volatile u32 rcv_missed; /* 0x20 (CSR8) */
++ volatile u32 reserved[11]; /* 0x24-0x4c (CSR9-19) */
++ volatile u32 cur_tx_buf_addr; /* 0x50 (CSR20) */
++ volatile u32 cur_rx_buf_addr; /* 0x50 (CSR21) */
+ } DMA;
+
+ /**
+--- a/drivers/net/ethernet/atheros/ar231x/ar231x.c
++++ b/drivers/net/ethernet/atheros/ar231x/ar231x.c
+@@ -275,7 +275,7 @@ static int ar231x_probe(struct platform_
+ static void ar231x_multicast_list(struct net_device *dev)
+ {
+ struct ar231x_private *sp = netdev_priv(dev);
+- unsigned int filter;
++ u32 filter;
+
+ filter = sp->eth_regs->mac_control;
+
+@@ -376,7 +376,7 @@ static int ar231x_allocate_descriptors(s
+ return 1;
+
+ /* invalidate caches */
+- ath25_dma_cache_inv((unsigned int)space, size);
++ ath25_dma_cache_inv((u32)space, size);
+
+ /* now convert pointer to KSEG1 */
+ space = (ar231x_descr_t *)KSEG1ADDR(space);
+@@ -536,8 +536,8 @@ static void ar231x_check_link(struct net
+ static int ar231x_reset_reg(struct net_device *dev)
+ {
+ struct ar231x_private *sp = netdev_priv(dev);
+- unsigned int ethsal, ethsah;
+- unsigned int flags;
++ u32 ethsal, ethsah;
++ u32 flags;
+
+ sp->cfg->reset_set(sp->cfg->reset_mac);
+ mdelay(10);
+@@ -727,7 +727,7 @@ static int ar231x_rx_int(struct net_devi
+ struct ar231x_private *sp = netdev_priv(dev);
+ struct sk_buff *skb, *skb_new;
+ ar231x_descr_t *rxdesc;
+- unsigned int status;
++ u32 status;
+ u32 idx;
+ int pkts = 0;
+ int rval;
+@@ -810,7 +810,7 @@ static void ar231x_tx_int(struct net_dev
+ u32 idx;
+ struct sk_buff *skb;
+ ar231x_descr_t *txdesc;
+- unsigned int status = 0;
++ u32 status = 0;
+
+ idx = sp->tx_csm;
+
+@@ -887,7 +887,7 @@ static irqreturn_t ar231x_interrupt(int
+ {
+ struct net_device *dev = (struct net_device *)dev_id;
+ struct ar231x_private *sp = netdev_priv(dev);
+- unsigned int status, enabled;
++ u32 status, enabled;
+
+ /* clear interrupt */
+ /* Don't clear RI bit if currently disabled */
+@@ -921,7 +921,7 @@ static irqreturn_t ar231x_interrupt(int
+ static int ar231x_open(struct net_device *dev)
+ {
+ struct ar231x_private *sp = netdev_priv(dev);
+- unsigned int ethsal, ethsah;
++ u32 ethsal, ethsah;
+
+ /* reset the hardware, in case the MAC address changed */
+ ethsah = (((u_int) (dev->dev_addr[5]) << 8) & (u_int) 0x0000FF00) |
+@@ -1077,7 +1077,7 @@ static int ar231x_ioctl(struct net_devic
+ static void ar231x_adjust_link(struct net_device *dev)
+ {
+ struct ar231x_private *sp = netdev_priv(dev);
+- unsigned int mc;
++ u32 mc;
+
+ if (!sp->phy_dev->link)
+ return;