Lines Matching full:alloc
172 int alloc = -ENOSPC; in can_nxp_s32_get_rx_fifo_filter() local
184 alloc = filter_id; in can_nxp_s32_get_rx_fifo_filter()
189 return alloc; in can_nxp_s32_get_rx_fifo_filter()
226 int alloc; in can_nxp_s32_stop() local
236 for (alloc = 0; alloc < CONFIG_CAN_NXP_S32_MAX_TX; alloc++) { in can_nxp_s32_stop()
237 function = data->tx_cbs[alloc].function; in can_nxp_s32_stop()
238 arg = data->tx_cbs[alloc].arg; in can_nxp_s32_stop()
240 if (atomic_test_and_clear_bit(data->tx_allocs, alloc)) { in can_nxp_s32_stop()
242 ALLOC_IDX_TO_TXMB_IDX(alloc))) { in can_nxp_s32_stop()
492 int alloc = -ENOSPC; in can_nxp_s32_add_rx_filter() local
506 alloc = i; in can_nxp_s32_add_rx_filter()
511 if (alloc == -ENOSPC) { in can_nxp_s32_add_rx_filter()
516 data->rx_cbs[alloc].function = callback; in can_nxp_s32_add_rx_filter()
517 data->rx_cbs[alloc].arg = user_data; in can_nxp_s32_add_rx_filter()
518 data->rx_cbs[alloc].filter = *filter; in can_nxp_s32_add_rx_filter()
521 mb_indx = ALLOC_IDX_TO_RXMB_IDX(alloc); in can_nxp_s32_add_rx_filter()
549 data->rx_cbs[alloc].rx_info = (Canexcel_Ip_DataInfoType) { in can_nxp_s32_add_rx_filter()
557 data->rx_cbs[alloc].rx_info.frame, mask); in can_nxp_s32_add_rx_filter()
560 &data->rx_cbs[alloc].rx_info); in can_nxp_s32_add_rx_filter()
562 Canexcel_Ip_ReceiveFD(config->instance, mb_indx, &data->rx_msg[alloc], FALSE); in can_nxp_s32_add_rx_filter()
570 return alloc; in can_nxp_s32_add_rx_filter()
583 int alloc, mb_indx; in can_nxp_s32_send() local
643 for (alloc = 0; alloc < CONFIG_CAN_NXP_S32_MAX_TX; alloc++) { in can_nxp_s32_send()
644 if (!atomic_test_and_set_bit(data->tx_allocs, alloc)) { in can_nxp_s32_send()
649 data->tx_cbs[alloc].function = callback; in can_nxp_s32_send()
650 data->tx_cbs[alloc].arg = user_data; in can_nxp_s32_send()
651 mb_indx = ALLOC_IDX_TO_TXMB_IDX(alloc); in can_nxp_s32_send()
652 data->tx_cbs[alloc].tx_info = (Canexcel_Ip_DataInfoType) { in can_nxp_s32_send()
677 status = Canexcel_Ip_SendFDMsg(config->instance, mb_indx, &data->tx_cbs[alloc].tx_info, in can_nxp_s32_send()
678 frame->id, (uint8_t *)&frame->data, &data->tx_msg[alloc]); in can_nxp_s32_send()
756 int alloc; in can_nxp_s32_err_callback() local
814 for (alloc = 0; alloc < CONFIG_CAN_NXP_S32_MAX_TX; alloc++) { in can_nxp_s32_err_callback()
816 function = data->tx_cbs[alloc].function; in can_nxp_s32_err_callback()
817 arg = data->tx_cbs[alloc].arg; in can_nxp_s32_err_callback()
819 if (atomic_test_and_clear_bit(data->tx_allocs, alloc)) { in can_nxp_s32_err_callback()
821 ALLOC_IDX_TO_TXMB_IDX(alloc))) { in can_nxp_s32_err_callback()
879 int alloc; in can_nxp_s32_ctrl_callback() local
882 alloc = TX_MBIDX_TO_ALLOC_IDX(buffidx); in can_nxp_s32_ctrl_callback()
883 tx_func = data->tx_cbs[alloc].function; in can_nxp_s32_ctrl_callback()
885 if (atomic_test_and_clear_bit(data->tx_allocs, alloc)) { in can_nxp_s32_ctrl_callback()
886 tx_func(dev, 0, data->tx_cbs[alloc].arg); in can_nxp_s32_ctrl_callback()
896 alloc = can_nxp_s32_get_rx_fifo_filter(data, queue_idx); in can_nxp_s32_ctrl_callback()
898 if (alloc != -ENOSPC) { in can_nxp_s32_ctrl_callback()
899 rx_func = data->rx_cbs[alloc].function; in can_nxp_s32_ctrl_callback()
900 if (atomic_test_bit(data->rx_allocs, alloc)) { in can_nxp_s32_ctrl_callback()
907 alloc, frame.id, in can_nxp_s32_ctrl_callback()
914 rx_func(dev, &frame, data->rx_cbs[alloc].arg); in can_nxp_s32_ctrl_callback()
922 alloc = RX_MBIDX_TO_ALLOC_IDX(buffidx); in can_nxp_s32_ctrl_callback()
923 rx_func = data->rx_cbs[alloc].function; in can_nxp_s32_ctrl_callback()
924 if (atomic_test_bit(data->rx_allocs, alloc)) { in can_nxp_s32_ctrl_callback()
925 nxp_s32_msg_data_to_zcan_frame(data->rx_msg[alloc], &frame); in can_nxp_s32_ctrl_callback()
938 rx_func(dev, &frame, data->rx_cbs[alloc].arg); in can_nxp_s32_ctrl_callback()
941 &data->rx_msg[alloc], FALSE) != CANEXCEL_STATUS_SUCCESS) { in can_nxp_s32_ctrl_callback()