[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220612213927.3004444-9-dario.binacchi@amarulasolutions.com>
Date: Sun, 12 Jun 2022 23:39:22 +0200
From: Dario Binacchi <dario.binacchi@...rulasolutions.com>
To: linux-kernel@...r.kernel.org
Cc: michael@...rulasolutions.com,
Amarula patchwork <linux-amarula@...rulasolutions.com>,
Oliver Hartkopp <socketcan@...tkopp.net>,
Dario Binacchi <dario.binacchi@...rulasolutions.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Marc Kleine-Budde <mkl@...gutronix.de>,
Paolo Abeni <pabeni@...hat.com>,
Wolfgang Grandegger <wg@...ndegger.com>,
linux-can@...r.kernel.org, netdev@...r.kernel.org
Subject: [PATCH v3 08/13] can: slcan: send the open command to the adapter
In case the bitrate has been set via ip tool, this patch changes the
driver to send the open command ("O\r") to the adapter.
Signed-off-by: Dario Binacchi <dario.binacchi@...rulasolutions.com>
---
(no changes since v2)
Changes in v2:
- Improve the commit message.
drivers/net/can/slcan.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/net/can/slcan.c b/drivers/net/can/slcan.c
index be3f7e5c685b..9bbf8f363f58 100644
--- a/drivers/net/can/slcan.c
+++ b/drivers/net/can/slcan.c
@@ -495,14 +495,23 @@ static int slc_open(struct net_device *dev)
netdev_err(dev,
"failed to send bitrate command 'C\\rS%d\\r'\n",
s);
- close_candev(dev);
- return err;
+ goto cmd_transmit_failed;
+ }
+
+ err = slcan_transmit_cmd(sl, "O\r");
+ if (err) {
+ netdev_err(dev, "failed to send open command 'O\\r'\n");
+ goto cmd_transmit_failed;
}
}
sl->can.state = CAN_STATE_ERROR_ACTIVE;
netif_start_queue(dev);
return 0;
+
+cmd_transmit_failed:
+ close_candev(dev);
+ return err;
}
static void slc_dealloc(struct slcan *sl)
--
2.32.0
Powered by blists - more mailing lists