WIP FPC-III support
[linux/fpc-iii.git] / drivers / net / ethernet / qlogic / qed / qed_init_ops.h
bloba573c892198204881d478fb11dafcd2d7691a4fe
1 /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
2 /* QLogic qed NIC Driver
3 * Copyright (c) 2015-2017 QLogic Corporation
4 * Copyright (c) 2019-2020 Marvell International Ltd.
5 */
7 #ifndef _QED_INIT_OPS_H
8 #define _QED_INIT_OPS_H
10 #include <linux/types.h>
11 #include <linux/slab.h>
12 #include "qed.h"
14 /**
15 * @brief qed_init_iro_array - init iro_arr.
18 * @param cdev
20 void qed_init_iro_array(struct qed_dev *cdev);
22 /**
23 * @brief qed_init_run - Run the init-sequence.
26 * @param p_hwfn
27 * @param p_ptt
28 * @param phase
29 * @param phase_id
30 * @param modes
31 * @return _qed_status_t
33 int qed_init_run(struct qed_hwfn *p_hwfn,
34 struct qed_ptt *p_ptt,
35 int phase,
36 int phase_id,
37 int modes);
39 /**
40 * @brief qed_init_hwfn_allocate - Allocate RT array, Store 'values' ptrs.
43 * @param p_hwfn
45 * @return _qed_status_t
47 int qed_init_alloc(struct qed_hwfn *p_hwfn);
49 /**
50 * @brief qed_init_hwfn_deallocate
53 * @param p_hwfn
55 void qed_init_free(struct qed_hwfn *p_hwfn);
57 /**
58 * @brief qed_init_store_rt_reg - Store a configuration value in the RT array.
61 * @param p_hwfn
62 * @param rt_offset
63 * @param val
65 void qed_init_store_rt_reg(struct qed_hwfn *p_hwfn,
66 u32 rt_offset,
67 u32 val);
69 #define STORE_RT_REG(hwfn, offset, val) \
70 qed_init_store_rt_reg(hwfn, offset, val)
72 #define OVERWRITE_RT_REG(hwfn, offset, val) \
73 qed_init_store_rt_reg(hwfn, offset, val)
75 /**
76 * @brief
79 * @param p_hwfn
80 * @param rt_offset
81 * @param val
82 * @param size
84 void qed_init_store_rt_agg(struct qed_hwfn *p_hwfn,
85 u32 rt_offset,
86 u32 *val,
87 size_t size);
89 #define STORE_RT_REG_AGG(hwfn, offset, val) \
90 qed_init_store_rt_agg(hwfn, offset, (u32 *)&val, sizeof(val))
92 /**
93 * @brief
94 * Initialize GTT global windows and set admin window
95 * related params of GTT/PTT to default values.
97 * @param p_hwfn
99 void qed_gtt_init(struct qed_hwfn *p_hwfn);
100 #endif