fibptr->next = fibptr+1; /* Forward chain the fibs */
init_MUTEX_LOCKED(&fibptr->event_wait);
spin_lock_init(&fibptr->event_lock);
- hw_fib_va->header.XferState = cpu_to_le32(0xffffffff);
+ hw_fib_va->header.XferState = 0xffffffff;
hw_fib_va->header.SenderSize = cpu_to_le16(sizeof(struct hw_fib));
fibptr->hw_fib_pa = hw_fib_pa;
hw_fib_va = (struct hw_fib *)((unsigned char *)hw_fib_va + sizeof(struct hw_fib));
* Null out fields that depend on being zero at the start of
* each I/O
*/
- fibptr->hw_fib->header.XferState = cpu_to_le32(0);
+ fibptr->hw_fib->header.XferState = 0;
fibptr->callback = NULL;
fibptr->callback_data = NULL;
} else {
if (fibptr->hw_fib->header.XferState != 0) {
printk(KERN_WARNING "fib_free, XferState != 0, fibptr = 0x%p, XferState = 0x%x\n",
- (void*)fibptr, fibptr->hw_fib->header.XferState);
+ (void*)fibptr,
+ le32_to_cpu(fibptr->hw_fib->header.XferState));
}
fibptr->next = fibptr->dev->free_fib;
fibptr->dev->free_fib = fibptr;
struct hw_fib *hw_fib = fibptr->hw_fib;
if(hw_fib->header.StructType != FIB_MAGIC)
BUG();
- hw_fib->header.XferState = cpu_to_le32(0);
+ hw_fib->header.XferState = 0;
}
/*
* in the queue entry.
*/
if (map)
- entry->addr = fibptr->hw_fib_pa;
+ entry->addr = cpu_to_le32(fibptr->hw_fib_pa);
return 0;
}
struct hw_fib * hw_fib = fibptr->hw_fib;
struct aac_queue * q;
unsigned long flags = 0;
- if (!(le32_to_cpu(hw_fib->header.XferState) & HostOwned))
+ if (!(hw_fib->header.XferState & cpu_to_le32(HostOwned)))
return -EBUSY;
/*
* There are 5 cases with the wait and reponse requested flags.
* The only invalid cases are if the caller requests to wait and
* does not request a response and if the caller does not want a
- * response and the Fibis not allocated from pool. If a response
+ * response and the Fib is not allocated from pool. If a response
* is not requesed the Fib will just be deallocaed by the DPC
* routine when the response comes back from the adapter. No
* further processing will be done besides deleting the Fib. We
return(status);
}
-int aac_consumer_avail(struct aac_dev *dev, struct aac_queue * q)
-{
- return (le32_to_cpu(*q->headers.producer) != le32_to_cpu(*q->headers.consumer));
-}
-
-
/**
* aac_consumer_free - free consumer entry
* @dev: Adapter
struct hw_fib * hw_fib = fibptr->hw_fib;
struct aac_dev * dev = fibptr->dev;
unsigned long nointr = 0;
- if (le32_to_cpu(hw_fib->header.XferState) == 0)
+ if (hw_fib->header.XferState == 0)
return 0;
/*
* If we plan to do anything check the structure type first.
* Check for a fib which has already been completed
*/
- if (hw_fib->header.XferState == cpu_to_le32(0))
+ if (hw_fib->header.XferState == 0)
return 0;
/*
* If we plan to do anything check the structure type first.
memset(cp, 0, 256);
}
-
-/**
- * aac_handle_aif - Handle a message from the firmware
- * @dev: Which adapter this fib is from
- * @fibptr: Pointer to fibptr from adapter
- *
- * This routine handles a driver notify fib from the adapter and
- * dispatches it to the appropriate routine for handling.
- */
-
-static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr)
-{
- struct hw_fib * hw_fib = fibptr->hw_fib;
- /*
- * Set the status of this FIB to be Invalid parameter.
- *
- * *(u32 *)fib->data = ST_INVAL;
- */
- *(u32 *)hw_fib->data = cpu_to_le32(ST_OK);
- fib_adapter_complete(fibptr, sizeof(u32));
-}
-
/**
* aac_command_thread - command processing thread
* @dev: Adapter to monitor
aifcmd = (struct aac_aifcmd *) hw_fib->data;
if (aifcmd->command == cpu_to_le32(AifCmdDriverNotify)) {
/* Handle Driver Notify Events */
- aac_handle_aif(dev, fib);
*(u32 *)hw_fib->data = cpu_to_le32(ST_OK);
fib_adapter_complete(fib, sizeof(u32));
} else {
u32 time_now, time_last;
unsigned long flagv;
- /* Sniff events */
- if (aifcmd->command == cpu_to_le32(AifCmdEventNotify))
- aac_handle_aif(dev, fib);
-
time_now = jiffies/HZ;
spin_lock_irqsave(&dev->fib_lock, flagv);