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

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

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

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

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

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

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

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

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

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

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

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

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

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 */
};

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

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

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

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

	ulong Flags;		/* Whats going down */
	unsigned long Flags;			/* Whats going down */
#define RC_WAITING            0
#define RC_STARTUP            1
#define RC_RUNNING            2
@@ -95,12 +93,12 @@ struct Host {
	struct Top Topology[LINKS_PER_UNIT];	/* one per link */
	struct Map Mapping[MAX_RUP];		/* Mappings for host */
	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 RUP *RupP;			/* Sixteen real rups here */
	struct PARM_MAP *ParmMapP;		/* points to the parmmap */
	uint ExtraUnits[MAX_EXTRA_UNITS];	/* unknown things */
	uint NumExtraBooted;	/* how many of the above */
	unsigned int ExtraUnits[MAX_EXTRA_UNITS];	/* unknown things */
	unsigned int NumExtraBooted;		/* how many of the above */
	/*
	 ** Twenty logical rups.
	 ** The first sixteen are the real Rup entries (above), the last four
+2 −2
Original line number Diff line number Diff line
@@ -68,8 +68,8 @@ struct LPB {
	u16 mon_ltt;
	u16 mon_lrt;
	u16 WaitNoBoot;	/* Secs to hold off booting */
	PKT_ptr add_packet_list;	/* Add packets to here */
	PKT_ptr remove_packet_list;	/* Send packets from here */
	u16 add_packet_list;	/* Add packets to here */
	u16 remove_packet_list;	/* Send packets from here */

	Channel_ptr lrt_fail_chan;	/* Lrt's failure channel */
	Channel_ptr ltt_fail_chan;	/* Ltt's failure channel */
+1 −40
Original line number Diff line number Diff line
@@ -19,56 +19,16 @@
#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 cprintf printk

#ifdef __KERNEL__
#define INKERNEL
#endif

struct ttystatics {
	struct termios tm;
};

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

#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;

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


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