aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/stmmac/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/stmmac/common.h')
-rw-r--r--drivers/net/stmmac/common.h55
1 files changed, 27 insertions, 28 deletions
diff --git a/drivers/net/stmmac/common.h b/drivers/net/stmmac/common.h
index 66b9da0260fe..dec7ce40c27a 100644
--- a/drivers/net/stmmac/common.h
+++ b/drivers/net/stmmac/common.h
@@ -102,8 +102,6 @@ struct stmmac_extra_stats {
102 102
103#define SF_DMA_MODE 1 /* DMA STORE-AND-FORWARD Operation Mode */ 103#define SF_DMA_MODE 1 /* DMA STORE-AND-FORWARD Operation Mode */
104 104
105#define HW_CSUM 1
106#define NO_HW_CSUM 0
107enum rx_frame_status { /* IPC status */ 105enum rx_frame_status { /* IPC status */
108 good_frame = 0, 106 good_frame = 0,
109 discard_frame = 1, 107 discard_frame = 1,
@@ -167,7 +165,7 @@ struct stmmac_desc_ops {
167 int (*get_tx_ls) (struct dma_desc *p); 165 int (*get_tx_ls) (struct dma_desc *p);
168 /* Return the transmit status looking at the TDES1 */ 166 /* Return the transmit status looking at the TDES1 */
169 int (*tx_status) (void *data, struct stmmac_extra_stats *x, 167 int (*tx_status) (void *data, struct stmmac_extra_stats *x,
170 struct dma_desc *p, unsigned long ioaddr); 168 struct dma_desc *p, void __iomem *ioaddr);
171 /* Get the buffer size from the descriptor */ 169 /* Get the buffer size from the descriptor */
172 int (*get_tx_len) (struct dma_desc *p); 170 int (*get_tx_len) (struct dma_desc *p);
173 /* Handle extra events on specific interrupts hw dependent */ 171 /* Handle extra events on specific interrupts hw dependent */
@@ -182,44 +180,46 @@ struct stmmac_desc_ops {
182 180
183struct stmmac_dma_ops { 181struct stmmac_dma_ops {
184 /* DMA core initialization */ 182 /* DMA core initialization */
185 int (*init) (unsigned long ioaddr, int pbl, u32 dma_tx, u32 dma_rx); 183 int (*init) (void __iomem *ioaddr, int pbl, u32 dma_tx, u32 dma_rx);
186 /* Dump DMA registers */ 184 /* Dump DMA registers */
187 void (*dump_regs) (unsigned long ioaddr); 185 void (*dump_regs) (void __iomem *ioaddr);
188 /* Set tx/rx threshold in the csr6 register 186 /* Set tx/rx threshold in the csr6 register
189 * An invalid value enables the store-and-forward mode */ 187 * An invalid value enables the store-and-forward mode */
190 void (*dma_mode) (unsigned long ioaddr, int txmode, int rxmode); 188 void (*dma_mode) (void __iomem *ioaddr, int txmode, int rxmode);
191 /* To track extra statistic (if supported) */ 189 /* To track extra statistic (if supported) */
192 void (*dma_diagnostic_fr) (void *data, struct stmmac_extra_stats *x, 190 void (*dma_diagnostic_fr) (void *data, struct stmmac_extra_stats *x,
193 unsigned long ioaddr); 191 void __iomem *ioaddr);
194 void (*enable_dma_transmission) (unsigned long ioaddr); 192 void (*enable_dma_transmission) (void __iomem *ioaddr);
195 void (*enable_dma_irq) (unsigned long ioaddr); 193 void (*enable_dma_irq) (void __iomem *ioaddr);
196 void (*disable_dma_irq) (unsigned long ioaddr); 194 void (*disable_dma_irq) (void __iomem *ioaddr);
197 void (*start_tx) (unsigned long ioaddr); 195 void (*start_tx) (void __iomem *ioaddr);
198 void (*stop_tx) (unsigned long ioaddr); 196 void (*stop_tx) (void __iomem *ioaddr);
199 void (*start_rx) (unsigned long ioaddr); 197 void (*start_rx) (void __iomem *ioaddr);
200 void (*stop_rx) (unsigned long ioaddr); 198 void (*stop_rx) (void __iomem *ioaddr);
201 int (*dma_interrupt) (unsigned long ioaddr, 199 int (*dma_interrupt) (void __iomem *ioaddr,
202 struct stmmac_extra_stats *x); 200 struct stmmac_extra_stats *x);
203}; 201};
204 202
205struct stmmac_ops { 203struct stmmac_ops {
206 /* MAC core initialization */ 204 /* MAC core initialization */
207 void (*core_init) (unsigned long ioaddr) ____cacheline_aligned; 205 void (*core_init) (void __iomem *ioaddr) ____cacheline_aligned;
206 /* Support checksum offload engine */
207 int (*rx_coe) (void __iomem *ioaddr);
208 /* Dump MAC registers */ 208 /* Dump MAC registers */
209 void (*dump_regs) (unsigned long ioaddr); 209 void (*dump_regs) (void __iomem *ioaddr);
210 /* Handle extra events on specific interrupts hw dependent */ 210 /* Handle extra events on specific interrupts hw dependent */
211 void (*host_irq_status) (unsigned long ioaddr); 211 void (*host_irq_status) (void __iomem *ioaddr);
212 /* Multicast filter setting */ 212 /* Multicast filter setting */
213 void (*set_filter) (struct net_device *dev); 213 void (*set_filter) (struct net_device *dev);
214 /* Flow control setting */ 214 /* Flow control setting */
215 void (*flow_ctrl) (unsigned long ioaddr, unsigned int duplex, 215 void (*flow_ctrl) (void __iomem *ioaddr, unsigned int duplex,
216 unsigned int fc, unsigned int pause_time); 216 unsigned int fc, unsigned int pause_time);
217 /* Set power management mode (e.g. magic frame) */ 217 /* Set power management mode (e.g. magic frame) */
218 void (*pmt) (unsigned long ioaddr, unsigned long mode); 218 void (*pmt) (void __iomem *ioaddr, unsigned long mode);
219 /* Set/Get Unicast MAC addresses */ 219 /* Set/Get Unicast MAC addresses */
220 void (*set_umac_addr) (unsigned long ioaddr, unsigned char *addr, 220 void (*set_umac_addr) (void __iomem *ioaddr, unsigned char *addr,
221 unsigned int reg_n); 221 unsigned int reg_n);
222 void (*get_umac_addr) (unsigned long ioaddr, unsigned char *addr, 222 void (*get_umac_addr) (void __iomem *ioaddr, unsigned char *addr,
223 unsigned int reg_n); 223 unsigned int reg_n);
224}; 224};
225 225
@@ -238,16 +238,15 @@ struct mac_device_info {
238 struct stmmac_ops *mac; 238 struct stmmac_ops *mac;
239 struct stmmac_desc_ops *desc; 239 struct stmmac_desc_ops *desc;
240 struct stmmac_dma_ops *dma; 240 struct stmmac_dma_ops *dma;
241 unsigned int pmt; /* support Power-Down */
242 struct mii_regs mii; /* MII register Addresses */ 241 struct mii_regs mii; /* MII register Addresses */
243 struct mac_link link; 242 struct mac_link link;
244}; 243};
245 244
246struct mac_device_info *dwmac1000_setup(unsigned long addr); 245struct mac_device_info *dwmac1000_setup(void __iomem *ioaddr);
247struct mac_device_info *dwmac100_setup(unsigned long addr); 246struct mac_device_info *dwmac100_setup(void __iomem *ioaddr);
248 247
249extern void stmmac_set_mac_addr(unsigned long ioaddr, u8 addr[6], 248extern void stmmac_set_mac_addr(void __iomem *ioaddr, u8 addr[6],
250 unsigned int high, unsigned int low); 249 unsigned int high, unsigned int low);
251extern void stmmac_get_mac_addr(unsigned long ioaddr, unsigned char *addr, 250extern void stmmac_get_mac_addr(void __iomem *ioaddr, unsigned char *addr,
252 unsigned int high, unsigned int low); 251 unsigned int high, unsigned int low);
253extern void dwmac_dma_flush_tx_fifo(unsigned long ioaddr); 252extern void dwmac_dma_flush_tx_fifo(void __iomem *ioaddr);