@@ -105,7 +105,7 @@ static void modem_backend_uart_async_hwfc_rx_recovery(struct modem_backend_uart
105
105
}
106
106
}
107
107
108
- static bool modem_backend_uart_async_hwfc_is_uart_stopped (struct modem_backend_uart * backend )
108
+ static bool modem_backend_uart_async_hwfc_is_uart_stopped (const struct modem_backend_uart * backend )
109
109
{
110
110
if (!atomic_test_bit (& backend -> async .common .state ,
111
111
MODEM_BACKEND_UART_ASYNC_STATE_OPEN_BIT ) &&
@@ -119,7 +119,7 @@ static bool modem_backend_uart_async_hwfc_is_uart_stopped(struct modem_backend_u
119
119
return false;
120
120
}
121
121
122
- static bool modem_backend_uart_async_hwfc_is_open (struct modem_backend_uart * backend )
122
+ static bool modem_backend_uart_async_hwfc_is_open (const struct modem_backend_uart * backend )
123
123
{
124
124
return atomic_test_bit (& backend -> async .common .state ,
125
125
MODEM_BACKEND_UART_ASYNC_STATE_OPEN_BIT );
@@ -253,7 +253,7 @@ static void advertise_receive_buf_stats(struct modem_backend_uart *backend, uint
253
253
}
254
254
#endif
255
255
256
- static uint32_t get_transmit_buf_size (struct modem_backend_uart * backend )
256
+ static uint32_t get_transmit_buf_size (const struct modem_backend_uart * backend )
257
257
{
258
258
return backend -> async .common .transmit_buf_size ;
259
259
}
@@ -411,6 +411,10 @@ int modem_backend_uart_async_init(struct modem_backend_uart *backend,
411
411
412
412
backend -> async .rx_buf_count = CONFIG_MODEM_BACKEND_UART_ASYNC_HWFC_BUFFER_COUNT ;
413
413
414
+ /* k_mem_slab_init requires a word-aligned buffer. */
415
+ __ASSERT ((uintptr_t )config -> receive_buf % sizeof (void * ) == 0 ,
416
+ "Receive buffer is not word-aligned" );
417
+
414
418
/* Make sure all the buffers will be aligned. */
415
419
buf_size -= (config -> receive_buf_size % (sizeof (uint32_t ) * backend -> async .rx_buf_count ));
416
420
backend -> async .rx_buf_size = buf_size / backend -> async .rx_buf_count ;
0 commit comments