aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bfa/bfa_svc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/bfa/bfa_svc.c')
-rw-r--r--drivers/scsi/bfa/bfa_svc.c62
1 files changed, 30 insertions, 32 deletions
diff --git a/drivers/scsi/bfa/bfa_svc.c b/drivers/scsi/bfa/bfa_svc.c
index aa1dc749b281..ee0701fd7b21 100644
--- a/drivers/scsi/bfa/bfa_svc.c
+++ b/drivers/scsi/bfa/bfa_svc.c
@@ -330,7 +330,7 @@ bfa_plog_add(struct bfa_plog_s *plog, struct bfa_plog_rec_s *pl_rec)
330 330
331 pl_recp = &(plog->plog_recs[tail]); 331 pl_recp = &(plog->plog_recs[tail]);
332 332
333 bfa_os_memcpy(pl_recp, pl_rec, sizeof(struct bfa_plog_rec_s)); 333 memcpy(pl_recp, pl_rec, sizeof(struct bfa_plog_rec_s));
334 334
335 pl_recp->tv = bfa_os_get_log_time(); 335 pl_recp->tv = bfa_os_get_log_time();
336 BFA_PL_LOG_REC_INCR(plog->tail); 336 BFA_PL_LOG_REC_INCR(plog->tail);
@@ -342,9 +342,9 @@ bfa_plog_add(struct bfa_plog_s *plog, struct bfa_plog_rec_s *pl_rec)
342void 342void
343bfa_plog_init(struct bfa_plog_s *plog) 343bfa_plog_init(struct bfa_plog_s *plog)
344{ 344{
345 bfa_os_memset((char *)plog, 0, sizeof(struct bfa_plog_s)); 345 memset((char *)plog, 0, sizeof(struct bfa_plog_s));
346 346
347 bfa_os_memcpy(plog->plog_sig, BFA_PL_SIG_STR, BFA_PL_SIG_LEN); 347 memcpy(plog->plog_sig, BFA_PL_SIG_STR, BFA_PL_SIG_LEN);
348 plog->head = plog->tail = 0; 348 plog->head = plog->tail = 0;
349 plog->plog_enabled = 1; 349 plog->plog_enabled = 1;
350} 350}
@@ -357,7 +357,7 @@ bfa_plog_str(struct bfa_plog_s *plog, enum bfa_plog_mid mid,
357 struct bfa_plog_rec_s lp; 357 struct bfa_plog_rec_s lp;
358 358
359 if (plog->plog_enabled) { 359 if (plog->plog_enabled) {
360 bfa_os_memset(&lp, 0, sizeof(struct bfa_plog_rec_s)); 360 memset(&lp, 0, sizeof(struct bfa_plog_rec_s));
361 lp.mid = mid; 361 lp.mid = mid;
362 lp.eid = event; 362 lp.eid = event;
363 lp.log_type = BFA_PL_LOG_TYPE_STRING; 363 lp.log_type = BFA_PL_LOG_TYPE_STRING;
@@ -381,15 +381,14 @@ bfa_plog_intarr(struct bfa_plog_s *plog, enum bfa_plog_mid mid,
381 num_ints = BFA_PL_INT_LOG_SZ; 381 num_ints = BFA_PL_INT_LOG_SZ;
382 382
383 if (plog->plog_enabled) { 383 if (plog->plog_enabled) {
384 bfa_os_memset(&lp, 0, sizeof(struct bfa_plog_rec_s)); 384 memset(&lp, 0, sizeof(struct bfa_plog_rec_s));
385 lp.mid = mid; 385 lp.mid = mid;
386 lp.eid = event; 386 lp.eid = event;
387 lp.log_type = BFA_PL_LOG_TYPE_INT; 387 lp.log_type = BFA_PL_LOG_TYPE_INT;
388 lp.misc = misc; 388 lp.misc = misc;
389 389
390 for (i = 0; i < num_ints; i++) 390 for (i = 0; i < num_ints; i++)
391 bfa_os_assign(lp.log_entry.int_log[i], 391 lp.log_entry.int_log[i] = intarr[i];
392 intarr[i]);
393 392
394 lp.log_num_ints = (u8) num_ints; 393 lp.log_num_ints = (u8) num_ints;
395 394
@@ -407,7 +406,7 @@ bfa_plog_fchdr(struct bfa_plog_s *plog, enum bfa_plog_mid mid,
407 u32 ints[BFA_PL_INT_LOG_SZ]; 406 u32 ints[BFA_PL_INT_LOG_SZ];
408 407
409 if (plog->plog_enabled) { 408 if (plog->plog_enabled) {
410 bfa_os_memset(&lp, 0, sizeof(struct bfa_plog_rec_s)); 409 memset(&lp, 0, sizeof(struct bfa_plog_rec_s));
411 410
412 ints[0] = tmp_int[0]; 411 ints[0] = tmp_int[0];
413 ints[1] = tmp_int[1]; 412 ints[1] = tmp_int[1];
@@ -427,7 +426,7 @@ bfa_plog_fchdr_and_pl(struct bfa_plog_s *plog, enum bfa_plog_mid mid,
427 u32 ints[BFA_PL_INT_LOG_SZ]; 426 u32 ints[BFA_PL_INT_LOG_SZ];
428 427
429 if (plog->plog_enabled) { 428 if (plog->plog_enabled) {
430 bfa_os_memset(&lp, 0, sizeof(struct bfa_plog_rec_s)); 429 memset(&lp, 0, sizeof(struct bfa_plog_rec_s));
431 430
432 ints[0] = tmp_int[0]; 431 ints[0] = tmp_int[0];
433 ints[1] = tmp_int[1]; 432 ints[1] = tmp_int[1];
@@ -485,7 +484,7 @@ claim_fcxp_req_rsp_mem(struct bfa_fcxp_mod_s *mod, struct bfa_meminfo_s *mi)
485 mod->req_pld_list_pa = dm_pa; 484 mod->req_pld_list_pa = dm_pa;
486 dm_kva += buf_pool_sz; 485 dm_kva += buf_pool_sz;
487 dm_pa += buf_pool_sz; 486 dm_pa += buf_pool_sz;
488 bfa_os_memset(mod->req_pld_list_kva, 0, buf_pool_sz); 487 memset(mod->req_pld_list_kva, 0, buf_pool_sz);
489 488
490 /* 489 /*
491 * Initialize the fcxp rsp payload list 490 * Initialize the fcxp rsp payload list
@@ -495,7 +494,7 @@ claim_fcxp_req_rsp_mem(struct bfa_fcxp_mod_s *mod, struct bfa_meminfo_s *mi)
495 mod->rsp_pld_list_pa = dm_pa; 494 mod->rsp_pld_list_pa = dm_pa;
496 dm_kva += buf_pool_sz; 495 dm_kva += buf_pool_sz;
497 dm_pa += buf_pool_sz; 496 dm_pa += buf_pool_sz;
498 bfa_os_memset(mod->rsp_pld_list_kva, 0, buf_pool_sz); 497 memset(mod->rsp_pld_list_kva, 0, buf_pool_sz);
499 498
500 bfa_meminfo_dma_virt(mi) = dm_kva; 499 bfa_meminfo_dma_virt(mi) = dm_kva;
501 bfa_meminfo_dma_phys(mi) = dm_pa; 500 bfa_meminfo_dma_phys(mi) = dm_pa;
@@ -508,7 +507,7 @@ claim_fcxps_mem(struct bfa_fcxp_mod_s *mod, struct bfa_meminfo_s *mi)
508 struct bfa_fcxp_s *fcxp; 507 struct bfa_fcxp_s *fcxp;
509 508
510 fcxp = (struct bfa_fcxp_s *) bfa_meminfo_kva(mi); 509 fcxp = (struct bfa_fcxp_s *) bfa_meminfo_kva(mi);
511 bfa_os_memset(fcxp, 0, sizeof(struct bfa_fcxp_s) * mod->num_fcxps); 510 memset(fcxp, 0, sizeof(struct bfa_fcxp_s) * mod->num_fcxps);
512 511
513 INIT_LIST_HEAD(&mod->fcxp_free_q); 512 INIT_LIST_HEAD(&mod->fcxp_free_q);
514 INIT_LIST_HEAD(&mod->fcxp_active_q); 513 INIT_LIST_HEAD(&mod->fcxp_active_q);
@@ -559,7 +558,7 @@ bfa_fcxp_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
559{ 558{
560 struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa); 559 struct bfa_fcxp_mod_s *mod = BFA_FCXP_MOD(bfa);
561 560
562 bfa_os_memset(mod, 0, sizeof(struct bfa_fcxp_mod_s)); 561 memset(mod, 0, sizeof(struct bfa_fcxp_mod_s));
563 mod->bfa = bfa; 562 mod->bfa = bfa;
564 mod->num_fcxps = cfg->fwcfg.num_fcxp_reqs; 563 mod->num_fcxps = cfg->fwcfg.num_fcxp_reqs;
565 564
@@ -1479,7 +1478,7 @@ bfa_lps_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
1479 struct bfa_lps_s *lps; 1478 struct bfa_lps_s *lps;
1480 int i; 1479 int i;
1481 1480
1482 bfa_os_memset(mod, 0, sizeof(struct bfa_lps_mod_s)); 1481 memset(mod, 0, sizeof(struct bfa_lps_mod_s));
1483 mod->num_lps = BFA_LPS_MAX_LPORTS; 1482 mod->num_lps = BFA_LPS_MAX_LPORTS;
1484 if (cfg->drvcfg.min_cfg) 1483 if (cfg->drvcfg.min_cfg)
1485 mod->num_lps = BFA_LPS_MIN_LPORTS; 1484 mod->num_lps = BFA_LPS_MIN_LPORTS;
@@ -2909,7 +2908,7 @@ bfa_fcport_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
2909 struct bfa_fcport_ln_s *ln = &fcport->ln; 2908 struct bfa_fcport_ln_s *ln = &fcport->ln;
2910 struct bfa_timeval_s tv; 2909 struct bfa_timeval_s tv;
2911 2910
2912 bfa_os_memset(fcport, 0, sizeof(struct bfa_fcport_s)); 2911 memset(fcport, 0, sizeof(struct bfa_fcport_s));
2913 fcport->bfa = bfa; 2912 fcport->bfa = bfa;
2914 ln->fcport = fcport; 2913 ln->fcport = fcport;
2915 2914
@@ -2986,9 +2985,8 @@ bfa_fcport_update_linkinfo(struct bfa_fcport_s *fcport)
2986 fcport->myalpa = 0; 2985 fcport->myalpa = 0;
2987 2986
2988 /* QoS Details */ 2987 /* QoS Details */
2989 bfa_os_assign(fcport->qos_attr, pevent->link_state.qos_attr); 2988 fcport->qos_attr = pevent->link_state.qos_attr;
2990 bfa_os_assign(fcport->qos_vc_attr, 2989 fcport->qos_vc_attr = pevent->link_state.vc_fcf.qos_vc_attr;
2991 pevent->link_state.vc_fcf.qos_vc_attr);
2992 2990
2993 /** 2991 /**
2994 * update trunk state if applicable 2992 * update trunk state if applicable
@@ -3223,7 +3221,7 @@ bfa_fcport_send_stats_get(void *cbarg)
3223 } 3221 }
3224 fcport->stats_qfull = BFA_FALSE; 3222 fcport->stats_qfull = BFA_FALSE;
3225 3223
3226 bfa_os_memset(msg, 0, sizeof(struct bfi_fcport_req_s)); 3224 memset(msg, 0, sizeof(struct bfi_fcport_req_s));
3227 bfi_h2i_set(msg->mh, BFI_MC_FCPORT, BFI_FCPORT_H2I_STATS_GET_REQ, 3225 bfi_h2i_set(msg->mh, BFI_MC_FCPORT, BFI_FCPORT_H2I_STATS_GET_REQ,
3228 bfa_lpuid(fcport->bfa)); 3226 bfa_lpuid(fcport->bfa));
3229 bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT); 3227 bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT);
@@ -3285,7 +3283,7 @@ bfa_fcport_send_stats_clear(void *cbarg)
3285 } 3283 }
3286 fcport->stats_qfull = BFA_FALSE; 3284 fcport->stats_qfull = BFA_FALSE;
3287 3285
3288 bfa_os_memset(msg, 0, sizeof(struct bfi_fcport_req_s)); 3286 memset(msg, 0, sizeof(struct bfi_fcport_req_s));
3289 bfi_h2i_set(msg->mh, BFI_MC_FCPORT, BFI_FCPORT_H2I_STATS_CLEAR_REQ, 3287 bfi_h2i_set(msg->mh, BFI_MC_FCPORT, BFI_FCPORT_H2I_STATS_CLEAR_REQ,
3290 bfa_lpuid(fcport->bfa)); 3288 bfa_lpuid(fcport->bfa));
3291 bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT); 3289 bfa_reqq_produce(fcport->bfa, BFA_REQQ_PORT);
@@ -3729,7 +3727,7 @@ bfa_fcport_get_attr(struct bfa_s *bfa, struct bfa_port_attr_s *attr)
3729{ 3727{
3730 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa); 3728 struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
3731 3729
3732 bfa_os_memset(attr, 0, sizeof(struct bfa_port_attr_s)); 3730 memset(attr, 0, sizeof(struct bfa_port_attr_s));
3733 3731
3734 attr->nwwn = fcport->nwwn; 3732 attr->nwwn = fcport->nwwn;
3735 attr->pwwn = fcport->pwwn; 3733 attr->pwwn = fcport->pwwn;
@@ -3737,7 +3735,7 @@ bfa_fcport_get_attr(struct bfa_s *bfa, struct bfa_port_attr_s *attr)
3737 attr->factorypwwn = bfa_ioc_get_mfg_pwwn(&bfa->ioc); 3735 attr->factorypwwn = bfa_ioc_get_mfg_pwwn(&bfa->ioc);
3738 attr->factorynwwn = bfa_ioc_get_mfg_nwwn(&bfa->ioc); 3736 attr->factorynwwn = bfa_ioc_get_mfg_nwwn(&bfa->ioc);
3739 3737
3740 bfa_os_memcpy(&attr->pport_cfg, &fcport->cfg, 3738 memcpy(&attr->pport_cfg, &fcport->cfg,
3741 sizeof(struct bfa_port_cfg_s)); 3739 sizeof(struct bfa_port_cfg_s));
3742 /* speed attributes */ 3740 /* speed attributes */
3743 attr->pport_cfg.speed = fcport->cfg.speed; 3741 attr->pport_cfg.speed = fcport->cfg.speed;
@@ -4612,7 +4610,7 @@ bfa_rport_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
4612 !(mod->num_rports & (mod->num_rports - 1))); 4610 !(mod->num_rports & (mod->num_rports - 1)));
4613 4611
4614 for (i = 0; i < mod->num_rports; i++, rp++) { 4612 for (i = 0; i < mod->num_rports; i++, rp++) {
4615 bfa_os_memset(rp, 0, sizeof(struct bfa_rport_s)); 4613 memset(rp, 0, sizeof(struct bfa_rport_s));
4616 rp->bfa = bfa; 4614 rp->bfa = bfa;
4617 rp->rport_tag = i; 4615 rp->rport_tag = i;
4618 bfa_sm_set_state(rp, bfa_rport_sm_uninit); 4616 bfa_sm_set_state(rp, bfa_rport_sm_uninit);
@@ -4858,7 +4856,7 @@ bfa_rport_online(struct bfa_rport_s *rport, struct bfa_rport_info_s *rport_info)
4858 rport_info->max_frmsz = FC_MIN_PDUSZ; 4856 rport_info->max_frmsz = FC_MIN_PDUSZ;
4859 } 4857 }
4860 4858
4861 bfa_os_assign(rport->rport_info, *rport_info); 4859 rport->rport_info = *rport_info;
4862 bfa_sm_send_event(rport, BFA_RPORT_SM_ONLINE); 4860 bfa_sm_send_event(rport, BFA_RPORT_SM_ONLINE);
4863} 4861}
4864 4862
@@ -4897,7 +4895,7 @@ bfa_rport_get_qos_attr(struct bfa_rport_s *rport,
4897void 4895void
4898bfa_rport_clear_stats(struct bfa_rport_s *rport) 4896bfa_rport_clear_stats(struct bfa_rport_s *rport)
4899{ 4897{
4900 bfa_os_memset(&rport->stats, 0, sizeof(rport->stats)); 4898 memset(&rport->stats, 0, sizeof(rport->stats));
4901} 4899}
4902 4900
4903 4901
@@ -4957,8 +4955,8 @@ bfa_sgpg_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
4957 bfa_assert(!(sgpg_pa.pa & (sizeof(struct bfi_sgpg_s) - 1))); 4955 bfa_assert(!(sgpg_pa.pa & (sizeof(struct bfi_sgpg_s) - 1)));
4958 4956
4959 for (i = 0; i < mod->num_sgpgs; i++) { 4957 for (i = 0; i < mod->num_sgpgs; i++) {
4960 bfa_os_memset(hsgpg, 0, sizeof(*hsgpg)); 4958 memset(hsgpg, 0, sizeof(*hsgpg));
4961 bfa_os_memset(sgpg, 0, sizeof(*sgpg)); 4959 memset(sgpg, 0, sizeof(*sgpg));
4962 4960
4963 hsgpg->sgpg = sgpg; 4961 hsgpg->sgpg = sgpg;
4964 sgpg_pa_tmp.pa = bfa_sgaddr_le(sgpg_pa.pa); 4962 sgpg_pa_tmp.pa = bfa_sgaddr_le(sgpg_pa.pa);
@@ -5136,7 +5134,7 @@ claim_uf_pbs(struct bfa_uf_mod_s *ufm, struct bfa_meminfo_s *mi)
5136 bfa_meminfo_dma_virt(mi) += uf_pb_tot_sz; 5134 bfa_meminfo_dma_virt(mi) += uf_pb_tot_sz;
5137 bfa_meminfo_dma_phys(mi) += uf_pb_tot_sz; 5135 bfa_meminfo_dma_phys(mi) += uf_pb_tot_sz;
5138 5136
5139 bfa_os_memset((void *)ufm->uf_pbs_kva, 0, uf_pb_tot_sz); 5137 memset((void *)ufm->uf_pbs_kva, 0, uf_pb_tot_sz);
5140} 5138}
5141 5139
5142static void 5140static void
@@ -5153,7 +5151,7 @@ claim_uf_post_msgs(struct bfa_uf_mod_s *ufm, struct bfa_meminfo_s *mi)
5153 5151
5154 for (i = 0, uf_bp_msg = ufm->uf_buf_posts; i < ufm->num_ufs; 5152 for (i = 0, uf_bp_msg = ufm->uf_buf_posts; i < ufm->num_ufs;
5155 i++, uf_bp_msg++) { 5153 i++, uf_bp_msg++) {
5156 bfa_os_memset(uf_bp_msg, 0, sizeof(struct bfi_uf_buf_post_s)); 5154 memset(uf_bp_msg, 0, sizeof(struct bfi_uf_buf_post_s));
5157 5155
5158 uf_bp_msg->buf_tag = i; 5156 uf_bp_msg->buf_tag = i;
5159 buf_len = sizeof(struct bfa_uf_buf_s); 5157 buf_len = sizeof(struct bfa_uf_buf_s);
@@ -5194,7 +5192,7 @@ claim_ufs(struct bfa_uf_mod_s *ufm, struct bfa_meminfo_s *mi)
5194 * Initialize UFs and queue it in UF free queue 5192 * Initialize UFs and queue it in UF free queue
5195 */ 5193 */
5196 for (i = 0, uf = ufm->uf_list; i < ufm->num_ufs; i++, uf++) { 5194 for (i = 0, uf = ufm->uf_list; i < ufm->num_ufs; i++, uf++) {
5197 bfa_os_memset(uf, 0, sizeof(struct bfa_uf_s)); 5195 memset(uf, 0, sizeof(struct bfa_uf_s));
5198 uf->bfa = ufm->bfa; 5196 uf->bfa = ufm->bfa;
5199 uf->uf_tag = i; 5197 uf->uf_tag = i;
5200 uf->pb_len = sizeof(struct bfa_uf_buf_s); 5198 uf->pb_len = sizeof(struct bfa_uf_buf_s);
@@ -5241,7 +5239,7 @@ bfa_uf_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
5241{ 5239{
5242 struct bfa_uf_mod_s *ufm = BFA_UF_MOD(bfa); 5240 struct bfa_uf_mod_s *ufm = BFA_UF_MOD(bfa);
5243 5241
5244 bfa_os_memset(ufm, 0, sizeof(struct bfa_uf_mod_s)); 5242 memset(ufm, 0, sizeof(struct bfa_uf_mod_s));
5245 ufm->bfa = bfa; 5243 ufm->bfa = bfa;
5246 ufm->num_ufs = cfg->fwcfg.num_uf_bufs; 5244 ufm->num_ufs = cfg->fwcfg.num_uf_bufs;
5247 INIT_LIST_HEAD(&ufm->uf_free_q); 5245 INIT_LIST_HEAD(&ufm->uf_free_q);
@@ -5279,7 +5277,7 @@ bfa_uf_post(struct bfa_uf_mod_s *ufm, struct bfa_uf_s *uf)
5279 if (!uf_post_msg) 5277 if (!uf_post_msg)
5280 return BFA_STATUS_FAILED; 5278 return BFA_STATUS_FAILED;
5281 5279
5282 bfa_os_memcpy(uf_post_msg, &ufm->uf_buf_posts[uf->uf_tag], 5280 memcpy(uf_post_msg, &ufm->uf_buf_posts[uf->uf_tag],
5283 sizeof(struct bfi_uf_buf_post_s)); 5281 sizeof(struct bfi_uf_buf_post_s));
5284 bfa_reqq_produce(ufm->bfa, BFA_REQQ_FCXP); 5282 bfa_reqq_produce(ufm->bfa, BFA_REQQ_FCXP);
5285 5283