Commit cdc807e5 authored by Adrian Bunk's avatar Adrian Bunk Committed by Linus Torvalds

[PATCH] small drivers/char/rio/ cleanups

The patch below does cleanups under drivers/char/rio/ including the
following:

- remove some completely unused code
- make some needlessly global code static
- remove #ifndef linux code
- remove never enabled #ifdef XPRINT_SUPPORT code
- RIOStrlen -> string.h strlen
- RIOStrCmp -> string.h strcmp
Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent c04e34f4
...@@ -47,7 +47,6 @@ int RIOBootCodeHOST(struct rio_info *, register struct DownLoad *); ...@@ -47,7 +47,6 @@ int RIOBootCodeHOST(struct rio_info *, register struct DownLoad *);
int RIOBootCodeUNKNOWN(struct rio_info *, struct DownLoad *); int RIOBootCodeUNKNOWN(struct rio_info *, struct DownLoad *);
void msec_timeout(struct Host *); void msec_timeout(struct Host *);
int RIOBootRup(struct rio_info *, uint, struct Host *, struct PKT *); int RIOBootRup(struct rio_info *, uint, struct Host *, struct PKT *);
int RIOBootComplete(struct rio_info *, struct Host *, uint, struct PktCmd *);
int RIOBootOk(struct rio_info *,struct Host *, ulong); int RIOBootOk(struct rio_info *,struct Host *, ulong);
int RIORtaBound(struct rio_info *, uint); int RIORtaBound(struct rio_info *, uint);
void FillSlot(int, int, uint, struct Host *); void FillSlot(int, int, uint, struct Host *);
...@@ -61,15 +60,10 @@ int RIOIdentifyRta(struct rio_info *, caddr_t); ...@@ -61,15 +60,10 @@ int RIOIdentifyRta(struct rio_info *, caddr_t);
int RIOKillNeighbour(struct rio_info *, caddr_t); int RIOKillNeighbour(struct rio_info *, caddr_t);
int RIOSuspendBootRta(struct Host *, int, int); int RIOSuspendBootRta(struct Host *, int, int);
int RIOFoadWakeup(struct rio_info *); int RIOFoadWakeup(struct rio_info *);
int RIOCommandRup(struct rio_info *, uint, struct Host *, struct PKT *);
struct CmdBlk * RIOGetCmdBlk(void); struct CmdBlk * RIOGetCmdBlk(void);
void RIOFreeCmdBlk(struct CmdBlk *); void RIOFreeCmdBlk(struct CmdBlk *);
int RIOQueueCmdBlk(struct Host *, uint, struct CmdBlk *); int RIOQueueCmdBlk(struct Host *, uint, struct CmdBlk *);
void RIOPollHostCommands(struct rio_info *, struct Host *); void RIOPollHostCommands(struct rio_info *, struct Host *);
int RIOStrlen(register char *);
int RIOStrCmp(register char *, register char *);
int RIOStrnCmp(register char *, register char *, int);
void RIOStrNCpy(char *, char *, int);
int RIOWFlushMark(int, struct CmdBlk *); int RIOWFlushMark(int, struct CmdBlk *);
int RIORFlushEnable(int, struct CmdBlk *); int RIORFlushEnable(int, struct CmdBlk *);
int RIOUnUse(int, struct CmdBlk *); int RIOUnUse(int, struct CmdBlk *);
...@@ -77,7 +71,6 @@ void ShowPacket(uint, struct PKT *); ...@@ -77,7 +71,6 @@ void ShowPacket(uint, struct PKT *);
/* rioctrl.c */ /* rioctrl.c */
int copyin(int, caddr_t, int); int copyin(int, caddr_t, int);
int copyout(caddr_t, int, int);
int riocontrol(struct rio_info *, dev_t,int,caddr_t,int); int riocontrol(struct rio_info *, dev_t,int,caddr_t,int);
int RIOPreemptiveCmd(struct rio_info *,struct Port *,uchar); int RIOPreemptiveCmd(struct rio_info *,struct Port *,uchar);
...@@ -89,24 +82,17 @@ int RIODoAT(struct rio_info *, int, int); ...@@ -89,24 +82,17 @@ int RIODoAT(struct rio_info *, int, int);
caddr_t RIOCheckForATCard(int); caddr_t RIOCheckForATCard(int);
int RIOAssignAT(struct rio_info *, int, caddr_t, int); int RIOAssignAT(struct rio_info *, int, caddr_t, int);
int RIOBoardTest(paddr_t, caddr_t, uchar, int); int RIOBoardTest(paddr_t, caddr_t, uchar, int);
int RIOScrub(int, BYTE *, int);
void RIOAllocateInterrupts(struct rio_info *);
void RIOStopInterrupts(struct rio_info *, int, int);
void RIOAllocDataStructs(struct rio_info *); void RIOAllocDataStructs(struct rio_info *);
void RIOSetupDataStructs(struct rio_info *); void RIOSetupDataStructs(struct rio_info *);
int RIODefaultName(struct rio_info *, struct Host *, uint); int RIODefaultName(struct rio_info *, struct Host *, uint);
int RIOReport(struct rio_info *);
struct rioVersion * RIOVersid(void); struct rioVersion * RIOVersid(void);
int RIOMapin(paddr_t, int, caddr_t *); int RIOMapin(paddr_t, int, caddr_t *);
void RIOMapout(paddr_t, long, caddr_t); void RIOMapout(paddr_t, long, caddr_t);
void RIOHostReset(uint, volatile struct DpRam *, uint); void RIOHostReset(uint, volatile struct DpRam *, uint);
/* riointr.c */ /* riointr.c */
void riopoll(struct rio_info *);
void riointr(struct rio_info *);
void RIOTxEnable(char *); void RIOTxEnable(char *);
void RIOServiceHost(struct rio_info *, struct Host *, int); void RIOServiceHost(struct rio_info *, struct Host *, int);
void RIOReceive(struct rio_info *, struct Port *);
int riotproc(struct rio_info *, register struct ttystatics *, int, int); int riotproc(struct rio_info *, register struct ttystatics *, int, int);
/* rioparam.c */ /* rioparam.c */
...@@ -123,22 +109,15 @@ void remove_receive(struct Port *); ...@@ -123,22 +109,15 @@ void remove_receive(struct Port *);
/* rioroute.c */ /* rioroute.c */
int RIORouteRup(struct rio_info *, uint, struct Host *, struct PKT *); int RIORouteRup(struct rio_info *, uint, struct Host *, struct PKT *);
void RIOFixPhbs(struct rio_info *, struct Host *, uint); void RIOFixPhbs(struct rio_info *, struct Host *, uint);
int RIOCheckIsolated(struct rio_info *, struct Host *, uint);
int RIOIsolate(struct rio_info *, struct Host *, uint);
int RIOCheck(struct Host *, uint);
uint GetUnitType(uint); uint GetUnitType(uint);
int RIOSetChange(struct rio_info *); int RIOSetChange(struct rio_info *);
void RIOConCon(struct rio_info *, struct Host *, uint, uint, uint, uint, int);
int RIOFindFreeID(struct rio_info *, struct Host *, uint *, uint *); int RIOFindFreeID(struct rio_info *, struct Host *, uint *, uint *);
int RIOFreeDisconnected(struct rio_info *, struct Host *, int );
int RIORemoveFromSavedTable(struct rio_info *, struct Map *);
/* riotty.c */ /* riotty.c */
int riotopen(struct tty_struct * tty, struct file * filp); int riotopen(struct tty_struct * tty, struct file * filp);
int riotclose(void *ptr); int riotclose(void *ptr);
int RIOCookMode(struct ttystatics *);
int riotioctl(struct rio_info *, struct tty_struct *, register int, register caddr_t); int riotioctl(struct rio_info *, struct tty_struct *, register int, register caddr_t);
void ttyseth(struct Port *, struct ttystatics *, struct old_sgttyb *sg); void ttyseth(struct Port *, struct ttystatics *, struct old_sgttyb *sg);
......
...@@ -32,11 +32,6 @@ ...@@ -32,11 +32,6 @@
* *
* */ * */
#define RCS_ID "$Id: rio.c,v 1.1 1999/07/11 10:13:54 wolff Exp wolff $"
#define RCS_REV "$Revision: 1.1 $"
#include <linux/module.h> #include <linux/module.h>
#include <linux/config.h> #include <linux/config.h>
#include <linux/kdev_t.h> #include <linux/kdev_t.h>
...@@ -198,7 +193,7 @@ static int rio_fw_ioctl (struct inode *inode, struct file *filp, ...@@ -198,7 +193,7 @@ static int rio_fw_ioctl (struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg); unsigned int cmd, unsigned long arg);
static int rio_init_drivers(void); static int rio_init_drivers(void);
void my_hd (void *addr, int len); static void my_hd (void *addr, int len);
static struct tty_driver *rio_driver, *rio_driver2; static struct tty_driver *rio_driver, *rio_driver2;
...@@ -206,11 +201,6 @@ static struct tty_driver *rio_driver, *rio_driver2; ...@@ -206,11 +201,6 @@ static struct tty_driver *rio_driver, *rio_driver2;
sources use all over the place. */ sources use all over the place. */
struct rio_info *p; struct rio_info *p;
/* struct rio_board boards[RIO_HOSTS]; */
struct rio_port *rio_ports;
int rio_initialized;
int rio_nports;
int rio_debug; int rio_debug;
...@@ -218,12 +208,12 @@ int rio_debug; ...@@ -218,12 +208,12 @@ int rio_debug;
- Set rio_poll to 1 to poll every timer tick (10ms on Intel). - Set rio_poll to 1 to poll every timer tick (10ms on Intel).
This is used when the card cannot use an interrupt for some reason. This is used when the card cannot use an interrupt for some reason.
*/ */
int rio_poll = 1; static int rio_poll = 1;
/* These are the only open spaces in my computer. Yours may have more /* These are the only open spaces in my computer. Yours may have more
or less.... */ or less.... */
int rio_probe_addrs[]= {0xc0000, 0xd0000, 0xe0000}; static int rio_probe_addrs[]= {0xc0000, 0xd0000, 0xe0000};
#define NR_RIO_ADDRS (sizeof(rio_probe_addrs)/sizeof (int)) #define NR_RIO_ADDRS (sizeof(rio_probe_addrs)/sizeof (int))
...@@ -264,7 +254,7 @@ static struct file_operations rio_fw_fops = { ...@@ -264,7 +254,7 @@ static struct file_operations rio_fw_fops = {
.ioctl = rio_fw_ioctl, .ioctl = rio_fw_ioctl,
}; };
struct miscdevice rio_fw_device = { static struct miscdevice rio_fw_device = {
RIOCTL_MISC_MINOR, "rioctl", &rio_fw_fops RIOCTL_MISC_MINOR, "rioctl", &rio_fw_fops
}; };
...@@ -302,7 +292,7 @@ static inline int rio_paranoia_check(struct rio_port const * port, ...@@ -302,7 +292,7 @@ static inline int rio_paranoia_check(struct rio_port const * port,
#ifdef DEBUG #ifdef DEBUG
void my_hd (void *ad, int len) static void my_hd (void *ad, int len)
{ {
int i, j, ch; int i, j, ch;
unsigned char *addr = ad; unsigned char *addr = ad;
...@@ -387,7 +377,7 @@ static int rio_set_real_termios (void *ptr) ...@@ -387,7 +377,7 @@ static int rio_set_real_termios (void *ptr)
} }
void rio_reset_interrupt (struct Host *HostP) static void rio_reset_interrupt (struct Host *HostP)
{ {
func_enter(); func_enter();
...@@ -824,7 +814,7 @@ static void rio_unthrottle (struct tty_struct * tty) ...@@ -824,7 +814,7 @@ static void rio_unthrottle (struct tty_struct * tty)
* ********************************************************************** */ * ********************************************************************** */
struct vpd_prom *get_VPD_PROM (struct Host *hp) static struct vpd_prom *get_VPD_PROM (struct Host *hp)
{ {
static struct vpd_prom vpdp; static struct vpd_prom vpdp;
char *p; char *p;
...@@ -1045,7 +1035,7 @@ static void __exit rio_release_drivers(void) ...@@ -1045,7 +1035,7 @@ static void __exit rio_release_drivers(void)
EEprom. As the bit is read/write for the CPU, we can fix it here, EEprom. As the bit is read/write for the CPU, we can fix it here,
if we detect that it isn't set correctly. -- REW */ if we detect that it isn't set correctly. -- REW */
void fix_rio_pci (struct pci_dev *pdev) static void fix_rio_pci (struct pci_dev *pdev)
{ {
unsigned int hwbase; unsigned int hwbase;
unsigned long rebase; unsigned long rebase;
......
...@@ -80,6 +80,8 @@ static char *_rioboot_c_sccs_ = "@(#)rioboot.c 1.3"; ...@@ -80,6 +80,8 @@ static char *_rioboot_c_sccs_ = "@(#)rioboot.c 1.3";
#include "cmdblk.h" #include "cmdblk.h"
#include "route.h" #include "route.h"
static int RIOBootComplete( struct rio_info *p, struct Host *HostP, uint Rup, struct PktCmd *PktCmdP );
static uchar static uchar
RIOAtVec2Ctrl[] = RIOAtVec2Ctrl[] =
{ {
...@@ -802,7 +804,7 @@ struct PKT *PacketP; ...@@ -802,7 +804,7 @@ struct PKT *PacketP;
** If booted by an RTA, HostP->Mapping[Rup].RtaUniqueNum is the booting RTA. ** If booted by an RTA, HostP->Mapping[Rup].RtaUniqueNum is the booting RTA.
** RtaUniq is the booted RTA. ** RtaUniq is the booted RTA.
*/ */
int RIOBootComplete( struct rio_info *p, struct Host *HostP, uint Rup, struct PktCmd *PktCmdP ) static int RIOBootComplete( struct rio_info *p, struct Host *HostP, uint Rup, struct PktCmd *PktCmdP )
{ {
struct Map *MapP = NULL; struct Map *MapP = NULL;
struct Map *MapP2 = NULL; struct Map *MapP2 = NULL;
......
...@@ -397,7 +397,7 @@ struct rio_info * p; ...@@ -397,7 +397,7 @@ struct rio_info * p;
/* /*
** Incoming command on the COMMAND_RUP to be processed. ** Incoming command on the COMMAND_RUP to be processed.
*/ */
int static int
RIOCommandRup(p, Rup, HostP, PacketP) RIOCommandRup(p, Rup, HostP, PacketP)
struct rio_info * p; struct rio_info * p;
uint Rup; uint Rup;
...@@ -917,62 +917,6 @@ struct Host * HostP; ...@@ -917,62 +917,6 @@ struct Host * HostP;
} while ( Rup ); } while ( Rup );
} }
/*
** Return the length of the named string
*/
int
RIOStrlen(Str)
register char *Str;
{
register int len = 0;
while ( *Str++ )
len++;
return len;
}
/*
** compares s1 to s2 and return 0 if they match.
*/
int
RIOStrCmp(s1, s2)
register char *s1;
register char *s2;
{
while ( *s1 && *s2 && *s1==*s2 )
s1++, s2++;
return *s1-*s2;
}
/*
** compares s1 to s2 for upto n bytes and return 0 if they match.
*/
int
RIOStrnCmp(s1, s2, n)
register char *s1;
register char *s2;
int n;
{
while ( n && *s1 && *s2 && *s1==*s2 )
n--, s1++, s2++;
return n ? *s1!=*s2 : 0;
}
/*
** copy up to 'len' bytes from 'from' to 'to'.
*/
void
RIOStrNCpy(to, from, len)
char *to;
char *from;
int len;
{
while ( len-- && (*to++ = *from++) )
;
to[-1]='\0';
}
int int
RIOWFlushMark(iPortP, CmdBlkP) RIOWFlushMark(iPortP, CmdBlkP)
int iPortP; int iPortP;
......
...@@ -130,7 +130,6 @@ static int ...@@ -130,7 +130,6 @@ static int
#define drv_makedev(maj, min) ((((uint) maj & 0xff) << 8) | ((uint) min & 0xff)) #define drv_makedev(maj, min) ((((uint) maj & 0xff) << 8) | ((uint) min & 0xff))
#ifdef linux
int copyin (int arg, caddr_t dp, int siz) int copyin (int arg, caddr_t dp, int siz)
{ {
int rv; int rv;
...@@ -141,8 +140,7 @@ int copyin (int arg, caddr_t dp, int siz) ...@@ -141,8 +140,7 @@ int copyin (int arg, caddr_t dp, int siz)
else return rv; else return rv;
} }
static int copyout (caddr_t dp, int arg, int siz)
int copyout (caddr_t dp, int arg, int siz)
{ {
int rv; int rv;
...@@ -152,35 +150,6 @@ int copyout (caddr_t dp, int arg, int siz) ...@@ -152,35 +150,6 @@ int copyout (caddr_t dp, int arg, int siz)
else return rv; else return rv;
} }
#else
int
copyin(arg, dp, siz)
int arg;
caddr_t dp;
int siz;
{
if (rbounds ((unsigned long) arg) >= siz) {
bcopy ( arg, dp, siz );
return OK;
} else
return ( COPYFAIL );
}
int
copyout (dp, arg, siz)
caddr_t dp;
int arg;
int siz;
{
if (wbounds ((unsigned long) arg) >= siz ) {
bcopy ( dp, arg, siz );
return OK;
} else
return ( COPYFAIL );
}
#endif
int int
riocontrol(p, dev, cmd, arg, su) riocontrol(p, dev, cmd, arg, su)
struct rio_info * p; struct rio_info * p;
......
...@@ -84,9 +84,15 @@ static char *_rioinit_c_sccs_ = "@(#)rioinit.c 1.3"; ...@@ -84,9 +84,15 @@ static char *_rioinit_c_sccs_ = "@(#)rioinit.c 1.3";
#undef bcopy #undef bcopy
#define bcopy rio_pcicopy #define bcopy rio_pcicopy
int int RIOPCIinit(struct rio_info *p, int Mode);
RIOPCIinit(struct rio_info *p, int Mode);
#if 0
static void RIOAllocateInterrupts(struct rio_info *);
static int RIOReport(struct rio_info *);
static void RIOStopInterrupts(struct rio_info *, int, int);
#endif
static int RIOScrub(int, BYTE *, int);
#if 0 #if 0
extern int rio_intr(); extern int rio_intr();
...@@ -1116,7 +1122,7 @@ int slot; ...@@ -1116,7 +1122,7 @@ int slot;
** Call with op not zero, and the RAM will be read and compated with val[op-1] ** Call with op not zero, and the RAM will be read and compated with val[op-1]
** to check that the data from the previous phase was retained. ** to check that the data from the previous phase was retained.
*/ */
int static int
RIOScrub(op, ram, size) RIOScrub(op, ram, size)
int op; int op;
BYTE * ram; BYTE * ram;
...@@ -1262,7 +1268,8 @@ int size; ...@@ -1262,7 +1268,8 @@ int size;
** and force into polled mode if told to. Patch up the ** and force into polled mode if told to. Patch up the
** interrupt vector & salute The Queen when you've done. ** interrupt vector & salute The Queen when you've done.
*/ */
void #if 0
static void
RIOAllocateInterrupts(p) RIOAllocateInterrupts(p)
struct rio_info * p; struct rio_info * p;
{ {
...@@ -1301,7 +1308,7 @@ struct rio_info * p; ...@@ -1301,7 +1308,7 @@ struct rio_info * p;
** new-fangled interrupt thingies. Set everything up to just ** new-fangled interrupt thingies. Set everything up to just
** poll. ** poll.
*/ */
void static void
RIOStopInterrupts(p, Reason, Host) RIOStopInterrupts(p, Reason, Host)
struct rio_info * p; struct rio_info * p;
int Reason; int Reason;
...@@ -1360,7 +1367,6 @@ int Host; ...@@ -1360,7 +1367,6 @@ int Host;
} }
} }
#if 0
/* /*
** This function is called at init time to setup the data structures. ** This function is called at init time to setup the data structures.
*/ */
...@@ -1476,7 +1482,8 @@ uint UnitId; ...@@ -1476,7 +1482,8 @@ uint UnitId;
#define RIO_RELEASE "Linux" #define RIO_RELEASE "Linux"
#define RELEASE_ID "1.0" #define RELEASE_ID "1.0"
int #if 0
static int
RIOReport(p) RIOReport(p)
struct rio_info * p; struct rio_info * p;
{ {
...@@ -1500,41 +1507,7 @@ struct rio_info * p; ...@@ -1500,41 +1507,7 @@ struct rio_info * p;
} }
return 0; return 0;
} }
#endif
/*
** This function returns release/version information as used by ioctl() calls
** It returns a MAX_VERSION_LEN byte string, null terminated.
*/
char *
OLD_RIOVersid( void )
{
static char Info[MAX_VERSION_LEN];
char * RIORelease = RIO_RELEASE;
char * cp;
int ct = 0;
for ( ct=0; RIORelease[ct] && ct<MAX_VERSION_LEN; ct++ )
Info[ct] = RIORelease[ct];
if ( ct>=MAX_VERSION_LEN ) {
Info[MAX_VERSION_LEN-1] = '\0';
return Info;
}
Info[ct++]=' ';
if ( ct>=MAX_VERSION_LEN ) {
Info[MAX_VERSION_LEN-1] = '\0';
return Info;
}
cp=""; /* Fill the RCS Id here */
while ( *cp && ct<MAX_VERSION_LEN )
Info[ct++] = *cp++;
if ( ct<MAX_VERSION_LEN-1 )
Info[ct] = '\0';
Info[MAX_VERSION_LEN-1] = '\0';
return Info;
}
static struct rioVersion stVersion; static struct rioVersion stVersion;
......
...@@ -84,83 +84,10 @@ static char *_riointr_c_sccs_ = "@(#)riointr.c 1.2"; ...@@ -84,83 +84,10 @@ static char *_riointr_c_sccs_ = "@(#)riointr.c 1.2";
#include "rioioctl.h" #include "rioioctl.h"
static void RIOReceive(struct rio_info *, struct Port *);
/* static char *firstchars (char *p, int nch)
** riopoll is called every clock tick. Once the /dev/rio device has been
** opened, and polldistributed( ) has been called, this routine is called
** every clock tick *by every cpu*. The 'interesting' piece of code that
** manipulates 'RIONumCpus' and 'RIOCpuCountdown' is used to fair-share
** the work between the CPUs. If there are 'N' cpus, then each poll time
** we increment a counter, modulo 'N-1'. When this counter is 0, we call
** the interrupt handler. This has the effect that polls are serviced
** by processor 'N', 'N-1', 'N-2', ... '0', round and round. Neat.
*/
void
riopoll(p)
struct rio_info * p;
{
int host;
/*
** Here's the deal. We try to fair share as much as possible amongst
** all the processors that are available. Since each processor
** should generate HZ ticks per second and since we only need HZ ticks
** in total for proper operation we simply attempt to cycle round each
** processor in turn, using RIOCpuCountdown to decide whether to call
** the interrupt routine. ( In fact the count zeroes when it reaches
** one less than the total number of processors - so e.g. on a two
** processor system RIOService will get called 2*HZ times per second. )
** this_cpu (cur_cpu()) tells us the number of the current processor
** as follows:
**
** 0 - default CPU
** 1 - first extra CPU
** 2 - second extra CPU
** etc.
*/
/*
** okay, we've got a cpu that hasn't had a go recently
** - lets check to see what needs doing.
*/
for ( host=0; host<p->RIONumHosts; host++ ) {
struct Host *HostP = &p->RIOHosts[host];
rio_spin_lock( &HostP->HostLock );
if ( ( (HostP->Flags & RUN_STATE) != RC_RUNNING ) ||
HostP->InIntr ) {
rio_spin_unlock (&HostP->HostLock);
continue;
}
if ( RWORD( HostP->ParmMapP->rup_intr ) ||
RWORD( HostP->ParmMapP->rx_intr ) ||
RWORD( HostP->ParmMapP->tx_intr ) ) {
HostP->InIntr = 1;
#ifdef FUTURE_RELEASE
if( HostP->Type == RIO_EISA )
INBZ( HostP->Slot, EISA_INTERRUPT_RESET );
else
#endif
WBYTE( HostP->ResetInt , 0xff );
rio_spin_lock(&HostP->HostLock);
p->_RIO_Polled++;
RIOServiceHost(p, HostP, 'p' );
rio_spin_lock( &HostP->HostLock);
HostP->InIntr = 0;
rio_spin_unlock (&HostP->HostLock);
}
}
rio_spin_unlock (&p->RIOIntrSem);
}
char *firstchars (char *p, int nch)
{ {
static char buf[2][128]; static char buf[2][128];
static int t=0; static int t=0;
...@@ -257,93 +184,6 @@ char * en; ...@@ -257,93 +184,6 @@ char * en;
} }
/*
** When a real-life interrupt comes in here, we try to find out
** which host card it belongs to, and then service only that host
** Notice the cunning way that, once we've found a candidate, we
** continue just in case we are sharing interrupts.
*/
void
riointr(p)
struct rio_info * p;
{
int host;
for ( host=0; host<p->RIONumHosts; host++ ) {
struct Host *HostP = &p->RIOHosts[host];
rio_dprintk (RIO_DEBUG_INTR, "riointr() doing host %d type %d\n", host, HostP->Type);
switch( HostP->Type ) {
case RIO_AT:
case RIO_MCA:
case RIO_PCI:
rio_spin_lock(&HostP->HostLock);
WBYTE(HostP->ResetInt , 0xff);
if ( !HostP->InIntr ) {
HostP->InIntr = 1;
rio_spin_unlock (&HostP->HostLock);
p->_RIO_Interrupted++;
RIOServiceHost(p, HostP, 'i');
rio_spin_lock(&HostP->HostLock);
HostP->InIntr = 0;
}
rio_spin_unlock(&HostP->HostLock);
break;
#ifdef FUTURE_RELEASE
case RIO_EISA:
if ( ivec == HostP->Ivec )
{
OldSpl = LOCKB( &HostP->HostLock );
INBZ( HostP->Slot, EISA_INTERRUPT_RESET );
if ( !HostP->InIntr )
{
HostP->InIntr = 1;
UNLOCKB( &HostP->HostLock, OldSpl );
if ( this_cpu < RIO_CPU_LIMIT )
{
int intrSpl = LOCKB( &RIOIntrLock );
UNLOCKB( &RIOIntrLock, intrSpl );
}
p->_RIO_Interrupted++;
RIOServiceHost( HostP, 'i' );
OldSpl = LOCKB( &HostP->HostLock );
HostP->InIntr = 0;
}
UNLOCKB( &HostP->HostLock, OldSpl );
done++;
}
break;
#endif
}
HostP->IntSrvDone++;
}
#ifdef FUTURE_RELEASE
if ( !done )
{
cmn_err( CE_WARN, "RIO: Interrupt received with vector 0x%x\n", ivec );
cmn_err( CE_CONT, " Valid vectors are:\n");
for ( host=0; host<RIONumHosts; host++ )
{
switch( RIOHosts[host].Type )
{
case RIO_AT:
case RIO_MCA:
case RIO_EISA:
cmn_err( CE_CONT, "0x%x ", RIOHosts[host].Ivec );
break;
case RIO_PCI:
cmn_err( CE_CONT, "0x%x ", get_intr_arg( RIOHosts[host].PciDevInfo.busnum, IDIST_PCI_IRQ( RIOHosts[host].PciDevInfo.slotnum, RIOHosts[host].PciDevInfo.funcnum ) ));
break;
}
}
cmn_err( CE_CONT, "\n" );
}
#endif
}
/* /*
** RIO Host Service routine. Does all the work traditionally associated with an ** RIO Host Service routine. Does all the work traditionally associated with an
** interrupt. ** interrupt.
...@@ -710,7 +550,7 @@ int From; ...@@ -710,7 +550,7 @@ int From;
** NB: Called with the tty locked. The spl from the lockb( ) is passed. ** NB: Called with the tty locked. The spl from the lockb( ) is passed.
** we return the ttySpl level that we re-locked at. ** we return the ttySpl level that we re-locked at.
*/ */
void static void
RIOReceive(p, PortP) RIOReceive(p, PortP)
struct rio_info * p; struct rio_info * p;
struct Port * PortP; struct Port * PortP;
......
...@@ -83,6 +83,12 @@ static char *_rioroute_c_sccs_ = "@(#)rioroute.c 1.3"; ...@@ -83,6 +83,12 @@ static char *_rioroute_c_sccs_ = "@(#)rioroute.c 1.3";
#include "list.h" #include "list.h"
#include "sam.h" #include "sam.h"
static int RIOCheckIsolated(struct rio_info *, struct Host *, uint);
static int RIOIsolate(struct rio_info *, struct Host *, uint);
static int RIOCheck(struct Host *, uint);
static void RIOConCon(struct rio_info *, struct Host *, uint, uint, uint, uint, int);
/* /*
** Incoming on the ROUTE_RUP ** Incoming on the ROUTE_RUP
** I wrote this while I was tired. Forgive me. ** I wrote this while I was tired. Forgive me.
...@@ -717,7 +723,7 @@ uint unit; ...@@ -717,7 +723,7 @@ uint unit;
** the world about it. This is done to ensure that the configurator ** the world about it. This is done to ensure that the configurator
** only gets up-to-date information about what is going on. ** only gets up-to-date information about what is going on.
*/ */
int static int
RIOCheckIsolated(p, HostP, UnitId) RIOCheckIsolated(p, HostP, UnitId)
struct rio_info * p; struct rio_info * p;
struct Host *HostP; struct Host *HostP;
...@@ -747,7 +753,7 @@ uint UnitId; ...@@ -747,7 +753,7 @@ uint UnitId;
** all the units attached to it. This will mean that the entire ** all the units attached to it. This will mean that the entire
** subnet will re-introduce itself. ** subnet will re-introduce itself.
*/ */
int static int
RIOIsolate(p, HostP, UnitId) RIOIsolate(p, HostP, UnitId)
struct rio_info * p; struct rio_info * p;
struct Host * HostP; struct Host * HostP;
...@@ -782,7 +788,7 @@ uint UnitId; ...@@ -782,7 +788,7 @@ uint UnitId;
return 1; return 1;
} }
int static int
RIOCheck(HostP, UnitId) RIOCheck(HostP, UnitId)
struct Host *HostP; struct Host *HostP;
uint UnitId; uint UnitId;
...@@ -883,7 +889,7 @@ struct rio_info * p; ...@@ -883,7 +889,7 @@ struct rio_info * p;
return(0); return(0);
} }
void static void
RIOConCon(p, HostP, FromId, FromLink, ToId, ToLink, Change) RIOConCon(p, HostP, FromId, FromLink, ToId, ToLink, Change)
struct rio_info * p; struct rio_info * p;
struct Host *HostP; struct Host *HostP;
...@@ -966,7 +972,7 @@ int Change; ...@@ -966,7 +972,7 @@ int Change;
** Delete and RTA entry from the saved table given to us ** Delete and RTA entry from the saved table given to us
** by the configuration program. ** by the configuration program.
*/ */
int static int
RIORemoveFromSavedTable(struct rio_info *p, struct Map *pMap) RIORemoveFromSavedTable(struct rio_info *p, struct Map *pMap)
{ {
int entry; int entry;
...@@ -993,7 +999,7 @@ RIORemoveFromSavedTable(struct rio_info *p, struct Map *pMap) ...@@ -993,7 +999,7 @@ RIORemoveFromSavedTable(struct rio_info *p, struct Map *pMap)
** Scan the unit links to and return zero if the unit is completely ** Scan the unit links to and return zero if the unit is completely
** disconnected. ** disconnected.
*/ */
int static int
RIOFreeDisconnected(struct rio_info *p, struct Host *HostP, int unit) RIOFreeDisconnected(struct rio_info *p, struct Host *HostP, int unit)
{ {
int link; int link;
......
...@@ -37,6 +37,7 @@ static char *_riotable_c_sccs_ = "@(#)riotable.c 1.2"; ...@@ -37,6 +37,7 @@ static char *_riotable_c_sccs_ = "@(#)riotable.c 1.2";
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/string.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/system.h> #include <asm/system.h>
...@@ -276,7 +277,7 @@ struct rio_info * p; ...@@ -276,7 +277,7 @@ struct rio_info * p;
return -ENXIO; return -ENXIO;
} }
rio_dprintk (RIO_DEBUG_TABLE, "RIONewTable: entering(9)\n"); rio_dprintk (RIO_DEBUG_TABLE, "RIONewTable: entering(9)\n");
if (RIOStrCmp(MapP->Name, if (strcmp(MapP->Name,
p->RIOConnectTable[SubEnt].Name)==0 && !(MapP->Flags & RTA16_SECOND_SLOT)) { /* (9) */ p->RIOConnectTable[SubEnt].Name)==0 && !(MapP->Flags & RTA16_SECOND_SLOT)) { /* (9) */
rio_dprintk (RIO_DEBUG_TABLE, "RTA name %s used twice\n", MapP->Name); rio_dprintk (RIO_DEBUG_TABLE, "RTA name %s used twice\n", MapP->Name);
p->RIOError.Error = NAME_USED_TWICE; p->RIOError.Error = NAME_USED_TWICE;
...@@ -405,7 +406,7 @@ struct rio_info * p; ...@@ -405,7 +406,7 @@ struct rio_info * p;
for ( Host2=0; Host2<p->RIONumHosts; Host2++ ) { for ( Host2=0; Host2<p->RIONumHosts; Host2++ ) {
if (Host2 == Host) if (Host2 == Host)
continue; continue;
if (RIOStrCmp(p->RIOHosts[Host].Name, p->RIOHosts[Host2].Name) if (strcmp(p->RIOHosts[Host].Name, p->RIOHosts[Host2].Name)
== 0) { == 0) {
NameIsUnique = 0; NameIsUnique = 0;
Host1++; Host1++;
...@@ -939,20 +940,6 @@ struct Map *HostMapP; ...@@ -939,20 +940,6 @@ struct Map *HostMapP;
PortP->Store = 0; PortP->Store = 0;
PortP->FirstOpen = 1; PortP->FirstOpen = 1;
/*
** handle the xprint issues
*/
#ifdef XPRINT_SUPPORT
PortP->Xprint.XpActive = 0;
PortP->Xprint.XttyP = &riox_tty[SysPort];
/* TO FROM MAXLEN */
RIOStrNCpy( PortP->Xprint.XpOn, RIOConf.XpOn, MAX_XP_CTRL_LEN );
RIOStrNCpy( PortP->Xprint.XpOff, RIOConf.XpOff, MAX_XP_CTRL_LEN );
PortP->Xprint.XpCps = RIOConf.XpCps;
PortP->Xprint.XpLen = RIOStrlen(PortP->Xprint.XpOn)+
RIOStrlen(PortP->Xprint.XpOff);
#endif
/* /*
** Buffers 'n things ** Buffers 'n things
*/ */
......
...@@ -40,6 +40,7 @@ static char *_riotty_c_sccs_ = "@(#)riotty.c 1.3"; ...@@ -40,6 +40,7 @@ static char *_riotty_c_sccs_ = "@(#)riotty.c 1.3";
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/tty.h> #include <linux/tty.h>
#include <linux/string.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/string.h> #include <asm/string.h>
...@@ -97,6 +98,9 @@ static void RIOClearUp(struct Port *PortP); ...@@ -97,6 +98,9 @@ static void RIOClearUp(struct Port *PortP);
int RIOShortCommand(struct rio_info *p, struct Port *PortP, int RIOShortCommand(struct rio_info *p, struct Port *PortP,
int command, int len, int arg); int command, int len, int arg);
#if 0
static int RIOCookMode(struct ttystatics *);
#endif
extern int conv_vb[]; /* now defined in ttymgr.c */ extern int conv_vb[]; /* now defined in ttymgr.c */
extern int conv_bv[]; /* now defined in ttymgr.c */ extern int conv_bv[]; /* now defined in ttymgr.c */
...@@ -726,7 +730,8 @@ riotclose(void *ptr) ...@@ -726,7 +730,8 @@ riotclose(void *ptr)
** COOK_WELL if the line discipline must be used to do the processing ** COOK_WELL if the line discipline must be used to do the processing
** COOK_MEDIUM if the card can do all the processing necessary. ** COOK_MEDIUM if the card can do all the processing necessary.
*/ */
int #if 0
static int
RIOCookMode(struct ttystatics *tp) RIOCookMode(struct ttystatics *tp)
{ {
/* /*
...@@ -757,7 +762,7 @@ RIOCookMode(struct ttystatics *tp) ...@@ -757,7 +762,7 @@ RIOCookMode(struct ttystatics *tp)
*/ */
return COOK_MEDIUM; return COOK_MEDIUM;
} }
#endif
static void static void
RIOClearUp(PortP) RIOClearUp(PortP)
...@@ -1011,8 +1016,8 @@ riotioctl(struct rio_info *p, struct tty_struct *tty, int cmd, caddr_t arg) ...@@ -1011,8 +1016,8 @@ riotioctl(struct rio_info *p, struct tty_struct *tty, int cmd, caddr_t arg)
pseterr(EFAULT); pseterr(EFAULT);
} }
PortP->Xprint.XpOn[MAX_XP_CTRL_LEN-1] = '\0'; PortP->Xprint.XpOn[MAX_XP_CTRL_LEN-1] = '\0';
PortP->Xprint.XpLen = RIOStrlen(PortP->Xprint.XpOn)+ PortP->Xprint.XpLen = strlen(PortP->Xprint.XpOn)+
RIOStrlen(PortP->Xprint.XpOff); strlen(PortP->Xprint.XpOff);
rio_spin_unlock_irqrestore(&PortP->portSem, flags); rio_spin_unlock_irqrestore(&PortP->portSem, flags);
return 0; return 0;
...@@ -1026,8 +1031,8 @@ riotioctl(struct rio_info *p, struct tty_struct *tty, int cmd, caddr_t arg) ...@@ -1026,8 +1031,8 @@ riotioctl(struct rio_info *p, struct tty_struct *tty, int cmd, caddr_t arg)
pseterr(EFAULT); pseterr(EFAULT);
} }
PortP->Xprint.XpOff[MAX_XP_CTRL_LEN-1] = '\0'; PortP->Xprint.XpOff[MAX_XP_CTRL_LEN-1] = '\0';
PortP->Xprint.XpLen = RIOStrlen(PortP->Xprint.XpOn)+ PortP->Xprint.XpLen = strlen(PortP->Xprint.XpOn)+
RIOStrlen(PortP->Xprint.XpOff); strlen(PortP->Xprint.XpOff);
rio_spin_unlock_irqrestore(&PortP->portSem, flags); rio_spin_unlock_irqrestore(&PortP->portSem, flags);
return 0; return 0;
......
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