Lines Matching refs:ifindex
95 int ifindex; member
120 int ifindex; member
146 static char *bcm_proc_getifname(char *result, int ifindex) in bcm_proc_getifname() argument
150 if (!ifindex) in bcm_proc_getifname()
154 dev = dev_get_by_index_rcu(&init_net, ifindex); in bcm_proc_getifname()
175 seq_printf(m, " / bound %s", bcm_proc_getifname(ifname, bo->ifindex)); in bcm_proc_show()
187 op->can_id, bcm_proc_getifname(ifname, op->ifindex)); in bcm_proc_show()
213 bcm_proc_getifname(ifname, op->ifindex), in bcm_proc_show()
254 if (!op->ifindex) in bcm_can_tx()
257 dev = dev_get_by_index(&init_net, op->ifindex); in bcm_can_tx()
268 can_skb_prv(skb)->ifindex = dev->ifindex; in bcm_can_tx()
651 op->rx_ifindex = skb->dev->ifindex; in bcm_rx_handler()
699 int ifindex) in bcm_find_op() argument
704 if ((op->can_id == can_id) && (op->ifindex == ifindex)) in bcm_find_op()
747 static int bcm_delete_rx_op(struct list_head *ops, canid_t can_id, int ifindex) in bcm_delete_rx_op() argument
752 if ((op->can_id == can_id) && (op->ifindex == ifindex)) { in bcm_delete_rx_op()
759 if (op->ifindex) { in bcm_delete_rx_op()
769 op->ifindex); in bcm_delete_rx_op()
792 static int bcm_delete_tx_op(struct list_head *ops, canid_t can_id, int ifindex) in bcm_delete_tx_op() argument
797 if ((op->can_id == can_id) && (op->ifindex == ifindex)) { in bcm_delete_tx_op()
811 int ifindex) in bcm_read_op() argument
813 struct bcm_op *op = bcm_find_op(ops, msg_head->can_id, ifindex); in bcm_read_op()
834 int ifindex, struct sock *sk) in bcm_tx_setup() argument
842 if (!ifindex) in bcm_tx_setup()
850 op = bcm_find_op(&bo->tx_ops, msg_head->can_id, ifindex); in bcm_tx_setup()
923 op->ifindex = ifindex; in bcm_tx_setup()
991 int ifindex, struct sock *sk) in bcm_rx_setup() argument
1015 op = bcm_find_op(&bo->rx_ops, msg_head->can_id, ifindex); in bcm_rx_setup()
1090 op->ifindex = ifindex; in bcm_rx_setup()
1093 op->rx_ifindex = ifindex; in bcm_rx_setup()
1165 if (ifindex) { in bcm_rx_setup()
1168 dev = dev_get_by_index(&init_net, ifindex); in bcm_rx_setup()
1197 static int bcm_tx_send(struct msghdr *msg, int ifindex, struct sock *sk) in bcm_tx_send() argument
1204 if (!ifindex) in bcm_tx_send()
1219 dev = dev_get_by_index(&init_net, ifindex); in bcm_tx_send()
1225 can_skb_prv(skb)->ifindex = dev->ifindex; in bcm_tx_send()
1245 int ifindex = bo->ifindex; /* default ifindex for this bcm_op */ in bcm_sendmsg() local
1258 if (!ifindex && msg->msg_name) { in bcm_sendmsg()
1269 ifindex = addr->can_ifindex; in bcm_sendmsg()
1271 if (ifindex) { in bcm_sendmsg()
1274 dev = dev_get_by_index(&init_net, ifindex); in bcm_sendmsg()
1298 ret = bcm_tx_setup(&msg_head, msg, ifindex, sk); in bcm_sendmsg()
1302 ret = bcm_rx_setup(&msg_head, msg, ifindex, sk); in bcm_sendmsg()
1306 if (bcm_delete_tx_op(&bo->tx_ops, msg_head.can_id, ifindex)) in bcm_sendmsg()
1313 if (bcm_delete_rx_op(&bo->rx_ops, msg_head.can_id, ifindex)) in bcm_sendmsg()
1322 ret = bcm_read_op(&bo->tx_ops, &msg_head, ifindex); in bcm_sendmsg()
1328 ret = bcm_read_op(&bo->rx_ops, &msg_head, ifindex); in bcm_sendmsg()
1336 ret = bcm_tx_send(msg, ifindex, sk); in bcm_sendmsg()
1378 if (bo->bound && bo->ifindex == dev->ifindex) { in bcm_notifier()
1380 bo->ifindex = 0; in bcm_notifier()
1394 if (bo->bound && bo->ifindex == dev->ifindex) { in bcm_notifier()
1412 bo->ifindex = 0; in bcm_init()
1455 if (op->ifindex) { in bcm_release()
1464 dev = dev_get_by_index(&init_net, op->ifindex); in bcm_release()
1485 bo->ifindex = 0; in bcm_release()
1523 bo->ifindex = dev->ifindex; in bcm_connect()
1528 bo->ifindex = 0; in bcm_connect()