Lines Matching refs:netdev

84 	struct net_device *netdev;
116 struct net_device *netdev = priv->netdev;
133 netdev_err(netdev, "Hardware reset failed\n");
154 netdev_err(priv->netdev, "Unknown speed %d !\n",
187 err = of_get_ethdev_address(priv->dev->of_node, priv->netdev);
192 priv->netdev->dev_addr);
207 eth_hw_addr_set(priv->netdev, mac);
210 eth_hw_addr_random(priv->netdev);
212 priv->netdev->dev_addr);
272 ftgmac100_write_mac_addr(priv, priv->netdev->dev_addr);
331 if (priv->netdev->flags & IFF_PROMISC)
333 if (priv->netdev->flags & IFF_ALLMULTI)
335 else if (netdev_mc_count(priv->netdev))
339 if (priv->netdev->features & NETIF_F_HW_VLAN_CTAG_RX)
357 netdev_for_each_mc_addr(ha, priv->netdev) {
368 static void ftgmac100_set_rx_mode(struct net_device *netdev)
370 struct ftgmac100 *priv = netdev_priv(netdev);
376 if (!netif_running(netdev))
390 struct net_device *netdev = priv->netdev;
395 skb = netdev_alloc_skb_ip_align(netdev, RX_BUF_SIZE);
398 netdev_warn(netdev, "failed to allocate rx skb\n");
406 netdev_err(netdev, "failed to map rx page\n");
440 struct net_device *netdev = priv->netdev;
443 netdev->stats.rx_errors++;
446 netdev->stats.rx_crc_errors++;
451 netdev->stats.rx_length_errors++;
456 struct net_device *netdev = priv->netdev;
515 netdev->stats.multicast++;
523 if (netdev->features & NETIF_F_RXCSUM) {
538 if ((netdev->features & NETIF_F_HW_VLAN_CTAG_RX) &&
561 skb->protocol = eth_type_trans(skb, netdev);
563 netdev->stats.rx_packets++;
564 netdev->stats.rx_bytes += size;
579 netdev->stats.rx_dropped++;
640 struct net_device *netdev = priv->netdev;
654 netdev->stats.tx_packets++;
655 netdev->stats.tx_bytes += skb->len;
666 struct net_device *netdev = priv->netdev;
675 if (unlikely(netif_queue_stopped(netdev) &&
679 txq = netdev_get_tx_queue(netdev, 0);
681 if (netif_queue_stopped(netdev) &&
683 netif_wake_queue(netdev);
709 struct net_device *netdev)
711 struct ftgmac100 *priv = netdev_priv(netdev);
719 netdev->stats.tx_dropped++;
726 netdev_dbg(netdev, "tx packet too big\n");
754 netdev_err(netdev, "map tx packet head failed\n");
820 netif_stop_queue(netdev);
824 netif_wake_queue(netdev);
834 netdev_err(netdev, "map tx fragment failed\n");
857 netdev->stats.tx_dropped++;
1000 struct net_device *netdev = bus->priv;
1001 struct ftgmac100 *priv = netdev_priv(netdev);
1029 netdev_err(netdev, "mdio read timed out\n");
1036 struct net_device *netdev = bus->priv;
1037 struct ftgmac100 *priv = netdev_priv(netdev);
1065 netdev_err(netdev, "mdio write timed out\n");
1069 static void ftgmac100_get_drvinfo(struct net_device *netdev,
1073 strscpy(info->bus_info, dev_name(&netdev->dev), sizeof(info->bus_info));
1077 ftgmac100_get_ringparam(struct net_device *netdev,
1082 struct ftgmac100 *priv = netdev_priv(netdev);
1092 ftgmac100_set_ringparam(struct net_device *netdev,
1097 struct ftgmac100 *priv = netdev_priv(netdev);
1109 if (netif_running(netdev))
1115 static void ftgmac100_get_pauseparam(struct net_device *netdev,
1118 struct ftgmac100 *priv = netdev_priv(netdev);
1125 static int ftgmac100_set_pauseparam(struct net_device *netdev,
1128 struct ftgmac100 *priv = netdev_priv(netdev);
1129 struct phy_device *phydev = netdev->phydev;
1138 if (netif_running(netdev)) {
1160 struct net_device *netdev = dev_id;
1161 struct ftgmac100 *priv = netdev_priv(netdev);
1171 netdev->stats.rx_over_errors++;
1175 netdev->stats.rx_fifo_errors++;
1179 netdev->stats.tx_fifo_errors++;
1184 netdev_warn(netdev,
1300 netif_start_queue(priv->netdev);
1310 struct net_device *netdev = priv->netdev;
1313 netdev_dbg(netdev, "Resetting NIC...\n");
1317 if (netdev->phydev)
1318 mutex_lock(&netdev->phydev->lock);
1324 if (!netif_running(netdev))
1328 netif_trans_update(netdev);
1330 netif_tx_disable(netdev);
1337 netdev_err(netdev, "attempting to continue...\n");
1346 netdev_dbg(netdev, "Reset done !\n");
1350 if (netdev->phydev)
1351 mutex_unlock(&netdev->phydev->lock);
1363 static void ftgmac100_adjust_link(struct net_device *netdev)
1365 struct ftgmac100 *priv = netdev_priv(netdev);
1366 struct phy_device *phydev = netdev->phydev;
1414 if (netdev->phydev)
1415 mutex_unlock(&netdev->phydev->lock);
1419 if (netdev->phydev)
1420 mutex_lock(&netdev->phydev->lock);
1424 static int ftgmac100_mii_probe(struct net_device *netdev)
1426 struct ftgmac100 *priv = netdev_priv(netdev);
1453 netdev_warn(netdev,
1460 netdev_info(netdev, "%s: no PHY found\n", netdev->name);
1464 phydev = phy_connect(netdev, phydev_name(phydev),
1468 netdev_err(netdev, "%s: Could not attach to PHY\n", netdev->name);
1483 static int ftgmac100_open(struct net_device *netdev)
1485 struct ftgmac100 *priv = netdev_priv(netdev);
1491 netdev_err(netdev, "Failed to allocate descriptors\n");
1515 netif_napi_add(netdev, &priv->napi, ftgmac100_poll);
1518 err = request_irq(netdev->irq, ftgmac100_interrupt, 0, netdev->name, netdev);
1520 netdev_err(netdev, "failed to request irq %d\n", netdev->irq);
1527 netdev_err(netdev, "Failed to allocate packet buffers\n");
1531 if (netdev->phydev) {
1533 phy_start(netdev->phydev);
1536 netif_carrier_on(netdev);
1548 netif_stop_queue(netdev);
1551 free_irq(netdev->irq, netdev);
1560 static int ftgmac100_stop(struct net_device *netdev)
1562 struct ftgmac100 *priv = netdev_priv(netdev);
1575 netif_stop_queue(netdev);
1578 if (netdev->phydev)
1579 phy_stop(netdev->phydev);
1584 free_irq(netdev->irq, netdev);
1591 static void ftgmac100_tx_timeout(struct net_device *netdev, unsigned int txqueue)
1593 struct ftgmac100 *priv = netdev_priv(netdev);
1602 static int ftgmac100_set_features(struct net_device *netdev,
1605 struct ftgmac100 *priv = netdev_priv(netdev);
1606 netdev_features_t changed = netdev->features ^ features;
1608 if (!netif_running(netdev))
1616 if (priv->netdev->features & NETIF_F_HW_VLAN_CTAG_RX)
1627 static void ftgmac100_poll_controller(struct net_device *netdev)
1632 ftgmac100_interrupt(netdev->irq, netdev);
1654 static int ftgmac100_setup_mdio(struct net_device *netdev)
1656 struct ftgmac100 *priv = netdev_priv(netdev);
1684 priv->mii_bus->priv = priv->netdev;
1708 static void ftgmac100_phy_disconnect(struct net_device *netdev)
1710 struct ftgmac100 *priv = netdev_priv(netdev);
1712 if (!netdev->phydev)
1715 phy_disconnect(netdev->phydev);
1720 static void ftgmac100_destroy_mdio(struct net_device *netdev)
1722 struct ftgmac100 *priv = netdev_priv(netdev);
1794 struct net_device *netdev;
1808 netdev = alloc_etherdev(sizeof(*priv));
1809 if (!netdev) {
1814 SET_NETDEV_DEV(netdev, &pdev->dev);
1816 netdev->ethtool_ops = &ftgmac100_ethtool_ops;
1817 netdev->netdev_ops = &ftgmac100_netdev_ops;
1818 netdev->watchdog_timeo = 5 * HZ;
1820 platform_set_drvdata(pdev, netdev);
1823 priv = netdev_priv(netdev);
1824 priv->netdev = netdev;
1844 netdev->irq = irq;
1877 priv->ndev = ncsi_register_dev(netdev, ftgmac100_ncsi_handler);
1891 phy = of_phy_get_and_connect(priv->netdev, np,
1911 err = ftgmac100_setup_mdio(netdev);
1916 phy = of_phy_get_and_connect(priv->netdev, np,
1938 err = ftgmac100_setup_mdio(netdev);
1942 err = ftgmac100_mii_probe(netdev);
1966 netdev->hw_features = NETIF_F_RXCSUM | NETIF_F_HW_CSUM |
1971 netdev->hw_features |= NETIF_F_HW_VLAN_CTAG_FILTER;
1975 netdev->hw_features &= ~NETIF_F_HW_CSUM;
1979 netdev->hw_features &= ~NETIF_F_HW_CSUM;
1982 netdev->hw_features &= ~(NETIF_F_HW_CSUM | NETIF_F_RXCSUM);
1983 netdev->features |= netdev->hw_features;
1986 err = register_netdev(netdev);
1988 dev_err(&pdev->dev, "Failed to register netdev\n");
1992 netdev_info(netdev, "irq %d, mapped at %p\n", netdev->irq, priv->base);
2000 ftgmac100_phy_disconnect(netdev);
2004 ftgmac100_destroy_mdio(netdev);
2010 free_netdev(netdev);
2017 struct net_device *netdev;
2020 netdev = platform_get_drvdata(pdev);
2021 priv = netdev_priv(netdev);
2025 unregister_netdev(netdev);
2035 ftgmac100_phy_disconnect(netdev);
2036 ftgmac100_destroy_mdio(netdev);
2042 free_netdev(netdev);