mt76: mt7921: rework mt7921_mcu_debug_msg_event routine
Rework mt7921_mcu_debug_msg_event routing removing unnecessary assignments and relying on wiphy_info Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
parent
859c85fd19
commit
c7cc5ec573
1 changed files with 12 additions and 14 deletions
|
@ -474,29 +474,27 @@ mt7921_mcu_bss_event(struct mt7921_dev *dev, struct sk_buff *skb)
|
||||||
static void
|
static void
|
||||||
mt7921_mcu_debug_msg_event(struct mt7921_dev *dev, struct sk_buff *skb)
|
mt7921_mcu_debug_msg_event(struct mt7921_dev *dev, struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
struct mt7921_mcu_rxd *rxd = (struct mt7921_mcu_rxd *)skb->data;
|
struct mt7921_debug_msg {
|
||||||
struct debug_msg {
|
|
||||||
__le16 id;
|
__le16 id;
|
||||||
u8 type;
|
u8 type;
|
||||||
u8 flag;
|
u8 flag;
|
||||||
__le32 value;
|
__le32 value;
|
||||||
__le16 len;
|
__le16 len;
|
||||||
u8 content[512];
|
u8 content[512];
|
||||||
} __packed * debug_msg;
|
} __packed * msg;
|
||||||
u16 cur_len;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
skb_pull(skb, sizeof(*rxd));
|
skb_pull(skb, sizeof(struct mt7921_mcu_rxd));
|
||||||
debug_msg = (struct debug_msg *)skb->data;
|
msg = (struct mt7921_debug_msg *)skb->data;
|
||||||
|
|
||||||
cur_len = min_t(u16, le16_to_cpu(debug_msg->len), 512);
|
if (msg->type == 3) { /* fw log */
|
||||||
|
u16 len = min_t(u16, le16_to_cpu(msg->len), 512);
|
||||||
|
int i;
|
||||||
|
|
||||||
if (debug_msg->type == 0x3) {
|
for (i = 0 ; i < len; i++) {
|
||||||
for (i = 0 ; i < cur_len; i++)
|
if (!msg->content[i])
|
||||||
if (!debug_msg->content[i])
|
msg->content[i] = ' ';
|
||||||
debug_msg->content[i] = ' ';
|
}
|
||||||
|
wiphy_info(mt76_hw(dev)->wiphy, "%*s", len, msg->content);
|
||||||
dev_dbg(dev->mt76.dev, "%s", debug_msg->content);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue