iwlwifi: arrange max number of Tx queues
authorRon Rindjunsky <ron.rindjunsky@intel.com>
Tue, 15 Apr 2008 23:01:45 +0000 (16:01 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 16 Apr 2008 20:00:01 +0000 (16:00 -0400)
This patch increases the max possible number of Tx queues, but leaves
current used number of queues as HW dependent

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

index 368da9852aab2e61c00a764efd4d90ff0f350338..ad612a8719f447afb6f8b109e089e7d0da1fe17d 100644 (file)
@@ -456,7 +456,7 @@ struct iwl3945_eeprom {
 /* Size of uCode instruction memory in bootstrap state machine */
 #define IWL_MAX_BSM_SIZE ALM_RTC_INST_SIZE
 
-#define IWL_MAX_NUM_QUEUES     8
+#define IWL39_MAX_NUM_QUEUES   8
 
 static inline int iwl3945_hw_valid_rtc_data_addr(u32 addr)
 {
index 3dc7f0fbf02f866d215fc39d9447972f1072828e..45c1c5533bf0c549ea08d9c0fd23f5f98c3f6bab 100644 (file)
@@ -687,6 +687,8 @@ enum {
 
 #endif
 
+#define IWL_MAX_NUM_QUEUES IWL39_MAX_NUM_QUEUES
+
 struct iwl3945_priv {
 
        /* ieee device used by generic ieee processing code */
index 3d098da25fc9eadd6aba2531f034fdf8f2123b45..1a66b508a8eaf7efdec1e2c971205437422d64dd 100644 (file)
@@ -1385,10 +1385,10 @@ static inline __le32 iwl4965_hw_set_rate_n_flags(u8 rate, u16 flags)
  * up to 7 DMA channels (FIFOs).  Each Tx queue is supported by a circular array
  * in DRAM containing 256 Transmit Frame Descriptors (TFDs).
  */
-#define IWL4965_MAX_WIN_SIZE              64
-#define IWL4965_QUEUE_SIZE               256
-#define IWL4965_NUM_FIFOS                  7
-#define IWL_MAX_NUM_QUEUES                16
+#define IWL4965_MAX_WIN_SIZE   64
+#define IWL4965_QUEUE_SIZE     256
+#define IWL4965_NUM_FIFOS      7
+#define IWL4965_MAX_NUM_QUEUES 16
 
 
 /**
@@ -1553,7 +1553,7 @@ struct iwl4965_sched_queue_byte_cnt_tbl {
  */
 struct iwl4965_shared {
        struct iwl4965_sched_queue_byte_cnt_tbl
-        queues_byte_cnt_tbls[IWL_MAX_NUM_QUEUES];
+        queues_byte_cnt_tbls[IWL4965_MAX_NUM_QUEUES];
        __le32 rb_closed;
 
        /* __le32 rb_closed_stts_rb_num:12; */
index 2e747129f6b012ebd1b4b91e19eb131ce50a5e29..b072523c63eec31ed356cce38176417957c05cbc 100644 (file)
@@ -46,7 +46,7 @@
 
 /* module parameters */
 static struct iwl_mod_params iwl4965_mod_params = {
-       .num_of_queues = IWL_MAX_NUM_QUEUES,
+       .num_of_queues = IWL4965_MAX_NUM_QUEUES,
        .enable_qos = 1,
        .amsdu_size_8K = 1,
        /* the rest are 0 by default */
@@ -2021,10 +2021,10 @@ int iwl4965_alive_notify(struct iwl_priv *priv)
 int iwl4965_hw_set_hw_params(struct iwl_priv *priv)
 {
 
-       if ((priv->cfg->mod_params->num_of_queues > IWL_MAX_NUM_QUEUES) ||
+       if ((priv->cfg->mod_params->num_of_queues > IWL4965_MAX_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, IWL_MAX_NUM_QUEUES);
+                         IWL_MIN_NUM_QUEUES, IWL4965_MAX_NUM_QUEUES);
                return -EINVAL;
        }
 
@@ -4362,7 +4362,7 @@ static void iwl4965_rx_reply_compressed_ba(struct iwl_priv *priv,
         * (in Tx queue's circular buffer) of first TFD/frame in window */
        u16 ba_resp_scd_ssn = le16_to_cpu(ba_resp->scd_ssn);
 
-       if (scd_flow >= ARRAY_SIZE(priv->txq)) {
+       if (scd_flow >= priv->hw_params.max_txq_num) {
                IWL_ERROR("BUG_ON scd_flow is bigger than number of queues");
                return;
        }
index ddcbad59092b0d38bc377e90b67676e607604f0f..9ed13cb0a2a9f0354b95dc04d29ec9e0e517f942 100644 (file)
@@ -941,6 +941,8 @@ enum {
 
 #endif
 
+#define IWL_MAX_NUM_QUEUES     20 /* FIXME: do dynamic allocation */
+
 struct iwl_priv {
 
        /* ieee device used by generic ieee processing code */
index 29a9ecdcbf35f627a7924fe13c6b9adda9ccfa3d..1a5678fe4224de0975592a9edc0f71a75a42fbf5 100644 (file)
@@ -70,7 +70,7 @@ static int iwl3945_param_disable;  /* def: 0 = enable radio */
 static int iwl3945_param_antenna;  /* def: 0 = both antennas (use diversity) */
 int iwl3945_param_hwcrypto;        /* def: 0 = use software encryption */
 static int iwl3945_param_qos_enable = 1; /* def: 1 = use quality of service */
-int iwl3945_param_queues_num = IWL_MAX_NUM_QUEUES; /* def: 8 Tx queues */
+int iwl3945_param_queues_num = IWL39_MAX_NUM_QUEUES; /* def: 8 Tx queues */
 
 /*
  * module name, copyright, version, etc.
@@ -7974,10 +7974,10 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
                iwl3945_hw_ops.hw_scan = NULL;
        }
 
-       if ((iwl3945_param_queues_num > IWL_MAX_NUM_QUEUES) ||
+       if ((iwl3945_param_queues_num > IWL39_MAX_NUM_QUEUES) ||
            (iwl3945_param_queues_num < IWL_MIN_NUM_QUEUES)) {
                IWL_ERROR("invalid queues_num, should be between %d and %d\n",
-                         IWL_MIN_NUM_QUEUES, IWL_MAX_NUM_QUEUES);
+                         IWL_MIN_NUM_QUEUES, IWL39_MAX_NUM_QUEUES);
                err = -EINVAL;
                goto out;
        }
This page took 0.049048 seconds and 5 git commands to generate.