mvme147.c (4b4193256c8d3bc3a5397b5cd9494c2ad386317d) mvme147.c (e179d78ee11a70e2675bc572f9f4e33d97233b23)
1// SPDX-License-Identifier: GPL-2.0-only
2/* mvme147.c : the Linux/mvme147/lance ethernet driver
3 *
4 * Copyright (C) 05/1998 Peter Maydell <pmaydell@chiark.greenend.org.uk>
5 * Based on the Sun Lance driver and the NetBSD HP Lance driver
6 * Uses the generic 7990.c LANCE code.
7 */
8

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

63 .ndo_start_xmit = lance_start_xmit,
64 .ndo_set_rx_mode = lance_set_multicast,
65 .ndo_tx_timeout = lance_tx_timeout,
66 .ndo_validate_addr = eth_validate_addr,
67 .ndo_set_mac_address = eth_mac_addr,
68};
69
70/* Initialise the one and only on-board 7990 */
1// SPDX-License-Identifier: GPL-2.0-only
2/* mvme147.c : the Linux/mvme147/lance ethernet driver
3 *
4 * Copyright (C) 05/1998 Peter Maydell <pmaydell@chiark.greenend.org.uk>
5 * Based on the Sun Lance driver and the NetBSD HP Lance driver
6 * Uses the generic 7990.c LANCE code.
7 */
8

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

63 .ndo_start_xmit = lance_start_xmit,
64 .ndo_set_rx_mode = lance_set_multicast,
65 .ndo_tx_timeout = lance_tx_timeout,
66 .ndo_validate_addr = eth_validate_addr,
67 .ndo_set_mac_address = eth_mac_addr,
68};
69
70/* Initialise the one and only on-board 7990 */
71struct net_device * __init mvme147lance_probe(int unit)
71static struct net_device * __init mvme147lance_probe(void)
72{
73 struct net_device *dev;
74 static int called;
75 static const char name[] = "MVME147 LANCE";
76 struct m147lance_private *lp;
77 u_long *addr;
78 u_long address;
79 int err;
80
81 if (!MACH_IS_MVME147 || called)
82 return ERR_PTR(-ENODEV);
83 called++;
84
85 dev = alloc_etherdev(sizeof(struct m147lance_private));
86 if (!dev)
87 return ERR_PTR(-ENOMEM);
88
72{
73 struct net_device *dev;
74 static int called;
75 static const char name[] = "MVME147 LANCE";
76 struct m147lance_private *lp;
77 u_long *addr;
78 u_long address;
79 int err;
80
81 if (!MACH_IS_MVME147 || called)
82 return ERR_PTR(-ENODEV);
83 called++;
84
85 dev = alloc_etherdev(sizeof(struct m147lance_private));
86 if (!dev)
87 return ERR_PTR(-ENOMEM);
88
89 if (unit >= 0)
90 sprintf(dev->name, "eth%d", unit);
91
92 /* Fill the dev fields */
93 dev->base_addr = (unsigned long)MVME147_LANCE_BASE;
94 dev->netdev_ops = &lance_netdev_ops;
95 dev->dma = 0;
96
97 addr = (u_long *)ETHERNET_ADDRESS;
98 address = *addr;
99 dev->dev_addr[0] = 0x08;

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

174static int m147lance_close(struct net_device *dev)
175{
176 /* disable interrupts at boardlevel */
177 m147_pcc->lan_cntrl = 0x0; /* disable interrupts */
178 lance_close(dev);
179 return 0;
180}
181
89 /* Fill the dev fields */
90 dev->base_addr = (unsigned long)MVME147_LANCE_BASE;
91 dev->netdev_ops = &lance_netdev_ops;
92 dev->dma = 0;
93
94 addr = (u_long *)ETHERNET_ADDRESS;
95 address = *addr;
96 dev->dev_addr[0] = 0x08;

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

171static int m147lance_close(struct net_device *dev)
172{
173 /* disable interrupts at boardlevel */
174 m147_pcc->lan_cntrl = 0x0; /* disable interrupts */
175 lance_close(dev);
176 return 0;
177}
178
182#ifdef MODULE
183MODULE_LICENSE("GPL");
184
185static struct net_device *dev_mvme147_lance;
179MODULE_LICENSE("GPL");
180
181static struct net_device *dev_mvme147_lance;
186int __init init_module(void)
182static int __init m147lance_init(void)
187{
183{
188 dev_mvme147_lance = mvme147lance_probe(-1);
184 dev_mvme147_lance = mvme147lance_probe();
189 return PTR_ERR_OR_ZERO(dev_mvme147_lance);
190}
185 return PTR_ERR_OR_ZERO(dev_mvme147_lance);
186}
187module_init(m147lance_init);
191
188
192void __exit cleanup_module(void)
189static void __exit m147lance_exit(void)
193{
194 struct m147lance_private *lp = netdev_priv(dev_mvme147_lance);
195 unregister_netdev(dev_mvme147_lance);
196 free_pages(lp->ram, 3);
197 free_netdev(dev_mvme147_lance);
198}
190{
191 struct m147lance_private *lp = netdev_priv(dev_mvme147_lance);
192 unregister_netdev(dev_mvme147_lance);
193 free_pages(lp->ram, 3);
194 free_netdev(dev_mvme147_lance);
195}
199
200#endif /* MODULE */
196module_exit(m147lance_exit);