if (!ifindex)
return "any";
+ /* no usage counting */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
- dev = __dev_get_by_index(&init_net, ifindex); /* no usage counting */
+ dev = __dev_get_by_index(&init_net, ifindex);
#else
- dev = __dev_get_by_index(ifindex); /* no usage counting */
+ dev = __dev_get_by_index(ifindex);
#endif
if (dev)
return dev->name;
if (op->flags & RX_FILTER_ID) {
/* the easiest case */
-
bcm_rx_update_and_send(op, &op->last_frames[0], &rxframe);
bcm_rx_starttimer(op);
return;
if (op->nframes == 1) {
/* simple compare with index 0 */
-
bcm_rx_cmp_to_index(op, 0, &rxframe);
bcm_rx_starttimer(op);
return;
}
if (op->nframes > 1) {
- /* multiplex compare
+ /*
+ * multiplex compare
*
* find the first multiplex mask that fits.
* Remark: The MUX-mask is stored in index 0
op = bcm_find_op(&bo->tx_ops, msg_head->can_id, ifindex);
if (op) {
- /* update existing BCM operation
- *
+ /* update existing BCM operation */
+
+ /*
* Do we need more space for the can_frames than currently
* allocated? -> This is a _really_ unusual use-case and
* therefore (complexity / locking) it is not supported.
/* bcm_can_tx / bcm_tx_timeout_handler needs this */
op->sk = sk;
-
op->ifindex = ifindex;
/* initialize uninitialized (kmalloc) structure */
if (op->flags & SETTIMER) {
/* set timer values */
-
op->count = msg_head->count;
op->ival1 = msg_head->ival1;
op->ival2 = msg_head->ival2;
if ((msg_head->flags & RX_FILTER_ID) || (!(msg_head->nframes))) {
/* be robust against wrong usage ... */
msg_head->flags |= RX_FILTER_ID;
- msg_head->nframes = 0; /* ignore trailing garbage */
+ /* ignore trailing garbage */
+ msg_head->nframes = 0;
}
if ((msg_head->flags & RX_RTR_FRAME) &&
/* check the given can_id */
op = bcm_find_op(&bo->rx_ops, msg_head->can_id, ifindex);
if (op) {
- /* update existing BCM operation
- *
+ /* update existing BCM operation */
+
+ /*
* Do we need more space for the can_frames than currently
* allocated? -> This is a _really_ unusual use-case and
* therefore (complexity / locking) it is not supported.
} else {
/* insert new BCM operation for the given can_id */
-
op = kzalloc(OPSIZ, GFP_KERNEL);
if (!op)
return -ENOMEM;
}
}
+ /* bcm_can_tx / bcm_tx_timeout_handler needs this */
op->sk = sk;
op->ifindex = ifindex;
op->thrtimer.expires = jiffies + 2;
add_timer(&op->thrtimer);
}
+
/*
* if (op->j_ival2) is zero, no (new) throttling
* will happen. For details see functions
struct net_device *dev;
int err;
- /* just copy and send one can_frame */
-
- if (!ifindex) /* we need a real device to send frames */
+ /* we need a real device to send frames */
+ if (!ifindex)
return -ENODEV;
skb = alloc_skb(CFSIZ, GFP_KERNEL);
if (addr->can_family != AF_CAN)
return -EINVAL;
- ifindex = addr->can_ifindex; /* ifindex from sendto() */
+ /* ifindex from sendto() */
+ ifindex = addr->can_ifindex;
if (ifindex) {
struct net_device *dev;