]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/scsi/aic94xx/aic94xx_scb.c
[SCSI] aic94xx: cleanups
[linux-2.6-omap-h63xx.git] / drivers / scsi / aic94xx / aic94xx_scb.c
index 8f43ff772f2378290d99af151a409b7dd19d6792..46643319c5201d1a1fbdc0b060982c4198085347 100644 (file)
@@ -24,7 +24,6 @@
  *
  */
 
-#include <linux/pci.h>
 #include <scsi/scsi_host.h>
 
 #include "aic94xx.h"
@@ -51,7 +50,7 @@
                           | CURRENT_SPINUP_HOLD | CURRENT_GTO_TIMEOUT \
                           | CURRENT_OOB_ERROR)
 
-static inline void get_lrate_mode(struct asd_phy *phy, u8 oob_mode)
+static void get_lrate_mode(struct asd_phy *phy, u8 oob_mode)
 {
        struct sas_phy *sas_phy = phy->sas_phy.phy;
 
@@ -82,7 +81,7 @@ static inline void get_lrate_mode(struct asd_phy *phy, u8 oob_mode)
                phy->sas_phy.oob_mode = SATA_OOB_MODE;
 }
 
-static inline void asd_phy_event_tasklet(struct asd_ascb *ascb,
+static void asd_phy_event_tasklet(struct asd_ascb *ascb,
                                         struct done_list_struct *dl)
 {
        struct asd_ha_struct *asd_ha = ascb->ha;
@@ -126,8 +125,7 @@ static inline void asd_phy_event_tasklet(struct asd_ascb *ascb,
 }
 
 /* If phys are enabled sparsely, this will do the right thing. */
-static inline unsigned ord_phy(struct asd_ha_struct *asd_ha,
-                              struct asd_phy *phy)
+static unsigned ord_phy(struct asd_ha_struct *asd_ha, struct asd_phy *phy)
 {
        u8 enabled_mask = asd_ha->hw_prof.enabled_phys;
        int i, k = 0;
@@ -152,7 +150,7 @@ static inline unsigned ord_phy(struct asd_ha_struct *asd_ha,
  * LOCKING: the frame_rcvd_lock needs to be held since this parses the frame
  * buffer.
  */
-static inline void asd_get_attached_sas_addr(struct asd_phy *phy, u8 *sas_addr)
+static void asd_get_attached_sas_addr(struct asd_phy *phy, u8 *sas_addr)
 {
        if (phy->sas_phy.frame_rcvd[0] == 0x34
            && phy->sas_phy.oob_mode == SATA_OOB_MODE) {
@@ -233,9 +231,9 @@ static void asd_deform_port(struct asd_ha_struct *asd_ha, struct asd_phy *phy)
        spin_unlock_irqrestore(&asd_ha->asd_ports_lock, flags);
 }
 
-static inline void asd_bytes_dmaed_tasklet(struct asd_ascb *ascb,
-                                          struct done_list_struct *dl,
-                                          int edb_id, int phy_id)
+static void asd_bytes_dmaed_tasklet(struct asd_ascb *ascb,
+                                   struct done_list_struct *dl,
+                                   int edb_id, int phy_id)
 {
        unsigned long flags;
        int edb_el = edb_id + ascb->edb_index;
@@ -256,9 +254,9 @@ static inline void asd_bytes_dmaed_tasklet(struct asd_ascb *ascb,
        sas_ha->notify_port_event(&phy->sas_phy, PORTE_BYTES_DMAED);
 }
 
-static inline void asd_link_reset_err_tasklet(struct asd_ascb *ascb,
-                                             struct done_list_struct *dl,
-                                             int phy_id)
+static void asd_link_reset_err_tasklet(struct asd_ascb *ascb,
+                                      struct done_list_struct *dl,
+                                      int phy_id)
 {
        struct asd_ha_struct *asd_ha = ascb->ha;
        struct sas_ha_struct *sas_ha = &asd_ha->sas_ha;
@@ -309,9 +307,9 @@ out:
        ;
 }
 
-static inline void asd_primitive_rcvd_tasklet(struct asd_ascb *ascb,
-                                             struct done_list_struct *dl,
-                                             int phy_id)
+static void asd_primitive_rcvd_tasklet(struct asd_ascb *ascb,
+                                      struct done_list_struct *dl,
+                                      int phy_id)
 {
        unsigned long flags;
        struct sas_ha_struct *sas_ha = &ascb->ha->sas_ha;
@@ -459,13 +457,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) {
@@ -479,7 +483,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 &&
@@ -710,7 +714,7 @@ out:
        asd_ascb_free(ascb);
 }
 
-static inline void set_speed_mask(u8 *speed_mask, struct asd_phy_desc *pd)
+static void set_speed_mask(u8 *speed_mask, struct asd_phy_desc *pd)
 {
        /* disable all speeds, then enable defaults */
        *speed_mask = SAS_SPEED_60_DIS | SAS_SPEED_30_DIS | SAS_SPEED_15_DIS
@@ -789,12 +793,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;
@@ -815,6 +819,8 @@ void asd_build_control_phy(struct asd_ascb *ascb, int phy_id, u8 subfunc)
 
 /* ---------- INITIATE LINK ADM TASK ---------- */
 
+#if 0
+
 static void link_adm_tasklet_complete(struct asd_ascb *ascb,
                                      struct done_list_struct *dl)
 {
@@ -847,6 +853,8 @@ void asd_build_initiate_link_adm_task(struct asd_ascb *ascb, int phy_id,
        ascb->tasklet_complete = link_adm_tasklet_complete;
 }
 
+#endif  /*  0  */
+
 /* ---------- SCB timer ---------- */
 
 /**