aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2009-08-27 06:01:42 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-09-15 15:02:28 -0400
commitb8ab735253320dcb9432d941536a49640cdbd914 (patch)
treefc574b49e63d825a562f987f9b129b22bdad6184 /drivers
parentc47a601d696e24f63f0429914b96f9cf10987e30 (diff)
Staging: et131x: kill the Q_ADDR struct
Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/et131x/et1310_address_map.h48
-rw-r--r--drivers/staging/et131x/et1310_jagcore.c41
-rw-r--r--drivers/staging/et131x/et131x_debug.c4
3 files changed, 30 insertions, 63 deletions
diff --git a/drivers/staging/et131x/et1310_address_map.h b/drivers/staging/et131x/et1310_address_map.h
index 5abaee918a04..b395f9c660e5 100644
--- a/drivers/staging/et131x/et1310_address_map.h
+++ b/drivers/staging/et131x/et1310_address_map.h
@@ -61,41 +61,13 @@
61 61
62/* START OF GLOBAL REGISTER ADDRESS MAP */ 62/* START OF GLOBAL REGISTER ADDRESS MAP */
63 63
64typedef union _Q_ADDR_t {
65 u32 value;
66 struct {
67#ifdef _BIT_FIELDS_HTOL
68 u32 unused:22; /* bits 10-31 */
69 u32 addr:10; /* bits 0-9 */
70#else
71 u32 addr:10; /* bits 0-9 */
72 u32 unused:22; /* bits 10-31 */
73#endif
74 } bits;
75} Q_ADDR_t, *PQ_ADDR_t;
76
77/* 64/*
78 * structure for tx queue start address reg in global address map 65 * 10bit registers
79 * located at address 0x0000 66 *
80 * Defined earlier (Q_ADDR_t) 67 * Tx queue start address reg in global address map at address 0x0000
81 */ 68 * tx queue end address reg in global address map at address 0x0004
82 69 * rx queue start address reg in global address map at address 0x0008
83/* 70 * rx queue end address reg in global address map at address 0x000C
84 * structure for tx queue end address reg in global address map
85 * located at address 0x0004
86 * Defined earlier (Q_ADDR_t)
87 */
88
89/*
90 * structure for rx queue start address reg in global address map
91 * located at address 0x0008
92 * Defined earlier (Q_ADDR_t)
93 */
94
95/*
96 * structure for rx queue end address reg in global address map
97 * located at address 0x000C
98 * Defined earlier (Q_ADDR_t)
99 */ 71 */
100 72
101/* 73/*
@@ -295,10 +267,10 @@ typedef union _LOOPBACK_t {
295 * Located at address 0x0000 267 * Located at address 0x0000
296 */ 268 */
297typedef struct _GLOBAL_t { /* Location: */ 269typedef struct _GLOBAL_t { /* Location: */
298 Q_ADDR_t txq_start_addr; /* 0x0000 */ 270 u32 txq_start_addr; /* 0x0000 */
299 Q_ADDR_t txq_end_addr; /* 0x0004 */ 271 u32 txq_end_addr; /* 0x0004 */
300 Q_ADDR_t rxq_start_addr; /* 0x0008 */ 272 u32 rxq_start_addr; /* 0x0008 */
301 Q_ADDR_t rxq_end_addr; /* 0x000C */ 273 u32 rxq_end_addr; /* 0x000C */
302 PM_CSR_t pm_csr; /* 0x0010 */ 274 PM_CSR_t pm_csr; /* 0x0010 */
303 u32 unused; /* 0x0014 */ 275 u32 unused; /* 0x0014 */
304 INTERRUPT_t int_status; /* 0x0018 */ 276 INTERRUPT_t int_status; /* 0x0018 */
diff --git a/drivers/staging/et131x/et1310_jagcore.c b/drivers/staging/et131x/et1310_jagcore.c
index 2767e4df0e62..47089bf59669 100644
--- a/drivers/staging/et131x/et1310_jagcore.c
+++ b/drivers/staging/et131x/et1310_jagcore.c
@@ -112,33 +112,26 @@ void ConfigGlobalRegs(struct et131x_adapter *etdev)
112 * and Rx as it desires. Our default is to split it 112 * and Rx as it desires. Our default is to split it
113 * 50/50: 113 * 50/50:
114 */ 114 */
115 writel(0, &pGbl->rxq_start_addr.value); 115 writel(0, &pGbl->rxq_start_addr);
116 writel(PARM_RX_MEM_END_DEF, 116 writel(PARM_RX_MEM_END_DEF, &pGbl->rxq_end_addr);
117 &pGbl->rxq_end_addr.value); 117 writel(PARM_RX_MEM_END_DEF + 1, &pGbl->txq_start_addr);
118 writel(PARM_RX_MEM_END_DEF + 1, 118 writel(INTERNAL_MEM_SIZE - 1, &pGbl->txq_end_addr);
119 &pGbl->txq_start_addr.value);
120 writel(INTERNAL_MEM_SIZE - 1,
121 &pGbl->txq_end_addr.value);
122 } else if (etdev->RegistryJumboPacket < 8192) { 119 } else if (etdev->RegistryJumboPacket < 8192) {
123 /* For jumbo packets > 2k but < 8k, split 50-50. */ 120 /* For jumbo packets > 2k but < 8k, split 50-50. */
124 writel(0, &pGbl->rxq_start_addr.value); 121 writel(0, &pGbl->rxq_start_addr);
125 writel(INTERNAL_MEM_RX_OFFSET, 122 writel(INTERNAL_MEM_RX_OFFSET, &pGbl->rxq_end_addr);
126 &pGbl->rxq_end_addr.value); 123 writel(INTERNAL_MEM_RX_OFFSET + 1, &pGbl->txq_start_addr);
127 writel(INTERNAL_MEM_RX_OFFSET + 1, 124 writel(INTERNAL_MEM_SIZE - 1, &pGbl->txq_end_addr);
128 &pGbl->txq_start_addr.value);
129 writel(INTERNAL_MEM_SIZE - 1,
130 &pGbl->txq_end_addr.value);
131 } else { 125 } else {
132 /* 9216 is the only packet size greater than 8k that 126 /* 9216 is the only packet size greater than 8k that
133 * is available. The Tx buffer has to be big enough 127 * is available. The Tx buffer has to be big enough
134 * for one whole packet on the Tx side. We'll make 128 * for one whole packet on the Tx side. We'll make
135 * the Tx 9408, and give the rest to Rx 129 * the Tx 9408, and give the rest to Rx
136 */ 130 */
137 writel(0x0000, &pGbl->rxq_start_addr.value); 131 writel(0x0000, &pGbl->rxq_start_addr);
138 writel(0x01b3, &pGbl->rxq_end_addr.value); 132 writel(0x01b3, &pGbl->rxq_end_addr);
139 writel(0x01b4, &pGbl->txq_start_addr.value); 133 writel(0x01b4, &pGbl->txq_start_addr);
140 writel(INTERNAL_MEM_SIZE - 1, 134 writel(INTERNAL_MEM_SIZE - 1,&pGbl->txq_end_addr);
141 &pGbl->txq_end_addr.value);
142 } 135 }
143 136
144 /* Initialize the loopback register. Disable all loopbacks. */ 137 /* Initialize the loopback register. Disable all loopbacks. */
@@ -149,13 +142,13 @@ void ConfigGlobalRegs(struct et131x_adapter *etdev)
149 * RxMAC will write data into the space, and the TxMAC will 142 * RxMAC will write data into the space, and the TxMAC will
150 * read it out. 143 * read it out.
151 */ 144 */
152 writel(0, &pGbl->rxq_start_addr.value); 145 writel(0, &pGbl->rxq_start_addr);
153 writel(INTERNAL_MEM_SIZE - 1, &pGbl->rxq_end_addr.value); 146 writel(INTERNAL_MEM_SIZE - 1, &pGbl->rxq_end_addr);
154 writel(0, &pGbl->txq_start_addr.value); 147 writel(0, &pGbl->txq_start_addr);
155 writel(INTERNAL_MEM_SIZE - 1, &pGbl->txq_end_addr.value); 148 writel(INTERNAL_MEM_SIZE - 1, &pGbl->txq_end_addr);
156 149
157 /* Initialize the loopback register (MAC loopback). */ 150 /* Initialize the loopback register (MAC loopback). */
158 writel(1, &pGbl->loopback.value); 151 writel(1, &pGbl->loopback);
159 } 152 }
160 153
161 /* MSI Register */ 154 /* MSI Register */
diff --git a/drivers/staging/et131x/et131x_debug.c b/drivers/staging/et131x/et131x_debug.c
index 779130b44a7d..945b4b542ada 100644
--- a/drivers/staging/et131x/et131x_debug.c
+++ b/drivers/staging/et131x/et131x_debug.c
@@ -1,3 +1,4 @@
1/*
1 * Agere Systems Inc. 2 * Agere Systems Inc.
2 * 10/100/1000 Base-T Ethernet Driver for the ET1301 and ET131x series MACs 3 * 10/100/1000 Base-T Ethernet Driver for the ET1301 and ET131x series MACs
3 * 4 *
@@ -135,6 +136,8 @@ void DumpTxQueueContents(int debug, struct et131x_adapter *etdev)
135 } 136 }
136} 137}
137 138
139#define NUM_BLOCKS 8
140
138static const char *BlockNames[NUM_BLOCKS] = { 141static const char *BlockNames[NUM_BLOCKS] = {
139 "Global", "Tx DMA", "Rx DMA", "Tx MAC", 142 "Global", "Tx DMA", "Rx DMA", "Tx MAC",
140 "Rx MAC", "MAC", "MAC Stat", "MMC" 143 "Rx MAC", "MAC", "MAC Stat", "MMC"
@@ -148,7 +151,6 @@ static const char *BlockNames[NUM_BLOCKS] = {
148 * Dumps the first 64 regs of each block of the et-1310 (each block is 151 * Dumps the first 64 regs of each block of the et-1310 (each block is
149 * mapped to a new page, each page is 4096 bytes). 152 * mapped to a new page, each page is 4096 bytes).
150 */ 153 */
151#define NUM_BLOCKS 8
152void DumpDeviceBlock(int debug, struct et131x_adapter *etdev, 154void DumpDeviceBlock(int debug, struct et131x_adapter *etdev,
153 u32 block) 155 u32 block)
154{ 156{