mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Einon <mark.einon@gmail.com>
To: gregkh@suse.de
Cc: greg@kroah.com, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org, o.hartmann@telovital.com,
	Mark Einon <mark.einon@gmail.com>
Subject: [PATCH 4/6] staging: et131x: Remove redundant replica loopback code
Date: Mon, 29 Aug 2011 18:42:39 +0100	[thread overview]
Message-ID: <1314639761-4947-4-git-send-email-mark.einon@gmail.com> (raw)
In-Reply-To: <1314639761-4947-1-git-send-email-mark.einon@gmail.com>

A mechanism used to set the phy in loopback mode is not present in the driver, making associated checks and variables redundant. Removing them.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
---
 drivers/staging/et131x/et1310_address_map.h |    6 +++---
 drivers/staging/et131x/et1310_rx.c          |   11 -----------
 drivers/staging/et131x/et131x_adapter.h     |    4 ----
 drivers/staging/et131x/et131x_isr.c         |   16 +++++++---------
 4 files changed, 10 insertions(+), 27 deletions(-)

diff --git a/drivers/staging/et131x/et1310_address_map.h b/drivers/staging/et131x/et1310_address_map.h
index 410677e..38ec56c 100644
--- a/drivers/staging/et131x/et1310_address_map.h
+++ b/drivers/staging/et131x/et1310_address_map.h
@@ -1,6 +1,6 @@
 /*
  * Agere Systems Inc.
- * 10/100/1000 Base-T Ethernet Driver for the ET1301 and ET131x series MACs
+ * 10/100/1000 Base-T Ethernet Driver for the ET1310 and ET131x series MACs
  *
  * Copyright © 2005 Agere Systems Inc.
  * All rights reserved.
@@ -149,7 +149,7 @@
  * GLOBAL Module of JAGCore Address Mapping
  * Located at address 0x0000
  */
-struct global_regs {			/* Location: */
+struct global_regs {				/* Location: */
 	u32 txq_start_addr;			/*  0x0000 */
 	u32 txq_end_addr;			/*  0x0004 */
 	u32 rxq_start_addr;			/*  0x0008 */
@@ -163,7 +163,7 @@ struct global_regs {			/* Location: */
 	u32 sw_reset;				/*  0x0028 */
 	u32 slv_timer;				/*  0x002C */
 	u32 msi_config;				/*  0x0030 */
-	u32 loopback;			/*  0x0034 */
+	u32 loopback;				/*  0x0034 */
 	u32 watchdog_timer;			/*  0x0038 */
 };
 
diff --git a/drivers/staging/et131x/et1310_rx.c b/drivers/staging/et131x/et1310_rx.c
index e6458db..f50420c 100644
--- a/drivers/staging/et131x/et1310_rx.c
+++ b/drivers/staging/et131x/et1310_rx.c
@@ -988,17 +988,6 @@ static struct rfd *nic_rx_pkts(struct et131x_adapter *adapter)
 	}
 
 	if (len) {
-		if (adapter->replica_phy_loopbk == 1) {
-			buf = rx_local->fbr[ring_index]->virt[buff_index];
-
-			if (memcmp(&buf[6], adapter->addr, ETH_ALEN) == 0) {
-				if (memcmp(&buf[42], "Replica packet",
-					   ETH_HLEN)) {
-					adapter->replica_phy_loopbk_passfail = 1;
-				}
-			}
-		}
-
 		/* Determine if this is a multicast packet coming in */
 		if ((word0 & ALCATEL_MULTICAST_PKT) &&
 		    !(word0 & ALCATEL_BROADCAST_PKT)) {
diff --git a/drivers/staging/et131x/et131x_adapter.h b/drivers/staging/et131x/et131x_adapter.h
index b03460b..508cc63 100644
--- a/drivers/staging/et131x/et131x_adapter.h
+++ b/drivers/staging/et131x/et131x_adapter.h
@@ -222,10 +222,6 @@ struct et131x_adapter {
 	/* Rx Memory Variables */
 	struct rx_ring rx_ring;
 
-	/* Loopback specifics */
-	u8 replica_phy_loopbk;		/* Replica Enable */
-	u8 replica_phy_loopbk_passfail;	/* Replica Enable Pass/Fail */
-
 	/* Stats */
 	struct ce_stats stats;
 
diff --git a/drivers/staging/et131x/et131x_isr.c b/drivers/staging/et131x/et131x_isr.c
index 7cfd213..4d75690 100644
--- a/drivers/staging/et131x/et131x_isr.c
+++ b/drivers/staging/et131x/et131x_isr.c
@@ -389,17 +389,15 @@ void et131x_isr_handler(struct work_struct *work)
 					(uint8_t) offsetof(struct mi_regs, isr),
 					&myisr);
 
-			if (!adapter->replica_phy_loopbk) {
-				et131x_mii_read(adapter,
-				       (uint8_t) offsetof(struct mi_regs, bmsr),
-				       &bmsr_data);
+			et131x_mii_read(adapter,
+			       (uint8_t) offsetof(struct mi_regs, bmsr),
+			       &bmsr_data);
 
-				bmsr_ints = adapter->bmsr ^ bmsr_data;
-				adapter->bmsr = bmsr_data;
+			bmsr_ints = adapter->bmsr ^ bmsr_data;
+			adapter->bmsr = bmsr_data;
 
-				/* Do all the cable in / cable out stuff */
-				et131x_mii_check(adapter, bmsr_data, bmsr_ints);
-			}
+			/* Do all the cable in / cable out stuff */
+			et131x_mii_check(adapter, bmsr_data, bmsr_ints);
 		}
 
 		/* Let's move on to the TxMac */
-- 
1.7.6


  parent reply	other threads:[~2011-08-29 17:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-29 17:42 [PATCH 1/6] staging: et131x: Further tidy up of 131x_pci_setup() Mark Einon
2011-08-29 17:42 ` [PATCH 2/6] MAINAINERS: Add details for drivers/staging/et131x Mark Einon
2011-08-29 17:42 ` [PATCH 3/6] staging: et131x: Remove unused xcvr_id in struct ce_stats Mark Einon
2011-08-29 17:42 ` Mark Einon [this message]
2011-08-30 10:08   ` [PATCH 4/6] staging: et131x: Remove redundant replica loopback code Dan Carpenter
2011-08-30 10:17     ` Alan Cox
2011-08-30 10:31       ` Mark Einon
2011-08-29 17:42 ` [PATCH 5/6] staging: et131x: Remove module_param et131x_speed_set Mark Einon
2011-08-29 17:42 ` [PATCH 6/6] staging: et131x: Use phy-device, mii_bus and ethtool_ops Mark Einon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1314639761-4947-4-git-send-email-mark.einon@gmail.com \
    --to=mark.einon@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=greg@kroah.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=o.hartmann@telovital.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome