Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ebb7678d authored by Emmanuel Grumbach's avatar Emmanuel Grumbach Committed by Wey-Yi Guy
Browse files

iwlwifi: move prepare_card_hw to start_hw



Kill the trans_ops->prepare_card_hw which is now useless.

Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
parent 57a1dc89
Loading
Loading
Loading
Loading
+0 −6
Original line number Original line Diff line number Diff line
@@ -1833,12 +1833,6 @@ int iwl_probe(struct iwl_bus *bus, const struct iwl_trans_ops *trans_ops,
	if (err)
	if (err)
		goto out_free_traffic_mem;
		goto out_free_traffic_mem;


	if (iwl_trans_prepare_card_hw(trans(priv))) {
		err = -EIO;
		IWL_WARN(priv, "Failed, HW not ready\n");
		goto out_free_traffic_mem;
	}

	/*****************
	/*****************
	 * 4. Read EEPROM
	 * 4. Read EEPROM
	 *****************/
	 *****************/
+15 −7
Original line number Original line Diff line number Diff line
@@ -690,13 +690,14 @@ static int iwl_set_hw_ready(struct iwl_trans *trans)
}
}


/* Note: returns standard 0/-ERROR code */
/* Note: returns standard 0/-ERROR code */
static int iwl_trans_pcie_prepare_card_hw(struct iwl_trans *trans)
static int iwl_prepare_card_hw(struct iwl_trans *trans)
{
{
	int ret;
	int ret;


	IWL_DEBUG_INFO(trans, "iwl_trans_prepare_card_hw enter\n");
	IWL_DEBUG_INFO(trans, "iwl_trans_prepare_card_hw enter\n");


	ret = iwl_set_hw_ready(trans);
	ret = iwl_set_hw_ready(trans);
	/* If the card is ready, exit 0 */
	if (ret >= 0)
	if (ret >= 0)
		return 0;
		return 0;


@@ -788,7 +789,7 @@ static int iwl_trans_pcie_start_device(struct iwl_trans *trans)
	trans_pcie->mcast_queue[IWL_RXON_CTX_PAN] = IWL_IPAN_MCAST_QUEUE;
	trans_pcie->mcast_queue[IWL_RXON_CTX_PAN] = IWL_IPAN_MCAST_QUEUE;


	if ((hw_params(trans).sku & EEPROM_SKU_CAP_AMT_ENABLE) &&
	if ((hw_params(trans).sku & EEPROM_SKU_CAP_AMT_ENABLE) &&
	     iwl_trans_pcie_prepare_card_hw(trans)) {
	     iwl_prepare_card_hw(trans)) {
		IWL_WARN(trans, "Exit HW not ready\n");
		IWL_WARN(trans, "Exit HW not ready\n");
		return -EIO;
		return -EIO;
	}
	}
@@ -1254,16 +1255,24 @@ static int iwl_trans_pcie_start_hw(struct iwl_trans *trans)
		if (err) {
		if (err) {
			IWL_ERR(trans, "Error allocating IRQ %d\n",
			IWL_ERR(trans, "Error allocating IRQ %d\n",
				trans->irq);
				trans->irq);
			iwl_free_isr_ict(trans);
			goto error;
			tasklet_kill(&trans_pcie->irq_tasklet);
			return err;
		}
		}


		INIT_WORK(&trans_pcie->rx_replenish, iwl_bg_rx_replenish);
		INIT_WORK(&trans_pcie->rx_replenish, iwl_bg_rx_replenish);
		trans_pcie->irq_requested = true;
		trans_pcie->irq_requested = true;
	}
	}


	return 0;
	err = iwl_prepare_card_hw(trans);
	if (err) {
		IWL_ERR(trans, "Error while preparing HW: %d", err);
		goto error;
	}
	return err;

error:
	iwl_free_isr_ict(trans);
	tasklet_kill(&trans_pcie->irq_tasklet);
	return err;
}
}


static int iwl_trans_pcie_reclaim(struct iwl_trans *trans, int sta_id, int tid,
static int iwl_trans_pcie_reclaim(struct iwl_trans *trans, int sta_id, int tid,
@@ -1931,7 +1940,6 @@ const struct iwl_trans_ops trans_ops_pcie = {
	.start_hw = iwl_trans_pcie_start_hw,
	.start_hw = iwl_trans_pcie_start_hw,
	.fw_alive = iwl_trans_pcie_fw_alive,
	.fw_alive = iwl_trans_pcie_fw_alive,
	.start_device = iwl_trans_pcie_start_device,
	.start_device = iwl_trans_pcie_start_device,
	.prepare_card_hw = iwl_trans_pcie_prepare_card_hw,
	.stop_device = iwl_trans_pcie_stop_device,
	.stop_device = iwl_trans_pcie_stop_device,


	.wake_any_queue = iwl_trans_pcie_wake_any_queue,
	.wake_any_queue = iwl_trans_pcie_wake_any_queue,
+0 −8
Original line number Original line Diff line number Diff line
@@ -136,8 +136,6 @@ struct iwl_host_cmd {
 * @start_hw: starts the HW- from that point on, the HW can send interrupts
 * @start_hw: starts the HW- from that point on, the HW can send interrupts
 * @start_device: allocates and inits all the resources for the transport
 * @start_device: allocates and inits all the resources for the transport
 *                layer.
 *                layer.
 * @prepare_card_hw: claim the ownership on the HW. Will be called during
 *                   probe.
 * @fw_alive: called when the fw sends alive notification
 * @fw_alive: called when the fw sends alive notification
 * @wake_any_queue: wake all the queues of a specfic context IWL_RXON_CTX_*
 * @wake_any_queue: wake all the queues of a specfic context IWL_RXON_CTX_*
 * @stop_device:stops the whole device (embedded CPU put to reset)
 * @stop_device:stops the whole device (embedded CPU put to reset)
@@ -167,7 +165,6 @@ struct iwl_trans_ops {
	int (*start_hw)(struct iwl_trans *iwl_trans);
	int (*start_hw)(struct iwl_trans *iwl_trans);
	int (*start_device)(struct iwl_trans *trans);
	int (*start_device)(struct iwl_trans *trans);
	void (*fw_alive)(struct iwl_trans *trans);
	void (*fw_alive)(struct iwl_trans *trans);
	int (*prepare_card_hw)(struct iwl_trans *trans);
	void (*stop_device)(struct iwl_trans *trans);
	void (*stop_device)(struct iwl_trans *trans);


	void (*wake_any_queue)(struct iwl_trans *trans,
	void (*wake_any_queue)(struct iwl_trans *trans,
@@ -284,11 +281,6 @@ static inline int iwl_trans_start_device(struct iwl_trans *trans)
	return trans->ops->start_device(trans);
	return trans->ops->start_device(trans);
}
}


static inline int iwl_trans_prepare_card_hw(struct iwl_trans *trans)
{
	return trans->ops->prepare_card_hw(trans);
}

static inline void iwl_trans_stop_device(struct iwl_trans *trans)
static inline void iwl_trans_stop_device(struct iwl_trans *trans)
{
{
	trans->ops->stop_device(trans);
	trans->ops->stop_device(trans);