/* bcm_tx_send - send a single CAN frame to the CAN interface (for bcm_sendmsg)  */
static int bcm_tx_send(struct msghdr *msg, int ifindex, struct sock *sk)
/* bcm_tx_send - send a single CAN frame to the CAN interface (for bcm_sendmsg)  */
static int bcm_tx_send(struct msghdr *msg, int ifindex, struct sock *sk)
{
	struct sk_buff *skb;
	struct net_device *dev;
	int err;
	if (!ifindex)
		return -ENODEV;
	skb = alloc_skb(CFSIZ, GFP_KERNEL);
	if (!skb)
		return -ENOMEM;
	err = memcpy_fromiovec(skb_put(skb, CFSIZ), msg->msg_iov, CFSIZ);
	if (err < 0) {
		kfree_skb(skb);
		return err;
	}
	dev = dev_get_by_index(&init_net, ifindex);
	if (!dev) {
		kfree_skb(skb);
		return -ENODEV;
	}
	skb->dev = dev;
	skb->sk  = sk;
	err = can_send(skb, 1);
	dev_put(dev);
	if (err)
		return err;
	return CFSIZ + MHSIZ;
}