projects
/
elmcan.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4773fcf
)
Rename elm327_panic() to elm327_hw_failure() to avoid confusion
author
norly
<ny-git@enpas.org>
Wed, 23 Jan 2019 15:41:56 +0000
(16:41 +0100)
committer
norly
<ny-git@enpas.org>
Wed, 30 Jan 2019 22:47:28 +0000
(23:47 +0100)
module/elmcan.c
patch
|
blob
|
history
readme.rst
patch
|
blob
|
history
diff --git
a/module/elmcan.c
b/module/elmcan.c
index cde48caaf330062c3859828594ebc522ed62e55f..978a8f1b8bacd2ffa133ba9aeda5dfd8f45c1737 100644
(file)
--- a/
module/elmcan.c
+++ b/
module/elmcan.c
@@
-137,7
+137,7
@@
struct elmcan {
static DEFINE_SPINLOCK(elmcan_discdata_lock);
static DEFINE_SPINLOCK(elmcan_discdata_lock);
-static inline void elm327_
panic
(struct elmcan *elm);
+static inline void elm327_
hw_failure
(struct elmcan *elm);
@@
-165,7
+165,7
@@
static void elm327_send(struct elmcan *elm, const void *buf, size_t len)
actual = elm->tty->ops->write(elm->tty, elm->txbuf, len);
if (actual < 0) {
pr_err("Failed to write to tty for %s.\n", elm->dev->name);
actual = elm->tty->ops->write(elm->tty, elm->txbuf, len);
if (actual < 0) {
pr_err("Failed to write to tty for %s.\n", elm->dev->name);
- elm327_
panic
(elm);
+ elm327_
hw_failure
(elm);
}
elm->txleft = len - actual;
}
elm->txleft = len - actual;
@@
-319,12
+319,13
@@
static void elm327_feed_frame_to_netdev(struct elmcan *elm, const struct can_fra
/************************************************************************
/************************************************************************
- * ELM327:
Panic handler
*
+ * ELM327:
"Panic" handler
*
* *
* (assumes elm->lock taken) *
************************************************************************/
* *
* (assumes elm->lock taken) *
************************************************************************/
-static inline void elm327_panic(struct elmcan *elm)
+/* Called when we're out of ideas and just want it all to end. */
+static inline void elm327_hw_failure(struct elmcan *elm)
{
struct can_frame frame = {0};
{
struct can_frame frame = {0};
@@
-665,7
+666,7
@@
static void elm327_parse_rxbuf(struct elmcan *elm)
* Did we even connect at the right baud rate?
*/
pr_err("RX buffer overflow. Faulty ELM327 connected?\n");
* Did we even connect at the right baud rate?
*/
pr_err("RX buffer overflow. Faulty ELM327 connected?\n");
- elm327_
panic
(elm);
+ elm327_
hw_failure
(elm);
} else if (len == elm->rxfill) {
if (elm->state == ELM_RECEIVING
&& elm->rxbuf[elm->rxfill - 1] == ELM327_READY_CHAR) {
} else if (len == elm->rxfill) {
if (elm->state == ELM_RECEIVING
&& elm->rxbuf[elm->rxfill - 1] == ELM327_READY_CHAR) {
@@
-904,7
+905,7
@@
static void elmcan_ldisc_rx(struct tty_struct *tty,
pr_err("Error in received character stream. Check your wiring.");
spin_lock_bh(&elm->lock);
pr_err("Error in received character stream. Check your wiring.");
spin_lock_bh(&elm->lock);
- elm327_
panic
(elm);
+ elm327_
hw_failure
(elm);
spin_unlock_bh(&elm->lock);
put_elm(elm);
spin_unlock_bh(&elm->lock);
put_elm(elm);
@@
-920,7
+921,7
@@
static void elmcan_ldisc_rx(struct tty_struct *tty,
pr_err("Receive buffer overflowed. Bad chip or wiring?");
spin_lock_bh(&elm->lock);
pr_err("Receive buffer overflowed. Bad chip or wiring?");
spin_lock_bh(&elm->lock);
- elm327_
panic
(elm);
+ elm327_
hw_failure
(elm);
spin_unlock_bh(&elm->lock);
put_elm(elm);
spin_unlock_bh(&elm->lock);
put_elm(elm);
@@
-966,7
+967,7
@@
static void elmcan_ldisc_tx_worker(struct work_struct *work)
actual = elm->tty->ops->write(elm->tty, elm->txhead, elm->txleft);
if (actual < 0) {
pr_err("Failed to write to tty for %s.\n", elm->dev->name);
actual = elm->tty->ops->write(elm->tty, elm->txhead, elm->txleft);
if (actual < 0) {
pr_err("Failed to write to tty for %s.\n", elm->dev->name);
- elm327_
panic
(elm);
+ elm327_
hw_failure
(elm);
}
elm->txleft -= actual;
}
elm->txleft -= actual;
diff --git
a/readme.rst
b/readme.rst
index 8a3592535347acd04f0134ed80569e1738d19aad..df78721e711f285f0cb2d3b7592909cdb9d7deac 100644
(file)
--- a/
readme.rst
+++ b/
readme.rst
@@
-260,8
+260,6
@@
incomplete) data frame::
To Do list for future development
----------------------------------
To Do list for future development
----------------------------------
-- Rename ``elm327_panic()``
-
- No auto-restart in ``elm327_panic()``?
- Stop current function when in ``elm327_panic()``
- No auto-restart in ``elm327_panic()``?
- Stop current function when in ``elm327_panic()``