]> err.no Git - linux-2.6/commitdiff
iwlwifi-5000: adding iwl5000 HW parameters
authorTomas Winkler <tomas.winkler@intel.com>
Thu, 24 Apr 2008 18:55:28 +0000 (11:55 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 7 May 2008 19:02:24 +0000 (15:02 -0400)
This patch adds iwl 5000 HW parameters

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl-4965-commands.h
drivers/net/wireless/iwlwifi/iwl-5000-hw.h
drivers/net/wireless/iwlwifi/iwl-5000.c

index 6b2d6bfec1e55293f408481d32c69f120534c71d..d0e3f35d4984792bc49715f4ecc33f610b7ca652 100644 (file)
@@ -712,6 +712,8 @@ struct iwl4965_qosparam_cmd {
 #define        IWL_STA_ID              2
 #define IWL4965_BROADCAST_ID   31
 #define        IWL4965_STATION_COUNT   32
+#define IWL5000_BROADCAST_ID   15
+#define        IWL5000_STATION_COUNT   16
 
 #define        IWL_STATION_COUNT       32      /* MAX(3945,4965)*/
 #define        IWL_INVALID_STATION     255
index 5cf8a684b3e1cb7e0d8f8dc85e661459825f42e2..31592fb8ddfdd53eb041dc9b446dcb76520db966 100644 (file)
 #ifndef __iwl_5000_hw_h__
 #define __iwl_5000_hw_h__
 
+#define IWL50_RTC_INST_UPPER_BOUND             (0x020000)
+#define IWL50_RTC_DATA_UPPER_BOUND             (0x80C000)
+#define IWL50_RTC_INST_SIZE (IWL50_RTC_INST_UPPER_BOUND - RTC_INST_LOWER_BOUND)
+#define IWL50_RTC_DATA_SIZE (IWL50_RTC_DATA_UPPER_BOUND - RTC_DATA_LOWER_BOUND)
+
 /* EERPROM */
 #define IWL_5000_EEPROM_IMG_SIZE                       2048
 
 #define IWL50_NUM_QUEUES                  20
 #define IWL50_BACK_QUEUE_FIRST_ID         10
 
+/* Fixed (non-configurable) rx data from phy */
+
+/* Base physical address of iwl5000_shared is provided to SCD_DRAM_BASE_ADDR
+ * and &iwl5000_shared.val0 is provided to FH_RSCSR_CHNL0_STTS_WPTR_REG */
+struct iwl5000_sched_queue_byte_cnt_tbl {
+       struct iwl4965_queue_byte_cnt_entry tfd_offset[IWL50_QUEUE_SIZE +
+                                                      IWL50_MAX_WIN_SIZE];
+} __attribute__ ((packed));
+
+struct iwl5000_shared {
+       struct iwl5000_sched_queue_byte_cnt_tbl
+        queues_byte_cnt_tbls[IWL50_NUM_QUEUES];
+       __le32 rb_closed;
+
+       /* __le32 rb_closed_stts_rb_num:12; */
+#define IWL_rb_closed_stts_rb_num_POS 0
+#define IWL_rb_closed_stts_rb_num_LEN 12
+#define IWL_rb_closed_stts_rb_num_SYM rb_closed
+       /* __le32 rsrv1:4; */
+       /* __le32 rb_closed_stts_rx_frame_num:12; */
+#define IWL_rb_closed_stts_rx_frame_num_POS 16
+#define IWL_rb_closed_stts_rx_frame_num_LEN 12
+#define IWL_rb_closed_stts_rx_frame_num_SYM rb_closed
+       /* __le32 rsrv2:4; */
+
+       __le32 frm_finished;
+       /* __le32 frame_finished_stts_rb_num:12; */
+#define IWL_frame_finished_stts_rb_num_POS 0
+#define IWL_frame_finished_stts_rb_num_LEN 12
+#define IWL_frame_finished_stts_rb_num_SYM frm_finished
+       /* __le32 rsrv3:4; */
+       /* __le32 frame_finished_stts_rx_frame_num:12; */
+#define IWL_frame_finished_stts_rx_frame_num_POS 16
+#define IWL_frame_finished_stts_rx_frame_num_LEN 12
+#define IWL_frame_finished_stts_rx_frame_num_SYM frm_finished
+       /* __le32 rsrv4:4; */
+
+       __le32 padding1;  /* so that allocation will be aligned to 16B */
+       __le32 padding2;
+} __attribute__ ((packed));
+
+
 #endif /* __iwl_5000_hw_h__ */
 
index 91b3e563bbea9a9b65db23d4882b39a13756be0f..545970b0caa10633a69ce16693229ca8c9711cc1 100644 (file)
@@ -133,8 +133,56 @@ static const u8 *iwl5000_eeprom_query_addr(const struct iwl_priv *priv,
        return &priv->eeprom[address];
 }
 
+static int iwl5000_hw_set_hw_params(struct iwl_priv *priv)
+{
+       if ((priv->cfg->mod_params->num_of_queues > IWL50_NUM_QUEUES) ||
+           (priv->cfg->mod_params->num_of_queues < IWL_MIN_NUM_QUEUES)) {
+               IWL_ERROR("invalid queues_num, should be between %d and %d\n",
+                         IWL_MIN_NUM_QUEUES, IWL50_NUM_QUEUES);
+               return -EINVAL;
+       }
 
-
+       priv->hw_params.max_txq_num = priv->cfg->mod_params->num_of_queues;
+       priv->hw_params.sw_crypto = priv->cfg->mod_params->sw_crypto;
+       priv->hw_params.tx_cmd_len = sizeof(struct iwl4965_tx_cmd);
+       priv->hw_params.max_rxq_size = RX_QUEUE_SIZE;
+       priv->hw_params.max_rxq_log = RX_QUEUE_SIZE_LOG;
+       if (priv->cfg->mod_params->amsdu_size_8K)
+               priv->hw_params.rx_buf_size = IWL_RX_BUF_SIZE_8K;
+       else
+               priv->hw_params.rx_buf_size = IWL_RX_BUF_SIZE_4K;
+       priv->hw_params.max_pkt_size = priv->hw_params.rx_buf_size - 256;
+       priv->hw_params.max_stations = IWL5000_STATION_COUNT;
+       priv->hw_params.bcast_sta_id = IWL5000_BROADCAST_ID;
+       priv->hw_params.max_data_size = IWL50_RTC_DATA_SIZE;
+       priv->hw_params.max_inst_size = IWL50_RTC_INST_SIZE;
+       priv->hw_params.max_bsm_size = BSM_SRAM_SIZE;
+       priv->hw_params.fat_channel =  BIT(IEEE80211_BAND_2GHZ) |
+                                       BIT(IEEE80211_BAND_5GHZ);
+
+       switch (priv->hw_rev & CSR_HW_REV_TYPE_MSK) {
+       case CSR_HW_REV_TYPE_5100:
+       case CSR_HW_REV_TYPE_5150:
+               priv->hw_params.tx_chains_num = 1;
+               priv->hw_params.rx_chains_num = 2;
+               /* FIXME: move to ANT_A, ANT_B, ANT_C enum */
+               priv->hw_params.valid_tx_ant = IWL_ANTENNA_MAIN;
+               priv->hw_params.valid_rx_ant = (IWL_ANTENNA_MAIN |
+                                               IWL_ANTENNA_AUX);
+               break;
+       case CSR_HW_REV_TYPE_5300:
+       case CSR_HW_REV_TYPE_5350:
+               priv->hw_params.tx_chains_num = 3;
+               priv->hw_params.rx_chains_num = 3;
+               /* FIXME: move to ANT_A, ANT_B, ANT_C enum */
+               priv->hw_params.valid_tx_ant = (IWL_ANTENNA_MAIN |
+                                               IWL_ANTENNA_AUX | 0x04);
+               priv->hw_params.valid_rx_ant = (IWL_ANTENNA_MAIN |
+                                               IWL_ANTENNA_AUX | 0x04);
+               break;
+       }
+       return 0;
+}
 static struct iwl_hcmd_ops iwl5000_hcmd = {
 };
 
@@ -142,6 +190,7 @@ static struct iwl_hcmd_utils_ops iwl5000_hcmd_utils = {
 };
 
 static struct iwl_lib_ops iwl5000_lib = {
+       .set_hw_params = iwl5000_hw_set_hw_params,
        .apm_ops = {
                .init = iwl5000_apm_init,
                .set_pwr_src = iwl4965_set_pwr_src,