Skip to content

Commit 4153366

Browse files
Alan-CoxLinus Torvalds
authored and
Linus Torvalds
committed
[PATCH] rio driver rework continued #1
More header cleanups, strip out typedefs and remove cruft. There are a lot of magic macros that can go and also a great deal of abuse of volatile that is not needed any more as this patch set cleans up the misuse of pointer access to ISA and PCI space. It now builds cleanly on 64bit, although there is more work left to do Signed-off-by: Alan Cox <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]> --- yaml --- svn_rev: 23459 current_ref: refs/heads/rpi-3.12.y current_commit: 27c6e52 head_branch: refs/heads/rpi-3.12.y migrated_from: v3
1 parent 10a9534 commit 4153366

File tree

11 files changed

+119
-168
lines changed

11 files changed

+119
-168
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/rpi-3.12.y: b6c6b6021ec735bd105e130ac1ee1606575f74c3
2+
refs/heads/rpi-3.12.y: 27c6e526f34760a9c48a90112242b7165064fa85

trunk/drivers/char/rio/cmdpkt.h

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -118,45 +118,45 @@ struct PktCmd_M {
118118
union {
119119
struct {
120120
struct {
121-
uchar PcCommand;
121+
u8 PcCommand;
122122
union {
123-
uchar PcPhbNum;
124-
uchar PcLinkNum;
125-
uchar PcIDNum;
123+
u8 PcPhbNum;
124+
u8 PcLinkNum;
125+
u8 PcIDNum;
126126
} U0;
127127
} CmdHdr;
128128
struct {
129-
ushort NumPackets;
130-
ushort LoadBase;
131-
ushort CodeSize;
129+
u16 NumPackets;
130+
u16 LoadBase;
131+
u16 CodeSize;
132132
} PcBootSequence;
133133
} S1;
134134
struct {
135-
ushort PcSequence;
136-
uchar PcBootData[RTA_BOOT_DATA_SIZE];
135+
u16 PcSequence;
136+
u8 PcBootData[RTA_BOOT_DATA_SIZE];
137137
} S2;
138138
struct {
139-
ushort __crud__;
140-
uchar PcUniqNum[4]; /* this is really a uint. */
141-
uchar PcModuleTypes; /* what modules are fitted */
139+
u16 __crud__;
140+
u8 PcUniqNum[4]; /* this is really a uint. */
141+
u8 PcModuleTypes; /* what modules are fitted */
142142
} S3;
143143
struct {
144-
ushort __cmd_hdr__;
145-
uchar __undefined__;
146-
uchar PcModemStatus;
147-
uchar PcPortStatus;
148-
uchar PcSubCommand;
149-
ushort PcSubAddr;
150-
uchar PcSubData[64];
144+
u16 __cmd_hdr__;
145+
u8 __undefined__;
146+
u8 PcModemStatus;
147+
u8 PcPortStatus;
148+
u8 PcSubCommand;
149+
u16 PcSubAddr;
150+
u8 PcSubData[64];
151151
} S4;
152152
struct {
153-
ushort __cmd_hdr__;
154-
uchar PcCommandText[1];
155-
uchar __crud__[20];
156-
uchar PcIDNum2; /* Tacked on end */
153+
u16 __cmd_hdr__;
154+
u8 PcCommandText[1];
155+
u8 __crud__[20];
156+
u8 PcIDNum2; /* Tacked on end */
157157
} S5;
158158
struct {
159-
ushort __cmd_hdr__;
159+
u16 __cmd_hdr__;
160160
struct Top Topology[LINKS_PER_UNIT];
161161
} S6;
162162
} U1;

trunk/drivers/char/rio/daemon.h

Lines changed: 31 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ static char *_daemon_h_sccs_ = "@(#)daemon.h 1.3";
4545
*/
4646

4747
struct Error {
48-
uint Error;
49-
uint Entry;
50-
uint Other;
48+
unsigned int Error;
49+
unsigned int Entry;
50+
unsigned int Other;
5151
};
5252

5353
struct DownLoad {
5454
char *DataP;
55-
uint Count;
56-
uint ProductCode;
55+
unsigned int Count;
56+
unsigned int ProductCode;
5757
};
5858

5959
/*
@@ -68,69 +68,64 @@ struct DownLoad {
6868
#endif
6969

7070
struct PortSetup {
71-
uint From; /* Set/Clear XP & IXANY Control from this port.... */
72-
uint To; /* .... to this port */
73-
uint XpCps; /* at this speed */
71+
unsigned int From; /* Set/Clear XP & IXANY Control from this port.... */
72+
unsigned int To; /* .... to this port */
73+
unsigned int XpCps; /* at this speed */
7474
char XpOn[MAX_XP_CTRL_LEN]; /* this is the start string */
7575
char XpOff[MAX_XP_CTRL_LEN]; /* this is the stop string */
76-
uchar IxAny; /* enable/disable IXANY */
77-
uchar IxOn; /* enable/disable IXON */
78-
uchar Lock; /* lock port params */
79-
uchar Store; /* store params across closes */
80-
uchar Drain; /* close only when drained */
76+
u8 IxAny; /* enable/disable IXANY */
77+
u8 IxOn; /* enable/disable IXON */
78+
u8 Lock; /* lock port params */
79+
u8 Store; /* store params across closes */
80+
u8 Drain; /* close only when drained */
8181
};
8282

