1 2 /******************************************************************************* 3 * bd_chain.h - bd chain interface 4 *******************************************************************************/ 5 #ifndef _BD_CHAIN_ST_H 6 #define _BD_CHAIN_ST_H 7 8 #include "lm_defs.h" 9 10 typedef struct _lm_bd_chain_next { 11 u32_t addr_lo /* Single continuous buffer low pointer */; 12 u32_t addr_hi /* Single continuous buffer high pointer */; 13 u8_t reserved[8] /* keeps same size as other eth tx bd types */; 14 } lm_bd_chain_next ; 15 16 17 typedef struct _lm_bd_chain_t 18 { 19 void *bd_chain_virt; /* virt addr of first page of the chain */ 20 lm_address_t bd_chain_phy; /* phys addr of first page of the chain */ 21 char *next_bd; /* pointer to next bd to produce or consume */ 22 u16_t page_cnt; /* number of chain pages */ 23 u16_t capacity; /* number of _usable_ bds (e.g. not including _next_ bds) */ 24 u16_t bd_left; /* number of not produced, _usable_ bds */ 25 u16_t prod_idx; /* index of next bd to produce (cyclic) */ 26 u16_t cons_idx; /* index of next bd to consume (cyclic) */ 27 u16_t bds_per_page; /* Number of bds per page */ 28 u16_t bds_per_page_mask; /* Mask of number of bds per page */ 29 u16_t usable_bds_per_page; /* Number of usable bds in a page (taking into account last 16 bytes for 'next-ptr' */ 30 u8_t bd_size; /* currently 8 and 16 bytes are supported. ("next_bd" is always 18 bytes) */ 31 u8_t bds_skip_eop; /* num bds to skip at the end of the page due to the 'next pointer' */ 32 u8_t reserved[2]; 33 34 //PBL 35 void *pbl_virt_addr_table;/* virt table pbl */ 36 lm_address_t *pbl_phys_addr_table;/* phys table pbl */ 37 u16_t pbe_idx; /* index of the current pbe page */ 38 u16_t usable_bds_mask; /* Mask used to check if end of page was reached */ 39 u8_t b_is_chain_mode; /* indicate if using bd_chain interface or pbl interface */ 40 u8_t num_bd_to_sub; /* Number of bds to subtract when checking if end of page was reached */ 41 u8_t reserved1[2]; 42 } lm_bd_chain_t; 43 44 45 typedef struct _lm_hc_sb_info_t 46 { 47 u8_t hc_sb; 48 u8_t hc_index_value; 49 u16_t iro_dhc_offset; 50 } lm_hc_sb_info_t; 51 52 53 #endif /* _BD_CHAIN_ST_H */ 54