@@ -52,7 +52,7 @@ static void modem_iface_uart_isr(const struct device *uart_dev,
5252{
5353 struct modem_context * ctx ;
5454 struct modem_iface_uart_data * data ;
55- int rx = 0 , ret ;
55+ int rx = 0 ;
5656 uint8_t * dst ;
5757 uint32_t partial_size = 0 ;
5858 uint32_t total_size = 0 ;
@@ -70,8 +70,7 @@ static void modem_iface_uart_isr(const struct device *uart_dev,
7070 while (uart_irq_update (ctx -> iface .dev ) &&
7171 uart_irq_rx_ready (ctx -> iface .dev )) {
7272 if (!partial_size ) {
73- partial_size = ring_buf_put_claim (& data -> rx_rb , & dst ,
74- UINT32_MAX );
73+ partial_size = ring_buffer_write_ptr (& data -> rx_rb , & dst );
7574 }
7675 if (!partial_size ) {
7776 if (data -> hw_flow_control ) {
@@ -93,8 +92,7 @@ static void modem_iface_uart_isr(const struct device *uart_dev,
9392 partial_size -= rx ;
9493 }
9594
96- ret = ring_buf_put_finish (& data -> rx_rb , total_size );
97- __ASSERT_NO_MSG (ret == 0 );
95+ ring_buffer_commit (& data -> rx_rb , total_size );
9896
9997 if (total_size > 0 ) {
10098 k_sem_give (& data -> rx_sem );
@@ -116,7 +114,7 @@ static int modem_iface_uart_read(struct modem_iface *iface,
116114 }
117115
118116 data = (struct modem_iface_uart_data * )(iface -> iface_data );
119- * bytes_read = ring_buf_get (& data -> rx_rb , buf , size );
117+ * bytes_read = ring_buffer_read (& data -> rx_rb , buf , size );
120118
121119 if (data -> hw_flow_control && * bytes_read == 0 ) {
122120 uart_irq_rx_enable (iface -> dev );
@@ -190,7 +188,7 @@ int modem_iface_uart_init(struct modem_iface *iface, struct modem_iface_uart_dat
190188 iface -> read = modem_iface_uart_read ;
191189 iface -> write = modem_iface_uart_write ;
192190
193- ring_buf_init (& data -> rx_rb , config -> rx_rb_buf_len , config -> rx_rb_buf );
191+ ring_buffer_init (& data -> rx_rb , config -> rx_rb_buf , config -> rx_rb_buf_len );
194192 k_sem_init (& data -> rx_sem , 0 , 1 );
195193
196194 /* Configure hardware flow control */
0 commit comments