Imported Upstream version 16.07-rc1
[deb_dpdk.git] / drivers / net / qede / base / ecore_l2.h
1 /*
2  * Copyright (c) 2016 QLogic Corporation.
3  * All rights reserved.
4  * www.qlogic.com
5  *
6  * See LICENSE.qede_pmd for copyright and licensing details.
7  */
8
9 #ifndef __ECORE_L2_H__
10 #define __ECORE_L2_H__
11
12 #include "ecore.h"
13 #include "ecore_hw.h"
14 #include "ecore_spq.h"
15 #include "ecore_l2_api.h"
16
17 /**
18  * @brief ecore_sp_vf_start -  VF Function Start
19  *
20  * This ramrod is sent to initialize a virtual function (VF) is loaded.
21  * It will configure the function related parameters.
22  *
23  * @note Final phase API.
24  *
25  * @param p_hwfn
26  * @param concrete_vfid                         VF ID
27  * @param opaque_vfid
28  *
29  * @return enum _ecore_status_t
30  */
31
32 enum _ecore_status_t ecore_sp_vf_start(struct ecore_hwfn *p_hwfn,
33                                        u32 concrete_vfid, u16 opaque_vfid);
34
35 /**
36  * @brief ecore_sp_vf_update - VF Function Update Ramrod
37  *
38  * This ramrod performs updates of a virtual function (VF).
39  * It currently contains no functionality.
40  *
41  * @note Final phase API.
42  *
43  * @param p_hwfn
44  *
45  * @return enum _ecore_status_t
46  */
47
48 enum _ecore_status_t ecore_sp_vf_update(struct ecore_hwfn *p_hwfn);
49
50 /**
51  * @brief ecore_sp_vf_stop - VF Function Stop Ramrod
52  *
53  * This ramrod is sent to unload a virtual function (VF).
54  *
55  * @note Final phase API.
56  *
57  * @param p_hwfn
58  * @param concrete_vfid
59  * @param opaque_vfid
60  *
61  * @return enum _ecore_status_t
62  */
63
64 enum _ecore_status_t ecore_sp_vf_stop(struct ecore_hwfn *p_hwfn,
65                                       u32 concrete_vfid, u16 opaque_vfid);
66
67 /**
68  * @brief ecore_sp_eth_tx_queue_update -
69  *
70  * This ramrod updates a TX queue. It is used for setting the active
71  * state of the queue.
72  *
73  * @note Final phase API.
74  *
75  * @param p_hwfn
76  *
77  * @return enum _ecore_status_t
78  */
79 enum _ecore_status_t ecore_sp_eth_tx_queue_update(struct ecore_hwfn *p_hwfn);
80
81 enum _ecore_status_t
82 ecore_sp_eth_vport_start(struct ecore_hwfn *p_hwfn,
83                          struct ecore_sp_vport_start_params *p_params);
84
85 /**
86  * @brief - Starts an Rx queue; Should be used where contexts are handled
87  * outside of the ramrod area [specifically iov scenarios]
88  *
89  * @param p_hwfn
90  * @param opaque_fid
91  * @param cid
92  * @param rx_queue_id
93  * @param vport_id
94  * @param stats_id
95  * @param sb
96  * @param sb_index
97  * @param bd_max_bytes
98  * @param bd_chain_phys_addr
99  * @param cqe_pbl_addr
100  * @param cqe_pbl_size
101  * @param leading
102  *
103  * @return enum _ecore_status_t
104  */
105 enum _ecore_status_t
106 ecore_sp_eth_rxq_start_ramrod(struct ecore_hwfn *p_hwfn,
107                               u16 opaque_fid,
108                               u32 cid,
109                               u16 rx_queue_id,
110                               u8 vport_id,
111                               u8 stats_id,
112                               u16 sb,
113                               u8 sb_index,
114                               u16 bd_max_bytes,
115                               dma_addr_t bd_chain_phys_addr,
116                               dma_addr_t cqe_pbl_addr, u16 cqe_pbl_size);
117
118 /**
119  * @brief - Starts a Tx queue; Should be used where contexts are handled
120  * outside of the ramrod area [specifically iov scenarios]
121  *
122  * @param p_hwfn
123  * @param opaque_fid
124  * @param tx_queue_id
125  * @param cid
126  * @param vport_id
127  * @param stats_id
128  * @param sb
129  * @param sb_index
130  * @param pbl_addr
131  * @param pbl_size
132  * @param p_pq_params - parameters for choosing the PQ for this Tx queue
133  *
134  * @return enum _ecore_status_t
135  */
136 enum _ecore_status_t
137 ecore_sp_eth_txq_start_ramrod(struct ecore_hwfn *p_hwfn,
138                               u16 opaque_fid,
139                               u16 tx_queue_id,
140                               u32 cid,
141                               u8 vport_id,
142                               u8 stats_id,
143                               u16 sb,
144                               u8 sb_index,
145                               dma_addr_t pbl_addr,
146                               u16 pbl_size,
147                               union ecore_qm_pq_params *p_pq_params);
148
149 u8 ecore_mcast_bin_from_mac(u8 *mac);
150
151 #endif