21 #include <linux/kernel.h>
22 #include <linux/module.h>
23 #include <linux/types.h>
24 #include <linux/fcntl.h>
30 #include <linux/string.h>
32 #include <linux/errno.h>
33 #include <linux/netdevice.h>
38 #include <linux/slab.h>
40 #include <asm/bootinfo.h>
41 #include <asm/pgtable.h>
47 static char jazz_sonic_string[] =
"jazzsonic";
49 #define SONIC_MEM_SIZE 0x100
56 #define SONIC_READ(reg) (*((volatile unsigned int *)dev->base_addr+reg))
58 #define SONIC_WRITE(reg,val) \
60 *((volatile unsigned int *)dev->base_addr+(reg)) = (val); \
66 static unsigned int sonic_debug = SONIC_DEBUG;
68 static unsigned int sonic_debug = 1;
76 static unsigned short known_revisions[] =
94 retval = sonic_open(dev);
100 static int jazzsonic_close(
struct net_device* dev)
103 err = sonic_close(dev);
109 .ndo_open = jazzsonic_open,
110 .ndo_stop = jazzsonic_close,
111 .ndo_start_xmit = sonic_send_packet,
112 .ndo_get_stats = sonic_get_stats,
113 .ndo_set_rx_mode = sonic_multicast_list,
114 .ndo_tx_timeout = sonic_tx_timeout,
122 static unsigned version_printed;
123 unsigned int silicon_revision;
139 printk(
"SONIC Silicon Revision = 0x%04x\n",silicon_revision);
142 while (known_revisions[i] != 0xffff &&
143 known_revisions[i] != silicon_revision)
146 if (known_revisions[i] == 0xffff) {
147 printk(
"SONIC ethernet controller not found (0x%4x)\n",
152 if (sonic_debug && version_printed++ == 0)
164 for (i=0; i<3; i++) {
181 printk(
KERN_ERR "%s: couldn't alloc DMA memory for descriptors.\n",
238 lp = netdev_priv(dev);
241 platform_set_drvdata(pdev, dev);
247 err = sonic_probe1(dev);
275 struct net_device *dev = platform_get_drvdata(pdev);
288 .probe = jazz_sonic_probe,
291 .name = jazz_sonic_string,