- switch(len) {
- case 17:
- if (!memcmp(elm->rxbuf, "UNABLE TO CONNECT", 17)) {
- netdev_err(elm->dev, "The ELM327 reported UNABLE TO CONNECT. Please check your setup.\n");
- }
- break;
- case 11:
- if (!memcmp(elm->rxbuf, "BUFFER FULL", 11)) {
- /* This case will only happen if the last data
- * line was complete.
- * Otherwise, elm327_parse_frame() will emit the
- * error frame instead.
- */
- frame.can_id |= CAN_ERR_CRTL;
- frame.data[1] = CAN_ERR_CRTL_RX_OVERFLOW;
- }
- break;
- case 9:
- if (!memcmp(elm->rxbuf, "BUS ERROR", 9)) {
- frame.can_id |= CAN_ERR_BUSERROR;
- }
- if (!memcmp(elm->rxbuf, "CAN ERROR", 9)
- || !memcmp(elm->rxbuf, "<RX ERROR", 9)) {
- frame.can_id |= CAN_ERR_PROT;
- }
- break;
- case 8:
- if (!memcmp(elm->rxbuf, "BUS BUSY", 8)) {
- frame.can_id |= CAN_ERR_PROT;
- frame.data[2] = CAN_ERR_PROT_OVERLOAD;
- }
- if (!memcmp(elm->rxbuf, "FB ERROR", 8)) {
- frame.can_id |= CAN_ERR_PROT;
- frame.data[2] = CAN_ERR_PROT_TX;
- }
- break;
- case 5:
- if (!memcmp(elm->rxbuf, "ERR", 3)) {
- netdev_err(elm->dev, "The ELM327 reported an ERR%c%c. Please power it off and on again.\n",
- elm->rxbuf[3], elm->rxbuf[4]);
- frame.can_id |= CAN_ERR_CRTL;
- }
- break;
- default:
- /* Don't emit an error frame if we're unsure */
- return;
+ switch (len) {
+ case 17:
+ if (!memcmp(elm->rxbuf, "UNABLE TO CONNECT", 17)) {
+ netdev_err(elm->dev,
+ "ELM327 reported UNABLE TO CONNECT. Please check your setup.\n");
+ }
+ break;
+ case 11:
+ if (!memcmp(elm->rxbuf, "BUFFER FULL", 11)) {
+ /* This case will only happen if the last data
+ * line was complete.
+ * Otherwise, elm327_parse_frame() will heuristically
+ * emit this error frame instead.
+ */
+ frame.can_id |= CAN_ERR_CRTL;
+ frame.data[1] = CAN_ERR_CRTL_RX_OVERFLOW;
+ }
+ break;
+ case 9:
+ if (!memcmp(elm->rxbuf, "BUS ERROR", 9))
+ frame.can_id |= CAN_ERR_BUSERROR;
+ if (!memcmp(elm->rxbuf, "CAN ERROR", 9))
+ frame.can_id |= CAN_ERR_PROT;
+ if (!memcmp(elm->rxbuf, "<RX ERROR", 9))
+ frame.can_id |= CAN_ERR_PROT;
+ break;
+ case 8:
+ if (!memcmp(elm->rxbuf, "BUS BUSY", 8)) {
+ frame.can_id |= CAN_ERR_PROT;
+ frame.data[2] = CAN_ERR_PROT_OVERLOAD;
+ }
+ if (!memcmp(elm->rxbuf, "FB ERROR", 8)) {
+ frame.can_id |= CAN_ERR_PROT;
+ frame.data[2] = CAN_ERR_PROT_TX;
+ }
+ break;
+ case 5:
+ if (!memcmp(elm->rxbuf, "ERR", 3)) {
+ netdev_err(elm->dev, "ELM327 reported an ERR%c%c. Please power it off and on again.\n",
+ elm->rxbuf[3], elm->rxbuf[4]);
+ frame.can_id |= CAN_ERR_CRTL;
+ }
+ break;
+ default:
+ /* Don't emit an error frame if we're unsure */
+ return;