diff options
author | Alan Cox <alan@linux.intel.com> | 2009-08-27 05:59:56 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-09-15 15:02:27 -0400 |
commit | c2557177f16cc0b63115a1ea09c732e3ace14d5f (patch) | |
tree | 96e2dab57f53ae1fe06c37d76c87b795edb55a67 /drivers | |
parent | c3b4a7a92e98a51b3dd253ec6fd825ccf0dd17f7 (diff) |
Staging: et131x: clean up constant rx/tx registry fields
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_jagcore.c | 4 | ||||
-rw-r--r-- | drivers/staging/et131x/et1310_rx.c | 6 | ||||
-rw-r--r-- | drivers/staging/et131x/et1310_tx.c | 11 | ||||
-rw-r--r-- | drivers/staging/et131x/et131x_adapter.h | 6 | ||||
-rw-r--r-- | drivers/staging/et131x/et131x_config.c | 27 | ||||
-rw-r--r-- | drivers/staging/et131x/et131x_defs.h | 8 |
6 files changed, 19 insertions, 43 deletions
diff --git a/drivers/staging/et131x/et1310_jagcore.c b/drivers/staging/et131x/et1310_jagcore.c index 403258924640..5c847ada17ed 100644 --- a/drivers/staging/et131x/et1310_jagcore.c +++ b/drivers/staging/et131x/et1310_jagcore.c | |||
@@ -113,9 +113,9 @@ void ConfigGlobalRegs(struct et131x_adapter *etdev) | |||
113 | * 50/50: | 113 | * 50/50: |
114 | */ | 114 | */ |
115 | writel(0, &pGbl->rxq_start_addr.value); | 115 | writel(0, &pGbl->rxq_start_addr.value); |
116 | writel(etdev->RegistryRxMemEnd, | 116 | writel(PARM_RX_MEM_END_DEF, |
117 | &pGbl->rxq_end_addr.value); | 117 | &pGbl->rxq_end_addr.value); |
118 | writel(etdev->RegistryRxMemEnd + 1, | 118 | writel(PARM_RX_MEM_END_DEF + 1, |
119 | &pGbl->txq_start_addr.value); | 119 | &pGbl->txq_start_addr.value); |
120 | writel(INTERNAL_MEM_SIZE - 1, | 120 | writel(INTERNAL_MEM_SIZE - 1, |
121 | &pGbl->txq_end_addr.value); | 121 | &pGbl->txq_end_addr.value); |
diff --git a/drivers/staging/et131x/et1310_rx.c b/drivers/staging/et131x/et1310_rx.c index c60e05e99a1a..53efa081274c 100644 --- a/drivers/staging/et131x/et1310_rx.c +++ b/drivers/staging/et131x/et1310_rx.c | |||
@@ -792,14 +792,14 @@ void ConfigRxDmaRegs(struct et131x_adapter *etdev) | |||
792 | * For version B silicon, this value gets updated once autoneg is | 792 | * For version B silicon, this value gets updated once autoneg is |
793 | *complete. | 793 | *complete. |
794 | */ | 794 | */ |
795 | writel(etdev->RegistryRxNumBuffers, &pRxDma->num_pkt_done.value); | 795 | writel(PARM_RX_NUM_BUFS_DEF, &pRxDma->num_pkt_done.value); |
796 | 796 | ||
797 | /* The "time_done" is not working correctly to coalesce interrupts | 797 | /* The "time_done" is not working correctly to coalesce interrupts |
798 | * after a given time period, but rather is giving us an interrupt | 798 | * after a given time period, but rather is giving us an interrupt |
799 | * regardless of whether we have received packets. | 799 | * regardless of whether we have received packets. |
800 | * This value gets updated once autoneg is complete. | 800 | * This value gets updated once autoneg is complete. |
801 | */ | 801 | */ |
802 | writel(etdev->RegistryRxTimeInterval, &pRxDma->max_pkt_time.value); | 802 | writel(PARM_RX_TIME_INT_DEF, &pRxDma->max_pkt_time.value); |
803 | 803 | ||
804 | spin_unlock_irqrestore(&etdev->RcvLock, flags); | 804 | spin_unlock_irqrestore(&etdev->RcvLock, flags); |
805 | 805 | ||
@@ -1272,7 +1272,7 @@ void et131x_handle_recv_interrupt(struct et131x_adapter *etdev) | |||
1272 | 1272 | ||
1273 | if ((PacketArrayCount == NUM_PACKETS_HANDLED) || TempUnfinishedRec) { | 1273 | if ((PacketArrayCount == NUM_PACKETS_HANDLED) || TempUnfinishedRec) { |
1274 | etdev->RxRing.UnfinishedReceives = true; | 1274 | etdev->RxRing.UnfinishedReceives = true; |
1275 | writel(etdev->RegistryTxTimeInterval * NANO_IN_A_MICRO, | 1275 | writel(PARM_TX_TIME_INT_DEF * NANO_IN_A_MICRO, |
1276 | &etdev->regs->global.watchdog_timer); | 1276 | &etdev->regs->global.watchdog_timer); |
1277 | } else { | 1277 | } else { |
1278 | /* Watchdog timer will disable itself if appropriate. */ | 1278 | /* Watchdog timer will disable itself if appropriate. */ |
diff --git a/drivers/staging/et131x/et1310_tx.c b/drivers/staging/et131x/et1310_tx.c index 8e8486adda39..8472c1b33f33 100644 --- a/drivers/staging/et131x/et1310_tx.c +++ b/drivers/staging/et131x/et1310_tx.c | |||
@@ -94,6 +94,7 @@ | |||
94 | 94 | ||
95 | #include "et1310_tx.h" | 95 | #include "et1310_tx.h" |
96 | 96 | ||
97 | |||
97 | /* Data for debugging facilities */ | 98 | /* Data for debugging facilities */ |
98 | #ifdef CONFIG_ET131X_DEBUG | 99 | #ifdef CONFIG_ET131X_DEBUG |
99 | extern dbg_info_t *et131x_dbginfo; | 100 | extern dbg_info_t *et131x_dbginfo; |
@@ -711,7 +712,7 @@ static int nic_send_packet(struct et131x_adapter *etdev, PMP_TCB pMpTcb) | |||
711 | 712 | ||
712 | if (etdev->uiLinkSpeed == TRUEPHY_SPEED_1000MBPS) { | 713 | if (etdev->uiLinkSpeed == TRUEPHY_SPEED_1000MBPS) { |
713 | if (++etdev->TxRing.TxPacketsSinceLastinterrupt == | 714 | if (++etdev->TxRing.TxPacketsSinceLastinterrupt == |
714 | etdev->RegistryTxNumBuffers) { | 715 | PARM_TX_NUM_BUFS_DEF) { |
715 | CurDesc[FragmentNumber - 1].word3.value = 0x5; | 716 | CurDesc[FragmentNumber - 1].word3.value = 0x5; |
716 | etdev->TxRing.TxPacketsSinceLastinterrupt = 0; | 717 | etdev->TxRing.TxPacketsSinceLastinterrupt = 0; |
717 | } else { | 718 | } else { |
@@ -794,7 +795,7 @@ static int nic_send_packet(struct et131x_adapter *etdev, PMP_TCB pMpTcb) | |||
794 | * timer to wake us up if this packet isn't followed by N more. | 795 | * timer to wake us up if this packet isn't followed by N more. |
795 | */ | 796 | */ |
796 | if (etdev->uiLinkSpeed == TRUEPHY_SPEED_1000MBPS) { | 797 | if (etdev->uiLinkSpeed == TRUEPHY_SPEED_1000MBPS) { |
797 | writel(etdev->RegistryTxTimeInterval * NANO_IN_A_MICRO, | 798 | writel(PARM_TX_TIME_INT_DEF * NANO_IN_A_MICRO, |
798 | &etdev->regs->global.watchdog_timer); | 799 | &etdev->regs->global.watchdog_timer); |
799 | } | 800 | } |
800 | 801 | ||
@@ -1064,7 +1065,7 @@ static int nic_send_packet(struct et131x_adapter *etdev, PMP_TCB pMpTcb) | |||
1064 | TRUEPHY_SPEED_1000MBPS) { | 1065 | TRUEPHY_SPEED_1000MBPS) { |
1065 | if (++etdev->TxRing. | 1066 | if (++etdev->TxRing. |
1066 | TxPacketsSinceLastinterrupt >= | 1067 | TxPacketsSinceLastinterrupt >= |
1067 | etdev->RegistryTxNumBuffers) { | 1068 | PARM_TX_NUM_BUFS_DEF) { |
1068 | CurDesc.word3.value = 0x5; | 1069 | CurDesc.word3.value = 0x5; |
1069 | etdev->TxRing. | 1070 | etdev->TxRing. |
1070 | TxPacketsSinceLastinterrupt | 1071 | TxPacketsSinceLastinterrupt |
@@ -1132,7 +1133,7 @@ static int nic_send_packet(struct et131x_adapter *etdev, PMP_TCB pMpTcb) | |||
1132 | 1133 | ||
1133 | if (etdev->uiLinkSpeed == TRUEPHY_SPEED_1000MBPS) { | 1134 | if (etdev->uiLinkSpeed == TRUEPHY_SPEED_1000MBPS) { |
1134 | if (++etdev->TxRing.TxPacketsSinceLastinterrupt >= | 1135 | if (++etdev->TxRing.TxPacketsSinceLastinterrupt >= |
1135 | etdev->RegistryTxNumBuffers) { | 1136 | PARM_TX_NUM_BUFS_DEF) { |
1136 | CurDesc.word3.value = 0x5; | 1137 | CurDesc.word3.value = 0x5; |
1137 | etdev->TxRing.TxPacketsSinceLastinterrupt = | 1138 | etdev->TxRing.TxPacketsSinceLastinterrupt = |
1138 | 0; | 1139 | 0; |
@@ -1212,7 +1213,7 @@ static int nic_send_packet(struct et131x_adapter *etdev, PMP_TCB pMpTcb) | |||
1212 | * timer to wake us up if this packet isn't followed by N more. | 1213 | * timer to wake us up if this packet isn't followed by N more. |
1213 | */ | 1214 | */ |
1214 | if (etdev->uiLinkSpeed == TRUEPHY_SPEED_1000MBPS) { | 1215 | if (etdev->uiLinkSpeed == TRUEPHY_SPEED_1000MBPS) { |
1215 | writel(etdev->RegistryTxTimeInterval * NANO_IN_A_MICRO, | 1216 | writel(PARM_TX_TIME_INT_DEF * NANO_IN_A_MICRO, |
1216 | &etdev->regs->global.watchdog_timer); | 1217 | &etdev->regs->global.watchdog_timer); |
1217 | } | 1218 | } |
1218 | 1219 | ||
diff --git a/drivers/staging/et131x/et131x_adapter.h b/drivers/staging/et131x/et131x_adapter.h index a7402a3792d2..bbbada027cd0 100644 --- a/drivers/staging/et131x/et131x_adapter.h +++ b/drivers/staging/et131x/et131x_adapter.h | |||
@@ -260,12 +260,6 @@ struct et131x_adapter { | |||
260 | u32 RegistryVlanTag; /* 802.1q Vlan TAG */ | 260 | u32 RegistryVlanTag; /* 802.1q Vlan TAG */ |
261 | u32 RegistryJumboPacket; /* Max supported ethernet packet size */ | 261 | u32 RegistryJumboPacket; /* Max supported ethernet packet size */ |
262 | 262 | ||
263 | u32 RegistryTxNumBuffers; | ||
264 | u32 RegistryTxTimeInterval; | ||
265 | |||
266 | u32 RegistryRxNumBuffers; | ||
267 | u32 RegistryRxTimeInterval; | ||
268 | |||
269 | /* Validation helpers */ | 263 | /* Validation helpers */ |
270 | u8 RegistryNMIDisable; | 264 | u8 RegistryNMIDisable; |
271 | u8 RegistryPhyLoopbk; /* Enable Phy loopback */ | 265 | u8 RegistryPhyLoopbk; /* Enable Phy loopback */ |
diff --git a/drivers/staging/et131x/et131x_config.c b/drivers/staging/et131x/et131x_config.c index f8273d17ebd3..a31f82aea0e3 100644 --- a/drivers/staging/et131x/et131x_config.c +++ b/drivers/staging/et131x/et131x_config.c | |||
@@ -129,26 +129,6 @@ extern dbg_info_t *et131x_dbginfo; | |||
129 | #define PARM_PHY_COMA_MIN 0 | 129 | #define PARM_PHY_COMA_MIN 0 |
130 | #define PARM_PHY_COMA_MAX 1 | 130 | #define PARM_PHY_COMA_MAX 1 |
131 | 131 | ||
132 | #define PARM_RX_NUM_BUFS_DEF 4 | ||
133 | #define PARM_RX_NUM_BUFS_MIN 1 | ||
134 | #define PARM_RX_NUM_BUFS_MAX 64 | ||
135 | |||
136 | #define PARM_RX_TIME_INT_DEF 10 | ||
137 | #define PARM_RX_TIME_INT_MIN 2 | ||
138 | #define PARM_RX_TIME_INT_MAX 320 | ||
139 | |||
140 | #define PARM_TX_NUM_BUFS_DEF 4 | ||
141 | #define PARM_TX_NUM_BUFS_MIN 1 | ||
142 | #define PARM_TX_NUM_BUFS_MAX 40 | ||
143 | |||
144 | #define PARM_TX_TIME_INT_DEF 40 | ||
145 | #define PARM_TX_TIME_INT_MIN 1 | ||
146 | #define PARM_TX_TIME_INT_MAX 140 | ||
147 | |||
148 | #define PARM_RX_MEM_END_DEF 0x2bc | ||
149 | #define PARM_RX_MEM_END_MIN 0 | ||
150 | #define PARM_RX_MEM_END_MAX 0x3ff | ||
151 | |||
152 | #define PARM_MAC_STAT_DEF 1 | 132 | #define PARM_MAC_STAT_DEF 1 |
153 | #define PARM_MAC_STAT_MIN 0 | 133 | #define PARM_MAC_STAT_MIN 0 |
154 | #define PARM_MAC_STAT_MAX 1 | 134 | #define PARM_MAC_STAT_MAX 1 |
@@ -166,8 +146,6 @@ extern dbg_info_t *et131x_dbginfo; | |||
166 | #define PARM_NMI_DISABLE_MAX 2 | 146 | #define PARM_NMI_DISABLE_MAX 2 |
167 | 147 | ||
168 | #define PARM_DMA_CACHE_DEF 0 | 148 | #define PARM_DMA_CACHE_DEF 0 |
169 | #define PARM_DMA_CACHE_MIN 0 | ||
170 | #define PARM_DMA_CACHE_MAX 15 | ||
171 | 149 | ||
172 | #define PARM_PHY_LOOPBK_DEF 0 | 150 | #define PARM_PHY_LOOPBK_DEF 0 |
173 | #define PARM_PHY_LOOPBK_MIN 0 | 151 | #define PARM_PHY_LOOPBK_MIN 0 |
@@ -249,11 +227,6 @@ void et131x_config_parse(struct et131x_adapter *etdev) | |||
249 | etdev->RegistryFlowControl = PARM_FLOW_CTL_DEF; | 227 | etdev->RegistryFlowControl = PARM_FLOW_CTL_DEF; |
250 | etdev->RegistryJumboPacket = PARM_JUMBO_PKT_DEF; | 228 | etdev->RegistryJumboPacket = PARM_JUMBO_PKT_DEF; |
251 | etdev->RegistryPhyComa = PARM_PHY_COMA_DEF; | 229 | etdev->RegistryPhyComa = PARM_PHY_COMA_DEF; |
252 | etdev->RegistryRxNumBuffers = PARM_RX_NUM_BUFS_DEF; | ||
253 | etdev->RegistryRxTimeInterval = PARM_RX_TIME_INT_DEF; | ||
254 | etdev->RegistryTxNumBuffers = PARM_TX_NUM_BUFS_DEF; | ||
255 | etdev->RegistryTxTimeInterval = PARM_TX_TIME_INT_DEF; | ||
256 | etdev->RegistryRxMemEnd = PARM_RX_MEM_END_DEF; | ||
257 | etdev->RegistryMACStat = PARM_MAC_STAT_DEF; | 230 | etdev->RegistryMACStat = PARM_MAC_STAT_DEF; |
258 | 231 | ||
259 | if (et131x_nmi_disable != PARM_NMI_DISABLE_DEF) | 232 | if (et131x_nmi_disable != PARM_NMI_DISABLE_DEF) |
diff --git a/drivers/staging/et131x/et131x_defs.h b/drivers/staging/et131x/et131x_defs.h index 9d609e530621..5665c6a226f0 100644 --- a/drivers/staging/et131x/et131x_defs.h +++ b/drivers/staging/et131x/et131x_defs.h | |||
@@ -125,4 +125,12 @@ | |||
125 | /* Define order of magnitude converter */ | 125 | /* Define order of magnitude converter */ |
126 | #define NANO_IN_A_MICRO 1000 | 126 | #define NANO_IN_A_MICRO 1000 |
127 | 127 | ||
128 | #define PARM_RX_NUM_BUFS_DEF 4 | ||
129 | #define PARM_RX_TIME_INT_DEF 10 | ||
130 | #define PARM_RX_MEM_END_DEF 0x2bc | ||
131 | #define PARM_TX_TIME_INT_DEF 40 | ||
132 | #define PARM_TX_NUM_BUFS_DEF 4 | ||
133 | #define PARM_DMA_CACHE_DEF 0 | ||
134 | |||
135 | |||
128 | #endif /* __ET131X_DEFS_H__ */ | 136 | #endif /* __ET131X_DEFS_H__ */ |