Deleted Added
full compact
27c27
< * $FreeBSD: head/sys/dev/twa/tw_cl_misc.c 209268 2010-06-17 19:48:03Z delphij $
---
> * $FreeBSD: head/sys/dev/twa/tw_cl_misc.c 212008 2010-08-30 19:15:04Z delphij $
86c86,87
< while ((req = tw_cli_req_q_remove_head(ctlr, TW_CLI_COMPLETE_Q))) {
---
> while ((req = tw_cli_req_q_remove_head(ctlr, TW_CLI_COMPLETE_Q)) !=
> TW_CL_NULL) {
100,107c101,103
< } else {
< if ((req_pkt = req->orig_req)) {
< /* It's a SCSI request. Complete it. */
< tw_cli_dbg_printf(2, ctlr->ctlr_handle,
< tw_osl_cur_func(),
< "Completing complete request %p "
< "on reset",
< req);
---
> } else if (req->flags & TW_CLI_REQ_FLAGS_PASSTHRU) {
> /* It's a passthru request. Complete it. */
> if ((req_pkt = req->orig_req) != TW_CL_NULL) {
109c105,107
< req_pkt->tw_osl_callback(req->req_handle);
---
>
> if (req_pkt->tw_osl_callback)
> req_pkt->tw_osl_callback(req->req_handle);
111a110,113
> } else {
> /* It's an external (SCSI) request. Add it to the reset queue. */
> tw_osl_untimeout(req->req_handle);
> tw_cli_req_q_insert_tail(req, TW_CLI_RESET_Q);
113c115
< }
---
> } /* End of while loop */
138c140,141
< while ((req = tw_cli_req_q_remove_head(ctlr, TW_CLI_BUSY_Q))) {
---
> while ((req = tw_cli_req_q_remove_head(ctlr, TW_CLI_BUSY_Q)) !=
> TW_CL_NULL) {
152,158c155,157
< } else {
< if ((req_pkt = req->orig_req)) {
< /* It's a SCSI request. Complete it. */
< tw_cli_dbg_printf(2, ctlr->ctlr_handle,
< tw_osl_cur_func(),
< "Completing busy request %p on reset",
< req);
---
> } else if (req->flags & TW_CLI_REQ_FLAGS_PASSTHRU) {
> /* It's a passthru request. Complete it. */
> if ((req_pkt = req->orig_req) != TW_CL_NULL) {
160c159,161
< req_pkt->tw_osl_callback(req->req_handle);
---
>
> if (req_pkt->tw_osl_callback)
> req_pkt->tw_osl_callback(req->req_handle);
162a164,167
> } else {
> /* It's an external (SCSI) request. Add it to the reset queue. */
> tw_osl_untimeout(req->req_handle);
> tw_cli_req_q_insert_tail(req, TW_CLI_RESET_Q);
164c169
< }
---
> } /* End of while loop */
191c196,197
< while ((req = tw_cli_req_q_remove_head(ctlr, TW_CLI_PENDING_Q))) {
---
> while ((req = tw_cli_req_q_remove_head(ctlr, TW_CLI_PENDING_Q)) !=
> TW_CL_NULL) {
205,211c211,213
< } else {
< if ((req_pkt = req->orig_req)) {
< /* It's an external request. Complete it. */
< tw_cli_dbg_printf(2, ctlr->ctlr_handle,
< tw_osl_cur_func(),
< "Completing pending request %p "
< "on reset", req);
---
> } else if (req->flags & TW_CLI_REQ_FLAGS_PASSTHRU) {
> /* It's a passthru request. Complete it. */
> if ((req_pkt = req->orig_req) != TW_CL_NULL) {
213c215,217
< req_pkt->tw_osl_callback(req->req_handle);
---
>
> if (req_pkt->tw_osl_callback)
> req_pkt->tw_osl_callback(req->req_handle);
215a220,223
> } else {
> /* It's an external (SCSI) request. Add it to the reset queue. */
> tw_osl_untimeout(req->req_handle);
> tw_cli_req_q_insert_tail(req, TW_CLI_RESET_Q);
217c225
< }
---
> } /* End of while loop */
242,244d249
< if (tw_cli_check_ctlr_state(ctlr, status_reg))
< return(TW_OSL_EGENFAILURE);
<
276,278d280
< if (tw_cli_check_ctlr_state(ctlr, status_reg))
< return(TW_OSL_EGENFAILURE);
<
358a361
> #if 0
361a365
> #endif // 0
717c721
< tw_cl_create_event(ctlr_handle, TW_CL_TRUE,
---
> tw_cl_create_event(ctlr_handle, TW_CL_FALSE,
741c745
< tw_cl_create_event(ctlr_handle, TW_CL_TRUE,
---
> tw_cl_create_event(ctlr_handle, TW_CL_FALSE,
751c755
< tw_cl_create_event(ctlr_handle, TW_CL_TRUE,
---
> tw_cl_create_event(ctlr_handle, TW_CL_FALSE,
771c775
< tw_cl_create_event(ctlr_handle, TW_CL_TRUE,
---
> tw_cl_create_event(ctlr_handle, TW_CL_FALSE,
794c798
< tw_cl_create_event(ctlr_handle, TW_CL_TRUE,
---
> tw_cl_create_event(ctlr_handle, TW_CL_FALSE,
804,814d807
<
< if (status_reg & TWA_STATUS_MICROCONTROLLER_ERROR) {
< tw_cl_create_event(ctlr_handle, TW_CL_TRUE,
< TW_CL_MESSAGE_SOURCE_COMMON_LAYER_EVENT,
< 0x1307, 0x1, TW_CL_SEVERITY_ERROR_STRING,
< "Micro-controller error! ",
< "status reg = 0x%x %s",
< status_reg,
< tw_cli_describe_bits(status_reg, desc));
< error = TW_OSL_EGENFAILURE;
< }
853,854d845
< if (reg & TWA_STATUS_MICROCONTROLLER_ERROR)
< tw_osl_strcpy(&str[tw_osl_strlen(str)], "MC_ERR,");