@@ -199,7 +199,7 @@ static void timestamp_setup(void)
199
199
net_if_call_timestamp_cb (pkt );
200
200
201
201
zassert_true (timestamp_cb_called , "Timestamp callback not called\n" );
202
- zassert_equal (pkt -> ref , 0 , "Pkt %p not released\n" );
202
+ zassert_equal (atomic_get ( & pkt -> atomic_ref ) , 0 , "Pkt %p not released\n" );
203
203
}
204
204
205
205
static void timestamp_callback_2 (struct net_pkt * pkt )
@@ -246,7 +246,7 @@ static void timestamp_setup_2nd_iface(void)
246
246
net_if_call_timestamp_cb (pkt );
247
247
248
248
zassert_true (timestamp_cb_called , "Timestamp callback not called\n" );
249
- zassert_equal (pkt -> ref , 0 , "Pkt %p not released\n" );
249
+ zassert_equal (atomic_get ( & pkt -> atomic_ref ) , 0 , "Pkt %p not released\n" );
250
250
}
251
251
252
252
static void timestamp_setup_all (void )
@@ -272,7 +272,7 @@ static void timestamp_setup_all(void)
272
272
net_if_call_timestamp_cb (pkt );
273
273
274
274
zassert_true (timestamp_cb_called , "Timestamp callback not called\n" );
275
- zassert_equal (pkt -> ref , 0 , "Pkt %p not released\n" );
275
+ zassert_equal (atomic_get ( & pkt -> atomic_ref ) , 0 , "Pkt %p not released\n" );
276
276
277
277
net_if_unregister_timestamp_cb (& timestamp_cb_3 );
278
278
}
@@ -297,7 +297,7 @@ static void timestamp_cleanup(void)
297
297
net_if_call_timestamp_cb (pkt );
298
298
299
299
zassert_false (timestamp_cb_called , "Timestamp callback called\n" );
300
- zassert_false (pkt -> ref < 1 , "Pkt %p released\n" );
300
+ zassert_false (atomic_get ( & pkt -> atomic_ref ) < 1 , "Pkt %p released\n" );
301
301
302
302
net_pkt_unref (pkt );
303
303
}
@@ -502,8 +502,9 @@ static void check_timestamp_before_enabling(void)
502
502
* should have unreffed the packet by now so the ref count
503
503
* should be zero now.
504
504
*/
505
- zassert_equal (pkt -> ref , 0 , "packet %p was not released (ref %d)\n" ,
506
- pkt , pkt -> ref );
505
+ zassert_equal (atomic_get (& pkt -> atomic_ref ), 0 ,
506
+ "packet %p was not released (ref %d)\n" ,
507
+ pkt , atomic_get (& pkt -> atomic_ref ));
507
508
}
508
509
509
510
static void check_timestamp_after_enabling (void )
@@ -524,8 +525,9 @@ static void check_timestamp_after_enabling(void)
524
525
* and timestamp_cb() should have unreffed the packet by now so
525
526
* the ref count should be zero at this point.
526
527
*/
527
- zassert_equal (pkt -> ref , 0 , "packet %p was not released (ref %d)\n" ,
528
- pkt , pkt -> ref );
528
+ zassert_equal (atomic_get (& pkt -> atomic_ref ), 0 ,
529
+ "packet %p was not released (ref %d)\n" ,
530
+ pkt , atomic_get (& pkt -> atomic_ref ));
529
531
}
530
532
531
533
void test_main (void )
0 commit comments