{
struct sk_buff *newskb = NULL;
struct canfd_frame *cfd = (struct canfd_frame *)skb->data;
- struct can_pkg_stats *can_stats = dev_net(skb->dev)->can.can_stats;
+ struct can_pkg_stats *can_stats = dev_net(skb->dev)->can.pkg_stats;
int err = -EINVAL;
if (skb->len == CAN_MTU) {
struct receiver *r;
struct hlist_head *rl;
struct can_dev_rcv_lists *d;
- struct can_rcv_lists_stats *can_pstats = net->can.can_pstats;
+ struct can_rcv_lists_stats *can_pstats = net->can.rcv_lists_stats;
int err = 0;
/* insert new receiver (dev,canid,mask) -> (func,data) */
{
struct receiver *r = NULL;
struct hlist_head *rl;
- struct can_rcv_lists_stats *can_pstats = net->can.can_pstats;
+ struct can_rcv_lists_stats *can_pstats = net->can.rcv_lists_stats;
struct can_dev_rcv_lists *d;
if (dev && dev->type != ARPHRD_CAN)
{
struct can_dev_rcv_lists *d;
struct net *net = dev_net(dev);
- struct can_pkg_stats *can_stats = net->can.can_stats;
+ struct can_pkg_stats *can_stats = net->can.pkg_stats;
int matches;
/* update statistics */
kzalloc(sizeof(*net->can.can_rx_alldev_list), GFP_KERNEL);
if (!net->can.can_rx_alldev_list)
goto out;
- net->can.can_stats = kzalloc(sizeof(*net->can.can_stats), GFP_KERNEL);
- if (!net->can.can_stats)
- goto out_free_alldev_list;
- net->can.can_pstats = kzalloc(sizeof(*net->can.can_pstats), GFP_KERNEL);
- if (!net->can.can_pstats)
- goto out_free_can_stats;
+ net->can.pkg_stats = kzalloc(sizeof(*net->can.pkg_stats), GFP_KERNEL);
+ if (!net->can.pkg_stats)
+ goto out_free_rx_alldev_list;
+ net->can.rcv_lists_stats = kzalloc(sizeof(*net->can.rcv_lists_stats), GFP_KERNEL);
+ if (!net->can.rcv_lists_stats)
+ goto out_free_pkg_stats;
if (IS_ENABLED(CONFIG_PROC_FS)) {
/* the statistics are updated every second (timer triggered) */
mod_timer(&net->can.can_stattimer,
round_jiffies(jiffies + HZ));
}
- net->can.can_stats->jiffies_init = jiffies;
+ net->can.pkg_stats->jiffies_init = jiffies;
can_init_proc(net);
}
return 0;
- out_free_can_stats:
- kfree(net->can.can_stats);
- out_free_alldev_list:
+ out_free_pkg_stats:
+ kfree(net->can.pkg_stats);
+ out_free_rx_alldev_list:
kfree(net->can.can_rx_alldev_list);
out:
return -ENOMEM;
rcu_read_unlock();
kfree(net->can.can_rx_alldev_list);
- kfree(net->can.can_stats);
- kfree(net->can.can_pstats);
+ kfree(net->can.pkg_stats);
+ kfree(net->can.rcv_lists_stats);
}
/* af_can module init/exit functions */
static void can_init_stats(struct net *net)
{
- struct can_pkg_stats *can_stats = net->can.can_stats;
- struct can_rcv_lists_stats *can_pstats = net->can.can_pstats;
+ struct can_pkg_stats *can_stats = net->can.pkg_stats;
+ struct can_rcv_lists_stats *can_pstats = net->can.rcv_lists_stats;
/*
* This memset function is called from a timer context (when
* can_stattimer is active which is the default) OR in a process
void can_stat_update(struct timer_list *t)
{
struct net *net = from_timer(net, t, can.can_stattimer);
- struct can_pkg_stats *can_stats = net->can.can_stats;
+ struct can_pkg_stats *can_stats = net->can.pkg_stats;
unsigned long j = jiffies; /* snapshot */
/* restart counting in timer context on user request */
static int can_stats_proc_show(struct seq_file *m, void *v)
{
struct net *net = m->private;
- struct can_pkg_stats *can_stats = net->can.can_stats;
- struct can_rcv_lists_stats *can_pstats = net->can.can_pstats;
+ struct can_pkg_stats *can_stats = net->can.pkg_stats;
+ struct can_rcv_lists_stats *can_pstats = net->can.rcv_lists_stats;
seq_putc(m, '\n');
seq_printf(m, " %8ld transmitted frames (TXF)\n", can_stats->tx_frames);
static int can_reset_stats_proc_show(struct seq_file *m, void *v)
{
struct net *net = m->private;
- struct can_rcv_lists_stats *can_pstats = net->can.can_pstats;
- struct can_pkg_stats *can_stats = net->can.can_stats;
+ struct can_rcv_lists_stats *can_pstats = net->can.rcv_lists_stats;
+ struct can_pkg_stats *can_stats = net->can.pkg_stats;
user_reset = 1;