Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 27c6e526 authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds
Browse files

[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: default avatarAlan Cox <alan@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent b6c6b602
Loading
Loading
Loading
Loading
+24 −24
Original line number Original line Diff line number Diff line
@@ -118,45 +118,45 @@ struct PktCmd_M {
	union {
	union {
		struct {
		struct {
			struct {
			struct {
				uchar PcCommand;
				u8 PcCommand;
				union {
				union {
					uchar PcPhbNum;
					u8 PcPhbNum;
					uchar PcLinkNum;
					u8 PcLinkNum;
					uchar PcIDNum;
					u8 PcIDNum;
				} U0;
				} U0;
			} CmdHdr;
			} CmdHdr;
			struct {
			struct {
				ushort NumPackets;
				u16 NumPackets;
				ushort LoadBase;
				u16 LoadBase;
				ushort CodeSize;
				u16 CodeSize;
			} PcBootSequence;
			} PcBootSequence;
		} S1;
		} S1;
		struct {
		struct {
			ushort PcSequence;
			u16 PcSequence;
			uchar PcBootData[RTA_BOOT_DATA_SIZE];
			u8 PcBootData[RTA_BOOT_DATA_SIZE];
		} S2;
		} S2;
		struct {
		struct {
			ushort __crud__;
			u16 __crud__;
			uchar PcUniqNum[4];	/* this is really a uint. */
			u8 PcUniqNum[4];	/* this is really a uint. */
			uchar PcModuleTypes;	/* what modules are fitted */
			u8 PcModuleTypes;	/* what modules are fitted */
		} S3;
		} S3;
		struct {
		struct {
			ushort __cmd_hdr__;
			u16 __cmd_hdr__;
			uchar __undefined__;
			u8 __undefined__;
			uchar PcModemStatus;
			u8 PcModemStatus;
			uchar PcPortStatus;
			u8 PcPortStatus;
			uchar PcSubCommand;
			u8 PcSubCommand;
			ushort PcSubAddr;
			u16 PcSubAddr;
			uchar PcSubData[64];
			u8 PcSubData[64];
		} S4;
		} S4;
		struct {
		struct {
			ushort __cmd_hdr__;
			u16 __cmd_hdr__;
			uchar PcCommandText[1];
			u8 PcCommandText[1];
			uchar __crud__[20];
			u8 __crud__[20];
			uchar PcIDNum2;	/* Tacked on end */
			u8 PcIDNum2;	/* Tacked on end */
		} S5;
		} S5;
		struct {
		struct {
			ushort __cmd_hdr__;
			u16 __cmd_hdr__;
			struct Top Topology[LINKS_PER_UNIT];
			struct Top Topology[LINKS_PER_UNIT];
		} S6;
		} S6;
	} U1;
	} U1;
+31 −36
Original line number Original line Diff line number Diff line
@@ -45,15 +45,15 @@ static char *_daemon_h_sccs_ = "@(#)daemon.h 1.3";
*/
*/


struct Error {
struct Error {
	uint Error;
	unsigned int Error;
	uint Entry;
	unsigned int Entry;
	uint Other;
	unsigned int Other;
};
};


struct DownLoad {
struct DownLoad {
	char *DataP;
	char *DataP;
	uint Count;
	unsigned int Count;
	uint ProductCode;
	unsigned int ProductCode;
};
};


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


struct PortSetup {
struct PortSetup {
	uint From;		/* Set/Clear XP & IXANY Control from this port.... */
	unsigned int From;		/* Set/Clear XP & IXANY Control from this port.... */
	uint To;		/* .... to this port */
	unsigned int To;		/* .... to this port */
	uint XpCps;		/* at this speed */
	unsigned int XpCps;		/* at this speed */
	char XpOn[MAX_XP_CTRL_LEN];	/* this is the start string */
	char XpOn[MAX_XP_CTRL_LEN];	/* this is the start string */
	char XpOff[MAX_XP_CTRL_LEN];	/* this is the stop string */
	char XpOff[MAX_XP_CTRL_LEN];	/* this is the stop string */
	uchar IxAny;		/* enable/disable IXANY */
	u8 IxAny;			/* enable/disable IXANY */
	uchar IxOn;		/* enable/disable IXON */
	u8 IxOn;			/* enable/disable IXON */
	uchar Lock;		/* lock port params */
	u8 Lock;			/* lock port params */
	uchar Store;		/* store params across closes */
	u8 Store;			/* store params across closes */
	uchar Drain;		/* close only when drained */
	u8 Drain;			/* close only when drained */
};
};


struct LpbReq {
struct LpbReq {
	uint Host;
	unsigned int Host;
	uint Link;
	unsigned int Link;
	struct LPB *LpbP;
	struct LPB *LpbP;
};
};


struct RupReq {
struct RupReq {
	uint HostNum;
	unsigned int HostNum;
	uint RupNum;
	unsigned int RupNum;
	struct RUP *RupP;
	struct RUP *RupP;
};
};


struct PortReq {
struct PortReq {
	uint SysPort;
	unsigned int SysPort;
	struct Port *PortP;
	struct Port *PortP;
};
};


struct StreamInfo {
struct StreamInfo {
	uint SysPort;
	unsigned int SysPort;
#if 0
	queue_t RQueue;
	queue_t WQueue;
#else
	int RQueue;
	int RQueue;
	int WQueue;
	int WQueue;
#endif
};
};


struct HostReq {
struct HostReq {
	uint HostNum;
	unsigned int HostNum;
	struct Host *HostP;
	struct Host *HostP;
};
};


struct HostDpRam {
struct HostDpRam {
	uint HostNum;
	unsigned int HostNum;
	struct DpRam *DpRamP;
	struct DpRam *DpRamP;
};
};


struct DebugCtrl {
struct DebugCtrl {
	uint SysPort;
	unsigned int SysPort;
	uint Debug;
	unsigned int Debug;
	uint Wait;
	unsigned int Wait;
};
};


struct MapInfo {
struct MapInfo {
	uint FirstPort;		/* 8 ports, starting from this (tty) number */
	unsigned int FirstPort;		/* 8 ports, starting from this (tty) number */
	uint RtaUnique;		/* reside on this RTA (unique number) */
	unsigned int RtaUnique;		/* reside on this RTA (unique number) */
};
};


struct MapIn {
struct MapIn {
	uint NumEntries;	/* How many port sets are we mapping? */
	unsigned int NumEntries;	/* How many port sets are we mapping? */
	struct MapInfo *MapInfoP;	/* Pointer to (user space) info */
	struct MapInfo *MapInfoP;	/* Pointer to (user space) info */
};
};


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


struct IdentifyRta {
struct IdentifyRta {
	ulong RtaUnique;
	unsigned long RtaUnique;
	uchar ID;
	u8 ID;
};
};


struct KillNeighbour {
struct KillNeighbour {
	ulong UniqueNum;
	unsigned long UniqueNum;
	uchar Link;
	u8 Link;
};
};


struct rioVersion {
struct rioVersion {
+27 −29
Original line number Original line Diff line number Diff line
@@ -50,22 +50,20 @@ static char *_host_h_sccs_ = "@(#)host.h 1.2";
**    the host.
**    the host.
*/
*/
struct Host {
struct Host {
	uchar Type;		/* RIO_EISA, RIO_MCA, ... */
	unsigned char Type;		/* RIO_EISA, RIO_MCA, ... */
	uchar Ivec;		/* POLLED or ivec number */
	unsigned char Ivec;		/* POLLED or ivec number */
	uchar Mode;		/* Control stuff */
	unsigned char Mode;		/* Control stuff */
	uchar Slot;		/* Slot */
	unsigned char Slot;		/* Slot */
	volatile caddr_t Caddr;	/* KV address of DPRAM */
	caddr_t Caddr;			/* KV address of DPRAM */
	volatile struct DpRam *CardP;	/* KV address of DPRAM, with overlay */
	struct DpRam *CardP;		/* KV address of DPRAM, with overlay */
	paddr_t PaddrP;			/* Phys. address of DPRAM */
	paddr_t 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 */
	uint UniqueNum;		/* host unique number */
	unsigned int UniqueNum;		/* host unique number */
	spinlock_t HostLock;	/* Lock structure for MPX */
	spinlock_t HostLock;	/* Lock structure for MPX */
	/*struct pci_devinfo    PciDevInfo; *//* PCI Bus/Device/Function stuff */
	unsigned int WorkToBeDone;	/* set to true each interrupt */
	/*struct lockb          HostLock;  *//* Lock structure for MPX */
	unsigned int InIntr;		/* Being serviced? */
	uint WorkToBeDone;	/* set to true each interrupt */
	unsigned int IntSrvDone;	/* host's interrupt has been serviced */
	uint InIntr;		/* Being serviced? */
	void (*Copy) (void *, void *, int);	/* copy func */
	uint IntSrvDone;	/* host's interrupt has been serviced */
	int (*Copy) (caddr_t, caddr_t, 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 !
@@ -74,7 +72,7 @@ struct Host {
	 ** a RIO_HOST_FOAD command.
	 ** a RIO_HOST_FOAD command.
	 */
	 */


	ulong Flags;		/* Whats going down */
	unsigned long Flags;			/* Whats going down */
#define RC_WAITING            0
#define RC_WAITING            0
#define RC_STARTUP            1
#define RC_STARTUP            1
#define RC_RUNNING            2
#define RC_RUNNING            2
@@ -95,12 +93,12 @@ 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 *PhbP;			/* Pointer to the PHB array */
	ushort *PhbNumP;	/* Ptr to Number of PHB's */
	unsigned short *PhbNumP;		/* Ptr to Number of PHB's */
	struct LPB *LinkStrP;			/* Link Structure Array */
	struct LPB *LinkStrP;			/* Link Structure Array */
	struct RUP *RupP;			/* Sixteen real rups here */
	struct RUP *RupP;			/* Sixteen real rups here */
	struct PARM_MAP *ParmMapP;		/* points to the parmmap */
	struct PARM_MAP *ParmMapP;		/* points to the parmmap */
	uint ExtraUnits[MAX_EXTRA_UNITS];	/* unknown things */
	unsigned int ExtraUnits[MAX_EXTRA_UNITS];	/* unknown things */
	uint NumExtraBooted;	/* how many of the above */
	unsigned int NumExtraBooted;		/* how many of the above */
	/*
	/*
	 ** Twenty logical rups.
	 ** Twenty logical rups.
	 ** The first sixteen are the real Rup entries (above), the last four
	 ** The first sixteen are the real Rup entries (above), the last four
+2 −2
Original line number Original line Diff line number Diff line
@@ -68,8 +68,8 @@ struct LPB {
	u16 mon_ltt;
	u16 mon_ltt;
	u16 mon_lrt;
	u16 mon_lrt;
	u16 WaitNoBoot;	/* Secs to hold off booting */
	u16 WaitNoBoot;	/* Secs to hold off booting */
	PKT_ptr add_packet_list;	/* Add packets to here */
	u16 add_packet_list;	/* Add packets to here */
	PKT_ptr remove_packet_list;	/* Send packets from here */
	u16 remove_packet_list;	/* Send packets from here */


	Channel_ptr lrt_fail_chan;	/* Lrt's failure channel */
	Channel_ptr lrt_fail_chan;	/* Lrt's failure channel */
	Channel_ptr ltt_fail_chan;	/* Ltt's failure channel */
	Channel_ptr ltt_fail_chan;	/* Ltt's failure channel */
+1 −40
Original line number Original line Diff line number Diff line
@@ -19,56 +19,16 @@
#include <linux/interrupt.h>
#include <linux/interrupt.h>




#define disable(oldspl) save_flags (oldspl)
#define restore(oldspl) restore_flags (oldspl)

#define sysbrk(x) kmalloc ((x),in_interrupt()? GFP_ATOMIC : GFP_KERNEL)
#define sysfree(p,size) kfree ((p))

#define WBYTE(p,v) writeb(v, &p)
#define RBYTE(p)   readb (&p)
#define WWORD(p,v) writew(v, &p)
#define RWORD(p)   readw(&p)
#define WINDW(p,v) writew(v, p)
#define RINDW(p)   readw(p)

#define DEBUG_ALL
#define DEBUG_ALL


#define cprintf printk

#ifdef __KERNEL__
#define INKERNEL
#endif

struct ttystatics {
struct ttystatics {
	struct termios tm;
	struct termios tm;
};
};


#define bzero(d, n)         memset((d), 0, (n))
#define bcopy(src, dest, n) memcpy ((dest), (src), (n))
#define bcopy(src, dest, n) memcpy ((dest), (src), (n))


#define SEM_SIGIGNORE 0x1234
#define SEM_SIGIGNORE 0x1234


#ifdef DEBUG_SEM
#define swait(a,b)      printk ("waiting:    " __FILE__ " line %d\n", __LINE__)
#define ssignal(sem)    printk ("signalling: " __FILE__ " line %d\n", __LINE__)

#define sreset(sem)     printk ("sreset:     " __FILE__ "\n")
#define sem_init(sem,v) printk ("sreset:     " __FILE__ "\n")
#endif


#define getpid()    (current->pid)

#define QSIZE SERIAL_XMIT_SIZE

#define pseterr(errno) return (- errno)

#define V_CBAUD CBAUD

/* For one reason or another rioboot.c uses delay instead of RIODelay. */
#define delay(x,y) RIODelay(NULL, y)

extern int rio_debug;
extern int rio_debug;


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



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