xref: /dpdk/drivers/net/sfc/sfc_ethdev_state.h (revision ac47868976e9fcdd62dcd70718e325ddaa92a644)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  *
3  * Copyright(c) 2019-2021 Xilinx, Inc.
4  * Copyright(c) 2019 Solarflare Communications Inc.
5  *
6  * This software was jointly developed between OKTET Labs (under contract
7  * for Solarflare) and Solarflare Communications, Inc.
8  */
9 
10 #ifndef _SFC_ETHDEV_STATE_H
11 #define _SFC_ETHDEV_STATE_H
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 /*
18  * +---------------+
19  * | UNINITIALIZED |<-----------+
20  * +---------------+		|
21  *	|.eth_dev_init		|.eth_dev_uninit
22  *	V			|
23  * +---------------+------------+
24  * |  INITIALIZED  |
25  * +---------------+<-----------<---------------+
26  *	|.dev_configure		|		|
27  *	V			|failed		|
28  * +---------------+------------+		|
29  * |  CONFIGURING  |				|
30  * +---------------+----+			|
31  *	|success	|			|
32  *	|		|		+---------------+
33  *	|		|		|    CLOSING    |
34  *	|		|		+---------------+
35  *	|		|			^
36  *	V		|.dev_configure		|
37  * +---------------+----+			|.dev_close
38  * |  CONFIGURED   |----------------------------+
39  * +---------------+<-----------+
40  *	|.dev_start		|
41  *	V			|
42  * +---------------+		|
43  * |   STARTING    |------------^
44  * +---------------+ failed	|
45  *	|success		|
46  *	|		+---------------+
47  *	|		|   STOPPING    |
48  *	|		+---------------+
49  *	|			^
50  *	V			|.dev_stop
51  * +---------------+------------+
52  * |    STARTED    |
53  * +---------------+
54  */
55 enum sfc_ethdev_state {
56 	SFC_ETHDEV_UNINITIALIZED = 0,
57 	SFC_ETHDEV_INITIALIZED,
58 	SFC_ETHDEV_CONFIGURING,
59 	SFC_ETHDEV_CONFIGURED,
60 	SFC_ETHDEV_CLOSING,
61 	SFC_ETHDEV_STARTING,
62 	SFC_ETHDEV_STARTED,
63 	SFC_ETHDEV_STOPPING,
64 
65 	SFC_ETHDEV_NSTATES
66 };
67 
68 #ifdef __cplusplus
69 }
70 #endif
71 
72 #endif  /* _SFC_ETHDEV_STATE_H */
73