atarilance.c (ca31fef11dc83e672415d5925a134749761329bd) | atarilance.c (e179d78ee11a70e2675bc572f9f4e33d97233b23) |
---|---|
1/* atarilance.c: Ethernet driver for VME Lance cards on the Atari */ 2/* 3 Written 1995/96 by Roman Hodek (Roman.Hodek@informatik.uni-erlangen.de) 4 5 This software may be used and distributed according to the terms 6 of the GNU General Public License, incorporated herein by reference. 7 8 This drivers was written with the following sources of reference: --- 353 unchanged lines hidden (view full) --- 362 while( len-- ) { 363 *cto++ = *cfrom++; 364 MFPDELAY(); 365 } 366 return dst; 367} 368 369 | 1/* atarilance.c: Ethernet driver for VME Lance cards on the Atari */ 2/* 3 Written 1995/96 by Roman Hodek (Roman.Hodek@informatik.uni-erlangen.de) 4 5 This software may be used and distributed according to the terms 6 of the GNU General Public License, incorporated herein by reference. 7 8 This drivers was written with the following sources of reference: --- 353 unchanged lines hidden (view full) --- 362 while( len-- ) { 363 *cto++ = *cfrom++; 364 MFPDELAY(); 365 } 366 return dst; 367} 368 369 |
370struct net_device * __init atarilance_probe(int unit) | 370struct net_device * __init atarilance_probe(void) |
371{ 372 int i; 373 static int found; 374 struct net_device *dev; 375 int err = -ENODEV; 376 377 if (!MACH_IS_ATARI || found) 378 /* Assume there's only one board possible... That seems true, since 379 * the Riebl/PAM board's address cannot be changed. */ 380 return ERR_PTR(-ENODEV); 381 382 dev = alloc_etherdev(sizeof(struct lance_private)); 383 if (!dev) 384 return ERR_PTR(-ENOMEM); | 371{ 372 int i; 373 static int found; 374 struct net_device *dev; 375 int err = -ENODEV; 376 377 if (!MACH_IS_ATARI || found) 378 /* Assume there's only one board possible... That seems true, since 379 * the Riebl/PAM board's address cannot be changed. */ 380 return ERR_PTR(-ENODEV); 381 382 dev = alloc_etherdev(sizeof(struct lance_private)); 383 if (!dev) 384 return ERR_PTR(-ENOMEM); |
385 if (unit >= 0) { 386 sprintf(dev->name, "eth%d", unit); 387 netdev_boot_setup_check(dev); 388 } | |
389 390 for( i = 0; i < N_LANCE_ADDR; ++i ) { 391 if (lance_probe1( dev, &lance_addr_list[i] )) { 392 found = 1; 393 err = register_netdev(dev); 394 if (!err) 395 return dev; 396 free_irq(dev->irq, dev); --- 735 unchanged lines hidden (view full) --- 1132 MEM->init.hwaddr[i] = dev->dev_addr[i^1]; /* <- 16 bit swap! */ 1133 lp->memcpy_f( RIEBL_HWADDR_ADDR, dev->dev_addr, 6 ); 1134 /* set also the magic for future sessions */ 1135 *RIEBL_MAGIC_ADDR = RIEBL_MAGIC; 1136 1137 return 0; 1138} 1139 | 385 386 for( i = 0; i < N_LANCE_ADDR; ++i ) { 387 if (lance_probe1( dev, &lance_addr_list[i] )) { 388 found = 1; 389 err = register_netdev(dev); 390 if (!err) 391 return dev; 392 free_irq(dev->irq, dev); --- 735 unchanged lines hidden (view full) --- 1128 MEM->init.hwaddr[i] = dev->dev_addr[i^1]; /* <- 16 bit swap! */ 1129 lp->memcpy_f( RIEBL_HWADDR_ADDR, dev->dev_addr, 6 ); 1130 /* set also the magic for future sessions */ 1131 *RIEBL_MAGIC_ADDR = RIEBL_MAGIC; 1132 1133 return 0; 1134} 1135 |
1140 1141#ifdef MODULE | |
1142static struct net_device *atarilance_dev; 1143 1144static int __init atarilance_module_init(void) 1145{ | 1136static struct net_device *atarilance_dev; 1137 1138static int __init atarilance_module_init(void) 1139{ |
1146 atarilance_dev = atarilance_probe(-1); | 1140 atarilance_dev = atarilance_probe(); |
1147 return PTR_ERR_OR_ZERO(atarilance_dev); 1148} 1149 1150static void __exit atarilance_module_exit(void) 1151{ 1152 unregister_netdev(atarilance_dev); 1153 free_irq(atarilance_dev->irq, atarilance_dev); 1154 free_netdev(atarilance_dev); 1155} 1156module_init(atarilance_module_init); 1157module_exit(atarilance_module_exit); | 1141 return PTR_ERR_OR_ZERO(atarilance_dev); 1142} 1143 1144static void __exit atarilance_module_exit(void) 1145{ 1146 unregister_netdev(atarilance_dev); 1147 free_irq(atarilance_dev->irq, atarilance_dev); 1148 free_netdev(atarilance_dev); 1149} 1150module_init(atarilance_module_init); 1151module_exit(atarilance_module_exit); |
1158#endif /* MODULE */ | |