diff options
Diffstat (limited to 'drivers/scsi/bfa/bfa_core.c')
-rw-r--r-- | drivers/scsi/bfa/bfa_core.c | 178 |
1 files changed, 89 insertions, 89 deletions
diff --git a/drivers/scsi/bfa/bfa_core.c b/drivers/scsi/bfa/bfa_core.c index c2fa07f2485..2345f48dc57 100644 --- a/drivers/scsi/bfa/bfa_core.c +++ b/drivers/scsi/bfa/bfa_core.c | |||
@@ -21,11 +21,11 @@ | |||
21 | 21 | ||
22 | BFA_TRC_FILE(HAL, CORE); | 22 | BFA_TRC_FILE(HAL, CORE); |
23 | 23 | ||
24 | /** | 24 | /* |
25 | * BFA IOC FC related definitions | 25 | * BFA IOC FC related definitions |
26 | */ | 26 | */ |
27 | 27 | ||
28 | /** | 28 | /* |
29 | * IOC local definitions | 29 | * IOC local definitions |
30 | */ | 30 | */ |
31 | #define BFA_IOCFC_TOV 5000 /* msecs */ | 31 | #define BFA_IOCFC_TOV 5000 /* msecs */ |
@@ -54,7 +54,7 @@ enum { | |||
54 | #define DEF_CFG_NUM_SBOOT_TGTS 16 | 54 | #define DEF_CFG_NUM_SBOOT_TGTS 16 |
55 | #define DEF_CFG_NUM_SBOOT_LUNS 16 | 55 | #define DEF_CFG_NUM_SBOOT_LUNS 16 |
56 | 56 | ||
57 | /** | 57 | /* |
58 | * forward declaration for IOC FC functions | 58 | * forward declaration for IOC FC functions |
59 | */ | 59 | */ |
60 | static void bfa_iocfc_enable_cbfn(void *bfa_arg, enum bfa_status status); | 60 | static void bfa_iocfc_enable_cbfn(void *bfa_arg, enum bfa_status status); |
@@ -63,7 +63,7 @@ static void bfa_iocfc_hbfail_cbfn(void *bfa_arg); | |||
63 | static void bfa_iocfc_reset_cbfn(void *bfa_arg); | 63 | static void bfa_iocfc_reset_cbfn(void *bfa_arg); |
64 | static struct bfa_ioc_cbfn_s bfa_iocfc_cbfn; | 64 | static struct bfa_ioc_cbfn_s bfa_iocfc_cbfn; |
65 | 65 | ||
66 | /** | 66 | /* |
67 | * BFA Interrupt handling functions | 67 | * BFA Interrupt handling functions |
68 | */ | 68 | */ |
69 | static void | 69 | static void |
@@ -86,7 +86,7 @@ bfa_reqq_resume(struct bfa_s *bfa, int qid) | |||
86 | 86 | ||
87 | waitq = bfa_reqq(bfa, qid); | 87 | waitq = bfa_reqq(bfa, qid); |
88 | list_for_each_safe(qe, qen, waitq) { | 88 | list_for_each_safe(qe, qen, waitq) { |
89 | /** | 89 | /* |
90 | * Callback only as long as there is room in request queue | 90 | * Callback only as long as there is room in request queue |
91 | */ | 91 | */ |
92 | if (bfa_reqq_full(bfa, qid)) | 92 | if (bfa_reqq_full(bfa, qid)) |
@@ -104,7 +104,7 @@ bfa_msix_all(struct bfa_s *bfa, int vec) | |||
104 | bfa_intx(bfa); | 104 | bfa_intx(bfa); |
105 | } | 105 | } |
106 | 106 | ||
107 | /** | 107 | /* |
108 | * hal_intr_api | 108 | * hal_intr_api |
109 | */ | 109 | */ |
110 | bfa_boolean_t | 110 | bfa_boolean_t |
@@ -113,15 +113,15 @@ bfa_intx(struct bfa_s *bfa) | |||
113 | u32 intr, qintr; | 113 | u32 intr, qintr; |
114 | int queue; | 114 | int queue; |
115 | 115 | ||
116 | intr = bfa_reg_read(bfa->iocfc.bfa_regs.intr_status); | 116 | intr = readl(bfa->iocfc.bfa_regs.intr_status); |
117 | if (!intr) | 117 | if (!intr) |
118 | return BFA_FALSE; | 118 | return BFA_FALSE; |
119 | 119 | ||
120 | /** | 120 | /* |
121 | * RME completion queue interrupt | 121 | * RME completion queue interrupt |
122 | */ | 122 | */ |
123 | qintr = intr & __HFN_INT_RME_MASK; | 123 | qintr = intr & __HFN_INT_RME_MASK; |
124 | bfa_reg_write(bfa->iocfc.bfa_regs.intr_status, qintr); | 124 | writel(qintr, bfa->iocfc.bfa_regs.intr_status); |
125 | 125 | ||
126 | for (queue = 0; queue < BFI_IOC_MAX_CQS_ASIC; queue++) { | 126 | for (queue = 0; queue < BFI_IOC_MAX_CQS_ASIC; queue++) { |
127 | if (intr & (__HFN_INT_RME_Q0 << queue)) | 127 | if (intr & (__HFN_INT_RME_Q0 << queue)) |
@@ -131,11 +131,11 @@ bfa_intx(struct bfa_s *bfa) | |||
131 | if (!intr) | 131 | if (!intr) |
132 | return BFA_TRUE; | 132 | return BFA_TRUE; |
133 | 133 | ||
134 | /** | 134 | /* |
135 | * CPE completion queue interrupt | 135 | * CPE completion queue interrupt |
136 | */ | 136 | */ |
137 | qintr = intr & __HFN_INT_CPE_MASK; | 137 | qintr = intr & __HFN_INT_CPE_MASK; |
138 | bfa_reg_write(bfa->iocfc.bfa_regs.intr_status, qintr); | 138 | writel(qintr, bfa->iocfc.bfa_regs.intr_status); |
139 | 139 | ||
140 | for (queue = 0; queue < BFI_IOC_MAX_CQS_ASIC; queue++) { | 140 | for (queue = 0; queue < BFI_IOC_MAX_CQS_ASIC; queue++) { |
141 | if (intr & (__HFN_INT_CPE_Q0 << queue)) | 141 | if (intr & (__HFN_INT_CPE_Q0 << queue)) |
@@ -153,13 +153,13 @@ bfa_intx(struct bfa_s *bfa) | |||
153 | void | 153 | void |
154 | bfa_intx_enable(struct bfa_s *bfa) | 154 | bfa_intx_enable(struct bfa_s *bfa) |
155 | { | 155 | { |
156 | bfa_reg_write(bfa->iocfc.bfa_regs.intr_mask, bfa->iocfc.intr_mask); | 156 | writel(bfa->iocfc.intr_mask, bfa->iocfc.bfa_regs.intr_mask); |
157 | } | 157 | } |
158 | 158 | ||
159 | void | 159 | void |
160 | bfa_intx_disable(struct bfa_s *bfa) | 160 | bfa_intx_disable(struct bfa_s *bfa) |
161 | { | 161 | { |
162 | bfa_reg_write(bfa->iocfc.bfa_regs.intr_mask, -1L); | 162 | writel(-1L, bfa->iocfc.bfa_regs.intr_mask); |
163 | } | 163 | } |
164 | 164 | ||
165 | void | 165 | void |
@@ -188,8 +188,8 @@ bfa_isr_enable(struct bfa_s *bfa) | |||
188 | __HFN_INT_RME_Q6 | __HFN_INT_RME_Q7 | | 188 | __HFN_INT_RME_Q6 | __HFN_INT_RME_Q7 | |
189 | __HFN_INT_MBOX_LPU1); | 189 | __HFN_INT_MBOX_LPU1); |
190 | 190 | ||
191 | bfa_reg_write(bfa->iocfc.bfa_regs.intr_status, intr_unmask); | 191 | writel(intr_unmask, bfa->iocfc.bfa_regs.intr_status); |
192 | bfa_reg_write(bfa->iocfc.bfa_regs.intr_mask, ~intr_unmask); | 192 | writel(~intr_unmask, bfa->iocfc.bfa_regs.intr_mask); |
193 | bfa->iocfc.intr_mask = ~intr_unmask; | 193 | bfa->iocfc.intr_mask = ~intr_unmask; |
194 | bfa_isr_mode_set(bfa, bfa->msix.nvecs != 0); | 194 | bfa_isr_mode_set(bfa, bfa->msix.nvecs != 0); |
195 | } | 195 | } |
@@ -198,7 +198,7 @@ void | |||
198 | bfa_isr_disable(struct bfa_s *bfa) | 198 | bfa_isr_disable(struct bfa_s *bfa) |
199 | { | 199 | { |
200 | bfa_isr_mode_set(bfa, BFA_FALSE); | 200 | bfa_isr_mode_set(bfa, BFA_FALSE); |
201 | bfa_reg_write(bfa->iocfc.bfa_regs.intr_mask, -1L); | 201 | writel(-1L, bfa->iocfc.bfa_regs.intr_mask); |
202 | bfa_msix_uninstall(bfa); | 202 | bfa_msix_uninstall(bfa); |
203 | } | 203 | } |
204 | 204 | ||
@@ -211,7 +211,7 @@ bfa_msix_reqq(struct bfa_s *bfa, int qid) | |||
211 | 211 | ||
212 | bfa->iocfc.hwif.hw_reqq_ack(bfa, qid); | 212 | bfa->iocfc.hwif.hw_reqq_ack(bfa, qid); |
213 | 213 | ||
214 | /** | 214 | /* |
215 | * Resume any pending requests in the corresponding reqq. | 215 | * Resume any pending requests in the corresponding reqq. |
216 | */ | 216 | */ |
217 | waitq = bfa_reqq(bfa, qid); | 217 | waitq = bfa_reqq(bfa, qid); |
@@ -259,14 +259,14 @@ bfa_msix_rspq(struct bfa_s *bfa, int qid) | |||
259 | } | 259 | } |
260 | } | 260 | } |
261 | 261 | ||
262 | /** | 262 | /* |
263 | * update CI | 263 | * update CI |
264 | */ | 264 | */ |
265 | bfa_rspq_ci(bfa, qid) = pi; | 265 | bfa_rspq_ci(bfa, qid) = pi; |
266 | bfa_reg_write(bfa->iocfc.bfa_regs.rme_q_ci[qid], pi); | 266 | writel(pi, bfa->iocfc.bfa_regs.rme_q_ci[qid]); |
267 | mmiowb(); | 267 | mmiowb(); |
268 | 268 | ||
269 | /** | 269 | /* |
270 | * Resume any pending requests in the corresponding reqq. | 270 | * Resume any pending requests in the corresponding reqq. |
271 | */ | 271 | */ |
272 | waitq = bfa_reqq(bfa, qid); | 272 | waitq = bfa_reqq(bfa, qid); |
@@ -279,7 +279,7 @@ bfa_msix_lpu_err(struct bfa_s *bfa, int vec) | |||
279 | { | 279 | { |
280 | u32 intr, curr_value; | 280 | u32 intr, curr_value; |
281 | 281 | ||
282 | intr = bfa_reg_read(bfa->iocfc.bfa_regs.intr_status); | 282 | intr = readl(bfa->iocfc.bfa_regs.intr_status); |
283 | 283 | ||
284 | if (intr & (__HFN_INT_MBOX_LPU0 | __HFN_INT_MBOX_LPU1)) | 284 | if (intr & (__HFN_INT_MBOX_LPU0 | __HFN_INT_MBOX_LPU1)) |
285 | bfa_msix_lpu(bfa); | 285 | bfa_msix_lpu(bfa); |
@@ -289,30 +289,30 @@ bfa_msix_lpu_err(struct bfa_s *bfa, int vec) | |||
289 | 289 | ||
290 | if (intr) { | 290 | if (intr) { |
291 | if (intr & __HFN_INT_LL_HALT) { | 291 | if (intr & __HFN_INT_LL_HALT) { |
292 | /** | 292 | /* |
293 | * If LL_HALT bit is set then FW Init Halt LL Port | 293 | * If LL_HALT bit is set then FW Init Halt LL Port |
294 | * Register needs to be cleared as well so Interrupt | 294 | * Register needs to be cleared as well so Interrupt |
295 | * Status Register will be cleared. | 295 | * Status Register will be cleared. |
296 | */ | 296 | */ |
297 | curr_value = bfa_reg_read(bfa->ioc.ioc_regs.ll_halt); | 297 | curr_value = readl(bfa->ioc.ioc_regs.ll_halt); |
298 | curr_value &= ~__FW_INIT_HALT_P; | 298 | curr_value &= ~__FW_INIT_HALT_P; |
299 | bfa_reg_write(bfa->ioc.ioc_regs.ll_halt, curr_value); | 299 | writel(curr_value, bfa->ioc.ioc_regs.ll_halt); |
300 | } | 300 | } |
301 | 301 | ||
302 | if (intr & __HFN_INT_ERR_PSS) { | 302 | if (intr & __HFN_INT_ERR_PSS) { |
303 | /** | 303 | /* |
304 | * ERR_PSS bit needs to be cleared as well in case | 304 | * ERR_PSS bit needs to be cleared as well in case |
305 | * interrups are shared so driver's interrupt handler is | 305 | * interrups are shared so driver's interrupt handler is |
306 | * still called eventhough it is already masked out. | 306 | * still called eventhough it is already masked out. |
307 | */ | 307 | */ |
308 | curr_value = bfa_reg_read( | 308 | curr_value = readl( |
309 | bfa->ioc.ioc_regs.pss_err_status_reg); | 309 | bfa->ioc.ioc_regs.pss_err_status_reg); |
310 | curr_value &= __PSS_ERR_STATUS_SET; | 310 | curr_value &= __PSS_ERR_STATUS_SET; |
311 | bfa_reg_write(bfa->ioc.ioc_regs.pss_err_status_reg, | 311 | writel(curr_value, |
312 | curr_value); | 312 | bfa->ioc.ioc_regs.pss_err_status_reg); |
313 | } | 313 | } |
314 | 314 | ||
315 | bfa_reg_write(bfa->iocfc.bfa_regs.intr_status, intr); | 315 | writel(intr, bfa->iocfc.bfa_regs.intr_status); |
316 | bfa_msix_errint(bfa, intr); | 316 | bfa_msix_errint(bfa, intr); |
317 | } | 317 | } |
318 | } | 318 | } |
@@ -323,11 +323,11 @@ bfa_isr_bind(enum bfi_mclass mc, bfa_isr_func_t isr_func) | |||
323 | bfa_isrs[mc] = isr_func; | 323 | bfa_isrs[mc] = isr_func; |
324 | } | 324 | } |
325 | 325 | ||
326 | /** | 326 | /* |
327 | * BFA IOC FC related functions | 327 | * BFA IOC FC related functions |
328 | */ | 328 | */ |
329 | 329 | ||
330 | /** | 330 | /* |
331 | * hal_ioc_pvt BFA IOC private functions | 331 | * hal_ioc_pvt BFA IOC private functions |
332 | */ | 332 | */ |
333 | 333 | ||
@@ -366,7 +366,7 @@ bfa_iocfc_fw_cfg_sz(struct bfa_iocfc_cfg_s *cfg, u32 *dm_len) | |||
366 | BFA_CACHELINE_SZ); | 366 | BFA_CACHELINE_SZ); |
367 | } | 367 | } |
368 | 368 | ||
369 | /** | 369 | /* |
370 | * Use the Mailbox interface to send BFI_IOCFC_H2I_CFG_REQ | 370 | * Use the Mailbox interface to send BFI_IOCFC_H2I_CFG_REQ |
371 | */ | 371 | */ |
372 | static void | 372 | static void |
@@ -384,14 +384,14 @@ bfa_iocfc_send_cfg(void *bfa_arg) | |||
384 | 384 | ||
385 | bfa_iocfc_reset_queues(bfa); | 385 | bfa_iocfc_reset_queues(bfa); |
386 | 386 | ||
387 | /** | 387 | /* |
388 | * initialize IOC configuration info | 388 | * initialize IOC configuration info |
389 | */ | 389 | */ |
390 | cfg_info->endian_sig = BFI_IOC_ENDIAN_SIG; | 390 | cfg_info->endian_sig = BFI_IOC_ENDIAN_SIG; |
391 | cfg_info->num_cqs = cfg->fwcfg.num_cqs; | 391 | cfg_info->num_cqs = cfg->fwcfg.num_cqs; |
392 | 392 | ||
393 | bfa_dma_be_addr_set(cfg_info->cfgrsp_addr, iocfc->cfgrsp_dma.pa); | 393 | bfa_dma_be_addr_set(cfg_info->cfgrsp_addr, iocfc->cfgrsp_dma.pa); |
394 | /** | 394 | /* |
395 | * dma map REQ and RSP circular queues and shadow pointers | 395 | * dma map REQ and RSP circular queues and shadow pointers |
396 | */ | 396 | */ |
397 | for (i = 0; i < cfg->fwcfg.num_cqs; i++) { | 397 | for (i = 0; i < cfg->fwcfg.num_cqs; i++) { |
@@ -400,17 +400,17 @@ bfa_iocfc_send_cfg(void *bfa_arg) | |||
400 | bfa_dma_be_addr_set(cfg_info->req_shadow_ci[i], | 400 | bfa_dma_be_addr_set(cfg_info->req_shadow_ci[i], |
401 | iocfc->req_cq_shadow_ci[i].pa); | 401 | iocfc->req_cq_shadow_ci[i].pa); |
402 | cfg_info->req_cq_elems[i] = | 402 | cfg_info->req_cq_elems[i] = |
403 | bfa_os_htons(cfg->drvcfg.num_reqq_elems); | 403 | cpu_to_be16(cfg->drvcfg.num_reqq_elems); |
404 | 404 | ||
405 | bfa_dma_be_addr_set(cfg_info->rsp_cq_ba[i], | 405 | bfa_dma_be_addr_set(cfg_info->rsp_cq_ba[i], |
406 | iocfc->rsp_cq_ba[i].pa); | 406 | iocfc->rsp_cq_ba[i].pa); |
407 | bfa_dma_be_addr_set(cfg_info->rsp_shadow_pi[i], | 407 | bfa_dma_be_addr_set(cfg_info->rsp_shadow_pi[i], |
408 | iocfc->rsp_cq_shadow_pi[i].pa); | 408 | iocfc->rsp_cq_shadow_pi[i].pa); |
409 | cfg_info->rsp_cq_elems[i] = | 409 | cfg_info->rsp_cq_elems[i] = |
410 | bfa_os_htons(cfg->drvcfg.num_rspq_elems); | 410 | cpu_to_be16(cfg->drvcfg.num_rspq_elems); |
411 | } | 411 | } |
412 | 412 | ||
413 | /** | 413 | /* |
414 | * Enable interrupt coalescing if it is driver init path | 414 | * Enable interrupt coalescing if it is driver init path |
415 | * and not ioc disable/enable path. | 415 | * and not ioc disable/enable path. |
416 | */ | 416 | */ |
@@ -419,7 +419,7 @@ bfa_iocfc_send_cfg(void *bfa_arg) | |||
419 | 419 | ||
420 | iocfc->cfgdone = BFA_FALSE; | 420 | iocfc->cfgdone = BFA_FALSE; |
421 | 421 | ||
422 | /** | 422 | /* |
423 | * dma map IOC configuration itself | 423 | * dma map IOC configuration itself |
424 | */ | 424 | */ |
425 | bfi_h2i_set(cfg_req.mh, BFI_MC_IOCFC, BFI_IOCFC_H2I_CFG_REQ, | 425 | bfi_h2i_set(cfg_req.mh, BFI_MC_IOCFC, BFI_IOCFC_H2I_CFG_REQ, |
@@ -440,9 +440,9 @@ bfa_iocfc_init_mem(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg, | |||
440 | iocfc->bfa = bfa; | 440 | iocfc->bfa = bfa; |
441 | iocfc->action = BFA_IOCFC_ACT_NONE; | 441 | iocfc->action = BFA_IOCFC_ACT_NONE; |
442 | 442 | ||
443 | bfa_os_assign(iocfc->cfg, *cfg); | 443 | iocfc->cfg = *cfg; |
444 | 444 | ||
445 | /** | 445 | /* |
446 | * Initialize chip specific handlers. | 446 | * Initialize chip specific handlers. |
447 | */ | 447 | */ |
448 | if (bfa_asic_id_ct(bfa_ioc_devid(&bfa->ioc))) { | 448 | if (bfa_asic_id_ct(bfa_ioc_devid(&bfa->ioc))) { |
@@ -503,13 +503,13 @@ bfa_iocfc_mem_claim(struct bfa_s *bfa, struct bfa_iocfc_cfg_s *cfg, | |||
503 | for (i = 0; i < cfg->fwcfg.num_cqs; i++) { | 503 | for (i = 0; i < cfg->fwcfg.num_cqs; i++) { |
504 | iocfc->req_cq_ba[i].kva = dm_kva; | 504 | iocfc->req_cq_ba[i].kva = dm_kva; |
505 | iocfc->req_cq_ba[i].pa = dm_pa; | 505 | iocfc->req_cq_ba[i].pa = dm_pa; |
506 | bfa_os_memset(dm_kva, 0, per_reqq_sz); | 506 | memset(dm_kva, 0, per_reqq_sz); |
507 | dm_kva += per_reqq_sz; | 507 | dm_kva += per_reqq_sz; |
508 | dm_pa += per_reqq_sz; | 508 | dm_pa += per_reqq_sz; |
509 | 509 | ||
510 | iocfc->rsp_cq_ba[i].kva = dm_kva; | 510 | iocfc->rsp_cq_ba[i].kva = dm_kva; |
511 | iocfc->rsp_cq_ba[i].pa = dm_pa; | 511 | iocfc->rsp_cq_ba[i].pa = dm_pa; |
512 | bfa_os_memset(dm_kva, 0, per_rspq_sz); | 512 | memset(dm_kva, 0, per_rspq_sz); |
513 | dm_kva += per_rspq_sz; | 513 | dm_kva += per_rspq_sz; |
514 | dm_pa += per_rspq_sz; | 514 | dm_pa += per_rspq_sz; |
515 | } | 515 | } |
@@ -559,7 +559,7 @@ bfa_iocfc_mem_claim(struct bfa_s *bfa, struct bfa_iocfc_cfg_s *cfg, | |||
559 | } | 559 | } |
560 | } | 560 | } |
561 | 561 | ||
562 | /** | 562 | /* |
563 | * Start BFA submodules. | 563 | * Start BFA submodules. |
564 | */ | 564 | */ |
565 | static void | 565 | static void |
@@ -573,7 +573,7 @@ bfa_iocfc_start_submod(struct bfa_s *bfa) | |||
573 | hal_mods[i]->start(bfa); | 573 | hal_mods[i]->start(bfa); |
574 | } | 574 | } |
575 | 575 | ||
576 | /** | 576 | /* |
577 | * Disable BFA submodules. | 577 | * Disable BFA submodules. |
578 | */ | 578 | */ |
579 | static void | 579 | static void |
@@ -623,7 +623,7 @@ bfa_iocfc_disable_cb(void *bfa_arg, bfa_boolean_t compl) | |||
623 | complete(&bfad->disable_comp); | 623 | complete(&bfad->disable_comp); |
624 | } | 624 | } |
625 | 625 | ||
626 | /** | 626 | /* |
627 | * Update BFA configuration from firmware configuration. | 627 | * Update BFA configuration from firmware configuration. |
628 | */ | 628 | */ |
629 | static void | 629 | static void |
@@ -634,15 +634,15 @@ bfa_iocfc_cfgrsp(struct bfa_s *bfa) | |||
634 | struct bfa_iocfc_fwcfg_s *fwcfg = &cfgrsp->fwcfg; | 634 | struct bfa_iocfc_fwcfg_s *fwcfg = &cfgrsp->fwcfg; |
635 | 635 | ||
636 | fwcfg->num_cqs = fwcfg->num_cqs; | 636 | fwcfg->num_cqs = fwcfg->num_cqs; |
637 | fwcfg->num_ioim_reqs = bfa_os_ntohs(fwcfg->num_ioim_reqs); | 637 | fwcfg->num_ioim_reqs = be16_to_cpu(fwcfg->num_ioim_reqs); |
638 | fwcfg->num_tskim_reqs = bfa_os_ntohs(fwcfg->num_tskim_reqs); | 638 | fwcfg->num_tskim_reqs = be16_to_cpu(fwcfg->num_tskim_reqs); |
639 | fwcfg->num_fcxp_reqs = bfa_os_ntohs(fwcfg->num_fcxp_reqs); | 639 | fwcfg->num_fcxp_reqs = be16_to_cpu(fwcfg->num_fcxp_reqs); |
640 | fwcfg->num_uf_bufs = bfa_os_ntohs(fwcfg->num_uf_bufs); | 640 | fwcfg->num_uf_bufs = be16_to_cpu(fwcfg->num_uf_bufs); |
641 | fwcfg->num_rports = bfa_os_ntohs(fwcfg->num_rports); | 641 | fwcfg->num_rports = be16_to_cpu(fwcfg->num_rports); |
642 | 642 | ||
643 | iocfc->cfgdone = BFA_TRUE; | 643 | iocfc->cfgdone = BFA_TRUE; |
644 | 644 | ||
645 | /** | 645 | /* |
646 | * Configuration is complete - initialize/start submodules | 646 | * Configuration is complete - initialize/start submodules |
647 | */ | 647 | */ |
648 | bfa_fcport_init(bfa); | 648 | bfa_fcport_init(bfa); |
@@ -665,7 +665,7 @@ bfa_iocfc_reset_queues(struct bfa_s *bfa) | |||
665 | } | 665 | } |
666 | } | 666 | } |
667 | 667 | ||
668 | /** | 668 | /* |
669 | * IOC enable request is complete | 669 | * IOC enable request is complete |
670 | */ | 670 | */ |
671 | static void | 671 | static void |
@@ -684,7 +684,7 @@ bfa_iocfc_enable_cbfn(void *bfa_arg, enum bfa_status status) | |||
684 | bfa_iocfc_send_cfg(bfa); | 684 | bfa_iocfc_send_cfg(bfa); |
685 | } | 685 | } |
686 | 686 | ||
687 | /** | 687 | /* |
688 | * IOC disable request is complete | 688 | * IOC disable request is complete |
689 | */ | 689 | */ |
690 | static void | 690 | static void |
@@ -705,7 +705,7 @@ bfa_iocfc_disable_cbfn(void *bfa_arg) | |||
705 | } | 705 | } |
706 | } | 706 | } |
707 | 707 | ||
708 | /** | 708 | /* |
709 | * Notify sub-modules of hardware failure. | 709 | * Notify sub-modules of hardware failure. |
710 | */ | 710 | */ |
711 | static void | 711 | static void |
@@ -723,7 +723,7 @@ bfa_iocfc_hbfail_cbfn(void *bfa_arg) | |||
723 | bfa); | 723 | bfa); |
724 | } | 724 | } |
725 | 725 | ||
726 | /** | 726 | /* |
727 | * Actions on chip-reset completion. | 727 | * Actions on chip-reset completion. |
728 | */ | 728 | */ |
729 | static void | 729 | static void |
@@ -735,11 +735,11 @@ bfa_iocfc_reset_cbfn(void *bfa_arg) | |||
735 | bfa_isr_enable(bfa); | 735 | bfa_isr_enable(bfa); |
736 | } | 736 | } |
737 | 737 | ||
738 | /** | 738 | /* |
739 | * hal_ioc_public | 739 | * hal_ioc_public |
740 | */ | 740 | */ |
741 | 741 | ||
742 | /** | 742 | /* |
743 | * Query IOC memory requirement information. | 743 | * Query IOC memory requirement information. |
744 | */ | 744 | */ |
745 | void | 745 | void |
@@ -754,7 +754,7 @@ bfa_iocfc_meminfo(struct bfa_iocfc_cfg_s *cfg, u32 *km_len, | |||
754 | *km_len += bfa_ioc_debug_trcsz(bfa_auto_recover); | 754 | *km_len += bfa_ioc_debug_trcsz(bfa_auto_recover); |
755 | } | 755 | } |
756 | 756 | ||
757 | /** | 757 | /* |
758 | * Query IOC memory requirement information. | 758 | * Query IOC memory requirement information. |
759 | */ | 759 | */ |
760 | void | 760 | void |
@@ -772,7 +772,7 @@ bfa_iocfc_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg, | |||
772 | ioc->trcmod = bfa->trcmod; | 772 | ioc->trcmod = bfa->trcmod; |
773 | bfa_ioc_attach(&bfa->ioc, bfa, &bfa_iocfc_cbfn, &bfa->timer_mod); | 773 | bfa_ioc_attach(&bfa->ioc, bfa, &bfa_iocfc_cbfn, &bfa->timer_mod); |
774 | 774 | ||
775 | /** | 775 | /* |
776 | * Set FC mode for BFA_PCI_DEVICE_ID_CT_FC. | 776 | * Set FC mode for BFA_PCI_DEVICE_ID_CT_FC. |
777 | */ | 777 | */ |
778 | if (pcidev->device_id == BFA_PCI_DEVICE_ID_CT_FC) | 778 | if (pcidev->device_id == BFA_PCI_DEVICE_ID_CT_FC) |
@@ -790,7 +790,7 @@ bfa_iocfc_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg, | |||
790 | INIT_LIST_HEAD(&bfa->reqq_waitq[i]); | 790 | INIT_LIST_HEAD(&bfa->reqq_waitq[i]); |
791 | } | 791 | } |
792 | 792 | ||
793 | /** | 793 | /* |
794 | * Query IOC memory requirement information. | 794 | * Query IOC memory requirement information. |
795 | */ | 795 | */ |
796 | void | 796 | void |
@@ -799,7 +799,7 @@ bfa_iocfc_detach(struct bfa_s *bfa) | |||
799 | bfa_ioc_detach(&bfa->ioc); | 799 | bfa_ioc_detach(&bfa->ioc); |
800 | } | 800 | } |
801 | 801 | ||
802 | /** | 802 | /* |
803 | * Query IOC memory requirement information. | 803 | * Query IOC memory requirement information. |
804 | */ | 804 | */ |
805 | void | 805 | void |
@@ -809,7 +809,7 @@ bfa_iocfc_init(struct bfa_s *bfa) | |||
809 | bfa_ioc_enable(&bfa->ioc); | 809 | bfa_ioc_enable(&bfa->ioc); |
810 | } | 810 | } |
811 | 811 | ||
812 | /** | 812 | /* |
813 | * IOC start called from bfa_start(). Called to start IOC operations | 813 | * IOC start called from bfa_start(). Called to start IOC operations |
814 | * at driver instantiation for this instance. | 814 | * at driver instantiation for this instance. |
815 | */ | 815 | */ |
@@ -820,7 +820,7 @@ bfa_iocfc_start(struct bfa_s *bfa) | |||
820 | bfa_iocfc_start_submod(bfa); | 820 | bfa_iocfc_start_submod(bfa); |
821 | } | 821 | } |
822 | 822 | ||
823 | /** | 823 | /* |
824 | * IOC stop called from bfa_stop(). Called only when driver is unloaded | 824 | * IOC stop called from bfa_stop(). Called only when driver is unloaded |
825 | * for this instance. | 825 | * for this instance. |
826 | */ | 826 | */ |
@@ -876,12 +876,12 @@ bfa_iocfc_get_attr(struct bfa_s *bfa, struct bfa_iocfc_attr_s *attr) | |||
876 | attr->intr_attr.coalesce = iocfc->cfginfo->intr_attr.coalesce; | 876 | attr->intr_attr.coalesce = iocfc->cfginfo->intr_attr.coalesce; |
877 | 877 | ||
878 | attr->intr_attr.delay = iocfc->cfginfo->intr_attr.delay ? | 878 | attr->intr_attr.delay = iocfc->cfginfo->intr_attr.delay ? |
879 | bfa_os_ntohs(iocfc->cfginfo->intr_attr.delay) : | 879 | be16_to_cpu(iocfc->cfginfo->intr_attr.delay) : |
880 | bfa_os_ntohs(iocfc->cfgrsp->intr_attr.delay); | 880 | be16_to_cpu(iocfc->cfgrsp->intr_attr.delay); |
881 | 881 | ||
882 | attr->intr_attr.latency = iocfc->cfginfo->intr_attr.latency ? | 882 | attr->intr_attr.latency = iocfc->cfginfo->intr_attr.latency ? |
883 | bfa_os_ntohs(iocfc->cfginfo->intr_attr.latency) : | 883 | be16_to_cpu(iocfc->cfginfo->intr_attr.latency) : |
884 | bfa_os_ntohs(iocfc->cfgrsp->intr_attr.latency); | 884 | be16_to_cpu(iocfc->cfgrsp->intr_attr.latency); |
885 | 885 | ||
886 | attr->config = iocfc->cfg; | 886 | attr->config = iocfc->cfg; |
887 | } | 887 | } |
@@ -893,8 +893,8 @@ bfa_iocfc_israttr_set(struct bfa_s *bfa, struct bfa_iocfc_intr_attr_s *attr) | |||
893 | struct bfi_iocfc_set_intr_req_s *m; | 893 | struct bfi_iocfc_set_intr_req_s *m; |
894 | 894 | ||
895 | iocfc->cfginfo->intr_attr.coalesce = attr->coalesce; | 895 | iocfc->cfginfo->intr_attr.coalesce = attr->coalesce; |
896 | iocfc->cfginfo->intr_attr.delay = bfa_os_htons(attr->delay); | 896 | iocfc->cfginfo->intr_attr.delay = cpu_to_be16(attr->delay); |
897 | iocfc->cfginfo->intr_attr.latency = bfa_os_htons(attr->latency); | 897 | iocfc->cfginfo->intr_attr.latency = cpu_to_be16(attr->latency); |
898 | 898 | ||
899 | if (!bfa_iocfc_is_operational(bfa)) | 899 | if (!bfa_iocfc_is_operational(bfa)) |
900 | return BFA_STATUS_OK; | 900 | return BFA_STATUS_OK; |
@@ -924,7 +924,7 @@ bfa_iocfc_set_snsbase(struct bfa_s *bfa, u64 snsbase_pa) | |||
924 | iocfc->cfginfo->sense_buf_len = (BFI_IOIM_SNSLEN - 1); | 924 | iocfc->cfginfo->sense_buf_len = (BFI_IOIM_SNSLEN - 1); |
925 | bfa_dma_be_addr_set(iocfc->cfginfo->ioim_snsbase, snsbase_pa); | 925 | bfa_dma_be_addr_set(iocfc->cfginfo->ioim_snsbase, snsbase_pa); |
926 | } | 926 | } |
927 | /** | 927 | /* |
928 | * Enable IOC after it is disabled. | 928 | * Enable IOC after it is disabled. |
929 | */ | 929 | */ |
930 | void | 930 | void |
@@ -953,7 +953,7 @@ bfa_iocfc_is_operational(struct bfa_s *bfa) | |||
953 | return bfa_ioc_is_operational(&bfa->ioc) && bfa->iocfc.cfgdone; | 953 | return bfa_ioc_is_operational(&bfa->ioc) && bfa->iocfc.cfgdone; |
954 | } | 954 | } |
955 | 955 | ||
956 | /** | 956 | /* |
957 | * Return boot target port wwns -- read from boot information in flash. | 957 | * Return boot target port wwns -- read from boot information in flash. |
958 | */ | 958 | */ |
959 | void | 959 | void |
@@ -998,11 +998,11 @@ bfa_iocfc_get_pbc_vports(struct bfa_s *bfa, struct bfi_pbc_vport_s *pbc_vport) | |||
998 | return cfgrsp->pbc_cfg.nvports; | 998 | return cfgrsp->pbc_cfg.nvports; |
999 | } | 999 | } |
1000 | 1000 | ||
1001 | /** | 1001 | /* |
1002 | * hal_api | 1002 | * hal_api |
1003 | */ | 1003 | */ |
1004 | 1004 | ||
1005 | /** | 1005 | /* |
1006 | * Use this function query the memory requirement of the BFA library. | 1006 | * Use this function query the memory requirement of the BFA library. |
1007 | * This function needs to be called before bfa_attach() to get the | 1007 | * This function needs to be called before bfa_attach() to get the |
1008 | * memory required of the BFA layer for a given driver configuration. | 1008 | * memory required of the BFA layer for a given driver configuration. |
@@ -1038,7 +1038,7 @@ bfa_cfg_get_meminfo(struct bfa_iocfc_cfg_s *cfg, struct bfa_meminfo_s *meminfo) | |||
1038 | 1038 | ||
1039 | bfa_assert((cfg != NULL) && (meminfo != NULL)); | 1039 | bfa_assert((cfg != NULL) && (meminfo != NULL)); |
1040 | 1040 | ||
1041 | bfa_os_memset((void *)meminfo, 0, sizeof(struct bfa_meminfo_s)); | 1041 | memset((void *)meminfo, 0, sizeof(struct bfa_meminfo_s)); |
1042 | meminfo->meminfo[BFA_MEM_TYPE_KVA - 1].mem_type = | 1042 | meminfo->meminfo[BFA_MEM_TYPE_KVA - 1].mem_type = |
1043 | BFA_MEM_TYPE_KVA; | 1043 | BFA_MEM_TYPE_KVA; |
1044 | meminfo->meminfo[BFA_MEM_TYPE_DMA - 1].mem_type = | 1044 | meminfo->meminfo[BFA_MEM_TYPE_DMA - 1].mem_type = |
@@ -1055,7 +1055,7 @@ bfa_cfg_get_meminfo(struct bfa_iocfc_cfg_s *cfg, struct bfa_meminfo_s *meminfo) | |||
1055 | meminfo->meminfo[BFA_MEM_TYPE_DMA - 1].mem_len = dm_len; | 1055 | meminfo->meminfo[BFA_MEM_TYPE_DMA - 1].mem_len = dm_len; |
1056 | } | 1056 | } |
1057 | 1057 | ||
1058 | /** | 1058 | /* |
1059 | * Use this function to do attach the driver instance with the BFA | 1059 | * Use this function to do attach the driver instance with the BFA |
1060 | * library. This function will not trigger any HW initialization | 1060 | * library. This function will not trigger any HW initialization |
1061 | * process (which will be done in bfa_init() call) | 1061 | * process (which will be done in bfa_init() call) |
@@ -1092,7 +1092,7 @@ bfa_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg, | |||
1092 | 1092 | ||
1093 | bfa_assert((cfg != NULL) && (meminfo != NULL)); | 1093 | bfa_assert((cfg != NULL) && (meminfo != NULL)); |
1094 | 1094 | ||
1095 | /** | 1095 | /* |
1096 | * initialize all memory pointers for iterative allocation | 1096 | * initialize all memory pointers for iterative allocation |
1097 | */ | 1097 | */ |
1098 | for (i = 0; i < BFA_MEM_TYPE_MAX; i++) { | 1098 | for (i = 0; i < BFA_MEM_TYPE_MAX; i++) { |
@@ -1109,7 +1109,7 @@ bfa_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg, | |||
1109 | bfa_com_port_attach(bfa, meminfo); | 1109 | bfa_com_port_attach(bfa, meminfo); |
1110 | } | 1110 | } |
1111 | 1111 | ||
1112 | /** | 1112 | /* |
1113 | * Use this function to delete a BFA IOC. IOC should be stopped (by | 1113 | * Use this function to delete a BFA IOC. IOC should be stopped (by |
1114 | * calling bfa_stop()) before this function call. | 1114 | * calling bfa_stop()) before this function call. |
1115 | * | 1115 | * |
@@ -1146,7 +1146,7 @@ bfa_init_plog(struct bfa_s *bfa, struct bfa_plog_s *plog) | |||
1146 | bfa->plog = plog; | 1146 | bfa->plog = plog; |
1147 | } | 1147 | } |
1148 | 1148 | ||
1149 | /** | 1149 | /* |
1150 | * Initialize IOC. | 1150 | * Initialize IOC. |
1151 | * | 1151 | * |
1152 | * This function will return immediately, when the IOC initialization is | 1152 | * This function will return immediately, when the IOC initialization is |
@@ -1169,7 +1169,7 @@ bfa_init(struct bfa_s *bfa) | |||
1169 | bfa_iocfc_init(bfa); | 1169 | bfa_iocfc_init(bfa); |
1170 | } | 1170 | } |
1171 | 1171 | ||
1172 | /** | 1172 | /* |
1173 | * Use this function initiate the IOC configuration setup. This function | 1173 | * Use this function initiate the IOC configuration setup. This function |
1174 | * will return immediately. | 1174 | * will return immediately. |
1175 | * | 1175 | * |
@@ -1183,7 +1183,7 @@ bfa_start(struct bfa_s *bfa) | |||
1183 | bfa_iocfc_start(bfa); | 1183 | bfa_iocfc_start(bfa); |
1184 | } | 1184 | } |
1185 | 1185 | ||
1186 | /** | 1186 | /* |
1187 | * Use this function quiese the IOC. This function will return immediately, | 1187 | * Use this function quiese the IOC. This function will return immediately, |
1188 | * when the IOC is actually stopped, the bfad->comp will be set. | 1188 | * when the IOC is actually stopped, the bfad->comp will be set. |
1189 | * | 1189 | * |
@@ -1243,7 +1243,7 @@ bfa_attach_fcs(struct bfa_s *bfa) | |||
1243 | bfa->fcs = BFA_TRUE; | 1243 | bfa->fcs = BFA_TRUE; |
1244 | } | 1244 | } |
1245 | 1245 | ||
1246 | /** | 1246 | /* |
1247 | * Periodic timer heart beat from driver | 1247 | * Periodic timer heart beat from driver |
1248 | */ | 1248 | */ |
1249 | void | 1249 | void |
@@ -1252,7 +1252,7 @@ bfa_timer_tick(struct bfa_s *bfa) | |||
1252 | bfa_timer_beat(&bfa->timer_mod); | 1252 | bfa_timer_beat(&bfa->timer_mod); |
1253 | } | 1253 | } |
1254 | 1254 | ||
1255 | /** | 1255 | /* |
1256 | * Return the list of PCI vendor/device id lists supported by this | 1256 | * Return the list of PCI vendor/device id lists supported by this |
1257 | * BFA instance. | 1257 | * BFA instance. |
1258 | */ | 1258 | */ |
@@ -1270,7 +1270,7 @@ bfa_get_pciids(struct bfa_pciid_s **pciids, int *npciids) | |||
1270 | *pciids = __pciids; | 1270 | *pciids = __pciids; |
1271 | } | 1271 | } |
1272 | 1272 | ||
1273 | /** | 1273 | /* |
1274 | * Use this function query the default struct bfa_iocfc_cfg_s value (compiled | 1274 | * Use this function query the default struct bfa_iocfc_cfg_s value (compiled |
1275 | * into BFA layer). The OS driver can then turn back and overwrite entries that | 1275 | * into BFA layer). The OS driver can then turn back and overwrite entries that |
1276 | * have been configured by the user. | 1276 | * have been configured by the user. |
@@ -1328,7 +1328,7 @@ bfa_get_attr(struct bfa_s *bfa, struct bfa_ioc_attr_s *ioc_attr) | |||
1328 | bfa_ioc_get_attr(&bfa->ioc, ioc_attr); | 1328 | bfa_ioc_get_attr(&bfa->ioc, ioc_attr); |
1329 | } | 1329 | } |
1330 | 1330 | ||
1331 | /** | 1331 | /* |
1332 | * Retrieve firmware trace information on IOC failure. | 1332 | * Retrieve firmware trace information on IOC failure. |
1333 | */ | 1333 | */ |
1334 | bfa_status_t | 1334 | bfa_status_t |
@@ -1337,7 +1337,7 @@ bfa_debug_fwsave(struct bfa_s *bfa, void *trcdata, int *trclen) | |||
1337 | return bfa_ioc_debug_fwsave(&bfa->ioc, trcdata, trclen); | 1337 | return bfa_ioc_debug_fwsave(&bfa->ioc, trcdata, trclen); |
1338 | } | 1338 | } |
1339 | 1339 | ||
1340 | /** | 1340 | /* |
1341 | * Clear the saved firmware trace information of an IOC. | 1341 | * Clear the saved firmware trace information of an IOC. |
1342 | */ | 1342 | */ |
1343 | void | 1343 | void |
@@ -1346,7 +1346,7 @@ bfa_debug_fwsave_clear(struct bfa_s *bfa) | |||
1346 | bfa_ioc_debug_fwsave_clear(&bfa->ioc); | 1346 | bfa_ioc_debug_fwsave_clear(&bfa->ioc); |
1347 | } | 1347 | } |
1348 | 1348 | ||
1349 | /** | 1349 | /* |
1350 | * Fetch firmware trace data. | 1350 | * Fetch firmware trace data. |
1351 | * | 1351 | * |
1352 | * @param[in] bfa BFA instance | 1352 | * @param[in] bfa BFA instance |
@@ -1362,7 +1362,7 @@ bfa_debug_fwtrc(struct bfa_s *bfa, void *trcdata, int *trclen) | |||
1362 | return bfa_ioc_debug_fwtrc(&bfa->ioc, trcdata, trclen); | 1362 | return bfa_ioc_debug_fwtrc(&bfa->ioc, trcdata, trclen); |
1363 | } | 1363 | } |
1364 | 1364 | ||
1365 | /** | 1365 | /* |
1366 | * Dump firmware memory. | 1366 | * Dump firmware memory. |
1367 | * | 1367 | * |
1368 | * @param[in] bfa BFA instance | 1368 | * @param[in] bfa BFA instance |
@@ -1378,7 +1378,7 @@ bfa_debug_fwcore(struct bfa_s *bfa, void *buf, u32 *offset, int *buflen) | |||
1378 | { | 1378 | { |
1379 | return bfa_ioc_debug_fwcore(&bfa->ioc, buf, offset, buflen); | 1379 | return bfa_ioc_debug_fwcore(&bfa->ioc, buf, offset, buflen); |
1380 | } | 1380 | } |
1381 | /** | 1381 | /* |
1382 | * Reset hw semaphore & usage cnt regs and initialize. | 1382 | * Reset hw semaphore & usage cnt regs and initialize. |
1383 | */ | 1383 | */ |
1384 | void | 1384 | void |
@@ -1388,7 +1388,7 @@ bfa_chip_reset(struct bfa_s *bfa) | |||
1388 | bfa_ioc_pll_init(&bfa->ioc); | 1388 | bfa_ioc_pll_init(&bfa->ioc); |
1389 | } | 1389 | } |
1390 | 1390 | ||
1391 | /** | 1391 | /* |
1392 | * Fetch firmware statistics data. | 1392 | * Fetch firmware statistics data. |
1393 | * | 1393 | * |
1394 | * @param[in] bfa BFA instance | 1394 | * @param[in] bfa BFA instance |