xref: /freebsd/sys/dev/gve/gve_register.h (revision 54dfc97b0bd99f1c3bcbb37357cf28cd81a7cf00)
1*54dfc97bSShailend Chand /*-
2*54dfc97bSShailend Chand  * SPDX-License-Identifier: BSD-3-Clause
3*54dfc97bSShailend Chand  *
4*54dfc97bSShailend Chand  * Copyright (c) 2023 Google LLC
5*54dfc97bSShailend Chand  *
6*54dfc97bSShailend Chand  * Redistribution and use in source and binary forms, with or without modification,
7*54dfc97bSShailend Chand  * are permitted provided that the following conditions are met:
8*54dfc97bSShailend Chand  *
9*54dfc97bSShailend Chand  * 1. Redistributions of source code must retain the above copyright notice, this
10*54dfc97bSShailend Chand  *    list of conditions and the following disclaimer.
11*54dfc97bSShailend Chand  *
12*54dfc97bSShailend Chand  * 2. Redistributions in binary form must reproduce the above copyright notice,
13*54dfc97bSShailend Chand  *    this list of conditions and the following disclaimer in the documentation
14*54dfc97bSShailend Chand  *    and/or other materials provided with the distribution.
15*54dfc97bSShailend Chand  *
16*54dfc97bSShailend Chand  * 3. Neither the name of the copyright holder nor the names of its contributors
17*54dfc97bSShailend Chand  *    may be used to endorse or promote products derived from this software without
18*54dfc97bSShailend Chand  *    specific prior written permission.
19*54dfc97bSShailend Chand  *
20*54dfc97bSShailend Chand  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
21*54dfc97bSShailend Chand  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22*54dfc97bSShailend Chand  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23*54dfc97bSShailend Chand  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
24*54dfc97bSShailend Chand  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25*54dfc97bSShailend Chand  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26*54dfc97bSShailend Chand  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
27*54dfc97bSShailend Chand  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28*54dfc97bSShailend Chand  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29*54dfc97bSShailend Chand  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30*54dfc97bSShailend Chand  */
31*54dfc97bSShailend Chand #ifndef _GVE_REGISTER_H_
32*54dfc97bSShailend Chand #define _GVE_REGISTER_H_
33*54dfc97bSShailend Chand 
34*54dfc97bSShailend Chand /* Fixed Configuration Registers */
35*54dfc97bSShailend Chand #define DEVICE_STATUS 0
36*54dfc97bSShailend Chand #define DRIVER_STATUS 4
37*54dfc97bSShailend Chand #define MAX_TX_QUEUES 8
38*54dfc97bSShailend Chand #define MAX_RX_QUEUES 12
39*54dfc97bSShailend Chand #define ADMINQ_PFN 16
40*54dfc97bSShailend Chand #define ADMINQ_DOORBELL 20
41*54dfc97bSShailend Chand #define ADMINQ_EVENT_COUNTER 24
42*54dfc97bSShailend Chand #define RESERVED 28
43*54dfc97bSShailend Chand #define DRIVER_VERSION 31
44*54dfc97bSShailend Chand #define ADMINQ_BASE_ADDRESS_HI 32
45*54dfc97bSShailend Chand #define ADMINQ_BASE_ADDRESS_LO 36
46*54dfc97bSShailend Chand #define ADMINQ_LENGTH 40
47*54dfc97bSShailend Chand 
48*54dfc97bSShailend Chand 
49*54dfc97bSShailend Chand enum gve_device_status_flags {
50*54dfc97bSShailend Chand 	GVE_DEVICE_STATUS_RESET_MASK		= BIT(1),
51*54dfc97bSShailend Chand 	GVE_DEVICE_STATUS_LINK_STATUS_MASK	= BIT(2),
52*54dfc97bSShailend Chand };
53*54dfc97bSShailend Chand 
54*54dfc97bSShailend Chand #endif /* _GVE_REGISTER_H_ */
55