13 #include <linux/module.h>
14 #include <linux/kernel.h>
15 #include <linux/errno.h>
18 #include <linux/netdevice.h>
28 #define NE_DATAPORT 0x10
30 #define NE_EN0_ISR 0x07
31 #define NE_EN0_DCFG 0x0e
32 #define NE_EN0_RSARLO 0x08
33 #define NE_EN0_RSARHI 0x09
34 #define NE_EN0_RCNTLO 0x0a
35 #define NE_EN0_RXCR 0x0c
36 #define NE_EN0_TXCR 0x0d
37 #define NE_EN0_RCNTHI 0x0b
38 #define NE_EN0_IMR 0x0f
40 #define NESM_START_PG 0x40
41 #define NESM_STOP_PG 0x80
43 #ifdef NE2000_ODDOFFSET
53 return addr - 1 + NE2000_ODDOFFSET;
66 rp = (NE2000_BYTE *) NE_PTR(addr);
75 rp = (NE2000_BYTE *) NE_PTR(addr);
77 return (
u8) (
RSWAP(val) & 0xff);
86 rp = (NE2000_BYTE *) NE_DATA_PTR(addr);
87 for (; (len > 0); len--) {
99 rp = (
volatile u16 *) NE_DATA_PTR(addr);
100 for (; (len > 0); len--) {
108 NE2000_BYTE *
rp,
val;
112 rp = (NE2000_BYTE *) NE_DATA_PTR(addr);
113 for (; (len > 0); len--) {
125 rp = (
volatile u16 *) NE_DATA_PTR(addr);
126 for (; (len > 0); len--) {
138 #define ei_outsb outsb
139 #define ei_outsw outsw
143 #define ei_inb_p ei_inb
144 #define ei_outb_p ei_outb
154 unsigned long reset_start_time =
jiffies;
168 netdev_warn(dev,
"%s: did not complete\n", __func__);
183 netdev_err(dev,
"%s: DMAing conflict [DMAstat:%d][irqlock:%d]\n",
195 struct ei_device *ei_local = netdev_priv(dev);
199 mcf8390_dmaing_err(__func__, dev, ei_local);
215 ei_local->
dmaing &= ~0x01;
230 struct ei_device *ei_local = netdev_priv(dev);
232 char *buf = skb->
data;
235 mcf8390_dmaing_err(__func__, dev, ei_local);
253 ei_local->
dmaing &= ~0x01;
256 static void mcf8390_block_output(
struct net_device *dev,
int count,
257 const unsigned char *buf,
258 const int start_page)
260 struct ei_device *ei_local = netdev_priv(dev);
269 mcf8390_dmaing_err(__func__, dev, ei_local);
291 netdev_err(dev,
"timeout waiting for Tx RDC\n");
292 mcf8390_reset_8390(dev);
299 ei_local->
dmaing &= ~0x01;
312 #ifdef CONFIG_NET_POLL_CONTROLLER
317 static int mcf8390_init(
struct net_device *dev)
320 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
321 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
323 struct ei_device *ei_local = netdev_priv(dev);
324 unsigned char SA_prom[32];
329 mcf8390_reset_8390(dev);
339 static const struct {
358 for (i = 0; i <
ARRAY_SIZE(program_seq); i++) {
360 addr + program_seq[i].
offset);
364 for (i = 0; i < 16; i++) {
384 ei_local->
name =
"mcf8390";
403 netdev_info(dev,
"addr=0x%08x irq=%d, Ethernet Address %pM\n",
424 dev_err(&pdev->
dev,
"no memory address specified?\n");
427 msize = resource_size(mem);
438 platform_set_drvdata(pdev, dev);
439 ei_local = netdev_priv(dev);
444 ret = mcf8390_init(dev);
455 struct net_device *dev = platform_get_drvdata(pdev);
471 .probe = mcf8390_probe,
472 .remove = mcf8390_remove,