• Home
  • Raw
  • Download

Lines Matching refs:netdev

84 	struct net_device *netdev;  member
116 struct net_device *netdev = priv->netdev; in ftgmac100_reset_mac() local
133 netdev_err(netdev, "Hardware reset failed\n"); in ftgmac100_reset_mac()
154 netdev_err(priv->netdev, "Unknown speed %d !\n", in ftgmac100_reset_and_config_mac()
189 ether_addr_copy(priv->netdev->dev_addr, mac); in ftgmac100_initial_mac()
206 ether_addr_copy(priv->netdev->dev_addr, mac); in ftgmac100_initial_mac()
209 eth_hw_addr_random(priv->netdev); in ftgmac100_initial_mac()
211 priv->netdev->dev_addr); in ftgmac100_initial_mac()
269 ftgmac100_write_mac_addr(priv, priv->netdev->dev_addr); in ftgmac100_init_hw()
328 if (priv->netdev->flags & IFF_PROMISC) in ftgmac100_start_hw()
330 if (priv->netdev->flags & IFF_ALLMULTI) in ftgmac100_start_hw()
332 else if (netdev_mc_count(priv->netdev)) in ftgmac100_start_hw()
336 if (priv->netdev->features & NETIF_F_HW_VLAN_CTAG_RX) in ftgmac100_start_hw()
354 netdev_for_each_mc_addr(ha, priv->netdev) { in ftgmac100_calc_mc_hash()
365 static void ftgmac100_set_rx_mode(struct net_device *netdev) in ftgmac100_set_rx_mode() argument
367 struct ftgmac100 *priv = netdev_priv(netdev); in ftgmac100_set_rx_mode()
373 if (!netif_running(netdev)) in ftgmac100_set_rx_mode()
387 struct net_device *netdev = priv->netdev; in ftgmac100_alloc_rx_buf() local
392 skb = netdev_alloc_skb_ip_align(netdev, RX_BUF_SIZE); in ftgmac100_alloc_rx_buf()
395 netdev_warn(netdev, "failed to allocate rx skb\n"); in ftgmac100_alloc_rx_buf()
403 netdev_err(netdev, "failed to map rx page\n"); in ftgmac100_alloc_rx_buf()
437 struct net_device *netdev = priv->netdev; in ftgmac100_rx_packet_error() local
440 netdev->stats.rx_errors++; in ftgmac100_rx_packet_error()
443 netdev->stats.rx_crc_errors++; in ftgmac100_rx_packet_error()
448 netdev->stats.rx_length_errors++; in ftgmac100_rx_packet_error()
453 struct net_device *netdev = priv->netdev; in ftgmac100_rx_packet() local
512 netdev->stats.multicast++; in ftgmac100_rx_packet()
520 if (netdev->features & NETIF_F_RXCSUM) { in ftgmac100_rx_packet()
535 if ((netdev->features & NETIF_F_HW_VLAN_CTAG_RX) && in ftgmac100_rx_packet()
558 skb->protocol = eth_type_trans(skb, netdev); in ftgmac100_rx_packet()
560 netdev->stats.rx_packets++; in ftgmac100_rx_packet()
561 netdev->stats.rx_bytes += size; in ftgmac100_rx_packet()
576 netdev->stats.rx_dropped++; in ftgmac100_rx_packet()
637 struct net_device *netdev = priv->netdev; in ftgmac100_tx_complete_packet() local
651 netdev->stats.tx_packets++; in ftgmac100_tx_complete_packet()
652 netdev->stats.tx_bytes += skb->len; in ftgmac100_tx_complete_packet()
663 struct net_device *netdev = priv->netdev; in ftgmac100_tx_complete() local
672 if (unlikely(netif_queue_stopped(netdev) && in ftgmac100_tx_complete()
676 txq = netdev_get_tx_queue(netdev, 0); in ftgmac100_tx_complete()
678 if (netif_queue_stopped(netdev) && in ftgmac100_tx_complete()
680 netif_wake_queue(netdev); in ftgmac100_tx_complete()
706 struct net_device *netdev) in ftgmac100_hard_start_xmit() argument
708 struct ftgmac100 *priv = netdev_priv(netdev); in ftgmac100_hard_start_xmit()
716 netdev->stats.tx_dropped++; in ftgmac100_hard_start_xmit()
723 netdev_dbg(netdev, "tx packet too big\n"); in ftgmac100_hard_start_xmit()
751 netdev_err(netdev, "map tx packet head failed\n"); in ftgmac100_hard_start_xmit()
817 netif_stop_queue(netdev); in ftgmac100_hard_start_xmit()
821 netif_wake_queue(netdev); in ftgmac100_hard_start_xmit()
831 netdev_err(netdev, "map tx fragment failed\n"); in ftgmac100_hard_start_xmit()
854 netdev->stats.tx_dropped++; in ftgmac100_hard_start_xmit()
995 static void ftgmac100_adjust_link(struct net_device *netdev) in ftgmac100_adjust_link() argument
997 struct ftgmac100 *priv = netdev_priv(netdev); in ftgmac100_adjust_link()
998 struct phy_device *phydev = netdev->phydev; in ftgmac100_adjust_link()
1049 struct net_device *netdev = priv->netdev; in ftgmac100_mii_probe() local
1054 netdev_info(netdev, "%s: no PHY found\n", netdev->name); in ftgmac100_mii_probe()
1058 phydev = phy_connect(netdev, phydev_name(phydev), in ftgmac100_mii_probe()
1062 netdev_err(netdev, "%s: Could not attach to PHY\n", netdev->name); in ftgmac100_mii_probe()
1079 struct net_device *netdev = bus->priv; in ftgmac100_mdiobus_read() local
1080 struct ftgmac100 *priv = netdev_priv(netdev); in ftgmac100_mdiobus_read()
1108 netdev_err(netdev, "mdio read timed out\n"); in ftgmac100_mdiobus_read()
1115 struct net_device *netdev = bus->priv; in ftgmac100_mdiobus_write() local
1116 struct ftgmac100 *priv = netdev_priv(netdev); in ftgmac100_mdiobus_write()
1144 netdev_err(netdev, "mdio write timed out\n"); in ftgmac100_mdiobus_write()
1148 static void ftgmac100_get_drvinfo(struct net_device *netdev, in ftgmac100_get_drvinfo() argument
1152 strlcpy(info->bus_info, dev_name(&netdev->dev), sizeof(info->bus_info)); in ftgmac100_get_drvinfo()
1155 static void ftgmac100_get_ringparam(struct net_device *netdev, in ftgmac100_get_ringparam() argument
1158 struct ftgmac100 *priv = netdev_priv(netdev); in ftgmac100_get_ringparam()
1167 static int ftgmac100_set_ringparam(struct net_device *netdev, in ftgmac100_set_ringparam() argument
1170 struct ftgmac100 *priv = netdev_priv(netdev); in ftgmac100_set_ringparam()
1182 if (netif_running(netdev)) in ftgmac100_set_ringparam()
1188 static void ftgmac100_get_pauseparam(struct net_device *netdev, in ftgmac100_get_pauseparam() argument
1191 struct ftgmac100 *priv = netdev_priv(netdev); in ftgmac100_get_pauseparam()
1198 static int ftgmac100_set_pauseparam(struct net_device *netdev, in ftgmac100_set_pauseparam() argument
1201 struct ftgmac100 *priv = netdev_priv(netdev); in ftgmac100_set_pauseparam()
1202 struct phy_device *phydev = netdev->phydev; in ftgmac100_set_pauseparam()
1211 if (netif_running(netdev)) { in ftgmac100_set_pauseparam()
1233 struct net_device *netdev = dev_id; in ftgmac100_interrupt() local
1234 struct ftgmac100 *priv = netdev_priv(netdev); in ftgmac100_interrupt()
1244 netdev->stats.rx_over_errors++; in ftgmac100_interrupt()
1248 netdev->stats.rx_fifo_errors++; in ftgmac100_interrupt()
1252 netdev->stats.tx_fifo_errors++; in ftgmac100_interrupt()
1257 netdev_warn(netdev, in ftgmac100_interrupt()
1373 netif_start_queue(priv->netdev); in ftgmac100_init_all()
1385 struct net_device *netdev = priv->netdev; in ftgmac100_reset_task() local
1388 netdev_dbg(netdev, "Resetting NIC...\n"); in ftgmac100_reset_task()
1392 if (netdev->phydev) in ftgmac100_reset_task()
1393 mutex_lock(&netdev->phydev->lock); in ftgmac100_reset_task()
1399 if (!netif_running(netdev)) in ftgmac100_reset_task()
1403 netif_trans_update(netdev); in ftgmac100_reset_task()
1405 netif_tx_disable(netdev); in ftgmac100_reset_task()
1412 netdev_err(netdev, "attempting to continue...\n"); in ftgmac100_reset_task()
1421 netdev_dbg(netdev, "Reset done !\n"); in ftgmac100_reset_task()
1425 if (netdev->phydev) in ftgmac100_reset_task()
1426 mutex_unlock(&netdev->phydev->lock); in ftgmac100_reset_task()
1430 static int ftgmac100_open(struct net_device *netdev) in ftgmac100_open() argument
1432 struct ftgmac100 *priv = netdev_priv(netdev); in ftgmac100_open()
1438 netdev_err(netdev, "Failed to allocate descriptors\n"); in ftgmac100_open()
1462 netif_napi_add(netdev, &priv->napi, ftgmac100_poll, 64); in ftgmac100_open()
1465 err = request_irq(netdev->irq, ftgmac100_interrupt, 0, netdev->name, netdev); in ftgmac100_open()
1467 netdev_err(netdev, "failed to request irq %d\n", netdev->irq); in ftgmac100_open()
1474 netdev_err(netdev, "Failed to allocate packet buffers\n"); in ftgmac100_open()
1478 if (netdev->phydev) { in ftgmac100_open()
1480 phy_start(netdev->phydev); in ftgmac100_open()
1483 netif_carrier_on(netdev); in ftgmac100_open()
1495 netif_stop_queue(netdev); in ftgmac100_open()
1498 free_irq(netdev->irq, netdev); in ftgmac100_open()
1507 static int ftgmac100_stop(struct net_device *netdev) in ftgmac100_stop() argument
1509 struct ftgmac100 *priv = netdev_priv(netdev); in ftgmac100_stop()
1522 netif_stop_queue(netdev); in ftgmac100_stop()
1525 if (netdev->phydev) in ftgmac100_stop()
1526 phy_stop(netdev->phydev); in ftgmac100_stop()
1531 free_irq(netdev->irq, netdev); in ftgmac100_stop()
1538 static void ftgmac100_tx_timeout(struct net_device *netdev, unsigned int txqueue) in ftgmac100_tx_timeout() argument
1540 struct ftgmac100 *priv = netdev_priv(netdev); in ftgmac100_tx_timeout()
1549 static int ftgmac100_set_features(struct net_device *netdev, in ftgmac100_set_features() argument
1552 struct ftgmac100 *priv = netdev_priv(netdev); in ftgmac100_set_features()
1553 netdev_features_t changed = netdev->features ^ features; in ftgmac100_set_features()
1555 if (!netif_running(netdev)) in ftgmac100_set_features()
1563 if (priv->netdev->features & NETIF_F_HW_VLAN_CTAG_RX) in ftgmac100_set_features()
1574 static void ftgmac100_poll_controller(struct net_device *netdev) in ftgmac100_poll_controller() argument
1579 ftgmac100_interrupt(netdev->irq, netdev); in ftgmac100_poll_controller()
1601 static int ftgmac100_setup_mdio(struct net_device *netdev) in ftgmac100_setup_mdio() argument
1603 struct ftgmac100 *priv = netdev_priv(netdev); in ftgmac100_setup_mdio()
1654 netdev_warn(netdev, in ftgmac100_setup_mdio()
1664 priv->mii_bus->priv = priv->netdev; in ftgmac100_setup_mdio()
1692 static void ftgmac100_destroy_mdio(struct net_device *netdev) in ftgmac100_destroy_mdio() argument
1694 struct ftgmac100 *priv = netdev_priv(netdev); in ftgmac100_destroy_mdio()
1696 if (!netdev->phydev) in ftgmac100_destroy_mdio()
1699 phy_disconnect(netdev->phydev); in ftgmac100_destroy_mdio()
1767 struct net_device *netdev; in ftgmac100_probe() local
1781 netdev = alloc_etherdev(sizeof(*priv)); in ftgmac100_probe()
1782 if (!netdev) { in ftgmac100_probe()
1787 SET_NETDEV_DEV(netdev, &pdev->dev); in ftgmac100_probe()
1789 netdev->ethtool_ops = &ftgmac100_ethtool_ops; in ftgmac100_probe()
1790 netdev->netdev_ops = &ftgmac100_netdev_ops; in ftgmac100_probe()
1791 netdev->watchdog_timeo = 5 * HZ; in ftgmac100_probe()
1793 platform_set_drvdata(pdev, netdev); in ftgmac100_probe()
1796 priv = netdev_priv(netdev); in ftgmac100_probe()
1797 priv->netdev = netdev; in ftgmac100_probe()
1817 netdev->irq = irq; in ftgmac100_probe()
1853 priv->ndev = ncsi_register_dev(netdev, ftgmac100_ncsi_handler); in ftgmac100_probe()
1861 phy = of_phy_get_and_connect(priv->netdev, np, in ftgmac100_probe()
1883 err = ftgmac100_setup_mdio(netdev); in ftgmac100_probe()
1899 netdev->hw_features = NETIF_F_RXCSUM | NETIF_F_HW_CSUM | in ftgmac100_probe()
1904 netdev->hw_features |= NETIF_F_HW_VLAN_CTAG_FILTER; in ftgmac100_probe()
1908 netdev->hw_features &= ~NETIF_F_HW_CSUM; in ftgmac100_probe()
1912 netdev->hw_features &= ~NETIF_F_HW_CSUM; in ftgmac100_probe()
1915 netdev->hw_features &= ~(NETIF_F_HW_CSUM | NETIF_F_RXCSUM); in ftgmac100_probe()
1916 netdev->features |= netdev->hw_features; in ftgmac100_probe()
1919 err = register_netdev(netdev); in ftgmac100_probe()
1925 netdev_info(netdev, "irq %d, mapped at %p\n", netdev->irq, priv->base); in ftgmac100_probe()
1935 ftgmac100_destroy_mdio(netdev); in ftgmac100_probe()
1941 free_netdev(netdev); in ftgmac100_probe()
1948 struct net_device *netdev; in ftgmac100_remove() local
1951 netdev = platform_get_drvdata(pdev); in ftgmac100_remove()
1952 priv = netdev_priv(netdev); in ftgmac100_remove()
1956 unregister_netdev(netdev); in ftgmac100_remove()
1966 ftgmac100_destroy_mdio(netdev); in ftgmac100_remove()
1972 free_netdev(netdev); in ftgmac100_remove()