net/qede/base: remove unused parameters
[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
13 #include "ecore.h"
14 #include "ecore_hw.h"
15 #include "ecore_spq.h"
16 #include "ecore_l2_api.h"
17
18 #define MAX_QUEUES_PER_QZONE    (sizeof(unsigned long) * 8)
19 #define ECORE_QUEUE_CID_PF      (0xff)
20
21 /* Almost identical to the ecore_queue_start_common_params,
22  * but here we maintain the SB index in IGU CAM.
23  */
24 struct ecore_queue_cid_params {
25         u8 vport_id;
26         u16 queue_id;
27         u8 stats_id;
28 };
29
30  /* Additional parameters required for initialization of the queue_cid
31  * and are relevant only for a PF initializing one for its VFs.
32  */
33 struct ecore_queue_cid_vf_params {
34         /* Should match the VF's relative index */
35         u8 vfid;
36
37         /* 0-based queue index. Should reflect the relative qzone the
38          * VF thinks is associated with it [in its range].
39          */
40         u8 vf_qid;
41
42         /* Indicates a VF is legacy, making it differ in several things:
43          *  - Producers would be placed in a different place.
44          *  - Makes assumptions regarding the CIDs.
45          */
46         u8 vf_legacy;
47
48         /* For VFs, this index arrives via TLV to diffrentiate between
49          * different queues opened on the same qzone, and is passed
50          * [where the PF would have allocated it internally for its own].
51          */
52         u8 qid_usage_idx;
53 };
54
55 struct ecore_queue_cid {
56         /* For stats-id, the `rel' is actually absolute as well */
57         struct ecore_queue_cid_params rel;
58         struct ecore_queue_cid_params abs;
59
60         /* These have no 'relative' meaning */
61         u16 sb_igu_id;
62         u8 sb_idx;
63
64         u32 cid;
65         u16 opaque_fid;
66
67         /* VFs queues are mapped differently, so we need to know the
68          * relative queue associated with them [0-based].
69          * Notice this is relevant on the *PF* queue-cid of its VF's queues,
70          * and not on the VF itself.
71          */
72         u8 vfid;
73         u8 vf_qid;
74
75         /* We need an additional index to diffrentiate between queues opened
76          * for same queue-zone, as VFs would have to communicate the info
77          * to the PF [otherwise PF has no way to diffrentiate].
78          */
79         u8 qid_usage_idx;
80
81         /* Legacy VFs might have Rx producer located elsewhere */
82         u8 vf_legacy;
83 #define ECORE_QCID_LEGACY_VF_RX_PROD    (1 << 0)
84 #define ECORE_QCID_LEGACY_VF_CID        (1 << 1)
85
86         struct ecore_hwfn *p_owner;
87 };
88
89 enum _ecore_status_t ecore_l2_alloc(struct ecore_hwfn *p_hwfn);
90 void ecore_l2_setup(struct ecore_hwfn *p_hwfn);
91 void ecore_l2_free(struct ecore_hwfn *p_hwfn);
92
93 void ecore_eth_queue_cid_release(struct ecore_hwfn *p_hwfn,
94                                  struct ecore_queue_cid *p_cid);
95
96 struct ecore_queue_cid *
97 ecore_eth_queue_to_cid(struct ecore_hwfn *p_hwfn, u16 opaque_fid,
98                        struct ecore_queue_start_common_params *p_params,
99                        struct ecore_queue_cid_vf_params *p_vf_params);
100
101 enum _ecore_status_t
102 ecore_sp_eth_vport_start(struct ecore_hwfn *p_hwfn,
103                          struct ecore_sp_vport_start_params *p_params);
104
105 /**
106  * @brief - Starts an Rx queue, when queue_cid is already prepared
107  *
108  * @param p_hwfn
109  * @param p_cid
110  * @param bd_max_bytes
111  * @param bd_chain_phys_addr
112  * @param cqe_pbl_addr
113  * @param cqe_pbl_size
114  *
115  * @return enum _ecore_status_t
116  */
117 enum _ecore_status_t
118 ecore_eth_rxq_start_ramrod(struct ecore_hwfn *p_hwfn,
119                            struct ecore_queue_cid *p_cid,
120                            u16 bd_max_bytes,
121                            dma_addr_t bd_chain_phys_addr,
122                            dma_addr_t cqe_pbl_addr,
123                            u16 cqe_pbl_size);
124
125 /**
126  * @brief - Starts a Tx queue, where queue_cid is already prepared
127  *
128  * @param p_hwfn
129  * @param p_cid
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_eth_txq_start_ramrod(struct ecore_hwfn *p_hwfn,
138                            struct ecore_queue_cid *p_cid,
139                            dma_addr_t pbl_addr, u16 pbl_size,
140                            u16 pq_id);
141
142 u8 ecore_mcast_bin_from_mac(u8 *mac);
143 #endif