]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/scsi/aic94xx/aic94xx_hwi.c
[SCSI] ips: PCI API cleanups
[linux-2.6-omap-h63xx.git] / drivers / scsi / aic94xx / aic94xx_hwi.c
index 1d8c5e5f442e668fefb8aacd2522583182ce0f4f..098b5f39cd31b3a2da7954e8488e265de442fdf0 100644 (file)
@@ -91,7 +91,7 @@ static int asd_init_phy(struct asd_phy *phy)
 
        sas_phy->enabled = 1;
        sas_phy->class = SAS;
-       sas_phy->iproto = SAS_PROTO_ALL;
+       sas_phy->iproto = SAS_PROTOCOL_ALL;
        sas_phy->tproto = 0;
        sas_phy->type = PHY_TYPE_PHYSICAL;
        sas_phy->role = PHY_ROLE_INITIATOR;
@@ -112,6 +112,21 @@ static int asd_init_phy(struct asd_phy *phy)
        return 0;
 }
 
+static void asd_init_ports(struct asd_ha_struct *asd_ha)
+{
+       int i;
+
+       spin_lock_init(&asd_ha->asd_ports_lock);
+       for (i = 0; i < ASD_MAX_PHYS; i++) {
+               struct asd_port *asd_port = &asd_ha->asd_ports[i];
+
+               memset(asd_port->sas_addr, 0, SAS_ADDR_SIZE);
+               memset(asd_port->attached_sas_addr, 0, SAS_ADDR_SIZE);
+               asd_port->phy_mask = 0;
+               asd_port->num_phys = 0;
+       }
+}
+
 static int asd_init_phys(struct asd_ha_struct *asd_ha)
 {
        u8 i;
@@ -121,6 +136,7 @@ static int asd_init_phys(struct asd_ha_struct *asd_ha)
                struct asd_phy *phy = &asd_ha->phys[i];
 
                phy->phy_desc = &asd_ha->hw_prof.phy_desc[i];
+               phy->asd_port = NULL;
 
                phy->sas_phy.enabled = 0;
                phy->sas_phy.id = i;
@@ -658,6 +674,8 @@ int asd_init_hw(struct asd_ha_struct *asd_ha)
                goto Out;
        }
 
+       asd_init_ports(asd_ha);
+
        err = asd_init_scbs(asd_ha);
        if (err) {
                asd_printk("couldn't initialize scbs for %s\n",
@@ -996,11 +1014,10 @@ static inline void asd_hst_pcix_isr(struct asd_ha_struct *asd_ha)
  * asd_hw_isr -- host adapter interrupt service routine
  * @irq: ignored
  * @dev_id: pointer to host adapter structure
- * @regs: ignored
  *
  * The ISR processes done list entries and level 3 error handling.
  */
-irqreturn_t asd_hw_isr(int irq, void *dev_id, struct pt_regs *regs)
+irqreturn_t asd_hw_isr(int irq, void *dev_id)
 {
        struct asd_ha_struct *asd_ha = dev_id;
        u32 chimint = asd_read_reg_dword(asd_ha, CHIMINT);
@@ -1030,15 +1047,14 @@ irqreturn_t asd_hw_isr(int irq, void *dev_id, struct pt_regs *regs)
 static inline struct asd_ascb *asd_ascb_alloc(struct asd_ha_struct *asd_ha,
                                              gfp_t gfp_flags)
 {
-       extern kmem_cache_t *asd_ascb_cache;
+       extern struct kmem_cache *asd_ascb_cache;
        struct asd_seq_data *seq = &asd_ha->seq;
        struct asd_ascb *ascb;
        unsigned long flags;
 
-       ascb = kmem_cache_alloc(asd_ascb_cache, gfp_flags);
+       ascb = kmem_cache_zalloc(asd_ascb_cache, gfp_flags);
 
        if (ascb) {
-               memset(ascb, 0, sizeof(*ascb));
                ascb->dma_scb.size = sizeof(struct scb);
                ascb->dma_scb.vaddr = dma_pool_alloc(asd_ha->scb_pool,
                                                     gfp_flags,