Lines Matching refs:frame
402 static void mcp251x_hw_tx(struct spi_device *spi, struct can_frame *frame, in mcp251x_hw_tx() argument
409 exide = (frame->can_id & CAN_EFF_FLAG) ? 1 : 0; /* Extended ID Enable */ in mcp251x_hw_tx()
411 sid = (frame->can_id & CAN_EFF_MASK) >> 18; in mcp251x_hw_tx()
413 sid = frame->can_id & CAN_SFF_MASK; /* Standard ID */ in mcp251x_hw_tx()
414 eid = frame->can_id & CAN_EFF_MASK; /* Extended ID */ in mcp251x_hw_tx()
415 rtr = (frame->can_id & CAN_RTR_FLAG) ? 1 : 0; /* Remote transmission */ in mcp251x_hw_tx()
424 buf[TXBDLC_OFF] = (rtr << DLC_RTR_SHIFT) | frame->can_dlc; in mcp251x_hw_tx()
425 memcpy(buf + TXBDAT_OFF, frame->data, frame->can_dlc); in mcp251x_hw_tx()
426 mcp251x_hw_tx_frame(spi, buf, frame->can_dlc, tx_buf_idx); in mcp251x_hw_tx()
458 struct can_frame *frame; in mcp251x_hw_rx() local
461 skb = alloc_can_skb(priv->net, &frame); in mcp251x_hw_rx()
471 frame->can_id = CAN_EFF_FLAG; in mcp251x_hw_rx()
472 frame->can_id |= in mcp251x_hw_rx()
482 frame->can_id |= CAN_RTR_FLAG; in mcp251x_hw_rx()
485 frame->can_id = in mcp251x_hw_rx()
489 frame->can_id |= CAN_RTR_FLAG; in mcp251x_hw_rx()
492 frame->can_dlc = get_can_dlc(buf[RXBDLC_OFF] & RXBDLC_LEN_MASK); in mcp251x_hw_rx()
493 memcpy(frame->data, buf + RXBDAT_OFF, frame->can_dlc); in mcp251x_hw_rx()
496 priv->net->stats.rx_bytes += frame->can_dlc; in mcp251x_hw_rx()
716 struct can_frame *frame; in mcp251x_error_skb() local
718 skb = alloc_can_err_skb(net, &frame); in mcp251x_error_skb()
720 frame->can_id |= can_id; in mcp251x_error_skb()
721 frame->data[1] = data1; in mcp251x_error_skb()
734 struct can_frame *frame; in mcp251x_tx_work_handler() local
741 frame = (struct can_frame *)priv->tx_skb->data; in mcp251x_tx_work_handler()
743 if (frame->can_dlc > CAN_FRAME_MAX_DATA_LEN) in mcp251x_tx_work_handler()
744 frame->can_dlc = CAN_FRAME_MAX_DATA_LEN; in mcp251x_tx_work_handler()
745 mcp251x_hw_tx(spi, frame, 0); in mcp251x_tx_work_handler()
746 priv->tx_len = 1 + frame->can_dlc; in mcp251x_tx_work_handler()