Lines Matching refs:fcport

16 static uint16_t qla_edif_sadb_get_sa_index(fc_port_t *fcport,
18 static int qla_edif_sadb_delete_sa_index(fc_port_t *fcport, uint16_t nport_handle,
80 static struct edif_list_entry *qla_edif_list_find_sa_index(fc_port_t *fcport, in qla_edif_list_find_sa_index() argument
85 struct list_head *indx_list = &fcport->edif.edif_indx_list; in qla_edif_list_find_sa_index()
98 fc_port_t *fcport = edif_entry->fcport; in qla2x00_sa_replace_iocb_timeout() local
99 struct scsi_qla_host *vha = fcport->vha; in qla2x00_sa_replace_iocb_timeout()
106 __func__, edif_entry->handle, fcport->port_name, fcport->d_id.b24); in qla2x00_sa_replace_iocb_timeout()
112 spin_lock_irqsave(&fcport->edif.indx_list_lock, flags); in qla2x00_sa_replace_iocb_timeout()
126 spin_unlock_irqrestore(&fcport->edif.indx_list_lock, flags); in qla2x00_sa_replace_iocb_timeout()
128 sa_ctl = qla_edif_find_sa_ctl_by_index(fcport, in qla2x00_sa_replace_iocb_timeout()
139 qla_post_sa_replace_work(fcport->vha, fcport, in qla2x00_sa_replace_iocb_timeout()
148 spin_unlock_irqrestore(&fcport->edif.indx_list_lock, flags); in qla2x00_sa_replace_iocb_timeout()
156 static int qla_edif_list_add_sa_update_index(fc_port_t *fcport, in qla_edif_list_add_sa_update_index() argument
163 entry = qla_edif_list_find_sa_index(fcport, handle); in qla_edif_list_add_sa_update_index()
187 spin_lock_irqsave(&fcport->edif.indx_list_lock, flags); in qla_edif_list_add_sa_update_index()
188 list_add_tail(&entry->next, &fcport->edif.edif_indx_list); in qla_edif_list_add_sa_update_index()
189 spin_unlock_irqrestore(&fcport->edif.indx_list_lock, flags); in qla_edif_list_add_sa_update_index()
194 static void qla_edif_list_delete_sa_index(fc_port_t *fcport, struct edif_list_entry *entry) in qla_edif_list_delete_sa_index() argument
198 spin_lock_irqsave(&fcport->edif.indx_list_lock, flags); in qla_edif_list_delete_sa_index()
200 spin_unlock_irqrestore(&fcport->edif.indx_list_lock, flags); in qla_edif_list_delete_sa_index()
204 fc_port_t *fcport, uint16_t nport_handle, struct edif_sa_ctl *sa_ctl) in qla_post_sa_replace_work() argument
212 e->u.sa_update.fcport = fcport; in qla_post_sa_replace_work()
215 fcport->flags |= FCF_ASYNC_ACTIVE; in qla_post_sa_replace_work()
220 qla_edif_sa_ctl_init(scsi_qla_host_t *vha, struct fc_port *fcport) in qla_edif_sa_ctl_init() argument
224 fcport->node_name, fcport->port_name, fcport->d_id.b24); in qla_edif_sa_ctl_init()
226 fcport->edif.tx_rekey_cnt = 0; in qla_edif_sa_ctl_init()
227 fcport->edif.rx_rekey_cnt = 0; in qla_edif_sa_ctl_init()
229 fcport->edif.tx_bytes = 0; in qla_edif_sa_ctl_init()
230 fcport->edif.rx_bytes = 0; in qla_edif_sa_ctl_init()
234 fc_port_t *fcport) in qla_bsg_check() argument
259 qla_pur_get_pending(vha, fcport, bsg_job); in qla_bsg_check()
263 __func__, sc_to_str(p->sub_cmd), fcport->port_name, in qla_bsg_check()
264 fcport->d_id.b24, rpl->rx_xchg_address, in qla_bsg_check()
318 qla_edif_free_sa_ctl(fc_port_t *fcport, struct edif_sa_ctl *sa_ctl, in qla_edif_free_sa_ctl() argument
323 spin_lock_irqsave(&fcport->edif.sa_list_lock, flags); in qla_edif_free_sa_ctl()
325 spin_unlock_irqrestore(&fcport->edif.sa_list_lock, flags); in qla_edif_free_sa_ctl()
327 fcport->edif.tx_rekey_cnt--; in qla_edif_free_sa_ctl()
329 fcport->edif.rx_rekey_cnt--; in qla_edif_free_sa_ctl()
334 static void qla_edif_add_sa_index_to_freepool(fc_port_t *fcport, int dir, in qla_edif_add_sa_index_to_freepool() argument
338 struct scsi_qla_host *vha = fcport->vha; in qla_edif_add_sa_index_to_freepool()
361 struct fc_port *fcport, struct edif_sa_index_entry *entry, in __qla2x00_release_all_sadb() argument
373 if (fcport->loop_id != entry->handle) { in __qla2x00_release_all_sadb()
376 __func__, i, entry->handle, fcport->loop_id, in __qla2x00_release_all_sadb()
381 sa_ctl = qla_edif_find_sa_ctl_by_index(fcport, in __qla2x00_release_all_sadb()
384 qla_edif_find_sa_ctl_by_index(fcport, sa_ctl->index, pdir)) { in __qla2x00_release_all_sadb()
387 qla_edif_free_sa_ctl(fcport, sa_ctl, sa_ctl->index); in __qla2x00_release_all_sadb()
400 qla_edif_add_sa_index_to_freepool(fcport, dir, in __qla2x00_release_all_sadb()
406 qla_edif_list_find_sa_index(fcport, entry->handle); in __qla2x00_release_all_sadb()
412 qla_edif_list_delete_sa_index(fcport, edif_entry); in __qla2x00_release_all_sadb()
422 fcport->edif.rx_sa_set = 1; in __qla2x00_release_all_sadb()
423 fcport->edif.rx_sa_pending = 0; in __qla2x00_release_all_sadb()
427 QL_VND_RX_SA_KEY, fcport); in __qla2x00_release_all_sadb()
445 void qla2x00_release_all_sadb(struct scsi_qla_host *vha, struct fc_port *fcport) in qla2x00_release_all_sadb() argument
457 if (entry->fcport == fcport) { in qla2x00_release_all_sadb()
460 __qla2x00_release_all_sadb(vha, fcport, entry, 0); in qla2x00_release_all_sadb()
468 if (entry->fcport == fcport) { in qla2x00_release_all_sadb()
472 __qla2x00_release_all_sadb(vha, fcport, entry, SAU_FLG_TX); in qla2x00_release_all_sadb()
492 struct fc_port *fcport; in qla_delete_n2n_sess_and_wait() local
499 fcport = NULL; in qla_delete_n2n_sess_and_wait()
500 list_for_each_entry(fcport, &vha->vp_fcports, list) { in qla_delete_n2n_sess_and_wait()
501 if (!fcport->n2n_flag) in qla_delete_n2n_sess_and_wait()
504 ql_dbg(ql_dbg_disc, fcport->vha, 0x2016, in qla_delete_n2n_sess_and_wait()
507 qla_edif_sa_ctl_init(vha, fcport); in qla_delete_n2n_sess_and_wait()
508 qlt_schedule_sess_for_deletion(fcport); in qla_delete_n2n_sess_and_wait()
511 if (fcport->disc_state != DSC_DELETE_PEND) { in qla_delete_n2n_sess_and_wait()
540 struct fc_port *fcport, *tf; in qla_edif_app_start() local
560 list_for_each_entry_safe(fcport, tf, &vha->vp_fcports, list) in qla_edif_app_start()
561 fcport->n2n_link_reset_cnt = 0; in qla_edif_app_start()
585 list_for_each_entry_safe(fcport, tf, &vha->vp_fcports, list) { in qla_edif_app_start()
588 fcport->node_name, fcport->port_name, in qla_edif_app_start()
589 fcport->d_id.b24); in qla_edif_app_start()
595 __func__, fcport->se_sess, fcport, in qla_edif_app_start()
596 fcport->port_name, fcport->loop_id, in qla_edif_app_start()
597 fcport->d_id.b24, fcport->logout_on_delete, in qla_edif_app_start()
598 fcport->keep_nport_handle, fcport->send_els_logo, in qla_edif_app_start()
599 fcport->disc_state, fcport->edif.auth_state, in qla_edif_app_start()
600 fcport->edif.app_stop); in qla_edif_app_start()
605 fcport->login_retry = vha->hw->login_retry_count; in qla_edif_app_start()
607 fcport->edif.app_stop = 0; in qla_edif_app_start()
608 fcport->edif.app_sess_online = 0; in qla_edif_app_start()
610 if (fcport->scan_state != QLA_FCPORT_FOUND) in qla_edif_app_start()
613 if (fcport->port_type == FCT_UNKNOWN && in qla_edif_app_start()
614 !fcport->fc4_features) in qla_edif_app_start()
615 rval = qla24xx_async_gffid(vha, fcport, true); in qla_edif_app_start()
617 if (!rval && !(fcport->fc4_features & FC4_FF_TARGET || in qla_edif_app_start()
618 fcport->port_type & (FCT_TARGET|FCT_NVME_TARGET))) in qla_edif_app_start()
625 __func__, fcport->port_name); in qla_edif_app_start()
626 qlt_schedule_sess_for_deletion(fcport); in qla_edif_app_start()
627 qla_edif_sa_ctl_init(vha, fcport); in qla_edif_app_start()
675 struct fc_port *fcport, *tf; in qla_edif_app_stop() local
690 list_for_each_entry_safe(fcport, tf, &vha->vp_fcports, list) { in qla_edif_app_stop()
691 if (!(fcport->flags & FCF_FCSP_DEVICE)) in qla_edif_app_stop()
694 if (fcport->flags & FCF_FCSP_DEVICE) { in qla_edif_app_stop()
697 __func__, fcport, in qla_edif_app_stop()
698 fcport->port_name, fcport->loop_id, fcport->d_id.b24, in qla_edif_app_stop()
699 fcport->logout_on_delete, fcport->keep_nport_handle, in qla_edif_app_stop()
700 fcport->send_els_logo); in qla_edif_app_stop()
705 fcport->edif.app_stop = 1; in qla_edif_app_stop()
708 __func__, fcport->port_name); in qla_edif_app_stop()
710 fcport->send_els_logo = 1; in qla_edif_app_stop()
711 qlt_schedule_sess_for_deletion(fcport); in qla_edif_app_stop()
724 qla_edif_app_chk_sa_update(scsi_qla_host_t *vha, fc_port_t *fcport, in qla_edif_app_chk_sa_update() argument
729 if (!(fcport->edif.rx_sa_set && fcport->edif.tx_sa_set)) { in qla_edif_app_chk_sa_update()
732 __func__, fcport->port_name, fcport->edif.tx_sa_set, in qla_edif_app_chk_sa_update()
733 fcport->edif.rx_sa_set); in qla_edif_app_chk_sa_update()
739 fcport->port_name); in qla_edif_app_chk_sa_update()
740 fcport->edif.rx_sa_set = fcport->edif.tx_sa_set = 0; in qla_edif_app_chk_sa_update()
741 fcport->edif.rx_sa_pending = fcport->edif.tx_sa_pending = 0; in qla_edif_app_chk_sa_update()
759 fc_port_t *fcport = NULL; in qla_edif_app_authok() local
774 fcport = qla2x00_find_fcport_by_wwpn(vha, in qla_edif_app_authok()
776 if (!fcport) in qla_edif_app_authok()
782 fcport = qla2x00_find_fcport_by_pid(vha, &portid); in qla_edif_app_authok()
783 if (!fcport) in qla_edif_app_authok()
795 if (!fcport) { in qla_edif_app_authok()
804 if (atomic_read(&fcport->state) == FCS_ONLINE) { in qla_edif_app_authok()
809 qla_edif_app_chk_sa_update(vha, fcport, &appplogireply); in qla_edif_app_authok()
814 if (fcport->disc_state != DSC_LOGIN_AUTH_PEND) { in qla_edif_app_authok()
817 __func__, fcport->port_name, fcport->disc_state); in qla_edif_app_authok()
825 fcport->edif.authok = 1; in qla_edif_app_authok()
826 if (!(fcport->edif.rx_sa_set && fcport->edif.tx_sa_set)) { in qla_edif_app_authok()
829 __func__, fcport->port_name, fcport->edif.tx_sa_set, in qla_edif_app_authok()
830 fcport->edif.rx_sa_set); in qla_edif_app_authok()
838 fcport->port_name); in qla_edif_app_authok()
839 fcport->edif.rx_sa_set = fcport->edif.tx_sa_set = 0; in qla_edif_app_authok()
840 fcport->edif.rx_sa_pending = fcport->edif.tx_sa_pending = 0; in qla_edif_app_authok()
846 __func__, fcport->port_name); in qla_edif_app_authok()
847 qla24xx_post_prli_work(vha, fcport); in qla_edif_app_authok()
872 fc_port_t *fcport = NULL; in qla_edif_app_authfail() local
892 fcport = qla2x00_find_fcport_by_wwpn(vha, in qla_edif_app_authfail()
897 fcport = qla2x00_find_fcport_by_pid(vha, &portid); in qla_edif_app_authfail()
898 if (!fcport) in qla_edif_app_authfail()
915 "%s fcport is 0x%p\n", __func__, fcport); in qla_edif_app_authfail()
917 if (fcport) { in qla_edif_app_authfail()
921 __func__, fcport->port_name, fcport->loop_id, fcport->d_id.b24); in qla_edif_app_authfail()
923 if (qla_ini_mode_enabled(fcport->vha)) { in qla_edif_app_authfail()
924 fcport->send_els_logo = 1; in qla_edif_app_authfail()
925 qlt_schedule_sess_for_deletion(fcport); in qla_edif_app_authfail()
962 struct fc_port *fcport = NULL, *tf; in qla_edif_app_getfcinfo() local
966 list_for_each_entry_safe(fcport, tf, &vha->vp_fcports, list) { in qla_edif_app_getfcinfo()
967 if (!(fcport->flags & FCF_FCSP_DEVICE)) in qla_edif_app_getfcinfo()
981 if (tdid.b24 != 0 && tdid.b24 != fcport->d_id.b24) in qla_edif_app_getfcinfo()
985 if (fcport->scan_state != QLA_FCPORT_FOUND) in qla_edif_app_getfcinfo()
988 if (fcport->port_type == FCT_UNKNOWN && in qla_edif_app_getfcinfo()
989 !fcport->fc4_features) in qla_edif_app_getfcinfo()
990 rval = qla24xx_async_gffid(vha, fcport, in qla_edif_app_getfcinfo()
994 !(fcport->fc4_features & FC4_FF_TARGET || in qla_edif_app_getfcinfo()
995 fcport->port_type & in qla_edif_app_getfcinfo()
1005 if (fcport->port_type & (FCT_NVME_TARGET | FCT_TARGET)) in qla_edif_app_getfcinfo()
1008 if (fcport->port_type & (FCT_NVME_INITIATOR | FCT_INITIATOR)) in qla_edif_app_getfcinfo()
1012 app_reply->ports[pcnt].remote_pid = fcport->d_id; in qla_edif_app_getfcinfo()
1016 fcport->node_name, fcport->port_name, pcnt, in qla_edif_app_getfcinfo()
1017 fcport->d_id.b24, fcport->flags & FCF_FCSP_DEVICE); in qla_edif_app_getfcinfo()
1019 switch (fcport->edif.auth_state) { in qla_edif_app_getfcinfo()
1021 if (fcport->disc_state == DSC_LOGIN_AUTH_PEND) { in qla_edif_app_getfcinfo()
1022 fcport->edif.auth_state = VND_CMD_AUTH_STATE_NEEDED; in qla_edif_app_getfcinfo()
1031 app_reply->ports[pcnt].auth_state = fcport->edif.auth_state; in qla_edif_app_getfcinfo()
1036 fcport->port_name, 8); in qla_edif_app_getfcinfo()
1039 (atomic_read(&fcport->state) == in qla_edif_app_getfcinfo()
1097 struct fc_port *fcport = NULL, *tf; in qla_edif_app_getstats() local
1101 list_for_each_entry_safe(fcport, tf, &vha->vp_fcports, list) { in qla_edif_app_getstats()
1102 if (fcport->edif.enable) { in qla_edif_app_getstats()
1107 fcport->edif.rekey_cnt; in qla_edif_app_getstats()
1109 fcport->edif.tx_bytes; in qla_edif_app_getstats()
1111 fcport->edif.rx_bytes; in qla_edif_app_getstats()
1114 fcport->port_name, 8); in qla_edif_app_getstats()
1137 struct fc_port *fcport; in qla_edif_ack() local
1148 fcport = qla2x00_find_fcport_by_pid(vha, &ack.port_id); in qla_edif_ack()
1151 if (!fcport) { in qla_edif_ack()
1160 fcport->edif.sess_down_acked = 1; in qla_edif_ack()
1387 qla_edif_add_sa_ctl(fc_port_t *fcport, struct qla_sa_update_frame *sa_frame, in qla_edif_add_sa_ctl() argument
1398 ql_dbg(ql_dbg_edif, fcport->vha, 0x9100, in qla_edif_add_sa_ctl()
1412 sa_ctl->fcport = fcport; in qla_edif_add_sa_ctl()
1415 ql_dbg(ql_dbg_edif, fcport->vha, 0x9100, in qla_edif_add_sa_ctl()
1418 spin_lock_irqsave(&fcport->edif.sa_list_lock, flags); in qla_edif_add_sa_ctl()
1420 list_add_tail(&sa_ctl->next, &fcport->edif.tx_sa_list); in qla_edif_add_sa_ctl()
1422 list_add_tail(&sa_ctl->next, &fcport->edif.rx_sa_list); in qla_edif_add_sa_ctl()
1423 spin_unlock_irqrestore(&fcport->edif.sa_list_lock, flags); in qla_edif_add_sa_ctl()
1429 qla_edif_flush_sa_ctl_lists(fc_port_t *fcport) in qla_edif_flush_sa_ctl_lists() argument
1434 spin_lock_irqsave(&fcport->edif.sa_list_lock, flags); in qla_edif_flush_sa_ctl_lists()
1436 list_for_each_entry_safe(sa_ctl, tsa_ctl, &fcport->edif.tx_sa_list, in qla_edif_flush_sa_ctl_lists()
1442 list_for_each_entry_safe(sa_ctl, tsa_ctl, &fcport->edif.rx_sa_list, in qla_edif_flush_sa_ctl_lists()
1448 spin_unlock_irqrestore(&fcport->edif.sa_list_lock, flags); in qla_edif_flush_sa_ctl_lists()
1452 qla_edif_find_sa_ctl_by_index(fc_port_t *fcport, int index, int dir) in qla_edif_find_sa_ctl_by_index() argument
1458 sa_list = &fcport->edif.tx_sa_list; in qla_edif_find_sa_ctl_by_index()
1460 sa_list = &fcport->edif.rx_sa_list; in qla_edif_find_sa_ctl_by_index()
1472 qla24xx_check_sadb_avail_slot(struct bsg_job *bsg_job, fc_port_t *fcport, in qla24xx_check_sadb_avail_slot() argument
1482 sa_index = qla_edif_sadb_get_sa_index(fcport, sa_frame); in qla24xx_check_sadb_avail_slot()
1485 ql_dbg(ql_dbg_edif, fcport->vha, 0x3063, in qla24xx_check_sadb_avail_slot()
1487 __func__, fcport->loop_id, sa_frame->spi); in qla24xx_check_sadb_avail_slot()
1490 fcport->edif.rx_sa_set = 1; in qla24xx_check_sadb_avail_slot()
1491 fcport->edif.rx_sa_pending = 0; in qla24xx_check_sadb_avail_slot()
1492 qla_edb_eventcreate(fcport->vha, in qla24xx_check_sadb_avail_slot()
1495 QL_VND_RX_SA_KEY, fcport); in qla24xx_check_sadb_avail_slot()
1500 ql_dbg(ql_dbg_edif, fcport->vha, 0x9100, in qla24xx_check_sadb_avail_slot()
1506 ql_dbg(ql_dbg_edif, fcport->vha, 0x9100, in qla24xx_check_sadb_avail_slot()
1508 __func__, sa_index, sa_frame->spi, dir, fcport->loop_id); in qla24xx_check_sadb_avail_slot()
1513 sa_ctl = qla_edif_add_sa_ctl(fcport, sa_frame, dir); in qla24xx_check_sadb_avail_slot()
1515 ql_dbg(ql_dbg_edif, fcport->vha, 0x9100, in qla24xx_check_sadb_avail_slot()
1524 fcport->edif.tx_rekey_cnt++; in qla24xx_check_sadb_avail_slot()
1526 fcport->edif.rx_rekey_cnt++; in qla24xx_check_sadb_avail_slot()
1528 ql_dbg(ql_dbg_edif, fcport->vha, 0x9100, in qla24xx_check_sadb_avail_slot()
1531 fcport->edif.tx_rekey_cnt, in qla24xx_check_sadb_avail_slot()
1532 fcport->edif.rx_rekey_cnt, fcport->loop_id); in qla24xx_check_sadb_avail_slot()
1548 fc_port_t *fcport = NULL; in qla24xx_sadb_update() local
1585 fcport = qla2x00_find_fcport_by_pid(vha, &portid); in qla24xx_sadb_update()
1586 if (fcport) { in qla24xx_sadb_update()
1589 fcport->edif.tx_bytes = 0; in qla24xx_sadb_update()
1591 fcport->edif.rx_bytes = 0; in qla24xx_sadb_update()
1603 if (fcport->loop_id == FC_NO_LOOP_ID) { in qla24xx_sadb_update()
1606 __func__, fcport->port_name, sa_frame.spi, in qla24xx_sadb_update()
1607 fcport->disc_state); in qla24xx_sadb_update()
1614 result = qla24xx_check_sadb_avail_slot(bsg_job, fcport, &sa_frame); in qla24xx_sadb_update()
1620 __func__, fcport->port_name); in qla24xx_sadb_update()
1629 __func__, fcport->port_name); in qla24xx_sadb_update()
1636 __func__, fcport->port_name, sa_frame.fast_sa_index, in qla24xx_sadb_update()
1642 uint16_t nport_handle = fcport->loop_id; in qla24xx_sadb_update()
1651 edif_entry = qla_edif_list_find_sa_index(fcport, fcport->loop_id); in qla24xx_sadb_update()
1655 __func__, fcport->loop_id, sa_index); in qla24xx_sadb_update()
1664 qla_edif_list_delete_sa_index(fcport, edif_entry); in qla24xx_sadb_update()
1667 __func__, fcport->loop_id, sa_index); in qla24xx_sadb_update()
1686 sa_ctl = qla_edif_find_sa_ctl_by_index(fcport, sa_index, in qla24xx_sadb_update()
1692 qla_edif_free_sa_ctl(fcport, sa_ctl, sa_ctl->index); in qla24xx_sadb_update()
1699 qla_edif_sadb_delete_sa_index(fcport, nport_handle, sa_index); in qla24xx_sadb_update()
1706 fcport->edif.rekey_cnt++; in qla24xx_sadb_update()
1709 edif_entry->fcport = fcport; in qla24xx_sadb_update()
1748 uint32_t nport_handle = fcport->loop_id; in qla24xx_sadb_update()
1761 result = qla_edif_list_add_sa_update_index(fcport, sa_index, in qla24xx_sadb_update()
1770 fcport->edif.aes_gmac = 1; in qla24xx_sadb_update()
1772 fcport->edif.aes_gmac = 0; in qla24xx_sadb_update()
1779 sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL); in qla24xx_sadb_update()
1820 __func__, sp->name, sp->handle, fcport->d_id.b24); in qla24xx_sadb_update()
1822 fcport->edif.rekey_cnt++; in qla24xx_sadb_update()
2024 qla_pur_get_pending(scsi_qla_host_t *vha, fc_port_t *fcport, in qla_pur_get_pending() argument
2034 ptr = qla_enode_find(vha, N_PUREX, fcport->d_id.b24, PUR_GET); in qla_pur_get_pending()
2038 __func__, fcport->port_name, fcport->d_id.b24); in qla_pur_get_pending()
2228 fc_port_t *fcport = sfcport; in qla_edb_eventcreate() local
2237 if (fcport) in qla_edb_eventcreate()
2238 fcport->edif.auth_state = dbtype; in qla_edb_eventcreate()
2252 if (!fcport) { in qla_edb_eventcreate()
2259 fcport = qla2x00_find_fcport_by_pid(vha, &id); in qla_edb_eventcreate()
2260 if (!fcport) { in qla_edb_eventcreate()
2273 edbnode->u.plogi_did.b24 = fcport->d_id.b24; in qla_edb_eventcreate()
2276 edbnode->u.els_sid.b24 = fcport->d_id.b24; in qla_edb_eventcreate()
2279 edbnode->u.sa_aen.port_id = fcport->d_id; in qla_edb_eventcreate()
2302 if (fcport) in qla_edb_eventcreate()
2303 fcport->edif.auth_state = dbtype; in qla_edb_eventcreate()
2339 sp->fcport->flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE); in qla_noop_sp_done()
2352 fc_port_t *fcport = NULL; in qla24xx_issue_sa_replace_iocb() local
2368 fcport = sa_ctl->fcport; in qla24xx_issue_sa_replace_iocb()
2371 sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL); in qla24xx_issue_sa_replace_iocb()
2379 fcport->flags |= FCF_ASYNC_SENT; in qla24xx_issue_sa_replace_iocb()
2385 fcport->d_id.b24, sa_ctl, sa_ctl->index, nport_handle); in qla24xx_issue_sa_replace_iocb()
2399 sp->fcport = fcport; in qla24xx_issue_sa_replace_iocb()
2412 fcport->flags &= ~FCF_ASYNC_SENT; in qla24xx_issue_sa_replace_iocb()
2414 fcport->flags &= ~FCF_ASYNC_ACTIVE; in qla24xx_issue_sa_replace_iocb()
2457 sa_update_iocb->u.nport_handle = cpu_to_le16(sp->fcport->loop_id); in qla24xx_sa_update_iocb()
2458 sa_update_iocb->vp_index = sp->fcport->vha->vp_idx; in qla24xx_sa_update_iocb()
2459 sa_update_iocb->port_id[0] = sp->fcport->d_id.b.al_pa; in qla24xx_sa_update_iocb()
2460 sa_update_iocb->port_id[1] = sp->fcport->d_id.b.area; in qla24xx_sa_update_iocb()
2461 sa_update_iocb->port_id[2] = sp->fcport->d_id.b.domain; in qla24xx_sa_update_iocb()
2469 if (sp->fcport->edif.aes_gmac) in qla24xx_sa_update_iocb()
2487 sp->fcport->edif.aes_gmac); in qla24xx_sa_update_iocb()
2490 sp->fcport->edif.tx_sa_pending = 1; in qla24xx_sa_update_iocb()
2492 sp->fcport->edif.rx_sa_pending = 1; in qla24xx_sa_update_iocb()
2494 sp->fcport->vha->qla_stats.control_requests++; in qla24xx_sa_update_iocb()
2503 uint16_t nport_handle = sp->fcport->loop_id; in qla24xx_sa_replace_iocb()
2513 sa_update_iocb->vp_index = sp->fcport->vha->vp_idx; in qla24xx_sa_replace_iocb()
2514 sa_update_iocb->port_id[0] = sp->fcport->d_id.b.al_pa; in qla24xx_sa_replace_iocb()
2515 sa_update_iocb->port_id[1] = sp->fcport->d_id.b.area; in qla24xx_sa_replace_iocb()
2516 sa_update_iocb->port_id[2] = sp->fcport->d_id.b.domain; in qla24xx_sa_replace_iocb()
2531 sp->fcport->vha->qla_stats.control_requests++; in qla24xx_sa_replace_iocb()
2543 struct fc_port *fcport; in qla24xx_auth_els() local
2632 fcport = qla2x00_find_fcport_by_pid(host, &purex->pur_info.pur_sid); in qla24xx_auth_els()
2637 fcport ? fcport->d_id.b24 : 0); in qla24xx_auth_els()
2644 if (fcport && EDIF_SESSION_DOWN(fcport)) { in qla24xx_auth_els()
2655 fcport->send_els_logo = 1; in qla24xx_auth_els()
2656 qlt_schedule_sess_for_deletion(fcport); in qla24xx_auth_els()
2671 static uint16_t qla_edif_get_sa_index_from_freepool(fc_port_t *fcport, int dir) in qla_edif_get_sa_index_from_freepool() argument
2673 struct scsi_qla_host *vha = fcport->vha; in qla_edif_get_sa_index_from_freepool()
2722 static int qla_edif_sadb_delete_sa_index(fc_port_t *fcport, uint16_t nport_handle, in qla_edif_sadb_delete_sa_index() argument
2730 scsi_qla_host_t *vha = fcport->vha; in qla_edif_sadb_delete_sa_index()
2760 qla_edif_add_sa_index_to_freepool(fcport, dir, sa_index); in qla_edif_sadb_delete_sa_index()
2827 nport_handle = sp->fcport->loop_id; in qla28xx_sa_update_iocb_entry()
2831 __func__, sp->fcport->port_name, pkt->u.comp_sts, pkt->old_sa_info, pkt->new_sa_info, in qla28xx_sa_update_iocb_entry()
2838 sp->fcport->flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE); in qla28xx_sa_update_iocb_entry()
2840 edif_entry = qla_edif_list_find_sa_index(sp->fcport, nport_handle); in qla28xx_sa_update_iocb_entry()
2845 qla_edif_list_delete_sa_index(sp->fcport, edif_entry); in qla28xx_sa_update_iocb_entry()
2867 sp->fcport->flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE); in qla28xx_sa_update_iocb_entry()
2870 __func__, sp->fcport->loop_id, pkt->sa_index); in qla28xx_sa_update_iocb_entry()
2886 sp->fcport->edif.enable = 1; in qla28xx_sa_update_iocb_entry()
2888 sp->fcport->edif.tx_sa_set = 1; in qla28xx_sa_update_iocb_entry()
2889 sp->fcport->edif.tx_sa_pending = 0; in qla28xx_sa_update_iocb_entry()
2892 QL_VND_TX_SA_KEY, sp->fcport); in qla28xx_sa_update_iocb_entry()
2894 sp->fcport->edif.rx_sa_set = 1; in qla28xx_sa_update_iocb_entry()
2895 sp->fcport->edif.rx_sa_pending = 0; in qla28xx_sa_update_iocb_entry()
2898 QL_VND_RX_SA_KEY, sp->fcport); in qla28xx_sa_update_iocb_entry()
2903 __func__, sp->fcport->port_name, pkt->sa_index, pkt->new_sa_info, in qla28xx_sa_update_iocb_entry()
2909 QL_VND_TX_SA_KEY, sp->fcport); in qla28xx_sa_update_iocb_entry()
2913 QL_VND_RX_SA_KEY, sp->fcport); in qla28xx_sa_update_iocb_entry()
2919 sa_ctl = qla_edif_find_sa_ctl_by_index(sp->fcport, in qla28xx_sa_update_iocb_entry()
2922 qla_edif_find_sa_ctl_by_index(sp->fcport, sa_ctl->index, in qla28xx_sa_update_iocb_entry()
2927 qla_edif_free_sa_ctl(sp->fcport, sa_ctl, sa_ctl->index); in qla28xx_sa_update_iocb_entry()
2936 qla_edif_sadb_delete_sa_index(sp->fcport, nport_handle, in qla28xx_sa_update_iocb_entry()
2946 qla_edif_sadb_delete_sa_index(sp->fcport, nport_handle, in qla28xx_sa_update_iocb_entry()
2951 qlt_schedule_sess_for_deletion(sp->fcport); in qla28xx_sa_update_iocb_entry()
3105 sp->fcport->edif.tx_bytes += scsi_bufflen(cmd); in qla28xx_start_scsi_edif()
3110 sp->fcport->edif.rx_bytes += scsi_bufflen(cmd); in qla28xx_start_scsi_edif()
3145 cmd_pkt->nport_handle = cpu_to_le16(sp->fcport->loop_id); in qla28xx_start_scsi_edif()
3146 cmd_pkt->port_id[0] = sp->fcport->d_id.b.al_pa; in qla28xx_start_scsi_edif()
3147 cmd_pkt->port_id[1] = sp->fcport->d_id.b.area; in qla28xx_start_scsi_edif()
3148 cmd_pkt->port_id[2] = sp->fcport->d_id.b.domain; in qla28xx_start_scsi_edif()
3171 sp->fcport->fcp_prio << 3; in qla28xx_start_scsi_edif()
3229 void qla_edif_list_del(fc_port_t *fcport) in qla_edif_list_del() argument
3233 struct list_head *indx_list = &fcport->edif.edif_indx_list; in qla_edif_list_del()
3236 spin_lock_irqsave(&fcport->edif.indx_list_lock, flags); in qla_edif_list_del()
3241 spin_unlock_irqrestore(&fcport->edif.indx_list_lock, flags); in qla_edif_list_del()
3249 static uint16_t qla_edif_sadb_get_sa_index(fc_port_t *fcport, in qla_edif_sadb_get_sa_index() argument
3258 scsi_qla_host_t *vha = fcport->vha; in qla_edif_sadb_get_sa_index()
3261 uint16_t nport_handle = fcport->loop_id; in qla_edif_sadb_get_sa_index()
3265 __func__, fcport, nport_handle); in qla_edif_sadb_get_sa_index()
3285 sa_index = qla_edif_get_sa_index_from_freepool(fcport, dir); in qla_edif_sadb_get_sa_index()
3293 entry->fcport = fcport; in qla_edif_sadb_get_sa_index()
3341 sa_index = qla_edif_get_sa_index_from_freepool(fcport, dir); in qla_edif_sadb_get_sa_index()
3343 ql_dbg(ql_dbg_edif, fcport->vha, 0x3063, in qla_edif_sadb_get_sa_index()
3352 ql_dbg(ql_dbg_edif, fcport->vha, 0x3063, in qla_edif_sadb_get_sa_index()
3413 fc_port_t *fcport, uint32_t handle, uint16_t sa_index) in __chk_edif_rx_sa_delete_pending() argument
3419 uint16_t nport_handle = fcport->loop_id; in __chk_edif_rx_sa_delete_pending()
3422 spin_lock_irqsave(&fcport->edif.indx_list_lock, flags); in __chk_edif_rx_sa_delete_pending()
3423 edif_entry = qla_edif_list_find_sa_index(fcport, nport_handle); in __chk_edif_rx_sa_delete_pending()
3425 spin_unlock_irqrestore(&fcport->edif.indx_list_lock, flags); in __chk_edif_rx_sa_delete_pending()
3435 spin_unlock_irqrestore(&fcport->edif.indx_list_lock, flags); in __chk_edif_rx_sa_delete_pending()
3444 spin_unlock_irqrestore(&fcport->edif.indx_list_lock, flags); in __chk_edif_rx_sa_delete_pending()
3455 spin_unlock_irqrestore(&fcport->edif.indx_list_lock, flags); in __chk_edif_rx_sa_delete_pending()
3465 sa_ctl = qla_edif_find_sa_ctl_by_index(fcport, delete_sa_index, 0); in __chk_edif_rx_sa_delete_pending()
3477 qla_post_sa_replace_work(fcport->vha, fcport, in __chk_edif_rx_sa_delete_pending()
3489 fc_port_t *fcport = sp->fcport; in qla_chk_edif_rx_sa_delete_pending() local
3500 return __chk_edif_rx_sa_delete_pending(vha, fcport, handle, in qla_chk_edif_rx_sa_delete_pending()
3504 void qlt_chk_edif_rx_sa_delete_pending(scsi_qla_host_t *vha, fc_port_t *fcport, in qlt_chk_edif_rx_sa_delete_pending() argument
3507 __chk_edif_rx_sa_delete_pending(vha, fcport, in qlt_chk_edif_rx_sa_delete_pending()
3532 a->did = sp->fcport->d_id; in qla_parse_auth_els_ctl()
3534 a->nport_handle = cpu_to_le16(sp->fcport->loop_id); in qla_parse_auth_els_ctl()
3542 fc_port_t *fcport = NULL; in qla_edif_process_els() local
3559 fcport = qla2x00_find_fcport_by_pid(vha, &d_id); in qla_edif_process_els()
3560 if (!fcport) { in qla_edif_process_els()
3568 if (qla_bsg_check(vha, bsg_job, fcport)) in qla_edif_process_els()
3571 if (EDIF_SESS_DELETE(fcport)) { in qla_edif_process_els()
3595 sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL); in qla_edif_process_els()
3598 "Failed get sp pid=%06x\n", fcport->d_id.b24); in qla_edif_process_els()
3647 __func__, sc_to_str(p->e.sub_cmd), fcport->port_name, in qla_edif_process_els()
3707 void qla_edif_clear_appdata(struct scsi_qla_host *vha, struct fc_port *fcport) in qla_edif_clear_appdata() argument
3709 if (!(fcport->flags & FCF_FCSP_DEVICE)) in qla_edif_clear_appdata()
3712 qla_edb_clear(vha, fcport->d_id); in qla_edif_clear_appdata()
3713 qla_enode_clear(vha, fcport->d_id); in qla_edif_clear_appdata()