tw_cl_intr.c (208969) | tw_cl_intr.c (212008) |
---|---|
1/* 2 * Copyright (c) 2004-07 Applied Micro Circuits Corporation. 3 * Copyright (c) 2004-05 Vinod Kashyap 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 10 unchanged lines hidden (view full) --- 19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * | 1/* 2 * Copyright (c) 2004-07 Applied Micro Circuits Corporation. 3 * Copyright (c) 2004-05 Vinod Kashyap 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 10 unchanged lines hidden (view full) --- 19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * |
27 * $FreeBSD: head/sys/dev/twa/tw_cl_intr.c 208969 2010-06-09 21:40:38Z delphij $ | 27 * $FreeBSD: head/sys/dev/twa/tw_cl_intr.c 212008 2010-08-30 19:15:04Z delphij $ |
28 */ 29 30/* 31 * AMCC'S 3ware driver for 9000 series storage controllers. 32 * 33 * Author: Vinod Kashyap 34 * Modifications by: Adam Radford 35 * Modifications by: Manjunath Ranganathaiah --- 207 unchanged lines hidden (view full) --- 243 TW_CL_MESSAGE_SOURCE_COMMON_LAYER_ERROR, 244 0x1201, 0x1, TW_CL_SEVERITY_ERROR_STRING, 245 "Unposted command completed!!", 246 "request = %p, status = %d", 247 req, req->state); 248#ifdef TW_OSL_DEBUG 249 tw_cl_print_ctlr_stats(ctlr->ctlr_handle); 250#endif /* TW_OSL_DEBUG */ | 28 */ 29 30/* 31 * AMCC'S 3ware driver for 9000 series storage controllers. 32 * 33 * Author: Vinod Kashyap 34 * Modifications by: Adam Radford 35 * Modifications by: Manjunath Ranganathaiah --- 207 unchanged lines hidden (view full) --- 243 TW_CL_MESSAGE_SOURCE_COMMON_LAYER_ERROR, 244 0x1201, 0x1, TW_CL_SEVERITY_ERROR_STRING, 245 "Unposted command completed!!", 246 "request = %p, status = %d", 247 req, req->state); 248#ifdef TW_OSL_DEBUG 249 tw_cl_print_ctlr_stats(ctlr->ctlr_handle); 250#endif /* TW_OSL_DEBUG */ |
251 tw_cl_reset_ctlr(ctlr->ctlr_handle); 252 return(TW_OSL_EIO); | 251 continue; |
253 } 254 255 /* 256 * Remove the request from the busy queue, mark it as complete, 257 * and enqueue it in the complete queue. 258 */ 259 tw_cli_req_q_remove_item(req, TW_CLI_BUSY_Q); 260 req->state = TW_CLI_REQ_STATE_COMPLETE; --- 136 unchanged lines hidden (view full) --- 397 TW_CL_MESSAGE_SOURCE_COMMON_LAYER_ERROR, 398 0x1203, 0x1, TW_CL_SEVERITY_ERROR_STRING, 399 "I/O completion on incomplete command!!", 400 "request = %p, status = %d", 401 req, req->state); 402#ifdef TW_OSL_DEBUG 403 tw_cl_print_ctlr_stats(ctlr->ctlr_handle); 404#endif /* TW_OSL_DEBUG */ | 252 } 253 254 /* 255 * Remove the request from the busy queue, mark it as complete, 256 * and enqueue it in the complete queue. 257 */ 258 tw_cli_req_q_remove_item(req, TW_CLI_BUSY_Q); 259 req->state = TW_CLI_REQ_STATE_COMPLETE; --- 136 unchanged lines hidden (view full) --- 396 TW_CL_MESSAGE_SOURCE_COMMON_LAYER_ERROR, 397 0x1203, 0x1, TW_CL_SEVERITY_ERROR_STRING, 398 "I/O completion on incomplete command!!", 399 "request = %p, status = %d", 400 req, req->state); 401#ifdef TW_OSL_DEBUG 402 tw_cl_print_ctlr_stats(ctlr->ctlr_handle); 403#endif /* TW_OSL_DEBUG */ |
405 tw_cl_reset_ctlr(ctlr->ctlr_handle); 406 req_pkt->status = TW_CL_ERR_REQ_BUS_RESET; 407 goto out; | 404 return; |
408 } 409 410 if (req->flags & TW_CLI_REQ_FLAGS_PASSTHRU) { 411 /* Copy the command packet back into OSL's space. */ 412 tw_osl_memcpy(req_pkt->gen_req_pkt.pt_req.cmd_pkt, req->cmd_pkt, 413 sizeof(struct tw_cl_command_packet)); 414 } else 415 tw_cli_scsi_complete(req); --- 62 unchanged lines hidden (view full) --- 478 tw_osl_cur_func(), 479 "cdb = %x %x %x %x %x %x %x %x " 480 "%x %x %x %x %x %x %x %x", 481 cdb[0], cdb[1], cdb[2], cdb[3], 482 cdb[4], cdb[5], cdb[6], cdb[7], 483 cdb[8], cdb[9], cdb[10], cdb[11], 484 cdb[12], cdb[13], cdb[14], cdb[15]); 485 | 405 } 406 407 if (req->flags & TW_CLI_REQ_FLAGS_PASSTHRU) { 408 /* Copy the command packet back into OSL's space. */ 409 tw_osl_memcpy(req_pkt->gen_req_pkt.pt_req.cmd_pkt, req->cmd_pkt, 410 sizeof(struct tw_cl_command_packet)); 411 } else 412 tw_cli_scsi_complete(req); --- 62 unchanged lines hidden (view full) --- 475 tw_osl_cur_func(), 476 "cdb = %x %x %x %x %x %x %x %x " 477 "%x %x %x %x %x %x %x %x", 478 cdb[0], cdb[1], cdb[2], cdb[3], 479 cdb[4], cdb[5], cdb[6], cdb[7], 480 cdb[8], cdb[9], cdb[10], cdb[11], 481 cdb[12], cdb[13], cdb[14], cdb[15]); 482 |
483#if 0 |
|
486 /* 487 * Print the error. Firmware doesn't yet support 488 * the 'Mode Sense' cmd. Don't print if the cmd 489 * is 'Mode Sense', and the error is 'Invalid field 490 * in CDB'. 491 */ 492 if (! ((cdb[0] == 0x1A) && (error == 0x10D))) 493 tw_cli_create_ctlr_event(req->ctlr, 494 TW_CL_MESSAGE_SOURCE_CONTROLLER_ERROR, 495 cmd_hdr); | 484 /* 485 * Print the error. Firmware doesn't yet support 486 * the 'Mode Sense' cmd. Don't print if the cmd 487 * is 'Mode Sense', and the error is 'Invalid field 488 * in CDB'. 489 */ 490 if (! ((cdb[0] == 0x1A) && (error == 0x10D))) 491 tw_cli_create_ctlr_event(req->ctlr, 492 TW_CL_MESSAGE_SOURCE_CONTROLLER_ERROR, 493 cmd_hdr); |
494#endif // 0 |
|
496 } 497 498 if (scsi_req->sense_data) { 499 tw_osl_memcpy(scsi_req->sense_data, cmd_hdr->sense_data, 500 TWA_SENSE_DATA_LENGTH); 501 scsi_req->sense_len = TWA_SENSE_DATA_LENGTH; 502 req_pkt->status |= TW_CL_ERR_REQ_AUTO_SENSE_VALID; 503 } --- 21 unchanged lines hidden (view full) --- 525 tw_cli_dbg_printf(4, ctlr->ctlr_handle, tw_osl_cur_func(), "entered"); 526 527 /* 528 * If the request was never submitted to the controller, the function 529 * that sets req->error is responsible for calling tw_cl_create_event. 530 */ 531 if (! req->error_code) 532 if (cmd->param.status) { | 495 } 496 497 if (scsi_req->sense_data) { 498 tw_osl_memcpy(scsi_req->sense_data, cmd_hdr->sense_data, 499 TWA_SENSE_DATA_LENGTH); 500 scsi_req->sense_len = TWA_SENSE_DATA_LENGTH; 501 req_pkt->status |= TW_CL_ERR_REQ_AUTO_SENSE_VALID; 502 } --- 21 unchanged lines hidden (view full) --- 524 tw_cli_dbg_printf(4, ctlr->ctlr_handle, tw_osl_cur_func(), "entered"); 525 526 /* 527 * If the request was never submitted to the controller, the function 528 * that sets req->error is responsible for calling tw_cl_create_event. 529 */ 530 if (! req->error_code) 531 if (cmd->param.status) { |
532#if 0 |
|
533 tw_cli_create_ctlr_event(ctlr, 534 TW_CL_MESSAGE_SOURCE_CONTROLLER_ERROR, 535 &(req->cmd_pkt->cmd_hdr)); | 533 tw_cli_create_ctlr_event(ctlr, 534 TW_CL_MESSAGE_SOURCE_CONTROLLER_ERROR, 535 &(req->cmd_pkt->cmd_hdr)); |
536#endif // 0 |
|
536 tw_cl_create_event(ctlr->ctlr_handle, TW_CL_FALSE, 537 TW_CL_MESSAGE_SOURCE_COMMON_LAYER_ERROR, 538 0x1204, 0x1, TW_CL_SEVERITY_ERROR_STRING, 539 "get/set_param failed", 540 "status = %d", cmd->param.status); 541 } 542 543 ctlr->internal_req_busy = TW_CL_FALSE; --- 41 unchanged lines hidden (view full) --- 585 /* 586 * If the request was never submitted to the controller, the function 587 * that sets error is responsible for calling tw_cl_create_event. 588 */ 589 if (!(error = req->error_code)) 590 if ((error = cmd->status)) { 591 cmd_hdr = (struct tw_cl_command_header *) 592 (&(req->cmd_pkt->cmd_hdr)); | 537 tw_cl_create_event(ctlr->ctlr_handle, TW_CL_FALSE, 538 TW_CL_MESSAGE_SOURCE_COMMON_LAYER_ERROR, 539 0x1204, 0x1, TW_CL_SEVERITY_ERROR_STRING, 540 "get/set_param failed", 541 "status = %d", cmd->param.status); 542 } 543 544 ctlr->internal_req_busy = TW_CL_FALSE; --- 41 unchanged lines hidden (view full) --- 586 /* 587 * If the request was never submitted to the controller, the function 588 * that sets error is responsible for calling tw_cl_create_event. 589 */ 590 if (!(error = req->error_code)) 591 if ((error = cmd->status)) { 592 cmd_hdr = (struct tw_cl_command_header *) 593 (&(req->cmd_pkt->cmd_hdr)); |
594#if 0 |
|
593 tw_cli_create_ctlr_event(ctlr, 594 TW_CL_MESSAGE_SOURCE_CONTROLLER_ERROR, 595 cmd_hdr); | 595 tw_cli_create_ctlr_event(ctlr, 596 TW_CL_MESSAGE_SOURCE_CONTROLLER_ERROR, 597 cmd_hdr); |
598#endif // 0 |
|
596 tw_cl_create_event(ctlr->ctlr_handle, TW_CL_FALSE, 597 TW_CL_MESSAGE_SOURCE_COMMON_LAYER_ERROR, 598 0x1206, 0x1, TW_CL_SEVERITY_ERROR_STRING, 599 "Request Sense failed", 600 "opcode = 0x%x, status = %d", 601 GET_OPCODE(cmd->res__opcode), cmd->status); 602 } 603 --- 150 unchanged lines hidden --- | 599 tw_cl_create_event(ctlr->ctlr_handle, TW_CL_FALSE, 600 TW_CL_MESSAGE_SOURCE_COMMON_LAYER_ERROR, 601 0x1206, 0x1, TW_CL_SEVERITY_ERROR_STRING, 602 "Request Sense failed", 603 "opcode = 0x%x, status = %d", 604 GET_OPCODE(cmd->res__opcode), cmd->status); 605 } 606 --- 150 unchanged lines hidden --- |