Skip to contentSkip to conversation

PATCH: rio, more header cleanup

PATCH Alan Cox 1 participant 1 message Feb 14, 2006 Char and misc drivers

lore
Share & tools
lore

Alan Cox

author
#0 lore raw

Strip some of the typedef mess out
Remove a small subset of unused defines and the like

drivers/char/rio/board.h +27 -31
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc3/drivers/char/rio/board.h linux-2.6.16-rc3/drivers/char/rio/board.h
@@ -33,10 +33,6 @@
 #ifndef	__rio_board_h__
 #define	__rio_board_h__
 
-#ifdef SCCS_LABELS
-static char *_board_h_sccs_ = "@(#)board.h	1.2";
-#endif
-
 /*
 ** board.h contains the definitions for the *hardware* of the host cards.
 ** It describes the memory overlay for the dual port RAM area.
@@ -53,29 +49,29 @@
 **	The shape of the Host Control area, at offset 0x7C00, Write Only
 */
 struct s_Ctrl {
-	BYTE DpCtl;		/* 7C00 */
-	BYTE Dp_Unused2_[127];
-	BYTE DpIntSet;		/* 7C80 */
-	BYTE Dp_Unused3_[127];
-	BYTE DpTpuReset;	/* 7D00 */
-	BYTE Dp_Unused4_[127];
-	BYTE DpIntReset;	/* 7D80 */
-	BYTE Dp_Unused5_[127];
+	u8 DpCtl;		/* 7C00 */
+	u8 Dp_Unused2_[127];
+	u8 DpIntSet;		/* 7C80 */
+	u8 Dp_Unused3_[127];
+	u8 DpTpuReset;	/* 7D00 */
+	u8 Dp_Unused4_[127];
+	u8 DpIntReset;	/* 7D80 */
+	u8 Dp_Unused5_[127];
 };
 
 /*
 ** The PROM data area on the host (0x7C00), Read Only
 */
 struct s_Prom {
-	WORD DpSlxCode[2];
-	WORD DpRev;
-	WORD Dp_Unused6_;
-	WORD DpUniq[4];
-	WORD DpJahre;
-	WORD DpWoche;
-	WORD DpHwFeature[5];
-	WORD DpOemId;
-	WORD DpSiggy[16];
+	u16 DpSlxCode[2];
+	u16 DpRev;
+	u16 Dp_Unused6_;
+	u16 DpUniq[4];
+	u16 DpJahre;
+	u16 DpWoche;
+	u16 DpHwFeature[5];
+	u16 DpOemId;
+	u16 DpSiggy[16];
 };
 
 /*
@@ -90,19 +86,19 @@
 ** The top end of memory!
 */
 struct s_ParmMapS {		/* Area containing Parm Map Pointer */
-	BYTE Dp_Unused8_[DP_PARMMAP_ADDR];
-	WORD DpParmMapAd;
+	u8 Dp_Unused8_[DP_PARMMAP_ADDR];
+	u16 DpParmMapAd;
 };
 
 struct s_StartUpS {
-	BYTE Dp_Unused9_[DP_STARTUP_ADDR];
-	BYTE Dp_LongJump[0x4];
-	BYTE Dp_Unused10_[2];
-	BYTE Dp_ShortJump[0x2];
+	u8 Dp_Unused9_[DP_STARTUP_ADDR];
+	u8 Dp_LongJump[0x4];
+	u8 Dp_Unused10_[2];
+	u8 Dp_ShortJump[0x2];
 };
 
 union u_Sram2ParmMap {		/* This is the top of memory (0x7E00-0x7FFF) */
-	BYTE DpSramMem[DP_SRAM2_SIZE];
+	u8 DpSramMem[DP_SRAM2_SIZE];
 	struct s_ParmMapS DpParmMapS;
 	struct s_StartUpS DpStartUpS;
 };
