mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-16 16:54:20 +08:00
sky2: restore vlan acceleration on reset
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> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
This commit is contained in:
parent
8757a5f715
commit
d494eacde8
@ -1159,17 +1159,9 @@ static int sky2_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SKY2_VLAN_TAG_USED
|
#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);
|
if (onoff) {
|
||||||
struct sky2_hw *hw = sky2->hw;
|
|
||||||
u16 port = sky2->port;
|
|
||||||
|
|
||||||
netif_tx_lock_bh(dev);
|
|
||||||
napi_disable(&hw->napi);
|
|
||||||
|
|
||||||
sky2->vlgrp = grp;
|
|
||||||
if (grp) {
|
|
||||||
sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T),
|
sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T),
|
||||||
RX_VLAN_STRIP_ON);
|
RX_VLAN_STRIP_ON);
|
||||||
sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T),
|
sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T),
|
||||||
@ -1180,6 +1172,19 @@ static void sky2_vlan_rx_register(struct net_device *dev, struct vlan_group *grp
|
|||||||
sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T),
|
sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T),
|
||||||
TX_VLAN_TAG_OFF);
|
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);
|
sky2_read32(hw, B0_Y2_SP_LISR);
|
||||||
napi_enable(&hw->napi);
|
napi_enable(&hw->napi);
|
||||||
@ -1418,6 +1423,10 @@ static int sky2_up(struct net_device *dev)
|
|||||||
sky2_prefetch_init(hw, txqaddr[port], sky2->tx_le_map,
|
sky2_prefetch_init(hw, txqaddr[port], sky2->tx_le_map,
|
||||||
TX_RING_SIZE - 1);
|
TX_RING_SIZE - 1);
|
||||||
|
|
||||||
|
#ifdef SKY2_VLAN_TAG_USED
|
||||||
|
sky2_set_vlan_mode(hw, port, sky2->vlgrp != NULL);
|
||||||
|
#endif
|
||||||
|
|
||||||
err = sky2_rx_start(sky2);
|
err = sky2_rx_start(sky2);
|
||||||
if (err)
|
if (err)
|
||||||
goto err_out;
|
goto err_out;
|
||||||
|
Loading…
Reference in New Issue
Block a user