1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* Copyright (C) 2018-2025, Advanced Micro Devices, Inc. */ 3 4 #ifndef _IONIC_API_H_ 5 #define _IONIC_API_H_ 6 7 #include <linux/auxiliary_bus.h> 8 #include "ionic_if.h" 9 #include "ionic_regs.h" 10 11 /** 12 * struct ionic_aux_dev - Auxiliary device information 13 * @lif: Logical interface 14 * @idx: Index identifier 15 * @adev: Auxiliary device 16 */ 17 struct ionic_aux_dev { 18 struct ionic_lif *lif; 19 int idx; 20 struct auxiliary_device adev; 21 }; 22 23 /** 24 * struct ionic_admin_ctx - Admin command context 25 * @work: Work completion wait queue element 26 * @cmd: Admin command (64B) to be copied to the queue 27 * @comp: Admin completion (16B) copied from the queue 28 */ 29 struct ionic_admin_ctx { 30 struct completion work; 31 union ionic_adminq_cmd cmd; 32 union ionic_adminq_comp comp; 33 }; 34 35 /** 36 * ionic_adminq_post_wait - Post an admin command and wait for response 37 * @lif: Logical interface 38 * @ctx: API admin command context 39 * 40 * Post the command to an admin queue in the ethernet driver. If this command 41 * succeeds, then the command has been posted, but that does not indicate a 42 * completion. If this command returns success, then the completion callback 43 * will eventually be called. 44 * 45 * Return: zero or negative error status 46 */ 47 int ionic_adminq_post_wait(struct ionic_lif *lif, struct ionic_admin_ctx *ctx); 48 49 /** 50 * ionic_error_to_errno - Transform ionic_if errors to os errno 51 * @code: Ionic error number 52 * 53 * Return: Negative OS error number or zero 54 */ 55 int ionic_error_to_errno(enum ionic_status_code code); 56 57 #endif /* _IONIC_API_H_ */ 58