aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-fh.h
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2008-11-07 09:58:40 -0800
committerJohn W. Linville <linville@tuxdriver.com>2008-11-21 11:07:23 -0500
commit4ddbb7d060061e584cb2137f4c7e41e502a560b4 (patch)
treecb6a78a622df2660411786e73c2bbd33b187d173 /drivers/net/wireless/iwlwifi/iwl-fh.h
parent8d86422a83d79e3d3241cf0f269fca0c2640bcee (diff)
downloadkernel_samsung_crespo-4ddbb7d060061e584cb2137f4c7e41e502a560b4.zip
kernel_samsung_crespo-4ddbb7d060061e584cb2137f4c7e41e502a560b4.tar.gz
kernel_samsung_crespo-4ddbb7d060061e584cb2137f4c7e41e502a560b4.tar.bz2
iwlwifi: revamp tx scheduler byte count tables handling
This moves byte count tables to tx domain removing completely ambivalent shared data. Changes handling of allocation byte count tables and keep warm consistent memory Moves general tx scheduler definitions from iwl-4956-hw.h to iwl-fh.h Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> 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-fh.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-fh.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-fh.h b/drivers/net/wireless/iwlwifi/iwl-fh.h
index 1537542..2c5f919 100644
--- a/drivers/net/wireless/iwlwifi/iwl-fh.h
+++ b/drivers/net/wireless/iwlwifi/iwl-fh.h
@@ -420,4 +420,69 @@ struct iwl_rb_status {
__le16 finished_fr_nam;
} __attribute__ ((packed));
+
+
+#define IWL_TX_DMA_MASK DMA_BIT_MASK(36)
+
+#define IWL_NUM_OF_TBS 20
+
+static inline u8 iwl_get_dma_hi_addr(dma_addr_t addr)
+{
+ return (sizeof(addr) > sizeof(u32) ? (addr >> 16) >> 16 : 0) & 0xF;
+}
+/**
+ * struct iwl_tfd_tb transmit buffer descriptor within transmit frame descriptor
+ *
+ * This structure contains dma address and length of transmission address
+ *
+ * @lo: low [31:0] portion of the dma address of TX buffer
+ * every even is unaligned on 16 bit boundary
+ * @hi_n_len 0-3 [35:32] portion of dma
+ * 4-16 length of the tx buffer
+ */
+struct iwl_tfd_tb {
+ __le32 lo;
+ __le16 hi_n_len;
+} __attribute__((packed));
+
+/**
+ * struct iwl_tfd
+ *
+ * Transmit Frame Descriptor (TFD)
+ *
+ * @ __reserved1[3] reserved
+ * @ num_tbs 0-5 number of active tbs
+ * 6-7 padding (not used)
+ * @ tbs[20] transmit frame buffer descriptors
+ * @ __pad padding
+ *
+ * Each Tx queue uses a circular buffer of 256 TFDs stored in host DRAM.
+ * Both driver and device share these circular buffers, each of which must be
+ * contiguous 256 TFDs x 128 bytes-per-TFD = 32 KBytes
+ *
+ * Driver must indicate the physical address of the base of each
+ * circular buffer via the FH_MEM_CBBC_QUEUE registers.
+ *
+ * Each TFD contains pointer/size information for up to 20 data buffers
+ * in host DRAM. These buffers collectively contain the (one) frame described
+ * by the TFD. Each buffer must be a single contiguous block of memory within
+ * itself, but buffers may be scattered in host DRAM. Each buffer has max size
+ * of (4K - 4). The concatenates all of a TFD's buffers into a single
+ * Tx frame, up to 8 KBytes in size.
+ *
+ * A maximum of 255 (not 256!) TFDs may be on a queue waiting for Tx.
+ *
+ * Bit fields in the control dword (val0):
+ */
+struct iwl_tfd {
+ u8 __reserved1[3];
+ u8 num_tbs;
+ struct iwl_tfd_tb tbs[IWL_NUM_OF_TBS];
+ __le32 __pad;
+} __attribute__ ((packed));
+
+
+/* Keep Warm Size */
+#define IWL_KW_SIZE 0x1000 /*4k */
+
#endif /* !__iwl_fh_h__ */