netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 5/10] cxgb3 - Clean up HW init routine
@ 2007-01-31  3:44 Divy Le Ray
  0 siblings, 0 replies; only message in thread
From: Divy Le Ray @ 2007-01-31  3:44 UTC (permalink / raw)
  To: jeff; +Cc: netdev, linux-kernel, swise

From: Divy Le Ray <divy@chelsio.com>

Clean up the tp_config() routine.

Signed-off-by: Divy Le Ray <divy@chelsio.com>
---

 drivers/net/cxgb3/t3_hw.c |   16 +++++-----------
 1 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/drivers/net/cxgb3/t3_hw.c b/drivers/net/cxgb3/t3_hw.c
index 2215400..7112bac 100644
--- a/drivers/net/cxgb3/t3_hw.c
+++ b/drivers/net/cxgb3/t3_hw.c
@@ -2328,8 +2328,6 @@ static inline void tp_wr_indirect(struct
 
 static void tp_config(struct adapter *adap, const struct tp_params *p)
 {
-	unsigned int v;
-
 	t3_write_reg(adap, A_TP_GLOBAL_CONFIG, F_TXPACINGENABLE | F_PATHMTU |
 		     F_IPCHECKSUMOFFLOAD | F_UDPCHECKSUMOFFLOAD |
 		     F_TCPCHECKSUMOFFLOAD | V_IPTTL(64));
@@ -2348,15 +2346,11 @@ static void tp_config(struct adapter *ad
 			 adap->params.rev > 0 ? F_ENABLEESND : F_T3A_ENABLEESND,
 			 0);
 
-	v = t3_read_reg(adap, A_TP_PC_CONFIG);
-	v &= ~(F_ENABLEEPCMDAFULL | F_ENABLEOCSPIFULL);
-	t3_write_reg(adap, A_TP_PC_CONFIG, v | F_TXDEFERENABLE |
-		     F_MODULATEUNIONMODE | F_HEARBEATDACK |
-		     F_TXCONGESTIONMODE | F_RXCONGESTIONMODE);
-
-	v = t3_read_reg(adap, A_TP_PC_CONFIG2);
-	v &= ~F_CHDRAFULL;
-	t3_write_reg(adap, A_TP_PC_CONFIG2, v);
+	t3_set_reg_field(adap, A_TP_PC_CONFIG,
+			 F_ENABLEEPCMDAFULL | F_ENABLEOCSPIFULL,
+			 F_TXDEFERENABLE | F_HEARBEATDACK | F_TXCONGESTIONMODE |
+			 F_RXCONGESTIONMODE);
+	t3_set_reg_field(adap, A_TP_PC_CONFIG2, F_CHDRAFULL, 0);
 
 	if (adap->params.rev > 0) {
 		tp_wr_indirect(adap, A_TP_EGRESS_CONFIG, F_REWRITEFORCETOSIZE);

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-01-31  3:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-31  3:44 [PATCH 5/10] cxgb3 - Clean up HW init routine Divy Le Ray

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).