Lines Matching refs:netdev
93 struct net_device *netdev; member
235 memcpy(dev->netdev->dev_addr, node_id, sizeof(node_id)); in set_ethernet_addr()
238 static int rtl8150_set_mac_address(struct net_device *netdev, void *p) in rtl8150_set_mac_address() argument
244 if (netif_running(netdev)) in rtl8150_set_mac_address()
246 dev = netdev->priv; in rtl8150_set_mac_address()
250 memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); in rtl8150_set_mac_address()
251 dbg("%s: Setting MAC address to ", netdev->name); in rtl8150_set_mac_address()
253 printk("%02X:", netdev->dev_addr[i]); in rtl8150_set_mac_address()
254 dbg("%02X\n", netdev->dev_addr[i]); in rtl8150_set_mac_address()
256 set_registers(dev, IDR, sizeof(netdev->dev_addr), netdev->dev_addr); in rtl8150_set_mac_address()
267 for (i = 0; i * 2 < netdev->addr_len; i++) { in rtl8150_set_mac_address()
269 netdev->dev_addr + (i * 2)); in rtl8150_set_mac_address()
340 struct net_device *netdev; in read_bulk_callback() local
348 netdev = dev->netdev; in read_bulk_callback()
349 if (!netif_device_present(netdev)) { in read_bulk_callback()
371 skb->dev = netdev; in read_bulk_callback()
375 skb->protocol = eth_type_trans(skb, netdev); in read_bulk_callback()
383 warn("%s: Rx urb submission failed %d", netdev->name, res); in read_bulk_callback()
393 if (!netif_device_present(dev->netdev)) in write_bulk_callback()
396 info("%s: Tx status %d", dev->netdev->name, urb->status); in write_bulk_callback()
397 dev->netdev->trans_start = jiffies; in write_bulk_callback()
398 netif_wake_queue(dev->netdev); in write_bulk_callback()
414 info("%s: intr status %d", dev->netdev->name, urb->status); in intr_callback()
457 static void rtl8150_tx_timeout(struct net_device *netdev) in rtl8150_tx_timeout() argument
461 dev = netdev->priv; in rtl8150_tx_timeout()
464 warn("%s: Tx timeout.", netdev->name); in rtl8150_tx_timeout()
470 static void rtl8150_set_multicast(struct net_device *netdev) in rtl8150_set_multicast() argument
474 dev = netdev->priv; in rtl8150_set_multicast()
475 netif_stop_queue(netdev); in rtl8150_set_multicast()
476 if (netdev->flags & IFF_PROMISC) { in rtl8150_set_multicast()
478 info("%s: promiscuous mode", netdev->name); in rtl8150_set_multicast()
479 } else if ((netdev->mc_count > multicast_filter_limit) || in rtl8150_set_multicast()
480 (netdev->flags & IFF_ALLMULTI)) { in rtl8150_set_multicast()
483 info("%s: allmulti set", netdev->name); in rtl8150_set_multicast()
489 netif_wake_queue(netdev); in rtl8150_set_multicast()
492 static int rtl8150_start_xmit(struct sk_buff *skb, struct net_device *netdev) in rtl8150_start_xmit() argument
497 netif_stop_queue(netdev); in rtl8150_start_xmit()
498 dev = netdev->priv; in rtl8150_start_xmit()
509 netif_start_queue(netdev); in rtl8150_start_xmit()
513 netdev->trans_start = jiffies; in rtl8150_start_xmit()
520 static int rtl8150_open(struct net_device *netdev) in rtl8150_open() argument
525 dev = netdev->priv; in rtl8150_open()
532 set_registers(dev, IDR, 6, netdev->dev_addr); in rtl8150_open()
543 netif_start_queue(netdev); in rtl8150_open()
550 static int rtl8150_close(struct net_device *netdev) in rtl8150_close() argument
555 dev = netdev->priv; in rtl8150_close()
563 netif_stop_queue(netdev); in rtl8150_close()
569 static int rtl8150_ethtool_ioctl(struct net_device *netdev, void *uaddr) in rtl8150_ethtool_ioctl() argument
575 dev = netdev->priv; in rtl8150_ethtool_ioctl()
637 edata.data = netif_carrier_ok(netdev); in rtl8150_ethtool_ioctl()
647 static int rtl8150_ioctl(struct net_device *netdev, struct ifreq *rq, int cmd) in rtl8150_ioctl() argument
653 dev = netdev->priv; in rtl8150_ioctl()
660 res = rtl8150_ethtool_ioctl(netdev, rq->ifr_data); in rtl8150_ioctl()
686 struct net_device *netdev; in rtl8150_probe() local
700 netdev = init_etherdev(NULL, 0); in rtl8150_probe()
701 if (!netdev) { in rtl8150_probe()
710 dev->netdev = netdev; in rtl8150_probe()
711 SET_MODULE_OWNER(netdev); in rtl8150_probe()
712 netdev->priv = dev; in rtl8150_probe()
713 netdev->open = rtl8150_open; in rtl8150_probe()
714 netdev->stop = rtl8150_close; in rtl8150_probe()
715 netdev->do_ioctl = rtl8150_ioctl; in rtl8150_probe()
716 netdev->watchdog_timeo = RTL8150_TX_TIMEOUT; in rtl8150_probe()
717 netdev->tx_timeout = rtl8150_tx_timeout; in rtl8150_probe()
718 netdev->hard_start_xmit = rtl8150_start_xmit; in rtl8150_probe()
719 netdev->set_multicast_list = rtl8150_set_multicast; in rtl8150_probe()
720 netdev->set_mac_address = rtl8150_set_mac_address; in rtl8150_probe()
721 netdev->get_stats = rtl8150_netdev_stats; in rtl8150_probe()
722 netdev->mtu = RTL8150_MTU; in rtl8150_probe()
728 unregister_netdev(dev->netdev); in rtl8150_probe()
729 kfree(netdev); in rtl8150_probe()
737 info("%s: rtl8150 is detected", netdev->name); in rtl8150_probe()
748 unregister_netdev(dev->netdev); in rtl8150_disconnect()
751 kfree(dev->netdev); in rtl8150_disconnect()
753 dev->netdev = NULL; in rtl8150_disconnect()