linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhu Yi <yi.zhu@intel.com>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org, Ben Cahill <ben.m.cahill@intel.com>
Subject: Re: [PATCH 12/36] iwlwifi: Partially clean-up, add comments to iwl-*-hw.h
Date: Thu, 29 Nov 2007 11:16:26 +0800	[thread overview]
Message-ID: <1196306186.7614.99.camel@debian.sh.intel.com> (raw)
In-Reply-To: <1196305816-23023-13-git-send-email-yi.zhu@intel.com>

Resend. Replace mail subject due to ML restriction for capital Triple-X
in subject.

On Thu, 2007-11-29 at 11:09 +0800, Zhu Yi wrote:
> From: Ben Cahill <ben.m.cahill@intel.com>
> 
> Partially clean-up, add comments to iwl-XXXX-hw.h
> 
> Signed-off-by: Ben Cahill <ben.m.cahill@intel.com>
> Signed-off-by: Zhu Yi <yi.zhu@intel.com>
> ---
>  drivers/net/wireless/iwlwifi/iwl-3945-hw.h |   66 ++++++++++++++++-------
>  drivers/net/wireless/iwlwifi/iwl-4965-hw.h |   78 ++++++++++++++++++----------
>  2 files changed, 97 insertions(+), 47 deletions(-)
> 
> diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-hw.h b/drivers/net/wireless/iwlwifi/iwl-3945-hw.h
> index 243a225..9526129 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-3945-hw.h
> +++ b/drivers/net/wireless/iwlwifi/iwl-3945-hw.h
> @@ -64,10 +64,11 @@
>  #ifndef __iwl_3945_hw__
>  #define __iwl_3945_hw__
>  
> -/* uCode queue management definitions */
> +/*
> + * uCode queue management definitions ...
> + * Queue #4 is the command queue for 3945 and 4965.
> + */
>  #define IWL_CMD_QUEUE_NUM       4
> -#define IWL_CMD_FIFO_NUM        4
> -#define IWL_BACK_QUEUE_FIRST_ID 7
>  
>  /* Tx rates */
>  #define IWL_CCK_RATES 4
> @@ -314,7 +315,6 @@ struct iwl3945_eeprom {
>  
>  	u8 reserved9[194];
>  
> -
>  /*
>   * 3945 Txpower calibration data.
>   */
> @@ -355,7 +355,18 @@ struct iwl3945_eeprom {
>  #define CSR_GPIO_IN             (CSR_BASE+0x018) /* read external chip pins */
>  #define CSR_RESET               (CSR_BASE+0x020) /* busmaster enable, NMI, etc*/
>  #define CSR_GP_CNTRL            (CSR_BASE+0x024)
> +
> +/*
> + * Hardware revision info
> + * Bit fields:
> + * 31-8:  Reserved
> + *  7-4:  Type of device:  0x0 = 4965, 0xd = 3945
> + *  3-2:  Revision step:  0 = A, 1 = B, 2 = C, 3 = D
> + *  1-0:  "Dash" value, as in A-1, etc.
> + */
>  #define CSR_HW_REV              (CSR_BASE+0x028)
> +
> +/* EEPROM reads */
>  #define CSR_EEPROM_REG          (CSR_BASE+0x02c)
>  #define CSR_EEPROM_GP           (CSR_BASE+0x030)
>  #define CSR_GP_UCODE		(CSR_BASE+0x044)
> @@ -363,13 +374,13 @@ struct iwl3945_eeprom {
>  #define CSR_UCODE_DRV_GP1_SET   (CSR_BASE+0x058)
>  #define CSR_UCODE_DRV_GP1_CLR   (CSR_BASE+0x05c)
>  #define CSR_UCODE_DRV_GP2       (CSR_BASE+0x060)
> -#define CSR_LED_REG		(CSR_BASE+0x094)
> -#define CSR_DRAM_INT_TBL_CTL	(CSR_BASE+0x0A0)
>  #define CSR_GIO_CHICKEN_BITS    (CSR_BASE+0x100)
> +
> +/* Analog phase-lock-loop configuration (3945 only)
> + * Set bit 24. */
>  #define CSR_ANA_PLL_CFG         (CSR_BASE+0x20c)
> -#define CSR_HW_REV_WA_REG	(CSR_BASE+0x22C)
>  
> -/* HW I/F configuration */
> +/* Bits for CSR_HW_IF_CONFIG_REG */
>  #define CSR_HW_IF_CONFIG_REG_BIT_ALMAGOR_MB         (0x00000100)
>  #define CSR_HW_IF_CONFIG_REG_BIT_ALMAGOR_MM         (0x00000200)
>  #define CSR_HW_IF_CONFIG_REG_BIT_SKU_MRC            (0x00000400)
> @@ -468,31 +479,46 @@ struct iwl3945_eeprom {
>  /* CSR_ANA_PLL_CFG */
>  #define CSR_ANA_PLL_CFG_SH		(0x00880300)
>  
> -#define CSR_LED_REG_TRUN_ON		(0x00000078)
> -#define CSR_LED_REG_TRUN_OFF		(0x00000038)
> -#define CSR_LED_BSM_CTRL_MSK		(0xFFFFFFDF)
> -
> -/* DRAM_INT_TBL_CTRL */
> -#define CSR_DRAM_INT_TBL_CTRL_EN	(1<<31)
> -#define CSR_DRAM_INT_TBL_CTRL_WRAP_CHK	(1<<27)
> -
>  /*=== HBUS (Host-side Bus) ===*/
>  #define HBUS_BASE	(0x400)
>  
> +/*
> + * Registers for accessing device's internal SRAM memory (e.g. SCD SRAM
> + * structures, error log, event log, verifying uCode load).
> + * First write to address register, then read from or write to data register
> + * to complete the job.  Once the address register is set up, accesses to
> + * data registers auto-increment the address by one dword.
> + * Bit usage for address registers (read or write):
> + *  0-31:  memory address within device
> + */
>  #define HBUS_TARG_MEM_RADDR     (HBUS_BASE+0x00c)
>  #define HBUS_TARG_MEM_WADDR     (HBUS_BASE+0x010)
>  #define HBUS_TARG_MEM_WDAT      (HBUS_BASE+0x018)
>  #define HBUS_TARG_MEM_RDAT      (HBUS_BASE+0x01c)
> +
> +/*
> + * Registers for accessing device's internal peripheral registers
> + * (e.g. SCD, BSM, etc.).  First write to address register,
> + * then read from or write to data register to complete the job.
> + * Bit usage for address registers (read or write):
> + *  0-15:  register address (offset) within device
> + * 24-25:  (# bytes - 1) to read or write (e.g. 3 for dword)
> + */
>  #define HBUS_TARG_PRPH_WADDR    (HBUS_BASE+0x044)
>  #define HBUS_TARG_PRPH_RADDR    (HBUS_BASE+0x048)
>  #define HBUS_TARG_PRPH_WDAT     (HBUS_BASE+0x04c)
>  #define HBUS_TARG_PRPH_RDAT     (HBUS_BASE+0x050)
> -#define HBUS_TARG_WRPTR         (HBUS_BASE+0x060)
> -
> -#define HBUS_TARG_MBX_C         (HBUS_BASE+0x030)
>  
> +/*
> + * Per-Tx-queue write pointer (index, really!) (3945 and 4965).
> + * Indicates index to next TFD that driver will fill (1 past latest filled).
> + * Bit usage:
> + *  0-7:  queue write index
> + * 11-8:  queue selector
> + */
> +#define HBUS_TARG_WRPTR         (HBUS_BASE+0x060)
>  
> -/* SCD (Scheduler) */
> +/* SCD (3945 Tx Frame Scheduler) */
>  #define SCD_BASE                        (CSR_BASE + 0x2E00)
>  
>  #define SCD_MODE_REG                    (SCD_BASE + 0x000)
> diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-hw.h b/drivers/net/wireless/iwlwifi/iwl-4965-hw.h
> index 93e2dff..2f0da4d 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-4965-hw.h
> +++ b/drivers/net/wireless/iwlwifi/iwl-4965-hw.h
> @@ -64,7 +64,12 @@
>  #ifndef __iwl_4965_hw_h__
>  #define __iwl_4965_hw_h__
>  
> -/* uCode queue management definitions */
> +/*
> + * uCode queue management definitions ...
> + * Queue #4 is the command queue for 3945 and 4965; map it to Tx FIFO chnl 4.
> + * The first queue used for block-ack aggregation is #7 (4965 only).
> + * All block-ack aggregation queues should map to Tx DMA/FIFO channel 7.
> + */
>  #define IWL_CMD_QUEUE_NUM       4
>  #define IWL_CMD_FIFO_NUM        4
>  #define IWL_BACK_QUEUE_FIRST_ID 7
> @@ -444,7 +449,20 @@ struct iwl4965_eeprom {
>  #define CSR_GPIO_IN             (CSR_BASE+0x018) /* read external chip pins */
>  #define CSR_RESET               (CSR_BASE+0x020) /* busmaster enable, NMI, etc*/
>  #define CSR_GP_CNTRL            (CSR_BASE+0x024)
> +
> +/*
> + * Hardware revision info
> + * Bit fields:
> + * 31-8:  Reserved
> + *  7-4:  Type of device:  0x0 = 4965, 0xd = 3945
> + *  3-2:  Revision step:  0 = A, 1 = B, 2 = C, 3 = D
> + *  1-0:  "Dash" value, as in A-1, etc.
> + *
> + * NOTE:  Revision step affects calculation of CCK txpower for 4965.
> + */
>  #define CSR_HW_REV              (CSR_BASE+0x028)
> +
> +/* EEPROM reads */
>  #define CSR_EEPROM_REG          (CSR_BASE+0x02c)
>  #define CSR_EEPROM_GP           (CSR_BASE+0x030)
>  #define CSR_GP_UCODE		(CSR_BASE+0x044)
> @@ -452,10 +470,13 @@ struct iwl4965_eeprom {
>  #define CSR_UCODE_DRV_GP1_SET   (CSR_BASE+0x058)
>  #define CSR_UCODE_DRV_GP1_CLR   (CSR_BASE+0x05c)
>  #define CSR_UCODE_DRV_GP2       (CSR_BASE+0x060)
> -#define CSR_LED_REG		(CSR_BASE+0x094)
> -#define CSR_DRAM_INT_TBL_CTL	(CSR_BASE+0x0A0)
>  #define CSR_GIO_CHICKEN_BITS    (CSR_BASE+0x100)
> -#define CSR_ANA_PLL_CFG         (CSR_BASE+0x20c)
> +
> +/*
> + * Indicates hardware rev, to determine CCK backoff for txpower calculation.
> + * Bit fields:
> + *  3-2:  0 = A, 1 = B, 2 = C, 3 = D step
> + */
>  #define CSR_HW_REV_WA_REG	(CSR_BASE+0x22C)
>  
>  /* HW I/F configuration */
> @@ -554,44 +575,47 @@ struct iwl4965_eeprom {
>  #define CSR_GIO_CHICKEN_BITS_REG_BIT_L1A_NO_L0S_RX  (0x00800000)
>  #define CSR_GIO_CHICKEN_BITS_REG_BIT_DIS_L0S_EXIT_TIMER  (0x20000000)
>  
> -/* CSR_ANA_PLL_CFG */
> -#define CSR_ANA_PLL_CFG_SH		(0x00880300)
> -
> -#define CSR_LED_REG_TRUN_ON		(0x00000078)
> -#define CSR_LED_REG_TRUN_OFF		(0x00000038)
> -#define CSR_LED_BSM_CTRL_MSK		(0xFFFFFFDF)
> -
> -/* DRAM_INT_TBL_CTRL */
> -#define CSR_DRAM_INT_TBL_CTRL_EN	(1<<31)
> -#define CSR_DRAM_INT_TBL_CTRL_WRAP_CHK	(1<<27)
> -
>  /*=== HBUS (Host-side Bus) ===*/
>  #define HBUS_BASE	(0x400)
>  
> +/*
> + * Registers for accessing device's internal SRAM memory (e.g. SCD SRAM
> + * structures, error log, event log, verifying uCode load).
> + * First write to address register, then read from or write to data register
> + * to complete the job.  Once the address register is set up, accesses to
> + * data registers auto-increment the address by one dword.
> + * Bit usage for address registers (read or write):
> + *  0-31:  memory address within device
> + */
>  #define HBUS_TARG_MEM_RADDR     (HBUS_BASE+0x00c)
>  #define HBUS_TARG_MEM_WADDR     (HBUS_BASE+0x010)
>  #define HBUS_TARG_MEM_WDAT      (HBUS_BASE+0x018)
>  #define HBUS_TARG_MEM_RDAT      (HBUS_BASE+0x01c)
> +
> +/*
> + * Registers for accessing device's internal peripheral registers
> + * (e.g. SCD, BSM, etc.).  First write to address register,
> + * then read from or write to data register to complete the job.
> + * Bit usage for address registers (read or write):
> + *  0-15:  register address (offset) within device
> + * 24-25:  (# bytes - 1) to read or write (e.g. 3 for dword)
> + */
>  #define HBUS_TARG_PRPH_WADDR    (HBUS_BASE+0x044)
>  #define HBUS_TARG_PRPH_RADDR    (HBUS_BASE+0x048)
>  #define HBUS_TARG_PRPH_WDAT     (HBUS_BASE+0x04c)
>  #define HBUS_TARG_PRPH_RDAT     (HBUS_BASE+0x050)
> +
> +/*
> + * Per-Tx-queue write pointer (index, really!) (3945 and 4965).
> + * Indicates index to next TFD that driver will fill (1 past latest filled).
> + * Bit usage:
> + *  0-7:  queue write index (0-255)
> + * 11-8:  queue selector (0-15)
> + */
>  #define HBUS_TARG_WRPTR         (HBUS_BASE+0x060)
>  
>  #define HBUS_TARG_MBX_C         (HBUS_BASE+0x030)
>  
> -
> -/* SCD (Scheduler) */
> -#define SCD_BASE                        (CSR_BASE + 0x2E00)
> -
> -#define SCD_MODE_REG                    (SCD_BASE + 0x000)
> -#define SCD_ARASTAT_REG                 (SCD_BASE + 0x004)
> -#define SCD_TXFACT_REG                  (SCD_BASE + 0x010)
> -#define SCD_TXF4MF_REG                  (SCD_BASE + 0x014)
> -#define SCD_TXF5MF_REG                  (SCD_BASE + 0x020)
> -#define SCD_SBYP_MODE_1_REG             (SCD_BASE + 0x02C)
> -#define SCD_SBYP_MODE_2_REG             (SCD_BASE + 0x030)
> -
>  /*=== FH (data Flow Handler) ===*/
>  #define FH_BASE     (0x800)
>  

      parent reply	other threads:[~2007-11-29  3:16 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1196305816-23023-1-git-send-email-yi.zhu@intel.com>
2007-11-29  3:09 ` [PATCH 01/36] iwlwifi: Support for uCode without init and bsm section Zhu Yi
2007-11-29  3:09   ` [PATCH 02/36] iwlwifi: continue namespace changes - fix CONFIG variables Zhu Yi
2007-11-29  3:09     ` [PATCH 03/36] iwl3945: re-align 3945 event log data Zhu Yi
2007-11-29  3:09       ` [PATCH 04/36] iwl4965: add comments to rate scaling code Zhu Yi
2007-11-29  3:09         ` [PATCH 05/36] iwlwifi: add comments to EEPROM stuff Zhu Yi
2007-11-29  3:09           ` [PATCH 06/36] iwl-4965-hw.h: clean up unused eeprom structures and definitions Zhu Yi
2007-11-29  3:09             ` [PATCH 07/36] iwlwifi: clean up and clarify some comments after 3945/4965 split Zhu Yi
2007-11-29  3:09               ` [PATCH 08/36] iwlwifi: Move is_legacy() macro family from iwl-4965-hw.h to iwl-4965-rs.h Zhu Yi
2007-11-29  3:09                 ` [PATCH 09/36] iwlwifi: Add comments to some driver data structures Zhu Yi
2007-11-29  3:09                   ` [PATCH 10/36] iwlwifi: Document 4965 rate_n_flags bits Zhu Yi
2007-11-29  3:09                     ` [PATCH 11/36] iwlwifi: Document Rx calibration Zhu Yi
     [not found]                       ` <1196305816-23023-13-git-send-email-yi.zhu@intel.com>
2007-11-29  3:09                         ` [PATCH 13/36] iwlwifi: clean up some unused definitions in iwl-4965.h and iwl-3945.h Zhu Yi
2007-11-29  3:09                           ` [PATCH 14/36] iwlwifi: add comments, mostly on Tx queues Zhu Yi
     [not found]                             ` <1196305816-23023-16-git-send-email-yi.zhu@intel.com>
2007-11-29  3:09                               ` [PATCH 16/36] iwlwifi: fix possibly NULL dereference in iwl_set_rate() Zhu Yi
2007-11-29  3:09                                 ` [PATCH 17/36] iwlwifi: Clean up unused definitions in iwl-3945-hw.h Zhu Yi
2007-11-29  3:09                                   ` [PATCH 18/36] iwlwifi: clean up unused definitions in iwl-4965-hw.h Zhu Yi
2007-11-29  3:09                                     ` [PATCH 19/36] iwlwifi: move uCode API definitions to iwl-4965-commands.h Zhu Yi
2007-11-29  3:10                                       ` [PATCH 20/36] iwlwifi: move HT_IE_EXT_CHANNEL_* driver definitions to iwl-4965.h Zhu Yi
2007-11-29  3:10                                         ` [PATCH 21/36] iwlwifi: document temperature calculation Zhu Yi
2007-11-29  3:10                                           ` [PATCH 22/36] iwlwifi: document txpower calculations Zhu Yi
2007-11-29  3:10                                             ` [PATCH 23/36] iwlwifi: document keep-warm buffer Zhu Yi
2007-11-29  3:10                                               ` [PATCH 24/36] iwlwifi: document Rx registers Zhu Yi
2007-11-29  3:10                                                 ` [PATCH 25/36] iwlwifi: document Tx registers Zhu Yi
2007-11-29  3:10                                                   ` [PATCH 26/36] iwlwifi: document shared Tx structures Zhu Yi
2007-11-29  3:10                                                     ` [PATCH 27/36] iwlwifi: document 4965 Tx scheduler Zhu Yi
2007-11-29  3:10                                                       ` [PATCH 28/36] iwlwifi: document command header and "alive" responses Zhu Yi
2007-11-29  3:10                                                         ` [PATCH 29/36] iwlwifi: add comments to RXON command and txpower formats Zhu Yi
2007-11-29  3:10                                                           ` [PATCH 30/36] iwlwifi: add comments to QOS and ADD_STA commands Zhu Yi
2007-11-29  3:10                                                             ` [PATCH 31/36] iwlwifi: add comments to Tx commands Zhu Yi
2007-11-29  3:10                                                               ` [PATCH 32/36] iwlwifi: document 4965 rate scaling Zhu Yi
2007-11-29  3:10                                                                 ` [PATCH 33/36] iwlwifi: enhance WPA authenication stability Zhu Yi
2007-11-29  3:10                                                                   ` [PATCH 34/36] iwlwifi: fix ucode assertion for RX queue overrun Zhu Yi
2007-11-29  3:10                                                                     ` [PATCH 35/36] iwlwifi: avoid firmware command sending if rfkill is enabled Zhu Yi
2007-11-29  3:10                                                                       ` [PATCH 36/36] iwlwifi: update version number to 1.2.22 Zhu Yi
2007-11-29  3:17                               ` [PATCH 15/36] iwlwifi: add comments to iwl*-base.c Zhu Yi
2007-11-29  3:16                         ` Zhu Yi [this message]

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=1196306186.7614.99.camel@debian.sh.intel.com \
    --to=yi.zhu@intel.com \
    --cc=ben.m.cahill@intel.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).