summaryrefslogtreecommitdiffstats
path: root/src/drivers/net/realtek.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers/net/realtek.h')
-rw-r--r--src/drivers/net/realtek.h42
1 files changed, 35 insertions, 7 deletions
diff --git a/src/drivers/net/realtek.h b/src/drivers/net/realtek.h
index 4d13784c4..c7cb7e422 100644
--- a/src/drivers/net/realtek.h
+++ b/src/drivers/net/realtek.h
@@ -247,6 +247,8 @@ enum realtek_legacy_status {
struct realtek_ring {
/** Descriptors */
struct realtek_descriptor *desc;
+ /** Descriptor ring DMA mapping */
+ struct dma_mapping map;
/** Producer index */
unsigned int prod;
/** Consumer index */
@@ -272,10 +274,40 @@ realtek_init_ring ( struct realtek_ring *ring, unsigned int count,
ring->reg = reg;
}
+/** Transmit ring */
+struct realtek_tx_ring {
+ /** Descriptor ring */
+ struct realtek_ring ring;
+ /** DMA mappings */
+ struct dma_mapping map[RTL_NUM_TX_DESC];
+};
+
+/** Receive ring */
+struct realtek_rx_ring {
+ /** Descriptor ring */
+ struct realtek_ring ring;
+ /** I/O buffers */
+ struct io_buffer *iobuf[RTL_NUM_RX_DESC];
+ /** DMA mappings */
+ struct dma_mapping map[RTL_NUM_RX_DESC];
+};
+
+/** Receive buffer (legacy mode *) */
+struct realtek_rx_buffer {
+ /** Buffer */
+ void *data;
+ /** Buffer DMA mapping */
+ struct dma_mapping map;
+ /** Offset within buffer */
+ unsigned int offset;
+};
+
/** A Realtek network card */
struct realtek_nic {
/** Registers */
void *regs;
+ /** DMA device */
+ struct dma_device *dma;
/** SPI bit-bashing interface */
struct spi_bit_basher spibit;
/** EEPROM */
@@ -295,15 +327,11 @@ struct realtek_nic {
unsigned int tppoll;
/** Transmit descriptor ring */
- struct realtek_ring tx;
+ struct realtek_tx_ring tx;
/** Receive descriptor ring */
- struct realtek_ring rx;
- /** Receive I/O buffers */
- struct io_buffer *rx_iobuf[RTL_NUM_RX_DESC];
+ struct realtek_rx_ring rx;
/** Receive buffer (legacy mode) */
- void *rx_buffer;
- /** Offset within receive buffer (legacy mode) */
- unsigned int rx_offset;
+ struct realtek_rx_buffer rxbuf;
};
#endif /* _REALTEK_H */