can: sja1000: Fix error location forwarding
PATCH 1/1 can: sja1000: Fix error location forwarding
According to SJA1000 documentation the location of error is available regardless of an error type. Therefore it should always be forwarded to SocketCAN.
--- drivers/net/can/sja1000/sja1000.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/can/sja1000/sja1000.c +5 -1
@@ -438,6 +438,7 @@ static int sja1000_err(struct net_device *dev, uint8_t isrc, uint8_t status) cf->can_id |=CAN_ERR_PROT |CAN_ERR_BUSERROR ; +/* set error type */ switch (ecc &ECC_MASK ) {case ECC_BIT : cf->data[2 ] |=CAN_ERR_PROT_BIT ;
@@ -449,9 +450,12 @@ static int sja1000_err(struct net_device *dev, uint8_t isrc, uint8_t status) cf->data[2 ] |=CAN_ERR_PROT_STUFF ;break ;default : - cf->data[3 ] = ecc &ECC_SEG ;break ; } + +/* set error location */ + cf->data[3 ] = ecc &ECC_SEG ; +/* Error occurred during transmission? */ if ((ecc &ECC_DIR ) ==0 ) cf->data[2 ] |=CAN_ERR_PROT_TX ;
Signature · 11 lines
2.1.4 -- Best regards, Alexander Gerasiov Contacts: e-mail: [email protected] Homepage: http://gerasiov.net Skype: gerasiov PGP fingerprint: 04B5 9D90 DF7C C2AB CD49 BAEA CA87 E9E8 2AAC 33F1
Hello Alexander,
you are right. Thanks for the fix.
Quoted 6 lines · Alexander Gerasiov
According to SJA1000 documentation the location of error is available regardless of an error type. Therefore it should always be forwarded to SocketCAN.
Signed-off-by Nikita Edward Baruzdin <[email protected]>Signed-off-by Alexander GQ Gerasiov <[email protected]>
Best regards,
Oliver
Quoted 31 lines
--- drivers/net/can/sja1000/sja1000.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/net/can/sja1000/sja1000.c +5
-1@@ -438,6 +438,7 @@ static int sja1000_err(struct net_device *dev, uint8_t isrc, uint8_t status) cf->can_id |=CAN_ERR_PROT |CAN_ERR_BUSERROR ; +/* set error type */ switch (ecc &ECC_MASK ) {case ECC_BIT : cf->data[2 ] |=CAN_ERR_PROT_BIT ;@@ -449,9 +450,12 @@ static int sja1000_err(struct net_device *dev, uint8_t isrc, uint8_t status) cf->data[2 ] |=CAN_ERR_PROT_STUFF ;break ;default : - cf->data[3 ] = ecc &ECC_SEG ;break ; } + +/* set error location */ + cf->data[3 ] = ecc &ECC_SEG ; +/* Error occurred during transmission? */ if ((ecc &ECC_DIR ) ==0 ) cf->data[2 ] |=CAN_ERR_PROT_TX ;
Quoted 6 lines · Alexander Gerasiov
According to SJA1000 documentation the location of error is available regardless of an error type. Therefore it should always be forwarded to SocketCAN.
Signed-off-by Nikita Edward Baruzdin <[email protected]>Signed-off-by Alexander GQ Gerasiov <[email protected]>
Applied to can-next/master. Please use git send-email to send your patches, your mailer converted tabs to spaces.
Tnx,
Marc
Signature · 4 lines
Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
Hi Marc,
Quoted 2 lines · Marc Kleine-Budde
Applied to can-next/master. Please use git send-email to send your patches, your mailer converted tabs to spaces.
can you please push the can[-next] changes so that they become visible.
Tnx,
Oliver
Marc Kleine-Budde
maintainerQuoted 8 lines · Oliver Hartkopp
Hi Marc,
Quoted 2 lines · Marc Kleine-Budde
Applied to can-next/master. Please use git send-email to send your patches, your mailer converted tabs to spaces.
can you please push the can[-next] changes so that they become visible.
Done. All pending changes are on can-next/testing.
Marc
Signature · 4 lines
Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |