elmcan.git
5 years agoDon't reset on HW fault, but take the interface down.
norly [Thu, 31 Jan 2019 00:08:15 +0000 (01:08 +0100)]
Don't reset on HW fault, but take the interface down.

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.

5 years agoelmcan_ldisc_ioctl(): Use elm->dev->name again
norly [Thu, 24 Jan 2019 02:44:04 +0000 (03:44 +0100)]
elmcan_ldisc_ioctl(): Use elm->dev->name again

We now have proper locking, so dev->name is guaranteed to exist.

5 years agoUse netdev_* prints throughout
norly [Wed, 23 Jan 2019 16:04:12 +0000 (17:04 +0100)]
Use netdev_* prints throughout

5 years agoRename elm327_panic() to elm327_hw_failure() to avoid confusion
norly [Wed, 23 Jan 2019 15:41:56 +0000 (16:41 +0100)]
Rename elm327_panic() to elm327_hw_failure() to avoid confusion

5 years agoHandle tty->ops->write() returning error
norly [Wed, 23 Jan 2019 15:37:39 +0000 (16:37 +0100)]
Handle tty->ops->write() returning error

This was already the case in elmcan_ldisc_tx_worker(), but was missing
in elm327_send().

5 years agoReplace '>' with constant ELM327_READY_CHAR
norly [Wed, 23 Jan 2019 15:19:18 +0000 (16:19 +0100)]
Replace '>' with constant ELM327_READY_CHAR

5 years agoBump N_ELMCAN to avoid conflicts with future in-tree line disciplines.
norly [Wed, 23 Jan 2019 01:54:41 +0000 (02:54 +0100)]
Bump N_ELMCAN to avoid conflicts with future in-tree line disciplines.

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.

5 years agoFix race between ldisc_close() and ldisc_*()
norly [Wed, 23 Jan 2019 01:39:46 +0000 (02:39 +0100)]
Fix race between ldisc_close() and ldisc_*()

There was a chance that something needed the elm object after it was
freed. Proper locking stops this.

5 years agoAvoid ldisc_ioctl() racing unregister_candev()
norly [Fri, 11 Jan 2019 02:38:35 +0000 (03:38 +0100)]
Avoid ldisc_ioctl() racing unregister_candev()

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.

5 years agoComments
norly [Mon, 7 Jan 2019 02:33:07 +0000 (03:33 +0100)]
Comments

5 years agoImport first public commit
norly [Tue, 13 Nov 2018 22:38:17 +0000 (23:38 +0100)]
Import first public commit

5 years agoInitial commit
norly [Tue, 13 Nov 2018 22:38:01 +0000 (23:38 +0100)]
Initial commit