Lines Matching refs:cf
174 struct can_frame *cf; in slcan_bump_frame() local
179 skb = alloc_can_skb(sl->dev, &cf); in slcan_bump_frame()
187 cf->can_id = CAN_RTR_FLAG; in slcan_bump_frame()
191 cf->len = sl->rbuff[SLCAN_CMD_LEN + SLCAN_SFF_ID_LEN]; in slcan_bump_frame()
197 cf->can_id = CAN_RTR_FLAG; in slcan_bump_frame()
200 cf->can_id |= CAN_EFF_FLAG; in slcan_bump_frame()
202 cf->len = sl->rbuff[SLCAN_CMD_LEN + SLCAN_EFF_ID_LEN]; in slcan_bump_frame()
214 cf->can_id |= tmpid; in slcan_bump_frame()
217 if (cf->len >= '0' && cf->len < '9') in slcan_bump_frame()
218 cf->len -= '0'; in slcan_bump_frame()
223 if (!(cf->can_id & CAN_RTR_FLAG)) { in slcan_bump_frame()
224 for (i = 0; i < cf->len; i++) { in slcan_bump_frame()
229 cf->data[i] = (tmp << 4); in slcan_bump_frame()
234 cf->data[i] |= tmp; in slcan_bump_frame()
239 if (!(cf->can_id & CAN_RTR_FLAG)) in slcan_bump_frame()
240 sl->dev->stats.rx_bytes += cf->len; in slcan_bump_frame()
262 struct can_frame *cf; in slcan_bump_state() local
297 skb = alloc_can_err_skb(dev, &cf); in slcan_bump_state()
301 can_change_state(dev, cf, tx_state, rx_state); in slcan_bump_state()
306 cf->can_id |= CAN_ERR_CNT; in slcan_bump_state()
307 cf->data[6] = txerr; in slcan_bump_state()
308 cf->data[7] = rxerr; in slcan_bump_state()
326 struct can_frame *cf; in slcan_bump_err() local
341 skb = alloc_can_err_skb(dev, &cf); in slcan_bump_err()
344 cf->can_id |= CAN_ERR_PROT | CAN_ERR_BUSERROR; in slcan_bump_err()
353 cf->can_id |= CAN_ERR_ACK; in slcan_bump_err()
354 cf->data[3] = CAN_ERR_PROT_LOC_ACK; in slcan_bump_err()
362 cf->data[2] |= CAN_ERR_PROT_BIT0; in slcan_bump_err()
369 cf->data[2] |= CAN_ERR_PROT_BIT1; in slcan_bump_err()
376 cf->data[2] |= CAN_ERR_PROT_BIT; in slcan_bump_err()
377 cf->data[3] = CAN_ERR_PROT_LOC_CRC_SEQ; in slcan_bump_err()
385 cf->data[2] |= CAN_ERR_PROT_FORM; in slcan_bump_err()
393 cf->can_id |= CAN_ERR_CRTL; in slcan_bump_err()
394 cf->data[1] = CAN_ERR_CRTL_RX_OVERFLOW; in slcan_bump_err()
402 cf->can_id |= CAN_ERR_CRTL; in slcan_bump_err()
403 cf->data[1] = CAN_ERR_CRTL_TX_OVERFLOW; in slcan_bump_err()
411 cf->data[2] |= CAN_ERR_PROT_STUFF; in slcan_bump_err()
482 static void slcan_encaps(struct slcan *sl, struct can_frame *cf) in slcan_encaps() argument
487 canid_t id = cf->can_id; in slcan_encaps()
491 if (cf->can_id & CAN_RTR_FLAG) in slcan_encaps()
497 if (cf->can_id & CAN_EFF_FLAG) { in slcan_encaps()
513 pos += (cf->can_id & CAN_EFF_FLAG) ? in slcan_encaps()
516 *pos++ = cf->len + '0'; in slcan_encaps()
519 if (!(cf->can_id & CAN_RTR_FLAG)) { in slcan_encaps()
520 for (i = 0; i < cf->len; i++) in slcan_encaps()
521 pos = hex_byte_pack_upper(pos, cf->data[i]); in slcan_encaps()
523 sl->dev->stats.tx_bytes += cf->len; in slcan_encaps()