]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] more driver updates (aic7xxx)
authorDoug Ledford <dledford@redhat.com>
Tue, 15 Oct 2002 11:58:12 +0000 (04:58 -0700)
committerDoug Ledford <dledford@redhat.com>
Tue, 15 Oct 2002 11:58:12 +0000 (04:58 -0700)
aic7xxx_linux_host.h:
  Update host template
aic7xxx_linux.c:
  Update to new TCQ scheme

drivers/scsi/aic7xxx/aic7xxx_linux.c
drivers/scsi/aic7xxx/aic7xxx_linux_host.h

index 70c2109703d5fc18f052f58be906ef335146823a..21e35f436d7575eca494b3301b300637b01e88bd 100644 (file)
@@ -430,8 +430,7 @@ static void ahc_linux_freeze_sim_queue(struct ahc_softc *ahc);
 static void ahc_linux_release_sim_queue(u_long arg);
 static int  ahc_linux_queue_recovery_cmd(Scsi_Cmnd *cmd, scb_flag flag);
 static void ahc_linux_initialize_scsi_bus(struct ahc_softc *ahc);
-static void ahc_linux_select_queue_depth(struct Scsi_Host *host,
-                                        Scsi_Device *scsi_devs);
+static int  ahc_linux_slave_attach(Scsi_Device *device);
 static void ahc_linux_device_queue_depth(struct ahc_softc *ahc,
                                         Scsi_Device *device);
 static struct ahc_linux_target*        ahc_linux_alloc_target(struct ahc_softc*,
@@ -1131,7 +1130,6 @@ ahc_linux_register_host(struct ahc_softc *ahc, Scsi_Host_Template *template)
        host->can_queue = AHC_MAX_QUEUE;
        host->cmd_per_lun = 2;
        host->sg_tablesize = AHC_NSEG;
-       host->select_queue_depths = ahc_linux_select_queue_depth;
        /* XXX No way to communicate the ID for multiple channels */
        host->this_id = ahc->our_id;
        host->irq = ahc->platform_data->irq;
@@ -1449,25 +1447,17 @@ ahc_platform_abort_scbs(struct ahc_softc *ahc, int target, char channel,
  * Sets the queue depth for each SCSI device hanging
  * off the input host adapter.
  */
-static void
-ahc_linux_select_queue_depth(struct Scsi_Host * host,
-                            Scsi_Device * scsi_devs)
+static int
+ahc_linux_slave_attach(Scsi_Device * device)
 {
-       Scsi_Device *device;
        struct  ahc_softc *ahc;
        u_long  flags;
-       int     scbnum;
 
-       ahc = *((struct ahc_softc **)host->hostdata);
+       ahc = *((struct ahc_softc **)device->host->hostdata);
        ahc_lock(ahc, &flags);
-       scbnum = 0;
-       for (device = scsi_devs; device != NULL; device = device->next) {
-               if (device->host == host) {
-                       ahc_linux_device_queue_depth(ahc, device);
-                       scbnum += device->queue_depth;
-               }
-       }
+       ahc_linux_device_queue_depth(ahc, device);
        ahc_unlock(ahc, &flags);
+       return 0;
 }
 
 /*
@@ -1512,7 +1502,8 @@ ahc_linux_device_queue_depth(struct ahc_softc *ahc, Scsi_Device * device)
                }
        }
        if (tags != 0) {
-               device->queue_depth = tags;
+               scsi_adjust_queue_depth(device, MSG_ORDERED_TAG, tags);
+               /* device->queue_depth = tags; */
                ahc_set_tags(ahc, &devinfo, AHC_QUEUE_TAGGED);
                printf("scsi%d:%c:%d:%d: Tagged Queuing enabled.  Depth %d\n",
                       ahc->platform_data->host->host_no, device->channel + 'A',
@@ -1523,8 +1514,9 @@ ahc_linux_device_queue_depth(struct ahc_softc *ahc, Scsi_Device * device)
                 * us at any time even though we can only execute them
                 * serially on the controller/device.  This should remove
                 * some latency.
-                */
                device->queue_depth = 2;
+                */
+               scsi_adjust_queue_depth(device, 0, device->host->cmd_per_lun);
        }
 }
 
index 4c3735f5a392a3aa9c658df31bfbba208aae8edf..de53201f4df1da74f05bd155921d8930e474f9e9 100644 (file)
@@ -80,7 +80,7 @@ int            ahc_linux_abort(Scsi_Cmnd *);
        eh_host_reset_handler: NULL,                            \
        abort: NULL,                                            \
        reset: NULL,                                            \
-       slave_attach: NULL,                                     \
+       slave_attach: ahc_linux_slave_attach,                   \
        bios_param: AIC7XXX_BIOSPARAM,                          \
        can_queue: 253,         /* max simultaneous cmds      */\
        this_id: -1,            /* scsi id of host adapter    */\