Lines Matching refs:net_dev
136 struct net_device *net_dev = bgmac->net_dev; in bgmac_dma_tx_add() local
144 netdev_err(bgmac->net_dev, "Too long skb (%d)\n", skb->len); in bgmac_dma_tx_add()
157 netdev_err(bgmac->net_dev, "TX ring is full, queue should be stopped!\n"); in bgmac_dma_tx_add()
158 netif_stop_queue(net_dev); in bgmac_dma_tx_add()
192 netdev_sent_queue(net_dev, skb->len); in bgmac_dma_tx_add()
206 netif_stop_queue(net_dev); in bgmac_dma_tx_add()
224 netdev_err(bgmac->net_dev, "Mapping error of skb on ring 0x%X\n", in bgmac_dma_tx_add()
229 net_dev->stats.tx_dropped++; in bgmac_dma_tx_add()
230 net_dev->stats.tx_errors++; in bgmac_dma_tx_add()
269 bgmac->net_dev->stats.tx_bytes += slot->skb->len; in bgmac_dma_tx_free()
270 bgmac->net_dev->stats.tx_packets++; in bgmac_dma_tx_free()
286 netdev_completed_queue(bgmac->net_dev, pkts_compl, bytes_compl); in bgmac_dma_tx_free()
288 if (netif_queue_stopped(bgmac->net_dev)) in bgmac_dma_tx_free()
289 netif_wake_queue(bgmac->net_dev); in bgmac_dma_tx_free()
355 netdev_err(bgmac->net_dev, "DMA mapping error\n"); in bgmac_dma_rx_skb_for_slot()
450 netdev_err(bgmac->net_dev, "Found poisoned packet at slot %d, DMA issue!\n", in bgmac_dma_rx_read()
453 bgmac->net_dev->stats.rx_errors++; in bgmac_dma_rx_read()
458 netdev_err(bgmac->net_dev, "Found oversized packet at slot %d, DMA issue!\n", in bgmac_dma_rx_read()
461 bgmac->net_dev->stats.rx_length_errors++; in bgmac_dma_rx_read()
462 bgmac->net_dev->stats.rx_errors++; in bgmac_dma_rx_read()
471 netdev_err(bgmac->net_dev, "build_skb failed\n"); in bgmac_dma_rx_read()
473 bgmac->net_dev->stats.rx_errors++; in bgmac_dma_rx_read()
482 skb->protocol = eth_type_trans(skb, bgmac->net_dev); in bgmac_dma_rx_read()
483 bgmac->net_dev->stats.rx_bytes += len; in bgmac_dma_rx_read()
484 bgmac->net_dev->stats.rx_packets++; in bgmac_dma_rx_read()
781 static void bgmac_set_rx_mode(struct net_device *net_dev) in bgmac_set_rx_mode() argument
783 struct bgmac *bgmac = netdev_priv(net_dev); in bgmac_set_rx_mode()
785 if (net_dev->flags & IFF_PROMISC) in bgmac_set_rx_mode()
1030 netdev_reset_queue(bgmac->net_dev); in bgmac_chip_reset()
1110 bgmac_set_rx_mode(bgmac->net_dev); in bgmac_chip_init()
1112 bgmac_write_mac_address(bgmac, bgmac->net_dev->dev_addr); in bgmac_chip_init()
1175 static int bgmac_open(struct net_device *net_dev) in bgmac_open() argument
1177 struct bgmac *bgmac = netdev_priv(net_dev); in bgmac_open()
1190 net_dev->name, net_dev); in bgmac_open()
1198 phy_start(net_dev->phydev); in bgmac_open()
1200 netif_start_queue(net_dev); in bgmac_open()
1205 static int bgmac_stop(struct net_device *net_dev) in bgmac_stop() argument
1207 struct bgmac *bgmac = netdev_priv(net_dev); in bgmac_stop()
1209 netif_carrier_off(net_dev); in bgmac_stop()
1211 phy_stop(net_dev->phydev); in bgmac_stop()
1215 free_irq(bgmac->irq, net_dev); in bgmac_stop()
1224 struct net_device *net_dev) in bgmac_start_xmit() argument
1226 struct bgmac *bgmac = netdev_priv(net_dev); in bgmac_start_xmit()
1234 static int bgmac_set_mac_address(struct net_device *net_dev, void *addr) in bgmac_set_mac_address() argument
1236 struct bgmac *bgmac = netdev_priv(net_dev); in bgmac_set_mac_address()
1240 ret = eth_prepare_mac_addr_change(net_dev, addr); in bgmac_set_mac_address()
1244 eth_hw_addr_set(net_dev, sa->sa_data); in bgmac_set_mac_address()
1245 bgmac_write_mac_address(bgmac, net_dev->dev_addr); in bgmac_set_mac_address()
1247 eth_commit_mac_addr_change(net_dev, addr); in bgmac_set_mac_address()
1251 static int bgmac_change_mtu(struct net_device *net_dev, int mtu) in bgmac_change_mtu() argument
1253 struct bgmac *bgmac = netdev_priv(net_dev); in bgmac_change_mtu()
1395 static void bgmac_get_drvinfo(struct net_device *net_dev, in bgmac_get_drvinfo() argument
1415 void bgmac_adjust_link(struct net_device *net_dev) in bgmac_adjust_link() argument
1417 struct bgmac *bgmac = netdev_priv(net_dev); in bgmac_adjust_link()
1418 struct phy_device *phy_dev = net_dev->phydev; in bgmac_adjust_link()
1456 err = phy_connect_direct(bgmac->net_dev, phy_dev, bgmac_adjust_link, in bgmac_phy_connect_direct()
1469 struct net_device *net_dev; in bgmac_alloc() local
1473 net_dev = devm_alloc_etherdev(dev, sizeof(*bgmac)); in bgmac_alloc()
1474 if (!net_dev) in bgmac_alloc()
1477 net_dev->netdev_ops = &bgmac_netdev_ops; in bgmac_alloc()
1478 net_dev->ethtool_ops = &bgmac_ethtool_ops; in bgmac_alloc()
1480 bgmac = netdev_priv(net_dev); in bgmac_alloc()
1482 bgmac->net_dev = net_dev; in bgmac_alloc()
1490 struct net_device *net_dev = bgmac->net_dev; in bgmac_enet_probe() local
1495 net_dev->irq = bgmac->irq; in bgmac_enet_probe()
1496 SET_NETDEV_DEV(net_dev, bgmac->dev); in bgmac_enet_probe()
1499 if (!is_valid_ether_addr(net_dev->dev_addr)) { in bgmac_enet_probe()
1501 net_dev->dev_addr); in bgmac_enet_probe()
1502 eth_hw_addr_random(net_dev); in bgmac_enet_probe()
1504 net_dev->dev_addr); in bgmac_enet_probe()
1532 netif_napi_add(net_dev, &bgmac->napi, bgmac_poll, BGMAC_WEIGHT); in bgmac_enet_probe()
1540 net_dev->features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; in bgmac_enet_probe()
1541 net_dev->hw_features = net_dev->features; in bgmac_enet_probe()
1542 net_dev->vlan_features = net_dev->features; in bgmac_enet_probe()
1545 net_dev->max_mtu = BGMAC_RX_MAX_FRAME_SIZE - ETH_FCS_LEN; in bgmac_enet_probe()
1549 err = register_netdev(bgmac->net_dev); in bgmac_enet_probe()
1555 netif_carrier_off(net_dev); in bgmac_enet_probe()
1560 phy_disconnect(net_dev->phydev); in bgmac_enet_probe()
1571 unregister_netdev(bgmac->net_dev); in bgmac_enet_remove()
1572 phy_disconnect(bgmac->net_dev->phydev); in bgmac_enet_remove()
1580 if (!netif_running(bgmac->net_dev)) in bgmac_enet_suspend()
1583 phy_stop(bgmac->net_dev->phydev); in bgmac_enet_suspend()
1585 netif_stop_queue(bgmac->net_dev); in bgmac_enet_suspend()
1589 netif_tx_lock(bgmac->net_dev); in bgmac_enet_suspend()
1590 netif_device_detach(bgmac->net_dev); in bgmac_enet_suspend()
1591 netif_tx_unlock(bgmac->net_dev); in bgmac_enet_suspend()
1605 if (!netif_running(bgmac->net_dev)) in bgmac_enet_resume()
1616 netif_tx_lock(bgmac->net_dev); in bgmac_enet_resume()
1617 netif_device_attach(bgmac->net_dev); in bgmac_enet_resume()
1618 netif_tx_unlock(bgmac->net_dev); in bgmac_enet_resume()
1620 netif_start_queue(bgmac->net_dev); in bgmac_enet_resume()
1622 phy_start(bgmac->net_dev->phydev); in bgmac_enet_resume()