Lines Matching refs:netdev
568 struct net_device *netdev; member
696 netif_err(nic, hw, nic->netdev, in e100_self_test()
702 netif_err(nic, hw, nic->netdev, "Self-test failed: timed out\n"); in e100_self_test()
805 netif_err(nic, probe, nic->netdev, "EEPROM corrupted\n"); in e100_eeprom_load()
930 static int mdio_read(struct net_device *netdev, int addr, int reg) in mdio_read() argument
932 struct nic *nic = netdev_priv(netdev); in mdio_read()
936 static void mdio_write(struct net_device *netdev, int addr, int reg, int data) in mdio_write() argument
938 struct nic *nic = netdev_priv(netdev); in mdio_write()
964 netdev_err(nic->netdev, "e100.mdio_ctrl won't go Ready\n"); in mdio_ctrl_hw()
976 netif_printk(nic, hw, KERN_DEBUG, nic->netdev, in mdio_ctrl_hw()
992 u16 advert = mdio_read(nic->netdev, nic->mii.phy_id, in mdio_ctrl_phy_82552_v()
1039 netif_printk(nic, hw, KERN_DEBUG, nic->netdev, in mdio_ctrl_phy_mii_emulated()
1048 netif_printk(nic, hw, KERN_DEBUG, nic->netdev, in mdio_ctrl_phy_mii_emulated()
1092 nic->mii.dev = nic->netdev; in e100_get_defaults()
1101 struct net_device *netdev = nic->netdev; in e100_configure() local
1145 if (unlikely(netdev->features & NETIF_F_RXFCS)) in e100_configure()
1152 if (netif_running(nic->netdev) || !(nic->flags & wol_magic)) in e100_configure()
1172 if (netdev->features & NETIF_F_RXALL) { in e100_configure()
1178 netif_printk(nic, hw, KERN_DEBUG, nic->netdev, "[00-07]=%8ph\n", in e100_configure()
1180 netif_printk(nic, hw, KERN_DEBUG, nic->netdev, "[08-15]=%8ph\n", in e100_configure()
1182 netif_printk(nic, hw, KERN_DEBUG, nic->netdev, "[16-23]=%8ph\n", in e100_configure()
1293 netif_err(nic, probe, nic->netdev, in e100_request_firmware()
1298 netif_info(nic, probe, nic->netdev, in e100_request_firmware()
1308 netif_err(nic, probe, nic->netdev, in e100_request_firmware()
1322 netif_err(nic, probe, nic->netdev, in e100_request_firmware()
1377 netif_err(nic, probe, nic->netdev, in e100_load_ucode_wait()
1398 netif_err(nic, probe, nic->netdev, "ucode load failed\n"); in e100_load_ucode_wait()
1409 memcpy(cb->u.iaaddr, nic->netdev->dev_addr, ETH_ALEN); in e100_setup_iaaddr()
1438 netif_info(nic, probe, nic->netdev, in e100_phy_check_without_mii()
1464 struct net_device *netdev = nic->netdev; in e100_phy_init() local
1471 bmcr = mdio_read(netdev, nic->mii.phy_id, MII_BMCR); in e100_phy_init()
1472 stat = mdio_read(netdev, nic->mii.phy_id, MII_BMSR); in e100_phy_init()
1473 stat = mdio_read(netdev, nic->mii.phy_id, MII_BMSR); in e100_phy_init()
1486 netif_err(nic, hw, nic->netdev, in e100_phy_init()
1491 netif_printk(nic, hw, KERN_DEBUG, nic->netdev, in e100_phy_init()
1495 id_lo = mdio_read(netdev, nic->mii.phy_id, MII_PHYSID1); in e100_phy_init()
1496 id_hi = mdio_read(netdev, nic->mii.phy_id, MII_PHYSID2); in e100_phy_init()
1498 netif_printk(nic, hw, KERN_DEBUG, nic->netdev, in e100_phy_init()
1504 mdio_write(netdev, addr, MII_BMCR, BMCR_ISOLATE); in e100_phy_init()
1506 bmcr = mdio_read(netdev, addr, MII_BMCR); in e100_phy_init()
1507 mdio_write(netdev, addr, MII_BMCR, in e100_phy_init()
1517 mdio_write(netdev, nic->mii.phy_id, MII_BMCR, in e100_phy_init()
1524 cong = mdio_read(netdev, nic->mii.phy_id, MII_NSC_CONG); in e100_phy_init()
1527 mdio_write(netdev, nic->mii.phy_id, MII_NSC_CONG, cong); in e100_phy_init()
1531 u16 advert = mdio_read(netdev, nic->mii.phy_id, MII_ADVERTISE); in e100_phy_init()
1538 mdio_write(netdev, nic->mii.phy_id, MII_ADVERTISE, advert); in e100_phy_init()
1541 bmcr = mdio_read(netdev, nic->mii.phy_id, MII_BMCR); in e100_phy_init()
1543 mdio_write(netdev, nic->mii.phy_id, MII_BMCR, bmcr); in e100_phy_init()
1545 (mdio_read(netdev, nic->mii.phy_id, MII_TPISTATUS) & 0x8000) && in e100_phy_init()
1548 mdio_write(netdev, nic->mii.phy_id, MII_NCONFIG, in e100_phy_init()
1561 netif_err(nic, hw, nic->netdev, "e100_hw_init\n"); in e100_hw_init()
1590 struct net_device *netdev = nic->netdev; in e100_multi() local
1592 u16 i, count = min(netdev_mc_count(netdev), E100_MAX_MULTICAST_ADDRS); in e100_multi()
1597 netdev_for_each_mc_addr(ha, netdev) { in e100_multi()
1606 static void e100_set_multicast_list(struct net_device *netdev) in e100_set_multicast_list() argument
1608 struct nic *nic = netdev_priv(netdev); in e100_set_multicast_list()
1610 netif_printk(nic, hw, KERN_DEBUG, nic->netdev, in e100_set_multicast_list()
1612 netdev_mc_count(netdev), netdev->flags); in e100_set_multicast_list()
1614 if (netdev->flags & IFF_PROMISC) in e100_set_multicast_list()
1619 if (netdev->flags & IFF_ALLMULTI || in e100_set_multicast_list()
1620 netdev_mc_count(netdev) > E100_MAX_MULTICAST_ADDRS) in e100_set_multicast_list()
1631 struct net_device *dev = nic->netdev; in e100_update_stats()
1687 netif_printk(nic, tx_err, KERN_DEBUG, nic->netdev, in e100_update_stats()
1719 netif_printk(nic, timer, KERN_DEBUG, nic->netdev, in e100_watchdog()
1727 if (mii_link_ok(&nic->mii) && !netif_carrier_ok(nic->netdev)) { in e100_watchdog()
1728 netdev_info(nic->netdev, "NIC Link is Up %u Mbps %s Duplex\n", in e100_watchdog()
1731 } else if (!mii_link_ok(&nic->mii) && netif_carrier_ok(nic->netdev)) { in e100_watchdog()
1732 netdev_info(nic->netdev, "NIC Link is Down\n"); in e100_watchdog()
1752 e100_set_multicast_list(nic->netdev); in e100_watchdog()
1799 struct net_device *netdev) in e100_xmit_frame() argument
1801 struct nic *nic = netdev_priv(netdev); in e100_xmit_frame()
1809 netif_printk(nic, tx_err, KERN_DEBUG, nic->netdev, in e100_xmit_frame()
1819 netif_printk(nic, tx_err, KERN_DEBUG, nic->netdev, in e100_xmit_frame()
1821 netif_stop_queue(netdev); in e100_xmit_frame()
1825 netif_printk(nic, tx_err, KERN_DEBUG, nic->netdev, in e100_xmit_frame()
1827 netif_stop_queue(netdev); in e100_xmit_frame()
1836 struct net_device *dev = nic->netdev; in e100_tx_clean()
1847 netif_printk(nic, tx_done, KERN_DEBUG, nic->netdev, in e100_tx_clean()
1871 if (unlikely(tx_cleaned && netif_queue_stopped(nic->netdev))) in e100_tx_clean()
1872 netif_wake_queue(nic->netdev); in e100_tx_clean()
1949 if (!(rx->skb = netdev_alloc_skb_ip_align(nic->netdev, RFD_BUF_LEN))) in e100_rx_alloc_skb()
1980 struct net_device *dev = nic->netdev; in e100_rx_indicate()
1994 netif_printk(nic, rx_status, KERN_DEBUG, nic->netdev, in e100_rx_indicate()
2043 skb->protocol = eth_type_trans(skb, nic->netdev); in e100_rx_indicate()
2217 struct net_device *netdev = dev_id; in e100_intr() local
2218 struct nic *nic = netdev_priv(netdev); in e100_intr()
2221 netif_printk(nic, intr, KERN_DEBUG, nic->netdev, in e100_intr()
2261 static void e100_netpoll(struct net_device *netdev) in e100_netpoll() argument
2263 struct nic *nic = netdev_priv(netdev); in e100_netpoll()
2266 e100_intr(nic->pdev->irq, netdev); in e100_netpoll()
2272 static int e100_set_mac_address(struct net_device *netdev, void *p) in e100_set_mac_address() argument
2274 struct nic *nic = netdev_priv(netdev); in e100_set_mac_address()
2280 memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); in e100_set_mac_address()
2286 static int e100_change_mtu(struct net_device *netdev, int new_mtu) in e100_change_mtu() argument
2290 netdev->mtu = new_mtu; in e100_change_mtu()
2313 e100_set_multicast_list(nic->netdev); in e100_up()
2317 nic->netdev->name, nic->netdev))) in e100_up()
2319 netif_wake_queue(nic->netdev); in e100_up()
2339 netif_stop_queue(nic->netdev); in e100_down()
2341 free_irq(nic->pdev->irq, nic->netdev); in e100_down()
2343 netif_carrier_off(nic->netdev); in e100_down()
2348 static void e100_tx_timeout(struct net_device *netdev) in e100_tx_timeout() argument
2350 struct nic *nic = netdev_priv(netdev); in e100_tx_timeout()
2360 struct net_device *netdev = nic->netdev; in e100_tx_timeout_task() local
2362 netif_printk(nic, tx_err, KERN_DEBUG, nic->netdev, in e100_tx_timeout_task()
2366 if (netif_running(netdev)) { in e100_tx_timeout_task()
2367 e100_down(netdev_priv(netdev)); in e100_tx_timeout_task()
2368 e100_up(netdev_priv(netdev)); in e100_tx_timeout_task()
2397 mdio_write(nic->netdev, nic->mii.phy_id, MII_BMCR, in e100_loopback_test()
2402 if (!(skb = netdev_alloc_skb(nic->netdev, ETH_DATA_LEN))) { in e100_loopback_test()
2408 e100_xmit_frame(skb, nic->netdev); in e100_loopback_test()
2420 mdio_write(nic->netdev, nic->mii.phy_id, MII_BMCR, 0); in e100_loopback_test()
2434 static int e100_get_settings(struct net_device *netdev, struct ethtool_cmd *cmd) in e100_get_settings() argument
2436 struct nic *nic = netdev_priv(netdev); in e100_get_settings()
2440 static int e100_set_settings(struct net_device *netdev, struct ethtool_cmd *cmd) in e100_set_settings() argument
2442 struct nic *nic = netdev_priv(netdev); in e100_set_settings()
2445 mdio_write(netdev, nic->mii.phy_id, MII_BMCR, BMCR_RESET); in e100_set_settings()
2452 static void e100_get_drvinfo(struct net_device *netdev, in e100_get_drvinfo() argument
2455 struct nic *nic = netdev_priv(netdev); in e100_get_drvinfo()
2463 static int e100_get_regs_len(struct net_device *netdev) in e100_get_regs_len() argument
2465 struct nic *nic = netdev_priv(netdev); in e100_get_regs_len()
2469 static void e100_get_regs(struct net_device *netdev, in e100_get_regs() argument
2472 struct nic *nic = netdev_priv(netdev); in e100_get_regs()
2482 mdio_read(netdev, nic->mii.phy_id, i); in e100_get_regs()
2490 static void e100_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) in e100_get_wol() argument
2492 struct nic *nic = netdev_priv(netdev); in e100_get_wol()
2497 static int e100_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) in e100_set_wol() argument
2499 struct nic *nic = netdev_priv(netdev); in e100_set_wol()
2517 static u32 e100_get_msglevel(struct net_device *netdev) in e100_get_msglevel() argument
2519 struct nic *nic = netdev_priv(netdev); in e100_get_msglevel()
2523 static void e100_set_msglevel(struct net_device *netdev, u32 value) in e100_set_msglevel() argument
2525 struct nic *nic = netdev_priv(netdev); in e100_set_msglevel()
2529 static int e100_nway_reset(struct net_device *netdev) in e100_nway_reset() argument
2531 struct nic *nic = netdev_priv(netdev); in e100_nway_reset()
2535 static u32 e100_get_link(struct net_device *netdev) in e100_get_link() argument
2537 struct nic *nic = netdev_priv(netdev); in e100_get_link()
2541 static int e100_get_eeprom_len(struct net_device *netdev) in e100_get_eeprom_len() argument
2543 struct nic *nic = netdev_priv(netdev); in e100_get_eeprom_len()
2548 static int e100_get_eeprom(struct net_device *netdev, in e100_get_eeprom() argument
2551 struct nic *nic = netdev_priv(netdev); in e100_get_eeprom()
2559 static int e100_set_eeprom(struct net_device *netdev, in e100_set_eeprom() argument
2562 struct nic *nic = netdev_priv(netdev); in e100_set_eeprom()
2573 static void e100_get_ringparam(struct net_device *netdev, in e100_get_ringparam() argument
2576 struct nic *nic = netdev_priv(netdev); in e100_get_ringparam()
2586 static int e100_set_ringparam(struct net_device *netdev, in e100_set_ringparam() argument
2589 struct nic *nic = netdev_priv(netdev); in e100_set_ringparam()
2596 if (netif_running(netdev)) in e100_set_ringparam()
2602 netif_info(nic, drv, nic->netdev, "Ring Param settings: rx: %d, tx %d\n", in e100_set_ringparam()
2604 if (netif_running(netdev)) in e100_set_ringparam()
2619 static void e100_diag_test(struct net_device *netdev, in e100_diag_test() argument
2623 struct nic *nic = netdev_priv(netdev); in e100_diag_test()
2634 if (netif_running(netdev)) in e100_diag_test()
2643 if (netif_running(netdev)) in e100_diag_test()
2652 static int e100_set_phys_id(struct net_device *netdev, in e100_set_phys_id() argument
2655 struct nic *nic = netdev_priv(netdev); in e100_set_phys_id()
2683 mdio_write(netdev, nic->mii.phy_id, led_reg, leds); in e100_set_phys_id()
2703 static int e100_get_sset_count(struct net_device *netdev, int sset) in e100_get_sset_count() argument
2715 static void e100_get_ethtool_stats(struct net_device *netdev, in e100_get_ethtool_stats() argument
2718 struct nic *nic = netdev_priv(netdev); in e100_get_ethtool_stats()
2722 data[i] = ((unsigned long *)&netdev->stats)[i]; in e100_get_ethtool_stats()
2736 static void e100_get_strings(struct net_device *netdev, u32 stringset, u8 *data) in e100_get_strings() argument
2773 static int e100_do_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) in e100_do_ioctl() argument
2775 struct nic *nic = netdev_priv(netdev); in e100_do_ioctl()
2796 static int e100_open(struct net_device *netdev) in e100_open() argument
2798 struct nic *nic = netdev_priv(netdev); in e100_open()
2801 netif_carrier_off(netdev); in e100_open()
2803 netif_err(nic, ifup, nic->netdev, "Cannot open interface, aborting\n"); in e100_open()
2807 static int e100_close(struct net_device *netdev) in e100_close() argument
2809 e100_down(netdev_priv(netdev)); in e100_close()
2813 static int e100_set_features(struct net_device *netdev, in e100_set_features() argument
2816 struct nic *nic = netdev_priv(netdev); in e100_set_features()
2817 netdev_features_t changed = features ^ netdev->features; in e100_set_features()
2822 netdev->features = features; in e100_set_features()
2845 struct net_device *netdev; in e100_probe() local
2849 if (!(netdev = alloc_etherdev(sizeof(struct nic)))) in e100_probe()
2852 netdev->hw_features |= NETIF_F_RXFCS; in e100_probe()
2853 netdev->priv_flags |= IFF_SUPP_NOFCS; in e100_probe()
2854 netdev->hw_features |= NETIF_F_RXALL; in e100_probe()
2856 netdev->netdev_ops = &e100_netdev_ops; in e100_probe()
2857 netdev->ethtool_ops = &e100_ethtool_ops; in e100_probe()
2858 netdev->watchdog_timeo = E100_WATCHDOG_PERIOD; in e100_probe()
2859 strncpy(netdev->name, pci_name(pdev), sizeof(netdev->name) - 1); in e100_probe()
2861 nic = netdev_priv(netdev); in e100_probe()
2862 netif_napi_add(netdev, &nic->napi, e100_poll, E100_NAPI_WEIGHT); in e100_probe()
2863 nic->netdev = netdev; in e100_probe()
2867 pci_set_drvdata(pdev, netdev); in e100_probe()
2870 netif_err(nic, probe, nic->netdev, "Cannot enable PCI device, aborting\n"); in e100_probe()
2875 netif_err(nic, probe, nic->netdev, "Cannot find proper PCI device base address, aborting\n"); in e100_probe()
2881 netif_err(nic, probe, nic->netdev, "Cannot obtain PCI resources, aborting\n"); in e100_probe()
2886 netif_err(nic, probe, nic->netdev, "No usable DMA configuration, aborting\n"); in e100_probe()
2890 SET_NETDEV_DEV(netdev, &pdev->dev); in e100_probe()
2893 netif_info(nic, probe, nic->netdev, "using i/o access mode\n"); in e100_probe()
2897 netif_err(nic, probe, nic->netdev, "Cannot map device registers, aborting\n"); in e100_probe()
2911 netdev->features |= NETIF_F_VLAN_CHALLENGED; in e100_probe()
2932 netif_err(nic, probe, nic->netdev, "Cannot alloc driver memory, aborting\n"); in e100_probe()
2941 memcpy(netdev->dev_addr, nic->eeprom, ETH_ALEN); in e100_probe()
2942 if (!is_valid_ether_addr(netdev->dev_addr)) { in e100_probe()
2944 netif_err(nic, probe, nic->netdev, "Invalid MAC address from EEPROM, aborting\n"); in e100_probe()
2948 netif_err(nic, probe, nic->netdev, "Invalid MAC address from EEPROM, you MUST configure one.\n"); in e100_probe()
2962 strcpy(netdev->name, "eth%d"); in e100_probe()
2963 if ((err = register_netdev(netdev))) { in e100_probe()
2964 netif_err(nic, probe, nic->netdev, "Cannot register net device, aborting\n"); in e100_probe()
2967 nic->cbs_pool = pci_pool_create(netdev->name, in e100_probe()
2972 netif_info(nic, probe, nic->netdev, in e100_probe()
2975 pdev->irq, netdev->dev_addr); in e100_probe()
2988 free_netdev(netdev); in e100_probe()
2994 struct net_device *netdev = pci_get_drvdata(pdev); in e100_remove() local
2996 if (netdev) { in e100_remove()
2997 struct nic *nic = netdev_priv(netdev); in e100_remove()
2998 unregister_netdev(netdev); in e100_remove()
3002 free_netdev(netdev); in e100_remove()
3013 struct net_device *netdev = pci_get_drvdata(pdev); in __e100_shutdown() local
3014 struct nic *nic = netdev_priv(netdev); in __e100_shutdown()
3016 if (netif_running(netdev)) in __e100_shutdown()
3018 netif_device_detach(netdev); in __e100_shutdown()
3025 u16 smartspeed = mdio_read(netdev, nic->mii.phy_id, in __e100_shutdown()
3028 mdio_write(netdev, nic->mii.phy_id, in __e100_shutdown()
3061 struct net_device *netdev = pci_get_drvdata(pdev); in e100_resume() local
3062 struct nic *nic = netdev_priv(netdev); in e100_resume()
3071 u16 smartspeed = mdio_read(netdev, nic->mii.phy_id, in e100_resume()
3074 mdio_write(netdev, nic->mii.phy_id, in e100_resume()
3079 netif_device_attach(netdev); in e100_resume()
3080 if (netif_running(netdev)) in e100_resume()
3103 struct net_device *netdev = pci_get_drvdata(pdev); in e100_io_error_detected() local
3104 struct nic *nic = netdev_priv(netdev); in e100_io_error_detected()
3106 netif_device_detach(netdev); in e100_io_error_detected()
3111 if (netif_running(netdev)) in e100_io_error_detected()
3127 struct net_device *netdev = pci_get_drvdata(pdev); in e100_io_slot_reset() local
3128 struct nic *nic = netdev_priv(netdev); in e100_io_slot_reset()
3154 struct net_device *netdev = pci_get_drvdata(pdev); in e100_io_resume() local
3155 struct nic *nic = netdev_priv(netdev); in e100_io_resume()
3160 netif_device_attach(netdev); in e100_io_resume()
3161 if (netif_running(netdev)) { in e100_io_resume()
3162 e100_open(netdev); in e100_io_resume()