Lines Matching refs:cf

276 	struct can_frame *cf = (struct can_frame *)skb->data;
278 u32 ctrl = FLEXCAN_MB_CNT_CODE(0xc) | (cf->can_dlc << 16);
285 if (cf->can_id & CAN_EFF_FLAG) {
286 can_id = cf->can_id & CAN_EFF_MASK;
289 can_id = (cf->can_id & CAN_SFF_MASK) << 18;
292 if (cf->can_id & CAN_RTR_FLAG)
295 if (cf->can_dlc > 0) {
296 u32 data = be32_to_cpup((__be32 *)&cf->data[0]);
299 if (cf->can_dlc > 3) {
300 u32 data = be32_to_cpup((__be32 *)&cf->data[4]);
313 struct can_frame *cf, u32 reg_esr)
318 cf->can_id |= CAN_ERR_PROT | CAN_ERR_BUSERROR;
322 cf->data[2] |= CAN_ERR_PROT_BIT1;
327 cf->data[2] |= CAN_ERR_PROT_BIT0;
332 cf->can_id |= CAN_ERR_ACK;
333 cf->data[3] |= CAN_ERR_PROT_LOC_ACK;
338 cf->data[2] |= CAN_ERR_PROT_BIT;
339 cf->data[3] |= CAN_ERR_PROT_LOC_CRC_SEQ;
344 cf->data[2] |= CAN_ERR_PROT_FORM;
349 cf->data[2] |= CAN_ERR_PROT_STUFF;
363 struct can_frame *cf;
365 skb = alloc_can_err_skb(dev, &cf);
369 do_bus_err(dev, cf, reg_esr);
373 dev->stats.rx_bytes += cf->can_dlc;
379 struct can_frame *cf, enum can_state new_state)
398 cf->can_id |= CAN_ERR_CRTL;
399 cf->data[1] = (bec.txerr > bec.rxerr) ?
414 cf->can_id |= CAN_ERR_CRTL;
415 cf->data[1] = (bec.txerr > bec.rxerr) ?
432 cf->can_id |= CAN_ERR_PROT;
433 cf->data[2] = CAN_ERR_PROT_ACTIVE;
436 cf->can_id |= CAN_ERR_BUSOFF;
448 struct can_frame *cf;
468 skb = alloc_can_err_skb(dev, &cf);
472 do_state(dev, cf, new_state);
477 dev->stats.rx_bytes += cf->can_dlc;
483 struct can_frame *cf)
493 cf->can_id = ((reg_id >> 0) & CAN_EFF_MASK) | CAN_EFF_FLAG;
495 cf->can_id = (reg_id >> 18) & CAN_SFF_MASK;
498 cf->can_id |= CAN_RTR_FLAG;
499 cf->can_dlc = get_can_dlc((reg_ctrl >> 16) & 0xf);
501 *(__be32 *)(cf->data + 0) = cpu_to_be32(flexcan_read(&mb->data[0]));
502 *(__be32 *)(cf->data + 4) = cpu_to_be32(flexcan_read(&mb->data[1]));
512 struct can_frame *cf;
515 skb = alloc_can_skb(dev, &cf);
521 flexcan_read_fifo(dev, cf);
525 stats->rx_bytes += cf->can_dlc;