aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_fsf.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-03-21 11:52:18 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-21 11:52:18 -0500
commitb05005772f34497eb2b7415a651fe785cbe70e16 (patch)
treeb176aeb7fa9baf69e77ddd83e844727490bfcf28 /drivers/s390/scsi/zfcp_fsf.c
parent044f324f6ea5d55391db62fca6a295b2651cb946 (diff)
parent7705a8792b0fc82fd7d4dd923724606bbfd9fb20 (diff)
Merge branch 'origin'
Conflicts: Documentation/video4linux/CARDLIST.cx88 drivers/media/video/cx88/Kconfig drivers/media/video/em28xx/em28xx-video.c drivers/media/video/saa7134/saa7134-dvb.c Resolved as in the original merge by Mauro Carvalho Chehab
Diffstat (limited to 'drivers/s390/scsi/zfcp_fsf.c')
-rw-r--r--drivers/s390/scsi/zfcp_fsf.c82
1 files changed, 44 insertions, 38 deletions
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
index cbfab09899c8..662ec571d73b 100644
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -30,8 +30,6 @@
30 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 30 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
31 */ 31 */
32 32
33#define ZFCP_FSF_C_REVISION "$Revision: 1.92 $"
34
35#include "zfcp_ext.h" 33#include "zfcp_ext.h"
36 34
37static int zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *); 35static int zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *);
@@ -390,6 +388,7 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req)
390 case FSF_PROT_LINK_DOWN: 388 case FSF_PROT_LINK_DOWN:
391 zfcp_fsf_link_down_info_eval(adapter, 389 zfcp_fsf_link_down_info_eval(adapter,
392 &prot_status_qual->link_down_info); 390 &prot_status_qual->link_down_info);
391 zfcp_erp_adapter_reopen(adapter, 0);
393 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; 392 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
394 break; 393 break;
395 394
@@ -560,10 +559,8 @@ zfcp_fsf_link_down_info_eval(struct zfcp_adapter *adapter,
560 559
561 atomic_set_mask(ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED, &adapter->status); 560 atomic_set_mask(ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED, &adapter->status);
562 561
563 if (link_down == NULL) { 562 if (link_down == NULL)
564 zfcp_erp_adapter_reopen(adapter, 0); 563 goto out;
565 return;
566 }
567 564
568 switch (link_down->error_code) { 565 switch (link_down->error_code) {
569 case FSF_PSQ_LINK_NO_LIGHT: 566 case FSF_PSQ_LINK_NO_LIGHT:
@@ -645,16 +642,8 @@ zfcp_fsf_link_down_info_eval(struct zfcp_adapter *adapter,
645 link_down->explanation_code, 642 link_down->explanation_code,
646 link_down->vendor_specific_code); 643 link_down->vendor_specific_code);
647 644
648 switch (link_down->error_code) { 645 out:
649 case FSF_PSQ_LINK_NO_LIGHT: 646 zfcp_erp_adapter_failed(adapter);
650 case FSF_PSQ_LINK_WRAP_PLUG:
651 case FSF_PSQ_LINK_NO_FCP:
652 case FSF_PSQ_LINK_FIRMWARE_UPDATE:
653 zfcp_erp_adapter_reopen(adapter, 0);
654 break;
655 default:
656 zfcp_erp_adapter_failed(adapter);
657 }
658} 647}
659 648
660/* 649/*
@@ -2306,6 +2295,35 @@ zfcp_fsf_exchange_port_data(struct zfcp_erp_action *erp_action,
2306 return retval; 2295 return retval;
2307} 2296}
2308 2297
2298/**
2299 * zfcp_fsf_exchange_port_evaluate
2300 * @fsf_req: fsf_req which belongs to xchg port data request
2301 * @xchg_ok: specifies if xchg port data was incomplete or complete (0/1)
2302 */
2303static void
2304zfcp_fsf_exchange_port_evaluate(struct zfcp_fsf_req *fsf_req, int xchg_ok)
2305{
2306 struct zfcp_adapter *adapter;
2307 struct fsf_qtcb *qtcb;
2308 struct fsf_qtcb_bottom_port *bottom, *data;
2309 struct Scsi_Host *shost;
2310
2311 adapter = fsf_req->adapter;
2312 qtcb = fsf_req->qtcb;
2313 bottom = &qtcb->bottom.port;
2314 shost = adapter->scsi_host;
2315
2316 data = (struct fsf_qtcb_bottom_port*) fsf_req->data;
2317 if (data)
2318 memcpy(data, bottom, sizeof(struct fsf_qtcb_bottom_port));
2319
2320 if (adapter->connection_features & FSF_FEATURE_NPIV_MODE)
2321 fc_host_permanent_port_name(shost) = bottom->wwpn;
2322 else
2323 fc_host_permanent_port_name(shost) = fc_host_port_name(shost);
2324 fc_host_maxframe_size(shost) = bottom->maximum_frame_size;
2325 fc_host_supported_speeds(shost) = bottom->supported_speed;
2326}
2309 2327
2310/** 2328/**
2311 * zfcp_fsf_exchange_port_data_handler - handler for exchange_port_data request 2329 * zfcp_fsf_exchange_port_data_handler - handler for exchange_port_data request
@@ -2314,38 +2332,26 @@ zfcp_fsf_exchange_port_data(struct zfcp_erp_action *erp_action,
2314static void 2332static void
2315zfcp_fsf_exchange_port_data_handler(struct zfcp_fsf_req *fsf_req) 2333zfcp_fsf_exchange_port_data_handler(struct zfcp_fsf_req *fsf_req)
2316{ 2334{
2317 struct zfcp_adapter *adapter = fsf_req->adapter; 2335 struct zfcp_adapter *adapter;
2318 struct Scsi_Host *shost = adapter->scsi_host; 2336 struct fsf_qtcb *qtcb;
2319 struct fsf_qtcb *qtcb = fsf_req->qtcb; 2337
2320 struct fsf_qtcb_bottom_port *bottom, *data; 2338 adapter = fsf_req->adapter;
2339 qtcb = fsf_req->qtcb;
2321 2340
2322 if (fsf_req->status & ZFCP_STATUS_FSFREQ_ERROR) 2341 if (fsf_req->status & ZFCP_STATUS_FSFREQ_ERROR)
2323 return; 2342 return;
2324 2343
2325 switch (qtcb->header.fsf_status) { 2344 switch (qtcb->header.fsf_status) {
2326 case FSF_GOOD: 2345 case FSF_GOOD:
2346 zfcp_fsf_exchange_port_evaluate(fsf_req, 1);
2327 atomic_set_mask(ZFCP_STATUS_ADAPTER_XPORT_OK, &adapter->status); 2347 atomic_set_mask(ZFCP_STATUS_ADAPTER_XPORT_OK, &adapter->status);
2328
2329 bottom = &qtcb->bottom.port;
2330 data = (struct fsf_qtcb_bottom_port*) fsf_req->data;
2331 if (data)
2332 memcpy(data, bottom, sizeof(struct fsf_qtcb_bottom_port));
2333 if (adapter->connection_features & FSF_FEATURE_NPIV_MODE)
2334 fc_host_permanent_port_name(shost) = bottom->wwpn;
2335 else
2336 fc_host_permanent_port_name(shost) =
2337 fc_host_port_name(shost);
2338 fc_host_maxframe_size(shost) = bottom->maximum_frame_size;
2339 fc_host_supported_speeds(shost) = bottom->supported_speed;
2340 break; 2348 break;
2341
2342 case FSF_EXCHANGE_CONFIG_DATA_INCOMPLETE: 2349 case FSF_EXCHANGE_CONFIG_DATA_INCOMPLETE:
2350 zfcp_fsf_exchange_port_evaluate(fsf_req, 0);
2343 atomic_set_mask(ZFCP_STATUS_ADAPTER_XPORT_OK, &adapter->status); 2351 atomic_set_mask(ZFCP_STATUS_ADAPTER_XPORT_OK, &adapter->status);
2344
2345 zfcp_fsf_link_down_info_eval(adapter, 2352 zfcp_fsf_link_down_info_eval(adapter,
2346 &qtcb->header.fsf_status_qual.link_down_info); 2353 &qtcb->header.fsf_status_qual.link_down_info);
2347 break; 2354 break;
2348
2349 default: 2355 default:
2350 debug_text_event(adapter->erp_dbf, 0, "xchg-port-ng"); 2356 debug_text_event(adapter->erp_dbf, 0, "xchg-port-ng");
2351 debug_event(adapter->erp_dbf, 0, 2357 debug_event(adapter->erp_dbf, 0,
@@ -4205,11 +4211,11 @@ zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *fsf_req)
4205 ZFCP_LOG_DEBUG("scpnt->result =0x%x\n", scpnt->result); 4211 ZFCP_LOG_DEBUG("scpnt->result =0x%x\n", scpnt->result);
4206 4212
4207 if (scpnt->result != 0) 4213 if (scpnt->result != 0)
4208 zfcp_scsi_dbf_event_result("erro", 3, fsf_req->adapter, scpnt); 4214 zfcp_scsi_dbf_event_result("erro", 3, fsf_req->adapter, scpnt, fsf_req);
4209 else if (scpnt->retries > 0) 4215 else if (scpnt->retries > 0)
4210 zfcp_scsi_dbf_event_result("retr", 4, fsf_req->adapter, scpnt); 4216 zfcp_scsi_dbf_event_result("retr", 4, fsf_req->adapter, scpnt, fsf_req);
4211 else 4217 else
4212 zfcp_scsi_dbf_event_result("norm", 6, fsf_req->adapter, scpnt); 4218 zfcp_scsi_dbf_event_result("norm", 6, fsf_req->adapter, scpnt, fsf_req);
4213 4219
4214 /* cleanup pointer (need this especially for abort) */ 4220 /* cleanup pointer (need this especially for abort) */
4215 scpnt->host_scribble = NULL; 4221 scpnt->host_scribble = NULL;