testmode.c (1758047057dbe329be712a31b79db7151b5871f8) testmode.c (680a2ead741ad9b479a53adf154ed5eee74d2b9a)
1// SPDX-License-Identifier: ISC
2
3#include "mt7921.h"
4#include "mcu.h"
5
6enum mt7921_testmode_attr {
7 MT7921_TM_ATTR_UNSPEC,
8 MT7921_TM_ATTR_SET,

--- 52 unchanged lines hidden (view full) ---

61
62 mt76_wr(dev, MT_WF_RFCR(0), dev->mt76.rxfilter);
63 phy->test.state = MT76_TM_STATE_ON;
64 }
65
66 if (!mt76_testmode_enabled(phy))
67 goto out;
68
1// SPDX-License-Identifier: ISC
2
3#include "mt7921.h"
4#include "mcu.h"
5
6enum mt7921_testmode_attr {
7 MT7921_TM_ATTR_UNSPEC,
8 MT7921_TM_ATTR_SET,

--- 52 unchanged lines hidden (view full) ---

61
62 mt76_wr(dev, MT_WF_RFCR(0), dev->mt76.rxfilter);
63 phy->test.state = MT76_TM_STATE_ON;
64 }
65
66 if (!mt76_testmode_enabled(phy))
67 goto out;
68
69 ret = mt76_mcu_send_msg(&dev->mt76, MCU_CMD_TEST_CTRL, &cmd,
69 ret = mt76_mcu_send_msg(&dev->mt76, MCU_CE_CMD(TEST_CTRL), &cmd,
70 sizeof(cmd), false);
71 if (ret)
72 goto out;
73
74 if (normal) {
75 /* Switch back to the normal world */
76 phy->test.state = MT76_TM_STATE_OFF;
77 pm->enable = true;

--- 12 unchanged lines hidden (view full) ---

90 .action = req->action,
91 .param0 = cpu_to_le32(req->param0),
92 .param1 = cpu_to_le32(req->param1),
93 };
94 struct mt7921_rftest_evt *evt;
95 struct sk_buff *skb;
96 int ret;
97
70 sizeof(cmd), false);
71 if (ret)
72 goto out;
73
74 if (normal) {
75 /* Switch back to the normal world */
76 phy->test.state = MT76_TM_STATE_OFF;
77 pm->enable = true;

--- 12 unchanged lines hidden (view full) ---

90 .action = req->action,
91 .param0 = cpu_to_le32(req->param0),
92 .param1 = cpu_to_le32(req->param1),
93 };
94 struct mt7921_rftest_evt *evt;
95 struct sk_buff *skb;
96 int ret;
97
98 ret = mt76_mcu_send_and_get_msg(&dev->mt76, MCU_CMD_TEST_CTRL,
98 ret = mt76_mcu_send_and_get_msg(&dev->mt76, MCU_CE_CMD(TEST_CTRL),
99 &cmd, sizeof(cmd), true, &skb);
100 if (ret)
101 goto out;
102
103 evt = (struct mt7921_rftest_evt *)skb->data;
104 evt_resp->param0 = le32_to_cpu(evt->param0);
105 evt_resp->param1 = le32_to_cpu(evt->param1);
106out:

--- 91 unchanged lines hidden ---
99 &cmd, sizeof(cmd), true, &skb);
100 if (ret)
101 goto out;
102
103 evt = (struct mt7921_rftest_evt *)skb->data;
104 evt_resp->param0 = le32_to_cpu(evt->param0);
105 evt_resp->param1 = le32_to_cpu(evt->param1);
106out:

--- 91 unchanged lines hidden ---