|
@@ -65,7 +65,22 @@ static struct be_cmd_priv_map cmd_priv_map[] = {
|
|
|
CMD_SUBSYSTEM_COMMON,
|
|
|
BE_PRIV_LNKMGMT | BE_PRIV_VHADM |
|
|
|
BE_PRIV_DEVCFG | BE_PRIV_DEVSEC
|
|
|
- }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ OPCODE_LOWLEVEL_HOST_DDR_DMA,
|
|
|
+ CMD_SUBSYSTEM_LOWLEVEL,
|
|
|
+ BE_PRIV_DEVCFG | BE_PRIV_DEVSEC
|
|
|
+ },
|
|
|
+ {
|
|
|
+ OPCODE_LOWLEVEL_LOOPBACK_TEST,
|
|
|
+ CMD_SUBSYSTEM_LOWLEVEL,
|
|
|
+ BE_PRIV_DEVCFG | BE_PRIV_DEVSEC
|
|
|
+ },
|
|
|
+ {
|
|
|
+ OPCODE_LOWLEVEL_SET_LOOPBACK_MODE,
|
|
|
+ CMD_SUBSYSTEM_LOWLEVEL,
|
|
|
+ BE_PRIV_DEVCFG | BE_PRIV_DEVSEC
|
|
|
+ },
|
|
|
};
|
|
|
|
|
|
static bool be_cmd_allowed(struct be_adapter *adapter, u8 opcode, u8 subsystem)
|
|
@@ -3169,6 +3184,10 @@ int be_cmd_set_loopback(struct be_adapter *adapter, u8 port_num,
|
|
|
struct be_cmd_req_set_lmode *req;
|
|
|
int status;
|
|
|
|
|
|
+ if (!be_cmd_allowed(adapter, OPCODE_LOWLEVEL_SET_LOOPBACK_MODE,
|
|
|
+ CMD_SUBSYSTEM_LOWLEVEL))
|
|
|
+ return -EPERM;
|
|
|
+
|
|
|
spin_lock_bh(&adapter->mcc_lock);
|
|
|
|
|
|
wrb = wrb_from_mccq(adapter);
|
|
@@ -3214,6 +3233,10 @@ int be_cmd_loopback_test(struct be_adapter *adapter, u32 port_num,
|
|
|
struct be_cmd_resp_loopback_test *resp;
|
|
|
int status;
|
|
|
|
|
|
+ if (!be_cmd_allowed(adapter, OPCODE_LOWLEVEL_LOOPBACK_TEST,
|
|
|
+ CMD_SUBSYSTEM_LOWLEVEL))
|
|
|
+ return -EPERM;
|
|
|
+
|
|
|
spin_lock_bh(&adapter->mcc_lock);
|
|
|
|
|
|
wrb = wrb_from_mccq(adapter);
|
|
@@ -3260,6 +3283,10 @@ int be_cmd_ddr_dma_test(struct be_adapter *adapter, u64 pattern,
|
|
|
int status;
|
|
|
int i, j = 0;
|
|
|
|
|
|
+ if (!be_cmd_allowed(adapter, OPCODE_LOWLEVEL_HOST_DDR_DMA,
|
|
|
+ CMD_SUBSYSTEM_LOWLEVEL))
|
|
|
+ return -EPERM;
|
|
|
+
|
|
|
spin_lock_bh(&adapter->mcc_lock);
|
|
|
|
|
|
wrb = wrb_from_mccq(adapter);
|