@@ -111,11 +107,11 @@
 **	This is the DP RAM overlay.
 */
 struct DpRam {
-	BYTE DpSram1[DP_SRAM1_SIZE];	/* 0000 - 7BFF */
+	u8 DpSram1[DP_SRAM1_SIZE];	/* 0000 - 7BFF */
 	union u_CtrlProm DpCtrlProm;	/* 7C00 - 7DFF */
 	union u_Sram2ParmMap DpSram2ParmMap;	/* 7E00 - 7FFF */
-	BYTE DpScratch[DP_SCRATCH_SIZE];	/* 8000 - 8FFF */
-	BYTE DpSram3[DP_SRAM3_SIZE];	/* 9000 - FFFF */
+	u8 DpScratch[DP_SCRATCH_SIZE];	/* 8000 - 8FFF */
+	u8 DpSram3[DP_SRAM3_SIZE];	/* 9000 - FFFF */
 };
 
 #define	DpControl	DpCtrlProm.DpCtrl.DpCtl
drivers/char/rio/cmdpkt.h +23 -23

75 lines not on this page · raw message

drivers/char/rio/link.h +24 -82

135 lines not on this page · raw message

drivers/char/rio/parmmap.h +27 -27

66 lines not on this page · raw message

drivers/char/rio/pkt.h +8 -16
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc3/drivers/char/rio/pkt.h linux-2.6.16-rc3/drivers/char/rio/pkt.h
@@ -37,14 +37,6 @@
 #ifndef _pkt_h
 #define _pkt_h 1
 
-
-#ifdef SCCS_LABELS
-#ifndef lint
-/* static char *_rio_pkt_h_sccs = "@(#)pkt.h	1.8"; */
-#endif
-#endif
-
-#define MAX_TTL         0xf
 #define PKT_CMD_BIT     ((ushort) 0x080)
 #define PKT_CMD_DATA    ((ushort) 0x080)
 
@@ -70,15 +62,15 @@
 #define CONTROL_DATA_WNDW  (DATA_WNDW << 8)
 
 struct PKT {
-	BYTE dest_unit;		/* Destination Unit Id */
-	BYTE dest_port;		/* Destination POrt */
-	BYTE src_unit;		/* Source Unit Id */
-	BYTE src_port;		/* Source POrt */
-	BYTE len;
-	BYTE control;
-	BYTE data[PKT_MAX_DATA_LEN];
+	u8 dest_unit;		/* Destination Unit Id */
+	u8 dest_port;		/* Destination POrt */
+	u8 src_unit;		/* Source Unit Id */
+	u8 src_port;		/* Source POrt */
+	u8 len;
+	u8 control;
+	u8 data[PKT_MAX_DATA_LEN];
 	/* Actual data :-) */
-	WORD csum;		/* C-SUM */
+	u16 csum;		/* C-SUM */
 };
 #endif
 
drivers/char/rio/port.h +93 -155

298 lines not on this page · raw message

drivers/char/rio/phb.h +15 -22
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc3/drivers/char/rio/phb.h linux-2.6.16-rc3/drivers/char/rio/phb.h
@@ -37,13 +37,6 @@
 #ifndef _phb_h
 #define _phb_h 1
 
-#ifdef SCCS_LABELS
-#ifndef lint
-/* static char *_rio_phb_h_sccs = "@(#)phb.h	1.12"; */
-#endif
-#endif
-
-
 /*************************************************
  * Handshake asserted. Deasserted by the LTT(s)
  ************************************************/
@@ -126,21 +119,21 @@
  *************************************************************************/
 typedef struct PHB PHB;
 struct PHB {
-	WORD source;
-	WORD handshake;
-	WORD status;
-	NUMBER timeout;		/* Maximum of 1.9 seconds */
-	WORD link;		/* Send down this link */
-	WORD destination;
-	PKT_ptr_ptr tx_start;
-	PKT_ptr_ptr tx_end;
-	PKT_ptr_ptr tx_add;
-	PKT_ptr_ptr tx_remove;
-
-	PKT_ptr_ptr rx_start;
-	PKT_ptr_ptr rx_end;
-	PKT_ptr_ptr rx_add;
-	PKT_ptr_ptr rx_remove;
+	u8 source;
+	u8 handshake;
+	u8 status;
+	u16 timeout;		/* Maximum of 1.9 seconds */
+	u8 link;		/* Send down this link */
+	u8 destination;
+	u16 tx_start;
+	u16 tx_end;
+	u16 tx_add;
+	u16 tx_remove;
+
+	u16 rx_start;
+	u16 rx_end;
+	u16 rx_add;
+	u16 rx_remove;
 
 };
 
drivers/char/rio/riotypes.h +15 -19
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc3/drivers/char/rio/riotypes.h linux-2.6.16-rc3/drivers/char/rio/riotypes.h
@@ -43,25 +43,21 @@
 #endif
 #endif
 
