All of lore.kernel.org
 help / color / mirror / Atom feed
From: "John W. Linville" <linville@tuxdriver.com>
To: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Cc: linux-wireless@vger.kernel.org,
	Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Subject: Re: [PATCH RESEND 33/35] iwlwifi: restore PAN support
Date: Thu, 8 Mar 2012 14:20:00 -0500	[thread overview]
Message-ID: <20120308192000.GB2469@tuxdriver.com> (raw)
In-Reply-To: <1331142764-5750-33-git-send-email-wey-yi.w.guy@intel.com>

This one didn't apply either.  Please check against wireless-next.

Thanks,

John

On Wed, Mar 07, 2012 at 09:52:41AM -0800, Wey-Yi Guy wrote:
> From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
> 
> in iwlwifi: move setting up fw parameters
> 
> Meenakshi moved code up to configure the transport layer, but this
> code read the sku before it was set (from the EEPROM). This killed
> P2P.
> Only the ucode_flags are needed to configure the transport layer, not
> the sku which _must_ be set after the EEPROM is read.
> 
> We need to reconfigure the transport in case the EEPROM disabled PAN
> support. This is not the nicest thing to do, but we have no choice.
> Document that we are allowed to configure the transport several times
> before start_fw, but not after.
> 
> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
> ---
>  drivers/net/wireless/iwlwifi/iwl-agn.c   |   59 +++++++++++++++---------------
>  drivers/net/wireless/iwlwifi/iwl-trans.h |    3 +-
>  2 files changed, 32 insertions(+), 30 deletions(-)
> 
> diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
> index f150edc..3793dc4 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-agn.c
> +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
> @@ -1206,35 +1206,17 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
>  	/* TODO: remove fw from shared data later */
>  	priv->shrd->fw = fw;
>  
> -	/************************
> -	 * 2. Setup HW constants
> -	 ************************/
> -	iwl_set_hw_params(priv);
> +	/*
> +	 * Populate the state variables that the transport layer needs
> +	 * to know about.
> +	 */
> +	trans_cfg.op_mode = op_mode;
>  
>  	ucode_flags = fw->ucode_capa.flags;
>  
>  #ifndef CONFIG_IWLWIFI_P2P
>  	ucode_flags &= ~IWL_UCODE_TLV_FLAGS_PAN;
>  #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;
> -
> -
> -	/*****************************
> -	 * Configure transport layer
> -	 *****************************/
> -	/*
> -	 * Populate the state variables that the transport layer needs
> -	 * to know about.
> -	 */
> -	trans_cfg.op_mode = op_mode;
>  
>  	if (ucode_flags & IWL_UCODE_TLV_FLAGS_PAN) {
>  		priv->sta_key_max_num = STA_KEY_MAX_NUM_PAN;
> @@ -1277,7 +1259,7 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
>  	spin_lock_init(&priv->statistics.lock);
>  
>  	/***********************
> -	 * 3. Read REV register
> +	 * 2. Read REV register
>  	 ***********************/
>  	IWL_INFO(priv, "Detected %s, REV=0x%X\n",
>  		cfg(priv)->name, trans(priv)->hw_rev);
> @@ -1287,9 +1269,8 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
>  		goto out_free_traffic_mem;
>  
>  	/*****************
> -	 * 4. Read EEPROM
> +	 * 3. Read EEPROM
>  	 *****************/
> -	/* Read the EEPROM */
>  	err = iwl_eeprom_init(trans(priv), trans(priv)->hw_rev);
>  	/* Reset chip to save power until we load uCode during "up". */
>  	iwl_trans_stop_hw(trans(priv));
> @@ -1318,8 +1299,28 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
>  		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);
> @@ -1328,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. */
>  
>  	/********************
> -	 * 7. Setup services
> +	 * 6. Setup services
>  	 ********************/
>  	iwl_setup_deferred_work(priv);
>  	iwl_setup_rx_handlers(priv);
> @@ -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...
>  	 *
> -	 * 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);
>  	if (err)
> diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h
> index a40c272..7d1990c 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-trans.h
> +++ b/drivers/net/wireless/iwlwifi/iwl-trans.h
> @@ -335,7 +335,8 @@ struct iwl_trans_config {
>   * @write32: write a u32 to a register at offset ofs from the BAR
>   * @read32: read a u32 register at offset ofs from the BAR
>   * @configure: configure parameters required by the transport layer from
> - *	the op_mode.
> + *	the op_mode. May be called several times before start_fw, can't be
> + *	called after that.
>   */
>  struct iwl_trans_ops {
>  
> -- 
> 1.7.0.4
> 
> 

-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

  reply	other threads:[~2012-03-08 19:32 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-07 17:52 [PATCH 00/35] update for 3.4: iwlwifi 2012-03-07 Wey-Yi Guy
2012-03-07 17:52 ` [PATCH RESEND 01/35] iwlwifi: remove unused arguments from iwlagn_gain_computation Wey-Yi Guy
2012-03-07 17:52 ` [PATCH RESEND 02/35] iwlwifi: remove unused argument from rs_initialize_lq Wey-Yi Guy
2012-03-07 17:52 ` [PATCH RESEND 03/35] iwlwifi: move iwl_sta_id_or_broadcast to user Wey-Yi Guy
2012-03-07 17:52 ` [PATCH RESEND 04/35] iwlwifi: remove unused argument from iwl_init_hw_rates Wey-Yi Guy
2012-03-07 17:52 ` [PATCH RESEND 05/35] iwlwifi: remove two unused arguments in testmode Wey-Yi Guy
2012-03-07 17:52 ` [PATCH RESEND 06/35] iwlwifi: remove unused argument from iwlagn_suspend Wey-Yi Guy
2012-03-07 17:52 ` [PATCH RESEND 07/35] iwlwifi: redesign PASSIVE_NO_RX workaround Wey-Yi Guy
2012-03-07 17:52 ` [PATCH RESEND 08/35] iwlwifi: transport's tx_agg_disable must be atomic Wey-Yi Guy
2012-03-07 17:52 ` [PATCH RESEND 09/35] iwlwifi: remove BT handlers from lib_ops Wey-Yi Guy
2012-03-07 17:52 ` [PATCH RESEND 10/35] iwlwifi: move BT/HT params to shared Wey-Yi Guy
2012-03-07 17:52 ` [PATCH RESEND 11/35] iwlwifi: make EEPROM enhanced TX power a bool Wey-Yi Guy
2012-03-07 17:52 ` [PATCH RESEND 12/35] iwlwifi: remove unused max_nrg_cck from sensitivity and constify Wey-Yi Guy
2012-03-07 17:52 ` [PATCH RESEND 13/35] iwlwifi: return error if loading uCode failed Wey-Yi Guy
2012-03-07 17:52 ` [PATCH RESEND 14/35] iwlwifi: dump stack when fail to gain access to the device Wey-Yi Guy
2012-03-07 17:52 ` [PATCH RESEND 15/35] iwlwifi: always check if got h/w access before write Wey-Yi Guy
2012-03-07 17:52 ` [PATCH RESEND 16/35] iwlwifi: cleanup/fix memory barriers Wey-Yi Guy
2012-03-07 17:52 ` [PATCH RESEND 17/35] iwlwifi: use writeb,writel,readl directly Wey-Yi Guy
2012-03-07 17:52 ` [PATCH RESEND 18/35] iwlwifi: print DMA stop timeout error only if it happened Wey-Yi Guy
2012-03-07 17:52 ` [PATCH RESEND 19/35] iwlwifi: reintroduce iwl_enable_rfkill_int Wey-Yi Guy
2012-03-07 17:52 ` [PATCH RESEND 20/35] iwlwifi: add testmode command for rx forwarding Wey-Yi Guy
2012-03-07 17:52 ` [PATCH RESEND 21/35] iwlwifi: fixed testmode notifications length Wey-Yi Guy
2012-03-07 17:52 ` [PATCH RESEND 22/35] iwlwifi: add option to test MFP Wey-Yi Guy
2012-03-07 17:52 ` [PATCH RESEND 23/35] iwlwifi: separate status to priv and trans Wey-Yi Guy
2012-03-07 17:52 ` [PATCH RESEND 24/35] iwlwifi: make tx_cmd_pool kmem cache global Wey-Yi Guy
2012-03-07 17:52 ` [PATCH RESEND 25/35] iwlwifi: log stop / wake queues Wey-Yi Guy
2012-03-07 17:52 ` [PATCH RESEND 26/35] iwlwifi: configure transport layer from dvm op mode Wey-Yi Guy
2012-03-07 17:52 ` [PATCH RESEND 27/35] iwlwifi: move setting up fw parameters Wey-Yi Guy
2012-03-07 17:52 ` [PATCH RESEND 28/35] iwlwifi: more status bit factoring Wey-Yi Guy
2012-03-07 17:52 ` [PATCH RESEND 29/35] iwlwifi: move command queue number out of the iwl_shared struct Wey-Yi Guy
2012-03-08 19:19   ` John W. Linville
2012-03-08 20:21     ` Guy, Wey-Yi
2012-03-07 17:52 ` [PATCH RESEND 30/35] iwlwifi: remove messages from queue wake/stop Wey-Yi Guy
2012-03-07 17:52 ` [PATCH RESEND 31/35] iwlwifi: make iwl_init_context static Wey-Yi Guy
2012-03-07 17:52 ` [PATCH RESEND 33/35] iwlwifi: restore PAN support Wey-Yi Guy
2012-03-08 19:20   ` John W. Linville [this message]
2012-03-08 18:29     ` Guy, Wey-Yi
2012-03-07 17:52 ` [PATCH RESEND 33/35] iwlwifi: don't delete AP station directly Wey-Yi Guy
2012-03-07 17:52 ` [PATCH RESEND 34/35] iwlwifi: correct status bit refactoring errors Wey-Yi Guy
2012-03-08 13:55   ` Stanislaw Gruszka
2012-03-08 14:04     ` Johannes Berg
2012-03-07 17:52 ` [PATCH RESEND 35/35] iwlwifi: always monitor for stuck queues Wey-Yi Guy
2012-03-07 20:23 ` [PATCH] iwlwifi: Add __printf verification Joe Perches
2012-03-07 20:23   ` Joe Perches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120308192000.GB2469@tuxdriver.com \
    --to=linville@tuxdriver.com \
    --cc=emmanuel.grumbach@intel.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=wey-yi.w.guy@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.