Commit 6d388419 authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by James Bottomley

[PATCH] tmscsim: trivial updates

Here comes the next (trivial) patch. I just want to get it out of the way
to make the next (scary) patch smaller and simpler. This one doesn't
modify the object code either. Actually, well, it does - it makes a few
objects, that were previously declared extern static. And removes a couple
more defines.
parent a6e0b36c
...@@ -33,11 +33,11 @@ ...@@ -33,11 +33,11 @@
# define USE_NEW_EH # define USE_NEW_EH
#endif #endif
extern int DC390_detect(Scsi_Host_Template *psht); static int DC390_detect(Scsi_Host_Template *psht);
extern int DC390_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *)); static int DC390_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *));
extern int DC390_abort(Scsi_Cmnd *cmd); static int DC390_abort(Scsi_Cmnd *cmd);
extern int DC390_reset(Scsi_Cmnd *cmd); static int DC390_reset(Scsi_Cmnd *cmd);
extern int DC390_bios_param(struct scsi_device *sdev, struct block_device *dev, static int DC390_bios_param(struct scsi_device *sdev, struct block_device *dev,
sector_t capacity, int geom[]); sector_t capacity, int geom[]);
static int DC390_release(struct Scsi_Host *); static int DC390_release(struct Scsi_Host *);
......
...@@ -15,7 +15,7 @@ dc390_freetag (PDCB pDCB, PSRB pSRB) ...@@ -15,7 +15,7 @@ dc390_freetag (PDCB pDCB, PSRB pSRB)
}; };
UCHAR static UCHAR
dc390_StartSCSI( PACB pACB, PDCB pDCB, PSRB pSRB ) dc390_StartSCSI( PACB pACB, PDCB pDCB, PSRB pSRB )
{ {
UCHAR cmd; UCHAR disc_allowed, try_sync_nego; UCHAR cmd; UCHAR disc_allowed, try_sync_nego;
...@@ -336,7 +336,7 @@ DC390_Interrupt( int irq, void *dev_id, struct pt_regs *regs) ...@@ -336,7 +336,7 @@ DC390_Interrupt( int irq, void *dev_id, struct pt_regs *regs)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
irqreturn_t do_DC390_Interrupt( int irq, void *dev_id, struct pt_regs *regs) static irqreturn_t do_DC390_Interrupt( int irq, void *dev_id, struct pt_regs *regs)
{ {
irqreturn_t ret; irqreturn_t ret;
DEBUG1(printk (KERN_INFO "DC390: Irq (%i) caught: ", irq)); DEBUG1(printk (KERN_INFO "DC390: Irq (%i) caught: ", irq));
...@@ -346,7 +346,7 @@ irqreturn_t do_DC390_Interrupt( int irq, void *dev_id, struct pt_regs *regs) ...@@ -346,7 +346,7 @@ irqreturn_t do_DC390_Interrupt( int irq, void *dev_id, struct pt_regs *regs)
return ret; return ret;
} }
void static void
dc390_DataOut_0( PACB pACB, PSRB pSRB, PUCHAR psstatus) dc390_DataOut_0( PACB pACB, PSRB pSRB, PUCHAR psstatus)
{ {
UCHAR sstatus; UCHAR sstatus;
...@@ -400,7 +400,7 @@ dc390_DataOut_0( PACB pACB, PSRB pSRB, PUCHAR psstatus) ...@@ -400,7 +400,7 @@ dc390_DataOut_0( PACB pACB, PSRB pSRB, PUCHAR psstatus)
} }
} }
void static void
dc390_DataIn_0( PACB pACB, PSRB pSRB, PUCHAR psstatus) dc390_DataIn_0( PACB pACB, PSRB pSRB, PUCHAR psstatus)
{ {
UCHAR sstatus, residual, bval; UCHAR sstatus, residual, bval;
...@@ -863,7 +863,7 @@ dc390_MsgIn_0( PACB pACB, PSRB pSRB, PUCHAR psstatus) ...@@ -863,7 +863,7 @@ dc390_MsgIn_0( PACB pACB, PSRB pSRB, PUCHAR psstatus)
} }
void static void
dc390_DataIO_Comm( PACB pACB, PSRB pSRB, UCHAR ioDir) dc390_DataIO_Comm( PACB pACB, PSRB pSRB, UCHAR ioDir)
{ {
PSGL psgl; PSGL psgl;
......
...@@ -283,14 +283,8 @@ MODULE_DEVICE_TABLE(pci, tmscsim_pci_tbl); ...@@ -283,14 +283,8 @@ MODULE_DEVICE_TABLE(pci, tmscsim_pci_tbl);
#define USE_SPINLOCKS 1 #define USE_SPINLOCKS 1
#define DC390_IFLAGS unsigned long iflags #define DC390_IFLAGS unsigned long iflags
#define DC390_DFLAGS unsigned long dflags
spinlock_t dc390_drvlock = SPIN_LOCK_UNLOCKED;
#define DC390_LOCK_IO(dev) spin_lock_irqsave (((struct Scsi_Host *)dev)->host_lock, iflags) #define DC390_LOCK_IO(dev) spin_lock_irqsave (((struct Scsi_Host *)dev)->host_lock, iflags)
#define DC390_UNLOCK_IO(dev) spin_unlock_irqrestore (((struct Scsi_Host *)dev)->host_lock, iflags) #define DC390_UNLOCK_IO(dev) spin_unlock_irqrestore (((struct Scsi_Host *)dev)->host_lock, iflags)
#define DC390_LOCK_DRV spin_lock_irqsave (&dc390_drvlock, dflags)
#define DC390_UNLOCK_DRV spin_unlock_irqrestore (&dc390_drvlock, dflags)
#define DC390_LOCK_DRV_NI spin_lock (&dc390_drvlock)
#define DC390_UNLOCK_DRV_NI spin_unlock (&dc390_drvlock)
/* These macros are used for uniform access to 2.0.x and 2.1.x PCI config space*/ /* These macros are used for uniform access to 2.0.x and 2.1.x PCI config space*/
...@@ -304,10 +298,7 @@ spinlock_t dc390_drvlock = SPIN_LOCK_UNLOCKED; ...@@ -304,10 +298,7 @@ spinlock_t dc390_drvlock = SPIN_LOCK_UNLOCKED;
#define PCI_READ_CONFIG_BYTE(pd, rv, bv) pci_read_config_byte (pd, rv, bv) #define PCI_READ_CONFIG_BYTE(pd, rv, bv) pci_read_config_byte (pd, rv, bv)
#define PCI_WRITE_CONFIG_WORD(pd, rv, bv) pci_write_config_word (pd, rv, bv) #define PCI_WRITE_CONFIG_WORD(pd, rv, bv) pci_write_config_word (pd, rv, bv)
#define PCI_READ_CONFIG_WORD(pd, rv, bv) pci_read_config_word (pd, rv, bv) #define PCI_READ_CONFIG_WORD(pd, rv, bv) pci_read_config_word (pd, rv, bv)
#define PCI_BUS_DEV pdev->bus->number, pdev->devfn
#define PCI_PRESENT (1) #define PCI_PRESENT (1)
#define PCI_SET_MASTER pci_set_master (pdev)
#define PCI_FIND_DEVICE(vend, id) (pdev = pci_find_device (vend, id, pdev))
#define PCI_GET_IO_AND_IRQ do{io_port = pci_resource_start (pdev, 0); irq = pdev->irq;} while(0) #define PCI_GET_IO_AND_IRQ do{io_port = pci_resource_start (pdev, 0); irq = pdev->irq;} while(0)
#include "tmscsim.h" #include "tmscsim.h"
...@@ -316,38 +307,38 @@ spinlock_t dc390_drvlock = SPIN_LOCK_UNLOCKED; ...@@ -316,38 +307,38 @@ spinlock_t dc390_drvlock = SPIN_LOCK_UNLOCKED;
# define __init # define __init
#endif #endif
UCHAR dc390_StartSCSI( PACB pACB, PDCB pDCB, PSRB pSRB ); static UCHAR dc390_StartSCSI( PACB pACB, PDCB pDCB, PSRB pSRB );
void dc390_DataOut_0( PACB pACB, PSRB pSRB, PUCHAR psstatus); static void dc390_DataOut_0( PACB pACB, PSRB pSRB, PUCHAR psstatus);
void dc390_DataIn_0( PACB pACB, PSRB pSRB, PUCHAR psstatus); static void dc390_DataIn_0( PACB pACB, PSRB pSRB, PUCHAR psstatus);
static void dc390_Command_0( PACB pACB, PSRB pSRB, PUCHAR psstatus); static void dc390_Command_0( PACB pACB, PSRB pSRB, PUCHAR psstatus);
static void dc390_Status_0( PACB pACB, PSRB pSRB, PUCHAR psstatus); static void dc390_Status_0( PACB pACB, PSRB pSRB, PUCHAR psstatus);
static void dc390_MsgOut_0( PACB pACB, PSRB pSRB, PUCHAR psstatus); static void dc390_MsgOut_0( PACB pACB, PSRB pSRB, PUCHAR psstatus);
void dc390_MsgIn_0( PACB pACB, PSRB pSRB, PUCHAR psstatus); static void dc390_MsgIn_0( PACB pACB, PSRB pSRB, PUCHAR psstatus);
static void dc390_DataOutPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus); static void dc390_DataOutPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus);
static void dc390_DataInPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus); static void dc390_DataInPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus);
void dc390_CommandPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus); static void dc390_CommandPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus);
static void dc390_StatusPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus); static void dc390_StatusPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus);
void dc390_MsgOutPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus); static void dc390_MsgOutPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus);
static void dc390_MsgInPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus); static void dc390_MsgInPhase( PACB pACB, PSRB pSRB, PUCHAR psstatus);
static void dc390_Nop_0( PACB pACB, PSRB pSRB, PUCHAR psstatus); static void dc390_Nop_0( PACB pACB, PSRB pSRB, PUCHAR psstatus);
static void dc390_Nop_1( PACB pACB, PSRB pSRB, PUCHAR psstatus); static void dc390_Nop_1( PACB pACB, PSRB pSRB, PUCHAR psstatus);
static void dc390_SetXferRate( PACB pACB, PDCB pDCB ); static void dc390_SetXferRate( PACB pACB, PDCB pDCB );
void dc390_Disconnect( PACB pACB ); static void dc390_Disconnect( PACB pACB );
void dc390_Reselect( PACB pACB ); static void dc390_Reselect( PACB pACB );
void dc390_SRBdone( PACB pACB, PDCB pDCB, PSRB pSRB ); static void dc390_SRBdone( PACB pACB, PDCB pDCB, PSRB pSRB );
void dc390_DoingSRB_Done( PACB pACB, PSCSICMD cmd ); static void dc390_DoingSRB_Done( PACB pACB, PSCSICMD cmd );
static void dc390_ScsiRstDetect( PACB pACB ); static void dc390_ScsiRstDetect( PACB pACB );
static void dc390_ResetSCSIBus( PACB pACB ); static void dc390_ResetSCSIBus( PACB pACB );
static void __inline__ dc390_RequestSense( PACB pACB, PDCB pDCB, PSRB pSRB ); static void __inline__ dc390_RequestSense( PACB pACB, PDCB pDCB, PSRB pSRB );
static void __inline__ dc390_InvalidCmd( PACB pACB ); static void __inline__ dc390_InvalidCmd( PACB pACB );
static void __inline__ dc390_EnableMsgOut_Abort (PACB, PSRB); static void __inline__ dc390_EnableMsgOut_Abort (PACB, PSRB);
static void dc390_remove_dev (PACB pACB, PDCB pDCB); static void dc390_remove_dev (PACB pACB, PDCB pDCB);
irqreturn_t do_DC390_Interrupt( int, void *, struct pt_regs *); static irqreturn_t do_DC390_Interrupt( int, void *, struct pt_regs *);
int dc390_initAdapter( PSH psh, ULONG io_port, UCHAR Irq, UCHAR index ); static int dc390_initAdapter( PSH psh, ULONG io_port, UCHAR Irq, UCHAR index );
void dc390_initDCB( PACB pACB, PDCB *ppDCB, UCHAR id, UCHAR lun); static void dc390_initDCB( PACB pACB, PDCB *ppDCB, UCHAR id, UCHAR lun);
void dc390_updateDCB (PACB pACB, PDCB pDCB); static void dc390_updateDCB (PACB pACB, PDCB pDCB);
static int DC390_release(struct Scsi_Host *host); static int DC390_release(struct Scsi_Host *host);
static int dc390_shutdown (struct Scsi_Host *host); static int dc390_shutdown (struct Scsi_Host *host);
...@@ -359,7 +350,7 @@ static UINT dc390_laststatus = 0; ...@@ -359,7 +350,7 @@ static UINT dc390_laststatus = 0;
static UCHAR dc390_adapterCnt = 0; static UCHAR dc390_adapterCnt = 0;
/* Startup values, to be overriden on the commandline */ /* Startup values, to be overriden on the commandline */
int tmscsim[] = {-2, -2, -2, -2, -2, -2}; static int tmscsim[] = {-2, -2, -2, -2, -2, -2};
#if defined(MODULE) #if defined(MODULE)
MODULE_PARM(tmscsim, "1-6i"); MODULE_PARM(tmscsim, "1-6i");
...@@ -422,15 +413,15 @@ static char* dc390_p1_str[] = { ...@@ -422,15 +413,15 @@ static char* dc390_p1_str[] = {
#endif #endif
/* Devices erroneously pretending to be able to do TagQ */ /* Devices erroneously pretending to be able to do TagQ */
UCHAR dc390_baddevname1[2][28] ={ static UCHAR dc390_baddevname1[2][28] ={
"SEAGATE ST3390N 9546", "SEAGATE ST3390N 9546",
"HP C3323-300 4269"}; "HP C3323-300 4269"};
#define BADDEVCNT 2 #define BADDEVCNT 2
static char* dc390_adapname = "DC390"; static char* dc390_adapname = "DC390";
UCHAR dc390_eepromBuf[MAX_ADAPTER_NUM][EE_LEN]; static UCHAR dc390_eepromBuf[MAX_ADAPTER_NUM][EE_LEN];
UCHAR dc390_clock_period1[] = {4, 5, 6, 7, 8, 10, 13, 20}; static UCHAR dc390_clock_period1[] = {4, 5, 6, 7, 8, 10, 13, 20};
UCHAR dc390_clock_speed[] = {100,80,67,57,50, 40, 31, 20}; static UCHAR dc390_clock_speed[] = {100,80,67,57,50, 40, 31, 20};
/*********************************************************************** /***********************************************************************
* Functions for access to DC390 EEPROM * Functions for access to DC390 EEPROM
...@@ -495,7 +486,7 @@ static void __init dc390_check_for_safe_settings (void) ...@@ -495,7 +486,7 @@ static void __init dc390_check_for_safe_settings (void)
} }
int __initdata tmscsim_def[] = {7, 0 /* 10MHz */, static int __initdata tmscsim_def[] = {7, 0 /* 10MHz */,
PARITY_CHK_ | SEND_START_ | EN_DISCONNECT_ PARITY_CHK_ | SEND_START_ | EN_DISCONNECT_
| SYNC_NEGO_ | TAG_QUEUEING_, | SYNC_NEGO_ | TAG_QUEUEING_,
MORE2_DRV | GREATER_1G | RST_SCSI_BUS | ACTIVE_NEGATION MORE2_DRV | GREATER_1G | RST_SCSI_BUS | ACTIVE_NEGATION
...@@ -526,7 +517,7 @@ static void __init dc390_fill_with_defaults (void) ...@@ -526,7 +517,7 @@ static void __init dc390_fill_with_defaults (void)
/* Override defaults on cmdline: /* Override defaults on cmdline:
* tmscsim: AdaptID, MaxSpeed (Index), DevMode (Bitmapped), AdaptMode (Bitmapped) * tmscsim: AdaptID, MaxSpeed (Index), DevMode (Bitmapped), AdaptMode (Bitmapped)
*/ */
int __init dc390_setup (char *str) static int __init dc390_setup (char *str)
{ {
int ints[8]; int ints[8];
int i, im; int i, im;
...@@ -818,7 +809,7 @@ static __inline__ void dc390_Waiting_to_Going ( PDCB pDCB, PSRB pSRB ) ...@@ -818,7 +809,7 @@ static __inline__ void dc390_Waiting_to_Going ( PDCB pDCB, PSRB pSRB )
dc390_Going_append (pDCB, pSRB); dc390_Going_append (pDCB, pSRB);
} }
void DC390_waiting_timed_out (unsigned long ptr); static void DC390_waiting_timed_out (unsigned long ptr);
/* Sets the timer to wake us up */ /* Sets the timer to wake us up */
static void dc390_waiting_timer (PACB pACB, unsigned long to) static void dc390_waiting_timer (PACB pACB, unsigned long to)
{ {
...@@ -871,7 +862,7 @@ static void dc390_Waiting_process ( PACB pACB ) ...@@ -871,7 +862,7 @@ static void dc390_Waiting_process ( PACB pACB )
} }
/* Wake up waiting queue */ /* Wake up waiting queue */
void DC390_waiting_timed_out (unsigned long ptr) static void DC390_waiting_timed_out (unsigned long ptr)
{ {
PACB pACB = (PACB)ptr; PACB pACB = (PACB)ptr;
DC390_IFLAGS; DC390_IFLAGS;
...@@ -1046,7 +1037,7 @@ static void dc390_BuildSRB (Scsi_Cmnd* pcmd, PDCB pDCB, PSRB pSRB) ...@@ -1046,7 +1037,7 @@ static void dc390_BuildSRB (Scsi_Cmnd* pcmd, PDCB pDCB, PSRB pSRB)
* *
***********************************************************************/ ***********************************************************************/
int DC390_queue_command (Scsi_Cmnd *cmd, void (* done)(Scsi_Cmnd *)) static int DC390_queue_command (Scsi_Cmnd *cmd, void (* done)(Scsi_Cmnd *))
{ {
PDCB pDCB; PDCB pDCB;
PSRB pSRB; PSRB pSRB;
...@@ -1213,7 +1204,7 @@ static int partsize(unsigned char *buf, unsigned long capacity, ...@@ -1213,7 +1204,7 @@ static int partsize(unsigned char *buf, unsigned long capacity,
* Note: * Note:
* In contrary to other externally callable funcs (DC390_), we don't lock * In contrary to other externally callable funcs (DC390_), we don't lock
***********************************************************************/ ***********************************************************************/
int DC390_bios_param (struct scsi_device *sdev, struct block_device *bdev, static int DC390_bios_param (struct scsi_device *sdev, struct block_device *bdev,
sector_t capacity, int geom[]) sector_t capacity, int geom[])
{ {
int heads, sectors, cylinders; int heads, sectors, cylinders;
...@@ -1250,15 +1241,14 @@ int DC390_bios_param (struct scsi_device *sdev, struct block_device *bdev, ...@@ -1250,15 +1241,14 @@ int DC390_bios_param (struct scsi_device *sdev, struct block_device *bdev,
return (0); return (0);
} }
#else #else
int DC390_bios_param (struct scsi_device *sdev, struct block_device *bdev, static int DC390_bios_param (struct scsi_device *sdev, struct block_device *bdev,
sector_t capacity, int geom[]) sector_t capacity, int geom[])
{ {
return scsicam_bios_param (bdev, capacity, geom); return scsicam_bios_param (bdev, capacity, geom);
} }
#endif #endif
static void dc390_dumpinfo (PACB pACB, PDCB pDCB, PSRB pSRB)
void dc390_dumpinfo (PACB pACB, PDCB pDCB, PSRB pSRB)
{ {
USHORT pstat; PDEVDECL1; USHORT pstat; PDEVDECL1;
if (!pDCB) pDCB = pACB->pActiveDCB; if (!pDCB) pDCB = pACB->pActiveDCB;
...@@ -1312,7 +1302,7 @@ void dc390_dumpinfo (PACB pACB, PDCB pDCB, PSRB pSRB) ...@@ -1312,7 +1302,7 @@ void dc390_dumpinfo (PACB pACB, PDCB pDCB, PSRB pSRB)
* Status: Buggy ! * Status: Buggy !
***********************************************************************/ ***********************************************************************/
int DC390_abort (Scsi_Cmnd *cmd) static int DC390_abort (Scsi_Cmnd *cmd)
{ {
PDCB pDCB; PDCB pDCB;
PSRB pSRB, psrb; PSRB pSRB, psrb;
...@@ -1518,7 +1508,7 @@ static void dc390_RecoverSRB( PACB pACB ) ...@@ -1518,7 +1508,7 @@ static void dc390_RecoverSRB( PACB pACB )
* Returns : 0 on success. * Returns : 0 on success.
***********************************************************************/ ***********************************************************************/
int DC390_reset (Scsi_Cmnd *cmd) static int DC390_reset (Scsi_Cmnd *cmd)
{ {
UCHAR bval; UCHAR bval;
PACB pACB = (PACB) cmd->device->host->hostdata; PACB pACB = (PACB) cmd->device->host->hostdata;
...@@ -1567,7 +1557,7 @@ int DC390_reset (Scsi_Cmnd *cmd) ...@@ -1567,7 +1557,7 @@ int DC390_reset (Scsi_Cmnd *cmd)
* Inputs : SCSI id and lun * Inputs : SCSI id and lun
***********************************************************************/ ***********************************************************************/
void dc390_initDCB( PACB pACB, PDCB *ppDCB, UCHAR id, UCHAR lun ) static void dc390_initDCB( PACB pACB, PDCB *ppDCB, UCHAR id, UCHAR lun )
{ {
PEEprom prom; PEEprom prom;
UCHAR index; UCHAR index;
...@@ -1652,7 +1642,7 @@ void dc390_initDCB( PACB pACB, PDCB *ppDCB, UCHAR id, UCHAR lun ) ...@@ -1652,7 +1642,7 @@ void dc390_initDCB( PACB pACB, PDCB *ppDCB, UCHAR id, UCHAR lun )
* Purpose : Set the configuration dependent DCB parameters * Purpose : Set the configuration dependent DCB parameters
***********************************************************************/ ***********************************************************************/
void dc390_updateDCB (PACB pACB, PDCB pDCB) static void dc390_updateDCB (PACB pACB, PDCB pDCB)
{ {
pDCB->SyncMode &= EN_TAG_QUEUEING | SYNC_NEGO_DONE /*| EN_ATN_STOP*/; pDCB->SyncMode &= EN_TAG_QUEUEING | SYNC_NEGO_DONE /*| EN_ATN_STOP*/;
if (pDCB->DevMode & TAG_QUEUEING_) { if (pDCB->DevMode & TAG_QUEUEING_) {
...@@ -1690,7 +1680,7 @@ static void __inline__ dc390_initSRB( PSRB psrb ) ...@@ -1690,7 +1680,7 @@ static void __inline__ dc390_initSRB( PSRB psrb )
} }
void dc390_linkSRB( PACB pACB ) static void dc390_linkSRB( PACB pACB )
{ {
UINT count, i; UINT count, i;
...@@ -1715,7 +1705,7 @@ void dc390_linkSRB( PACB pACB ) ...@@ -1715,7 +1705,7 @@ void dc390_linkSRB( PACB pACB )
* io_port, Irq, index: Resources and adapter index * io_port, Irq, index: Resources and adapter index
***********************************************************************/ ***********************************************************************/
void __init dc390_initACB (PSH psh, ULONG io_port, UCHAR Irq, UCHAR index) static void __init dc390_initACB (PSH psh, ULONG io_port, UCHAR Irq, UCHAR index)
{ {
PACB pACB; PACB pACB;
UCHAR i; UCHAR i;
...@@ -1788,7 +1778,7 @@ void __init dc390_initACB (PSH psh, ULONG io_port, UCHAR Irq, UCHAR index) ...@@ -1788,7 +1778,7 @@ void __init dc390_initACB (PSH psh, ULONG io_port, UCHAR Irq, UCHAR index)
* Outputs: 0 on success, -1 on error * Outputs: 0 on success, -1 on error
***********************************************************************/ ***********************************************************************/
int __init dc390_initAdapter (PSH psh, ULONG io_port, UCHAR Irq, UCHAR index) static int __init dc390_initAdapter (PSH psh, ULONG io_port, UCHAR Irq, UCHAR index)
{ {
PACB pACB, pACB2; PACB pACB, pACB2;
UCHAR dstate; UCHAR dstate;
...@@ -1867,7 +1857,7 @@ int __init dc390_initAdapter (PSH psh, ULONG io_port, UCHAR Irq, UCHAR index) ...@@ -1867,7 +1857,7 @@ int __init dc390_initAdapter (PSH psh, ULONG io_port, UCHAR Irq, UCHAR index)
* Inputs : host - pointer to this host adapter's structure * Inputs : host - pointer to this host adapter's structure
* io_port - IO ports mapped to this adapter * io_port - IO ports mapped to this adapter
* Irq - IRQ assigned to this adpater * Irq - IRQ assigned to this adpater
* PDEVDECL - PCI access handle * struct pci_dev - PCI access handle
* index - Adapter index * index - Adapter index
* *
* Outputs: 0 on success, -1 on error * Outputs: 0 on success, -1 on error
...@@ -1876,7 +1866,7 @@ int __init dc390_initAdapter (PSH psh, ULONG io_port, UCHAR Irq, UCHAR index) ...@@ -1876,7 +1866,7 @@ int __init dc390_initAdapter (PSH psh, ULONG io_port, UCHAR Irq, UCHAR index)
* not in DC390_detect, called from outside * not in DC390_detect, called from outside
***********************************************************************/ ***********************************************************************/
static int __init DC390_init (PSHT psht, ULONG io_port, UCHAR Irq, PDEVDECL, UCHAR index) static int __init DC390_init (PSHT psht, ULONG io_port, UCHAR Irq, struct pci_dev *pdev, UCHAR index)
{ {
PSH psh; PSH psh;
PACB pACB; PACB pACB;
...@@ -1939,14 +1929,14 @@ static void __init dc390_set_pci_cfg (PDEVDECL) ...@@ -1939,14 +1929,14 @@ static void __init dc390_set_pci_cfg (PDEVDECL)
int __init DC390_detect (Scsi_Host_Template *psht) int __init DC390_detect (Scsi_Host_Template *psht)
{ {
PDEVDECL0; struct pci_dev *pdev = NULL;
UCHAR irq; UCHAR irq;
ULONG io_port; ULONG io_port;
dc390_pACB_start = NULL; dc390_pACB_start = NULL;
if ( PCI_PRESENT ) if ( PCI_PRESENT )
while (PCI_FIND_DEVICE (PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD53C974)) while ((pdev = pci_find_device(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD53C974, pdev)))
{ {
if (pci_enable_device (pdev)) if (pci_enable_device (pdev))
continue; continue;
...@@ -1960,7 +1950,7 @@ int __init DC390_detect (Scsi_Host_Template *psht) ...@@ -1960,7 +1950,7 @@ int __init DC390_detect (Scsi_Host_Template *psht)
if( !DC390_init(psht, io_port, irq, PDEV, dc390_adapterCnt)) if( !DC390_init(psht, io_port, irq, PDEV, dc390_adapterCnt))
{ {
PCI_SET_MASTER; pci_set_master(pdev);
dc390_set_pci_cfg (PDEV); dc390_set_pci_cfg (PDEV);
dc390_adapterCnt++; dc390_adapterCnt++;
} }
...@@ -2002,7 +1992,7 @@ int __init DC390_detect (Scsi_Host_Template *psht) ...@@ -2002,7 +1992,7 @@ int __init DC390_detect (Scsi_Host_Template *psht)
else SPRINTF(" No ") else SPRINTF(" No ")
int DC390_proc_info (struct Scsi_Host *shpnt, char *buffer, char **start, static int DC390_proc_info (struct Scsi_Host *shpnt, char *buffer, char **start,
off_t offset, int length, int inout) off_t offset, int length, int inout)
{ {
int dev, spd, spd1; int dev, spd, spd1;
...@@ -2149,7 +2139,7 @@ static int dc390_shutdown (struct Scsi_Host *host) ...@@ -2149,7 +2139,7 @@ static int dc390_shutdown (struct Scsi_Host *host)
return( 0 ); return( 0 );
} }
void dc390_freeDCBs (struct Scsi_Host *host) static void dc390_freeDCBs (struct Scsi_Host *host)
{ {
PDCB pDCB, nDCB; PDCB pDCB, nDCB;
PACB pACB = (PACB)(host->hostdata); PACB pACB = (PACB)(host->hostdata);
...@@ -2168,7 +2158,7 @@ void dc390_freeDCBs (struct Scsi_Host *host) ...@@ -2168,7 +2158,7 @@ void dc390_freeDCBs (struct Scsi_Host *host)
} }
int DC390_release (struct Scsi_Host *host) static int DC390_release (struct Scsi_Host *host)
{ {
DC390_IFLAGS; DC390_IFLAGS;
PACB pACB = (PACB)(host->hostdata); PACB pACB = (PACB)(host->hostdata);
......
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