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]>
drivers/char/rio/cmdpkt.h +24 -24
@@ -118,45 +118,45 @@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 ;
drivers/char/rio/daemon.h +31 -36
128 lines not on this page · raw message
drivers/char/rio/host.h +27 -29
84 lines not on this page · raw message
drivers/char/rio/link.h +2 -2
@@ -68,8 +68,8 @@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 */
drivers/char/rio/linux_compat.h +1 -40
63 lines not on this page · raw message
drivers/char/rio/port.h +1 -1
@@ -40,7 +40,7 @@struct gs_port gs;int PortNum;/* RIO port no., 0-511 */ struct Host *HostP; -volatile caddr_t Caddr; +caddr_t Caddr;unsigned short HostPort;/* Port number on host card */ unsigned char RupNum;/* Number of RUP for port */ unsigned char ID2 ;/* Second ID of RTA for port */
drivers/char/rio/riodrvr.h +23 -25
81 lines not on this page · raw message
drivers/char/rio/rup.h +2 -2
@@ -53,8 +53,8 @@#define RUP_NO_OWNER 0xff/* RUP not owned by any process */ struct RUP { -PKT_ptr txpkt;/* Outgoing packet */ -PKT_ptr rxpkt;/* Incoming packet */ +u16 txpkt;/* Outgoing packet */ +u16 rxpkt;/* Incoming packet */ u16 link;/* Which link to send down? */ u8 rup_dest_unit[2 ];/* Destination unit */ u16 handshake;/* For handshaking */
drivers/char/rio/top.h +2 -2
@@ -41,8 +41,8 @@** Topology information */ struct Top { -uchar Unit; -uchar Link; +u8 Unit; +u8 Link; };#endif /* __rio_top_h__ */
drivers/char/rio/typdef.h +5 -6
@@ -39,10 +39,10 @@** These types are ONLY to be used for refering to data structures ** on the RIO Host card! */ -typedef volatile u8 BYTE ; -typedef volatile u16 WORD ; -typedef volatile u32 DWORD ; -typedef volatile u16 RIOP ; +typedef u8 BYTE ; +typedef u16 WORD ; +typedef u32 DWORD ; +typedef u16 RIOP ;/*
@@ -57,8 +57,7 @@typedef unsigned char uchar_t ;typedef unsigned char queue_t ;typedef unsigned char mblk_t ; -typedef unsigned int paddr_t ; -typedef unsigned char uchar ; +typedef unsigned long paddr_t ;#define TPNULL ((ushort)(0x8000))
drivers/char/rio/typdef.h line 44
Quoted 7 lines · Alan Cox
drivers/char/rio/typdef.h +3
-4-typedef volatile u8 BYTE ; -typedef volatile u16 WORD ; -typedef volatile u32 DWORD ; -typedef volatile u16 RIOP ; +typedef u8 BYTE ; +typedef u16 WORD ; +typedef u32 DWORD ;
while you're there... might as well kill those ;)
Quoted 6 lines · Arjan van de Ven
drivers/char/rio/typdef.h line 44
Quoted 3 lines
drivers/char/rio/typdef.h +3
-0+typedef u8 BYTE ; +typedef u16 WORD ; +typedef u32 DWORD ;while you're there... might as well kill those ;)
There is a lot more than that left on the todo list. You can only shovel so much manure in a day ;)