diff options
Diffstat (limited to 'drivers/scsi/bfa/bfad.c')
-rw-r--r-- | drivers/scsi/bfa/bfad.c | 73 |
1 files changed, 16 insertions, 57 deletions
diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c index 4d8784e06e14..1f938974b848 100644 --- a/drivers/scsi/bfa/bfad.c +++ b/drivers/scsi/bfa/bfad.c | |||
@@ -15,7 +15,7 @@ | |||
15 | * General Public License for more details. | 15 | * General Public License for more details. |
16 | */ | 16 | */ |
17 | 17 | ||
18 | /** | 18 | /* |
19 | * bfad.c Linux driver PCI interface module. | 19 | * bfad.c Linux driver PCI interface module. |
20 | */ | 20 | */ |
21 | #include <linux/module.h> | 21 | #include <linux/module.h> |
@@ -151,7 +151,7 @@ bfad_sm_failed(struct bfad_s *bfad, enum bfad_sm_event event); | |||
151 | static void | 151 | static void |
152 | bfad_sm_fcs_exit(struct bfad_s *bfad, enum bfad_sm_event event); | 152 | bfad_sm_fcs_exit(struct bfad_s *bfad, enum bfad_sm_event event); |
153 | 153 | ||
154 | /** | 154 | /* |
155 | * Beginning state for the driver instance, awaiting the pci_probe event | 155 | * Beginning state for the driver instance, awaiting the pci_probe event |
156 | */ | 156 | */ |
157 | static void | 157 | static void |
@@ -181,7 +181,7 @@ bfad_sm_uninit(struct bfad_s *bfad, enum bfad_sm_event event) | |||
181 | } | 181 | } |
182 | } | 182 | } |
183 | 183 | ||
184 | /** | 184 | /* |
185 | * Driver Instance is created, awaiting event INIT to initialize the bfad | 185 | * Driver Instance is created, awaiting event INIT to initialize the bfad |
186 | */ | 186 | */ |
187 | static void | 187 | static void |
@@ -364,7 +364,7 @@ bfad_sm_stopping(struct bfad_s *bfad, enum bfad_sm_event event) | |||
364 | } | 364 | } |
365 | } | 365 | } |
366 | 366 | ||
367 | /** | 367 | /* |
368 | * BFA callbacks | 368 | * BFA callbacks |
369 | */ | 369 | */ |
370 | void | 370 | void |
@@ -376,7 +376,7 @@ bfad_hcb_comp(void *arg, bfa_status_t status) | |||
376 | complete(&fcomp->comp); | 376 | complete(&fcomp->comp); |
377 | } | 377 | } |
378 | 378 | ||
379 | /** | 379 | /* |
380 | * bfa_init callback | 380 | * bfa_init callback |
381 | */ | 381 | */ |
382 | void | 382 | void |
@@ -401,7 +401,7 @@ bfa_cb_init(void *drv, bfa_status_t init_status) | |||
401 | complete(&bfad->comp); | 401 | complete(&bfad->comp); |
402 | } | 402 | } |
403 | 403 | ||
404 | /** | 404 | /* |
405 | * BFA_FCS callbacks | 405 | * BFA_FCS callbacks |
406 | */ | 406 | */ |
407 | struct bfad_port_s * | 407 | struct bfad_port_s * |
@@ -457,7 +457,7 @@ bfa_fcb_lport_delete(struct bfad_s *bfad, enum bfa_lport_role roles, | |||
457 | } | 457 | } |
458 | } | 458 | } |
459 | 459 | ||
460 | /** | 460 | /* |
461 | * FCS RPORT alloc callback, after successful PLOGI by FCS | 461 | * FCS RPORT alloc callback, after successful PLOGI by FCS |
462 | */ | 462 | */ |
463 | bfa_status_t | 463 | bfa_status_t |
@@ -478,7 +478,7 @@ ext: | |||
478 | return rc; | 478 | return rc; |
479 | } | 479 | } |
480 | 480 | ||
481 | /** | 481 | /* |
482 | * FCS PBC VPORT Create | 482 | * FCS PBC VPORT Create |
483 | */ | 483 | */ |
484 | void | 484 | void |
@@ -663,7 +663,7 @@ ext: | |||
663 | return rc; | 663 | return rc; |
664 | } | 664 | } |
665 | 665 | ||
666 | /** | 666 | /* |
667 | * Create a vport under a vf. | 667 | * Create a vport under a vf. |
668 | */ | 668 | */ |
669 | bfa_status_t | 669 | bfa_status_t |
@@ -716,30 +716,6 @@ ext: | |||
716 | return rc; | 716 | return rc; |
717 | } | 717 | } |
718 | 718 | ||
719 | /** | ||
720 | * Create a vf and its base vport implicitely. | ||
721 | */ | ||
722 | bfa_status_t | ||
723 | bfad_vf_create(struct bfad_s *bfad, u16 vf_id, | ||
724 | struct bfa_lport_cfg_s *port_cfg) | ||
725 | { | ||
726 | struct bfad_vf_s *vf; | ||
727 | int rc = BFA_STATUS_OK; | ||
728 | |||
729 | vf = kzalloc(sizeof(struct bfad_vf_s), GFP_KERNEL); | ||
730 | if (!vf) { | ||
731 | rc = BFA_STATUS_FAILED; | ||
732 | goto ext; | ||
733 | } | ||
734 | |||
735 | rc = bfa_fcs_vf_create(&vf->fcs_vf, &bfad->bfa_fcs, vf_id, port_cfg, | ||
736 | vf); | ||
737 | if (rc != BFA_STATUS_OK) | ||
738 | kfree(vf); | ||
739 | ext: | ||
740 | return rc; | ||
741 | } | ||
742 | |||
743 | void | 719 | void |
744 | bfad_bfa_tmo(unsigned long data) | 720 | bfad_bfa_tmo(unsigned long data) |
745 | { | 721 | { |
@@ -885,20 +861,6 @@ bfad_pci_uninit(struct pci_dev *pdev, struct bfad_s *bfad) | |||
885 | pci_set_drvdata(pdev, NULL); | 861 | pci_set_drvdata(pdev, NULL); |
886 | } | 862 | } |
887 | 863 | ||
888 | void | ||
889 | bfad_fcs_port_cfg(struct bfad_s *bfad) | ||
890 | { | ||
891 | struct bfa_lport_cfg_s port_cfg; | ||
892 | struct bfa_port_attr_s attr; | ||
893 | char symname[BFA_SYMNAME_MAXLEN]; | ||
894 | |||
895 | sprintf(symname, "%s-%d", BFAD_DRIVER_NAME, bfad->inst_no); | ||
896 | memcpy(port_cfg.sym_name.symname, symname, strlen(symname)); | ||
897 | bfa_fcport_get_attr(&bfad->bfa, &attr); | ||
898 | port_cfg.nwwn = attr.nwwn; | ||
899 | port_cfg.pwwn = attr.pwwn; | ||
900 | } | ||
901 | |||
902 | bfa_status_t | 864 | bfa_status_t |
903 | bfad_drv_init(struct bfad_s *bfad) | 865 | bfad_drv_init(struct bfad_s *bfad) |
904 | { | 866 | { |
@@ -1089,9 +1051,6 @@ bfad_start_ops(struct bfad_s *bfad) { | |||
1089 | bfa_fcs_init(&bfad->bfa_fcs); | 1051 | bfa_fcs_init(&bfad->bfa_fcs); |
1090 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | 1052 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); |
1091 | 1053 | ||
1092 | /* PPORT FCS config */ | ||
1093 | bfad_fcs_port_cfg(bfad); | ||
1094 | |||
1095 | retval = bfad_cfg_pport(bfad, BFA_LPORT_ROLE_FCP_IM); | 1054 | retval = bfad_cfg_pport(bfad, BFA_LPORT_ROLE_FCP_IM); |
1096 | if (retval != BFA_STATUS_OK) { | 1055 | if (retval != BFA_STATUS_OK) { |
1097 | if (bfa_sm_cmp_state(bfad, bfad_sm_initializing)) | 1056 | if (bfa_sm_cmp_state(bfad, bfad_sm_initializing)) |
@@ -1181,7 +1140,7 @@ bfad_worker(void *ptr) | |||
1181 | return 0; | 1140 | return 0; |
1182 | } | 1141 | } |
1183 | 1142 | ||
1184 | /** | 1143 | /* |
1185 | * BFA driver interrupt functions | 1144 | * BFA driver interrupt functions |
1186 | */ | 1145 | */ |
1187 | irqreturn_t | 1146 | irqreturn_t |
@@ -1240,7 +1199,7 @@ bfad_msix(int irq, void *dev_id) | |||
1240 | return IRQ_HANDLED; | 1199 | return IRQ_HANDLED; |
1241 | } | 1200 | } |
1242 | 1201 | ||
1243 | /** | 1202 | /* |
1244 | * Initialize the MSIX entry table. | 1203 | * Initialize the MSIX entry table. |
1245 | */ | 1204 | */ |
1246 | static void | 1205 | static void |
@@ -1293,7 +1252,7 @@ bfad_install_msix_handler(struct bfad_s *bfad) | |||
1293 | return 0; | 1252 | return 0; |
1294 | } | 1253 | } |
1295 | 1254 | ||
1296 | /** | 1255 | /* |
1297 | * Setup MSIX based interrupt. | 1256 | * Setup MSIX based interrupt. |
1298 | */ | 1257 | */ |
1299 | int | 1258 | int |
@@ -1374,7 +1333,7 @@ bfad_remove_intr(struct bfad_s *bfad) | |||
1374 | } | 1333 | } |
1375 | } | 1334 | } |
1376 | 1335 | ||
1377 | /** | 1336 | /* |
1378 | * PCI probe entry. | 1337 | * PCI probe entry. |
1379 | */ | 1338 | */ |
1380 | int | 1339 | int |
@@ -1460,7 +1419,7 @@ out: | |||
1460 | return error; | 1419 | return error; |
1461 | } | 1420 | } |
1462 | 1421 | ||
1463 | /** | 1422 | /* |
1464 | * PCI remove entry. | 1423 | * PCI remove entry. |
1465 | */ | 1424 | */ |
1466 | void | 1425 | void |
@@ -1541,7 +1500,7 @@ static struct pci_driver bfad_pci_driver = { | |||
1541 | .remove = __devexit_p(bfad_pci_remove), | 1500 | .remove = __devexit_p(bfad_pci_remove), |
1542 | }; | 1501 | }; |
1543 | 1502 | ||
1544 | /** | 1503 | /* |
1545 | * Driver module init. | 1504 | * Driver module init. |
1546 | */ | 1505 | */ |
1547 | static int __init | 1506 | static int __init |
@@ -1581,7 +1540,7 @@ ext: | |||
1581 | return error; | 1540 | return error; |
1582 | } | 1541 | } |
1583 | 1542 | ||
1584 | /** | 1543 | /* |
1585 | * Driver module exit. | 1544 | * Driver module exit. |
1586 | */ | 1545 | */ |
1587 | static void __exit | 1546 | static void __exit |