public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta•com>
To: Jeff Garzik <jgarzik@pobox•com>
Cc: netdev@vger•kernel.org
Subject: [PATCH 1/5] sky2: restore vlan acceleration on reset
Date: Wed, 14 May 2008 17:04:13 -0700	[thread overview]
Message-ID: <20080515000432.887028646@vyatta.com> (raw)
In-Reply-To: 20080515000412.984337700@vyatta.com

[-- Attachment #1: sky2-vlan-restore.patch --]
[-- Type: text/plain, Size: 1720 bytes --]

If device has to be reset by sky2_restart, then need to restore
the VLAN acceleration settings.

Signed-off-by: Stephen Hemminger <shemminger@vyatta•com>

---
Please apply to 2.6.26


--- a/drivers/net/sky2.c	2008-05-14 16:28:22.000000000 -0700
+++ b/drivers/net/sky2.c	2008-05-14 16:29:39.000000000 -0700
@@ -1159,17 +1159,9 @@ static int sky2_ioctl(struct net_device 
 }
 
 #ifdef SKY2_VLAN_TAG_USED
-static void sky2_vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
+static void sky2_set_vlan_mode(struct sky2_hw *hw, u16 port, bool onoff)
 {
-	struct sky2_port *sky2 = netdev_priv(dev);
-	struct sky2_hw *hw = sky2->hw;
-	u16 port = sky2->port;
-
-	netif_tx_lock_bh(dev);
-	napi_disable(&hw->napi);
-
-	sky2->vlgrp = grp;
-	if (grp) {
+	if (onoff) {
 		sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T),
 			     RX_VLAN_STRIP_ON);
 		sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T),
@@ -1180,6 +1172,19 @@ static void sky2_vlan_rx_register(struct
 		sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T),
 			     TX_VLAN_TAG_OFF);
 	}
+}
+
+static void sky2_vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
+{
+	struct sky2_port *sky2 = netdev_priv(dev);
+	struct sky2_hw *hw = sky2->hw;
+	u16 port = sky2->port;
+
+	netif_tx_lock_bh(dev);
+	napi_disable(&hw->napi);
+
+	sky2->vlgrp = grp;
+	sky2_set_vlan_mode(hw, port, grp != NULL);
 
 	sky2_read32(hw, B0_Y2_SP_LISR);
 	napi_enable(&hw->napi);
@@ -1418,6 +1423,10 @@ static int sky2_up(struct net_device *de
 	sky2_prefetch_init(hw, txqaddr[port], sky2->tx_le_map,
 			   TX_RING_SIZE - 1);
 
+#ifdef SKY2_VLAN_TAG_USED
+	sky2_set_vlan_mode(hw, port, sky2->vlgrp != NULL);
+#endif
+
 	err = sky2_rx_start(sky2);
 	if (err)
 		goto err_out;

-- 


  reply	other threads:[~2008-05-15  0:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-15  0:04 [PATCH 0/5] sky2: driver update Stephen Hemminger
2008-05-15  0:04 ` Stephen Hemminger [this message]
2008-05-21 17:02   ` [PATCH 1/5] sky2: restore vlan acceleration on reset Stephen Hemminger
2008-05-21 17:12     ` Jeff Garzik
2008-05-22 10:01   ` Jeff Garzik
2008-05-15  0:04 ` [PATCH 2/5] sky2: don't warn if page allocation fails Stephen Hemminger
2008-05-22  9:57   ` Jeff Garzik
2008-05-27 18:47     ` Stephen Hemminger
2008-06-03  6:16       ` Nick Piggin
2008-05-15  0:04 ` [PATCH 3/5] sky2: split phy power into two functions Stephen Hemminger
2008-05-31  2:20   ` Jeff Garzik
2008-05-15  0:04 ` [PATCH 4/5] sky2: put PHY in sleep when down Stephen Hemminger
2008-05-15  0:04 ` [PATCH 5/5] sky2: pci power savings Stephen Hemminger

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=20080515000432.887028646@vyatta.com \
    --to=shemminger@vyatta$(echo .)com \
    --cc=jgarzik@pobox$(echo .)com \
    --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