Commit 9cd56c73 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by James Bottomley

[PATCH] convert inia100 to new probing API

Hi Doug,

you've been the last who touched inia100.c, so I may assume you
actually have the hardware?  I've updated the driver to the new
pci probing and scsi host registration code and it would be cool
if someone could test it so we could merge it into early 2.6.
parent 652490f0
......@@ -108,9 +108,6 @@ ORC_SCB *orc_alloc_scb(ORC_HCS * hcsp);
/* ---- EXTERNAL FUNCTIONS ---- */
extern void inia100SCBPost(BYTE * pHcb, BYTE * pScb);
/* ---- INTERNAL VARIABLES ---- */
struct inia100_Adpt_Struc *inia100_adpt;
NVRAM nvram, *nvramp = &nvram;
static UCHAR dftNvRam[64] =
{
......@@ -702,83 +699,6 @@ void orc_release_dma(ORC_HCS * hcsp, Scsi_Cmnd * SCpnt)
}
}
/*****************************************************************************
Function name : Addinia100_into_Adapter_table
Description : This function will scan PCI bus to get all Orchid card
Input : None.
Output : None.
Return : SUCCESSFUL - Successful scan
ohterwise - No drives founded
*****************************************************************************/
int Addinia100_into_Adapter_table(WORD wBIOS, WORD wBASE, struct pci_dev *pdev,
int iAdapters)
{
unsigned int i, j;
for (i = 0; i < iAdapters; i++) {
if (inia100_adpt[i].ADPT_BIOS < wBIOS)
continue;
if (inia100_adpt[i].ADPT_BIOS == wBIOS) {
if (inia100_adpt[i].ADPT_BASE == wBASE) {
if (inia100_adpt[i].ADPT_pdev->bus->number != 0xFF)
return (FAILURE);
} else if (inia100_adpt[i].ADPT_BASE < wBASE)
continue;
}
for (j = iAdapters - 1; j > i; j--) {
inia100_adpt[j].ADPT_BASE = inia100_adpt[j - 1].ADPT_BASE;
inia100_adpt[j].ADPT_BIOS = inia100_adpt[j - 1].ADPT_BIOS;
inia100_adpt[j].ADPT_pdev = inia100_adpt[j - 1].ADPT_pdev;
}
inia100_adpt[i].ADPT_BASE = wBASE;
inia100_adpt[i].ADPT_BIOS = wBIOS;
inia100_adpt[i].ADPT_pdev = pdev;
return (SUCCESSFUL);
}
return (FAILURE);
}
/*****************************************************************************
Function name : init_inia100Adapter_table
Description : This function will scan PCI bus to get all Orchid card
Input : None.
Output : None.
Return : 0 on success, 1 on failure
*****************************************************************************/
int init_inia100Adapter_table(int iAdapters)
{
int i;
inia100_adpt = kmalloc(sizeof(INIA100_ADPT_STRUCT) * iAdapters,
GFP_KERNEL);
if(inia100_adpt == NULL)
return 1;
for (i = 0; i < iAdapters; i++) {/* Initialize adapter structure */
inia100_adpt[i].ADPT_BIOS = 0xffff;
inia100_adpt[i].ADPT_BASE = 0xffff;
inia100_adpt[i].ADPT_pdev = NULL;
}
return 0;
}
/*****************************************************************************
Function name : get_orcPCIConfig
Description :
Input : pHCB - Pointer to host adapter structure
Output : None.
Return : pSRB - Pointer to SCSI request block.
*****************************************************************************/
void get_orcPCIConfig(ORC_HCS * pCurHcb, int ch_idx)
{
pCurHcb->HCS_Base = inia100_adpt[ch_idx].ADPT_BASE; /* Supply base address */
pCurHcb->HCS_BIOS = inia100_adpt[ch_idx].ADPT_BIOS; /* Supply BIOS address */
pCurHcb->HCS_Intr = inia100_adpt[ch_idx].ADPT_pdev->irq; /* Supply interrupt line */
return;
}
/*****************************************************************************
Function name : abort_SCB
Description : Abort a queued command.
......
This diff is collapsed.
......@@ -67,13 +67,6 @@
#include <linux/types.h>
#include <linux/pci.h>
static int inia100_detect(Scsi_Host_Template *);
static int inia100_release(struct Scsi_Host *);
static int inia100_queue(Scsi_Cmnd *, void (*done) (Scsi_Cmnd *));
static int inia100_abort(Scsi_Cmnd *);
static int inia100_device_reset(Scsi_Cmnd *);
static int inia100_bus_reset(Scsi_Cmnd *);
#define inia100_REVID "Initio INI-A100U2W SCSI device driver; Revision: 1.02d"
#define ULONG unsigned long
......@@ -115,13 +108,6 @@ typedef struct ORC_SG_Struc {
U32 SG_Len; /* Data Length */
} ORC_SG;
typedef struct inia100_Adpt_Struc {
UWORD ADPT_BIOS; /* 0 */
UWORD ADPT_BASE; /* 1 */
struct pci_dev *ADPT_pdev; /* 2 */
} INIA100_ADPT_STRUCT;
/* SCSI related definition */
#define DISC_NOT_ALLOW 0x80 /* Disconnect is not allowed */
#define DISC_ALLOW 0xC0 /* Disconnect is allowed */
......@@ -211,7 +197,7 @@ typedef struct inia100_Adpt_Struc {
typedef struct orc_extended_scb { /* Extended SCB */
ORC_SG ESCB_SGList[TOTAL_SG_ENTRY]; /*0 Start of SG list */
Scsi_Cmnd *SCB_Srb; /*50 SRB Pointer */
struct scsi_cmnd *SCB_Srb; /*50 SRB Pointer */
} ESCB;
/***********************************************************************
......@@ -344,8 +330,8 @@ typedef struct ORC_Ha_Ctrl_Struc {
ORC_TCS HCS_Tcs[16]; /* 28 */
U32 BitAllocFlag[MAX_CHANNELS][8]; /* Max STB is 256, So 256/32 */
spinlock_t BitAllocFlagLock;
Scsi_Cmnd *pSRB_head;
Scsi_Cmnd *pSRB_tail;
struct scsi_cmnd *pSRB_head;
struct scsi_cmnd *pSRB_tail;
spinlock_t pSRB_lock;
struct pci_dev *pdev;
} ORC_HCS;
......
This diff is collapsed.
......@@ -989,8 +989,6 @@ typedef enum { LOCK_INT, LOCK_EXT } lockscope_t;
const char *megaraid_info (struct Scsi_Host *);
static int megaraid_detect(Scsi_Host_Template *);
static void mega_find_card(Scsi_Host_Template *, u16, u16);
static int mega_query_adapter(adapter_t *);
static inline int issue_scb(adapter_t *, scb_t *);
static int mega_setup_mailbox(adapter_t *);
......@@ -1007,7 +1005,6 @@ static irqreturn_t megaraid_isr_iomapped(int, void *, struct pt_regs *);
static void mega_free_scb(adapter_t *, scb_t *);
static int megaraid_release (struct Scsi_Host *);
static int megaraid_abort(Scsi_Cmnd *);
static int megaraid_reset(Scsi_Cmnd *);
static int megaraid_abort_and_reset(adapter_t *, Scsi_Cmnd *, int);
......@@ -1025,8 +1022,6 @@ static inline void mega_free_sgl (adapter_t *adapter);
static void mega_8_to_40ld (mraid_inquiry *inquiry,
mega_inquiry3 *enquiry3, mega_product_info *);
static int megaraid_reboot_notify (struct notifier_block *,
unsigned long, void *);
static int megadev_open (struct inode *, struct file *);
static int megadev_ioctl (struct inode *, struct file *, unsigned int,
unsigned long);
......
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