From: Stephen Hemminger <shemminger@vyatta•com>
To: David Miller <davem@davemloft•net>
Cc: netdev@vger•kernel.org, Mike McCormack <mikem@ring3k•org>
Subject: [PATCH 08/10] sky2: Refactor sky2_down into two functions
Date: Fri, 12 Feb 2010 08:58:05 -0800 [thread overview]
Message-ID: <20100212165938.074245846@vyatta.com> (raw)
In-Reply-To: 20100212165757.767062851@vyatta.com
[-- Attachment #1: sky2-mike4.patch --]
[-- Type: text/plain, Size: 1595 bytes --]
From: Mike McCormack <mikem@ring3k•org>
Create a sky2_hw_down that brings the hardware down.
Signed-off-by: Mike McCormack <mikem@ring3k•org>
Acked-by: Stephen Hemminber <shemminger@vyatta•com>
---
drivers/net/sky2.c | 28 +++++++++++++++++-----------
1 files changed, 17 insertions(+), 11 deletions(-)
--- a/drivers/net/sky2.c 2010-02-11 15:33:44.579670361 -0800
+++ b/drivers/net/sky2.c 2010-02-11 15:46:45.651858252 -0800
@@ -1908,21 +1908,12 @@ static void sky2_tx_reset(struct sky2_hw
sky2_write8(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_RST_SET);
}
-/* Network shutdown */
-static int sky2_down(struct net_device *dev)
+static void sky2_hw_down(struct sky2_port *sky2)
{
- struct sky2_port *sky2 = netdev_priv(dev);
struct sky2_hw *hw = sky2->hw;
unsigned port = sky2->port;
- u16 ctrl;
u32 imask;
-
- /* Never really got started! */
- if (!sky2->tx_le)
- return 0;
-
- if (netif_msg_ifdown(sky2))
- printk(KERN_INFO PFX "%s: disabling interface\n", dev->name);
+ u16 ctrl;
/* Force flow control off */
sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_PAUSE_OFF);
@@ -1972,6 +1963,21 @@ static int sky2_down(struct net_device *
/* Free any pending frames stuck in HW queue */
sky2_tx_complete(sky2, sky2->tx_prod);
+}
+
+/* Network shutdown */
+static int sky2_down(struct net_device *dev)
+{
+ struct sky2_port *sky2 = netdev_priv(dev);
+
+ /* Never really got started! */
+ if (!sky2->tx_le)
+ return 0;
+
+ if (netif_msg_ifdown(sky2))
+ printk(KERN_INFO PFX "%s: disabling interface\n", dev->name);
+
+ sky2_hw_down(sky2);
sky2_free_buffers(sky2);
--
next prev parent reply other threads:[~2010-02-12 17:08 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-12 16:57 [PATCH 00/10] sky2 update for net-next Stephen Hemminger
2010-02-12 16:57 ` [PATCH 01/10] sky2: fix sparse warning Stephen Hemminger
2010-02-12 16:57 ` [PATCH 02/10] sky2: WoL changes Stephen Hemminger
2010-02-12 16:58 ` [PATCH 03/10] sky2: dont enable PME legacy mode Stephen Hemminger
2010-02-12 16:58 ` [PATCH 04/10] sky2: jumbo packet changes Stephen Hemminger
2010-02-12 16:58 ` [PATCH 05/10] sky2: Factor out code to calculate packet sizes Stephen Hemminger
2010-02-12 16:58 ` [PATCH 06/10] sky2: Allocate initial skbs in sky2_alloc_buffers Stephen Hemminger
2010-02-12 16:58 ` [PATCH 07/10] sky2: Refactor sky2_up into two functions Stephen Hemminger
2010-02-12 16:58 ` Stephen Hemminger [this message]
2010-02-12 16:58 ` [PATCH 09/10] sky2: Avoid down and up during sky2_reset Stephen Hemminger
2010-02-12 16:58 ` [PATCH 10/10] sky2: version 1.27 Stephen Hemminger
2010-02-13 0:21 ` [PATCH 00/10] sky2 update for net-next David Miller
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=20100212165938.074245846@vyatta.com \
--to=shemminger@vyatta$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=mikem@ring3k$(echo .)org \
--cc=netdev@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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