aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-fh.h
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2008-11-07 12:58:40 -0500
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)
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 153754277e07..2c5f919dd847 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 {
420 __le16 finished_fr_nam; 420 __le16 finished_fr_nam;
421} __attribute__ ((packed)); 421} __attribute__ ((packed));
422 422
423
424
425#define IWL_TX_DMA_MASK DMA_BIT_MASK(36)
426
427#define IWL_NUM_OF_TBS 20
428
429static inline u8 iwl_get_dma_hi_addr(dma_addr_t addr)
430{
431 return (sizeof(addr) > sizeof(u32) ? (addr >> 16) >> 16 : 0) & 0xF;
432}
433/**
434 * struct iwl_tfd_tb transmit buffer descriptor within transmit frame descriptor
435 *
436 * This structure contains dma address and length of transmission address
437 *
438 * @lo: low [31:0] portion of the dma address of TX buffer
439 * every even is unaligned on 16 bit boundary
440 * @hi_n_len 0-3 [35:32] portion of dma
441 * 4-16 length of the tx buffer
442 */
443struct iwl_tfd_tb {
444 __le32 lo;
445 __le16 hi_n_len;
446} __attribute__((packed));
447
448/**
449 * struct iwl_tfd
450 *
451 * Transmit Frame Descriptor (TFD)
452 *
453 * @ __reserved1[3] reserved
454 * @ num_tbs 0-5 number of active tbs
455 * 6-7 padding (not used)
456 * @ tbs[20] transmit frame buffer descriptors
457 * @ __pad padding
458 *
459 * Each Tx queue uses a circular buffer of 256 TFDs stored in host DRAM.
460 * Both driver and device share these circular buffers, each of which must be
461 * contiguous 256 TFDs x 128 bytes-per-TFD = 32 KBytes
462 *
463 * Driver must indicate the physical address of the base of each
464 * circular buffer via the FH_MEM_CBBC_QUEUE registers.
465 *
466 * Each TFD contains pointer/size information for up to 20 data buffers
467 * in host DRAM. These buffers collectively contain the (one) frame described
468 * by the TFD. Each buffer must be a single contiguous block of memory within
469 * itself, but buffers may be scattered in host DRAM. Each buffer has max size
470 * of (4K - 4). The concatenates all of a TFD's buffers into a single
471 * Tx frame, up to 8 KBytes in size.
472 *
473 * A maximum of 255 (not 256!) TFDs may be on a queue waiting for Tx.
474 *
475 * Bit fields in the control dword (val0):
476 */
477struct iwl_tfd {
478 u8 __reserved1[3];
479 u8 num_tbs;
480 struct iwl_tfd_tb tbs[IWL_NUM_OF_TBS];
481 __le32 __pad;
482} __attribute__ ((packed));
483
484
485/* Keep Warm Size */
486#define IWL_KW_SIZE 0x1000 /*4k */
487
423#endif /* !__iwl_fh_h__ */ 488#endif /* !__iwl_fh_h__ */