Lines Matching full:ns

14 	struct netdevsim *ns = netdev_priv(dev);  in nsim_get_pause_stats()  local
16 if (ns->ethtool.pauseparam.report_stats_rx) in nsim_get_pause_stats()
18 if (ns->ethtool.pauseparam.report_stats_tx) in nsim_get_pause_stats()
25 struct netdevsim *ns = netdev_priv(dev); in nsim_get_pauseparam() local
28 pause->rx_pause = ns->ethtool.pauseparam.rx; in nsim_get_pauseparam()
29 pause->tx_pause = ns->ethtool.pauseparam.tx; in nsim_get_pauseparam()
35 struct netdevsim *ns = netdev_priv(dev); in nsim_set_pauseparam() local
40 ns->ethtool.pauseparam.rx = pause->rx_pause; in nsim_set_pauseparam()
41 ns->ethtool.pauseparam.tx = pause->tx_pause; in nsim_set_pauseparam()
50 struct netdevsim *ns = netdev_priv(dev); in nsim_get_coalesce() local
52 memcpy(coal, &ns->ethtool.coalesce, sizeof(ns->ethtool.coalesce)); in nsim_get_coalesce()
61 struct netdevsim *ns = netdev_priv(dev); in nsim_set_coalesce() local
63 memcpy(&ns->ethtool.coalesce, coal, sizeof(ns->ethtool.coalesce)); in nsim_set_coalesce()
72 struct netdevsim *ns = netdev_priv(dev); in nsim_get_ringparam() local
74 memcpy(ring, &ns->ethtool.ring, sizeof(ns->ethtool.ring)); in nsim_get_ringparam()
82 struct netdevsim *ns = netdev_priv(dev); in nsim_set_ringparam() local
84 ns->ethtool.ring.rx_pending = ring->rx_pending; in nsim_set_ringparam()
85 ns->ethtool.ring.rx_jumbo_pending = ring->rx_jumbo_pending; in nsim_set_ringparam()
86 ns->ethtool.ring.rx_mini_pending = ring->rx_mini_pending; in nsim_set_ringparam()
87 ns->ethtool.ring.tx_pending = ring->tx_pending; in nsim_set_ringparam()
94 struct netdevsim *ns = netdev_priv(dev); in nsim_get_channels() local
96 ch->max_combined = ns->nsim_bus_dev->num_queues; in nsim_get_channels()
97 ch->combined_count = ns->ethtool.channels; in nsim_get_channels()
103 struct netdevsim *ns = netdev_priv(dev); in nsim_set_channels() local
111 ns->ethtool.channels = ch->combined_count; in nsim_set_channels()
118 struct netdevsim *ns = netdev_priv(dev); in nsim_get_fecparam() local
120 if (ns->ethtool.get_err) in nsim_get_fecparam()
121 return -ns->ethtool.get_err; in nsim_get_fecparam()
122 memcpy(fecparam, &ns->ethtool.fec, sizeof(ns->ethtool.fec)); in nsim_get_fecparam()
129 struct netdevsim *ns = netdev_priv(dev); in nsim_set_fecparam() local
132 if (ns->ethtool.set_err) in nsim_set_fecparam()
133 return -ns->ethtool.set_err; in nsim_set_fecparam()
134 memcpy(&ns->ethtool.fec, fecparam, sizeof(ns->ethtool.fec)); in nsim_set_fecparam()
139 ns->ethtool.fec.active_fec = 1 << (fls(fec) - 1); in nsim_set_fecparam()
158 static void nsim_ethtool_ring_init(struct netdevsim *ns) in nsim_ethtool_ring_init() argument
160 ns->ethtool.ring.rx_max_pending = 4096; in nsim_ethtool_ring_init()
161 ns->ethtool.ring.rx_jumbo_max_pending = 4096; in nsim_ethtool_ring_init()
162 ns->ethtool.ring.rx_mini_max_pending = 4096; in nsim_ethtool_ring_init()
163 ns->ethtool.ring.tx_max_pending = 4096; in nsim_ethtool_ring_init()
166 void nsim_ethtool_init(struct netdevsim *ns) in nsim_ethtool_init() argument
170 ns->netdev->ethtool_ops = &nsim_ethtool_ops; in nsim_ethtool_init()
172 nsim_ethtool_ring_init(ns); in nsim_ethtool_init()
174 ns->ethtool.fec.fec = ETHTOOL_FEC_NONE; in nsim_ethtool_init()
175 ns->ethtool.fec.active_fec = ETHTOOL_FEC_NONE; in nsim_ethtool_init()
177 ns->ethtool.channels = ns->nsim_bus_dev->num_queues; in nsim_ethtool_init()
179 ethtool = debugfs_create_dir("ethtool", ns->nsim_dev_port->ddir); in nsim_ethtool_init()
181 debugfs_create_u32("get_err", 0600, ethtool, &ns->ethtool.get_err); in nsim_ethtool_init()
182 debugfs_create_u32("set_err", 0600, ethtool, &ns->ethtool.set_err); in nsim_ethtool_init()
186 &ns->ethtool.pauseparam.report_stats_rx); in nsim_ethtool_init()
188 &ns->ethtool.pauseparam.report_stats_tx); in nsim_ethtool_init()
192 &ns->ethtool.ring.rx_max_pending); in nsim_ethtool_init()
194 &ns->ethtool.ring.rx_jumbo_max_pending); in nsim_ethtool_init()
196 &ns->ethtool.ring.rx_mini_max_pending); in nsim_ethtool_init()
198 &ns->ethtool.ring.tx_max_pending); in nsim_ethtool_init()