Lines Matching +full:com +full:- +full:seq

1 // SPDX-License-Identifier: ISC
4 * Copyright (C) 2018 Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
14 struct sk_buff *skb, int seq) in mt76x02_mcu_parse_response() argument
20 dev_err(mdev->dev, "MCU message %02x (seq %d) timed out\n", in mt76x02_mcu_parse_response()
21 abs(cmd), seq); in mt76x02_mcu_parse_response()
22 dev->mcu_timeout = 1; in mt76x02_mcu_parse_response()
23 return -ETIMEDOUT; in mt76x02_mcu_parse_response()
26 rxfce = (u32 *)skb->cb; in mt76x02_mcu_parse_response()
27 if (seq != FIELD_GET(MT_RX_FCE_INFO_CMD_SEQ, *rxfce)) in mt76x02_mcu_parse_response()
28 return -EAGAIN; in mt76x02_mcu_parse_response()
42 u8 seq; in mt76x02_mcu_msg_send() local
44 if (dev->mcu_timeout) in mt76x02_mcu_msg_send()
45 return -EIO; in mt76x02_mcu_msg_send()
49 return -ENOMEM; in mt76x02_mcu_msg_send()
51 mutex_lock(&mdev->mcu.mutex); in mt76x02_mcu_msg_send()
53 seq = ++mdev->mcu.msg_seq & 0xf; in mt76x02_mcu_msg_send()
54 if (!seq) in mt76x02_mcu_msg_send()
55 seq = ++mdev->mcu.msg_seq & 0xf; in mt76x02_mcu_msg_send()
59 FIELD_PREP(MT_MCU_MSG_CMD_SEQ, seq) | in mt76x02_mcu_msg_send()
61 FIELD_PREP(MT_MCU_MSG_LEN, skb->len); in mt76x02_mcu_msg_send()
63 ret = mt76_tx_queue_skb_raw(dev, mdev->q_mcu[MT_MCUQ_WM], skb, tx_info); in mt76x02_mcu_msg_send()
68 skb = mt76_mcu_get_response(&dev->mt76, expires); in mt76x02_mcu_msg_send()
69 ret = mt76x02_mcu_parse_response(mdev, cmd, skb, seq); in mt76x02_mcu_msg_send()
71 if (ret != -EAGAIN) in mt76x02_mcu_msg_send()
76 mutex_unlock(&mdev->mcu.mutex); in mt76x02_mcu_msg_send()
97 return mt76_mcu_send_msg(&dev->mt76, CMD_FUN_SET_OP, &msg, in mt76x02_mcu_function_select()
112 return mt76_mcu_send_msg(&dev->mt76, CMD_POWER_SAVING_OP, &msg, in mt76x02_mcu_set_radio_state()
126 bool is_mt76x2e = mt76_is_mmio(&dev->mt76) && is_mt76x2(dev); in mt76x02_mcu_calibrate()
132 ret = mt76_mcu_send_msg(&dev->mt76, CMD_CALIBRATION_OP, &msg, in mt76x02_mcu_calibrate()
140 return -ETIMEDOUT; in mt76x02_mcu_calibrate()
153 while ((skb = skb_dequeue(&dev->mt76.mcu.res_q)) != NULL) in mt76x02_mcu_cleanup()
163 u16 bld = le16_to_cpu(h->build_ver); in mt76x02_set_ethtool_fwver()
164 u16 ver = le16_to_cpu(h->fw_ver); in mt76x02_set_ethtool_fwver()
166 snprintf(dev->mt76.hw->wiphy->fw_version, in mt76x02_set_ethtool_fwver()
167 sizeof(dev->mt76.hw->wiphy->fw_version), in mt76x02_set_ethtool_fwver()
168 "%d.%d.%02d-b%x", in mt76x02_set_ethtool_fwver()