Lines Matching refs:fcport

181 	sp = qla2xxx_get_qpair_sp(cmd_sp->vha, cmd_sp->qpair, cmd_sp->fcport,
229 fc_port_t *fcport = sp->fcport;
234 if (fcport) {
235 ql_dbg(ql_dbg_disc, fcport->vha, 0x2071,
237 sp->name, sp->handle, fcport->d_id.b24, fcport->port_name);
239 fcport->flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE);
302 "%s %8phC res %d \n", __func__, sp->fcport->port_name, res);
304 sp->fcport->flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE);
308 ea.fcport = sp->fcport;
324 qla2x00_async_login(struct scsi_qla_host *vha, fc_port_t *fcport,
331 if (!vha->flags.online || (fcport->flags & FCF_ASYNC_SENT) ||
332 fcport->loop_id == FC_NO_LOOP_ID) {
335 __func__, fcport->port_name);
340 sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL);
344 qla2x00_set_fcport_disc_state(fcport, DSC_LOGIN_PEND);
345 fcport->flags |= FCF_ASYNC_SENT;
346 fcport->logout_completed = 0;
350 sp->gen1 = fcport->rscn_gen;
351 sp->gen2 = fcport->login_gen;
356 if (N2N_TOPO(fcport->vha->hw) && fcport_is_bigger(fcport)) {
368 if (NVME_TARGET(vha->hw, fcport))
375 fcport->port_name, sp->handle, fcport->loop_id,
376 fcport->d_id.b24, fcport->login_retry,
380 fcport->flags |= FCF_LOGIN_NEEDED;
390 fcport->flags &= ~FCF_ASYNC_SENT;
392 fcport->flags &= ~FCF_ASYNC_ACTIVE;
398 qla2x00_set_fcport_disc_state(fcport, DSC_DELETED);
404 sp->fcport->flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE);
405 sp->fcport->login_gen++;
406 qlt_logo_completion_handler(sp->fcport, sp->u.iocb_cmd.u.logio.data[0]);
412 qla2x00_async_logout(struct scsi_qla_host *vha, fc_port_t *fcport)
417 fcport->flags |= FCF_ASYNC_SENT;
419 sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL);
430 sp->handle, fcport->loop_id, fcport->d_id.b.domain,
431 fcport->d_id.b.area, fcport->d_id.b.al_pa,
432 fcport->port_name, fcport->explicit_logout);
443 fcport->flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE);
448 qla2x00_async_prlo_done(struct scsi_qla_host *vha, fc_port_t *fcport,
451 fcport->flags &= ~FCF_ASYNC_ACTIVE;
453 if (!fcport->tgt_session)
454 qla2x00_mark_device_lost(vha, fcport, 1);
455 qlt_logo_completion_handler(fcport, data[0]);
463 sp->fcport->flags &= ~FCF_ASYNC_ACTIVE;
465 qla2x00_post_async_prlo_done_work(sp->fcport->vha, sp->fcport,
472 qla2x00_async_prlo(struct scsi_qla_host *vha, fc_port_t *fcport)
479 sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL);
490 sp->handle, fcport->loop_id, fcport->d_id.b.domain,
491 fcport->d_id.b.area, fcport->d_id.b.al_pa);
503 fcport->flags &= ~FCF_ASYNC_ACTIVE;
510 struct fc_port *fcport = ea->fcport;
515 __func__, fcport->port_name, fcport->disc_state,
516 fcport->fw_login_state, ea->rc, fcport->login_gen, ea->sp->gen2,
517 fcport->rscn_gen, ea->sp->gen1, fcport->loop_id);
525 __func__, ea->fcport->port_name);
529 if (fcport->deleted == QLA_SESS_DELETED)
530 fcport->deleted = 0;
532 fcport->logout_on_delete = 1;
535 qlt_schedule_sess_for_deletion(ea->fcport);
539 if (ea->fcport->disc_state == DSC_DELETE_PEND)
542 if (ea->sp->gen2 != ea->fcport->login_gen) {
546 __func__, ea->fcport->port_name);
548 } else if (ea->sp->gen1 != ea->fcport->rscn_gen) {
549 qla_rscn_replay(fcport);
550 qlt_schedule_sess_for_deletion(fcport);
557 static int qla_post_els_plogi_work(struct scsi_qla_host *vha, fc_port_t *fcport)
565 e->u.fcport.fcport = fcport;
566 fcport->flags |= FCF_ASYNC_ACTIVE;
567 qla2x00_set_fcport_disc_state(fcport, DSC_LOGIN_PEND);
579 sp->name, res, sp->fcport->port_name);
581 sp->fcport->flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE);
589 ea.fcport = sp->fcport;
600 qla2x00_async_adisc(struct scsi_qla_host *vha, fc_port_t *fcport,
607 if (IS_SESSION_DELETED(fcport)) {
610 __func__, fcport->port_name);
611 fcport->flags &= ~FCF_ASYNC_ACTIVE;
615 if (!vha->flags.online || (fcport->flags & FCF_ASYNC_SENT))
618 fcport->flags |= FCF_ASYNC_SENT;
620 sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL);
626 sp->gen1 = fcport->rscn_gen;
627 sp->gen2 = fcport->login_gen;
638 sp->handle, fcport->loop_id, fcport->d_id.b24, fcport->port_name);
650 fcport->flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE);
651 qla2x00_post_async_adisc_work(vha, fcport, data);
709 void qla2x00_clear_loop_id(fc_port_t *fcport)
711 struct qla_hw_data *ha = fcport->vha->hw;
713 if (fcport->loop_id == FC_NO_LOOP_ID ||
714 qla2x00_is_reserved_id(fcport->vha, fcport->loop_id))
717 clear_bit(fcport->loop_id, ha->loop_id_map);
718 fcport->loop_id = FC_NO_LOOP_ID;
724 fc_port_t *fcport, *conflict_fcport;
732 fcport = ea->fcport;
735 __func__, fcport->port_name, fcport->disc_state,
736 fcport->fw_login_state, ea->rc,
737 fcport->login_gen, fcport->last_login_gen,
738 fcport->rscn_gen, fcport->last_rscn_gen, vha->loop_id, fcport->edif.enable);
740 if (fcport->disc_state == DSC_DELETE_PEND)
744 if (fcport->login_retry == 0) {
747 fcport->port_name, fcport->login_retry);
752 if (fcport->last_rscn_gen != fcport->rscn_gen) {
753 qla_rscn_replay(fcport);
754 qlt_schedule_sess_for_deletion(fcport);
756 } else if (fcport->last_login_gen != fcport->login_gen) {
759 __func__, fcport->port_name);
768 __func__, __LINE__, fcport->port_name, n,
769 fcport->d_id.b.domain, fcport->d_id.b.area,
770 fcport->d_id.b.al_pa, fcport->loop_id);
780 if (memcmp((u8 *)&wwn, fcport->port_name, WWN_SIZE))
795 fcport->fc4_type &= ~FS_FC4TYPE_FCP;
796 fcport->fc4_type |= FS_FC4TYPE_NVME;
798 fcport->fc4_type |= FS_FC4TYPE_FCP;
799 fcport->fc4_type &= ~FS_FC4TYPE_NVME;
804 __func__, fcport->port_name,
805 e->current_login_state, fcport->fw_login_state,
806 fcport->fc4_type, id.b24, fcport->d_id.b24,
807 loop_id, fcport->loop_id);
809 switch (fcport->disc_state) {
814 if ((id.b24 != fcport->d_id.b24 &&
815 fcport->d_id.b24 &&
816 fcport->loop_id != FC_NO_LOOP_ID) ||
817 (fcport->loop_id != FC_NO_LOOP_ID &&
818 fcport->loop_id != loop_id)) {
821 __func__, __LINE__, fcport->port_name);
822 if (fcport->n2n_flag)
823 fcport->d_id.b24 = 0;
824 qlt_schedule_sess_for_deletion(fcport);
830 fcport->loop_id = loop_id;
831 if (fcport->n2n_flag)
832 fcport->d_id.b24 = id.b24;
834 wwn = wwn_to_u64(fcport->port_name);
840 * Another share fcport share the same loop_id &
841 * nport id. Conflict fcport needs to finish
842 * cleanup before this fcport can proceed to login.
844 conflict_fcport->conflict = fcport;
845 fcport->login_pause = 1;
854 __func__, __LINE__, fcport->port_name);
857 fcport->port_type = FCT_INITIATOR;
859 fcport->port_type = FCT_TARGET;
861 qla2x00_post_async_adisc_work(vha, fcport,
867 qla24xx_post_gpdb_work(vha, fcport, 0);
873 if (fcport->loop_id == FC_NO_LOOP_ID) {
874 qla2x00_find_new_loop_id(vha, fcport);
875 fcport->fw_login_state =
880 fcport->port_name);
881 qla24xx_fcport_handle_login(vha, fcport);
886 fcport->fw_login_state = current_login_state;
887 fcport->d_id = id;
896 qla2x00_set_fcport_disc_state(fcport,
902 fcport->port_type = FCT_INITIATOR;
904 fcport->port_type = FCT_TARGET;
907 qla2x00_post_async_adisc_work(vha, fcport,
914 qla24xx_post_gpdb_work(vha, fcport, 0);
917 if (fcport_is_bigger(fcport)) {
919 if (fcport->loop_id != FC_NO_LOOP_ID)
920 qla2x00_clear_loop_id(fcport);
922 fcport->loop_id = loop_id;
924 fcport);
929 if (fcport_is_smaller(fcport)) {
931 if (fcport->loop_id != FC_NO_LOOP_ID)
932 qla2x00_clear_loop_id(fcport);
934 fcport->loop_id = loop_id;
936 fcport);
956 if (fcport->d_id.b24 == id.b24) {
972 * another fcport
974 if (fcport->loop_id == loop_id)
975 fcport->loop_id = FC_NO_LOOP_ID;
977 qla24xx_fcport_handle_login(vha, fcport);
980 qla2x00_set_fcport_disc_state(fcport, DSC_DELETED);
981 if (time_after_eq(jiffies, fcport->dm_login_expire)) {
982 if (fcport->n2n_link_reset_cnt < 2) {
983 fcport->n2n_link_reset_cnt++;
992 if (fcport->n2n_chip_reset < 1) {
997 fcport->n2n_chip_reset++;
1001 fcport->port_name);
1002 fcport->scan_state = 0;
1015 qla24xx_fcport_handle_login(vha, fcport);
1027 struct fc_port *fcport = NULL, *tf;
1041 sp->fcport->flags &= ~(FCF_ASYNC_SENT|FCF_ASYNC_ACTIVE);
1071 fcport = tf = NULL;
1076 list_for_each_entry_safe(fcport, tf, &h, gnl_entry) {
1078 list_del_init(&fcport->gnl_entry);
1079 fcport->flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE);
1081 ea.fcport = fcport;
1086 /* create new fcport if fw has knowledge of new sessions */
1095 list_for_each_entry_safe(fcport, tf, &vha->vp_fcports, list) {
1096 if (!memcmp((u8 *)&wwn, fcport->port_name,
1122 list_for_each_entry_safe(fcport, tf, &vha->gnl.fcports,
1124 list_del_init(&fcport->gnl_entry);
1125 fcport->flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE);
1126 if (qla24xx_post_gnl_work(vha, fcport) == QLA_SUCCESS)
1136 int qla24xx_async_gnl(struct scsi_qla_host *vha, fc_port_t *fcport)
1143 if (!vha->flags.online || (fcport->flags & FCF_ASYNC_SENT))
1147 "Async-gnlist WWPN %8phC \n", fcport->port_name);
1150 fcport->flags |= FCF_ASYNC_SENT;
1151 qla2x00_set_fcport_disc_state(fcport, DSC_GNL);
1152 fcport->last_rscn_gen = fcport->rscn_gen;
1153 fcport->last_login_gen = fcport->login_gen;
1155 list_add_tail(&fcport->gnl_entry, &vha->gnl.fcports);
1164 sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL);
1170 sp->gen1 = fcport->rscn_gen;
1171 sp->gen2 = fcport->login_gen;
1187 sp->name, fcport->port_name, sp->handle);
1198 fcport->flags &= ~(FCF_ASYNC_SENT);
1200 fcport->flags &= ~(FCF_ASYNC_ACTIVE);
1204 int qla24xx_post_gnl_work(struct scsi_qla_host *vha, fc_port_t *fcport)
1212 e->u.fcport.fcport = fcport;
1213 fcport->flags |= FCF_ASYNC_ACTIVE;
1221 fc_port_t *fcport = sp->fcport;
1227 sp->name, res, fcport->port_name, mb[1], mb[2]);
1229 fcport->flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE);
1235 ea.fcport = fcport;
1247 int qla24xx_post_prli_work(struct scsi_qla_host *vha, fc_port_t *fcport)
1258 e->u.fcport.fcport = fcport;
1271 sp->fcport->port_name, res);
1273 sp->fcport->flags &= ~FCF_ASYNC_SENT;
1277 ea.fcport = sp->fcport;
1295 qla24xx_async_prli(struct scsi_qla_host *vha, fc_port_t *fcport)
1303 __func__, __LINE__, fcport->port_name);
1307 if ((fcport->fw_login_state == DSC_LS_PLOGI_PEND ||
1308 fcport->fw_login_state == DSC_LS_PRLI_PEND) &&
1311 __func__, __LINE__, fcport->port_name);
1315 sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL);
1319 fcport->flags |= FCF_ASYNC_SENT;
1320 fcport->logout_completed = 0;
1330 if (NVME_TARGET(vha->hw, fcport))
1335 fcport->port_name, sp->handle, fcport->loop_id, fcport->d_id.b24,
1336 fcport->login_retry, fcport->fc4_type, vha->hw->fc4_type_priority,
1337 NVME_TARGET(vha->hw, fcport) ? "nvme" : "fcp");
1341 fcport->flags |= FCF_LOGIN_NEEDED;
1351 fcport->flags &= ~FCF_ASYNC_SENT;
1355 int qla24xx_post_gpdb_work(struct scsi_qla_host *vha, fc_port_t *fcport, u8 opt)
1363 e->u.fcport.fcport = fcport;
1364 e->u.fcport.opt = opt;
1365 fcport->flags |= FCF_ASYNC_ACTIVE;
1369 int qla24xx_async_gpdb(struct scsi_qla_host *vha, fc_port_t *fcport, u8 opt)
1379 if (IS_SESSION_DELETED(fcport)) {
1382 __func__, fcport->port_name);
1383 fcport->flags &= ~FCF_ASYNC_ACTIVE;
1387 if (!vha->flags.online || fcport->flags & FCF_ASYNC_SENT) {
1390 __func__, fcport->port_name, vha->flags.online, fcport->flags);
1394 sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL);
1398 qla2x00_set_fcport_disc_state(fcport, DSC_GPDB);
1400 fcport->flags |= FCF_ASYNC_SENT;
1403 sp->gen1 = fcport->rscn_gen;
1404 sp->gen2 = fcport->login_gen;
1417 mb[1] = fcport->loop_id;
1431 sp->name, fcport->port_name, sp->handle, opt);
1443 fcport->flags &= ~FCF_ASYNC_SENT;
1445 fcport->flags &= ~FCF_ASYNC_ACTIVE;
1446 qla24xx_post_gpdb_work(vha, fcport, opt);
1456 ea->fcport->login_gen++;
1457 ea->fcport->logout_on_delete = 1;
1459 if (!ea->fcport->login_succ && !IS_SW_RESV_ADDR(ea->fcport->d_id)) {
1461 ea->fcport->login_succ = 1;
1464 qla24xx_sched_upd_fcport(ea->fcport);
1466 } else if (ea->fcport->login_succ) {
1474 __func__, __LINE__, ea->fcport->port_name);
1475 qla2x00_set_fcport_disc_state(ea->fcport, DSC_LOGIN_COMPLETE);
1480 static int qla_chk_secure_login(scsi_qla_host_t *vha, fc_port_t *fcport,
1488 fcport->port_name);
1489 fcport->flags |= FCF_FCSP_DEVICE;
1493 fcport->port_name);
1494 fcport->flags &= ~FCF_FCSP_DEVICE;
1497 if (fcport->flags & FCF_FCSP_DEVICE) {
1498 qla2x00_set_fcport_disc_state(fcport, DSC_LOGIN_AUTH_PEND);
1500 fcport->edif.rx_sa_set = 0;
1501 fcport->edif.tx_sa_set = 0;
1502 fcport->edif.rx_sa_pending = 0;
1503 fcport->edif.tx_sa_pending = 0;
1506 fcport->d_id.b24);
1511 __func__, __LINE__, fcport->port_name);
1512 fcport->edif.app_sess_online = 1;
1515 fcport->d_id.b24, 0, fcport);
1522 __func__, __LINE__, fcport->port_name);
1523 qla24xx_post_prli_work(vha, fcport);
1533 fc_port_t *fcport = ea->fcport;
1540 fcport->flags &= ~FCF_ASYNC_SENT;
1544 fcport->port_name, fcport->disc_state, pd->current_login_state,
1545 fcport->fc4_type, ea->rc);
1547 if (fcport->disc_state == DSC_DELETE_PEND) {
1549 __func__, __LINE__, fcport->port_name);
1553 if (NVME_TARGET(vha->hw, fcport))
1558 if (ea->sp->gen2 != fcport->login_gen) {
1563 __func__, fcport->port_name);
1565 } else if (ea->sp->gen1 != fcport->rscn_gen) {
1566 qla_rscn_replay(fcport);
1567 qlt_schedule_sess_for_deletion(fcport);
1569 __func__, __LINE__, fcport->port_name, ls);
1575 __qla24xx_parse_gpdb(vha, fcport, pd);
1578 if (qla_chk_secure_login(vha, fcport, pd)) {
1580 __func__, __LINE__, fcport->port_name, ls);
1590 qla2x00_set_fcport_disc_state(fcport, DSC_GNL);
1594 __func__, __LINE__, fcport->port_name, ls);
1600 __func__, __LINE__, fcport->port_name);
1601 qlt_schedule_sess_for_deletion(fcport);
1607 static void qla_chk_n2n_b4_login(struct scsi_qla_host *vha, fc_port_t *fcport)
1614 __func__, fcport->port_name, fcport->disc_state,
1615 fcport->fw_login_state, fcport->loop_id, fcport->login_retry);
1625 wwn = wwn_to_u64(fcport->port_name);
1628 else if ((fcport->fw_login_state == DSC_LS_PLOGI_COMP)
1630 fcport->plogi_nack_done_deadline))
1640 if (login && fcport->login_retry) {
1641 fcport->login_retry--;
1642 if (fcport->loop_id == FC_NO_LOOP_ID) {
1643 fcport->fw_login_state = DSC_LS_PORT_UNAVAIL;
1644 rc = qla2x00_find_new_loop_id(vha, fcport);
1648 __func__, __LINE__, fcport->port_name);
1649 fcport->scan_state = 0;
1650 qlt_schedule_sess_for_deletion(fcport);
1656 __func__, __LINE__, fcport->port_name);
1657 qla2x00_post_async_login_work(vha, fcport, NULL);
1661 int qla24xx_fcport_handle_login(struct scsi_qla_host *vha, fc_port_t *fcport)
1668 __func__, fcport->port_name, fcport->disc_state,
1669 fcport->fw_login_state, fcport->login_pause, fcport->flags,
1670 fcport->conflict, fcport->last_rscn_gen, fcport->rscn_gen,
1671 fcport->login_gen, fcport->loop_id, fcport->scan_state,
1672 fcport->fc4_type);
1674 if (fcport->scan_state != QLA_FCPORT_FOUND ||
1675 fcport->disc_state == DSC_DELETE_PEND)
1678 if ((fcport->loop_id != FC_NO_LOOP_ID) &&
1680 ((fcport->fw_login_state == DSC_LS_PLOGI_PEND) ||
1681 (fcport->fw_login_state == DSC_LS_PRLI_PEND)))
1684 if (fcport->fw_login_state == DSC_LS_PLOGI_COMP &&
1686 if (time_before_eq(jiffies, fcport->plogi_nack_done_deadline)) {
1696 if (fcport->flags & (FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE)) {
1701 switch (fcport->disc_state) {
1705 if (fcport_is_smaller(fcport)) {
1707 if (fcport->login_retry) {
1708 if (fcport->loop_id == FC_NO_LOOP_ID) {
1710 fcport);
1711 fcport->fw_login_state =
1714 fcport->login_retry--;
1715 qla_post_els_plogi_work(vha, fcport);
1719 fcport->port_name);
1722 qla24xx_post_gnl_work(vha, fcport);
1726 if (fcport->loop_id == FC_NO_LOOP_ID) {
1729 __func__, __LINE__, fcport->port_name);
1730 qla24xx_post_gnl_work(vha, fcport);
1732 qla_chk_n2n_b4_login(vha, fcport);
1741 if ((fcport->current_login_state & 0xf) == 0x6) {
1744 __func__, __LINE__, fcport->port_name);
1745 fcport->chip_reset =
1747 qla24xx_post_gpdb_work(vha, fcport, 0);
1751 __func__, __LINE__, fcport->port_name,
1752 NVME_TARGET(vha->hw, fcport) ? "NVME" :
1754 qla24xx_post_prli_work(vha, fcport);
1758 if (fcport->login_pause) {
1762 fcport->port_name);
1763 fcport->last_rscn_gen = fcport->rscn_gen;
1764 fcport->last_login_gen = fcport->login_gen;
1768 qla_chk_n2n_b4_login(vha, fcport);
1775 qla_chk_n2n_b4_login(vha, fcport);
1777 qlt_schedule_sess_for_deletion(fcport);
1783 qla2x00_post_async_adisc_work(vha, fcport, data);
1790 if (fcport->fw_login_state == DSC_LS_PLOGI_COMP) {
1793 __func__, __LINE__, fcport->port_name,
1794 NVME_TARGET(vha->hw, fcport) ? "NVME" : "FC");
1795 qla24xx_post_prli_work(vha, fcport);
1801 fcport->jiffies_at_registration)/1000;
1802 if (fcport->sec_since_registration < sec && sec &&
1804 fcport->sec_since_registration = sec;
1805 ql_dbg(ql_dbg_disc, fcport->vha, 0xffff,
1807 __func__, fcport->port_name, sec);
1810 if (fcport->next_disc_state != DSC_DELETE_PEND)
1811 fcport->next_disc_state = DSC_ADISC;
1843 fc_port_t *fcport;
1848 fcport = qla2x00_find_fcport_by_nportid(vha, &ea->id, 1);
1849 if (fcport) {
1851 fcport->flags & FCF_FCP2_DEVICE &&
1852 atomic_read(&fcport->state) == FCS_ONLINE) {
1855 fcport->d_id.b24, fcport->port_name);
1868 if (atomic_read(&fcport->state) == FCS_ONLINE) {
1873 fcport->scan_needed = 1;
1874 fcport->rscn_gen++;
1877 fcport->scan_needed = 1;
1878 fcport->rscn_gen++;
1883 list_for_each_entry(fcport, &vha->vp_fcports, list) {
1884 if (fcport->flags & FCF_FCP2_DEVICE &&
1885 atomic_read(&fcport->state) == FCS_ONLINE)
1888 if ((ea->id.b24 & 0xffff00) == (fcport->d_id.b24 & 0xffff00)) {
1889 fcport->scan_needed = 1;
1890 fcport->rscn_gen++;
1895 list_for_each_entry(fcport, &vha->vp_fcports, list) {
1896 if (fcport->flags & FCF_FCP2_DEVICE &&
1897 atomic_read(&fcport->state) == FCS_ONLINE)
1900 if ((ea->id.b24 & 0xff0000) == (fcport->d_id.b24 & 0xff0000)) {
1901 fcport->scan_needed = 1;
1902 fcport->rscn_gen++;
1908 list_for_each_entry(fcport, &vha->vp_fcports, list) {
1909 if (fcport->flags & FCF_FCP2_DEVICE &&
1910 atomic_read(&fcport->state) == FCS_ONLINE)
1913 fcport->scan_needed = 1;
1914 fcport->rscn_gen++;
1931 fc_port_t *fcport = ea->fcport;
1938 __func__, fcport->port_name, fcport->disc_state,
1939 fcport->fw_login_state, fcport->login_pause,
1940 fcport->deleted, fcport->conflict,
1941 fcport->last_rscn_gen, fcport->rscn_gen,
1942 fcport->last_login_gen, fcport->login_gen,
1943 fcport->flags);
1945 if (fcport->last_rscn_gen != fcport->rscn_gen) {
1947 __func__, __LINE__, fcport->port_name);
1948 qla24xx_post_gnl_work(vha, fcport);
1952 qla24xx_fcport_handle_login(vha, fcport);
1958 if (N2N_TOPO(vha->hw) && fcport_is_smaller(ea->fcport) &&
1961 qla24xx_post_gpdb_work(vha, ea->fcport, 0);
1971 __func__, __LINE__, ea->fcport->port_name);
1972 qla24xx_post_prli_work(vha, ea->fcport);
1976 * RSCN(s) came in for this fcport, but the RSCN(s) was not able
1977 * to be consumed by the fcport
1979 void qla_rscn_replay(fc_port_t *fcport)
1983 switch (fcport->disc_state) {
1990 if (fcport->scan_needed) {
1992 ea.id = fcport->d_id;
1994 qla2x00_handle_rscn(fcport->vha, &ea);
2034 sp->handle, sp->fcport->d_id.b24, sp->u.iocb_cmd.u.tmf.flags,
2045 if (_chip_gen != sp->vha->hw->chip_reset || _login_gen != sp->fcport->login_gen) {\
2061 * It is assume caller will provide an fcport pointer and modifier
2070 fc_port_t *fcport = arg->fcport;
2073 if (TMF_NOT_READY(arg->fcport)) {
2076 fcport->loop_id, fcport->d_id.b24,
2082 login_gen = fcport->login_gen;
2085 sp = qla2xxx_get_qpair_sp(vha, arg->qpair, fcport, GFP_KERNEL);
2098 tm_iocb->u.tmf.loop_id = fcport->loop_id;
2105 sp->handle, fcport->loop_id, fcport->d_id.b24,
2120 sp->handle, fcport->loop_id, fcport->d_id.b24,
2145 arg->fcport->d_id.b24, arg->lun, WAIT_LUN);
2148 arg->fcport->d_id.b24, arg->lun, WAIT_TARGET);
2158 fc_port_t *fcport = arg->fcport;
2162 if (TMF_NOT_READY(arg->fcport)) {
2165 fcport->loop_id, fcport->d_id.b24,
2171 login_gen = fcport->login_gen;
2174 sp = qla2xxx_get_qpair_sp(vha, arg->qpair, fcport, GFP_KERNEL);
2194 sp->handle, fcport->loop_id, fcport->d_id.b24,
2214 fcport->d_id.b24, arg->lun);
2217 if (chip_gen == vha->hw->chip_reset && login_gen == fcport->login_gen) {
2222 vha->host_no, fcport->d_id.b24, arg->lun);
2254 fc_port_t *fcport = arg->fcport;
2260 if (t->fcport == arg->fcport && t->lun == arg->lun) {
2264 vha->host_no, fcport->d_id.b24, arg->lun);
2277 if (TMF_NOT_READY(fcport)) {
2301 qla2x00_async_tm_cmd(fc_port_t *fcport, uint32_t flags, uint64_t lun,
2304 struct scsi_qla_host *vha = fcport->vha;
2308 if (TMF_NOT_READY(fcport))
2311 a.vha = fcport->vha;
2312 a.fcport = fcport;
2339 fc_port_t *fcport = sp->fcport;
2341 struct scsi_qla_host *vha = fcport->vha;
2356 return qlafx00_fx_disc(vha, &vha->hw->mr.fcport,
2373 __func__, __LINE__, ea->fcport->port_name);
2375 ea->fcport->chip_reset = vha->hw->base_qpair->chip_reset;
2376 ea->fcport->logout_on_delete = 1;
2377 ea->fcport->nvme_prli_service_param = ea->iop[0];
2379 ea->fcport->nvme_first_burst_size =
2382 ea->fcport->nvme_first_burst_size = 0;
2383 qla24xx_post_gpdb_work(vha, ea->fcport, 0);
2389 __func__, __LINE__, ea->fcport->port_name,
2391 "FCP" : "NVMe", ea->fcport->fc4_type,
2395 if (NVME_FCP_TARGET(ea->fcport)) {
2397 ea->fcport->do_prli_nvme = 0;
2399 ea->fcport->do_prli_nvme = 1;
2401 ea->fcport->do_prli_nvme = 0;
2405 if (ea->fcport->n2n_link_reset_cnt ==
2407 ea->fcport->flags & FCF_FCSP_DEVICE) {
2409 ea->fcport->n2n_link_reset_cnt = 0;
2412 if (ea->fcport->n2n_link_reset_cnt <
2414 ea->fcport->n2n_link_reset_cnt++;
2426 ea->fcport->port_name);
2433 ea->fcport->flags &= ~FCF_ASYNC_SENT;
2434 ea->fcport->keep_nport_handle = 0;
2435 ea->fcport->logout_on_delete = 1;
2436 qlt_schedule_sess_for_deletion(ea->fcport);
2449 struct fc_port *fcport = ea->fcport;
2453 __func__, fcport->port_name, fcport->disc_state,
2454 fcport->fw_login_state, ea->rc, ea->sp->gen2, fcport->login_gen,
2455 ea->sp->gen1, fcport->rscn_gen,
2458 if ((fcport->fw_login_state == DSC_LS_PLOGI_PEND) ||
2459 (fcport->fw_login_state == DSC_LS_PRLI_PEND)) {
2462 __func__, __LINE__, fcport->port_name);
2466 if ((fcport->disc_state == DSC_DELETE_PEND) ||
2467 (fcport->disc_state == DSC_DELETED)) {
2472 if (ea->sp->gen2 != fcport->login_gen) {
2476 __func__, fcport->port_name);
2479 } else if (ea->sp->gen1 != fcport->rscn_gen) {
2482 __func__, fcport->port_name);
2483 qla_rscn_replay(fcport);
2484 qlt_schedule_sess_for_deletion(fcport);
2499 set_bit(ea->fcport->loop_id, vha->hw->loop_id_map);
2501 ea->fcport->chip_reset = vha->hw->base_qpair->chip_reset;
2502 ea->fcport->logout_on_delete = 1;
2503 ea->fcport->send_els_logo = 0;
2504 ea->fcport->fw_login_state = DSC_LS_PLOGI_COMP;
2507 qla24xx_post_gpdb_work(vha, ea->fcport, 0);
2509 if (NVME_TARGET(vha->hw, fcport)) {
2512 __func__, __LINE__, fcport->port_name);
2513 qla24xx_post_prli_work(vha, fcport);
2517 __func__, __LINE__, fcport->port_name,
2518 fcport->loop_id, fcport->d_id.b24);
2520 set_bit(fcport->loop_id, vha->hw->loop_id_map);
2522 fcport->chip_reset = vha->hw->base_qpair->chip_reset;
2523 fcport->logout_on_delete = 1;
2524 fcport->send_els_logo = 0;
2525 fcport->fw_login_state = DSC_LS_PRLI_COMP;
2528 qla24xx_post_gpdb_work(vha, fcport, 0);
2534 __func__, __LINE__, ea->fcport->port_name, ea->data[1]);
2536 qlt_schedule_sess_for_deletion(ea->fcport);
2547 __func__, __LINE__, ea->fcport->port_name,
2548 ea->fcport->loop_id, cid.b24);
2550 set_bit(ea->fcport->loop_id, vha->hw->loop_id_map);
2551 ea->fcport->loop_id = FC_NO_LOOP_ID;
2552 qla24xx_post_gnl_work(vha, ea->fcport);
2557 wwn_to_u64(ea->fcport->port_name),
2558 ea->fcport->d_id, lid, &conflict_fcport);
2562 * Another fcport share the same loop_id/nport id.
2563 * Conflict fcport needs to finish cleanup before this
2564 * fcport can proceed to login.
2566 conflict_fcport->conflict = ea->fcport;
2567 ea->fcport->login_pause = 1;
2571 __func__, __LINE__, ea->fcport->port_name,
2572 ea->fcport->d_id.b24, lid);
2576 __func__, __LINE__, ea->fcport->port_name,
2577 ea->fcport->d_id.b24, lid);
2579 qla2x00_clear_loop_id(ea->fcport);
2581 ea->fcport->loop_id = lid;
2582 ea->fcport->keep_nport_handle = 0;
2583 ea->fcport->logout_on_delete = 1;
2584 qlt_schedule_sess_for_deletion(ea->fcport);
5494 void qla2x00_set_fcport_state(fc_port_t *fcport, int state)
5498 old_state = atomic_read(&fcport->state);
5499 atomic_set(&fcport->state, state);
5501 /* Don't print state transitions during initial allocation of fcport */
5503 ql_dbg(ql_dbg_disc, fcport->vha, 0x207d,
5505 fcport->port_name, port_state_str[old_state],
5506 port_state_str[state], fcport->d_id.b.domain,
5507 fcport->d_id.b.area, fcport->d_id.b.al_pa);
5512 * qla2x00_alloc_fcport() - Allocate a generic fcport.
5516 * Returns a pointer to the allocated fcport, or NULL, if none available.
5521 fc_port_t *fcport;
5523 fcport = kzalloc(sizeof(fc_port_t), flags);
5524 if (!fcport)
5527 fcport->ct_desc.ct_sns = dma_alloc_coherent(&vha->hw->pdev->dev,
5528 sizeof(struct ct_sns_pkt), &fcport->ct_desc.ct_sns_dma,
5530 if (!fcport->ct_desc.ct_sns) {
5533 kfree(fcport);
5537 /* Setup fcport template structure. */
5538 fcport->vha = vha;
5539 fcport->port_type = FCT_UNKNOWN;
5540 fcport->loop_id = FC_NO_LOOP_ID;
5541 qla2x00_set_fcport_state(fcport, FCS_UNCONFIGURED);
5542 fcport->supported_classes = FC_COS_UNSPECIFIED;
5543 fcport->fp_speed = PORT_SPEED_UNKNOWN;
5545 fcport->disc_state = DSC_DELETED;
5546 fcport->fw_login_state = DSC_LS_PORT_UNAVAIL;
5547 fcport->deleted = QLA_SESS_DELETED;
5548 fcport->login_retry = vha->hw->login_retry_count;
5549 fcport->chip_reset = vha->hw->base_qpair->chip_reset;
5550 fcport->logout_on_delete = 1;
5551 fcport->tgt_link_down_time = QLA2XX_MAX_LINK_DOWN_TIME;
5552 fcport->tgt_short_link_down_cnt = 0;
5553 fcport->dev_loss_tmo = 0;
5555 if (!fcport->ct_desc.ct_sns) {
5558 kfree(fcport);
5562 INIT_WORK(&fcport->del_work, qla24xx_delete_sess_fn);
5563 INIT_WORK(&fcport->free_work, qlt_free_session_done);
5564 INIT_WORK(&fcport->reg_work, qla_register_fcport_fn);
5565 INIT_LIST_HEAD(&fcport->gnl_entry);
5566 INIT_LIST_HEAD(&fcport->list);
5567 INIT_LIST_HEAD(&fcport->unsol_ctx_head);
5569 INIT_LIST_HEAD(&fcport->sess_cmd_list);
5570 spin_lock_init(&fcport->sess_cmd_lock);
5572 spin_lock_init(&fcport->edif.sa_list_lock);
5573 INIT_LIST_HEAD(&fcport->edif.tx_sa_list);
5574 INIT_LIST_HEAD(&fcport->edif.rx_sa_list);
5576 spin_lock_init(&fcport->edif.indx_list_lock);
5577 INIT_LIST_HEAD(&fcport->edif.edif_indx_list);
5579 return fcport;
5583 qla2x00_free_fcport(fc_port_t *fcport)
5585 if (fcport->ct_desc.ct_sns) {
5586 dma_free_coherent(&fcport->vha->hw->pdev->dev,
5587 sizeof(struct ct_sns_pkt), fcport->ct_desc.ct_sns,
5588 fcport->ct_desc.ct_sns_dma);
5590 fcport->ct_desc.ct_sns = NULL;
5593 qla_edif_flush_sa_ctl_lists(fcport);
5594 list_del(&fcport->list);
5595 qla2x00_clear_loop_id(fcport);
5597 qla_edif_list_del(fcport);
5599 kfree(fcport);
5763 fc_port_t *fcport;
5770 list_for_each_entry(fcport, &vha->vp_fcports, list) {
5771 if (fcport->n2n_flag) {
5772 qla24xx_fcport_handle_login(vha, fcport);
5819 fc_port_t *fcport, *new_fcport;
5873 list_for_each_entry(fcport, &vha->vp_fcports, list) {
5874 fcport->scan_state = QLA_FCPORT_SCAN;
5877 /* Allocate temporary fcport for any new fcports discovered. */
5881 "Memory allocation failed for fcport.\n");
5926 "Failed to retrieve fcport information "
5941 fcport = NULL;
5942 list_for_each_entry(fcport, &vha->vp_fcports, list) {
5943 if (memcmp(new_fcport->port_name, fcport->port_name,
5947 fcport->flags &= ~FCF_FABRIC_DEVICE;
5948 fcport->loop_id = new_fcport->loop_id;
5949 fcport->port_type = new_fcport->port_type;
5950 fcport->d_id.b24 = new_fcport->d_id.b24;
5951 memcpy(fcport->node_name, new_fcport->node_name,
5953 fcport->scan_state = QLA_FCPORT_FOUND;
5954 if (fcport->login_retry == 0) {
5955 fcport->login_retry = vha->hw->login_retry_count;
5958 fcport->port_name, fcport->loop_id,
5959 fcport->login_retry);
5969 /* Allocate a new replacement fcport. */
5970 fcport = new_fcport;
5978 "Failed to allocate memory for fcport.\n");
5989 fcport->fp_speed = ha->link_data_rate;
5992 list_for_each_entry(fcport, &vha->vp_fcports, list) {
5996 if (fcport->scan_state == QLA_FCPORT_SCAN) {
5999 atomic_read(&fcport->state) == FCS_ONLINE) {
6000 qla2x00_mark_device_lost(vha, fcport,
6002 if (fcport->loop_id != FC_NO_LOOP_ID &&
6003 (fcport->flags & FCF_FCP2_DEVICE) == 0 &&
6004 fcport->port_type != FCT_INITIATOR &&
6005 fcport->port_type != FCT_BROADCAST) {
6009 fcport->port_name);
6011 qlt_schedule_sess_for_deletion(fcport);
6017 if (fcport->scan_state == QLA_FCPORT_FOUND)
6018 qla24xx_fcport_handle_login(vha, fcport);
6032 qla2x00_iidma_fcport(scsi_qla_host_t *vha, fc_port_t *fcport)
6041 if (atomic_read(&fcport->state) != FCS_ONLINE)
6044 if (fcport->fp_speed == PORT_SPEED_UNKNOWN ||
6045 fcport->fp_speed > ha->link_data_rate ||
6049 rval = qla2x00_set_idma_speed(vha, fcport->loop_id, fcport->fp_speed,
6054 fcport->port_name, rval, fcport->fp_speed, mb[0], mb[1]);
6058 qla2x00_get_link_speed_str(ha, fcport->fp_speed),
6059 fcport->fp_speed, fcport->port_name);
6063 void qla_do_iidma_work(struct scsi_qla_host *vha, fc_port_t *fcport)
6065 qla2x00_iidma_fcport(vha, fcport);
6066 qla24xx_update_fcport_fcp_prio(vha, fcport);
6069 int qla_post_iidma_work(struct scsi_qla_host *vha, fc_port_t *fcport)
6077 e->u.fcport.fcport = fcport;
6083 qla2x00_reg_remote_port(scsi_qla_host_t *vha, fc_port_t *fcport)
6089 if (atomic_read(&fcport->state) == FCS_ONLINE)
6092 rport_ids.node_name = wwn_to_u64(fcport->node_name);
6093 rport_ids.port_name = wwn_to_u64(fcport->port_name);
6094 rport_ids.port_id = fcport->d_id.b.domain << 16 |
6095 fcport->d_id.b.area << 8 | fcport->d_id.b.al_pa;
6097 fcport->rport = rport = fc_remote_port_add(vha->host, 0, &rport_ids);
6104 spin_lock_irqsave(fcport->vha->host->host_lock, flags);
6105 *((fc_port_t **)rport->dd_data) = fcport;
6106 spin_unlock_irqrestore(fcport->vha->host->host_lock, flags);
6107 fcport->dev_loss_tmo = rport->dev_loss_tmo;
6109 rport->supported_classes = fcport->supported_classes;
6112 if (fcport->port_type == FCT_INITIATOR)
6114 if (fcport->port_type == FCT_TARGET)
6116 if (fcport->port_type & FCT_NVME_INITIATOR)
6118 if (fcport->port_type & FCT_NVME_TARGET)
6120 if (fcport->port_type & FCT_NVME_DISCOVERY)
6127 __func__, fcport->port_name, vha->host_no,
6129 (fcport->port_type == FCT_TARGET) ? "tgt" :
6130 ((fcport->port_type & FCT_NVME) ? "nvme" : "ini"));
6139 * fcport = port structure pointer.
6149 qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport)
6153 if (IS_SW_RESV_ADDR(fcport->d_id))
6157 __func__, fcport->port_name);
6159 qla2x00_set_fcport_disc_state(fcport, DSC_UPD_FCPORT);
6160 fcport->login_retry = vha->hw->login_retry_count;
6161 fcport->flags &= ~(FCF_LOGIN_NEEDED | FCF_ASYNC_SENT);
6164 fcport->deleted = 0;
6168 fcport->logout_on_delete = 0;
6170 fcport->logout_on_delete = 1;
6171 fcport->n2n_chip_reset = fcport->n2n_link_reset_cnt = 0;
6173 if (fcport->tgt_link_down_time < fcport->dev_loss_tmo) {
6174 fcport->tgt_short_link_down_cnt++;
6175 fcport->tgt_link_down_time = QLA2XX_MAX_LINK_DOWN_TIME;
6181 fcport->keep_nport_handle = 1;
6187 qla2x00_iidma_fcport(vha, fcport);
6189 qla2x00_dfs_create_rport(vha, fcport);
6191 qla24xx_update_fcport_fcp_prio(vha, fcport);
6195 qla2x00_reg_remote_port(vha, fcport);
6200 qlt_fc_port_added(vha, fcport);
6203 qla2x00_reg_remote_port(vha, fcport);
6206 qlt_fc_port_added(vha, fcport);
6212 if (NVME_TARGET(vha->hw, fcport))
6213 qla_nvme_register_remote(vha, fcport);
6215 qla2x00_set_fcport_state(fcport, FCS_ONLINE);
6218 if (fcport->id_changed) {
6219 fcport->id_changed = 0;
6222 __func__, __LINE__, fcport->port_name,
6224 qla24xx_post_gfpnid_work(vha, fcport);
6228 __func__, __LINE__, fcport->port_name,
6230 qla24xx_post_gpsc_work(vha, fcport);
6234 qla2x00_set_fcport_disc_state(fcport, DSC_LOGIN_COMPLETE);
6239 fc_port_t *fcport = container_of(work, struct fc_port, reg_work);
6240 u32 rscn_gen = fcport->rscn_gen;
6243 if (IS_SW_RESV_ADDR(fcport->d_id))
6246 qla2x00_update_fcport(fcport->vha, fcport);
6248 ql_dbg(ql_dbg_disc, fcport->vha, 0x911e,
6250 rscn_gen, fcport->rscn_gen, fcport->next_disc_state);
6252 if (rscn_gen != fcport->rscn_gen) {
6254 switch (fcport->next_disc_state) {
6256 qlt_schedule_sess_for_deletion(fcport);
6260 qla2x00_post_async_adisc_work(fcport->vha, fcport,
6284 fc_port_t *fcport;
6392 list_for_each_entry(fcport, &vha->vp_fcports, list)
6393 fcport->scan_state = QLA_FCPORT_SCAN;
6429 fc_port_t *fcport, *new_fcport;
6480 /* Allocate temporary fcport for any new fcports discovered. */
6484 "Failed to allocate memory for fcport.\n");
6587 list_for_each_entry(fcport, &vha->vp_fcports, list) {
6588 if (memcmp(new_fcport->port_name, fcport->port_name,
6592 fcport->scan_state = QLA_FCPORT_FOUND;
6597 memcpy(fcport->fabric_port_name,
6599 fcport->fp_speed = new_fcport->fp_speed;
6605 if (fcport->d_id.b24 == new_fcport->d_id.b24 &&
6606 (atomic_read(&fcport->state) == FCS_ONLINE ||
6611 if (fcport->login_retry == 0)
6612 fcport->login_retry =
6617 if ((fcport->flags & FCF_FABRIC_DEVICE) == 0) {
6618 fcport->d_id.b24 = new_fcport->d_id.b24;
6619 qla2x00_clear_loop_id(fcport);
6620 fcport->flags |= (FCF_FABRIC_DEVICE |
6634 fcport->port_name,
6635 fcport->d_id.b.domain,
6636 fcport->d_id.b.area,
6637 fcport->d_id.b.al_pa,
6638 fcport->loop_id,
6642 fcport->d_id.b24 = new_fcport->d_id.b24;
6646 fcport->d_id.b24 = new_fcport->d_id.b24;
6647 fcport->flags |= FCF_LOGIN_NEEDED;
6651 if (found && NVME_TARGET(vha->hw, fcport)) {
6652 if (fcport->disc_state == DSC_DELETE_PEND) {
6653 qla2x00_set_fcport_disc_state(fcport, DSC_GNL);
6655 fcport->login_succ = 0;
6670 /* Allocate a new replacement fcport. */
6675 "Memory allocation failed for fcport.\n");
6687 list_for_each_entry(fcport, &vha->vp_fcports, list) {
6691 if ((fcport->flags & FCF_FABRIC_DEVICE) == 0)
6694 if (fcport->scan_state == QLA_FCPORT_SCAN) {
6697 atomic_read(&fcport->state) == FCS_ONLINE) {
6698 qla2x00_mark_device_lost(vha, fcport,
6700 if (fcport->loop_id != FC_NO_LOOP_ID &&
6701 (fcport->flags & FCF_FCP2_DEVICE) == 0 &&
6702 fcport->port_type != FCT_INITIATOR &&
6703 fcport->port_type != FCT_BROADCAST) {
6707 fcport->port_name);
6708 qlt_schedule_sess_for_deletion(fcport);
6714 if (fcport->scan_state == QLA_FCPORT_FOUND &&
6715 (fcport->flags & FCF_LOGIN_NEEDED) != 0)
6716 qla24xx_fcport_handle_login(vha, fcport);
6764 qla2x00_fabric_login(scsi_qla_host_t *vha, fc_port_t *fcport,
6780 fcport->loop_id, fcport->d_id.b.domain,
6781 fcport->d_id.b.area, fcport->d_id.b.al_pa);
6783 /* Login fcport on switch. */
6784 rval = ha->isp_ops->fabric_login(vha, fcport->loop_id,
6785 fcport->d_id.b.domain, fcport->d_id.b.area,
6786 fcport->d_id.b.al_pa, mb, BIT_0);
6799 tmp_loopid = fcport->loop_id;
6800 fcport->loop_id = mb[1];
6805 fcport->loop_id, fcport->d_id.b.domain,
6806 fcport->d_id.b.area, fcport->d_id.b.al_pa);
6820 *next_loopid = (fcport->loop_id + 1);
6824 fcport->port_type = FCT_INITIATOR;
6826 fcport->port_type = FCT_TARGET;
6828 fcport->flags |= FCF_FCP2_DEVICE;
6833 fcport->supported_classes |= FC_COS_CLASS2;
6835 fcport->supported_classes |= FC_COS_CLASS3;
6839 fcport->flags |=
6849 fcport->loop_id++;
6850 rval = qla2x00_find_new_loop_id(vha, fcport);
6861 *next_loopid = fcport->loop_id;
6862 ha->isp_ops->fabric_logout(vha, fcport->loop_id,
6863 fcport->d_id.b.domain, fcport->d_id.b.area,
6864 fcport->d_id.b.al_pa);
6865 qla2x00_mark_device_lost(vha, fcport, 1);
6875 "jiffies=%lx.\n", mb[0], fcport->d_id.b.domain,
6876 fcport->d_id.b.area, fcport->d_id.b.al_pa,
6877 fcport->loop_id, jiffies);
6879 *next_loopid = fcport->loop_id;
6880 ha->isp_ops->fabric_logout(vha, fcport->loop_id,
6881 fcport->d_id.b.domain, fcport->d_id.b.area,
6882 fcport->d_id.b.al_pa);
6883 qla2x00_clear_loop_id(fcport);
6884 fcport->login_retry = 0;
6908 qla2x00_local_device_login(scsi_qla_host_t *vha, fc_port_t *fcport)
6914 rval = qla2x00_login_local_device(vha, fcport, mb, BIT_0);
7358 fc_port_t *fcport;
7444 list_for_each_entry(fcport, &vha->vp_fcports, list) {
7445 fcport->flags &= ~(FCF_LOGIN_NEEDED | FCF_ASYNC_SENT);
7446 fcport->scan_state = 0;
7453 list_for_each_entry(fcport, &vp->vp_fcports, list)
7454 fcport->flags &= ~(FCF_LOGIN_NEEDED | FCF_ASYNC_SENT);
9444 * fcport = port structure pointer.
9454 qla24xx_get_fcp_prio(scsi_qla_host_t *vha, fc_port_t *fcport)
9492 pid2 = fcport->d_id.b24 & INVALID_PORT_ID;
9511 wwn1 = wwn_to_u64(fcport->port_name);
9547 qla24xx_update_fcport_fcp_prio(scsi_qla_host_t *vha, fc_port_t *fcport)
9553 if (fcport->port_type != FCT_TARGET ||
9554 fcport->loop_id == FC_NO_LOOP_ID)
9557 priority = qla24xx_get_fcp_prio(vha, fcport);
9562 fcport->fcp_prio = priority & 0xf;
9566 ret = qla24xx_set_fcp_prio(vha, fcport->loop_id, priority, mb);
9568 if (fcport->fcp_prio != priority)
9572 fcport->loop_id, fcport->d_id.b.domain,
9573 fcport->d_id.b.area, fcport->d_id.b.al_pa);
9574 fcport->fcp_prio = priority & 0xf;
9578 "loop_id=%d port_id=%02x%02x%02x.\n", ret, fcport->loop_id,
9579 fcport->d_id.b.domain, fcport->d_id.b.area,
9580 fcport->d_id.b.al_pa);
9601 fc_port_t *fcport;
9605 list_for_each_entry(fcport, &vha->vp_fcports, list)
9606 ret = qla24xx_update_fcport_fcp_prio(vha, fcport);
9852 fc_port_t *fcport = NULL;
9867 list_for_each_entry(fcport, &vha->vp_fcports, list) {
9868 fcport->tgt_short_link_down_cnt = 0;
9869 fcport->tgt_link_down_time = QLA2XX_MAX_LINK_DOWN_TIME;
9898 fc_port_t *fcport = NULL;
9956 list_for_each_entry(fcport, &vha->vp_fcports, list) {
9957 if (fcport->port_type != FCT_TARGET)
9959 if (!fcport->rport)
9962 rsp_data->entry[i].tgt_num = fcport->rport->number;
9963 rsp_data->entry[i].cnt = fcport->tgt_short_link_down_cnt;
9977 fc_port_t *fcport = *(fc_port_t **)rport->dd_data;
9983 tgt_data->stats.entry[0].cnt = fcport->tgt_short_link_down_cnt;