/* Schedule any necessary changes in ELM327's CAN configuration */
if (elm->can_frame_to_send.can_id != frame->can_id) {
/* Set the new CAN ID for transmission. */
- if ((frame->can_id & CAN_EFF_FLAG)
- ^ (elm->can_frame_to_send.can_id & CAN_EFF_FLAG)) {
+ if ((frame->can_id & CAN_EFF_FLAG) ^
+ (elm->can_frame_to_send.can_id & CAN_EFF_FLAG)) {
elm->can_config = (frame->can_id & CAN_EFF_FLAG
? 0
: ELM327_CAN_CONFIG_SEND_SFF)
frame->can_id = CAN_EFF_FLAG;
datastart = 14;
} else if (elm->rxbuf[3] == ' ' && elm->rxbuf[5] == ' ') {
- frame->can_id = 0;
datastart = 6;
} else {
/* This is not a well-formatted data line.
struct elmcan *elm = netdev_priv(dev);
struct can_frame *frame = (struct can_frame *)skb->data;
+ if (can_dropped_invalid_skb(dev, skb))
+ return NETDEV_TX_OK;
+
/* BHs are already disabled, so no spin_lock_bh().
* See Documentation/networking/netdevices.txt
*/
INIT_WORK(&elm->tx_work, elmcan_ldisc_tx_worker);
/* Configure CAN metadata */
- elm->can.state = CAN_STATE_STOPPED;
elm->can.bitrate_const = elmcan_bitrate_const;
elm->can.bitrate_const_cnt = ARRAY_SIZE(elmcan_bitrate_const);
elm->can.do_set_bittiming = elmcan_do_set_bittiming;