File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -127,7 +127,15 @@ struct rx_msg {
127
127
u8 dlc ;
128
128
__le32 ts ;
129
129
__le32 id ; /* upper 3 bits contain flags */
130
- u8 data [8 ];
130
+ union {
131
+ u8 data [8 ];
132
+ struct {
133
+ u8 status ; /* CAN Controller Status */
134
+ u8 ecc ; /* Error Capture Register */
135
+ u8 rec ; /* RX Error Counter */
136
+ u8 tec ; /* TX Error Counter */
137
+ } ev_can_err_ext ; /* For ESD_EV_CAN_ERROR_EXT */
138
+ };
131
139
};
132
140
133
141
struct tx_msg {
@@ -229,10 +237,10 @@ static void esd_usb_rx_event(struct esd_usb_net_priv *priv,
229
237
u32 id = le32_to_cpu (msg -> msg .rx .id ) & ESD_IDMASK ;
230
238
231
239
if (id == ESD_EV_CAN_ERROR_EXT ) {
232
- u8 state = msg -> msg .rx .data [ 0 ] ;
233
- u8 ecc = msg -> msg .rx .data [ 1 ] ;
234
- u8 rxerr = msg -> msg .rx .data [ 2 ] ;
235
- u8 txerr = msg -> msg .rx .data [ 3 ] ;
240
+ u8 state = msg -> msg .rx .ev_can_err_ext . status ;
241
+ u8 ecc = msg -> msg .rx .ev_can_err_ext . ecc ;
242
+ u8 rxerr = msg -> msg .rx .ev_can_err_ext . rec ;
243
+ u8 txerr = msg -> msg .rx .ev_can_err_ext . tec ;
236
244
237
245
netdev_dbg (priv -> netdev ,
238
246
"CAN_ERR_EV_EXT: dlc=%#02x state=%02x ecc=%02x rec=%02x tec=%02x\n" ,
You can’t perform that action at this time.
0 commit comments