mt7615: remove dest from mt7615_mcu_msg_send signature

Remove dest parameter from mt7615_mcu_msg_send/__mt7615_mcu_msg_send
routine signature since it can is always set to MCU_S2D_H2N

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
Lorenzo Bianconi 2019-05-04 17:29:01 +02:00 committed by Felix Fietkau
parent 27da3bfd31
commit 33d9ed728e

View File

@ -49,7 +49,7 @@ struct mt7615_fw_trailer {
#define FW_START_WORKING_PDA_CR4 BIT(2) #define FW_START_WORKING_PDA_CR4 BIT(2)
static int __mt7615_mcu_msg_send(struct mt7615_dev *dev, struct sk_buff *skb, static int __mt7615_mcu_msg_send(struct mt7615_dev *dev, struct sk_buff *skb,
int cmd, int dest, int *wait_seq) int cmd, int *wait_seq)
{ {
struct mt7615_mcu_txd *mcu_txd; struct mt7615_mcu_txd *mcu_txd;
u8 seq, q_idx, pkt_fmt; u8 seq, q_idx, pkt_fmt;
@ -102,7 +102,7 @@ static int __mt7615_mcu_msg_send(struct mt7615_dev *dev, struct sk_buff *skb,
mcu_txd->ext_cid = cmd; mcu_txd->ext_cid = cmd;
mcu_txd->ext_cid_ack = 1; mcu_txd->ext_cid_ack = 1;
} }
mcu_txd->s2d_index = dest; mcu_txd->s2d_index = MCU_S2D_H2N;
if (wait_seq) if (wait_seq)
*wait_seq = seq; *wait_seq = seq;
@ -117,7 +117,7 @@ static int __mt7615_mcu_msg_send(struct mt7615_dev *dev, struct sk_buff *skb,
static int static int
mt7615_mcu_msg_send(struct mt7615_dev *dev, struct sk_buff *skb, mt7615_mcu_msg_send(struct mt7615_dev *dev, struct sk_buff *skb,
int cmd, int dest, struct sk_buff **skb_ret) int cmd, struct sk_buff **skb_ret)
{ {
unsigned long expires = jiffies + 10 * HZ; unsigned long expires = jiffies + 10 * HZ;
struct mt7615_mcu_rxd *rxd; struct mt7615_mcu_rxd *rxd;
@ -125,7 +125,7 @@ mt7615_mcu_msg_send(struct mt7615_dev *dev, struct sk_buff *skb,
mutex_lock(&dev->mt76.mmio.mcu.mutex); mutex_lock(&dev->mt76.mmio.mcu.mutex);
ret = __mt7615_mcu_msg_send(dev, skb, cmd, dest, &seq); ret = __mt7615_mcu_msg_send(dev, skb, cmd, &seq);
if (ret) if (ret)
goto out; goto out;
@ -178,7 +178,7 @@ static int mt7615_mcu_init_download(struct mt7615_dev *dev, u32 addr,
struct sk_buff *skb = mt7615_mcu_msg_alloc(&req, sizeof(req)); struct sk_buff *skb = mt7615_mcu_msg_alloc(&req, sizeof(req));
return mt7615_mcu_msg_send(dev, skb, -MCU_CMD_TARGET_ADDRESS_LEN_REQ, return mt7615_mcu_msg_send(dev, skb, -MCU_CMD_TARGET_ADDRESS_LEN_REQ,
MCU_S2D_H2N, NULL); NULL);
} }
static int mt7615_mcu_send_firmware(struct mt7615_dev *dev, const void *data, static int mt7615_mcu_send_firmware(struct mt7615_dev *dev, const void *data,
@ -196,7 +196,7 @@ static int mt7615_mcu_send_firmware(struct mt7615_dev *dev, const void *data,
return -ENOMEM; return -ENOMEM;
ret = __mt7615_mcu_msg_send(dev, skb, -MCU_CMD_FW_SCATTER, ret = __mt7615_mcu_msg_send(dev, skb, -MCU_CMD_FW_SCATTER,
MCU_S2D_H2N, NULL); NULL);
if (ret) if (ret)
break; break;
@ -219,16 +219,14 @@ static int mt7615_mcu_start_firmware(struct mt7615_dev *dev, u32 addr,
}; };
struct sk_buff *skb = mt7615_mcu_msg_alloc(&req, sizeof(req)); struct sk_buff *skb = mt7615_mcu_msg_alloc(&req, sizeof(req));
return mt7615_mcu_msg_send(dev, skb, -MCU_CMD_FW_START_REQ, return mt7615_mcu_msg_send(dev, skb, -MCU_CMD_FW_START_REQ, NULL);
MCU_S2D_H2N, NULL);
} }
static int mt7615_mcu_restart(struct mt7615_dev *dev) static int mt7615_mcu_restart(struct mt7615_dev *dev)
{ {
struct sk_buff *skb = mt7615_mcu_msg_alloc(NULL, 0); struct sk_buff *skb = mt7615_mcu_msg_alloc(NULL, 0);
return mt7615_mcu_msg_send(dev, skb, -MCU_CMD_RESTART_DL_REQ, return mt7615_mcu_msg_send(dev, skb, -MCU_CMD_RESTART_DL_REQ, NULL);
MCU_S2D_H2N, NULL);
} }
static int mt7615_mcu_patch_sem_ctrl(struct mt7615_dev *dev, bool get) static int mt7615_mcu_patch_sem_ctrl(struct mt7615_dev *dev, bool get)
@ -248,7 +246,7 @@ static int mt7615_mcu_patch_sem_ctrl(struct mt7615_dev *dev, bool get)
int ret; int ret;
ret = mt7615_mcu_msg_send(dev, skb, -MCU_CMD_PATCH_SEM_CONTROL, ret = mt7615_mcu_msg_send(dev, skb, -MCU_CMD_PATCH_SEM_CONTROL,
MCU_S2D_H2N, &skb_ret); &skb_ret);
if (ret) if (ret)
goto out; goto out;
@ -270,8 +268,7 @@ static int mt7615_mcu_start_patch(struct mt7615_dev *dev)
}; };
struct sk_buff *skb = mt7615_mcu_msg_alloc(&req, sizeof(req)); struct sk_buff *skb = mt7615_mcu_msg_alloc(&req, sizeof(req));
return mt7615_mcu_msg_send(dev, skb, -MCU_CMD_PATCH_FINISH_REQ, return mt7615_mcu_msg_send(dev, skb, -MCU_CMD_PATCH_FINISH_REQ, NULL);
MCU_S2D_H2N, NULL);
} }
static int mt7615_driver_own(struct mt7615_dev *dev) static int mt7615_driver_own(struct mt7615_dev *dev)
@ -558,7 +555,7 @@ int mt7615_mcu_set_eeprom(struct mt7615_dev *dev)
data[off - MT_EE_NIC_CONF_0].val = eep[off]; data[off - MT_EE_NIC_CONF_0].val = eep[off];
return mt7615_mcu_msg_send(dev, skb, MCU_EXT_CMD_EFUSE_BUFFER_MODE, return mt7615_mcu_msg_send(dev, skb, MCU_EXT_CMD_EFUSE_BUFFER_MODE,
MCU_S2D_H2N, NULL); NULL);
} }
int mt7615_mcu_init_mac(struct mt7615_dev *dev) int mt7615_mcu_init_mac(struct mt7615_dev *dev)
@ -573,8 +570,7 @@ int mt7615_mcu_init_mac(struct mt7615_dev *dev)
}; };
struct sk_buff *skb = mt7615_mcu_msg_alloc(&req, sizeof(req)); struct sk_buff *skb = mt7615_mcu_msg_alloc(&req, sizeof(req));
return mt7615_mcu_msg_send(dev, skb, MCU_EXT_CMD_MAC_INIT_CTRL, return mt7615_mcu_msg_send(dev, skb, MCU_EXT_CMD_MAC_INIT_CTRL, NULL);
MCU_S2D_H2N, NULL);
} }
int mt7615_mcu_set_rts_thresh(struct mt7615_dev *dev, u32 val) int mt7615_mcu_set_rts_thresh(struct mt7615_dev *dev, u32 val)
@ -593,8 +589,7 @@ int mt7615_mcu_set_rts_thresh(struct mt7615_dev *dev, u32 val)
}; };
struct sk_buff *skb = mt7615_mcu_msg_alloc(&req, sizeof(req)); struct sk_buff *skb = mt7615_mcu_msg_alloc(&req, sizeof(req));
return mt7615_mcu_msg_send(dev, skb, MCU_EXT_CMD_PROTECT_CTRL, return mt7615_mcu_msg_send(dev, skb, MCU_EXT_CMD_PROTECT_CTRL, NULL);
MCU_S2D_H2N, NULL);
} }
int mt7615_mcu_set_wmm(struct mt7615_dev *dev, u8 queue, int mt7615_mcu_set_wmm(struct mt7615_dev *dev, u8 queue,
@ -632,8 +627,7 @@ int mt7615_mcu_set_wmm(struct mt7615_dev *dev, u8 queue,
} }
skb = mt7615_mcu_msg_alloc(&req, sizeof(req)); skb = mt7615_mcu_msg_alloc(&req, sizeof(req));
return mt7615_mcu_msg_send(dev, skb, MCU_EXT_CMD_EDCA_UPDATE, return mt7615_mcu_msg_send(dev, skb, MCU_EXT_CMD_EDCA_UPDATE, NULL);
MCU_S2D_H2N, NULL);
} }
int mt7615_mcu_ctrl_pm_state(struct mt7615_dev *dev, int enter) int mt7615_mcu_ctrl_pm_state(struct mt7615_dev *dev, int enter)
@ -663,8 +657,7 @@ int mt7615_mcu_ctrl_pm_state(struct mt7615_dev *dev, int enter)
}; };
struct sk_buff *skb = mt7615_mcu_msg_alloc(&req, sizeof(req)); struct sk_buff *skb = mt7615_mcu_msg_alloc(&req, sizeof(req));
return mt7615_mcu_msg_send(dev, skb, MCU_EXT_CMD_PM_STATE_CTRL, return mt7615_mcu_msg_send(dev, skb, MCU_EXT_CMD_PM_STATE_CTRL, NULL);
MCU_S2D_H2N, NULL);
} }
static int __mt7615_mcu_set_dev_info(struct mt7615_dev *dev, static int __mt7615_mcu_set_dev_info(struct mt7615_dev *dev,
@ -712,7 +705,7 @@ static int __mt7615_mcu_set_dev_info(struct mt7615_dev *dev,
memcpy(skb_push(skb, sizeof(req_hdr)), &req_hdr, sizeof(req_hdr)); memcpy(skb_push(skb, sizeof(req_hdr)), &req_hdr, sizeof(req_hdr));
return mt7615_mcu_msg_send(dev, skb, MCU_EXT_CMD_DEV_INFO_UPDATE, return mt7615_mcu_msg_send(dev, skb, MCU_EXT_CMD_DEV_INFO_UPDATE,
MCU_S2D_H2N, NULL); NULL);
} }
int mt7615_mcu_set_dev_info(struct mt7615_dev *dev, struct ieee80211_vif *vif, int mt7615_mcu_set_dev_info(struct mt7615_dev *dev, struct ieee80211_vif *vif,
@ -838,7 +831,7 @@ static int __mt7615_mcu_set_bss_info(struct mt7615_dev *dev,
bss_info_tag_handler[i].handler(dev, bss_info, skb); bss_info_tag_handler[i].handler(dev, bss_info, skb);
return mt7615_mcu_msg_send(dev, skb, MCU_EXT_CMD_BSS_INFO_UPDATE, return mt7615_mcu_msg_send(dev, skb, MCU_EXT_CMD_BSS_INFO_UPDATE,
MCU_S2D_H2N, NULL); NULL);
} }
int mt7615_mcu_set_bss_info(struct mt7615_dev *dev, int mt7615_mcu_set_bss_info(struct mt7615_dev *dev,
@ -921,8 +914,7 @@ __mt7615_mcu_set_wtbl(struct mt7615_dev *dev, int wlan_idx,
if (buf && buf_len) if (buf && buf_len)
memcpy(skb_put(skb, buf_len), buf, buf_len); memcpy(skb_put(skb, buf_len), buf, buf_len);
return mt7615_mcu_msg_send(dev, skb, MCU_EXT_CMD_WTBL_UPDATE, return mt7615_mcu_msg_send(dev, skb, MCU_EXT_CMD_WTBL_UPDATE, NULL);
MCU_S2D_H2N, NULL);
} }
static enum mt7615_cipher_type static enum mt7615_cipher_type
@ -1100,8 +1092,7 @@ __mt7615_mcu_set_sta_rec(struct mt7615_dev *dev, int bss_idx,
if (buf && buf_len) if (buf && buf_len)
memcpy(skb_put(skb, buf_len), buf, buf_len); memcpy(skb_put(skb, buf_len), buf, buf_len);
return mt7615_mcu_msg_send(dev, skb, MCU_EXT_CMD_STA_REC_UPDATE, return mt7615_mcu_msg_send(dev, skb, MCU_EXT_CMD_STA_REC_UPDATE, NULL);
MCU_S2D_H2N, NULL);
} }
int mt7615_mcu_set_sta_rec_bmc(struct mt7615_dev *dev, int mt7615_mcu_set_sta_rec_bmc(struct mt7615_dev *dev,
@ -1229,8 +1220,7 @@ int mt7615_mcu_set_bcn(struct mt7615_dev *dev, struct ieee80211_vif *vif,
dev_kfree_skb(skb); dev_kfree_skb(skb);
skb = mt7615_mcu_msg_alloc(&req, sizeof(req)); skb = mt7615_mcu_msg_alloc(&req, sizeof(req));
return mt7615_mcu_msg_send(dev, skb, MCU_EXT_CMD_BCN_OFFLOAD, return mt7615_mcu_msg_send(dev, skb, MCU_EXT_CMD_BCN_OFFLOAD, NULL);
MCU_S2D_H2N, NULL);
} }
int mt7615_mcu_set_channel(struct mt7615_dev *dev) int mt7615_mcu_set_channel(struct mt7615_dev *dev)
@ -1295,14 +1285,12 @@ int mt7615_mcu_set_channel(struct mt7615_dev *dev)
memset(req.txpower_sku, 0x3f, 49); memset(req.txpower_sku, 0x3f, 49);
skb = mt7615_mcu_msg_alloc(&req, sizeof(req)); skb = mt7615_mcu_msg_alloc(&req, sizeof(req));
ret = mt7615_mcu_msg_send(dev, skb, MCU_EXT_CMD_CHANNEL_SWITCH, ret = mt7615_mcu_msg_send(dev, skb, MCU_EXT_CMD_CHANNEL_SWITCH, NULL);
MCU_S2D_H2N, NULL);
if (ret) if (ret)
return ret; return ret;
skb = mt7615_mcu_msg_alloc(&req, sizeof(req)); skb = mt7615_mcu_msg_alloc(&req, sizeof(req));
return mt7615_mcu_msg_send(dev, skb, MCU_EXT_CMD_SET_RX_PATH, return mt7615_mcu_msg_send(dev, skb, MCU_EXT_CMD_SET_RX_PATH, NULL);
MCU_S2D_H2N, NULL);
} }
int mt7615_mcu_set_ht_cap(struct mt7615_dev *dev, struct ieee80211_vif *vif, int mt7615_mcu_set_ht_cap(struct mt7615_dev *dev, struct ieee80211_vif *vif,