diff options
author | Anirban Chakraborty <anirban.chakraborty@qlogic.com> | 2010-07-09 17:15:05 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-07-10 04:41:58 +0400 |
commit | 132ff00a0fdea43708639d84ab3b42bb106410d7 (patch) | |
tree | 020c3254753286c59a5d17757d2d05fce243abce /drivers | |
parent | ac8d0c4feb5577a830bbf1d9a3bb5b1d30298e2c (diff) | |
download | linux-132ff00a0fdea43708639d84ab3b42bb106410d7.tar.xz |
qlcnic: Disable admin tools interface for VF driver mode
Non privileged (VF) driver will not be able to carry out any of the FW update,
etc. operations. Disable the tools interface by not creating the sysfs nodes.
Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/qlcnic/qlcnic_main.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c index c334f1a0a2a4..4d1831350efa 100644 --- a/drivers/net/qlcnic/qlcnic_main.c +++ b/drivers/net/qlcnic/qlcnic_main.c @@ -3272,6 +3272,8 @@ qlcnic_create_diag_entries(struct qlcnic_adapter *adapter) { struct device *dev = &adapter->pdev->dev; + if (adapter->op_mode == QLCNIC_NON_PRIV_FUNC) + return; if (device_create_file(dev, &dev_attr_diag_mode)) dev_info(dev, "failed to create diag_mode sysfs entry\n"); if (device_create_bin_file(dev, &bin_attr_crb)) @@ -3292,12 +3294,13 @@ qlcnic_create_diag_entries(struct qlcnic_adapter *adapter) } - static void qlcnic_remove_diag_entries(struct qlcnic_adapter *adapter) { struct device *dev = &adapter->pdev->dev; + if (adapter->op_mode == QLCNIC_NON_PRIV_FUNC) + return; device_remove_file(dev, &dev_attr_diag_mode); device_remove_bin_file(dev, &bin_attr_crb); device_remove_bin_file(dev, &bin_attr_mem); |