Commit b1abb4d6 authored by James Bottomley's avatar James Bottomley Committed by James Bottomley

[SCSI] aic7xxx: remove separate target and device allocations

Since the aic driver is now taught to speak in terms of the generic
linux devices, we can now also dispense with the transport class get
routines (since we update the parameters when the driver sees they
change) and also plumb it into the spi transport transfer agreement
reporting infrastructure.
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 153b1e1f
This diff is collapsed.
...@@ -79,6 +79,8 @@ ...@@ -79,6 +79,8 @@
#include <scsi/scsi_device.h> #include <scsi/scsi_device.h>
#include <scsi/scsi_host.h> #include <scsi/scsi_host.h>
#include <scsi/scsi_tcq.h> #include <scsi/scsi_tcq.h>
#include <scsi/scsi_transport.h>
#include <scsi/scsi_transport_spi.h>
/* Core SCSI definitions */ /* Core SCSI definitions */
#define AIC_LIB_PREFIX ahc #define AIC_LIB_PREFIX ahc
...@@ -330,8 +332,6 @@ typedef enum { ...@@ -330,8 +332,6 @@ typedef enum {
struct ahc_linux_target; struct ahc_linux_target;
struct ahc_linux_device { struct ahc_linux_device {
TAILQ_ENTRY(ahc_linux_device) links;
/* /*
* The number of transactions currently * The number of transactions currently
* queued to the device. * queued to the device.
...@@ -401,17 +401,10 @@ struct ahc_linux_device { ...@@ -401,17 +401,10 @@ struct ahc_linux_device {
*/ */
u_int commands_since_idle_or_otag; u_int commands_since_idle_or_otag;
#define AHC_OTAG_THRESH 500 #define AHC_OTAG_THRESH 500
int lun;
struct scsi_device *scsi_device;
struct ahc_linux_target *target;
}; };
struct ahc_linux_target { struct ahc_linux_target {
struct ahc_linux_device *devices[AHC_NUM_LUNS]; struct scsi_device *sdev[AHC_NUM_LUNS];
int channel;
int target;
int refcount;
struct ahc_transinfo last_tinfo; struct ahc_transinfo last_tinfo;
struct ahc_softc *ahc; struct ahc_softc *ahc;
}; };
...@@ -445,7 +438,7 @@ struct ahc_platform_data { ...@@ -445,7 +438,7 @@ struct ahc_platform_data {
/* /*
* Fields accessed from interrupt context. * Fields accessed from interrupt context.
*/ */
struct ahc_linux_target *targets[AHC_NUM_TARGETS]; struct scsi_target *starget[AHC_NUM_TARGETS];
spinlock_t spin_lock; spinlock_t spin_lock;
u_int qfrozen; u_int qfrozen;
......
...@@ -50,7 +50,7 @@ static void ahc_dump_target_state(struct ahc_softc *ahc, ...@@ -50,7 +50,7 @@ static void ahc_dump_target_state(struct ahc_softc *ahc,
u_int our_id, char channel, u_int our_id, char channel,
u_int target_id, u_int target_offset); u_int target_id, u_int target_offset);
static void ahc_dump_device_state(struct info_str *info, static void ahc_dump_device_state(struct info_str *info,
struct ahc_linux_device *dev); struct scsi_device *dev);
static int ahc_proc_write_seeprom(struct ahc_softc *ahc, static int ahc_proc_write_seeprom(struct ahc_softc *ahc,
char *buffer, int length); char *buffer, int length);
...@@ -142,6 +142,7 @@ ahc_dump_target_state(struct ahc_softc *ahc, struct info_str *info, ...@@ -142,6 +142,7 @@ ahc_dump_target_state(struct ahc_softc *ahc, struct info_str *info,
u_int target_offset) u_int target_offset)
{ {
struct ahc_linux_target *targ; struct ahc_linux_target *targ;
struct scsi_target *starget;
struct ahc_initiator_tinfo *tinfo; struct ahc_initiator_tinfo *tinfo;
struct ahc_tmode_tstate *tstate; struct ahc_tmode_tstate *tstate;
int lun; int lun;
...@@ -153,7 +154,8 @@ ahc_dump_target_state(struct ahc_softc *ahc, struct info_str *info, ...@@ -153,7 +154,8 @@ ahc_dump_target_state(struct ahc_softc *ahc, struct info_str *info,
copy_info(info, "Target %d Negotiation Settings\n", target_id); copy_info(info, "Target %d Negotiation Settings\n", target_id);
copy_info(info, "\tUser: "); copy_info(info, "\tUser: ");
ahc_format_transinfo(info, &tinfo->user); ahc_format_transinfo(info, &tinfo->user);
targ = ahc->platform_data->targets[target_offset]; starget = ahc->platform_data->starget[target_offset];
targ = scsi_transport_target_data(starget);
if (targ == NULL) if (targ == NULL)
return; return;
...@@ -163,22 +165,25 @@ ahc_dump_target_state(struct ahc_softc *ahc, struct info_str *info, ...@@ -163,22 +165,25 @@ ahc_dump_target_state(struct ahc_softc *ahc, struct info_str *info,
ahc_format_transinfo(info, &tinfo->curr); ahc_format_transinfo(info, &tinfo->curr);
for (lun = 0; lun < AHC_NUM_LUNS; lun++) { for (lun = 0; lun < AHC_NUM_LUNS; lun++) {
struct ahc_linux_device *dev; struct scsi_device *sdev;
dev = targ->devices[lun]; sdev = targ->sdev[lun];
if (dev == NULL) if (sdev == NULL)
continue; continue;
ahc_dump_device_state(info, dev); ahc_dump_device_state(info, sdev);
} }
} }
static void static void
ahc_dump_device_state(struct info_str *info, struct ahc_linux_device *dev) ahc_dump_device_state(struct info_str *info, struct scsi_device *sdev)
{ {
struct ahc_linux_device *dev = scsi_transport_device_data(sdev);
copy_info(info, "\tChannel %c Target %d Lun %d Settings\n", copy_info(info, "\tChannel %c Target %d Lun %d Settings\n",
dev->target->channel + 'A', dev->target->target, dev->lun); sdev->sdev_target->channel + 'A',
sdev->sdev_target->id, sdev->lun);
copy_info(info, "\t\tCommands Queued %ld\n", dev->commands_issued); copy_info(info, "\t\tCommands Queued %ld\n", dev->commands_issued);
copy_info(info, "\t\tCommands Active %d\n", dev->active); copy_info(info, "\t\tCommands Active %d\n", dev->active);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment