[PATCH] trivial annotations in rio

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Al Viro 2006-05-27 00:08:25 -04:00
parent a8bd60705a
commit d886cb586f
17 changed files with 228 additions and 230 deletions

View File

@ -51,7 +51,7 @@ struct Error {
}; };
struct DownLoad { struct DownLoad {
char *DataP; char __user *DataP;
unsigned int Count; unsigned int Count;
unsigned int ProductCode; unsigned int ProductCode;
}; };
@ -83,18 +83,18 @@ struct PortSetup {
struct LpbReq { struct LpbReq {
unsigned int Host; unsigned int Host;
unsigned int Link; unsigned int Link;
struct LPB *LpbP; struct LPB __user *LpbP;
}; };
struct RupReq { struct RupReq {
unsigned int HostNum; unsigned int HostNum;
unsigned int RupNum; unsigned int RupNum;
struct RUP *RupP; struct RUP __user *RupP;
}; };
struct PortReq { struct PortReq {
unsigned int SysPort; unsigned int SysPort;
struct Port *PortP; struct Port __user *PortP;
}; };
struct StreamInfo { struct StreamInfo {
@ -105,12 +105,12 @@ struct StreamInfo {
struct HostReq { struct HostReq {
unsigned int HostNum; unsigned int HostNum;
struct Host *HostP; struct Host __user *HostP;
}; };
struct HostDpRam { struct HostDpRam {
unsigned int HostNum; unsigned int HostNum;
struct DpRam *DpRamP; struct DpRam __user *DpRamP;
}; };
struct DebugCtrl { struct DebugCtrl {

View File

@ -46,7 +46,7 @@ int RIOBootCodeRTA(struct rio_info *, struct DownLoad *);
int RIOBootCodeHOST(struct rio_info *, struct DownLoad *); int RIOBootCodeHOST(struct rio_info *, 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 *, unsigned int, struct Host *, struct PKT *); int RIOBootRup(struct rio_info *, unsigned int, struct Host *, struct PKT __iomem *);
int RIOBootOk(struct rio_info *, struct Host *, unsigned long); int RIOBootOk(struct rio_info *, struct Host *, unsigned long);
int RIORtaBound(struct rio_info *, unsigned int); int RIORtaBound(struct rio_info *, unsigned int);
void rio_fill_host_slot(int, int, unsigned int, struct Host *); void rio_fill_host_slot(int, int, unsigned int, struct Host *);
@ -55,8 +55,8 @@ void rio_fill_host_slot(int, int, unsigned int, struct Host *);
int RIOFoadRta(struct Host *, struct Map *); int RIOFoadRta(struct Host *, struct Map *);
int RIOZombieRta(struct Host *, struct Map *); int RIOZombieRta(struct Host *, struct Map *);
int RIOCommandRta(struct rio_info *, unsigned long, int (*func) (struct Host *, struct Map *)); int RIOCommandRta(struct rio_info *, unsigned long, int (*func) (struct Host *, struct Map *));
int RIOIdentifyRta(struct rio_info *, void *); int RIOIdentifyRta(struct rio_info *, void __user *);
int RIOKillNeighbour(struct rio_info *, void *); int RIOKillNeighbour(struct rio_info *, void __user *);
int RIOSuspendBootRta(struct Host *, int, int); int RIOSuspendBootRta(struct Host *, int, int);
int RIOFoadWakeup(struct rio_info *); int RIOFoadWakeup(struct rio_info *);
struct CmdBlk *RIOGetCmdBlk(void); struct CmdBlk *RIOGetCmdBlk(void);
@ -68,7 +68,8 @@ int RIORFlushEnable(unsigned long, struct CmdBlk *);
int RIOUnUse(unsigned long, struct CmdBlk *); int RIOUnUse(unsigned long, struct CmdBlk *);
/* rioctrl.c */ /* rioctrl.c */
int riocontrol(struct rio_info *, dev_t, int, caddr_t, int); int riocontrol(struct rio_info *, dev_t, int, unsigned long, int);
int RIOPreemptiveCmd(struct rio_info *, struct Port *, unsigned char); int RIOPreemptiveCmd(struct rio_info *, struct Port *, unsigned char);
/* rioinit.c */ /* rioinit.c */
@ -77,13 +78,13 @@ void RIOInitHosts(struct rio_info *, struct RioHostInfo *);
void RIOISAinit(struct rio_info *, int); void RIOISAinit(struct rio_info *, int);
int RIODoAT(struct rio_info *, int, int); 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, void __iomem *, int);
int RIOBoardTest(unsigned long, caddr_t, unsigned char, int); int RIOBoardTest(unsigned long, void __iomem *, unsigned char, 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 *, unsigned int); int RIODefaultName(struct rio_info *, struct Host *, unsigned int);
struct rioVersion *RIOVersid(void); struct rioVersion *RIOVersid(void);
void RIOHostReset(unsigned int, struct DpRam *, unsigned int); void RIOHostReset(unsigned int, struct DpRam __iomem *, unsigned int);
/* riointr.c */ /* riointr.c */
void RIOTxEnable(char *); void RIOTxEnable(char *);
@ -95,14 +96,14 @@ int RIOParam(struct Port *, int, int, int);
int RIODelay(struct Port *PortP, int); int RIODelay(struct Port *PortP, int);
int RIODelay_ni(struct Port *PortP, int); int RIODelay_ni(struct Port *PortP, int);
void ms_timeout(struct Port *); void ms_timeout(struct Port *);
int can_add_transmit(struct PKT **, struct Port *); int can_add_transmit(struct PKT __iomem **, struct Port *);
void add_transmit(struct Port *); void add_transmit(struct Port *);
void put_free_end(struct Host *, struct PKT *); void put_free_end(struct Host *, struct PKT __iomem *);
int can_remove_receive(struct PKT **, struct Port *); int can_remove_receive(struct PKT __iomem **, struct Port *);
void remove_receive(struct Port *); void remove_receive(struct Port *);
/* rioroute.c */ /* rioroute.c */
int RIORouteRup(struct rio_info *, unsigned int, struct Host *, struct PKT *); int RIORouteRup(struct rio_info *, unsigned int, struct Host *, struct PKT __iomem *);
void RIOFixPhbs(struct rio_info *, struct Host *, unsigned int); void RIOFixPhbs(struct rio_info *, struct Host *, unsigned int);
unsigned int GetUnitType(unsigned int); unsigned int GetUnitType(unsigned int);
int RIOSetChange(struct rio_info *); int RIOSetChange(struct rio_info *);
@ -139,7 +140,7 @@ int rio_isr_thread(char *);
struct rio_info *rio_info_store(int cmd, struct rio_info *p); struct rio_info *rio_info_store(int cmd, struct rio_info *p);
#endif #endif
extern void rio_copy_to_card(void *to, void *from, int len); extern void rio_copy_to_card(void __iomem *to, void *from, int len);
extern int rio_minor(struct tty_struct *tty); extern int rio_minor(struct tty_struct *tty);
extern int rio_ismodem(struct tty_struct *tty); extern int rio_ismodem(struct tty_struct *tty);

View File

@ -48,8 +48,8 @@ struct Host {
unsigned char Ivec; /* POLLED or ivec number */ unsigned char Ivec; /* POLLED or ivec number */
unsigned char Mode; /* Control stuff */ unsigned char Mode; /* Control stuff */
unsigned char Slot; /* Slot */ unsigned char Slot; /* Slot */
caddr_t Caddr; /* KV address of DPRAM */ void __iomem *Caddr; /* KV address of DPRAM */
struct DpRam *CardP; /* KV address of DPRAM, with overlay */ struct DpRam __iomem *CardP; /* KV address of DPRAM, with overlay */
unsigned long PaddrP; /* Phys. address of DPRAM */ unsigned long PaddrP; /* Phys. address of DPRAM */
char Name[MAX_NAME_LEN]; /* The name of the host */ char Name[MAX_NAME_LEN]; /* The name of the host */
unsigned int UniqueNum; /* host unique number */ unsigned int UniqueNum; /* host unique number */
@ -57,7 +57,7 @@ struct Host {
unsigned int WorkToBeDone; /* set to true each interrupt */ unsigned int WorkToBeDone; /* set to true each interrupt */
unsigned int InIntr; /* Being serviced? */ unsigned int InIntr; /* Being serviced? */
unsigned int IntSrvDone; /* host's interrupt has been serviced */ unsigned int IntSrvDone; /* host's interrupt has been serviced */
void (*Copy) (void *, void *, int); /* copy func */ void (*Copy) (void *, void __iomem *, int); /* copy func */
struct timer_list timer; struct timer_list timer;
/* /*
** I M P O R T A N T ! ** I M P O R T A N T !
@ -83,11 +83,11 @@ struct Host {
struct Top Topology[LINKS_PER_UNIT]; /* one per link */ struct Top Topology[LINKS_PER_UNIT]; /* one per link */
struct Map Mapping[MAX_RUP]; /* Mappings for host */ struct Map Mapping[MAX_RUP]; /* Mappings for host */
struct PHB *PhbP; /* Pointer to the PHB array */ struct PHB __iomem *PhbP; /* Pointer to the PHB array */
unsigned short *PhbNumP; /* Ptr to Number of PHB's */ unsigned short __iomem *PhbNumP; /* Ptr to Number of PHB's */
struct LPB *LinkStrP; /* Link Structure Array */ struct LPB __iomem *LinkStrP; /* Link Structure Array */
struct RUP *RupP; /* Sixteen real rups here */ struct RUP __iomem *RupP; /* Sixteen real rups here */
struct PARM_MAP *ParmMapP; /* points to the parmmap */ struct PARM_MAP __iomem *ParmMapP; /* points to the parmmap */
unsigned int ExtraUnits[MAX_EXTRA_UNITS]; /* unknown things */ unsigned int ExtraUnits[MAX_EXTRA_UNITS]; /* unknown things */
unsigned int NumExtraBooted; /* how many of the above */ unsigned int NumExtraBooted; /* how many of the above */
/* /*

View File

@ -40,7 +40,7 @@ struct Port {
struct gs_port gs; struct gs_port gs;
int PortNum; /* RIO port no., 0-511 */ int PortNum; /* RIO port no., 0-511 */
struct Host *HostP; struct Host *HostP;
caddr_t Caddr; void __iomem *Caddr;
unsigned short HostPort; /* Port number on host card */ unsigned short HostPort; /* Port number on host card */
unsigned char RupNum; /* Number of RUP for port */ unsigned char RupNum; /* Number of RUP for port */
unsigned char ID2; /* Second ID of RTA for port */ unsigned char ID2; /* Second ID of RTA for port */
@ -92,13 +92,13 @@ struct Port {
#define RIO_RTSFLOW 0x0400 /* RIO's own RTSFLOW flag */ #define RIO_RTSFLOW 0x0400 /* RIO's own RTSFLOW flag */
struct PHB *PhbP; /* pointer to PHB for port */ struct PHB __iomem *PhbP; /* pointer to PHB for port */
u16 *TxAdd; /* Add packets here */ u16 __iomem *TxAdd; /* Add packets here */
u16 *TxStart; /* Start of add array */ u16 __iomem *TxStart; /* Start of add array */
u16 *TxEnd; /* End of add array */ u16 __iomem *TxEnd; /* End of add array */
u16 *RxRemove; /* Remove packets here */ u16 __iomem *RxRemove; /* Remove packets here */
u16 *RxStart; /* Start of remove array */ u16 __iomem *RxStart; /* Start of remove array */
u16 *RxEnd; /* End of remove array */ u16 __iomem *RxEnd; /* End of remove array */
unsigned int RtaUniqueNum; /* Unique number of RTA */ unsigned int RtaUniqueNum; /* Unique number of RTA */
unsigned short PortState; /* status of port */ unsigned short PortState; /* status of port */
unsigned short ModemState; /* status of modem lines */ unsigned short ModemState; /* status of modem lines */

View File

@ -129,8 +129,8 @@
** RIO_OBJ takes hostp->Caddr and a UNIX pointer to an object and ** RIO_OBJ takes hostp->Caddr and a UNIX pointer to an object and
** returns the offset into the DP RAM area. ** returns the offset into the DP RAM area.
*/ */
#define RIO_PTR(C,O) (((unsigned char *)(C))+(0xFFFF&(O))) #define RIO_PTR(C,O) (((unsigned char __iomem *)(C))+(0xFFFF&(O)))
#define RIO_OFF(C,O) ((long)(O)-(long)(C)) #define RIO_OFF(C,O) ((unsigned char __iomem *)(O)-(unsigned char __iomem *)(C))
/* /*
** How to convert from various different device number formats: ** How to convert from various different device number formats:

View File

@ -333,7 +333,7 @@ int RIODelay_ni(struct Port *PortP, int njiffies)
return !RIO_FAIL; return !RIO_FAIL;
} }
void rio_copy_to_card(void *to, void *from, int len) void rio_copy_to_card(void __iomem *to, void *from, int len)
{ {
rio_memcpy_toio(NULL, to, from, len); rio_memcpy_toio(NULL, to, from, len);
} }
@ -573,7 +573,7 @@ static int rio_fw_ioctl(struct inode *inode, struct file *filp, unsigned int cmd
func_enter(); func_enter();
/* The "dev" argument isn't used. */ /* The "dev" argument isn't used. */
rc = riocontrol(p, 0, cmd, (void *) arg, capable(CAP_SYS_ADMIN)); rc = riocontrol(p, 0, cmd, arg, capable(CAP_SYS_ADMIN));
func_exit(); func_exit();
return rc; return rc;
@ -583,6 +583,7 @@ extern int RIOShortCommand(struct rio_info *p, struct Port *PortP, int command,
static int rio_ioctl(struct tty_struct *tty, struct file *filp, unsigned int cmd, unsigned long arg) static int rio_ioctl(struct tty_struct *tty, struct file *filp, unsigned int cmd, unsigned long arg)
{ {
void __user *argp = (void __user *)arg;
int rc; int rc;
struct Port *PortP; struct Port *PortP;
int ival; int ival;
@ -594,14 +595,14 @@ static int rio_ioctl(struct tty_struct *tty, struct file *filp, unsigned int cmd
rc = 0; rc = 0;
switch (cmd) { switch (cmd) {
case TIOCSSOFTCAR: case TIOCSSOFTCAR:
if ((rc = get_user(ival, (unsigned int *) arg)) == 0) { if ((rc = get_user(ival, (unsigned __user *) argp)) == 0) {
tty->termios->c_cflag = (tty->termios->c_cflag & ~CLOCAL) | (ival ? CLOCAL : 0); tty->termios->c_cflag = (tty->termios->c_cflag & ~CLOCAL) | (ival ? CLOCAL : 0);
} }
break; break;
case TIOCGSERIAL: case TIOCGSERIAL:
rc = -EFAULT; rc = -EFAULT;
if (access_ok(VERIFY_WRITE, (void *) arg, sizeof(struct serial_struct))) if (access_ok(VERIFY_WRITE, argp, sizeof(struct serial_struct)))
rc = gs_getserial(&PortP->gs, (struct serial_struct *) arg); rc = gs_getserial(&PortP->gs, argp);
break; break;
case TCSBRK: case TCSBRK:
if (PortP->State & RIO_DELETED) { if (PortP->State & RIO_DELETED) {
@ -631,8 +632,8 @@ static int rio_ioctl(struct tty_struct *tty, struct file *filp, unsigned int cmd
break; break;
case TIOCSSERIAL: case TIOCSSERIAL:
rc = -EFAULT; rc = -EFAULT;
if (access_ok(VERIFY_READ, (void *) arg, sizeof(struct serial_struct))) if (access_ok(VERIFY_READ, argp, sizeof(struct serial_struct)))
rc = gs_setserial(&PortP->gs, (struct serial_struct *) arg); rc = gs_setserial(&PortP->gs, argp);
break; break;
default: default:
rc = -ENOIOCTLCMD; rc = -ENOIOCTLCMD;
@ -919,7 +920,7 @@ static void __exit rio_release_drivers(void)
static void fix_rio_pci(struct pci_dev *pdev) static void fix_rio_pci(struct pci_dev *pdev)
{ {
unsigned long hwbase; unsigned long hwbase;
unsigned char *rebase; unsigned char __iomem *rebase;
unsigned int t; unsigned int t;
#define CNTRL_REG_OFFSET 0x50 #define CNTRL_REG_OFFSET 0x50
@ -999,7 +1000,7 @@ static int __init rio_init(void)
if (((1 << hp->Ivec) & rio_irqmask) == 0) if (((1 << hp->Ivec) & rio_irqmask) == 0)
hp->Ivec = 0; hp->Ivec = 0;
hp->Caddr = ioremap(p->RIOHosts[p->RIONumHosts].PaddrP, RIO_WINDOW_LEN); hp->Caddr = ioremap(p->RIOHosts[p->RIONumHosts].PaddrP, RIO_WINDOW_LEN);
hp->CardP = (struct DpRam *) hp->Caddr; hp->CardP = (struct DpRam __iomem *) hp->Caddr;
hp->Type = RIO_PCI; hp->Type = RIO_PCI;
hp->Copy = rio_copy_to_card; hp->Copy = rio_copy_to_card;
hp->Mode = RIO_PCI_BOOT_FROM_RAM; hp->Mode = RIO_PCI_BOOT_FROM_RAM;
@ -1021,7 +1022,7 @@ static int __init rio_init(void)
p->RIONumHosts++; p->RIONumHosts++;
found++; found++;
} else { } else {
iounmap((char *) (p->RIOHosts[p->RIONumHosts].Caddr)); iounmap(p->RIOHosts[p->RIONumHosts].Caddr);
} }
} }
@ -1047,7 +1048,7 @@ static int __init rio_init(void)
hp->Ivec = 0; hp->Ivec = 0;
hp->Ivec |= 0x8000; /* Mark as non-sharable */ hp->Ivec |= 0x8000; /* Mark as non-sharable */
hp->Caddr = ioremap(p->RIOHosts[p->RIONumHosts].PaddrP, RIO_WINDOW_LEN); hp->Caddr = ioremap(p->RIOHosts[p->RIONumHosts].PaddrP, RIO_WINDOW_LEN);
hp->CardP = (struct DpRam *) hp->Caddr; hp->CardP = (struct DpRam __iomem *) hp->Caddr;
hp->Type = RIO_PCI; hp->Type = RIO_PCI;
hp->Copy = rio_copy_to_card; hp->Copy = rio_copy_to_card;
hp->Mode = RIO_PCI_BOOT_FROM_RAM; hp->Mode = RIO_PCI_BOOT_FROM_RAM;
@ -1070,7 +1071,7 @@ static int __init rio_init(void)
p->RIONumHosts++; p->RIONumHosts++;
found++; found++;
} else { } else {
iounmap((char *) (p->RIOHosts[p->RIONumHosts].Caddr)); iounmap(p->RIOHosts[p->RIONumHosts].Caddr);
} }
#else #else
printk(KERN_ERR "Found an older RIO PCI card, but the driver is not " "compiled to support it.\n"); printk(KERN_ERR "Found an older RIO PCI card, but the driver is not " "compiled to support it.\n");
@ -1085,7 +1086,7 @@ static int __init rio_init(void)
/* There was something about the IRQs of these cards. 'Forget what.--REW */ /* There was something about the IRQs of these cards. 'Forget what.--REW */
hp->Ivec = 0; hp->Ivec = 0;
hp->Caddr = ioremap(p->RIOHosts[p->RIONumHosts].PaddrP, RIO_WINDOW_LEN); hp->Caddr = ioremap(p->RIOHosts[p->RIONumHosts].PaddrP, RIO_WINDOW_LEN);
hp->CardP = (struct DpRam *) hp->Caddr; hp->CardP = (struct DpRam __iomem *) hp->Caddr;
hp->Type = RIO_AT; hp->Type = RIO_AT;
hp->Copy = rio_copy_to_card; /* AT card PCI???? - PVDL hp->Copy = rio_copy_to_card; /* AT card PCI???? - PVDL
* -- YES! this is now a normal copy. Only the * -- YES! this is now a normal copy. Only the
@ -1111,7 +1112,7 @@ static int __init rio_init(void)
} }
if (!okboard) if (!okboard)
iounmap((char *) (hp->Caddr)); iounmap(hp->Caddr);
} }
} }

View File

@ -131,24 +131,24 @@ struct vpd_prom {
#ifdef CONFIG_RIO_OLDPCI #ifdef CONFIG_RIO_OLDPCI
static inline void *rio_memcpy_toio(void *dummy, void *dest, void *source, int n) static inline void __iomem *rio_memcpy_toio(void __iomem *dummy, void __iomem *dest, void *source, int n)
{ {
char *dst = dest; char __iomem *dst = dest;
char *src = source; char *src = source;
while (n--) { while (n--) {
writeb(*src++, dst++); writeb(*src++, dst++);
(void) readb(dummy); (void) readb(dummy); /* WTF? */
} }
return dest; return dest;
} }
static inline void *rio_memcpy_fromio(void *dest, void *source, int n) static inline void *rio_memcpy_fromio(void *dest, void __iomem *source, int n)
{ {
char *dst = dest; char *dst = dest;
char *src = source; char __iomem *src = source;
while (n--) while (n--)
*dst++ = readb(src++); *dst++ = readb(src++);

View File

@ -71,7 +71,7 @@
#include "cmdblk.h" #include "cmdblk.h"
#include "route.h" #include "route.h"
static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int Rup, struct PktCmd *PktCmdP); static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int Rup, struct PktCmd __iomem *PktCmdP);
static const unsigned char RIOAtVec2Ctrl[] = { static const unsigned char RIOAtVec2Ctrl[] = {
/* 0 */ INTERRUPT_DISABLE, /* 0 */ INTERRUPT_DISABLE,
@ -204,13 +204,13 @@ void rio_start_card_running(struct Host *HostP)
int RIOBootCodeHOST(struct rio_info *p, struct DownLoad *rbp) int RIOBootCodeHOST(struct rio_info *p, struct DownLoad *rbp)
{ {
struct Host *HostP; struct Host *HostP;
u8 *Cad; u8 __iomem *Cad;
PARM_MAP *ParmMapP; PARM_MAP __iomem *ParmMapP;
int RupN; int RupN;
int PortN; int PortN;
unsigned int host; unsigned int host;
u8 *StartP; u8 __iomem *StartP;
u8 *DestP; u8 __iomem *DestP;
int wait_count; int wait_count;
u16 OldParmMap; u16 OldParmMap;
u16 offset; /* It is very important that this is a u16 */ u16 offset; /* It is very important that this is a u16 */
@ -262,7 +262,7 @@ int RIOBootCodeHOST(struct rio_info *p, struct DownLoad *rbp)
** Ensure that the host really is stopped. ** Ensure that the host really is stopped.
** Disable it's external bus & twang its reset line. ** Disable it's external bus & twang its reset line.
*/ */
RIOHostReset(HostP->Type, (struct DpRam *) HostP->CardP, HostP->Slot); RIOHostReset(HostP->Type, HostP->CardP, HostP->Slot);
/* /*
** Copy the data directly from user space to the SRAM. ** Copy the data directly from user space to the SRAM.
@ -366,7 +366,7 @@ int RIOBootCodeHOST(struct rio_info *p, struct DownLoad *rbp)
** a short branch to 0x7FF8, where a long branch is coded. ** a short branch to 0x7FF8, where a long branch is coded.
*/ */
DestP = (u8 *) &Cad[0x7FF8]; /* <<<---- READ THE ABOVE COMMENTS */ DestP = &Cad[0x7FF8]; /* <<<---- READ THE ABOVE COMMENTS */
#define NFIX(N) (0x60 | (N)) /* .O = (~(.O + N))<<4 */ #define NFIX(N) (0x60 | (N)) /* .O = (~(.O + N))<<4 */
#define PFIX(N) (0x20 | (N)) /* .O = (.O + N)<<4 */ #define PFIX(N) (0x20 | (N)) /* .O = (.O + N)<<4 */
@ -438,7 +438,7 @@ int RIOBootCodeHOST(struct rio_info *p, struct DownLoad *rbp)
rio_dprintk(RIO_DEBUG_BOOT, "RIO Mesg Run Fail\n"); rio_dprintk(RIO_DEBUG_BOOT, "RIO Mesg Run Fail\n");
HostP->Flags &= ~RUN_STATE; HostP->Flags &= ~RUN_STATE;
HostP->Flags |= RC_STUFFED; HostP->Flags |= RC_STUFFED;
RIOHostReset( HostP->Type, (struct DpRam *)HostP->CardP, HostP->Slot ); RIOHostReset( HostP->Type, HostP->CardP, HostP->Slot );
continue; continue;
} }
@ -453,9 +453,9 @@ int RIOBootCodeHOST(struct rio_info *p, struct DownLoad *rbp)
/* /*
** Grab a 32 bit pointer to the parmmap structure ** Grab a 32 bit pointer to the parmmap structure
*/ */
ParmMapP = (PARM_MAP *) RIO_PTR(Cad, readw(&HostP->__ParmMapR)); ParmMapP = (PARM_MAP __iomem *) RIO_PTR(Cad, readw(&HostP->__ParmMapR));
rio_dprintk(RIO_DEBUG_BOOT, "ParmMapP : %p\n", ParmMapP); rio_dprintk(RIO_DEBUG_BOOT, "ParmMapP : %p\n", ParmMapP);
ParmMapP = (PARM_MAP *) ((unsigned long) Cad + readw(&HostP->__ParmMapR)); ParmMapP = (PARM_MAP __iomem *)(Cad + readw(&HostP->__ParmMapR));
rio_dprintk(RIO_DEBUG_BOOT, "ParmMapP : %p\n", ParmMapP); rio_dprintk(RIO_DEBUG_BOOT, "ParmMapP : %p\n", ParmMapP);
/* /*
@ -468,7 +468,7 @@ int RIOBootCodeHOST(struct rio_info *p, struct DownLoad *rbp)
rio_dprintk(RIO_DEBUG_BOOT, "Links = 0x%x\n", readw(&ParmMapP->links)); rio_dprintk(RIO_DEBUG_BOOT, "Links = 0x%x\n", readw(&ParmMapP->links));
HostP->Flags &= ~RUN_STATE; HostP->Flags &= ~RUN_STATE;
HostP->Flags |= RC_STUFFED; HostP->Flags |= RC_STUFFED;
RIOHostReset( HostP->Type, (struct DpRam *)HostP->CardP, HostP->Slot ); RIOHostReset( HostP->Type, HostP->CardP, HostP->Slot );
continue; continue;
} }
@ -491,7 +491,7 @@ int RIOBootCodeHOST(struct rio_info *p, struct DownLoad *rbp)
rio_dprintk(RIO_DEBUG_BOOT, "Timedout waiting for init_done\n"); rio_dprintk(RIO_DEBUG_BOOT, "Timedout waiting for init_done\n");
HostP->Flags &= ~RUN_STATE; HostP->Flags &= ~RUN_STATE;
HostP->Flags |= RC_STUFFED; HostP->Flags |= RC_STUFFED;
RIOHostReset( HostP->Type, (struct DpRam *)HostP->CardP, HostP->Slot ); RIOHostReset( HostP->Type, HostP->CardP, HostP->Slot );
continue; continue;
} }
@ -512,10 +512,10 @@ int RIOBootCodeHOST(struct rio_info *p, struct DownLoad *rbp)
** 32 bit pointers for the driver in ioremap space. ** 32 bit pointers for the driver in ioremap space.
*/ */
HostP->ParmMapP = ParmMapP; HostP->ParmMapP = ParmMapP;
HostP->PhbP = (struct PHB *) RIO_PTR(Cad, readw(&ParmMapP->phb_ptr)); HostP->PhbP = (struct PHB __iomem *) RIO_PTR(Cad, readw(&ParmMapP->phb_ptr));
HostP->RupP = (struct RUP *) RIO_PTR(Cad, readw(&ParmMapP->rups)); HostP->RupP = (struct RUP __iomem *) RIO_PTR(Cad, readw(&ParmMapP->rups));
HostP->PhbNumP = (unsigned short *) RIO_PTR(Cad, readw(&ParmMapP->phb_num_ptr)); HostP->PhbNumP = (unsigned short __iomem *) RIO_PTR(Cad, readw(&ParmMapP->phb_num_ptr));
HostP->LinkStrP = (struct LPB *) RIO_PTR(Cad, readw(&ParmMapP->link_str_ptr)); HostP->LinkStrP = (struct LPB __iomem *) RIO_PTR(Cad, readw(&ParmMapP->link_str_ptr));
/* /*
** point the UnixRups at the real Rups ** point the UnixRups at the real Rups
@ -540,7 +540,7 @@ int RIOBootCodeHOST(struct rio_info *p, struct DownLoad *rbp)
for (PortN = p->RIOFirstPortsMapped; PortN < p->RIOLastPortsMapped + PORTS_PER_RTA; PortN++) { for (PortN = p->RIOFirstPortsMapped; PortN < p->RIOLastPortsMapped + PORTS_PER_RTA; PortN++) {
if (p->RIOPortp[PortN]->HostP == HostP) { if (p->RIOPortp[PortN]->HostP == HostP) {
struct Port *PortP = p->RIOPortp[PortN]; struct Port *PortP = p->RIOPortp[PortN];
struct PHB *PhbP; struct PHB __iomem *PhbP;
/* int oldspl; */ /* int oldspl; */
if (!PortP->Mapped) if (!PortP->Mapped)
@ -551,12 +551,12 @@ int RIOBootCodeHOST(struct rio_info *p, struct DownLoad *rbp)
PortP->PhbP = PhbP; PortP->PhbP = PhbP;
PortP->TxAdd = (u16 *) RIO_PTR(Cad, readw(&PhbP->tx_add)); PortP->TxAdd = (u16 __iomem *) RIO_PTR(Cad, readw(&PhbP->tx_add));
PortP->TxStart = (u16 *) RIO_PTR(Cad, readw(&PhbP->tx_start)); PortP->TxStart = (u16 __iomem *) RIO_PTR(Cad, readw(&PhbP->tx_start));
PortP->TxEnd = (u16 *) RIO_PTR(Cad, readw(&PhbP->tx_end)); PortP->TxEnd = (u16 __iomem *) RIO_PTR(Cad, readw(&PhbP->tx_end));
PortP->RxRemove = (u16 *) RIO_PTR(Cad, readw(&PhbP->rx_remove)); PortP->RxRemove = (u16 __iomem *) RIO_PTR(Cad, readw(&PhbP->rx_remove));
PortP->RxStart = (u16 *) RIO_PTR(Cad, readw(&PhbP->rx_start)); PortP->RxStart = (u16 __iomem *) RIO_PTR(Cad, readw(&PhbP->rx_start));
PortP->RxEnd = (u16 *) RIO_PTR(Cad, readw(&PhbP->rx_end)); PortP->RxEnd = (u16 __iomem *) RIO_PTR(Cad, readw(&PhbP->rx_end));
rio_spin_unlock_irqrestore(&PortP->portSem, flags); rio_spin_unlock_irqrestore(&PortP->portSem, flags);
/* /*
@ -601,9 +601,9 @@ int RIOBootCodeHOST(struct rio_info *p, struct DownLoad *rbp)
* return 1. If we havent, then return 0. * return 1. If we havent, then return 0.
*/ */
int RIOBootRup(struct rio_info *p, unsigned int Rup, struct Host *HostP, struct PKT *PacketP) int RIOBootRup(struct rio_info *p, unsigned int Rup, struct Host *HostP, struct PKT __iomem *PacketP)
{ {
struct PktCmd *PktCmdP = (struct PktCmd *) PacketP->data; struct PktCmd __iomem *PktCmdP = (struct PktCmd __iomem *) PacketP->data;
struct PktCmd_M *PktReplyP; struct PktCmd_M *PktReplyP;
struct CmdBlk *CmdBlkP; struct CmdBlk *CmdBlkP;
unsigned int sequence; unsigned int sequence;
@ -722,7 +722,7 @@ int RIOBootRup(struct rio_info *p, unsigned int Rup, struct Host *HostP, struct
* RtaUniq is the booted RTA. * RtaUniq is the booted RTA.
*/ */
static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int Rup, struct PktCmd *PktCmdP) static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int Rup, struct PktCmd __iomem *PktCmdP)
{ {
struct Map *MapP = NULL; struct Map *MapP = NULL;
struct Map *MapP2 = NULL; struct Map *MapP2 = NULL;

View File

@ -180,7 +180,7 @@ int RIOCommandRta(struct rio_info *p, unsigned long RtaUnique, int (*func) (stru
} }
int RIOIdentifyRta(struct rio_info *p, void * arg) int RIOIdentifyRta(struct rio_info *p, void __user * arg)
{ {
unsigned int Host; unsigned int Host;
@ -245,7 +245,7 @@ int RIOIdentifyRta(struct rio_info *p, void * arg)
} }
int RIOKillNeighbour(struct rio_info *p, void * arg) int RIOKillNeighbour(struct rio_info *p, void __user * arg)
{ {
uint Host; uint Host;
uint ID; uint ID;
@ -370,9 +370,9 @@ int RIOFoadWakeup(struct rio_info *p)
/* /*
** Incoming command on the COMMAND_RUP to be processed. ** Incoming command on the COMMAND_RUP to be processed.
*/ */
static int RIOCommandRup(struct rio_info *p, uint Rup, struct Host *HostP, struct PKT * PacketP) static int RIOCommandRup(struct rio_info *p, uint Rup, struct Host *HostP, struct PKT __iomem *PacketP)
{ {
struct PktCmd *PktCmdP = (struct PktCmd *) PacketP->data; struct PktCmd __iomem *PktCmdP = (struct PktCmd __iomem *)PacketP->data;
struct Port *PortP; struct Port *PortP;
struct UnixRup *UnixRupP; struct UnixRup *UnixRupP;
unsigned short SysPort; unsigned short SysPort;
@ -601,7 +601,7 @@ int RIOQueueCmdBlk(struct Host *HostP, uint Rup, struct CmdBlk *CmdBlkP)
/* /*
** Whammy! blat that pack! ** Whammy! blat that pack!
*/ */
HostP->Copy((caddr_t) & CmdBlkP->Packet, RIO_PTR(HostP->Caddr, UnixRupP->RupP->txpkt), sizeof(struct PKT)); HostP->Copy(&CmdBlkP->Packet, RIO_PTR(HostP->Caddr, UnixRupP->RupP->txpkt), sizeof(struct PKT));
/* /*
** place command packet on the pending position. ** place command packet on the pending position.
@ -655,7 +655,7 @@ void RIOPollHostCommands(struct rio_info *p, struct Host *HostP)
{ {
struct CmdBlk *CmdBlkP; struct CmdBlk *CmdBlkP;
struct UnixRup *UnixRupP; struct UnixRup *UnixRupP;
struct PKT *PacketP; struct PKT __iomem *PacketP;
unsigned short Rup; unsigned short Rup;
unsigned long flags; unsigned long flags;
@ -676,7 +676,7 @@ void RIOPollHostCommands(struct rio_info *p, struct Host *HostP)
if (readw(&UnixRupP->RupP->rxcontrol) != RX_RUP_INACTIVE) { if (readw(&UnixRupP->RupP->rxcontrol) != RX_RUP_INACTIVE) {
int FreeMe; int FreeMe;
PacketP = (struct PKT *) RIO_PTR(HostP->Caddr, readw(&UnixRupP->RupP->rxpkt)); PacketP = (struct PKT __iomem *) RIO_PTR(HostP->Caddr, readw(&UnixRupP->RupP->rxpkt));
switch (readb(&PacketP->dest_port)) { switch (readb(&PacketP->dest_port)) {
case BOOT_RUP: case BOOT_RUP:
@ -696,7 +696,7 @@ void RIOPollHostCommands(struct rio_info *p, struct Host *HostP)
FreeMe = RIOCommandRup(p, Rup, HostP, PacketP); FreeMe = RIOCommandRup(p, Rup, HostP, PacketP);
if (PacketP->data[5] == MEMDUMP) { if (PacketP->data[5] == MEMDUMP) {
rio_dprintk(RIO_DEBUG_CMD, "Memdump from 0x%x complete\n", *(unsigned short *) & (PacketP->data[6])); rio_dprintk(RIO_DEBUG_CMD, "Memdump from 0x%x complete\n", *(unsigned short *) & (PacketP->data[6]));
HostP->Copy((caddr_t) & (PacketP->data[8]), (caddr_t) p->RIOMemDump, 32); HostP->Copy(&(PacketP->data[8]), p->RIOMemDump, 32);
} }
rio_spin_lock_irqsave(&UnixRupP->RupLock, flags); rio_spin_lock_irqsave(&UnixRupP->RupLock, flags);
break; break;
@ -782,7 +782,7 @@ void RIOPollHostCommands(struct rio_info *p, struct Host *HostP)
/* /*
** Whammy! blat that pack! ** Whammy! blat that pack!
*/ */
HostP->Copy((caddr_t) & CmdBlkP->Packet, RIO_PTR(HostP->Caddr, UnixRupP->RupP->txpkt), sizeof(struct PKT)); HostP->Copy(&CmdBlkP->Packet, RIO_PTR(HostP->Caddr, UnixRupP->RupP->txpkt), sizeof(struct PKT));
/* /*
** remove the command from the rup command queue... ** remove the command from the rup command queue...
@ -824,7 +824,7 @@ int RIOWFlushMark(unsigned long iPortP, struct CmdBlk *CmdBlkP)
int RIORFlushEnable(unsigned long iPortP, struct CmdBlk *CmdBlkP) int RIORFlushEnable(unsigned long iPortP, struct CmdBlk *CmdBlkP)
{ {
struct Port *PortP = (struct Port *) iPortP; struct Port *PortP = (struct Port *) iPortP;
struct PKT *PacketP; struct PKT __iomem *PacketP;
unsigned long flags; unsigned long flags;
rio_spin_lock_irqsave(&PortP->portSem, flags); rio_spin_lock_irqsave(&PortP->portSem, flags);

View File

@ -80,7 +80,7 @@ static char *_rioctrl_c_sccs_ = "@(#)rioctrl.c 1.3";
static struct LpbReq LpbReq; static struct LpbReq LpbReq;
static struct RupReq RupReq; static struct RupReq RupReq;
static struct PortReq PortReq; static struct PortReq PortReq;
static struct HostReq HostReq; static struct HostReq HostReq; /* oh really? global? and no locking? */
static struct HostDpRam HostDpRam; static struct HostDpRam HostDpRam;
static struct DebugCtrl DebugCtrl; static struct DebugCtrl DebugCtrl;
static struct Map MapEnt; static struct Map MapEnt;
@ -126,12 +126,7 @@ 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))
int riocontrol(p, dev, cmd, arg, su) int riocontrol(struct rio_info *p, dev_t dev, int cmd, unsigned long arg, int su)
struct rio_info *p;
dev_t dev;
int cmd;
caddr_t arg;
int su;
{ {
uint Host; /* leave me unsigned! */ uint Host; /* leave me unsigned! */
uint port; /* and me! */ uint port; /* and me! */
@ -139,9 +134,10 @@ int su;
ushort loop; ushort loop;
int Entry; int Entry;
struct Port *PortP; struct Port *PortP;
struct PKT *PacketP; struct PKT __iomem *PacketP;
int retval = 0; int retval = 0;
unsigned long flags; unsigned long flags;
void __user *argp = (void __user *)arg;
func_enter(); func_enter();
@ -149,7 +145,7 @@ int su;
Host = 0; Host = 0;
PortP = NULL; PortP = NULL;
rio_dprintk(RIO_DEBUG_CTRL, "control ioctl cmd: 0x%x arg: %p\n", cmd, arg); rio_dprintk(RIO_DEBUG_CTRL, "control ioctl cmd: 0x%x arg: %p\n", cmd, argp);
switch (cmd) { switch (cmd) {
/* /*
@ -160,11 +156,11 @@ int su;
** otherwise just the specified host card will be changed. ** otherwise just the specified host card will be changed.
*/ */
case RIO_SET_TIMER: case RIO_SET_TIMER:
rio_dprintk(RIO_DEBUG_CTRL, "RIO_SET_TIMER to %ldms\n", (unsigned long)arg); rio_dprintk(RIO_DEBUG_CTRL, "RIO_SET_TIMER to %ldms\n", arg);
{ {
int host, value; int host, value;
host = ((unsigned long) arg >> 16) & 0x0000FFFF; host = (arg >> 16) & 0x0000FFFF;
value = (unsigned long) arg & 0x0000ffff; value = arg & 0x0000ffff;
if (host == -1) { if (host == -1) {
for (host = 0; host < p->RIONumHosts; host++) { for (host = 0; host < p->RIONumHosts; host++) {
if (p->RIOHosts[host].Flags == RC_RUNNING) { if (p->RIOHosts[host].Flags == RC_RUNNING) {
@ -183,26 +179,26 @@ int su;
case RIO_FOAD_RTA: case RIO_FOAD_RTA:
rio_dprintk(RIO_DEBUG_CTRL, "RIO_FOAD_RTA\n"); rio_dprintk(RIO_DEBUG_CTRL, "RIO_FOAD_RTA\n");
return RIOCommandRta(p, (unsigned long)arg, RIOFoadRta); return RIOCommandRta(p, arg, RIOFoadRta);
case RIO_ZOMBIE_RTA: case RIO_ZOMBIE_RTA:
rio_dprintk(RIO_DEBUG_CTRL, "RIO_ZOMBIE_RTA\n"); rio_dprintk(RIO_DEBUG_CTRL, "RIO_ZOMBIE_RTA\n");
return RIOCommandRta(p, (unsigned long)arg, RIOZombieRta); return RIOCommandRta(p, arg, RIOZombieRta);
case RIO_IDENTIFY_RTA: case RIO_IDENTIFY_RTA:
rio_dprintk(RIO_DEBUG_CTRL, "RIO_IDENTIFY_RTA\n"); rio_dprintk(RIO_DEBUG_CTRL, "RIO_IDENTIFY_RTA\n");
return RIOIdentifyRta(p, arg); return RIOIdentifyRta(p, argp);
case RIO_KILL_NEIGHBOUR: case RIO_KILL_NEIGHBOUR:
rio_dprintk(RIO_DEBUG_CTRL, "RIO_KILL_NEIGHBOUR\n"); rio_dprintk(RIO_DEBUG_CTRL, "RIO_KILL_NEIGHBOUR\n");
return RIOKillNeighbour(p, arg); return RIOKillNeighbour(p, argp);
case SPECIAL_RUP_CMD: case SPECIAL_RUP_CMD:
{ {
struct CmdBlk *CmdBlkP; struct CmdBlk *CmdBlkP;
rio_dprintk(RIO_DEBUG_CTRL, "SPECIAL_RUP_CMD\n"); rio_dprintk(RIO_DEBUG_CTRL, "SPECIAL_RUP_CMD\n");
if (copy_from_user(&SpecialRupCmd, arg, sizeof(SpecialRupCmd))) { if (copy_from_user(&SpecialRupCmd, argp, sizeof(SpecialRupCmd))) {
rio_dprintk(RIO_DEBUG_CTRL, "SPECIAL_RUP_CMD copy failed\n"); rio_dprintk(RIO_DEBUG_CTRL, "SPECIAL_RUP_CMD copy failed\n");
p->RIOError.Error = COPYIN_FAILED; p->RIOError.Error = COPYIN_FAILED;
return -EFAULT; return -EFAULT;
@ -239,7 +235,7 @@ int su;
if ((retval = RIOApel(p)) != 0) if ((retval = RIOApel(p)) != 0)
return retval; return retval;
if (copy_to_user(arg, p->RIOConnectTable, TOTAL_MAP_ENTRIES * sizeof(struct Map))) { if (copy_to_user(argp, p->RIOConnectTable, TOTAL_MAP_ENTRIES * sizeof(struct Map))) {
rio_dprintk(RIO_DEBUG_CTRL, "RIO_GET_TABLE copy failed\n"); rio_dprintk(RIO_DEBUG_CTRL, "RIO_GET_TABLE copy failed\n");
p->RIOError.Error = COPYOUT_FAILED; p->RIOError.Error = COPYOUT_FAILED;
return -EFAULT; return -EFAULT;
@ -284,7 +280,7 @@ int su;
p->RIOError.Error = NOT_SUPER_USER; p->RIOError.Error = NOT_SUPER_USER;
return -EPERM; return -EPERM;
} }
if (copy_from_user(&p->RIOConnectTable[0], arg, TOTAL_MAP_ENTRIES * sizeof(struct Map))) { if (copy_from_user(&p->RIOConnectTable[0], argp, TOTAL_MAP_ENTRIES * sizeof(struct Map))) {
rio_dprintk(RIO_DEBUG_CTRL, "RIO_PUT_TABLE copy failed\n"); rio_dprintk(RIO_DEBUG_CTRL, "RIO_PUT_TABLE copy failed\n");
p->RIOError.Error = COPYIN_FAILED; p->RIOError.Error = COPYIN_FAILED;
return -EFAULT; return -EFAULT;
@ -330,7 +326,7 @@ int su;
p->RIOError.Error = NOT_SUPER_USER; p->RIOError.Error = NOT_SUPER_USER;
return -EPERM; return -EPERM;
} }
if (copy_to_user(arg, p->RIOBindTab, (sizeof(ulong) * MAX_RTA_BINDINGS))) { if (copy_to_user(argp, p->RIOBindTab, (sizeof(ulong) * MAX_RTA_BINDINGS))) {
rio_dprintk(RIO_DEBUG_CTRL, "RIO_GET_BINDINGS copy failed\n"); rio_dprintk(RIO_DEBUG_CTRL, "RIO_GET_BINDINGS copy failed\n");
p->RIOError.Error = COPYOUT_FAILED; p->RIOError.Error = COPYOUT_FAILED;
return -EFAULT; return -EFAULT;
@ -349,7 +345,7 @@ int su;
p->RIOError.Error = NOT_SUPER_USER; p->RIOError.Error = NOT_SUPER_USER;
return -EPERM; return -EPERM;
} }
if (copy_from_user(&p->RIOBindTab[0], arg, (sizeof(ulong) * MAX_RTA_BINDINGS))) { if (copy_from_user(&p->RIOBindTab[0], argp, (sizeof(ulong) * MAX_RTA_BINDINGS))) {
rio_dprintk(RIO_DEBUG_CTRL, "RIO_PUT_BINDINGS copy failed\n"); rio_dprintk(RIO_DEBUG_CTRL, "RIO_PUT_BINDINGS copy failed\n");
p->RIOError.Error = COPYIN_FAILED; p->RIOError.Error = COPYIN_FAILED;
return -EFAULT; return -EFAULT;
@ -373,12 +369,12 @@ int su;
for (Entry = 0; Entry < MAX_RTA_BINDINGS; Entry++) { for (Entry = 0; Entry < MAX_RTA_BINDINGS; Entry++) {
if ((EmptySlot == -1) && (p->RIOBindTab[Entry] == 0L)) if ((EmptySlot == -1) && (p->RIOBindTab[Entry] == 0L))
EmptySlot = Entry; EmptySlot = Entry;
else if (p->RIOBindTab[Entry] == (long)arg) { else if (p->RIOBindTab[Entry] == arg) {
/* /*
** Already exists - delete ** Already exists - delete
*/ */
p->RIOBindTab[Entry] = 0L; p->RIOBindTab[Entry] = 0L;
rio_dprintk(RIO_DEBUG_CTRL, "Removing Rta %ld from p->RIOBindTab\n", (unsigned long)arg); rio_dprintk(RIO_DEBUG_CTRL, "Removing Rta %ld from p->RIOBindTab\n", arg);
return 0; return 0;
} }
} }
@ -386,10 +382,10 @@ int su;
** Dosen't exist - add ** Dosen't exist - add
*/ */
if (EmptySlot != -1) { if (EmptySlot != -1) {
p->RIOBindTab[EmptySlot] = (unsigned long)arg; p->RIOBindTab[EmptySlot] = arg;
rio_dprintk(RIO_DEBUG_CTRL, "Adding Rta %lx to p->RIOBindTab\n", (unsigned long) arg); rio_dprintk(RIO_DEBUG_CTRL, "Adding Rta %lx to p->RIOBindTab\n", arg);
} else { } else {
rio_dprintk(RIO_DEBUG_CTRL, "p->RIOBindTab full! - Rta %lx not added\n", (unsigned long) arg); rio_dprintk(RIO_DEBUG_CTRL, "p->RIOBindTab full! - Rta %lx not added\n", arg);
return -ENOMEM; return -ENOMEM;
} }
return 0; return 0;
@ -397,7 +393,7 @@ int su;
case RIO_RESUME: case RIO_RESUME:
rio_dprintk(RIO_DEBUG_CTRL, "RIO_RESUME\n"); rio_dprintk(RIO_DEBUG_CTRL, "RIO_RESUME\n");
port = (unsigned long) arg; port = arg;
if ((port < 0) || (port > 511)) { if ((port < 0) || (port > 511)) {
rio_dprintk(RIO_DEBUG_CTRL, "RIO_RESUME: Bad port number %d\n", port); rio_dprintk(RIO_DEBUG_CTRL, "RIO_RESUME: Bad port number %d\n", port);
p->RIOError.Error = PORT_NUMBER_OUT_OF_RANGE; p->RIOError.Error = PORT_NUMBER_OUT_OF_RANGE;
@ -433,7 +429,7 @@ int su;
p->RIOError.Error = NOT_SUPER_USER; p->RIOError.Error = NOT_SUPER_USER;
return -EPERM; return -EPERM;
} }
if (copy_from_user(&MapEnt, arg, sizeof(MapEnt))) { if (copy_from_user(&MapEnt, argp, sizeof(MapEnt))) {
rio_dprintk(RIO_DEBUG_CTRL, "Copy from user space failed\n"); rio_dprintk(RIO_DEBUG_CTRL, "Copy from user space failed\n");
p->RIOError.Error = COPYIN_FAILED; p->RIOError.Error = COPYIN_FAILED;
return -EFAULT; return -EFAULT;
@ -447,7 +443,7 @@ int su;
p->RIOError.Error = NOT_SUPER_USER; p->RIOError.Error = NOT_SUPER_USER;
return -EPERM; return -EPERM;
} }
if (copy_from_user(&MapEnt, arg, sizeof(MapEnt))) { if (copy_from_user(&MapEnt, argp, sizeof(MapEnt))) {
rio_dprintk(RIO_DEBUG_CTRL, "Copy from user space failed\n"); rio_dprintk(RIO_DEBUG_CTRL, "Copy from user space failed\n");
p->RIOError.Error = COPYIN_FAILED; p->RIOError.Error = COPYIN_FAILED;
return -EFAULT; return -EFAULT;
@ -461,7 +457,7 @@ int su;
p->RIOError.Error = NOT_SUPER_USER; p->RIOError.Error = NOT_SUPER_USER;
return -EPERM; return -EPERM;
} }
if (copy_from_user(&MapEnt, arg, sizeof(MapEnt))) { if (copy_from_user(&MapEnt, argp, sizeof(MapEnt))) {
rio_dprintk(RIO_DEBUG_CTRL, "Copy from data space failed\n"); rio_dprintk(RIO_DEBUG_CTRL, "Copy from data space failed\n");
p->RIOError.Error = COPYIN_FAILED; p->RIOError.Error = COPYIN_FAILED;
return -EFAULT; return -EFAULT;
@ -469,14 +465,14 @@ int su;
return RIODeleteRta(p, &MapEnt); return RIODeleteRta(p, &MapEnt);
case RIO_QUICK_CHECK: case RIO_QUICK_CHECK:
if (copy_to_user(arg, &p->RIORtaDisCons, sizeof(unsigned int))) { if (copy_to_user(argp, &p->RIORtaDisCons, sizeof(unsigned int))) {
p->RIOError.Error = COPYOUT_FAILED; p->RIOError.Error = COPYOUT_FAILED;
return -EFAULT; return -EFAULT;
} }
return 0; return 0;
case RIO_LAST_ERROR: case RIO_LAST_ERROR:
if (copy_to_user(arg, &p->RIOError, sizeof(struct Error))) if (copy_to_user(argp, &p->RIOError, sizeof(struct Error)))
return -EFAULT; return -EFAULT;
return 0; return 0;
@ -485,7 +481,7 @@ int su;
return -EINVAL; return -EINVAL;
case RIO_GET_MODTYPE: case RIO_GET_MODTYPE:
if (copy_from_user(&port, arg, sizeof(unsigned int))) { if (copy_from_user(&port, argp, sizeof(unsigned int))) {
p->RIOError.Error = COPYIN_FAILED; p->RIOError.Error = COPYIN_FAILED;
return -EFAULT; return -EFAULT;
} }
@ -505,7 +501,7 @@ int su;
** Return module type of port ** Return module type of port
*/ */
port = PortP->HostP->UnixRups[PortP->RupNum].ModTypes; port = PortP->HostP->UnixRups[PortP->RupNum].ModTypes;
if (copy_to_user(arg, &port, sizeof(unsigned int))) { if (copy_to_user(argp, &port, sizeof(unsigned int))) {
p->RIOError.Error = COPYOUT_FAILED; p->RIOError.Error = COPYOUT_FAILED;
return -EFAULT; return -EFAULT;
} }
@ -521,7 +517,7 @@ int su;
case RIO_SETUP_PORTS: case RIO_SETUP_PORTS:
rio_dprintk(RIO_DEBUG_CTRL, "Setup ports\n"); rio_dprintk(RIO_DEBUG_CTRL, "Setup ports\n");
if (copy_from_user(&PortSetup, arg, sizeof(PortSetup))) { if (copy_from_user(&PortSetup, argp, sizeof(PortSetup))) {
p->RIOError.Error = COPYIN_FAILED; p->RIOError.Error = COPYIN_FAILED;
rio_dprintk(RIO_DEBUG_CTRL, "EFAULT"); rio_dprintk(RIO_DEBUG_CTRL, "EFAULT");
return -EFAULT; return -EFAULT;
@ -551,7 +547,7 @@ int su;
case RIO_GET_PORT_SETUP: case RIO_GET_PORT_SETUP:
rio_dprintk(RIO_DEBUG_CTRL, "Get port setup\n"); rio_dprintk(RIO_DEBUG_CTRL, "Get port setup\n");
if (copy_from_user(&PortSetup, arg, sizeof(PortSetup))) { if (copy_from_user(&PortSetup, argp, sizeof(PortSetup))) {
p->RIOError.Error = COPYIN_FAILED; p->RIOError.Error = COPYIN_FAILED;
return -EFAULT; return -EFAULT;
} }
@ -572,7 +568,7 @@ int su;
PortSetup.XpOn[MAX_XP_CTRL_LEN - 1] = '\0'; PortSetup.XpOn[MAX_XP_CTRL_LEN - 1] = '\0';
PortSetup.XpOff[MAX_XP_CTRL_LEN - 1] = '\0'; PortSetup.XpOff[MAX_XP_CTRL_LEN - 1] = '\0';
if (copy_to_user(arg, &PortSetup, sizeof(PortSetup))) { if (copy_to_user(argp, &PortSetup, sizeof(PortSetup))) {
p->RIOError.Error = COPYOUT_FAILED; p->RIOError.Error = COPYOUT_FAILED;
return -EFAULT; return -EFAULT;
} }
@ -580,7 +576,7 @@ int su;
case RIO_GET_PORT_PARAMS: case RIO_GET_PORT_PARAMS:
rio_dprintk(RIO_DEBUG_CTRL, "Get port params\n"); rio_dprintk(RIO_DEBUG_CTRL, "Get port params\n");
if (copy_from_user(&PortParams, arg, sizeof(struct PortParams))) { if (copy_from_user(&PortParams, argp, sizeof(struct PortParams))) {
p->RIOError.Error = COPYIN_FAILED; p->RIOError.Error = COPYIN_FAILED;
return -EFAULT; return -EFAULT;
} }
@ -593,7 +589,7 @@ int su;
PortParams.State = PortP->State; PortParams.State = PortP->State;
rio_dprintk(RIO_DEBUG_CTRL, "Port %d\n", PortParams.Port); rio_dprintk(RIO_DEBUG_CTRL, "Port %d\n", PortParams.Port);
if (copy_to_user(arg, &PortParams, sizeof(struct PortParams))) { if (copy_to_user(argp, &PortParams, sizeof(struct PortParams))) {
p->RIOError.Error = COPYOUT_FAILED; p->RIOError.Error = COPYOUT_FAILED;
return -EFAULT; return -EFAULT;
} }
@ -601,7 +597,7 @@ int su;
case RIO_GET_PORT_TTY: case RIO_GET_PORT_TTY:
rio_dprintk(RIO_DEBUG_CTRL, "Get port tty\n"); rio_dprintk(RIO_DEBUG_CTRL, "Get port tty\n");
if (copy_from_user(&PortTty, arg, sizeof(struct PortTty))) { if (copy_from_user(&PortTty, argp, sizeof(struct PortTty))) {
p->RIOError.Error = COPYIN_FAILED; p->RIOError.Error = COPYIN_FAILED;
return -EFAULT; return -EFAULT;
} }
@ -612,14 +608,14 @@ int su;
rio_dprintk(RIO_DEBUG_CTRL, "Port %d\n", PortTty.port); rio_dprintk(RIO_DEBUG_CTRL, "Port %d\n", PortTty.port);
PortP = (p->RIOPortp[PortTty.port]); PortP = (p->RIOPortp[PortTty.port]);
if (copy_to_user(arg, &PortTty, sizeof(struct PortTty))) { if (copy_to_user(argp, &PortTty, sizeof(struct PortTty))) {
p->RIOError.Error = COPYOUT_FAILED; p->RIOError.Error = COPYOUT_FAILED;
return -EFAULT; return -EFAULT;
} }
return retval; return retval;
case RIO_SET_PORT_TTY: case RIO_SET_PORT_TTY:
if (copy_from_user(&PortTty, arg, sizeof(struct PortTty))) { if (copy_from_user(&PortTty, argp, sizeof(struct PortTty))) {
p->RIOError.Error = COPYIN_FAILED; p->RIOError.Error = COPYIN_FAILED;
return -EFAULT; return -EFAULT;
} }
@ -634,7 +630,7 @@ int su;
case RIO_SET_PORT_PARAMS: case RIO_SET_PORT_PARAMS:
rio_dprintk(RIO_DEBUG_CTRL, "Set port params\n"); rio_dprintk(RIO_DEBUG_CTRL, "Set port params\n");
if (copy_from_user(&PortParams, arg, sizeof(PortParams))) { if (copy_from_user(&PortParams, argp, sizeof(PortParams))) {
p->RIOError.Error = COPYIN_FAILED; p->RIOError.Error = COPYIN_FAILED;
return -EFAULT; return -EFAULT;
} }
@ -650,7 +646,7 @@ int su;
case RIO_GET_PORT_STATS: case RIO_GET_PORT_STATS:
rio_dprintk(RIO_DEBUG_CTRL, "RIO_GET_PORT_STATS\n"); rio_dprintk(RIO_DEBUG_CTRL, "RIO_GET_PORT_STATS\n");
if (copy_from_user(&portStats, arg, sizeof(struct portStats))) { if (copy_from_user(&portStats, argp, sizeof(struct portStats))) {
p->RIOError.Error = COPYIN_FAILED; p->RIOError.Error = COPYIN_FAILED;
return -EFAULT; return -EFAULT;
} }
@ -665,14 +661,14 @@ int su;
portStats.opens = PortP->opens; portStats.opens = PortP->opens;
portStats.closes = PortP->closes; portStats.closes = PortP->closes;
portStats.ioctls = PortP->ioctls; portStats.ioctls = PortP->ioctls;
if (copy_to_user(arg, &portStats, sizeof(struct portStats))) { if (copy_to_user(argp, &portStats, sizeof(struct portStats))) {
p->RIOError.Error = COPYOUT_FAILED; p->RIOError.Error = COPYOUT_FAILED;
return -EFAULT; return -EFAULT;
} }
return retval; return retval;
case RIO_RESET_PORT_STATS: case RIO_RESET_PORT_STATS:
port = (unsigned long) arg; port = arg;
rio_dprintk(RIO_DEBUG_CTRL, "RIO_RESET_PORT_STATS\n"); rio_dprintk(RIO_DEBUG_CTRL, "RIO_RESET_PORT_STATS\n");
if (port >= RIO_PORTS) { if (port >= RIO_PORTS) {
p->RIOError.Error = PORT_NUMBER_OUT_OF_RANGE; p->RIOError.Error = PORT_NUMBER_OUT_OF_RANGE;
@ -690,7 +686,7 @@ int su;
case RIO_GATHER_PORT_STATS: case RIO_GATHER_PORT_STATS:
rio_dprintk(RIO_DEBUG_CTRL, "RIO_GATHER_PORT_STATS\n"); rio_dprintk(RIO_DEBUG_CTRL, "RIO_GATHER_PORT_STATS\n");
if (copy_from_user(&portStats, arg, sizeof(struct portStats))) { if (copy_from_user(&portStats, argp, sizeof(struct portStats))) {
p->RIOError.Error = COPYIN_FAILED; p->RIOError.Error = COPYIN_FAILED;
return -EFAULT; return -EFAULT;
} }
@ -706,7 +702,7 @@ int su;
case RIO_READ_CONFIG: case RIO_READ_CONFIG:
rio_dprintk(RIO_DEBUG_CTRL, "RIO_READ_CONFIG\n"); rio_dprintk(RIO_DEBUG_CTRL, "RIO_READ_CONFIG\n");
if (copy_to_user(arg, &p->RIOConf, sizeof(struct Conf))) { if (copy_to_user(argp, &p->RIOConf, sizeof(struct Conf))) {
p->RIOError.Error = COPYOUT_FAILED; p->RIOError.Error = COPYOUT_FAILED;
return -EFAULT; return -EFAULT;
} }
@ -718,7 +714,7 @@ int su;
p->RIOError.Error = NOT_SUPER_USER; p->RIOError.Error = NOT_SUPER_USER;
return -EPERM; return -EPERM;
} }
if (copy_from_user(&p->RIOConf, arg, sizeof(struct Conf))) { if (copy_from_user(&p->RIOConf, argp, sizeof(struct Conf))) {
p->RIOError.Error = COPYIN_FAILED; p->RIOError.Error = COPYIN_FAILED;
return -EFAULT; return -EFAULT;
} }
@ -746,7 +742,7 @@ int su;
case RIO_SETDEBUG: case RIO_SETDEBUG:
case RIO_GETDEBUG: case RIO_GETDEBUG:
rio_dprintk(RIO_DEBUG_CTRL, "RIO_SETDEBUG/RIO_GETDEBUG\n"); rio_dprintk(RIO_DEBUG_CTRL, "RIO_SETDEBUG/RIO_GETDEBUG\n");
if (copy_from_user(&DebugCtrl, arg, sizeof(DebugCtrl))) { if (copy_from_user(&DebugCtrl, argp, sizeof(DebugCtrl))) {
p->RIOError.Error = COPYIN_FAILED; p->RIOError.Error = COPYIN_FAILED;
return -EFAULT; return -EFAULT;
} }
@ -763,7 +759,7 @@ int su;
rio_dprintk(RIO_DEBUG_CTRL, "Get global debug 0x%x wait 0x%x\n", p->rio_debug, p->RIODebugWait); rio_dprintk(RIO_DEBUG_CTRL, "Get global debug 0x%x wait 0x%x\n", p->rio_debug, p->RIODebugWait);
DebugCtrl.Debug = p->rio_debug; DebugCtrl.Debug = p->rio_debug;
DebugCtrl.Wait = p->RIODebugWait; DebugCtrl.Wait = p->RIODebugWait;
if (copy_to_user(arg, &DebugCtrl, sizeof(DebugCtrl))) { if (copy_to_user(argp, &DebugCtrl, sizeof(DebugCtrl))) {
rio_dprintk(RIO_DEBUG_CTRL, "RIO_SET/GET DEBUG: bad port number %d\n", DebugCtrl.SysPort); rio_dprintk(RIO_DEBUG_CTRL, "RIO_SET/GET DEBUG: bad port number %d\n", DebugCtrl.SysPort);
p->RIOError.Error = COPYOUT_FAILED; p->RIOError.Error = COPYOUT_FAILED;
return -EFAULT; return -EFAULT;
@ -785,7 +781,7 @@ int su;
} else { } else {
rio_dprintk(RIO_DEBUG_CTRL, "RIO_GETDEBUG 0x%x\n", p->RIOPortp[DebugCtrl.SysPort]->Debug); rio_dprintk(RIO_DEBUG_CTRL, "RIO_GETDEBUG 0x%x\n", p->RIOPortp[DebugCtrl.SysPort]->Debug);
DebugCtrl.Debug = p->RIOPortp[DebugCtrl.SysPort]->Debug; DebugCtrl.Debug = p->RIOPortp[DebugCtrl.SysPort]->Debug;
if (copy_to_user(arg, &DebugCtrl, sizeof(DebugCtrl))) { if (copy_to_user(argp, &DebugCtrl, sizeof(DebugCtrl))) {
rio_dprintk(RIO_DEBUG_CTRL, "RIO_GETDEBUG: Bad copy to user space\n"); rio_dprintk(RIO_DEBUG_CTRL, "RIO_GETDEBUG: Bad copy to user space\n");
p->RIOError.Error = COPYOUT_FAILED; p->RIOError.Error = COPYOUT_FAILED;
return -EFAULT; return -EFAULT;
@ -800,7 +796,7 @@ int su;
** textual null terminated string. ** textual null terminated string.
*/ */
rio_dprintk(RIO_DEBUG_CTRL, "RIO_VERSID\n"); rio_dprintk(RIO_DEBUG_CTRL, "RIO_VERSID\n");
if (copy_to_user(arg, RIOVersid(), sizeof(struct rioVersion))) { if (copy_to_user(argp, RIOVersid(), sizeof(struct rioVersion))) {
rio_dprintk(RIO_DEBUG_CTRL, "RIO_VERSID: Bad copy to user space (host=%d)\n", Host); rio_dprintk(RIO_DEBUG_CTRL, "RIO_VERSID: Bad copy to user space (host=%d)\n", Host);
p->RIOError.Error = COPYOUT_FAILED; p->RIOError.Error = COPYOUT_FAILED;
return -EFAULT; return -EFAULT;
@ -813,7 +809,7 @@ int su;
** at init time. ** at init time.
*/ */
rio_dprintk(RIO_DEBUG_CTRL, "RIO_NUM_HOSTS\n"); rio_dprintk(RIO_DEBUG_CTRL, "RIO_NUM_HOSTS\n");
if (copy_to_user(arg, &p->RIONumHosts, sizeof(p->RIONumHosts))) { if (copy_to_user(argp, &p->RIONumHosts, sizeof(p->RIONumHosts))) {
rio_dprintk(RIO_DEBUG_CTRL, "RIO_NUM_HOSTS: Bad copy to user space\n"); rio_dprintk(RIO_DEBUG_CTRL, "RIO_NUM_HOSTS: Bad copy to user space\n");
p->RIOError.Error = COPYOUT_FAILED; p->RIOError.Error = COPYOUT_FAILED;
return -EFAULT; return -EFAULT;
@ -824,7 +820,7 @@ int su;
/* /*
** Kill host. This may not be in the final version... ** Kill host. This may not be in the final version...
*/ */
rio_dprintk(RIO_DEBUG_CTRL, "RIO_HOST_FOAD %ld\n", (unsigned long) arg); rio_dprintk(RIO_DEBUG_CTRL, "RIO_HOST_FOAD %ld\n", arg);
if (!su) { if (!su) {
rio_dprintk(RIO_DEBUG_CTRL, "RIO_HOST_FOAD: Not super user\n"); rio_dprintk(RIO_DEBUG_CTRL, "RIO_HOST_FOAD: Not super user\n");
p->RIOError.Error = NOT_SUPER_USER; p->RIOError.Error = NOT_SUPER_USER;
@ -858,7 +854,7 @@ int su;
p->RIOError.Error = NOT_SUPER_USER; p->RIOError.Error = NOT_SUPER_USER;
return -EPERM; return -EPERM;
} }
if (copy_from_user(&DownLoad, arg, sizeof(DownLoad))) { if (copy_from_user(&DownLoad, argp, sizeof(DownLoad))) {
rio_dprintk(RIO_DEBUG_CTRL, "RIO_DOWNLOAD: Copy in from user space failed\n"); rio_dprintk(RIO_DEBUG_CTRL, "RIO_DOWNLOAD: Copy in from user space failed\n");
p->RIOError.Error = COPYIN_FAILED; p->RIOError.Error = COPYIN_FAILED;
return -EFAULT; return -EFAULT;
@ -888,7 +884,7 @@ int su;
{ {
unsigned int host; unsigned int host;
if (copy_from_user(&host, arg, sizeof(host))) { if (copy_from_user(&host, argp, sizeof(host))) {
rio_dprintk(RIO_DEBUG_CTRL, "RIO_HOST_REQ: Copy in from user space failed\n"); rio_dprintk(RIO_DEBUG_CTRL, "RIO_HOST_REQ: Copy in from user space failed\n");
p->RIOError.Error = COPYIN_FAILED; p->RIOError.Error = COPYIN_FAILED;
return -EFAULT; return -EFAULT;
@ -897,7 +893,7 @@ int su;
** Fetch the parmmap ** Fetch the parmmap
*/ */
rio_dprintk(RIO_DEBUG_CTRL, "RIO_PARMS\n"); rio_dprintk(RIO_DEBUG_CTRL, "RIO_PARMS\n");
if (copy_to_user(arg, p->RIOHosts[host].ParmMapP, sizeof(PARM_MAP))) { if (copy_to_user(argp, p->RIOHosts[host].ParmMapP, sizeof(PARM_MAP))) {
p->RIOError.Error = COPYOUT_FAILED; p->RIOError.Error = COPYOUT_FAILED;
rio_dprintk(RIO_DEBUG_CTRL, "RIO_PARMS: Copy out to user space failed\n"); rio_dprintk(RIO_DEBUG_CTRL, "RIO_PARMS: Copy out to user space failed\n");
return -EFAULT; return -EFAULT;
@ -907,7 +903,7 @@ int su;
case RIO_HOST_REQ: case RIO_HOST_REQ:
rio_dprintk(RIO_DEBUG_CTRL, "RIO_HOST_REQ\n"); rio_dprintk(RIO_DEBUG_CTRL, "RIO_HOST_REQ\n");
if (copy_from_user(&HostReq, arg, sizeof(HostReq))) { if (copy_from_user(&HostReq, argp, sizeof(HostReq))) {
rio_dprintk(RIO_DEBUG_CTRL, "RIO_HOST_REQ: Copy in from user space failed\n"); rio_dprintk(RIO_DEBUG_CTRL, "RIO_HOST_REQ: Copy in from user space failed\n");
p->RIOError.Error = COPYIN_FAILED; p->RIOError.Error = COPYIN_FAILED;
return -EFAULT; return -EFAULT;
@ -928,7 +924,7 @@ int su;
case RIO_HOST_DPRAM: case RIO_HOST_DPRAM:
rio_dprintk(RIO_DEBUG_CTRL, "Request for DPRAM\n"); rio_dprintk(RIO_DEBUG_CTRL, "Request for DPRAM\n");
if (copy_from_user(&HostDpRam, arg, sizeof(HostDpRam))) { if (copy_from_user(&HostDpRam, argp, sizeof(HostDpRam))) {
rio_dprintk(RIO_DEBUG_CTRL, "RIO_HOST_DPRAM: Copy in from user space failed\n"); rio_dprintk(RIO_DEBUG_CTRL, "RIO_HOST_DPRAM: Copy in from user space failed\n");
p->RIOError.Error = COPYIN_FAILED; p->RIOError.Error = COPYIN_FAILED;
return -EFAULT; return -EFAULT;
@ -945,7 +941,7 @@ int su;
/* It's hardware like this that really gets on my tits. */ /* It's hardware like this that really gets on my tits. */
static unsigned char copy[sizeof(struct DpRam)]; static unsigned char copy[sizeof(struct DpRam)];
for (off = 0; off < sizeof(struct DpRam); off++) for (off = 0; off < sizeof(struct DpRam); off++)
copy[off] = readb(&p->RIOHosts[HostDpRam.HostNum].Caddr[off]); copy[off] = readb(p->RIOHosts[HostDpRam.HostNum].Caddr + off);
if (copy_to_user(HostDpRam.DpRamP, copy, sizeof(struct DpRam))) { if (copy_to_user(HostDpRam.DpRamP, copy, sizeof(struct DpRam))) {
p->RIOError.Error = COPYOUT_FAILED; p->RIOError.Error = COPYOUT_FAILED;
rio_dprintk(RIO_DEBUG_CTRL, "RIO_HOST_DPRAM: Bad copy to user space\n"); rio_dprintk(RIO_DEBUG_CTRL, "RIO_HOST_DPRAM: Bad copy to user space\n");
@ -960,13 +956,13 @@ int su;
case RIO_SET_BUSY: case RIO_SET_BUSY:
rio_dprintk(RIO_DEBUG_CTRL, "RIO_SET_BUSY\n"); rio_dprintk(RIO_DEBUG_CTRL, "RIO_SET_BUSY\n");
if ((unsigned long) arg > 511) { if (arg > 511) {
rio_dprintk(RIO_DEBUG_CTRL, "RIO_SET_BUSY: Bad port number %ld\n", (unsigned long) arg); rio_dprintk(RIO_DEBUG_CTRL, "RIO_SET_BUSY: Bad port number %ld\n", arg);
p->RIOError.Error = PORT_NUMBER_OUT_OF_RANGE; p->RIOError.Error = PORT_NUMBER_OUT_OF_RANGE;
return -EINVAL; return -EINVAL;
} }
rio_spin_lock_irqsave(&PortP->portSem, flags); rio_spin_lock_irqsave(&PortP->portSem, flags);
p->RIOPortp[(unsigned long) arg]->State |= RIO_BUSY; p->RIOPortp[arg]->State |= RIO_BUSY;
rio_spin_unlock_irqrestore(&PortP->portSem, flags); rio_spin_unlock_irqrestore(&PortP->portSem, flags);
return retval; return retval;
@ -976,7 +972,7 @@ int su;
** (probably for debug reasons) ** (probably for debug reasons)
*/ */
rio_dprintk(RIO_DEBUG_CTRL, "RIO_HOST_PORT\n"); rio_dprintk(RIO_DEBUG_CTRL, "RIO_HOST_PORT\n");
if (copy_from_user(&PortReq, arg, sizeof(PortReq))) { if (copy_from_user(&PortReq, argp, sizeof(PortReq))) {
rio_dprintk(RIO_DEBUG_CTRL, "RIO_HOST_PORT: Copy in from user space failed\n"); rio_dprintk(RIO_DEBUG_CTRL, "RIO_HOST_PORT: Copy in from user space failed\n");
p->RIOError.Error = COPYIN_FAILED; p->RIOError.Error = COPYIN_FAILED;
return -EFAULT; return -EFAULT;
@ -1001,7 +997,7 @@ int su;
** (probably for debug reasons) ** (probably for debug reasons)
*/ */
rio_dprintk(RIO_DEBUG_CTRL, "RIO_HOST_RUP\n"); rio_dprintk(RIO_DEBUG_CTRL, "RIO_HOST_RUP\n");
if (copy_from_user(&RupReq, arg, sizeof(RupReq))) { if (copy_from_user(&RupReq, argp, sizeof(RupReq))) {
rio_dprintk(RIO_DEBUG_CTRL, "RIO_HOST_RUP: Copy in from user space failed\n"); rio_dprintk(RIO_DEBUG_CTRL, "RIO_HOST_RUP: Copy in from user space failed\n");
p->RIOError.Error = COPYIN_FAILED; p->RIOError.Error = COPYIN_FAILED;
return -EFAULT; return -EFAULT;
@ -1038,7 +1034,7 @@ int su;
** (probably for debug reasons) ** (probably for debug reasons)
*/ */
rio_dprintk(RIO_DEBUG_CTRL, "RIO_HOST_LPB\n"); rio_dprintk(RIO_DEBUG_CTRL, "RIO_HOST_LPB\n");
if (copy_from_user(&LpbReq, arg, sizeof(LpbReq))) { if (copy_from_user(&LpbReq, argp, sizeof(LpbReq))) {
rio_dprintk(RIO_DEBUG_CTRL, "RIO_HOST_LPB: Bad copy from user space\n"); rio_dprintk(RIO_DEBUG_CTRL, "RIO_HOST_LPB: Bad copy from user space\n");
p->RIOError.Error = COPYIN_FAILED; p->RIOError.Error = COPYIN_FAILED;
return -EFAULT; return -EFAULT;
@ -1136,7 +1132,7 @@ int su;
case RIO_MAP_B110_TO_110: case RIO_MAP_B110_TO_110:
case RIO_MAP_B110_TO_115200: case RIO_MAP_B110_TO_115200:
rio_dprintk(RIO_DEBUG_CTRL, "Baud rate mapping\n"); rio_dprintk(RIO_DEBUG_CTRL, "Baud rate mapping\n");
port = (unsigned long) arg; port = arg;
if (port < 0 || port > 511) { if (port < 0 || port > 511) {
rio_dprintk(RIO_DEBUG_CTRL, "Baud rate mapping: Bad port number %d\n", port); rio_dprintk(RIO_DEBUG_CTRL, "Baud rate mapping: Bad port number %d\n", port);
p->RIOError.Error = PORT_NUMBER_OUT_OF_RANGE; p->RIOError.Error = PORT_NUMBER_OUT_OF_RANGE;
@ -1166,7 +1162,7 @@ int su;
case RIO_SEND_PACKET: case RIO_SEND_PACKET:
rio_dprintk(RIO_DEBUG_CTRL, "RIO_SEND_PACKET\n"); rio_dprintk(RIO_DEBUG_CTRL, "RIO_SEND_PACKET\n");
if (copy_from_user(&SendPack, arg, sizeof(SendPack))) { if (copy_from_user(&SendPack, argp, sizeof(SendPack))) {
rio_dprintk(RIO_DEBUG_CTRL, "RIO_SEND_PACKET: Bad copy from user space\n"); rio_dprintk(RIO_DEBUG_CTRL, "RIO_SEND_PACKET: Bad copy from user space\n");
p->RIOError.Error = COPYIN_FAILED; p->RIOError.Error = COPYIN_FAILED;
return -EFAULT; return -EFAULT;
@ -1210,7 +1206,7 @@ int su;
return su ? 0 : -EPERM; return su ? 0 : -EPERM;
case RIO_WHAT_MESG: case RIO_WHAT_MESG:
if (copy_to_user(arg, &p->RIONoMessage, sizeof(p->RIONoMessage))) { if (copy_to_user(argp, &p->RIONoMessage, sizeof(p->RIONoMessage))) {
rio_dprintk(RIO_DEBUG_CTRL, "RIO_WHAT_MESG: Bad copy to user space\n"); rio_dprintk(RIO_DEBUG_CTRL, "RIO_WHAT_MESG: Bad copy to user space\n");
p->RIOError.Error = COPYOUT_FAILED; p->RIOError.Error = COPYOUT_FAILED;
return -EFAULT; return -EFAULT;
@ -1218,7 +1214,7 @@ int su;
return 0; return 0;
case RIO_MEM_DUMP: case RIO_MEM_DUMP:
if (copy_from_user(&SubCmd, arg, sizeof(struct SubCmdStruct))) { if (copy_from_user(&SubCmd, argp, sizeof(struct SubCmdStruct))) {
p->RIOError.Error = COPYIN_FAILED; p->RIOError.Error = COPYIN_FAILED;
return -EFAULT; return -EFAULT;
} }
@ -1248,7 +1244,7 @@ int su;
PortP->State |= RIO_BUSY; PortP->State |= RIO_BUSY;
rio_spin_unlock_irqrestore(&PortP->portSem, flags); rio_spin_unlock_irqrestore(&PortP->portSem, flags);
if (copy_to_user(arg, p->RIOMemDump, MEMDUMP_SIZE)) { if (copy_to_user(argp, p->RIOMemDump, MEMDUMP_SIZE)) {
rio_dprintk(RIO_DEBUG_CTRL, "RIO_MEM_DUMP copy failed\n"); rio_dprintk(RIO_DEBUG_CTRL, "RIO_MEM_DUMP copy failed\n");
p->RIOError.Error = COPYOUT_FAILED; p->RIOError.Error = COPYOUT_FAILED;
return -EFAULT; return -EFAULT;
@ -1256,30 +1252,30 @@ int su;
return 0; return 0;
case RIO_TICK: case RIO_TICK:
if ((unsigned long) arg >= p->RIONumHosts) if (arg >= p->RIONumHosts)
return -EINVAL; return -EINVAL;
rio_dprintk(RIO_DEBUG_CTRL, "Set interrupt for host %ld\n", (unsigned long) arg); rio_dprintk(RIO_DEBUG_CTRL, "Set interrupt for host %ld\n", arg);
writeb(0xFF, &p->RIOHosts[(unsigned long) arg].SetInt); writeb(0xFF, &p->RIOHosts[arg].SetInt);
return 0; return 0;
case RIO_TOCK: case RIO_TOCK:
if ((unsigned long) arg >= p->RIONumHosts) if (arg >= p->RIONumHosts)
return -EINVAL; return -EINVAL;
rio_dprintk(RIO_DEBUG_CTRL, "Clear interrupt for host %ld\n", (unsigned long) arg); rio_dprintk(RIO_DEBUG_CTRL, "Clear interrupt for host %ld\n", arg);
writeb(0xFF, &p->RIOHosts[(unsigned long) arg].ResetInt); writeb(0xFF, &p->RIOHosts[arg].ResetInt);
return 0; return 0;
case RIO_READ_CHECK: case RIO_READ_CHECK:
/* Check reads for pkts with data[0] the same */ /* Check reads for pkts with data[0] the same */
p->RIOReadCheck = !p->RIOReadCheck; p->RIOReadCheck = !p->RIOReadCheck;
if (copy_to_user(arg, &p->RIOReadCheck, sizeof(unsigned int))) { if (copy_to_user(argp, &p->RIOReadCheck, sizeof(unsigned int))) {
p->RIOError.Error = COPYOUT_FAILED; p->RIOError.Error = COPYOUT_FAILED;
return -EFAULT; return -EFAULT;
} }
return 0; return 0;
case RIO_READ_REGISTER: case RIO_READ_REGISTER:
if (copy_from_user(&SubCmd, arg, sizeof(struct SubCmdStruct))) { if (copy_from_user(&SubCmd, argp, sizeof(struct SubCmdStruct))) {
p->RIOError.Error = COPYIN_FAILED; p->RIOError.Error = COPYIN_FAILED;
return -EFAULT; return -EFAULT;
} }
@ -1314,7 +1310,7 @@ int su;
PortP->State |= RIO_BUSY; PortP->State |= RIO_BUSY;
rio_spin_unlock_irqrestore(&PortP->portSem, flags); rio_spin_unlock_irqrestore(&PortP->portSem, flags);
if (copy_to_user(arg, &p->CdRegister, sizeof(unsigned int))) { if (copy_to_user(argp, &p->CdRegister, sizeof(unsigned int))) {
rio_dprintk(RIO_DEBUG_CTRL, "RIO_READ_REGISTER copy failed\n"); rio_dprintk(RIO_DEBUG_CTRL, "RIO_READ_REGISTER copy failed\n");
p->RIOError.Error = COPYOUT_FAILED; p->RIOError.Error = COPYOUT_FAILED;
return -EFAULT; return -EFAULT;
@ -1327,10 +1323,10 @@ int su;
*/ */
case RIO_MAKE_DEV: case RIO_MAKE_DEV:
{ {
unsigned int port = (unsigned long) arg & RIO_MODEM_MASK; unsigned int port = arg & RIO_MODEM_MASK;
unsigned int ret; unsigned int ret;
switch ((unsigned long) arg & RIO_DEV_MASK) { switch (arg & RIO_DEV_MASK) {
case RIO_DEV_DIRECT: case RIO_DEV_DIRECT:
ret = drv_makedev(MAJOR(dev), port); ret = drv_makedev(MAJOR(dev), port);
rio_dprintk(RIO_DEBUG_CTRL, "Makedev direct 0x%x is 0x%x\n", port, ret); rio_dprintk(RIO_DEBUG_CTRL, "Makedev direct 0x%x is 0x%x\n", port, ret);
@ -1358,7 +1354,7 @@ int su;
int mino; int mino;
unsigned long ret; unsigned long ret;
dv = (dev_t) ((unsigned long) arg); dv = (dev_t) (arg);
mino = RIO_UNMODEM(dv); mino = RIO_UNMODEM(dv);
if (RIO_ISMODEM(dv)) { if (RIO_ISMODEM(dv)) {

View File

@ -79,7 +79,7 @@ static char *_rioinit_c_sccs_ = "@(#)rioinit.c 1.3";
int RIOPCIinit(struct rio_info *p, int Mode); int RIOPCIinit(struct rio_info *p, int Mode);
static int RIOScrub(int, u8 *, int); static int RIOScrub(int, u8 __iomem *, int);
/** /**
@ -92,10 +92,10 @@ static int RIOScrub(int, u8 *, int);
** bits > 0 indicates 16 bit operation. ** bits > 0 indicates 16 bit operation.
*/ */
int RIOAssignAT(struct rio_info *p, int Base, caddr_t virtAddr, int mode) int RIOAssignAT(struct rio_info *p, int Base, void __iomem *virtAddr, int mode)
{ {
int bits; int bits;
struct DpRam *cardp = (struct DpRam *)virtAddr; struct DpRam __iomem *cardp = (struct DpRam __iomem *)virtAddr;
if ((Base < ONE_MEG) || (mode & BYTE_ACCESS_MODE)) if ((Base < ONE_MEG) || (mode & BYTE_ACCESS_MODE))
bits = BYTE_OPERATION; bits = BYTE_OPERATION;
@ -107,7 +107,7 @@ int RIOAssignAT(struct rio_info *p, int Base, caddr_t virtAddr, int mode)
** transient stuff. ** transient stuff.
*/ */
p->RIOHosts[p->RIONumHosts].Caddr = virtAddr; p->RIOHosts[p->RIONumHosts].Caddr = virtAddr;
p->RIOHosts[p->RIONumHosts].CardP = (struct DpRam *)virtAddr; p->RIOHosts[p->RIONumHosts].CardP = virtAddr;
/* /*
** Revision 01 AT host cards don't support WORD operations, ** Revision 01 AT host cards don't support WORD operations,
@ -151,10 +151,10 @@ static u8 val[] = {
** RAM test a board. ** RAM test a board.
** Nothing too complicated, just enough to check it out. ** Nothing too complicated, just enough to check it out.
*/ */
int RIOBoardTest(unsigned long paddr, caddr_t caddr, unsigned char type, int slot) int RIOBoardTest(unsigned long paddr, void __iomem *caddr, unsigned char type, int slot)
{ {
struct DpRam *DpRam = (struct DpRam *)caddr; struct DpRam __iomem *DpRam = caddr;
char *ram[4]; void __iomem *ram[4];
int size[4]; int size[4];
int op, bank; int op, bank;
int nbanks; int nbanks;
@ -179,12 +179,12 @@ int RIOBoardTest(unsigned long paddr, caddr_t caddr, unsigned char type, int slo
size[2] = DP_SRAM3_SIZE; size[2] = DP_SRAM3_SIZE;
size[3] = DP_SCRATCH_SIZE; size[3] = DP_SCRATCH_SIZE;
ram[0] = (char *)&DpRam->DpSram1[0]; ram[0] = DpRam->DpSram1;
ram[1] = (char *)&DpRam->DpSram2[0]; ram[1] = DpRam->DpSram2;
ram[2] = (char *)&DpRam->DpSram3[0]; ram[2] = DpRam->DpSram3;
nbanks = (type == RIO_PCI) ? 3 : 4; nbanks = (type == RIO_PCI) ? 3 : 4;
if (nbanks == 4) if (nbanks == 4)
ram[3] = (char *)&DpRam->DpScratch[0]; ram[3] = DpRam->DpScratch;
if (nbanks == 3) { if (nbanks == 3) {
@ -202,7 +202,7 @@ int RIOBoardTest(unsigned long paddr, caddr_t caddr, unsigned char type, int slo
*/ */
for (op=0; op<TEST_END; op++) { for (op=0; op<TEST_END; op++) {
for (bank=0; bank<nbanks; bank++) { for (bank=0; bank<nbanks; bank++) {
if (RIOScrub(op, (u8 *)ram[bank], size[bank]) == RIO_FAIL) { if (RIOScrub(op, ram[bank], size[bank]) == RIO_FAIL) {
rio_dprintk (RIO_DEBUG_INIT, "RIO-init: RIOScrub band %d, op %d failed\n", rio_dprintk (RIO_DEBUG_INIT, "RIO-init: RIOScrub band %d, op %d failed\n",
bank, op); bank, op);
return RIO_FAIL; return RIO_FAIL;
@ -227,7 +227,7 @@ int RIOBoardTest(unsigned long paddr, caddr_t caddr, unsigned char type, int slo
** to check that the data from the previous phase was retained. ** to check that the data from the previous phase was retained.
*/ */
static int RIOScrub(int op, u8 *ram, int size) static int RIOScrub(int op, u8 __iomem *ram, int size)
{ {
int off; int off;
unsigned char oldbyte; unsigned char oldbyte;
@ -393,7 +393,7 @@ struct rioVersion *RIOVersid(void)
return &stVersion; return &stVersion;
} }
void RIOHostReset(unsigned int Type, struct DpRam *DpRamP, unsigned int Slot) void RIOHostReset(unsigned int Type, struct DpRam __iomem *DpRamP, unsigned int Slot)
{ {
/* /*
** Reset the Tpu ** Reset the Tpu

View File

@ -102,7 +102,7 @@ void RIOTxEnable(char *en)
struct rio_info *p; struct rio_info *p;
struct tty_struct *tty; struct tty_struct *tty;
int c; int c;
struct PKT *PacketP; struct PKT __iomem *PacketP;
unsigned long flags; unsigned long flags;
PortP = (struct Port *) en; PortP = (struct Port *) en;
@ -144,7 +144,7 @@ void RIOTxEnable(char *en)
if (c == 0) if (c == 0)
break; break;
rio_memcpy_toio(PortP->HostP->Caddr, (caddr_t) PacketP->data, PortP->gs.xmit_buf + PortP->gs.xmit_tail, c); rio_memcpy_toio(PortP->HostP->Caddr, PacketP->data, PortP->gs.xmit_buf + PortP->gs.xmit_tail, c);
/* udelay (1); */ /* udelay (1); */
writeb(c, &(PacketP->len)); writeb(c, &(PacketP->len));
@ -219,7 +219,7 @@ void RIOServiceHost(struct rio_info *p, struct Host *HostP, int From)
for (port = p->RIOFirstPortsBooted; port < p->RIOLastPortsBooted + PORTS_PER_RTA; port++) { for (port = p->RIOFirstPortsBooted; port < p->RIOLastPortsBooted + PORTS_PER_RTA; port++) {
struct Port *PortP = p->RIOPortp[port]; struct Port *PortP = p->RIOPortp[port];
struct tty_struct *ttyP; struct tty_struct *ttyP;
struct PKT *PacketP; struct PKT __iomem *PacketP;
/* /*
** not mapped in - most of the RIOPortp[] information ** not mapped in - most of the RIOPortp[] information
@ -298,7 +298,7 @@ void RIOServiceHost(struct rio_info *p, struct Host *HostP, int From)
for (port = p->RIOFirstPortsBooted; port < p->RIOLastPortsBooted + PORTS_PER_RTA; port++) { for (port = p->RIOFirstPortsBooted; port < p->RIOLastPortsBooted + PORTS_PER_RTA; port++) {
struct Port *PortP = p->RIOPortp[port]; struct Port *PortP = p->RIOPortp[port];
struct tty_struct *ttyP; struct tty_struct *ttyP;
struct PKT *PacketP; struct PKT __iomem *PacketP;
/* /*
** not mapped in - most of the RIOPortp[] information ** not mapped in - most of the RIOPortp[] information
@ -427,13 +427,13 @@ void RIOServiceHost(struct rio_info *p, struct Host *HostP, int From)
while (PortP->WflushFlag && can_add_transmit(&PacketP, PortP) && (PortP->InUse == NOT_INUSE)) { while (PortP->WflushFlag && can_add_transmit(&PacketP, PortP) && (PortP->InUse == NOT_INUSE)) {
int p; int p;
struct PktCmd *PktCmdP; struct PktCmd __iomem *PktCmdP;
rio_dprintk(RIO_DEBUG_INTR, "Add WFLUSH marker to data queue\n"); rio_dprintk(RIO_DEBUG_INTR, "Add WFLUSH marker to data queue\n");
/* /*
** make it look just like a WFLUSH command ** make it look just like a WFLUSH command
*/ */
PktCmdP = (struct PktCmd *) &PacketP->data[0]; PktCmdP = (struct PktCmd __iomem *) &PacketP->data[0];
writeb(WFLUSH, &PktCmdP->Command); writeb(WFLUSH, &PktCmdP->Command);
@ -525,9 +525,9 @@ static void RIOReceive(struct rio_info *p, struct Port *PortP)
{ {
struct tty_struct *TtyP; struct tty_struct *TtyP;
unsigned short transCount; unsigned short transCount;
struct PKT *PacketP; struct PKT __iomem *PacketP;
register unsigned int DataCnt; register unsigned int DataCnt;
unsigned char *ptr; unsigned char __iomem *ptr;
unsigned char *buf; unsigned char *buf;
int copied = 0; int copied = 0;
@ -625,7 +625,7 @@ static void RIOReceive(struct rio_info *p, struct Port *PortP)
** to '#define', (this is the only place ___DEBUG_IT___ occurs in the ** to '#define', (this is the only place ___DEBUG_IT___ occurs in the
** driver). ** driver).
*/ */
ptr = (unsigned char *) PacketP->data + PortP->RxDataStart; ptr = (unsigned char __iomem *) PacketP->data + PortP->RxDataStart;
tty_prepare_flip_string(TtyP, &buf, transCount); tty_prepare_flip_string(TtyP, &buf, transCount);
rio_memcpy_fromio(buf, ptr, transCount); rio_memcpy_fromio(buf, ptr, transCount);

View File

@ -154,8 +154,8 @@ int RIOParam(struct Port *PortP, int cmd, int Modem, int SleepFlag)
{ {
struct tty_struct *TtyP; struct tty_struct *TtyP;
int retval; int retval;
struct phb_param *phb_param_ptr; struct phb_param __iomem *phb_param_ptr;
struct PKT *PacketP; struct PKT __iomem *PacketP;
int res; int res;
u8 Cor1 = 0, Cor2 = 0, Cor4 = 0, Cor5 = 0; u8 Cor1 = 0, Cor2 = 0, Cor4 = 0, Cor5 = 0;
u8 TxXon = 0, TxXoff = 0, RxXon = 0, RxXoff = 0; u8 TxXon = 0, TxXoff = 0, RxXon = 0, RxXoff = 0;
@ -235,7 +235,7 @@ int RIOParam(struct Port *PortP, int cmd, int Modem, int SleepFlag)
rio_dprintk(RIO_DEBUG_PARAM, "can_add_transmit() returns %x\n", res); rio_dprintk(RIO_DEBUG_PARAM, "can_add_transmit() returns %x\n", res);
rio_dprintk(RIO_DEBUG_PARAM, "Packet is %p\n", PacketP); rio_dprintk(RIO_DEBUG_PARAM, "Packet is %p\n", PacketP);
phb_param_ptr = (struct phb_param *) PacketP->data; phb_param_ptr = (struct phb_param __iomem *) PacketP->data;
switch (TtyP->termios->c_cflag & CSIZE) { switch (TtyP->termios->c_cflag & CSIZE) {
@ -580,11 +580,11 @@ int RIOParam(struct Port *PortP, int cmd, int Modem, int SleepFlag)
** We can add another packet to a transmit queue if the packet pointer pointed ** We can add another packet to a transmit queue if the packet pointer pointed
** to by the TxAdd pointer has PKT_IN_USE clear in its address. ** to by the TxAdd pointer has PKT_IN_USE clear in its address.
*/ */
int can_add_transmit(struct PKT **PktP, struct Port *PortP) int can_add_transmit(struct PKT __iomem **PktP, struct Port *PortP)
{ {
struct PKT *tp; struct PKT __iomem *tp;
*PktP = tp = (struct PKT *) RIO_PTR(PortP->Caddr, readw(PortP->TxAdd)); *PktP = tp = (struct PKT __iomem *) RIO_PTR(PortP->Caddr, readw(PortP->TxAdd));
return !((unsigned long) tp & PKT_IN_USE); return !((unsigned long) tp & PKT_IN_USE);
} }
@ -608,9 +608,9 @@ void add_transmit(struct Port *PortP)
* Put a packet onto the end of the * Put a packet onto the end of the
* free list * free list
****************************************/ ****************************************/
void put_free_end(struct Host *HostP, struct PKT *PktP) void put_free_end(struct Host *HostP, struct PKT __iomem *PktP)
{ {
struct rio_free_list *tmp_pointer; struct rio_free_list __iomem *tmp_pointer;
unsigned short old_end, new_end; unsigned short old_end, new_end;
unsigned long flags; unsigned long flags;
@ -625,15 +625,15 @@ void put_free_end(struct Host *HostP, struct PKT *PktP)
if ((old_end = readw(&HostP->ParmMapP->free_list_end)) != TPNULL) { if ((old_end = readw(&HostP->ParmMapP->free_list_end)) != TPNULL) {
new_end = RIO_OFF(HostP->Caddr, PktP); new_end = RIO_OFF(HostP->Caddr, PktP);
tmp_pointer = (struct rio_free_list *) RIO_PTR(HostP->Caddr, old_end); tmp_pointer = (struct rio_free_list __iomem *) RIO_PTR(HostP->Caddr, old_end);
writew(new_end, &tmp_pointer->next); writew(new_end, &tmp_pointer->next);
writew(old_end, &((struct rio_free_list *) PktP)->prev); writew(old_end, &((struct rio_free_list __iomem *) PktP)->prev);
writew(TPNULL, &((struct rio_free_list *) PktP)->next); writew(TPNULL, &((struct rio_free_list __iomem *) PktP)->next);
writew(new_end, &HostP->ParmMapP->free_list_end); writew(new_end, &HostP->ParmMapP->free_list_end);
} else { /* First packet on the free list this should never happen! */ } else { /* First packet on the free list this should never happen! */
rio_dprintk(RIO_DEBUG_PFE, "put_free_end(): This should never happen\n"); rio_dprintk(RIO_DEBUG_PFE, "put_free_end(): This should never happen\n");
writew(RIO_OFF(HostP->Caddr, PktP), &HostP->ParmMapP->free_list_end); writew(RIO_OFF(HostP->Caddr, PktP), &HostP->ParmMapP->free_list_end);
tmp_pointer = (struct rio_free_list *) PktP; tmp_pointer = (struct rio_free_list __iomem *) PktP;
writew(TPNULL, &tmp_pointer->prev); writew(TPNULL, &tmp_pointer->prev);
writew(TPNULL, &tmp_pointer->next); writew(TPNULL, &tmp_pointer->next);
} }
@ -647,10 +647,10 @@ void put_free_end(struct Host *HostP, struct PKT *PktP)
** relevant packet, [having cleared the PKT_IN_USE bit]. If PKT_IN_USE is clear, ** relevant packet, [having cleared the PKT_IN_USE bit]. If PKT_IN_USE is clear,
** then can_remove_receive() returns 0. ** then can_remove_receive() returns 0.
*/ */
int can_remove_receive(struct PKT **PktP, struct Port *PortP) int can_remove_receive(struct PKT __iomem **PktP, struct Port *PortP)
{ {
if (readw(PortP->RxRemove) & PKT_IN_USE) { if (readw(PortP->RxRemove) & PKT_IN_USE) {
*PktP = (struct PKT *) RIO_PTR(PortP->Caddr, readw(PortP->RxRemove) & ~PKT_IN_USE); *PktP = (struct PKT __iomem *) RIO_PTR(PortP->Caddr, readw(PortP->RxRemove) & ~PKT_IN_USE);
return 1; return 1;
} }
return 0; return 0;

View File

@ -86,9 +86,9 @@ static void RIOConCon(struct rio_info *, struct Host *, unsigned int, unsigned i
** 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.
*/ */
int RIORouteRup(struct rio_info *p, unsigned int Rup, struct Host *HostP, struct PKT * PacketP) int RIORouteRup(struct rio_info *p, unsigned int Rup, struct Host *HostP, struct PKT __iomem * PacketP)
{ {
struct PktCmd *PktCmdP = (struct PktCmd *) PacketP->data; struct PktCmd __iomem *PktCmdP = (struct PktCmd __iomem *) PacketP->data;
struct PktCmd_M *PktReplyP; struct PktCmd_M *PktReplyP;
struct CmdBlk *CmdBlkP; struct CmdBlk *CmdBlkP;
struct Port *PortP; struct Port *PortP;
@ -517,8 +517,8 @@ void RIOFixPhbs(struct rio_info *p, struct Host *HostP, unsigned int unit)
for (port = 0; port < PORTS_PER_RTA; port++, PortN++) { for (port = 0; port < PORTS_PER_RTA; port++, PortN++) {
unsigned short dest_port = port + 8; unsigned short dest_port = port + 8;
u16 *TxPktP; u16 __iomem *TxPktP;
struct PKT *Pkt; struct PKT __iomem *Pkt;
PortP = p->RIOPortp[PortN]; PortP = p->RIOPortp[PortN];
@ -555,12 +555,12 @@ void RIOFixPhbs(struct rio_info *p, struct Host *HostP, unsigned int unit)
** card. This needs to be translated into a 32 bit pointer ** card. This needs to be translated into a 32 bit pointer
** so it can be accessed from the driver. ** so it can be accessed from the driver.
*/ */
Pkt = (struct PKT *) RIO_PTR(HostP->Caddr, readw(TxPktP)); Pkt = (struct PKT __iomem *) RIO_PTR(HostP->Caddr, readw(TxPktP));
/* /*
** If the packet is used, reset it. ** If the packet is used, reset it.
*/ */
Pkt = (struct PKT *) ((unsigned long) Pkt & ~PKT_IN_USE); Pkt = (struct PKT __iomem *) ((unsigned long) Pkt & ~PKT_IN_USE);
writeb(dest_unit, &Pkt->dest_unit); writeb(dest_unit, &Pkt->dest_unit);
writeb(dest_port, &Pkt->dest_port); writeb(dest_port, &Pkt->dest_port);
} }

View File

@ -534,8 +534,8 @@ int RIODeleteRta(struct rio_info *p, struct Map *MapP)
if (PortP->SecondBlock) { if (PortP->SecondBlock) {
u16 dest_unit = HostMapP->ID; u16 dest_unit = HostMapP->ID;
u16 dest_port = port - SysPort; u16 dest_port = port - SysPort;
u16 *TxPktP; u16 __iomem *TxPktP;
struct PKT *Pkt; struct PKT __iomem *Pkt;
for (TxPktP = PortP->TxStart; TxPktP <= PortP->TxEnd; TxPktP++) { for (TxPktP = PortP->TxStart; TxPktP <= PortP->TxEnd; TxPktP++) {
/* /*
@ -545,7 +545,7 @@ int RIODeleteRta(struct rio_info *p, struct Map *MapP)
** a 32 bit pointer so it can be ** a 32 bit pointer so it can be
** accessed from the driver. ** accessed from the driver.
*/ */
Pkt = (struct PKT *) RIO_PTR(HostP->Caddr, readw(&*TxPktP)); Pkt = (struct PKT __iomem *) RIO_PTR(HostP->Caddr, readw(&*TxPktP));
rio_dprintk(RIO_DEBUG_TABLE, "Tx packet (%x) destination: Old %x:%x New %x:%x\n", *TxPktP, Pkt->dest_unit, Pkt->dest_port, dest_unit, dest_port); rio_dprintk(RIO_DEBUG_TABLE, "Tx packet (%x) destination: Old %x:%x New %x:%x\n", *TxPktP, Pkt->dest_unit, Pkt->dest_port, dest_unit, dest_port);
writew(dest_unit, &Pkt->dest_unit); writew(dest_unit, &Pkt->dest_unit);
writew(dest_port, &Pkt->dest_port); writew(dest_port, &Pkt->dest_port);
@ -781,13 +781,13 @@ int RIOReMapPorts(struct rio_info *p, struct Host *HostP, struct Map *HostMapP)
** unless the host has been booted ** unless the host has been booted
*/ */
if ((HostP->Flags & RUN_STATE) == RC_RUNNING) { if ((HostP->Flags & RUN_STATE) == RC_RUNNING) {
struct PHB *PhbP = PortP->PhbP = &HostP->PhbP[HostPort]; struct PHB __iomem *PhbP = PortP->PhbP = &HostP->PhbP[HostPort];
PortP->TxAdd = (u16 *) RIO_PTR(HostP->Caddr, readw(&PhbP->tx_add)); PortP->TxAdd = (u16 __iomem *) RIO_PTR(HostP->Caddr, readw(&PhbP->tx_add));
PortP->TxStart = (u16 *) RIO_PTR(HostP->Caddr, readw(&PhbP->tx_start)); PortP->TxStart = (u16 __iomem *) RIO_PTR(HostP->Caddr, readw(&PhbP->tx_start));
PortP->TxEnd = (u16 *) RIO_PTR(HostP->Caddr, readw(&PhbP->tx_end)); PortP->TxEnd = (u16 __iomem *) RIO_PTR(HostP->Caddr, readw(&PhbP->tx_end));
PortP->RxRemove = (u16 *) RIO_PTR(HostP->Caddr, readw(&PhbP->rx_remove)); PortP->RxRemove = (u16 __iomem *) RIO_PTR(HostP->Caddr, readw(&PhbP->rx_remove));
PortP->RxStart = (u16 *) RIO_PTR(HostP->Caddr, readw(&PhbP->rx_start)); PortP->RxStart = (u16 __iomem *) RIO_PTR(HostP->Caddr, readw(&PhbP->rx_start));
PortP->RxEnd = (u16 *) RIO_PTR(HostP->Caddr, readw(&PhbP->rx_end)); PortP->RxEnd = (u16 __iomem *) RIO_PTR(HostP->Caddr, readw(&PhbP->rx_end));
} else } else
PortP->PhbP = NULL; PortP->PhbP = NULL;

View File

@ -576,7 +576,7 @@ static void RIOClearUp(struct Port *PortP)
*/ */
int RIOShortCommand(struct rio_info *p, struct Port *PortP, int command, int len, int arg) int RIOShortCommand(struct rio_info *p, struct Port *PortP, int command, int len, int arg)
{ {
struct PKT *PacketP; struct PKT __iomem *PacketP;
int retries = 20; /* at 10 per second -> 2 seconds */ int retries = 20; /* at 10 per second -> 2 seconds */
unsigned long flags; unsigned long flags;

View File

@ -44,7 +44,7 @@ static char *_unixrup_h_sccs_ = "@(#)unixrup.h 1.2";
struct UnixRup { struct UnixRup {
struct CmdBlk *CmdsWaitingP; /* Commands waiting to be done */ struct CmdBlk *CmdsWaitingP; /* Commands waiting to be done */
struct CmdBlk *CmdPendingP; /* The command currently being sent */ struct CmdBlk *CmdPendingP; /* The command currently being sent */
struct RUP *RupP; /* the Rup to send it to */ struct RUP __iomem *RupP; /* the Rup to send it to */
unsigned int Id; /* Id number */ unsigned int Id; /* Id number */
unsigned int BaseSysPort; /* SysPort of first tty on this RTA */ unsigned int BaseSysPort; /* SysPort of first tty on this RTA */
unsigned int ModTypes; /* Modules on this RTA */ unsigned int ModTypes; /* Modules on this RTA */