*/
-#define DAC960_DriverVersion "2.5.48"
-#define DAC960_DriverDate "14 May 2006"
+#define DAC960_DriverVersion "2.5.47"
+#define DAC960_DriverDate "14 November 2002"
#include <linux/module.h>
#include <linux/timer.h>
#include <linux/pci.h>
#include <linux/init.h>
-#include <linux/jiffies.h>
#include <linux/random.h>
#include <asm/io.h>
#include <asm/uaccess.h>
void *cpu_end = loaf->cpu_free + len;
void *cpu_addr = loaf->cpu_free;
- BUG_ON(cpu_end > loaf->cpu_base + loaf->length);
+ if (cpu_end > loaf->cpu_base + loaf->length)
+ BUG();
*dma_handle = loaf->dma_free;
loaf->cpu_free = cpu_end;
loaf->dma_free += len;
CommandsRemaining = CommandAllocationGroupSize;
CommandGroupByteCount =
CommandsRemaining * CommandAllocationLength;
- AllocationPointer = kzalloc(CommandGroupByteCount, GFP_ATOMIC);
+ AllocationPointer = kmalloc(CommandGroupByteCount, GFP_ATOMIC);
if (AllocationPointer == NULL)
return DAC960_Failure(Controller,
"AUXILIARY STRUCTURE CREATION");
+ memset(AllocationPointer, 0, CommandGroupByteCount);
}
Command = (DAC960_Command_T *) AllocationPointer;
AllocationPointer += CommandAllocationLength;
static void DAC960_ExecuteCommand(DAC960_Command_T *Command)
{
DAC960_Controller_T *Controller = Command->Controller;
- DECLARE_COMPLETION_ONSTACK(Completion);
+ DECLARE_COMPLETION(Completion);
unsigned long flags;
Command->Completion = &Completion;
blk_queue_max_sectors(RequestQueue, Controller->MaxBlocksPerCommand);
disk->queue = RequestQueue;
sprintf(disk->disk_name, "rd/c%dd%d", Controller->ControllerNumber, n);
+ sprintf(disk->devfs_name, "rd/host%d/target%d", Controller->ControllerNumber, n);
disk->major = MajorNumber;
disk->first_minor = n << DAC960_MaxPartitionsBits;
disk->fops = &DAC960_BlockDeviceOperations;
void __iomem *BaseAddress;
int i;
- Controller = kzalloc(sizeof(DAC960_Controller_T), GFP_ATOMIC);
+ Controller = (DAC960_Controller_T *)
+ kmalloc(sizeof(DAC960_Controller_T), GFP_ATOMIC);
if (Controller == NULL) {
DAC960_Error("Unable to allocate Controller structure for "
"Controller at\n", NULL);
return NULL;
}
+ memset(Controller, 0, sizeof(DAC960_Controller_T));
Controller->ControllerNumber = DAC960_ControllerCount;
DAC960_Controllers[DAC960_ControllerCount++] = Controller;
Controller->Bus = PCI_Device->bus->number;
Acquire shared access to the IRQ Channel.
*/
IRQ_Channel = PCI_Device->irq;
- if (request_irq(IRQ_Channel, InterruptHandler, IRQF_SHARED,
+ if (request_irq(IRQ_Channel, InterruptHandler, SA_SHIRQ,
Controller->FullModelName, Controller) < 0)
{
DAC960_Error("Unable to acquire IRQ Channel %d for Controller at\n",
(NewEnquiry->EventLogSequenceNumber !=
OldEnquiry->EventLogSequenceNumber) ||
Controller->MonitoringTimerCount == 0 ||
- time_after_eq(jiffies, Controller->SecondaryMonitoringTime
- + DAC960_SecondaryMonitoringInterval))
+ (jiffies - Controller->SecondaryMonitoringTime
+ >= DAC960_SecondaryMonitoringInterval))
{
Controller->V1.NeedLogicalDriveInformation = true;
Controller->V1.NewEventLogSequenceNumber =
(NewPhysicalDeviceInfo->LogicalUnit !=
PhysicalDeviceInfo->LogicalUnit))
{
- PhysicalDeviceInfo =
+ PhysicalDeviceInfo = (DAC960_V2_PhysicalDeviceInfo_T *)
kmalloc(sizeof(DAC960_V2_PhysicalDeviceInfo_T), GFP_ATOMIC);
InquiryUnitSerialNumber =
+ (DAC960_SCSI_Inquiry_UnitSerialNumber_T *)
kmalloc(sizeof(DAC960_SCSI_Inquiry_UnitSerialNumber_T),
GFP_ATOMIC);
- if (InquiryUnitSerialNumber == NULL ||
- PhysicalDeviceInfo == NULL)
+ if (InquiryUnitSerialNumber == NULL &&
+ PhysicalDeviceInfo != NULL)
{
- kfree(InquiryUnitSerialNumber);
- InquiryUnitSerialNumber = NULL;
kfree(PhysicalDeviceInfo);
PhysicalDeviceInfo = NULL;
}
unsigned int StatusChangeCounter =
Controller->V2.HealthStatusBuffer->StatusChangeCounter;
boolean ForceMonitoringCommand = false;
- if (time_after(jiffies, Controller->SecondaryMonitoringTime
- + DAC960_SecondaryMonitoringInterval))
+ if (jiffies - Controller->SecondaryMonitoringTime
+ > DAC960_SecondaryMonitoringInterval)
{
int LogicalDriveNumber;
for (LogicalDriveNumber = 0;
ControllerInfo->ConsistencyChecksActive +
ControllerInfo->RebuildsActive +
ControllerInfo->OnlineExpansionsActive == 0 ||
- time_before(jiffies, Controller->PrimaryMonitoringTime
- + DAC960_MonitoringTimerInterval)) &&
+ jiffies - Controller->PrimaryMonitoringTime
+ < DAC960_MonitoringTimerInterval) &&
!ForceMonitoringCommand)
{
Controller->MonitoringTimer.expires =
Controller->ProgressBufferLength = Length;
if (Controller->EphemeralProgressMessage)
{
- if (time_after_eq(jiffies, Controller->LastProgressReportTime
- + DAC960_ProgressReportingInterval))
+ if (jiffies - Controller->LastProgressReportTime
+ >= DAC960_ProgressReportingInterval)
{
printk("%sDAC960#%d: %s", DAC960_MessageLevelMap[MessageLevel],
Controller->ControllerNumber, Buffer);
unsigned long flags;
unsigned char Channel, TargetID, LogicalDriveNumber;
unsigned short LogicalDeviceNumber;
- wait_queue_t __wait;
-
- init_waitqueue_entry(&__wait, current);
spin_lock_irqsave(&Controller->queue_lock, flags);
while ((Command = DAC960_AllocateCommand(Controller)) == NULL)
.SegmentByteCount =
CommandMailbox->ControllerInfo.DataTransferSize;
DAC960_ExecuteCommand(Command);
- add_wait_queue(&Controller->CommandWaitQueue, &__wait);
- set_current_state(TASK_UNINTERRUPTIBLE);
-
while (Controller->V2.NewControllerInformation->PhysicalScanActive)
{
DAC960_ExecuteCommand(Command);
- schedule_timeout(HZ);
- set_current_state(TASK_UNINTERRUPTIBLE);
+ sleep_on_timeout(&Controller->CommandWaitQueue, HZ);
}
- current->state = TASK_RUNNING;
- remove_wait_queue(&Controller->CommandWaitQueue, &__wait);
-
DAC960_UserCritical("Discovery Completed\n", Controller);
}
}
module_exit(DAC960_cleanup_module);
MODULE_LICENSE("GPL");
-MODULE_VERSION(DAC960_DriverVersion);