X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=target_firmware%2Fmagpie_fw_dev%2Ftarget%2Finc%2Fadf_nbuf.h;fp=target_firmware%2Fmagpie_fw_dev%2Ftarget%2Finc%2Fadf_nbuf.h;h=8217326a057ecb64fa1c6df19a60c21fcc55e489;hb=6f2219c1ab25d1dfbb5d2de6508212a27f9d7e9c;hp=8ad5185202ea3d409e49bd02c61ed31aae033b40;hpb=7f95fac61c96c91198ad65198c2fa30dfc936286;p=open-ath9k-htc-firmware.git diff --git a/target_firmware/magpie_fw_dev/target/inc/adf_nbuf.h b/target_firmware/magpie_fw_dev/target/inc/adf_nbuf.h index 8ad5185..8217326 100755 --- a/target_firmware/magpie_fw_dev/target/inc/adf_nbuf.h +++ b/target_firmware/magpie_fw_dev/target/inc/adf_nbuf.h @@ -34,13 +34,13 @@ */ /** * @defgroup adf_nbuf_public network buffer API - */ + */ /** * @ingroup adf_nbuf_public * @file adf_nbuf.h * This file defines the network buffer abstraction. - */ + */ #ifndef _ADF_NBUF_H #define _ADF_NBUF_H @@ -75,10 +75,10 @@ typedef __adf_nbuf_queue_t adf_nbuf_queue_t; * - need space in adf_drv's software descriptor * - are typically created during adf_drv_create * - need to be created before any API(adf_nbuf_map) that uses them - * + * * @param[in] osdev os device * @param[out] dmap map handle - * + * * @return status of the operation */ static inline a_status_t @@ -91,7 +91,7 @@ adf_nbuf_dmamap_create(adf_os_device_t osdev, /** * @brief Delete a dmap map - * + * * @param[in] osdev os device * @param[in] dmap */ @@ -113,9 +113,9 @@ adf_nbuf_dmamap_destroy(adf_os_device_t osdev, adf_os_dma_map_t dmap) * @return status of the operation */ static inline a_status_t -adf_nbuf_map(adf_os_device_t osdev, - adf_os_dma_map_t bmap, - adf_nbuf_t buf, +adf_nbuf_map(adf_os_device_t osdev, + adf_os_dma_map_t bmap, + adf_nbuf_t buf, adf_os_dma_dir_t dir) { return __adf_nbuf_map(osdev, bmap, buf, dir); @@ -130,8 +130,8 @@ adf_nbuf_map(adf_os_device_t osdev, * @param[in] dir DMA direction */ static inline void -adf_nbuf_unmap(adf_os_device_t osdev, - adf_os_dma_map_t bmap, +adf_nbuf_unmap(adf_os_device_t osdev, + adf_os_dma_map_t bmap, adf_os_dma_dir_t dir) { __adf_nbuf_unmap(osdev, bmap, dir); @@ -139,7 +139,7 @@ adf_nbuf_unmap(adf_os_device_t osdev, /** * @brief returns information about the mapped buf - * + * * @param[in] bmap map handle * @param[out] sg map info */ @@ -162,14 +162,14 @@ adf_nbuf_dmamap_info(adf_os_dma_map_t bmap, adf_os_dmamap_info_t *sg) * The nbuf created is guarenteed to have only 1 physical segment * * @param[in] hdl platform device object - * @param[in] size data buffer size for this adf_nbuf including max header + * @param[in] size data buffer size for this adf_nbuf including max header * size * @param[in] reserve headroom to start with. * @param[in] align alignment for the start buffer. * * @return The new adf_nbuf instance or NULL if there's not enough memory. */ -static inline adf_nbuf_t +static inline adf_nbuf_t adf_nbuf_alloc(adf_os_size_t size, int reserve, int align) @@ -195,10 +195,10 @@ adf_nbuf_free(adf_nbuf_t buf) * buf. Note that this can allocate a new buffer, or * change geometry of the orignial buffer. The new buffer * is returned in the (new_buf). - * + * * @param[in] buf (older buffer) * @param[in] headroom - * + * * @return newly allocated buffer */ static inline adf_nbuf_t @@ -211,10 +211,10 @@ adf_nbuf_realloc_headroom(adf_nbuf_t buf, a_uint32_t headroom) /** * @brief expand the tailroom to the new tailroom, but the buffer * remains the same - * + * * @param[in] buf buffer * @param[in] tailroom new tailroom - * + * * @return expanded buffer or NULL on failure */ static inline adf_nbuf_t @@ -232,11 +232,11 @@ adf_nbuf_realloc_tailroom(adf_nbuf_t buf, a_uint32_t tailroom) * having an extra API is that some OS do this in more * optimized way, rather than calling realloc (head/tail) * back to back. - * + * * @param[in] buf buffer - * @param[in] headroom new headroom + * @param[in] headroom new headroom * @param[in] tailroom new tailroom - * + * * @return expanded buffer */ static inline adf_nbuf_t @@ -253,9 +253,9 @@ adf_nbuf_expand(adf_nbuf_t buf, a_uint32_t headroom, a_uint32_t tailroom) * effect, it also "linearizes" a buffer (which is * perhaps why you'll use it mostly). It creates a * writeable copy. - * + * * @param[in] buf source nbuf to copy from - * + * * @return the new nbuf */ static inline adf_nbuf_t @@ -268,10 +268,10 @@ adf_nbuf_copy(adf_nbuf_t buf) /** * @brief link two nbufs, the new buf is piggybacked into the * older one. - * + * * @param[in] dst buffer to piggyback into * @param[in] src buffer to put - * + * * @return status of the call */ static inline void @@ -283,12 +283,12 @@ adf_nbuf_cat(adf_nbuf_t dst,adf_nbuf_t src) /** * @brief clone the nbuf (copy is readonly) - * + * * @param[in] buf nbuf to clone from - * + * * @return cloned buffer */ -static inline adf_nbuf_t +static inline adf_nbuf_t adf_nbuf_clone(adf_nbuf_t buf) { return(__adf_nbuf_clone(buf)); @@ -301,12 +301,12 @@ adf_nbuf_clone(adf_nbuf_t buf) * other users.If the nbuf is a clone then this function * creates a new copy of the data. If the buffer is not * a clone the original buffer is returned. - * + * * @param[in] buf source nbuf to create a writable copy from - * + * * @return new buffer which is writeable */ -static inline adf_nbuf_t +static inline adf_nbuf_t adf_nbuf_unshare(adf_nbuf_t buf) { return(__adf_nbuf_unshare(buf)); @@ -322,9 +322,9 @@ adf_nbuf_unshare(adf_nbuf_t buf) /** * @brief return the amount of headroom int the current nbuf - * + * * @param[in] buf buffer - * + * * @return amount of head room */ static inline a_uint32_t @@ -336,10 +336,10 @@ adf_nbuf_headroom(adf_nbuf_t buf) /** * @brief return the amount of tail space available - * + * * @param[in] buf buffer - * - * @return amount of tail room + * + * @return amount of tail room */ static inline a_uint32_t adf_nbuf_tailroom(adf_nbuf_t buf) @@ -397,7 +397,7 @@ adf_nbuf_pull_head(adf_nbuf_t buf, adf_os_size_t size) /** - * + * * @brief trim data out from the end * * @param[in] buf buf instance @@ -427,9 +427,9 @@ adf_nbuf_len(adf_nbuf_t buf) /** * @brief test whether the nbuf is cloned or not - * + * * @param[in] buf buffer - * + * * @return TRUE if it is cloned, else FALSE */ static inline a_bool_t @@ -446,19 +446,19 @@ adf_nbuf_is_cloned(adf_nbuf_t buf) /** * @brief return the frag pointer & length of the frag - * + * * @param[in] buf buffer * @param[out] sg this will return all the frags of the nbuf - * + * */ -static inline void -adf_nbuf_frag_info(adf_nbuf_t buf, adf_os_sglist_t *sg) +static inline void +adf_nbuf_frag_info(adf_nbuf_t buf, adf_os_sglist_t *sg) { __adf_nbuf_frag_info(buf, sg); } /** * @brief return the data pointer & length of the header - * + * * @param[in] buf nbuf * @param[out] addr data pointer * @param[out] len length of the data @@ -475,9 +475,9 @@ adf_nbuf_peek_header(adf_nbuf_t buf, a_uint8_t **addr, a_uint32_t *len) /** * @brief get the priv pointer from the nbuf'f private space - * + * * @param[in] buf - * + * * @return data pointer to typecast into your priv structure */ static inline a_uint8_t * @@ -533,9 +533,9 @@ adf_nbuf_queue_remove(adf_nbuf_queue_t *head) /** * @brief get the length of the queue - * + * * @param[in] head buf queue head - * + * * @return length of the queue */ static inline a_uint32_t @@ -547,12 +547,12 @@ adf_nbuf_queue_len(adf_nbuf_queue_t *head) /** * @brief get the first guy/packet in the queue - * + * * @param[in] head buf queue head - * + * * @return first buffer in queue */ -static inline adf_nbuf_t +static inline adf_nbuf_t adf_nbuf_queue_first(adf_nbuf_queue_t *head) { return (__adf_nbuf_queue_first(head)); @@ -562,9 +562,9 @@ adf_nbuf_queue_first(adf_nbuf_queue_t *head) /** * @brief get the next guy/packet of the given buffer (or * packet) - * + * * @param[in] buf buffer - * + * * @return next buffer/packet */ static inline adf_nbuf_t @@ -576,7 +576,7 @@ adf_nbuf_queue_next(adf_nbuf_t buf) /** * @brief Check if the buf queue is empty - * + * * @param[in] nbq buf queue handle * * @return TRUE if queue is empty @@ -598,7 +598,7 @@ adf_nbuf_is_queue_empty(adf_nbuf_queue_t * nbq) /** * @brief Gets the tx checksumming to be performed on this buf - * + * * @param[in] buf buffer * @param[out] hdr_off the (tcp) header start * @param[out] where the checksum offset @@ -613,7 +613,7 @@ adf_nbuf_tx_cksum_info(adf_nbuf_t buf, a_uint8_t **hdr_off, a_uint8_t **where) /** * @brief Drivers that support hw checksumming use this to * indicate checksum info to the stack. - * + * * @param[in] buf buffer * @param[in] cksum checksum */ @@ -627,7 +627,7 @@ adf_nbuf_set_rx_cksum(adf_nbuf_t buf, adf_nbuf_rx_cksum_t *cksum) /** * @brief Drivers that are capable of TCP Large segment offload * use this to get the offload info out of an buf. - * + * * @param[in] buf buffer * @param[out] tso offload info */ @@ -647,16 +647,16 @@ adf_nbuf_set_vlan_info(adf_nbuf_t buf, adf_net_vlan_tag_t vlan_tag) /** * @brief This function extracts the vid & priority from an * nbuf - * - * + * + * * @param[in] hdl net handle * @param[in] buf buffer * @param[in] vlan vlan header - * + * * @return status of the operation */ static inline a_status_t -adf_nbuf_get_vlan_info(adf_net_handle_t hdl, adf_nbuf_t buf, +adf_nbuf_get_vlan_info(adf_net_handle_t hdl, adf_nbuf_t buf, adf_net_vlanhdr_t *vlan) { return __adf_nbuf_get_vlan_info(hdl, buf, vlan);