qlcnic: fix internal loopback test
authorSucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Mon, 17 May 2010 01:22:12 +0000 (01:22 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 18 May 2010 00:30:55 +0000 (17:30 -0700)
Reset/set DEV_UP bit during allocation and deallocation of resources.

Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/qlcnic/qlcnic_main.c

index b076474..dde1e8a 100644 (file)
@@ -870,6 +870,7 @@ void qlcnic_diag_free_res(struct net_device *netdev, int max_sds_rings)
        struct qlcnic_host_sds_ring *sds_ring;
        int ring;
 
+       clear_bit(__QLCNIC_DEV_UP, &adapter->state);
        if (adapter->diag_test == QLCNIC_INTERRUPT_TEST) {
                for (ring = 0; ring < adapter->max_sds_rings; ring++) {
                        sds_ring = &adapter->recv_ctx.sds_rings[ring];
@@ -920,6 +921,7 @@ int qlcnic_diag_alloc_res(struct net_device *netdev, int test)
                        qlcnic_enable_int(sds_ring);
                }
        }
+       set_bit(__QLCNIC_DEV_UP, &adapter->state);
 
        return 0;
 }