Skip to contentSkip to conversation

QE: remove typedefs

PATCH In review Kim Phillips 1 participant 1 message Sep 30, 2006 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 13/15 QE: remove typedefs

remove typedefs from QE code

---
 arch/powerpc/sysdev/qe_lib/qe_common.c |   18 ++--
 arch/powerpc/sysdev/qe_lib/ucc.c       |    2 
 arch/powerpc/sysdev/qe_lib/ucc_fast.c  |   32 ++++----
 arch/powerpc/sysdev/qe_lib/ucc_slow.c  |   38 ++++-----
 include/asm-powerpc/immap_qe.h         |  136 ++++++++++++++++----------------
 include/asm-powerpc/qe.h               |   40 +++++----
 include/asm-powerpc/ucc.h              |   10 +-
 include/asm-powerpc/ucc_fast.h         |   76 +++++++++---------
 include/asm-powerpc/ucc_slow.h         |   78 +++++++++---------
 9 files changed, 215 insertions(+), 215 deletions(-)
arch/powerpc/sysdev/qe_lib/qe_common.c +9 -9
index 5c3381f..3780eae 100644
@@ -35,24 +35,24 @@ #include <asm/rheap.h>
 
 /* QE snum state
 */
-typedef enum qe_snum_state {
+enum qe_snum_state {
 	QE_SNUM_STATE_USED,	/* used */
 	QE_SNUM_STATE_FREE	/* free */
-} qe_snum_state_e;
+};
 
 /* QE snum
 */
-typedef struct qe_snum {
+struct qe_snum {
 	u8 num;			/* snum  */
-	qe_snum_state_e state;	/* state */
-} qe_snum_t;
+	enum qe_snum_state state;	/* state */
+};
 
 /* We allocate this here because it is used almost exclusively for
  * the communication processor devices.
  */
 EXPORT_SYMBOL(qe_immr);
-qe_map_t *qe_immr = NULL;
-static qe_snum_t snums[QE_NUM_OF_SNUM];	/* Dynamically allocated SNUMs  */
+struct qe_immap *qe_immr = NULL;
+static struct qe_snum snums[QE_NUM_OF_SNUM];	/* Dynamically allocated SNUMs  */
 
 static void qe_snums_init(void);
 static void qe_muram_init(void);
