#define FW_START_WORKING_PDA_CR4 BIT(2)
static int __mt7615_mcu_msg_send(struct mt7615_dev *dev, struct sk_buff *skb,
- int cmd, int query, int dest, int *wait_seq)
+ int cmd, int dest, int *wait_seq)
{
struct mt7615_mcu_txd *mcu_txd;
u8 seq, q_idx, pkt_fmt;
mcu_txd->seq = seq;
if (cmd < 0) {
+ mcu_txd->set_query = MCU_Q_NA;
mcu_txd->cid = -cmd;
} else {
mcu_txd->cid = MCU_CMD_EXT_CID;
+ mcu_txd->set_query = MCU_Q_SET;
mcu_txd->ext_cid = cmd;
- if (query != MCU_Q_NA)
- mcu_txd->ext_cid_ack = 1;
+ mcu_txd->ext_cid_ack = 1;
}
-
- mcu_txd->set_query = query;
mcu_txd->s2d_index = dest;
if (wait_seq)
return mt76_tx_queue_skb_raw(dev, qid, skb, 0);
}
-static int mt7615_mcu_msg_send(struct mt7615_dev *dev, struct sk_buff *skb,
- int cmd, int query, int dest,
- struct sk_buff **skb_ret)
+static int
+mt7615_mcu_msg_send(struct mt7615_dev *dev, struct sk_buff *skb,
+ int cmd, int dest, struct sk_buff **skb_ret)
{
unsigned long expires = jiffies + 10 * HZ;
struct mt7615_mcu_rxd *rxd;
mutex_lock(&dev->mt76.mmio.mcu.mutex);
- ret = __mt7615_mcu_msg_send(dev, skb, cmd, query, dest, &seq);
+ ret = __mt7615_mcu_msg_send(dev, skb, cmd, dest, &seq);
if (ret)
goto out;
struct sk_buff *skb = mt7615_mcu_msg_alloc(&req, sizeof(req));
return mt7615_mcu_msg_send(dev, skb, -MCU_CMD_TARGET_ADDRESS_LEN_REQ,
- MCU_Q_NA, MCU_S2D_H2N, NULL);
+ MCU_S2D_H2N, NULL);
}
static int mt7615_mcu_send_firmware(struct mt7615_dev *dev, const void *data,
return -ENOMEM;
ret = __mt7615_mcu_msg_send(dev, skb, -MCU_CMD_FW_SCATTER,
- MCU_Q_NA, MCU_S2D_H2N, NULL);
+ MCU_S2D_H2N, NULL);
if (ret)
break;
struct sk_buff *skb = mt7615_mcu_msg_alloc(&req, sizeof(req));
return mt7615_mcu_msg_send(dev, skb, -MCU_CMD_FW_START_REQ,
- MCU_Q_NA, MCU_S2D_H2N, NULL);
+ MCU_S2D_H2N, NULL);
}
static int mt7615_mcu_restart(struct mt7615_dev *dev)
struct sk_buff *skb = mt7615_mcu_msg_alloc(NULL, 0);
return mt7615_mcu_msg_send(dev, skb, -MCU_CMD_RESTART_DL_REQ,
- MCU_Q_NA, MCU_S2D_H2N, NULL);
+ MCU_S2D_H2N, NULL);
}
static int mt7615_mcu_patch_sem_ctrl(struct mt7615_dev *dev, bool get)
int ret;
ret = mt7615_mcu_msg_send(dev, skb, -MCU_CMD_PATCH_SEM_CONTROL,
- MCU_Q_NA, MCU_S2D_H2N, &skb_ret);
+ MCU_S2D_H2N, &skb_ret);
if (ret)
goto out;
struct sk_buff *skb = mt7615_mcu_msg_alloc(&req, sizeof(req));
return mt7615_mcu_msg_send(dev, skb, -MCU_CMD_PATCH_FINISH_REQ,
- MCU_Q_NA, MCU_S2D_H2N, NULL);
+ MCU_S2D_H2N, NULL);
}
static int mt7615_driver_own(struct mt7615_dev *dev)
data[off - MT_EE_NIC_CONF_0].val = eep[off];
return mt7615_mcu_msg_send(dev, skb, MCU_EXT_CMD_EFUSE_BUFFER_MODE,
- MCU_Q_SET, MCU_S2D_H2N, NULL);
+ MCU_S2D_H2N, NULL);
}
int mt7615_mcu_init_mac(struct mt7615_dev *dev)
struct sk_buff *skb = mt7615_mcu_msg_alloc(&req, sizeof(req));
return mt7615_mcu_msg_send(dev, skb, MCU_EXT_CMD_MAC_INIT_CTRL,
- MCU_Q_SET, MCU_S2D_H2N, NULL);
+ MCU_S2D_H2N, NULL);
}
int mt7615_mcu_set_rts_thresh(struct mt7615_dev *dev, u32 val)
struct sk_buff *skb = mt7615_mcu_msg_alloc(&req, sizeof(req));
return mt7615_mcu_msg_send(dev, skb, MCU_EXT_CMD_PROTECT_CTRL,
- MCU_Q_SET, MCU_S2D_H2N, NULL);
+ MCU_S2D_H2N, NULL);
}
int mt7615_mcu_set_wmm(struct mt7615_dev *dev, u8 queue,
skb = mt7615_mcu_msg_alloc(&req, sizeof(req));
return mt7615_mcu_msg_send(dev, skb, MCU_EXT_CMD_EDCA_UPDATE,
- MCU_Q_SET, MCU_S2D_H2N, NULL);
+ MCU_S2D_H2N, NULL);
}
int mt7615_mcu_ctrl_pm_state(struct mt7615_dev *dev, int enter)
struct sk_buff *skb = mt7615_mcu_msg_alloc(&req, sizeof(req));
return mt7615_mcu_msg_send(dev, skb, MCU_EXT_CMD_PM_STATE_CTRL,
- MCU_Q_SET, MCU_S2D_H2N, NULL);
+ MCU_S2D_H2N, NULL);
}
static int __mt7615_mcu_set_dev_info(struct mt7615_dev *dev,
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,
- MCU_Q_SET, MCU_S2D_H2N, NULL);
+ MCU_S2D_H2N, NULL);
}
int mt7615_mcu_set_dev_info(struct mt7615_dev *dev, struct ieee80211_vif *vif,
bss_info_tag_handler[i].handler(dev, bss_info, skb);
return mt7615_mcu_msg_send(dev, skb, MCU_EXT_CMD_BSS_INFO_UPDATE,
- MCU_Q_SET, MCU_S2D_H2N, NULL);
+ MCU_S2D_H2N, NULL);
}
int mt7615_mcu_set_bss_info(struct mt7615_dev *dev,
memcpy(skb_put(skb, buf_len), buf, buf_len);
return mt7615_mcu_msg_send(dev, skb, MCU_EXT_CMD_WTBL_UPDATE,
- MCU_Q_SET, MCU_S2D_H2N, NULL);
+ MCU_S2D_H2N, NULL);
}
static enum mt7615_cipher_type
memcpy(skb_put(skb, buf_len), buf, buf_len);
return mt7615_mcu_msg_send(dev, skb, MCU_EXT_CMD_STA_REC_UPDATE,
- MCU_Q_SET, MCU_S2D_H2N, NULL);
+ MCU_S2D_H2N, NULL);
}
int mt7615_mcu_set_sta_rec_bmc(struct mt7615_dev *dev,
skb = mt7615_mcu_msg_alloc(&req, sizeof(req));
return mt7615_mcu_msg_send(dev, skb, MCU_EXT_CMD_BCN_OFFLOAD,
- MCU_Q_SET, MCU_S2D_H2N, NULL);
+ MCU_S2D_H2N, NULL);
}
int mt7615_mcu_set_channel(struct mt7615_dev *dev)
skb = mt7615_mcu_msg_alloc(&req, sizeof(req));
ret = mt7615_mcu_msg_send(dev, skb, MCU_EXT_CMD_CHANNEL_SWITCH,
- MCU_Q_SET, MCU_S2D_H2N, NULL);
+ MCU_S2D_H2N, NULL);
if (ret)
return ret;
skb = mt7615_mcu_msg_alloc(&req, sizeof(req));
return mt7615_mcu_msg_send(dev, skb, MCU_EXT_CMD_SET_RX_PATH,
- MCU_Q_SET, MCU_S2D_H2N, NULL);
+ MCU_S2D_H2N, NULL);
}
int mt7615_mcu_set_ht_cap(struct mt7615_dev *dev, struct ieee80211_vif *vif,