diff options
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_gs.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_gs.c | 192 |
1 files changed, 117 insertions, 75 deletions
diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c index 531dad95896..31ce4f62da1 100644 --- a/drivers/scsi/qla2xxx/qla_gs.c +++ b/drivers/scsi/qla2xxx/qla_gs.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * QLOGIC LINUX SOFTWARE | 2 | * QLOGIC LINUX SOFTWARE |
3 | * | 3 | * |
4 | * QLogic ISP2x00 device driver for Linux 2.6.x | 4 | * QLogic ISP2x00 device driver for Linux 2.6.x |
5 | * Copyright (C) 2003-2004 QLogic Corporation | 5 | * Copyright (C) 2003-2005 QLogic Corporation |
6 | * (www.qlogic.com) | 6 | * (www.qlogic.com) |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or modify it | 8 | * This program is free software; you can redistribute it and/or modify it |
@@ -18,9 +18,6 @@ | |||
18 | */ | 18 | */ |
19 | #include "qla_def.h" | 19 | #include "qla_def.h" |
20 | 20 | ||
21 | static inline ms_iocb_entry_t * | ||
22 | qla2x00_prep_ms_iocb(scsi_qla_host_t *, uint32_t, uint32_t); | ||
23 | |||
24 | static inline struct ct_sns_req * | 21 | static inline struct ct_sns_req * |
25 | qla2x00_prep_ct_req(struct ct_sns_req *, uint16_t, uint16_t); | 22 | qla2x00_prep_ct_req(struct ct_sns_req *, uint16_t, uint16_t); |
26 | 23 | ||
@@ -35,14 +32,14 @@ static int qla2x00_sns_rft_id(scsi_qla_host_t *); | |||
35 | static int qla2x00_sns_rnn_id(scsi_qla_host_t *); | 32 | static int qla2x00_sns_rnn_id(scsi_qla_host_t *); |
36 | 33 | ||
37 | /** | 34 | /** |
38 | * qla2x00_prep_ms_iocb() - Prepare common MS IOCB fields for SNS CT query. | 35 | * qla2x00_prep_ms_iocb() - Prepare common MS/CT IOCB fields for SNS CT query. |
39 | * @ha: HA context | 36 | * @ha: HA context |
40 | * @req_size: request size in bytes | 37 | * @req_size: request size in bytes |
41 | * @rsp_size: response size in bytes | 38 | * @rsp_size: response size in bytes |
42 | * | 39 | * |
43 | * Returns a pointer to the @ha's ms_iocb. | 40 | * Returns a pointer to the @ha's ms_iocb. |
44 | */ | 41 | */ |
45 | static inline ms_iocb_entry_t * | 42 | void * |
46 | qla2x00_prep_ms_iocb(scsi_qla_host_t *ha, uint32_t req_size, uint32_t rsp_size) | 43 | qla2x00_prep_ms_iocb(scsi_qla_host_t *ha, uint32_t req_size, uint32_t rsp_size) |
47 | { | 44 | { |
48 | ms_iocb_entry_t *ms_pkt; | 45 | ms_iocb_entry_t *ms_pkt; |
@@ -72,6 +69,42 @@ qla2x00_prep_ms_iocb(scsi_qla_host_t *ha, uint32_t req_size, uint32_t rsp_size) | |||
72 | } | 69 | } |
73 | 70 | ||
74 | /** | 71 | /** |
72 | * qla24xx_prep_ms_iocb() - Prepare common CT IOCB fields for SNS CT query. | ||
73 | * @ha: HA context | ||
74 | * @req_size: request size in bytes | ||
75 | * @rsp_size: response size in bytes | ||
76 | * | ||
77 | * Returns a pointer to the @ha's ms_iocb. | ||
78 | */ | ||
79 | void * | ||
80 | qla24xx_prep_ms_iocb(scsi_qla_host_t *ha, uint32_t req_size, uint32_t rsp_size) | ||
81 | { | ||
82 | struct ct_entry_24xx *ct_pkt; | ||
83 | |||
84 | ct_pkt = (struct ct_entry_24xx *)ha->ms_iocb; | ||
85 | memset(ct_pkt, 0, sizeof(struct ct_entry_24xx)); | ||
86 | |||
87 | ct_pkt->entry_type = CT_IOCB_TYPE; | ||
88 | ct_pkt->entry_count = 1; | ||
89 | ct_pkt->nport_handle = __constant_cpu_to_le16(NPH_SNS); | ||
90 | ct_pkt->timeout = __constant_cpu_to_le16(25); | ||
91 | ct_pkt->cmd_dsd_count = __constant_cpu_to_le16(1); | ||
92 | ct_pkt->rsp_dsd_count = __constant_cpu_to_le16(1); | ||
93 | ct_pkt->rsp_byte_count = cpu_to_le32(rsp_size); | ||
94 | ct_pkt->cmd_byte_count = cpu_to_le32(req_size); | ||
95 | |||
96 | ct_pkt->dseg_0_address[0] = cpu_to_le32(LSD(ha->ct_sns_dma)); | ||
97 | ct_pkt->dseg_0_address[1] = cpu_to_le32(MSD(ha->ct_sns_dma)); | ||
98 | ct_pkt->dseg_0_len = ct_pkt->cmd_byte_count; | ||
99 | |||
100 | ct_pkt->dseg_1_address[0] = cpu_to_le32(LSD(ha->ct_sns_dma)); | ||
101 | ct_pkt->dseg_1_address[1] = cpu_to_le32(MSD(ha->ct_sns_dma)); | ||
102 | ct_pkt->dseg_1_len = ct_pkt->rsp_byte_count; | ||
103 | |||
104 | return (ct_pkt); | ||
105 | } | ||
106 | |||
107 | /** | ||
75 | * qla2x00_prep_ct_req() - Prepare common CT request fields for SNS query. | 108 | * qla2x00_prep_ct_req() - Prepare common CT request fields for SNS query. |
76 | * @ct_req: CT request buffer | 109 | * @ct_req: CT request buffer |
77 | * @cmd: GS command | 110 | * @cmd: GS command |
@@ -93,6 +126,47 @@ qla2x00_prep_ct_req(struct ct_sns_req *ct_req, uint16_t cmd, uint16_t rsp_size) | |||
93 | return (ct_req); | 126 | return (ct_req); |
94 | } | 127 | } |
95 | 128 | ||
129 | static int | ||
130 | qla2x00_chk_ms_status(scsi_qla_host_t *ha, ms_iocb_entry_t *ms_pkt, | ||
131 | struct ct_sns_rsp *ct_rsp, const char *routine) | ||
132 | { | ||
133 | int rval; | ||
134 | uint16_t comp_status; | ||
135 | |||
136 | rval = QLA_FUNCTION_FAILED; | ||
137 | if (ms_pkt->entry_status != 0) { | ||
138 | DEBUG2_3(printk("scsi(%ld): %s failed, error status (%x).\n", | ||
139 | ha->host_no, routine, ms_pkt->entry_status)); | ||
140 | } else { | ||
141 | if (IS_QLA24XX(ha) || IS_QLA25XX(ha)) | ||
142 | comp_status = | ||
143 | ((struct ct_entry_24xx *)ms_pkt)->comp_status; | ||
144 | else | ||
145 | comp_status = le16_to_cpu(ms_pkt->status); | ||
146 | switch (comp_status) { | ||
147 | case CS_COMPLETE: | ||
148 | case CS_DATA_UNDERRUN: | ||
149 | case CS_DATA_OVERRUN: /* Overrun? */ | ||
150 | if (ct_rsp->header.response != | ||
151 | __constant_cpu_to_be16(CT_ACCEPT_RESPONSE)) { | ||
152 | DEBUG2_3(printk("scsi(%ld): %s failed, " | ||
153 | "rejected request:\n", ha->host_no, | ||
154 | routine)); | ||
155 | DEBUG2_3(qla2x00_dump_buffer( | ||
156 | (uint8_t *)&ct_rsp->header, | ||
157 | sizeof(struct ct_rsp_hdr))); | ||
158 | } else | ||
159 | rval = QLA_SUCCESS; | ||
160 | break; | ||
161 | default: | ||
162 | DEBUG2_3(printk("scsi(%ld): %s failed, completion " | ||
163 | "status (%x).\n", ha->host_no, routine, | ||
164 | comp_status)); | ||
165 | break; | ||
166 | } | ||
167 | } | ||
168 | return rval; | ||
169 | } | ||
96 | 170 | ||
97 | /** | 171 | /** |
98 | * qla2x00_ga_nxt() - SNS scan for fabric devices via GA_NXT command. | 172 | * qla2x00_ga_nxt() - SNS scan for fabric devices via GA_NXT command. |
@@ -116,7 +190,7 @@ qla2x00_ga_nxt(scsi_qla_host_t *ha, fc_port_t *fcport) | |||
116 | 190 | ||
117 | /* Issue GA_NXT */ | 191 | /* Issue GA_NXT */ |
118 | /* Prepare common MS IOCB */ | 192 | /* Prepare common MS IOCB */ |
119 | ms_pkt = qla2x00_prep_ms_iocb(ha, GA_NXT_REQ_SIZE, GA_NXT_RSP_SIZE); | 193 | ms_pkt = ha->isp_ops.prep_ms_iocb(ha, GA_NXT_REQ_SIZE, GA_NXT_RSP_SIZE); |
120 | 194 | ||
121 | /* Prepare CT request */ | 195 | /* Prepare CT request */ |
122 | ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, GA_NXT_CMD, | 196 | ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, GA_NXT_CMD, |
@@ -135,12 +209,8 @@ qla2x00_ga_nxt(scsi_qla_host_t *ha, fc_port_t *fcport) | |||
135 | /*EMPTY*/ | 209 | /*EMPTY*/ |
136 | DEBUG2_3(printk("scsi(%ld): GA_NXT issue IOCB failed (%d).\n", | 210 | DEBUG2_3(printk("scsi(%ld): GA_NXT issue IOCB failed (%d).\n", |
137 | ha->host_no, rval)); | 211 | ha->host_no, rval)); |
138 | } else if (ct_rsp->header.response != | 212 | } else if (qla2x00_chk_ms_status(ha, ms_pkt, ct_rsp, "GA_NXT") != |
139 | __constant_cpu_to_be16(CT_ACCEPT_RESPONSE)) { | 213 | QLA_SUCCESS) { |
140 | DEBUG2_3(printk("scsi(%ld): GA_NXT failed, rejected request, " | ||
141 | "ga_nxt_rsp:\n", ha->host_no)); | ||
142 | DEBUG2_3(qla2x00_dump_buffer((uint8_t *)&ct_rsp->header, | ||
143 | sizeof(struct ct_rsp_hdr))); | ||
144 | rval = QLA_FUNCTION_FAILED; | 214 | rval = QLA_FUNCTION_FAILED; |
145 | } else { | 215 | } else { |
146 | /* Populate fc_port_t entry. */ | 216 | /* Populate fc_port_t entry. */ |
@@ -206,7 +276,7 @@ qla2x00_gid_pt(scsi_qla_host_t *ha, sw_info_t *list) | |||
206 | 276 | ||
207 | /* Issue GID_PT */ | 277 | /* Issue GID_PT */ |
208 | /* Prepare common MS IOCB */ | 278 | /* Prepare common MS IOCB */ |
209 | ms_pkt = qla2x00_prep_ms_iocb(ha, GID_PT_REQ_SIZE, GID_PT_RSP_SIZE); | 279 | ms_pkt = ha->isp_ops.prep_ms_iocb(ha, GID_PT_REQ_SIZE, GID_PT_RSP_SIZE); |
210 | 280 | ||
211 | /* Prepare CT request */ | 281 | /* Prepare CT request */ |
212 | ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, GID_PT_CMD, | 282 | ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, GID_PT_CMD, |
@@ -223,12 +293,8 @@ qla2x00_gid_pt(scsi_qla_host_t *ha, sw_info_t *list) | |||
223 | /*EMPTY*/ | 293 | /*EMPTY*/ |
224 | DEBUG2_3(printk("scsi(%ld): GID_PT issue IOCB failed (%d).\n", | 294 | DEBUG2_3(printk("scsi(%ld): GID_PT issue IOCB failed (%d).\n", |
225 | ha->host_no, rval)); | 295 | ha->host_no, rval)); |
226 | } else if (ct_rsp->header.response != | 296 | } else if (qla2x00_chk_ms_status(ha, ms_pkt, ct_rsp, "GID_PT") != |
227 | __constant_cpu_to_be16(CT_ACCEPT_RESPONSE)) { | 297 | QLA_SUCCESS) { |
228 | DEBUG2_3(printk("scsi(%ld): GID_PT failed, rejected request, " | ||
229 | "gid_pt_rsp:\n", ha->host_no)); | ||
230 | DEBUG2_3(qla2x00_dump_buffer((uint8_t *)&ct_rsp->header, | ||
231 | sizeof(struct ct_rsp_hdr))); | ||
232 | rval = QLA_FUNCTION_FAILED; | 298 | rval = QLA_FUNCTION_FAILED; |
233 | } else { | 299 | } else { |
234 | /* Set port IDs in switch info list. */ | 300 | /* Set port IDs in switch info list. */ |
@@ -251,7 +317,7 @@ qla2x00_gid_pt(scsi_qla_host_t *ha, sw_info_t *list) | |||
251 | * single call. Return a failed status, and let GA_NXT handle | 317 | * single call. Return a failed status, and let GA_NXT handle |
252 | * the overload. | 318 | * the overload. |
253 | */ | 319 | */ |
254 | if (i == MAX_FIBRE_DEVICES) | 320 | if (i == MAX_FIBRE_DEVICES) |
255 | rval = QLA_FUNCTION_FAILED; | 321 | rval = QLA_FUNCTION_FAILED; |
256 | } | 322 | } |
257 | 323 | ||
@@ -282,7 +348,7 @@ qla2x00_gpn_id(scsi_qla_host_t *ha, sw_info_t *list) | |||
282 | for (i = 0; i < MAX_FIBRE_DEVICES; i++) { | 348 | for (i = 0; i < MAX_FIBRE_DEVICES; i++) { |
283 | /* Issue GPN_ID */ | 349 | /* Issue GPN_ID */ |
284 | /* Prepare common MS IOCB */ | 350 | /* Prepare common MS IOCB */ |
285 | ms_pkt = qla2x00_prep_ms_iocb(ha, GPN_ID_REQ_SIZE, | 351 | ms_pkt = ha->isp_ops.prep_ms_iocb(ha, GPN_ID_REQ_SIZE, |
286 | GPN_ID_RSP_SIZE); | 352 | GPN_ID_RSP_SIZE); |
287 | 353 | ||
288 | /* Prepare CT request */ | 354 | /* Prepare CT request */ |
@@ -302,12 +368,8 @@ qla2x00_gpn_id(scsi_qla_host_t *ha, sw_info_t *list) | |||
302 | /*EMPTY*/ | 368 | /*EMPTY*/ |
303 | DEBUG2_3(printk("scsi(%ld): GPN_ID issue IOCB failed " | 369 | DEBUG2_3(printk("scsi(%ld): GPN_ID issue IOCB failed " |
304 | "(%d).\n", ha->host_no, rval)); | 370 | "(%d).\n", ha->host_no, rval)); |
305 | } else if (ct_rsp->header.response != | 371 | } else if (qla2x00_chk_ms_status(ha, ms_pkt, ct_rsp, |
306 | __constant_cpu_to_be16(CT_ACCEPT_RESPONSE)) { | 372 | "GPN_ID") != QLA_SUCCESS) { |
307 | DEBUG2_3(printk("scsi(%ld): GPN_ID failed, rejected " | ||
308 | "request, gpn_id_rsp:\n", ha->host_no)); | ||
309 | DEBUG2_3(qla2x00_dump_buffer((uint8_t *)&ct_rsp->header, | ||
310 | sizeof(struct ct_rsp_hdr))); | ||
311 | rval = QLA_FUNCTION_FAILED; | 373 | rval = QLA_FUNCTION_FAILED; |
312 | } else { | 374 | } else { |
313 | /* Save portname */ | 375 | /* Save portname */ |
@@ -347,7 +409,7 @@ qla2x00_gnn_id(scsi_qla_host_t *ha, sw_info_t *list) | |||
347 | for (i = 0; i < MAX_FIBRE_DEVICES; i++) { | 409 | for (i = 0; i < MAX_FIBRE_DEVICES; i++) { |
348 | /* Issue GNN_ID */ | 410 | /* Issue GNN_ID */ |
349 | /* Prepare common MS IOCB */ | 411 | /* Prepare common MS IOCB */ |
350 | ms_pkt = qla2x00_prep_ms_iocb(ha, GNN_ID_REQ_SIZE, | 412 | ms_pkt = ha->isp_ops.prep_ms_iocb(ha, GNN_ID_REQ_SIZE, |
351 | GNN_ID_RSP_SIZE); | 413 | GNN_ID_RSP_SIZE); |
352 | 414 | ||
353 | /* Prepare CT request */ | 415 | /* Prepare CT request */ |
@@ -367,12 +429,8 @@ qla2x00_gnn_id(scsi_qla_host_t *ha, sw_info_t *list) | |||
367 | /*EMPTY*/ | 429 | /*EMPTY*/ |
368 | DEBUG2_3(printk("scsi(%ld): GNN_ID issue IOCB failed " | 430 | DEBUG2_3(printk("scsi(%ld): GNN_ID issue IOCB failed " |
369 | "(%d).\n", ha->host_no, rval)); | 431 | "(%d).\n", ha->host_no, rval)); |
370 | } else if (ct_rsp->header.response != | 432 | } else if (qla2x00_chk_ms_status(ha, ms_pkt, ct_rsp, |
371 | __constant_cpu_to_be16(CT_ACCEPT_RESPONSE)) { | 433 | "GNN_ID") != QLA_SUCCESS) { |
372 | DEBUG2_3(printk("scsi(%ld): GNN_ID failed, rejected " | ||
373 | "request, gnn_id_rsp:\n", ha->host_no)); | ||
374 | DEBUG2_3(qla2x00_dump_buffer((uint8_t *)&ct_rsp->header, | ||
375 | sizeof(struct ct_rsp_hdr))); | ||
376 | rval = QLA_FUNCTION_FAILED; | 434 | rval = QLA_FUNCTION_FAILED; |
377 | } else { | 435 | } else { |
378 | /* Save nodename */ | 436 | /* Save nodename */ |
@@ -425,7 +483,7 @@ qla2x00_rft_id(scsi_qla_host_t *ha) | |||
425 | 483 | ||
426 | /* Issue RFT_ID */ | 484 | /* Issue RFT_ID */ |
427 | /* Prepare common MS IOCB */ | 485 | /* Prepare common MS IOCB */ |
428 | ms_pkt = qla2x00_prep_ms_iocb(ha, RFT_ID_REQ_SIZE, RFT_ID_RSP_SIZE); | 486 | ms_pkt = ha->isp_ops.prep_ms_iocb(ha, RFT_ID_REQ_SIZE, RFT_ID_RSP_SIZE); |
429 | 487 | ||
430 | /* Prepare CT request */ | 488 | /* Prepare CT request */ |
431 | ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, RFT_ID_CMD, | 489 | ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, RFT_ID_CMD, |
@@ -446,12 +504,8 @@ qla2x00_rft_id(scsi_qla_host_t *ha) | |||
446 | /*EMPTY*/ | 504 | /*EMPTY*/ |
447 | DEBUG2_3(printk("scsi(%ld): RFT_ID issue IOCB failed (%d).\n", | 505 | DEBUG2_3(printk("scsi(%ld): RFT_ID issue IOCB failed (%d).\n", |
448 | ha->host_no, rval)); | 506 | ha->host_no, rval)); |
449 | } else if (ct_rsp->header.response != | 507 | } else if (qla2x00_chk_ms_status(ha, ms_pkt, ct_rsp, "RFT_ID") != |
450 | __constant_cpu_to_be16(CT_ACCEPT_RESPONSE)) { | 508 | QLA_SUCCESS) { |
451 | DEBUG2_3(printk("scsi(%ld): RFT_ID failed, rejected " | ||
452 | "request, rft_id_rsp:\n", ha->host_no)); | ||
453 | DEBUG2_3(qla2x00_dump_buffer((uint8_t *)&ct_rsp->header, | ||
454 | sizeof(struct ct_rsp_hdr))); | ||
455 | rval = QLA_FUNCTION_FAILED; | 509 | rval = QLA_FUNCTION_FAILED; |
456 | } else { | 510 | } else { |
457 | DEBUG2(printk("scsi(%ld): RFT_ID exiting normally.\n", | 511 | DEBUG2(printk("scsi(%ld): RFT_ID exiting normally.\n", |
@@ -484,7 +538,7 @@ qla2x00_rff_id(scsi_qla_host_t *ha) | |||
484 | 538 | ||
485 | /* Issue RFF_ID */ | 539 | /* Issue RFF_ID */ |
486 | /* Prepare common MS IOCB */ | 540 | /* Prepare common MS IOCB */ |
487 | ms_pkt = qla2x00_prep_ms_iocb(ha, RFF_ID_REQ_SIZE, RFF_ID_RSP_SIZE); | 541 | ms_pkt = ha->isp_ops.prep_ms_iocb(ha, RFF_ID_REQ_SIZE, RFF_ID_RSP_SIZE); |
488 | 542 | ||
489 | /* Prepare CT request */ | 543 | /* Prepare CT request */ |
490 | ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, RFF_ID_CMD, | 544 | ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, RFF_ID_CMD, |
@@ -505,12 +559,8 @@ qla2x00_rff_id(scsi_qla_host_t *ha) | |||
505 | /*EMPTY*/ | 559 | /*EMPTY*/ |
506 | DEBUG2_3(printk("scsi(%ld): RFF_ID issue IOCB failed (%d).\n", | 560 | DEBUG2_3(printk("scsi(%ld): RFF_ID issue IOCB failed (%d).\n", |
507 | ha->host_no, rval)); | 561 | ha->host_no, rval)); |
508 | } else if (ct_rsp->header.response != | 562 | } else if (qla2x00_chk_ms_status(ha, ms_pkt, ct_rsp, "RFF_ID") != |
509 | __constant_cpu_to_be16(CT_ACCEPT_RESPONSE)) { | 563 | QLA_SUCCESS) { |
510 | DEBUG2_3(printk("scsi(%ld): RFF_ID failed, rejected " | ||
511 | "request, rff_id_rsp:\n", ha->host_no)); | ||
512 | DEBUG2_3(qla2x00_dump_buffer((uint8_t *)&ct_rsp->header, | ||
513 | sizeof(struct ct_rsp_hdr))); | ||
514 | rval = QLA_FUNCTION_FAILED; | 564 | rval = QLA_FUNCTION_FAILED; |
515 | } else { | 565 | } else { |
516 | DEBUG2(printk("scsi(%ld): RFF_ID exiting normally.\n", | 566 | DEBUG2(printk("scsi(%ld): RFF_ID exiting normally.\n", |
@@ -541,7 +591,7 @@ qla2x00_rnn_id(scsi_qla_host_t *ha) | |||
541 | 591 | ||
542 | /* Issue RNN_ID */ | 592 | /* Issue RNN_ID */ |
543 | /* Prepare common MS IOCB */ | 593 | /* Prepare common MS IOCB */ |
544 | ms_pkt = qla2x00_prep_ms_iocb(ha, RNN_ID_REQ_SIZE, RNN_ID_RSP_SIZE); | 594 | ms_pkt = ha->isp_ops.prep_ms_iocb(ha, RNN_ID_REQ_SIZE, RNN_ID_RSP_SIZE); |
545 | 595 | ||
546 | /* Prepare CT request */ | 596 | /* Prepare CT request */ |
547 | ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, RNN_ID_CMD, | 597 | ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, RNN_ID_CMD, |
@@ -553,7 +603,7 @@ qla2x00_rnn_id(scsi_qla_host_t *ha) | |||
553 | ct_req->req.rnn_id.port_id[1] = ha->d_id.b.area; | 603 | ct_req->req.rnn_id.port_id[1] = ha->d_id.b.area; |
554 | ct_req->req.rnn_id.port_id[2] = ha->d_id.b.al_pa; | 604 | ct_req->req.rnn_id.port_id[2] = ha->d_id.b.al_pa; |
555 | 605 | ||
556 | memcpy(ct_req->req.rnn_id.node_name, ha->init_cb->node_name, WWN_SIZE); | 606 | memcpy(ct_req->req.rnn_id.node_name, ha->node_name, WWN_SIZE); |
557 | 607 | ||
558 | /* Execute MS IOCB */ | 608 | /* Execute MS IOCB */ |
559 | rval = qla2x00_issue_iocb(ha, ha->ms_iocb, ha->ms_iocb_dma, | 609 | rval = qla2x00_issue_iocb(ha, ha->ms_iocb, ha->ms_iocb_dma, |
@@ -562,12 +612,8 @@ qla2x00_rnn_id(scsi_qla_host_t *ha) | |||
562 | /*EMPTY*/ | 612 | /*EMPTY*/ |
563 | DEBUG2_3(printk("scsi(%ld): RNN_ID issue IOCB failed (%d).\n", | 613 | DEBUG2_3(printk("scsi(%ld): RNN_ID issue IOCB failed (%d).\n", |
564 | ha->host_no, rval)); | 614 | ha->host_no, rval)); |
565 | } else if (ct_rsp->header.response != | 615 | } else if (qla2x00_chk_ms_status(ha, ms_pkt, ct_rsp, "RNN_ID") != |
566 | __constant_cpu_to_be16(CT_ACCEPT_RESPONSE)) { | 616 | QLA_SUCCESS) { |
567 | DEBUG2_3(printk("scsi(%ld): RNN_ID failed, rejected " | ||
568 | "request, rnn_id_rsp:\n", ha->host_no)); | ||
569 | DEBUG2_3(qla2x00_dump_buffer((uint8_t *)&ct_rsp->header, | ||
570 | sizeof(struct ct_rsp_hdr))); | ||
571 | rval = QLA_FUNCTION_FAILED; | 617 | rval = QLA_FUNCTION_FAILED; |
572 | } else { | 618 | } else { |
573 | DEBUG2(printk("scsi(%ld): RNN_ID exiting normally.\n", | 619 | DEBUG2(printk("scsi(%ld): RNN_ID exiting normally.\n", |
@@ -603,7 +649,7 @@ qla2x00_rsnn_nn(scsi_qla_host_t *ha) | |||
603 | /* Issue RSNN_NN */ | 649 | /* Issue RSNN_NN */ |
604 | /* Prepare common MS IOCB */ | 650 | /* Prepare common MS IOCB */ |
605 | /* Request size adjusted after CT preparation */ | 651 | /* Request size adjusted after CT preparation */ |
606 | ms_pkt = qla2x00_prep_ms_iocb(ha, 0, RSNN_NN_RSP_SIZE); | 652 | ms_pkt = ha->isp_ops.prep_ms_iocb(ha, 0, RSNN_NN_RSP_SIZE); |
607 | 653 | ||
608 | /* Prepare CT request */ | 654 | /* Prepare CT request */ |
609 | ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, RSNN_NN_CMD, | 655 | ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, RSNN_NN_CMD, |
@@ -611,8 +657,8 @@ qla2x00_rsnn_nn(scsi_qla_host_t *ha) | |||
611 | ct_rsp = &ha->ct_sns->p.rsp; | 657 | ct_rsp = &ha->ct_sns->p.rsp; |
612 | 658 | ||
613 | /* Prepare CT arguments -- node_name, symbolic node_name, size */ | 659 | /* Prepare CT arguments -- node_name, symbolic node_name, size */ |
614 | memcpy(ct_req->req.rsnn_nn.node_name, ha->init_cb->node_name, WWN_SIZE); | 660 | memcpy(ct_req->req.rsnn_nn.node_name, ha->node_name, WWN_SIZE); |
615 | 661 | ||
616 | /* Prepare the Symbolic Node Name */ | 662 | /* Prepare the Symbolic Node Name */ |
617 | /* Board type */ | 663 | /* Board type */ |
618 | snn = ct_req->req.rsnn_nn.sym_node_name; | 664 | snn = ct_req->req.rsnn_nn.sym_node_name; |
@@ -641,12 +687,8 @@ qla2x00_rsnn_nn(scsi_qla_host_t *ha) | |||
641 | /*EMPTY*/ | 687 | /*EMPTY*/ |
642 | DEBUG2_3(printk("scsi(%ld): RSNN_NN issue IOCB failed (%d).\n", | 688 | DEBUG2_3(printk("scsi(%ld): RSNN_NN issue IOCB failed (%d).\n", |
643 | ha->host_no, rval)); | 689 | ha->host_no, rval)); |
644 | } else if (ct_rsp->header.response != | 690 | } else if (qla2x00_chk_ms_status(ha, ms_pkt, ct_rsp, "RSNN_NN") != |
645 | __constant_cpu_to_be16(CT_ACCEPT_RESPONSE)) { | 691 | QLA_SUCCESS) { |
646 | DEBUG2_3(printk("scsi(%ld): RSNN_NN failed, rejected " | ||
647 | "request, rsnn_id_rsp:\n", ha->host_no)); | ||
648 | DEBUG2_3(qla2x00_dump_buffer((uint8_t *)&ct_rsp->header, | ||
649 | sizeof(struct ct_rsp_hdr))); | ||
650 | rval = QLA_FUNCTION_FAILED; | 692 | rval = QLA_FUNCTION_FAILED; |
651 | } else { | 693 | } else { |
652 | DEBUG2(printk("scsi(%ld): RSNN_NN exiting normally.\n", | 694 | DEBUG2(printk("scsi(%ld): RSNN_NN exiting normally.\n", |
@@ -821,7 +863,7 @@ qla2x00_sns_gid_pt(scsi_qla_host_t *ha, sw_info_t *list) | |||
821 | * single call. Return a failed status, and let GA_NXT handle | 863 | * single call. Return a failed status, and let GA_NXT handle |
822 | * the overload. | 864 | * the overload. |
823 | */ | 865 | */ |
824 | if (i == MAX_FIBRE_DEVICES) | 866 | if (i == MAX_FIBRE_DEVICES) |
825 | rval = QLA_FUNCTION_FAILED; | 867 | rval = QLA_FUNCTION_FAILED; |
826 | } | 868 | } |
827 | 869 | ||
@@ -1028,14 +1070,14 @@ qla2x00_sns_rnn_id(scsi_qla_host_t *ha) | |||
1028 | sns_cmd->p.cmd.param[1] = ha->d_id.b.area; | 1070 | sns_cmd->p.cmd.param[1] = ha->d_id.b.area; |
1029 | sns_cmd->p.cmd.param[2] = ha->d_id.b.domain; | 1071 | sns_cmd->p.cmd.param[2] = ha->d_id.b.domain; |
1030 | 1072 | ||
1031 | sns_cmd->p.cmd.param[4] = ha->init_cb->node_name[7]; | 1073 | sns_cmd->p.cmd.param[4] = ha->node_name[7]; |
1032 | sns_cmd->p.cmd.param[5] = ha->init_cb->node_name[6]; | 1074 | sns_cmd->p.cmd.param[5] = ha->node_name[6]; |
1033 | sns_cmd->p.cmd.param[6] = ha->init_cb->node_name[5]; | 1075 | sns_cmd->p.cmd.param[6] = ha->node_name[5]; |
1034 | sns_cmd->p.cmd.param[7] = ha->init_cb->node_name[4]; | 1076 | sns_cmd->p.cmd.param[7] = ha->node_name[4]; |
1035 | sns_cmd->p.cmd.param[8] = ha->init_cb->node_name[3]; | 1077 | sns_cmd->p.cmd.param[8] = ha->node_name[3]; |
1036 | sns_cmd->p.cmd.param[9] = ha->init_cb->node_name[2]; | 1078 | sns_cmd->p.cmd.param[9] = ha->node_name[2]; |
1037 | sns_cmd->p.cmd.param[10] = ha->init_cb->node_name[1]; | 1079 | sns_cmd->p.cmd.param[10] = ha->node_name[1]; |
1038 | sns_cmd->p.cmd.param[11] = ha->init_cb->node_name[0]; | 1080 | sns_cmd->p.cmd.param[11] = ha->node_name[0]; |
1039 | 1081 | ||
1040 | /* Execute SNS command. */ | 1082 | /* Execute SNS command. */ |
1041 | rval = qla2x00_send_sns(ha, ha->sns_cmd_dma, RNN_ID_SNS_CMD_SIZE / 2, | 1083 | rval = qla2x00_send_sns(ha, ha->sns_cmd_dma, RNN_ID_SNS_CMD_SIZE / 2, |