forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
can: bcm: use CAN frame instead of can_frame in comments
can_frame is the name of the struct can_frame which is not meant in the corrected comments. Signed-off-by: Oliver Hartkopp <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
- Loading branch information
1 parent
95acb49
commit 72c8a89
Showing
1 changed file
with
16 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,7 +84,7 @@ MODULE_LICENSE("Dual BSD/GPL"); | |
MODULE_AUTHOR("Oliver Hartkopp <[email protected]>"); | ||
MODULE_ALIAS("can-proto-2"); | ||
|
||
/* easy access to can_frame payload */ | ||
/* easy access to CAN frame payload */ | ||
static inline u64 GET_U64(const struct can_frame *cp) | ||
{ | ||
return *(u64 *)cp->data; | ||
|
@@ -305,13 +305,13 @@ static void bcm_send_to_user(struct bcm_op *op, struct bcm_msg_head *head, | |
memcpy(skb_put(skb, sizeof(*head)), head, sizeof(*head)); | ||
|
||
if (head->nframes) { | ||
/* can_frames starting here */ | ||
/* CAN frames starting here */ | ||
firstframe = (struct can_frame *)skb_tail_pointer(skb); | ||
|
||
memcpy(skb_put(skb, datalen), frames, datalen); | ||
|
||
/* | ||
* the BCM uses the can_dlc-element of the can_frame | ||
* the BCM uses the can_dlc-element of the CAN frame | ||
* structure for internal purposes. This is only | ||
* relevant for updates that are generated by the | ||
* BCM, where nframes is 1 | ||
|
@@ -492,7 +492,7 @@ static void bcm_rx_cmp_to_index(struct bcm_op *op, unsigned int index, | |
return; | ||
} | ||
|
||
/* do a real check in can_frame data section */ | ||
/* do a real check in CAN frame data section */ | ||
|
||
if ((GET_U64(&op->frames[index]) & GET_U64(rxdata)) != | ||
(GET_U64(&op->frames[index]) & GET_U64(&op->last_frames[index]))) { | ||
|
@@ -501,7 +501,7 @@ static void bcm_rx_cmp_to_index(struct bcm_op *op, unsigned int index, | |
} | ||
|
||
if (op->flags & RX_CHECK_DLC) { | ||
/* do a real check in can_frame dlc */ | ||
/* do a real check in CAN frame dlc */ | ||
if (rxdata->can_dlc != (op->last_frames[index].can_dlc & | ||
BCM_CAN_DLC_MASK)) { | ||
bcm_rx_update_and_send(op, &op->last_frames[index], | ||
|
@@ -554,7 +554,7 @@ static enum hrtimer_restart bcm_rx_timeout_handler(struct hrtimer *hrtimer) | |
|
||
/* if user wants to be informed, when cyclic CAN-Messages come back */ | ||
if ((op->flags & RX_ANNOUNCE_RESUME) && op->last_frames) { | ||
/* clear received can_frames to indicate 'nothing received' */ | ||
/* clear received CAN frames to indicate 'nothing received' */ | ||
memset(op->last_frames, 0, op->nframes * CFSIZ); | ||
} | ||
|
||
|
@@ -840,7 +840,7 @@ static int bcm_tx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg, | |
if (!ifindex) | ||
return -ENODEV; | ||
|
||
/* check nframes boundaries - we need at least one can_frame */ | ||
/* check nframes boundaries - we need at least one CAN frame */ | ||
if (msg_head->nframes < 1 || msg_head->nframes > MAX_NFRAMES) | ||
return -EINVAL; | ||
|
||
|
@@ -851,14 +851,14 @@ static int bcm_tx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg, | |
/* update existing BCM operation */ | ||
|
||
/* | ||
* Do we need more space for the can_frames than currently | ||
* 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. | ||
*/ | ||
if (msg_head->nframes > op->nframes) | ||
return -E2BIG; | ||
|
||
/* update can_frames content */ | ||
/* update CAN frames content */ | ||
for (i = 0; i < msg_head->nframes; i++) { | ||
err = memcpy_from_msg((u8 *)&op->frames[i], msg, CFSIZ); | ||
|
||
|
@@ -883,7 +883,7 @@ static int bcm_tx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg, | |
|
||
op->can_id = msg_head->can_id; | ||
|
||
/* create array for can_frames and copy the data */ | ||
/* create array for CAN frames and copy the data */ | ||
if (msg_head->nframes > 1) { | ||
op->frames = kmalloc(msg_head->nframes * CFSIZ, | ||
GFP_KERNEL); | ||
|
@@ -966,7 +966,7 @@ static int bcm_tx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg, | |
|
||
if (op->flags & STARTTIMER) { | ||
hrtimer_cancel(&op->timer); | ||
/* spec: send can_frame when starting timer */ | ||
/* spec: send CAN frame when starting timer */ | ||
op->flags |= TX_ANNOUNCE; | ||
} | ||
|
||
|
@@ -1015,15 +1015,15 @@ static int bcm_rx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg, | |
/* update existing BCM operation */ | ||
|
||
/* | ||
* Do we need more space for the can_frames than currently | ||
* 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. | ||
*/ | ||
if (msg_head->nframes > op->nframes) | ||
return -E2BIG; | ||
|
||
if (msg_head->nframes) { | ||
/* update can_frames content */ | ||
/* update CAN frames content */ | ||
err = memcpy_from_msg((u8 *)op->frames, msg, | ||
msg_head->nframes * CFSIZ); | ||
if (err < 0) | ||
|
@@ -1048,15 +1048,15 @@ static int bcm_rx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg, | |
op->nframes = msg_head->nframes; | ||
|
||
if (msg_head->nframes > 1) { | ||
/* create array for can_frames and copy the data */ | ||
/* create array for CAN frames and copy the data */ | ||
op->frames = kmalloc(msg_head->nframes * CFSIZ, | ||
GFP_KERNEL); | ||
if (!op->frames) { | ||
kfree(op); | ||
return -ENOMEM; | ||
} | ||
|
||
/* create and init array for received can_frames */ | ||
/* create and init array for received CAN frames */ | ||
op->last_frames = kzalloc(msg_head->nframes * CFSIZ, | ||
GFP_KERNEL); | ||
if (!op->last_frames) { | ||
|
@@ -1327,7 +1327,7 @@ static int bcm_sendmsg(struct socket *sock, struct msghdr *msg, size_t size) | |
break; | ||
|
||
case TX_SEND: | ||
/* we need exactly one can_frame behind the msg head */ | ||
/* we need exactly one CAN frame behind the msg head */ | ||
if ((msg_head.nframes != 1) || (size != CFSIZ + MHSIZ)) | ||
ret = -EINVAL; | ||
else | ||
|