diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-4965-hw.h')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965-hw.h | 117 |
1 files changed, 2 insertions, 115 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-hw.h b/drivers/net/wireless/iwlwifi/iwl-4965-hw.h index 9da7c7bea752..fb0fd773960f 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965-hw.h +++ b/drivers/net/wireless/iwlwifi/iwl-4965-hw.h | |||
@@ -819,64 +819,6 @@ enum { | |||
819 | #define IWL49_NUM_QUEUES 16 | 819 | #define IWL49_NUM_QUEUES 16 |
820 | #define IWL49_NUM_AMPDU_QUEUES 8 | 820 | #define IWL49_NUM_AMPDU_QUEUES 8 |
821 | 821 | ||
822 | #define IWL_TX_DMA_MASK (DMA_BIT_MASK(36) & ~0x3) | ||
823 | #define IWL_NUM_OF_TBS 20 | ||
824 | |||
825 | static inline u8 iwl_get_dma_hi_addr(dma_addr_t addr) | ||
826 | { | ||
827 | return (sizeof(addr) > sizeof(u32) ? (addr >> 16) >> 16 : 0) & 0xF; | ||
828 | } | ||
829 | /** | ||
830 | * struct iwl_tfd_tb transmit buffer descriptor within transmit frame descriptor | ||
831 | * | ||
832 | * This structure contains dma address and length of transmission address | ||
833 | * | ||
834 | * @lo: low [31:0] portion of the dma address of TX buffer | ||
835 | * every even is unaligned on 16 bit boundary | ||
836 | * @hi_n_len 0-3 [35:32] portion of dma | ||
837 | * 4-16 length of the tx buffer | ||
838 | */ | ||
839 | struct iwl_tfd_tb { | ||
840 | __le32 lo; | ||
841 | __le16 hi_n_len; | ||
842 | } __attribute__((packed)); | ||
843 | |||
844 | /** | ||
845 | * struct iwl_tfd | ||
846 | * | ||
847 | * Transmit Frame Descriptor (TFD) | ||
848 | * | ||
849 | * @ __reserved1[3] reserved | ||
850 | * @ num_tbs 0-5 number of active tbs | ||
851 | * 6-7 padding (not used) | ||
852 | * @ tbs[20] transmit frame buffer descriptors | ||
853 | * @ __pad padding | ||
854 | * | ||
855 | * Each Tx queue uses a circular buffer of 256 TFDs stored in host DRAM. | ||
856 | * Both driver and device share these circular buffers, each of which must be | ||
857 | * contiguous 256 TFDs x 128 bytes-per-TFD = 32 KBytes | ||
858 | * | ||
859 | * Driver must indicate the physical address of the base of each | ||
860 | * circular buffer via the FH_MEM_CBBC_QUEUE registers. | ||
861 | * | ||
862 | * Each TFD contains pointer/size information for up to 20 data buffers | ||
863 | * in host DRAM. These buffers collectively contain the (one) frame described | ||
864 | * by the TFD. Each buffer must be a single contiguous block of memory within | ||
865 | * itself, but buffers may be scattered in host DRAM. Each buffer has max size | ||
866 | * of (4K - 4). The concatenates all of a TFD's buffers into a single | ||
867 | * Tx frame, up to 8 KBytes in size. | ||
868 | * | ||
869 | * A maximum of 255 (not 256!) TFDs may be on a queue waiting for Tx. | ||
870 | * | ||
871 | * Bit fields in the control dword (val0): | ||
872 | */ | ||
873 | struct iwl_tfd { | ||
874 | u8 __reserved1[3]; | ||
875 | u8 num_tbs; | ||
876 | struct iwl_tfd_tb tbs[IWL_NUM_OF_TBS]; | ||
877 | __le32 __pad; | ||
878 | } __attribute__ ((packed)); | ||
879 | |||
880 | 822 | ||
881 | /** | 823 | /** |
882 | * struct iwl4965_schedq_bc_tbl | 824 | * struct iwl4965_schedq_bc_tbl |
@@ -896,64 +838,9 @@ struct iwl_tfd { | |||
896 | * padding puts each byte count table on a 1024-byte boundary; | 838 | * padding puts each byte count table on a 1024-byte boundary; |
897 | * 4965 assumes tables are separated by 1024 bytes. | 839 | * 4965 assumes tables are separated by 1024 bytes. |
898 | */ | 840 | */ |
899 | struct iwl4965_schedq_bc_tbl { | 841 | struct iwl4965_scd_bc_tbl { |
900 | __le16 tfd_offset[TFD_QUEUE_BC_SIZE]; | 842 | __le16 tfd_offset[TFD_QUEUE_BC_SIZE]; |
901 | u8 pad[1024 - (TFD_QUEUE_BC_SIZE) * sizeof(__le16)]; | 843 | u8 pad[1024 - (TFD_QUEUE_BC_SIZE) * sizeof(__le16)]; |
902 | } __attribute__ ((packed)); | 844 | } __attribute__ ((packed)); |
903 | 845 | ||
904 | 846 | #endif /* !__iwl_4965_hw_h__ */ | |
905 | /** | ||
906 | * struct iwl4965_shared - handshake area for Tx and Rx | ||
907 | * | ||
908 | * For convenience in allocating memory, this structure combines 2 areas of | ||
909 | * DRAM which must be shared between driver and 4965. These do not need to | ||
910 | * be combined, if better allocation would result from keeping them separate: | ||
911 | * | ||
912 | * 1) The Tx byte count tables occupy 1024 bytes each (16 KBytes total for | ||
913 | * 16 queues). Driver uses SCD_DRAM_BASE_ADDR to tell 4965 where to find | ||
914 | * the first of these tables. 4965 assumes tables are 1024 bytes apart. | ||
915 | * | ||
916 | * 2) The Rx status (val0 and val1) occupies only 8 bytes. Driver uses | ||
917 | * FH_RSCSR_CHNL0_STTS_WPTR_REG to tell 4965 where to find this area. | ||
918 | * Driver reads val0 to determine the latest Receive Buffer Descriptor (RBD) | ||
919 | * that has been filled by the 4965. | ||
920 | * | ||
921 | * Bit fields val0: | ||
922 | * 31-12: Not used | ||
923 | * 11- 0: Index of last filled Rx buffer descriptor (4965 writes, driver reads) | ||
924 | * | ||
925 | * Bit fields val1: | ||
926 | * 31- 0: Not used | ||
927 | */ | ||
928 | struct iwl4965_shared { | ||
929 | struct iwl4965_schedq_bc_tbl queues_bc_tbls[IWL49_NUM_QUEUES]; | ||
930 | __le32 rb_closed; | ||
931 | |||
932 | /* __le32 rb_closed_stts_rb_num:12; */ | ||
933 | #define IWL_rb_closed_stts_rb_num_POS 0 | ||
934 | #define IWL_rb_closed_stts_rb_num_LEN 12 | ||
935 | #define IWL_rb_closed_stts_rb_num_SYM rb_closed | ||
936 | /* __le32 rsrv1:4; */ | ||
937 | /* __le32 rb_closed_stts_rx_frame_num:12; */ | ||
938 | #define IWL_rb_closed_stts_rx_frame_num_POS 16 | ||
939 | #define IWL_rb_closed_stts_rx_frame_num_LEN 12 | ||
940 | #define IWL_rb_closed_stts_rx_frame_num_SYM rb_closed | ||
941 | /* __le32 rsrv2:4; */ | ||
942 | |||
943 | __le32 frm_finished; | ||
944 | /* __le32 frame_finished_stts_rb_num:12; */ | ||
945 | #define IWL_frame_finished_stts_rb_num_POS 0 | ||
946 | #define IWL_frame_finished_stts_rb_num_LEN 12 | ||
947 | #define IWL_frame_finished_stts_rb_num_SYM frm_finished | ||
948 | /* __le32 rsrv3:4; */ | ||
949 | /* __le32 frame_finished_stts_rx_frame_num:12; */ | ||
950 | #define IWL_frame_finished_stts_rx_frame_num_POS 16 | ||
951 | #define IWL_frame_finished_stts_rx_frame_num_LEN 12 | ||
952 | #define IWL_frame_finished_stts_rx_frame_num_SYM frm_finished | ||
953 | /* __le32 rsrv4:4; */ | ||
954 | |||
955 | __le32 padding1; /* so that allocation will be aligned to 16B */ | ||
956 | __le32 padding2; | ||
957 | } __attribute__ ((packed)); | ||
958 | |||
959 | #endif /* __iwl4965_4965_hw_h__ */ | ||