mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
mt76: introduce __mt76_mcu_send_firmware routine
Introduce __mt76_mcu_send_firmware routine to specify mcu message max length. This is a preliminary patch to support mt7921s driver. Co-developed-by: Sean Wang <[email protected]> Signed-off-by: Sean Wang <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
committed by
Felix Fietkau
parent
03a9926453
commit
75615480b3
@@ -106,13 +106,13 @@ out:
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt76_mcu_skb_send_and_get_msg);
|
||||
|
||||
int mt76_mcu_send_firmware(struct mt76_dev *dev, int cmd, const void *data,
|
||||
int len)
|
||||
int __mt76_mcu_send_firmware(struct mt76_dev *dev, int cmd, const void *data,
|
||||
int len, int max_len)
|
||||
{
|
||||
int err, cur_len;
|
||||
|
||||
while (len > 0) {
|
||||
cur_len = min_t(int, 4096 - dev->mcu_ops->headroom, len);
|
||||
cur_len = min_t(int, max_len - dev->mcu_ops->headroom, len);
|
||||
|
||||
err = mt76_mcu_send_msg(dev, cmd, data, cur_len, false);
|
||||
if (err)
|
||||
@@ -129,4 +129,4 @@ int mt76_mcu_send_firmware(struct mt76_dev *dev, int cmd, const void *data,
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt76_mcu_send_firmware);
|
||||
EXPORT_SYMBOL_GPL(__mt76_mcu_send_firmware);
|
||||
|
||||
Reference in New Issue
Block a user