com20020.c (97464eddf9fdbe02abfc44676949e07708cf557f) com20020.c (d6d7d3ed56e3bfe7fd34108dbe23f0610e3d8621)
1/*
2 * Linux ARCnet driver - COM20020 chipset support
3 *
4 * Written 1997 by David Woodhouse.
5 * Written 1994-1999 by Avery Pennarun.
6 * Written 1999 by Martin Mares <mj@ucw.cz>.
7 * Derived from skeleton.c by Donald Becker.
8 *

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

187 lp->hw.command = com20020_command;
188 lp->hw.status = com20020_status;
189 lp->hw.intmask = com20020_setmask;
190 lp->hw.reset = com20020_reset;
191 lp->hw.copy_to_card = com20020_copy_to_card;
192 lp->hw.copy_from_card = com20020_copy_from_card;
193 lp->hw.close = com20020_close;
194
1/*
2 * Linux ARCnet driver - COM20020 chipset support
3 *
4 * Written 1997 by David Woodhouse.
5 * Written 1994-1999 by Avery Pennarun.
6 * Written 1999 by Martin Mares <mj@ucw.cz>.
7 * Derived from skeleton.c by Donald Becker.
8 *

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

187 lp->hw.command = com20020_command;
188 lp->hw.status = com20020_status;
189 lp->hw.intmask = com20020_setmask;
190 lp->hw.reset = com20020_reset;
191 lp->hw.copy_to_card = com20020_copy_to_card;
192 lp->hw.copy_from_card = com20020_copy_from_card;
193 lp->hw.close = com20020_close;
194
195 /* FIXME: do this some other way! */
195 if (!dev->dev_addr[0])
196 if (!dev->dev_addr[0])
196 dev->dev_addr[0] = inb(ioaddr + BUS_ALIGN * 8); /* FIXME: do this some other way! */
197 dev->dev_addr[0] = inb(ioaddr + BUS_ALIGN * 8);
197
198 SET_SUBADR(SUB_SETUP1);
199 outb(lp->setup, _XREG);
200
201 if (lp->card_flags & ARC_CAN_10MBIT) {
202 SET_SUBADR(SUB_SETUP2);
203 outb(lp->setup2, _XREG);
204

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

264 lp->config = TXENcfg | (lp->timeout << 3) | (lp->backplane << 2);
265 /* power-up defaults */
266 SETCONF;
267 arc_printk(D_DEBUG, dev, "%s: %d: %s\n", __FILE__, __LINE__, __func__);
268
269 if (really_reset) {
270 /* reset the card */
271 ARCRESET;
198
199 SET_SUBADR(SUB_SETUP1);
200 outb(lp->setup, _XREG);
201
202 if (lp->card_flags & ARC_CAN_10MBIT) {
203 SET_SUBADR(SUB_SETUP2);
204 outb(lp->setup2, _XREG);
205

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

265 lp->config = TXENcfg | (lp->timeout << 3) | (lp->backplane << 2);
266 /* power-up defaults */
267 SETCONF;
268 arc_printk(D_DEBUG, dev, "%s: %d: %s\n", __FILE__, __LINE__, __func__);
269
270 if (really_reset) {
271 /* reset the card */
272 ARCRESET;
272 mdelay(RESETtime * 2); /* COM20020 seems to be slower sometimes */
273 mdelay(RESETtime * 2);
274 /* COM20020 seems to be slower sometimes */
273 }
274 /* clear flags & end reset */
275 arc_printk(D_DEBUG, dev, "%s: %d: %s\n", __FILE__, __LINE__, __func__);
276 ACOMMAND(CFLAGScmd | RESETclear | CONFIGclear);
277
278 /* verify that the ARCnet signature byte is present */
279 arc_printk(D_DEBUG, dev, "%s: %d: %s\n", __FILE__, __LINE__, __func__);
280

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

333 * best-effort filtering.
334 * FIXME - do multicast stuff, not just promiscuous.
335 */
336static void com20020_set_mc_list(struct net_device *dev)
337{
338 struct arcnet_local *lp = netdev_priv(dev);
339 int ioaddr = dev->base_addr;
340
275 }
276 /* clear flags & end reset */
277 arc_printk(D_DEBUG, dev, "%s: %d: %s\n", __FILE__, __LINE__, __func__);
278 ACOMMAND(CFLAGScmd | RESETclear | CONFIGclear);
279
280 /* verify that the ARCnet signature byte is present */
281 arc_printk(D_DEBUG, dev, "%s: %d: %s\n", __FILE__, __LINE__, __func__);
282

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

335 * best-effort filtering.
336 * FIXME - do multicast stuff, not just promiscuous.
337 */
338static void com20020_set_mc_list(struct net_device *dev)
339{
340 struct arcnet_local *lp = netdev_priv(dev);
341 int ioaddr = dev->base_addr;
342
341 if ((dev->flags & IFF_PROMISC) && (dev->flags & IFF_UP)) { /* Enable promiscuous mode */
343 if ((dev->flags & IFF_PROMISC) && (dev->flags & IFF_UP)) {
344 /* Enable promiscuous mode */
342 if (!(lp->setup & PROMISCset))
343 arc_printk(D_NORMAL, dev, "Setting promiscuous flag...\n");
344 SET_SUBADR(SUB_SETUP1);
345 lp->setup |= PROMISCset;
346 outb(lp->setup, _XREG);
345 if (!(lp->setup & PROMISCset))
346 arc_printk(D_NORMAL, dev, "Setting promiscuous flag...\n");
347 SET_SUBADR(SUB_SETUP1);
348 lp->setup |= PROMISCset;
349 outb(lp->setup, _XREG);
347 } else
350 } else {
348 /* Disable promiscuous mode, use normal mode */
351 /* Disable promiscuous mode, use normal mode */
349 {
350 if ((lp->setup & PROMISCset))
351 arc_printk(D_NORMAL, dev, "Resetting promiscuous flag...\n");
352 SET_SUBADR(SUB_SETUP1);
353 lp->setup &= ~PROMISCset;
354 outb(lp->setup, _XREG);
355 }
356}
357

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

365
366MODULE_LICENSE("GPL");
367
368#ifdef MODULE
369
370static int __init com20020_module_init(void)
371{
372 if (BUGLVL(D_NORMAL))
352 if ((lp->setup & PROMISCset))
353 arc_printk(D_NORMAL, dev, "Resetting promiscuous flag...\n");
354 SET_SUBADR(SUB_SETUP1);
355 lp->setup &= ~PROMISCset;
356 outb(lp->setup, _XREG);
357 }
358}
359

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

367
368MODULE_LICENSE("GPL");
369
370#ifdef MODULE
371
372static int __init com20020_module_init(void)
373{
374 if (BUGLVL(D_NORMAL))
373 pr_info("%s\n", "COM20020 chipset support (by David Woodhouse et al.)\n");
375 pr_info("%s\n", "COM20020 chipset support (by David Woodhouse et al.)");
374 return 0;
375}
376
377static void __exit com20020_module_exit(void)
378{
379}
380module_init(com20020_module_init);
381module_exit(com20020_module_exit);
382#endif /* MODULE */
376 return 0;
377}
378
379static void __exit com20020_module_exit(void)
380{
381}
382module_init(com20020_module_init);
383module_exit(com20020_module_exit);
384#endif /* MODULE */