Lines Matching defs:vha
55 static struct edb_node *qla_edb_getnext(scsi_qla_host_t *vha)
60 spin_lock_irqsave(&vha->e_dbell.db_lock, flags);
63 if (!list_empty(&vha->e_dbell.head)) {
64 edbnode = list_first_entry(&vha->e_dbell.head,
69 spin_unlock_irqrestore(&vha->e_dbell.db_lock, flags);
74 static void qla_edb_node_free(scsi_qla_host_t *vha, struct edb_node *node)
99 struct scsi_qla_host *vha = fcport->vha;
104 ql_dbg(ql_dbg_edif, vha, 0x3069,
132 ql_dbg(ql_dbg_edif, vha, 0x3063,
139 qla_post_sa_replace_work(fcport->vha, fcport,
143 ql_dbg(ql_dbg_edif, vha, 0x3063,
203 int qla_post_sa_replace_work(struct scsi_qla_host *vha,
208 e = qla2x00_alloc_work(vha, QLA_EVT_SA_REPLACE);
216 return qla2x00_post_work(vha, e);
220 qla_edif_sa_ctl_init(scsi_qla_host_t *vha, struct fc_port *fcport)
222 ql_dbg(ql_dbg_edif, vha, 0x2058,
233 static int qla_bsg_check(scsi_qla_host_t *vha, struct bsg_job *bsg_job,
241 if (!vha->hw->flags.edif_enabled) {
242 ql_dbg(ql_dbg_edif, vha, 0x9105,
246 if (DBELL_INACTIVE(vha)) {
247 ql_dbg(ql_dbg_edif, vha, 0x09102,
259 qla_pur_get_pending(vha, fcport, bsg_job);
261 ql_dbg(ql_dbg_edif, vha, 0x911d,
279 qla2x00_find_fcport_by_pid(scsi_qla_host_t *vha, port_id_t *id)
284 list_for_each_entry_safe(f, tf, &vha->vp_fcports, list) {
293 * @vha: host adapter pointer
298 qla_edif_app_check(scsi_qla_host_t *vha, struct app_id appid)
303 ql_dbg(ql_dbg_edif, vha, 0x911d, "%s app id not ok (%x)",
309 ql_dbg(ql_dbg_edif, vha, 0x911d, "%s app version is not ok (%x)",
338 struct scsi_qla_host *vha = fcport->vha;
339 struct qla_hw_data *ha = vha->hw;
343 ql_dbg(ql_dbg_edif + ql_dbg_verbose, vha, 0x3063,
356 ql_dbg(ql_dbg_edif, vha, 0x3063,
360 static void __qla2x00_release_all_sadb(struct scsi_qla_host *vha,
374 ql_dbg(ql_dbg_edif, vha, 0x3063,
385 ql_dbg(ql_dbg_edif, vha, 0x3063,
389 ql_dbg(ql_dbg_edif, vha, 0x3063,
394 ql_dbg(ql_dbg_edif, vha, 0x3063,
408 ql_dbg(ql_dbg_edif, vha, 0x5033,
424 qla_edb_eventcreate(vha,
429 ql_dbg(ql_dbg_edif, vha, 0x5033,
439 ql_dbg(ql_dbg_edif, vha, 0x3063,
445 void qla2x00_release_all_sadb(struct scsi_qla_host *vha, struct fc_port *fcport)
448 struct qla_hw_data *ha = vha->hw;
451 ql_dbg(ql_dbg_edif + ql_dbg_verbose, vha, 0x3063,
460 __qla2x00_release_all_sadb(vha, fcport, entry, 0);
472 __qla2x00_release_all_sadb(vha, fcport, entry, SAU_FLG_TX);
486 * @vha: host adapter pointer
490 static int qla_delete_n2n_sess_and_wait(scsi_qla_host_t *vha)
496 if (!N2N_TOPO(vha->hw))
500 list_for_each_entry(fcport, &vha->vp_fcports, list) {
504 ql_dbg(ql_dbg_disc, fcport->vha, 0x2016,
507 qla_edif_sa_ctl_init(vha, fcport);
518 set_bit(RELOGIN_NEEDED, &vha->dpc_flags);
527 * @vha: host adapter pointer
534 qla_edif_app_start(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
542 ql_log(ql_log_info, vha, 0x1313,
549 ql_dbg(ql_dbg_edif, vha, 0x911d, "%s app_vid=%x app_start_flags %x\n",
552 if (DBELL_INACTIVE(vha)) {
554 vha->e_dbell.db_flags |= EDB_ACTIVE;
559 if (N2N_TOPO(vha->hw)) {
560 list_for_each_entry_safe(fcport, tf, &vha->vp_fcports, list)
563 if (vha->hw->flags.n2n_fw_acc_sec) {
570 if (qla_delete_n2n_sess_and_wait(vha))
574 if (!vha->hw->flags.n2n_bigger || link_bounce) {
575 set_bit(N2N_LINK_RESET, &vha->dpc_flags);
576 qla2xxx_wake_dpc(vha);
579 qla2x00_wait_for_hba_online(vha);
580 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
581 qla2xxx_wake_dpc(vha);
582 qla2x00_wait_for_hba_online(vha);
585 list_for_each_entry_safe(fcport, tf, &vha->vp_fcports, list) {
586 ql_dbg(ql_dbg_edif, vha, 0x2058,
590 ql_dbg(ql_dbg_edif, vha, 0xf084,
602 if (atomic_read(&vha->loop_state) == LOOP_DOWN)
605 fcport->login_retry = vha->hw->login_retry_count;
615 rval = qla24xx_async_gffid(vha, fcport, true);
623 ql_dbg(ql_dbg_edif, vha, 0x911e,
627 qla_edif_sa_ctl_init(vha, fcport);
629 set_bit(RELOGIN_NEEDED, &vha->dpc_flags);
632 if (vha->pur_cinfo.enode_flags != ENODE_ACTIVE) {
634 vha->pur_cinfo.enode_flags = ENODE_ACTIVE;
636 ql_dbg(ql_dbg_edif, vha, 0x911f, "%s enode already active\n",
641 appreply.host_support_edif = vha->hw->flags.edif_enabled;
642 appreply.edif_enode_active = vha->pur_cinfo.enode_flags;
643 appreply.edif_edb_active = vha->e_dbell.db_flags;
655 ql_dbg(ql_dbg_edif, vha, 0x911d,
664 * @vha: host adapter pointer
671 qla_edif_app_stop(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
681 ql_dbg(ql_dbg_edif, vha, 0x911d, "%s Stopping APP: app_vid=%x\n",
687 qla_enode_stop(vha); /* stop enode */
688 qla_edb_stop(vha); /* stop db */
690 list_for_each_entry_safe(fcport, tf, &vha->vp_fcports, list) {
695 ql_dbg(ql_dbg_edif, vha, 0xf084,
702 if (atomic_read(&vha->loop_state) == LOOP_DOWN)
706 ql_dbg(ql_dbg_edif, vha, 0x911e,
724 qla_edif_app_chk_sa_update(scsi_qla_host_t *vha, fc_port_t *fcport,
730 ql_dbg(ql_dbg_edif, vha, 0x911e,
737 ql_dbg(ql_dbg_edif, vha, 0x911e,
750 * @vha: host adapter pointer
754 qla_edif_app_authok(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
774 fcport = qla2x00_find_fcport_by_wwpn(vha,
777 ql_dbg(ql_dbg_edif, vha, 0x911d,
782 fcport = qla2x00_find_fcport_by_pid(vha, &portid);
784 ql_dbg(ql_dbg_edif, vha, 0x911d,
789 ql_dbg(ql_dbg_edif, vha, 0x911d,
805 ql_dbg(ql_dbg_edif, vha, 0x911d,
809 qla_edif_app_chk_sa_update(vha, fcport, &appplogireply);
815 ql_dbg(ql_dbg_edif, vha, 0x911e,
827 ql_dbg(ql_dbg_edif, vha, 0x911e,
836 ql_dbg(ql_dbg_edif, vha, 0x911e,
843 if (qla_ini_mode_enabled(vha)) {
844 ql_dbg(ql_dbg_edif, vha, 0x911e,
847 qla24xx_post_prli_work(vha, fcport);
863 * @vha: host adapter pointer
867 qla_edif_app_authfail(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
875 ql_dbg(ql_dbg_edif, vha, 0x911d, "%s app auth fail\n", __func__);
892 fcport = qla2x00_find_fcport_by_wwpn(vha,
897 fcport = qla2x00_find_fcport_by_pid(vha, &portid);
899 ql_dbg(ql_dbg_edif, vha, 0x911d,
905 ql_dbg(ql_dbg_edif, vha, 0x911e,
914 ql_dbg(ql_dbg_edif, vha, 0x911d,
919 ql_dbg(ql_dbg_edif, vha, 0x911e,
923 if (qla_ini_mode_enabled(fcport->vha)) {
936 * @vha: host adapter pointer
940 qla_edif_app_getfcinfo(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
949 ql_dbg(ql_dbg_edif, vha, 0x911d, "%s app get fcinfo\n", __func__);
966 list_for_each_entry_safe(fcport, tf, &vha->vp_fcports, list) {
974 ql_dbg(ql_dbg_edif, vha, 0x2058,
984 if (!N2N_TOPO(vha->hw)) {
990 rval = qla24xx_async_gffid(vha, fcport,
1014 ql_dbg(ql_dbg_edif, vha, 0x2058,
1064 * @vha: host adapter pointer
1068 qla_edif_app_getstats(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
1082 ql_dbg(ql_dbg_async, vha, 0x911d,
1101 list_for_each_entry_safe(fcport, tf, &vha->vp_fcports, list) {
1135 qla_edif_ack(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
1144 ql_dbg(ql_dbg_edif, vha, 0x70cf,
1148 fcport = qla2x00_find_fcport_by_pid(vha, &ack.port_id);
1152 ql_dbg(ql_dbg_edif, vha, 0x70cf,
1168 static int qla_edif_consume_dbell(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
1181 dbnode = qla_edb_getnext(vha);
1204 ql_log(ql_log_warn, vha, 0x09102,
1217 ql_dbg(ql_dbg_edif, vha, 0x09102,
1234 static void __qla_edif_dbell_bsg_done(scsi_qla_host_t *vha, struct bsg_job *bsg_job,
1243 qla_edif_consume_dbell(vha, bsg_job);
1248 static void qla_edif_dbell_bsg_done(scsi_qla_host_t *vha)
1253 spin_lock_irqsave(&vha->e_dbell.db_lock, flags);
1254 if (vha->e_dbell.dbell_bsg_job) {
1255 prev_bsg_job = vha->e_dbell.dbell_bsg_job;
1256 vha->e_dbell.dbell_bsg_job = NULL;
1258 spin_unlock_irqrestore(&vha->e_dbell.db_lock, flags);
1261 __qla_edif_dbell_bsg_done(vha, prev_bsg_job, 0);
1265 qla_edif_dbell_bsg(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
1271 qla_edif_dbell_bsg_done(vha);
1273 spin_lock_irqsave(&vha->e_dbell.db_lock, flags);
1274 if (list_empty(&vha->e_dbell.head) && DBELL_ACTIVE(vha)) {
1279 vha->e_dbell.dbell_bsg_job = bsg_job;
1280 vha->e_dbell.bsg_expire = jiffies + 10 * HZ;
1284 spin_unlock_irqrestore(&vha->e_dbell.db_lock, flags);
1287 __qla_edif_dbell_bsg_done(vha, bsg_job, 1);
1298 scsi_qla_host_t *vha = shost_priv(host);
1309 ql_dbg(level, vha, 0x911d, "%s vnd subcmd=%x\n",
1316 if (!vha->hw->flags.edif_enabled ||
1317 test_bit(VPORT_DELETE, &vha->dpc_flags)) {
1318 ql_dbg(level, vha, 0x911d,
1320 __func__, bsg_job, vha->dpc_flags);
1326 if (!qla_edif_app_check(vha, appcheck)) {
1327 ql_dbg(level, vha, 0x911d,
1342 rval = qla_edif_app_start(vha, bsg_job);
1345 rval = qla_edif_app_stop(vha, bsg_job);
1348 rval = qla_edif_app_authok(vha, bsg_job);
1351 rval = qla_edif_app_authfail(vha, bsg_job);
1354 rval = qla_edif_app_getfcinfo(vha, bsg_job);
1357 rval = qla_edif_app_getstats(vha, bsg_job);
1360 rval = qla_edif_ack(vha, bsg_job);
1363 rval = qla_edif_dbell_bsg(vha, bsg_job);
1367 ql_dbg(ql_dbg_edif, vha, 0x911d, "%s unknown cmd=%x\n",
1377 ql_dbg(level, vha, 0x7009,
1398 ql_dbg(ql_dbg_edif, fcport->vha, 0x9100,
1415 ql_dbg(ql_dbg_edif, fcport->vha, 0x9100,
1485 ql_dbg(ql_dbg_edif, fcport->vha, 0x3063,
1492 qla_edb_eventcreate(fcport->vha,
1500 ql_dbg(ql_dbg_edif, fcport->vha, 0x9100,
1506 ql_dbg(ql_dbg_edif, fcport->vha, 0x9100,
1515 ql_dbg(ql_dbg_edif, fcport->vha, 0x9100,
1528 ql_dbg(ql_dbg_edif, fcport->vha, 0x9100,
1547 scsi_qla_host_t *vha = shost_priv(host);
1558 ql_dbg(ql_dbg_edif + ql_dbg_verbose, vha, 0x911d,
1559 "%s entered, vha: 0x%p\n", __func__, vha);
1566 if (!vha->flags.online) {
1567 ql_log(ql_log_warn, vha, 0x70a1, "Host is not online\n");
1573 if (DBELL_INACTIVE(vha)) {
1574 ql_log(ql_log_warn, vha, 0x70a1, "App not started\n");
1585 fcport = qla2x00_find_fcport_by_pid(vha, &portid);
1595 ql_dbg(ql_dbg_edif, vha, 0x70a3, "Failed to find port= %06x\n",
1604 ql_dbg(ql_dbg_edif, vha, 0x70e1,
1618 ql_dbg(ql_dbg_edif, vha, 0x70e1,
1627 ql_dbg(ql_dbg_edif, vha, 0x70e1,
1634 ql_dbg(ql_dbg_edif, vha, 0x70e1,
1653 ql_dbg(ql_dbg_edif, vha, 0x911d,
1665 ql_dbg(ql_dbg_edif, vha, 0x911d,
1681 ql_dbg(ql_dbg_edif, vha, 0x911d,
1689 ql_dbg(ql_dbg_edif, vha, 0x3063,
1696 ql_dbg(ql_dbg_edif, vha, 0x3063,
1712 ql_dbg(ql_dbg_edif, vha, 0x911d,
1730 ql_dbg(ql_dbg_edif, vha, 0x911d,
1757 ql_dbg(ql_dbg_edif, vha, 0x911d,
1764 ql_dbg(ql_dbg_edif, vha, 0x911d,
1779 sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL);
1808 ql_log(ql_dbg_edif, vha, 0x70e3,
1818 ql_dbg(ql_dbg_edif, vha, 0x911d,
1833 ql_dbg(ql_dbg_edif, vha, 0x911d,
1843 qla_enode_free(scsi_qla_host_t *vha, struct enode *node)
1851 * @vha: host adapter pointer
1856 qla_enode_init(scsi_qla_host_t *vha)
1858 struct qla_hw_data *ha = vha->hw;
1861 if (vha->pur_cinfo.enode_flags == ENODE_ACTIVE) {
1863 ql_dbg(ql_dbg_edif, vha, 0x09102, "%s enode still active\n",
1869 spin_lock_init(&vha->pur_cinfo.pur_lock);
1870 INIT_LIST_HEAD(&vha->pur_cinfo.head);
1878 * @vha: host adapter pointer
1883 qla_enode_stop(scsi_qla_host_t *vha)
1888 if (vha->pur_cinfo.enode_flags != ENODE_ACTIVE) {
1890 ql_dbg(ql_dbg_edif, vha, 0x09102,
1896 spin_lock_irqsave(&vha->pur_cinfo.pur_lock, flags);
1898 vha->pur_cinfo.enode_flags &= ~ENODE_ACTIVE; /* mark it not active */
1901 list_for_each_entry_safe(node, q, &vha->pur_cinfo.head, list) {
1902 ql_dbg(ql_dbg_edif, vha, 0x910f,
1906 qla_enode_free(vha, node);
1908 spin_unlock_irqrestore(&vha->pur_cinfo.pur_lock, flags);
1911 static void qla_enode_clear(scsi_qla_host_t *vha, port_id_t portid)
1918 if (vha->pur_cinfo.enode_flags != ENODE_ACTIVE) {
1919 ql_dbg(ql_dbg_edif, vha, 0x09102,
1923 spin_lock_irqsave(&vha->pur_cinfo.pur_lock, flags);
1924 list_for_each_entry_safe(e, tmp, &vha->pur_cinfo.head, list) {
1927 ql_dbg(ql_dbg_edif, vha, 0x911d,
1937 spin_unlock_irqrestore(&vha->pur_cinfo.pur_lock, flags);
1941 qla_enode_free(vha, e);
1951 qla_enode_alloc(scsi_qla_host_t *vha, uint32_t ntype)
1970 qla_enode_add(scsi_qla_host_t *vha, struct enode *ptr)
1974 ql_dbg(ql_dbg_edif + ql_dbg_verbose, vha, 0x9109,
1978 spin_lock_irqsave(&vha->pur_cinfo.pur_lock, flags);
1979 list_add_tail(&ptr->list, &vha->pur_cinfo.head);
1980 spin_unlock_irqrestore(&vha->pur_cinfo.pur_lock, flags);
1986 qla_enode_find(scsi_qla_host_t *vha, uint32_t ntype, uint32_t p1, uint32_t p2)
1995 spin_lock_irqsave(&vha->pur_cinfo.pur_lock, flags);
1997 list_for_each_entry_safe(list_node, q, &vha->pur_cinfo.head, list) {
2011 spin_unlock_irqrestore(&vha->pur_cinfo.pur_lock, flags);
2019 * @vha: host adapter pointer
2024 qla_pur_get_pending(scsi_qla_host_t *vha, fc_port_t *fcport,
2034 ptr = qla_enode_find(vha, N_PUREX, fcport->d_id.b24, PUR_GET);
2036 ql_dbg(ql_dbg_edif, vha, 0x9111,
2058 qla_enode_free(vha, ptr);
2065 qla_els_reject_iocb(scsi_qla_host_t *vha, struct qla_qpair *qp,
2072 ql_log(ql_log_warn, vha, 0x700c,
2077 qla_els_pt_iocb(vha, els_iocb, a);
2079 ql_dbg(ql_dbg_edif, vha, 0x0183,
2082 ql_dump_buffer(ql_dbg_edif + ql_dbg_verbose, vha, 0x0185,
2083 vha->hw->elsrej.c, sizeof(*vha->hw->elsrej.c));
2086 qla2x00_start_iocbs(vha, qp->req);
2091 qla_edb_init(scsi_qla_host_t *vha)
2093 if (DBELL_ACTIVE(vha)) {
2095 ql_dbg(ql_dbg_edif, vha, 0x09102,
2101 spin_lock_init(&vha->e_dbell.db_lock);
2102 INIT_LIST_HEAD(&vha->e_dbell.head);
2105 static void qla_edb_clear(scsi_qla_host_t *vha, port_id_t portid)
2112 if (DBELL_INACTIVE(vha)) {
2114 ql_dbg(ql_dbg_edif, vha, 0x09102,
2120 spin_lock_irqsave(&vha->e_dbell.db_lock, flags);
2121 list_for_each_entry_safe(e, tmp, &vha->e_dbell.head, list) {
2134 ql_log(ql_log_warn, vha, 0x09102,
2140 ql_dbg(ql_dbg_edif, vha, 0x910f,
2147 spin_unlock_irqrestore(&vha->e_dbell.db_lock, flags);
2150 qla_edb_node_free(vha, e);
2156 qla_edb_stop(scsi_qla_host_t *vha)
2161 if (DBELL_INACTIVE(vha)) {
2163 ql_dbg(ql_dbg_edif, vha, 0x09102,
2169 spin_lock_irqsave(&vha->e_dbell.db_lock, flags);
2171 vha->e_dbell.db_flags &= ~EDB_ACTIVE; /* mark it not active */
2173 list_for_each_entry_safe(node, q, &vha->e_dbell.head, list) {
2174 ql_dbg(ql_dbg_edif, vha, 0x910f,
2177 qla_edb_node_free(vha, node);
2179 spin_unlock_irqrestore(&vha->e_dbell.db_lock, flags);
2181 qla_edif_dbell_bsg_done(vha);
2185 qla_edb_node_alloc(scsi_qla_host_t *vha, uint32_t ntype)
2192 ql_dbg(ql_dbg_edif, vha, 0x9100,
2204 qla_edb_node_add(scsi_qla_host_t *vha, struct edb_node *ptr)
2208 if (DBELL_INACTIVE(vha)) {
2210 ql_dbg(ql_dbg_edif, vha, 0x09102,
2215 spin_lock_irqsave(&vha->e_dbell.db_lock, flags);
2216 list_add_tail(&ptr->list, &vha->e_dbell.head);
2217 spin_unlock_irqrestore(&vha->e_dbell.db_lock, flags);
2224 qla_edb_eventcreate(scsi_qla_host_t *vha, uint32_t dbtype,
2231 if (!vha->hw->flags.edif_enabled) {
2236 if (DBELL_INACTIVE(vha)) {
2240 ql_dbg(ql_dbg_edif, vha, 0x09102,
2245 edbnode = qla_edb_node_alloc(vha, dbtype);
2247 ql_dbg(ql_dbg_edif, vha, 0x09102,
2256 ql_dbg(ql_dbg_edif, vha, 0x09222,
2259 fcport = qla2x00_find_fcport_by_pid(vha, &id);
2261 ql_dbg(ql_dbg_edif, vha, 0x09102,
2285 ql_dbg(ql_dbg_edif, vha, 0x09102,
2293 if (!qla_edb_node_add(vha, edbnode)) {
2294 ql_dbg(ql_dbg_edif, vha, 0x09102,
2299 ql_dbg(ql_dbg_edif, vha, 0x09102,
2301 qla_edif_dbell_bsg_done(vha);
2308 qla_edif_timer(scsi_qla_host_t *vha)
2310 struct qla_hw_data *ha = vha->hw;
2312 if (!vha->vp_idx && N2N_TOPO(ha) && ha->flags.n2n_fw_acc_sec) {
2313 if (DBELL_INACTIVE(vha) &&
2323 ql_dbg(ql_dbg_async, vha, 0x911d,
2326 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
2333 if (vha->e_dbell.dbell_bsg_job && time_after_eq(jiffies, vha->e_dbell.bsg_expire))
2334 qla_edif_dbell_bsg_done(vha);
2349 qla24xx_issue_sa_replace_iocb(scsi_qla_host_t *vha, struct qla_work_evt *e)
2358 ql_dbg(ql_dbg_edif, vha, 0x70e6,
2362 ql_dbg(ql_dbg_edif, vha, 0x70e6,
2371 sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL);
2373 ql_dbg(ql_dbg_edif, vha, 0x70e6,
2383 ql_dbg(ql_dbg_edif, vha, 0x3073,
2393 ql_dbg(ql_dbg_edif, vha, 0x70e6,
2421 struct scsi_qla_host *vha = sp->vha;
2428 ql_dbg(ql_dbg_edif, vha, 0x911d,
2429 "%s: EDIF SA UPDATE RX IOCB vha: 0x%p index: %d\n",
2430 __func__, vha, sa_frame->fast_sa_index);
2433 ql_dbg(ql_dbg_edif, vha, 0x911d,
2434 "%s: EDIF SA DELETE RX IOCB vha: 0x%p index: %d\n",
2435 __func__, vha, sa_frame->fast_sa_index);
2439 ql_dbg(ql_dbg_edif, vha, 0x911d,
2440 "%s: EDIF SA UPDATE TX IOCB vha: 0x%p index: %d\n",
2441 __func__, vha, sa_frame->fast_sa_index);
2445 ql_dbg(ql_dbg_edif, vha, 0x911d,
2446 "%s: EDIF SA DELETE TX IOCB vha: 0x%p index: %d\n",
2447 __func__, vha, sa_frame->fast_sa_index);
2458 sa_update_iocb->vp_index = sp->fcport->vha->vp_idx;
2482 ql_dbg(ql_dbg_edif, vha, 0x921d,
2494 sp->fcport->vha->qla_stats.control_requests++;
2500 struct scsi_qla_host *vha = sp->vha;
2513 sa_update_iocb->vp_index = sp->fcport->vha->vp_idx;
2525 ql_dbg(ql_dbg_edif, vha, 0x921d,
2531 sp->fcport->vha->qla_stats.control_requests++;
2534 void qla24xx_auth_els(scsi_qla_host_t *vha, void **pkt, struct rsp_que **rsp)
2556 a.tx_addr = vha->hw->elsrej.cdma;
2557 a.vp_idx = vha->vp_idx;
2566 qla_els_reject_iocb(vha, (*rsp)->qpair, &a);
2567 __qla_consume_iocb(vha, pkt, rsp);
2572 ql_dbg(ql_dbg_edif, vha, 0x0910d,
2575 qla_els_reject_iocb(vha, (*rsp)->qpair, &a);
2576 __qla_consume_iocb(vha, pkt, rsp);
2580 if (!vha->hw->flags.edif_enabled) {
2582 ql_dbg(ql_dbg_edif, vha, 0x910e, "%s edif not enabled\n",
2584 qla_els_reject_iocb(vha, (*rsp)->qpair, &a);
2585 __qla_consume_iocb(vha, pkt, rsp);
2589 ptr = qla_enode_alloc(vha, N_PUREX);
2591 ql_dbg(ql_dbg_edif, vha, 0x09109,
2594 qla_els_reject_iocb(vha, (*rsp)->qpair, &a);
2595 __qla_consume_iocb(vha, pkt, rsp);
2611 rc = __qla_copy_purex_to_buffer(vha, pkt, rsp, purex->msgp,
2614 qla_els_reject_iocb(vha, (*rsp)->qpair, &a);
2615 qla_enode_free(vha, ptr);
2621 host = qla_find_host_by_d_id(vha, beid);
2623 ql_log(ql_log_fatal, vha, 0x508b,
2627 qla_els_reject_iocb(vha, (*rsp)->qpair, &a);
2628 qla_enode_free(vha, ptr);
2634 if (DBELL_INACTIVE(vha)) {
2673 struct scsi_qla_host *vha = fcport->vha;
2674 struct qla_hw_data *ha = vha->hw;
2679 ql_dbg(ql_dbg_edif + ql_dbg_verbose, vha, 0x3063,
2699 ql_dbg(ql_dbg_edif, vha, 0x3063,
2730 scsi_qla_host_t *vha = fcport->vha;
2731 struct qla_hw_data *ha = vha->hw;
2734 ql_dbg(ql_dbg_edif, vha, 0x3063,
2744 ql_dbg(ql_dbg_edif, vha, 0x3063,
2772 ql_dbg(ql_dbg_edif, vha, 0x3063,
2788 struct scsi_qla_host *vha;
2797 /* use sp->vha due to npiv */
2798 vha = sp->vha;
2802 ql_dbg(ql_dbg_edif, vha, 0x3063,
2803 "%s: EDIF SA UPDATE RX IOCB vha: 0x%p index: %d\n",
2804 __func__, vha, pkt->sa_index);
2807 ql_dbg(ql_dbg_edif, vha, 0x3063,
2808 "%s: EDIF SA DELETE RX IOCB vha: 0x%p index: %d\n",
2809 __func__, vha, pkt->sa_index);
2812 ql_dbg(ql_dbg_edif, vha, 0x3063,
2813 "%s: EDIF SA UPDATE TX IOCB vha: 0x%p index: %d\n",
2814 __func__, vha, pkt->sa_index);
2817 ql_dbg(ql_dbg_edif, vha, 0x3063,
2818 "%s: EDIF SA DELETE TX IOCB vha: 0x%p index: %d\n",
2819 __func__, vha, pkt->sa_index);
2829 ql_dbg(ql_dbg_edif, vha, 0x3063,
2842 ql_dbg(ql_dbg_edif, vha, 0x5033,
2848 ql_dbg(ql_dbg_edif, vha, 0x5033,
2868 ql_dbg(ql_dbg_edif, vha, 0x3063,
2882 ql_dbg(ql_dbg_edif + ql_dbg_verbose, vha, 0x3063,
2890 qla_edb_eventcreate(vha, VND_CMD_AUTH_STATE_SAUPDATE_COMPL,
2896 qla_edb_eventcreate(vha, VND_CMD_AUTH_STATE_SAUPDATE_COMPL,
2901 ql_dbg(ql_dbg_edif, vha, 0x3063,
2907 qla_edb_eventcreate(vha, VND_CMD_AUTH_STATE_SAUPDATE_COMPL,
2911 qla_edb_eventcreate(vha, VND_CMD_AUTH_STATE_SAUPDATE_COMPL,
2924 ql_dbg(ql_dbg_edif + ql_dbg_verbose, vha, 0x3063,
2929 ql_dbg(ql_dbg_edif, vha, 0x3063,
2933 ql_dbg(ql_dbg_edif, vha, 0x3063,
2943 ql_dbg(ql_dbg_edif, vha, 0x3063,
2982 struct scsi_qla_host *vha = sp->vha;
2983 struct qla_hw_data *ha = vha->hw;
2998 if (vha->marker_needed != 0) {
2999 if (qla2x00_marker(vha, sp->qpair, 0, 0, MK_SYNC_ALL) !=
3001 ql_log(ql_log_warn, vha, 0x300c,
3005 vha->marker_needed = 0;
3034 req_cnt = qla24xx_calc_iocbs(vha, tot_dsds);
3054 if (qla_get_buf(vha, sp->qpair, &sp->u.scmd.buf_dsc)) {
3055 ql_log(ql_log_fatal, vha, 0x3011,
3072 ql_log(ql_log_warn, vha, 0x3012,
3103 vha->qla_stats.output_bytes += scsi_bufflen(cmd);
3104 vha->qla_stats.output_requests++;
3108 vha->qla_stats.input_bytes += scsi_bufflen(cmd);
3109 vha->qla_stats.input_requests++;
3131 cont_pkt = qla2x00_prep_cont_type1_iocb(vha, req);
3149 cmd_pkt->vp_index = sp->vha->vp_idx;
3258 scsi_qla_host_t *vha = fcport->vha;
3259 struct qla_hw_data *ha = vha->hw;
3263 ql_dbg(ql_dbg_edif, vha, 0x3063,
3275 ql_dbg(ql_dbg_edif, vha, 0x3063,
3301 ql_dbg(ql_dbg_edif, vha, 0x3063,
3317 ql_dbg(ql_dbg_edif, vha, 0x3063,
3329 ql_dbg(ql_dbg_edif, vha, 0x3063,
3332 ql_dbg(ql_dbg_edif, vha, 0x3063,
3343 ql_dbg(ql_dbg_edif, fcport->vha, 0x3063,
3352 ql_dbg(ql_dbg_edif, fcport->vha, 0x3063,
3412 static void __chk_edif_rx_sa_delete_pending(scsi_qla_host_t *vha,
3448 ql_dbg(ql_dbg_edif, vha, 0x5033,
3459 ql_dbg(ql_dbg_edif, vha, 0x3063,
3467 ql_dbg(ql_dbg_edif, vha, 0x3063,
3470 ql_dbg(ql_dbg_edif, vha, 0x3063,
3477 qla_post_sa_replace_work(fcport->vha, fcport,
3480 ql_dbg(ql_dbg_edif, vha, 0x3063,
3486 void qla_chk_edif_rx_sa_delete_pending(scsi_qla_host_t *vha,
3500 return __chk_edif_rx_sa_delete_pending(vha, fcport, handle,
3504 void qlt_chk_edif_rx_sa_delete_pending(scsi_qla_host_t *vha, fc_port_t *fcport,
3507 __chk_edif_rx_sa_delete_pending(vha, fcport,
3535 a->vp_idx = sp->vha->vp_idx;
3538 int qla_edif_process_els(scsi_qla_host_t *vha, struct bsg_job *bsg_job)
3543 struct qla_hw_data *ha = vha->hw;
3559 fcport = qla2x00_find_fcport_by_pid(vha, &d_id);
3561 ql_dbg(ql_dbg_edif, vha, 0x911a,
3568 if (qla_bsg_check(vha, bsg_job, fcport))
3572 ql_dbg(ql_dbg_edif, vha, 0x910d,
3579 if (!vha->flags.online) {
3580 ql_log(ql_log_warn, vha, 0x7005, "Host not online.\n");
3588 ql_dbg(ql_dbg_user, vha, 0x7001,
3595 sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL);
3597 ql_dbg(ql_dbg_user, vha, 0x7004,
3608 ql_dbg(ql_dbg_user, vha, 0x7005,
3620 ql_dbg(ql_dbg_user, vha, 0x7006,
3645 ql_dbg(ql_dbg_edif, vha, 0x700a,
3658 ql_log(ql_log_warn, vha, 0x700e,
3679 void qla_edif_sess_down(struct scsi_qla_host *vha, struct fc_port *sess)
3683 if (sess->edif.app_sess_online && DBELL_ACTIVE(vha)) {
3684 ql_dbg(ql_dbg_disc, vha, 0xf09c,
3689 qla_edb_eventcreate(vha, VND_CMD_AUTH_STATE_SESSION_SHUTDOWN,
3691 qla2x00_post_aen_work(vha, FCH_EVT_PORT_OFFLINE, sess->d_id.b24);
3694 !test_bit(VPORT_DELETE, &vha->dpc_flags)) {
3701 ql_dbg(ql_dbg_disc, vha, 0xf09c,
3707 void qla_edif_clear_appdata(struct scsi_qla_host *vha, struct fc_port *fcport)
3712 qla_edb_clear(vha, fcport->d_id);
3713 qla_enode_clear(vha, fcport->d_id);