/* Allocate and setup space for the CAN network device  */
struct net_device* alloc_candev(int sizeof_priv, unsigned int echo_skb_max)
/* Allocate and setup space for the CAN network device  */
struct net_device* alloc_candev(int sizeof_priv, unsigned int echo_skb_max)
{
	struct net_device *dev;
	struct can_priv *priv;
	int size;
	if (echo_skb_max)
		size = ALIGN(sizeof_priv, sizeof(struct sk_buff *)) +
			echo_skb_max * sizeof(struct sk_buff *);
	else
		size = sizeof_priv;
	dev = alloc_netdev(size, "can%d", can_setup);
	if (!dev)
		return NULL;
	priv = netdev_priv(dev);
	if (echo_skb_max) {
		priv->echo_skb_max = echo_skb_max;
		priv->echo_skb = (void *)priv +
			ALIGN(sizeof_priv, sizeof(struct sk_buff *));
	}
	priv->state = CAN_STATE_STOPPED;
	init_timer(&priv->restart_timer);
	return dev;
}