diff options
Diffstat (limited to 'drivers/net/bna/bfa_cee.c')
-rw-r--r-- | drivers/net/bna/bfa_cee.c | 136 |
1 files changed, 10 insertions, 126 deletions
diff --git a/drivers/net/bna/bfa_cee.c b/drivers/net/bna/bfa_cee.c index 1545fc9720f8..f7b789a3b217 100644 --- a/drivers/net/bna/bfa_cee.c +++ b/drivers/net/bna/bfa_cee.c | |||
@@ -152,7 +152,7 @@ bfa_cee_reset_stats_isr(struct bfa_cee *cee, enum bfa_status status) | |||
152 | cee->cbfn.reset_stats_cbfn(cee->cbfn.reset_stats_cbarg, status); | 152 | cee->cbfn.reset_stats_cbfn(cee->cbfn.reset_stats_cbarg, status); |
153 | } | 153 | } |
154 | /** | 154 | /** |
155 | * bfa_cee_meminfo() | 155 | * bfa_nw_cee_meminfo() |
156 | * | 156 | * |
157 | * @brief Returns the size of the DMA memory needed by CEE module | 157 | * @brief Returns the size of the DMA memory needed by CEE module |
158 | * | 158 | * |
@@ -161,13 +161,13 @@ bfa_cee_reset_stats_isr(struct bfa_cee *cee, enum bfa_status status) | |||
161 | * @return Size of DMA region | 161 | * @return Size of DMA region |
162 | */ | 162 | */ |
163 | u32 | 163 | u32 |
164 | bfa_cee_meminfo(void) | 164 | bfa_nw_cee_meminfo(void) |
165 | { | 165 | { |
166 | return bfa_cee_attr_meminfo() + bfa_cee_stats_meminfo(); | 166 | return bfa_cee_attr_meminfo() + bfa_cee_stats_meminfo(); |
167 | } | 167 | } |
168 | 168 | ||
169 | /** | 169 | /** |
170 | * bfa_cee_mem_claim() | 170 | * bfa_nw_cee_mem_claim() |
171 | * | 171 | * |
172 | * @brief Initialized CEE DMA Memory | 172 | * @brief Initialized CEE DMA Memory |
173 | * | 173 | * |
@@ -178,7 +178,7 @@ bfa_cee_meminfo(void) | |||
178 | * @return void | 178 | * @return void |
179 | */ | 179 | */ |
180 | void | 180 | void |
181 | bfa_cee_mem_claim(struct bfa_cee *cee, u8 *dma_kva, u64 dma_pa) | 181 | bfa_nw_cee_mem_claim(struct bfa_cee *cee, u8 *dma_kva, u64 dma_pa) |
182 | { | 182 | { |
183 | cee->attr_dma.kva = dma_kva; | 183 | cee->attr_dma.kva = dma_kva; |
184 | cee->attr_dma.pa = dma_pa; | 184 | cee->attr_dma.pa = dma_pa; |
@@ -190,108 +190,6 @@ bfa_cee_mem_claim(struct bfa_cee *cee, u8 *dma_kva, u64 dma_pa) | |||
190 | } | 190 | } |
191 | 191 | ||
192 | /** | 192 | /** |
193 | * bfa_cee_get_attr() | ||
194 | * | ||
195 | * @brief | ||
196 | * Send the request to the f/w to fetch CEE attributes. | ||
197 | * | ||
198 | * @param[in] Pointer to the CEE module data structure. | ||
199 | * | ||
200 | * @return Status | ||
201 | */ | ||
202 | |||
203 | enum bfa_status | ||
204 | bfa_cee_get_attr(struct bfa_cee *cee, struct bfa_cee_attr *attr, | ||
205 | bfa_cee_get_attr_cbfn_t cbfn, void *cbarg) | ||
206 | { | ||
207 | struct bfi_cee_get_req *cmd; | ||
208 | |||
209 | BUG_ON(!((cee != NULL) && (cee->ioc != NULL))); | ||
210 | if (!bfa_ioc_is_operational(cee->ioc)) | ||
211 | return BFA_STATUS_IOC_FAILURE; | ||
212 | if (cee->get_attr_pending == true) | ||
213 | return BFA_STATUS_DEVBUSY; | ||
214 | cee->get_attr_pending = true; | ||
215 | cmd = (struct bfi_cee_get_req *) cee->get_cfg_mb.msg; | ||
216 | cee->attr = attr; | ||
217 | cee->cbfn.get_attr_cbfn = cbfn; | ||
218 | cee->cbfn.get_attr_cbarg = cbarg; | ||
219 | bfi_h2i_set(cmd->mh, BFI_MC_CEE, BFI_CEE_H2I_GET_CFG_REQ, | ||
220 | bfa_ioc_portid(cee->ioc)); | ||
221 | bfa_dma_be_addr_set(cmd->dma_addr, cee->attr_dma.pa); | ||
222 | bfa_ioc_mbox_queue(cee->ioc, &cee->get_cfg_mb); | ||
223 | |||
224 | return BFA_STATUS_OK; | ||
225 | } | ||
226 | |||
227 | /** | ||
228 | * bfa_cee_get_stats() | ||
229 | * | ||
230 | * @brief | ||
231 | * Send the request to the f/w to fetch CEE statistics. | ||
232 | * | ||
233 | * @param[in] Pointer to the CEE module data structure. | ||
234 | * | ||
235 | * @return Status | ||
236 | */ | ||
237 | |||
238 | enum bfa_status | ||
239 | bfa_cee_get_stats(struct bfa_cee *cee, struct bfa_cee_stats *stats, | ||
240 | bfa_cee_get_stats_cbfn_t cbfn, void *cbarg) | ||
241 | { | ||
242 | struct bfi_cee_get_req *cmd; | ||
243 | |||
244 | BUG_ON(!((cee != NULL) && (cee->ioc != NULL))); | ||
245 | |||
246 | if (!bfa_ioc_is_operational(cee->ioc)) | ||
247 | return BFA_STATUS_IOC_FAILURE; | ||
248 | if (cee->get_stats_pending == true) | ||
249 | return BFA_STATUS_DEVBUSY; | ||
250 | cee->get_stats_pending = true; | ||
251 | cmd = (struct bfi_cee_get_req *) cee->get_stats_mb.msg; | ||
252 | cee->stats = stats; | ||
253 | cee->cbfn.get_stats_cbfn = cbfn; | ||
254 | cee->cbfn.get_stats_cbarg = cbarg; | ||
255 | bfi_h2i_set(cmd->mh, BFI_MC_CEE, BFI_CEE_H2I_GET_STATS_REQ, | ||
256 | bfa_ioc_portid(cee->ioc)); | ||
257 | bfa_dma_be_addr_set(cmd->dma_addr, cee->stats_dma.pa); | ||
258 | bfa_ioc_mbox_queue(cee->ioc, &cee->get_stats_mb); | ||
259 | |||
260 | return BFA_STATUS_OK; | ||
261 | } | ||
262 | |||
263 | /** | ||
264 | * bfa_cee_reset_stats() | ||
265 | * | ||
266 | * @brief Clears CEE Stats in the f/w. | ||
267 | * | ||
268 | * @param[in] Pointer to the CEE module data structure. | ||
269 | * | ||
270 | * @return Status | ||
271 | */ | ||
272 | |||
273 | enum bfa_status | ||
274 | bfa_cee_reset_stats(struct bfa_cee *cee, bfa_cee_reset_stats_cbfn_t cbfn, | ||
275 | void *cbarg) | ||
276 | { | ||
277 | struct bfi_cee_reset_stats *cmd; | ||
278 | |||
279 | BUG_ON(!((cee != NULL) && (cee->ioc != NULL))); | ||
280 | if (!bfa_ioc_is_operational(cee->ioc)) | ||
281 | return BFA_STATUS_IOC_FAILURE; | ||
282 | if (cee->reset_stats_pending == true) | ||
283 | return BFA_STATUS_DEVBUSY; | ||
284 | cee->reset_stats_pending = true; | ||
285 | cmd = (struct bfi_cee_reset_stats *) cee->reset_stats_mb.msg; | ||
286 | cee->cbfn.reset_stats_cbfn = cbfn; | ||
287 | cee->cbfn.reset_stats_cbarg = cbarg; | ||
288 | bfi_h2i_set(cmd->mh, BFI_MC_CEE, BFI_CEE_H2I_RESET_STATS, | ||
289 | bfa_ioc_portid(cee->ioc)); | ||
290 | bfa_ioc_mbox_queue(cee->ioc, &cee->reset_stats_mb); | ||
291 | return BFA_STATUS_OK; | ||
292 | } | ||
293 | |||
294 | /** | ||
295 | * bfa_cee_isrs() | 193 | * bfa_cee_isrs() |
296 | * | 194 | * |
297 | * @brief Handles Mail-box interrupts for CEE module. | 195 | * @brief Handles Mail-box interrupts for CEE module. |
@@ -301,7 +199,7 @@ bfa_cee_reset_stats(struct bfa_cee *cee, bfa_cee_reset_stats_cbfn_t cbfn, | |||
301 | * @return void | 199 | * @return void |
302 | */ | 200 | */ |
303 | 201 | ||
304 | void | 202 | static void |
305 | bfa_cee_isr(void *cbarg, struct bfi_mbmsg *m) | 203 | bfa_cee_isr(void *cbarg, struct bfi_mbmsg *m) |
306 | { | 204 | { |
307 | union bfi_cee_i2h_msg_u *msg; | 205 | union bfi_cee_i2h_msg_u *msg; |
@@ -334,7 +232,7 @@ bfa_cee_isr(void *cbarg, struct bfi_mbmsg *m) | |||
334 | * @return void | 232 | * @return void |
335 | */ | 233 | */ |
336 | 234 | ||
337 | void | 235 | static void |
338 | bfa_cee_hbfail(void *arg) | 236 | bfa_cee_hbfail(void *arg) |
339 | { | 237 | { |
340 | struct bfa_cee *cee; | 238 | struct bfa_cee *cee; |
@@ -367,7 +265,7 @@ bfa_cee_hbfail(void *arg) | |||
367 | } | 265 | } |
368 | 266 | ||
369 | /** | 267 | /** |
370 | * bfa_cee_attach() | 268 | * bfa_nw_cee_attach() |
371 | * | 269 | * |
372 | * @brief CEE module-attach API | 270 | * @brief CEE module-attach API |
373 | * | 271 | * |
@@ -380,28 +278,14 @@ bfa_cee_hbfail(void *arg) | |||
380 | * @return void | 278 | * @return void |
381 | */ | 279 | */ |
382 | void | 280 | void |
383 | bfa_cee_attach(struct bfa_cee *cee, struct bfa_ioc *ioc, | 281 | bfa_nw_cee_attach(struct bfa_cee *cee, struct bfa_ioc *ioc, |
384 | void *dev) | 282 | void *dev) |
385 | { | 283 | { |
386 | BUG_ON(!(cee != NULL)); | 284 | BUG_ON(!(cee != NULL)); |
387 | cee->dev = dev; | 285 | cee->dev = dev; |
388 | cee->ioc = ioc; | 286 | cee->ioc = ioc; |
389 | 287 | ||
390 | bfa_ioc_mbox_regisr(cee->ioc, BFI_MC_CEE, bfa_cee_isr, cee); | 288 | bfa_nw_ioc_mbox_regisr(cee->ioc, BFI_MC_CEE, bfa_cee_isr, cee); |
391 | bfa_ioc_hbfail_init(&cee->hbfail, bfa_cee_hbfail, cee); | 289 | bfa_ioc_hbfail_init(&cee->hbfail, bfa_cee_hbfail, cee); |
392 | bfa_ioc_hbfail_register(cee->ioc, &cee->hbfail); | 290 | bfa_nw_ioc_hbfail_register(cee->ioc, &cee->hbfail); |
393 | } | ||
394 | |||
395 | /** | ||
396 | * bfa_cee_detach() | ||
397 | * | ||
398 | * @brief CEE module-detach API | ||
399 | * | ||
400 | * @param[in] cee - Pointer to the CEE module data structure | ||
401 | * | ||
402 | * @return void | ||
403 | */ | ||
404 | void | ||
405 | bfa_cee_detach(struct bfa_cee *cee) | ||
406 | { | ||
407 | } | 291 | } |