Lines Matching refs:op

194 	struct bcm_op *op;  in bcm_proc_show()  local
203 list_for_each_entry(op, &bo->rx_ops, list) { in bcm_proc_show()
208 if (!op->frames_abs) in bcm_proc_show()
211 seq_printf(m, "rx_op: %03X %-5s ", op->can_id, in bcm_proc_show()
212 bcm_proc_getifname(net, ifname, op->ifindex)); in bcm_proc_show()
214 if (op->flags & CAN_FD_FRAME) in bcm_proc_show()
215 seq_printf(m, "(%u)", op->nframes); in bcm_proc_show()
217 seq_printf(m, "[%u]", op->nframes); in bcm_proc_show()
219 seq_printf(m, "%c ", (op->flags & RX_CHECK_DLC) ? 'd' : ' '); in bcm_proc_show()
221 if (op->kt_ival1) in bcm_proc_show()
223 (long long)ktime_to_us(op->kt_ival1)); in bcm_proc_show()
225 if (op->kt_ival2) in bcm_proc_show()
227 (long long)ktime_to_us(op->kt_ival2)); in bcm_proc_show()
230 op->frames_filtered, op->frames_abs); in bcm_proc_show()
232 reduction = 100 - (op->frames_filtered * 100) / op->frames_abs; in bcm_proc_show()
238 list_for_each_entry(op, &bo->tx_ops, list) { in bcm_proc_show()
240 seq_printf(m, "tx_op: %03X %s ", op->can_id, in bcm_proc_show()
241 bcm_proc_getifname(net, ifname, op->ifindex)); in bcm_proc_show()
243 if (op->flags & CAN_FD_FRAME) in bcm_proc_show()
244 seq_printf(m, "(%u) ", op->nframes); in bcm_proc_show()
246 seq_printf(m, "[%u] ", op->nframes); in bcm_proc_show()
248 if (op->kt_ival1) in bcm_proc_show()
250 (long long)ktime_to_us(op->kt_ival1)); in bcm_proc_show()
252 if (op->kt_ival2) in bcm_proc_show()
254 (long long)ktime_to_us(op->kt_ival2)); in bcm_proc_show()
256 seq_printf(m, "# sent %ld\n", op->frames_abs); in bcm_proc_show()
267 static void bcm_can_tx(struct bcm_op *op) in bcm_can_tx() argument
271 struct canfd_frame *cf = op->frames + op->cfsiz * op->currframe; in bcm_can_tx()
274 if (!op->ifindex) in bcm_can_tx()
277 dev = dev_get_by_index(sock_net(op->sk), op->ifindex); in bcm_can_tx()
283 skb = alloc_skb(op->cfsiz + sizeof(struct can_skb_priv), gfp_any()); in bcm_can_tx()
291 skb_put_data(skb, cf, op->cfsiz); in bcm_can_tx()
295 can_skb_set_owner(skb, op->sk); in bcm_can_tx()
299 op->currframe++; in bcm_can_tx()
300 op->frames_abs++; in bcm_can_tx()
303 if (op->currframe >= op->nframes) in bcm_can_tx()
304 op->currframe = 0; in bcm_can_tx()
313 static void bcm_send_to_user(struct bcm_op *op, struct bcm_msg_head *head, in bcm_send_to_user() argument
319 struct sock *sk = op->sk; in bcm_send_to_user()
320 unsigned int datalen = head->nframes * op->cfsiz; in bcm_send_to_user()
347 skb->tstamp = op->rx_stamp; in bcm_send_to_user()
361 addr->can_ifindex = op->rx_ifindex; in bcm_send_to_user()
373 static bool bcm_tx_set_expiry(struct bcm_op *op, struct hrtimer *hrt) in bcm_tx_set_expiry() argument
377 if (op->kt_ival1 && op->count) in bcm_tx_set_expiry()
378 ival = op->kt_ival1; in bcm_tx_set_expiry()
379 else if (op->kt_ival2) in bcm_tx_set_expiry()
380 ival = op->kt_ival2; in bcm_tx_set_expiry()
388 static void bcm_tx_start_timer(struct bcm_op *op) in bcm_tx_start_timer() argument
390 if (bcm_tx_set_expiry(op, &op->timer)) in bcm_tx_start_timer()
391 hrtimer_start_expires(&op->timer, HRTIMER_MODE_ABS_SOFT); in bcm_tx_start_timer()
397 struct bcm_op *op = container_of(hrtimer, struct bcm_op, timer); in bcm_tx_timeout_handler() local
400 if (op->kt_ival1 && (op->count > 0)) { in bcm_tx_timeout_handler()
401 op->count--; in bcm_tx_timeout_handler()
402 if (!op->count && (op->flags & TX_COUNTEVT)) { in bcm_tx_timeout_handler()
406 msg_head.flags = op->flags; in bcm_tx_timeout_handler()
407 msg_head.count = op->count; in bcm_tx_timeout_handler()
408 msg_head.ival1 = op->ival1; in bcm_tx_timeout_handler()
409 msg_head.ival2 = op->ival2; in bcm_tx_timeout_handler()
410 msg_head.can_id = op->can_id; in bcm_tx_timeout_handler()
413 bcm_send_to_user(op, &msg_head, NULL, 0); in bcm_tx_timeout_handler()
415 bcm_can_tx(op); in bcm_tx_timeout_handler()
417 } else if (op->kt_ival2) { in bcm_tx_timeout_handler()
418 bcm_can_tx(op); in bcm_tx_timeout_handler()
421 return bcm_tx_set_expiry(op, &op->timer) ? in bcm_tx_timeout_handler()
428 static void bcm_rx_changed(struct bcm_op *op, struct canfd_frame *data) in bcm_rx_changed() argument
433 op->frames_filtered++; in bcm_rx_changed()
436 if (op->frames_filtered > ULONG_MAX/100) in bcm_rx_changed()
437 op->frames_filtered = op->frames_abs = 0; in bcm_rx_changed()
443 head.flags = op->flags; in bcm_rx_changed()
444 head.count = op->count; in bcm_rx_changed()
445 head.ival1 = op->ival1; in bcm_rx_changed()
446 head.ival2 = op->ival2; in bcm_rx_changed()
447 head.can_id = op->can_id; in bcm_rx_changed()
450 bcm_send_to_user(op, &head, data, 1); in bcm_rx_changed()
458 static void bcm_rx_update_and_send(struct bcm_op *op, in bcm_rx_update_and_send() argument
462 memcpy(lastdata, rxdata, op->cfsiz); in bcm_rx_update_and_send()
468 if (!op->kt_ival2) { in bcm_rx_update_and_send()
470 bcm_rx_changed(op, lastdata); in bcm_rx_update_and_send()
475 if (hrtimer_active(&op->thrtimer)) in bcm_rx_update_and_send()
479 if (!op->kt_lastmsg) in bcm_rx_update_and_send()
483 if (ktime_us_delta(ktime_get(), op->kt_lastmsg) < in bcm_rx_update_and_send()
484 ktime_to_us(op->kt_ival2)) { in bcm_rx_update_and_send()
486 hrtimer_start(&op->thrtimer, in bcm_rx_update_and_send()
487 ktime_add(op->kt_lastmsg, op->kt_ival2), in bcm_rx_update_and_send()
494 bcm_rx_changed(op, lastdata); in bcm_rx_update_and_send()
495 op->kt_lastmsg = ktime_get(); in bcm_rx_update_and_send()
502 static void bcm_rx_cmp_to_index(struct bcm_op *op, unsigned int index, in bcm_rx_cmp_to_index() argument
505 struct canfd_frame *cf = op->frames + op->cfsiz * index; in bcm_rx_cmp_to_index()
506 struct canfd_frame *lcf = op->last_frames + op->cfsiz * index; in bcm_rx_cmp_to_index()
516 bcm_rx_update_and_send(op, lcf, rxdata); in bcm_rx_cmp_to_index()
524 bcm_rx_update_and_send(op, lcf, rxdata); in bcm_rx_cmp_to_index()
529 if (op->flags & RX_CHECK_DLC) { in bcm_rx_cmp_to_index()
532 bcm_rx_update_and_send(op, lcf, rxdata); in bcm_rx_cmp_to_index()
541 static void bcm_rx_starttimer(struct bcm_op *op) in bcm_rx_starttimer() argument
543 if (op->flags & RX_NO_AUTOTIMER) in bcm_rx_starttimer()
546 if (op->kt_ival1) in bcm_rx_starttimer()
547 hrtimer_start(&op->timer, op->kt_ival1, HRTIMER_MODE_REL_SOFT); in bcm_rx_starttimer()
553 struct bcm_op *op = container_of(hrtimer, struct bcm_op, timer); in bcm_rx_timeout_handler() local
557 if ((op->flags & RX_ANNOUNCE_RESUME) && op->last_frames) { in bcm_rx_timeout_handler()
559 memset(op->last_frames, 0, op->nframes * op->cfsiz); in bcm_rx_timeout_handler()
564 msg_head.flags = op->flags; in bcm_rx_timeout_handler()
565 msg_head.count = op->count; in bcm_rx_timeout_handler()
566 msg_head.ival1 = op->ival1; in bcm_rx_timeout_handler()
567 msg_head.ival2 = op->ival2; in bcm_rx_timeout_handler()
568 msg_head.can_id = op->can_id; in bcm_rx_timeout_handler()
571 bcm_send_to_user(op, &msg_head, NULL, 0); in bcm_rx_timeout_handler()
579 static inline int bcm_rx_do_flush(struct bcm_op *op, unsigned int index) in bcm_rx_do_flush() argument
581 struct canfd_frame *lcf = op->last_frames + op->cfsiz * index; in bcm_rx_do_flush()
583 if ((op->last_frames) && (lcf->flags & RX_THR)) { in bcm_rx_do_flush()
584 bcm_rx_changed(op, lcf); in bcm_rx_do_flush()
593 static int bcm_rx_thr_flush(struct bcm_op *op) in bcm_rx_thr_flush() argument
597 if (op->nframes > 1) { in bcm_rx_thr_flush()
601 for (i = 1; i < op->nframes; i++) in bcm_rx_thr_flush()
602 updated += bcm_rx_do_flush(op, i); in bcm_rx_thr_flush()
606 updated += bcm_rx_do_flush(op, 0); in bcm_rx_thr_flush()
618 struct bcm_op *op = container_of(hrtimer, struct bcm_op, thrtimer); in bcm_rx_thr_handler() local
620 if (bcm_rx_thr_flush(op)) { in bcm_rx_thr_handler()
621 hrtimer_forward(hrtimer, ktime_get(), op->kt_ival2); in bcm_rx_thr_handler()
625 op->kt_lastmsg = 0; in bcm_rx_thr_handler()
635 struct bcm_op *op = (struct bcm_op *)data; in bcm_rx_handler() local
639 if (op->can_id != rxframe->can_id) in bcm_rx_handler()
643 if (skb->len != op->cfsiz) in bcm_rx_handler()
647 hrtimer_cancel(&op->timer); in bcm_rx_handler()
650 op->rx_stamp = skb->tstamp; in bcm_rx_handler()
652 op->rx_ifindex = skb->dev->ifindex; in bcm_rx_handler()
654 op->frames_abs++; in bcm_rx_handler()
656 if (op->flags & RX_RTR_FRAME) { in bcm_rx_handler()
658 bcm_can_tx(op); in bcm_rx_handler()
662 if (op->flags & RX_FILTER_ID) { in bcm_rx_handler()
664 bcm_rx_update_and_send(op, op->last_frames, rxframe); in bcm_rx_handler()
668 if (op->nframes == 1) { in bcm_rx_handler()
670 bcm_rx_cmp_to_index(op, 0, rxframe); in bcm_rx_handler()
674 if (op->nframes > 1) { in bcm_rx_handler()
683 for (i = 1; i < op->nframes; i++) { in bcm_rx_handler()
684 if ((get_u64(op->frames, 0) & get_u64(rxframe, 0)) == in bcm_rx_handler()
685 (get_u64(op->frames, 0) & in bcm_rx_handler()
686 get_u64(op->frames + op->cfsiz * i, 0))) { in bcm_rx_handler()
687 bcm_rx_cmp_to_index(op, i, rxframe); in bcm_rx_handler()
694 bcm_rx_starttimer(op); in bcm_rx_handler()
703 struct bcm_op *op; in bcm_find_op() local
705 list_for_each_entry(op, ops, list) { in bcm_find_op()
706 if ((op->can_id == mh->can_id) && (op->ifindex == ifindex) && in bcm_find_op()
707 (op->flags & CAN_FD_FRAME) == (mh->flags & CAN_FD_FRAME)) in bcm_find_op()
708 return op; in bcm_find_op()
714 static void bcm_remove_op(struct bcm_op *op) in bcm_remove_op() argument
716 hrtimer_cancel(&op->timer); in bcm_remove_op()
717 hrtimer_cancel(&op->thrtimer); in bcm_remove_op()
719 if ((op->frames) && (op->frames != &op->sframe)) in bcm_remove_op()
720 kfree(op->frames); in bcm_remove_op()
722 if ((op->last_frames) && (op->last_frames != &op->last_sframe)) in bcm_remove_op()
723 kfree(op->last_frames); in bcm_remove_op()
725 kfree(op); in bcm_remove_op()
728 static void bcm_rx_unreg(struct net_device *dev, struct bcm_op *op) in bcm_rx_unreg() argument
730 if (op->rx_reg_dev == dev) { in bcm_rx_unreg()
731 can_rx_unregister(dev_net(dev), dev, op->can_id, in bcm_rx_unreg()
732 REGMASK(op->can_id), bcm_rx_handler, op); in bcm_rx_unreg()
735 op->rx_reg_dev = NULL; in bcm_rx_unreg()
738 "mismatch %p %p\n", op->rx_reg_dev, dev); in bcm_rx_unreg()
747 struct bcm_op *op, *n; in bcm_delete_rx_op() local
749 list_for_each_entry_safe(op, n, ops, list) { in bcm_delete_rx_op()
750 if ((op->can_id == mh->can_id) && (op->ifindex == ifindex) && in bcm_delete_rx_op()
751 (op->flags & CAN_FD_FRAME) == (mh->flags & CAN_FD_FRAME)) { in bcm_delete_rx_op()
758 if (op->ifindex) { in bcm_delete_rx_op()
764 if (op->rx_reg_dev) { in bcm_delete_rx_op()
767 dev = dev_get_by_index(sock_net(op->sk), in bcm_delete_rx_op()
768 op->ifindex); in bcm_delete_rx_op()
770 bcm_rx_unreg(dev, op); in bcm_delete_rx_op()
775 can_rx_unregister(sock_net(op->sk), NULL, in bcm_delete_rx_op()
776 op->can_id, in bcm_delete_rx_op()
777 REGMASK(op->can_id), in bcm_delete_rx_op()
778 bcm_rx_handler, op); in bcm_delete_rx_op()
780 list_del(&op->list); in bcm_delete_rx_op()
781 bcm_remove_op(op); in bcm_delete_rx_op()
795 struct bcm_op *op, *n; in bcm_delete_tx_op() local
797 list_for_each_entry_safe(op, n, ops, list) { in bcm_delete_tx_op()
798 if ((op->can_id == mh->can_id) && (op->ifindex == ifindex) && in bcm_delete_tx_op()
799 (op->flags & CAN_FD_FRAME) == (mh->flags & CAN_FD_FRAME)) { in bcm_delete_tx_op()
800 list_del(&op->list); in bcm_delete_tx_op()
801 bcm_remove_op(op); in bcm_delete_tx_op()
815 struct bcm_op *op = bcm_find_op(ops, msg_head, ifindex); in bcm_read_op() local
817 if (!op) in bcm_read_op()
821 msg_head->flags = op->flags; in bcm_read_op()
822 msg_head->count = op->count; in bcm_read_op()
823 msg_head->ival1 = op->ival1; in bcm_read_op()
824 msg_head->ival2 = op->ival2; in bcm_read_op()
825 msg_head->nframes = op->nframes; in bcm_read_op()
827 bcm_send_to_user(op, msg_head, op->frames, 0); in bcm_read_op()
839 struct bcm_op *op; in bcm_tx_setup() local
857 op = bcm_find_op(&bo->tx_ops, msg_head, ifindex); in bcm_tx_setup()
858 if (op) { in bcm_tx_setup()
866 if (msg_head->nframes > op->nframes) in bcm_tx_setup()
872 cf = op->frames + op->cfsiz * i; in bcm_tx_setup()
873 err = memcpy_from_msg((u8 *)cf, msg, op->cfsiz); in bcm_tx_setup()
875 if (op->flags & CAN_FD_FRAME) { in bcm_tx_setup()
891 op->flags = msg_head->flags; in bcm_tx_setup()
896 op = kzalloc(OPSIZ, GFP_KERNEL); in bcm_tx_setup()
897 if (!op) in bcm_tx_setup()
900 op->can_id = msg_head->can_id; in bcm_tx_setup()
901 op->cfsiz = CFSIZ(msg_head->flags); in bcm_tx_setup()
902 op->flags = msg_head->flags; in bcm_tx_setup()
906 op->frames = kmalloc_array(msg_head->nframes, in bcm_tx_setup()
907 op->cfsiz, in bcm_tx_setup()
909 if (!op->frames) { in bcm_tx_setup()
910 kfree(op); in bcm_tx_setup()
914 op->frames = &op->sframe; in bcm_tx_setup()
918 cf = op->frames + op->cfsiz * i; in bcm_tx_setup()
919 err = memcpy_from_msg((u8 *)cf, msg, op->cfsiz); in bcm_tx_setup()
921 if (op->flags & CAN_FD_FRAME) { in bcm_tx_setup()
930 if (op->frames != &op->sframe) in bcm_tx_setup()
931 kfree(op->frames); in bcm_tx_setup()
932 kfree(op); in bcm_tx_setup()
943 op->last_frames = NULL; in bcm_tx_setup()
946 op->sk = sk; in bcm_tx_setup()
947 op->ifindex = ifindex; in bcm_tx_setup()
950 hrtimer_init(&op->timer, CLOCK_MONOTONIC, in bcm_tx_setup()
952 op->timer.function = bcm_tx_timeout_handler; in bcm_tx_setup()
955 hrtimer_init(&op->thrtimer, CLOCK_MONOTONIC, in bcm_tx_setup()
959 list_add(&op->list, &bo->tx_ops); in bcm_tx_setup()
963 if (op->nframes != msg_head->nframes) { in bcm_tx_setup()
964 op->nframes = msg_head->nframes; in bcm_tx_setup()
966 op->currframe = 0; in bcm_tx_setup()
971 if (op->flags & TX_RESET_MULTI_IDX) { in bcm_tx_setup()
973 op->currframe = 0; in bcm_tx_setup()
976 if (op->flags & SETTIMER) { in bcm_tx_setup()
978 op->count = msg_head->count; in bcm_tx_setup()
979 op->ival1 = msg_head->ival1; in bcm_tx_setup()
980 op->ival2 = msg_head->ival2; in bcm_tx_setup()
981 op->kt_ival1 = bcm_timeval_to_ktime(msg_head->ival1); in bcm_tx_setup()
982 op->kt_ival2 = bcm_timeval_to_ktime(msg_head->ival2); in bcm_tx_setup()
985 if (!op->kt_ival1 && !op->kt_ival2) in bcm_tx_setup()
986 hrtimer_cancel(&op->timer); in bcm_tx_setup()
989 if (op->flags & STARTTIMER) { in bcm_tx_setup()
990 hrtimer_cancel(&op->timer); in bcm_tx_setup()
992 op->flags |= TX_ANNOUNCE; in bcm_tx_setup()
995 if (op->flags & TX_ANNOUNCE) { in bcm_tx_setup()
996 bcm_can_tx(op); in bcm_tx_setup()
997 if (op->count) in bcm_tx_setup()
998 op->count--; in bcm_tx_setup()
1001 if (op->flags & STARTTIMER) in bcm_tx_setup()
1002 bcm_tx_start_timer(op); in bcm_tx_setup()
1004 return msg_head->nframes * op->cfsiz + MHSIZ; in bcm_tx_setup()
1014 struct bcm_op *op; in bcm_rx_setup() local
1039 op = bcm_find_op(&bo->rx_ops, msg_head, ifindex); in bcm_rx_setup()
1040 if (op) { in bcm_rx_setup()
1048 if (msg_head->nframes > op->nframes) in bcm_rx_setup()
1053 err = memcpy_from_msg(op->frames, msg, in bcm_rx_setup()
1054 msg_head->nframes * op->cfsiz); in bcm_rx_setup()
1059 memset(op->last_frames, 0, msg_head->nframes * op->cfsiz); in bcm_rx_setup()
1062 op->nframes = msg_head->nframes; in bcm_rx_setup()
1063 op->flags = msg_head->flags; in bcm_rx_setup()
1070 op = kzalloc(OPSIZ, GFP_KERNEL); in bcm_rx_setup()
1071 if (!op) in bcm_rx_setup()
1074 op->can_id = msg_head->can_id; in bcm_rx_setup()
1075 op->nframes = msg_head->nframes; in bcm_rx_setup()
1076 op->cfsiz = CFSIZ(msg_head->flags); in bcm_rx_setup()
1077 op->flags = msg_head->flags; in bcm_rx_setup()
1081 op->frames = kmalloc_array(msg_head->nframes, in bcm_rx_setup()
1082 op->cfsiz, in bcm_rx_setup()
1084 if (!op->frames) { in bcm_rx_setup()
1085 kfree(op); in bcm_rx_setup()
1090 op->last_frames = kcalloc(msg_head->nframes, in bcm_rx_setup()
1091 op->cfsiz, in bcm_rx_setup()
1093 if (!op->last_frames) { in bcm_rx_setup()
1094 kfree(op->frames); in bcm_rx_setup()
1095 kfree(op); in bcm_rx_setup()
1100 op->frames = &op->sframe; in bcm_rx_setup()
1101 op->last_frames = &op->last_sframe; in bcm_rx_setup()
1105 err = memcpy_from_msg(op->frames, msg, in bcm_rx_setup()
1106 msg_head->nframes * op->cfsiz); in bcm_rx_setup()
1108 if (op->frames != &op->sframe) in bcm_rx_setup()
1109 kfree(op->frames); in bcm_rx_setup()
1110 if (op->last_frames != &op->last_sframe) in bcm_rx_setup()
1111 kfree(op->last_frames); in bcm_rx_setup()
1112 kfree(op); in bcm_rx_setup()
1118 op->sk = sk; in bcm_rx_setup()
1119 op->ifindex = ifindex; in bcm_rx_setup()
1122 op->rx_ifindex = ifindex; in bcm_rx_setup()
1125 hrtimer_init(&op->timer, CLOCK_MONOTONIC, in bcm_rx_setup()
1127 op->timer.function = bcm_rx_timeout_handler; in bcm_rx_setup()
1129 hrtimer_init(&op->thrtimer, CLOCK_MONOTONIC, in bcm_rx_setup()
1131 op->thrtimer.function = bcm_rx_thr_handler; in bcm_rx_setup()
1134 list_add(&op->list, &bo->rx_ops); in bcm_rx_setup()
1143 if (op->flags & RX_RTR_FRAME) { in bcm_rx_setup()
1144 struct canfd_frame *frame0 = op->frames; in bcm_rx_setup()
1147 hrtimer_cancel(&op->thrtimer); in bcm_rx_setup()
1148 hrtimer_cancel(&op->timer); in bcm_rx_setup()
1155 if ((op->flags & TX_CP_CAN_ID) || in bcm_rx_setup()
1156 (frame0->can_id == op->can_id)) in bcm_rx_setup()
1157 frame0->can_id = op->can_id & ~CAN_RTR_FLAG; in bcm_rx_setup()
1160 if (op->flags & SETTIMER) { in bcm_rx_setup()
1163 op->ival1 = msg_head->ival1; in bcm_rx_setup()
1164 op->ival2 = msg_head->ival2; in bcm_rx_setup()
1165 op->kt_ival1 = bcm_timeval_to_ktime(msg_head->ival1); in bcm_rx_setup()
1166 op->kt_ival2 = bcm_timeval_to_ktime(msg_head->ival2); in bcm_rx_setup()
1169 if (!op->kt_ival1) in bcm_rx_setup()
1170 hrtimer_cancel(&op->timer); in bcm_rx_setup()
1176 op->kt_lastmsg = 0; in bcm_rx_setup()
1177 hrtimer_cancel(&op->thrtimer); in bcm_rx_setup()
1178 bcm_rx_thr_flush(op); in bcm_rx_setup()
1181 if ((op->flags & STARTTIMER) && op->kt_ival1) in bcm_rx_setup()
1182 hrtimer_start(&op->timer, op->kt_ival1, in bcm_rx_setup()
1194 op->can_id, in bcm_rx_setup()
1195 REGMASK(op->can_id), in bcm_rx_setup()
1196 bcm_rx_handler, op, in bcm_rx_setup()
1199 op->rx_reg_dev = dev; in bcm_rx_setup()
1204 err = can_rx_register(sock_net(sk), NULL, op->can_id, in bcm_rx_setup()
1205 REGMASK(op->can_id), in bcm_rx_setup()
1206 bcm_rx_handler, op, "bcm", sk); in bcm_rx_setup()
1209 list_del(&op->list); in bcm_rx_setup()
1210 bcm_remove_op(op); in bcm_rx_setup()
1215 return msg_head->nframes * op->cfsiz + MHSIZ; in bcm_rx_setup()
1387 struct bcm_op *op; in bcm_notifier() local
1402 list_for_each_entry(op, &bo->rx_ops, list) in bcm_notifier()
1403 if (op->rx_reg_dev == dev) in bcm_notifier()
1404 bcm_rx_unreg(dev, op); in bcm_notifier()
1464 struct bcm_op *op, *next; in bcm_release() local
1478 list_for_each_entry_safe(op, next, &bo->tx_ops, list) in bcm_release()
1479 bcm_remove_op(op); in bcm_release()
1481 list_for_each_entry_safe(op, next, &bo->rx_ops, list) { in bcm_release()
1486 if (op->ifindex) { in bcm_release()
1492 if (op->rx_reg_dev) { in bcm_release()
1495 dev = dev_get_by_index(net, op->ifindex); in bcm_release()
1497 bcm_rx_unreg(dev, op); in bcm_release()
1502 can_rx_unregister(net, NULL, op->can_id, in bcm_release()
1503 REGMASK(op->can_id), in bcm_release()
1504 bcm_rx_handler, op); in bcm_release()
1506 bcm_remove_op(op); in bcm_release()