Lines Matching refs:netdev

128 	struct net_device *netdev;  member
204 netif_device_detach(dev->netdev); in async_set_registers()
265 ether_addr_copy(dev->netdev->dev_addr, node_id); in set_ethernet_addr()
267 eth_hw_addr_random(dev->netdev); in set_ethernet_addr()
268 netdev_notice(dev->netdev, "Assigned a random MAC address: %pM\n", in set_ethernet_addr()
269 dev->netdev->dev_addr); in set_ethernet_addr()
273 static int rtl8150_set_mac_address(struct net_device *netdev, void *p) in rtl8150_set_mac_address() argument
276 rtl8150_t *dev = netdev_priv(netdev); in rtl8150_set_mac_address()
278 if (netif_running(netdev)) in rtl8150_set_mac_address()
281 memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); in rtl8150_set_mac_address()
282 netdev_dbg(netdev, "Setting MAC address to %pM\n", netdev->dev_addr); in rtl8150_set_mac_address()
284 set_registers(dev, IDR, netdev->addr_len, netdev->dev_addr); in rtl8150_set_mac_address()
296 for (i = 0; i * 2 < netdev->addr_len; i++) { in rtl8150_set_mac_address()
298 netdev->dev_addr + (i * 2)); in rtl8150_set_mac_address()
375 struct net_device *netdev; in read_bulk_callback() local
385 netdev = dev->netdev; in read_bulk_callback()
386 if (!netif_device_present(netdev)) in read_bulk_callback()
414 dev->rx_skb->protocol = eth_type_trans(dev->rx_skb, netdev); in read_bulk_callback()
416 netdev->stats.rx_packets++; in read_bulk_callback()
417 netdev->stats.rx_bytes += pkt_len; in read_bulk_callback()
431 netif_device_detach(dev->netdev); in read_bulk_callback()
453 if (!netif_device_present(dev->netdev)) in write_bulk_callback()
457 dev->netdev->name, status); in write_bulk_callback()
458 netif_trans_update(dev->netdev); in write_bulk_callback()
459 netif_wake_queue(dev->netdev); in write_bulk_callback()
482 dev->netdev->name, status); in intr_callback()
488 dev->netdev->stats.tx_errors++; in intr_callback()
490 dev->netdev->stats.tx_aborted_errors++; in intr_callback()
492 dev->netdev->stats.tx_window_errors++; in intr_callback()
494 dev->netdev->stats.tx_carrier_errors++; in intr_callback()
498 if (netif_carrier_ok(dev->netdev)) { in intr_callback()
499 netif_carrier_off(dev->netdev); in intr_callback()
500 netdev_dbg(dev->netdev, "%s: LINK LOST\n", __func__); in intr_callback()
503 if (!netif_carrier_ok(dev->netdev)) { in intr_callback()
504 netif_carrier_on(dev->netdev); in intr_callback()
505 netdev_dbg(dev->netdev, "%s: LINK CAME BACK\n", __func__); in intr_callback()
512 netif_device_detach(dev->netdev); in intr_callback()
523 netif_device_detach(dev->netdev); in rtl8150_suspend()
525 if (netif_running(dev->netdev)) { in rtl8150_suspend()
536 netif_device_attach(dev->netdev); in rtl8150_resume()
537 if (netif_running(dev->netdev)) { in rtl8150_resume()
603 netif_device_detach(dev->netdev); in rx_fixup()
646 static void rtl8150_tx_timeout(struct net_device *netdev, unsigned int txqueue) in rtl8150_tx_timeout() argument
648 rtl8150_t *dev = netdev_priv(netdev); in rtl8150_tx_timeout()
649 dev_warn(&netdev->dev, "Tx timeout.\n"); in rtl8150_tx_timeout()
651 netdev->stats.tx_errors++; in rtl8150_tx_timeout()
654 static void rtl8150_set_multicast(struct net_device *netdev) in rtl8150_set_multicast() argument
656 rtl8150_t *dev = netdev_priv(netdev); in rtl8150_set_multicast()
659 netif_stop_queue(netdev); in rtl8150_set_multicast()
660 if (netdev->flags & IFF_PROMISC) { in rtl8150_set_multicast()
662 dev_info(&netdev->dev, "%s: promiscuous mode\n", netdev->name); in rtl8150_set_multicast()
663 } else if (!netdev_mc_empty(netdev) || in rtl8150_set_multicast()
664 (netdev->flags & IFF_ALLMULTI)) { in rtl8150_set_multicast()
667 dev_dbg(&netdev->dev, "%s: allmulti set\n", netdev->name); in rtl8150_set_multicast()
673 netif_wake_queue(netdev); in rtl8150_set_multicast()
677 struct net_device *netdev) in rtl8150_start_xmit() argument
679 rtl8150_t *dev = netdev_priv(netdev); in rtl8150_start_xmit()
682 netif_stop_queue(netdev); in rtl8150_start_xmit()
691 netif_device_detach(dev->netdev); in rtl8150_start_xmit()
693 dev_warn(&netdev->dev, "failed tx_urb %d\n", res); in rtl8150_start_xmit()
694 netdev->stats.tx_errors++; in rtl8150_start_xmit()
695 netif_start_queue(netdev); in rtl8150_start_xmit()
698 netdev->stats.tx_packets++; in rtl8150_start_xmit()
699 netdev->stats.tx_bytes += skb->len; in rtl8150_start_xmit()
700 netif_trans_update(netdev); in rtl8150_start_xmit()
707 static void set_carrier(struct net_device *netdev) in set_carrier() argument
709 rtl8150_t *dev = netdev_priv(netdev); in set_carrier()
714 netif_carrier_on(netdev); in set_carrier()
716 netif_carrier_off(netdev); in set_carrier()
719 static int rtl8150_open(struct net_device *netdev) in rtl8150_open() argument
721 rtl8150_t *dev = netdev_priv(netdev); in rtl8150_open()
729 set_registers(dev, IDR, 6, netdev->dev_addr); in rtl8150_open()
735 netif_device_detach(dev->netdev); in rtl8150_open()
736 dev_warn(&netdev->dev, "rx_urb submit failed: %d\n", res); in rtl8150_open()
744 netif_device_detach(dev->netdev); in rtl8150_open()
745 dev_warn(&netdev->dev, "intr_urb submit failed: %d\n", res); in rtl8150_open()
750 set_carrier(netdev); in rtl8150_open()
751 netif_start_queue(netdev); in rtl8150_open()
756 static int rtl8150_close(struct net_device *netdev) in rtl8150_close() argument
758 rtl8150_t *dev = netdev_priv(netdev); in rtl8150_close()
760 netif_stop_queue(netdev); in rtl8150_close()
768 static void rtl8150_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *info) in rtl8150_get_drvinfo() argument
770 rtl8150_t *dev = netdev_priv(netdev); in rtl8150_get_drvinfo()
777 static int rtl8150_get_link_ksettings(struct net_device *netdev, in rtl8150_get_link_ksettings() argument
780 rtl8150_t *dev = netdev_priv(netdev); in rtl8150_get_link_ksettings()
825 static int rtl8150_ioctl(struct net_device *netdev, struct ifreq *rq, int cmd) in rtl8150_ioctl() argument
827 rtl8150_t *dev = netdev_priv(netdev); in rtl8150_ioctl()
867 struct net_device *netdev; in rtl8150_probe() local
869 netdev = alloc_etherdev(sizeof(rtl8150_t)); in rtl8150_probe()
870 if (!netdev) in rtl8150_probe()
873 dev = netdev_priv(netdev); in rtl8150_probe()
877 free_netdev(netdev); in rtl8150_probe()
885 dev->netdev = netdev; in rtl8150_probe()
886 netdev->netdev_ops = &rtl8150_netdev_ops; in rtl8150_probe()
887 netdev->watchdog_timeo = RTL8150_TX_TIMEOUT; in rtl8150_probe()
888 netdev->ethtool_ops = &ops; in rtl8150_probe()
903 SET_NETDEV_DEV(netdev, &intf->dev); in rtl8150_probe()
904 if (register_netdev(netdev) != 0) { in rtl8150_probe()
909 dev_info(&intf->dev, "%s: rtl8150 is detected\n", netdev->name); in rtl8150_probe()
920 free_netdev(netdev); in rtl8150_probe()
932 unregister_netdev(dev->netdev); in rtl8150_disconnect()
938 free_netdev(dev->netdev); in rtl8150_disconnect()