aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/DAC960.c
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
commit8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch)
treea8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /drivers/block/DAC960.c
parent406089d01562f1e2bf9f089fd7637009ebaad589 (diff)
Patched in Tegra support.
Diffstat (limited to 'drivers/block/DAC960.c')
-rw-r--r--drivers/block/DAC960.c41
1 files changed, 21 insertions, 20 deletions
diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c
index 9a13e889837..e086fbbbe85 100644
--- a/drivers/block/DAC960.c
+++ b/drivers/block/DAC960.c
@@ -1177,8 +1177,7 @@ static bool DAC960_V1_EnableMemoryMailboxInterface(DAC960_Controller_T
1177 int TimeoutCounter; 1177 int TimeoutCounter;
1178 int i; 1178 int i;
1179 1179
1180 memset(&CommandMailbox, 0, sizeof(DAC960_V1_CommandMailbox_T)); 1180
1181
1182 if (pci_set_dma_mask(Controller->PCIDevice, DMA_BIT_MASK(32))) 1181 if (pci_set_dma_mask(Controller->PCIDevice, DMA_BIT_MASK(32)))
1183 return DAC960_Failure(Controller, "DMA mask out of range"); 1182 return DAC960_Failure(Controller, "DMA mask out of range");
1184 Controller->BounceBufferLimit = DMA_BIT_MASK(32); 1183 Controller->BounceBufferLimit = DMA_BIT_MASK(32);
@@ -4628,8 +4627,7 @@ static void DAC960_V2_ProcessCompletedCommand(DAC960_Command_T *Command)
4628 DAC960_Controller_T *Controller = Command->Controller; 4627 DAC960_Controller_T *Controller = Command->Controller;
4629 DAC960_CommandType_T CommandType = Command->CommandType; 4628 DAC960_CommandType_T CommandType = Command->CommandType;
4630 DAC960_V2_CommandMailbox_T *CommandMailbox = &Command->V2.CommandMailbox; 4629 DAC960_V2_CommandMailbox_T *CommandMailbox = &Command->V2.CommandMailbox;
4631 DAC960_V2_IOCTL_Opcode_T IOCTLOpcode = CommandMailbox->Common.IOCTL_Opcode; 4630 DAC960_V2_IOCTL_Opcode_T CommandOpcode = CommandMailbox->Common.IOCTL_Opcode;
4632 DAC960_V2_CommandOpcode_T CommandOpcode = CommandMailbox->SCSI_10.CommandOpcode;
4633 DAC960_V2_CommandStatus_T CommandStatus = Command->V2.CommandStatus; 4631 DAC960_V2_CommandStatus_T CommandStatus = Command->V2.CommandStatus;
4634 4632
4635 if (CommandType == DAC960_ReadCommand || 4633 if (CommandType == DAC960_ReadCommand ||
@@ -4701,7 +4699,7 @@ static void DAC960_V2_ProcessCompletedCommand(DAC960_Command_T *Command)
4701 { 4699 {
4702 if (Controller->ShutdownMonitoringTimer) 4700 if (Controller->ShutdownMonitoringTimer)
4703 return; 4701 return;
4704 if (IOCTLOpcode == DAC960_V2_GetControllerInfo) 4702 if (CommandOpcode == DAC960_V2_GetControllerInfo)
4705 { 4703 {
4706 DAC960_V2_ControllerInfo_T *NewControllerInfo = 4704 DAC960_V2_ControllerInfo_T *NewControllerInfo =
4707 Controller->V2.NewControllerInformation; 4705 Controller->V2.NewControllerInformation;
@@ -4721,14 +4719,14 @@ static void DAC960_V2_ProcessCompletedCommand(DAC960_Command_T *Command)
4721 memcpy(ControllerInfo, NewControllerInfo, 4719 memcpy(ControllerInfo, NewControllerInfo,
4722 sizeof(DAC960_V2_ControllerInfo_T)); 4720 sizeof(DAC960_V2_ControllerInfo_T));
4723 } 4721 }
4724 else if (IOCTLOpcode == DAC960_V2_GetEvent) 4722 else if (CommandOpcode == DAC960_V2_GetEvent)
4725 { 4723 {
4726 if (CommandStatus == DAC960_V2_NormalCompletion) { 4724 if (CommandStatus == DAC960_V2_NormalCompletion) {
4727 DAC960_V2_ReportEvent(Controller, Controller->V2.Event); 4725 DAC960_V2_ReportEvent(Controller, Controller->V2.Event);
4728 } 4726 }
4729 Controller->V2.NextEventSequenceNumber++; 4727 Controller->V2.NextEventSequenceNumber++;
4730 } 4728 }
4731 else if (IOCTLOpcode == DAC960_V2_GetPhysicalDeviceInfoValid && 4729 else if (CommandOpcode == DAC960_V2_GetPhysicalDeviceInfoValid &&
4732 CommandStatus == DAC960_V2_NormalCompletion) 4730 CommandStatus == DAC960_V2_NormalCompletion)
4733 { 4731 {
4734 DAC960_V2_PhysicalDeviceInfo_T *NewPhysicalDeviceInfo = 4732 DAC960_V2_PhysicalDeviceInfo_T *NewPhysicalDeviceInfo =
@@ -4917,7 +4915,7 @@ static void DAC960_V2_ProcessCompletedCommand(DAC960_Command_T *Command)
4917 NewPhysicalDeviceInfo->LogicalUnit++; 4915 NewPhysicalDeviceInfo->LogicalUnit++;
4918 Controller->V2.PhysicalDeviceIndex++; 4916 Controller->V2.PhysicalDeviceIndex++;
4919 } 4917 }
4920 else if (IOCTLOpcode == DAC960_V2_GetPhysicalDeviceInfoValid) 4918 else if (CommandOpcode == DAC960_V2_GetPhysicalDeviceInfoValid)
4921 { 4919 {
4922 unsigned int DeviceIndex; 4920 unsigned int DeviceIndex;
4923 for (DeviceIndex = Controller->V2.PhysicalDeviceIndex; 4921 for (DeviceIndex = Controller->V2.PhysicalDeviceIndex;
@@ -4940,7 +4938,7 @@ static void DAC960_V2_ProcessCompletedCommand(DAC960_Command_T *Command)
4940 } 4938 }
4941 Controller->V2.NeedPhysicalDeviceInformation = false; 4939 Controller->V2.NeedPhysicalDeviceInformation = false;
4942 } 4940 }
4943 else if (IOCTLOpcode == DAC960_V2_GetLogicalDeviceInfoValid && 4941 else if (CommandOpcode == DAC960_V2_GetLogicalDeviceInfoValid &&
4944 CommandStatus == DAC960_V2_NormalCompletion) 4942 CommandStatus == DAC960_V2_NormalCompletion)
4945 { 4943 {
4946 DAC960_V2_LogicalDeviceInfo_T *NewLogicalDeviceInfo = 4944 DAC960_V2_LogicalDeviceInfo_T *NewLogicalDeviceInfo =
@@ -5067,7 +5065,7 @@ static void DAC960_V2_ProcessCompletedCommand(DAC960_Command_T *Command)
5067 [LogicalDeviceNumber] = true; 5065 [LogicalDeviceNumber] = true;
5068 NewLogicalDeviceInfo->LogicalDeviceNumber++; 5066 NewLogicalDeviceInfo->LogicalDeviceNumber++;
5069 } 5067 }
5070 else if (IOCTLOpcode == DAC960_V2_GetLogicalDeviceInfoValid) 5068 else if (CommandOpcode == DAC960_V2_GetLogicalDeviceInfoValid)
5071 { 5069 {
5072 int LogicalDriveNumber; 5070 int LogicalDriveNumber;
5073 for (LogicalDriveNumber = 0; 5071 for (LogicalDriveNumber = 0;
@@ -6580,21 +6578,24 @@ static const struct file_operations dac960_user_command_proc_fops = {
6580 6578
6581static void DAC960_CreateProcEntries(DAC960_Controller_T *Controller) 6579static void DAC960_CreateProcEntries(DAC960_Controller_T *Controller)
6582{ 6580{
6581 struct proc_dir_entry *StatusProcEntry;
6583 struct proc_dir_entry *ControllerProcEntry; 6582 struct proc_dir_entry *ControllerProcEntry;
6583 struct proc_dir_entry *UserCommandProcEntry;
6584 6584
6585 if (DAC960_ProcDirectoryEntry == NULL) { 6585 if (DAC960_ProcDirectoryEntry == NULL) {
6586 DAC960_ProcDirectoryEntry = proc_mkdir("rd", NULL); 6586 DAC960_ProcDirectoryEntry = proc_mkdir("rd", NULL);
6587 proc_create("status", 0, DAC960_ProcDirectoryEntry, 6587 StatusProcEntry = proc_create("status", 0,
6588 &dac960_proc_fops); 6588 DAC960_ProcDirectoryEntry,
6589 &dac960_proc_fops);
6589 } 6590 }
6590 6591
6591 sprintf(Controller->ControllerName, "c%d", Controller->ControllerNumber); 6592 sprintf(Controller->ControllerName, "c%d", Controller->ControllerNumber);
6592 ControllerProcEntry = proc_mkdir(Controller->ControllerName, 6593 ControllerProcEntry = proc_mkdir(Controller->ControllerName,
6593 DAC960_ProcDirectoryEntry); 6594 DAC960_ProcDirectoryEntry);
6594 proc_create_data("initial_status", 0, ControllerProcEntry, &dac960_initial_status_proc_fops, Controller); 6595 proc_create_data("initial_status", 0, ControllerProcEntry, &dac960_initial_status_proc_fops, Controller);
6595 proc_create_data("current_status", 0, ControllerProcEntry, &dac960_current_status_proc_fops, Controller); 6596 proc_create_data("current_status", 0, ControllerProcEntry, &dac960_current_status_proc_fops, Controller);
6596 proc_create_data("user_command", S_IWUSR | S_IRUSR, ControllerProcEntry, &dac960_user_command_proc_fops, Controller); 6597 UserCommandProcEntry = proc_create_data("user_command", S_IWUSR | S_IRUSR, ControllerProcEntry, &dac960_user_command_proc_fops, Controller);
6597 Controller->ControllerProcEntry = ControllerProcEntry; 6598 Controller->ControllerProcEntry = ControllerProcEntry;
6598} 6599}
6599 6600
6600 6601