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

Commit 1eb9ed1e authored by Wey-Yi Guy's avatar Wey-Yi Guy
Browse files

Merge branch 'master' of...

Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into wireless-next
parents 8d357611 3dc420be
Loading
Loading
Loading
Loading
+37 −36
Original line number Original line Diff line number Diff line
@@ -1206,35 +1206,25 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
	/* TODO: remove fw from shared data later */
	/* TODO: remove fw from shared data later */
	priv->shrd->fw = fw;
	priv->shrd->fw = fw;


	/************************
	/*
	 * 2. Setup HW constants
	 * Populate the state variables that the transport layer needs
	 ************************/
	 * to know about.
	iwl_set_hw_params(priv);
	 */
	trans_cfg.op_mode = op_mode;


	ucode_flags = fw->ucode_capa.flags;
	ucode_flags = fw->ucode_capa.flags;


#ifndef CONFIG_IWLWIFI_P2P
#ifndef CONFIG_IWLWIFI_P2P
	ucode_flags &= ~IWL_UCODE_TLV_FLAGS_PAN;
	ucode_flags &= ~IWL_UCODE_TLV_FLAGS_PAN;
#endif
#endif
	if (!(hw_params(priv).sku & EEPROM_SKU_CAP_IPAN_ENABLE))
		ucode_flags &= ~IWL_UCODE_TLV_FLAGS_PAN;

	/*
	 * if not PAN, then don't support P2P -- might be a uCode
	 * packaging bug or due to the eeprom check above
	 */
	if (!(ucode_flags & IWL_UCODE_TLV_FLAGS_PAN))
		ucode_flags &= ~IWL_UCODE_TLV_FLAGS_P2P;



	if (ucode_flags & IWL_UCODE_TLV_FLAGS_PAN) {
	/*****************************
		priv->sta_key_max_num = STA_KEY_MAX_NUM_PAN;
	 * Configure transport layer
		trans_cfg.cmd_queue = IWL_IPAN_CMD_QUEUE_NUM;
	 *****************************/
	} else {
	/*
		priv->sta_key_max_num = STA_KEY_MAX_NUM;
	 * Populate the state variables that the transport layer needs
		trans_cfg.cmd_queue = IWL_DEFAULT_CMD_QUEUE_NUM;
	 * to know about.
	}
	 */
	trans_cfg.op_mode = op_mode;


	/* Configure transport layer */
	/* Configure transport layer */
	iwl_trans_configure(trans(priv), &trans_cfg);
	iwl_trans_configure(trans(priv), &trans_cfg);
@@ -1269,7 +1259,7 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
	spin_lock_init(&priv->statistics.lock);
	spin_lock_init(&priv->statistics.lock);


	/***********************
	/***********************
	 * 3. Read REV register
	 * 2. Read REV register
	 ***********************/
	 ***********************/
	IWL_INFO(priv, "Detected %s, REV=0x%X\n",
	IWL_INFO(priv, "Detected %s, REV=0x%X\n",
		cfg(priv)->name, trans(priv)->hw_rev);
		cfg(priv)->name, trans(priv)->hw_rev);
@@ -1279,9 +1269,8 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
		goto out_free_traffic_mem;
		goto out_free_traffic_mem;


	/*****************
	/*****************
	 * 4. Read EEPROM
	 * 3. Read EEPROM
	 *****************/
	 *****************/
	/* Read the EEPROM */
	err = iwl_eeprom_init(trans(priv), trans(priv)->hw_rev);
	err = iwl_eeprom_init(trans(priv), trans(priv)->hw_rev);
	/* Reset chip to save power until we load uCode during "up". */
	/* Reset chip to save power until we load uCode during "up". */
	iwl_trans_stop_hw(trans(priv));
	iwl_trans_stop_hw(trans(priv));
@@ -1310,8 +1299,28 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
		priv->hw->wiphy->n_addresses++;
		priv->hw->wiphy->n_addresses++;
	}
	}


	/************************
	 * 4. Setup HW constants
	 ************************/
	iwl_set_hw_params(priv);

	if (!(hw_params(priv).sku & EEPROM_SKU_CAP_IPAN_ENABLE)) {
		IWL_DEBUG_INFO(priv, "Your EEPROM disabled PAN");
		ucode_flags &= ~IWL_UCODE_TLV_FLAGS_PAN;
		/*
		 * if not PAN, then don't support P2P -- might be a uCode
		 * packaging bug or due to the eeprom check above
		 */
		ucode_flags &= ~IWL_UCODE_TLV_FLAGS_P2P;
		priv->sta_key_max_num = STA_KEY_MAX_NUM;
		trans_cfg.cmd_queue = IWL_DEFAULT_CMD_QUEUE_NUM;

		/* Configure transport layer again*/
		iwl_trans_configure(trans(priv), &trans_cfg);
	}

	/*******************
	/*******************
	 * 6. Setup priv
	 * 5. Setup priv
	 *******************/
	 *******************/


	err = iwl_init_drv(priv);
	err = iwl_init_drv(priv);