@@ -85,7 +85,7 @@ EXPORT_SYMBOL(get_qe_base);
 void qe_reset(void)
 {
 	if (qe_immr == NULL)
-		qe_immr = (qe_map_t *) ioremap(get_qe_base(), QE_IMMAP_SIZE);
+		qe_immr = (struct qe_immap *) ioremap(get_qe_base(), QE_IMMAP_SIZE);
 
 	qe_snums_init();
 
@@ -270,7 +270,7 @@ EXPORT_SYMBOL(qe_put_snum);
 
 static int qe_sdma_init(void)
 {
-	sdma_t *sdma = &qe_immr->sdma;
+	struct sdma *sdma = &qe_immr->sdma;
 	uint sdma_buf_offset;
 
 	if (!sdma)
arch/powerpc/sysdev/qe_lib/ucc.c +1 -1
index edb0acb..d19f5e2 100644
@@ -150,7 +150,7 @@ int ucc_mux_set_grant_tsa_bkpt(int ucc_n
 	return 0;
 }
 
-int ucc_set_qe_mux_rxtx(int ucc_num, qe_clock_e clock, comm_dir_e mode)
+int ucc_set_qe_mux_rxtx(int ucc_num, enum qe_clock clock, enum comm_dir mode)
 {
 	volatile u32 *p_cmxucr;
 	u8 reg_num;
arch/powerpc/sysdev/qe_lib/ucc_fast.c +16 -16
index 4312083..b078d4e 100644
@@ -44,7 +44,7 @@ #else
 #define uccf_vdbg(fmt, args...) do { } while (0)
 #endif				/* UCCF_VERBOSE_DEBUG */
 
-void ucc_fast_dump_regs(ucc_fast_private_t * uccf)
+void ucc_fast_dump_regs(struct ucc_fast_private * uccf)
 {
 	uccf_info("UCC%d Fast registers:", uccf->uf_info->ucc_num);
 	uccf_info("Base address: 0x%08x", (u32) uccf->uf_regs);
@@ -112,14 +112,14 @@ u32 ucc_fast_get_qe_cr_subblock(int uccf
 	}
 }
 
-void ucc_fast_transmit_on_demand(ucc_fast_private_t * uccf)
+void ucc_fast_transmit_on_demand(struct ucc_fast_private * uccf)
 {
 	out_be16(&uccf->uf_regs->utodr, UCC_FAST_TOD);
 }
 
-void ucc_fast_enable(ucc_fast_private_t * uccf, comm_dir_e mode)
+void ucc_fast_enable(struct ucc_fast_private * uccf, enum comm_dir mode)
 {
-	ucc_fast_t *uf_regs;
+	struct ucc_fast *uf_regs;
 	u32 gumr;
 
 	uf_regs = uccf->uf_regs;
@@ -137,9 +137,9 @@ void ucc_fast_enable(ucc_fast_private_t 
 	out_be32(&uf_regs->gumr, gumr);
 }
 
-void ucc_fast_disable(ucc_fast_private_t * uccf, comm_dir_e mode)
+void ucc_fast_disable(struct ucc_fast_private * uccf, enum comm_dir mode)
 {
-	ucc_fast_t *uf_regs;
+	struct ucc_fast *uf_regs;
 	u32 gumr;
 
 	uf_regs = uccf->uf_regs;
@@ -157,10 +157,10 @@ void ucc_fast_disable(ucc_fast_private_t
 	out_be32(&uf_regs->gumr, gumr);
 }
 
-int ucc_fast_init(ucc_fast_info_t * uf_info, ucc_fast_private_t ** uccf_ret)
+int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** uccf_ret)
 {
-	ucc_fast_private_t *uccf;
-	ucc_fast_t *uf_regs;
+	struct ucc_fast_private *uccf;
+	struct ucc_fast *uf_regs;
 	u32 gumr = 0;
 	int ret;
 
@@ -225,20 +225,20 @@ int ucc_fast_init(ucc_fast_info_t * uf_i
 	}
 
 	uccf =
-	    (ucc_fast_private_t *) kmalloc(sizeof(ucc_fast_private_t),
+	    (struct ucc_fast_private *) kmalloc(sizeof(struct ucc_fast_private),
 					   GFP_KERNEL);
 	if (!uccf) {
 		uccf_err
 		    ("ucc_fast_init: No memory for UCC slow data structure!");
 		return -ENOMEM;
 	}
-	memset(uccf, 0, sizeof(ucc_fast_private_t));
+	memset(uccf, 0, sizeof(struct ucc_fast_private));
 
 	/* Fill fast UCC structure */
 	uccf->uf_info = uf_info;
 	/* Set the PHY base address */
 	uccf->uf_regs =
-	    (ucc_fast_t *) ioremap(uf_info->regs, sizeof(ucc_fast_t));
+	    (struct ucc_fast *) ioremap(uf_info->regs, sizeof(struct ucc_fast));
 	if (uccf->uf_regs == NULL) {
 		uccf_err
 		    ("ucc_fast_init: No memory map for UCC slow controller!");
@@ -259,7 +259,7 @@ #ifdef STATISTICS
 #endif				/* STATISTICS */
 
 	/* Init Guemr register */
-	if ((ret = ucc_init_guemr((ucc_common_t *) (uf_regs)))) {
+	if ((ret = ucc_init_guemr((struct ucc_common *) (uf_regs)))) {
 		uccf_err("ucc_fast_init: Could not init the guemr register.");
 		ucc_fast_free(uccf);
 		return ret;
@@ -267,7 +267,7 @@ #endif				/* STATISTICS */
 
 	/* Set UCC to fast type */
 	if ((ret = ucc_set_type(uf_info->ucc_num,
-				(ucc_common_t *) (uf_regs),
+				(struct ucc_common *) (uf_regs),
 				UCC_SPEED_TYPE_FAST))) {
 		uccf_err("ucc_fast_init: Could not set type to fast.");
 		ucc_fast_free(uccf);
@@ -311,7 +311,7 @@ #endif				/* STATISTICS */
 	if (IS_MURAM_ERR(uccf->ucc_fast_tx_virtual_fifo_base_offset)) {
 		uccf_err
 		    ("ucc_fast_init: Can not allocate MURAM memory for "
-			"ucc_fast_tx_virtual_fifo_base_offset.");
+			"struct ucc_fastx_virtual_fifo_base_offset.");
 		uccf->ucc_fast_tx_virtual_fifo_base_offset = 0;
 		ucc_fast_free(uccf);
 		return -ENOMEM;
@@ -393,7 +393,7 @@ #endif				/* STATISTICS */
 	return 0;
 }
 
-void ucc_fast_free(ucc_fast_private_t * uccf)
+void ucc_fast_free(struct ucc_fast_private * uccf)
 {
 	if (!uccf)
 		return;
arch/powerpc/sysdev/qe_lib/ucc_slow.c +19 -19
index a8232cd..0059de4 100644
@@ -69,14 +69,14 @@ u32 ucc_slow_get_qe_cr_subblock(int uccs
 	}
 }
 
-void ucc_slow_poll_transmitter_now(ucc_slow_private_t * uccs)
+void ucc_slow_poll_transmitter_now(struct ucc_slow_private * uccs)
 {
 	out_be16(&uccs->us_regs->utodr, UCC_SLOW_TOD);
 }
 
-void ucc_slow_graceful_stop_tx(ucc_slow_private_t * uccs)
+void ucc_slow_graceful_stop_tx(struct ucc_slow_private * uccs)
 {
-	ucc_slow_info_t *us_info = uccs->us_info;
+	struct ucc_slow_info *us_info = uccs->us_info;
 	u32 id;
 
 	id = ucc_slow_get_qe_cr_subblock(us_info->ucc_num);
@@ -84,27 +84,27 @@ void ucc_slow_graceful_stop_tx(ucc_slow_
 		     0);
 }
 
-void ucc_slow_stop_tx(ucc_slow_private_t * uccs)
+void ucc_slow_stop_tx(struct ucc_slow_private * uccs)
 {
-	ucc_slow_info_t *us_info = uccs->us_info;
+	struct ucc_slow_info *us_info = uccs->us_info;
 	u32 id;
 
 	id = ucc_slow_get_qe_cr_subblock(us_info->ucc_num);
 	qe_issue_cmd(QE_STOP_TX, id, (u8) QE_CR_PROTOCOL_UNSPECIFIED, 0);
 }
 
-void ucc_slow_restart_tx(ucc_slow_private_t * uccs)
+void ucc_slow_restart_tx(struct ucc_slow_private * uccs)
 {
-	ucc_slow_info_t *us_info = uccs->us_info;
+	struct ucc_slow_info *us_info = uccs->us_info;
 	u32 id;
 
 	id = ucc_slow_get_qe_cr_subblock(us_info->ucc_num);
 	qe_issue_cmd(QE_RESTART_TX, id, (u8) QE_CR_PROTOCOL_UNSPECIFIED, 0);
 }
 
-void ucc_slow_enable(ucc_slow_private_t * uccs, comm_dir_e mode)
+void ucc_slow_enable(struct ucc_slow_private * uccs, enum comm_dir mode)
 {
-	ucc_slow_t *us_regs;
+	struct ucc_slow *us_regs;
 	u32 gumr_l;
 
 	us_regs = uccs->us_regs;
@@ -122,9 +122,9 @@ void ucc_slow_enable(ucc_slow_private_t 
 	out_be32(&us_regs->gumr_l, gumr_l);
 }
 
-void ucc_slow_disable(ucc_slow_private_t * uccs, comm_dir_e mode)
+void ucc_slow_disable(struct ucc_slow_private * uccs, enum comm_dir mode)
 {
-	ucc_slow_t *us_regs;
+	struct ucc_slow *us_regs;
 	u32 gumr_l;
 
 	us_regs = uccs->us_regs;
@@ -142,14 +142,14 @@ void ucc_slow_disable(ucc_slow_private_t
 	out_be32(&us_regs->gumr_l, gumr_l);
 }
 
-int ucc_slow_init(ucc_slow_info_t * us_info, ucc_slow_private_t ** uccs_ret)
+int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** uccs_ret)
 {
 	u32 i;
-	ucc_slow_t *us_regs;
+	struct ucc_slow *us_regs;
 	u32 gumr;
 	u8 function_code = 0;
 	u8 *bd;
-	ucc_slow_private_t *uccs;
+	struct ucc_slow_private *uccs;
 	u32 id;
 	u32 command;
 	int ret;
@@ -176,14 +176,14 @@ int ucc_slow_init(ucc_slow_info_t * us_i
 	}
 
 	uccs =
-	    (ucc_slow_private_t *) kmalloc(sizeof(ucc_slow_private_t),
+	    (struct ucc_slow_private *) kmalloc(sizeof(struct ucc_slow_private),
 					   GFP_KERNEL);
 	if (!uccs) {
 		uccs_err
 		    ("ucc_slow_init: No memory for UCC slow data structure!");
 		return -ENOMEM;
 	}
-	memset(uccs, 0, sizeof(ucc_slow_private_t));
+	memset(uccs, 0, sizeof(struct ucc_slow_private));
 
 	/* Fill slow UCC structure */
 	uccs->us_info = us_info;
@@ -216,7 +216,7 @@ #endif				/* STATISTICS */
 	uccs->us_pram = qe_muram_addr(uccs->us_pram_offset);
 
 	/* Init Guemr register */
-	if ((ret = ucc_init_guemr((ucc_common_t *) (us_info->us_regs)))) {
+	if ((ret = ucc_init_guemr((struct ucc_common *) (us_info->us_regs)))) {
 		uccs_err("ucc_slow_init: Could not init the guemr register.");
 		ucc_slow_free(uccs);
 		return ret;
@@ -224,7 +224,7 @@ #endif				/* STATISTICS */
 
 	/* Set UCC to slow type */
 	if ((ret = ucc_set_type(us_info->ucc_num,
-				(ucc_common_t *) (us_info->us_regs),
+				(struct ucc_common *) (us_info->us_regs),
 				UCC_SPEED_TYPE_SLOW))) {
 		uccs_err("ucc_slow_init: Could not init the guemr register.");
 		ucc_slow_free(uccs);
@@ -386,7 +386,7 @@ #endif				/* STATISTICS */
 	return 0;
 }
 
-void ucc_slow_free(ucc_slow_private_t * uccs)
+void ucc_slow_free(struct ucc_slow_private * uccs)
 {
 	if (!uccs)
 		return;
include/asm-powerpc/immap_qe.h +68 -68

300 lines not on this page · raw message

include/asm-powerpc/qe.h +20 -20
index 94623ee..2e43e45 100644
@@ -51,18 +51,18 @@ void qe_muram_dump(void);
 void *qe_muram_addr(uint offset);
 /* Buffer descriptors.
 */
-typedef struct qe_bd {
+struct qe_bd {
 	u16 status;
 	u16 length;
 	u32 buf;
-} __attribute__ ((packed)) qe_bd_t;
+} __attribute__ ((packed));
 
-#define QE_SIZEOF_BD       sizeof(qe_bd_t)
+#define QE_SIZEOF_BD       sizeof(struct qe_bd)
 
 #define BD_STATUS_MASK                      0xffff0000
 #define BD_LENGTH_MASK                      0x0000ffff
 
-#define BD_BUFFER_ARG(bd)                   ((qe_bd_t *)bd)->buf
+#define BD_BUFFER_ARG(bd)                   ((struct qe_bd *)bd)->buf
 #define BD_BUFFER_CLEAR(bd)                 out_be32(&(BD_BUFFER_ARG(bd)), 0);
 #define BD_BUFFER(bd)                       in_be32(&(BD_BUFFER_ARG(bd)))
 #define BD_STATUS_AND_LENGTH_SET(bd, val)   out_be32((u32*)bd, val)
@@ -83,66 +83,66 @@ #define QE_ALIGNMENT_OF_PRAM            
 
 /* RISC allocation
 */
-typedef enum qe_risc_allocation {
+enum qe_risc_allocation {
 	QE_RISC_ALLOCATION_RISC1 = 1,	/* RISC 1 */
 	QE_RISC_ALLOCATION_RISC2 = 2,	/* RISC 2 */
 	QE_RISC_ALLOCATION_RISC1_AND_RISC2 = 3	/* Dynamically choose RISC 1 or
 						   RISC 2 */
-} qe_risc_allocation_e;
+};
 
 /* QE extended filtering Table Lookup Key Size
 */
-typedef enum qe_fltr_tbl_lookup_key_size {
+enum qe_fltr_tbl_lookup_key_size {
 	QE_FLTR_TABLE_LOOKUP_KEY_SIZE_8_BYTES
 		= 0x3f,		/* LookupKey parsed by the Generate LookupKey
 				   CMD is truncated to 8  bytes */
 	QE_FLTR_TABLE_LOOKUP_KEY_SIZE_16_BYTES
 		= 0x5f,		/* LookupKey parsed by the Generate LookupKey
 				   CMD is truncated to 16 bytes */
-} qe_fltr_tbl_lookup_key_size_e;
+};
 
 /* QE FLTR extended filtering Largest External Table Lookup Key Size
 */
-typedef enum qe_fltr_largest_external_tbl_lookup_key_size_ {
+enum qe_fltr_largest_external_tbl_lookup_key_size {
 	QE_FLTR_LARGEST_EXTERNAL_TABLE_LOOKUP_KEY_SIZE_NONE
 		= 0x0,/* not used */
 	QE_FLTR_LARGEST_EXTERNAL_TABLE_LOOKUP_KEY_SIZE_8_BYTES
 		= QE_FLTR_TABLE_LOOKUP_KEY_SIZE_8_BYTES,	/* 8  bytes */
 	QE_FLTR_LARGEST_EXTERNAL_TABLE_LOOKUP_KEY_SIZE_16_BYTES
 		= QE_FLTR_TABLE_LOOKUP_KEY_SIZE_16_BYTES	/* 16 bytes */
-} qe_fltr_largest_external_tbl_lookup_key_size_e;
+};
 
 /* structure representing QE parameter RAM
 */
-typedef struct qe_timer_tables {
+struct qe_timer_tables {
 	u16 tm_base;		/* QE timer table base adr */
 	u16 tm_ptr;		/* QE timer table pointer  */
 	u16 r_tmr;		/* QE timer mode register  */
 	u16 r_tmv;		/* QE timer valid register */
 	u32 tm_cmd;		/* QE timer cmd register   */
 	u32 tm_cnt;		/* QE timer internal cnt   */
-} __attribute__ ((packed)) qe_timer_tables_t;
+} __attribute__ ((packed));
 
 #define QE_FLTR_TAD_SIZE                8
 
 /* QE extended filtering Termination Action Descriptor (TAD)
 */
-typedef struct qe_fltr_tad {
+struct qe_fltr_tad {
 	u8 serialized[QE_FLTR_TAD_SIZE];
-} __attribute__ ((packed)) qe_fltr_tad_t;
+} __attribute__ ((packed));
 
 /* Communication Direction.
 */
-typedef enum comm_dir {
+enum comm_dir {
 	COMM_DIR_NONE = 0,
 	COMM_DIR_RX = 1,
 	COMM_DIR_TX = 2,
 	COMM_DIR_RX_AND_TX = 3
-} comm_dir_e;
+};
 
 /* Clocks and GRG's
 */
-typedef enum qe_clock {
+enum qe_clock {
 	QE_CLK_NONE = 0
 	    , QE_BRG1		/* Baud Rate Generator  1 */
 	    , QE_BRG2		/* Baud Rate Generator  2 */
@@ -185,7 +185,7 @@ typedef enum qe_clock {
 	    , QE_CLK23		/* Clock 23               */
 	    , QE_CLK24		/* Clock 24               */
 	    , QE_CLK_DUMMY
-} qe_clock_e;
+};
 
 /* QE CMXUCR Registers.
  * There are two UCCs represented in each of the four CMXUCR registers.
@@ -366,7 +366,7 @@ #define UCC_GUEMR_SET_RESERVED3 0x10	/* 
 
 /* structure representing UCC SLOW parameter RAM
 */
-typedef struct ucc_slow_pram {
+struct ucc_slow_pram {
 	u16 rbase;		/* RX BD base address       */
 	u16 tbase;		/* TX BD base address       */
 	u8 rfcr;		/* Rx function code         */
@@ -384,7 +384,7 @@ typedef struct ucc_slow_pram {
 	u32 ttemp;		/* Tx temp                  */
 	u32 rcrc;		/* temp receive CRC         */
 	u32 tcrc;		/* temp transmit CRC        */
-} __attribute__ ((packed)) ucc_slow_pram_t;
+} __attribute__ ((packed));
 
 /* General UCC SLOW Mode Register (GUMRH & GUMRL)
 */
include/asm-powerpc/ucc.h +5 -5
index 5c09df6..bca4966 100644
@@ -24,13 +24,13 @@ #define UCC_MAX_NUM     8
 
 /* Slow or fast type for UCCs.
 */
-typedef enum ucc_speed_type {
+enum ucc_speed_type {
 	UCC_SPEED_TYPE_FAST, UCC_SPEED_TYPE_SLOW
-} ucc_speed_type_e;
+};
 
 /* Initial UCCs Parameter RAM address relative to: MEM_MAP_BASE (IMMR).
 */
-typedef enum ucc_pram_initial_offset {
+enum ucc_pram_initial_offset {
 	UCC_PRAM_OFFSET_UCC1 = 0x8400,
 	UCC_PRAM_OFFSET_UCC2 = 0x8500,
 	UCC_PRAM_OFFSET_UCC3 = 0x8600,
@@ -39,7 +39,7 @@ typedef enum ucc_pram_initial_offset {
 	UCC_PRAM_OFFSET_UCC6 = 0x8100,
 	UCC_PRAM_OFFSET_UCC7 = 0x8200,
 	UCC_PRAM_OFFSET_UCC8 = 0x8300
-} ucc_pram_initial_offset_e;
+};
 
 /* ucc_set_type
  * Sets UCC to slow or fast mode.
@@ -60,7 +60,7 @@ int ucc_init_guemr(struct ucc_common *re
 
 int ucc_set_qe_mux_mii_mng(int ucc_num);
 
-int ucc_set_qe_mux_rxtx(int ucc_num, qe_clock_e clock, comm_dir_e mode);
+int ucc_set_qe_mux_rxtx(int ucc_num, enum qe_clock clock, enum comm_dir mode);
 
 int ucc_mux_set_grant_tsa_bkpt(int ucc_num, int set, u32 mask);
 
include/asm-powerpc/ucc_fast.h +38 -38

187 lines not on this page · raw message

include/asm-powerpc/ucc_slow.h +39 -39

194 lines not on this page · raw message

Signature · 1 line
1.4.2.1