Lines Matching refs:op

192 	struct bcm_op *op;  in bcm_proc_show()  local
201 list_for_each_entry(op, &bo->rx_ops, list) { in bcm_proc_show()
206 if (!op->frames_abs) in bcm_proc_show()
209 seq_printf(m, "rx_op: %03X %-5s ", op->can_id, in bcm_proc_show()
210 bcm_proc_getifname(net, ifname, op->ifindex)); in bcm_proc_show()
212 if (op->flags & CAN_FD_FRAME) in bcm_proc_show()
213 seq_printf(m, "(%u)", op->nframes); in bcm_proc_show()
215 seq_printf(m, "[%u]", op->nframes); in bcm_proc_show()
217 seq_printf(m, "%c ", (op->flags & RX_CHECK_DLC) ? 'd' : ' '); in bcm_proc_show()
219 if (op->kt_ival1) in bcm_proc_show()
221 (long long)ktime_to_us(op->kt_ival1)); in bcm_proc_show()
223 if (op->kt_ival2) in bcm_proc_show()
225 (long long)ktime_to_us(op->kt_ival2)); in bcm_proc_show()
228 op->frames_filtered, op->frames_abs); in bcm_proc_show()
230 reduction = 100 - (op->frames_filtered * 100) / op->frames_abs; in bcm_proc_show()
236 list_for_each_entry(op, &bo->tx_ops, list) { in bcm_proc_show()
238 seq_printf(m, "tx_op: %03X %s ", op->can_id, in bcm_proc_show()
239 bcm_proc_getifname(net, ifname, op->ifindex)); in bcm_proc_show()
241 if (op->flags & CAN_FD_FRAME) in bcm_proc_show()
242 seq_printf(m, "(%u) ", op->nframes); in bcm_proc_show()
244 seq_printf(m, "[%u] ", op->nframes); in bcm_proc_show()
246 if (op->kt_ival1) in bcm_proc_show()
248 (long long)ktime_to_us(op->kt_ival1)); in bcm_proc_show()
250 if (op->kt_ival2) in bcm_proc_show()
252 (long long)ktime_to_us(op->kt_ival2)); in bcm_proc_show()
254 seq_printf(m, "# sent %ld\n", op->frames_abs); in bcm_proc_show()
265 static void bcm_can_tx(struct bcm_op *op) in bcm_can_tx() argument
269 struct canfd_frame *cf = op->frames + op->cfsiz * op->currframe; in bcm_can_tx()
272 if (!op->ifindex) in bcm_can_tx()
275 dev = dev_get_by_index(sock_net(op->sk), op->ifindex); in bcm_can_tx()
281 skb = alloc_skb(op->cfsiz + sizeof(struct can_skb_priv), gfp_any()); in bcm_can_tx()
289 skb_put_data(skb, cf, op->cfsiz); in bcm_can_tx()
293 can_skb_set_owner(skb, op->sk); in bcm_can_tx()
297 op->currframe++; in bcm_can_tx()
298 op->frames_abs++; in bcm_can_tx()
301 if (op->currframe >= op->nframes) in bcm_can_tx()
302 op->currframe = 0; in bcm_can_tx()
311 static void bcm_send_to_user(struct bcm_op *op, struct bcm_msg_head *head, in bcm_send_to_user() argument
317 struct sock *sk = op->sk; in bcm_send_to_user()
318 unsigned int datalen = head->nframes * op->cfsiz; in bcm_send_to_user()
345 skb->tstamp = op->rx_stamp; in bcm_send_to_user()
359 addr->can_ifindex = op->rx_ifindex; in bcm_send_to_user()
371 static bool bcm_tx_set_expiry(struct bcm_op *op, struct hrtimer *hrt) in bcm_tx_set_expiry() argument
375 if (op->kt_ival1 && op->count) in bcm_tx_set_expiry()
376 ival = op->kt_ival1; in bcm_tx_set_expiry()
377 else if (op->kt_ival2) in bcm_tx_set_expiry()
378 ival = op->kt_ival2; in bcm_tx_set_expiry()
386 static void bcm_tx_start_timer(struct bcm_op *op) in bcm_tx_start_timer() argument
388 if (bcm_tx_set_expiry(op, &op->timer)) in bcm_tx_start_timer()
389 hrtimer_start_expires(&op->timer, HRTIMER_MODE_ABS_SOFT); in bcm_tx_start_timer()
395 struct bcm_op *op = container_of(hrtimer, struct bcm_op, timer); in bcm_tx_timeout_handler() local
398 if (op->kt_ival1 && (op->count > 0)) { in bcm_tx_timeout_handler()
399 op->count--; in bcm_tx_timeout_handler()
400 if (!op->count && (op->flags & TX_COUNTEVT)) { in bcm_tx_timeout_handler()
404 msg_head.flags = op->flags; in bcm_tx_timeout_handler()
405 msg_head.count = op->count; in bcm_tx_timeout_handler()
406 msg_head.ival1 = op->ival1; in bcm_tx_timeout_handler()
407 msg_head.ival2 = op->ival2; in bcm_tx_timeout_handler()
408 msg_head.can_id = op->can_id; in bcm_tx_timeout_handler()
411 bcm_send_to_user(op, &msg_head, NULL, 0); in bcm_tx_timeout_handler()
413 bcm_can_tx(op); in bcm_tx_timeout_handler()
415 } else if (op->kt_ival2) { in bcm_tx_timeout_handler()
416 bcm_can_tx(op); in bcm_tx_timeout_handler()
419 return bcm_tx_set_expiry(op, &op->timer) ? in bcm_tx_timeout_handler()
426 static void bcm_rx_changed(struct bcm_op *op, struct canfd_frame *data) in bcm_rx_changed() argument
431 op->frames_filtered++; in bcm_rx_changed()
434 if (op->frames_filtered > ULONG_MAX/100) in bcm_rx_changed()
435 op->frames_filtered = op->frames_abs = 0; in bcm_rx_changed()
441 head.flags = op->flags; in bcm_rx_changed()
442 head.count = op->count; in bcm_rx_changed()
443 head.ival1 = op->ival1; in bcm_rx_changed()
444 head.ival2 = op->ival2; in bcm_rx_changed()
445 head.can_id = op->can_id; in bcm_rx_changed()
448 bcm_send_to_user(op, &head, data, 1); in bcm_rx_changed()
456 static void bcm_rx_update_and_send(struct bcm_op *op, in bcm_rx_update_and_send() argument
460 memcpy(lastdata, rxdata, op->cfsiz); in bcm_rx_update_and_send()
466 if (!op->kt_ival2) { in bcm_rx_update_and_send()
468 bcm_rx_changed(op, lastdata); in bcm_rx_update_and_send()
473 if (hrtimer_active(&op->thrtimer)) in bcm_rx_update_and_send()
477 if (!op->kt_lastmsg) in bcm_rx_update_and_send()
481 if (ktime_us_delta(ktime_get(), op->kt_lastmsg) < in bcm_rx_update_and_send()
482 ktime_to_us(op->kt_ival2)) { in bcm_rx_update_and_send()
484 hrtimer_start(&op->thrtimer, in bcm_rx_update_and_send()
485 ktime_add(op->kt_lastmsg, op->kt_ival2), in bcm_rx_update_and_send()
492 bcm_rx_changed(op, lastdata); in bcm_rx_update_and_send()
493 op->kt_lastmsg = ktime_get(); in bcm_rx_update_and_send()
500 static void bcm_rx_cmp_to_index(struct bcm_op *op, unsigned int index, in bcm_rx_cmp_to_index() argument
503 struct canfd_frame *cf = op->frames + op->cfsiz * index; in bcm_rx_cmp_to_index()
504 struct canfd_frame *lcf = op->last_frames + op->cfsiz * index; in bcm_rx_cmp_to_index()
514 bcm_rx_update_and_send(op, lcf, rxdata); in bcm_rx_cmp_to_index()
522 bcm_rx_update_and_send(op, lcf, rxdata); in bcm_rx_cmp_to_index()
527 if (op->flags & RX_CHECK_DLC) { in bcm_rx_cmp_to_index()
530 bcm_rx_update_and_send(op, lcf, rxdata); in bcm_rx_cmp_to_index()
539 static void bcm_rx_starttimer(struct bcm_op *op) in bcm_rx_starttimer() argument
541 if (op->flags & RX_NO_AUTOTIMER) in bcm_rx_starttimer()
544 if (op->kt_ival1) in bcm_rx_starttimer()
545 hrtimer_start(&op->timer, op->kt_ival1, HRTIMER_MODE_REL_SOFT); in bcm_rx_starttimer()
551 struct bcm_op *op = container_of(hrtimer, struct bcm_op, timer); in bcm_rx_timeout_handler() local
555 if ((op->flags & RX_ANNOUNCE_RESUME) && op->last_frames) { in bcm_rx_timeout_handler()
557 memset(op->last_frames, 0, op->nframes * op->cfsiz); in bcm_rx_timeout_handler()
562 msg_head.flags = op->flags; in bcm_rx_timeout_handler()
563 msg_head.count = op->count; in bcm_rx_timeout_handler()
564 msg_head.ival1 = op->ival1; in bcm_rx_timeout_handler()
565 msg_head.ival2 = op->ival2; in bcm_rx_timeout_handler()
566 msg_head.can_id = op->can_id; in bcm_rx_timeout_handler()
569 bcm_send_to_user(op, &msg_head, NULL, 0); in bcm_rx_timeout_handler()
577 static inline int bcm_rx_do_flush(struct bcm_op *op, unsigned int index) in bcm_rx_do_flush() argument
579 struct canfd_frame *lcf = op->last_frames + op->cfsiz * index; in bcm_rx_do_flush()
581 if ((op->last_frames) && (lcf->flags & RX_THR)) { in bcm_rx_do_flush()
582 bcm_rx_changed(op, lcf); in bcm_rx_do_flush()
591 static int bcm_rx_thr_flush(struct bcm_op *op) in bcm_rx_thr_flush() argument
595 if (op->nframes > 1) { in bcm_rx_thr_flush()
599 for (i = 1; i < op->nframes; i++) in bcm_rx_thr_flush()
600 updated += bcm_rx_do_flush(op, i); in bcm_rx_thr_flush()
604 updated += bcm_rx_do_flush(op, 0); in bcm_rx_thr_flush()
616 struct bcm_op *op = container_of(hrtimer, struct bcm_op, thrtimer); in bcm_rx_thr_handler() local
618 if (bcm_rx_thr_flush(op)) { in bcm_rx_thr_handler()
619 hrtimer_forward(hrtimer, ktime_get(), op->kt_ival2); in bcm_rx_thr_handler()
623 op->kt_lastmsg = 0; in bcm_rx_thr_handler()
633 struct bcm_op *op = (struct bcm_op *)data; in bcm_rx_handler() local
637 if (op->can_id != rxframe->can_id) in bcm_rx_handler()
641 if (skb->len != op->cfsiz) in bcm_rx_handler()
645 hrtimer_cancel(&op->timer); in bcm_rx_handler()
648 op->rx_stamp = skb->tstamp; in bcm_rx_handler()
650 op->rx_ifindex = skb->dev->ifindex; in bcm_rx_handler()
652 op->frames_abs++; in bcm_rx_handler()
654 if (op->flags & RX_RTR_FRAME) { in bcm_rx_handler()
656 bcm_can_tx(op); in bcm_rx_handler()
660 if (op->flags & RX_FILTER_ID) { in bcm_rx_handler()
662 bcm_rx_update_and_send(op, op->last_frames, rxframe); in bcm_rx_handler()
666 if (op->nframes == 1) { in bcm_rx_handler()
668 bcm_rx_cmp_to_index(op, 0, rxframe); in bcm_rx_handler()
672 if (op->nframes > 1) { in bcm_rx_handler()
681 for (i = 1; i < op->nframes; i++) { in bcm_rx_handler()
682 if ((get_u64(op->frames, 0) & get_u64(rxframe, 0)) == in bcm_rx_handler()
683 (get_u64(op->frames, 0) & in bcm_rx_handler()
684 get_u64(op->frames + op->cfsiz * i, 0))) { in bcm_rx_handler()
685 bcm_rx_cmp_to_index(op, i, rxframe); in bcm_rx_handler()
692 bcm_rx_starttimer(op); in bcm_rx_handler()
701 struct bcm_op *op; in bcm_find_op() local
703 list_for_each_entry(op, ops, list) { in bcm_find_op()
704 if ((op->can_id == mh->can_id) && (op->ifindex == ifindex) && in bcm_find_op()
705 (op->flags & CAN_FD_FRAME) == (mh->flags & CAN_FD_FRAME)) in bcm_find_op()
706 return op; in bcm_find_op()
712 static void bcm_remove_op(struct bcm_op *op) in bcm_remove_op() argument
714 hrtimer_cancel(&op->timer); in bcm_remove_op()
715 hrtimer_cancel(&op->thrtimer); in bcm_remove_op()
717 if ((op->frames) && (op->frames != &op->sframe)) in bcm_remove_op()
718 kfree(op->frames); in bcm_remove_op()
720 if ((op->last_frames) && (op->last_frames != &op->last_sframe)) in bcm_remove_op()
721 kfree(op->last_frames); in bcm_remove_op()
723 kfree(op); in bcm_remove_op()
726 static void bcm_rx_unreg(struct net_device *dev, struct bcm_op *op) in bcm_rx_unreg() argument
728 if (op->rx_reg_dev == dev) { in bcm_rx_unreg()
729 can_rx_unregister(dev_net(dev), dev, op->can_id, in bcm_rx_unreg()
730 REGMASK(op->can_id), bcm_rx_handler, op); in bcm_rx_unreg()
733 op->rx_reg_dev = NULL; in bcm_rx_unreg()
736 "mismatch %p %p\n", op->rx_reg_dev, dev); in bcm_rx_unreg()
745 struct bcm_op *op, *n; in bcm_delete_rx_op() local
747 list_for_each_entry_safe(op, n, ops, list) { in bcm_delete_rx_op()
748 if ((op->can_id == mh->can_id) && (op->ifindex == ifindex) && in bcm_delete_rx_op()
749 (op->flags & CAN_FD_FRAME) == (mh->flags & CAN_FD_FRAME)) { in bcm_delete_rx_op()
756 if (op->ifindex) { in bcm_delete_rx_op()
762 if (op->rx_reg_dev) { in bcm_delete_rx_op()
765 dev = dev_get_by_index(sock_net(op->sk), in bcm_delete_rx_op()
766 op->ifindex); in bcm_delete_rx_op()
768 bcm_rx_unreg(dev, op); in bcm_delete_rx_op()
773 can_rx_unregister(sock_net(op->sk), NULL, in bcm_delete_rx_op()
774 op->can_id, in bcm_delete_rx_op()
775 REGMASK(op->can_id), in bcm_delete_rx_op()
776 bcm_rx_handler, op); in bcm_delete_rx_op()
778 list_del(&op->list); in bcm_delete_rx_op()
779 bcm_remove_op(op); in bcm_delete_rx_op()
793 struct bcm_op *op, *n; in bcm_delete_tx_op() local
795 list_for_each_entry_safe(op, n, ops, list) { in bcm_delete_tx_op()
796 if ((op->can_id == mh->can_id) && (op->ifindex == ifindex) && in bcm_delete_tx_op()
797 (op->flags & CAN_FD_FRAME) == (mh->flags & CAN_FD_FRAME)) { in bcm_delete_tx_op()
798 list_del(&op->list); in bcm_delete_tx_op()
799 bcm_remove_op(op); in bcm_delete_tx_op()
813 struct bcm_op *op = bcm_find_op(ops, msg_head, ifindex); in bcm_read_op() local
815 if (!op) in bcm_read_op()
819 msg_head->flags = op->flags; in bcm_read_op()
820 msg_head->count = op->count; in bcm_read_op()
821 msg_head->ival1 = op->ival1; in bcm_read_op()
822 msg_head->ival2 = op->ival2; in bcm_read_op()
823 msg_head->nframes = op->nframes; in bcm_read_op()
825 bcm_send_to_user(op, msg_head, op->frames, 0); in bcm_read_op()
837 struct bcm_op *op; in bcm_tx_setup() local
855 op = bcm_find_op(&bo->tx_ops, msg_head, ifindex); in bcm_tx_setup()
856 if (op) { in bcm_tx_setup()
864 if (msg_head->nframes > op->nframes) in bcm_tx_setup()
870 cf = op->frames + op->cfsiz * i; in bcm_tx_setup()
871 err = memcpy_from_msg((u8 *)cf, msg, op->cfsiz); in bcm_tx_setup()
873 if (op->flags & CAN_FD_FRAME) { in bcm_tx_setup()
889 op->flags = msg_head->flags; in bcm_tx_setup()
894 op = kzalloc(OPSIZ, GFP_KERNEL); in bcm_tx_setup()
895 if (!op) in bcm_tx_setup()
898 op->can_id = msg_head->can_id; in bcm_tx_setup()
899 op->cfsiz = CFSIZ(msg_head->flags); in bcm_tx_setup()
900 op->flags = msg_head->flags; in bcm_tx_setup()
904 op->frames = kmalloc_array(msg_head->nframes, in bcm_tx_setup()
905 op->cfsiz, in bcm_tx_setup()
907 if (!op->frames) { in bcm_tx_setup()
908 kfree(op); in bcm_tx_setup()
912 op->frames = &op->sframe; in bcm_tx_setup()
916 cf = op->frames + op->cfsiz * i; in bcm_tx_setup()
917 err = memcpy_from_msg((u8 *)cf, msg, op->cfsiz); in bcm_tx_setup()
919 if (op->flags & CAN_FD_FRAME) { in bcm_tx_setup()
928 if (op->frames != &op->sframe) in bcm_tx_setup()
929 kfree(op->frames); in bcm_tx_setup()
930 kfree(op); in bcm_tx_setup()
941 op->last_frames = NULL; in bcm_tx_setup()
944 op->sk = sk; in bcm_tx_setup()
945 op->ifindex = ifindex; in bcm_tx_setup()
948 hrtimer_init(&op->timer, CLOCK_MONOTONIC, in bcm_tx_setup()
950 op->timer.function = bcm_tx_timeout_handler; in bcm_tx_setup()
953 hrtimer_init(&op->thrtimer, CLOCK_MONOTONIC, in bcm_tx_setup()
957 list_add(&op->list, &bo->tx_ops); in bcm_tx_setup()
961 if (op->nframes != msg_head->nframes) { in bcm_tx_setup()
962 op->nframes = msg_head->nframes; in bcm_tx_setup()
964 op->currframe = 0; in bcm_tx_setup()
969 if (op->flags & TX_RESET_MULTI_IDX) { in bcm_tx_setup()
971 op->currframe = 0; in bcm_tx_setup()
974 if (op->flags & SETTIMER) { in bcm_tx_setup()
976 op->count = msg_head->count; in bcm_tx_setup()
977 op->ival1 = msg_head->ival1; in bcm_tx_setup()
978 op->ival2 = msg_head->ival2; in bcm_tx_setup()
979 op->kt_ival1 = bcm_timeval_to_ktime(msg_head->ival1); in bcm_tx_setup()
980 op->kt_ival2 = bcm_timeval_to_ktime(msg_head->ival2); in bcm_tx_setup()
983 if (!op->kt_ival1 && !op->kt_ival2) in bcm_tx_setup()
984 hrtimer_cancel(&op->timer); in bcm_tx_setup()
987 if (op->flags & STARTTIMER) { in bcm_tx_setup()
988 hrtimer_cancel(&op->timer); in bcm_tx_setup()
990 op->flags |= TX_ANNOUNCE; in bcm_tx_setup()
993 if (op->flags & TX_ANNOUNCE) { in bcm_tx_setup()
994 bcm_can_tx(op); in bcm_tx_setup()
995 if (op->count) in bcm_tx_setup()
996 op->count--; in bcm_tx_setup()
999 if (op->flags & STARTTIMER) in bcm_tx_setup()
1000 bcm_tx_start_timer(op); in bcm_tx_setup()
1002 return msg_head->nframes * op->cfsiz + MHSIZ; in bcm_tx_setup()
1012 struct bcm_op *op; in bcm_rx_setup() local
1037 op = bcm_find_op(&bo->rx_ops, msg_head, ifindex); in bcm_rx_setup()
1038 if (op) { in bcm_rx_setup()
1046 if (msg_head->nframes > op->nframes) in bcm_rx_setup()
1051 err = memcpy_from_msg(op->frames, msg, in bcm_rx_setup()
1052 msg_head->nframes * op->cfsiz); in bcm_rx_setup()
1057 memset(op->last_frames, 0, msg_head->nframes * op->cfsiz); in bcm_rx_setup()
1060 op->nframes = msg_head->nframes; in bcm_rx_setup()
1061 op->flags = msg_head->flags; in bcm_rx_setup()
1068 op = kzalloc(OPSIZ, GFP_KERNEL); in bcm_rx_setup()
1069 if (!op) in bcm_rx_setup()
1072 op->can_id = msg_head->can_id; in bcm_rx_setup()
1073 op->nframes = msg_head->nframes; in bcm_rx_setup()
1074 op->cfsiz = CFSIZ(msg_head->flags); in bcm_rx_setup()
1075 op->flags = msg_head->flags; in bcm_rx_setup()
1079 op->frames = kmalloc_array(msg_head->nframes, in bcm_rx_setup()
1080 op->cfsiz, in bcm_rx_setup()
1082 if (!op->frames) { in bcm_rx_setup()
1083 kfree(op); in bcm_rx_setup()
1088 op->last_frames = kcalloc(msg_head->nframes, in bcm_rx_setup()
1089 op->cfsiz, in bcm_rx_setup()
1091 if (!op->last_frames) { in bcm_rx_setup()
1092 kfree(op->frames); in bcm_rx_setup()
1093 kfree(op); in bcm_rx_setup()
1098 op->frames = &op->sframe; in bcm_rx_setup()
1099 op->last_frames = &op->last_sframe; in bcm_rx_setup()
1103 err = memcpy_from_msg(op->frames, msg, in bcm_rx_setup()
1104 msg_head->nframes * op->cfsiz); in bcm_rx_setup()
1106 if (op->frames != &op->sframe) in bcm_rx_setup()
1107 kfree(op->frames); in bcm_rx_setup()
1108 if (op->last_frames != &op->last_sframe) in bcm_rx_setup()
1109 kfree(op->last_frames); in bcm_rx_setup()
1110 kfree(op); in bcm_rx_setup()
1116 op->sk = sk; in bcm_rx_setup()
1117 op->ifindex = ifindex; in bcm_rx_setup()
1120 op->rx_ifindex = ifindex; in bcm_rx_setup()
1123 hrtimer_init(&op->timer, CLOCK_MONOTONIC, in bcm_rx_setup()
1125 op->timer.function = bcm_rx_timeout_handler; in bcm_rx_setup()
1127 hrtimer_init(&op->thrtimer, CLOCK_MONOTONIC, in bcm_rx_setup()
1129 op->thrtimer.function = bcm_rx_thr_handler; in bcm_rx_setup()
1132 list_add(&op->list, &bo->rx_ops); in bcm_rx_setup()
1141 if (op->flags & RX_RTR_FRAME) { in bcm_rx_setup()
1142 struct canfd_frame *frame0 = op->frames; in bcm_rx_setup()
1145 hrtimer_cancel(&op->thrtimer); in bcm_rx_setup()
1146 hrtimer_cancel(&op->timer); in bcm_rx_setup()
1153 if ((op->flags & TX_CP_CAN_ID) || in bcm_rx_setup()
1154 (frame0->can_id == op->can_id)) in bcm_rx_setup()
1155 frame0->can_id = op->can_id & ~CAN_RTR_FLAG; in bcm_rx_setup()
1158 if (op->flags & SETTIMER) { in bcm_rx_setup()
1161 op->ival1 = msg_head->ival1; in bcm_rx_setup()
1162 op->ival2 = msg_head->ival2; in bcm_rx_setup()
1163 op->kt_ival1 = bcm_timeval_to_ktime(msg_head->ival1); in bcm_rx_setup()
1164 op->kt_ival2 = bcm_timeval_to_ktime(msg_head->ival2); in bcm_rx_setup()
1167 if (!op->kt_ival1) in bcm_rx_setup()
1168 hrtimer_cancel(&op->timer); in bcm_rx_setup()
1174 op->kt_lastmsg = 0; in bcm_rx_setup()
1175 hrtimer_cancel(&op->thrtimer); in bcm_rx_setup()
1176 bcm_rx_thr_flush(op); in bcm_rx_setup()
1179 if ((op->flags & STARTTIMER) && op->kt_ival1) in bcm_rx_setup()
1180 hrtimer_start(&op->timer, op->kt_ival1, in bcm_rx_setup()
1192 op->can_id, in bcm_rx_setup()
1193 REGMASK(op->can_id), in bcm_rx_setup()
1194 bcm_rx_handler, op, in bcm_rx_setup()
1197 op->rx_reg_dev = dev; in bcm_rx_setup()
1202 err = can_rx_register(sock_net(sk), NULL, op->can_id, in bcm_rx_setup()
1203 REGMASK(op->can_id), in bcm_rx_setup()
1204 bcm_rx_handler, op, "bcm", sk); in bcm_rx_setup()
1207 list_del(&op->list); in bcm_rx_setup()
1208 bcm_remove_op(op); in bcm_rx_setup()
1213 return msg_head->nframes * op->cfsiz + MHSIZ; in bcm_rx_setup()
1385 struct bcm_op *op; in bcm_notifier() local
1400 list_for_each_entry(op, &bo->rx_ops, list) in bcm_notifier()
1401 if (op->rx_reg_dev == dev) in bcm_notifier()
1402 bcm_rx_unreg(dev, op); in bcm_notifier()
1462 struct bcm_op *op, *next; in bcm_release() local
1476 list_for_each_entry_safe(op, next, &bo->tx_ops, list) in bcm_release()
1477 bcm_remove_op(op); in bcm_release()
1479 list_for_each_entry_safe(op, next, &bo->rx_ops, list) { in bcm_release()
1484 if (op->ifindex) { in bcm_release()
1490 if (op->rx_reg_dev) { in bcm_release()
1493 dev = dev_get_by_index(net, op->ifindex); in bcm_release()
1495 bcm_rx_unreg(dev, op); in bcm_release()
1500 can_rx_unregister(net, NULL, op->can_id, in bcm_release()
1501 REGMASK(op->can_id), in bcm_release()
1502 bcm_rx_handler, op); in bcm_release()
1504 bcm_remove_op(op); in bcm_release()