diff options
Diffstat (limited to 'drivers/scsi/bfa/bfad_bsg.c')
-rw-r--r-- | drivers/scsi/bfa/bfad_bsg.c | 1082 |
1 files changed, 1077 insertions, 5 deletions
diff --git a/drivers/scsi/bfa/bfad_bsg.c b/drivers/scsi/bfa/bfad_bsg.c index 89f863ed233..06fc00caeb4 100644 --- a/drivers/scsi/bfa/bfad_bsg.c +++ b/drivers/scsi/bfa/bfad_bsg.c | |||
@@ -56,7 +56,7 @@ bfad_iocmd_ioc_disable(struct bfad_s *bfad, void *cmd) | |||
56 | spin_lock_irqsave(&bfad->bfad_lock, flags); | 56 | spin_lock_irqsave(&bfad->bfad_lock, flags); |
57 | if (bfad->disable_active) { | 57 | if (bfad->disable_active) { |
58 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | 58 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); |
59 | return EBUSY; | 59 | return -EBUSY; |
60 | } | 60 | } |
61 | 61 | ||
62 | bfad->disable_active = BFA_TRUE; | 62 | bfad->disable_active = BFA_TRUE; |
@@ -90,6 +90,7 @@ bfad_iocmd_ioc_get_info(struct bfad_s *bfad, void *cmd) | |||
90 | bfa_get_adapter_serial_num(&bfad->bfa, iocmd->serialnum); | 90 | bfa_get_adapter_serial_num(&bfad->bfa, iocmd->serialnum); |
91 | iocmd->factorynwwn = pattr.factorynwwn; | 91 | iocmd->factorynwwn = pattr.factorynwwn; |
92 | iocmd->factorypwwn = pattr.factorypwwn; | 92 | iocmd->factorypwwn = pattr.factorypwwn; |
93 | iocmd->bfad_num = bfad->inst_no; | ||
93 | im_port = bfad->pport.im_port; | 94 | im_port = bfad->pport.im_port; |
94 | iocmd->host = im_port->shost->host_no; | 95 | iocmd->host = im_port->shost->host_no; |
95 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | 96 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); |
@@ -178,6 +179,38 @@ out: | |||
178 | } | 179 | } |
179 | 180 | ||
180 | int | 181 | int |
182 | bfad_iocmd_ioc_reset_stats(struct bfad_s *bfad, void *cmd, unsigned int v_cmd) | ||
183 | { | ||
184 | struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd; | ||
185 | unsigned long flags; | ||
186 | |||
187 | if (v_cmd == IOCMD_IOC_RESET_STATS) { | ||
188 | bfa_ioc_clear_stats(&bfad->bfa); | ||
189 | iocmd->status = BFA_STATUS_OK; | ||
190 | } else if (v_cmd == IOCMD_IOC_RESET_FWSTATS) { | ||
191 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
192 | iocmd->status = bfa_ioc_fw_stats_clear(&bfad->bfa.ioc); | ||
193 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
194 | } | ||
195 | |||
196 | return 0; | ||
197 | } | ||
198 | |||
199 | int | ||
200 | bfad_iocmd_ioc_set_name(struct bfad_s *bfad, void *cmd, unsigned int v_cmd) | ||
201 | { | ||
202 | struct bfa_bsg_ioc_name_s *iocmd = (struct bfa_bsg_ioc_name_s *) cmd; | ||
203 | |||
204 | if (v_cmd == IOCMD_IOC_SET_ADAPTER_NAME) | ||
205 | strcpy(bfad->adapter_name, iocmd->name); | ||
206 | else if (v_cmd == IOCMD_IOC_SET_PORT_NAME) | ||
207 | strcpy(bfad->port_name, iocmd->name); | ||
208 | |||
209 | iocmd->status = BFA_STATUS_OK; | ||
210 | return 0; | ||
211 | } | ||
212 | |||
213 | int | ||
181 | bfad_iocmd_iocfc_get_attr(struct bfad_s *bfad, void *cmd) | 214 | bfad_iocmd_iocfc_get_attr(struct bfad_s *bfad, void *cmd) |
182 | { | 215 | { |
183 | struct bfa_bsg_iocfc_attr_s *iocmd = (struct bfa_bsg_iocfc_attr_s *)cmd; | 216 | struct bfa_bsg_iocfc_attr_s *iocmd = (struct bfa_bsg_iocfc_attr_s *)cmd; |
@@ -306,6 +339,81 @@ out: | |||
306 | return 0; | 339 | return 0; |
307 | } | 340 | } |
308 | 341 | ||
342 | int | ||
343 | bfad_iocmd_port_reset_stats(struct bfad_s *bfad, void *cmd) | ||
344 | { | ||
345 | struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd; | ||
346 | struct bfad_hal_comp fcomp; | ||
347 | unsigned long flags; | ||
348 | |||
349 | init_completion(&fcomp.comp); | ||
350 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
351 | iocmd->status = bfa_port_clear_stats(&bfad->bfa.modules.port, | ||
352 | bfad_hcb_comp, &fcomp); | ||
353 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
354 | if (iocmd->status != BFA_STATUS_OK) { | ||
355 | bfa_trc(bfad, iocmd->status); | ||
356 | return 0; | ||
357 | } | ||
358 | wait_for_completion(&fcomp.comp); | ||
359 | iocmd->status = fcomp.status; | ||
360 | return 0; | ||
361 | } | ||
362 | |||
363 | int | ||
364 | bfad_iocmd_set_port_cfg(struct bfad_s *bfad, void *iocmd, unsigned int v_cmd) | ||
365 | { | ||
366 | struct bfa_bsg_port_cfg_s *cmd = (struct bfa_bsg_port_cfg_s *)iocmd; | ||
367 | unsigned long flags; | ||
368 | |||
369 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
370 | if (v_cmd == IOCMD_PORT_CFG_TOPO) | ||
371 | cmd->status = bfa_fcport_cfg_topology(&bfad->bfa, cmd->param); | ||
372 | else if (v_cmd == IOCMD_PORT_CFG_SPEED) | ||
373 | cmd->status = bfa_fcport_cfg_speed(&bfad->bfa, cmd->param); | ||
374 | else if (v_cmd == IOCMD_PORT_CFG_ALPA) | ||
375 | cmd->status = bfa_fcport_cfg_hardalpa(&bfad->bfa, cmd->param); | ||
376 | else if (v_cmd == IOCMD_PORT_CLR_ALPA) | ||
377 | cmd->status = bfa_fcport_clr_hardalpa(&bfad->bfa); | ||
378 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
379 | |||
380 | return 0; | ||
381 | } | ||
382 | |||
383 | int | ||
384 | bfad_iocmd_port_cfg_maxfrsize(struct bfad_s *bfad, void *cmd) | ||
385 | { | ||
386 | struct bfa_bsg_port_cfg_maxfrsize_s *iocmd = | ||
387 | (struct bfa_bsg_port_cfg_maxfrsize_s *)cmd; | ||
388 | unsigned long flags; | ||
389 | |||
390 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
391 | iocmd->status = bfa_fcport_cfg_maxfrsize(&bfad->bfa, iocmd->maxfrsize); | ||
392 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
393 | |||
394 | return 0; | ||
395 | } | ||
396 | |||
397 | int | ||
398 | bfad_iocmd_port_cfg_bbsc(struct bfad_s *bfad, void *cmd, unsigned int v_cmd) | ||
399 | { | ||
400 | struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd; | ||
401 | struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(&bfad->bfa); | ||
402 | unsigned long flags; | ||
403 | |||
404 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
405 | if (bfa_ioc_get_type(&bfad->bfa.ioc) == BFA_IOC_TYPE_FC) { | ||
406 | if (v_cmd == IOCMD_PORT_BBSC_ENABLE) | ||
407 | fcport->cfg.bb_scn_state = BFA_TRUE; | ||
408 | else if (v_cmd == IOCMD_PORT_BBSC_DISABLE) | ||
409 | fcport->cfg.bb_scn_state = BFA_FALSE; | ||
410 | } | ||
411 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
412 | |||
413 | iocmd->status = BFA_STATUS_OK; | ||
414 | return 0; | ||
415 | } | ||
416 | |||
309 | static int | 417 | static int |
310 | bfad_iocmd_lport_get_attr(struct bfad_s *bfad, void *cmd) | 418 | bfad_iocmd_lport_get_attr(struct bfad_s *bfad, void *cmd) |
311 | { | 419 | { |
@@ -354,6 +462,40 @@ out: | |||
354 | } | 462 | } |
355 | 463 | ||
356 | int | 464 | int |
465 | bfad_iocmd_lport_reset_stats(struct bfad_s *bfad, void *cmd) | ||
466 | { | ||
467 | struct bfa_fcs_lport_s *fcs_port; | ||
468 | struct bfa_bsg_reset_stats_s *iocmd = | ||
469 | (struct bfa_bsg_reset_stats_s *)cmd; | ||
470 | struct bfa_fcpim_s *fcpim = BFA_FCPIM(&bfad->bfa); | ||
471 | struct list_head *qe, *qen; | ||
472 | struct bfa_itnim_s *itnim; | ||
473 | unsigned long flags; | ||
474 | |||
475 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
476 | fcs_port = bfa_fcs_lookup_port(&bfad->bfa_fcs, | ||
477 | iocmd->vf_id, iocmd->vpwwn); | ||
478 | if (fcs_port == NULL) { | ||
479 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
480 | iocmd->status = BFA_STATUS_UNKNOWN_LWWN; | ||
481 | goto out; | ||
482 | } | ||
483 | |||
484 | bfa_fcs_lport_clear_stats(fcs_port); | ||
485 | /* clear IO stats from all active itnims */ | ||
486 | list_for_each_safe(qe, qen, &fcpim->itnim_q) { | ||
487 | itnim = (struct bfa_itnim_s *) qe; | ||
488 | if (itnim->rport->rport_info.lp_tag != fcs_port->lp_tag) | ||
489 | continue; | ||
490 | bfa_itnim_clear_stats(itnim); | ||
491 | } | ||
492 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
493 | iocmd->status = BFA_STATUS_OK; | ||
494 | out: | ||
495 | return 0; | ||
496 | } | ||
497 | |||
498 | int | ||
357 | bfad_iocmd_lport_get_iostats(struct bfad_s *bfad, void *cmd) | 499 | bfad_iocmd_lport_get_iostats(struct bfad_s *bfad, void *cmd) |
358 | { | 500 | { |
359 | struct bfa_fcs_lport_s *fcs_port; | 501 | struct bfa_fcs_lport_s *fcs_port; |
@@ -389,7 +531,7 @@ bfad_iocmd_lport_get_rports(struct bfad_s *bfad, void *cmd, | |||
389 | void *iocmd_bufptr; | 531 | void *iocmd_bufptr; |
390 | 532 | ||
391 | if (iocmd->nrports == 0) | 533 | if (iocmd->nrports == 0) |
392 | return EINVAL; | 534 | return -EINVAL; |
393 | 535 | ||
394 | if (bfad_chk_iocmd_sz(payload_len, | 536 | if (bfad_chk_iocmd_sz(payload_len, |
395 | sizeof(struct bfa_bsg_lport_get_rports_s), | 537 | sizeof(struct bfa_bsg_lport_get_rports_s), |
@@ -539,6 +681,152 @@ out: | |||
539 | return 0; | 681 | return 0; |
540 | } | 682 | } |
541 | 683 | ||
684 | int | ||
685 | bfad_iocmd_rport_clr_stats(struct bfad_s *bfad, void *cmd) | ||
686 | { | ||
687 | struct bfa_bsg_rport_reset_stats_s *iocmd = | ||
688 | (struct bfa_bsg_rport_reset_stats_s *)cmd; | ||
689 | struct bfa_fcs_lport_s *fcs_port; | ||
690 | struct bfa_fcs_rport_s *fcs_rport; | ||
691 | struct bfa_rport_s *rport; | ||
692 | unsigned long flags; | ||
693 | |||
694 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
695 | fcs_port = bfa_fcs_lookup_port(&bfad->bfa_fcs, | ||
696 | iocmd->vf_id, iocmd->pwwn); | ||
697 | if (fcs_port == NULL) { | ||
698 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
699 | iocmd->status = BFA_STATUS_UNKNOWN_LWWN; | ||
700 | goto out; | ||
701 | } | ||
702 | |||
703 | fcs_rport = bfa_fcs_rport_lookup(fcs_port, iocmd->rpwwn); | ||
704 | if (fcs_rport == NULL) { | ||
705 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
706 | iocmd->status = BFA_STATUS_UNKNOWN_RWWN; | ||
707 | goto out; | ||
708 | } | ||
709 | |||
710 | memset((char *)&fcs_rport->stats, 0, sizeof(struct bfa_rport_stats_s)); | ||
711 | rport = bfa_fcs_rport_get_halrport(fcs_rport); | ||
712 | memset(&rport->stats, 0, sizeof(rport->stats)); | ||
713 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
714 | iocmd->status = BFA_STATUS_OK; | ||
715 | out: | ||
716 | return 0; | ||
717 | } | ||
718 | |||
719 | int | ||
720 | bfad_iocmd_rport_set_speed(struct bfad_s *bfad, void *cmd) | ||
721 | { | ||
722 | struct bfa_bsg_rport_set_speed_s *iocmd = | ||
723 | (struct bfa_bsg_rport_set_speed_s *)cmd; | ||
724 | struct bfa_fcs_lport_s *fcs_port; | ||
725 | struct bfa_fcs_rport_s *fcs_rport; | ||
726 | unsigned long flags; | ||
727 | |||
728 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
729 | fcs_port = bfa_fcs_lookup_port(&bfad->bfa_fcs, | ||
730 | iocmd->vf_id, iocmd->pwwn); | ||
731 | if (fcs_port == NULL) { | ||
732 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
733 | iocmd->status = BFA_STATUS_UNKNOWN_LWWN; | ||
734 | goto out; | ||
735 | } | ||
736 | |||
737 | fcs_rport = bfa_fcs_rport_lookup(fcs_port, iocmd->rpwwn); | ||
738 | if (fcs_rport == NULL) { | ||
739 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
740 | iocmd->status = BFA_STATUS_UNKNOWN_RWWN; | ||
741 | goto out; | ||
742 | } | ||
743 | |||
744 | fcs_rport->rpf.assigned_speed = iocmd->speed; | ||
745 | /* Set this speed in f/w only if the RPSC speed is not available */ | ||
746 | if (fcs_rport->rpf.rpsc_speed == BFA_PORT_SPEED_UNKNOWN) | ||
747 | bfa_rport_speed(fcs_rport->bfa_rport, iocmd->speed); | ||
748 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
749 | iocmd->status = BFA_STATUS_OK; | ||
750 | out: | ||
751 | return 0; | ||
752 | } | ||
753 | |||
754 | int | ||
755 | bfad_iocmd_vport_get_attr(struct bfad_s *bfad, void *cmd) | ||
756 | { | ||
757 | struct bfa_fcs_vport_s *fcs_vport; | ||
758 | struct bfa_bsg_vport_attr_s *iocmd = (struct bfa_bsg_vport_attr_s *)cmd; | ||
759 | unsigned long flags; | ||
760 | |||
761 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
762 | fcs_vport = bfa_fcs_vport_lookup(&bfad->bfa_fcs, | ||
763 | iocmd->vf_id, iocmd->vpwwn); | ||
764 | if (fcs_vport == NULL) { | ||
765 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
766 | iocmd->status = BFA_STATUS_UNKNOWN_VWWN; | ||
767 | goto out; | ||
768 | } | ||
769 | |||
770 | bfa_fcs_vport_get_attr(fcs_vport, &iocmd->vport_attr); | ||
771 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
772 | iocmd->status = BFA_STATUS_OK; | ||
773 | out: | ||
774 | return 0; | ||
775 | } | ||
776 | |||
777 | int | ||
778 | bfad_iocmd_vport_get_stats(struct bfad_s *bfad, void *cmd) | ||
779 | { | ||
780 | struct bfa_fcs_vport_s *fcs_vport; | ||
781 | struct bfa_bsg_vport_stats_s *iocmd = | ||
782 | (struct bfa_bsg_vport_stats_s *)cmd; | ||
783 | unsigned long flags; | ||
784 | |||
785 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
786 | fcs_vport = bfa_fcs_vport_lookup(&bfad->bfa_fcs, | ||
787 | iocmd->vf_id, iocmd->vpwwn); | ||
788 | if (fcs_vport == NULL) { | ||
789 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
790 | iocmd->status = BFA_STATUS_UNKNOWN_VWWN; | ||
791 | goto out; | ||
792 | } | ||
793 | |||
794 | memcpy((void *)&iocmd->vport_stats, (void *)&fcs_vport->vport_stats, | ||
795 | sizeof(struct bfa_vport_stats_s)); | ||
796 | memcpy((void *)&iocmd->vport_stats.port_stats, | ||
797 | (void *)&fcs_vport->lport.stats, | ||
798 | sizeof(struct bfa_lport_stats_s)); | ||
799 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
800 | iocmd->status = BFA_STATUS_OK; | ||
801 | out: | ||
802 | return 0; | ||
803 | } | ||
804 | |||
805 | int | ||
806 | bfad_iocmd_vport_clr_stats(struct bfad_s *bfad, void *cmd) | ||
807 | { | ||
808 | struct bfa_fcs_vport_s *fcs_vport; | ||
809 | struct bfa_bsg_reset_stats_s *iocmd = | ||
810 | (struct bfa_bsg_reset_stats_s *)cmd; | ||
811 | unsigned long flags; | ||
812 | |||
813 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
814 | fcs_vport = bfa_fcs_vport_lookup(&bfad->bfa_fcs, | ||
815 | iocmd->vf_id, iocmd->vpwwn); | ||
816 | if (fcs_vport == NULL) { | ||
817 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
818 | iocmd->status = BFA_STATUS_UNKNOWN_VWWN; | ||
819 | goto out; | ||
820 | } | ||
821 | |||
822 | memset(&fcs_vport->vport_stats, 0, sizeof(struct bfa_vport_stats_s)); | ||
823 | memset(&fcs_vport->lport.stats, 0, sizeof(struct bfa_lport_stats_s)); | ||
824 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
825 | iocmd->status = BFA_STATUS_OK; | ||
826 | out: | ||
827 | return 0; | ||
828 | } | ||
829 | |||
542 | static int | 830 | static int |
543 | bfad_iocmd_fabric_get_lports(struct bfad_s *bfad, void *cmd, | 831 | bfad_iocmd_fabric_get_lports(struct bfad_s *bfad, void *cmd, |
544 | unsigned int payload_len) | 832 | unsigned int payload_len) |
@@ -582,6 +870,66 @@ out: | |||
582 | } | 870 | } |
583 | 871 | ||
584 | int | 872 | int |
873 | bfad_iocmd_ratelim(struct bfad_s *bfad, unsigned int cmd, void *pcmd) | ||
874 | { | ||
875 | struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)pcmd; | ||
876 | struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(&bfad->bfa); | ||
877 | unsigned long flags; | ||
878 | |||
879 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
880 | |||
881 | if (cmd == IOCMD_RATELIM_ENABLE) | ||
882 | fcport->cfg.ratelimit = BFA_TRUE; | ||
883 | else if (cmd == IOCMD_RATELIM_DISABLE) | ||
884 | fcport->cfg.ratelimit = BFA_FALSE; | ||
885 | |||
886 | if (fcport->cfg.trl_def_speed == BFA_PORT_SPEED_UNKNOWN) | ||
887 | fcport->cfg.trl_def_speed = BFA_PORT_SPEED_1GBPS; | ||
888 | |||
889 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
890 | iocmd->status = BFA_STATUS_OK; | ||
891 | |||
892 | return 0; | ||
893 | } | ||
894 | |||
895 | int | ||
896 | bfad_iocmd_ratelim_speed(struct bfad_s *bfad, unsigned int cmd, void *pcmd) | ||
897 | { | ||
898 | struct bfa_bsg_trl_speed_s *iocmd = (struct bfa_bsg_trl_speed_s *)pcmd; | ||
899 | struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(&bfad->bfa); | ||
900 | unsigned long flags; | ||
901 | |||
902 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
903 | |||
904 | /* Auto and speeds greater than the supported speed, are invalid */ | ||
905 | if ((iocmd->speed == BFA_PORT_SPEED_AUTO) || | ||
906 | (iocmd->speed > fcport->speed_sup)) { | ||
907 | iocmd->status = BFA_STATUS_UNSUPP_SPEED; | ||
908 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
909 | return 0; | ||
910 | } | ||
911 | |||
912 | fcport->cfg.trl_def_speed = iocmd->speed; | ||
913 | iocmd->status = BFA_STATUS_OK; | ||
914 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
915 | |||
916 | return 0; | ||
917 | } | ||
918 | |||
919 | int | ||
920 | bfad_iocmd_cfg_fcpim(struct bfad_s *bfad, void *cmd) | ||
921 | { | ||
922 | struct bfa_bsg_fcpim_s *iocmd = (struct bfa_bsg_fcpim_s *)cmd; | ||
923 | unsigned long flags; | ||
924 | |||
925 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
926 | bfa_fcpim_path_tov_set(&bfad->bfa, iocmd->param); | ||
927 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
928 | iocmd->status = BFA_STATUS_OK; | ||
929 | return 0; | ||
930 | } | ||
931 | |||
932 | int | ||
585 | bfad_iocmd_fcpim_get_modstats(struct bfad_s *bfad, void *cmd) | 933 | bfad_iocmd_fcpim_get_modstats(struct bfad_s *bfad, void *cmd) |
586 | { | 934 | { |
587 | struct bfa_bsg_fcpim_modstats_s *iocmd = | 935 | struct bfa_bsg_fcpim_modstats_s *iocmd = |
@@ -604,6 +952,28 @@ bfad_iocmd_fcpim_get_modstats(struct bfad_s *bfad, void *cmd) | |||
604 | } | 952 | } |
605 | 953 | ||
606 | int | 954 | int |
955 | bfad_iocmd_fcpim_clr_modstats(struct bfad_s *bfad, void *cmd) | ||
956 | { | ||
957 | struct bfa_bsg_fcpim_modstatsclr_s *iocmd = | ||
958 | (struct bfa_bsg_fcpim_modstatsclr_s *)cmd; | ||
959 | struct bfa_fcpim_s *fcpim = BFA_FCPIM(&bfad->bfa); | ||
960 | struct list_head *qe, *qen; | ||
961 | struct bfa_itnim_s *itnim; | ||
962 | unsigned long flags; | ||
963 | |||
964 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
965 | list_for_each_safe(qe, qen, &fcpim->itnim_q) { | ||
966 | itnim = (struct bfa_itnim_s *) qe; | ||
967 | bfa_itnim_clear_stats(itnim); | ||
968 | } | ||
969 | memset(&fcpim->del_itn_stats, 0, | ||
970 | sizeof(struct bfa_fcpim_del_itn_stats_s)); | ||
971 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
972 | iocmd->status = BFA_STATUS_OK; | ||
973 | return 0; | ||
974 | } | ||
975 | |||
976 | int | ||
607 | bfad_iocmd_fcpim_get_del_itn_stats(struct bfad_s *bfad, void *cmd) | 977 | bfad_iocmd_fcpim_get_del_itn_stats(struct bfad_s *bfad, void *cmd) |
608 | { | 978 | { |
609 | struct bfa_bsg_fcpim_del_itn_stats_s *iocmd = | 979 | struct bfa_bsg_fcpim_del_itn_stats_s *iocmd = |
@@ -670,6 +1040,35 @@ bfad_iocmd_itnim_get_iostats(struct bfad_s *bfad, void *cmd) | |||
670 | } | 1040 | } |
671 | 1041 | ||
672 | static int | 1042 | static int |
1043 | bfad_iocmd_itnim_reset_stats(struct bfad_s *bfad, void *cmd) | ||
1044 | { | ||
1045 | struct bfa_bsg_rport_reset_stats_s *iocmd = | ||
1046 | (struct bfa_bsg_rport_reset_stats_s *)cmd; | ||
1047 | struct bfa_fcs_lport_s *fcs_port; | ||
1048 | struct bfa_fcs_itnim_s *itnim; | ||
1049 | unsigned long flags; | ||
1050 | |||
1051 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
1052 | fcs_port = bfa_fcs_lookup_port(&bfad->bfa_fcs, | ||
1053 | iocmd->vf_id, iocmd->pwwn); | ||
1054 | if (!fcs_port) | ||
1055 | iocmd->status = BFA_STATUS_UNKNOWN_LWWN; | ||
1056 | else { | ||
1057 | itnim = bfa_fcs_itnim_lookup(fcs_port, iocmd->rpwwn); | ||
1058 | if (itnim == NULL) | ||
1059 | iocmd->status = BFA_STATUS_UNKNOWN_RWWN; | ||
1060 | else { | ||
1061 | iocmd->status = BFA_STATUS_OK; | ||
1062 | bfa_fcs_itnim_stats_clear(fcs_port, iocmd->rpwwn); | ||
1063 | bfa_itnim_clear_stats(bfa_fcs_itnim_get_halitn(itnim)); | ||
1064 | } | ||
1065 | } | ||
1066 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
1067 | |||
1068 | return 0; | ||
1069 | } | ||
1070 | |||
1071 | static int | ||
673 | bfad_iocmd_itnim_get_itnstats(struct bfad_s *bfad, void *cmd) | 1072 | bfad_iocmd_itnim_get_itnstats(struct bfad_s *bfad, void *cmd) |
674 | { | 1073 | { |
675 | struct bfa_bsg_itnim_itnstats_s *iocmd = | 1074 | struct bfa_bsg_itnim_itnstats_s *iocmd = |
@@ -1511,11 +1910,545 @@ out: | |||
1511 | return 0; | 1910 | return 0; |
1512 | } | 1911 | } |
1513 | 1912 | ||
1913 | #define BFA_DEBUG_FW_CORE_CHUNK_SZ 0x4000U /* 16K chunks for FW dump */ | ||
1914 | int | ||
1915 | bfad_iocmd_debug_fw_core(struct bfad_s *bfad, void *cmd, | ||
1916 | unsigned int payload_len) | ||
1917 | { | ||
1918 | struct bfa_bsg_debug_s *iocmd = (struct bfa_bsg_debug_s *)cmd; | ||
1919 | void *iocmd_bufptr; | ||
1920 | unsigned long flags; | ||
1921 | |||
1922 | if (bfad_chk_iocmd_sz(payload_len, sizeof(struct bfa_bsg_debug_s), | ||
1923 | BFA_DEBUG_FW_CORE_CHUNK_SZ) != BFA_STATUS_OK) { | ||
1924 | iocmd->status = BFA_STATUS_VERSION_FAIL; | ||
1925 | return 0; | ||
1926 | } | ||
1927 | |||
1928 | if (iocmd->bufsz < BFA_DEBUG_FW_CORE_CHUNK_SZ || | ||
1929 | !IS_ALIGNED(iocmd->bufsz, sizeof(u16)) || | ||
1930 | !IS_ALIGNED(iocmd->offset, sizeof(u32))) { | ||
1931 | bfa_trc(bfad, BFA_DEBUG_FW_CORE_CHUNK_SZ); | ||
1932 | iocmd->status = BFA_STATUS_EINVAL; | ||
1933 | goto out; | ||
1934 | } | ||
1935 | |||
1936 | iocmd_bufptr = (char *)iocmd + sizeof(struct bfa_bsg_debug_s); | ||
1937 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
1938 | iocmd->status = bfa_ioc_debug_fwcore(&bfad->bfa.ioc, iocmd_bufptr, | ||
1939 | (u32 *)&iocmd->offset, &iocmd->bufsz); | ||
1940 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
1941 | out: | ||
1942 | return 0; | ||
1943 | } | ||
1944 | |||
1945 | int | ||
1946 | bfad_iocmd_debug_ctl(struct bfad_s *bfad, void *cmd, unsigned int v_cmd) | ||
1947 | { | ||
1948 | struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd; | ||
1949 | unsigned long flags; | ||
1950 | |||
1951 | if (v_cmd == IOCMD_DEBUG_FW_STATE_CLR) { | ||
1952 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
1953 | bfad->bfa.ioc.dbg_fwsave_once = BFA_TRUE; | ||
1954 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
1955 | } else if (v_cmd == IOCMD_DEBUG_PORTLOG_CLR) | ||
1956 | bfad->plog_buf.head = bfad->plog_buf.tail = 0; | ||
1957 | else if (v_cmd == IOCMD_DEBUG_START_DTRC) | ||
1958 | bfa_trc_init(bfad->trcmod); | ||
1959 | else if (v_cmd == IOCMD_DEBUG_STOP_DTRC) | ||
1960 | bfa_trc_stop(bfad->trcmod); | ||
1961 | |||
1962 | iocmd->status = BFA_STATUS_OK; | ||
1963 | return 0; | ||
1964 | } | ||
1965 | |||
1966 | int | ||
1967 | bfad_iocmd_porglog_ctl(struct bfad_s *bfad, void *cmd) | ||
1968 | { | ||
1969 | struct bfa_bsg_portlogctl_s *iocmd = (struct bfa_bsg_portlogctl_s *)cmd; | ||
1970 | |||
1971 | if (iocmd->ctl == BFA_TRUE) | ||
1972 | bfad->plog_buf.plog_enabled = 1; | ||
1973 | else | ||
1974 | bfad->plog_buf.plog_enabled = 0; | ||
1975 | |||
1976 | iocmd->status = BFA_STATUS_OK; | ||
1977 | return 0; | ||
1978 | } | ||
1979 | |||
1980 | int | ||
1981 | bfad_iocmd_fcpim_cfg_profile(struct bfad_s *bfad, void *cmd, unsigned int v_cmd) | ||
1982 | { | ||
1983 | struct bfa_bsg_fcpim_profile_s *iocmd = | ||
1984 | (struct bfa_bsg_fcpim_profile_s *)cmd; | ||
1985 | struct timeval tv; | ||
1986 | unsigned long flags; | ||
1987 | |||
1988 | do_gettimeofday(&tv); | ||
1989 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
1990 | if (v_cmd == IOCMD_FCPIM_PROFILE_ON) | ||
1991 | iocmd->status = bfa_fcpim_profile_on(&bfad->bfa, tv.tv_sec); | ||
1992 | else if (v_cmd == IOCMD_FCPIM_PROFILE_OFF) | ||
1993 | iocmd->status = bfa_fcpim_profile_off(&bfad->bfa); | ||
1994 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
1995 | |||
1996 | return 0; | ||
1997 | } | ||
1998 | |||
1999 | static int | ||
2000 | bfad_iocmd_itnim_get_ioprofile(struct bfad_s *bfad, void *cmd) | ||
2001 | { | ||
2002 | struct bfa_bsg_itnim_ioprofile_s *iocmd = | ||
2003 | (struct bfa_bsg_itnim_ioprofile_s *)cmd; | ||
2004 | struct bfa_fcs_lport_s *fcs_port; | ||
2005 | struct bfa_fcs_itnim_s *itnim; | ||
2006 | unsigned long flags; | ||
2007 | |||
2008 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
2009 | fcs_port = bfa_fcs_lookup_port(&bfad->bfa_fcs, | ||
2010 | iocmd->vf_id, iocmd->lpwwn); | ||
2011 | if (!fcs_port) | ||
2012 | iocmd->status = BFA_STATUS_UNKNOWN_LWWN; | ||
2013 | else { | ||
2014 | itnim = bfa_fcs_itnim_lookup(fcs_port, iocmd->rpwwn); | ||
2015 | if (itnim == NULL) | ||
2016 | iocmd->status = BFA_STATUS_UNKNOWN_RWWN; | ||
2017 | else | ||
2018 | iocmd->status = bfa_itnim_get_ioprofile( | ||
2019 | bfa_fcs_itnim_get_halitn(itnim), | ||
2020 | &iocmd->ioprofile); | ||
2021 | } | ||
2022 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
2023 | return 0; | ||
2024 | } | ||
2025 | |||
2026 | int | ||
2027 | bfad_iocmd_fcport_get_stats(struct bfad_s *bfad, void *cmd) | ||
2028 | { | ||
2029 | struct bfa_bsg_fcport_stats_s *iocmd = | ||
2030 | (struct bfa_bsg_fcport_stats_s *)cmd; | ||
2031 | struct bfad_hal_comp fcomp; | ||
2032 | unsigned long flags; | ||
2033 | struct bfa_cb_pending_q_s cb_qe; | ||
2034 | |||
2035 | init_completion(&fcomp.comp); | ||
2036 | bfa_pending_q_init(&cb_qe, (bfa_cb_cbfn_t)bfad_hcb_comp, | ||
2037 | &fcomp, &iocmd->stats); | ||
2038 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
2039 | iocmd->status = bfa_fcport_get_stats(&bfad->bfa, &cb_qe); | ||
2040 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
2041 | if (iocmd->status != BFA_STATUS_OK) { | ||
2042 | bfa_trc(bfad, iocmd->status); | ||
2043 | goto out; | ||
2044 | } | ||
2045 | wait_for_completion(&fcomp.comp); | ||
2046 | iocmd->status = fcomp.status; | ||
2047 | out: | ||
2048 | return 0; | ||
2049 | } | ||
2050 | |||
2051 | int | ||
2052 | bfad_iocmd_fcport_reset_stats(struct bfad_s *bfad, void *cmd) | ||
2053 | { | ||
2054 | struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd; | ||
2055 | struct bfad_hal_comp fcomp; | ||
2056 | unsigned long flags; | ||
2057 | struct bfa_cb_pending_q_s cb_qe; | ||
2058 | |||
2059 | init_completion(&fcomp.comp); | ||
2060 | bfa_pending_q_init(&cb_qe, (bfa_cb_cbfn_t)bfad_hcb_comp, &fcomp, NULL); | ||
2061 | |||
2062 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
2063 | iocmd->status = bfa_fcport_clear_stats(&bfad->bfa, &cb_qe); | ||
2064 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
2065 | if (iocmd->status != BFA_STATUS_OK) { | ||
2066 | bfa_trc(bfad, iocmd->status); | ||
2067 | goto out; | ||
2068 | } | ||
2069 | wait_for_completion(&fcomp.comp); | ||
2070 | iocmd->status = fcomp.status; | ||
2071 | out: | ||
2072 | return 0; | ||
2073 | } | ||
2074 | |||
2075 | int | ||
2076 | bfad_iocmd_boot_cfg(struct bfad_s *bfad, void *cmd) | ||
2077 | { | ||
2078 | struct bfa_bsg_boot_s *iocmd = (struct bfa_bsg_boot_s *)cmd; | ||
2079 | struct bfad_hal_comp fcomp; | ||
2080 | unsigned long flags; | ||
2081 | |||
2082 | init_completion(&fcomp.comp); | ||
2083 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
2084 | iocmd->status = bfa_flash_update_part(BFA_FLASH(&bfad->bfa), | ||
2085 | BFA_FLASH_PART_BOOT, PCI_FUNC(bfad->pcidev->devfn), | ||
2086 | &iocmd->cfg, sizeof(struct bfa_boot_cfg_s), 0, | ||
2087 | bfad_hcb_comp, &fcomp); | ||
2088 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
2089 | if (iocmd->status != BFA_STATUS_OK) | ||
2090 | goto out; | ||
2091 | wait_for_completion(&fcomp.comp); | ||
2092 | iocmd->status = fcomp.status; | ||
2093 | out: | ||
2094 | return 0; | ||
2095 | } | ||
2096 | |||
2097 | int | ||
2098 | bfad_iocmd_boot_query(struct bfad_s *bfad, void *cmd) | ||
2099 | { | ||
2100 | struct bfa_bsg_boot_s *iocmd = (struct bfa_bsg_boot_s *)cmd; | ||
2101 | struct bfad_hal_comp fcomp; | ||
2102 | unsigned long flags; | ||
2103 | |||
2104 | init_completion(&fcomp.comp); | ||
2105 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
2106 | iocmd->status = bfa_flash_read_part(BFA_FLASH(&bfad->bfa), | ||
2107 | BFA_FLASH_PART_BOOT, PCI_FUNC(bfad->pcidev->devfn), | ||
2108 | &iocmd->cfg, sizeof(struct bfa_boot_cfg_s), 0, | ||
2109 | bfad_hcb_comp, &fcomp); | ||
2110 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
2111 | if (iocmd->status != BFA_STATUS_OK) | ||
2112 | goto out; | ||
2113 | wait_for_completion(&fcomp.comp); | ||
2114 | iocmd->status = fcomp.status; | ||
2115 | out: | ||
2116 | return 0; | ||
2117 | } | ||
2118 | |||
2119 | int | ||
2120 | bfad_iocmd_preboot_query(struct bfad_s *bfad, void *cmd) | ||
2121 | { | ||
2122 | struct bfa_bsg_preboot_s *iocmd = (struct bfa_bsg_preboot_s *)cmd; | ||
2123 | struct bfi_iocfc_cfgrsp_s *cfgrsp = bfad->bfa.iocfc.cfgrsp; | ||
2124 | struct bfa_boot_pbc_s *pbcfg = &iocmd->cfg; | ||
2125 | unsigned long flags; | ||
2126 | |||
2127 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
2128 | pbcfg->enable = cfgrsp->pbc_cfg.boot_enabled; | ||
2129 | pbcfg->nbluns = cfgrsp->pbc_cfg.nbluns; | ||
2130 | pbcfg->speed = cfgrsp->pbc_cfg.port_speed; | ||
2131 | memcpy(pbcfg->pblun, cfgrsp->pbc_cfg.blun, sizeof(pbcfg->pblun)); | ||
2132 | iocmd->status = BFA_STATUS_OK; | ||
2133 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
2134 | |||
2135 | return 0; | ||
2136 | } | ||
2137 | |||
2138 | int | ||
2139 | bfad_iocmd_ethboot_cfg(struct bfad_s *bfad, void *cmd) | ||
2140 | { | ||
2141 | struct bfa_bsg_ethboot_s *iocmd = (struct bfa_bsg_ethboot_s *)cmd; | ||
2142 | struct bfad_hal_comp fcomp; | ||
2143 | unsigned long flags; | ||
2144 | |||
2145 | init_completion(&fcomp.comp); | ||
2146 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
2147 | iocmd->status = bfa_flash_update_part(BFA_FLASH(&bfad->bfa), | ||
2148 | BFA_FLASH_PART_PXECFG, | ||
2149 | bfad->bfa.ioc.port_id, &iocmd->cfg, | ||
2150 | sizeof(struct bfa_ethboot_cfg_s), 0, | ||
2151 | bfad_hcb_comp, &fcomp); | ||
2152 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
2153 | if (iocmd->status != BFA_STATUS_OK) | ||
2154 | goto out; | ||
2155 | wait_for_completion(&fcomp.comp); | ||
2156 | iocmd->status = fcomp.status; | ||
2157 | out: | ||
2158 | return 0; | ||
2159 | } | ||
2160 | |||
2161 | int | ||
2162 | bfad_iocmd_ethboot_query(struct bfad_s *bfad, void *cmd) | ||
2163 | { | ||
2164 | struct bfa_bsg_ethboot_s *iocmd = (struct bfa_bsg_ethboot_s *)cmd; | ||
2165 | struct bfad_hal_comp fcomp; | ||
2166 | unsigned long flags; | ||
2167 | |||
2168 | init_completion(&fcomp.comp); | ||
2169 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
2170 | iocmd->status = bfa_flash_read_part(BFA_FLASH(&bfad->bfa), | ||
2171 | BFA_FLASH_PART_PXECFG, | ||
2172 | bfad->bfa.ioc.port_id, &iocmd->cfg, | ||
2173 | sizeof(struct bfa_ethboot_cfg_s), 0, | ||
2174 | bfad_hcb_comp, &fcomp); | ||
2175 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
2176 | if (iocmd->status != BFA_STATUS_OK) | ||
2177 | goto out; | ||
2178 | wait_for_completion(&fcomp.comp); | ||
2179 | iocmd->status = fcomp.status; | ||
2180 | out: | ||
2181 | return 0; | ||
2182 | } | ||
2183 | |||
2184 | int | ||
2185 | bfad_iocmd_cfg_trunk(struct bfad_s *bfad, void *cmd, unsigned int v_cmd) | ||
2186 | { | ||
2187 | struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd; | ||
2188 | struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(&bfad->bfa); | ||
2189 | struct bfa_fcport_trunk_s *trunk = &fcport->trunk; | ||
2190 | unsigned long flags; | ||
2191 | |||
2192 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
2193 | |||
2194 | if (v_cmd == IOCMD_TRUNK_ENABLE) { | ||
2195 | trunk->attr.state = BFA_TRUNK_OFFLINE; | ||
2196 | bfa_fcport_disable(&bfad->bfa); | ||
2197 | fcport->cfg.trunked = BFA_TRUE; | ||
2198 | } else if (v_cmd == IOCMD_TRUNK_DISABLE) { | ||
2199 | trunk->attr.state = BFA_TRUNK_DISABLED; | ||
2200 | bfa_fcport_disable(&bfad->bfa); | ||
2201 | fcport->cfg.trunked = BFA_FALSE; | ||
2202 | } | ||
2203 | |||
2204 | if (!bfa_fcport_is_disabled(&bfad->bfa)) | ||
2205 | bfa_fcport_enable(&bfad->bfa); | ||
2206 | |||
2207 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
2208 | |||
2209 | iocmd->status = BFA_STATUS_OK; | ||
2210 | return 0; | ||
2211 | } | ||
2212 | |||
2213 | int | ||
2214 | bfad_iocmd_trunk_get_attr(struct bfad_s *bfad, void *cmd) | ||
2215 | { | ||
2216 | struct bfa_bsg_trunk_attr_s *iocmd = (struct bfa_bsg_trunk_attr_s *)cmd; | ||
2217 | struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(&bfad->bfa); | ||
2218 | struct bfa_fcport_trunk_s *trunk = &fcport->trunk; | ||
2219 | unsigned long flags; | ||
2220 | |||
2221 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
2222 | memcpy((void *)&iocmd->attr, (void *)&trunk->attr, | ||
2223 | sizeof(struct bfa_trunk_attr_s)); | ||
2224 | iocmd->attr.port_id = bfa_lps_get_base_pid(&bfad->bfa); | ||
2225 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
2226 | |||
2227 | iocmd->status = BFA_STATUS_OK; | ||
2228 | return 0; | ||
2229 | } | ||
2230 | |||
2231 | int | ||
2232 | bfad_iocmd_qos(struct bfad_s *bfad, void *cmd, unsigned int v_cmd) | ||
2233 | { | ||
2234 | struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd; | ||
2235 | struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(&bfad->bfa); | ||
2236 | unsigned long flags; | ||
2237 | |||
2238 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
2239 | if (bfa_ioc_get_type(&bfad->bfa.ioc) == BFA_IOC_TYPE_FC) { | ||
2240 | if (v_cmd == IOCMD_QOS_ENABLE) | ||
2241 | fcport->cfg.qos_enabled = BFA_TRUE; | ||
2242 | else if (v_cmd == IOCMD_QOS_DISABLE) | ||
2243 | fcport->cfg.qos_enabled = BFA_FALSE; | ||
2244 | } | ||
2245 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
2246 | |||
2247 | iocmd->status = BFA_STATUS_OK; | ||
2248 | return 0; | ||
2249 | } | ||
2250 | |||
2251 | int | ||
2252 | bfad_iocmd_qos_get_attr(struct bfad_s *bfad, void *cmd) | ||
2253 | { | ||
2254 | struct bfa_bsg_qos_attr_s *iocmd = (struct bfa_bsg_qos_attr_s *)cmd; | ||
2255 | struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(&bfad->bfa); | ||
2256 | unsigned long flags; | ||
2257 | |||
2258 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
2259 | iocmd->attr.state = fcport->qos_attr.state; | ||
2260 | iocmd->attr.total_bb_cr = be32_to_cpu(fcport->qos_attr.total_bb_cr); | ||
2261 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
2262 | |||
2263 | iocmd->status = BFA_STATUS_OK; | ||
2264 | return 0; | ||
2265 | } | ||
2266 | |||
2267 | int | ||
2268 | bfad_iocmd_qos_get_vc_attr(struct bfad_s *bfad, void *cmd) | ||
2269 | { | ||
2270 | struct bfa_bsg_qos_vc_attr_s *iocmd = | ||
2271 | (struct bfa_bsg_qos_vc_attr_s *)cmd; | ||
2272 | struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(&bfad->bfa); | ||
2273 | struct bfa_qos_vc_attr_s *bfa_vc_attr = &fcport->qos_vc_attr; | ||
2274 | unsigned long flags; | ||
2275 | u32 i = 0; | ||
2276 | |||
2277 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
2278 | iocmd->attr.total_vc_count = be16_to_cpu(bfa_vc_attr->total_vc_count); | ||
2279 | iocmd->attr.shared_credit = be16_to_cpu(bfa_vc_attr->shared_credit); | ||
2280 | iocmd->attr.elp_opmode_flags = | ||
2281 | be32_to_cpu(bfa_vc_attr->elp_opmode_flags); | ||
2282 | |||
2283 | /* Individual VC info */ | ||
2284 | while (i < iocmd->attr.total_vc_count) { | ||
2285 | iocmd->attr.vc_info[i].vc_credit = | ||
2286 | bfa_vc_attr->vc_info[i].vc_credit; | ||
2287 | iocmd->attr.vc_info[i].borrow_credit = | ||
2288 | bfa_vc_attr->vc_info[i].borrow_credit; | ||
2289 | iocmd->attr.vc_info[i].priority = | ||
2290 | bfa_vc_attr->vc_info[i].priority; | ||
2291 | i++; | ||
2292 | } | ||
2293 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
2294 | |||
2295 | iocmd->status = BFA_STATUS_OK; | ||
2296 | return 0; | ||
2297 | } | ||
2298 | |||
2299 | int | ||
2300 | bfad_iocmd_qos_get_stats(struct bfad_s *bfad, void *cmd) | ||
2301 | { | ||
2302 | struct bfa_bsg_fcport_stats_s *iocmd = | ||
2303 | (struct bfa_bsg_fcport_stats_s *)cmd; | ||
2304 | struct bfad_hal_comp fcomp; | ||
2305 | unsigned long flags; | ||
2306 | struct bfa_cb_pending_q_s cb_qe; | ||
2307 | |||
2308 | init_completion(&fcomp.comp); | ||
2309 | bfa_pending_q_init(&cb_qe, (bfa_cb_cbfn_t)bfad_hcb_comp, | ||
2310 | &fcomp, &iocmd->stats); | ||
2311 | |||
2312 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
2313 | WARN_ON(!bfa_ioc_get_fcmode(&bfad->bfa.ioc)); | ||
2314 | iocmd->status = bfa_fcport_get_stats(&bfad->bfa, &cb_qe); | ||
2315 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
2316 | if (iocmd->status != BFA_STATUS_OK) { | ||
2317 | bfa_trc(bfad, iocmd->status); | ||
2318 | goto out; | ||
2319 | } | ||
2320 | wait_for_completion(&fcomp.comp); | ||
2321 | iocmd->status = fcomp.status; | ||
2322 | out: | ||
2323 | return 0; | ||
2324 | } | ||
2325 | |||
2326 | int | ||
2327 | bfad_iocmd_qos_reset_stats(struct bfad_s *bfad, void *cmd) | ||
2328 | { | ||
2329 | struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd; | ||
2330 | struct bfad_hal_comp fcomp; | ||
2331 | unsigned long flags; | ||
2332 | struct bfa_cb_pending_q_s cb_qe; | ||
2333 | |||
2334 | init_completion(&fcomp.comp); | ||
2335 | bfa_pending_q_init(&cb_qe, (bfa_cb_cbfn_t)bfad_hcb_comp, | ||
2336 | &fcomp, NULL); | ||
2337 | |||
2338 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
2339 | WARN_ON(!bfa_ioc_get_fcmode(&bfad->bfa.ioc)); | ||
2340 | iocmd->status = bfa_fcport_clear_stats(&bfad->bfa, &cb_qe); | ||
2341 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
2342 | if (iocmd->status != BFA_STATUS_OK) { | ||
2343 | bfa_trc(bfad, iocmd->status); | ||
2344 | goto out; | ||
2345 | } | ||
2346 | wait_for_completion(&fcomp.comp); | ||
2347 | iocmd->status = fcomp.status; | ||
2348 | out: | ||
2349 | return 0; | ||
2350 | } | ||
2351 | |||
2352 | int | ||
2353 | bfad_iocmd_vf_get_stats(struct bfad_s *bfad, void *cmd) | ||
2354 | { | ||
2355 | struct bfa_bsg_vf_stats_s *iocmd = | ||
2356 | (struct bfa_bsg_vf_stats_s *)cmd; | ||
2357 | struct bfa_fcs_fabric_s *fcs_vf; | ||
2358 | unsigned long flags; | ||
2359 | |||
2360 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
2361 | fcs_vf = bfa_fcs_vf_lookup(&bfad->bfa_fcs, iocmd->vf_id); | ||
2362 | if (fcs_vf == NULL) { | ||
2363 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
2364 | iocmd->status = BFA_STATUS_UNKNOWN_VFID; | ||
2365 | goto out; | ||
2366 | } | ||
2367 | memcpy((void *)&iocmd->stats, (void *)&fcs_vf->stats, | ||
2368 | sizeof(struct bfa_vf_stats_s)); | ||
2369 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
2370 | iocmd->status = BFA_STATUS_OK; | ||
2371 | out: | ||
2372 | return 0; | ||
2373 | } | ||
2374 | |||
2375 | int | ||
2376 | bfad_iocmd_vf_clr_stats(struct bfad_s *bfad, void *cmd) | ||
2377 | { | ||
2378 | struct bfa_bsg_vf_reset_stats_s *iocmd = | ||
2379 | (struct bfa_bsg_vf_reset_stats_s *)cmd; | ||
2380 | struct bfa_fcs_fabric_s *fcs_vf; | ||
2381 | unsigned long flags; | ||
2382 | |||
2383 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
2384 | fcs_vf = bfa_fcs_vf_lookup(&bfad->bfa_fcs, iocmd->vf_id); | ||
2385 | if (fcs_vf == NULL) { | ||
2386 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
2387 | iocmd->status = BFA_STATUS_UNKNOWN_VFID; | ||
2388 | goto out; | ||
2389 | } | ||
2390 | memset((void *)&fcs_vf->stats, 0, sizeof(struct bfa_vf_stats_s)); | ||
2391 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
2392 | iocmd->status = BFA_STATUS_OK; | ||
2393 | out: | ||
2394 | return 0; | ||
2395 | } | ||
2396 | |||
2397 | int | ||
2398 | bfad_iocmd_lunmask(struct bfad_s *bfad, void *pcmd, unsigned int v_cmd) | ||
2399 | { | ||
2400 | struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)pcmd; | ||
2401 | unsigned long flags; | ||
2402 | |||
2403 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
2404 | if (v_cmd == IOCMD_FCPIM_LUNMASK_ENABLE) | ||
2405 | iocmd->status = bfa_fcpim_lunmask_update(&bfad->bfa, BFA_TRUE); | ||
2406 | else if (v_cmd == IOCMD_FCPIM_LUNMASK_DISABLE) | ||
2407 | iocmd->status = bfa_fcpim_lunmask_update(&bfad->bfa, BFA_FALSE); | ||
2408 | else if (v_cmd == IOCMD_FCPIM_LUNMASK_CLEAR) | ||
2409 | iocmd->status = bfa_fcpim_lunmask_clear(&bfad->bfa); | ||
2410 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
2411 | return 0; | ||
2412 | } | ||
2413 | |||
2414 | int | ||
2415 | bfad_iocmd_fcpim_lunmask_query(struct bfad_s *bfad, void *cmd) | ||
2416 | { | ||
2417 | struct bfa_bsg_fcpim_lunmask_query_s *iocmd = | ||
2418 | (struct bfa_bsg_fcpim_lunmask_query_s *)cmd; | ||
2419 | struct bfa_lunmask_cfg_s *lun_mask = &iocmd->lun_mask; | ||
2420 | unsigned long flags; | ||
2421 | |||
2422 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
2423 | iocmd->status = bfa_fcpim_lunmask_query(&bfad->bfa, lun_mask); | ||
2424 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
2425 | return 0; | ||
2426 | } | ||
2427 | |||
2428 | int | ||
2429 | bfad_iocmd_fcpim_cfg_lunmask(struct bfad_s *bfad, void *cmd, unsigned int v_cmd) | ||
2430 | { | ||
2431 | struct bfa_bsg_fcpim_lunmask_s *iocmd = | ||
2432 | (struct bfa_bsg_fcpim_lunmask_s *)cmd; | ||
2433 | unsigned long flags; | ||
2434 | |||
2435 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
2436 | if (v_cmd == IOCMD_FCPIM_LUNMASK_ADD) | ||
2437 | iocmd->status = bfa_fcpim_lunmask_add(&bfad->bfa, iocmd->vf_id, | ||
2438 | &iocmd->pwwn, iocmd->rpwwn, iocmd->lun); | ||
2439 | else if (v_cmd == IOCMD_FCPIM_LUNMASK_DELETE) | ||
2440 | iocmd->status = bfa_fcpim_lunmask_delete(&bfad->bfa, | ||
2441 | iocmd->vf_id, &iocmd->pwwn, | ||
2442 | iocmd->rpwwn, iocmd->lun); | ||
2443 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
2444 | return 0; | ||
2445 | } | ||
2446 | |||
1514 | static int | 2447 | static int |
1515 | bfad_iocmd_handler(struct bfad_s *bfad, unsigned int cmd, void *iocmd, | 2448 | bfad_iocmd_handler(struct bfad_s *bfad, unsigned int cmd, void *iocmd, |
1516 | unsigned int payload_len) | 2449 | unsigned int payload_len) |
1517 | { | 2450 | { |
1518 | int rc = EINVAL; | 2451 | int rc = -EINVAL; |
1519 | 2452 | ||
1520 | switch (cmd) { | 2453 | switch (cmd) { |
1521 | case IOCMD_IOC_ENABLE: | 2454 | case IOCMD_IOC_ENABLE: |
@@ -1536,6 +2469,14 @@ bfad_iocmd_handler(struct bfad_s *bfad, unsigned int cmd, void *iocmd, | |||
1536 | case IOCMD_IOC_GET_FWSTATS: | 2469 | case IOCMD_IOC_GET_FWSTATS: |
1537 | rc = bfad_iocmd_ioc_get_fwstats(bfad, iocmd, payload_len); | 2470 | rc = bfad_iocmd_ioc_get_fwstats(bfad, iocmd, payload_len); |
1538 | break; | 2471 | break; |
2472 | case IOCMD_IOC_RESET_STATS: | ||
2473 | case IOCMD_IOC_RESET_FWSTATS: | ||
2474 | rc = bfad_iocmd_ioc_reset_stats(bfad, iocmd, cmd); | ||
2475 | break; | ||
2476 | case IOCMD_IOC_SET_ADAPTER_NAME: | ||
2477 | case IOCMD_IOC_SET_PORT_NAME: | ||
2478 | rc = bfad_iocmd_ioc_set_name(bfad, iocmd, cmd); | ||
2479 | break; | ||
1539 | case IOCMD_IOCFC_GET_ATTR: | 2480 | case IOCMD_IOCFC_GET_ATTR: |
1540 | rc = bfad_iocmd_iocfc_get_attr(bfad, iocmd); | 2481 | rc = bfad_iocmd_iocfc_get_attr(bfad, iocmd); |
1541 | break; | 2482 | break; |
@@ -1554,12 +2495,31 @@ bfad_iocmd_handler(struct bfad_s *bfad, unsigned int cmd, void *iocmd, | |||
1554 | case IOCMD_PORT_GET_STATS: | 2495 | case IOCMD_PORT_GET_STATS: |
1555 | rc = bfad_iocmd_port_get_stats(bfad, iocmd, payload_len); | 2496 | rc = bfad_iocmd_port_get_stats(bfad, iocmd, payload_len); |
1556 | break; | 2497 | break; |
2498 | case IOCMD_PORT_RESET_STATS: | ||
2499 | rc = bfad_iocmd_port_reset_stats(bfad, iocmd); | ||
2500 | break; | ||
2501 | case IOCMD_PORT_CFG_TOPO: | ||
2502 | case IOCMD_PORT_CFG_SPEED: | ||
2503 | case IOCMD_PORT_CFG_ALPA: | ||
2504 | case IOCMD_PORT_CLR_ALPA: | ||
2505 | rc = bfad_iocmd_set_port_cfg(bfad, iocmd, cmd); | ||
2506 | break; | ||
2507 | case IOCMD_PORT_CFG_MAXFRSZ: | ||
2508 | rc = bfad_iocmd_port_cfg_maxfrsize(bfad, iocmd); | ||
2509 | break; | ||
2510 | case IOCMD_PORT_BBSC_ENABLE: | ||
2511 | case IOCMD_PORT_BBSC_DISABLE: | ||
2512 | rc = bfad_iocmd_port_cfg_bbsc(bfad, iocmd, cmd); | ||
2513 | break; | ||
1557 | case IOCMD_LPORT_GET_ATTR: | 2514 | case IOCMD_LPORT_GET_ATTR: |
1558 | rc = bfad_iocmd_lport_get_attr(bfad, iocmd); | 2515 | rc = bfad_iocmd_lport_get_attr(bfad, iocmd); |
1559 | break; | 2516 | break; |
1560 | case IOCMD_LPORT_GET_STATS: | 2517 | case IOCMD_LPORT_GET_STATS: |
1561 | rc = bfad_iocmd_lport_get_stats(bfad, iocmd); | 2518 | rc = bfad_iocmd_lport_get_stats(bfad, iocmd); |
1562 | break; | 2519 | break; |
2520 | case IOCMD_LPORT_RESET_STATS: | ||
2521 | rc = bfad_iocmd_lport_reset_stats(bfad, iocmd); | ||
2522 | break; | ||
1563 | case IOCMD_LPORT_GET_IOSTATS: | 2523 | case IOCMD_LPORT_GET_IOSTATS: |
1564 | rc = bfad_iocmd_lport_get_iostats(bfad, iocmd); | 2524 | rc = bfad_iocmd_lport_get_iostats(bfad, iocmd); |
1565 | break; | 2525 | break; |
@@ -1575,12 +2535,40 @@ bfad_iocmd_handler(struct bfad_s *bfad, unsigned int cmd, void *iocmd, | |||
1575 | case IOCMD_RPORT_GET_STATS: | 2535 | case IOCMD_RPORT_GET_STATS: |
1576 | rc = bfad_iocmd_rport_get_stats(bfad, iocmd); | 2536 | rc = bfad_iocmd_rport_get_stats(bfad, iocmd); |
1577 | break; | 2537 | break; |
2538 | case IOCMD_RPORT_RESET_STATS: | ||
2539 | rc = bfad_iocmd_rport_clr_stats(bfad, iocmd); | ||
2540 | break; | ||
2541 | case IOCMD_RPORT_SET_SPEED: | ||
2542 | rc = bfad_iocmd_rport_set_speed(bfad, iocmd); | ||
2543 | break; | ||
2544 | case IOCMD_VPORT_GET_ATTR: | ||
2545 | rc = bfad_iocmd_vport_get_attr(bfad, iocmd); | ||
2546 | break; | ||
2547 | case IOCMD_VPORT_GET_STATS: | ||
2548 | rc = bfad_iocmd_vport_get_stats(bfad, iocmd); | ||
2549 | break; | ||
2550 | case IOCMD_VPORT_RESET_STATS: | ||
2551 | rc = bfad_iocmd_vport_clr_stats(bfad, iocmd); | ||
2552 | break; | ||
1578 | case IOCMD_FABRIC_GET_LPORTS: | 2553 | case IOCMD_FABRIC_GET_LPORTS: |
1579 | rc = bfad_iocmd_fabric_get_lports(bfad, iocmd, payload_len); | 2554 | rc = bfad_iocmd_fabric_get_lports(bfad, iocmd, payload_len); |
1580 | break; | 2555 | break; |
2556 | case IOCMD_RATELIM_ENABLE: | ||
2557 | case IOCMD_RATELIM_DISABLE: | ||
2558 | rc = bfad_iocmd_ratelim(bfad, cmd, iocmd); | ||
2559 | break; | ||
2560 | case IOCMD_RATELIM_DEF_SPEED: | ||
2561 | rc = bfad_iocmd_ratelim_speed(bfad, cmd, iocmd); | ||
2562 | break; | ||
2563 | case IOCMD_FCPIM_FAILOVER: | ||
2564 | rc = bfad_iocmd_cfg_fcpim(bfad, iocmd); | ||
2565 | break; | ||
1581 | case IOCMD_FCPIM_MODSTATS: | 2566 | case IOCMD_FCPIM_MODSTATS: |
1582 | rc = bfad_iocmd_fcpim_get_modstats(bfad, iocmd); | 2567 | rc = bfad_iocmd_fcpim_get_modstats(bfad, iocmd); |
1583 | break; | 2568 | break; |
2569 | case IOCMD_FCPIM_MODSTATSCLR: | ||
2570 | rc = bfad_iocmd_fcpim_clr_modstats(bfad, iocmd); | ||
2571 | break; | ||
1584 | case IOCMD_FCPIM_DEL_ITN_STATS: | 2572 | case IOCMD_FCPIM_DEL_ITN_STATS: |
1585 | rc = bfad_iocmd_fcpim_get_del_itn_stats(bfad, iocmd); | 2573 | rc = bfad_iocmd_fcpim_get_del_itn_stats(bfad, iocmd); |
1586 | break; | 2574 | break; |
@@ -1590,6 +2578,9 @@ bfad_iocmd_handler(struct bfad_s *bfad, unsigned int cmd, void *iocmd, | |||
1590 | case IOCMD_ITNIM_GET_IOSTATS: | 2578 | case IOCMD_ITNIM_GET_IOSTATS: |
1591 | rc = bfad_iocmd_itnim_get_iostats(bfad, iocmd); | 2579 | rc = bfad_iocmd_itnim_get_iostats(bfad, iocmd); |
1592 | break; | 2580 | break; |
2581 | case IOCMD_ITNIM_RESET_STATS: | ||
2582 | rc = bfad_iocmd_itnim_reset_stats(bfad, iocmd); | ||
2583 | break; | ||
1593 | case IOCMD_ITNIM_GET_ITNSTATS: | 2584 | case IOCMD_ITNIM_GET_ITNSTATS: |
1594 | rc = bfad_iocmd_itnim_get_itnstats(bfad, iocmd); | 2585 | rc = bfad_iocmd_itnim_get_itnstats(bfad, iocmd); |
1595 | break; | 2586 | break; |
@@ -1702,11 +2693,92 @@ bfad_iocmd_handler(struct bfad_s *bfad, unsigned int cmd, void *iocmd, | |||
1702 | case IOCMD_DEBUG_PORTLOG: | 2693 | case IOCMD_DEBUG_PORTLOG: |
1703 | rc = bfad_iocmd_porglog_get(bfad, iocmd); | 2694 | rc = bfad_iocmd_porglog_get(bfad, iocmd); |
1704 | break; | 2695 | break; |
2696 | case IOCMD_DEBUG_FW_CORE: | ||
2697 | rc = bfad_iocmd_debug_fw_core(bfad, iocmd, payload_len); | ||
2698 | break; | ||
2699 | case IOCMD_DEBUG_FW_STATE_CLR: | ||
2700 | case IOCMD_DEBUG_PORTLOG_CLR: | ||
2701 | case IOCMD_DEBUG_START_DTRC: | ||
2702 | case IOCMD_DEBUG_STOP_DTRC: | ||
2703 | rc = bfad_iocmd_debug_ctl(bfad, iocmd, cmd); | ||
2704 | break; | ||
2705 | case IOCMD_DEBUG_PORTLOG_CTL: | ||
2706 | rc = bfad_iocmd_porglog_ctl(bfad, iocmd); | ||
2707 | break; | ||
2708 | case IOCMD_FCPIM_PROFILE_ON: | ||
2709 | case IOCMD_FCPIM_PROFILE_OFF: | ||
2710 | rc = bfad_iocmd_fcpim_cfg_profile(bfad, iocmd, cmd); | ||
2711 | break; | ||
2712 | case IOCMD_ITNIM_GET_IOPROFILE: | ||
2713 | rc = bfad_iocmd_itnim_get_ioprofile(bfad, iocmd); | ||
2714 | break; | ||
2715 | case IOCMD_FCPORT_GET_STATS: | ||
2716 | rc = bfad_iocmd_fcport_get_stats(bfad, iocmd); | ||
2717 | break; | ||
2718 | case IOCMD_FCPORT_RESET_STATS: | ||
2719 | rc = bfad_iocmd_fcport_reset_stats(bfad, iocmd); | ||
2720 | break; | ||
2721 | case IOCMD_BOOT_CFG: | ||
2722 | rc = bfad_iocmd_boot_cfg(bfad, iocmd); | ||
2723 | break; | ||
2724 | case IOCMD_BOOT_QUERY: | ||
2725 | rc = bfad_iocmd_boot_query(bfad, iocmd); | ||
2726 | break; | ||
2727 | case IOCMD_PREBOOT_QUERY: | ||
2728 | rc = bfad_iocmd_preboot_query(bfad, iocmd); | ||
2729 | break; | ||
2730 | case IOCMD_ETHBOOT_CFG: | ||
2731 | rc = bfad_iocmd_ethboot_cfg(bfad, iocmd); | ||
2732 | break; | ||
2733 | case IOCMD_ETHBOOT_QUERY: | ||
2734 | rc = bfad_iocmd_ethboot_query(bfad, iocmd); | ||
2735 | break; | ||
2736 | case IOCMD_TRUNK_ENABLE: | ||
2737 | case IOCMD_TRUNK_DISABLE: | ||
2738 | rc = bfad_iocmd_cfg_trunk(bfad, iocmd, cmd); | ||
2739 | break; | ||
2740 | case IOCMD_TRUNK_GET_ATTR: | ||
2741 | rc = bfad_iocmd_trunk_get_attr(bfad, iocmd); | ||
2742 | break; | ||
2743 | case IOCMD_QOS_ENABLE: | ||
2744 | case IOCMD_QOS_DISABLE: | ||
2745 | rc = bfad_iocmd_qos(bfad, iocmd, cmd); | ||
2746 | break; | ||
2747 | case IOCMD_QOS_GET_ATTR: | ||
2748 | rc = bfad_iocmd_qos_get_attr(bfad, iocmd); | ||
2749 | break; | ||
2750 | case IOCMD_QOS_GET_VC_ATTR: | ||
2751 | rc = bfad_iocmd_qos_get_vc_attr(bfad, iocmd); | ||
2752 | break; | ||
2753 | case IOCMD_QOS_GET_STATS: | ||
2754 | rc = bfad_iocmd_qos_get_stats(bfad, iocmd); | ||
2755 | break; | ||
2756 | case IOCMD_QOS_RESET_STATS: | ||
2757 | rc = bfad_iocmd_qos_reset_stats(bfad, iocmd); | ||
2758 | break; | ||
2759 | case IOCMD_VF_GET_STATS: | ||
2760 | rc = bfad_iocmd_vf_get_stats(bfad, iocmd); | ||
2761 | break; | ||
2762 | case IOCMD_VF_RESET_STATS: | ||
2763 | rc = bfad_iocmd_vf_clr_stats(bfad, iocmd); | ||
2764 | break; | ||
2765 | case IOCMD_FCPIM_LUNMASK_ENABLE: | ||
2766 | case IOCMD_FCPIM_LUNMASK_DISABLE: | ||
2767 | case IOCMD_FCPIM_LUNMASK_CLEAR: | ||
2768 | rc = bfad_iocmd_lunmask(bfad, iocmd, cmd); | ||
2769 | break; | ||
2770 | case IOCMD_FCPIM_LUNMASK_QUERY: | ||
2771 | rc = bfad_iocmd_fcpim_lunmask_query(bfad, iocmd); | ||
2772 | break; | ||
2773 | case IOCMD_FCPIM_LUNMASK_ADD: | ||
2774 | case IOCMD_FCPIM_LUNMASK_DELETE: | ||
2775 | rc = bfad_iocmd_fcpim_cfg_lunmask(bfad, iocmd, cmd); | ||
2776 | break; | ||
1705 | default: | 2777 | default: |
1706 | rc = EINVAL; | 2778 | rc = -EINVAL; |
1707 | break; | 2779 | break; |
1708 | } | 2780 | } |
1709 | return -rc; | 2781 | return rc; |
1710 | } | 2782 | } |
1711 | 2783 | ||
1712 | static int | 2784 | static int |