• Home
  • Raw
  • Download

Lines Matching refs:op

199 	struct bcm_op *op;  in bcm_proc_show()  local
208 list_for_each_entry(op, &bo->rx_ops, list) { in bcm_proc_show()
213 if (!op->frames_abs) in bcm_proc_show()
216 seq_printf(m, "rx_op: %03X %-5s ", op->can_id, in bcm_proc_show()
217 bcm_proc_getifname(net, ifname, op->ifindex)); in bcm_proc_show()
219 if (op->flags & CAN_FD_FRAME) in bcm_proc_show()
220 seq_printf(m, "(%u)", op->nframes); in bcm_proc_show()
222 seq_printf(m, "[%u]", op->nframes); in bcm_proc_show()
224 seq_printf(m, "%c ", (op->flags & RX_CHECK_DLC) ? 'd' : ' '); in bcm_proc_show()
226 if (op->kt_ival1) in bcm_proc_show()
228 (long long)ktime_to_us(op->kt_ival1)); in bcm_proc_show()
230 if (op->kt_ival2) in bcm_proc_show()
232 (long long)ktime_to_us(op->kt_ival2)); in bcm_proc_show()
235 op->frames_filtered, op->frames_abs); in bcm_proc_show()
237 reduction = 100 - (op->frames_filtered * 100) / op->frames_abs; in bcm_proc_show()
243 list_for_each_entry(op, &bo->tx_ops, list) { in bcm_proc_show()
245 seq_printf(m, "tx_op: %03X %s ", op->can_id, in bcm_proc_show()
246 bcm_proc_getifname(net, ifname, op->ifindex)); in bcm_proc_show()
248 if (op->flags & CAN_FD_FRAME) in bcm_proc_show()
249 seq_printf(m, "(%u) ", op->nframes); in bcm_proc_show()
251 seq_printf(m, "[%u] ", op->nframes); in bcm_proc_show()
253 if (op->kt_ival1) in bcm_proc_show()
255 (long long)ktime_to_us(op->kt_ival1)); in bcm_proc_show()
257 if (op->kt_ival2) in bcm_proc_show()
259 (long long)ktime_to_us(op->kt_ival2)); in bcm_proc_show()
261 seq_printf(m, "# sent %ld\n", op->frames_abs); in bcm_proc_show()
272 static void bcm_can_tx(struct bcm_op *op) in bcm_can_tx() argument
276 struct canfd_frame *cf = op->frames + op->cfsiz * op->currframe; in bcm_can_tx()
280 if (!op->ifindex) in bcm_can_tx()
283 dev = dev_get_by_index(sock_net(op->sk), op->ifindex); in bcm_can_tx()
289 skb = alloc_skb(op->cfsiz + sizeof(struct can_skb_priv), gfp_any()); in bcm_can_tx()
297 skb_put_data(skb, cf, op->cfsiz); in bcm_can_tx()
301 can_skb_set_owner(skb, op->sk); in bcm_can_tx()
304 op->frames_abs++; in bcm_can_tx()
306 op->currframe++; in bcm_can_tx()
309 if (op->currframe >= op->nframes) in bcm_can_tx()
310 op->currframe = 0; in bcm_can_tx()
319 static void bcm_send_to_user(struct bcm_op *op, struct bcm_msg_head *head, in bcm_send_to_user() argument
325 struct sock *sk = op->sk; in bcm_send_to_user()
326 unsigned int datalen = head->nframes * op->cfsiz; in bcm_send_to_user()
353 skb->tstamp = op->rx_stamp; in bcm_send_to_user()
367 addr->can_ifindex = op->rx_ifindex; in bcm_send_to_user()
379 static bool bcm_tx_set_expiry(struct bcm_op *op, struct hrtimer *hrt) in bcm_tx_set_expiry() argument
383 if (op->kt_ival1 && op->count) in bcm_tx_set_expiry()
384 ival = op->kt_ival1; in bcm_tx_set_expiry()
385 else if (op->kt_ival2) in bcm_tx_set_expiry()
386 ival = op->kt_ival2; in bcm_tx_set_expiry()
394 static void bcm_tx_start_timer(struct bcm_op *op) in bcm_tx_start_timer() argument
396 if (bcm_tx_set_expiry(op, &op->timer)) in bcm_tx_start_timer()
397 hrtimer_start_expires(&op->timer, HRTIMER_MODE_ABS_SOFT); in bcm_tx_start_timer()
403 struct bcm_op *op = container_of(hrtimer, struct bcm_op, timer); in bcm_tx_timeout_handler() local
406 if (op->kt_ival1 && (op->count > 0)) { in bcm_tx_timeout_handler()
407 op->count--; in bcm_tx_timeout_handler()
408 if (!op->count && (op->flags & TX_COUNTEVT)) { in bcm_tx_timeout_handler()
413 msg_head.flags = op->flags; in bcm_tx_timeout_handler()
414 msg_head.count = op->count; in bcm_tx_timeout_handler()
415 msg_head.ival1 = op->ival1; in bcm_tx_timeout_handler()
416 msg_head.ival2 = op->ival2; in bcm_tx_timeout_handler()
417 msg_head.can_id = op->can_id; in bcm_tx_timeout_handler()
420 bcm_send_to_user(op, &msg_head, NULL, 0); in bcm_tx_timeout_handler()
422 bcm_can_tx(op); in bcm_tx_timeout_handler()
424 } else if (op->kt_ival2) { in bcm_tx_timeout_handler()
425 bcm_can_tx(op); in bcm_tx_timeout_handler()
428 return bcm_tx_set_expiry(op, &op->timer) ? in bcm_tx_timeout_handler()
435 static void bcm_rx_changed(struct bcm_op *op, struct canfd_frame *data) in bcm_rx_changed() argument
440 op->frames_filtered++; in bcm_rx_changed()
443 if (op->frames_filtered > ULONG_MAX/100) in bcm_rx_changed()
444 op->frames_filtered = op->frames_abs = 0; in bcm_rx_changed()
451 head.flags = op->flags; in bcm_rx_changed()
452 head.count = op->count; in bcm_rx_changed()
453 head.ival1 = op->ival1; in bcm_rx_changed()
454 head.ival2 = op->ival2; in bcm_rx_changed()
455 head.can_id = op->can_id; in bcm_rx_changed()
458 bcm_send_to_user(op, &head, data, 1); in bcm_rx_changed()
466 static void bcm_rx_update_and_send(struct bcm_op *op, in bcm_rx_update_and_send() argument
470 memcpy(lastdata, rxdata, op->cfsiz); in bcm_rx_update_and_send()
476 if (!op->kt_ival2) { in bcm_rx_update_and_send()
478 bcm_rx_changed(op, lastdata); in bcm_rx_update_and_send()
483 if (hrtimer_active(&op->thrtimer)) in bcm_rx_update_and_send()
487 if (!op->kt_lastmsg) in bcm_rx_update_and_send()
491 if (ktime_us_delta(ktime_get(), op->kt_lastmsg) < in bcm_rx_update_and_send()
492 ktime_to_us(op->kt_ival2)) { in bcm_rx_update_and_send()
494 hrtimer_start(&op->thrtimer, in bcm_rx_update_and_send()
495 ktime_add(op->kt_lastmsg, op->kt_ival2), in bcm_rx_update_and_send()
502 bcm_rx_changed(op, lastdata); in bcm_rx_update_and_send()
503 op->kt_lastmsg = ktime_get(); in bcm_rx_update_and_send()
510 static void bcm_rx_cmp_to_index(struct bcm_op *op, unsigned int index, in bcm_rx_cmp_to_index() argument
513 struct canfd_frame *cf = op->frames + op->cfsiz * index; in bcm_rx_cmp_to_index()
514 struct canfd_frame *lcf = op->last_frames + op->cfsiz * index; in bcm_rx_cmp_to_index()
524 bcm_rx_update_and_send(op, lcf, rxdata); in bcm_rx_cmp_to_index()
532 bcm_rx_update_and_send(op, lcf, rxdata); in bcm_rx_cmp_to_index()
537 if (op->flags & RX_CHECK_DLC) { in bcm_rx_cmp_to_index()
540 bcm_rx_update_and_send(op, lcf, rxdata); in bcm_rx_cmp_to_index()
549 static void bcm_rx_starttimer(struct bcm_op *op) in bcm_rx_starttimer() argument
551 if (op->flags & RX_NO_AUTOTIMER) in bcm_rx_starttimer()
554 if (op->kt_ival1) in bcm_rx_starttimer()
555 hrtimer_start(&op->timer, op->kt_ival1, HRTIMER_MODE_REL_SOFT); in bcm_rx_starttimer()
561 struct bcm_op *op = container_of(hrtimer, struct bcm_op, timer); in bcm_rx_timeout_handler() local
565 if ((op->flags & RX_ANNOUNCE_RESUME) && op->last_frames) { in bcm_rx_timeout_handler()
567 memset(op->last_frames, 0, op->nframes * op->cfsiz); in bcm_rx_timeout_handler()
573 msg_head.flags = op->flags; in bcm_rx_timeout_handler()
574 msg_head.count = op->count; in bcm_rx_timeout_handler()
575 msg_head.ival1 = op->ival1; in bcm_rx_timeout_handler()
576 msg_head.ival2 = op->ival2; in bcm_rx_timeout_handler()
577 msg_head.can_id = op->can_id; in bcm_rx_timeout_handler()
580 bcm_send_to_user(op, &msg_head, NULL, 0); in bcm_rx_timeout_handler()
588 static inline int bcm_rx_do_flush(struct bcm_op *op, unsigned int index) in bcm_rx_do_flush() argument
590 struct canfd_frame *lcf = op->last_frames + op->cfsiz * index; in bcm_rx_do_flush()
592 if ((op->last_frames) && (lcf->flags & RX_THR)) { in bcm_rx_do_flush()
593 bcm_rx_changed(op, lcf); in bcm_rx_do_flush()
602 static int bcm_rx_thr_flush(struct bcm_op *op) in bcm_rx_thr_flush() argument
606 if (op->nframes > 1) { in bcm_rx_thr_flush()
610 for (i = 1; i < op->nframes; i++) in bcm_rx_thr_flush()
611 updated += bcm_rx_do_flush(op, i); in bcm_rx_thr_flush()
615 updated += bcm_rx_do_flush(op, 0); in bcm_rx_thr_flush()
627 struct bcm_op *op = container_of(hrtimer, struct bcm_op, thrtimer); in bcm_rx_thr_handler() local
629 if (bcm_rx_thr_flush(op)) { in bcm_rx_thr_handler()
630 hrtimer_forward(hrtimer, ktime_get(), op->kt_ival2); in bcm_rx_thr_handler()
634 op->kt_lastmsg = 0; in bcm_rx_thr_handler()
644 struct bcm_op *op = (struct bcm_op *)data; in bcm_rx_handler() local
648 if (op->can_id != rxframe->can_id) in bcm_rx_handler()
652 if (skb->len != op->cfsiz) in bcm_rx_handler()
656 hrtimer_cancel(&op->timer); in bcm_rx_handler()
659 op->rx_stamp = skb->tstamp; in bcm_rx_handler()
661 op->rx_ifindex = skb->dev->ifindex; in bcm_rx_handler()
663 op->frames_abs++; in bcm_rx_handler()
665 if (op->flags & RX_RTR_FRAME) { in bcm_rx_handler()
667 bcm_can_tx(op); in bcm_rx_handler()
671 if (op->flags & RX_FILTER_ID) { in bcm_rx_handler()
673 bcm_rx_update_and_send(op, op->last_frames, rxframe); in bcm_rx_handler()
677 if (op->nframes == 1) { in bcm_rx_handler()
679 bcm_rx_cmp_to_index(op, 0, rxframe); in bcm_rx_handler()
683 if (op->nframes > 1) { in bcm_rx_handler()
692 for (i = 1; i < op->nframes; i++) { in bcm_rx_handler()
693 if ((get_u64(op->frames, 0) & get_u64(rxframe, 0)) == in bcm_rx_handler()
694 (get_u64(op->frames, 0) & in bcm_rx_handler()
695 get_u64(op->frames + op->cfsiz * i, 0))) { in bcm_rx_handler()
696 bcm_rx_cmp_to_index(op, i, rxframe); in bcm_rx_handler()
703 bcm_rx_starttimer(op); in bcm_rx_handler()
712 struct bcm_op *op; in bcm_find_op() local
714 list_for_each_entry(op, ops, list) { in bcm_find_op()
715 if ((op->can_id == mh->can_id) && (op->ifindex == ifindex) && in bcm_find_op()
716 (op->flags & CAN_FD_FRAME) == (mh->flags & CAN_FD_FRAME)) in bcm_find_op()
717 return op; in bcm_find_op()
725 struct bcm_op *op = container_of(rcu_head, struct bcm_op, rcu); in bcm_free_op_rcu() local
727 if ((op->frames) && (op->frames != &op->sframe)) in bcm_free_op_rcu()
728 kfree(op->frames); in bcm_free_op_rcu()
730 if ((op->last_frames) && (op->last_frames != &op->last_sframe)) in bcm_free_op_rcu()
731 kfree(op->last_frames); in bcm_free_op_rcu()
733 kfree(op); in bcm_free_op_rcu()
736 static void bcm_remove_op(struct bcm_op *op) in bcm_remove_op() argument
738 hrtimer_cancel(&op->timer); in bcm_remove_op()
739 hrtimer_cancel(&op->thrtimer); in bcm_remove_op()
741 call_rcu(&op->rcu, bcm_free_op_rcu); in bcm_remove_op()
744 static void bcm_rx_unreg(struct net_device *dev, struct bcm_op *op) in bcm_rx_unreg() argument
746 if (op->rx_reg_dev == dev) { in bcm_rx_unreg()
747 can_rx_unregister(dev_net(dev), dev, op->can_id, in bcm_rx_unreg()
748 REGMASK(op->can_id), bcm_rx_handler, op); in bcm_rx_unreg()
751 op->rx_reg_dev = NULL; in bcm_rx_unreg()
754 "mismatch %p %p\n", op->rx_reg_dev, dev); in bcm_rx_unreg()
763 struct bcm_op *op, *n; in bcm_delete_rx_op() local
765 list_for_each_entry_safe(op, n, ops, list) { in bcm_delete_rx_op()
766 if ((op->can_id == mh->can_id) && (op->ifindex == ifindex) && in bcm_delete_rx_op()
767 (op->flags & CAN_FD_FRAME) == (mh->flags & CAN_FD_FRAME)) { in bcm_delete_rx_op()
770 op->flags |= RX_NO_AUTOTIMER; in bcm_delete_rx_op()
777 if (op->ifindex) { in bcm_delete_rx_op()
783 if (op->rx_reg_dev) { in bcm_delete_rx_op()
786 dev = dev_get_by_index(sock_net(op->sk), in bcm_delete_rx_op()
787 op->ifindex); in bcm_delete_rx_op()
789 bcm_rx_unreg(dev, op); in bcm_delete_rx_op()
794 can_rx_unregister(sock_net(op->sk), NULL, in bcm_delete_rx_op()
795 op->can_id, in bcm_delete_rx_op()
796 REGMASK(op->can_id), in bcm_delete_rx_op()
797 bcm_rx_handler, op); in bcm_delete_rx_op()
799 list_del(&op->list); in bcm_delete_rx_op()
800 bcm_remove_op(op); in bcm_delete_rx_op()
814 struct bcm_op *op, *n; in bcm_delete_tx_op() local
816 list_for_each_entry_safe(op, n, ops, list) { in bcm_delete_tx_op()
817 if ((op->can_id == mh->can_id) && (op->ifindex == ifindex) && in bcm_delete_tx_op()
818 (op->flags & CAN_FD_FRAME) == (mh->flags & CAN_FD_FRAME)) { in bcm_delete_tx_op()
819 list_del(&op->list); in bcm_delete_tx_op()
820 bcm_remove_op(op); in bcm_delete_tx_op()
834 struct bcm_op *op = bcm_find_op(ops, msg_head, ifindex); in bcm_read_op() local
836 if (!op) in bcm_read_op()
840 msg_head->flags = op->flags; in bcm_read_op()
841 msg_head->count = op->count; in bcm_read_op()
842 msg_head->ival1 = op->ival1; in bcm_read_op()
843 msg_head->ival2 = op->ival2; in bcm_read_op()
844 msg_head->nframes = op->nframes; in bcm_read_op()
846 bcm_send_to_user(op, msg_head, op->frames, 0); in bcm_read_op()
858 struct bcm_op *op; in bcm_tx_setup() local
876 op = bcm_find_op(&bo->tx_ops, msg_head, ifindex); in bcm_tx_setup()
877 if (op) { in bcm_tx_setup()
885 if (msg_head->nframes > op->nframes) in bcm_tx_setup()
891 cf = op->frames + op->cfsiz * i; in bcm_tx_setup()
892 err = memcpy_from_msg((u8 *)cf, msg, op->cfsiz); in bcm_tx_setup()
894 if (op->flags & CAN_FD_FRAME) { in bcm_tx_setup()
910 op->flags = msg_head->flags; in bcm_tx_setup()
915 op = kzalloc(OPSIZ, GFP_KERNEL); in bcm_tx_setup()
916 if (!op) in bcm_tx_setup()
919 op->can_id = msg_head->can_id; in bcm_tx_setup()
920 op->cfsiz = CFSIZ(msg_head->flags); in bcm_tx_setup()
921 op->flags = msg_head->flags; in bcm_tx_setup()
925 op->frames = kmalloc_array(msg_head->nframes, in bcm_tx_setup()
926 op->cfsiz, in bcm_tx_setup()
928 if (!op->frames) { in bcm_tx_setup()
929 kfree(op); in bcm_tx_setup()
933 op->frames = &op->sframe; in bcm_tx_setup()
937 cf = op->frames + op->cfsiz * i; in bcm_tx_setup()
938 err = memcpy_from_msg((u8 *)cf, msg, op->cfsiz); in bcm_tx_setup()
942 if (op->flags & CAN_FD_FRAME) { in bcm_tx_setup()
960 op->last_frames = NULL; in bcm_tx_setup()
963 op->sk = sk; in bcm_tx_setup()
964 op->ifindex = ifindex; in bcm_tx_setup()
967 hrtimer_init(&op->timer, CLOCK_MONOTONIC, in bcm_tx_setup()
969 op->timer.function = bcm_tx_timeout_handler; in bcm_tx_setup()
972 hrtimer_init(&op->thrtimer, CLOCK_MONOTONIC, in bcm_tx_setup()
976 list_add(&op->list, &bo->tx_ops); in bcm_tx_setup()
980 if (op->nframes != msg_head->nframes) { in bcm_tx_setup()
981 op->nframes = msg_head->nframes; in bcm_tx_setup()
983 op->currframe = 0; in bcm_tx_setup()
988 if (op->flags & TX_RESET_MULTI_IDX) { in bcm_tx_setup()
990 op->currframe = 0; in bcm_tx_setup()
993 if (op->flags & SETTIMER) { in bcm_tx_setup()
995 op->count = msg_head->count; in bcm_tx_setup()
996 op->ival1 = msg_head->ival1; in bcm_tx_setup()
997 op->ival2 = msg_head->ival2; in bcm_tx_setup()
998 op->kt_ival1 = bcm_timeval_to_ktime(msg_head->ival1); in bcm_tx_setup()
999 op->kt_ival2 = bcm_timeval_to_ktime(msg_head->ival2); in bcm_tx_setup()
1002 if (!op->kt_ival1 && !op->kt_ival2) in bcm_tx_setup()
1003 hrtimer_cancel(&op->timer); in bcm_tx_setup()
1006 if (op->flags & STARTTIMER) { in bcm_tx_setup()
1007 hrtimer_cancel(&op->timer); in bcm_tx_setup()
1009 op->flags |= TX_ANNOUNCE; in bcm_tx_setup()
1012 if (op->flags & TX_ANNOUNCE) { in bcm_tx_setup()
1013 bcm_can_tx(op); in bcm_tx_setup()
1014 if (op->count) in bcm_tx_setup()
1015 op->count--; in bcm_tx_setup()
1018 if (op->flags & STARTTIMER) in bcm_tx_setup()
1019 bcm_tx_start_timer(op); in bcm_tx_setup()
1021 return msg_head->nframes * op->cfsiz + MHSIZ; in bcm_tx_setup()
1024 if (op->frames != &op->sframe) in bcm_tx_setup()
1025 kfree(op->frames); in bcm_tx_setup()
1026 kfree(op); in bcm_tx_setup()
1037 struct bcm_op *op; in bcm_rx_setup() local
1062 op = bcm_find_op(&bo->rx_ops, msg_head, ifindex); in bcm_rx_setup()
1063 if (op) { in bcm_rx_setup()
1071 if (msg_head->nframes > op->nframes) in bcm_rx_setup()
1076 err = memcpy_from_msg(op->frames, msg, in bcm_rx_setup()
1077 msg_head->nframes * op->cfsiz); in bcm_rx_setup()
1082 memset(op->last_frames, 0, msg_head->nframes * op->cfsiz); in bcm_rx_setup()
1085 op->nframes = msg_head->nframes; in bcm_rx_setup()
1086 op->flags = msg_head->flags; in bcm_rx_setup()
1093 op = kzalloc(OPSIZ, GFP_KERNEL); in bcm_rx_setup()
1094 if (!op) in bcm_rx_setup()
1097 op->can_id = msg_head->can_id; in bcm_rx_setup()
1098 op->nframes = msg_head->nframes; in bcm_rx_setup()
1099 op->cfsiz = CFSIZ(msg_head->flags); in bcm_rx_setup()
1100 op->flags = msg_head->flags; in bcm_rx_setup()
1104 op->frames = kmalloc_array(msg_head->nframes, in bcm_rx_setup()
1105 op->cfsiz, in bcm_rx_setup()
1107 if (!op->frames) { in bcm_rx_setup()
1108 kfree(op); in bcm_rx_setup()
1113 op->last_frames = kcalloc(msg_head->nframes, in bcm_rx_setup()
1114 op->cfsiz, in bcm_rx_setup()
1116 if (!op->last_frames) { in bcm_rx_setup()
1117 kfree(op->frames); in bcm_rx_setup()
1118 kfree(op); in bcm_rx_setup()
1123 op->frames = &op->sframe; in bcm_rx_setup()
1124 op->last_frames = &op->last_sframe; in bcm_rx_setup()
1128 err = memcpy_from_msg(op->frames, msg, in bcm_rx_setup()
1129 msg_head->nframes * op->cfsiz); in bcm_rx_setup()
1131 if (op->frames != &op->sframe) in bcm_rx_setup()
1132 kfree(op->frames); in bcm_rx_setup()
1133 if (op->last_frames != &op->last_sframe) in bcm_rx_setup()
1134 kfree(op->last_frames); in bcm_rx_setup()
1135 kfree(op); in bcm_rx_setup()
1141 op->sk = sk; in bcm_rx_setup()
1142 op->ifindex = ifindex; in bcm_rx_setup()
1145 op->rx_ifindex = ifindex; in bcm_rx_setup()
1148 hrtimer_init(&op->timer, CLOCK_MONOTONIC, in bcm_rx_setup()
1150 op->timer.function = bcm_rx_timeout_handler; in bcm_rx_setup()
1152 hrtimer_init(&op->thrtimer, CLOCK_MONOTONIC, in bcm_rx_setup()
1154 op->thrtimer.function = bcm_rx_thr_handler; in bcm_rx_setup()
1157 list_add(&op->list, &bo->rx_ops); in bcm_rx_setup()
1166 if (op->flags & RX_RTR_FRAME) { in bcm_rx_setup()
1167 struct canfd_frame *frame0 = op->frames; in bcm_rx_setup()
1170 hrtimer_cancel(&op->thrtimer); in bcm_rx_setup()
1171 hrtimer_cancel(&op->timer); in bcm_rx_setup()
1178 if ((op->flags & TX_CP_CAN_ID) || in bcm_rx_setup()
1179 (frame0->can_id == op->can_id)) in bcm_rx_setup()
1180 frame0->can_id = op->can_id & ~CAN_RTR_FLAG; in bcm_rx_setup()
1183 if (op->flags & SETTIMER) { in bcm_rx_setup()
1186 op->ival1 = msg_head->ival1; in bcm_rx_setup()
1187 op->ival2 = msg_head->ival2; in bcm_rx_setup()
1188 op->kt_ival1 = bcm_timeval_to_ktime(msg_head->ival1); in bcm_rx_setup()
1189 op->kt_ival2 = bcm_timeval_to_ktime(msg_head->ival2); in bcm_rx_setup()
1192 if (!op->kt_ival1) in bcm_rx_setup()
1193 hrtimer_cancel(&op->timer); in bcm_rx_setup()
1199 op->kt_lastmsg = 0; in bcm_rx_setup()
1200 hrtimer_cancel(&op->thrtimer); in bcm_rx_setup()
1201 bcm_rx_thr_flush(op); in bcm_rx_setup()
1204 if ((op->flags & STARTTIMER) && op->kt_ival1) in bcm_rx_setup()
1205 hrtimer_start(&op->timer, op->kt_ival1, in bcm_rx_setup()
1217 op->can_id, in bcm_rx_setup()
1218 REGMASK(op->can_id), in bcm_rx_setup()
1219 bcm_rx_handler, op, in bcm_rx_setup()
1222 op->rx_reg_dev = dev; in bcm_rx_setup()
1227 err = can_rx_register(sock_net(sk), NULL, op->can_id, in bcm_rx_setup()
1228 REGMASK(op->can_id), in bcm_rx_setup()
1229 bcm_rx_handler, op, "bcm", sk); in bcm_rx_setup()
1232 list_del(&op->list); in bcm_rx_setup()
1233 bcm_remove_op(op); in bcm_rx_setup()
1238 return msg_head->nframes * op->cfsiz + MHSIZ; in bcm_rx_setup()
1408 struct bcm_op *op; in bcm_notify() local
1420 list_for_each_entry(op, &bo->rx_ops, list) in bcm_notify()
1421 if (op->rx_reg_dev == dev) in bcm_notify()
1422 bcm_rx_unreg(dev, op); in bcm_notify()
1503 struct bcm_op *op, *next; in bcm_release() local
1530 list_for_each_entry_safe(op, next, &bo->tx_ops, list) in bcm_release()
1531 bcm_remove_op(op); in bcm_release()
1533 list_for_each_entry_safe(op, next, &bo->rx_ops, list) { in bcm_release()
1538 if (op->ifindex) { in bcm_release()
1544 if (op->rx_reg_dev) { in bcm_release()
1547 dev = dev_get_by_index(net, op->ifindex); in bcm_release()
1549 bcm_rx_unreg(dev, op); in bcm_release()
1554 can_rx_unregister(net, NULL, op->can_id, in bcm_release()
1555 REGMASK(op->can_id), in bcm_release()
1556 bcm_rx_handler, op); in bcm_release()
1562 list_for_each_entry_safe(op, next, &bo->rx_ops, list) in bcm_release()
1563 bcm_remove_op(op); in bcm_release()