8383
struct LpbReq {
84-
uint Host;
85-
uint Link;
84+
unsigned int Host;
85+
unsigned int Link;
8686
struct LPB *LpbP;
8787
};
8888

8989
struct RupReq {
90-
uint HostNum;
91-
uint RupNum;
90+
unsigned int HostNum;
91+
unsigned int RupNum;
9292
struct RUP *RupP;
9393
};
9494

9595
struct PortReq {
96-
uint SysPort;
96+
unsigned int SysPort;
9797
struct Port *PortP;
9898
};
9999

100100
struct StreamInfo {
101-
uint SysPort;
102-
#if 0
103-
queue_t RQueue;
104-
queue_t WQueue;
105-
#else
101+
unsigned int SysPort;
106102
int RQueue;
107103
int WQueue;
108-
#endif
109104
};
110105

111106
struct HostReq {
112-
uint HostNum;
107+
unsigned int HostNum;
113108
struct Host *HostP;
114109
};
115110

116111
struct HostDpRam {
117-
uint HostNum;
112+
unsigned int HostNum;
118113
struct DpRam *DpRamP;
119114
};
120115

121116
struct DebugCtrl {
122-
uint SysPort;
123-
uint Debug;
124-
uint Wait;
117+
unsigned int SysPort;
118+
unsigned int Debug;
119+
unsigned int Wait;
125120
};
126121

127122
struct MapInfo {
128-
uint FirstPort; /* 8 ports, starting from this (tty) number */
129-
uint RtaUnique; /* reside on this RTA (unique number) */
123+
unsigned int FirstPort; /* 8 ports, starting from this (tty) number */
124+
unsigned int RtaUnique; /* reside on this RTA (unique number) */
130125
};
131126

132127
struct MapIn {
133-
uint NumEntries; /* How many port sets are we mapping? */
128+
unsigned int NumEntries; /* How many port sets are we mapping? */
134129
struct MapInfo *MapInfoP; /* Pointer to (user space) info */
135130
};
136131

@@ -147,13 +142,13 @@ struct SpecialRupCmd {
147142
};
148143

149144
struct IdentifyRta {
150-
ulong RtaUnique;
151-
uchar ID;
145+
unsigned long RtaUnique;
146+
u8 ID;
152147
};
153148

154149
struct KillNeighbour {
155-
ulong UniqueNum;
156-
uchar Link;
150+
unsigned long UniqueNum;
151+
u8 Link;
157152
};
158153

