--- ./linux.orig/drivers/block/DAC960.c Tue Jan 1 04:56:19 2002 +++ ./linux/drivers/block/DAC960.c Sat Feb 2 06:13:08 2002 @@ -306,9 +306,9 @@ static void DAC960_WaitForCommand(DAC960_Controller_T *Controller) { - spin_unlock_irq(&Controller->RequestQueue->queue_lock); + spin_unlock_irq(Controller->RequestQueue->queue_lock); __wait_event(Controller->CommandWaitQueue, Controller->FreeCommands); - spin_lock_irq(&Controller->RequestQueue->queue_lock); + spin_lock_irq(Controller->RequestQueue->queue_lock); } @@ -1944,8 +1944,9 @@ /* Initialize the I/O Request Queue. */ + spin_lock_init(Controller->queue_lock); RequestQueue = BLK_DEFAULT_QUEUE(MajorNumber); - blk_init_queue(RequestQueue, DAC960_RequestFunction); + blk_init_queue(RequestQueue, DAC960_RequestFunction, Controller->queue_lock); RequestQueue->queuedata = Controller; blk_queue_max_hw_segments(RequestQueue, Controller->DriverScatterGatherLimit); @@ -1957,9 +1958,6 @@ Initialize the Disk Partitions array, Partition Sizes array, Block Sizes array, and Max Sectors per Request array. */ - for (MinorNumber = 0; MinorNumber < DAC960_MinorCount; MinorNumber++) - Controller->MaxSectorsPerRequest[MinorNumber] = - Controller->MaxBlocksPerCommand; Controller->GenericDiskInfo.part = Controller->DiskPartitions; Controller->GenericDiskInfo.sizes = Controller->PartitionSizes; blksize_size[MajorNumber] = Controller->BlockSizes; @@ -2066,10 +2064,11 @@ { if (Controller->FirmwareType == DAC960_V1_Controller) { + Controller->KernelDevice = mk_kdev(DAC960_MajorNumber(controller->ControllerNumber), + DAC960_MinorNumber(LogicalDriveNumber, 0)); if (LogicalDriveNumber > Controller->LogicalDriveCount - 1) return; register_disk(&Controller->GenericDiskInfo, - DAC960_KernelDevice(Controller->ControllerNumber, - LogicalDriveNumber, 0), + Controller->KernelDevice, DAC960_MaxPartitions, &DAC960_BlockDeviceOperations, Controller->V1.LogicalDriveInformation @@ -2080,9 +2079,9 @@ DAC960_V2_LogicalDeviceInfo_T *LogicalDeviceInfo = Controller->V2.LogicalDeviceInformation[LogicalDriveNumber]; if (LogicalDeviceInfo == NULL) return; + register_disk(&Controller->GenericDiskInfo, - DAC960_KernelDevice(Controller->ControllerNumber, - LogicalDriveNumber, 0), + Controller->KernelDevice, DAC960_MaxPartitions, &DAC960_BlockDeviceOperations, LogicalDeviceInfo->ConfigurableDeviceSize); @@ -2742,17 +2741,17 @@ if (bio_data(BufferHeader) == LastDataEndPointer) { ScatterGatherList[SegmentNumber-1].SegmentByteCount += - bio_size(BufferHeader); - LastDataEndPointer += bio_size(BufferHeader); + BufferHeader->bi_size; + LastDataEndPointer += BufferHeader->bi_size; } else { ScatterGatherList[SegmentNumber].SegmentDataPointer = Virtual_to_Bus32(bio_data(BufferHeader)); ScatterGatherList[SegmentNumber].SegmentByteCount = - bio_size(BufferHeader); + BufferHeader->bi_zize; LastDataEndPointer = bio_data(BufferHeader) + - bio_size(BufferHeader); + BufferHeader->bi_size; if (SegmentNumber++ > Controller->DriverScatterGatherLimit) panic("DAC960: Scatter/Gather Segment Overflow\n"); } @@ -2833,17 +2832,17 @@ if (bio_data(BufferHeader) == LastDataEndPointer) { ScatterGatherList[SegmentNumber-1].SegmentByteCount += - bio_size(BufferHeader); - LastDataEndPointer += bio_size(BufferHeader); + BufferHeader->bi_size; + LastDataEndPointer += BufferHeader->bi_size; } else { ScatterGatherList[SegmentNumber].SegmentDataPointer = Virtual_to_Bus64(bio_data(BufferHeader)); ScatterGatherList[SegmentNumber].SegmentByteCount = - bio_size(BufferHeader); + BufferHeader->bi_size; LastDataEndPointer = bio_data(BufferHeader) + - bio_size(BufferHeader); + BufferHeader->bi_size; if (SegmentNumber++ > Controller->DriverScatterGatherLimit) panic("DAC960: Scatter/Gather Segment Overflow\n"); } @@ -2945,7 +2944,7 @@ if (SuccessfulIO) set_bit(BIO_UPTODATE, &BufferHeader->bi_flags); blk_finished_io(bio_sectors(BufferHeader)); - BufferHeader->bi_end_io(BufferHeader); + BufferHeader->bi_end_io(BufferHeader, bio_sectors(BufferHeader)); } @@ -3061,7 +3060,7 @@ Command->CommandType = DAC960_WriteRetryCommand; CommandMailbox->Type5.CommandOpcode = DAC960_V1_Write; } - Command->BlockCount = bio_size(BufferHeader) >> DAC960_BlockSizeBits; + Command->BlockCount = (BufferHeader->bi_size) >> DAC960_BlockSizeBits; CommandMailbox->Type5.LD.TransferLength = Command->BlockCount; CommandMailbox->Type5.BusAddress = Virtual_to_Bus32(bio_data(BufferHeader)); @@ -3110,9 +3109,9 @@ DAC960_V1_CommandMailbox_T *CommandMailbox = &Command->V1.CommandMailbox; Command->BlockNumber += - bio_size(BufferHeader) >> DAC960_BlockSizeBits; + (BufferHeader->bi_size) >> DAC960_BlockSizeBits; Command->BlockCount = - bio_size(NextBufferHeader) >> DAC960_BlockSizeBits; + (NextBufferHeader->bi_size) >> DAC960_BlockSizeBits; Command->BufferHeader = NextBufferHeader; CommandMailbox->Type5.LD.TransferLength = Command->BlockCount; CommandMailbox->Type5.LogicalBlockAddress = Command->BlockNumber; @@ -4158,7 +4157,7 @@ if (CommandType == DAC960_ReadCommand) Command->CommandType = DAC960_ReadRetryCommand; else Command->CommandType = DAC960_WriteRetryCommand; - Command->BlockCount = bio_size(BufferHeader) >> DAC960_BlockSizeBits; + Command->BlockCount = (BufferHeader->bi_size) >> DAC960_BlockSizeBits; CommandMailbox->SCSI_10.CommandControlBits .AdditionalScatterGatherListMemory = false; CommandMailbox->SCSI_10.DataTransferSize = @@ -4214,9 +4213,9 @@ if (NextBufferHeader != NULL) { Command->BlockNumber += - bio_size(BufferHeader) >> DAC960_BlockSizeBits; + (BufferHeader->bi_size) >> DAC960_BlockSizeBits; Command->BlockCount = - bio_size(NextBufferHeader) >> DAC960_BlockSizeBits; + (NextBufferHeader->bi_size) >> DAC960_BlockSizeBits; Command->BufferHeader = NextBufferHeader; CommandMailbox->SCSI_10.DataTransferSize = Command->BlockCount << DAC960_BlockSizeBits; @@ -5299,7 +5298,7 @@ DAC960_ComputeGenericDiskInfo(Controller); DAC960_RegisterDisk(Controller, LogicalDriveNumber); } - if (Controller->GenericDiskInfo.sizes[MINOR(Inode->i_rdev)] == 0) + if (Controller->GenericDiskInfo.sizes[minor(Inode->i_rdev)] == 0) return -ENXIO; /* Increment Controller and Logical Drive Usage Counts. @@ -5536,11 +5535,11 @@ while (Controller->V1.DirectCommandActive[DCDB.Channel] [DCDB.TargetID]) { - spin_unlock_irq(&Controller->RequestQueue->queue_lock); + spin_unlock_irq(Controller->RequestQueue->queue_lock); __wait_event(Controller->CommandWaitQueue, !Controller->V1.DirectCommandActive [DCDB.Channel][DCDB.TargetID]); - spin_lock_irq(&Controller->RequestQueue->queue_lock); + spin_lock_irq(Controller->RequestQueue->queue_lock); } Controller->V1.DirectCommandActive[DCDB.Channel] [DCDB.TargetID] = true; --- ./linux.orig/drivers/block/DAC960.h Fri Jan 4 00:51:36 2002 +++ ./linux/drivers/block/DAC960.h Sat Feb 2 05:54:00 2002 @@ -2363,6 +2363,7 @@ boolean SuppressEnclosureMessages; Timer_T MonitoringTimer; GenericDiskInfo_T GenericDiskInfo; + KernelDevice_T KernelDevice; DAC960_Command_T *FreeCommands; unsigned char *CombinedStatusBuffer; unsigned char *CurrentStatusBuffer; @@ -2508,7 +2509,7 @@ void DAC960_AcquireControllerLock(DAC960_Controller_T *Controller, ProcessorFlags_T *ProcessorFlags) { - spin_lock_irqsave(&Controller->RequestQueue->queue_lock, *ProcessorFlags); + spin_lock_irqsave(Controller->RequestQueue->queue_lock, *ProcessorFlags); } @@ -2520,7 +2521,7 @@ void DAC960_ReleaseControllerLock(DAC960_Controller_T *Controller, ProcessorFlags_T *ProcessorFlags) { - spin_unlock_irqrestore(&Controller->RequestQueue->queue_lock, *ProcessorFlags); + spin_unlock_irqrestore(Controller->RequestQueue->queue_lock, *ProcessorFlags); } @@ -2557,7 +2558,7 @@ void DAC960_AcquireControllerLockIH(DAC960_Controller_T *Controller, ProcessorFlags_T *ProcessorFlags) { - spin_lock_irqsave(&Controller->RequestQueue->queue_lock, *ProcessorFlags); + spin_lock_irqsave(Controller->RequestQueue->queue_lock, *ProcessorFlags); } @@ -2570,7 +2571,7 @@ void DAC960_ReleaseControllerLockIH(DAC960_Controller_T *Controller, ProcessorFlags_T *ProcessorFlags) { - spin_unlock_irqrestore(&Controller->RequestQueue->queue_lock, *ProcessorFlags); + spin_unlock_irqrestore(Controller->RequestQueue->queue_lock, *ProcessorFlags); }