sun3lance.c (ca31fef11dc83e672415d5925a134749761329bd) sun3lance.c (e179d78ee11a70e2675bc572f9f4e33d97233b23)
1/* sun3lance.c: Ethernet driver for SUN3 Lance chip */
2/*
3
4 Sun3 Lance ethernet driver, by Sam Creasey (sammy@users.qual.net).
5 This driver is a part of the linux kernel, and is thus distributed
6 under the GNU General Public License.
7
8 The values used in LANCE_OBIO and LANCE_IRQ seem to be empirically

--- 231 unchanged lines hidden (view full) ---

240 struct net_device *dev);
241static irqreturn_t lance_interrupt( int irq, void *dev_id);
242static int lance_rx( struct net_device *dev );
243static int lance_close( struct net_device *dev );
244static void set_multicast_list( struct net_device *dev );
245
246/************************* End of Prototypes **************************/
247
1/* sun3lance.c: Ethernet driver for SUN3 Lance chip */
2/*
3
4 Sun3 Lance ethernet driver, by Sam Creasey (sammy@users.qual.net).
5 This driver is a part of the linux kernel, and is thus distributed
6 under the GNU General Public License.
7
8 The values used in LANCE_OBIO and LANCE_IRQ seem to be empirically

--- 231 unchanged lines hidden (view full) ---

240 struct net_device *dev);
241static irqreturn_t lance_interrupt( int irq, void *dev_id);
242static int lance_rx( struct net_device *dev );
243static int lance_close( struct net_device *dev );
244static void set_multicast_list( struct net_device *dev );
245
246/************************* End of Prototypes **************************/
247
248struct net_device * __init sun3lance_probe(int unit)
248static struct net_device * __init sun3lance_probe(void)
249{
250 struct net_device *dev;
251 static int found;
252 int err = -ENODEV;
253
254 if (!MACH_IS_SUN3 && !MACH_IS_SUN3X)
255 return ERR_PTR(-ENODEV);
256

--- 10 unchanged lines hidden (view full) ---

267 }
268
269 if (found)
270 return ERR_PTR(-ENODEV);
271
272 dev = alloc_etherdev(sizeof(struct lance_private));
273 if (!dev)
274 return ERR_PTR(-ENOMEM);
249{
250 struct net_device *dev;
251 static int found;
252 int err = -ENODEV;
253
254 if (!MACH_IS_SUN3 && !MACH_IS_SUN3X)
255 return ERR_PTR(-ENODEV);
256

--- 10 unchanged lines hidden (view full) ---

267 }
268
269 if (found)
270 return ERR_PTR(-ENODEV);
271
272 dev = alloc_etherdev(sizeof(struct lance_private));
273 if (!dev)
274 return ERR_PTR(-ENOMEM);
275 if (unit >= 0) {
276 sprintf(dev->name, "eth%d", unit);
277 netdev_boot_setup_check(dev);
278 }
279
280 if (!lance_probe(dev))
281 goto out;
282
283 err = register_netdev(dev);
284 if (err)
285 goto out1;
286 found = 1;

--- 632 unchanged lines hidden (view full) ---

919 */
920 REGA( CSR3 ) = CSR3_BSWP;
921
922 /* Resume normal operation and reset AREG to CSR0 */
923 REGA( CSR0 ) = CSR0_IDON | CSR0_INEA | CSR0_STRT;
924}
925
926
275
276 if (!lance_probe(dev))
277 goto out;
278
279 err = register_netdev(dev);
280 if (err)
281 goto out1;
282 found = 1;

--- 632 unchanged lines hidden (view full) ---

915 */
916 REGA( CSR3 ) = CSR3_BSWP;
917
918 /* Resume normal operation and reset AREG to CSR0 */
919 REGA( CSR0 ) = CSR0_IDON | CSR0_INEA | CSR0_STRT;
920}
921
922
927#ifdef MODULE
928
929static struct net_device *sun3lance_dev;
930
923static struct net_device *sun3lance_dev;
924
931int __init init_module(void)
925static int __init sun3lance_init(void)
932{
926{
933 sun3lance_dev = sun3lance_probe(-1);
927 sun3lance_dev = sun3lance_probe();
934 return PTR_ERR_OR_ZERO(sun3lance_dev);
935}
928 return PTR_ERR_OR_ZERO(sun3lance_dev);
929}
930module_init(sun3lance_init);
936
931
937void __exit cleanup_module(void)
932static void __exit sun3lance_cleanup(void)
938{
939 unregister_netdev(sun3lance_dev);
940#ifdef CONFIG_SUN3
941 iounmap((void __iomem *)sun3lance_dev->base_addr);
942#endif
943 free_netdev(sun3lance_dev);
944}
933{
934 unregister_netdev(sun3lance_dev);
935#ifdef CONFIG_SUN3
936 iounmap((void __iomem *)sun3lance_dev->base_addr);
937#endif
938 free_netdev(sun3lance_dev);
939}
945
946#endif /* MODULE */
947
940module_exit(sun3lance_cleanup);