qlcnic: replace magic numbers with defines
authorSony Chacko <sony.chacko@qlogic.com>
Thu, 19 Aug 2010 05:08:24 +0000 (05:08 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 19 Aug 2010 23:52:38 +0000 (16:52 -0700)
Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/qlcnic/qlcnic.h
drivers/net/qlcnic/qlcnic_hdr.h
drivers/net/qlcnic/qlcnic_init.c
drivers/net/qlcnic/qlcnic_main.c

index 5c549c5c2dd7810104a9f43ee5d0f4090654434c..d19836758c6eb84bdd9ebe07c149a86cf4be6b7a 100644 (file)
 
 #define DEFAULT_RCV_DESCRIPTORS_1G     2048
 #define DEFAULT_RCV_DESCRIPTORS_10G    4096
+#define MAX_RDS_RINGS                   2
 
 #define get_next_index(index, length)  \
        (((index) + 1) & ((length) - 1))
index bd346d9aac94cc5d1e6895af64ffdb86fbcd8da9..39db4df0f650bc55f686045b26a6f168d0033ac9 100644 (file)
@@ -745,6 +745,10 @@ enum {
 #define FW_POLL_DELAY          (1 * HZ)
 #define FW_FAIL_THRESH         2
 
+#define QLCNIC_RESET_TIMEOUT_SECS      10
+#define QLCNIC_INIT_TIMEOUT_SECS       30
+
+
 #define        ISR_MSI_INT_TRIGGER(FUNC) (QLCNIC_PCIX_PS_REG(PCIX_MSI_F(FUNC)))
 #define ISR_LEGACY_INT_TRIGGERED(VAL)  (((VAL) & 0x300) == 0x200)
 
index 08da25895fad17d26c8b8ff83e214c73d6ccbea7..90766757c3148792db61c317be7f2b75f461d363 100644 (file)
@@ -553,12 +553,12 @@ qlcnic_setup_idc_param(struct qlcnic_adapter *adapter) {
        }
        adapter->physical_port = (val >> 2);
        if (qlcnic_rom_fast_read(adapter, QLCNIC_ROM_DEV_INIT_TIMEOUT, &timeo))
-               timeo = 30;
+               timeo = QLCNIC_INIT_TIMEOUT_SECS;
 
        adapter->dev_init_timeo = timeo;
 
        if (qlcnic_rom_fast_read(adapter, QLCNIC_ROM_DRV_RESET_TIMEOUT, &timeo))
-               timeo = 10;
+               timeo = QLCNIC_RESET_TIMEOUT_SECS;
 
        adapter->reset_ack_timeo = timeo;
 
index beadf2e411308225f0002334989f503e6373ad0c..c6f19c961c3d9f888e5ce42dec2a5f5447a324bd 100644 (file)
@@ -754,7 +754,7 @@ qlcnic_check_options(struct qlcnic_adapter *adapter)
 
        adapter->num_txd = MAX_CMD_DESCRIPTORS;
 
-       adapter->max_rds_rings = 2;
+       adapter->max_rds_rings = MAX_RDS_RINGS;
 }
 
 static int