Commit 114fe5e3 authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Felix Fietkau

mt76: mt7603: remove query from mt7603_mcu_msg_send signature

Remove query parameter from mt7603_mcu_msg_send/__mt7603_mcu_msg_send
routine signature since it can be obtained from cmd value. This is a
preliminary patch for mcu code unification between mt7615 and mt7603
drivers
Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent b28e22bd
...@@ -14,8 +14,8 @@ struct mt7603_fw_trailer { ...@@ -14,8 +14,8 @@ struct mt7603_fw_trailer {
} __packed; } __packed;
static int static int
__mt7603_mcu_msg_send(struct mt7603_dev *dev, struct sk_buff *skb, int cmd, __mt7603_mcu_msg_send(struct mt7603_dev *dev, struct sk_buff *skb,
int query, int *wait_seq) int cmd, int *wait_seq)
{ {
int hdrlen = dev->mcu_running ? sizeof(struct mt7603_mcu_txd) : 12; int hdrlen = dev->mcu_running ? sizeof(struct mt7603_mcu_txd) : 12;
struct mt76_dev *mdev = &dev->mt76; struct mt76_dev *mdev = &dev->mt76;
...@@ -42,15 +42,14 @@ __mt7603_mcu_msg_send(struct mt7603_dev *dev, struct sk_buff *skb, int cmd, ...@@ -42,15 +42,14 @@ __mt7603_mcu_msg_send(struct mt7603_dev *dev, struct sk_buff *skb, int cmd,
if (cmd < 0) { if (cmd < 0) {
txd->cid = -cmd; txd->cid = -cmd;
txd->set_query = MCU_Q_NA;
} else { } else {
txd->cid = MCU_CMD_EXT_CID; txd->cid = MCU_CMD_EXT_CID;
txd->ext_cid = cmd; txd->ext_cid = cmd;
if (query != MCU_Q_NA) txd->set_query = MCU_Q_SET;
txd->ext_cid_ack = 1; txd->ext_cid_ack = 1;
} }
txd->set_query = query;
if (wait_seq) if (wait_seq)
*wait_seq = seq; *wait_seq = seq;
...@@ -58,8 +57,7 @@ __mt7603_mcu_msg_send(struct mt7603_dev *dev, struct sk_buff *skb, int cmd, ...@@ -58,8 +57,7 @@ __mt7603_mcu_msg_send(struct mt7603_dev *dev, struct sk_buff *skb, int cmd,
} }
static int static int
mt7603_mcu_msg_send(struct mt7603_dev *dev, struct sk_buff *skb, int cmd, mt7603_mcu_msg_send(struct mt7603_dev *dev, struct sk_buff *skb, int cmd)
int query)
{ {
struct mt76_dev *mdev = &dev->mt76; struct mt76_dev *mdev = &dev->mt76;
unsigned long expires = jiffies + 3 * HZ; unsigned long expires = jiffies + 3 * HZ;
...@@ -68,7 +66,7 @@ mt7603_mcu_msg_send(struct mt7603_dev *dev, struct sk_buff *skb, int cmd, ...@@ -68,7 +66,7 @@ mt7603_mcu_msg_send(struct mt7603_dev *dev, struct sk_buff *skb, int cmd,
mutex_lock(&mdev->mmio.mcu.mutex); mutex_lock(&mdev->mmio.mcu.mutex);
ret = __mt7603_mcu_msg_send(dev, skb, cmd, query, &seq); ret = __mt7603_mcu_msg_send(dev, skb, cmd, &seq);
if (ret) if (ret)
goto out; goto out;
...@@ -115,8 +113,7 @@ mt7603_mcu_init_download(struct mt7603_dev *dev, u32 addr, u32 len) ...@@ -115,8 +113,7 @@ mt7603_mcu_init_download(struct mt7603_dev *dev, u32 addr, u32 len)
}; };
struct sk_buff *skb = mt7603_mcu_msg_alloc(&req, sizeof(req)); struct sk_buff *skb = mt7603_mcu_msg_alloc(&req, sizeof(req));
return mt7603_mcu_msg_send(dev, skb, -MCU_CMD_TARGET_ADDRESS_LEN_REQ, return mt7603_mcu_msg_send(dev, skb, -MCU_CMD_TARGET_ADDRESS_LEN_REQ);
MCU_Q_NA);
} }
static int static int
...@@ -134,7 +131,7 @@ mt7603_mcu_send_firmware(struct mt7603_dev *dev, const void *data, int len) ...@@ -134,7 +131,7 @@ mt7603_mcu_send_firmware(struct mt7603_dev *dev, const void *data, int len)
return -ENOMEM; return -ENOMEM;
ret = __mt7603_mcu_msg_send(dev, skb, -MCU_CMD_FW_SCATTER, ret = __mt7603_mcu_msg_send(dev, skb, -MCU_CMD_FW_SCATTER,
MCU_Q_NA, NULL); NULL);
if (ret) if (ret)
break; break;
...@@ -157,8 +154,7 @@ mt7603_mcu_start_firmware(struct mt7603_dev *dev, u32 addr) ...@@ -157,8 +154,7 @@ mt7603_mcu_start_firmware(struct mt7603_dev *dev, u32 addr)
}; };
struct sk_buff *skb = mt7603_mcu_msg_alloc(&req, sizeof(req)); struct sk_buff *skb = mt7603_mcu_msg_alloc(&req, sizeof(req));
return mt7603_mcu_msg_send(dev, skb, -MCU_CMD_FW_START_REQ, return mt7603_mcu_msg_send(dev, skb, -MCU_CMD_FW_START_REQ);
MCU_Q_NA);
} }
static int static int
...@@ -166,8 +162,7 @@ mt7603_mcu_restart(struct mt7603_dev *dev) ...@@ -166,8 +162,7 @@ mt7603_mcu_restart(struct mt7603_dev *dev)
{ {
struct sk_buff *skb = mt7603_mcu_msg_alloc(NULL, 0); struct sk_buff *skb = mt7603_mcu_msg_alloc(NULL, 0);
return mt7603_mcu_msg_send(dev, skb, -MCU_CMD_RESTART_DL_REQ, return mt7603_mcu_msg_send(dev, skb, -MCU_CMD_RESTART_DL_REQ);
MCU_Q_NA);
} }
int mt7603_load_firmware(struct mt7603_dev *dev) int mt7603_load_firmware(struct mt7603_dev *dev)
...@@ -371,8 +366,7 @@ int mt7603_mcu_set_eeprom(struct mt7603_dev *dev) ...@@ -371,8 +366,7 @@ int mt7603_mcu_set_eeprom(struct mt7603_dev *dev)
data[i].pad = 0; data[i].pad = 0;
} }
return mt7603_mcu_msg_send(dev, skb, MCU_EXT_CMD_EFUSE_BUFFER_MODE, return mt7603_mcu_msg_send(dev, skb, MCU_EXT_CMD_EFUSE_BUFFER_MODE);
MCU_Q_SET);
} }
static int mt7603_mcu_set_tx_power(struct mt7603_dev *dev) static int mt7603_mcu_set_tx_power(struct mt7603_dev *dev)
...@@ -417,8 +411,7 @@ static int mt7603_mcu_set_tx_power(struct mt7603_dev *dev) ...@@ -417,8 +411,7 @@ static int mt7603_mcu_set_tx_power(struct mt7603_dev *dev)
sizeof(req.temp_comp_power)); sizeof(req.temp_comp_power));
skb = mt7603_mcu_msg_alloc(&req, sizeof(req)); skb = mt7603_mcu_msg_alloc(&req, sizeof(req));
return mt7603_mcu_msg_send(dev, skb, MCU_EXT_CMD_SET_TX_POWER_CTRL, return mt7603_mcu_msg_send(dev, skb, MCU_EXT_CMD_SET_TX_POWER_CTRL);
MCU_Q_SET);
} }
int mt7603_mcu_set_channel(struct mt7603_dev *dev) int mt7603_mcu_set_channel(struct mt7603_dev *dev)
...@@ -466,8 +459,7 @@ int mt7603_mcu_set_channel(struct mt7603_dev *dev) ...@@ -466,8 +459,7 @@ int mt7603_mcu_set_channel(struct mt7603_dev *dev)
req.txpower[i] = tx_power; req.txpower[i] = tx_power;
skb = mt7603_mcu_msg_alloc(&req, sizeof(req)); skb = mt7603_mcu_msg_alloc(&req, sizeof(req));
ret = mt7603_mcu_msg_send(dev, skb, MCU_EXT_CMD_CHANNEL_SWITCH, ret = mt7603_mcu_msg_send(dev, skb, MCU_EXT_CMD_CHANNEL_SWITCH);
MCU_Q_SET);
if (ret) if (ret)
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment