From: Patrick McHardy <kaber@trash.net>
To: Stephen Hemminger <shemminger@osdl.org>
Cc: Linux Netdev List <netdev@vger.kernel.org>,
Ben Greear <greearb@candelatech.com>
Subject: [SKY2]: Fix VLAN unregistration
Date: Sun, 27 May 2007 20:44:04 +0200 [thread overview]
Message-ID: <4659D174.70301@trash.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 371 bytes --]
Fix sky2 disabling VLAN completely when the first vid is unregistered.
For some reason the VLAN code insists on the driver providing a
vlan_rx_kill_vid function even if only NETIF_F_HW_VLAN_RX and not
NETIF_F_HW_VLAN_FILTER is set, so this patch keeps an empty
function. This seems to be a bug though, vlan_rx_add_vid is only
required with NETIF_F_HW_VLAN_FILTER. Ben?
[-- Attachment #2: x --]
[-- Type: text/plain, Size: 2001 bytes --]
[SKY2]: Fix VLAN unregistration
sky2 disables VLAN completely when the first VID is unregistered. It
should instead disable VLAN when the group is unregistered by calling
sky2_vlan_rx_register with grp = NULL.
Signed-off-by: Patrick McHardy <kaber@trash.net>
---
commit 62d7f463e185a0b65915110d25d8c4c732e67c0a
tree dc6efd2d80b927bb45e0b33b33a7b5174d1bf05a
parent add81ec9b23f1fbe973093d5999a3d70e9d4c48b
author Patrick McHardy <kaber@trash.net> Sun, 27 May 2007 20:39:09 +0200
committer Patrick McHardy <kaber@trash.net> Sun, 27 May 2007 20:39:09 +0200
drivers/net/sky2.c | 25 ++++++++++++-------------
1 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 832fd69..c973def 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -1050,8 +1050,17 @@ static void sky2_vlan_rx_register(struct net_device *dev, struct vlan_group *grp
netif_tx_lock_bh(dev);
- sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T), RX_VLAN_STRIP_ON);
- sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), TX_VLAN_TAG_ON);
+ if (grp) {
+ sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T),
+ RX_VLAN_STRIP_ON);
+ sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T),
+ TX_VLAN_TAG_ON);
+ } else {
+ sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T),
+ RX_VLAN_STRIP_OFF);
+ sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T),
+ TX_VLAN_TAG_OFF);
+ }
sky2->vlgrp = grp;
netif_tx_unlock_bh(dev);
@@ -1059,17 +1068,7 @@ static void sky2_vlan_rx_register(struct net_device *dev, struct vlan_group *grp
static void sky2_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
{
- struct sky2_port *sky2 = netdev_priv(dev);
- struct sky2_hw *hw = sky2->hw;
- u16 port = sky2->port;
-
- netif_tx_lock_bh(dev);
-
- sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T), RX_VLAN_STRIP_OFF);
- sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), TX_VLAN_TAG_OFF);
- vlan_group_set_device(sky2->vlgrp, vid, NULL);
-
- netif_tx_unlock_bh(dev);
+ return;
}
#endif
next reply other threads:[~2007-05-27 18:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-27 18:44 Patrick McHardy [this message]
2007-05-28 21:42 ` [SKY2]: Fix VLAN unregistration Ben Greear
2007-05-29 10:57 ` Patrick McHardy
2007-05-29 17:16 ` Stephen Hemminger
2007-05-31 17:19 ` [PATCH]: sky2: " Stephen Hemminger
2007-05-31 17:37 ` Patrick McHardy
2007-05-31 18:21 ` Stephen Hemminger
2007-06-01 15:16 ` Patrick McHardy
2007-06-01 16:16 ` 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=4659D174.70301@trash.net \
--to=kaber@trash.net \
--cc=greearb@candelatech.com \
--cc=netdev@vger.kernel.org \
--cc=shemminger@osdl.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.