159154
struct rioVersion {

trunk/drivers/char/rio/host.h

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,20 @@ static char *_host_h_sccs_ = "@(#)host.h 1.2";
5050
** the host.
5151
*/
5252
struct Host {
53-
uchar Type; /* RIO_EISA, RIO_MCA, ... */
54-
uchar Ivec; /* POLLED or ivec number */
55-
uchar Mode; /* Control stuff */
56-
uchar Slot; /* Slot */
57-
volatile caddr_t Caddr; /* KV address of DPRAM */
58-
volatile struct DpRam *CardP; /* KV address of DPRAM, with overlay */
59-
paddr_t PaddrP; /* Phys. address of DPRAM */
53+
unsigned char Type; /* RIO_EISA, RIO_MCA, ... */
54+
unsigned char Ivec; /* POLLED or ivec number */
55+
unsigned char Mode; /* Control stuff */
56+
unsigned char Slot; /* Slot */
57+
caddr_t Caddr; /* KV address of DPRAM */
58+
struct DpRam *CardP; /* KV address of DPRAM, with overlay */
59+
paddr_t PaddrP; /* Phys. address of DPRAM */
6060
char Name[MAX_NAME_LEN]; /* The name of the host */
61-
uint UniqueNum; /* host unique number */
61+
unsigned int UniqueNum; /* host unique number */
6262
spinlock_t HostLock; /* Lock structure for MPX */
63-
/*struct pci_devinfo PciDevInfo; *//* PCI Bus/Device/Function stuff */
64-
/*struct lockb HostLock; *//* Lock structure for MPX */
65-
uint WorkToBeDone; /* set to true each interrupt */
66-
uint InIntr; /* Being serviced? */
67-
uint IntSrvDone; /* host's interrupt has been serviced */
68-
int (*Copy) (caddr_t, caddr_t, int); /* copy func */
63+
unsigned int WorkToBeDone; /* set to true each interrupt */
64+
unsigned int InIntr; /* Being serviced? */
65+
unsigned int IntSrvDone; /* host's interrupt has been serviced */
66+
void (*Copy) (void *, void *, int); /* copy func */
6967
struct timer_list timer;
7068
/*
7169
** I M P O R T A N T !
@@ -74,7 +72,7 @@ struct Host {
7472
** a RIO_HOST_FOAD command.
7573
*/
7674

77-
ulong Flags; /* Whats going down */
75+
unsigned long Flags; /* Whats going down */
7876
#define RC_WAITING 0
7977
#define RC_STARTUP 1
8078
#define RC_RUNNING 2
@@ -88,28 +86,28 @@ struct Host {
8886
** Boot mode applies to the way in which hosts in this system will
8987
** boot RTAs
9088
*/
91-
#define RC_BOOT_ALL 0x8 /* Boot all RTAs attached */
92-
#define RC_BOOT_OWN 0x10 /* Only boot RTAs bound to this system */
93-
#define RC_BOOT_NONE 0x20 /* Don't boot any RTAs (slave mode) */
89+
#define RC_BOOT_ALL 0x8 /* Boot all RTAs attached */
90+
#define RC_BOOT_OWN 0x10 /* Only boot RTAs bound to this system */
91+
#define RC_BOOT_NONE 0x20 /* Don't boot any RTAs (slave mode) */
9492

9593
struct Top Topology[LINKS_PER_UNIT]; /* one per link */
96-
struct Map Mapping[MAX_RUP]; /* Mappings for host */
97-
struct PHB *PhbP; /* Pointer to the PHB array */
98-
ushort *PhbNumP; /* Ptr to Number of PHB's */
99-
struct LPB *LinkStrP; /* Link Structure Array */
100-
struct RUP *RupP; /* Sixteen real rups here */
101-
struct PARM_MAP *ParmMapP; /* points to the parmmap */
102-
uint ExtraUnits[MAX_EXTRA_UNITS]; /* unknown things */
103-
uint NumExtraBooted; /* how many of the above */
94+
struct Map Mapping[MAX_RUP]; /* Mappings for host */
95+
struct PHB *PhbP; /* Pointer to the PHB array */
96+
unsigned short *PhbNumP; /* Ptr to Number of PHB's */
97+
struct LPB *LinkStrP; /* Link Structure Array */
98+
struct RUP *RupP; /* Sixteen real rups here */
99+
struct PARM_MAP *ParmMapP; /* points to the parmmap */
100+
unsigned int ExtraUnits[MAX_EXTRA_UNITS]; /* unknown things */
101+
unsigned int NumExtraBooted; /* how many of the above */
104102
/*
105103
** Twenty logical rups.
106104
** The first sixteen are the real Rup entries (above), the last four
107105
** are the link RUPs.
108106
*/
109107
struct UnixRup UnixRups[MAX_RUP + LINKS_PER_UNIT];
110-
int timeout_id; /* For calling 100 ms delays */
111-
int timeout_sem; /* For calling 100 ms delays */
112-
long locks; /* long req'd for set_bit --RR */
108+
int timeout_id; /* For calling 100 ms delays */
109+
int timeout_sem; /* For calling 100 ms delays */
110+
long locks; /* long req'd for set_bit --RR */
113111
char ____end_marker____;
114112
};
115113
#define Control CardP->DpControl

trunk/drivers/char/rio/link.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ struct LPB {
6868
u16 mon_ltt;
6969
u16 mon_lrt;
7070
u16 WaitNoBoot; /* Secs to hold off booting */
71-
PKT_ptr add_packet_list; /* Add packets to here */
72-
PKT_ptr remove_packet_list; /* Send packets from here */
71+
u16 add_packet_list; /* Add packets to here */
72+
u16 remove_packet_list; /* Send packets from here */
7373

7474
Channel_ptr lrt_fail_chan; /* Lrt's failure channel */
7575
Channel_ptr ltt_fail_chan; /* Ltt's failure channel */

trunk/drivers/char/rio/linux_compat.h

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -19,56 +19,16 @@
1919
#include <linux/interrupt.h>
2020

2121

22-
#define disable(oldspl) save_flags (oldspl)
23-
#define restore(oldspl) restore_flags (oldspl)
24-
25-
#define sysbrk(x) kmalloc ((x),in_interrupt()? GFP_ATOMIC : GFP_KERNEL)
26-
#define sysfree(p,size) kfree ((p))
27-
28-
#define WBYTE(p,v) writeb(v, &p)
29-
#define RBYTE(p) readb (&p)
30-
#define WWORD(p,v) writew(v, &p)
31-
#define RWORD(p) readw(&p)
32-
#define WINDW(p,v) writew(v, p)
33-
#define RINDW(p) readw(p)
34-
3522
#define DEBUG_ALL
3623

37-
#define cprintf printk
38-
39-
#ifdef __KERNEL__
40-
#define INKERNEL
41-
#endif
42-
4324
struct ttystatics {
4425
struct termios tm;
4526
};
4627

47-
#define bzero(d, n) memset((d), 0, (n))
4828
#define bcopy(src, dest, n) memcpy ((dest), (src), (n))
4929

5030
#define SEM_SIGIGNORE 0x1234
5131

52-
#ifdef DEBUG_SEM
53-
#define swait(a,b) printk ("waiting: " __FILE__ " line %d\n", __LINE__)
54-
#define ssignal(sem) printk ("signalling: " __FILE__ " line %d\n", __LINE__)
55-
56-
#define sreset(sem) printk ("sreset: " __FILE__ "\n")
57-
#define sem_init(sem,v) printk ("sreset: " __FILE__ "\n")
58-
#endif
59-
60-
61-
#define getpid() (current->pid)
62-
63-
#define QSIZE SERIAL_XMIT_SIZE
64-
65-
#define pseterr(errno) return (- errno)
66-
67-
#define V_CBAUD CBAUD
68-
69-
/* For one reason or another rioboot.c uses delay instead of RIODelay. */
70-
#define delay(x,y) RIODelay(NULL, y)
71-
7232
extern int rio_debug;
7333

7434
#define RIO_DEBUG_INIT 0x000001
@@ -91,6 +51,7 @@ extern int rio_debug;
9151
#define RIO_DEBUG_DELAY 0x020000
9252
#define RIO_DEBUG_MOD_COUNT 0x040000
9353

54+
9455
/* Copied over from riowinif.h . This is ugly. The winif file declares
9556
also much other stuff which is incompatible with the headers from
9657
the older driver. The older driver includes "brates.h" which shadows

trunk/drivers/char/rio/port.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ struct Port {
4040
struct gs_port gs;
4141
int PortNum; /* RIO port no., 0-511 */
4242
struct Host *HostP;
43-
volatile caddr_t Caddr;
43+
caddr_t Caddr;
4444
unsigned short HostPort; /* Port number on host card */
4545
unsigned char RupNum; /* Number of RUP for port */
4646
unsigned char ID2; /* Second ID of RTA for port */

0 commit comments

Comments
 (0)