提交 077e9894 编写于 作者: L Linus Torvalds

Merge branch 'rio.b19' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/bird

* 'rio.b19' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/bird:
  [PATCH] missing readb/readw in rio
  [PATCH] copy_to_user() from iomem is a bad thing
  [PATCH] forgotten swap of copyout() arguments
  [PATCH] handling rio MEMDUMP
  [PATCH] fix rio_copy_to_card() for OLDPCI case
  [PATCH] uses of ->Copy() in rioroute are bogus
  [PATCH] bogus order of copy_from_user() arguments
  [PATCH] rio ->Copy() expects the sourse as first argument
  [PATCH] trivial annotations in rio
...@@ -51,7 +51,7 @@ struct Error { ...@@ -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 { ...@@ -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 { ...@@ -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 {
......
...@@ -46,7 +46,7 @@ int RIOBootCodeRTA(struct rio_info *, struct DownLoad *); ...@@ -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 *); ...@@ -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 *); ...@@ -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 *); ...@@ -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); ...@@ -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 *); ...@@ -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 *from, void __iomem *to, 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);
......
...@@ -48,8 +48,8 @@ struct Host { ...@@ -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 { ...@@ -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 { ...@@ -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 */
/* /*
......
...@@ -40,7 +40,7 @@ struct Port { ...@@ -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 { ...@@ -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 */
......
...@@ -129,8 +129,8 @@ ...@@ -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:
......
...@@ -333,9 +333,9 @@ int RIODelay_ni(struct Port *PortP, int njiffies) ...@@ -333,9 +333,9 @@ 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 *from, void __iomem *to, int len)
{ {
rio_memcpy_toio(NULL, to, from, len); rio_copy_toio(to, from, len);
} }
int rio_minor(struct tty_struct *tty) int rio_minor(struct tty_struct *tty)
...@@ -573,7 +573,7 @@ static int rio_fw_ioctl(struct inode *inode, struct file *filp, unsigned int cmd ...@@ -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, ...@@ -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 ...@@ -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 ...@@ -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) ...@@ -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) ...@@ -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) ...@@ -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) ...@@ -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) ...@@ -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) ...@@ -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) ...@@ -1111,7 +1112,7 @@ static int __init rio_init(void)
} }
if (!okboard) if (!okboard)
iounmap((char *) (hp->Caddr)); iounmap(hp->Caddr);
} }
} }
......
...@@ -131,9 +131,9 @@ struct vpd_prom { ...@@ -131,9 +131,9 @@ 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--) {
...@@ -144,11 +144,22 @@ static inline void *rio_memcpy_toio(void *dummy, void *dest, void *source, int n ...@@ -144,11 +144,22 @@ static inline void *rio_memcpy_toio(void *dummy, void *dest, void *source, int n
return dest; return dest;
} }
static inline void __iomem *rio_copy_toio(void __iomem *dest, void *source, int n)
{
char __iomem *dst = dest;
char *src = source;
while (n--)
writeb(*src++, dst++);
static inline void *rio_memcpy_fromio(void *dest, void *source, int n) return dest;
}
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++);
...@@ -158,6 +169,7 @@ static inline void *rio_memcpy_fromio(void *dest, void *source, int n) ...@@ -158,6 +169,7 @@ static inline void *rio_memcpy_fromio(void *dest, void *source, int n)
#else #else
#define rio_memcpy_toio(dummy,dest,source,n) memcpy_toio(dest, source, n) #define rio_memcpy_toio(dummy,dest,source,n) memcpy_toio(dest, source, n)
#define rio_copy_toio memcpy_toio
#define rio_memcpy_fromio memcpy_fromio #define rio_memcpy_fromio memcpy_fromio
#endif #endif
......
...@@ -71,7 +71,7 @@ ...@@ -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) ...@@ -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) ...@@ -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.
...@@ -280,7 +280,7 @@ int RIOBootCodeHOST(struct rio_info *p, struct DownLoad *rbp) ...@@ -280,7 +280,7 @@ int RIOBootCodeHOST(struct rio_info *p, struct DownLoad *rbp)
func_exit(); func_exit();
return -ENOMEM; return -ENOMEM;
} }
if (copy_from_user(rbp->DataP, DownCode, rbp->Count)) { if (copy_from_user(DownCode, rbp->DataP, rbp->Count)) {
kfree(DownCode); kfree(DownCode);
p->RIOError.Error = COPYIN_FAILED; p->RIOError.Error = COPYIN_FAILED;
func_exit(); func_exit();
...@@ -366,7 +366,7 @@ int RIOBootCodeHOST(struct rio_info *p, struct DownLoad *rbp) ...@@ -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) ...@@ -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) ...@@ -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) ...@@ -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) ...@@ -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) ...@@ -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) ...@@ -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) ...@@ -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) ...@@ -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 ...@@ -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;
......
...@@ -180,7 +180,7 @@ int RIOCommandRta(struct rio_info *p, unsigned long RtaUnique, int (*func) (stru ...@@ -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) ...@@ -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) ...@@ -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;
...@@ -407,12 +407,12 @@ static int RIOCommandRup(struct rio_info *p, uint Rup, struct Host *HostP, struc ...@@ -407,12 +407,12 @@ static int RIOCommandRup(struct rio_info *p, uint Rup, struct Host *HostP, struc
} else } else
rio_dprintk(RIO_DEBUG_CMD, "CONTROL information: This is the RUP for link ``%c'' of host ``%s''\n", ('A' + Rup - MAX_RUP), HostP->Name); rio_dprintk(RIO_DEBUG_CMD, "CONTROL information: This is the RUP for link ``%c'' of host ``%s''\n", ('A' + Rup - MAX_RUP), HostP->Name);
rio_dprintk(RIO_DEBUG_CMD, "PACKET information: Destination 0x%x:0x%x\n", PacketP->dest_unit, PacketP->dest_port); rio_dprintk(RIO_DEBUG_CMD, "PACKET information: Destination 0x%x:0x%x\n", readb(&PacketP->dest_unit), readb(&PacketP->dest_port));
rio_dprintk(RIO_DEBUG_CMD, "PACKET information: Source 0x%x:0x%x\n", PacketP->src_unit, PacketP->src_port); rio_dprintk(RIO_DEBUG_CMD, "PACKET information: Source 0x%x:0x%x\n", readb(&PacketP->src_unit), readb(&PacketP->src_port));
rio_dprintk(RIO_DEBUG_CMD, "PACKET information: Length 0x%x (%d)\n", PacketP->len, PacketP->len); rio_dprintk(RIO_DEBUG_CMD, "PACKET information: Length 0x%x (%d)\n", readb(&PacketP->len), readb(&PacketP->len));
rio_dprintk(RIO_DEBUG_CMD, "PACKET information: Control 0x%x (%d)\n", PacketP->control, PacketP->control); rio_dprintk(RIO_DEBUG_CMD, "PACKET information: Control 0x%x (%d)\n", readb(&PacketP->control), readb(&PacketP->control));
rio_dprintk(RIO_DEBUG_CMD, "PACKET information: Check 0x%x (%d)\n", PacketP->csum, PacketP->csum); rio_dprintk(RIO_DEBUG_CMD, "PACKET information: Check 0x%x (%d)\n", readw(&PacketP->csum), readw(&PacketP->csum));
rio_dprintk(RIO_DEBUG_CMD, "COMMAND information: Host Port Number 0x%x, " "Command Code 0x%x\n", PktCmdP->PhbNum, PktCmdP->Command); rio_dprintk(RIO_DEBUG_CMD, "COMMAND information: Host Port Number 0x%x, " "Command Code 0x%x\n", readb(&PktCmdP->PhbNum), readb(&PktCmdP->Command));
return 1; return 1;
} }
PortP = p->RIOPortp[SysPort]; PortP = p->RIOPortp[SysPort];
...@@ -601,7 +601,7 @@ int RIOQueueCmdBlk(struct Host *HostP, uint Rup, struct CmdBlk *CmdBlkP) ...@@ -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, readw(&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) ...@@ -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) ...@@ -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:
...@@ -694,9 +694,9 @@ void RIOPollHostCommands(struct rio_info *p, struct Host *HostP) ...@@ -694,9 +694,9 @@ void RIOPollHostCommands(struct rio_info *p, struct Host *HostP)
*/ */
rio_spin_unlock_irqrestore(&UnixRupP->RupLock, flags); rio_spin_unlock_irqrestore(&UnixRupP->RupLock, flags);
FreeMe = RIOCommandRup(p, Rup, HostP, PacketP); FreeMe = RIOCommandRup(p, Rup, HostP, PacketP);
if (PacketP->data[5] == MEMDUMP) { if (readb(&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", readw(&(PacketP->data[6])));
HostP->Copy((caddr_t) & (PacketP->data[8]), (caddr_t) p->RIOMemDump, 32); rio_memcpy_fromio(p->RIOMemDump, &(PacketP->data[8]), 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) ...@@ -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, readw(&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) ...@@ -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);
......
此差异已折叠。
...@@ -79,7 +79,7 @@ static char *_rioinit_c_sccs_ = "@(#)rioinit.c 1.3"; ...@@ -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); ...@@ -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) ...@@ -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[] = { ...@@ -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 ...@@ -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 ...@@ -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 ...@@ -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) ...@@ -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
......
...@@ -102,7 +102,7 @@ void RIOTxEnable(char *en) ...@@ -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) ...@@ -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) ...@@ -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) ...@@ -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) ...@@ -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) ...@@ -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;
...@@ -585,19 +585,19 @@ static void RIOReceive(struct rio_info *p, struct Port *PortP) ...@@ -585,19 +585,19 @@ static void RIOReceive(struct rio_info *p, struct Port *PortP)
/* /*
** check that it is not a command! ** check that it is not a command!
*/ */
if (PacketP->len & PKT_CMD_BIT) { if (readb(&PacketP->len) & PKT_CMD_BIT) {
rio_dprintk(RIO_DEBUG_INTR, "RIO: unexpected command packet received on PHB\n"); rio_dprintk(RIO_DEBUG_INTR, "RIO: unexpected command packet received on PHB\n");
/* rio_dprint(RIO_DEBUG_INTR, (" sysport = %d\n", p->RIOPortp->PortNum)); */ /* rio_dprint(RIO_DEBUG_INTR, (" sysport = %d\n", p->RIOPortp->PortNum)); */
rio_dprintk(RIO_DEBUG_INTR, " dest_unit = %d\n", PacketP->dest_unit); rio_dprintk(RIO_DEBUG_INTR, " dest_unit = %d\n", readb(&PacketP->dest_unit));
rio_dprintk(RIO_DEBUG_INTR, " dest_port = %d\n", PacketP->dest_port); rio_dprintk(RIO_DEBUG_INTR, " dest_port = %d\n", readb(&PacketP->dest_port));
rio_dprintk(RIO_DEBUG_INTR, " src_unit = %d\n", PacketP->src_unit); rio_dprintk(RIO_DEBUG_INTR, " src_unit = %d\n", readb(&PacketP->src_unit));
rio_dprintk(RIO_DEBUG_INTR, " src_port = %d\n", PacketP->src_port); rio_dprintk(RIO_DEBUG_INTR, " src_port = %d\n", readb(&PacketP->src_port));
rio_dprintk(RIO_DEBUG_INTR, " len = %d\n", PacketP->len); rio_dprintk(RIO_DEBUG_INTR, " len = %d\n", readb(&PacketP->len));
rio_dprintk(RIO_DEBUG_INTR, " control = %d\n", PacketP->control); rio_dprintk(RIO_DEBUG_INTR, " control = %d\n", readb(&PacketP->control));
rio_dprintk(RIO_DEBUG_INTR, " csum = %d\n", PacketP->csum); rio_dprintk(RIO_DEBUG_INTR, " csum = %d\n", readw(&PacketP->csum));
rio_dprintk(RIO_DEBUG_INTR, " data bytes: "); rio_dprintk(RIO_DEBUG_INTR, " data bytes: ");
for (DataCnt = 0; DataCnt < PKT_MAX_DATA_LEN; DataCnt++) for (DataCnt = 0; DataCnt < PKT_MAX_DATA_LEN; DataCnt++)
rio_dprintk(RIO_DEBUG_INTR, "%d\n", PacketP->data[DataCnt]); rio_dprintk(RIO_DEBUG_INTR, "%d\n", readb(&PacketP->data[DataCnt]));
remove_receive(PortP); remove_receive(PortP);
put_free_end(PortP->HostP, PacketP); put_free_end(PortP->HostP, PacketP);
continue; /* with next packet */ continue; /* with next packet */
...@@ -618,24 +618,24 @@ static void RIOReceive(struct rio_info *p, struct Port *PortP) ...@@ -618,24 +618,24 @@ static void RIOReceive(struct rio_info *p, struct Port *PortP)
** and available space. ** and available space.
*/ */
transCount = tty_buffer_request_room(TtyP, PacketP->len & PKT_LEN_MASK); transCount = tty_buffer_request_room(TtyP, readb(&PacketP->len) & PKT_LEN_MASK);
rio_dprintk(RIO_DEBUG_REC, "port %d: Copy %d bytes\n", PortP->PortNum, transCount); rio_dprintk(RIO_DEBUG_REC, "port %d: Copy %d bytes\n", PortP->PortNum, transCount);
/* /*
** To use the following 'kkprintfs' for debugging - change the '#undef' ** To use the following 'kkprintfs' for debugging - change the '#undef'
** 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);
PortP->RxDataStart += transCount; PortP->RxDataStart += transCount;
PacketP->len -= transCount; writeb(readb(&PacketP->len)-transCount, &PacketP->len);
copied += transCount; copied += transCount;
if (PacketP->len == 0) { if (readb(&PacketP->len) == 0) {
/* /*
** If we have emptied the packet, then we can ** If we have emptied the packet, then we can
** free it, and reset the start pointer for ** free it, and reset the start pointer for
......
...@@ -154,8 +154,8 @@ int RIOParam(struct Port *PortP, int cmd, int Modem, int SleepFlag) ...@@ -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) ...@@ -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) ...@@ -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) ...@@ -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) ...@@ -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) ...@@ -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;
......
...@@ -86,9 +86,9 @@ static void RIOConCon(struct rio_info *, struct Host *, unsigned int, unsigned i ...@@ -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;
...@@ -307,7 +307,7 @@ int RIORouteRup(struct rio_info *p, unsigned int Rup, struct Host *HostP, struct ...@@ -307,7 +307,7 @@ int RIORouteRup(struct rio_info *p, unsigned int Rup, struct Host *HostP, struct
if (!RIOBootOk(p, HostP, RtaUniq)) { if (!RIOBootOk(p, HostP, RtaUniq)) {
rio_dprintk(RIO_DEBUG_ROUTE, "RTA %x tried to get an ID, but does not belong - FOAD it!\n", RtaUniq); rio_dprintk(RIO_DEBUG_ROUTE, "RTA %x tried to get an ID, but does not belong - FOAD it!\n", RtaUniq);
PktReplyP->Command = ROUTE_FOAD; PktReplyP->Command = ROUTE_FOAD;
HostP->Copy("RT_FOAD", PktReplyP->CommandText, 7); memcpy(PktReplyP->CommandText, "RT_FOAD", 7);
RIOQueueCmdBlk(HostP, Rup, CmdBlkP); RIOQueueCmdBlk(HostP, Rup, CmdBlkP);
return 1; return 1;
} }
...@@ -341,7 +341,7 @@ int RIORouteRup(struct rio_info *p, unsigned int Rup, struct Host *HostP, struct ...@@ -341,7 +341,7 @@ int RIORouteRup(struct rio_info *p, unsigned int Rup, struct Host *HostP, struct
HostP->Mapping[ThisUnit].Flags |= MSG_DONE; HostP->Mapping[ThisUnit].Flags |= MSG_DONE;
} }
PktReplyP->Command = ROUTE_FOAD; PktReplyP->Command = ROUTE_FOAD;
HostP->Copy("RT_FOAD", PktReplyP->CommandText, 7); memcpy(PktReplyP->CommandText, "RT_FOAD", 7);
RIOQueueCmdBlk(HostP, Rup, CmdBlkP); RIOQueueCmdBlk(HostP, Rup, CmdBlkP);
return 1; return 1;
} }
...@@ -367,7 +367,7 @@ int RIORouteRup(struct rio_info *p, unsigned int Rup, struct Host *HostP, struct ...@@ -367,7 +367,7 @@ int RIORouteRup(struct rio_info *p, unsigned int Rup, struct Host *HostP, struct
PktReplyP->IDNum2 = ROUTE_NO_ID; PktReplyP->IDNum2 = ROUTE_NO_ID;
rio_dprintk(RIO_DEBUG_ROUTE, "RTA '%s' has been allocated ID %d\n", HostP->Mapping[ThisUnit].Name, PktReplyP->IDNum); rio_dprintk(RIO_DEBUG_ROUTE, "RTA '%s' has been allocated ID %d\n", HostP->Mapping[ThisUnit].Name, PktReplyP->IDNum);
} }
HostP->Copy("RT_ALLOCAT", PktReplyP->CommandText, 10); memcpy(PktReplyP->CommandText, "RT_ALLOCAT", 10);
RIOQueueCmdBlk(HostP, Rup, CmdBlkP); RIOQueueCmdBlk(HostP, Rup, CmdBlkP);
...@@ -469,7 +469,7 @@ int RIORouteRup(struct rio_info *p, unsigned int Rup, struct Host *HostP, struct ...@@ -469,7 +469,7 @@ int RIORouteRup(struct rio_info *p, unsigned int Rup, struct Host *HostP, struct
} }
PktReplyP->Command = ROUTE_FOAD; PktReplyP->Command = ROUTE_FOAD;
HostP->Copy("RT_FOAD", PktReplyP->CommandText, 7); memcpy(PktReplyP->CommandText, "RT_FOAD", 7);
} else { } else {
/* /*
** we did boot it (as an extra), and there may now be a table ** we did boot it (as an extra), and there may now be a table
...@@ -489,7 +489,7 @@ int RIORouteRup(struct rio_info *p, unsigned int Rup, struct Host *HostP, struct ...@@ -489,7 +489,7 @@ int RIORouteRup(struct rio_info *p, unsigned int Rup, struct Host *HostP, struct
} }
} }
PktReplyP->Command = ROUTE_USED; PktReplyP->Command = ROUTE_USED;
HostP->Copy("RT_USED", PktReplyP->CommandText, 7); memcpy(PktReplyP->CommandText, "RT_USED", 7);
} }
RIOQueueCmdBlk(HostP, Rup, CmdBlkP); RIOQueueCmdBlk(HostP, Rup, CmdBlkP);
return 1; return 1;
...@@ -517,8 +517,8 @@ void RIOFixPhbs(struct rio_info *p, struct Host *HostP, unsigned int unit) ...@@ -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) ...@@ -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);
} }
......
...@@ -534,8 +534,8 @@ int RIODeleteRta(struct rio_info *p, struct Map *MapP) ...@@ -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,12 +545,12 @@ int RIODeleteRta(struct rio_info *p, struct Map *MapP) ...@@ -545,12 +545,12 @@ 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", readw(TxPktP), readb(&Pkt->dest_unit), readb(&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);
} }
rio_dprintk(RIO_DEBUG_TABLE, "Port %d phb destination: Old %x:%x New %x:%x\n", port, PortP->PhbP->destination & 0xff, (PortP->PhbP->destination >> 8) & 0xff, dest_unit, dest_port); rio_dprintk(RIO_DEBUG_TABLE, "Port %d phb destination: Old %x:%x New %x:%x\n", port, readb(&PortP->PhbP->destination) & 0xff, (readb(&PortP->PhbP->destination) >> 8) & 0xff, dest_unit, dest_port);
writew(dest_unit + (dest_port << 8), &PortP->PhbP->destination); writew(dest_unit + (dest_port << 8), &PortP->PhbP->destination);
} }
rio_spin_unlock_irqrestore(&PortP->portSem, sem_flags); rio_spin_unlock_irqrestore(&PortP->portSem, sem_flags);
...@@ -781,13 +781,13 @@ int RIOReMapPorts(struct rio_info *p, struct Host *HostP, struct Map *HostMapP) ...@@ -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;
......
...@@ -576,7 +576,7 @@ static void RIOClearUp(struct Port *PortP) ...@@ -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;
......
...@@ -44,7 +44,7 @@ static char *_unixrup_h_sccs_ = "@(#)unixrup.h 1.2"; ...@@ -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 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册