bcm.c (441bc62741e6e7f8d428b827c2a7b482a467fc42) | bcm.c (3617d9496cd92dcca4d0893191d95554590d8d9f) |
---|---|
1/* 2 * bcm.c - Broadcast Manager to filter/send (cyclic) CAN content 3 * 4 * Copyright (c) 2002-2017 Volkswagen Group Electronic Research 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 225 unchanged lines hidden (view full) --- 234 seq_printf(m, "t2=%lld ", 235 (long long)ktime_to_us(op->kt_ival2)); 236 237 seq_printf(m, "# sent %ld\n", op->frames_abs); 238 } 239 seq_putc(m, '\n'); 240 return 0; 241} | 1/* 2 * bcm.c - Broadcast Manager to filter/send (cyclic) CAN content 3 * 4 * Copyright (c) 2002-2017 Volkswagen Group Electronic Research 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 225 unchanged lines hidden (view full) --- 234 seq_printf(m, "t2=%lld ", 235 (long long)ktime_to_us(op->kt_ival2)); 236 237 seq_printf(m, "# sent %ld\n", op->frames_abs); 238 } 239 seq_putc(m, '\n'); 240 return 0; 241} |
242 243static int bcm_proc_open(struct inode *inode, struct file *file) 244{ 245 return single_open_net(inode, file, bcm_proc_show); 246} 247 248static const struct file_operations bcm_proc_fops = { 249 .open = bcm_proc_open, 250 .read = seq_read, 251 .llseek = seq_lseek, 252 .release = single_release_net, 253}; | |
254#endif /* CONFIG_PROC_FS */ 255 256/* 257 * bcm_can_tx - send the (next) CAN frame to the appropriate CAN interface 258 * of the given bcm tx op 259 */ 260static void bcm_can_tx(struct bcm_op *op) 261{ --- 1339 unchanged lines hidden (view full) --- 1601 /* no interface reference for ifindex = 0 ('any' CAN device) */ 1602 bo->ifindex = 0; 1603 } 1604 1605#if IS_ENABLED(CONFIG_PROC_FS) 1606 if (net->can.bcmproc_dir) { 1607 /* unique socket address as filename */ 1608 sprintf(bo->procname, "%lu", sock_i_ino(sk)); | 242#endif /* CONFIG_PROC_FS */ 243 244/* 245 * bcm_can_tx - send the (next) CAN frame to the appropriate CAN interface 246 * of the given bcm tx op 247 */ 248static void bcm_can_tx(struct bcm_op *op) 249{ --- 1339 unchanged lines hidden (view full) --- 1589 /* no interface reference for ifindex = 0 ('any' CAN device) */ 1590 bo->ifindex = 0; 1591 } 1592 1593#if IS_ENABLED(CONFIG_PROC_FS) 1594 if (net->can.bcmproc_dir) { 1595 /* unique socket address as filename */ 1596 sprintf(bo->procname, "%lu", sock_i_ino(sk)); |
1609 bo->bcm_proc_read = proc_create_data(bo->procname, 0644, | 1597 bo->bcm_proc_read = proc_create_net_single(bo->procname, 0644, |
1610 net->can.bcmproc_dir, | 1598 net->can.bcmproc_dir, |
1611 &bcm_proc_fops, sk); | 1599 bcm_proc_show, sk); |
1612 if (!bo->bcm_proc_read) { 1613 ret = -ENOMEM; 1614 goto fail; 1615 } 1616 } 1617#endif /* CONFIG_PROC_FS */ 1618 1619 bo->bound = 1; --- 126 unchanged lines hidden --- | 1600 if (!bo->bcm_proc_read) { 1601 ret = -ENOMEM; 1602 goto fail; 1603 } 1604 } 1605#endif /* CONFIG_PROC_FS */ 1606 1607 bo->bound = 1; --- 126 unchanged lines hidden --- |