@@ -1320,7 +1329,7 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
	/* At this point both hw and priv are initialized. */
	/* At this point both hw and priv are initialized. */


	/********************
	/********************
	 * 7. Setup services
	 * 6. Setup services
	 ********************/
	 ********************/
	iwl_setup_deferred_work(priv);
	iwl_setup_deferred_work(priv);
	iwl_setup_rx_handlers(priv);
	iwl_setup_rx_handlers(priv);
@@ -1336,14 +1345,6 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
	priv->new_scan_threshold_behaviour =
	priv->new_scan_threshold_behaviour =
		!!(ucode_flags & IWL_UCODE_TLV_FLAGS_NEWSCAN);
		!!(ucode_flags & IWL_UCODE_TLV_FLAGS_NEWSCAN);


	if (ucode_flags & IWL_UCODE_TLV_FLAGS_PAN) {
		priv->sta_key_max_num = STA_KEY_MAX_NUM_PAN;
		priv->shrd->cmd_queue = IWL_IPAN_CMD_QUEUE_NUM;
	} else {
		priv->sta_key_max_num = STA_KEY_MAX_NUM;
		priv->shrd->cmd_queue = IWL_DEFAULT_CMD_QUEUE_NUM;
	}

	priv->phy_calib_chain_noise_reset_cmd =
	priv->phy_calib_chain_noise_reset_cmd =
		fw->ucode_capa.standard_phy_calibration_size;
		fw->ucode_capa.standard_phy_calibration_size;
	priv->phy_calib_chain_noise_gain_cmd =
	priv->phy_calib_chain_noise_gain_cmd =
@@ -1355,7 +1356,7 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
	/**************************************************
	/**************************************************
	 * This is still part of probe() in a sense...
	 * This is still part of probe() in a sense...
	 *
	 *
	 * 9. Setup and register with mac80211 and debugfs
	 * 7. Setup and register with mac80211 and debugfs
	 **************************************************/
	 **************************************************/
	err = iwlagn_mac_setup_register(priv, &fw->ucode_capa);
	err = iwlagn_mac_setup_register(priv, &fw->ucode_capa);
	if (err)
	if (err)
