Lines Matching refs:dev

123 extern int mac8390_memtest(struct net_device *dev);
124 static int mac8390_initdev(struct net_device *dev, struct nubus_board *board,
127 static int mac8390_open(struct net_device *dev);
128 static int mac8390_close(struct net_device *dev);
129 static void mac8390_no_reset(struct net_device *dev);
130 static void interlan_reset(struct net_device *dev);
133 static void sane_get_8390_hdr(struct net_device *dev,
135 static void sane_block_input(struct net_device *dev, int count,
137 static void sane_block_output(struct net_device *dev, int count,
141 static void dayna_memcpy_fromcard(struct net_device *dev, void *to,
143 static void dayna_memcpy_tocard(struct net_device *dev, int to,
147 static void dayna_get_8390_hdr(struct net_device *dev,
149 static void dayna_block_input(struct net_device *dev, int count,
151 static void dayna_block_output(struct net_device *dev, int count,
155 static void slow_sane_get_8390_hdr(struct net_device *dev,
157 static void slow_sane_block_input(struct net_device *dev, int count,
159 static void slow_sane_block_output(struct net_device *dev, int count,
284 static bool mac8390_rsrc_init(struct net_device *dev, in mac8390_rsrc_init() argument
295 dev->irq = SLOT2IRQ(board->slot); in mac8390_rsrc_init()
297 dev->base_addr = board->slot_addr | ((board->slot & 0xf) << 20); in mac8390_rsrc_init()
305 dev_err(&board->dev, in mac8390_rsrc_init()
312 dev_info(&board->dev, "MAC address resource not found\n"); in mac8390_rsrc_init()
317 eth_hw_addr_set(dev, addr); in mac8390_rsrc_init()
323 dev_err(&board->dev, in mac8390_rsrc_init()
328 dev->mem_start = dev->base_addr + offset; in mac8390_rsrc_init()
330 dev->base_addr = dev->mem_start + 0x10000; in mac8390_rsrc_init()
334 dev_info(&board->dev, in mac8390_rsrc_init()
336 offset = mac8390_memsize(dev->mem_start); in mac8390_rsrc_init()
340 dev->mem_end = dev->mem_start + offset; in mac8390_rsrc_init()
345 dev->base_addr = (int)(board->slot_addr + in mac8390_rsrc_init()
347 dev->mem_start = (int)(board->slot_addr + in mac8390_rsrc_init()
349 dev->mem_end = dev->mem_start + in mac8390_rsrc_init()
350 mac8390_memsize(dev->mem_start); in mac8390_rsrc_init()
353 dev->base_addr = (int)(board->slot_addr + in mac8390_rsrc_init()
355 dev->mem_start = (int)(board->slot_addr + in mac8390_rsrc_init()
357 dev->mem_end = dev->mem_start + in mac8390_rsrc_init()
358 mac8390_memsize(dev->mem_start); in mac8390_rsrc_init()
361 dev->base_addr = (int)(board->slot_addr + in mac8390_rsrc_init()
363 dev->mem_start = (int)(board->slot_addr + in mac8390_rsrc_init()
371 i = (void *)dev->base_addr; in mac8390_rsrc_init()
373 dev->mem_end = dev->mem_start + in mac8390_rsrc_init()
374 mac8390_memsize(dev->mem_start); in mac8390_rsrc_init()
378 dev_err(&board->dev, in mac8390_rsrc_init()
389 struct net_device *dev; in mac8390_device_probe() local
394 dev = ____alloc_ei_netdev(0); in mac8390_device_probe()
395 if (!dev) in mac8390_device_probe()
398 SET_NETDEV_DEV(dev, &board->dev); in mac8390_device_probe()
409 if (mac8390_rsrc_init(dev, fres, cardtype)) in mac8390_device_probe()
415 err = mac8390_initdev(dev, board, cardtype); in mac8390_device_probe()
419 err = register_netdev(dev); in mac8390_device_probe()
423 nubus_set_drvdata(board, dev); in mac8390_device_probe()
427 free_netdev(dev); in mac8390_device_probe()
433 struct net_device *dev = nubus_get_drvdata(board); in mac8390_device_remove() local
435 unregister_netdev(dev); in mac8390_device_remove()
436 free_netdev(dev); in mac8390_device_remove()
478 static int mac8390_initdev(struct net_device *dev, struct nubus_board *board, in mac8390_initdev() argument
503 dev->netdev_ops = &mac8390_netdev_ops; in mac8390_initdev()
514 ei_status.rmem_start = dev->mem_start; in mac8390_initdev()
515 ei_status.rmem_end = dev->mem_start + CABLETRON_RX_STOP_PG*256; in mac8390_initdev()
519 ei_status.stop_page = (dev->mem_end - dev->mem_start)/256; in mac8390_initdev()
520 ei_status.rmem_start = dev->mem_start + TX_PAGES*256; in mac8390_initdev()
521 ei_status.rmem_end = dev->mem_end; in mac8390_initdev()
528 switch (mac8390_testio(dev->mem_start)) { in mac8390_initdev()
530 dev_err(&board->dev, in mac8390_initdev()
597 dev_err(&board->dev, "Unsupported card type\n"); in mac8390_initdev()
601 __NS8390_init(dev, 0); in mac8390_initdev()
604 dev_info(&board->dev, "%s (type %s)\n", board->name, cardname[type]); in mac8390_initdev()
605 dev_info(&board->dev, "MAC %pM, IRQ %d, %d KB shared memory at %#lx, %d-bit access.\n", in mac8390_initdev()
606 dev->dev_addr, dev->irq, in mac8390_initdev()
607 (unsigned int)(dev->mem_end - dev->mem_start) >> 10, in mac8390_initdev()
608 dev->mem_start, access_bitmode ? 32 : 16); in mac8390_initdev()
612 static int mac8390_open(struct net_device *dev) in mac8390_open() argument
616 __ei_open(dev); in mac8390_open()
617 err = request_irq(dev->irq, __ei_interrupt, 0, "8390 Ethernet", dev); in mac8390_open()
619 pr_err("%s: unable to get IRQ %d\n", dev->name, dev->irq); in mac8390_open()
623 static int mac8390_close(struct net_device *dev) in mac8390_close() argument
625 free_irq(dev->irq, dev); in mac8390_close()
626 __ei_close(dev); in mac8390_close()
630 static void mac8390_no_reset(struct net_device *dev) in mac8390_no_reset() argument
632 struct ei_device *ei_local = netdev_priv(dev); in mac8390_no_reset()
635 netif_info(ei_local, hw, dev, "reset not supported\n"); in mac8390_no_reset()
638 static void interlan_reset(struct net_device *dev) in interlan_reset() argument
640 unsigned char *target = nubus_slot_addr(IRQ2SLOT(dev->irq)); in interlan_reset()
641 struct ei_device *ei_local = netdev_priv(dev); in interlan_reset()
643 netif_info(ei_local, hw, dev, "Need to reset the NS8390 t=%lu...", in interlan_reset()
653 static void dayna_memcpy_fromcard(struct net_device *dev, void *to, int from, in dayna_memcpy_fromcard() argument
659 ptr = (unsigned char *)(dev->mem_start+from); in dayna_memcpy_fromcard()
677 static void dayna_memcpy_tocard(struct net_device *dev, int to, in dayna_memcpy_tocard() argument
683 ptr = (unsigned short *)(dev->mem_start+to); in dayna_memcpy_tocard()
704 static void sane_get_8390_hdr(struct net_device *dev, in sane_get_8390_hdr() argument
708 memcpy_fromio(hdr, (void __iomem *)dev->mem_start + hdr_start, 4); in sane_get_8390_hdr()
713 static void sane_block_input(struct net_device *dev, int count, in sane_block_input() argument
717 unsigned long xfer_start = xfer_base + dev->mem_start; in sane_block_input()
723 (void __iomem *)dev->mem_start + xfer_base, in sane_block_input()
730 (void __iomem *)dev->mem_start + xfer_base, in sane_block_input()
735 static void sane_block_output(struct net_device *dev, int count, in sane_block_output() argument
740 memcpy_toio((void __iomem *)dev->mem_start + shmem, buf, count); in sane_block_output()
744 static void dayna_get_8390_hdr(struct net_device *dev, in dayna_get_8390_hdr() argument
749 dayna_memcpy_fromcard(dev, hdr, hdr_start, 4); in dayna_get_8390_hdr()
754 static void dayna_block_input(struct net_device *dev, int count, in dayna_block_input() argument
758 unsigned long xfer_start = xfer_base+dev->mem_start; in dayna_block_input()
766 dayna_memcpy_fromcard(dev, skb->data, xfer_base, semi_count); in dayna_block_input()
768 dayna_memcpy_fromcard(dev, skb->data + semi_count, in dayna_block_input()
769 ei_status.rmem_start - dev->mem_start, in dayna_block_input()
772 dayna_memcpy_fromcard(dev, skb->data, xfer_base, count); in dayna_block_input()
776 static void dayna_block_output(struct net_device *dev, int count, in dayna_block_output() argument
782 dayna_memcpy_tocard(dev, shmem, buf, count); in dayna_block_output()
786 static void slow_sane_get_8390_hdr(struct net_device *dev, in slow_sane_get_8390_hdr() argument
791 word_memcpy_fromcard(hdr, dev->mem_start + hdr_start, 4); in slow_sane_get_8390_hdr()
796 static void slow_sane_block_input(struct net_device *dev, int count, in slow_sane_block_input() argument
800 unsigned long xfer_start = xfer_base+dev->mem_start; in slow_sane_block_input()
805 word_memcpy_fromcard(skb->data, dev->mem_start + xfer_base, in slow_sane_block_input()
811 word_memcpy_fromcard(skb->data, dev->mem_start + xfer_base, in slow_sane_block_input()
816 static void slow_sane_block_output(struct net_device *dev, int count, in slow_sane_block_output() argument
821 word_memcpy_tocard(dev->mem_start + shmem, buf, count); in slow_sane_block_output()