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_now(hrtimer, 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 (op->flags & CAN_FD_FRAME) { in bcm_rx_handler()
661 hrtimer_cancel(&op->timer); in bcm_rx_handler()
664 op->rx_stamp = skb->tstamp; in bcm_rx_handler()
666 op->rx_ifindex = skb->dev->ifindex; in bcm_rx_handler()
668 op->frames_abs++; in bcm_rx_handler()
670 if (op->flags & RX_RTR_FRAME) { in bcm_rx_handler()
672 bcm_can_tx(op); in bcm_rx_handler()
676 if (op->flags & RX_FILTER_ID) { in bcm_rx_handler()
678 bcm_rx_update_and_send(op, op->last_frames, rxframe); in bcm_rx_handler()
682 if (op->nframes == 1) { in bcm_rx_handler()
684 bcm_rx_cmp_to_index(op, 0, rxframe); in bcm_rx_handler()
688 if (op->nframes > 1) { in bcm_rx_handler()
697 for (i = 1; i < op->nframes; i++) { in bcm_rx_handler()
698 if ((get_u64(op->frames, 0) & get_u64(rxframe, 0)) == in bcm_rx_handler()
699 (get_u64(op->frames, 0) & in bcm_rx_handler()
700 get_u64(op->frames + op->cfsiz * i, 0))) { in bcm_rx_handler()
701 bcm_rx_cmp_to_index(op, i, rxframe); in bcm_rx_handler()
708 bcm_rx_starttimer(op); in bcm_rx_handler()
717 struct bcm_op *op; in bcm_find_op() local
719 list_for_each_entry(op, ops, list) { in bcm_find_op()
720 if ((op->can_id == mh->can_id) && (op->ifindex == ifindex) && in bcm_find_op()
721 (op->flags & CAN_FD_FRAME) == (mh->flags & CAN_FD_FRAME)) in bcm_find_op()
722 return op; in bcm_find_op()
730 struct bcm_op *op = container_of(rcu_head, struct bcm_op, rcu); in bcm_free_op_rcu() local
732 if ((op->frames) && (op->frames != &op->sframe)) in bcm_free_op_rcu()
733 kfree(op->frames); in bcm_free_op_rcu()
735 if ((op->last_frames) && (op->last_frames != &op->last_sframe)) in bcm_free_op_rcu()
736 kfree(op->last_frames); in bcm_free_op_rcu()
738 kfree(op); in bcm_free_op_rcu()
741 static void bcm_remove_op(struct bcm_op *op) in bcm_remove_op() argument
743 hrtimer_cancel(&op->timer); in bcm_remove_op()
744 hrtimer_cancel(&op->thrtimer); in bcm_remove_op()
746 call_rcu(&op->rcu, bcm_free_op_rcu); in bcm_remove_op()
749 static void bcm_rx_unreg(struct net_device *dev, struct bcm_op *op) in bcm_rx_unreg() argument
751 if (op->rx_reg_dev == dev) { in bcm_rx_unreg()
752 can_rx_unregister(dev_net(dev), dev, op->can_id, in bcm_rx_unreg()
753 REGMASK(op->can_id), bcm_rx_handler, op); in bcm_rx_unreg()
756 op->rx_reg_dev = NULL; in bcm_rx_unreg()
759 "mismatch %p %p\n", op->rx_reg_dev, dev); in bcm_rx_unreg()
768 struct bcm_op *op, *n; in bcm_delete_rx_op() local
770 list_for_each_entry_safe(op, n, ops, list) { in bcm_delete_rx_op()
771 if ((op->can_id == mh->can_id) && (op->ifindex == ifindex) && in bcm_delete_rx_op()
772 (op->flags & CAN_FD_FRAME) == (mh->flags & CAN_FD_FRAME)) { in bcm_delete_rx_op()
775 op->flags |= RX_NO_AUTOTIMER; in bcm_delete_rx_op()
782 if (op->ifindex) { in bcm_delete_rx_op()
788 if (op->rx_reg_dev) { in bcm_delete_rx_op()
791 dev = dev_get_by_index(sock_net(op->sk), in bcm_delete_rx_op()
792 op->ifindex); in bcm_delete_rx_op()
794 bcm_rx_unreg(dev, op); in bcm_delete_rx_op()
799 can_rx_unregister(sock_net(op->sk), NULL, in bcm_delete_rx_op()
800 op->can_id, in bcm_delete_rx_op()
801 REGMASK(op->can_id), in bcm_delete_rx_op()
802 bcm_rx_handler, op); in bcm_delete_rx_op()
804 list_del(&op->list); in bcm_delete_rx_op()
805 bcm_remove_op(op); in bcm_delete_rx_op()
819 struct bcm_op *op, *n; in bcm_delete_tx_op() local
821 list_for_each_entry_safe(op, n, ops, list) { in bcm_delete_tx_op()
822 if ((op->can_id == mh->can_id) && (op->ifindex == ifindex) && in bcm_delete_tx_op()
823 (op->flags & CAN_FD_FRAME) == (mh->flags & CAN_FD_FRAME)) { in bcm_delete_tx_op()
824 list_del(&op->list); in bcm_delete_tx_op()
825 bcm_remove_op(op); in bcm_delete_tx_op()
839 struct bcm_op *op = bcm_find_op(ops, msg_head, ifindex); in bcm_read_op() local
841 if (!op) in bcm_read_op()
845 msg_head->flags = op->flags; in bcm_read_op()
846 msg_head->count = op->count; in bcm_read_op()
847 msg_head->ival1 = op->ival1; in bcm_read_op()
848 msg_head->ival2 = op->ival2; in bcm_read_op()
849 msg_head->nframes = op->nframes; in bcm_read_op()
851 bcm_send_to_user(op, msg_head, op->frames, 0); in bcm_read_op()
863 struct bcm_op *op; in bcm_tx_setup() local
881 op = bcm_find_op(&bo->tx_ops, msg_head, ifindex); in bcm_tx_setup()
882 if (op) { in bcm_tx_setup()
890 if (msg_head->nframes > op->nframes) in bcm_tx_setup()
896 cf = op->frames + op->cfsiz * i; in bcm_tx_setup()
897 err = memcpy_from_msg((u8 *)cf, msg, op->cfsiz); in bcm_tx_setup()
899 if (op->flags & CAN_FD_FRAME) { in bcm_tx_setup()
915 op->flags = msg_head->flags; in bcm_tx_setup()
920 op = kzalloc(OPSIZ, GFP_KERNEL); in bcm_tx_setup()
921 if (!op) in bcm_tx_setup()
924 op->can_id = msg_head->can_id; in bcm_tx_setup()
925 op->cfsiz = CFSIZ(msg_head->flags); in bcm_tx_setup()
926 op->flags = msg_head->flags; in bcm_tx_setup()
930 op->frames = kmalloc_array(msg_head->nframes, in bcm_tx_setup()
931 op->cfsiz, in bcm_tx_setup()
933 if (!op->frames) { in bcm_tx_setup()
934 kfree(op); in bcm_tx_setup()
938 op->frames = &op->sframe; in bcm_tx_setup()
942 cf = op->frames + op->cfsiz * i; in bcm_tx_setup()
943 err = memcpy_from_msg((u8 *)cf, msg, op->cfsiz); in bcm_tx_setup()
947 if (op->flags & CAN_FD_FRAME) { in bcm_tx_setup()
965 op->last_frames = NULL; in bcm_tx_setup()
968 op->sk = sk; in bcm_tx_setup()
969 op->ifindex = ifindex; in bcm_tx_setup()
972 hrtimer_init(&op->timer, CLOCK_MONOTONIC, in bcm_tx_setup()
974 op->timer.function = bcm_tx_timeout_handler; in bcm_tx_setup()
977 hrtimer_init(&op->thrtimer, CLOCK_MONOTONIC, in bcm_tx_setup()
981 list_add(&op->list, &bo->tx_ops); in bcm_tx_setup()
985 if (op->nframes != msg_head->nframes) { in bcm_tx_setup()
986 op->nframes = msg_head->nframes; in bcm_tx_setup()
988 op->currframe = 0; in bcm_tx_setup()
993 if (op->flags & TX_RESET_MULTI_IDX) { in bcm_tx_setup()
995 op->currframe = 0; in bcm_tx_setup()
998 if (op->flags & SETTIMER) { in bcm_tx_setup()
1000 op->count = msg_head->count; in bcm_tx_setup()
1001 op->ival1 = msg_head->ival1; in bcm_tx_setup()
1002 op->ival2 = msg_head->ival2; in bcm_tx_setup()
1003 op->kt_ival1 = bcm_timeval_to_ktime(msg_head->ival1); in bcm_tx_setup()
1004 op->kt_ival2 = bcm_timeval_to_ktime(msg_head->ival2); in bcm_tx_setup()
1007 if (!op->kt_ival1 && !op->kt_ival2) in bcm_tx_setup()
1008 hrtimer_cancel(&op->timer); in bcm_tx_setup()
1011 if (op->flags & STARTTIMER) { in bcm_tx_setup()
1012 hrtimer_cancel(&op->timer); in bcm_tx_setup()
1014 op->flags |= TX_ANNOUNCE; in bcm_tx_setup()
1017 if (op->flags & TX_ANNOUNCE) { in bcm_tx_setup()
1018 bcm_can_tx(op); in bcm_tx_setup()
1019 if (op->count) in bcm_tx_setup()
1020 op->count--; in bcm_tx_setup()
1023 if (op->flags & STARTTIMER) in bcm_tx_setup()
1024 bcm_tx_start_timer(op); in bcm_tx_setup()
1026 return msg_head->nframes * op->cfsiz + MHSIZ; in bcm_tx_setup()
1029 if (op->frames != &op->sframe) in bcm_tx_setup()
1030 kfree(op->frames); in bcm_tx_setup()
1031 kfree(op); in bcm_tx_setup()
1042 struct bcm_op *op; in bcm_rx_setup() local
1067 op = bcm_find_op(&bo->rx_ops, msg_head, ifindex); in bcm_rx_setup()
1068 if (op) { in bcm_rx_setup()
1076 if (msg_head->nframes > op->nframes) in bcm_rx_setup()
1081 err = memcpy_from_msg(op->frames, msg, in bcm_rx_setup()
1082 msg_head->nframes * op->cfsiz); in bcm_rx_setup()
1087 memset(op->last_frames, 0, msg_head->nframes * op->cfsiz); in bcm_rx_setup()
1090 op->nframes = msg_head->nframes; in bcm_rx_setup()
1091 op->flags = msg_head->flags; in bcm_rx_setup()
1098 op = kzalloc(OPSIZ, GFP_KERNEL); in bcm_rx_setup()
1099 if (!op) in bcm_rx_setup()
1102 op->can_id = msg_head->can_id; in bcm_rx_setup()
1103 op->nframes = msg_head->nframes; in bcm_rx_setup()
1104 op->cfsiz = CFSIZ(msg_head->flags); in bcm_rx_setup()
1105 op->flags = msg_head->flags; in bcm_rx_setup()
1109 op->frames = kmalloc_array(msg_head->nframes, in bcm_rx_setup()
1110 op->cfsiz, in bcm_rx_setup()
1112 if (!op->frames) { in bcm_rx_setup()
1113 kfree(op); in bcm_rx_setup()
1118 op->last_frames = kcalloc(msg_head->nframes, in bcm_rx_setup()
1119 op->cfsiz, in bcm_rx_setup()
1121 if (!op->last_frames) { in bcm_rx_setup()
1122 kfree(op->frames); in bcm_rx_setup()
1123 kfree(op); in bcm_rx_setup()
1128 op->frames = &op->sframe; in bcm_rx_setup()
1129 op->last_frames = &op->last_sframe; in bcm_rx_setup()
1133 err = memcpy_from_msg(op->frames, msg, in bcm_rx_setup()
1134 msg_head->nframes * op->cfsiz); in bcm_rx_setup()
1136 if (op->frames != &op->sframe) in bcm_rx_setup()
1137 kfree(op->frames); in bcm_rx_setup()
1138 if (op->last_frames != &op->last_sframe) in bcm_rx_setup()
1139 kfree(op->last_frames); in bcm_rx_setup()
1140 kfree(op); in bcm_rx_setup()
1146 op->sk = sk; in bcm_rx_setup()
1147 op->ifindex = ifindex; in bcm_rx_setup()
1150 op->rx_ifindex = ifindex; in bcm_rx_setup()
1153 hrtimer_init(&op->timer, CLOCK_MONOTONIC, in bcm_rx_setup()
1155 op->timer.function = bcm_rx_timeout_handler; in bcm_rx_setup()
1157 hrtimer_init(&op->thrtimer, CLOCK_MONOTONIC, in bcm_rx_setup()
1159 op->thrtimer.function = bcm_rx_thr_handler; in bcm_rx_setup()
1162 list_add(&op->list, &bo->rx_ops); in bcm_rx_setup()
1171 if (op->flags & RX_RTR_FRAME) { in bcm_rx_setup()
1172 struct canfd_frame *frame0 = op->frames; in bcm_rx_setup()
1175 hrtimer_cancel(&op->thrtimer); in bcm_rx_setup()
1176 hrtimer_cancel(&op->timer); in bcm_rx_setup()
1183 if ((op->flags & TX_CP_CAN_ID) || in bcm_rx_setup()
1184 (frame0->can_id == op->can_id)) in bcm_rx_setup()
1185 frame0->can_id = op->can_id & ~CAN_RTR_FLAG; in bcm_rx_setup()
1188 if (op->flags & SETTIMER) { in bcm_rx_setup()
1191 op->ival1 = msg_head->ival1; in bcm_rx_setup()
1192 op->ival2 = msg_head->ival2; in bcm_rx_setup()
1193 op->kt_ival1 = bcm_timeval_to_ktime(msg_head->ival1); in bcm_rx_setup()
1194 op->kt_ival2 = bcm_timeval_to_ktime(msg_head->ival2); in bcm_rx_setup()
1197 if (!op->kt_ival1) in bcm_rx_setup()
1198 hrtimer_cancel(&op->timer); in bcm_rx_setup()
1204 op->kt_lastmsg = 0; in bcm_rx_setup()
1205 hrtimer_cancel(&op->thrtimer); in bcm_rx_setup()
1206 bcm_rx_thr_flush(op); in bcm_rx_setup()
1209 if ((op->flags & STARTTIMER) && op->kt_ival1) in bcm_rx_setup()
1210 hrtimer_start(&op->timer, op->kt_ival1, in bcm_rx_setup()
1222 op->can_id, in bcm_rx_setup()
1223 REGMASK(op->can_id), in bcm_rx_setup()
1224 bcm_rx_handler, op, in bcm_rx_setup()
1227 op->rx_reg_dev = dev; in bcm_rx_setup()
1232 err = can_rx_register(sock_net(sk), NULL, op->can_id, in bcm_rx_setup()
1233 REGMASK(op->can_id), in bcm_rx_setup()
1234 bcm_rx_handler, op, "bcm", sk); in bcm_rx_setup()
1237 list_del(&op->list); in bcm_rx_setup()
1238 bcm_remove_op(op); in bcm_rx_setup()
1243 return msg_head->nframes * op->cfsiz + MHSIZ; in bcm_rx_setup()
1413 struct bcm_op *op; in bcm_notify() local
1425 list_for_each_entry(op, &bo->rx_ops, list) in bcm_notify()
1426 if (op->rx_reg_dev == dev) in bcm_notify()
1427 bcm_rx_unreg(dev, op); in bcm_notify()
1508 struct bcm_op *op, *next; in bcm_release() local
1535 list_for_each_entry_safe(op, next, &bo->tx_ops, list) in bcm_release()
1536 bcm_remove_op(op); in bcm_release()
1538 list_for_each_entry_safe(op, next, &bo->rx_ops, list) { in bcm_release()
1543 if (op->ifindex) { in bcm_release()
1549 if (op->rx_reg_dev) { in bcm_release()
1552 dev = dev_get_by_index(net, op->ifindex); in bcm_release()
1554 bcm_rx_unreg(dev, op); in bcm_release()
1559 can_rx_unregister(net, NULL, op->can_id, in bcm_release()
1560 REGMASK(op->can_id), in bcm_release()
1561 bcm_rx_handler, op); in bcm_release()
1567 list_for_each_entry_safe(op, next, &bo->rx_ops, list) in bcm_release()
1568 bcm_remove_op(op); in bcm_release()