+0 −2
Original line number Original line Diff line number Diff line
@@ -368,7 +368,6 @@ struct iwl_cfg {
/**
/**
 * struct iwl_shared - shared fields for all the layers of the driver
 * struct iwl_shared - shared fields for all the layers of the driver
 *
 *
 * @cmd_queue: command queue number
 * @status: STATUS_*
 * @status: STATUS_*
 * @wowlan: are we running wowlan uCode
 * @wowlan: are we running wowlan uCode
 * @valid_contexts: microcode/device supports multiple contexts
 * @valid_contexts: microcode/device supports multiple contexts
@@ -385,7 +384,6 @@ struct iwl_cfg {
 * @device_pointers: pointers to ucode event tables
 * @device_pointers: pointers to ucode event tables
 */
 */
struct iwl_shared {
struct iwl_shared {
	u8 cmd_queue;
	unsigned long status;
	unsigned long status;
	u8 valid_contexts;
	u8 valid_contexts;


+2 −0
Original line number Original line Diff line number Diff line
@@ -248,6 +248,7 @@ struct iwl_tx_queue {
 * @ucode_write_complete: indicates that the ucode has been copied.
 * @ucode_write_complete: indicates that the ucode has been copied.
 * @ucode_write_waitq: wait queue for uCode load
 * @ucode_write_waitq: wait queue for uCode load
 * @status - transport specific status flags
 * @status - transport specific status flags
 * @cmd_queue - command queue number
 */
 */
struct iwl_trans_pcie {
struct iwl_trans_pcie {
	struct iwl_rx_queue rxq;
	struct iwl_rx_queue rxq;
@@ -289,6 +290,7 @@ struct iwl_trans_pcie {
	bool ucode_write_complete;
	bool ucode_write_complete;
	wait_queue_head_t ucode_write_waitq;
	wait_queue_head_t ucode_write_waitq;
	unsigned long status;
	unsigned long status;
	u8 cmd_queue;
};
};


#define IWL_TRANS_GET_PCIE_TRANS(_iwl_trans) \
#define IWL_TRANS_GET_PCIE_TRANS(_iwl_trans) \
+1 −1
Original line number Original line Diff line number Diff line
@@ -361,7 +361,7 @@ static void iwl_rx_handle_rxbuf(struct iwl_trans *trans,
{
{
	struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
	struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
	struct iwl_rx_queue *rxq = &trans_pcie->rxq;
	struct iwl_rx_queue *rxq = &trans_pcie->rxq;
	struct iwl_tx_queue *txq = &trans_pcie->txq[trans->shrd->cmd_queue];
	struct iwl_tx_queue *txq = &trans_pcie->txq[trans_pcie->cmd_queue];
	struct iwl_device_cmd *cmd;
	struct iwl_device_cmd *cmd;
	unsigned long flags;
	unsigned long flags;
	int len, err;
	int len, err;
+12 −12
Original line number Original line Diff line number Diff line
@@ -397,7 +397,7 @@ static void iwlagn_txq_inval_byte_cnt_tbl(struct iwl_trans *trans,


	WARN_ON(read_ptr >= TFD_QUEUE_SIZE_MAX);
	WARN_ON(read_ptr >= TFD_QUEUE_SIZE_MAX);


	if (txq_id != trans->shrd->cmd_queue)
	if (txq_id != trans_pcie->cmd_queue)
		sta_id = tx_cmd->sta_id;
		sta_id = tx_cmd->sta_id;


	bc_ent = cpu_to_le16(1 | (sta_id << 12));
	bc_ent = cpu_to_le16(1 | (sta_id << 12));
@@ -664,7 +664,7 @@ int iwl_trans_pcie_tx_agg_disable(struct iwl_trans *trans, int sta_id, int tid)
static int iwl_enqueue_hcmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd)
static int iwl_enqueue_hcmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd)
{
{
	struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
	struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
	struct iwl_tx_queue *txq = &trans_pcie->txq[trans->shrd->cmd_queue];
	struct iwl_tx_queue *txq = &trans_pcie->txq[trans_pcie->cmd_queue];
	struct iwl_queue *q = &txq->q;
	struct iwl_queue *q = &txq->q;
	struct iwl_device_cmd *out_cmd;
	struct iwl_device_cmd *out_cmd;
	struct iwl_cmd_meta *out_meta;
	struct iwl_cmd_meta *out_meta;
@@ -737,7 +737,7 @@ static int iwl_enqueue_hcmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd)
	out_cmd->hdr.cmd = cmd->id;
	out_cmd->hdr.cmd = cmd->id;
	out_cmd->hdr.flags = 0;
	out_cmd->hdr.flags = 0;
	out_cmd->hdr.sequence =
	out_cmd->hdr.sequence =
		cpu_to_le16(QUEUE_TO_SEQ(trans->shrd->cmd_queue) |
		cpu_to_le16(QUEUE_TO_SEQ(trans_pcie->cmd_queue) |
					 INDEX_TO_SEQ(q->write_ptr));
					 INDEX_TO_SEQ(q->write_ptr));


	/* and copy the data that needs to be copied */
	/* and copy the data that needs to be copied */
@@ -757,7 +757,7 @@ static int iwl_enqueue_hcmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd)
			get_cmd_string(out_cmd->hdr.cmd),
			get_cmd_string(out_cmd->hdr.cmd),
			out_cmd->hdr.cmd,
			out_cmd->hdr.cmd,
			le16_to_cpu(out_cmd->hdr.sequence), cmd_size,
			le16_to_cpu(out_cmd->hdr.sequence), cmd_size,
			q->write_ptr, idx, trans->shrd->cmd_queue);
			q->write_ptr, idx, trans_pcie->cmd_queue);


	phys_addr = dma_map_single(trans->dev, &out_cmd->hdr, copy_size,
	phys_addr = dma_map_single(trans->dev, &out_cmd->hdr, copy_size,
				DMA_BIDIRECTIONAL);
				DMA_BIDIRECTIONAL);
@@ -881,16 +881,16 @@ void iwl_tx_cmd_complete(struct iwl_trans *trans, struct iwl_rx_cmd_buffer *rxb,
	struct iwl_device_cmd *cmd;
	struct iwl_device_cmd *cmd;
	struct iwl_cmd_meta *meta;
	struct iwl_cmd_meta *meta;
	struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
	struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
	struct iwl_tx_queue *txq = &trans_pcie->txq[trans->shrd->cmd_queue];
	struct iwl_tx_queue *txq = &trans_pcie->txq[trans_pcie->cmd_queue];


	/* If a Tx command is being handled and it isn't in the actual
	/* If a Tx command is being handled and it isn't in the actual
	 * command queue then there a command routing bug has been introduced
	 * command queue then there a command routing bug has been introduced
	 * in the queue management code. */
	 * in the queue management code. */
	if (WARN(txq_id != trans->shrd->cmd_queue,
	if (WARN(txq_id != trans_pcie->cmd_queue,
		 "wrong command queue %d (should be %d), sequence 0x%X readp=%d writep=%d\n",
		 "wrong command queue %d (should be %d), sequence 0x%X readp=%d writep=%d\n",
		  txq_id, trans->shrd->cmd_queue, sequence,
		  txq_id, trans_pcie->cmd_queue, sequence,
		  trans_pcie->txq[trans->shrd->cmd_queue].q.read_ptr,
		  trans_pcie->txq[trans_pcie->cmd_queue].q.read_ptr,
		  trans_pcie->txq[trans->shrd->cmd_queue].q.write_ptr)) {
		  trans_pcie->txq[trans_pcie->cmd_queue].q.write_ptr)) {
		iwl_print_hex_error(trans, pkt, 32);
		iwl_print_hex_error(trans, pkt, 32);
		return;
		return;
	}
	}
@@ -997,7 +997,7 @@ static int iwl_send_cmd_sync(struct iwl_trans *trans, struct iwl_host_cmd *cmd)
	if (!ret) {
	if (!ret) {
		if (test_bit(STATUS_HCMD_ACTIVE, &trans->shrd->status)) {
		if (test_bit(STATUS_HCMD_ACTIVE, &trans->shrd->status)) {
			struct iwl_tx_queue *txq =
			struct iwl_tx_queue *txq =
				&trans_pcie->txq[trans->shrd->cmd_queue];
				&trans_pcie->txq[trans_pcie->cmd_queue];
			struct iwl_queue *q = &txq->q;
			struct iwl_queue *q = &txq->q;


			IWL_ERR(trans,
			IWL_ERR(trans,
@@ -1034,7 +1034,7 @@ static int iwl_send_cmd_sync(struct iwl_trans *trans, struct iwl_host_cmd *cmd)
		 * in later, it will possibly set an invalid
		 * in later, it will possibly set an invalid
		 * address (cmd->meta.source).
		 * address (cmd->meta.source).
		 */
		 */
		trans_pcie->txq[trans->shrd->cmd_queue].meta[cmd_idx].flags &=
		trans_pcie->txq[trans_pcie->cmd_queue].meta[cmd_idx].flags &=
							~CMD_WANT_SKB;
							~CMD_WANT_SKB;
	}
	}


@@ -1065,7 +1065,7 @@ int iwl_tx_queue_reclaim(struct iwl_trans *trans, int txq_id, int index,
	int freed = 0;
	int freed = 0;


	/* This function is not meant to release cmd queue*/
	/* This function is not meant to release cmd queue*/
	if (WARN_ON(txq_id == trans->shrd->cmd_queue))
	if (WARN_ON(txq_id == trans_pcie->cmd_queue))
		return 0;
		return 0;


	lockdep_assert_held(&txq->lock);
	lockdep_assert_held(&txq->lock);
Loading