30 #include <linux/slab.h>
34 static void dwmac1000_core_init(
void __iomem *ioaddr)
43 #ifdef STMMAC_VLAN_TAG_USED
49 static int dwmac1000_rx_ipc_enable(
void __iomem *ioaddr)
61 static void dwmac1000_dump_regs(
void __iomem *ioaddr)
64 pr_info(
"\tDWMAC1000 regs (base addr = 0x%p)\n", ioaddr);
66 for (i = 0; i < 55; i++) {
68 pr_info(
"\tReg No. %d (offset 0x%x): 0x%08x\n", i,
69 offset,
readl(ioaddr + offset));
73 static void dwmac1000_set_umac_addr(
void __iomem *ioaddr,
unsigned char *
addr,
80 static void dwmac1000_get_umac_addr(
void __iomem *ioaddr,
unsigned char *addr,
87 static void dwmac1000_set_filter(
struct net_device *
dev,
int id)
90 unsigned int value = 0;
91 unsigned int perfect_addr_number;
110 memset(mc_filter, 0,
sizeof(mc_filter));
119 mc_filter[bit_nr >> 5] |= 1 << (bit_nr & 31);
141 dwmac1000_set_umac_addr(ioaddr, ha->
addr, reg);
146 #ifdef FRAME_FILTER_DEBUG
157 static void dwmac1000_flow_ctrl(
void __iomem *ioaddr,
unsigned int duplex,
158 unsigned int fc,
unsigned int pause_time)
160 unsigned int flow = 0;
180 static void dwmac1000_pmt(
void __iomem *ioaddr,
unsigned long mode)
182 unsigned int pmt = 0;
251 static void dwmac1000_set_eee_mode(
void __iomem *ioaddr)
263 static void dwmac1000_reset_eee_mode(
void __iomem *ioaddr)
272 static void dwmac1000_set_eee_pls(
void __iomem *ioaddr,
int link)
286 static void dwmac1000_set_eee_timer(
void __iomem *ioaddr,
int ls,
int tw)
288 int value = ((tw & 0xffff)) | ((ls & 0x7ff) << 16);
300 static const struct stmmac_ops dwmac1000_ops = {
301 .core_init = dwmac1000_core_init,
302 .rx_ipc = dwmac1000_rx_ipc_enable,
303 .dump_regs = dwmac1000_dump_regs,
305 .set_filter = dwmac1000_set_filter,
306 .flow_ctrl = dwmac1000_flow_ctrl,
307 .pmt = dwmac1000_pmt,
308 .set_umac_addr = dwmac1000_set_umac_addr,
309 .get_umac_addr = dwmac1000_get_umac_addr,
310 .set_eee_mode = dwmac1000_set_eee_mode,
311 .reset_eee_mode = dwmac1000_reset_eee_mode,
312 .set_eee_timer = dwmac1000_set_eee_timer,
313 .set_eee_pls = dwmac1000_set_eee_pls,
325 mac->
mac = &dwmac1000_ops;