Commit cb5cdd4c authored by Felix Fietkau's avatar Felix Fietkau

mt76: rename __mt76_mcu_send_msg to mt76_mcu_send_msg

Preparation for further cleanup
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 9b60eb90
...@@ -685,9 +685,8 @@ enum mt76_phy_type { ...@@ -685,9 +685,8 @@ enum mt76_phy_type {
#define mt76_wr_rp(dev, ...) (dev)->mt76.bus->wr_rp(&((dev)->mt76), __VA_ARGS__) #define mt76_wr_rp(dev, ...) (dev)->mt76.bus->wr_rp(&((dev)->mt76), __VA_ARGS__)
#define mt76_rd_rp(dev, ...) (dev)->mt76.bus->rd_rp(&((dev)->mt76), __VA_ARGS__) #define mt76_rd_rp(dev, ...) (dev)->mt76.bus->rd_rp(&((dev)->mt76), __VA_ARGS__)
#define mt76_mcu_send_msg(dev, ...) (dev)->mt76.mcu_ops->mcu_send_msg(&((dev)->mt76), __VA_ARGS__)
#define __mt76_mcu_send_msg(dev, ...) (dev)->mcu_ops->mcu_send_msg((dev), __VA_ARGS__) #define mt76_mcu_send_msg(dev, ...) (dev)->mcu_ops->mcu_send_msg((dev), __VA_ARGS__)
#define __mt76_mcu_skb_send_msg(dev, ...) (dev)->mcu_ops->mcu_skb_send_msg((dev), __VA_ARGS__) #define __mt76_mcu_skb_send_msg(dev, ...) (dev)->mcu_ops->mcu_skb_send_msg((dev), __VA_ARGS__)
#define mt76_mcu_restart(dev, ...) (dev)->mt76.mcu_ops->mcu_restart(&((dev)->mt76)) #define mt76_mcu_restart(dev, ...) (dev)->mt76.mcu_ops->mcu_restart(&((dev)->mt76))
#define __mt76_mcu_restart(dev, ...) (dev)->mcu_ops->mcu_restart((dev)) #define __mt76_mcu_restart(dev, ...) (dev)->mcu_ops->mcu_restart((dev))
......
...@@ -114,8 +114,8 @@ mt7603_mcu_init_download(struct mt7603_dev *dev, u32 addr, u32 len) ...@@ -114,8 +114,8 @@ mt7603_mcu_init_download(struct mt7603_dev *dev, u32 addr, u32 len)
.mode = cpu_to_le32(BIT(31)), .mode = cpu_to_le32(BIT(31)),
}; };
return __mt76_mcu_send_msg(&dev->mt76, -MCU_CMD_TARGET_ADDRESS_LEN_REQ, return mt76_mcu_send_msg(&dev->mt76, -MCU_CMD_TARGET_ADDRESS_LEN_REQ,
&req, sizeof(req), true); &req, sizeof(req), true);
} }
static int static int
...@@ -127,8 +127,8 @@ mt7603_mcu_send_firmware(struct mt7603_dev *dev, const void *data, int len) ...@@ -127,8 +127,8 @@ mt7603_mcu_send_firmware(struct mt7603_dev *dev, const void *data, int len)
cur_len = min_t(int, 4096 - sizeof(struct mt7603_mcu_txd), cur_len = min_t(int, 4096 - sizeof(struct mt7603_mcu_txd),
len); len);
ret = __mt76_mcu_send_msg(&dev->mt76, -MCU_CMD_FW_SCATTER, ret = mt76_mcu_send_msg(&dev->mt76, -MCU_CMD_FW_SCATTER, data,
data, cur_len, false); cur_len, false);
if (ret) if (ret)
break; break;
...@@ -150,15 +150,14 @@ mt7603_mcu_start_firmware(struct mt7603_dev *dev, u32 addr) ...@@ -150,15 +150,14 @@ mt7603_mcu_start_firmware(struct mt7603_dev *dev, u32 addr)
.addr = cpu_to_le32(addr), .addr = cpu_to_le32(addr),
}; };
return __mt76_mcu_send_msg(&dev->mt76, -MCU_CMD_FW_START_REQ, return mt76_mcu_send_msg(&dev->mt76, -MCU_CMD_FW_START_REQ, &req,
&req, sizeof(req), true); sizeof(req), true);
} }
static int static int
mt7603_mcu_restart(struct mt76_dev *dev) mt7603_mcu_restart(struct mt76_dev *dev)
{ {
return __mt76_mcu_send_msg(dev, -MCU_CMD_RESTART_DL_REQ, return mt76_mcu_send_msg(dev, -MCU_CMD_RESTART_DL_REQ, NULL, 0, true);
NULL, 0, true);
} }
static int mt7603_load_firmware(struct mt7603_dev *dev) static int mt7603_load_firmware(struct mt7603_dev *dev)
...@@ -377,8 +376,8 @@ int mt7603_mcu_set_eeprom(struct mt7603_dev *dev) ...@@ -377,8 +376,8 @@ int mt7603_mcu_set_eeprom(struct mt7603_dev *dev)
data[i].val = eep[req_fields[i]]; data[i].val = eep[req_fields[i]];
} }
ret = __mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_EFUSE_BUFFER_MODE, ret = mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_EFUSE_BUFFER_MODE,
req, len, true); req, len, true);
kfree(req); kfree(req);
return ret; return ret;
...@@ -424,8 +423,8 @@ static int mt7603_mcu_set_tx_power(struct mt7603_dev *dev) ...@@ -424,8 +423,8 @@ static int mt7603_mcu_set_tx_power(struct mt7603_dev *dev)
memcpy(req.temp_comp_power, eep + MT_EE_STEP_NUM_NEG_6_7, memcpy(req.temp_comp_power, eep + MT_EE_STEP_NUM_NEG_6_7,
sizeof(req.temp_comp_power)); sizeof(req.temp_comp_power));
return __mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_SET_TX_POWER_CTRL, return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_SET_TX_POWER_CTRL,
&req, sizeof(req), true); &req, sizeof(req), true);
} }
int mt7603_mcu_set_channel(struct mt7603_dev *dev) int mt7603_mcu_set_channel(struct mt7603_dev *dev)
...@@ -470,8 +469,8 @@ int mt7603_mcu_set_channel(struct mt7603_dev *dev) ...@@ -470,8 +469,8 @@ int mt7603_mcu_set_channel(struct mt7603_dev *dev)
for (i = 0; i < ARRAY_SIZE(req.txpower); i++) for (i = 0; i < ARRAY_SIZE(req.txpower); i++)
req.txpower[i] = tx_power; req.txpower[i] = tx_power;
ret = __mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_CHANNEL_SWITCH, ret = mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_CHANNEL_SWITCH, &req,
&req, sizeof(req), true); sizeof(req), true);
if (ret) if (ret)
return ret; return ret;
......
...@@ -89,7 +89,8 @@ int mt76x02_mcu_function_select(struct mt76x02_dev *dev, enum mcu_function func, ...@@ -89,7 +89,8 @@ int mt76x02_mcu_function_select(struct mt76x02_dev *dev, enum mcu_function func,
if (func != Q_SELECT) if (func != Q_SELECT)
wait = true; wait = true;
return mt76_mcu_send_msg(dev, CMD_FUN_SET_OP, &msg, sizeof(msg), wait); return mt76_mcu_send_msg(&dev->mt76, CMD_FUN_SET_OP, &msg,
sizeof(msg), wait);
} }
EXPORT_SYMBOL_GPL(mt76x02_mcu_function_select); EXPORT_SYMBOL_GPL(mt76x02_mcu_function_select);
...@@ -103,8 +104,8 @@ int mt76x02_mcu_set_radio_state(struct mt76x02_dev *dev, bool on) ...@@ -103,8 +104,8 @@ int mt76x02_mcu_set_radio_state(struct mt76x02_dev *dev, bool on)
.level = cpu_to_le32(0), .level = cpu_to_le32(0),
}; };
return mt76_mcu_send_msg(dev, CMD_POWER_SAVING_OP, &msg, sizeof(msg), return mt76_mcu_send_msg(&dev->mt76, CMD_POWER_SAVING_OP, &msg,
false); sizeof(msg), false);
} }
EXPORT_SYMBOL_GPL(mt76x02_mcu_set_radio_state); EXPORT_SYMBOL_GPL(mt76x02_mcu_set_radio_state);
...@@ -123,8 +124,8 @@ int mt76x02_mcu_calibrate(struct mt76x02_dev *dev, int type, u32 param) ...@@ -123,8 +124,8 @@ int mt76x02_mcu_calibrate(struct mt76x02_dev *dev, int type, u32 param)
if (is_mt76x2e) if (is_mt76x2e)
mt76_rmw(dev, MT_MCU_COM_REG0, BIT(31), 0); mt76_rmw(dev, MT_MCU_COM_REG0, BIT(31), 0);
ret = mt76_mcu_send_msg(dev, CMD_CALIBRATION_OP, &msg, sizeof(msg), ret = mt76_mcu_send_msg(&dev->mt76, CMD_CALIBRATION_OP, &msg,
true); sizeof(msg), true);
if (ret) if (ret)
return ret; return ret;
......
...@@ -33,13 +33,14 @@ int mt76x2_mcu_set_channel(struct mt76x02_dev *dev, u8 channel, u8 bw, ...@@ -33,13 +33,14 @@ int mt76x2_mcu_set_channel(struct mt76x02_dev *dev, u8 channel, u8 bw,
}; };
/* first set the channel without the extension channel info */ /* first set the channel without the extension channel info */
mt76_mcu_send_msg(dev, CMD_SWITCH_CHANNEL_OP, &msg, sizeof(msg), true); mt76_mcu_send_msg(&dev->mt76, CMD_SWITCH_CHANNEL_OP, &msg,
sizeof(msg), true);
usleep_range(5000, 10000); usleep_range(5000, 10000);
msg.ext_chan = 0xe0 + bw_index; msg.ext_chan = 0xe0 + bw_index;
return mt76_mcu_send_msg(dev, CMD_SWITCH_CHANNEL_OP, &msg, sizeof(msg), return mt76_mcu_send_msg(&dev->mt76, CMD_SWITCH_CHANNEL_OP, &msg,
true); sizeof(msg), true);
} }
EXPORT_SYMBOL_GPL(mt76x2_mcu_set_channel); EXPORT_SYMBOL_GPL(mt76x2_mcu_set_channel);
...@@ -66,7 +67,8 @@ int mt76x2_mcu_load_cr(struct mt76x02_dev *dev, u8 type, u8 temp_level, ...@@ -66,7 +67,8 @@ int mt76x2_mcu_load_cr(struct mt76x02_dev *dev, u8 type, u8 temp_level,
msg.cfg = cpu_to_le32(val); msg.cfg = cpu_to_le32(val);
/* first set the channel without the extension channel info */ /* first set the channel without the extension channel info */
return mt76_mcu_send_msg(dev, CMD_LOAD_CR, &msg, sizeof(msg), true); return mt76_mcu_send_msg(&dev->mt76, CMD_LOAD_CR, &msg, sizeof(msg),
true);
} }
EXPORT_SYMBOL_GPL(mt76x2_mcu_load_cr); EXPORT_SYMBOL_GPL(mt76x2_mcu_load_cr);
...@@ -84,8 +86,8 @@ int mt76x2_mcu_init_gain(struct mt76x02_dev *dev, u8 channel, u32 gain, ...@@ -84,8 +86,8 @@ int mt76x2_mcu_init_gain(struct mt76x02_dev *dev, u8 channel, u32 gain,
if (force) if (force)
msg.channel |= cpu_to_le32(BIT(31)); msg.channel |= cpu_to_le32(BIT(31));
return mt76_mcu_send_msg(dev, CMD_INIT_GAIN_OP, &msg, sizeof(msg), return mt76_mcu_send_msg(&dev->mt76, CMD_INIT_GAIN_OP, &msg,
true); sizeof(msg), true);
} }
EXPORT_SYMBOL_GPL(mt76x2_mcu_init_gain); EXPORT_SYMBOL_GPL(mt76x2_mcu_init_gain);
...@@ -100,7 +102,7 @@ int mt76x2_mcu_tssi_comp(struct mt76x02_dev *dev, ...@@ -100,7 +102,7 @@ int mt76x2_mcu_tssi_comp(struct mt76x02_dev *dev,
.data = *tssi_data, .data = *tssi_data,
}; };
return mt76_mcu_send_msg(dev, CMD_CALIBRATION_OP, &msg, sizeof(msg), return mt76_mcu_send_msg(&dev->mt76, CMD_CALIBRATION_OP, &msg,
true); sizeof(msg), true);
} }
EXPORT_SYMBOL_GPL(mt76x2_mcu_tssi_comp); EXPORT_SYMBOL_GPL(mt76x2_mcu_tssi_comp);
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