aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/macsonic.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/macsonic.c')
-rw-r--r--drivers/net/macsonic.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/drivers/net/macsonic.c b/drivers/net/macsonic.c
index f6f3dafe83ee..393d995f1919 100644
--- a/drivers/net/macsonic.c
+++ b/drivers/net/macsonic.c
@@ -13,20 +13,20 @@
13 * 13 *
14 * Based on code 14 * Based on code
15 * (C) 1996 by Thomas Bogendoerfer (tsbogend@bigbug.franken.de) 15 * (C) 1996 by Thomas Bogendoerfer (tsbogend@bigbug.franken.de)
16 * 16 *
17 * This driver is based on work from Andreas Busse, but most of 17 * This driver is based on work from Andreas Busse, but most of
18 * the code is rewritten. 18 * the code is rewritten.
19 * 19 *
20 * (C) 1995 by Andreas Busse (andy@waldorf-gmbh.de) 20 * (C) 1995 by Andreas Busse (andy@waldorf-gmbh.de)
21 * 21 *
22 * A driver for the Mac onboard Sonic ethernet chip. 22 * A driver for the Mac onboard Sonic ethernet chip.
23 * 23 *
24 * 98/12/21 MSch: judged from tests on Q800, it's basically working, 24 * 98/12/21 MSch: judged from tests on Q800, it's basically working,
25 * but eating up both receive and transmit resources 25 * but eating up both receive and transmit resources
26 * and duplicating packets. Needs more testing. 26 * and duplicating packets. Needs more testing.
27 * 27 *
28 * 99/01/03 MSch: upgraded to version 0.92 of the core driver, fixed. 28 * 99/01/03 MSch: upgraded to version 0.92 of the core driver, fixed.
29 * 29 *
30 * 00/10/31 sammy@oh.verio.com: Updated driver for 2.4 kernels, fixed problems 30 * 00/10/31 sammy@oh.verio.com: Updated driver for 2.4 kernels, fixed problems
31 * on centris. 31 * on centris.
32 */ 32 */
@@ -76,7 +76,7 @@ static struct platform_device *mac_sonic_device;
76/* use 0 for production, 1 for verification, >1 for debug */ 76/* use 0 for production, 1 for verification, >1 for debug */
77#ifdef SONIC_DEBUG 77#ifdef SONIC_DEBUG
78static unsigned int sonic_debug = SONIC_DEBUG; 78static unsigned int sonic_debug = SONIC_DEBUG;
79#else 79#else
80static unsigned int sonic_debug = 1; 80static unsigned int sonic_debug = 1;
81#endif 81#endif
82 82
@@ -129,7 +129,7 @@ static inline void bit_reverse_addr(unsigned char addr[6])
129 int i; 129 int i;
130 130
131 for(i = 0; i < 6; i++) 131 for(i = 0; i < 6; i++)
132 addr[i] = ((nibbletab[addr[i] & 0xf] << 4) | 132 addr[i] = ((nibbletab[addr[i] & 0xf] << 4) |
133 nibbletab[(addr[i] >> 4) &0xf]); 133 nibbletab[(addr[i] >> 4) &0xf]);
134} 134}
135 135
@@ -215,7 +215,7 @@ int __init mac_onboard_sonic_ethernet_addr(struct net_device* dev)
215 unsigned short val; 215 unsigned short val;
216 216
217 printk(KERN_INFO "macsonic: PROM seems to be wrong, trying CAM entry 15\n"); 217 printk(KERN_INFO "macsonic: PROM seems to be wrong, trying CAM entry 15\n");
218 218
219 SONIC_WRITE(SONIC_CMD, SONIC_CR_RST); 219 SONIC_WRITE(SONIC_CMD, SONIC_CR_RST);
220 SONIC_WRITE(SONIC_CEP, 15); 220 SONIC_WRITE(SONIC_CEP, 15);
221 221
@@ -228,7 +228,7 @@ int __init mac_onboard_sonic_ethernet_addr(struct net_device* dev)
228 val = SONIC_READ(SONIC_CAP0); 228 val = SONIC_READ(SONIC_CAP0);
229 dev->dev_addr[1] = val >> 8; 229 dev->dev_addr[1] = val >> 8;
230 dev->dev_addr[0] = val & 0xff; 230 dev->dev_addr[0] = val & 0xff;
231 231
232 printk(KERN_INFO "HW Address from CAM 15: "); 232 printk(KERN_INFO "HW Address from CAM 15: ");
233 for (i = 0; i < 6; i++) { 233 for (i = 0; i < 6; i++) {
234 printk("%2.2x", dev->dev_addr[i]); 234 printk("%2.2x", dev->dev_addr[i]);
@@ -258,7 +258,7 @@ int __init mac_onboard_sonic_probe(struct net_device* dev)
258 struct sonic_local* lp = netdev_priv(dev); 258 struct sonic_local* lp = netdev_priv(dev);
259 int sr; 259 int sr;
260 int commslot = 0; 260 int commslot = 0;
261 261
262 if (once_is_more_than_enough) 262 if (once_is_more_than_enough)
263 return -ENODEV; 263 return -ENODEV;
264 once_is_more_than_enough = 1; 264 once_is_more_than_enough = 1;
@@ -268,9 +268,9 @@ int __init mac_onboard_sonic_probe(struct net_device* dev)
268 268
269 if (macintosh_config->ether_type != MAC_ETHER_SONIC) 269 if (macintosh_config->ether_type != MAC_ETHER_SONIC)
270 return -ENODEV; 270 return -ENODEV;
271 271
272 printk(KERN_INFO "Checking for internal Macintosh ethernet (SONIC).. "); 272 printk(KERN_INFO "Checking for internal Macintosh ethernet (SONIC).. ");
273 273
274 /* Bogus probing, on the models which may or may not have 274 /* Bogus probing, on the models which may or may not have
275 Ethernet (BTW, the Ethernet *is* always at the same 275 Ethernet (BTW, the Ethernet *is* always at the same
276 address, and nothing else lives there, at least if Apple's 276 address, and nothing else lives there, at least if Apple's
@@ -293,7 +293,7 @@ int __init mac_onboard_sonic_probe(struct net_device* dev)
293 commslot = 1; 293 commslot = 1;
294 } 294 }
295 295
296 printk("yes\n"); 296 printk("yes\n");
297 297
298 /* Danger! My arms are flailing wildly! You *must* set lp->reg_offset 298 /* Danger! My arms are flailing wildly! You *must* set lp->reg_offset
299 * and dev->base_addr before using SONIC_READ() or SONIC_WRITE() */ 299 * and dev->base_addr before using SONIC_READ() or SONIC_WRITE() */
@@ -325,7 +325,7 @@ int __init mac_onboard_sonic_probe(struct net_device* dev)
325 lp->dma_bitmode = SONIC_BITMODE16; 325 lp->dma_bitmode = SONIC_BITMODE16;
326 326
327 sr = SONIC_READ(SONIC_SR); 327 sr = SONIC_READ(SONIC_SR);
328 if (sr == 0x0004 || sr == 0x0006 || sr == 0x0100 || sr == 0x0101) 328 if (sr == 0x0004 || sr == 0x0006 || sr == 0x0100 || sr == 0x0101)
329 /* 83932 is 0x0004 or 0x0006, 83934 is 0x0100 or 0x0101 */ 329 /* 83932 is 0x0004 or 0x0006, 83934 is 0x0100 or 0x0101 */
330 lp->dma_bitmode = SONIC_BITMODE32; 330 lp->dma_bitmode = SONIC_BITMODE32;
331 else { 331 else {
@@ -389,7 +389,7 @@ int __init mac_nubus_sonic_ethernet_addr(struct net_device* dev,
389 389
390int __init macsonic_ident(struct nubus_dev* ndev) 390int __init macsonic_ident(struct nubus_dev* ndev)
391{ 391{
392 if (ndev->dr_hw == NUBUS_DRHW_ASANTE_LC && 392 if (ndev->dr_hw == NUBUS_DRHW_ASANTE_LC &&
393 ndev->dr_sw == NUBUS_DRSW_SONIC_LC) 393 ndev->dr_sw == NUBUS_DRSW_SONIC_LC)
394 return MACSONIC_DAYNALINK; 394 return MACSONIC_DAYNALINK;
395 if (ndev->dr_hw == NUBUS_DRHW_SONIC && 395 if (ndev->dr_hw == NUBUS_DRHW_SONIC &&
@@ -400,11 +400,11 @@ int __init macsonic_ident(struct nubus_dev* ndev)
400 else 400 else
401 return MACSONIC_APPLE; 401 return MACSONIC_APPLE;
402 } 402 }
403 403
404 if (ndev->dr_hw == NUBUS_DRHW_SMC9194 && 404 if (ndev->dr_hw == NUBUS_DRHW_SMC9194 &&
405 ndev->dr_sw == NUBUS_DRSW_DAYNA) 405 ndev->dr_sw == NUBUS_DRSW_DAYNA)
406 return MACSONIC_DAYNA; 406 return MACSONIC_DAYNA;
407 407
408 if (ndev->dr_hw == NUBUS_DRHW_SONIC_LC && 408 if (ndev->dr_hw == NUBUS_DRHW_SONIC_LC &&
409 ndev->dr_sw == 0) { /* huh? */ 409 ndev->dr_sw == 0) { /* huh? */
410 return MACSONIC_APPLE16; 410 return MACSONIC_APPLE16;
@@ -421,7 +421,7 @@ int __init mac_nubus_sonic_probe(struct net_device* dev)
421 u16 sonic_dcr; 421 u16 sonic_dcr;
422 int id = -1; 422 int id = -1;
423 int reg_offset, dma_bitmode; 423 int reg_offset, dma_bitmode;
424 424
425 /* Find the first SONIC that hasn't been initialized already */ 425 /* Find the first SONIC that hasn't been initialized already */
426 while ((ndev = nubus_find_type(NUBUS_CAT_NETWORK, 426 while ((ndev = nubus_find_type(NUBUS_CAT_NETWORK,
427 NUBUS_TYPE_ETHERNET, ndev)) != NULL) 427 NUBUS_TYPE_ETHERNET, ndev)) != NULL)
@@ -459,7 +459,7 @@ int __init mac_nubus_sonic_probe(struct net_device* dev)
459 base_addr = ndev->board->slot_addr + APPLE_SONIC_REGISTERS; 459 base_addr = ndev->board->slot_addr + APPLE_SONIC_REGISTERS;
460 prom_addr = ndev->board->slot_addr + APPLE_SONIC_PROM_BASE; 460 prom_addr = ndev->board->slot_addr + APPLE_SONIC_PROM_BASE;
461 sonic_dcr = SONIC_DCR_EXBUS | SONIC_DCR_RFT1 | SONIC_DCR_TFT0 | 461 sonic_dcr = SONIC_DCR_EXBUS | SONIC_DCR_RFT1 | SONIC_DCR_TFT0 |
462 SONIC_DCR_PO1 | SONIC_DCR_BMS; 462 SONIC_DCR_PO1 | SONIC_DCR_BMS;
463 reg_offset = 0; 463 reg_offset = 0;
464 dma_bitmode = SONIC_BITMODE16; 464 dma_bitmode = SONIC_BITMODE16;
465 break; 465 break;
@@ -467,7 +467,7 @@ int __init mac_nubus_sonic_probe(struct net_device* dev)
467 base_addr = ndev->board->slot_addr + APPLE_SONIC_REGISTERS; 467 base_addr = ndev->board->slot_addr + APPLE_SONIC_REGISTERS;
468 prom_addr = ndev->board->slot_addr + DAYNALINK_PROM_BASE; 468 prom_addr = ndev->board->slot_addr + DAYNALINK_PROM_BASE;
469 sonic_dcr = SONIC_DCR_RFT1 | SONIC_DCR_TFT0 | 469 sonic_dcr = SONIC_DCR_RFT1 | SONIC_DCR_TFT0 |
470 SONIC_DCR_PO1 | SONIC_DCR_BMS; 470 SONIC_DCR_PO1 | SONIC_DCR_BMS;
471 reg_offset = 0; 471 reg_offset = 0;
472 dma_bitmode = SONIC_BITMODE16; 472 dma_bitmode = SONIC_BITMODE16;
473 break; 473 break;