Skip to contentSkip to conversation

fixes compile errors in cpqfc driver

PATCH RESEND New Mike Christie 1 participant 1 message Jul 14, 2003 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 fixes compile errors in cpqfc driver

The attached path fixes the compile errors in the cpqfc driver caused by changes in scsi_cmnd. And, per Christoph and James's comments http://marc.theaimsgroup.com/?l=linux-scsi&m=105099392420649&w=2 I have removed the scsi_cmnd stack usage.

I do not have the hardware, so I have only verified that it compiles.

Mike Christie
[email protected]

cpqfcTSinit.c    |   35 +++++++++++++++++++++---------
cpqfcTSstructs.h |    1
cpqfcTSworker.c  |   63 +++++++++++++++++++++++++++++++------------------------
3 files changed, 61 insertions(+), 38 deletions(-)
drivers/scsi/cpqfcTSinit.c +25 -10
diff -uar linux-2.5.75/drivers/scsi/cpqfcTSinit.c linux-2.5.75-cpqfc/drivers/scsi/cpqfcTSinit.c
@@ -549,14 +549,14 @@
 			hba->private_data_bits+(i/BITS_PER_LONG));
 }
 
-int cpqfcTS_ioctl( Scsi_Device *ScsiDev, int Cmnd, void *arg)
+int cpqfcTS_ioctl( struct scsi_device *ScsiDev, int Cmnd, void *arg)
 {
   int result = 0;
   struct Scsi_Host *HostAdapter = ScsiDev->host;
   CPQFCHBA *cpqfcHBAdata = (CPQFCHBA *)HostAdapter->hostdata;
   PTACHYON fcChip = &cpqfcHBAdata->fcChip;
   PFC_LOGGEDIN_PORT pLoggedInPort = NULL;
-  Scsi_Cmnd DumCmnd;
+  struct scsi_cmnd *DumCmnd;
   int i, j;
   VENDOR_IOCTL_REQ ioc;
   cpqfc_passthru_t *vendor_cmd;
@@ -723,13 +723,16 @@
 /* 	DumCmnd.target  = ScsiDev->id; */
 /* 	DumCmnd.lun     = ScsiDev->lun; */
 
-        DumCmnd.device = ScsiDev;
+	DumCmnd = scsi_get_command (ScsiDev, GFP_KERNEL);
+	if (!DumCmnd)
+		return -ENOMEM;
 	
 	pLoggedInPort = fcFindLoggedInPort( fcChip,
-		&DumCmnd, // search Scsi Nexus
+		DumCmnd, // search Scsi Nexus
 		0,        // DON'T search linked list for FC port id
 		NULL,     // DON'T search linked list for FC WWN
 		NULL);    // DON'T care about end of list
+	scsi_put_command (DumCmnd);
 	if (pLoggedInPort == NULL) {
 		result = -ENXIO;
 		break;
@@ -918,7 +921,8 @@
 int cpqfcTS_proc_info (struct Scsi_Host *host, char *buffer, char **start, off_t offset, int length, 
 		       int inout)
 {
-  Scsi_Cmnd DumCmnd;
+  struct scsi_cmnd *DumCmnd;
+  struct scsi_device *ScsiDev;
   int Chan, Targ, i;
   struct info_str info;
   CPQFCHBA *cpqfcHBA;
@@ -946,13 +950,21 @@
 
 #define DISPLAY_WWN_INFO
 #ifdef DISPLAY_WWN_INFO
+  ScsiDev = scsi_get_host_dev (host);
+  if (!ScsiDev) 
+    return -ENOMEM;
+  DumCmnd = scsi_get_command (ScsiDev, GFP_KERNEL);
+  if (!DumCmnd) {
+    scsi_free_host_dev (ScsiDev);
+    return -ENOMEM;
+  }
   copy_info(&info, "WWN database: (\"port_id: 000000\" means disconnected)\n");
   for ( Chan=0; Chan <= host->max_channel; Chan++) {
-    DumCmnd.channel = Chan;
+    DumCmnd->device->channel = Chan;
     for (Targ=0; Targ <= host->max_id; Targ++) {
-      DumCmnd.target = Targ;
+      DumCmnd->device->id = Targ;
       if ((pLoggedInPort = fcFindLoggedInPort( fcChip,
-	    			&DumCmnd, // search Scsi Nexus
+	    			DumCmnd,  // search Scsi Nexus
     				0,        // DON'T search list for FC port id
     				NULL,     // DON'T search list for FC WWN
     				NULL))){   // DON'T care about end of list
@@ -966,6 +978,9 @@
       }
     }
   }
+
+  scsi_put_command (DumCmnd);
+  scsi_free_host_dev (ScsiDev);
 #endif
 
 
@@ -1578,7 +1593,7 @@
 // Scsi_Request, etc.
 // For now, so people don't fall into a hole...
 return -ENOTSUPP;
-
+/*
   // printk("   ENTERING cpqfcTS_TargetDeviceReset() - flag=%d \n",reset_flags);
 
   if (ScsiDev->host->eh_active) return FAILED;
@@ -1600,7 +1615,7 @@
 	SCpnt->request->CPQFC_WAITING = NULL;
   }
     
-/*
+
       if(driver_byte(SCpnt->result) != 0)
 	  switch(SCpnt->sense_buffer[2] & 0xf) {
 	case ILLEGAL_REQUEST:
drivers/scsi/cpqfcTSstructs.h +0 -1
diff -uar linux-2.5.75/drivers/scsi/cpqfcTSstructs.h linux-2.5.75-cpqfc/drivers/scsi/cpqfcTSstructs.h
@@ -696,7 +696,6 @@
 
   ULONG port_id;     // a FC 24-bit address of port (lower 8 bits = al_pa)
 
-  Scsi_Cmnd ScsiCmnd;   // command buffer for Report Luns
 #define REPORT_LUNS_PL 256  
   UCHAR ReportLunsPayload[REPORT_LUNS_PL];
   
drivers/scsi/cpqfcTSworker.c +36 -27

155 lines not on this page · raw message