mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Einon <mark.einon@gmail.com>
To: gregkh@suse.de
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	o.hartmann@telovital.com, alan@linux.intel.com,
	Mark Einon <mark.einon@gmail.com>
Subject: [PATCH 3/8] staging: et131x: Remove adapter->bmsr, replace with phydev equivalents
Date: Sat,  1 Oct 2011 11:14:12 +0100	[thread overview]
Message-ID: <1317464057-18231-3-git-send-email-mark.einon@gmail.com> (raw)
In-Reply-To: <1317464057-18231-1-git-send-email-mark.einon@gmail.com>

adapter->bmsr is no longer being updated, but is also used to check the link state in places.

Remove bmsr from adapter, and replace link state checks with phydev->link check.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
---
 drivers/staging/et131x/et1310_phy.c     |    3 ---
 drivers/staging/et131x/et131x_adapter.h |    3 ---
 drivers/staging/et131x/et131x_initpci.c |    7 +++----
 3 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/et131x/et1310_phy.c b/drivers/staging/et131x/et1310_phy.c
index fc37b18..a72046b 100644
--- a/drivers/staging/et131x/et1310_phy.c
+++ b/drivers/staging/et131x/et1310_phy.c
@@ -337,9 +337,6 @@ void et131x_xcvr_init(struct et131x_adapter *adapter)
 	u16 isr;
 	u16 lcr2;
 
-	/* Zero out the adapter structure variable representing BMSR */
-	adapter->bmsr = 0;
-
 	et131x_mii_read(adapter, PHY_INTERRUPT_STATUS, &isr);
 	et131x_mii_read(adapter, PHY_INTERRUPT_MASK, &imr);
 
diff --git a/drivers/staging/et131x/et131x_adapter.h b/drivers/staging/et131x/et131x_adapter.h
index fabc2c5..b5195ef 100644
--- a/drivers/staging/et131x/et131x_adapter.h
+++ b/drivers/staging/et131x/et131x_adapter.h
@@ -201,9 +201,6 @@ struct et131x_adapter {
 	u16 pdown_speed;
 	u8 pdown_duplex;
 
-	/* Xcvr status at last poll */
-	u16 bmsr;
-
 	/* Tx Memory Variables */
 	struct tx_ring tx_ring;
 
diff --git a/drivers/staging/et131x/et131x_initpci.c b/drivers/staging/et131x/et131x_initpci.c
index 667ab80..10283a3 100644
--- a/drivers/staging/et131x/et131x_initpci.c
+++ b/drivers/staging/et131x/et131x_initpci.c
@@ -239,19 +239,18 @@ static int et131x_pci_init(struct et131x_adapter *adapter,
 void et131x_error_timer_handler(unsigned long data)
 {
 	struct et131x_adapter *adapter = (struct et131x_adapter *) data;
+	struct phy_device *phydev = adapter->phydev;
 
 	if (!et1310_in_phy_coma(adapter))
 		et1310_update_macstat_host_counters(adapter);
 	else
 		dev_err(&adapter->pdev->dev, "No interrupts, in PHY coma\n");
 
-	if (!(adapter->bmsr & BMSR_LSTATUS) &&
-	    adapter->boot_coma < 11) {
+	if (!phydev->link && adapter->boot_coma < 11)
 		adapter->boot_coma++;
-	}
 
 	if (adapter->boot_coma == 10) {
-		if (!(adapter->bmsr & BMSR_LSTATUS)) {
+		if (!phydev->link) {
 			if (!et1310_in_phy_coma(adapter)) {
 				/* NOTE - This was originally a 'sync with
 				 *  interrupt'. How to do that under Linux?
-- 
1.7.6.4


  parent reply	other threads:[~2011-10-01 10:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-01 10:14 [PATCH 1/8] staging: et131x: Remove TODO entry 'alloc_etherdev initilising memory with zero' Mark Einon
2011-10-01 10:14 ` [PATCH 2/8] staging: et131x: Introduce et1310_in_phy_coma() call Mark Einon
2011-10-01 10:14 ` Mark Einon [this message]
2011-10-01 10:14 ` [PATCH 4/8] staging: et131x: Add pci suspend & resume functions Mark Einon
2011-10-01 11:03   ` Francois Romieu
2011-10-01 14:02     ` Mark Einon
2011-10-01 19:36       ` Francois Romieu
2011-10-01 10:14 ` [PATCH 5/8] staging: et131x: Fix add_timer() from et131x_open Mark Einon
2011-10-01 10:14 ` [PATCH 6/8] staging: et131x: Update TODO file for kernel parameters Mark Einon
2011-10-01 10:14 ` [PATCH 7/8] staging: et131x: Updating copyright statements and module authors Mark Einon
2011-10-01 19:58   ` Dan Carpenter
2011-10-02 18:54     ` Mark Einon
2011-10-01 10:14 ` [PATCH 8/8] staging: et131x: Fix indefinite low power sleep 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=1317464057-18231-3-git-send-email-mark.einon@gmail.com \
    --to=mark.einon@gmail.com \
    --cc=alan@linux.intel.com \
    --cc=devel@driverdev.osuosl.org \
    --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