Lines Matching refs:netdev
77 struct net_device *netdev; member
127 struct net_device *netdev = priv->netdev; in ftmac100_reset() local
150 netdev_err(netdev, "software reset failed\n"); in ftmac100_reset()
174 struct net_device *netdev = priv->netdev; in ftmac100_start_hw() local
189 ftmac100_set_mac(priv, netdev->dev_addr); in ftmac100_start_hw()
334 struct net_device *netdev = priv->netdev; in ftmac100_rx_packet_error() local
339 netdev_info(netdev, "rx err\n"); in ftmac100_rx_packet_error()
341 netdev->stats.rx_errors++; in ftmac100_rx_packet_error()
347 netdev_info(netdev, "rx crc err\n"); in ftmac100_rx_packet_error()
349 netdev->stats.rx_crc_errors++; in ftmac100_rx_packet_error()
355 netdev_info(netdev, "rx frame too long\n"); in ftmac100_rx_packet_error()
357 netdev->stats.rx_length_errors++; in ftmac100_rx_packet_error()
361 netdev_info(netdev, "rx runt\n"); in ftmac100_rx_packet_error()
363 netdev->stats.rx_length_errors++; in ftmac100_rx_packet_error()
367 netdev_info(netdev, "rx odd nibble\n"); in ftmac100_rx_packet_error()
369 netdev->stats.rx_length_errors++; in ftmac100_rx_packet_error()
378 struct net_device *netdev = priv->netdev; in ftmac100_rx_drop_packet() local
383 netdev_dbg(netdev, "drop packet %p\n", rxdes); in ftmac100_rx_drop_packet()
394 netdev->stats.rx_dropped++; in ftmac100_rx_drop_packet()
399 struct net_device *netdev = priv->netdev; in ftmac100_rx_packet() local
423 skb = netdev_alloc_skb_ip_align(netdev, 128); in ftmac100_rx_packet()
426 netdev_err(netdev, "rx skb alloc failed\n"); in ftmac100_rx_packet()
433 netdev->stats.multicast++; in ftmac100_rx_packet()
456 skb->protocol = eth_type_trans(skb, netdev); in ftmac100_rx_packet()
458 netdev->stats.rx_packets++; in ftmac100_rx_packet()
459 netdev->stats.rx_bytes += skb->len; in ftmac100_rx_packet()
586 struct net_device *netdev = priv->netdev; in ftmac100_tx_complete_packet() local
608 netdev->stats.tx_aborted_errors++; in ftmac100_tx_complete_packet()
610 netdev->stats.tx_packets++; in ftmac100_tx_complete_packet()
611 netdev->stats.tx_bytes += skb->len; in ftmac100_tx_complete_packet()
624 netif_wake_queue(netdev); in ftmac100_tx_complete_packet()
638 struct net_device *netdev = priv->netdev; in ftmac100_xmit() local
657 netif_stop_queue(netdev); in ftmac100_xmit()
673 struct net_device *netdev = priv->netdev; in ftmac100_alloc_rx_page() local
680 netdev_err(netdev, "failed to allocate rx page\n"); in ftmac100_alloc_rx_page()
687 netdev_err(netdev, "failed to map rx page\n"); in ftmac100_alloc_rx_page()
764 static int ftmac100_mdio_read(struct net_device *netdev, int phy_id, int reg) in ftmac100_mdio_read() argument
766 struct ftmac100 *priv = netdev_priv(netdev); in ftmac100_mdio_read()
785 netdev_err(netdev, "mdio read timed out\n"); in ftmac100_mdio_read()
789 static void ftmac100_mdio_write(struct net_device *netdev, int phy_id, int reg, in ftmac100_mdio_write() argument
792 struct ftmac100 *priv = netdev_priv(netdev); in ftmac100_mdio_write()
814 netdev_err(netdev, "mdio write timed out\n"); in ftmac100_mdio_write()
820 static void ftmac100_get_drvinfo(struct net_device *netdev, in ftmac100_get_drvinfo() argument
825 strlcpy(info->bus_info, dev_name(&netdev->dev), sizeof(info->bus_info)); in ftmac100_get_drvinfo()
828 static int ftmac100_get_settings(struct net_device *netdev, struct ethtool_cmd *cmd) in ftmac100_get_settings() argument
830 struct ftmac100 *priv = netdev_priv(netdev); in ftmac100_get_settings()
834 static int ftmac100_set_settings(struct net_device *netdev, struct ethtool_cmd *cmd) in ftmac100_set_settings() argument
836 struct ftmac100 *priv = netdev_priv(netdev); in ftmac100_set_settings()
840 static int ftmac100_nway_reset(struct net_device *netdev) in ftmac100_nway_reset() argument
842 struct ftmac100 *priv = netdev_priv(netdev); in ftmac100_nway_reset()
846 static u32 ftmac100_get_link(struct net_device *netdev) in ftmac100_get_link() argument
848 struct ftmac100 *priv = netdev_priv(netdev); in ftmac100_get_link()
865 struct net_device *netdev = dev_id; in ftmac100_interrupt() local
866 struct ftmac100 *priv = netdev_priv(netdev); in ftmac100_interrupt()
868 if (likely(netif_running(netdev))) { in ftmac100_interrupt()
883 struct net_device *netdev = priv->netdev; in ftmac100_poll() local
923 netdev_info(netdev, "[ISR] = 0x%x: %s%s%s%s\n", status, in ftmac100_poll()
931 netdev->stats.rx_over_errors++; in ftmac100_poll()
936 netdev->stats.rx_fifo_errors++; in ftmac100_poll()
957 static int ftmac100_open(struct net_device *netdev) in ftmac100_open() argument
959 struct ftmac100 *priv = netdev_priv(netdev); in ftmac100_open()
964 netdev_err(netdev, "failed to allocate buffers\n"); in ftmac100_open()
968 err = request_irq(priv->irq, ftmac100_interrupt, 0, netdev->name, netdev); in ftmac100_open()
970 netdev_err(netdev, "failed to request irq %d\n", priv->irq); in ftmac100_open()
984 netif_start_queue(netdev); in ftmac100_open()
991 free_irq(priv->irq, netdev); in ftmac100_open()
998 static int ftmac100_stop(struct net_device *netdev) in ftmac100_stop() argument
1000 struct ftmac100 *priv = netdev_priv(netdev); in ftmac100_stop()
1003 netif_stop_queue(netdev); in ftmac100_stop()
1006 free_irq(priv->irq, netdev); in ftmac100_stop()
1012 static int ftmac100_hard_start_xmit(struct sk_buff *skb, struct net_device *netdev) in ftmac100_hard_start_xmit() argument
1014 struct ftmac100 *priv = netdev_priv(netdev); in ftmac100_hard_start_xmit()
1019 netdev_dbg(netdev, "tx packet too big\n"); in ftmac100_hard_start_xmit()
1021 netdev->stats.tx_dropped++; in ftmac100_hard_start_xmit()
1030 netdev_err(netdev, "map socket buffer failed\n"); in ftmac100_hard_start_xmit()
1032 netdev->stats.tx_dropped++; in ftmac100_hard_start_xmit()
1041 static int ftmac100_do_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) in ftmac100_do_ioctl() argument
1043 struct ftmac100 *priv = netdev_priv(netdev); in ftmac100_do_ioctl()
1065 struct net_device *netdev; in ftmac100_probe() local
1081 netdev = alloc_etherdev(sizeof(*priv)); in ftmac100_probe()
1082 if (!netdev) { in ftmac100_probe()
1087 SET_NETDEV_DEV(netdev, &pdev->dev); in ftmac100_probe()
1088 netdev->ethtool_ops = &ftmac100_ethtool_ops; in ftmac100_probe()
1089 netdev->netdev_ops = &ftmac100_netdev_ops; in ftmac100_probe()
1091 platform_set_drvdata(pdev, netdev); in ftmac100_probe()
1094 priv = netdev_priv(netdev); in ftmac100_probe()
1095 priv->netdev = netdev; in ftmac100_probe()
1101 netif_napi_add(netdev, &priv->napi, ftmac100_poll, 64); in ftmac100_probe()
1125 priv->mii.dev = netdev; in ftmac100_probe()
1130 err = register_netdev(netdev); in ftmac100_probe()
1136 netdev_info(netdev, "irq %d, mapped at %p\n", priv->irq, priv->base); in ftmac100_probe()
1138 if (!is_valid_ether_addr(netdev->dev_addr)) { in ftmac100_probe()
1139 eth_hw_addr_random(netdev); in ftmac100_probe()
1140 netdev_info(netdev, "generated random MAC address %pM\n", in ftmac100_probe()
1141 netdev->dev_addr); in ftmac100_probe()
1152 free_netdev(netdev); in ftmac100_probe()
1159 struct net_device *netdev; in ftmac100_remove() local
1162 netdev = platform_get_drvdata(pdev); in ftmac100_remove()
1163 priv = netdev_priv(netdev); in ftmac100_remove()
1165 unregister_netdev(netdev); in ftmac100_remove()
1171 free_netdev(netdev); in ftmac100_remove()