Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] trivial annotations in rio

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro d886cb58 a8bd6070

+228 -230
+6 -6
drivers/char/rio/daemon.h
··· 51 51 }; 52 52 53 53 struct DownLoad { 54 - char *DataP; 54 + char __user *DataP; 55 55 unsigned int Count; 56 56 unsigned int ProductCode; 57 57 }; ··· 83 83 struct LpbReq { 84 84 unsigned int Host; 85 85 unsigned int Link; 86 - struct LPB *LpbP; 86 + struct LPB __user *LpbP; 87 87 }; 88 88 89 89 struct RupReq { 90 90 unsigned int HostNum; 91 91 unsigned int RupNum; 92 - struct RUP *RupP; 92 + struct RUP __user *RupP; 93 93 }; 94 94 95 95 struct PortReq { 96 96 unsigned int SysPort; 97 - struct Port *PortP; 97 + struct Port __user *PortP; 98 98 }; 99 99 100 100 struct StreamInfo { ··· 105 105 106 106 struct HostReq { 107 107 unsigned int HostNum; 108 - struct Host *HostP; 108 + struct Host __user *HostP; 109 109 }; 110 110 111 111 struct HostDpRam { 112 112 unsigned int HostNum; 113 - struct DpRam *DpRamP; 113 + struct DpRam __user *DpRamP; 114 114 }; 115 115 116 116 struct DebugCtrl {
+13 -12
drivers/char/rio/func.h
··· 46 46 int RIOBootCodeHOST(struct rio_info *, struct DownLoad *); 47 47 int RIOBootCodeUNKNOWN(struct rio_info *, struct DownLoad *); 48 48 void msec_timeout(struct Host *); 49 - int RIOBootRup(struct rio_info *, unsigned int, struct Host *, struct PKT *); 49 + int RIOBootRup(struct rio_info *, unsigned int, struct Host *, struct PKT __iomem *); 50 50 int RIOBootOk(struct rio_info *, struct Host *, unsigned long); 51 51 int RIORtaBound(struct rio_info *, unsigned int); 52 52 void rio_fill_host_slot(int, int, unsigned int, struct Host *); ··· 55 55 int RIOFoadRta(struct Host *, struct Map *); 56 56 int RIOZombieRta(struct Host *, struct Map *); 57 57 int RIOCommandRta(struct rio_info *, unsigned long, int (*func) (struct Host *, struct Map *)); 58 - int RIOIdentifyRta(struct rio_info *, void *); 59 - int RIOKillNeighbour(struct rio_info *, void *); 58 + int RIOIdentifyRta(struct rio_info *, void __user *); 59 + int RIOKillNeighbour(struct rio_info *, void __user *); 60 60 int RIOSuspendBootRta(struct Host *, int, int); 61 61 int RIOFoadWakeup(struct rio_info *); 62 62 struct CmdBlk *RIOGetCmdBlk(void); ··· 68 68 int RIOUnUse(unsigned long, struct CmdBlk *); 69 69 70 70 /* rioctrl.c */ 71 - int riocontrol(struct rio_info *, dev_t, int, caddr_t, int); 71 + int riocontrol(struct rio_info *, dev_t, int, unsigned long, int); 72 + 72 73 int RIOPreemptiveCmd(struct rio_info *, struct Port *, unsigned char); 73 74 74 75 /* rioinit.c */ ··· 78 77 void RIOISAinit(struct rio_info *, int); 79 78 int RIODoAT(struct rio_info *, int, int); 80 79 caddr_t RIOCheckForATCard(int); 81 - int RIOAssignAT(struct rio_info *, int, caddr_t, int); 82 - int RIOBoardTest(unsigned long, caddr_t, unsigned char, int); 80 + int RIOAssignAT(struct rio_info *, int, void __iomem *, int); 81 + int RIOBoardTest(unsigned long, void __iomem *, unsigned char, int); 83 82 void RIOAllocDataStructs(struct rio_info *); 84 83 void RIOSetupDataStructs(struct rio_info *); 85 84 int RIODefaultName(struct rio_info *, struct Host *, unsigned int); 86 85 struct rioVersion *RIOVersid(void); 87 - void RIOHostReset(unsigned int, struct DpRam *, unsigned int); 86 + void RIOHostReset(unsigned int, struct DpRam __iomem *, unsigned int); 88 87 89 88 /* riointr.c */ 90 89 void RIOTxEnable(char *); ··· 96 95 int RIODelay(struct Port *PortP, int); 97 96 int RIODelay_ni(struct Port *PortP, int); 98 97 void ms_timeout(struct Port *); 99 - int can_add_transmit(struct PKT **, struct Port *); 98 + int can_add_transmit(struct PKT __iomem **, struct Port *); 100 99 void add_transmit(struct Port *); 101 - void put_free_end(struct Host *, struct PKT *); 102 - int can_remove_receive(struct PKT **, struct Port *); 100 + void put_free_end(struct Host *, struct PKT __iomem *); 101 + int can_remove_receive(struct PKT __iomem **, struct Port *); 103 102 void remove_receive(struct Port *); 104 103 105 104 /* rioroute.c */ 106 - int RIORouteRup(struct rio_info *, unsigned int, struct Host *, struct PKT *); 105 + int RIORouteRup(struct rio_info *, unsigned int, struct Host *, struct PKT __iomem *); 107 106 void RIOFixPhbs(struct rio_info *, struct Host *, unsigned int); 108 107 unsigned int GetUnitType(unsigned int); 109 108 int RIOSetChange(struct rio_info *); ··· 140 139 struct rio_info *rio_info_store(int cmd, struct rio_info *p); 141 140 #endif 142 141 143 - extern void rio_copy_to_card(void *to, void *from, int len); 142 + extern void rio_copy_to_card(void __iomem *to, void *from, int len); 144 143 extern int rio_minor(struct tty_struct *tty); 145 144 extern int rio_ismodem(struct tty_struct *tty); 146 145
+8 -8
drivers/char/rio/host.h
··· 48 48 unsigned char Ivec; /* POLLED or ivec number */ 49 49 unsigned char Mode; /* Control stuff */ 50 50 unsigned char Slot; /* Slot */ 51 - caddr_t Caddr; /* KV address of DPRAM */ 52 - struct DpRam *CardP; /* KV address of DPRAM, with overlay */ 51 + void __iomem *Caddr; /* KV address of DPRAM */ 52 + struct DpRam __iomem *CardP; /* KV address of DPRAM, with overlay */ 53 53 unsigned long PaddrP; /* Phys. address of DPRAM */ 54 54 char Name[MAX_NAME_LEN]; /* The name of the host */ 55 55 unsigned int UniqueNum; /* host unique number */ ··· 57 57 unsigned int WorkToBeDone; /* set to true each interrupt */ 58 58 unsigned int InIntr; /* Being serviced? */ 59 59 unsigned int IntSrvDone; /* host's interrupt has been serviced */ 60 - void (*Copy) (void *, void *, int); /* copy func */ 60 + void (*Copy) (void *, void __iomem *, int); /* copy func */ 61 61 struct timer_list timer; 62 62 /* 63 63 ** I M P O R T A N T ! ··· 83 83 84 84 struct Top Topology[LINKS_PER_UNIT]; /* one per link */ 85 85 struct Map Mapping[MAX_RUP]; /* Mappings for host */ 86 - struct PHB *PhbP; /* Pointer to the PHB array */ 87 - unsigned short *PhbNumP; /* Ptr to Number of PHB's */ 88 - struct LPB *LinkStrP; /* Link Structure Array */ 89 - struct RUP *RupP; /* Sixteen real rups here */ 90 - struct PARM_MAP *ParmMapP; /* points to the parmmap */ 86 + struct PHB __iomem *PhbP; /* Pointer to the PHB array */ 87 + unsigned short __iomem *PhbNumP; /* Ptr to Number of PHB's */ 88 + struct LPB __iomem *LinkStrP; /* Link Structure Array */ 89 + struct RUP __iomem *RupP; /* Sixteen real rups here */ 90 + struct PARM_MAP __iomem *ParmMapP; /* points to the parmmap */ 91 91 unsigned int ExtraUnits[MAX_EXTRA_UNITS]; /* unknown things */ 92 92 unsigned int NumExtraBooted; /* how many of the above */ 93 93 /*
+8 -8
drivers/char/rio/port.h
··· 40 40 struct gs_port gs; 41 41 int PortNum; /* RIO port no., 0-511 */ 42 42 struct Host *HostP; 43 - caddr_t Caddr; 43 + void __iomem *Caddr; 44 44 unsigned short HostPort; /* Port number on host card */ 45 45 unsigned char RupNum; /* Number of RUP for port */ 46 46 unsigned char ID2; /* Second ID of RTA for port */ ··· 92 92 #define RIO_RTSFLOW 0x0400 /* RIO's own RTSFLOW flag */ 93 93 94 94 95 - struct PHB *PhbP; /* pointer to PHB for port */ 96 - u16 *TxAdd; /* Add packets here */ 97 - u16 *TxStart; /* Start of add array */ 98 - u16 *TxEnd; /* End of add array */ 99 - u16 *RxRemove; /* Remove packets here */ 100 - u16 *RxStart; /* Start of remove array */ 101 - u16 *RxEnd; /* End of remove array */ 95 + struct PHB __iomem *PhbP; /* pointer to PHB for port */ 96 + u16 __iomem *TxAdd; /* Add packets here */ 97 + u16 __iomem *TxStart; /* Start of add array */ 98 + u16 __iomem *TxEnd; /* End of add array */ 99 + u16 __iomem *RxRemove; /* Remove packets here */ 100 + u16 __iomem *RxStart; /* Start of remove array */ 101 + u16 __iomem *RxEnd; /* End of remove array */ 102 102 unsigned int RtaUniqueNum; /* Unique number of RTA */ 103 103 unsigned short PortState; /* status of port */ 104 104 unsigned short ModemState; /* status of modem lines */
+2 -2
drivers/char/rio/rio.h
··· 129 129 ** RIO_OBJ takes hostp->Caddr and a UNIX pointer to an object and 130 130 ** returns the offset into the DP RAM area. 131 131 */ 132 - #define RIO_PTR(C,O) (((unsigned char *)(C))+(0xFFFF&(O))) 133 - #define RIO_OFF(C,O) ((long)(O)-(long)(C)) 132 + #define RIO_PTR(C,O) (((unsigned char __iomem *)(C))+(0xFFFF&(O))) 133 + #define RIO_OFF(C,O) ((unsigned char __iomem *)(O)-(unsigned char __iomem *)(C)) 134 134 135 135 /* 136 136 ** How to convert from various different device number formats:
+15 -14
drivers/char/rio/rio_linux.c
··· 333 333 return !RIO_FAIL; 334 334 } 335 335 336 - void rio_copy_to_card(void *to, void *from, int len) 336 + void rio_copy_to_card(void __iomem *to, void *from, int len) 337 337 { 338 338 rio_memcpy_toio(NULL, to, from, len); 339 339 } ··· 573 573 func_enter(); 574 574 575 575 /* The "dev" argument isn't used. */ 576 - rc = riocontrol(p, 0, cmd, (void *) arg, capable(CAP_SYS_ADMIN)); 576 + rc = riocontrol(p, 0, cmd, arg, capable(CAP_SYS_ADMIN)); 577 577 578 578 func_exit(); 579 579 return rc; ··· 583 583 584 584 static int rio_ioctl(struct tty_struct *tty, struct file *filp, unsigned int cmd, unsigned long arg) 585 585 { 586 + void __user *argp = (void __user *)arg; 586 587 int rc; 587 588 struct Port *PortP; 588 589 int ival; ··· 595 594 rc = 0; 596 595 switch (cmd) { 597 596 case TIOCSSOFTCAR: 598 - if ((rc = get_user(ival, (unsigned int *) arg)) == 0) { 597 + if ((rc = get_user(ival, (unsigned __user *) argp)) == 0) { 599 598 tty->termios->c_cflag = (tty->termios->c_cflag & ~CLOCAL) | (ival ? CLOCAL : 0); 600 599 } 601 600 break; 602 601 case TIOCGSERIAL: 603 602 rc = -EFAULT; 604 - if (access_ok(VERIFY_WRITE, (void *) arg, sizeof(struct serial_struct))) 605 - rc = gs_getserial(&PortP->gs, (struct serial_struct *) arg); 603 + if (access_ok(VERIFY_WRITE, argp, sizeof(struct serial_struct))) 604 + rc = gs_getserial(&PortP->gs, argp); 606 605 break; 607 606 case TCSBRK: 608 607 if (PortP->State & RIO_DELETED) { ··· 632 631 break; 633 632 case TIOCSSERIAL: 634 633 rc = -EFAULT; 635 - if (access_ok(VERIFY_READ, (void *) arg, sizeof(struct serial_struct))) 636 - rc = gs_setserial(&PortP->gs, (struct serial_struct *) arg); 634 + if (access_ok(VERIFY_READ, argp, sizeof(struct serial_struct))) 635 + rc = gs_setserial(&PortP->gs, argp); 637 636 break; 638 637 default: 639 638 rc = -ENOIOCTLCMD; ··· 920 919 static void fix_rio_pci(struct pci_dev *pdev) 921 920 { 922 921 unsigned long hwbase; 923 - unsigned char *rebase; 922 + unsigned char __iomem *rebase; 924 923 unsigned int t; 925 924 926 925 #define CNTRL_REG_OFFSET 0x50 ··· 1000 999 if (((1 << hp->Ivec) & rio_irqmask) == 0) 1001 1000 hp->Ivec = 0; 1002 1001 hp->Caddr = ioremap(p->RIOHosts[p->RIONumHosts].PaddrP, RIO_WINDOW_LEN); 1003 - hp->CardP = (struct DpRam *) hp->Caddr; 1002 + hp->CardP = (struct DpRam __iomem *) hp->Caddr; 1004 1003 hp->Type = RIO_PCI; 1005 1004 hp->Copy = rio_copy_to_card; 1006 1005 hp->Mode = RIO_PCI_BOOT_FROM_RAM; ··· 1022 1021 p->RIONumHosts++; 1023 1022 found++; 1024 1023 } else { 1025 - iounmap((char *) (p->RIOHosts[p->RIONumHosts].Caddr)); 1024 + iounmap(p->RIOHosts[p->RIONumHosts].Caddr); 1026 1025 } 1027 1026 } 1028 1027 ··· 1048 1047 hp->Ivec = 0; 1049 1048 hp->Ivec |= 0x8000; /* Mark as non-sharable */ 1050 1049 hp->Caddr = ioremap(p->RIOHosts[p->RIONumHosts].PaddrP, RIO_WINDOW_LEN); 1051 - hp->CardP = (struct DpRam *) hp->Caddr; 1050 + hp->CardP = (struct DpRam __iomem *) hp->Caddr; 1052 1051 hp->Type = RIO_PCI; 1053 1052 hp->Copy = rio_copy_to_card; 1054 1053 hp->Mode = RIO_PCI_BOOT_FROM_RAM; ··· 1071 1070 p->RIONumHosts++; 1072 1071 found++; 1073 1072 } else { 1074 - iounmap((char *) (p->RIOHosts[p->RIONumHosts].Caddr)); 1073 + iounmap(p->RIOHosts[p->RIONumHosts].Caddr); 1075 1074 } 1076 1075 #else 1077 1076 printk(KERN_ERR "Found an older RIO PCI card, but the driver is not " "compiled to support it.\n"); ··· 1086 1085 /* There was something about the IRQs of these cards. 'Forget what.--REW */ 1087 1086 hp->Ivec = 0; 1088 1087 hp->Caddr = ioremap(p->RIOHosts[p->RIONumHosts].PaddrP, RIO_WINDOW_LEN); 1089 - hp->CardP = (struct DpRam *) hp->Caddr; 1088 + hp->CardP = (struct DpRam __iomem *) hp->Caddr; 1090 1089 hp->Type = RIO_AT; 1091 1090 hp->Copy = rio_copy_to_card; /* AT card PCI???? - PVDL 1092 1091 * -- YES! this is now a normal copy. Only the ··· 1112 1111 } 1113 1112 1114 1113 if (!okboard) 1115 - iounmap((char *) (hp->Caddr)); 1114 + iounmap(hp->Caddr); 1116 1115 } 1117 1116 } 1118 1117
+5 -5
drivers/char/rio/rio_linux.h
··· 131 131 132 132 133 133 #ifdef CONFIG_RIO_OLDPCI 134 - static inline void *rio_memcpy_toio(void *dummy, void *dest, void *source, int n) 134 + static inline void __iomem *rio_memcpy_toio(void __iomem *dummy, void __iomem *dest, void *source, int n) 135 135 { 136 - char *dst = dest; 136 + char __iomem *dst = dest; 137 137 char *src = source; 138 138 139 139 while (n--) { 140 140 writeb(*src++, dst++); 141 - (void) readb(dummy); 141 + (void) readb(dummy); /* WTF? */ 142 142 } 143 143 144 144 return dest; 145 145 } 146 146 147 147 148 - static inline void *rio_memcpy_fromio(void *dest, void *source, int n) 148 + static inline void *rio_memcpy_fromio(void *dest, void __iomem *source, int n) 149 149 { 150 150 char *dst = dest; 151 - char *src = source; 151 + char __iomem *src = source; 152 152 153 153 while (n--) 154 154 *dst++ = readb(src++);
+26 -26
drivers/char/rio/rioboot.c
··· 71 71 #include "cmdblk.h" 72 72 #include "route.h" 73 73 74 - static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int Rup, struct PktCmd *PktCmdP); 74 + static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int Rup, struct PktCmd __iomem *PktCmdP); 75 75 76 76 static const unsigned char RIOAtVec2Ctrl[] = { 77 77 /* 0 */ INTERRUPT_DISABLE, ··· 204 204 int RIOBootCodeHOST(struct rio_info *p, struct DownLoad *rbp) 205 205 { 206 206 struct Host *HostP; 207 - u8 *Cad; 208 - PARM_MAP *ParmMapP; 207 + u8 __iomem *Cad; 208 + PARM_MAP __iomem *ParmMapP; 209 209 int RupN; 210 210 int PortN; 211 211 unsigned int host; 212 - u8 *StartP; 213 - u8 *DestP; 212 + u8 __iomem *StartP; 213 + u8 __iomem *DestP; 214 214 int wait_count; 215 215 u16 OldParmMap; 216 216 u16 offset; /* It is very important that this is a u16 */ ··· 262 262 ** Ensure that the host really is stopped. 263 263 ** Disable it's external bus & twang its reset line. 264 264 */ 265 - RIOHostReset(HostP->Type, (struct DpRam *) HostP->CardP, HostP->Slot); 265 + RIOHostReset(HostP->Type, HostP->CardP, HostP->Slot); 266 266 267 267 /* 268 268 ** Copy the data directly from user space to the SRAM. ··· 366 366 ** a short branch to 0x7FF8, where a long branch is coded. 367 367 */ 368 368 369 - DestP = (u8 *) &Cad[0x7FF8]; /* <<<---- READ THE ABOVE COMMENTS */ 369 + DestP = &Cad[0x7FF8]; /* <<<---- READ THE ABOVE COMMENTS */ 370 370 371 371 #define NFIX(N) (0x60 | (N)) /* .O = (~(.O + N))<<4 */ 372 372 #define PFIX(N) (0x20 | (N)) /* .O = (.O + N)<<4 */ ··· 438 438 rio_dprintk(RIO_DEBUG_BOOT, "RIO Mesg Run Fail\n"); 439 439 HostP->Flags &= ~RUN_STATE; 440 440 HostP->Flags |= RC_STUFFED; 441 - RIOHostReset( HostP->Type, (struct DpRam *)HostP->CardP, HostP->Slot ); 441 + RIOHostReset( HostP->Type, HostP->CardP, HostP->Slot ); 442 442 continue; 443 443 } 444 444 ··· 453 453 /* 454 454 ** Grab a 32 bit pointer to the parmmap structure 455 455 */ 456 - ParmMapP = (PARM_MAP *) RIO_PTR(Cad, readw(&HostP->__ParmMapR)); 456 + ParmMapP = (PARM_MAP __iomem *) RIO_PTR(Cad, readw(&HostP->__ParmMapR)); 457 457 rio_dprintk(RIO_DEBUG_BOOT, "ParmMapP : %p\n", ParmMapP); 458 - ParmMapP = (PARM_MAP *) ((unsigned long) Cad + readw(&HostP->__ParmMapR)); 458 + ParmMapP = (PARM_MAP __iomem *)(Cad + readw(&HostP->__ParmMapR)); 459 459 rio_dprintk(RIO_DEBUG_BOOT, "ParmMapP : %p\n", ParmMapP); 460 460 461 461 /* ··· 468 468 rio_dprintk(RIO_DEBUG_BOOT, "Links = 0x%x\n", readw(&ParmMapP->links)); 469 469 HostP->Flags &= ~RUN_STATE; 470 470 HostP->Flags |= RC_STUFFED; 471 - RIOHostReset( HostP->Type, (struct DpRam *)HostP->CardP, HostP->Slot ); 471 + RIOHostReset( HostP->Type, HostP->CardP, HostP->Slot ); 472 472 continue; 473 473 } 474 474 ··· 491 491 rio_dprintk(RIO_DEBUG_BOOT, "Timedout waiting for init_done\n"); 492 492 HostP->Flags &= ~RUN_STATE; 493 493 HostP->Flags |= RC_STUFFED; 494 - RIOHostReset( HostP->Type, (struct DpRam *)HostP->CardP, HostP->Slot ); 494 + RIOHostReset( HostP->Type, HostP->CardP, HostP->Slot ); 495 495 continue; 496 496 } 497 497 ··· 512 512 ** 32 bit pointers for the driver in ioremap space. 513 513 */ 514 514 HostP->ParmMapP = ParmMapP; 515 - HostP->PhbP = (struct PHB *) RIO_PTR(Cad, readw(&ParmMapP->phb_ptr)); 516 - HostP->RupP = (struct RUP *) RIO_PTR(Cad, readw(&ParmMapP->rups)); 517 - HostP->PhbNumP = (unsigned short *) RIO_PTR(Cad, readw(&ParmMapP->phb_num_ptr)); 518 - HostP->LinkStrP = (struct LPB *) RIO_PTR(Cad, readw(&ParmMapP->link_str_ptr)); 515 + HostP->PhbP = (struct PHB __iomem *) RIO_PTR(Cad, readw(&ParmMapP->phb_ptr)); 516 + HostP->RupP = (struct RUP __iomem *) RIO_PTR(Cad, readw(&ParmMapP->rups)); 517 + HostP->PhbNumP = (unsigned short __iomem *) RIO_PTR(Cad, readw(&ParmMapP->phb_num_ptr)); 518 + HostP->LinkStrP = (struct LPB __iomem *) RIO_PTR(Cad, readw(&ParmMapP->link_str_ptr)); 519 519 520 520 /* 521 521 ** point the UnixRups at the real Rups ··· 540 540 for (PortN = p->RIOFirstPortsMapped; PortN < p->RIOLastPortsMapped + PORTS_PER_RTA; PortN++) { 541 541 if (p->RIOPortp[PortN]->HostP == HostP) { 542 542 struct Port *PortP = p->RIOPortp[PortN]; 543 - struct PHB *PhbP; 543 + struct PHB __iomem *PhbP; 544 544 /* int oldspl; */ 545 545 546 546 if (!PortP->Mapped) ··· 551 551 552 552 PortP->PhbP = PhbP; 553 553 554 - PortP->TxAdd = (u16 *) RIO_PTR(Cad, readw(&PhbP->tx_add)); 555 - PortP->TxStart = (u16 *) RIO_PTR(Cad, readw(&PhbP->tx_start)); 556 - PortP->TxEnd = (u16 *) RIO_PTR(Cad, readw(&PhbP->tx_end)); 557 - PortP->RxRemove = (u16 *) RIO_PTR(Cad, readw(&PhbP->rx_remove)); 558 - PortP->RxStart = (u16 *) RIO_PTR(Cad, readw(&PhbP->rx_start)); 559 - PortP->RxEnd = (u16 *) RIO_PTR(Cad, readw(&PhbP->rx_end)); 554 + PortP->TxAdd = (u16 __iomem *) RIO_PTR(Cad, readw(&PhbP->tx_add)); 555 + PortP->TxStart = (u16 __iomem *) RIO_PTR(Cad, readw(&PhbP->tx_start)); 556 + PortP->TxEnd = (u16 __iomem *) RIO_PTR(Cad, readw(&PhbP->tx_end)); 557 + PortP->RxRemove = (u16 __iomem *) RIO_PTR(Cad, readw(&PhbP->rx_remove)); 558 + PortP->RxStart = (u16 __iomem *) RIO_PTR(Cad, readw(&PhbP->rx_start)); 559 + PortP->RxEnd = (u16 __iomem *) RIO_PTR(Cad, readw(&PhbP->rx_end)); 560 560 561 561 rio_spin_unlock_irqrestore(&PortP->portSem, flags); 562 562 /* ··· 601 601 * return 1. If we havent, then return 0. 602 602 */ 603 603 604 - int RIOBootRup(struct rio_info *p, unsigned int Rup, struct Host *HostP, struct PKT *PacketP) 604 + int RIOBootRup(struct rio_info *p, unsigned int Rup, struct Host *HostP, struct PKT __iomem *PacketP) 605 605 { 606 - struct PktCmd *PktCmdP = (struct PktCmd *) PacketP->data; 606 + struct PktCmd __iomem *PktCmdP = (struct PktCmd __iomem *) PacketP->data; 607 607 struct PktCmd_M *PktReplyP; 608 608 struct CmdBlk *CmdBlkP; 609 609 unsigned int sequence; ··· 722 722 * RtaUniq is the booted RTA. 723 723 */ 724 724 725 - static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int Rup, struct PktCmd *PktCmdP) 725 + static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int Rup, struct PktCmd __iomem *PktCmdP) 726 726 { 727 727 struct Map *MapP = NULL; 728 728 struct Map *MapP2 = NULL;
+10 -10
drivers/char/rio/riocmd.c
··· 180 180 } 181 181 182 182 183 - int RIOIdentifyRta(struct rio_info *p, void * arg) 183 + int RIOIdentifyRta(struct rio_info *p, void __user * arg) 184 184 { 185 185 unsigned int Host; 186 186 ··· 245 245 } 246 246 247 247 248 - int RIOKillNeighbour(struct rio_info *p, void * arg) 248 + int RIOKillNeighbour(struct rio_info *p, void __user * arg) 249 249 { 250 250 uint Host; 251 251 uint ID; ··· 370 370 /* 371 371 ** Incoming command on the COMMAND_RUP to be processed. 372 372 */ 373 - static int RIOCommandRup(struct rio_info *p, uint Rup, struct Host *HostP, struct PKT * PacketP) 373 + static int RIOCommandRup(struct rio_info *p, uint Rup, struct Host *HostP, struct PKT __iomem *PacketP) 374 374 { 375 - struct PktCmd *PktCmdP = (struct PktCmd *) PacketP->data; 375 + struct PktCmd __iomem *PktCmdP = (struct PktCmd __iomem *)PacketP->data; 376 376 struct Port *PortP; 377 377 struct UnixRup *UnixRupP; 378 378 unsigned short SysPort; ··· 601 601 /* 602 602 ** Whammy! blat that pack! 603 603 */ 604 - HostP->Copy((caddr_t) & CmdBlkP->Packet, RIO_PTR(HostP->Caddr, UnixRupP->RupP->txpkt), sizeof(struct PKT)); 604 + HostP->Copy(&CmdBlkP->Packet, RIO_PTR(HostP->Caddr, UnixRupP->RupP->txpkt), sizeof(struct PKT)); 605 605 606 606 /* 607 607 ** place command packet on the pending position. ··· 655 655 { 656 656 struct CmdBlk *CmdBlkP; 657 657 struct UnixRup *UnixRupP; 658 - struct PKT *PacketP; 658 + struct PKT __iomem *PacketP; 659 659 unsigned short Rup; 660 660 unsigned long flags; 661 661 ··· 676 676 if (readw(&UnixRupP->RupP->rxcontrol) != RX_RUP_INACTIVE) { 677 677 int FreeMe; 678 678 679 - PacketP = (struct PKT *) RIO_PTR(HostP->Caddr, readw(&UnixRupP->RupP->rxpkt)); 679 + PacketP = (struct PKT __iomem *) RIO_PTR(HostP->Caddr, readw(&UnixRupP->RupP->rxpkt)); 680 680 681 681 switch (readb(&PacketP->dest_port)) { 682 682 case BOOT_RUP: ··· 696 696 FreeMe = RIOCommandRup(p, Rup, HostP, PacketP); 697 697 if (PacketP->data[5] == MEMDUMP) { 698 698 rio_dprintk(RIO_DEBUG_CMD, "Memdump from 0x%x complete\n", *(unsigned short *) & (PacketP->data[6])); 699 - HostP->Copy((caddr_t) & (PacketP->data[8]), (caddr_t) p->RIOMemDump, 32); 699 + HostP->Copy(&(PacketP->data[8]), p->RIOMemDump, 32); 700 700 } 701 701 rio_spin_lock_irqsave(&UnixRupP->RupLock, flags); 702 702 break; ··· 782 782 /* 783 783 ** Whammy! blat that pack! 784 784 */ 785 - HostP->Copy((caddr_t) & CmdBlkP->Packet, RIO_PTR(HostP->Caddr, UnixRupP->RupP->txpkt), sizeof(struct PKT)); 785 + HostP->Copy(&CmdBlkP->Packet, RIO_PTR(HostP->Caddr, UnixRupP->RupP->txpkt), sizeof(struct PKT)); 786 786 787 787 /* 788 788 ** remove the command from the rup command queue... ··· 824 824 int RIORFlushEnable(unsigned long iPortP, struct CmdBlk *CmdBlkP) 825 825 { 826 826 struct Port *PortP = (struct Port *) iPortP; 827 - struct PKT *PacketP; 827 + struct PKT __iomem *PacketP; 828 828 unsigned long flags; 829 829 830 830 rio_spin_lock_irqsave(&PortP->portSem, flags);
+80 -84
drivers/char/rio/rioctrl.c
··· 80 80 static struct LpbReq LpbReq; 81 81 static struct RupReq RupReq; 82 82 static struct PortReq PortReq; 83 - static struct HostReq HostReq; 83 + static struct HostReq HostReq; /* oh really? global? and no locking? */ 84 84 static struct HostDpRam HostDpRam; 85 85 static struct DebugCtrl DebugCtrl; 86 86 static struct Map MapEnt; ··· 126 126 127 127 #define drv_makedev(maj, min) ((((uint) maj & 0xff) << 8) | ((uint) min & 0xff)) 128 128 129 - int riocontrol(p, dev, cmd, arg, su) 130 - struct rio_info *p; 131 - dev_t dev; 132 - int cmd; 133 - caddr_t arg; 134 - int su; 129 + int riocontrol(struct rio_info *p, dev_t dev, int cmd, unsigned long arg, int su) 135 130 { 136 131 uint Host; /* leave me unsigned! */ 137 132 uint port; /* and me! */ ··· 134 139 ushort loop; 135 140 int Entry; 136 141 struct Port *PortP; 137 - struct PKT *PacketP; 142 + struct PKT __iomem *PacketP; 138 143 int retval = 0; 139 144 unsigned long flags; 145 + void __user *argp = (void __user *)arg; 140 146 141 147 func_enter(); 142 148 ··· 145 149 Host = 0; 146 150 PortP = NULL; 147 151 148 - rio_dprintk(RIO_DEBUG_CTRL, "control ioctl cmd: 0x%x arg: %p\n", cmd, arg); 152 + rio_dprintk(RIO_DEBUG_CTRL, "control ioctl cmd: 0x%x arg: %p\n", cmd, argp); 149 153 150 154 switch (cmd) { 151 155 /* ··· 156 160 ** otherwise just the specified host card will be changed. 157 161 */ 158 162 case RIO_SET_TIMER: 159 - rio_dprintk(RIO_DEBUG_CTRL, "RIO_SET_TIMER to %ldms\n", (unsigned long)arg); 163 + rio_dprintk(RIO_DEBUG_CTRL, "RIO_SET_TIMER to %ldms\n", arg); 160 164 { 161 165 int host, value; 162 - host = ((unsigned long) arg >> 16) & 0x0000FFFF; 163 - value = (unsigned long) arg & 0x0000ffff; 166 + host = (arg >> 16) & 0x0000FFFF; 167 + value = arg & 0x0000ffff; 164 168 if (host == -1) { 165 169 for (host = 0; host < p->RIONumHosts; host++) { 166 170 if (p->RIOHosts[host].Flags == RC_RUNNING) { ··· 179 183 180 184 case RIO_FOAD_RTA: 181 185 rio_dprintk(RIO_DEBUG_CTRL, "RIO_FOAD_RTA\n"); 182 - return RIOCommandRta(p, (unsigned long)arg, RIOFoadRta); 186 + return RIOCommandRta(p, arg, RIOFoadRta); 183 187 184 188 case RIO_ZOMBIE_RTA: 185 189 rio_dprintk(RIO_DEBUG_CTRL, "RIO_ZOMBIE_RTA\n"); 186 - return RIOCommandRta(p, (unsigned long)arg, RIOZombieRta); 190 + return RIOCommandRta(p, arg, RIOZombieRta); 187 191 188 192 case RIO_IDENTIFY_RTA: 189 193 rio_dprintk(RIO_DEBUG_CTRL, "RIO_IDENTIFY_RTA\n"); 190 - return RIOIdentifyRta(p, arg); 194 + return RIOIdentifyRta(p, argp); 191 195 192 196 case RIO_KILL_NEIGHBOUR: 193 197 rio_dprintk(RIO_DEBUG_CTRL, "RIO_KILL_NEIGHBOUR\n"); 194 - return RIOKillNeighbour(p, arg); 198 + return RIOKillNeighbour(p, argp); 195 199 196 200 case SPECIAL_RUP_CMD: 197 201 { 198 202 struct CmdBlk *CmdBlkP; 199 203 200 204 rio_dprintk(RIO_DEBUG_CTRL, "SPECIAL_RUP_CMD\n"); 201 - if (copy_from_user(&SpecialRupCmd, arg, sizeof(SpecialRupCmd))) { 205 + if (copy_from_user(&SpecialRupCmd, argp, sizeof(SpecialRupCmd))) { 202 206 rio_dprintk(RIO_DEBUG_CTRL, "SPECIAL_RUP_CMD copy failed\n"); 203 207 p->RIOError.Error = COPYIN_FAILED; 204 208 return -EFAULT; ··· 235 239 if ((retval = RIOApel(p)) != 0) 236 240 return retval; 237 241 238 - if (copy_to_user(arg, p->RIOConnectTable, TOTAL_MAP_ENTRIES * sizeof(struct Map))) { 242 + if (copy_to_user(argp, p->RIOConnectTable, TOTAL_MAP_ENTRIES * sizeof(struct Map))) { 239 243 rio_dprintk(RIO_DEBUG_CTRL, "RIO_GET_TABLE copy failed\n"); 240 244 p->RIOError.Error = COPYOUT_FAILED; 241 245 return -EFAULT; ··· 280 284 p->RIOError.Error = NOT_SUPER_USER; 281 285 return -EPERM; 282 286 } 283 - if (copy_from_user(&p->RIOConnectTable[0], arg, TOTAL_MAP_ENTRIES * sizeof(struct Map))) { 287 + if (copy_from_user(&p->RIOConnectTable[0], argp, TOTAL_MAP_ENTRIES * sizeof(struct Map))) { 284 288 rio_dprintk(RIO_DEBUG_CTRL, "RIO_PUT_TABLE copy failed\n"); 285 289 p->RIOError.Error = COPYIN_FAILED; 286 290 return -EFAULT; ··· 326 330 p->RIOError.Error = NOT_SUPER_USER; 327 331 return -EPERM; 328 332 } 329 - if (copy_to_user(arg, p->RIOBindTab, (sizeof(ulong) * MAX_RTA_BINDINGS))) { 333 + if (copy_to_user(argp, p->RIOBindTab, (sizeof(ulong) * MAX_RTA_BINDINGS))) { 330 334 rio_dprintk(RIO_DEBUG_CTRL, "RIO_GET_BINDINGS copy failed\n"); 331 335 p->RIOError.Error = COPYOUT_FAILED; 332 336 return -EFAULT; ··· 345 349 p->RIOError.Error = NOT_SUPER_USER; 346 350 return -EPERM; 347 351 } 348 - if (copy_from_user(&p->RIOBindTab[0], arg, (sizeof(ulong) * MAX_RTA_BINDINGS))) { 352 + if (copy_from_user(&p->RIOBindTab[0], argp, (sizeof(ulong) * MAX_RTA_BINDINGS))) { 349 353 rio_dprintk(RIO_DEBUG_CTRL, "RIO_PUT_BINDINGS copy failed\n"); 350 354 p->RIOError.Error = COPYIN_FAILED; 351 355 return -EFAULT; ··· 369 373 for (Entry = 0; Entry < MAX_RTA_BINDINGS; Entry++) { 370 374 if ((EmptySlot == -1) && (p->RIOBindTab[Entry] == 0L)) 371 375 EmptySlot = Entry; 372 - else if (p->RIOBindTab[Entry] == (long)arg) { 376 + else if (p->RIOBindTab[Entry] == arg) { 373 377 /* 374 378 ** Already exists - delete 375 379 */ 376 380 p->RIOBindTab[Entry] = 0L; 377 - rio_dprintk(RIO_DEBUG_CTRL, "Removing Rta %ld from p->RIOBindTab\n", (unsigned long)arg); 381 + rio_dprintk(RIO_DEBUG_CTRL, "Removing Rta %ld from p->RIOBindTab\n", arg); 378 382 return 0; 379 383 } 380 384 } ··· 382 386 ** Dosen't exist - add 383 387 */ 384 388 if (EmptySlot != -1) { 385 - p->RIOBindTab[EmptySlot] = (unsigned long)arg; 386 - rio_dprintk(RIO_DEBUG_CTRL, "Adding Rta %lx to p->RIOBindTab\n", (unsigned long) arg); 389 + p->RIOBindTab[EmptySlot] = arg; 390 + rio_dprintk(RIO_DEBUG_CTRL, "Adding Rta %lx to p->RIOBindTab\n", arg); 387 391 } else { 388 - rio_dprintk(RIO_DEBUG_CTRL, "p->RIOBindTab full! - Rta %lx not added\n", (unsigned long) arg); 392 + rio_dprintk(RIO_DEBUG_CTRL, "p->RIOBindTab full! - Rta %lx not added\n", arg); 389 393 return -ENOMEM; 390 394 } 391 395 return 0; ··· 393 397 394 398 case RIO_RESUME: 395 399 rio_dprintk(RIO_DEBUG_CTRL, "RIO_RESUME\n"); 396 - port = (unsigned long) arg; 400 + port = arg; 397 401 if ((port < 0) || (port > 511)) { 398 402 rio_dprintk(RIO_DEBUG_CTRL, "RIO_RESUME: Bad port number %d\n", port); 399 403 p->RIOError.Error = PORT_NUMBER_OUT_OF_RANGE; ··· 429 433 p->RIOError.Error = NOT_SUPER_USER; 430 434 return -EPERM; 431 435 } 432 - if (copy_from_user(&MapEnt, arg, sizeof(MapEnt))) { 436 + if (copy_from_user(&MapEnt, argp, sizeof(MapEnt))) { 433 437 rio_dprintk(RIO_DEBUG_CTRL, "Copy from user space failed\n"); 434 438 p->RIOError.Error = COPYIN_FAILED; 435 439 return -EFAULT; ··· 443 447 p->RIOError.Error = NOT_SUPER_USER; 444 448 return -EPERM; 445 449 } 446 - if (copy_from_user(&MapEnt, arg, sizeof(MapEnt))) { 450 + if (copy_from_user(&MapEnt, argp, sizeof(MapEnt))) { 447 451 rio_dprintk(RIO_DEBUG_CTRL, "Copy from user space failed\n"); 448 452 p->RIOError.Error = COPYIN_FAILED; 449 453 return -EFAULT; ··· 457 461 p->RIOError.Error = NOT_SUPER_USER; 458 462 return -EPERM; 459 463 } 460 - if (copy_from_user(&MapEnt, arg, sizeof(MapEnt))) { 464 + if (copy_from_user(&MapEnt, argp, sizeof(MapEnt))) { 461 465 rio_dprintk(RIO_DEBUG_CTRL, "Copy from data space failed\n"); 462 466 p->RIOError.Error = COPYIN_FAILED; 463 467 return -EFAULT; ··· 465 469 return RIODeleteRta(p, &MapEnt); 466 470 467 471 case RIO_QUICK_CHECK: 468 - if (copy_to_user(arg, &p->RIORtaDisCons, sizeof(unsigned int))) { 472 + if (copy_to_user(argp, &p->RIORtaDisCons, sizeof(unsigned int))) { 469 473 p->RIOError.Error = COPYOUT_FAILED; 470 474 return -EFAULT; 471 475 } 472 476 return 0; 473 477 474 478 case RIO_LAST_ERROR: 475 - if (copy_to_user(arg, &p->RIOError, sizeof(struct Error))) 479 + if (copy_to_user(argp, &p->RIOError, sizeof(struct Error))) 476 480 return -EFAULT; 477 481 return 0; 478 482 ··· 481 485 return -EINVAL; 482 486 483 487 case RIO_GET_MODTYPE: 484 - if (copy_from_user(&port, arg, sizeof(unsigned int))) { 488 + if (copy_from_user(&port, argp, sizeof(unsigned int))) { 485 489 p->RIOError.Error = COPYIN_FAILED; 486 490 return -EFAULT; 487 491 } ··· 501 505 ** Return module type of port 502 506 */ 503 507 port = PortP->HostP->UnixRups[PortP->RupNum].ModTypes; 504 - if (copy_to_user(arg, &port, sizeof(unsigned int))) { 508 + if (copy_to_user(argp, &port, sizeof(unsigned int))) { 505 509 p->RIOError.Error = COPYOUT_FAILED; 506 510 return -EFAULT; 507 511 } ··· 517 521 518 522 case RIO_SETUP_PORTS: 519 523 rio_dprintk(RIO_DEBUG_CTRL, "Setup ports\n"); 520 - if (copy_from_user(&PortSetup, arg, sizeof(PortSetup))) { 524 + if (copy_from_user(&PortSetup, argp, sizeof(PortSetup))) { 521 525 p->RIOError.Error = COPYIN_FAILED; 522 526 rio_dprintk(RIO_DEBUG_CTRL, "EFAULT"); 523 527 return -EFAULT; ··· 547 551 548 552 case RIO_GET_PORT_SETUP: 549 553 rio_dprintk(RIO_DEBUG_CTRL, "Get port setup\n"); 550 - if (copy_from_user(&PortSetup, arg, sizeof(PortSetup))) { 554 + if (copy_from_user(&PortSetup, argp, sizeof(PortSetup))) { 551 555 p->RIOError.Error = COPYIN_FAILED; 552 556 return -EFAULT; 553 557 } ··· 568 572 PortSetup.XpOn[MAX_XP_CTRL_LEN - 1] = '\0'; 569 573 PortSetup.XpOff[MAX_XP_CTRL_LEN - 1] = '\0'; 570 574 571 - if (copy_to_user(arg, &PortSetup, sizeof(PortSetup))) { 575 + if (copy_to_user(argp, &PortSetup, sizeof(PortSetup))) { 572 576 p->RIOError.Error = COPYOUT_FAILED; 573 577 return -EFAULT; 574 578 } ··· 576 580 577 581 case RIO_GET_PORT_PARAMS: 578 582 rio_dprintk(RIO_DEBUG_CTRL, "Get port params\n"); 579 - if (copy_from_user(&PortParams, arg, sizeof(struct PortParams))) { 583 + if (copy_from_user(&PortParams, argp, sizeof(struct PortParams))) { 580 584 p->RIOError.Error = COPYIN_FAILED; 581 585 return -EFAULT; 582 586 } ··· 589 593 PortParams.State = PortP->State; 590 594 rio_dprintk(RIO_DEBUG_CTRL, "Port %d\n", PortParams.Port); 591 595 592 - if (copy_to_user(arg, &PortParams, sizeof(struct PortParams))) { 596 + if (copy_to_user(argp, &PortParams, sizeof(struct PortParams))) { 593 597 p->RIOError.Error = COPYOUT_FAILED; 594 598 return -EFAULT; 595 599 } ··· 597 601 598 602 case RIO_GET_PORT_TTY: 599 603 rio_dprintk(RIO_DEBUG_CTRL, "Get port tty\n"); 600 - if (copy_from_user(&PortTty, arg, sizeof(struct PortTty))) { 604 + if (copy_from_user(&PortTty, argp, sizeof(struct PortTty))) { 601 605 p->RIOError.Error = COPYIN_FAILED; 602 606 return -EFAULT; 603 607 } ··· 608 612 609 613 rio_dprintk(RIO_DEBUG_CTRL, "Port %d\n", PortTty.port); 610 614 PortP = (p->RIOPortp[PortTty.port]); 611 - if (copy_to_user(arg, &PortTty, sizeof(struct PortTty))) { 615 + if (copy_to_user(argp, &PortTty, sizeof(struct PortTty))) { 612 616 p->RIOError.Error = COPYOUT_FAILED; 613 617 return -EFAULT; 614 618 } 615 619 return retval; 616 620 617 621 case RIO_SET_PORT_TTY: 618 - if (copy_from_user(&PortTty, arg, sizeof(struct PortTty))) { 622 + if (copy_from_user(&PortTty, argp, sizeof(struct PortTty))) { 619 623 p->RIOError.Error = COPYIN_FAILED; 620 624 return -EFAULT; 621 625 } ··· 630 634 631 635 case RIO_SET_PORT_PARAMS: 632 636 rio_dprintk(RIO_DEBUG_CTRL, "Set port params\n"); 633 - if (copy_from_user(&PortParams, arg, sizeof(PortParams))) { 637 + if (copy_from_user(&PortParams, argp, sizeof(PortParams))) { 634 638 p->RIOError.Error = COPYIN_FAILED; 635 639 return -EFAULT; 636 640 } ··· 646 650 647 651 case RIO_GET_PORT_STATS: 648 652 rio_dprintk(RIO_DEBUG_CTRL, "RIO_GET_PORT_STATS\n"); 649 - if (copy_from_user(&portStats, arg, sizeof(struct portStats))) { 653 + if (copy_from_user(&portStats, argp, sizeof(struct portStats))) { 650 654 p->RIOError.Error = COPYIN_FAILED; 651 655 return -EFAULT; 652 656 } ··· 661 665 portStats.opens = PortP->opens; 662 666 portStats.closes = PortP->closes; 663 667 portStats.ioctls = PortP->ioctls; 664 - if (copy_to_user(arg, &portStats, sizeof(struct portStats))) { 668 + if (copy_to_user(argp, &portStats, sizeof(struct portStats))) { 665 669 p->RIOError.Error = COPYOUT_FAILED; 666 670 return -EFAULT; 667 671 } 668 672 return retval; 669 673 670 674 case RIO_RESET_PORT_STATS: 671 - port = (unsigned long) arg; 675 + port = arg; 672 676 rio_dprintk(RIO_DEBUG_CTRL, "RIO_RESET_PORT_STATS\n"); 673 677 if (port >= RIO_PORTS) { 674 678 p->RIOError.Error = PORT_NUMBER_OUT_OF_RANGE; ··· 686 690 687 691 case RIO_GATHER_PORT_STATS: 688 692 rio_dprintk(RIO_DEBUG_CTRL, "RIO_GATHER_PORT_STATS\n"); 689 - if (copy_from_user(&portStats, arg, sizeof(struct portStats))) { 693 + if (copy_from_user(&portStats, argp, sizeof(struct portStats))) { 690 694 p->RIOError.Error = COPYIN_FAILED; 691 695 return -EFAULT; 692 696 } ··· 702 706 703 707 case RIO_READ_CONFIG: 704 708 rio_dprintk(RIO_DEBUG_CTRL, "RIO_READ_CONFIG\n"); 705 - if (copy_to_user(arg, &p->RIOConf, sizeof(struct Conf))) { 709 + if (copy_to_user(argp, &p->RIOConf, sizeof(struct Conf))) { 706 710 p->RIOError.Error = COPYOUT_FAILED; 707 711 return -EFAULT; 708 712 } ··· 714 718 p->RIOError.Error = NOT_SUPER_USER; 715 719 return -EPERM; 716 720 } 717 - if (copy_from_user(&p->RIOConf, arg, sizeof(struct Conf))) { 721 + if (copy_from_user(&p->RIOConf, argp, sizeof(struct Conf))) { 718 722 p->RIOError.Error = COPYIN_FAILED; 719 723 return -EFAULT; 720 724 } ··· 742 746 case RIO_SETDEBUG: 743 747 case RIO_GETDEBUG: 744 748 rio_dprintk(RIO_DEBUG_CTRL, "RIO_SETDEBUG/RIO_GETDEBUG\n"); 745 - if (copy_from_user(&DebugCtrl, arg, sizeof(DebugCtrl))) { 749 + if (copy_from_user(&DebugCtrl, argp, sizeof(DebugCtrl))) { 746 750 p->RIOError.Error = COPYIN_FAILED; 747 751 return -EFAULT; 748 752 } ··· 759 763 rio_dprintk(RIO_DEBUG_CTRL, "Get global debug 0x%x wait 0x%x\n", p->rio_debug, p->RIODebugWait); 760 764 DebugCtrl.Debug = p->rio_debug; 761 765 DebugCtrl.Wait = p->RIODebugWait; 762 - if (copy_to_user(arg, &DebugCtrl, sizeof(DebugCtrl))) { 766 + if (copy_to_user(argp, &DebugCtrl, sizeof(DebugCtrl))) { 763 767 rio_dprintk(RIO_DEBUG_CTRL, "RIO_SET/GET DEBUG: bad port number %d\n", DebugCtrl.SysPort); 764 768 p->RIOError.Error = COPYOUT_FAILED; 765 769 return -EFAULT; ··· 781 785 } else { 782 786 rio_dprintk(RIO_DEBUG_CTRL, "RIO_GETDEBUG 0x%x\n", p->RIOPortp[DebugCtrl.SysPort]->Debug); 783 787 DebugCtrl.Debug = p->RIOPortp[DebugCtrl.SysPort]->Debug; 784 - if (copy_to_user(arg, &DebugCtrl, sizeof(DebugCtrl))) { 788 + if (copy_to_user(argp, &DebugCtrl, sizeof(DebugCtrl))) { 785 789 rio_dprintk(RIO_DEBUG_CTRL, "RIO_GETDEBUG: Bad copy to user space\n"); 786 790 p->RIOError.Error = COPYOUT_FAILED; 787 791 return -EFAULT; ··· 796 800 ** textual null terminated string. 797 801 */ 798 802 rio_dprintk(RIO_DEBUG_CTRL, "RIO_VERSID\n"); 799 - if (copy_to_user(arg, RIOVersid(), sizeof(struct rioVersion))) { 803 + if (copy_to_user(argp, RIOVersid(), sizeof(struct rioVersion))) { 800 804 rio_dprintk(RIO_DEBUG_CTRL, "RIO_VERSID: Bad copy to user space (host=%d)\n", Host); 801 805 p->RIOError.Error = COPYOUT_FAILED; 802 806 return -EFAULT; ··· 809 813 ** at init time. 810 814 */ 811 815 rio_dprintk(RIO_DEBUG_CTRL, "RIO_NUM_HOSTS\n"); 812 - if (copy_to_user(arg, &p->RIONumHosts, sizeof(p->RIONumHosts))) { 816 + if (copy_to_user(argp, &p->RIONumHosts, sizeof(p->RIONumHosts))) { 813 817 rio_dprintk(RIO_DEBUG_CTRL, "RIO_NUM_HOSTS: Bad copy to user space\n"); 814 818 p->RIOError.Error = COPYOUT_FAILED; 815 819 return -EFAULT; ··· 820 824 /* 821 825 ** Kill host. This may not be in the final version... 822 826 */ 823 - rio_dprintk(RIO_DEBUG_CTRL, "RIO_HOST_FOAD %ld\n", (unsigned long) arg); 827 + rio_dprintk(RIO_DEBUG_CTRL, "RIO_HOST_FOAD %ld\n", arg); 824 828 if (!su) { 825 829 rio_dprintk(RIO_DEBUG_CTRL, "RIO_HOST_FOAD: Not super user\n"); 826 830 p->RIOError.Error = NOT_SUPER_USER; ··· 854 858 p->RIOError.Error = NOT_SUPER_USER; 855 859 return -EPERM; 856 860 } 857 - if (copy_from_user(&DownLoad, arg, sizeof(DownLoad))) { 861 + if (copy_from_user(&DownLoad, argp, sizeof(DownLoad))) { 858 862 rio_dprintk(RIO_DEBUG_CTRL, "RIO_DOWNLOAD: Copy in from user space failed\n"); 859 863 p->RIOError.Error = COPYIN_FAILED; 860 864 return -EFAULT; ··· 884 888 { 885 889 unsigned int host; 886 890 887 - if (copy_from_user(&host, arg, sizeof(host))) { 891 + if (copy_from_user(&host, argp, sizeof(host))) { 888 892 rio_dprintk(RIO_DEBUG_CTRL, "RIO_HOST_REQ: Copy in from user space failed\n"); 889 893 p->RIOError.Error = COPYIN_FAILED; 890 894 return -EFAULT; ··· 893 897 ** Fetch the parmmap 894 898 */ 895 899 rio_dprintk(RIO_DEBUG_CTRL, "RIO_PARMS\n"); 896 - if (copy_to_user(arg, p->RIOHosts[host].ParmMapP, sizeof(PARM_MAP))) { 900 + if (copy_to_user(argp, p->RIOHosts[host].ParmMapP, sizeof(PARM_MAP))) { 897 901 p->RIOError.Error = COPYOUT_FAILED; 898 902 rio_dprintk(RIO_DEBUG_CTRL, "RIO_PARMS: Copy out to user space failed\n"); 899 903 return -EFAULT; ··· 903 907 904 908 case RIO_HOST_REQ: 905 909 rio_dprintk(RIO_DEBUG_CTRL, "RIO_HOST_REQ\n"); 906 - if (copy_from_user(&HostReq, arg, sizeof(HostReq))) { 910 + if (copy_from_user(&HostReq, argp, sizeof(HostReq))) { 907 911 rio_dprintk(RIO_DEBUG_CTRL, "RIO_HOST_REQ: Copy in from user space failed\n"); 908 912 p->RIOError.Error = COPYIN_FAILED; 909 913 return -EFAULT; ··· 924 928 925 929 case RIO_HOST_DPRAM: 926 930 rio_dprintk(RIO_DEBUG_CTRL, "Request for DPRAM\n"); 927 - if (copy_from_user(&HostDpRam, arg, sizeof(HostDpRam))) { 931 + if (copy_from_user(&HostDpRam, argp, sizeof(HostDpRam))) { 928 932 rio_dprintk(RIO_DEBUG_CTRL, "RIO_HOST_DPRAM: Copy in from user space failed\n"); 929 933 p->RIOError.Error = COPYIN_FAILED; 930 934 return -EFAULT; ··· 941 945 /* It's hardware like this that really gets on my tits. */ 942 946 static unsigned char copy[sizeof(struct DpRam)]; 943 947 for (off = 0; off < sizeof(struct DpRam); off++) 944 - copy[off] = readb(&p->RIOHosts[HostDpRam.HostNum].Caddr[off]); 948 + copy[off] = readb(p->RIOHosts[HostDpRam.HostNum].Caddr + off); 945 949 if (copy_to_user(HostDpRam.DpRamP, copy, sizeof(struct DpRam))) { 946 950 p->RIOError.Error = COPYOUT_FAILED; 947 951 rio_dprintk(RIO_DEBUG_CTRL, "RIO_HOST_DPRAM: Bad copy to user space\n"); ··· 956 960 957 961 case RIO_SET_BUSY: 958 962 rio_dprintk(RIO_DEBUG_CTRL, "RIO_SET_BUSY\n"); 959 - if ((unsigned long) arg > 511) { 960 - rio_dprintk(RIO_DEBUG_CTRL, "RIO_SET_BUSY: Bad port number %ld\n", (unsigned long) arg); 963 + if (arg > 511) { 964 + rio_dprintk(RIO_DEBUG_CTRL, "RIO_SET_BUSY: Bad port number %ld\n", arg); 961 965 p->RIOError.Error = PORT_NUMBER_OUT_OF_RANGE; 962 966 return -EINVAL; 963 967 } 964 968 rio_spin_lock_irqsave(&PortP->portSem, flags); 965 - p->RIOPortp[(unsigned long) arg]->State |= RIO_BUSY; 969 + p->RIOPortp[arg]->State |= RIO_BUSY; 966 970 rio_spin_unlock_irqrestore(&PortP->portSem, flags); 967 971 return retval; 968 972 ··· 972 976 ** (probably for debug reasons) 973 977 */ 974 978 rio_dprintk(RIO_DEBUG_CTRL, "RIO_HOST_PORT\n"); 975 - if (copy_from_user(&PortReq, arg, sizeof(PortReq))) { 979 + if (copy_from_user(&PortReq, argp, sizeof(PortReq))) { 976 980 rio_dprintk(RIO_DEBUG_CTRL, "RIO_HOST_PORT: Copy in from user space failed\n"); 977 981 p->RIOError.Error = COPYIN_FAILED; 978 982 return -EFAULT; ··· 997 1001 ** (probably for debug reasons) 998 1002 */ 999 1003 rio_dprintk(RIO_DEBUG_CTRL, "RIO_HOST_RUP\n"); 1000 - if (copy_from_user(&RupReq, arg, sizeof(RupReq))) { 1004 + if (copy_from_user(&RupReq, argp, sizeof(RupReq))) { 1001 1005 rio_dprintk(RIO_DEBUG_CTRL, "RIO_HOST_RUP: Copy in from user space failed\n"); 1002 1006 p->RIOError.Error = COPYIN_FAILED; 1003 1007 return -EFAULT; ··· 1034 1038 ** (probably for debug reasons) 1035 1039 */ 1036 1040 rio_dprintk(RIO_DEBUG_CTRL, "RIO_HOST_LPB\n"); 1037 - if (copy_from_user(&LpbReq, arg, sizeof(LpbReq))) { 1041 + if (copy_from_user(&LpbReq, argp, sizeof(LpbReq))) { 1038 1042 rio_dprintk(RIO_DEBUG_CTRL, "RIO_HOST_LPB: Bad copy from user space\n"); 1039 1043 p->RIOError.Error = COPYIN_FAILED; 1040 1044 return -EFAULT; ··· 1132 1136 case RIO_MAP_B110_TO_110: 1133 1137 case RIO_MAP_B110_TO_115200: 1134 1138 rio_dprintk(RIO_DEBUG_CTRL, "Baud rate mapping\n"); 1135 - port = (unsigned long) arg; 1139 + port = arg; 1136 1140 if (port < 0 || port > 511) { 1137 1141 rio_dprintk(RIO_DEBUG_CTRL, "Baud rate mapping: Bad port number %d\n", port); 1138 1142 p->RIOError.Error = PORT_NUMBER_OUT_OF_RANGE; ··· 1162 1166 1163 1167 case RIO_SEND_PACKET: 1164 1168 rio_dprintk(RIO_DEBUG_CTRL, "RIO_SEND_PACKET\n"); 1165 - if (copy_from_user(&SendPack, arg, sizeof(SendPack))) { 1169 + if (copy_from_user(&SendPack, argp, sizeof(SendPack))) { 1166 1170 rio_dprintk(RIO_DEBUG_CTRL, "RIO_SEND_PACKET: Bad copy from user space\n"); 1167 1171 p->RIOError.Error = COPYIN_FAILED; 1168 1172 return -EFAULT; ··· 1206 1210 return su ? 0 : -EPERM; 1207 1211 1208 1212 case RIO_WHAT_MESG: 1209 - if (copy_to_user(arg, &p->RIONoMessage, sizeof(p->RIONoMessage))) { 1213 + if (copy_to_user(argp, &p->RIONoMessage, sizeof(p->RIONoMessage))) { 1210 1214 rio_dprintk(RIO_DEBUG_CTRL, "RIO_WHAT_MESG: Bad copy to user space\n"); 1211 1215 p->RIOError.Error = COPYOUT_FAILED; 1212 1216 return -EFAULT; ··· 1214 1218 return 0; 1215 1219 1216 1220 case RIO_MEM_DUMP: 1217 - if (copy_from_user(&SubCmd, arg, sizeof(struct SubCmdStruct))) { 1221 + if (copy_from_user(&SubCmd, argp, sizeof(struct SubCmdStruct))) { 1218 1222 p->RIOError.Error = COPYIN_FAILED; 1219 1223 return -EFAULT; 1220 1224 } ··· 1244 1248 PortP->State |= RIO_BUSY; 1245 1249 1246 1250 rio_spin_unlock_irqrestore(&PortP->portSem, flags); 1247 - if (copy_to_user(arg, p->RIOMemDump, MEMDUMP_SIZE)) { 1251 + if (copy_to_user(argp, p->RIOMemDump, MEMDUMP_SIZE)) { 1248 1252 rio_dprintk(RIO_DEBUG_CTRL, "RIO_MEM_DUMP copy failed\n"); 1249 1253 p->RIOError.Error = COPYOUT_FAILED; 1250 1254 return -EFAULT; ··· 1252 1256 return 0; 1253 1257 1254 1258 case RIO_TICK: 1255 - if ((unsigned long) arg >= p->RIONumHosts) 1259 + if (arg >= p->RIONumHosts) 1256 1260 return -EINVAL; 1257 - rio_dprintk(RIO_DEBUG_CTRL, "Set interrupt for host %ld\n", (unsigned long) arg); 1258 - writeb(0xFF, &p->RIOHosts[(unsigned long) arg].SetInt); 1261 + rio_dprintk(RIO_DEBUG_CTRL, "Set interrupt for host %ld\n", arg); 1262 + writeb(0xFF, &p->RIOHosts[arg].SetInt); 1259 1263 return 0; 1260 1264 1261 1265 case RIO_TOCK: 1262 - if ((unsigned long) arg >= p->RIONumHosts) 1266 + if (arg >= p->RIONumHosts) 1263 1267 return -EINVAL; 1264 - rio_dprintk(RIO_DEBUG_CTRL, "Clear interrupt for host %ld\n", (unsigned long) arg); 1265 - writeb(0xFF, &p->RIOHosts[(unsigned long) arg].ResetInt); 1268 + rio_dprintk(RIO_DEBUG_CTRL, "Clear interrupt for host %ld\n", arg); 1269 + writeb(0xFF, &p->RIOHosts[arg].ResetInt); 1266 1270 return 0; 1267 1271 1268 1272 case RIO_READ_CHECK: 1269 1273 /* Check reads for pkts with data[0] the same */ 1270 1274 p->RIOReadCheck = !p->RIOReadCheck; 1271 - if (copy_to_user(arg, &p->RIOReadCheck, sizeof(unsigned int))) { 1275 + if (copy_to_user(argp, &p->RIOReadCheck, sizeof(unsigned int))) { 1272 1276 p->RIOError.Error = COPYOUT_FAILED; 1273 1277 return -EFAULT; 1274 1278 } 1275 1279 return 0; 1276 1280 1277 1281 case RIO_READ_REGISTER: 1278 - if (copy_from_user(&SubCmd, arg, sizeof(struct SubCmdStruct))) { 1282 + if (copy_from_user(&SubCmd, argp, sizeof(struct SubCmdStruct))) { 1279 1283 p->RIOError.Error = COPYIN_FAILED; 1280 1284 return -EFAULT; 1281 1285 } ··· 1310 1314 PortP->State |= RIO_BUSY; 1311 1315 1312 1316 rio_spin_unlock_irqrestore(&PortP->portSem, flags); 1313 - if (copy_to_user(arg, &p->CdRegister, sizeof(unsigned int))) { 1317 + if (copy_to_user(argp, &p->CdRegister, sizeof(unsigned int))) { 1314 1318 rio_dprintk(RIO_DEBUG_CTRL, "RIO_READ_REGISTER copy failed\n"); 1315 1319 p->RIOError.Error = COPYOUT_FAILED; 1316 1320 return -EFAULT; ··· 1323 1327 */ 1324 1328 case RIO_MAKE_DEV: 1325 1329 { 1326 - unsigned int port = (unsigned long) arg & RIO_MODEM_MASK; 1330 + unsigned int port = arg & RIO_MODEM_MASK; 1327 1331 unsigned int ret; 1328 1332 1329 - switch ((unsigned long) arg & RIO_DEV_MASK) { 1333 + switch (arg & RIO_DEV_MASK) { 1330 1334 case RIO_DEV_DIRECT: 1331 1335 ret = drv_makedev(MAJOR(dev), port); 1332 1336 rio_dprintk(RIO_DEBUG_CTRL, "Makedev direct 0x%x is 0x%x\n", port, ret); ··· 1354 1358 int mino; 1355 1359 unsigned long ret; 1356 1360 1357 - dv = (dev_t) ((unsigned long) arg); 1361 + dv = (dev_t) (arg); 1358 1362 mino = RIO_UNMODEM(dv); 1359 1363 1360 1364 if (RIO_ISMODEM(dv)) {
+14 -14
drivers/char/rio/rioinit.c
··· 79 79 80 80 int RIOPCIinit(struct rio_info *p, int Mode); 81 81 82 - static int RIOScrub(int, u8 *, int); 82 + static int RIOScrub(int, u8 __iomem *, int); 83 83 84 84 85 85 /** ··· 92 92 ** bits > 0 indicates 16 bit operation. 93 93 */ 94 94 95 - int RIOAssignAT(struct rio_info *p, int Base, caddr_t virtAddr, int mode) 95 + int RIOAssignAT(struct rio_info *p, int Base, void __iomem *virtAddr, int mode) 96 96 { 97 97 int bits; 98 - struct DpRam *cardp = (struct DpRam *)virtAddr; 98 + struct DpRam __iomem *cardp = (struct DpRam __iomem *)virtAddr; 99 99 100 100 if ((Base < ONE_MEG) || (mode & BYTE_ACCESS_MODE)) 101 101 bits = BYTE_OPERATION; ··· 107 107 ** transient stuff. 108 108 */ 109 109 p->RIOHosts[p->RIONumHosts].Caddr = virtAddr; 110 - p->RIOHosts[p->RIONumHosts].CardP = (struct DpRam *)virtAddr; 110 + p->RIOHosts[p->RIONumHosts].CardP = virtAddr; 111 111 112 112 /* 113 113 ** Revision 01 AT host cards don't support WORD operations, ··· 151 151 ** RAM test a board. 152 152 ** Nothing too complicated, just enough to check it out. 153 153 */ 154 - int RIOBoardTest(unsigned long paddr, caddr_t caddr, unsigned char type, int slot) 154 + int RIOBoardTest(unsigned long paddr, void __iomem *caddr, unsigned char type, int slot) 155 155 { 156 - struct DpRam *DpRam = (struct DpRam *)caddr; 157 - char *ram[4]; 156 + struct DpRam __iomem *DpRam = caddr; 157 + void __iomem *ram[4]; 158 158 int size[4]; 159 159 int op, bank; 160 160 int nbanks; ··· 179 179 size[2] = DP_SRAM3_SIZE; 180 180 size[3] = DP_SCRATCH_SIZE; 181 181 182 - ram[0] = (char *)&DpRam->DpSram1[0]; 183 - ram[1] = (char *)&DpRam->DpSram2[0]; 184 - ram[2] = (char *)&DpRam->DpSram3[0]; 182 + ram[0] = DpRam->DpSram1; 183 + ram[1] = DpRam->DpSram2; 184 + ram[2] = DpRam->DpSram3; 185 185 nbanks = (type == RIO_PCI) ? 3 : 4; 186 186 if (nbanks == 4) 187 - ram[3] = (char *)&DpRam->DpScratch[0]; 187 + ram[3] = DpRam->DpScratch; 188 188 189 189 190 190 if (nbanks == 3) { ··· 202 202 */ 203 203 for (op=0; op<TEST_END; op++) { 204 204 for (bank=0; bank<nbanks; bank++) { 205 - if (RIOScrub(op, (u8 *)ram[bank], size[bank]) == RIO_FAIL) { 205 + if (RIOScrub(op, ram[bank], size[bank]) == RIO_FAIL) { 206 206 rio_dprintk (RIO_DEBUG_INIT, "RIO-init: RIOScrub band %d, op %d failed\n", 207 207 bank, op); 208 208 return RIO_FAIL; ··· 227 227 ** to check that the data from the previous phase was retained. 228 228 */ 229 229 230 - static int RIOScrub(int op, u8 *ram, int size) 230 + static int RIOScrub(int op, u8 __iomem *ram, int size) 231 231 { 232 232 int off; 233 233 unsigned char oldbyte; ··· 393 393 return &stVersion; 394 394 } 395 395 396 - void RIOHostReset(unsigned int Type, struct DpRam *DpRamP, unsigned int Slot) 396 + void RIOHostReset(unsigned int Type, struct DpRam __iomem *DpRamP, unsigned int Slot) 397 397 { 398 398 /* 399 399 ** Reset the Tpu
+9 -9
drivers/char/rio/riointr.c
··· 102 102 struct rio_info *p; 103 103 struct tty_struct *tty; 104 104 int c; 105 - struct PKT *PacketP; 105 + struct PKT __iomem *PacketP; 106 106 unsigned long flags; 107 107 108 108 PortP = (struct Port *) en; ··· 144 144 if (c == 0) 145 145 break; 146 146 147 - rio_memcpy_toio(PortP->HostP->Caddr, (caddr_t) PacketP->data, PortP->gs.xmit_buf + PortP->gs.xmit_tail, c); 147 + rio_memcpy_toio(PortP->HostP->Caddr, PacketP->data, PortP->gs.xmit_buf + PortP->gs.xmit_tail, c); 148 148 /* udelay (1); */ 149 149 150 150 writeb(c, &(PacketP->len)); ··· 219 219 for (port = p->RIOFirstPortsBooted; port < p->RIOLastPortsBooted + PORTS_PER_RTA; port++) { 220 220 struct Port *PortP = p->RIOPortp[port]; 221 221 struct tty_struct *ttyP; 222 - struct PKT *PacketP; 222 + struct PKT __iomem *PacketP; 223 223 224 224 /* 225 225 ** not mapped in - most of the RIOPortp[] information ··· 298 298 for (port = p->RIOFirstPortsBooted; port < p->RIOLastPortsBooted + PORTS_PER_RTA; port++) { 299 299 struct Port *PortP = p->RIOPortp[port]; 300 300 struct tty_struct *ttyP; 301 - struct PKT *PacketP; 301 + struct PKT __iomem *PacketP; 302 302 303 303 /* 304 304 ** not mapped in - most of the RIOPortp[] information ··· 427 427 428 428 while (PortP->WflushFlag && can_add_transmit(&PacketP, PortP) && (PortP->InUse == NOT_INUSE)) { 429 429 int p; 430 - struct PktCmd *PktCmdP; 430 + struct PktCmd __iomem *PktCmdP; 431 431 432 432 rio_dprintk(RIO_DEBUG_INTR, "Add WFLUSH marker to data queue\n"); 433 433 /* 434 434 ** make it look just like a WFLUSH command 435 435 */ 436 - PktCmdP = (struct PktCmd *) &PacketP->data[0]; 436 + PktCmdP = (struct PktCmd __iomem *) &PacketP->data[0]; 437 437 438 438 writeb(WFLUSH, &PktCmdP->Command); 439 439 ··· 525 525 { 526 526 struct tty_struct *TtyP; 527 527 unsigned short transCount; 528 - struct PKT *PacketP; 528 + struct PKT __iomem *PacketP; 529 529 register unsigned int DataCnt; 530 - unsigned char *ptr; 530 + unsigned char __iomem *ptr; 531 531 unsigned char *buf; 532 532 int copied = 0; 533 533 ··· 625 625 ** to '#define', (this is the only place ___DEBUG_IT___ occurs in the 626 626 ** driver). 627 627 */ 628 - ptr = (unsigned char *) PacketP->data + PortP->RxDataStart; 628 + ptr = (unsigned char __iomem *) PacketP->data + PortP->RxDataStart; 629 629 630 630 tty_prepare_flip_string(TtyP, &buf, transCount); 631 631 rio_memcpy_fromio(buf, ptr, transCount);
+14 -14
drivers/char/rio/rioparam.c
··· 154 154 { 155 155 struct tty_struct *TtyP; 156 156 int retval; 157 - struct phb_param *phb_param_ptr; 158 - struct PKT *PacketP; 157 + struct phb_param __iomem *phb_param_ptr; 158 + struct PKT __iomem *PacketP; 159 159 int res; 160 160 u8 Cor1 = 0, Cor2 = 0, Cor4 = 0, Cor5 = 0; 161 161 u8 TxXon = 0, TxXoff = 0, RxXon = 0, RxXoff = 0; ··· 235 235 rio_dprintk(RIO_DEBUG_PARAM, "can_add_transmit() returns %x\n", res); 236 236 rio_dprintk(RIO_DEBUG_PARAM, "Packet is %p\n", PacketP); 237 237 238 - phb_param_ptr = (struct phb_param *) PacketP->data; 238 + phb_param_ptr = (struct phb_param __iomem *) PacketP->data; 239 239 240 240 241 241 switch (TtyP->termios->c_cflag & CSIZE) { ··· 580 580 ** We can add another packet to a transmit queue if the packet pointer pointed 581 581 ** to by the TxAdd pointer has PKT_IN_USE clear in its address. 582 582 */ 583 - int can_add_transmit(struct PKT **PktP, struct Port *PortP) 583 + int can_add_transmit(struct PKT __iomem **PktP, struct Port *PortP) 584 584 { 585 - struct PKT *tp; 585 + struct PKT __iomem *tp; 586 586 587 - *PktP = tp = (struct PKT *) RIO_PTR(PortP->Caddr, readw(PortP->TxAdd)); 587 + *PktP = tp = (struct PKT __iomem *) RIO_PTR(PortP->Caddr, readw(PortP->TxAdd)); 588 588 589 589 return !((unsigned long) tp & PKT_IN_USE); 590 590 } ··· 608 608 * Put a packet onto the end of the 609 609 * free list 610 610 ****************************************/ 611 - void put_free_end(struct Host *HostP, struct PKT *PktP) 611 + void put_free_end(struct Host *HostP, struct PKT __iomem *PktP) 612 612 { 613 - struct rio_free_list *tmp_pointer; 613 + struct rio_free_list __iomem *tmp_pointer; 614 614 unsigned short old_end, new_end; 615 615 unsigned long flags; 616 616 ··· 625 625 626 626 if ((old_end = readw(&HostP->ParmMapP->free_list_end)) != TPNULL) { 627 627 new_end = RIO_OFF(HostP->Caddr, PktP); 628 - tmp_pointer = (struct rio_free_list *) RIO_PTR(HostP->Caddr, old_end); 628 + tmp_pointer = (struct rio_free_list __iomem *) RIO_PTR(HostP->Caddr, old_end); 629 629 writew(new_end, &tmp_pointer->next); 630 - writew(old_end, &((struct rio_free_list *) PktP)->prev); 631 - writew(TPNULL, &((struct rio_free_list *) PktP)->next); 630 + writew(old_end, &((struct rio_free_list __iomem *) PktP)->prev); 631 + writew(TPNULL, &((struct rio_free_list __iomem *) PktP)->next); 632 632 writew(new_end, &HostP->ParmMapP->free_list_end); 633 633 } else { /* First packet on the free list this should never happen! */ 634 634 rio_dprintk(RIO_DEBUG_PFE, "put_free_end(): This should never happen\n"); 635 635 writew(RIO_OFF(HostP->Caddr, PktP), &HostP->ParmMapP->free_list_end); 636 - tmp_pointer = (struct rio_free_list *) PktP; 636 + tmp_pointer = (struct rio_free_list __iomem *) PktP; 637 637 writew(TPNULL, &tmp_pointer->prev); 638 638 writew(TPNULL, &tmp_pointer->next); 639 639 } ··· 647 647 ** relevant packet, [having cleared the PKT_IN_USE bit]. If PKT_IN_USE is clear, 648 648 ** then can_remove_receive() returns 0. 649 649 */ 650 - int can_remove_receive(struct PKT **PktP, struct Port *PortP) 650 + int can_remove_receive(struct PKT __iomem **PktP, struct Port *PortP) 651 651 { 652 652 if (readw(PortP->RxRemove) & PKT_IN_USE) { 653 - *PktP = (struct PKT *) RIO_PTR(PortP->Caddr, readw(PortP->RxRemove) & ~PKT_IN_USE); 653 + *PktP = (struct PKT __iomem *) RIO_PTR(PortP->Caddr, readw(PortP->RxRemove) & ~PKT_IN_USE); 654 654 return 1; 655 655 } 656 656 return 0;
+6 -6
drivers/char/rio/rioroute.c
··· 86 86 ** Incoming on the ROUTE_RUP 87 87 ** I wrote this while I was tired. Forgive me. 88 88 */ 89 - int RIORouteRup(struct rio_info *p, unsigned int Rup, struct Host *HostP, struct PKT * PacketP) 89 + int RIORouteRup(struct rio_info *p, unsigned int Rup, struct Host *HostP, struct PKT __iomem * PacketP) 90 90 { 91 - struct PktCmd *PktCmdP = (struct PktCmd *) PacketP->data; 91 + struct PktCmd __iomem *PktCmdP = (struct PktCmd __iomem *) PacketP->data; 92 92 struct PktCmd_M *PktReplyP; 93 93 struct CmdBlk *CmdBlkP; 94 94 struct Port *PortP; ··· 517 517 518 518 for (port = 0; port < PORTS_PER_RTA; port++, PortN++) { 519 519 unsigned short dest_port = port + 8; 520 - u16 *TxPktP; 521 - struct PKT *Pkt; 520 + u16 __iomem *TxPktP; 521 + struct PKT __iomem *Pkt; 522 522 523 523 PortP = p->RIOPortp[PortN]; 524 524 ··· 555 555 ** card. This needs to be translated into a 32 bit pointer 556 556 ** so it can be accessed from the driver. 557 557 */ 558 - Pkt = (struct PKT *) RIO_PTR(HostP->Caddr, readw(TxPktP)); 558 + Pkt = (struct PKT __iomem *) RIO_PTR(HostP->Caddr, readw(TxPktP)); 559 559 560 560 /* 561 561 ** If the packet is used, reset it. 562 562 */ 563 - Pkt = (struct PKT *) ((unsigned long) Pkt & ~PKT_IN_USE); 563 + Pkt = (struct PKT __iomem *) ((unsigned long) Pkt & ~PKT_IN_USE); 564 564 writeb(dest_unit, &Pkt->dest_unit); 565 565 writeb(dest_port, &Pkt->dest_port); 566 566 }
+10 -10
drivers/char/rio/riotable.c
··· 534 534 if (PortP->SecondBlock) { 535 535 u16 dest_unit = HostMapP->ID; 536 536 u16 dest_port = port - SysPort; 537 - u16 *TxPktP; 538 - struct PKT *Pkt; 537 + u16 __iomem *TxPktP; 538 + struct PKT __iomem *Pkt; 539 539 540 540 for (TxPktP = PortP->TxStart; TxPktP <= PortP->TxEnd; TxPktP++) { 541 541 /* ··· 545 545 ** a 32 bit pointer so it can be 546 546 ** accessed from the driver. 547 547 */ 548 - Pkt = (struct PKT *) RIO_PTR(HostP->Caddr, readw(&*TxPktP)); 548 + Pkt = (struct PKT __iomem *) RIO_PTR(HostP->Caddr, readw(&*TxPktP)); 549 549 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); 550 550 writew(dest_unit, &Pkt->dest_unit); 551 551 writew(dest_port, &Pkt->dest_port); ··· 781 781 ** unless the host has been booted 782 782 */ 783 783 if ((HostP->Flags & RUN_STATE) == RC_RUNNING) { 784 - struct PHB *PhbP = PortP->PhbP = &HostP->PhbP[HostPort]; 785 - PortP->TxAdd = (u16 *) RIO_PTR(HostP->Caddr, readw(&PhbP->tx_add)); 786 - PortP->TxStart = (u16 *) RIO_PTR(HostP->Caddr, readw(&PhbP->tx_start)); 787 - PortP->TxEnd = (u16 *) RIO_PTR(HostP->Caddr, readw(&PhbP->tx_end)); 788 - PortP->RxRemove = (u16 *) RIO_PTR(HostP->Caddr, readw(&PhbP->rx_remove)); 789 - PortP->RxStart = (u16 *) RIO_PTR(HostP->Caddr, readw(&PhbP->rx_start)); 790 - PortP->RxEnd = (u16 *) RIO_PTR(HostP->Caddr, readw(&PhbP->rx_end)); 784 + struct PHB __iomem *PhbP = PortP->PhbP = &HostP->PhbP[HostPort]; 785 + PortP->TxAdd = (u16 __iomem *) RIO_PTR(HostP->Caddr, readw(&PhbP->tx_add)); 786 + PortP->TxStart = (u16 __iomem *) RIO_PTR(HostP->Caddr, readw(&PhbP->tx_start)); 787 + PortP->TxEnd = (u16 __iomem *) RIO_PTR(HostP->Caddr, readw(&PhbP->tx_end)); 788 + PortP->RxRemove = (u16 __iomem *) RIO_PTR(HostP->Caddr, readw(&PhbP->rx_remove)); 789 + PortP->RxStart = (u16 __iomem *) RIO_PTR(HostP->Caddr, readw(&PhbP->rx_start)); 790 + PortP->RxEnd = (u16 __iomem *) RIO_PTR(HostP->Caddr, readw(&PhbP->rx_end)); 791 791 } else 792 792 PortP->PhbP = NULL; 793 793
+1 -1
drivers/char/rio/riotty.c
··· 576 576 */ 577 577 int RIOShortCommand(struct rio_info *p, struct Port *PortP, int command, int len, int arg) 578 578 { 579 - struct PKT *PacketP; 579 + struct PKT __iomem *PacketP; 580 580 int retries = 20; /* at 10 per second -> 2 seconds */ 581 581 unsigned long flags; 582 582
+1 -1
drivers/char/rio/unixrup.h
··· 44 44 struct UnixRup { 45 45 struct CmdBlk *CmdsWaitingP; /* Commands waiting to be done */ 46 46 struct CmdBlk *CmdPendingP; /* The command currently being sent */ 47 - struct RUP *RupP; /* the Rup to send it to */ 47 + struct RUP __iomem *RupP; /* the Rup to send it to */ 48 48 unsigned int Id; /* Id number */ 49 49 unsigned int BaseSysPort; /* SysPort of first tty on this RTA */ 50 50 unsigned int ModTypes; /* Modules on this RTA */