summaryrefslogtreecommitdiff
path: root/module
AgeCommit message (Collapse)Author
2019-02-19Ignore tty RX after HW failure, locking fixnorly
2019-02-18Work around hardware bug when waiting for '>' promptnorly
Sometimes the ELM327 sets 0x80 and/or 0x40 when sending '>' to indicate that it is ready to receive the next command. Masking these two bits out seems to take care of most or all hangs during initialization.
2019-02-18Shut down ELM327's 'protocol' before reconfiguring CANnorly
According to ELM327's manual, AT PC should be sent before issuing AT PB.
2019-02-18Drop fake bittimings in favor of bitrate tablenorly
The fake bittiming table produces wrong results in Linux 4.19's bitrate based parameter calculation. SocketCAN support for fixed bitrates was introduced in 431af779256c in Jan 2017, and as of Linux 4.18 the only driver using it is mcba_usb. Bitrates are also fixed in ELM327, and none of the other parameters can be tuned, so using this API makes sense here as well.
2019-02-18Improve readability of elm327_handle_prompt()norly
2019-02-18Null stack variables before usenorly
2019-02-18Don't try to send garbage after each init script entrynorly
Previously, we'd try to send the local txbuf even though it had not been written to. Thus strlen() would overrun the buffer, which recent Linux versions catch in a BUG_ON().
2019-01-31Use more netdev_err() instead of pr_err()norly
...and remove a stray comment
2019-01-31Return cleanly in functions calling elm327_hw_failure()norly
2019-01-31Don't reset on HW fault, but take the interface down.norly
There is currently no interface to try again, other than detaching and re-attaching the line discipline. It wouldn't make much sense either, unless we've run into an unexpected state in the ELM327's firmware.
2019-01-30elmcan_ldisc_ioctl(): Use elm->dev->name againnorly
We now have proper locking, so dev->name is guaranteed to exist.
2019-01-30Use netdev_* prints throughoutnorly
2019-01-30Rename elm327_panic() to elm327_hw_failure() to avoid confusionnorly
2019-01-23Handle tty->ops->write() returning errornorly
This was already the case in elmcan_ldisc_tx_worker(), but was missing in elm327_send().
2019-01-23Replace '>' with constant ELM327_READY_CHARnorly
2019-01-23Bump N_ELMCAN to avoid conflicts with future in-tree line disciplines.norly
We can't go higher than 29 because of NR_LDISCS == 30 in Linux 5.0. We can't go lower than 28 because of N_NULL == 27 in Linux 5.0.
2019-01-23Fix race between ldisc_close() and ldisc_*()norly
There was a chance that something needed the elm object after it was freed. Proper locking stops this.
2019-01-23Avoid ldisc_ioctl() racing unregister_candev()norly
When getting the CAN interface's name via the SIOCGIFNAME ioctl, elm->dev->name may no longer exist because the interface is being shut down. Also, print the name of the interface to dmesg.
2019-01-19Commentsnorly
2018-11-13Import first public commitnorly