-typedef unsigned short NUMBER_ptr;
-typedef unsigned short WORD_ptr;
-typedef unsigned short BYTE_ptr;
-typedef unsigned short char_ptr;
-typedef unsigned short Channel_ptr;
-typedef unsigned short FREE_LIST_ptr_ptr;
-typedef unsigned short FREE_LIST_ptr;
-typedef unsigned short LPB_ptr;
-typedef unsigned short Process_ptr;
-typedef unsigned short PHB_ptr;
-typedef unsigned short PKT_ptr;
-typedef unsigned short PKT_ptr_ptr;
-typedef unsigned short Q_BUF_ptr;
-typedef unsigned short Q_BUF_ptr_ptr;
-typedef unsigned short ROUTE_STR_ptr;
-typedef unsigned short RUP_ptr;
-typedef unsigned short short_ptr;
-typedef unsigned short u_short_ptr;
-typedef unsigned short ushort_ptr;
+typedef u16 char_ptr;
+typedef u16 Channel_ptr;
+typedef u16 FREE_LIST_ptr_ptr;
+typedef u16 FREE_LIST_ptr;
+typedef u16 LPB_ptr;
+typedef u16 Process_ptr;
+typedef u16 PHB_ptr;
+typedef u16 PKT_ptr;
+typedef u16 Q_BUF_ptr;
+typedef u16 Q_BUF_ptr_ptr;
+typedef u16 ROUTE_STR_ptr;
+typedef u16 RUP_ptr;
+typedef u16 short_ptr;
+typedef u16 u_short_ptr;
+typedef u16 ushort_ptr;
 
 #endif				/* __riotypes__ */
 
drivers/char/rio/rup.h +7 -14
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc3/drivers/char/rio/rup.h linux-2.6.16-rc3/drivers/char/rio/rup.h
@@ -37,14 +37,7 @@
 #ifndef _rup_h
 #define _rup_h 1
 
-#ifdef SCCS_LABELS
-#ifndef lint
-/* static char *_rio_rup_h_sccs = "@(#)rup.h	1.5"; */
-#endif
-#endif
-
 #define MAX_RUP          ((short) 16)
-
 #define PKTS_PER_RUP     ((short) 2)	/* They are always used in pairs */
 
 /*************************************************
@@ -62,13 +55,13 @@
 struct RUP {
 	PKT_ptr txpkt;		/* Outgoing packet */
 	PKT_ptr rxpkt;		/* Incoming packet */
-	WORD link;		/* Which link to send down? */
-	BYTE rup_dest_unit[2];	/* Destination unit */
-	WORD handshake;		/* For handshaking */
-	WORD timeout;		/* Timeout */
-	WORD status;		/* Status */
-	WORD txcontrol;		/* Transmit control */
-	WORD rxcontrol;		/* Receive control */
+	u16 link;		/* Which link to send down? */
+	u8 rup_dest_unit[2];	/* Destination unit */
+	u16 handshake;		/* For handshaking */
+	u16 timeout;		/* Timeout */
+	u16 status;		/* Status */
+	u16 txcontrol;		/* Transmit control */
+	u16 rxcontrol;		/* Receive control */
 };
 
 #endif
drivers/char/rio/typdef.h +4 -11
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.16-rc3/drivers/char/rio/typdef.h linux-2.6.16-rc3/drivers/char/rio/typdef.h
@@ -33,23 +33,16 @@
 #ifndef __rio_typdef_h__
 #define __rio_typdef_h__
 
-#ifdef SCCS_LABELS
-static char *_typdef_h_sccs_ = "@(#)typdef.h	1.2";
-#endif
-
-#undef VPIX
-
 /*
 ** IT IS REALLY, REALLY, IMPORTANT THAT BYTES ARE UNSIGNED!
 **
 ** These types are ONLY to be used for refering to data structures
 ** on the RIO Host card!
 */
-typedef volatile unsigned char BYTE;
-typedef volatile unsigned short WORD;
-typedef volatile unsigned int DWORD;
-typedef volatile unsigned short RIOP;
-typedef volatile short NUMBER;
+typedef volatile u8 BYTE;
+typedef volatile u16 WORD;
+typedef volatile u32 DWORD;
+typedef volatile u16 RIOP;
 
 
 /*