Lines Matching refs:can
24 * error frames (see uapi/linux/can/error.h) and sends it using the
28 #include <linux/can.h>
29 #include <linux/can/dev.h>
30 #include <linux/can/error.h>
78 /* start the can transceiver - val defines the operation mode */
80 /* cancel pending transmissions and stop the can transceiver */
82 /* send can transceiver into low-power sleep mode */
84 /* wake up can transceiver from low-power sleep mode */
86 /* reset the can transceiver */
88 /* get piece of info from the can transceiver - subcmd defines what
275 struct can_priv can;
282 /* lock for can->echo_skb (used around
452 up->can.clock.freq = le32_to_cpu(device_info->freq);
466 up->can.ctrlmode_supported = 0;
469 up->can.ctrlmode_supported |= CAN_CTRLMODE_LOOPBACK;
471 up->can.ctrlmode_supported |= CAN_CTRLMODE_LISTENONLY;
473 up->can.ctrlmode_supported |= CAN_CTRLMODE_3_SAMPLES;
475 up->can.ctrlmode_supported |= CAN_CTRLMODE_ONE_SHOT;
477 up->can.ctrlmode_supported |= CAN_CTRLMODE_BERR_REPORTING;
481 * Returns true if the can state has changed.
487 enum can_state new_state = up->can.state;
489 struct can_device_stats *can_stats = &up->can.can_stats;
532 if (up->can.state == new_state)
536 if (up->can.state > new_state) {
537 up->can.state = new_state;
542 up->can.state = new_state;
560 /* Callback on reception of a can frame via the IN endpoint
588 if (!(up->can.ctrlmode & CAN_CTRLMODE_BERR_REPORTING) &&
613 /* fill the can frame */
980 if (up->can.ctrlmode & CAN_CTRLMODE_LOOPBACK)
982 if (up->can.ctrlmode & CAN_CTRLMODE_LISTENONLY)
984 if (up->can.ctrlmode & CAN_CTRLMODE_3_SAMPLES)
986 if (up->can.ctrlmode & CAN_CTRLMODE_ONE_SHOT)
1014 up->can.state = CAN_STATE_ERROR_ACTIVE;
1110 /* callback when Linux needs to send a can frame */
1138 /* put the skb on can loopback stack */
1200 up->can.state = CAN_STATE_STOPPED;
1208 /* stop and reset can device */
1249 cmd_set_bittiming->tq = cpu_to_le32(up->can.bittiming.tq);
1250 cmd_set_bittiming->brp = cpu_to_le16(up->can.bittiming.brp);
1252 cpu_to_le16(up->can.bittiming.sample_point);
1253 cmd_set_bittiming->prop_seg = up->can.bittiming.prop_seg;
1254 cmd_set_bittiming->phase_seg1 = up->can.bittiming.phase_seg1;
1255 cmd_set_bittiming->phase_seg2 = up->can.bittiming.phase_seg2;
1256 cmd_set_bittiming->sjw = up->can.bittiming.sjw;
1264 * Called when the user runs "ip link set can1 type can restart".
1277 up->can.state = CAN_STATE_ERROR_ACTIVE;
1279 /* check if queue can be restarted,
1509 up->can.state = CAN_STATE_STOPPED;
1510 up->can.bittiming_const = &up->device_info.bittiming_const;
1511 up->can.do_set_bittiming = ucan_set_bittiming;
1512 up->can.do_set_mode = &ucan_set_mode;
1546 up->can.state = CAN_STATE_STOPPED;