aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/rio/rioparam.c
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2006-03-24 06:18:32 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-24 10:33:29 -0500
commit554b7c801e379e8c0072533b4da89a3a003cbfac (patch)
tree86f2da1549e37648948fe3d091ecc76c18714597 /drivers/char/rio/rioparam.c
parent57c2d60e1e3db506cdcecbf60f939593125db7f8 (diff)
[PATCH] Yet more rio cleaning (2 of 2)
- Remove more unused headers - Remove various typedefs - Correct type of PaddrP (physical addresses should be ulong) - Kill use of bcopy - More printk cleanups - Kill true/false - Clean up direct access to pci BARs Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char/rio/rioparam.c')
-rw-r--r--drivers/char/rio/rioparam.c39
1 files changed, 16 insertions, 23 deletions
diff --git a/drivers/char/rio/rioparam.c b/drivers/char/rio/rioparam.c
index af25d2084f47..d2e8092cdb29 100644
--- a/drivers/char/rio/rioparam.c
+++ b/drivers/char/rio/rioparam.c
@@ -52,15 +52,12 @@ static char *_rioparam_c_sccs_ = "@(#)rioparam.c 1.3";
52 52
53#include "linux_compat.h" 53#include "linux_compat.h"
54#include "rio_linux.h" 54#include "rio_linux.h"
55#include "typdef.h"
56#include "pkt.h" 55#include "pkt.h"
57#include "daemon.h" 56#include "daemon.h"
58#include "rio.h" 57#include "rio.h"
59#include "riospace.h" 58#include "riospace.h"
60#include "top.h"
61#include "cmdpkt.h" 59#include "cmdpkt.h"
62#include "map.h" 60#include "map.h"
63#include "riotypes.h"
64#include "rup.h" 61#include "rup.h"
65#include "port.h" 62#include "port.h"
66#include "riodrvr.h" 63#include "riodrvr.h"
@@ -73,17 +70,13 @@ static char *_rioparam_c_sccs_ = "@(#)rioparam.c 1.3";
73#include "unixrup.h" 70#include "unixrup.h"
74#include "board.h" 71#include "board.h"
75#include "host.h" 72#include "host.h"
76#include "error.h"
77#include "phb.h" 73#include "phb.h"
78#include "link.h" 74#include "link.h"
79#include "cmdblk.h" 75#include "cmdblk.h"
80#include "route.h" 76#include "route.h"
81#include "control.h"
82#include "cirrus.h" 77#include "cirrus.h"
83#include "rioioctl.h" 78#include "rioioctl.h"
84#include "param.h" 79#include "param.h"
85#include "list.h"
86#include "sam.h"
87 80
88 81
89 82
@@ -162,7 +155,7 @@ int RIOParam(struct Port *PortP, int cmd, int Modem, int SleepFlag)
162 struct tty_struct *TtyP; 155 struct tty_struct *TtyP;
163 int retval; 156 int retval;
164 struct phb_param *phb_param_ptr; 157 struct phb_param *phb_param_ptr;
165 PKT *PacketP; 158 struct PKT *PacketP;
166 int res; 159 int res;
167 u8 Cor1 = 0, Cor2 = 0, Cor4 = 0, Cor5 = 0; 160 u8 Cor1 = 0, Cor2 = 0, Cor4 = 0, Cor5 = 0;
168 u8 TxXon = 0, TxXoff = 0, RxXon = 0, RxXoff = 0; 161 u8 TxXon = 0, TxXoff = 0, RxXon = 0, RxXoff = 0;
@@ -228,7 +221,7 @@ int RIOParam(struct Port *PortP, int cmd, int Modem, int SleepFlag)
228 if (PortP->State & RIO_DELETED) { 221 if (PortP->State & RIO_DELETED) {
229 rio_spin_unlock_irqrestore(&PortP->portSem, flags); 222 rio_spin_unlock_irqrestore(&PortP->portSem, flags);
230 func_exit(); 223 func_exit();
231 return RIO_SUCCESS; 224 return 0;
232 } 225 }
233 } 226 }
234 227
@@ -240,7 +233,7 @@ int RIOParam(struct Port *PortP, int cmd, int Modem, int SleepFlag)
240 } 233 }
241 234
242 rio_dprintk(RIO_DEBUG_PARAM, "can_add_transmit() returns %x\n", res); 235 rio_dprintk(RIO_DEBUG_PARAM, "can_add_transmit() returns %x\n", res);
243 rio_dprintk(RIO_DEBUG_PARAM, "Packet is 0x%p\n", PacketP); 236 rio_dprintk(RIO_DEBUG_PARAM, "Packet is %p\n", PacketP);
244 237
245 phb_param_ptr = (struct phb_param *) PacketP->data; 238 phb_param_ptr = (struct phb_param *) PacketP->data;
246 239
@@ -579,7 +572,7 @@ int RIOParam(struct Port *PortP, int cmd, int Modem, int SleepFlag)
579 */ 572 */
580 func_exit(); 573 func_exit();
581 574
582 return RIO_SUCCESS; 575 return 0;
583} 576}
584 577
585 578
@@ -587,11 +580,11 @@ int RIOParam(struct Port *PortP, int cmd, int Modem, int SleepFlag)
587** We can add another packet to a transmit queue if the packet pointer pointed 580** We can add another packet to a transmit queue if the packet pointer pointed
588** to by the TxAdd pointer has PKT_IN_USE clear in its address. 581** to by the TxAdd pointer has PKT_IN_USE clear in its address.
589*/ 582*/
590int can_add_transmit(PKT **PktP, struct Port *PortP) 583int can_add_transmit(struct PKT **PktP, struct Port *PortP)
591{ 584{
592 PKT *tp; 585 struct PKT *tp;
593 586
594 *PktP = tp = (PKT *) RIO_PTR(PortP->Caddr, readw(PortP->TxAdd)); 587 *PktP = tp = (struct PKT *) RIO_PTR(PortP->Caddr, readw(PortP->TxAdd));
595 588
596 return !((unsigned long) tp & PKT_IN_USE); 589 return !((unsigned long) tp & PKT_IN_USE);
597} 590}
@@ -615,10 +608,10 @@ void add_transmit(struct Port *PortP)
615 * Put a packet onto the end of the 608 * Put a packet onto the end of the
616 * free list 609 * free list
617 ****************************************/ 610 ****************************************/
618void put_free_end(struct Host *HostP, PKT *PktP) 611void put_free_end(struct Host *HostP, struct PKT *PktP)
619{ 612{
620 FREE_LIST *tmp_pointer; 613 struct rio_free_list *tmp_pointer;
621 ushort old_end, new_end; 614 unsigned short old_end, new_end;
622 unsigned long flags; 615 unsigned long flags;
623 616
624 rio_spin_lock_irqsave(&HostP->HostLock, flags); 617 rio_spin_lock_irqsave(&HostP->HostLock, flags);
@@ -632,15 +625,15 @@ void put_free_end(struct Host *HostP, PKT *PktP)
632 625
633 if ((old_end = readw(&HostP->ParmMapP->free_list_end)) != TPNULL) { 626 if ((old_end = readw(&HostP->ParmMapP->free_list_end)) != TPNULL) {
634 new_end = RIO_OFF(HostP->Caddr, PktP); 627 new_end = RIO_OFF(HostP->Caddr, PktP);
635 tmp_pointer = (FREE_LIST *) RIO_PTR(HostP->Caddr, old_end); 628 tmp_pointer = (struct rio_free_list *) RIO_PTR(HostP->Caddr, old_end);
636 writew(new_end, &tmp_pointer->next); 629 writew(new_end, &tmp_pointer->next);
637 writew(old_end, &((FREE_LIST *) PktP)->prev); 630 writew(old_end, &((struct rio_free_list *) PktP)->prev);
638 writew(TPNULL, &((FREE_LIST *) PktP)->next); 631 writew(TPNULL, &((struct rio_free_list *) PktP)->next);
639 writew(new_end, &HostP->ParmMapP->free_list_end); 632 writew(new_end, &HostP->ParmMapP->free_list_end);
640 } else { /* First packet on the free list this should never happen! */ 633 } else { /* First packet on the free list this should never happen! */
641 rio_dprintk(RIO_DEBUG_PFE, "put_free_end(): This should never happen\n"); 634 rio_dprintk(RIO_DEBUG_PFE, "put_free_end(): This should never happen\n");
642 writew(RIO_OFF(HostP->Caddr, PktP), &HostP->ParmMapP->free_list_end); 635 writew(RIO_OFF(HostP->Caddr, PktP), &HostP->ParmMapP->free_list_end);
643 tmp_pointer = (FREE_LIST *) PktP; 636 tmp_pointer = (struct rio_free_list *) PktP;
644 writew(TPNULL, &tmp_pointer->prev); 637 writew(TPNULL, &tmp_pointer->prev);
645 writew(TPNULL, &tmp_pointer->next); 638 writew(TPNULL, &tmp_pointer->next);
646 } 639 }
@@ -654,10 +647,10 @@ void put_free_end(struct Host *HostP, PKT *PktP)
654** relevant packet, [having cleared the PKT_IN_USE bit]. If PKT_IN_USE is clear, 647** relevant packet, [having cleared the PKT_IN_USE bit]. If PKT_IN_USE is clear,
655** then can_remove_receive() returns 0. 648** then can_remove_receive() returns 0.
656*/ 649*/
657int can_remove_receive(PKT **PktP, struct Port *PortP) 650int can_remove_receive(struct PKT **PktP, struct Port *PortP)
658{ 651{
659 if (readw(PortP->RxRemove) & PKT_IN_USE) { 652 if (readw(PortP->RxRemove) & PKT_IN_USE) {
660 *PktP = (PKT *) RIO_PTR(PortP->Caddr, readw(PortP->RxRemove) & ~PKT_IN_USE); 653 *PktP = (struct PKT *) RIO_PTR(PortP->Caddr, readw(PortP->RxRemove) & ~PKT_IN_USE);
661 return 1; 654 return 1;
662 } 655 }
663 return 0; 656 return 0;