diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2008-10-24 02:48:55 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-10-31 19:02:27 -0400 |
commit | 127901ab69bbb263fb2b46e850cf20c57ac321d3 (patch) | |
tree | 35ab1fa324ca430ab486e9bc63cfea41966b1c49 /drivers/net/wireless/iwlwifi/iwl-4965-hw.h | |
parent | 951891c7ef844919d30aac7b1fc7396fd8be23ff (diff) |
iwlwifi: refactor tx byte count table usage
This patch drops unreadable usage of IWL_SET/GET_BITS16 in byte count
tables handling
This patch also cleans a bit the byte count table code and adds
WARN_ON traps on invalid values
This patch is pure cleanup, no functional changes.
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-4965-hw.h')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965-hw.h | 38 |
1 files changed, 6 insertions, 32 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-hw.h b/drivers/net/wireless/iwlwifi/iwl-4965-hw.h index b66dd093084d..f3f41a6a7c8c 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965-hw.h +++ b/drivers/net/wireless/iwlwifi/iwl-4965-hw.h | |||
@@ -111,7 +111,6 @@ | |||
111 | #define PCI_CFG_CMD_REG_INT_DIS_MSK 0x04 | 111 | #define PCI_CFG_CMD_REG_INT_DIS_MSK 0x04 |
112 | #define PCI_CFG_PMC_PME_FROM_D3COLD_SUPPORT (0x80000000) | 112 | #define PCI_CFG_PMC_PME_FROM_D3COLD_SUPPORT (0x80000000) |
113 | 113 | ||
114 | #define TFD_QUEUE_SIZE_MAX (256) | ||
115 | 114 | ||
116 | #define IWL_NUM_SCAN_RATES (2) | 115 | #define IWL_NUM_SCAN_RATES (2) |
117 | 116 | ||
@@ -815,8 +814,6 @@ enum { | |||
815 | * up to 7 DMA channels (FIFOs). Each Tx queue is supported by a circular array | 814 | * up to 7 DMA channels (FIFOs). Each Tx queue is supported by a circular array |
816 | * in DRAM containing 256 Transmit Frame Descriptors (TFDs). | 815 | * in DRAM containing 256 Transmit Frame Descriptors (TFDs). |
817 | */ | 816 | */ |
818 | #define IWL49_MAX_WIN_SIZE 64 | ||
819 | #define IWL49_QUEUE_SIZE 256 | ||
820 | #define IWL49_NUM_FIFOS 7 | 817 | #define IWL49_NUM_FIFOS 7 |
821 | #define IWL49_CMD_FIFO_NUM 4 | 818 | #define IWL49_CMD_FIFO_NUM 4 |
822 | #define IWL49_NUM_QUEUES 16 | 819 | #define IWL49_NUM_QUEUES 16 |
@@ -882,26 +879,7 @@ struct iwl_tfd { | |||
882 | 879 | ||
883 | 880 | ||
884 | /** | 881 | /** |
885 | * struct iwl4965_queue_byte_cnt_entry | 882 | * struct iwl4965_schedq_bc_tbl |
886 | * | ||
887 | * Byte Count Table Entry | ||
888 | * | ||
889 | * Bit fields: | ||
890 | * 15-12: reserved | ||
891 | * 11- 0: total to-be-transmitted byte count of frame (does not include command) | ||
892 | */ | ||
893 | struct iwl4965_queue_byte_cnt_entry { | ||
894 | __le16 val; | ||
895 | /* __le16 byte_cnt:12; */ | ||
896 | #define IWL_byte_cnt_POS 0 | ||
897 | #define IWL_byte_cnt_LEN 12 | ||
898 | #define IWL_byte_cnt_SYM val | ||
899 | /* __le16 rsvd:4; */ | ||
900 | } __attribute__ ((packed)); | ||
901 | |||
902 | |||
903 | /** | ||
904 | * struct iwl4965_sched_queue_byte_cnt_tbl | ||
905 | * | 883 | * |
906 | * Byte Count table | 884 | * Byte Count table |
907 | * | 885 | * |
@@ -915,15 +893,12 @@ struct iwl4965_queue_byte_cnt_entry { | |||
915 | * count table for the chosen Tx queue. If the TFD index is 0-63, the driver | 893 | * count table for the chosen Tx queue. If the TFD index is 0-63, the driver |
916 | * must duplicate the byte count entry in corresponding index 256-319. | 894 | * must duplicate the byte count entry in corresponding index 256-319. |
917 | * | 895 | * |
918 | * "dont_care" padding puts each byte count table on a 1024-byte boundary; | 896 | * padding puts each byte count table on a 1024-byte boundary; |
919 | * 4965 assumes tables are separated by 1024 bytes. | 897 | * 4965 assumes tables are separated by 1024 bytes. |
920 | */ | 898 | */ |
921 | struct iwl4965_sched_queue_byte_cnt_tbl { | 899 | struct iwl4965_schedq_bc_tbl { |
922 | struct iwl4965_queue_byte_cnt_entry tfd_offset[IWL49_QUEUE_SIZE + | 900 | __le16 tfd_offset[TFD_QUEUE_BC_SIZE]; |
923 | IWL49_MAX_WIN_SIZE]; | 901 | u8 pad[1024 - (TFD_QUEUE_BC_SIZE) * sizeof(__le16)]; |
924 | u8 dont_care[1024 - | ||
925 | (IWL49_QUEUE_SIZE + IWL49_MAX_WIN_SIZE) * | ||
926 | sizeof(__le16)]; | ||
927 | } __attribute__ ((packed)); | 902 | } __attribute__ ((packed)); |
928 | 903 | ||
929 | 904 | ||
@@ -951,8 +926,7 @@ struct iwl4965_sched_queue_byte_cnt_tbl { | |||
951 | * 31- 0: Not used | 926 | * 31- 0: Not used |
952 | */ | 927 | */ |
953 | struct iwl4965_shared { | 928 | struct iwl4965_shared { |
954 | struct iwl4965_sched_queue_byte_cnt_tbl | 929 | struct iwl4965_schedq_bc_tbl queues_bc_tbls[IWL49_NUM_QUEUES]; |
955 | queues_byte_cnt_tbls[IWL49_NUM_QUEUES]; | ||
956 | __le32 rb_closed; | 930 | __le32 rb_closed; |
957 | 931 | ||
958 | /* __le32 rb_closed_stts_rb_num:12; */ | 932 | /* __le32 rb_closed_stts_rb_num:12; */ |