merge by hand (fix up qla_os.c merge error)
This commit is contained in:
@@ -44,109 +44,6 @@
|
||||
#include <linux/device.h>
|
||||
#include <linux/eisa.h>
|
||||
|
||||
#define EISA_MFCTR_CHAR0(ID) (char)(((ID>>26) & 0x1F) | '@') /* Bits 26-30 */
|
||||
#define EISA_MFCTR_CHAR1(ID) (char)(((ID>>21) & 0x1F) | '@') /* Bits 21-25 */
|
||||
#define EISA_MFCTR_CHAR2(ID) (char)(((ID>>16) & 0x1F) | '@') /* Bits 16-20 */
|
||||
#define EISA_PRODUCT_ID(ID) (short)((ID>>4) & 0xFFF) /* Bits 4-15 */
|
||||
#define EISA_REVISION_ID(ID) (uint8_t)(ID & 0x0F) /* Bits 0-3 */
|
||||
|
||||
static int aic7770_eisa_dev_probe(struct device *dev);
|
||||
static int aic7770_eisa_dev_remove(struct device *dev);
|
||||
static struct eisa_driver aic7770_driver = {
|
||||
.driver = {
|
||||
.name = "aic7xxx",
|
||||
.probe = aic7770_eisa_dev_probe,
|
||||
.remove = aic7770_eisa_dev_remove,
|
||||
}
|
||||
};
|
||||
|
||||
typedef struct device *aic7770_dev_t;
|
||||
|
||||
static int aic7770_linux_config(struct aic7770_identity *entry,
|
||||
aic7770_dev_t dev, u_int eisaBase);
|
||||
|
||||
int
|
||||
ahc_linux_eisa_init(void)
|
||||
{
|
||||
struct eisa_device_id *eid;
|
||||
struct aic7770_identity *id;
|
||||
int i;
|
||||
|
||||
if (aic7xxx_probe_eisa_vl == 0)
|
||||
return -ENODEV;
|
||||
|
||||
/*
|
||||
* Linux requires the EISA IDs to be specified in
|
||||
* the EISA ID string format. Perform the conversion
|
||||
* and setup a table with a NUL terminal entry.
|
||||
*/
|
||||
aic7770_driver.id_table = malloc(sizeof(struct eisa_device_id) *
|
||||
(ahc_num_aic7770_devs + 1),
|
||||
M_DEVBUF, M_NOWAIT);
|
||||
if (aic7770_driver.id_table == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
for (eid = (struct eisa_device_id *)aic7770_driver.id_table,
|
||||
id = aic7770_ident_table, i = 0;
|
||||
i < ahc_num_aic7770_devs; eid++, id++, i++) {
|
||||
|
||||
sprintf(eid->sig, "%c%c%c%03X%01X",
|
||||
EISA_MFCTR_CHAR0(id->full_id),
|
||||
EISA_MFCTR_CHAR1(id->full_id),
|
||||
EISA_MFCTR_CHAR2(id->full_id),
|
||||
EISA_PRODUCT_ID(id->full_id),
|
||||
EISA_REVISION_ID(id->full_id));
|
||||
eid->driver_data = i;
|
||||
}
|
||||
eid->sig[0] = 0;
|
||||
|
||||
return eisa_driver_register(&aic7770_driver);
|
||||
}
|
||||
|
||||
void
|
||||
ahc_linux_eisa_exit(void)
|
||||
{
|
||||
if(aic7xxx_probe_eisa_vl != 0 && aic7770_driver.id_table != NULL) {
|
||||
eisa_driver_unregister(&aic7770_driver);
|
||||
free(aic7770_driver.id_table, M_DEVBUF);
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
aic7770_linux_config(struct aic7770_identity *entry, aic7770_dev_t dev,
|
||||
u_int eisaBase)
|
||||
{
|
||||
struct ahc_softc *ahc;
|
||||
char buf[80];
|
||||
char *name;
|
||||
int error;
|
||||
|
||||
/*
|
||||
* Allocate a softc for this card and
|
||||
* set it up for attachment by our
|
||||
* common detect routine.
|
||||
*/
|
||||
sprintf(buf, "ahc_eisa:%d", eisaBase >> 12);
|
||||
name = malloc(strlen(buf) + 1, M_DEVBUF, M_NOWAIT);
|
||||
if (name == NULL)
|
||||
return (ENOMEM);
|
||||
strcpy(name, buf);
|
||||
ahc = ahc_alloc(&aic7xxx_driver_template, name);
|
||||
if (ahc == NULL)
|
||||
return (ENOMEM);
|
||||
error = aic7770_config(ahc, entry, eisaBase);
|
||||
if (error != 0) {
|
||||
ahc->bsh.ioport = 0;
|
||||
ahc_free(ahc);
|
||||
return (error);
|
||||
}
|
||||
|
||||
dev->driver_data = (void *)ahc;
|
||||
if (aic7xxx_detect_complete)
|
||||
error = ahc_linux_register_host(ahc, &aic7xxx_driver_template);
|
||||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
aic7770_map_registers(struct ahc_softc *ahc, u_int port)
|
||||
{
|
||||
@@ -178,37 +75,79 @@ aic7770_map_int(struct ahc_softc *ahc, u_int irq)
|
||||
}
|
||||
|
||||
static int
|
||||
aic7770_eisa_dev_probe(struct device *dev)
|
||||
aic7770_probe(struct device *dev)
|
||||
{
|
||||
struct eisa_device *edev;
|
||||
struct eisa_device *edev = to_eisa_device(dev);
|
||||
u_int eisaBase = edev->base_addr+AHC_EISA_SLOT_OFFSET;
|
||||
struct ahc_softc *ahc;
|
||||
char buf[80];
|
||||
char *name;
|
||||
int error;
|
||||
|
||||
edev = to_eisa_device(dev);
|
||||
return (aic7770_linux_config(aic7770_ident_table + edev->id.driver_data,
|
||||
dev, edev->base_addr+AHC_EISA_SLOT_OFFSET));
|
||||
sprintf(buf, "ahc_eisa:%d", eisaBase >> 12);
|
||||
name = malloc(strlen(buf) + 1, M_DEVBUF, M_NOWAIT);
|
||||
if (name == NULL)
|
||||
return (ENOMEM);
|
||||
strcpy(name, buf);
|
||||
ahc = ahc_alloc(&aic7xxx_driver_template, name);
|
||||
if (ahc == NULL)
|
||||
return (ENOMEM);
|
||||
error = aic7770_config(ahc, aic7770_ident_table + edev->id.driver_data,
|
||||
eisaBase);
|
||||
if (error != 0) {
|
||||
ahc->bsh.ioport = 0;
|
||||
ahc_free(ahc);
|
||||
return (error);
|
||||
}
|
||||
|
||||
dev_set_drvdata(dev, ahc);
|
||||
|
||||
if (aic7xxx_detect_complete)
|
||||
error = ahc_linux_register_host(ahc, &aic7xxx_driver_template);
|
||||
return (error);
|
||||
}
|
||||
|
||||
static int
|
||||
aic7770_eisa_dev_remove(struct device *dev)
|
||||
aic7770_remove(struct device *dev)
|
||||
{
|
||||
struct ahc_softc *ahc;
|
||||
u_long l;
|
||||
struct ahc_softc *ahc = dev_get_drvdata(dev);
|
||||
u_long s;
|
||||
|
||||
/*
|
||||
* We should be able to just perform
|
||||
* the free directly, but check our
|
||||
* list for extra sanity.
|
||||
*/
|
||||
ahc_list_lock(&l);
|
||||
ahc = ahc_find_softc((struct ahc_softc *)dev->driver_data);
|
||||
if (ahc != NULL) {
|
||||
u_long s;
|
||||
ahc_lock(ahc, &s);
|
||||
ahc_intr_enable(ahc, FALSE);
|
||||
ahc_unlock(ahc, &s);
|
||||
|
||||
ahc_lock(ahc, &s);
|
||||
ahc_intr_enable(ahc, FALSE);
|
||||
ahc_unlock(ahc, &s);
|
||||
ahc_free(ahc);
|
||||
}
|
||||
ahc_list_unlock(&l);
|
||||
|
||||
return (0);
|
||||
ahc_free(ahc);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct eisa_device_id aic7770_ids[] = {
|
||||
{ "ADP7771", 0 }, /* AHA 274x */
|
||||
{ "ADP7756", 1 }, /* AHA 284x BIOS enabled */
|
||||
{ "ADP7757", 2 }, /* AHA 284x BIOS disabled */
|
||||
{ "ADP7782", 3 }, /* AHA 274x Olivetti OEM */
|
||||
{ "ADP7783", 4 }, /* AHA 274x Olivetti OEM (Differential) */
|
||||
{ "ADP7770", 5 }, /* AIC7770 generic */
|
||||
{ "" }
|
||||
};
|
||||
|
||||
static struct eisa_driver aic7770_driver = {
|
||||
.id_table = aic7770_ids,
|
||||
.driver = {
|
||||
.name = "aic7xxx",
|
||||
.probe = aic7770_probe,
|
||||
.remove = aic7770_remove,
|
||||
}
|
||||
};
|
||||
|
||||
int
|
||||
ahc_linux_eisa_init(void)
|
||||
{
|
||||
return eisa_driver_register(&aic7770_driver);
|
||||
}
|
||||
|
||||
void
|
||||
ahc_linux_eisa_exit(void)
|
||||
{
|
||||
eisa_driver_unregister(&aic7770_driver);
|
||||
}
|
||||
|
@@ -941,7 +941,7 @@ ahd_linux_queue(Scsi_Cmnd * cmd, void (*scsi_done) (Scsi_Cmnd *))
|
||||
*/
|
||||
cmd->scsi_done = scsi_done;
|
||||
|
||||
ahd_midlayer_entrypoint_lock(ahd, &flags);
|
||||
ahd_lock(ahd, &flags);
|
||||
|
||||
/*
|
||||
* Close the race of a command that was in the process of
|
||||
@@ -955,7 +955,7 @@ ahd_linux_queue(Scsi_Cmnd * cmd, void (*scsi_done) (Scsi_Cmnd *))
|
||||
ahd_cmd_set_transaction_status(cmd, CAM_REQUEUE_REQ);
|
||||
ahd_linux_queue_cmd_complete(ahd, cmd);
|
||||
ahd_schedule_completeq(ahd);
|
||||
ahd_midlayer_entrypoint_unlock(ahd, &flags);
|
||||
ahd_unlock(ahd, &flags);
|
||||
return (0);
|
||||
}
|
||||
dev = ahd_linux_get_device(ahd, cmd->device->channel,
|
||||
@@ -965,7 +965,7 @@ ahd_linux_queue(Scsi_Cmnd * cmd, void (*scsi_done) (Scsi_Cmnd *))
|
||||
ahd_cmd_set_transaction_status(cmd, CAM_RESRC_UNAVAIL);
|
||||
ahd_linux_queue_cmd_complete(ahd, cmd);
|
||||
ahd_schedule_completeq(ahd);
|
||||
ahd_midlayer_entrypoint_unlock(ahd, &flags);
|
||||
ahd_unlock(ahd, &flags);
|
||||
printf("%s: aic79xx_linux_queue - Unable to allocate device!\n",
|
||||
ahd_name(ahd));
|
||||
return (0);
|
||||
@@ -979,7 +979,7 @@ ahd_linux_queue(Scsi_Cmnd * cmd, void (*scsi_done) (Scsi_Cmnd *))
|
||||
dev->flags |= AHD_DEV_ON_RUN_LIST;
|
||||
ahd_linux_run_device_queues(ahd);
|
||||
}
|
||||
ahd_midlayer_entrypoint_unlock(ahd, &flags);
|
||||
ahd_unlock(ahd, &flags);
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -1511,17 +1511,17 @@ ahd_linux_dev_reset(Scsi_Cmnd *cmd)
|
||||
ahd_name(ahd), cmd->device->channel, cmd->device->id,
|
||||
cmd->device->lun, cmd);
|
||||
#endif
|
||||
ahd_midlayer_entrypoint_lock(ahd, &s);
|
||||
ahd_lock(ahd, &s);
|
||||
|
||||
dev = ahd_linux_get_device(ahd, cmd->device->channel, cmd->device->id,
|
||||
cmd->device->lun, /*alloc*/FALSE);
|
||||
if (dev == NULL) {
|
||||
ahd_midlayer_entrypoint_unlock(ahd, &s);
|
||||
ahd_unlock(ahd, &s);
|
||||
kfree(recovery_cmd);
|
||||
return (FAILED);
|
||||
}
|
||||
if ((scb = ahd_get_scb(ahd, AHD_NEVER_COL_IDX)) == NULL) {
|
||||
ahd_midlayer_entrypoint_unlock(ahd, &s);
|
||||
ahd_unlock(ahd, &s);
|
||||
kfree(recovery_cmd);
|
||||
return (FAILED);
|
||||
}
|
||||
@@ -1570,7 +1570,7 @@ ahd_linux_dev_reset(Scsi_Cmnd *cmd)
|
||||
spin_lock_irq(&ahd->platform_data->spin_lock);
|
||||
ahd_schedule_runq(ahd);
|
||||
ahd_linux_run_complete_queue(ahd);
|
||||
ahd_midlayer_entrypoint_unlock(ahd, &s);
|
||||
ahd_unlock(ahd, &s);
|
||||
printf("%s: Device reset returning 0x%x\n", ahd_name(ahd), retval);
|
||||
return (retval);
|
||||
}
|
||||
@@ -1591,11 +1591,11 @@ ahd_linux_bus_reset(Scsi_Cmnd *cmd)
|
||||
printf("%s: Bus reset called for cmd %p\n",
|
||||
ahd_name(ahd), cmd);
|
||||
#endif
|
||||
ahd_midlayer_entrypoint_lock(ahd, &s);
|
||||
ahd_lock(ahd, &s);
|
||||
found = ahd_reset_channel(ahd, cmd->device->channel + 'A',
|
||||
/*initiate reset*/TRUE);
|
||||
ahd_linux_run_complete_queue(ahd);
|
||||
ahd_midlayer_entrypoint_unlock(ahd, &s);
|
||||
ahd_unlock(ahd, &s);
|
||||
|
||||
if (bootverbose)
|
||||
printf("%s: SCSI bus reset delivered. "
|
||||
|
@@ -112,23 +112,6 @@ typedef Scsi_Cmnd *ahd_io_ctx_t;
|
||||
#define ahd_le32toh(x) le32_to_cpu(x)
|
||||
#define ahd_le64toh(x) le64_to_cpu(x)
|
||||
|
||||
#ifndef LITTLE_ENDIAN
|
||||
#define LITTLE_ENDIAN 1234
|
||||
#endif
|
||||
|
||||
#ifndef BIG_ENDIAN
|
||||
#define BIG_ENDIAN 4321
|
||||
#endif
|
||||
|
||||
#ifndef BYTE_ORDER
|
||||
#if defined(__BIG_ENDIAN)
|
||||
#define BYTE_ORDER BIG_ENDIAN
|
||||
#endif
|
||||
#if defined(__LITTLE_ENDIAN)
|
||||
#define BYTE_ORDER LITTLE_ENDIAN
|
||||
#endif
|
||||
#endif /* BYTE_ORDER */
|
||||
|
||||
/************************* Configuration Data *********************************/
|
||||
extern uint32_t aic79xx_allow_memio;
|
||||
extern int aic79xx_detect_complete;
|
||||
|
@@ -346,7 +346,6 @@ typedef enum {
|
||||
* controller.
|
||||
*/
|
||||
AHC_NEWEEPROM_FMT = 0x4000,
|
||||
AHC_RESOURCE_SHORTAGE = 0x8000,
|
||||
AHC_TQINFIFO_BLOCKED = 0x10000, /* Blocked waiting for ATIOs */
|
||||
AHC_INT50_SPEEDFLEX = 0x20000, /*
|
||||
* Internal 50pin connector
|
||||
@@ -1200,7 +1199,6 @@ void ahc_pause_and_flushwork(struct ahc_softc *ahc);
|
||||
int ahc_suspend(struct ahc_softc *ahc);
|
||||
int ahc_resume(struct ahc_softc *ahc);
|
||||
void ahc_softc_insert(struct ahc_softc *);
|
||||
struct ahc_softc *ahc_find_softc(struct ahc_softc *ahc);
|
||||
void ahc_set_unit(struct ahc_softc *, int);
|
||||
void ahc_set_name(struct ahc_softc *, char *);
|
||||
void ahc_alloc_scbs(struct ahc_softc *ahc);
|
||||
|
@@ -3934,22 +3934,6 @@ ahc_softc_insert(struct ahc_softc *ahc)
|
||||
ahc->init_level++;
|
||||
}
|
||||
|
||||
/*
|
||||
* Verify that the passed in softc pointer is for a
|
||||
* controller that is still configured.
|
||||
*/
|
||||
struct ahc_softc *
|
||||
ahc_find_softc(struct ahc_softc *ahc)
|
||||
{
|
||||
struct ahc_softc *list_ahc;
|
||||
|
||||
TAILQ_FOREACH(list_ahc, &ahc_tailq, links) {
|
||||
if (list_ahc == ahc)
|
||||
return (ahc);
|
||||
}
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
void
|
||||
ahc_set_unit(struct ahc_softc *ahc, int unit)
|
||||
{
|
||||
|
파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
Load Diff
@@ -79,6 +79,8 @@
|
||||
#include <scsi/scsi_device.h>
|
||||
#include <scsi/scsi_host.h>
|
||||
#include <scsi/scsi_tcq.h>
|
||||
#include <scsi/scsi_transport.h>
|
||||
#include <scsi/scsi_transport_spi.h>
|
||||
|
||||
/* Core SCSI definitions */
|
||||
#define AIC_LIB_PREFIX ahc
|
||||
@@ -127,23 +129,6 @@ typedef struct scsi_cmnd *ahc_io_ctx_t;
|
||||
#define ahc_le32toh(x) le32_to_cpu(x)
|
||||
#define ahc_le64toh(x) le64_to_cpu(x)
|
||||
|
||||
#ifndef LITTLE_ENDIAN
|
||||
#define LITTLE_ENDIAN 1234
|
||||
#endif
|
||||
|
||||
#ifndef BIG_ENDIAN
|
||||
#define BIG_ENDIAN 4321
|
||||
#endif
|
||||
|
||||
#ifndef BYTE_ORDER
|
||||
#if defined(__BIG_ENDIAN)
|
||||
#define BYTE_ORDER BIG_ENDIAN
|
||||
#endif
|
||||
#if defined(__LITTLE_ENDIAN)
|
||||
#define BYTE_ORDER LITTLE_ENDIAN
|
||||
#endif
|
||||
#endif /* BYTE_ORDER */
|
||||
|
||||
/************************* Configuration Data *********************************/
|
||||
extern u_int aic7xxx_no_probe;
|
||||
extern u_int aic7xxx_allow_memio;
|
||||
@@ -283,35 +268,6 @@ ahc_scb_timer_reset(struct scb *scb, u_int usec)
|
||||
|
||||
#define AIC7XXX_DRIVER_VERSION "6.2.36"
|
||||
|
||||
/**************************** Front End Queues ********************************/
|
||||
/*
|
||||
* Data structure used to cast the Linux struct scsi_cmnd to something
|
||||
* that allows us to use the queue macros. The linux structure has
|
||||
* plenty of space to hold the links fields as required by the queue
|
||||
* macros, but the queue macors require them to have the correct type.
|
||||
*/
|
||||
struct ahc_cmd_internal {
|
||||
/* Area owned by the Linux scsi layer. */
|
||||
uint8_t private[offsetof(struct scsi_cmnd, SCp.Status)];
|
||||
union {
|
||||
STAILQ_ENTRY(ahc_cmd) ste;
|
||||
LIST_ENTRY(ahc_cmd) le;
|
||||
TAILQ_ENTRY(ahc_cmd) tqe;
|
||||
} links;
|
||||
uint32_t end;
|
||||
};
|
||||
|
||||
struct ahc_cmd {
|
||||
union {
|
||||
struct ahc_cmd_internal icmd;
|
||||
struct scsi_cmnd scsi_cmd;
|
||||
} un;
|
||||
};
|
||||
|
||||
#define acmd_icmd(cmd) ((cmd)->un.icmd)
|
||||
#define acmd_scsi_cmd(cmd) ((cmd)->un.scsi_cmd)
|
||||
#define acmd_links un.icmd.links
|
||||
|
||||
/*************************** Device Data Structures ***************************/
|
||||
/*
|
||||
* A per probed device structure used to deal with some error recovery
|
||||
@@ -320,7 +276,6 @@ struct ahc_cmd {
|
||||
* after a successfully completed inquiry command to the target when
|
||||
* that inquiry data indicates a lun is present.
|
||||
*/
|
||||
TAILQ_HEAD(ahc_busyq, ahc_cmd);
|
||||
typedef enum {
|
||||
AHC_DEV_FREEZE_TIL_EMPTY = 0x02, /* Freeze queue until active == 0 */
|
||||
AHC_DEV_Q_BASIC = 0x10, /* Allow basic device queuing */
|
||||
@@ -330,8 +285,6 @@ typedef enum {
|
||||
|
||||
struct ahc_linux_target;
|
||||
struct ahc_linux_device {
|
||||
TAILQ_ENTRY(ahc_linux_device) links;
|
||||
|
||||
/*
|
||||
* The number of transactions currently
|
||||
* queued to the device.
|
||||
@@ -401,17 +354,10 @@ struct ahc_linux_device {
|
||||
*/
|
||||
u_int commands_since_idle_or_otag;
|
||||
#define AHC_OTAG_THRESH 500
|
||||
|
||||
int lun;
|
||||
struct scsi_device *scsi_device;
|
||||
struct ahc_linux_target *target;
|
||||
};
|
||||
|
||||
struct ahc_linux_target {
|
||||
struct ahc_linux_device *devices[AHC_NUM_LUNS];
|
||||
int channel;
|
||||
int target;
|
||||
int refcount;
|
||||
struct scsi_device *sdev[AHC_NUM_LUNS];
|
||||
struct ahc_transinfo last_tinfo;
|
||||
struct ahc_softc *ahc;
|
||||
};
|
||||
@@ -445,7 +391,7 @@ struct ahc_platform_data {
|
||||
/*
|
||||
* Fields accessed from interrupt context.
|
||||
*/
|
||||
struct ahc_linux_target *targets[AHC_NUM_TARGETS];
|
||||
struct scsi_target *starget[AHC_NUM_TARGETS];
|
||||
|
||||
spinlock_t spin_lock;
|
||||
u_int qfrozen;
|
||||
@@ -659,7 +605,6 @@ typedef enum
|
||||
|
||||
/**************************** VL/EISA Routines ********************************/
|
||||
#ifdef CONFIG_EISA
|
||||
extern uint32_t aic7xxx_probe_eisa_vl;
|
||||
int ahc_linux_eisa_init(void);
|
||||
void ahc_linux_eisa_exit(void);
|
||||
int aic7770_map_registers(struct ahc_softc *ahc,
|
||||
@@ -924,7 +869,6 @@ ahc_notify_xfer_settings_change(struct ahc_softc *ahc,
|
||||
static __inline void
|
||||
ahc_platform_scb_free(struct ahc_softc *ahc, struct scb *scb)
|
||||
{
|
||||
ahc->flags &= ~AHC_RESOURCE_SHORTAGE;
|
||||
}
|
||||
|
||||
int ahc_platform_alloc(struct ahc_softc *ahc, void *platform_arg);
|
||||
|
@@ -140,27 +140,17 @@ struct pci_driver aic7xxx_pci_driver = {
|
||||
static void
|
||||
ahc_linux_pci_dev_remove(struct pci_dev *pdev)
|
||||
{
|
||||
struct ahc_softc *ahc;
|
||||
u_long l;
|
||||
struct ahc_softc *ahc = pci_get_drvdata(pdev);
|
||||
u_long s;
|
||||
|
||||
/*
|
||||
* We should be able to just perform
|
||||
* the free directly, but check our
|
||||
* list for extra sanity.
|
||||
*/
|
||||
ahc_list_lock(&l);
|
||||
ahc = ahc_find_softc((struct ahc_softc *)pci_get_drvdata(pdev));
|
||||
if (ahc != NULL) {
|
||||
u_long s;
|
||||
ahc_list_lock(&s);
|
||||
TAILQ_REMOVE(&ahc_tailq, ahc, links);
|
||||
ahc_list_unlock(&s);
|
||||
|
||||
TAILQ_REMOVE(&ahc_tailq, ahc, links);
|
||||
ahc_list_unlock(&l);
|
||||
ahc_lock(ahc, &s);
|
||||
ahc_intr_enable(ahc, FALSE);
|
||||
ahc_unlock(ahc, &s);
|
||||
ahc_free(ahc);
|
||||
} else
|
||||
ahc_list_unlock(&l);
|
||||
ahc_lock(ahc, &s);
|
||||
ahc_intr_enable(ahc, FALSE);
|
||||
ahc_unlock(ahc, &s);
|
||||
ahc_free(ahc);
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -174,22 +164,6 @@ ahc_linux_pci_dev_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
char *name;
|
||||
int error;
|
||||
|
||||
/*
|
||||
* Some BIOSen report the same device multiple times.
|
||||
*/
|
||||
TAILQ_FOREACH(ahc, &ahc_tailq, links) {
|
||||
struct pci_dev *probed_pdev;
|
||||
|
||||
probed_pdev = ahc->dev_softc;
|
||||
if (probed_pdev->bus->number == pdev->bus->number
|
||||
&& probed_pdev->devfn == pdev->devfn)
|
||||
break;
|
||||
}
|
||||
if (ahc != NULL) {
|
||||
/* Skip duplicate. */
|
||||
return (-ENODEV);
|
||||
}
|
||||
|
||||
pci = pdev;
|
||||
entry = ahc_find_pci_device(pci);
|
||||
if (entry == NULL)
|
||||
|
@@ -50,7 +50,7 @@ static void ahc_dump_target_state(struct ahc_softc *ahc,
|
||||
u_int our_id, char channel,
|
||||
u_int target_id, u_int target_offset);
|
||||
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,
|
||||
char *buffer, int length);
|
||||
|
||||
@@ -142,6 +142,7 @@ ahc_dump_target_state(struct ahc_softc *ahc, struct info_str *info,
|
||||
u_int target_offset)
|
||||
{
|
||||
struct ahc_linux_target *targ;
|
||||
struct scsi_target *starget;
|
||||
struct ahc_initiator_tinfo *tinfo;
|
||||
struct ahc_tmode_tstate *tstate;
|
||||
int lun;
|
||||
@@ -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, "\tUser: ");
|
||||
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)
|
||||
return;
|
||||
|
||||
@@ -163,22 +165,25 @@ ahc_dump_target_state(struct ahc_softc *ahc, struct info_str *info,
|
||||
ahc_format_transinfo(info, &tinfo->curr);
|
||||
|
||||
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;
|
||||
|
||||
ahc_dump_device_state(info, dev);
|
||||
ahc_dump_device_state(info, sdev);
|
||||
}
|
||||
}
|
||||
|
||||
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",
|
||||
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 Active %d\n", dev->active);
|
||||
@@ -292,20 +297,13 @@ int
|
||||
ahc_linux_proc_info(struct Scsi_Host *shost, char *buffer, char **start,
|
||||
off_t offset, int length, int inout)
|
||||
{
|
||||
struct ahc_softc *ahc;
|
||||
struct ahc_softc *ahc = *(struct ahc_softc **)shost->hostdata;
|
||||
struct info_str info;
|
||||
char ahc_info[256];
|
||||
u_long s;
|
||||
u_int max_targ;
|
||||
u_int i;
|
||||
int retval;
|
||||
|
||||
retval = -EINVAL;
|
||||
ahc_list_lock(&s);
|
||||
ahc = ahc_find_softc(*(struct ahc_softc **)shost->hostdata);
|
||||
if (ahc == NULL)
|
||||
goto done;
|
||||
|
||||
/* Has data been written to the file? */
|
||||
if (inout == TRUE) {
|
||||
retval = ahc_proc_write_seeprom(ahc, buffer, length);
|
||||
@@ -367,6 +365,5 @@ ahc_linux_proc_info(struct Scsi_Host *shost, char *buffer, char **start,
|
||||
}
|
||||
retval = info.pos > info.offset ? info.pos - info.offset : 0;
|
||||
done:
|
||||
ahc_list_unlock(&s);
|
||||
return (retval);
|
||||
}
|
||||
|
Reference in New Issue
Block a user