• Home
  • Raw
  • Download

Lines Matching refs:netdev

433 	struct net_device	*netdev;  member
625 netif_dbg(ks, hw, ks->netdev, "setting power mode %d\n", pwrmode); in ks_set_powermode()
779 static void ks_rcv(struct ks_net *ks, struct net_device *netdev) in ks_rcv() argument
804 netdev->stats.rx_dropped++; in ks_rcv()
806 netdev->stats.rx_frame_errors++; in ks_rcv()
808 netdev->stats.rx_length_errors++; in ks_rcv()
813 skb = netdev_alloc_skb(netdev, frame_hdr->len + 16); in ks_rcv()
819 skb->protocol = eth_type_trans(skb, netdev); in ks_rcv()
822 netdev->stats.rx_bytes += frame_hdr->len - 4; in ks_rcv()
823 netdev->stats.rx_packets++; in ks_rcv()
826 netdev->stats.rx_dropped++; in ks_rcv()
839 static void ks_update_link_status(struct net_device *netdev, struct ks_net *ks) in ks_update_link_status() argument
844 netif_carrier_on(netdev); in ks_update_link_status()
847 netif_carrier_off(netdev); in ks_update_link_status()
850 netif_dbg(ks, link, ks->netdev, in ks_update_link_status()
867 struct net_device *netdev = pw; in ks_irq() local
868 struct ks_net *ks = netdev_priv(netdev); in ks_irq()
883 ks_rcv(ks, netdev); in ks_irq()
886 ks_update_link_status(netdev, ks); in ks_irq()
889 netif_wake_queue(netdev); in ks_irq()
899 ks->netdev->stats.rx_over_errors++; in ks_irq()
913 static int ks_net_open(struct net_device *netdev) in ks_net_open() argument
915 struct ks_net *ks = netdev_priv(netdev); in ks_net_open()
923 netif_dbg(ks, ifup, ks->netdev, "%s - entry\n", __func__); in ks_net_open()
926 err = request_irq(netdev->irq, ks_irq, KS_INT_FLAGS, DRV_NAME, netdev); in ks_net_open()
929 pr_err("Failed to request IRQ: %d: %d\n", netdev->irq, err); in ks_net_open()
940 netif_start_queue(ks->netdev); in ks_net_open()
942 netif_dbg(ks, ifup, ks->netdev, "network device up\n"); in ks_net_open()
955 static int ks_net_stop(struct net_device *netdev) in ks_net_stop() argument
957 struct ks_net *ks = netdev_priv(netdev); in ks_net_stop()
959 netif_info(ks, ifdown, netdev, "shutting down\n"); in ks_net_stop()
961 netif_stop_queue(netdev); in ks_net_stop()
974 free_irq(netdev->irq, netdev); in ks_net_stop()
1023 static int ks_start_xmit(struct sk_buff *skb, struct net_device *netdev) in ks_start_xmit() argument
1026 struct ks_net *ks = netdev_priv(netdev); in ks_start_xmit()
1028 disable_irq(netdev->irq); in ks_start_xmit()
1039 netdev->stats.tx_bytes += skb->len; in ks_start_xmit()
1040 netdev->stats.tx_packets++; in ks_start_xmit()
1046 enable_irq(netdev->irq); in ks_start_xmit()
1191 static void ks_set_rx_mode(struct net_device *netdev) in ks_set_rx_mode() argument
1193 struct ks_net *ks = netdev_priv(netdev); in ks_set_rx_mode()
1197 if ((netdev->flags & IFF_PROMISC) == IFF_PROMISC) in ks_set_rx_mode()
1199 (u16)((netdev->flags & IFF_PROMISC) == IFF_PROMISC)); in ks_set_rx_mode()
1201 else if ((netdev->flags & IFF_ALLMULTI) == IFF_ALLMULTI) in ks_set_rx_mode()
1203 (u16)((netdev->flags & IFF_ALLMULTI) == IFF_ALLMULTI)); in ks_set_rx_mode()
1207 if ((netdev->flags & IFF_MULTICAST) && netdev_mc_count(netdev)) { in ks_set_rx_mode()
1208 if (netdev_mc_count(netdev) <= MAX_MCAST_LST) { in ks_set_rx_mode()
1211 netdev_for_each_mc_addr(ha, netdev) { in ks_set_rx_mode()
1257 static int ks_set_mac_address(struct net_device *netdev, void *paddr) in ks_set_mac_address() argument
1259 struct ks_net *ks = netdev_priv(netdev); in ks_set_mac_address()
1263 memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); in ks_set_mac_address()
1265 da = (u8 *)netdev->dev_addr; in ks_set_mac_address()
1271 static int ks_net_ioctl(struct net_device *netdev, struct ifreq *req, int cmd) in ks_net_ioctl() argument
1273 struct ks_net *ks = netdev_priv(netdev); in ks_net_ioctl()
1275 if (!netif_running(netdev)) in ks_net_ioctl()
1294 static void ks_get_drvinfo(struct net_device *netdev, in ks_get_drvinfo() argument
1299 strlcpy(di->bus_info, dev_name(netdev->dev.parent), in ks_get_drvinfo()
1303 static u32 ks_get_msglevel(struct net_device *netdev) in ks_get_msglevel() argument
1305 struct ks_net *ks = netdev_priv(netdev); in ks_get_msglevel()
1309 static void ks_set_msglevel(struct net_device *netdev, u32 to) in ks_set_msglevel() argument
1311 struct ks_net *ks = netdev_priv(netdev); in ks_set_msglevel()
1315 static int ks_get_settings(struct net_device *netdev, struct ethtool_cmd *cmd) in ks_get_settings() argument
1317 struct ks_net *ks = netdev_priv(netdev); in ks_get_settings()
1321 static int ks_set_settings(struct net_device *netdev, struct ethtool_cmd *cmd) in ks_set_settings() argument
1323 struct ks_net *ks = netdev_priv(netdev); in ks_set_settings()
1327 static u32 ks_get_link(struct net_device *netdev) in ks_get_link() argument
1329 struct ks_net *ks = netdev_priv(netdev); in ks_get_link()
1333 static int ks_nway_reset(struct net_device *netdev) in ks_nway_reset() argument
1335 struct ks_net *ks = netdev_priv(netdev); in ks_nway_reset()
1394 static int ks_phy_read(struct net_device *netdev, int phy_addr, int reg) in ks_phy_read() argument
1396 struct ks_net *ks = netdev_priv(netdev); in ks_phy_read()
1411 static void ks_phy_write(struct net_device *netdev, in ks_phy_write() argument
1414 struct ks_net *ks = netdev_priv(netdev); in ks_phy_write()
1440 netdev_warn(ks->netdev, "Memory selftest not finished\n"); in ks_read_selftest()
1445 netdev_err(ks->netdev, "TX memory selftest fails\n"); in ks_read_selftest()
1450 netdev_err(ks->netdev, "RX memory selftest fails\n"); in ks_read_selftest()
1454 netdev_info(ks->netdev, "the selftest passes\n"); in ks_read_selftest()
1543 struct net_device *netdev; in ks8851_probe() local
1548 netdev = alloc_etherdev(sizeof(struct ks_net)); in ks8851_probe()
1549 if (!netdev) in ks8851_probe()
1552 SET_NETDEV_DEV(netdev, &pdev->dev); in ks8851_probe()
1554 ks = netdev_priv(netdev); in ks8851_probe()
1555 ks->netdev = netdev; in ks8851_probe()
1571 netdev->irq = platform_get_irq(pdev, 0); in ks8851_probe()
1573 if ((int)netdev->irq < 0) { in ks8851_probe()
1574 err = netdev->irq; in ks8851_probe()
1583 netdev->netdev_ops = &ks_netdev_ops; in ks8851_probe()
1584 netdev->ethtool_ops = &ks_ethtool_ops; in ks8851_probe()
1587 ks->mii.dev = netdev; in ks8851_probe()
1594 netdev_info(netdev, "message enable is %d\n", msg_enable); in ks8851_probe()
1603 netdev_err(netdev, "failed to read device ID\n"); in ks8851_probe()
1609 netdev_err(netdev, "failed to read device ID\n"); in ks8851_probe()
1614 err = register_netdev(netdev); in ks8851_probe()
1618 platform_set_drvdata(pdev, netdev); in ks8851_probe()
1639 netdev_err(netdev, "No platform data\n"); in ks8851_probe()
1648 netdev_info(netdev, "Using random mac address\n"); in ks8851_probe()
1650 netdev_info(netdev, "Mac address is: %pM\n", ks->mac_addr); in ks8851_probe()
1652 memcpy(netdev->dev_addr, ks->mac_addr, ETH_ALEN); in ks8851_probe()
1654 ks_set_mac(ks, netdev->dev_addr); in ks8851_probe()
1658 netdev_info(netdev, "Found chip, family: 0x%x, id: 0x%x, rev: 0x%x\n", in ks8851_probe()
1663 unregister_netdev(netdev); in ks8851_probe()
1665 free_netdev(netdev); in ks8851_probe()
1671 struct net_device *netdev = platform_get_drvdata(pdev); in ks8851_remove() local
1673 unregister_netdev(netdev); in ks8851_remove()
1674 free_netdev(netdev); in ks8851_remove()