Lines Matching refs:dev
48 static int simeth_open(struct net_device *dev);
49 static int simeth_close(struct net_device *dev);
50 static int simeth_tx(struct sk_buff *skb, struct net_device *dev);
51 static int simeth_rx(struct net_device *dev);
52 static struct net_device_stats *simeth_get_stats(struct net_device *dev);
54 static void set_multicast_list(struct net_device *dev);
183 struct net_device *dev; in simeth_probe1() local
200 dev = alloc_etherdev(sizeof(struct simeth_local)); in simeth_probe1()
201 if (!dev) in simeth_probe1()
204 memcpy(dev->dev_addr, mac_addr, sizeof(mac_addr)); in simeth_probe1()
206 local = netdev_priv(dev); in simeth_probe1()
209 dev->netdev_ops = &simeth_netdev_ops; in simeth_probe1()
211 err = register_netdev(dev); in simeth_probe1()
213 free_netdev(dev); in simeth_probe1()
223 dev->irq = rc; in simeth_probe1()
226 dev->name, simeth_device, local->simfd, dev->dev_addr, dev->irq); in simeth_probe1()
235 simeth_open(struct net_device *dev) in simeth_open() argument
237 if (request_irq(dev->irq, simeth_interrupt, 0, "simeth", dev)) { in simeth_open()
238 printk(KERN_WARNING "simeth: unable to get IRQ %d.\n", dev->irq); in simeth_open()
242 netif_start_queue(dev); in simeth_open()
248 static __inline__ int dev_is_ethdev(struct net_device *dev) in dev_is_ethdev() argument
250 return ( dev->type == ARPHRD_ETHER && strncmp(dev->name, "dummy", 5)); in dev_is_ethdev()
271 struct net_device *dev = netdev_notifier_info_to_dev(ptr); in simeth_device_event() local
279 if ( ! dev ) { in simeth_device_event()
284 if (dev_net(dev) != &init_net) in simeth_device_event()
295 if ( !dev_is_ethdev(dev) ) return NOTIFY_DONE; in simeth_device_event()
297 if ((in_dev=dev->ip_ptr) != NULL) { in simeth_device_event()
299 if (strcmp(dev->name, ifa->ifa_label) == 0) break; in simeth_device_event()
302 printk(KERN_ERR "simeth_open: can't find device %s's ifa\n", dev->name); in simeth_device_event()
307 dev->name, ntohl(ifa->ifa_local)); in simeth_device_event()
315 local = netdev_priv(dev); in simeth_device_event()
318 netdev_attach(local->simfd, dev->irq, ntohl(ifa->ifa_local)): in simeth_device_event()
328 simeth_close(struct net_device *dev) in simeth_close() argument
330 netif_stop_queue(dev); in simeth_close()
332 free_irq(dev->irq, dev); in simeth_close()
368 simeth_tx(struct sk_buff *skb, struct net_device *dev) in simeth_tx() argument
370 struct simeth_local *local = netdev_priv(dev); in simeth_tx()
401 make_new_skb(struct net_device *dev) in make_new_skb() argument
411 printk(KERN_NOTICE "%s: memory squeeze. dropping packet.\n", dev->name); in make_new_skb()
426 simeth_rx(struct net_device *dev) in simeth_rx() argument
433 local = netdev_priv(dev); in simeth_rx()
441 if ( (skb=make_new_skb(dev)) == NULL ) { in simeth_rx()
442 printk(KERN_NOTICE "%s: memory squeeze. dropping packet.\n", dev->name); in simeth_rx()
452 dev->name, SIMETH_RECV_MAX-rcv_count); in simeth_rx()
462 skb->protocol = eth_type_trans(skb, dev); in simeth_rx()
485 struct net_device *dev = dev_id; in simeth_interrupt() local
490 while (simeth_rx(dev)); in simeth_interrupt()
495 simeth_get_stats(struct net_device *dev) in simeth_get_stats() argument
497 struct simeth_local *local = netdev_priv(dev); in simeth_get_stats()
504 set_multicast_list(struct net_device *dev) in set_multicast_list() argument
506 printk(KERN_WARNING "%s: set_multicast_list called\n", dev->name); in set_multicast_list()