diff options
Diffstat (limited to 'kernel/ethosu_inference.h')
-rw-r--r-- | kernel/ethosu_inference.h | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/kernel/ethosu_inference.h b/kernel/ethosu_inference.h index a41043a..66d4ff9 100644 --- a/kernel/ethosu_inference.h +++ b/kernel/ethosu_inference.h @@ -25,6 +25,7 @@ * Includes ****************************************************************************/ +#include "ethosu_mailbox.h" #include "uapi/ethosu.h" #include <linux/kref.h> @@ -48,10 +49,10 @@ struct file; * @file: File handle * @kref: Reference counter * @waitq: Wait queue + * @done: Wait condition is done * @ifm: Pointer to IFM buffer * @ofm: Pointer to OFM buffer * @net: Pointer to network - * @pending: Pending response from the firmware * @status: Inference status * @pmu_event_config: PMU event configuration * @pmu_event_count: PMU event count after inference @@ -59,22 +60,22 @@ struct file; * @pmu_cycle_counter_count: PMU cycle counter count after inference */ struct ethosu_inference { - struct ethosu_device *edev; - struct file *file; - struct kref kref; - wait_queue_head_t waitq; - uint32_t ifm_count; - struct ethosu_buffer *ifm[ETHOSU_FD_MAX]; - uint32_t ofm_count; - struct ethosu_buffer *ofm[ETHOSU_FD_MAX]; - struct ethosu_network *net; - bool pending; - enum ethosu_uapi_status status; - uint8_t pmu_event_config[ETHOSU_PMU_EVENT_MAX]; - uint32_t pmu_event_count[ETHOSU_PMU_EVENT_MAX]; - uint32_t pmu_cycle_counter_enable; - uint64_t pmu_cycle_counter_count; - struct list_head list; + struct ethosu_device *edev; + struct file *file; + struct kref kref; + wait_queue_head_t waitq; + bool done; + uint32_t ifm_count; + struct ethosu_buffer *ifm[ETHOSU_FD_MAX]; + uint32_t ofm_count; + struct ethosu_buffer *ofm[ETHOSU_FD_MAX]; + struct ethosu_network *net; + enum ethosu_uapi_status status; + uint8_t pmu_event_config[ETHOSU_PMU_EVENT_MAX]; + uint32_t pmu_event_count[ETHOSU_PMU_EVENT_MAX]; + uint32_t pmu_cycle_counter_enable; + uint64_t pmu_cycle_counter_count; + struct ethosu_mailbox_msg msg; }; /**************************************************************************** @@ -108,8 +109,10 @@ void ethosu_inference_get(struct ethosu_inference *inf); /** * ethosu_inference_put() - Put inference + * + * Return: 1 if object was removed, else 0. */ -void ethosu_inference_put(struct ethosu_inference *inf); +int ethosu_inference_put(struct ethosu_inference *inf); /** * ethosu_inference_rsp() - Handle inference response |