···150150 return precvframe->u.hdr.rx_head;151151}152152153153-static inline u8 *get_rx_status(union recv_frame *precvframe)154154-{155155- return get_rxmem(precvframe);156156-}157157-158153static inline u8 *get_recvframe_data(union recv_frame *precvframe)159154{160155 /* always return rx_data */161156 if (precvframe == NULL)162157 return NULL;163163- return precvframe->u.hdr.rx_data;164164-}165165-166166-static inline u8 *recvframe_push(union recv_frame *precvframe, sint sz)167167-{168168- /* append data before rx_data */169169-170170- /* add data to the start of recv_frame171171- *172172- * This function extends the used data area of the recv_frame at the173173- * buffer start. rx_data must be still larger than rx_head, after174174- * pushing.175175- */176176-177177- if (precvframe == NULL)178178- return NULL;179179- precvframe->u.hdr.rx_data -= sz ;180180- if (precvframe->u.hdr.rx_data < precvframe->u.hdr.rx_head) {181181- precvframe->u.hdr.rx_data += sz ;182182- return NULL;183183- }184184- precvframe->u.hdr.len += sz;185158 return precvframe->u.hdr.rx_data;186159}187160···207234 }208235 precvframe->u.hdr.len -= sz;209236 return precvframe->u.hdr.rx_tail;210210-}211211-212212-static inline _buffer *get_rxbuf_desc(union recv_frame *precvframe)213213-{214214- _buffer *buf_desc;215215- if (precvframe == NULL)216216- return NULL;217217- return buf_desc;218218-}219219-220220-static inline union recv_frame *rxmem_to_recvframe(u8 *rxmem)221221-{222222- /* due to the design of 2048 bytes alignment of recv_frame, we can223223- * reference the union recv_frame from any given member of recv_frame.224224- * rxmem indicates the any member/address in recv_frame */225225- return (union recv_frame *)(((addr_t)rxmem >> RXFRAME_ALIGN) <<226226- RXFRAME_ALIGN);227227-}228228-229229-static inline union recv_frame *pkt_to_recvframe(_pkt *pkt)230230-{231231- u8 *buf_star;232232- union recv_frame *precv_frame;233233-234234- precv_frame = rxmem_to_recvframe((unsigned char *)buf_star);235235- return precv_frame;236236-}237237-238238-static inline u8 *pkt_to_recvmem(_pkt *pkt)239239-{240240- /* return the rx_head */241241- union recv_frame *precv_frame = pkt_to_recvframe(pkt);242242-243243- return precv_frame->u.hdr.rx_head;244244-}245245-246246-static inline u8 *pkt_to_recvdata(_pkt *pkt)247247-{248248- /* return the rx_data */249249- union recv_frame *precv_frame = pkt_to_recvframe(pkt);250250-251251- return precv_frame->u.hdr.rx_data;252252-}253253-254254-static inline sint get_recvframe_len(union recv_frame *precvframe)255255-{256256- return precvframe->u.hdr.len;257237}258238259239struct sta_info;