• Home
  • Raw
  • Download

Lines Matching refs:netdev

77 static int change_mac_addr(struct net_device *netdev, const u8 *addr);
132 struct net_device *netdev = nic_dev->netdev; in create_txqs() local
137 nic_dev->txqs = devm_kcalloc(&netdev->dev, num_txqs, in create_txqs()
147 err = hinic_init_txq(&nic_dev->txqs[i], sq, netdev); in create_txqs()
149 netif_err(nic_dev, drv, netdev, in create_txqs()
156 netif_err(nic_dev, drv, netdev, in create_txqs()
175 devm_kfree(&netdev->dev, nic_dev->txqs); in create_txqs()
204 struct net_device *netdev = nic_dev->netdev; in free_txqs() local
216 devm_kfree(&netdev->dev, nic_dev->txqs); in free_txqs()
229 struct net_device *netdev = nic_dev->netdev; in create_rxqs() local
234 nic_dev->rxqs = devm_kcalloc(&netdev->dev, num_rxqs, in create_rxqs()
244 err = hinic_init_rxq(&nic_dev->rxqs[i], rq, netdev); in create_rxqs()
246 netif_err(nic_dev, drv, netdev, in create_rxqs()
253 netif_err(nic_dev, drv, netdev, in create_rxqs()
271 devm_kfree(&netdev->dev, nic_dev->rxqs); in create_rxqs()
282 struct net_device *netdev = nic_dev->netdev; in free_rxqs() local
294 devm_kfree(&netdev->dev, nic_dev->rxqs); in free_rxqs()
370 struct net_device *netdev = nic_dev->netdev; in hinic_enable_rss() local
388 netif_err(nic_dev, drv, netdev, in hinic_enable_rss()
419 netif_err(nic_dev, drv, netdev, "Failed to init rss\n"); in hinic_enable_rss()
422 int hinic_open(struct net_device *netdev) in hinic_open() argument
424 struct hinic_dev *nic_dev = netdev_priv(netdev); in hinic_open()
432 netif_err(nic_dev, drv, netdev, in hinic_open()
440 netif_err(nic_dev, drv, netdev, in hinic_open()
449 netif_err(nic_dev, drv, netdev, in hinic_open()
458 netif_err(nic_dev, drv, nic_dev->netdev, in hinic_open()
463 netif_set_real_num_tx_queues(netdev, nic_dev->num_qps); in hinic_open()
464 netif_set_real_num_rx_queues(netdev, nic_dev->num_qps); in hinic_open()
468 netif_err(nic_dev, drv, netdev, in hinic_open()
475 netif_err(nic_dev, drv, netdev, in hinic_open()
484 netif_err(nic_dev, drv, netdev, "Failed to get link state\n"); in hinic_open()
501 netif_info(nic_dev, drv, netdev, "link + intf UP\n"); in hinic_open()
502 netif_carrier_on(netdev); in hinic_open()
503 netif_tx_wake_all_queues(netdev); in hinic_open()
508 netif_info(nic_dev, drv, netdev, "HINIC_INTF is UP\n"); in hinic_open()
515 netif_warn(nic_dev, drv, netdev, in hinic_open()
521 netif_warn(nic_dev, drv, netdev, in hinic_open()
540 int hinic_close(struct net_device *netdev) in hinic_close() argument
542 struct hinic_dev *nic_dev = netdev_priv(netdev); in hinic_close()
553 netif_carrier_off(netdev); in hinic_close()
554 netif_tx_disable(netdev); in hinic_close()
576 netif_info(nic_dev, drv, netdev, "HINIC_INTF is DOWN\n"); in hinic_close()
580 static int hinic_change_mtu(struct net_device *netdev, int new_mtu) in hinic_change_mtu() argument
582 struct hinic_dev *nic_dev = netdev_priv(netdev); in hinic_change_mtu()
585 netif_info(nic_dev, drv, netdev, "set_mtu = %d\n", new_mtu); in hinic_change_mtu()
589 netif_err(nic_dev, drv, netdev, "Failed to set port mtu\n"); in hinic_change_mtu()
591 netdev->mtu = new_mtu; in hinic_change_mtu()
603 static int change_mac_addr(struct net_device *netdev, const u8 *addr) in change_mac_addr() argument
605 struct hinic_dev *nic_dev = netdev_priv(netdev); in change_mac_addr()
612 netif_info(nic_dev, drv, netdev, "change mac addr = %02x %02x %02x %02x %02x %02x\n", in change_mac_addr()
618 err = hinic_port_del_mac(nic_dev, netdev->dev_addr, vid); in change_mac_addr()
620 netif_err(nic_dev, drv, netdev, in change_mac_addr()
627 netif_err(nic_dev, drv, netdev, "Failed to add mac\n"); in change_mac_addr()
638 static int hinic_set_mac_addr(struct net_device *netdev, void *addr) in hinic_set_mac_addr() argument
646 err = change_mac_addr(netdev, new_mac); in hinic_set_mac_addr()
648 memcpy(netdev->dev_addr, new_mac, ETH_ALEN); in hinic_set_mac_addr()
660 static int add_mac_addr(struct net_device *netdev, const u8 *addr) in add_mac_addr() argument
662 struct hinic_dev *nic_dev = netdev_priv(netdev); in add_mac_addr()
666 netif_info(nic_dev, drv, netdev, "set mac addr = %02x %02x %02x %02x %02x %02x\n", in add_mac_addr()
674 netif_err(nic_dev, drv, netdev, "Failed to add mac\n"); in add_mac_addr()
692 static int remove_mac_addr(struct net_device *netdev, const u8 *addr) in remove_mac_addr() argument
694 struct hinic_dev *nic_dev = netdev_priv(netdev); in remove_mac_addr()
701 netif_info(nic_dev, drv, netdev, "remove mac addr = %02x %02x %02x %02x %02x %02x\n", in remove_mac_addr()
709 netif_err(nic_dev, drv, netdev, in remove_mac_addr()
721 static int hinic_vlan_rx_add_vid(struct net_device *netdev, in hinic_vlan_rx_add_vid() argument
724 struct hinic_dev *nic_dev = netdev_priv(netdev); in hinic_vlan_rx_add_vid()
727 netif_info(nic_dev, drv, netdev, "add vid = %d\n", vid); in hinic_vlan_rx_add_vid()
733 netif_err(nic_dev, drv, netdev, "Failed to add vlan\n"); in hinic_vlan_rx_add_vid()
737 err = hinic_port_add_mac(nic_dev, netdev->dev_addr, vid); in hinic_vlan_rx_add_vid()
739 netif_err(nic_dev, drv, netdev, "Failed to set mac\n"); in hinic_vlan_rx_add_vid()
751 netif_err(nic_dev, drv, netdev, in hinic_vlan_rx_add_vid()
759 static int hinic_vlan_rx_kill_vid(struct net_device *netdev, in hinic_vlan_rx_kill_vid() argument
762 struct hinic_dev *nic_dev = netdev_priv(netdev); in hinic_vlan_rx_kill_vid()
765 netif_info(nic_dev, drv, netdev, "remove vid = %d\n", vid); in hinic_vlan_rx_kill_vid()
771 netif_err(nic_dev, drv, netdev, "Failed to delete vlan\n"); in hinic_vlan_rx_kill_vid()
792 __dev_uc_sync(nic_dev->netdev, add_mac_addr, remove_mac_addr); in set_rx_mode()
793 __dev_mc_sync(nic_dev->netdev, add_mac_addr, remove_mac_addr); in set_rx_mode()
796 static void hinic_set_rx_mode(struct net_device *netdev) in hinic_set_rx_mode() argument
798 struct hinic_dev *nic_dev = netdev_priv(netdev); in hinic_set_rx_mode()
808 if (netdev->flags & IFF_PROMISC) { in hinic_set_rx_mode()
811 } else if (netdev->flags & IFF_ALLMULTI) { in hinic_set_rx_mode()
820 static void hinic_tx_timeout(struct net_device *netdev, unsigned int txqueue) in hinic_tx_timeout() argument
822 struct hinic_dev *nic_dev = netdev_priv(netdev); in hinic_tx_timeout()
829 netif_err(nic_dev, drv, netdev, "Tx timeout\n"); in hinic_tx_timeout()
832 if (!netif_xmit_stopped(netdev_get_tx_queue(netdev, q_id))) in hinic_tx_timeout()
839 netif_err(nic_dev, drv, netdev, "Txq%d: sw_pi: %d, hw_ci: %d, sw_ci: %d, napi->state: 0x%lx\n", in hinic_tx_timeout()
845 static void hinic_get_stats64(struct net_device *netdev, in hinic_get_stats64() argument
848 struct hinic_dev *nic_dev = netdev_priv(netdev); in hinic_get_stats64()
864 static int hinic_set_features(struct net_device *netdev, in hinic_set_features() argument
867 struct hinic_dev *nic_dev = netdev_priv(netdev); in hinic_set_features()
869 return set_features(nic_dev, nic_dev->netdev->features, in hinic_set_features()
873 static netdev_features_t hinic_fix_features(struct net_device *netdev, in hinic_fix_features() argument
876 struct hinic_dev *nic_dev = netdev_priv(netdev); in hinic_fix_features()
880 netif_info(nic_dev, drv, netdev, "disabling LRO as RXCSUM is off\n"); in hinic_fix_features()
926 static void netdev_features_init(struct net_device *netdev) in netdev_features_init() argument
928 netdev->hw_features = NETIF_F_SG | NETIF_F_HIGHDMA | NETIF_F_IP_CSUM | in netdev_features_init()
934 netdev->vlan_features = netdev->hw_features; in netdev_features_init()
936 netdev->features = netdev->hw_features | NETIF_F_HW_VLAN_CTAG_FILTER; in netdev_features_init()
938 netdev->hw_enc_features = NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | NETIF_F_SCTP_CRC | in netdev_features_init()
990 netif_carrier_on(nic_dev->netdev); in link_status_event_handler()
991 netif_tx_wake_all_queues(nic_dev->netdev); in link_status_event_handler()
999 netif_info(nic_dev, drv, nic_dev->netdev, "HINIC_Link is UP\n"); in link_status_event_handler()
1005 netif_carrier_off(nic_dev->netdev); in link_status_event_handler()
1006 netif_tx_disable(nic_dev->netdev); in link_status_event_handler()
1010 netif_info(nic_dev, drv, nic_dev->netdev, "HINIC_Link is DOWN\n"); in link_status_event_handler()
1045 netif_info(nic_dev, link, nic_dev->netdev, in link_err_event()
1105 nic_dev->netdev->features = features ^ failed_features; in set_features()
1161 struct net_device *netdev; in nic_dev_init() local
1186 netdev = alloc_etherdev_mq(sizeof(*nic_dev), num_qps); in nic_dev_init()
1187 if (!netdev) { in nic_dev_init()
1194 netdev->netdev_ops = &hinic_netdev_ops; in nic_dev_init()
1196 netdev->netdev_ops = &hinicvf_netdev_ops; in nic_dev_init()
1198 netdev->max_mtu = ETH_MAX_MTU; in nic_dev_init()
1200 nic_dev = netdev_priv(netdev); in nic_dev_init()
1201 nic_dev->netdev = netdev; in nic_dev_init()
1216 hinic_set_ethtool_ops(netdev); in nic_dev_init()
1233 pci_set_drvdata(pdev, netdev); in nic_dev_init()
1235 err = hinic_port_get_mac(nic_dev, netdev->dev_addr); in nic_dev_init()
1241 if (!is_valid_ether_addr(netdev->dev_addr)) { in nic_dev_init()
1249 netdev->dev_addr); in nic_dev_init()
1250 eth_hw_addr_random(netdev); in nic_dev_init()
1253 err = hinic_port_add_mac(nic_dev, netdev->dev_addr, 0); in nic_dev_init()
1259 err = hinic_port_set_mtu(nic_dev, netdev->mtu); in nic_dev_init()
1268 netdev_features_init(netdev); in nic_dev_init()
1270 netif_carrier_off(netdev); in nic_dev_init()
1281 err = set_features(nic_dev, 0, nic_dev->netdev->features, true); in nic_dev_init()
1290 SET_NETDEV_DEV(netdev, &pdev->dev); in nic_dev_init()
1308 err = register_netdev(netdev); in nic_dev_init()
1334 hinic_port_del_mac(nic_dev, netdev->dev_addr, 0); in nic_dev_init()
1341 free_netdev(netdev); in nic_dev_init()
1431 struct net_device *netdev = pci_get_drvdata(pdev); in hinic_remove() local
1432 struct hinic_dev *nic_dev = netdev_priv(netdev); in hinic_remove()
1441 unregister_netdev(netdev); in hinic_remove()
1451 hinic_port_del_mac(nic_dev, netdev->dev_addr, 0); in hinic_remove()
1469 free_netdev(netdev); in hinic_remove()