struct net_device *dev)
{
if (!dev)
- return net->can.can_rx_alldev_list;
+ return net->can.rx_alldev_list;
else
return (struct can_dev_rcv_lists *)dev->ml_priv;
}
if (!r)
return -ENOMEM;
- spin_lock(&net->can.can_rcvlists_lock);
+ spin_lock(&net->can.rcvlists_lock);
d = find_dev_rcv_lists(net, dev);
if (d) {
err = -ENODEV;
}
- spin_unlock(&net->can.can_rcvlists_lock);
+ spin_unlock(&net->can.rcvlists_lock);
return err;
}
if (dev && !net_eq(net, dev_net(dev)))
return;
- spin_lock(&net->can.can_rcvlists_lock);
+ spin_lock(&net->can.rcvlists_lock);
d = find_dev_rcv_lists(net, dev);
if (!d) {
}
out:
- spin_unlock(&net->can.can_rcvlists_lock);
+ spin_unlock(&net->can.rcvlists_lock);
/* schedule the receiver item for deletion */
if (r) {
rcu_read_lock();
/* deliver the packet to sockets listening on all devices */
- matches = can_rcv_filter(net->can.can_rx_alldev_list, skb);
+ matches = can_rcv_filter(net->can.rx_alldev_list, skb);
/* find receive list for this device */
d = find_dev_rcv_lists(net, dev);
break;
case NETDEV_UNREGISTER:
- spin_lock(&dev_net(dev)->can.can_rcvlists_lock);
+ spin_lock(&dev_net(dev)->can.rcvlists_lock);
d = dev->ml_priv;
if (d) {
dev->name);
}
- spin_unlock(&dev_net(dev)->can.can_rcvlists_lock);
+ spin_unlock(&dev_net(dev)->can.rcvlists_lock);
break;
}
static int can_pernet_init(struct net *net)
{
- spin_lock_init(&net->can.can_rcvlists_lock);
- net->can.can_rx_alldev_list =
- kzalloc(sizeof(*net->can.can_rx_alldev_list), GFP_KERNEL);
- if (!net->can.can_rx_alldev_list)
+ spin_lock_init(&net->can.rcvlists_lock);
+ net->can.rx_alldev_list =
+ kzalloc(sizeof(*net->can.rx_alldev_list), GFP_KERNEL);
+ if (!net->can.rx_alldev_list)
goto out;
net->can.pkg_stats = kzalloc(sizeof(*net->can.pkg_stats), GFP_KERNEL);
if (!net->can.pkg_stats)
if (IS_ENABLED(CONFIG_PROC_FS)) {
/* the statistics are updated every second (timer triggered) */
if (stats_timer) {
- timer_setup(&net->can.can_stattimer, can_stat_update,
+ timer_setup(&net->can.stattimer, can_stat_update,
0);
- mod_timer(&net->can.can_stattimer,
+ mod_timer(&net->can.stattimer,
round_jiffies(jiffies + HZ));
}
net->can.pkg_stats->jiffies_init = jiffies;
out_free_pkg_stats:
kfree(net->can.pkg_stats);
out_free_rx_alldev_list:
- kfree(net->can.can_rx_alldev_list);
+ kfree(net->can.rx_alldev_list);
out:
return -ENOMEM;
}
if (IS_ENABLED(CONFIG_PROC_FS)) {
can_remove_proc(net);
if (stats_timer)
- del_timer_sync(&net->can.can_stattimer);
+ del_timer_sync(&net->can.stattimer);
}
/* remove created dev_rcv_lists from still registered CAN devices */
}
rcu_read_unlock();
- kfree(net->can.can_rx_alldev_list);
+ kfree(net->can.rx_alldev_list);
kfree(net->can.pkg_stats);
kfree(net->can.rcv_lists_stats);
}
void can_stat_update(struct timer_list *t)
{
- struct net *net = from_timer(net, t, can.can_stattimer);
+ struct net *net = from_timer(net, t, can.stattimer);
struct can_pkg_stats *pkg_stats = net->can.pkg_stats;
unsigned long j = jiffies; /* snapshot */
pkg_stats->matches_delta = 0;
/* restart timer (one second) */
- mod_timer(&net->can.can_stattimer, round_jiffies(jiffies + HZ));
+ mod_timer(&net->can.stattimer, round_jiffies(jiffies + HZ));
}
/*
seq_putc(m, '\n');
- if (net->can.can_stattimer.function == can_stat_update) {
+ if (net->can.stattimer.function == can_stat_update) {
seq_printf(m, " %8ld %% total match ratio (RXMR)\n",
pkg_stats->total_rx_match_ratio);
user_reset = 1;
- if (net->can.can_stattimer.function == can_stat_update) {
+ if (net->can.stattimer.function == can_stat_update) {
seq_printf(m, "Scheduled statistic reset #%ld.\n",
rcv_lists_stats->stats_reset + 1);
} else {
rcu_read_lock();
/* receive list for 'all' CAN devices (dev == NULL) */
- d = net->can.can_rx_alldev_list;
+ d = net->can.rx_alldev_list;
can_rcvlist_proc_show_one(m, idx, NULL, d);
/* receive list for registered CAN devices */
rcu_read_lock();
/* sff receive list for 'all' CAN devices (dev == NULL) */
- d = net->can.can_rx_alldev_list;
+ d = net->can.rx_alldev_list;
can_rcvlist_proc_show_array(m, NULL, d->rx_sff, ARRAY_SIZE(d->rx_sff));
/* sff receive list for registered CAN devices */
rcu_read_lock();
/* eff receive list for 'all' CAN devices (dev == NULL) */
- d = net->can.can_rx_alldev_list;
+ d = net->can.rx_alldev_list;
can_rcvlist_proc_show_array(m, NULL, d->rx_eff, ARRAY_SIZE(d->rx_eff));
/* eff receive list for registered CAN devices */