19 #include <linux/kernel.h>
20 #include <linux/module.h>
21 #include <linux/types.h>
22 #include <linux/fcntl.h>
28 #include <linux/string.h>
30 #include <linux/errno.h>
31 #include <linux/netdevice.h>
36 #include <linux/slab.h>
39 #include <asm/pgtable.h>
42 static char xtsonic_string[] =
"xtsonic";
59 #define SONIC_RBSIZE 1524
64 #define SONIC_MEM_SIZE 0x100
69 #define SONIC_READ(reg) \
70 (0xffff & *((volatile unsigned int *)dev->base_addr+reg))
72 #define SONIC_WRITE(reg,val) \
73 *((volatile unsigned int *)dev->base_addr+reg) = val
78 static unsigned int sonic_debug = SONIC_DEBUG;
80 static unsigned int sonic_debug = 1;
88 static unsigned short known_revisions[] =
106 retval = sonic_open(dev);
112 static int xtsonic_close(
struct net_device *dev)
115 err = sonic_close(dev);
121 .ndo_open = xtsonic_open,
122 .ndo_stop = xtsonic_close,
123 .ndo_start_xmit = sonic_send_packet,
124 .ndo_get_stats = sonic_get_stats,
125 .ndo_set_rx_mode = sonic_multicast_list,
126 .ndo_tx_timeout = sonic_tx_timeout,
134 static unsigned version_printed = 0;
135 unsigned int silicon_revision;
151 printk(
"SONIC Silicon Revision = 0x%04x\n",silicon_revision);
154 while ((known_revisions[i] != 0xffff) &&
155 (known_revisions[i] != silicon_revision))
158 if (known_revisions[i] == 0xffff) {
159 printk(
"SONIC ethernet controller not found (0x%4x)\n",
164 if (sonic_debug && version_printed++ == 0)
180 for (i=0; i<3; i++) {
207 " descriptors.\n", dev_name(lp->
device));
268 lp = netdev_priv(dev);
276 if ((err = sonic_probe1(dev)))
281 printk(
"%s: SONIC ethernet @%08lx, MAC %pM, IRQ %d\n", dev->
name,
302 struct net_device *dev = platform_get_drvdata(pdev);
319 .name = xtsonic_string,