- Update to 2.6.25-rc3.
[linux-flexiantxendom0-3.2.10.git] / drivers / scsi / aic94xx / aic94xx_scb.c
index db6ab1a..ab35050 100644 (file)
@@ -458,13 +458,19 @@ static void escb_tasklet_complete(struct asd_ascb *ascb,
                tc_abort = le16_to_cpu(tc_abort);
 
                list_for_each_entry_safe(a, b, &asd_ha->seq.pend_q, list) {
-                       struct sas_task *task = ascb->uldd_task;
+                       struct sas_task *task = a->uldd_task;
+
+                       if (a->tc_index != tc_abort)
+                               continue;
 
-                       if (task && a->tc_index == tc_abort) {
+                       if (task) {
                                failed_dev = task->dev;
                                sas_task_abort(task);
-                               break;
+                       } else {
+                               ASD_DPRINTK("R_T_A for non TASK scb 0x%x\n",
+                                           a->scb->header.opcode);
                        }
+                       break;
                }
 
                if (!failed_dev) {
@@ -478,7 +484,7 @@ static void escb_tasklet_complete(struct asd_ascb *ascb,
                 * that the EH will wake up and do something.
                 */
                list_for_each_entry_safe(a, b, &asd_ha->seq.pend_q, list) {
-                       struct sas_task *task = ascb->uldd_task;
+                       struct sas_task *task = a->uldd_task;
 
                        if (task &&
                            task->dev == failed_dev &&
@@ -788,12 +794,12 @@ void asd_build_control_phy(struct asd_ascb *ascb, int phy_id, u8 subfunc)
 
                /* initiator port settings are in the hi nibble */
                if (phy->sas_phy.role == PHY_ROLE_INITIATOR)
-                       control_phy->port_type = SAS_PROTO_ALL << 4;
+                       control_phy->port_type = SAS_PROTOCOL_ALL << 4;
                else if (phy->sas_phy.role == PHY_ROLE_TARGET)
-                       control_phy->port_type = SAS_PROTO_ALL;
+                       control_phy->port_type = SAS_PROTOCOL_ALL;
                else
                        control_phy->port_type =
-                               (SAS_PROTO_ALL << 4) | SAS_PROTO_ALL;
+                               (SAS_PROTOCOL_ALL << 4) | SAS_PROTOCOL_ALL;
 
                /* link reset retries, this should be nominal */
                control_phy->link_reset_retries = 10;