aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bna/bnad.c
diff options
context:
space:
mode:
authorRasesh Mody <rmody@brocade.com>2010-12-23 16:45:08 -0500
committerDavid S. Miller <davem@davemloft.net>2010-12-25 22:16:02 -0500
commitaad75b66f1d3784514351f06bc589c55d5325bc8 (patch)
tree2b4ae30592b4a9597f42a6e91e61bc20930f12ae /drivers/net/bna/bnad.c
parentce9b9f383775e6de74ca4c93d5c643dc3d76dd3c (diff)
bna: Restore VLAN filter table
Change Details: - Retrieve the VLAN configuration from the networking stack and apply it to the base interface during ifconfig up Signed-off-by: Debashis Dutt <ddutt@brocade.com> Signed-off-by: Rasesh Mody <rmody@brocade.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bna/bnad.c')
-rw-r--r--drivers/net/bna/bnad.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/drivers/net/bna/bnad.c b/drivers/net/bna/bnad.c
index f77593638c57..140ea95b9150 100644
--- a/drivers/net/bna/bnad.c
+++ b/drivers/net/bna/bnad.c
@@ -566,7 +566,8 @@ bnad_enable_rx_irq(struct bnad *bnad, struct bna_ccb *ccb)
566{ 566{
567 unsigned long flags; 567 unsigned long flags;
568 568
569 spin_lock_irqsave(&bnad->bna_lock, flags); /* Because of polling context */ 569 /* Because of polling context */
570 spin_lock_irqsave(&bnad->bna_lock, flags);
570 bnad_enable_rx_irq_unsafe(ccb); 571 bnad_enable_rx_irq_unsafe(ccb);
571 spin_unlock_irqrestore(&bnad->bna_lock, flags); 572 spin_unlock_irqrestore(&bnad->bna_lock, flags);
572} 573}
@@ -1962,6 +1963,27 @@ bnad_enable_default_bcast(struct bnad *bnad)
1962 return 0; 1963 return 0;
1963} 1964}
1964 1965
1966/* Called with bnad_conf_lock() held */
1967static void
1968bnad_restore_vlans(struct bnad *bnad, u32 rx_id)
1969{
1970 u16 vlan_id;
1971 unsigned long flags;
1972
1973 if (!bnad->vlan_grp)
1974 return;
1975
1976 BUG_ON(!(VLAN_N_VID == (BFI_MAX_VLAN + 1)));
1977
1978 for (vlan_id = 0; vlan_id < VLAN_N_VID; vlan_id++) {
1979 if (!vlan_group_get_device(bnad->vlan_grp, vlan_id))
1980 continue;
1981 spin_lock_irqsave(&bnad->bna_lock, flags);
1982 bna_rx_vlan_add(bnad->rx_info[rx_id].rx, vlan_id);
1983 spin_unlock_irqrestore(&bnad->bna_lock, flags);
1984 }
1985}
1986
1965/* Statistics utilities */ 1987/* Statistics utilities */
1966void 1988void
1967bnad_netdev_qstats_fill(struct bnad *bnad, struct rtnl_link_stats64 *stats) 1989bnad_netdev_qstats_fill(struct bnad *bnad, struct rtnl_link_stats64 *stats)
@@ -2337,6 +2359,9 @@ bnad_open(struct net_device *netdev)
2337 /* Enable broadcast */ 2359 /* Enable broadcast */
2338 bnad_enable_default_bcast(bnad); 2360 bnad_enable_default_bcast(bnad);
2339 2361
2362 /* Restore VLANs, if any */
2363 bnad_restore_vlans(bnad, 0);
2364
2340 /* Set the UCAST address */ 2365 /* Set the UCAST address */
2341 spin_lock_irqsave(&bnad->bna_lock, flags); 2366 spin_lock_irqsave(&bnad->bna_lock, flags);
2342 bnad_mac_addr_set_locked(bnad, netdev->dev_addr); 2367 bnad_mac_addr_set_locked(bnad, netdev->dev_addr);
@@ -3021,7 +3046,7 @@ static int __devinit
3021bnad_pci_probe(struct pci_dev *pdev, 3046bnad_pci_probe(struct pci_dev *pdev,
3022 const struct pci_device_id *pcidev_id) 3047 const struct pci_device_id *pcidev_id)
3023{ 3048{
3024 bool using_dac; 3049 bool using_dac = false;
3025 int err; 3050 int err;
3026 struct bnad *bnad; 3051 struct bnad *bnad;
3027 struct bna *bna; 3052 struct bna *bna;