@@ -91,7 +91,7 @@ struct gsm_mux {
91
91
uint16_t msg_len ; /* message length */
92
92
uint16_t received ; /* bytes so far received */
93
93
94
- struct k_delayed_work t2_timer ;
94
+ struct k_work_delayable t2_timer ;
95
95
sys_slist_t pending_ctrls ;
96
96
97
97
uint16_t t1_timeout_value ; /* T1 default value */
@@ -169,7 +169,7 @@ static struct gsm_mux muxes[CONFIG_GSM_MUX_MAX];
169
169
static struct gsm_dlci dlcis [CONFIG_GSM_MUX_DLCI_MAX ];
170
170
static sys_slist_t dlci_free_entries ;
171
171
static sys_slist_t dlci_active_t1_timers ;
172
- static struct k_delayed_work t1_timer ;
172
+ static struct k_work_delayable t1_timer ;
173
173
174
174
static struct gsm_control_msg ctrls [CONFIG_GSM_MUX_PENDING_CMD_MAX ];
175
175
static sys_slist_t ctrls_free_entries ;
@@ -454,9 +454,7 @@ static void dlci_run_timer(uint32_t current_time)
454
454
struct gsm_dlci * dlci , * next ;
455
455
uint32_t new_timer = UINT_MAX ;
456
456
457
- if (k_delayed_work_remaining_get (& t1_timer )) {
458
- k_delayed_work_cancel (& t1_timer );
459
- }
457
+ (void )k_work_cancel_delayable (& t1_timer );
460
458
461
459
SYS_SLIST_FOR_EACH_CONTAINER_SAFE (& dlci_active_t1_timers ,
462
460
dlci , next , node ) {
@@ -467,7 +465,7 @@ static void dlci_run_timer(uint32_t current_time)
467
465
}
468
466
469
467
if (new_timer != UINT_MAX ) {
470
- k_delayed_work_submit (& t1_timer , K_MSEC (new_timer ));
468
+ k_work_reschedule (& t1_timer , K_MSEC (new_timer ));
471
469
}
472
470
}
473
471
@@ -631,9 +629,9 @@ static void gsm_mux_t2_timeout(struct k_work *work)
631
629
}
632
630
633
631
if (entry ) {
634
- k_delayed_work_submit ( & mux -> t2_timer ,
635
- K_MSEC ( entry -> req_start + T2_MSEC -
636
- current_time ));
632
+ k_work_reschedule (
633
+ & mux -> t2_timer ,
634
+ K_MSEC ( entry -> req_start + T2_MSEC - current_time ));
637
635
}
638
636
}
639
637
@@ -674,8 +672,8 @@ static int gsm_mux_send_control_message(struct gsm_mux *mux, uint8_t dlci_addres
674
672
ctrl -> req_start = k_uptime_get_32 ();
675
673
676
674
/* Let's start the timer if necessary */
677
- if (!k_delayed_work_remaining_get (& mux -> t2_timer )) {
678
- k_delayed_work_submit (& mux -> t2_timer , K_MSEC (T2_MSEC ));
675
+ if (!k_work_delayable_remaining_get (& mux -> t2_timer )) {
676
+ k_work_reschedule (& mux -> t2_timer , K_MSEC (T2_MSEC ));
679
677
}
680
678
681
679
return gsm_mux_modem_send (mux , buf -> data , buf -> len );
@@ -692,9 +690,9 @@ static int gsm_dlci_opening_or_closing(struct gsm_dlci *dlci,
692
690
dlci -> command_cb = cb ;
693
691
694
692
/* Let's start the timer if necessary */
695
- if (!k_delayed_work_remaining_get (& t1_timer )) {
696
- k_delayed_work_submit (& t1_timer ,
697
- K_MSEC (dlci -> mux -> t1_timeout_value ));
693
+ if (!k_work_delayable_remaining_get (& t1_timer )) {
694
+ k_work_reschedule (& t1_timer ,
695
+ K_MSEC (dlci -> mux -> t1_timeout_value ));
698
696
}
699
697
700
698
sys_slist_append (& dlci_active_t1_timers , & dlci -> node );
@@ -739,7 +737,7 @@ int gsm_mux_disconnect(struct gsm_mux *mux, k_timeout_t timeout)
739
737
(void )gsm_mux_send_control_message (dlci -> mux , dlci -> num ,
740
738
CMD_CLD , NULL , 0 );
741
739
742
- k_delayed_work_cancel (& mux -> t2_timer );
740
+ ( void ) k_work_cancel_delayable (& mux -> t2_timer );
743
741
744
742
(void )gsm_dlci_closing (dlci , NULL );
745
743
@@ -1474,7 +1472,7 @@ struct gsm_mux *gsm_mux_create(const struct device *uart)
1474
1472
mux -> state = GSM_MUX_SOF ;
1475
1473
mux -> buf = NULL ;
1476
1474
1477
- k_delayed_work_init (& mux -> t2_timer , gsm_mux_t2_timeout );
1475
+ k_work_init_delayable (& mux -> t2_timer , gsm_mux_t2_timeout );
1478
1476
sys_slist_init (& mux -> pending_ctrls );
1479
1477
1480
1478
/* The system will continue after the control DLCI is
@@ -1538,5 +1536,5 @@ void gsm_mux_init(void)
1538
1536
sys_slist_prepend (& dlci_free_entries , & dlcis [i ].node );
1539
1537
}
1540
1538
1541
- k_delayed_work_init (& t1_timer , dlci_t1_timeout );
1539
+ k_work_init_delayable (& t1_timer , dlci_t1_timeout );
1542
1540
}
0 commit comments