Commit ae90bdd6 authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Felix Fietkau
Browse files

mt76: connac: move mt76_connac_mcu_restart in common module



Move mt76_connac_mcu_restart routine in mt76-connac since it is shared
between mt7921 and mt7915.

Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 3dc531b9
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -2750,5 +2750,19 @@ int mt76_connac_mcu_set_pm(struct mt76_dev *dev, int band, int enter)
}
EXPORT_SYMBOL_GPL(mt76_connac_mcu_set_pm);

int mt76_connac_mcu_restart(struct mt76_dev *dev)
{
	struct {
		u8 power_mode;
		u8 rsv[3];
	} req = {
		.power_mode = 1,
	};

	return mt76_mcu_send_msg(dev, MCU_CMD(NIC_POWER_CTRL), &req,
				 sizeof(req), false);
}
EXPORT_SYMBOL_GPL(mt76_connac_mcu_restart);

MODULE_AUTHOR("Lorenzo Bianconi <lorenzo@kernel.org>");
MODULE_LICENSE("Dual BSD/GPL");
+1 −0
Original line number Diff line number Diff line
@@ -1610,4 +1610,5 @@ void mt76_connac_mcu_wtbl_smps_tlv(struct sk_buff *skb,
				   struct ieee80211_sta *sta,
				   void *sta_wtbl, void *wtbl_tlv);
int mt76_connac_mcu_set_pm(struct mt76_dev *dev, int band, int enter);
int mt76_connac_mcu_restart(struct mt76_dev *dev);
#endif /* __MT76_CONNAC_MCU_H */
+1 −14
Original line number Diff line number Diff line
@@ -1941,19 +1941,6 @@ int mt7915_mcu_add_beacon(struct ieee80211_hw *hw,
				     MCU_EXT_CMD(BSS_INFO_UPDATE), true);
}

static int mt7915_mcu_restart(struct mt76_dev *dev)
{
	struct {
		u8 power_mode;
		u8 rsv[3];
	} req = {
		.power_mode = 1,
	};

	return mt76_mcu_send_msg(dev, MCU_CMD(NIC_POWER_CTRL), &req,
				 sizeof(req), false);
}

static int mt7915_mcu_patch_sem_ctrl(struct mt7915_dev *dev, bool get)
{
	struct {
@@ -2428,7 +2415,7 @@ int mt7915_mcu_init(struct mt7915_dev *dev)
		.headroom = sizeof(struct mt7915_mcu_txd),
		.mcu_skb_send_msg = mt7915_mcu_send_message,
		.mcu_parse_response = mt7915_mcu_parse_response,
		.mcu_restart = mt7915_mcu_restart,
		.mcu_restart = mt76_connac_mcu_restart,
	};
	int ret;

+0 −14
Original line number Diff line number Diff line
@@ -444,20 +444,6 @@ int mt7921_mcu_uni_rx_ba(struct mt7921_dev *dev,
				      enable, false);
}

int mt7921_mcu_restart(struct mt76_dev *dev)
{
	struct {
		u8 power_mode;
		u8 rsv[3];
	} req = {
		.power_mode = 1,
	};

	return mt76_mcu_send_msg(dev, MCU_CMD(NIC_POWER_CTRL), &req,
				 sizeof(req), false);
}
EXPORT_SYMBOL_GPL(mt7921_mcu_restart);

static u32 mt7921_get_data_mode(struct mt7921_dev *dev, u32 info)
{
	u32 mode = DL_MODE_NEED_RSP;
+0 −1
Original line number Diff line number Diff line
@@ -433,7 +433,6 @@ int mt7921_mcu_fill_message(struct mt76_dev *mdev, struct sk_buff *skb,
			    int cmd, int *wait_seq);
int mt7921_mcu_parse_response(struct mt76_dev *mdev, int cmd,
			      struct sk_buff *skb, int seq);
int mt7921_mcu_restart(struct mt76_dev *dev);

void mt7921e_queue_rx_skb(struct mt76_dev *mdev, enum mt76_rxq_id q,
			  struct sk_buff *skb);
Loading