@@ -141,7 +141,7 @@ static int can_tdc_changelink(struct can_priv *priv, const struct nlattr *nla,
141
141
{
142
142
struct nlattr * tb_tdc [IFLA_CAN_TDC_MAX + 1 ];
143
143
struct can_tdc tdc = { 0 };
144
- const struct can_tdc_const * tdc_const = priv -> tdc_const ;
144
+ const struct can_tdc_const * tdc_const = priv -> fd . tdc_const ;
145
145
int err ;
146
146
147
147
if (!tdc_const || !can_tdc_is_enabled (priv ))
@@ -179,7 +179,7 @@ static int can_tdc_changelink(struct can_priv *priv, const struct nlattr *nla,
179
179
tdc .tdcf = tdcf ;
180
180
}
181
181
182
- priv -> tdc = tdc ;
182
+ priv -> fd . tdc = tdc ;
183
183
184
184
return 0 ;
185
185
}
@@ -228,10 +228,10 @@ static int can_changelink(struct net_device *dev, struct nlattr *tb[],
228
228
dev -> mtu = CANFD_MTU ;
229
229
} else {
230
230
dev -> mtu = CAN_MTU ;
231
- memset (& priv -> data_bittiming , 0 ,
232
- sizeof (priv -> data_bittiming ));
231
+ memset (& priv -> fd . data_bittiming , 0 ,
232
+ sizeof (priv -> fd . data_bittiming ));
233
233
priv -> ctrlmode &= ~CAN_CTRLMODE_TDC_MASK ;
234
- memset (& priv -> tdc , 0 , sizeof (priv -> tdc ));
234
+ memset (& priv -> fd . tdc , 0 , sizeof (priv -> fd . tdc ));
235
235
}
236
236
237
237
tdc_mask = cm -> mask & CAN_CTRLMODE_TDC_MASK ;
@@ -312,16 +312,16 @@ static int can_changelink(struct net_device *dev, struct nlattr *tb[],
312
312
* directly via do_set_bitrate(). Bail out if neither
313
313
* is given.
314
314
*/
315
- if (!priv -> data_bittiming_const && !priv -> do_set_data_bittiming &&
316
- !priv -> data_bitrate_const )
315
+ if (!priv -> fd . data_bittiming_const && !priv -> fd . do_set_data_bittiming &&
316
+ !priv -> fd . data_bitrate_const )
317
317
return - EOPNOTSUPP ;
318
318
319
319
memcpy (& dbt , nla_data (data [IFLA_CAN_DATA_BITTIMING ]),
320
320
sizeof (dbt ));
321
321
err = can_get_bittiming (dev , & dbt ,
322
- priv -> data_bittiming_const ,
323
- priv -> data_bitrate_const ,
324
- priv -> data_bitrate_const_cnt ,
322
+ priv -> fd . data_bittiming_const ,
323
+ priv -> fd . data_bitrate_const ,
324
+ priv -> fd . data_bitrate_const_cnt ,
325
325
extack );
326
326
if (err )
327
327
return err ;
@@ -333,7 +333,7 @@ static int can_changelink(struct net_device *dev, struct nlattr *tb[],
333
333
return - EINVAL ;
334
334
}
335
335
336
- memset (& priv -> tdc , 0 , sizeof (priv -> tdc ));
336
+ memset (& priv -> fd . tdc , 0 , sizeof (priv -> fd . tdc ));
337
337
if (data [IFLA_CAN_TDC ]) {
338
338
/* TDC parameters are provided: use them */
339
339
err = can_tdc_changelink (priv , data [IFLA_CAN_TDC ],
@@ -346,17 +346,17 @@ static int can_changelink(struct net_device *dev, struct nlattr *tb[],
346
346
/* Neither of TDC parameters nor TDC flags are
347
347
* provided: do calculation
348
348
*/
349
- can_calc_tdco (& priv -> tdc , priv -> tdc_const , & dbt ,
349
+ can_calc_tdco (& priv -> fd . tdc , priv -> fd . tdc_const , & dbt ,
350
350
& priv -> ctrlmode , priv -> ctrlmode_supported );
351
351
} /* else: both CAN_CTRLMODE_TDC_{AUTO,MANUAL} are explicitly
352
352
* turned off. TDC is disabled: do nothing
353
353
*/
354
354
355
- memcpy (& priv -> data_bittiming , & dbt , sizeof (dbt ));
355
+ memcpy (& priv -> fd . data_bittiming , & dbt , sizeof (dbt ));
356
356
357
- if (priv -> do_set_data_bittiming ) {
357
+ if (priv -> fd . do_set_data_bittiming ) {
358
358
/* Finally, set the bit-timing registers */
359
- err = priv -> do_set_data_bittiming (dev );
359
+ err = priv -> fd . do_set_data_bittiming (dev );
360
360
if (err )
361
361
return err ;
362
362
}
@@ -394,7 +394,7 @@ static size_t can_tdc_get_size(const struct net_device *dev)
394
394
struct can_priv * priv = netdev_priv (dev );
395
395
size_t size ;
396
396
397
- if (!priv -> tdc_const )
397
+ if (!priv -> fd . tdc_const )
398
398
return 0 ;
399
399
400
400
size = nla_total_size (0 ); /* nest IFLA_CAN_TDC */
@@ -404,17 +404,17 @@ static size_t can_tdc_get_size(const struct net_device *dev)
404
404
}
405
405
size += nla_total_size (sizeof (u32 )); /* IFLA_CAN_TDCO_MIN */
406
406
size += nla_total_size (sizeof (u32 )); /* IFLA_CAN_TDCO_MAX */
407
- if (priv -> tdc_const -> tdcf_max ) {
407
+ if (priv -> fd . tdc_const -> tdcf_max ) {
408
408
size += nla_total_size (sizeof (u32 )); /* IFLA_CAN_TDCF_MIN */
409
409
size += nla_total_size (sizeof (u32 )); /* IFLA_CAN_TDCF_MAX */
410
410
}
411
411
412
412
if (can_tdc_is_enabled (priv )) {
413
413
if (priv -> ctrlmode & CAN_CTRLMODE_TDC_MANUAL ||
414
- priv -> do_get_auto_tdcv )
414
+ priv -> fd . do_get_auto_tdcv )
415
415
size += nla_total_size (sizeof (u32 )); /* IFLA_CAN_TDCV */
416
416
size += nla_total_size (sizeof (u32 )); /* IFLA_CAN_TDCO */
417
- if (priv -> tdc_const -> tdcf_max )
417
+ if (priv -> fd . tdc_const -> tdcf_max )
418
418
size += nla_total_size (sizeof (u32 )); /* IFLA_CAN_TDCF */
419
419
}
420
420
@@ -442,9 +442,9 @@ static size_t can_get_size(const struct net_device *dev)
442
442
size += nla_total_size (sizeof (u32 )); /* IFLA_CAN_RESTART_MS */
443
443
if (priv -> do_get_berr_counter ) /* IFLA_CAN_BERR_COUNTER */
444
444
size += nla_total_size (sizeof (struct can_berr_counter ));
445
- if (priv -> data_bittiming .bitrate ) /* IFLA_CAN_DATA_BITTIMING */
445
+ if (priv -> fd . data_bittiming .bitrate ) /* IFLA_CAN_DATA_BITTIMING */
446
446
size += nla_total_size (sizeof (struct can_bittiming ));
447
- if (priv -> data_bittiming_const ) /* IFLA_CAN_DATA_BITTIMING_CONST */
447
+ if (priv -> fd . data_bittiming_const ) /* IFLA_CAN_DATA_BITTIMING_CONST */
448
448
size += nla_total_size (sizeof (struct can_bittiming_const ));
449
449
if (priv -> termination_const ) {
450
450
size += nla_total_size (sizeof (priv -> termination )); /* IFLA_CAN_TERMINATION */
@@ -454,9 +454,9 @@ static size_t can_get_size(const struct net_device *dev)
454
454
if (priv -> bitrate_const ) /* IFLA_CAN_BITRATE_CONST */
455
455
size += nla_total_size (sizeof (* priv -> bitrate_const ) *
456
456
priv -> bitrate_const_cnt );
457
- if (priv -> data_bitrate_const ) /* IFLA_CAN_DATA_BITRATE_CONST */
458
- size += nla_total_size (sizeof (* priv -> data_bitrate_const ) *
459
- priv -> data_bitrate_const_cnt );
457
+ if (priv -> fd . data_bitrate_const ) /* IFLA_CAN_DATA_BITRATE_CONST */
458
+ size += nla_total_size (sizeof (* priv -> fd . data_bitrate_const ) *
459
+ priv -> fd . data_bitrate_const_cnt );
460
460
size += sizeof (priv -> bitrate_max ); /* IFLA_CAN_BITRATE_MAX */
461
461
size += can_tdc_get_size (dev ); /* IFLA_CAN_TDC */
462
462
size += can_ctrlmode_ext_get_size (); /* IFLA_CAN_CTRLMODE_EXT */
@@ -468,8 +468,8 @@ static int can_tdc_fill_info(struct sk_buff *skb, const struct net_device *dev)
468
468
{
469
469
struct nlattr * nest ;
470
470
struct can_priv * priv = netdev_priv (dev );
471
- struct can_tdc * tdc = & priv -> tdc ;
472
- const struct can_tdc_const * tdc_const = priv -> tdc_const ;
471
+ struct can_tdc * tdc = & priv -> fd . tdc ;
472
+ const struct can_tdc_const * tdc_const = priv -> fd . tdc_const ;
473
473
474
474
if (!tdc_const )
475
475
return 0 ;
@@ -497,8 +497,8 @@ static int can_tdc_fill_info(struct sk_buff *skb, const struct net_device *dev)
497
497
if (priv -> ctrlmode & CAN_CTRLMODE_TDC_MANUAL ) {
498
498
tdcv = tdc -> tdcv ;
499
499
err = 0 ;
500
- } else if (priv -> do_get_auto_tdcv ) {
501
- err = priv -> do_get_auto_tdcv (dev , & tdcv );
500
+ } else if (priv -> fd . do_get_auto_tdcv ) {
501
+ err = priv -> fd . do_get_auto_tdcv (dev , & tdcv );
502
502
}
503
503
if (!err && nla_put_u32 (skb , IFLA_CAN_TDC_TDCV , tdcv ))
504
504
goto err_cancel ;
@@ -564,14 +564,14 @@ static int can_fill_info(struct sk_buff *skb, const struct net_device *dev)
564
564
!priv -> do_get_berr_counter (dev , & bec ) &&
565
565
nla_put (skb , IFLA_CAN_BERR_COUNTER , sizeof (bec ), & bec )) ||
566
566
567
- (priv -> data_bittiming .bitrate &&
567
+ (priv -> fd . data_bittiming .bitrate &&
568
568
nla_put (skb , IFLA_CAN_DATA_BITTIMING ,
569
- sizeof (priv -> data_bittiming ), & priv -> data_bittiming )) ||
569
+ sizeof (priv -> fd . data_bittiming ), & priv -> fd . data_bittiming )) ||
570
570
571
- (priv -> data_bittiming_const &&
571
+ (priv -> fd . data_bittiming_const &&
572
572
nla_put (skb , IFLA_CAN_DATA_BITTIMING_CONST ,
573
- sizeof (* priv -> data_bittiming_const ),
574
- priv -> data_bittiming_const )) ||
573
+ sizeof (* priv -> fd . data_bittiming_const ),
574
+ priv -> fd . data_bittiming_const )) ||
575
575
576
576
(priv -> termination_const &&
577
577
(nla_put_u16 (skb , IFLA_CAN_TERMINATION , priv -> termination ) ||
@@ -586,11 +586,11 @@ static int can_fill_info(struct sk_buff *skb, const struct net_device *dev)
586
586
priv -> bitrate_const_cnt ,
587
587
priv -> bitrate_const )) ||
588
588
589
- (priv -> data_bitrate_const &&
589
+ (priv -> fd . data_bitrate_const &&
590
590
nla_put (skb , IFLA_CAN_DATA_BITRATE_CONST ,
591
- sizeof (* priv -> data_bitrate_const ) *
592
- priv -> data_bitrate_const_cnt ,
593
- priv -> data_bitrate_const )) ||
591
+ sizeof (* priv -> fd . data_bitrate_const ) *
592
+ priv -> fd . data_bitrate_const_cnt ,
593
+ priv -> fd . data_bitrate_const )) ||
594
594
595
595
(nla_put (skb , IFLA_CAN_BITRATE_MAX ,
596
596
sizeof (priv -> bitrate_max ),
0 commit comments