82596.c (4b4193256c8d3bc3a5397b5cd9494c2ad386317d) 82596.c (e179d78ee11a70e2675bc572f9f4e33d97233b23)
1/* 82596.c: A generic 82596 ethernet driver for linux. */
2/*
3 Based on Apricot.c
4 Written 1994 by Mark Evans.
5 This driver is for the Apricot 82596 bus-master interface
6
7 Modularised 12/94 Mark Evans
8

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

1105}
1106
1107static void print_eth(unsigned char *add, char *str)
1108{
1109 printk(KERN_DEBUG "i596 0x%p, %pM --> %pM %02X%02X, %s\n",
1110 add, add + 6, add, add[12], add[13], str);
1111}
1112
1/* 82596.c: A generic 82596 ethernet driver for linux. */
2/*
3 Based on Apricot.c
4 Written 1994 by Mark Evans.
5 This driver is for the Apricot 82596 bus-master interface
6
7 Modularised 12/94 Mark Evans
8

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

1105}
1106
1107static void print_eth(unsigned char *add, char *str)
1108{
1109 printk(KERN_DEBUG "i596 0x%p, %pM --> %pM %02X%02X, %s\n",
1110 add, add + 6, add, add[12], add[13], str);
1111}
1112
1113static int io = 0x300;
1114static int irq = 10;
1115
1116static const struct net_device_ops i596_netdev_ops = {
1117 .ndo_open = i596_open,
1118 .ndo_stop = i596_close,
1119 .ndo_start_xmit = i596_start_xmit,
1120 .ndo_set_rx_mode = set_multicast_list,
1121 .ndo_tx_timeout = i596_tx_timeout,
1122 .ndo_set_mac_address = eth_mac_addr,
1123 .ndo_validate_addr = eth_validate_addr,
1124};
1125
1113static const struct net_device_ops i596_netdev_ops = {
1114 .ndo_open = i596_open,
1115 .ndo_stop = i596_close,
1116 .ndo_start_xmit = i596_start_xmit,
1117 .ndo_set_rx_mode = set_multicast_list,
1118 .ndo_tx_timeout = i596_tx_timeout,
1119 .ndo_set_mac_address = eth_mac_addr,
1120 .ndo_validate_addr = eth_validate_addr,
1121};
1122
1126struct net_device * __init i82596_probe(int unit)
1123static struct net_device * __init i82596_probe(void)
1127{
1128 struct net_device *dev;
1129 int i;
1130 struct i596_private *lp;
1131 char eth_addr[8];
1132 static int probed;
1133 int err;
1134
1135 if (probed)
1136 return ERR_PTR(-ENODEV);
1137 probed++;
1138
1139 dev = alloc_etherdev(0);
1140 if (!dev)
1141 return ERR_PTR(-ENOMEM);
1142
1124{
1125 struct net_device *dev;
1126 int i;
1127 struct i596_private *lp;
1128 char eth_addr[8];
1129 static int probed;
1130 int err;
1131
1132 if (probed)
1133 return ERR_PTR(-ENODEV);
1134 probed++;
1135
1136 dev = alloc_etherdev(0);
1137 if (!dev)
1138 return ERR_PTR(-ENOMEM);
1139
1143 if (unit >= 0) {
1144 sprintf(dev->name, "eth%d", unit);
1145 netdev_boot_setup_check(dev);
1146 } else {
1147 dev->base_addr = io;
1148 dev->irq = irq;
1149 }
1150
1151#ifdef ENABLE_MVME16x_NET
1152 if (MACH_IS_MVME16x) {
1153 if (mvme16x_config & MVME16x_CONFIG_NO_ETHERNET) {
1154 printk(KERN_NOTICE "Ethernet probe disabled - chip not present\n");
1155 err = -ENODEV;
1156 goto out;
1157 }
1158 memcpy(eth_addr, (void *) 0xfffc1f2c, ETH_ALEN); /* YUCK! Get addr from NOVRAM */

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

1510 DEB(DEB_MULTI,printk(KERN_INFO "%s: Adding address %pM\n",
1511 dev->name, cp));
1512 cp += ETH_ALEN;
1513 }
1514 i596_add_cmd(dev, &cmd->cmd);
1515 }
1516}
1517
1140#ifdef ENABLE_MVME16x_NET
1141 if (MACH_IS_MVME16x) {
1142 if (mvme16x_config & MVME16x_CONFIG_NO_ETHERNET) {
1143 printk(KERN_NOTICE "Ethernet probe disabled - chip not present\n");
1144 err = -ENODEV;
1145 goto out;
1146 }
1147 memcpy(eth_addr, (void *) 0xfffc1f2c, ETH_ALEN); /* YUCK! Get addr from NOVRAM */

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

1499 DEB(DEB_MULTI,printk(KERN_INFO "%s: Adding address %pM\n",
1500 dev->name, cp));
1501 cp += ETH_ALEN;
1502 }
1503 i596_add_cmd(dev, &cmd->cmd);
1504 }
1505}
1506
1518#ifdef MODULE
1519static struct net_device *dev_82596;
1520
1521static int debug = -1;
1522module_param(debug, int, 0);
1523MODULE_PARM_DESC(debug, "i82596 debug mask");
1524
1507static struct net_device *dev_82596;
1508
1509static int debug = -1;
1510module_param(debug, int, 0);
1511MODULE_PARM_DESC(debug, "i82596 debug mask");
1512
1525int __init init_module(void)
1513static int __init i82596_init(void)
1526{
1527 if (debug >= 0)
1528 i596_debug = debug;
1514{
1515 if (debug >= 0)
1516 i596_debug = debug;
1529 dev_82596 = i82596_probe(-1);
1517 dev_82596 = i82596_probe();
1530 return PTR_ERR_OR_ZERO(dev_82596);
1531}
1518 return PTR_ERR_OR_ZERO(dev_82596);
1519}
1520module_init(i82596_init);
1532
1521
1533void __exit cleanup_module(void)
1522static void __exit i82596_cleanup(void)
1534{
1535 unregister_netdev(dev_82596);
1536#ifdef __mc68000__
1537 /* XXX This assumes default cache mode to be IOMAP_FULL_CACHING,
1538 * XXX which may be invalid (CONFIG_060_WRITETHROUGH)
1539 */
1540
1541 kernel_set_cachemode((void *)(dev_82596->mem_start), 4096,
1542 IOMAP_FULL_CACHING);
1543#endif
1544 free_page ((u32)(dev_82596->mem_start));
1545 free_netdev(dev_82596);
1546}
1523{
1524 unregister_netdev(dev_82596);
1525#ifdef __mc68000__
1526 /* XXX This assumes default cache mode to be IOMAP_FULL_CACHING,
1527 * XXX which may be invalid (CONFIG_060_WRITETHROUGH)
1528 */
1529
1530 kernel_set_cachemode((void *)(dev_82596->mem_start), 4096,
1531 IOMAP_FULL_CACHING);
1532#endif
1533 free_page ((u32)(dev_82596->mem_start));
1534 free_netdev(dev_82596);
1535}
1547
1548#endif /* MODULE */
1536module_exit(i82596_cleanup);