convert inia100 to new probing API
Subsystems (2)
PATCH 1/1 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.
drivers/scsi/i60uscsi.c +0 -80
@@ -108,9 +108,6 @@/* ---- 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 ] = {
@@ -701,83 +698,6 @@ scsi_to_pci_dma_dir(SCpnt->sc_data_direction)); } } - -/***************************************************************************** -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
===== drivers/scsi/inia100.c 1.25 vs edited =====
drivers/scsi/inia100.c +194 -340
669 lines not on this page · raw message
===== drivers/scsi/inia100.h 1.16 vs edited =====
drivers/scsi/inia100.h +3 -17
@@ -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 @@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 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 @@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 ;
===== drivers/scsi/megaraid.c 1.56 vs edited =====
drivers/scsi/megaraid.c +550 -754
1,340 lines not on this page · raw message
===== drivers/scsi/megaraid.h 1.23 vs edited =====
drivers/scsi/megaraid.h +0 -5
@@ -989,8 +989,6 @@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 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 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 );