Lines Matching refs:op
198 struct bcm_op *op; in bcm_proc_show() local
207 list_for_each_entry(op, &bo->rx_ops, list) { in bcm_proc_show()
212 if (!op->frames_abs) in bcm_proc_show()
215 seq_printf(m, "rx_op: %03X %-5s ", op->can_id, in bcm_proc_show()
216 bcm_proc_getifname(net, ifname, op->ifindex)); in bcm_proc_show()
218 if (op->flags & CAN_FD_FRAME) in bcm_proc_show()
219 seq_printf(m, "(%u)", op->nframes); in bcm_proc_show()
221 seq_printf(m, "[%u]", op->nframes); in bcm_proc_show()
223 seq_printf(m, "%c ", (op->flags & RX_CHECK_DLC) ? 'd' : ' '); in bcm_proc_show()
225 if (op->kt_ival1) in bcm_proc_show()
227 (long long)ktime_to_us(op->kt_ival1)); in bcm_proc_show()
229 if (op->kt_ival2) in bcm_proc_show()
231 (long long)ktime_to_us(op->kt_ival2)); in bcm_proc_show()
234 op->frames_filtered, op->frames_abs); in bcm_proc_show()
236 reduction = 100 - (op->frames_filtered * 100) / op->frames_abs; in bcm_proc_show()
242 list_for_each_entry(op, &bo->tx_ops, list) { in bcm_proc_show()
244 seq_printf(m, "tx_op: %03X %s ", op->can_id, in bcm_proc_show()
245 bcm_proc_getifname(net, ifname, op->ifindex)); in bcm_proc_show()
247 if (op->flags & CAN_FD_FRAME) in bcm_proc_show()
248 seq_printf(m, "(%u) ", op->nframes); in bcm_proc_show()
250 seq_printf(m, "[%u] ", op->nframes); in bcm_proc_show()
252 if (op->kt_ival1) in bcm_proc_show()
254 (long long)ktime_to_us(op->kt_ival1)); in bcm_proc_show()
256 if (op->kt_ival2) in bcm_proc_show()
258 (long long)ktime_to_us(op->kt_ival2)); in bcm_proc_show()
260 seq_printf(m, "# sent %ld\n", op->frames_abs); in bcm_proc_show()
271 static void bcm_can_tx(struct bcm_op *op) in bcm_can_tx() argument
275 struct canfd_frame *cf = op->frames + op->cfsiz * op->currframe; in bcm_can_tx()
278 if (!op->ifindex) in bcm_can_tx()
281 dev = dev_get_by_index(sock_net(op->sk), op->ifindex); in bcm_can_tx()
287 skb = alloc_skb(op->cfsiz + sizeof(struct can_skb_priv), gfp_any()); in bcm_can_tx()
295 skb_put_data(skb, cf, op->cfsiz); in bcm_can_tx()
299 can_skb_set_owner(skb, op->sk); in bcm_can_tx()
303 op->currframe++; in bcm_can_tx()
304 op->frames_abs++; in bcm_can_tx()
307 if (op->currframe >= op->nframes) in bcm_can_tx()
308 op->currframe = 0; in bcm_can_tx()
317 static void bcm_send_to_user(struct bcm_op *op, struct bcm_msg_head *head, in bcm_send_to_user() argument
323 struct sock *sk = op->sk; in bcm_send_to_user()
324 unsigned int datalen = head->nframes * op->cfsiz; in bcm_send_to_user()
351 skb->tstamp = op->rx_stamp; in bcm_send_to_user()
365 addr->can_ifindex = op->rx_ifindex; in bcm_send_to_user()
377 static bool bcm_tx_set_expiry(struct bcm_op *op, struct hrtimer *hrt) in bcm_tx_set_expiry() argument
381 if (op->kt_ival1 && op->count) in bcm_tx_set_expiry()
382 ival = op->kt_ival1; in bcm_tx_set_expiry()
383 else if (op->kt_ival2) in bcm_tx_set_expiry()
384 ival = op->kt_ival2; in bcm_tx_set_expiry()
392 static void bcm_tx_start_timer(struct bcm_op *op) in bcm_tx_start_timer() argument
394 if (bcm_tx_set_expiry(op, &op->timer)) in bcm_tx_start_timer()
395 hrtimer_start_expires(&op->timer, HRTIMER_MODE_ABS_SOFT); in bcm_tx_start_timer()
401 struct bcm_op *op = container_of(hrtimer, struct bcm_op, timer); in bcm_tx_timeout_handler() local
404 if (op->kt_ival1 && (op->count > 0)) { in bcm_tx_timeout_handler()
405 op->count--; in bcm_tx_timeout_handler()
406 if (!op->count && (op->flags & TX_COUNTEVT)) { in bcm_tx_timeout_handler()
411 msg_head.flags = op->flags; in bcm_tx_timeout_handler()
412 msg_head.count = op->count; in bcm_tx_timeout_handler()
413 msg_head.ival1 = op->ival1; in bcm_tx_timeout_handler()
414 msg_head.ival2 = op->ival2; in bcm_tx_timeout_handler()
415 msg_head.can_id = op->can_id; in bcm_tx_timeout_handler()
418 bcm_send_to_user(op, &msg_head, NULL, 0); in bcm_tx_timeout_handler()
420 bcm_can_tx(op); in bcm_tx_timeout_handler()
422 } else if (op->kt_ival2) { in bcm_tx_timeout_handler()
423 bcm_can_tx(op); in bcm_tx_timeout_handler()
426 return bcm_tx_set_expiry(op, &op->timer) ? in bcm_tx_timeout_handler()
433 static void bcm_rx_changed(struct bcm_op *op, struct canfd_frame *data) in bcm_rx_changed() argument
438 op->frames_filtered++; in bcm_rx_changed()
441 if (op->frames_filtered > ULONG_MAX/100) in bcm_rx_changed()
442 op->frames_filtered = op->frames_abs = 0; in bcm_rx_changed()
449 head.flags = op->flags; in bcm_rx_changed()
450 head.count = op->count; in bcm_rx_changed()
451 head.ival1 = op->ival1; in bcm_rx_changed()
452 head.ival2 = op->ival2; in bcm_rx_changed()
453 head.can_id = op->can_id; in bcm_rx_changed()
456 bcm_send_to_user(op, &head, data, 1); in bcm_rx_changed()
464 static void bcm_rx_update_and_send(struct bcm_op *op, in bcm_rx_update_and_send() argument
468 memcpy(lastdata, rxdata, op->cfsiz); in bcm_rx_update_and_send()
474 if (!op->kt_ival2) { in bcm_rx_update_and_send()
476 bcm_rx_changed(op, lastdata); in bcm_rx_update_and_send()
481 if (hrtimer_active(&op->thrtimer)) in bcm_rx_update_and_send()
485 if (!op->kt_lastmsg) in bcm_rx_update_and_send()
489 if (ktime_us_delta(ktime_get(), op->kt_lastmsg) < in bcm_rx_update_and_send()
490 ktime_to_us(op->kt_ival2)) { in bcm_rx_update_and_send()
492 hrtimer_start(&op->thrtimer, in bcm_rx_update_and_send()
493 ktime_add(op->kt_lastmsg, op->kt_ival2), in bcm_rx_update_and_send()
500 bcm_rx_changed(op, lastdata); in bcm_rx_update_and_send()
501 op->kt_lastmsg = ktime_get(); in bcm_rx_update_and_send()
508 static void bcm_rx_cmp_to_index(struct bcm_op *op, unsigned int index, in bcm_rx_cmp_to_index() argument
511 struct canfd_frame *cf = op->frames + op->cfsiz * index; in bcm_rx_cmp_to_index()
512 struct canfd_frame *lcf = op->last_frames + op->cfsiz * index; in bcm_rx_cmp_to_index()
522 bcm_rx_update_and_send(op, lcf, rxdata); in bcm_rx_cmp_to_index()
530 bcm_rx_update_and_send(op, lcf, rxdata); in bcm_rx_cmp_to_index()
535 if (op->flags & RX_CHECK_DLC) { in bcm_rx_cmp_to_index()
538 bcm_rx_update_and_send(op, lcf, rxdata); in bcm_rx_cmp_to_index()
547 static void bcm_rx_starttimer(struct bcm_op *op) in bcm_rx_starttimer() argument
549 if (op->flags & RX_NO_AUTOTIMER) in bcm_rx_starttimer()
552 if (op->kt_ival1) in bcm_rx_starttimer()
553 hrtimer_start(&op->timer, op->kt_ival1, HRTIMER_MODE_REL_SOFT); in bcm_rx_starttimer()
559 struct bcm_op *op = container_of(hrtimer, struct bcm_op, timer); in bcm_rx_timeout_handler() local
563 if ((op->flags & RX_ANNOUNCE_RESUME) && op->last_frames) { in bcm_rx_timeout_handler()
565 memset(op->last_frames, 0, op->nframes * op->cfsiz); in bcm_rx_timeout_handler()
571 msg_head.flags = op->flags; in bcm_rx_timeout_handler()
572 msg_head.count = op->count; in bcm_rx_timeout_handler()
573 msg_head.ival1 = op->ival1; in bcm_rx_timeout_handler()
574 msg_head.ival2 = op->ival2; in bcm_rx_timeout_handler()
575 msg_head.can_id = op->can_id; in bcm_rx_timeout_handler()
578 bcm_send_to_user(op, &msg_head, NULL, 0); in bcm_rx_timeout_handler()
586 static inline int bcm_rx_do_flush(struct bcm_op *op, unsigned int index) in bcm_rx_do_flush() argument
588 struct canfd_frame *lcf = op->last_frames + op->cfsiz * index; in bcm_rx_do_flush()
590 if ((op->last_frames) && (lcf->flags & RX_THR)) { in bcm_rx_do_flush()
591 bcm_rx_changed(op, lcf); in bcm_rx_do_flush()
600 static int bcm_rx_thr_flush(struct bcm_op *op) in bcm_rx_thr_flush() argument
604 if (op->nframes > 1) { in bcm_rx_thr_flush()
608 for (i = 1; i < op->nframes; i++) in bcm_rx_thr_flush()
609 updated += bcm_rx_do_flush(op, i); in bcm_rx_thr_flush()
613 updated += bcm_rx_do_flush(op, 0); in bcm_rx_thr_flush()
625 struct bcm_op *op = container_of(hrtimer, struct bcm_op, thrtimer); in bcm_rx_thr_handler() local
627 if (bcm_rx_thr_flush(op)) { in bcm_rx_thr_handler()
628 hrtimer_forward_now(hrtimer, op->kt_ival2); in bcm_rx_thr_handler()
632 op->kt_lastmsg = 0; in bcm_rx_thr_handler()
642 struct bcm_op *op = (struct bcm_op *)data; in bcm_rx_handler() local
646 if (op->can_id != rxframe->can_id) in bcm_rx_handler()
650 if (skb->len != op->cfsiz) in bcm_rx_handler()
654 hrtimer_cancel(&op->timer); in bcm_rx_handler()
657 op->rx_stamp = skb->tstamp; in bcm_rx_handler()
659 op->rx_ifindex = skb->dev->ifindex; in bcm_rx_handler()
661 op->frames_abs++; in bcm_rx_handler()
663 if (op->flags & RX_RTR_FRAME) { in bcm_rx_handler()
665 bcm_can_tx(op); in bcm_rx_handler()
669 if (op->flags & RX_FILTER_ID) { in bcm_rx_handler()
671 bcm_rx_update_and_send(op, op->last_frames, rxframe); in bcm_rx_handler()
675 if (op->nframes == 1) { in bcm_rx_handler()
677 bcm_rx_cmp_to_index(op, 0, rxframe); in bcm_rx_handler()
681 if (op->nframes > 1) { in bcm_rx_handler()
690 for (i = 1; i < op->nframes; i++) { in bcm_rx_handler()
691 if ((get_u64(op->frames, 0) & get_u64(rxframe, 0)) == in bcm_rx_handler()
692 (get_u64(op->frames, 0) & in bcm_rx_handler()
693 get_u64(op->frames + op->cfsiz * i, 0))) { in bcm_rx_handler()
694 bcm_rx_cmp_to_index(op, i, rxframe); in bcm_rx_handler()
701 bcm_rx_starttimer(op); in bcm_rx_handler()
710 struct bcm_op *op; in bcm_find_op() local
712 list_for_each_entry(op, ops, list) { in bcm_find_op()
713 if ((op->can_id == mh->can_id) && (op->ifindex == ifindex) && in bcm_find_op()
714 (op->flags & CAN_FD_FRAME) == (mh->flags & CAN_FD_FRAME)) in bcm_find_op()
715 return op; in bcm_find_op()
721 static void bcm_remove_op(struct bcm_op *op) in bcm_remove_op() argument
723 hrtimer_cancel(&op->timer); in bcm_remove_op()
724 hrtimer_cancel(&op->thrtimer); in bcm_remove_op()
726 if ((op->frames) && (op->frames != &op->sframe)) in bcm_remove_op()
727 kfree(op->frames); in bcm_remove_op()
729 if ((op->last_frames) && (op->last_frames != &op->last_sframe)) in bcm_remove_op()
730 kfree(op->last_frames); in bcm_remove_op()
732 kfree(op); in bcm_remove_op()
735 static void bcm_rx_unreg(struct net_device *dev, struct bcm_op *op) in bcm_rx_unreg() argument
737 if (op->rx_reg_dev == dev) { in bcm_rx_unreg()
738 can_rx_unregister(dev_net(dev), dev, op->can_id, in bcm_rx_unreg()
739 REGMASK(op->can_id), bcm_rx_handler, op); in bcm_rx_unreg()
742 op->rx_reg_dev = NULL; in bcm_rx_unreg()
745 "mismatch %p %p\n", op->rx_reg_dev, dev); in bcm_rx_unreg()
754 struct bcm_op *op, *n; in bcm_delete_rx_op() local
756 list_for_each_entry_safe(op, n, ops, list) { in bcm_delete_rx_op()
757 if ((op->can_id == mh->can_id) && (op->ifindex == ifindex) && in bcm_delete_rx_op()
758 (op->flags & CAN_FD_FRAME) == (mh->flags & CAN_FD_FRAME)) { in bcm_delete_rx_op()
765 if (op->ifindex) { in bcm_delete_rx_op()
771 if (op->rx_reg_dev) { in bcm_delete_rx_op()
774 dev = dev_get_by_index(sock_net(op->sk), in bcm_delete_rx_op()
775 op->ifindex); in bcm_delete_rx_op()
777 bcm_rx_unreg(dev, op); in bcm_delete_rx_op()
782 can_rx_unregister(sock_net(op->sk), NULL, in bcm_delete_rx_op()
783 op->can_id, in bcm_delete_rx_op()
784 REGMASK(op->can_id), in bcm_delete_rx_op()
785 bcm_rx_handler, op); in bcm_delete_rx_op()
787 list_del(&op->list); in bcm_delete_rx_op()
789 bcm_remove_op(op); in bcm_delete_rx_op()
803 struct bcm_op *op, *n; in bcm_delete_tx_op() local
805 list_for_each_entry_safe(op, n, ops, list) { in bcm_delete_tx_op()
806 if ((op->can_id == mh->can_id) && (op->ifindex == ifindex) && in bcm_delete_tx_op()
807 (op->flags & CAN_FD_FRAME) == (mh->flags & CAN_FD_FRAME)) { in bcm_delete_tx_op()
808 list_del(&op->list); in bcm_delete_tx_op()
809 bcm_remove_op(op); in bcm_delete_tx_op()
823 struct bcm_op *op = bcm_find_op(ops, msg_head, ifindex); in bcm_read_op() local
825 if (!op) in bcm_read_op()
829 msg_head->flags = op->flags; in bcm_read_op()
830 msg_head->count = op->count; in bcm_read_op()
831 msg_head->ival1 = op->ival1; in bcm_read_op()
832 msg_head->ival2 = op->ival2; in bcm_read_op()
833 msg_head->nframes = op->nframes; in bcm_read_op()
835 bcm_send_to_user(op, msg_head, op->frames, 0); in bcm_read_op()
847 struct bcm_op *op; in bcm_tx_setup() local
865 op = bcm_find_op(&bo->tx_ops, msg_head, ifindex); in bcm_tx_setup()
866 if (op) { in bcm_tx_setup()
874 if (msg_head->nframes > op->nframes) in bcm_tx_setup()
880 cf = op->frames + op->cfsiz * i; in bcm_tx_setup()
881 err = memcpy_from_msg((u8 *)cf, msg, op->cfsiz); in bcm_tx_setup()
883 if (op->flags & CAN_FD_FRAME) { in bcm_tx_setup()
899 op->flags = msg_head->flags; in bcm_tx_setup()
904 op = kzalloc(OPSIZ, GFP_KERNEL); in bcm_tx_setup()
905 if (!op) in bcm_tx_setup()
908 op->can_id = msg_head->can_id; in bcm_tx_setup()
909 op->cfsiz = CFSIZ(msg_head->flags); in bcm_tx_setup()
910 op->flags = msg_head->flags; in bcm_tx_setup()
914 op->frames = kmalloc_array(msg_head->nframes, in bcm_tx_setup()
915 op->cfsiz, in bcm_tx_setup()
917 if (!op->frames) { in bcm_tx_setup()
918 kfree(op); in bcm_tx_setup()
922 op->frames = &op->sframe; in bcm_tx_setup()
926 cf = op->frames + op->cfsiz * i; in bcm_tx_setup()
927 err = memcpy_from_msg((u8 *)cf, msg, op->cfsiz); in bcm_tx_setup()
929 if (op->flags & CAN_FD_FRAME) { in bcm_tx_setup()
938 if (op->frames != &op->sframe) in bcm_tx_setup()
939 kfree(op->frames); in bcm_tx_setup()
940 kfree(op); in bcm_tx_setup()
951 op->last_frames = NULL; in bcm_tx_setup()
954 op->sk = sk; in bcm_tx_setup()
955 op->ifindex = ifindex; in bcm_tx_setup()
958 hrtimer_init(&op->timer, CLOCK_MONOTONIC, in bcm_tx_setup()
960 op->timer.function = bcm_tx_timeout_handler; in bcm_tx_setup()
963 hrtimer_init(&op->thrtimer, CLOCK_MONOTONIC, in bcm_tx_setup()
967 list_add(&op->list, &bo->tx_ops); in bcm_tx_setup()
971 if (op->nframes != msg_head->nframes) { in bcm_tx_setup()
972 op->nframes = msg_head->nframes; in bcm_tx_setup()
974 op->currframe = 0; in bcm_tx_setup()
979 if (op->flags & TX_RESET_MULTI_IDX) { in bcm_tx_setup()
981 op->currframe = 0; in bcm_tx_setup()
984 if (op->flags & SETTIMER) { in bcm_tx_setup()
986 op->count = msg_head->count; in bcm_tx_setup()
987 op->ival1 = msg_head->ival1; in bcm_tx_setup()
988 op->ival2 = msg_head->ival2; in bcm_tx_setup()
989 op->kt_ival1 = bcm_timeval_to_ktime(msg_head->ival1); in bcm_tx_setup()
990 op->kt_ival2 = bcm_timeval_to_ktime(msg_head->ival2); in bcm_tx_setup()
993 if (!op->kt_ival1 && !op->kt_ival2) in bcm_tx_setup()
994 hrtimer_cancel(&op->timer); in bcm_tx_setup()
997 if (op->flags & STARTTIMER) { in bcm_tx_setup()
998 hrtimer_cancel(&op->timer); in bcm_tx_setup()
1000 op->flags |= TX_ANNOUNCE; in bcm_tx_setup()
1003 if (op->flags & TX_ANNOUNCE) { in bcm_tx_setup()
1004 bcm_can_tx(op); in bcm_tx_setup()
1005 if (op->count) in bcm_tx_setup()
1006 op->count--; in bcm_tx_setup()
1009 if (op->flags & STARTTIMER) in bcm_tx_setup()
1010 bcm_tx_start_timer(op); in bcm_tx_setup()
1012 return msg_head->nframes * op->cfsiz + MHSIZ; in bcm_tx_setup()
1022 struct bcm_op *op; in bcm_rx_setup() local
1047 op = bcm_find_op(&bo->rx_ops, msg_head, ifindex); in bcm_rx_setup()
1048 if (op) { in bcm_rx_setup()
1056 if (msg_head->nframes > op->nframes) in bcm_rx_setup()
1061 err = memcpy_from_msg(op->frames, msg, in bcm_rx_setup()
1062 msg_head->nframes * op->cfsiz); in bcm_rx_setup()
1067 memset(op->last_frames, 0, msg_head->nframes * op->cfsiz); in bcm_rx_setup()
1070 op->nframes = msg_head->nframes; in bcm_rx_setup()
1071 op->flags = msg_head->flags; in bcm_rx_setup()
1078 op = kzalloc(OPSIZ, GFP_KERNEL); in bcm_rx_setup()
1079 if (!op) in bcm_rx_setup()
1082 op->can_id = msg_head->can_id; in bcm_rx_setup()
1083 op->nframes = msg_head->nframes; in bcm_rx_setup()
1084 op->cfsiz = CFSIZ(msg_head->flags); in bcm_rx_setup()
1085 op->flags = msg_head->flags; in bcm_rx_setup()
1089 op->frames = kmalloc_array(msg_head->nframes, in bcm_rx_setup()
1090 op->cfsiz, in bcm_rx_setup()
1092 if (!op->frames) { in bcm_rx_setup()
1093 kfree(op); in bcm_rx_setup()
1098 op->last_frames = kcalloc(msg_head->nframes, in bcm_rx_setup()
1099 op->cfsiz, in bcm_rx_setup()
1101 if (!op->last_frames) { in bcm_rx_setup()
1102 kfree(op->frames); in bcm_rx_setup()
1103 kfree(op); in bcm_rx_setup()
1108 op->frames = &op->sframe; in bcm_rx_setup()
1109 op->last_frames = &op->last_sframe; in bcm_rx_setup()
1113 err = memcpy_from_msg(op->frames, msg, in bcm_rx_setup()
1114 msg_head->nframes * op->cfsiz); in bcm_rx_setup()
1116 if (op->frames != &op->sframe) in bcm_rx_setup()
1117 kfree(op->frames); in bcm_rx_setup()
1118 if (op->last_frames != &op->last_sframe) in bcm_rx_setup()
1119 kfree(op->last_frames); in bcm_rx_setup()
1120 kfree(op); in bcm_rx_setup()
1126 op->sk = sk; in bcm_rx_setup()
1127 op->ifindex = ifindex; in bcm_rx_setup()
1130 op->rx_ifindex = ifindex; in bcm_rx_setup()
1133 hrtimer_init(&op->timer, CLOCK_MONOTONIC, in bcm_rx_setup()
1135 op->timer.function = bcm_rx_timeout_handler; in bcm_rx_setup()
1137 hrtimer_init(&op->thrtimer, CLOCK_MONOTONIC, in bcm_rx_setup()
1139 op->thrtimer.function = bcm_rx_thr_handler; in bcm_rx_setup()
1142 list_add(&op->list, &bo->rx_ops); in bcm_rx_setup()
1151 if (op->flags & RX_RTR_FRAME) { in bcm_rx_setup()
1152 struct canfd_frame *frame0 = op->frames; in bcm_rx_setup()
1155 hrtimer_cancel(&op->thrtimer); in bcm_rx_setup()
1156 hrtimer_cancel(&op->timer); in bcm_rx_setup()
1163 if ((op->flags & TX_CP_CAN_ID) || in bcm_rx_setup()
1164 (frame0->can_id == op->can_id)) in bcm_rx_setup()
1165 frame0->can_id = op->can_id & ~CAN_RTR_FLAG; in bcm_rx_setup()
1168 if (op->flags & SETTIMER) { in bcm_rx_setup()
1171 op->ival1 = msg_head->ival1; in bcm_rx_setup()
1172 op->ival2 = msg_head->ival2; in bcm_rx_setup()
1173 op->kt_ival1 = bcm_timeval_to_ktime(msg_head->ival1); in bcm_rx_setup()
1174 op->kt_ival2 = bcm_timeval_to_ktime(msg_head->ival2); in bcm_rx_setup()
1177 if (!op->kt_ival1) in bcm_rx_setup()
1178 hrtimer_cancel(&op->timer); in bcm_rx_setup()
1184 op->kt_lastmsg = 0; in bcm_rx_setup()
1185 hrtimer_cancel(&op->thrtimer); in bcm_rx_setup()
1186 bcm_rx_thr_flush(op); in bcm_rx_setup()
1189 if ((op->flags & STARTTIMER) && op->kt_ival1) in bcm_rx_setup()
1190 hrtimer_start(&op->timer, op->kt_ival1, in bcm_rx_setup()
1202 op->can_id, in bcm_rx_setup()
1203 REGMASK(op->can_id), in bcm_rx_setup()
1204 bcm_rx_handler, op, in bcm_rx_setup()
1207 op->rx_reg_dev = dev; in bcm_rx_setup()
1212 err = can_rx_register(sock_net(sk), NULL, op->can_id, in bcm_rx_setup()
1213 REGMASK(op->can_id), in bcm_rx_setup()
1214 bcm_rx_handler, op, "bcm", sk); in bcm_rx_setup()
1217 list_del(&op->list); in bcm_rx_setup()
1218 bcm_remove_op(op); in bcm_rx_setup()
1223 return msg_head->nframes * op->cfsiz + MHSIZ; in bcm_rx_setup()
1393 struct bcm_op *op; in bcm_notify() local
1405 list_for_each_entry(op, &bo->rx_ops, list) in bcm_notify()
1406 if (op->rx_reg_dev == dev) in bcm_notify()
1407 bcm_rx_unreg(dev, op); in bcm_notify()
1488 struct bcm_op *op, *next; in bcm_release() local
1509 list_for_each_entry_safe(op, next, &bo->tx_ops, list) in bcm_release()
1510 bcm_remove_op(op); in bcm_release()
1512 list_for_each_entry_safe(op, next, &bo->rx_ops, list) { in bcm_release()
1517 if (op->ifindex) { in bcm_release()
1523 if (op->rx_reg_dev) { in bcm_release()
1526 dev = dev_get_by_index(net, op->ifindex); in bcm_release()
1528 bcm_rx_unreg(dev, op); in bcm_release()
1533 can_rx_unregister(net, NULL, op->can_id, in bcm_release()
1534 REGMASK(op->can_id), in bcm_release()
1535 bcm_rx_handler, op); in bcm_release()
1541 list_for_each_entry_safe(op, next, &bo->rx_ops, list) in bcm_release()
1542 bcm_remove_op(op); in bcm_release()