X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/b10ad5f4e073c01e80d4fadf4fcc757feb44b2f9..1e38789510260b1a4b1502c754e9abdb27b5ac8d:/target/linux/ramips/files/drivers/net/ramips_eth.h diff --git a/target/linux/ramips/files/drivers/net/ramips_eth.h b/target/linux/ramips/files/drivers/net/ramips_eth.h index ecf8d7723..7d5296b21 100644 --- a/target/linux/ramips/files/drivers/net/ramips_eth.h +++ b/target/linux/ramips/files/drivers/net/ramips_eth.h @@ -22,6 +22,7 @@ #include #include #include +#include #define NUM_RX_DESC 256 #define NUM_TX_DESC 256 @@ -185,7 +186,7 @@ #define RAMIPS_US_CYC_CNT_SHIFT 0x8 #define RAMIPS_US_CYC_CNT_DIVISOR 1000000 -#define RX_DMA_PLEN0(x) ((x >> 16) & 0x3fff) +#define RX_DMA_PLEN0(_x) (((_x) >> 16) & 0x3fff) #define RX_DMA_LSO BIT(30) #define RX_DMA_DONE BIT(31) @@ -197,11 +198,11 @@ struct ramips_rx_dma { }; #define TX_DMA_PLEN0_MASK ((0x3fff) << 16) -#define TX_DMA_PLEN0(x) ((x & 0x3fff) << 16) +#define TX_DMA_PLEN0(_x) (((_x) & 0x3fff) << 16) #define TX_DMA_LSO BIT(30) #define TX_DMA_DONE BIT(31) -#define TX_DMA_QN(x) (x << 16) -#define TX_DMA_PN(x) (x << 24) +#define TX_DMA_QN(_x) ((_x) << 16) +#define TX_DMA_PN(_x) ((_x) << 24) #define TX_DMA_QN_MASK TX_DMA_QN(0x7) #define TX_DMA_PN_MASK TX_DMA_PN(0x7) @@ -214,12 +215,13 @@ struct ramips_tx_dma { struct raeth_priv { - unsigned int phy_rx; + dma_addr_t rx_desc_dma; struct tasklet_struct rx_tasklet; struct ramips_rx_dma *rx; struct sk_buff *rx_skb[NUM_RX_DESC]; + dma_addr_t rx_dma[NUM_RX_DESC]; - unsigned int phy_tx; + dma_addr_t tx_desc_dma; struct tasklet_struct tx_housekeeping_tasklet; struct ramips_tx_dma *tx; struct sk_buff *tx_skb[NUM_TX_DESC];