From: Oleksij Rempel Date: Thu, 13 Oct 2016 07:44:52 +0000 (+0200) Subject: remove all trailing whitespaces in one run X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=6f2219c1ab25d1dfbb5d2de6508212a27f9d7e9c;p=open-ath9k-htc-firmware.git remove all trailing whitespaces in one run and convert dos to unix files. no other changes made here. Signed-off-by: Oleksij Rempel --- diff --git a/target_firmware/magpie_fw_dev/target/adf/adf_nbuf.c b/target_firmware/magpie_fw_dev/target/adf/adf_nbuf.c index 36bf86f..e3cde3a 100755 --- a/target_firmware/magpie_fw_dev/target/adf/adf_nbuf.c +++ b/target_firmware/magpie_fw_dev/target/adf/adf_nbuf.c @@ -52,22 +52,22 @@ VDESC * __adf_nbuf_last(VBUF *buf); // ############################################################################# /** - * + * * @brief allocate a new nbuf, - * + * * @param hdl (adf_net handle) * @param size (size of the new buf) * @param reserve (amount of space to reserve in the head) - * + * * @return newly allocated nbuf */ -__adf_nbuf_t -__adf_nbuf_alloc(adf_os_size_t size, a_uint32_t reserve, +__adf_nbuf_t +__adf_nbuf_alloc(adf_os_size_t size, a_uint32_t reserve, a_uint32_t align) { VBUF *buf = NULL; VDESC *desc; - + buf = VBUF_alloc_vbuf(); if ( buf != NULL ) { desc = VDESC_alloc_vdesc(); @@ -76,21 +76,21 @@ __adf_nbuf_alloc(adf_os_size_t size, a_uint32_t reserve, desc->next_desc = NULL; desc->data_offset = reserve; desc->data_size = 0; - desc->control = 0; - + desc->control = 0; + buf->desc_list = desc; - buf->buf_length = 0; + buf->buf_length = 0; } - + return buf; -} - +} + /** * @brief Free the nbuf * function to be called in * @param hdl * @param adf_nbuf - * + * */ void __adf_nbuf_free(__adf_nbuf_t buf) { @@ -100,13 +100,13 @@ void __adf_nbuf_free(__adf_nbuf_t buf) /** * @brief reallocate the head space, call it only after the you * have called headroom - * + * * @param adf_nbuf - * @param headroom - * + * @param headroom + * * @return new nbuf */ -__adf_nbuf_t +__adf_nbuf_t __adf_nbuf_realloc_headroom(__adf_nbuf_t buf, a_uint32_t headroom) { adf_os_assert(0); @@ -116,13 +116,13 @@ __adf_nbuf_realloc_headroom(__adf_nbuf_t buf, a_uint32_t headroom) /** * @brief expand the tailroom, mostly by adding the new tail * buffer, also take care of the priv - * + * * @param buf * @param tailroom - * + * * @return struct mbuf * (buffer with the new tailroom) */ -__adf_nbuf_t +__adf_nbuf_t __adf_nbuf_realloc_tailroom(__adf_nbuf_t buf, a_uint32_t tailroom) { adf_os_assert(0); @@ -131,14 +131,14 @@ __adf_nbuf_realloc_tailroom(__adf_nbuf_t buf, a_uint32_t tailroom) /** * @brief expand the headroom or tailroom or both - * + * * @param buf * @param headroom ( 0 if no headroom expansion req) * @param tailroom ( 0 if no tailroom expansion req) - * + * * @return struct mbuf* (NULL if something goofed up) */ -__adf_nbuf_t +__adf_nbuf_t __adf_nbuf_expand(__adf_nbuf_t buf, a_uint32_t headroom, a_uint32_t tailroom) { adf_os_assert(0); @@ -147,19 +147,19 @@ __adf_nbuf_expand(__adf_nbuf_t buf, a_uint32_t headroom, a_uint32_t tailroom) /** * @brief put data in the head - * + * * @param buf * @param len (how much data to put) - * + * * @return new data pointer ,NULL if the len is more than the * space available in the head frag. */ -a_uint8_t * +a_uint8_t * __adf_nbuf_push_head(__adf_nbuf_t buf, adf_os_size_t len) { - a_uint8_t *ptr = NULL; + a_uint8_t *ptr = NULL; VDESC *desc = buf->desc_list; - + desc->data_offset -= len; desc->data_size += len; buf->buf_length += len; @@ -168,12 +168,12 @@ __adf_nbuf_push_head(__adf_nbuf_t buf, adf_os_size_t len) } /** - * + * * @brief add data in the end of tail - * + * * @param buf * @param len (how much data to put) - * + * * @return previous tail (data+len),NULL if the len is more than * space available */ @@ -182,79 +182,79 @@ __adf_nbuf_put_tail(__adf_nbuf_t buf, adf_os_size_t len) { a_uint8_t *tail = NULL; VDESC *last_desc = __adf_nbuf_last(buf); - + tail = last_desc->buf_addr + last_desc->data_offset + last_desc->data_size; last_desc->data_size += len; buf->buf_length += len; - + return tail; } /** * @brief strip data from head - * + * * @param adf_nbuf * @param len (how much data to rip) - * + * * @return new data pointer */ -a_uint8_t * +a_uint8_t * __adf_nbuf_pull_head(__adf_nbuf_t buf, adf_os_size_t len) { a_uint8_t *ptr = NULL; VDESC *desc = buf->desc_list; - + desc->data_offset += len; desc->data_size -= len; buf->buf_length -= len; ptr = desc->buf_addr + desc->data_offset; - + return ptr; } /** * @brief strip data from tail, priv safe - * + * * @param buf * @param len (how much to strip down) - * + * */ -void +void __adf_nbuf_trim_tail(__adf_nbuf_t buf, adf_os_size_t len) { VDESC *last_desc = __adf_nbuf_last(buf); - + adf_os_assert(buf != NULL); last_desc->data_size -= len; buf->buf_length -= len; - + //adf_os_assert(0); //0820 } /** * @brief Copy assumes that we create a writeable copy of the * nbuf which is equivalent in FreeBSD as duping the * mbuf. - * + * * @param src - * + * * @return struct mbuf * (newly allocated buffer) */ -__adf_nbuf_t +__adf_nbuf_t __adf_nbuf_copy(__adf_nbuf_t src) { - __adf_nbuf_t buf = NULL; + __adf_nbuf_t buf = NULL; adf_os_assert(src != NULL); - + return buf; } /** * @brief make the writable copy of the nbuf - * + * * @param adf_nbuf - * + * * @return new nbuf */ -__adf_nbuf_t +__adf_nbuf_t __adf_nbuf_unshare(__adf_nbuf_t src) { __adf_nbuf_t buf = NULL; @@ -267,32 +267,32 @@ __adf_nbuf_unshare(__adf_nbuf_t src) /** * @brief return the frag data & len, where frag no. is * specified by the index - * + * * @param[in] buf * @param[out] sg (scatter/gather list of all the frags) - * + * */ -void +void __adf_nbuf_frag_info(__adf_nbuf_t buf, adf_os_sglist_t *sg) { VDESC *desc = buf->desc_list; int count = 0; - + while( desc != NULL ) { sg->sg_segs[count].vaddr = desc->buf_addr + desc->data_offset; sg->sg_segs[count].len = desc->data_size; - - count++; + + count++; desc = desc->next_desc; } - + sg->nsegs = count; } /** * @brief retrieve the priv space pointer from nbuf - * + * * @param buf (nbuf to attach the priv space) - * + * * @return uint8_t* ( pointer to the data ) */ a_uint8_t * @@ -304,15 +304,15 @@ __adf_nbuf_get_priv(__adf_nbuf_t buf) } /** - * + * * @brief append the nbuf to the queue - * + * * @param adf_qhead * @param adf_nbuf - * + * */ -void -__adf_nbuf_queue_add(__adf_nbuf_qhead_t *qhead, +void +__adf_nbuf_queue_add(__adf_nbuf_qhead_t *qhead, __adf_nbuf_t buf) { qhead->qlen++; @@ -330,12 +330,12 @@ __adf_nbuf_queue_add(__adf_nbuf_qhead_t *qhead, /** * @brief dequeue an nbuf - * + * * @param adf_qhead - * + * * @return the nbuf */ -__adf_nbuf_t +__adf_nbuf_t __adf_nbuf_queue_remove(__adf_nbuf_qhead_t *qhead) { __adf_nbuf_t b0 = NULL; @@ -349,7 +349,7 @@ __adf_nbuf_queue_remove(__adf_nbuf_qhead_t *qhead) } else { qhead->head = qhead->head->next_buf; } - + b0->next_buf = NULL; } return b0; @@ -363,51 +363,51 @@ __adf_nbuf_queue_remove(__adf_nbuf_qhead_t *qhead) /** * @brief creates a streaming mapping (takes a pre allocated * global tag for 4K mbuf sizes) - * + * * @param hdl * @param max_sz * @param dmap - * + * * @return a_status_t */ -a_status_t +a_status_t __adf_nbuf_dmamap_create(__adf_os_device_t osdev, __adf_os_dma_map_t *dmap) { a_status_t retval = A_STATUS_OK; - + (*dmap) = A_ALLOCRAM(sizeof(struct __adf_dma_map)); if(*dmap == NULL) return A_STATUS_ENOMEM; - + (*dmap)->buf = NULL; return retval; } -a_status_t -__adf_nbuf_map(__adf_os_device_t osdev, __adf_os_dma_map_t bmap, +a_status_t +__adf_nbuf_map(__adf_os_device_t osdev, __adf_os_dma_map_t bmap, __adf_nbuf_t buf, adf_os_dma_dir_t dir) -{ +{ bmap->buf = buf; - + return A_STATUS_OK; } -void -__adf_nbuf_unmap(__adf_os_device_t osdev, __adf_os_dma_map_t bmap, +void +__adf_nbuf_unmap(__adf_os_device_t osdev, __adf_os_dma_map_t bmap, adf_os_dma_dir_t dir) { bmap->buf = NULL; - + return; } void -__adf_nbuf_dmamap_destroy(__adf_os_device_t osdev, +__adf_nbuf_dmamap_destroy(__adf_os_device_t osdev, __adf_os_dma_map_t dmap) { //dmap->buf = NULL; - + // Should not be called in FW! //return A_STATUS_OK; } @@ -415,26 +415,26 @@ __adf_nbuf_dmamap_destroy(__adf_os_device_t osdev, /** - * @brief return the dma map info - * + * @brief return the dma map info + * * @param[in] bmap * @param[out] sg (map_info ptr) */ -void +void __adf_nbuf_dmamap_info(__adf_os_dma_map_t bmap, adf_os_dmamap_info_t *sg) { VDESC *desc = bmap->buf->desc_list; int count = 0; - + while( desc != NULL ) { sg->dma_segs[count].paddr = (adf_os_dma_addr_t)(desc->buf_addr + desc->data_offset); sg->dma_segs[count].len = desc->data_size; - - count++; + + count++; desc = desc->next_desc; } - - sg->nsegs = count; + + sg->nsegs = count; } /** @@ -445,18 +445,18 @@ __adf_nbuf_dmamap_info(__adf_os_dma_map_t bmap, adf_os_dmamap_info_t *sg) /** * @brief sets the cksum type & value for nbuf * XXX: not fully implemented - * + * * @param buf * @param cksum */ -void +void __adf_nbuf_set_rx_cksum(__adf_nbuf_t buf, adf_nbuf_rx_cksum_t *cksum) { } -a_status_t -__adf_nbuf_get_vlan_info(adf_net_handle_t hdl, __adf_nbuf_t buf, +a_status_t +__adf_nbuf_get_vlan_info(adf_net_handle_t hdl, __adf_nbuf_t buf, adf_net_vlanhdr_t *vlan) { return A_STATUS_OK; @@ -504,7 +504,7 @@ __adf_nbuf_create_frm_frag(__adf_nbuf_queue_t *qhead) } if (cnt != len) { - //adf_os_print("cnt: %x, len: %x, __adf_nbuf_queue_len: %x\n", cnt, len, + //adf_os_print("cnt: %x, len: %x, __adf_nbuf_queue_len: %x\n", cnt, len, // __adf_nbuf_queue_len(qhead)); adf_os_assert(0); } @@ -547,36 +547,36 @@ __adf_nbuf_split_to_frag(__adf_nbuf_t buf, __adf_nbuf_qhead_t *qhead) buf->desc_list = NULL; buf->buf_length = 0; VBUF_free_vbuf(buf); - + } /** * @brief return the last mbuf - * + * * @param m0 - * + * * @return struct mbuf* */ -VDESC * +VDESC * __adf_nbuf_last(VBUF *buf) { VDESC *desc = buf->desc_list; - + //for(; desc->next_desc != NULL; desc = desc->next_desc) // ; while(desc->next_desc != NULL) { desc = desc->next_desc; } - + return desc; } /** * @brief num bytes in the head - * + * * @param adf_nbuf - * + * * @return num of bytes available */ a_uint32_t @@ -589,45 +589,45 @@ __adf_nbuf_headroom(__adf_nbuf_t buf) /** * @brief num of bytes available in the tail excluding the priv * portion - * + * * @param adf_nbuf - * + * * @return num of bytes */ -a_uint32_t +a_uint32_t __adf_nbuf_tailroom(__adf_nbuf_t buf) { VDESC *last_desc = __adf_nbuf_last(buf); - + return last_desc->buf_size - last_desc->data_offset - last_desc->data_size; } /** * @brief get the entire packet length - * + * * @param adf_nbuf - * + * * @return total length of packet (sum of all frag lengths) - */ + */ a_uint32_t __adf_nbuf_len(__adf_nbuf_t buf) { - return buf->buf_length; + return buf->buf_length; } /** * @brief Clone the nbuf (will not create writeable copies) - * + * * @param adf_nbuf - * + * * @return Read-only copy of the nbuf (including clusters) */ -__adf_nbuf_t +__adf_nbuf_t __adf_nbuf_clone(__adf_nbuf_t src) { __adf_nbuf_t buf = NULL; - + return buf; } @@ -641,9 +641,9 @@ __adf_nbuf_cat(__adf_nbuf_t dst, __adf_nbuf_t src) /* * @brief check if the mbuf is cloned or not - * + * * @param buf - * + * * @return a_bool_t */ a_bool_t @@ -655,19 +655,19 @@ __adf_nbuf_is_cloned(__adf_nbuf_t buf) * @brief This will return the header's addr & m_len */ void -__adf_nbuf_peek_header(__adf_nbuf_t buf, a_uint8_t **addr, +__adf_nbuf_peek_header(__adf_nbuf_t buf, a_uint8_t **addr, a_uint32_t *len) { VDESC *desc = buf->desc_list; - + *addr = desc->buf_addr + desc->data_offset; - *len = desc->data_size; + *len = desc->data_size; } /** * @brief init the queue * @param qhead */ -void +void __adf_nbuf_queue_init(__adf_nbuf_qhead_t *qhead) { qhead->qlen = 0; @@ -677,11 +677,11 @@ __adf_nbuf_queue_init(__adf_nbuf_qhead_t *qhead) /** * @brief return the length of queue * @param adf_qhead - * + * * @return length - * + * */ -a_uint32_t +a_uint32_t __adf_nbuf_queue_len(__adf_nbuf_qhead_t *qhead) { return qhead->qlen; @@ -689,34 +689,34 @@ __adf_nbuf_queue_len(__adf_nbuf_qhead_t *qhead) /** * @brief returns the first guy in the Q * @param qhead - * + * * @return (NULL if the Q is empty) */ -__adf_nbuf_t +__adf_nbuf_t __adf_nbuf_queue_first(__adf_nbuf_queue_t *qhead) { return qhead->head; } /** * @brief return the next packet from packet chain - * + * * @param buf (packet) - * + * * @return (NULL if no packets are there) */ -__adf_nbuf_t +__adf_nbuf_t __adf_nbuf_queue_next(__adf_nbuf_t buf) { return buf->next_buf; } /** * @brief check if the queue is empty or not - * + * * @param qhead - * + * * @return a_bool_t */ -a_bool_t +a_bool_t __adf_nbuf_is_queue_empty(__adf_nbuf_qhead_t *qhead) { return ((qhead->qlen == 0)); diff --git a/target_firmware/magpie_fw_dev/target/adf/adf_nbuf_pvt.h b/target_firmware/magpie_fw_dev/target/adf/adf_nbuf_pvt.h index 0b21fb8..a446583 100755 --- a/target_firmware/magpie_fw_dev/target/adf/adf_nbuf_pvt.h +++ b/target_firmware/magpie_fw_dev/target/adf/adf_nbuf_pvt.h @@ -33,7 +33,7 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* - * FreeBSD specific prototypes + * FreeBSD specific prototypes */ #ifndef _ADF_NBUF_PVT_H #define _ADF_NBUF_PVT_H @@ -44,7 +44,7 @@ //#include #define __ADF_NBUF_NULL NULL -#define __ADF_NBUF_CTX_BUF +#define __ADF_NBUF_CTX_BUF typedef VBUF * __adf_nbuf_t; @@ -53,94 +53,94 @@ typedef VBUF * __adf_nbuf_t; */ typedef struct __adf_nbuf_qhead { VBUF *head; - VBUF *tail; + VBUF *tail; a_uint32_t qlen; }__adf_nbuf_qhead_t; typedef __adf_nbuf_qhead_t __adf_nbuf_queue_t; -__adf_nbuf_t -__adf_nbuf_alloc(adf_os_size_t size, - a_uint32_t reserve, a_uint32_t align); +__adf_nbuf_t +__adf_nbuf_alloc(adf_os_size_t size, + a_uint32_t reserve, a_uint32_t align); -void +void __adf_nbuf_free(__adf_nbuf_t buf); -a_uint8_t * +a_uint8_t * __adf_nbuf_push_head(__adf_nbuf_t buf, adf_os_size_t size); - -a_uint8_t * + +a_uint8_t * __adf_nbuf_pull_head(__adf_nbuf_t buf, adf_os_size_t size); -a_uint8_t * +a_uint8_t * __adf_nbuf_put_tail(__adf_nbuf_t buf, adf_os_size_t size); -void +void __adf_nbuf_trim_tail(__adf_nbuf_t buf, adf_os_size_t size); -__adf_nbuf_t +__adf_nbuf_t __adf_nbuf_realloc_headroom(__adf_nbuf_t buf, - a_uint32_t headroom); - -__adf_nbuf_t -__adf_nbuf_realloc_tailroom(__adf_nbuf_t buf, + a_uint32_t headroom); + +__adf_nbuf_t +__adf_nbuf_realloc_tailroom(__adf_nbuf_t buf, a_uint32_t tailroom); - -__adf_nbuf_t + +__adf_nbuf_t __adf_nbuf_expand(__adf_nbuf_t buf, a_uint32_t headroom, a_uint32_t tailroom); - -__adf_nbuf_t + +__adf_nbuf_t __adf_nbuf_copy(__adf_nbuf_t src); -__adf_nbuf_t +__adf_nbuf_t __adf_nbuf_unshare(__adf_nbuf_t src); -void +void __adf_nbuf_frag_info(__adf_nbuf_t buf, adf_os_sglist_t *sg); -a_uint8_t * +a_uint8_t * __adf_nbuf_get_priv(__adf_nbuf_t buf); -void -__adf_nbuf_queue_add(__adf_nbuf_qhead_t *qhead, +void +__adf_nbuf_queue_add(__adf_nbuf_qhead_t *qhead, __adf_nbuf_t buf); - -__adf_nbuf_t + +__adf_nbuf_t __adf_nbuf_queue_remove(__adf_nbuf_qhead_t *qhead); -a_uint32_t -__adf_nbuf_tx_cksum_info(__adf_nbuf_t buf, - a_uint8_t **hdr_off, +a_uint32_t +__adf_nbuf_tx_cksum_info(__adf_nbuf_t buf, + a_uint8_t **hdr_off, a_uint8_t **where); - -void + +void __adf_nbuf_set_rx_cksum(__adf_nbuf_t buf, adf_nbuf_rx_cksum_t *cksum); -void +void __adf_nbuf_get_tso_info(__adf_nbuf_t buf, adf_nbuf_tso_t *tso); -a_status_t -__adf_nbuf_get_vlan_info(adf_net_handle_t hdl, - __adf_nbuf_t buf, - adf_net_vlanhdr_t *vlan); - -void +a_status_t +__adf_nbuf_get_vlan_info(adf_net_handle_t hdl, + __adf_nbuf_t buf, + adf_net_vlanhdr_t *vlan); + +void __adf_nbuf_dmamap_info(__adf_os_dma_map_t bmap, adf_os_dmamap_info_t *sg); /** * @brief return the last mbuf - * + * * @param m0 - * + * * @return struct mbuf* */ -VDESC * +VDESC * __adf_nbuf_last(VBUF *buf); /** * @brief num bytes in the head - * + * * @param adf_nbuf - * + * * @return num of bytes available */ a_uint32_t @@ -149,33 +149,33 @@ __adf_nbuf_headroom(__adf_nbuf_t buf); /** * @brief num of bytes available in the tail excluding the priv * portion - * + * * @param adf_nbuf - * + * * @return num of bytes */ -a_uint32_t +a_uint32_t __adf_nbuf_tailroom(__adf_nbuf_t buf); /** * @brief get the entire packet length - * + * * @param adf_nbuf - * + * * @return total length of packet (sum of all frag lengths) - */ + */ a_uint32_t __adf_nbuf_len(__adf_nbuf_t buf); /** * @brief Clone the nbuf (will not create writeable copies) - * + * * @param adf_nbuf - * + * * @return Read-only copy of the nbuf (including clusters) */ -__adf_nbuf_t +__adf_nbuf_t __adf_nbuf_clone(__adf_nbuf_t src); void @@ -184,9 +184,9 @@ __adf_nbuf_cat(__adf_nbuf_t dst, __adf_nbuf_t src); /* * @brief check if the mbuf is cloned or not - * + * * @param buf - * + * * @return a_bool_t */ a_bool_t @@ -196,53 +196,53 @@ __adf_nbuf_is_cloned(__adf_nbuf_t buf); * @brief This will return the header's addr & m_len */ void -__adf_nbuf_peek_header(__adf_nbuf_t buf, a_uint8_t **addr, +__adf_nbuf_peek_header(__adf_nbuf_t buf, a_uint8_t **addr, a_uint32_t *len); /** * @brief init the queue * @param qhead */ -void +void __adf_nbuf_queue_init(__adf_nbuf_qhead_t *qhead); /** * @brief return the length of queue * @param adf_qhead - * + * * @return length - * + * */ -a_uint32_t +a_uint32_t __adf_nbuf_queue_len(__adf_nbuf_qhead_t *qhead); /** * @brief returns the first guy in the Q * @param qhead - * + * * @return (NULL if the Q is empty) */ -__adf_nbuf_t +__adf_nbuf_t __adf_nbuf_queue_first(__adf_nbuf_queue_t *qhead); /** * @brief return the next packet from packet chain - * + * * @param buf (packet) - * + * * @return (NULL if no packets are there) */ -__adf_nbuf_t +__adf_nbuf_t __adf_nbuf_queue_next(__adf_nbuf_t buf); /** * @brief check if the queue is empty or not - * + * * @param qhead - * + * * @return a_bool_t */ -a_bool_t +a_bool_t __adf_nbuf_is_queue_empty(__adf_nbuf_qhead_t *qhead); __adf_nbuf_t @@ -250,10 +250,10 @@ __adf_nbuf_create_frm_frag(__adf_nbuf_queue_t *head); void __adf_nbuf_split_to_frag(__adf_nbuf_t buf, __adf_nbuf_queue_t *qhead); -a_status_t __adf_nbuf_dmamap_create(__adf_os_device_t osdev, +a_status_t __adf_nbuf_dmamap_create(__adf_os_device_t osdev, __adf_os_dma_map_t *dmap); -void __adf_nbuf_dmamap_destroy(__adf_os_device_t osdev, +void __adf_nbuf_dmamap_destroy(__adf_os_device_t osdev, __adf_os_dma_map_t dmap); a_status_t __adf_nbuf_map(__adf_os_device_t osdev, __adf_os_dma_map_t dmap, diff --git a/target_firmware/magpie_fw_dev/target/adf/adf_net.c b/target_firmware/magpie_fw_dev/target/adf/adf_net.c index ef754a9..79ae62e 100755 --- a/target_firmware/magpie_fw_dev/target/adf/adf_net.c +++ b/target_firmware/magpie_fw_dev/target/adf/adf_net.c @@ -49,13 +49,13 @@ /** * @brief register the driver into the shim * @param[in] drv - * + * * @return a_status_t */ a_status_t __adf_net_register_drv(adf_drv_info_t *drv) { - wlan_pci_register_drv(drv); + wlan_pci_register_drv(drv); return A_STATUS_OK; } diff --git a/target_firmware/magpie_fw_dev/target/adf/adf_net_pvt.h b/target_firmware/magpie_fw_dev/target/adf/adf_net_pvt.h index 9858823..00c513d 100755 --- a/target_firmware/magpie_fw_dev/target/adf/adf_net_pvt.h +++ b/target_firmware/magpie_fw_dev/target/adf/adf_net_pvt.h @@ -44,7 +44,7 @@ #define __ADF_PCI_BAR0 0x10 -a_status_t +a_status_t __adf_net_register_drv(adf_drv_info_t *drv); void @@ -80,7 +80,7 @@ __adf_net_carrier_on(adf_net_handle_t hdl) static inline void __adf_net_start_queue(adf_net_handle_t hdl) -{ +{ } @@ -118,8 +118,8 @@ static inline adf_net_handle_t __adf_net_dev_create(adf_drv_handle_t hdl, adf_de return NULL; } -static inline adf_net_handle_t __adf_net_vdev_create(adf_net_handle_t dev_hdl, - adf_drv_handle_t hdl, adf_vdev_sw_t *op, +static inline adf_net_handle_t __adf_net_vdev_create(adf_net_handle_t dev_hdl, + adf_drv_handle_t hdl, adf_vdev_sw_t *op, adf_net_dev_info_t *info) { return NULL; @@ -140,6 +140,6 @@ static inline adf_os_handle_t __adf_net_hdl_to_os(adf_net_handle_t hdl) { return NULL; -} +} #endif diff --git a/target_firmware/magpie_fw_dev/target/adf/adf_os_atomic_pvt.h b/target_firmware/magpie_fw_dev/target/adf/adf_os_atomic_pvt.h index fcbcc2c..3bb0b40 100755 --- a/target_firmware/magpie_fw_dev/target/adf/adf_os_atomic_pvt.h +++ b/target_firmware/magpie_fw_dev/target/adf/adf_os_atomic_pvt.h @@ -44,9 +44,9 @@ typedef a_uint32_t __adf_os_atomic_t; /** * @brief This initiallizes the varriable to zero - * + * * @param __adf_os_atomic_t (int pointer) - * + * */ static inline void __adf_os_atomic_init(__adf_os_atomic_t *v) @@ -78,7 +78,7 @@ static inline void __adf_os_atomic_write(__adf_os_atomic_t *v,a_uint32_t p) { atomic_store_rel_int(v,(int)p); -} +} */ #endif diff --git a/target_firmware/magpie_fw_dev/target/adf/adf_os_defer_pvt.c b/target_firmware/magpie_fw_dev/target/adf/adf_os_defer_pvt.c index b19f0e5..d27398a 100755 --- a/target_firmware/magpie_fw_dev/target/adf/adf_os_defer_pvt.c +++ b/target_firmware/magpie_fw_dev/target/adf/adf_os_defer_pvt.c @@ -34,7 +34,7 @@ */ #include "adf_os_defer_pvt.h" -void +void __adf_os_defer_func(void *arg, int pending) { __adf_os_defer_ctx_t *ctx = (__adf_os_defer_ctx_t *)arg; diff --git a/target_firmware/magpie_fw_dev/target/adf/adf_os_defer_pvt.h b/target_firmware/magpie_fw_dev/target/adf/adf_os_defer_pvt.h index 525a7f4..66b4ee8 100755 --- a/target_firmware/magpie_fw_dev/target/adf/adf_os_defer_pvt.h +++ b/target_firmware/magpie_fw_dev/target/adf/adf_os_defer_pvt.h @@ -66,13 +66,13 @@ extern void __adf_os_defer_func(void *arg, int pending); /** * @brief initiallize the defer function (work or bh) - * + * * @param defer * @param func * @param arg */ static inline void __adf_os_init_defer(__adf_os_defer_t *defer, - adf_os_defer_fn_t func, + adf_os_defer_fn_t func, void *arg) { defer->ctx.caller_fn = func; @@ -97,27 +97,27 @@ static inline void __adf_os_init_bh(adf_os_handle_t hdl, //__adf_os_init_defer(bh, func, arg); A_TASKLET_INIT_TASK(func, arg, bh); } -static inline void __adf_os_sched_work(adf_os_handle_t hdl, +static inline void __adf_os_sched_work(adf_os_handle_t hdl, __adf_os_work_t * work) { //taskqueue_enqueue(taskqueue_thread, &work->tsk); } -static inline void __adf_os_disable_work(adf_os_handle_t hdl, +static inline void __adf_os_disable_work(adf_os_handle_t hdl, __adf_os_work_t * work) { //taskqueue_drain(taskqueue_thread, &work->tsk); } -static inline void __adf_os_sched_bh(adf_os_handle_t hdl, +static inline void __adf_os_sched_bh(adf_os_handle_t hdl, __adf_os_bh_t * bh) { A_TASKLET_SCHEDULE(bh); } -static inline void __adf_os_disable_bh(adf_os_handle_t hdl, +static inline void __adf_os_disable_bh(adf_os_handle_t hdl, __adf_os_bh_t * bh) { A_TASKLET_DISABLE(bh); } -#endif +#endif diff --git a/target_firmware/magpie_fw_dev/target/adf/adf_os_dma.c b/target_firmware/magpie_fw_dev/target/adf/adf_os_dma.c index 915e8e0..c29f8e4 100755 --- a/target_firmware/magpie_fw_dev/target/adf/adf_os_dma.c +++ b/target_firmware/magpie_fw_dev/target/adf/adf_os_dma.c @@ -45,7 +45,7 @@ void __adf_os_dma_load(void *arg, bus_dma_segment_t *dseg, int nseg, int error) adf_os_assert(nseg == 1); ((bus_dma_segment_t *)arg)[0].ds_addr = dseg[0].ds_addr; - ((bus_dma_segment_t *)arg)[0].ds_len = dseg[0].ds_len; + ((bus_dma_segment_t *)arg)[0].ds_len = dseg[0].ds_len; } #endif @@ -53,29 +53,29 @@ void __adf_os_dma_load(void *arg, bus_dma_segment_t *dseg, int nseg, int error) * @brief Allocates a DMA region, uses the tag elem to store the * tag value which constant for all the mappings done * through this API. - * + * * @param osdev * @param size * @param coherent * @param dmap - * + * * @return void* (Virtual address) */ inline void* -__adf_os_dmamem_alloc(__adf_os_device_t osdev, adf_os_size_t size, +__adf_os_dmamem_alloc(__adf_os_device_t osdev, adf_os_size_t size, a_bool_t coherent, __adf_os_dma_map_t *dmap) -{ +{ (*dmap) = A_ALLOCRAM(sizeof(struct __adf_dma_map)); - + if((*dmap) == NULL){ goto fail_malloc; } - + (*dmap)->ds_addr = A_ALLOCRAM(size); (*dmap)->ds_len = size; - + return (*dmap)->ds_addr; - -fail_malloc: - return NULL; + +fail_malloc: + return NULL; } diff --git a/target_firmware/magpie_fw_dev/target/adf/adf_os_dma_pvt.h b/target_firmware/magpie_fw_dev/target/adf/adf_os_dma_pvt.h index bf4180b..342b2fc 100755 --- a/target_firmware/magpie_fw_dev/target/adf/adf_os_dma_pvt.h +++ b/target_firmware/magpie_fw_dev/target/adf/adf_os_dma_pvt.h @@ -39,17 +39,17 @@ #include inline void* -__adf_os_dmamem_alloc(__adf_os_device_t osdev, adf_os_size_t size, +__adf_os_dmamem_alloc(__adf_os_device_t osdev, adf_os_size_t size, a_bool_t coherent, __adf_os_dma_map_t *dmap); -/* - * Free a previously mapped DMA buffer +/* + * Free a previously mapped DMA buffer * Direction doesnt matter, since this API is called at closing time. */ static inline void __adf_os_dmamem_free(adf_os_device_t osdev, __adf_os_size_t size, a_bool_t coherent, void *vaddr, __adf_os_dma_map_t dmap) -{ +{ } @@ -57,7 +57,7 @@ __adf_os_dmamem_free(adf_os_device_t osdev, __adf_os_size_t size, a_bool_t co //#define __adf_os_dmamem_map2addr(_dmap) ((_dmap)->seg[0].ds_addr) #define __adf_os_dmamem_map2addr(_dmap) ((adf_os_dma_addr_t)(_dmap)->ds_addr) -static inline void +static inline void __adf_os_dmamem_cache_sync(__adf_os_device_t osdev, __adf_os_dma_map_t dmap, adf_os_cache_sync_t sync) { diff --git a/target_firmware/magpie_fw_dev/target/adf/adf_os_io_pvt.h b/target_firmware/magpie_fw_dev/target/adf/adf_os_io_pvt.h index 105216f..1b37cef 100755 --- a/target_firmware/magpie_fw_dev/target/adf/adf_os_io_pvt.h +++ b/target_firmware/magpie_fw_dev/target/adf/adf_os_io_pvt.h @@ -53,6 +53,6 @@ #define __adf_os_htons(x) x #define __adf_os_htonl(x) x -#define __adf_os_cpu_to_le16(x) __bswap16(x) +#define __adf_os_cpu_to_le16(x) __bswap16(x) #endif diff --git a/target_firmware/magpie_fw_dev/target/adf/adf_os_irq_pvt.c b/target_firmware/magpie_fw_dev/target/adf/adf_os_irq_pvt.c index 5a7dfb7..90212bc 100755 --- a/target_firmware/magpie_fw_dev/target/adf/adf_os_irq_pvt.c +++ b/target_firmware/magpie_fw_dev/target/adf/adf_os_irq_pvt.c @@ -45,7 +45,7 @@ extern adf_os_drv_intr g_wlan_intr; * @brief setup the Interrupt handler for the driver * @param[in] dev * @param[in] sc - * + * * @return int */ @@ -53,8 +53,8 @@ int __adf_os_setup_intr(__adf_os_device_t osdev, adf_os_drv_intr fn) { g_wlan_intr = fn; - - return 0; + + return 0; } /** @@ -65,5 +65,5 @@ __adf_os_setup_intr(__adf_os_device_t osdev, adf_os_drv_intr fn) void __adf_os_free_intr(__adf_os_device_t osdev) { - g_wlan_intr = NULL; + g_wlan_intr = NULL; } diff --git a/target_firmware/magpie_fw_dev/target/adf/adf_os_lock_pvt.h b/target_firmware/magpie_fw_dev/target/adf/adf_os_lock_pvt.h index aa60e13..20ac814 100755 --- a/target_firmware/magpie_fw_dev/target/adf/adf_os_lock_pvt.h +++ b/target_firmware/magpie_fw_dev/target/adf/adf_os_lock_pvt.h @@ -40,7 +40,7 @@ typedef int __adf_os_mutex_t; static inline void __adf_os_init_mutex(__adf_os_mutex_t *mtx) { - + } static inline int __adf_os_mutex_acquire(__adf_os_mutex_t *mtx) @@ -77,7 +77,7 @@ static inline void __adf_os_spin_unlock_bh(__adf_os_spinlock_t *lock) { //mtx_unlock_spin(lock); } -static inline a_bool_t __adf_os_spinlock_irq_exec(adf_os_handle_t hdl, __adf_os_spinlock_t *lock, +static inline a_bool_t __adf_os_spinlock_irq_exec(adf_os_handle_t hdl, __adf_os_spinlock_t *lock, adf_os_irqlocked_func_t func, void *arg) { return 0; diff --git a/target_firmware/magpie_fw_dev/target/adf/adf_os_mem_pvt.h b/target_firmware/magpie_fw_dev/target/adf/adf_os_mem_pvt.h index b5bcfa1..7b2f0e1 100755 --- a/target_firmware/magpie_fw_dev/target/adf/adf_os_mem_pvt.h +++ b/target_firmware/magpie_fw_dev/target/adf/adf_os_mem_pvt.h @@ -53,7 +53,7 @@ static inline void __adf_os_mem_free(void *buf) /* move a memory buffer */ static inline void __adf_os_mem_copy(void *dst, const void *src, adf_os_size_t size) { - A_MEMCPY(dst,src,size); + A_MEMCPY(dst,src,size); } /* set a memory buffer */ diff --git a/target_firmware/magpie_fw_dev/target/adf/adf_os_module_pvt.h b/target_firmware/magpie_fw_dev/target/adf/adf_os_module_pvt.h index 08a9617..08313ba 100755 --- a/target_firmware/magpie_fw_dev/target/adf/adf_os_module_pvt.h +++ b/target_firmware/magpie_fw_dev/target/adf/adf_os_module_pvt.h @@ -55,18 +55,18 @@ /** * @brief generic driver /module init function - * + * * @param mod (module data) * @param event (LOAD or UNLOAD) * @param arg (any extra argument needed if - * + * * @return int */ /** * exit module macro */ -#define __adf_os_virt_module_exit(_fn) +#define __adf_os_virt_module_exit(_fn) -#define __adf_os_module_dep(_name, _dep) +#define __adf_os_module_dep(_name, _dep) #endif diff --git a/target_firmware/magpie_fw_dev/target/adf/adf_os_pci_pvt.h b/target_firmware/magpie_fw_dev/target/adf/adf_os_pci_pvt.h index c4d6b70..4e7861f 100755 --- a/target_firmware/magpie_fw_dev/target/adf/adf_os_pci_pvt.h +++ b/target_firmware/magpie_fw_dev/target/adf/adf_os_pci_pvt.h @@ -47,7 +47,7 @@ /** * exit module macro */ -#define __adf_os_pci_module_exit(_fn) +#define __adf_os_pci_module_exit(_fn) /** * initiallize the PCI driver structure @@ -69,10 +69,10 @@ * @param osdev * @param offset * @param val - * + * * @return int */ -static inline int +static inline int __adf_os_pci_config_read8(adf_os_device_t osdev, int offset, a_uint8_t *val) { (*val) = wlan_pci_config_read(offset, 1); @@ -82,39 +82,39 @@ __adf_os_pci_config_read8(adf_os_device_t osdev, int offset, a_uint8_t *val) */ } -static inline int +static inline int __adf_os_pci_config_write8(adf_os_device_t osdev, int offset, a_uint8_t val) { wlan_pci_config_write(offset, val, 1); - return 0; + return 0; } -static inline int +static inline int __adf_os_pci_config_read16(adf_os_device_t osdev, int offset, a_uint16_t *val) { (*val) = wlan_pci_config_read(offset, 2); return 0; } -static inline int +static inline int __adf_os_pci_config_write16(adf_os_device_t osdev, int offset, a_uint16_t val) { wlan_pci_config_write(offset, val, 2); - return 0; + return 0; } -static inline int +static inline int __adf_os_pci_config_read32(adf_os_device_t osdev, int offset, a_uint32_t *val) { (*val) = wlan_pci_config_read(offset, 4); return 0; } -static inline int +static inline int __adf_os_pci_config_write32(adf_os_device_t osdev, int offset, a_uint32_t val) { wlan_pci_config_write(offset, val, 4); - return 0; + return 0; } #endif diff --git a/target_firmware/magpie_fw_dev/target/adf/adf_os_time_pvt.h b/target_firmware/magpie_fw_dev/target/adf/adf_os_time_pvt.h index 3b9d02a..708ff43 100755 --- a/target_firmware/magpie_fw_dev/target/adf/adf_os_time_pvt.h +++ b/target_firmware/magpie_fw_dev/target/adf/adf_os_time_pvt.h @@ -42,7 +42,7 @@ * @brief this code is modified version of tvtohz(9) which * returns signed int which we don't require, hence we * got rid of the type casting thing - * + * * @return unsigned long */ static inline unsigned long @@ -63,7 +63,7 @@ __adf_os_msecs_to_ticks(a_uint32_t msecs) static inline unsigned long __adf_os_getuptime(void) { - return MSEC_TO_TICK(A_MILLISECONDS());; + return MSEC_TO_TICK(A_MILLISECONDS());; } static inline void diff --git a/target_firmware/magpie_fw_dev/target/adf/adf_os_timer_pvt.h b/target_firmware/magpie_fw_dev/target/adf/adf_os_timer_pvt.h index 7ae74be..936ab85 100755 --- a/target_firmware/magpie_fw_dev/target/adf/adf_os_timer_pvt.h +++ b/target_firmware/magpie_fw_dev/target/adf/adf_os_timer_pvt.h @@ -39,7 +39,7 @@ #include "Magpie_api.h" -typedef struct +typedef struct { A_timer_t *magpie_timer; adf_os_timer_func_t timer_func; @@ -50,7 +50,7 @@ typedef struct void __adf_os_timer_func(A_HANDLE timer_handle, void *arg); -/* +/* * Initialize a timer */ static inline void @@ -61,8 +61,8 @@ __adf_os_timer_init(adf_os_handle_t hdl, __adf_os_timer_t *timer, A_INIT_TIMER(timer->magpie_timer, __adf_os_timer_func, arg); } -/* - * start a timer +/* + * start a timer */ static inline void __adf_os_timer_start(__adf_os_timer_t *timer, int msec) diff --git a/target_firmware/magpie_fw_dev/target/adf/adf_os_types_pvt.h b/target_firmware/magpie_fw_dev/target/adf/adf_os_types_pvt.h index dc8316c..5ff6a1c 100755 --- a/target_firmware/magpie_fw_dev/target/adf/adf_os_types_pvt.h +++ b/target_firmware/magpie_fw_dev/target/adf/adf_os_types_pvt.h @@ -65,14 +65,14 @@ /** * CACHE-SYNC (DMA) */ -#define __ADF_SYNC_PREREAD 0 +#define __ADF_SYNC_PREREAD 0 #define __ADF_SYNC_POSTREAD 1 #define __ADF_SYNC_PREWRITE 2 #define __ADF_SYNC_POSTWRITE 3 #define __ADF_OS_DMA_TO_DEVICE 0 -#define __ADF_OS_DMA_FROM_DEVICE 1 - +#define __ADF_OS_DMA_FROM_DEVICE 1 + struct __adf_softc; @@ -86,24 +86,24 @@ enum __adf_net_wireless_evcode{ __ADF_IEEE80211_SCAN = 105, __ADF_IEEE80211_REPLAY = 106, __ADF_IEEE80211_MICHAEL = 107, - __ADF_IEEE80211_REJOIN = 108, + __ADF_IEEE80211_REJOIN = 108, __ADF_CUSTOM_PUSH_BUTTON = 109, }; /* generic data types */ struct __adf_device { -int dummy; -}; +int dummy; +}; typedef struct __adf_device *__adf_os_device_t; struct __adf_dma_map { VBUF *buf; - + A_UINT32 *ds_addr; A_UINT16 ds_len; -}; +}; typedef struct __adf_dma_map *__adf_os_dma_map_t; @@ -116,23 +116,23 @@ typedef int __adf_os_off_t; #define __adf_os_iomem_t #if 0 -typedef int __a_uint8_t; -typedef int __a_int8_t; -typedef int __a_uint16_t; -typedef int __a_int16_t; -typedef int __a_uint32_t; -typedef int __a_int32_t; -typedef int __a_uint64_t; -typedef int __a_int64_t; +typedef int __a_uint8_t; +typedef int __a_int8_t; +typedef int __a_uint16_t; +typedef int __a_int16_t; +typedef int __a_uint32_t; +typedef int __a_int32_t; +typedef int __a_uint64_t; +typedef int __a_int64_t; #else typedef A_UINT8 __a_uint8_t; -typedef A_INT8 __a_int8_t; -typedef A_UINT16 __a_uint16_t; -typedef A_INT16 __a_int16_t; -typedef A_UINT32 __a_uint32_t; -typedef A_INT32 __a_int32_t; -typedef A_UINT64 __a_uint64_t; -typedef A_INT64 __a_int64_t; +typedef A_INT8 __a_int8_t; +typedef A_UINT16 __a_uint16_t; +typedef A_INT16 __a_int16_t; +typedef A_UINT32 __a_uint32_t; +typedef A_INT32 __a_int32_t; +typedef A_UINT64 __a_uint64_t; +typedef A_INT64 __a_int64_t; typedef A_UINT32 u_int32_t; typedef A_UINT16 u_int16_t; @@ -150,7 +150,7 @@ typedef A_UINT64 u_int64_t; //#define __adf_os_print my_printf #define __adf_os_print A_PRINTF -#if 1 +#if 1 #if defined(__XCC__) #include "stdarg.h" #define __va_list __gnuc_va_list diff --git a/target_firmware/magpie_fw_dev/target/adf/adf_os_util_pvt.h b/target_firmware/magpie_fw_dev/target/adf/adf_os_util_pvt.h index 0efeb06..23b71b1 100755 --- a/target_firmware/magpie_fw_dev/target/adf/adf_os_util_pvt.h +++ b/target_firmware/magpie_fw_dev/target/adf/adf_os_util_pvt.h @@ -37,18 +37,18 @@ #include -#define __adf_os_unlikely(_expr) -#define __adf_os_likely(_expr) +#define __adf_os_unlikely(_expr) +#define __adf_os_likely(_expr) /** - * @brief memory barriers. + * @brief memory barriers. */ #define __adf_os_wmb() oops no implementation... #define __adf_os_rmb() oops no implementation... #define __adf_os_mb() oops no implementation... -#define __adf_os_min(_a, _b) ((_a < _b) ? _a : _b) -#define __adf_os_max(_a, _b) ((_a > _b) ? _a : _b) +#define __adf_os_min(_a, _b) ((_a < _b) ? _a : _b) +#define __adf_os_max(_a, _b) ((_a > _b) ? _a : _b) #ifdef _DEBUG_BUILD_ #define __adf_os_assert(expr) do {\ @@ -79,10 +79,10 @@ #define inline #endif -static void inline +static void inline __adf_os_get_rand(adf_os_handle_t hdl,__a_uint8_t *ptr, __a_uint32_t len) { -#if 0 +#if 0 u_int8_t *dp = ptr; u_int32_t v; size_t nb; @@ -93,7 +93,7 @@ __adf_os_get_rand(adf_os_handle_t hdl,__a_uint8_t *ptr, __a_uint32_t len) dp += sizeof(u_int32_t); len -= nb; } -#endif +#endif } diff --git a/target_firmware/magpie_fw_dev/target/buf_pool/buf_pool_api.h b/target_firmware/magpie_fw_dev/target/buf_pool/buf_pool_api.h index b4ff2b5..54cdd1d 100755 --- a/target_firmware/magpie_fw_dev/target/buf_pool/buf_pool_api.h +++ b/target_firmware/magpie_fw_dev/target/buf_pool/buf_pool_api.h @@ -34,9 +34,9 @@ */ /* * @File: buf_pool_api.h - * + * * @Abstract: BUF Pool api - * + * * @Notes: */ @@ -48,11 +48,11 @@ /* endpoint defines */ typedef enum { - POOL_ID_HTC_CONTROL = 0, - POOL_ID_WMI_SVC_CMD_REPLY = 1, + POOL_ID_HTC_CONTROL = 0, + POOL_ID_WMI_SVC_CMD_REPLY = 1, POOL_ID_WMI_SVC_EVENT = 2, POOL_ID_WLAN_RX_BUF = 3, - POOL_ID_MAX = 10 + POOL_ID_MAX = 10 } BUF_POOL_ID; typedef void* pool_handle_t; @@ -60,19 +60,19 @@ typedef void* pool_handle_t; /* hardware API table structure (API descriptions below) */ struct buf_pool_api { pool_handle_t (*_init)(adf_os_handle_t handle); - + void (*_shutdown)(pool_handle_t handle); - + void (*_create_pool)(pool_handle_t handle, BUF_POOL_ID poolId, int nItems, int nSize); - + adf_nbuf_t (*_alloc_buf)(pool_handle_t handle, BUF_POOL_ID poolId, int reserve); - + adf_nbuf_t (*_alloc_buf_align)(pool_handle_t handle, BUF_POOL_ID poolId, int reserve, int align); - + void (*_free_buf)(pool_handle_t handle, BUF_POOL_ID poolId, adf_nbuf_t buf); - + /* room to expand this table by another table */ - void *pReserved; + void *pReserved; }; extern void buf_pool_module_install(struct buf_pool_api *apis); diff --git a/target_firmware/magpie_fw_dev/target/buf_pool/buf_pool_dynamic.c b/target_firmware/magpie_fw_dev/target/buf_pool/buf_pool_dynamic.c index 7e70fd5..2113cd2 100755 --- a/target_firmware/magpie_fw_dev/target/buf_pool/buf_pool_dynamic.c +++ b/target_firmware/magpie_fw_dev/target/buf_pool/buf_pool_dynamic.c @@ -33,37 +33,37 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* - * @File: - * + * @File: + * * @Abstract: Buf pool implementation: Dynamic version - * - * @Notes: + * + * @Notes: */ #include #include #include -#include +#include //#include #include - + LOCAL htc_handle_t _buf_pool_dynamic_init(adf_os_handle_t handle); LOCAL void _buf_pool_dynamic_create_pool(pool_handle_t handle, BUF_POOL_ID poolId, int nItems, int nSize); LOCAL adf_nbuf_t _buf_pool_dynamic_alloc_buf(pool_handle_t handle, BUF_POOL_ID poolId, int reserve); LOCAL adf_nbuf_t _buf_pool_dynamic_alloc_buf_align(pool_handle_t handle, BUF_POOL_ID poolId, int reserve, int align); LOCAL void _buf_pool_dynamic_free_buf(pool_handle_t handle, BUF_POOL_ID poolId, adf_nbuf_t buf); LOCAL void _buf_pool_dynamic_shutdown(pool_handle_t handle); - + typedef struct _POOL_CONFIG { int nSize; } POOL_CONFIG; - + typedef struct _BUF_POOL_DYNAMIC_CONTEXT { adf_os_handle_t OSHandle; - POOL_CONFIG poolConf[POOL_ID_MAX]; + POOL_CONFIG poolConf[POOL_ID_MAX]; } BUF_POOL_DYNAMIC_CONTEXT; void buf_pool_module_install(struct buf_pool_api *pAPIs) -{ +{ pAPIs->_init = _buf_pool_dynamic_init; pAPIs->_create_pool = _buf_pool_dynamic_create_pool; pAPIs->_alloc_buf = _buf_pool_dynamic_alloc_buf; @@ -71,47 +71,47 @@ void buf_pool_module_install(struct buf_pool_api *pAPIs) pAPIs->_free_buf = _buf_pool_dynamic_free_buf; pAPIs->_shutdown = _buf_pool_dynamic_shutdown; } - + LOCAL pool_handle_t _buf_pool_dynamic_init(adf_os_handle_t handle) { BUF_POOL_DYNAMIC_CONTEXT *ctx; - + ctx = (BUF_POOL_DYNAMIC_CONTEXT *)adf_os_mem_alloc(sizeof(BUF_POOL_DYNAMIC_CONTEXT)); ctx->OSHandle = handle; - - return ctx; -} - -LOCAL void _buf_pool_dynamic_shutdown(pool_handle_t handle) + + return ctx; +} + +LOCAL void _buf_pool_dynamic_shutdown(pool_handle_t handle) { BUF_POOL_DYNAMIC_CONTEXT *ctx = (BUF_POOL_DYNAMIC_CONTEXT *)handle; - + adf_os_mem_free(ctx); } LOCAL void _buf_pool_dynamic_create_pool(pool_handle_t handle, BUF_POOL_ID poolId, int nItems, int nSize) { BUF_POOL_DYNAMIC_CONTEXT *ctx = (BUF_POOL_DYNAMIC_CONTEXT *)handle; - + ctx->poolConf[poolId].nSize = nSize; } - + LOCAL adf_nbuf_t _buf_pool_dynamic_alloc_buf(pool_handle_t handle, BUF_POOL_ID poolId, int reserve) { BUF_POOL_DYNAMIC_CONTEXT *ctx = (BUF_POOL_DYNAMIC_CONTEXT *)handle; POOL_CONFIG *poolConf = &ctx->poolConf[poolId]; - - return adf_nbuf_alloc(poolConf->nSize, + + return adf_nbuf_alloc(poolConf->nSize, reserve, 0); } - + LOCAL adf_nbuf_t _buf_pool_dynamic_alloc_buf_align(pool_handle_t handle, BUF_POOL_ID poolId, int reserve, int align) { BUF_POOL_DYNAMIC_CONTEXT *ctx = (BUF_POOL_DYNAMIC_CONTEXT *)handle; POOL_CONFIG *poolConf = &ctx->poolConf[poolId]; - return adf_nbuf_alloc(poolConf->nSize, + return adf_nbuf_alloc(poolConf->nSize, reserve, align); } @@ -119,7 +119,7 @@ LOCAL adf_nbuf_t _buf_pool_dynamic_alloc_buf_align(pool_handle_t handle, BUF_PO LOCAL void _buf_pool_dynamic_free_buf(pool_handle_t handle, BUF_POOL_ID poolId, adf_nbuf_t buf) { //BUF_POOL_DYNAMIC_CONTEXT *ctx = (BUF_POOL_DYNAMIC_CONTEXT *)handle; - + adf_nbuf_free(buf); } diff --git a/target_firmware/magpie_fw_dev/target/buf_pool/buf_pool_static.c b/target_firmware/magpie_fw_dev/target/buf_pool/buf_pool_static.c index 6886e8a..33a95fb 100755 --- a/target_firmware/magpie_fw_dev/target/buf_pool/buf_pool_static.c +++ b/target_firmware/magpie_fw_dev/target/buf_pool/buf_pool_static.c @@ -33,20 +33,20 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* - * @File: - * + * @File: + * * @Abstract: Buf pool implementation: static version - * - * @Notes: + * + * @Notes: */ #include -#include +#include #include #include #include #include -#include +#include #include "buf_pool_static.h" @@ -55,12 +55,12 @@ LOCAL void _buf_pool_static_create_pool(pool_handle_t handle, BUF_POOL_ID poolId LOCAL adf_nbuf_t _buf_pool_static_alloc_buf(pool_handle_t handle, BUF_POOL_ID poolId, int reserve); LOCAL adf_nbuf_t _buf_pool_static_alloc_buf_align(pool_handle_t handle, BUF_POOL_ID poolId, int reserve, int align); LOCAL void _buf_pool_static_free_buf(pool_handle_t handle, BUF_POOL_ID poolId, adf_nbuf_t buf); -LOCAL void _buf_pool_static_shutdown(pool_handle_t handle); +LOCAL void _buf_pool_static_shutdown(pool_handle_t handle); BUF_POOL_STATIC_CONTEXT g_poolCtx; void buf_pool_module_install(struct buf_pool_api *pAPIs) -{ +{ pAPIs->_init = _buf_pool_static_init; pAPIs->_create_pool = _buf_pool_static_create_pool; pAPIs->_alloc_buf = _buf_pool_static_alloc_buf; @@ -68,29 +68,29 @@ void buf_pool_module_install(struct buf_pool_api *pAPIs) pAPIs->_free_buf = _buf_pool_static_free_buf; pAPIs->_shutdown = _buf_pool_static_shutdown; } - + LOCAL pool_handle_t _buf_pool_static_init(adf_os_handle_t handle) { #if 1 int i; - + for(i=0; i < POOL_ID_MAX; i++) { g_poolCtx.bufQ[i] = NULL; } - + return &g_poolCtx; -#else +#else BUF_POOL_STATIC_CONTEXT *ctx; - + //ctx = (BUF_POOL_static_CONTEXT *)A_ALLOCRAM(sizeof(BUF_POOL_static_CONTEXT)); ctx = (BUF_POOL_STATIC_CONTEXT *)adf_os_mem_alloc(sizeof(BUF_POOL_STATIC_CONTEXT)); ctx->NetHandle = handle; - - return ctx; -#endif -} - -LOCAL void _buf_pool_static_shutdown(pool_handle_t handle) + + return ctx; +#endif +} + +LOCAL void _buf_pool_static_shutdown(pool_handle_t handle) { // SHALL NOT BE USED in FW } @@ -100,9 +100,9 @@ LOCAL void _buf_pool_static_create_pool(pool_handle_t handle, BUF_POOL_ID poolId int i; VBUF *buf; VDESC *desc; - + //BUF_POOL_STATIC_CONTEXT *ctx = (BUF_POOL_STATIC_CONTEXT *)handle; - + for ( i = 0; i < nItems; i++) { buf = VBUF_alloc_vbuf(); desc = VDESC_alloc_vdesc(); @@ -111,10 +111,10 @@ LOCAL void _buf_pool_static_create_pool(pool_handle_t handle, BUF_POOL_ID poolId desc->buf_size = nSize; desc->data_offset = 0; desc->data_size = 0; - - buf->buf_length = 0; + + buf->buf_length = 0; buf->desc_list = desc; - + if ( g_poolCtx.bufQ[poolId] == NULL ) { g_poolCtx.bufQ[poolId] = buf; } else { @@ -123,21 +123,21 @@ LOCAL void _buf_pool_static_create_pool(pool_handle_t handle, BUF_POOL_ID poolId } } } - + LOCAL adf_nbuf_t _buf_pool_static_alloc_buf(pool_handle_t handle, BUF_POOL_ID poolId, int reserve) { VBUF *buf; - + buf = g_poolCtx.bufQ[poolId]; if ( buf != NULL ) { g_poolCtx.bufQ[poolId] = buf->next_buf; - + buf->next_buf = NULL; buf->desc_list->data_offset = reserve; buf->desc_list->data_size = 0; buf->buf_length = 0; } - + return buf; } @@ -145,7 +145,7 @@ LOCAL adf_nbuf_t _buf_pool_static_alloc_buf_align(pool_handle_t handle, BUF_POO { return _buf_pool_static_alloc_buf(handle, poolId, reserve); } - + LOCAL void _buf_pool_static_free_buf(pool_handle_t handle, BUF_POOL_ID poolId, adf_nbuf_t buf) { if ( g_poolCtx.bufQ[poolId] == NULL ) { diff --git a/target_firmware/magpie_fw_dev/target/buf_pool/buf_pool_static.h b/target_firmware/magpie_fw_dev/target/buf_pool/buf_pool_static.h index d882436..02c55ad 100755 --- a/target_firmware/magpie_fw_dev/target/buf_pool/buf_pool_static.h +++ b/target_firmware/magpie_fw_dev/target/buf_pool/buf_pool_static.h @@ -33,11 +33,11 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* - * @File: - * - * @Abstract: - * - * @Notes: + * @File: + * + * @Abstract: + * + * @Notes: */ #ifndef BUF_POOL_STATIC_H_ @@ -45,7 +45,7 @@ typedef struct _BUF_POOL_STATIC_CONTEXT { VBUF *bufQ[POOL_ID_MAX]; - + // Left a door for extension the structure void *pReserved; } BUF_POOL_STATIC_CONTEXT; diff --git a/target_firmware/magpie_fw_dev/target/cmnos/clock_api.h b/target_firmware/magpie_fw_dev/target/cmnos/clock_api.h index c7aae71..82b80fe 100755 --- a/target_firmware/magpie_fw_dev/target/cmnos/clock_api.h +++ b/target_firmware/magpie_fw_dev/target/cmnos/clock_api.h @@ -48,7 +48,7 @@ struct clock_api { A_UINT32 (* _refclk_speed_get)(void); A_UINT32 (* _milliseconds)(void); void (* _sysclk_change)(void); - + void (* _clock_tick)(void); }; diff --git a/target_firmware/magpie_fw_dev/target/cmnos/cmnos_api.h b/target_firmware/magpie_fw_dev/target/cmnos/cmnos_api.h index ccd3033..8325273 100755 --- a/target_firmware/magpie_fw_dev/target/cmnos/cmnos_api.h +++ b/target_firmware/magpie_fw_dev/target/cmnos/cmnos_api.h @@ -156,7 +156,7 @@ do { \ #define A_MEMMOVE(dst, src, size) #define A_MEMCMP(p1, p2, nbytes) -#endif +#endif #if 1 @@ -200,9 +200,9 @@ do { \ #define A_UART_HWINIT(freq, baud) -#define A_UART_ENABLED() +#define A_UART_ENABLED() -#define A_PUTS(str) +#define A_PUTS(str) #define A_PUTC(ch) #define A_GETC(pCh) @@ -247,7 +247,7 @@ do { \ #define A_IS_HOST_PRESENT() #define A_KBHIT(delay) #define A_GET_ROM_VER() -#endif +#endif //#if SYSTEM_MODULE_DBG /* debug Support */ @@ -268,16 +268,16 @@ do { \ #define A_USB_EP0_SETUP() A_CMN(usb._usb_ep0_setup()) #define A_USB_EP0_TX_DATA() A_CMN(usb._usb_ep0_tx_data()) #define A_USB_EP0_RX_DATA() A_CMN(usb._usb_ep0_rx_data()) - + #define A_USB_GET_CONFIG() A_CMN(usb._usb_get_configuration()) #define A_USB_SET_CONFIG() A_CMN(usb._usb_set_configuration()) - + #define A_USB_GET_INTERFACE() A_CMN(usb._usb_get_interface()) #define A_USB_SET_INTERFACE() A_CMN(usb._usb_set_interface()) - + #define A_USB_STANDARD_CMD() A_CMN(usb._usb_standard_cmd()) #define A_USB_VENDOR_CMD() A_CMN(usb._usb_vendor_cmd()) - + #define A_USB_POWER_OFF() A_CMN(usb._usb_power_off()) #define A_USB_RESET_FIFO() A_CMN(usb._usb_reset_fifo()) #define A_USB_GEN_WDT() A_CMN(usb._usb_gen_wdt()) @@ -299,31 +299,31 @@ do { \ #else #define A_USB_INIT() -#define A_USB_TASK() +#define A_USB_TASK() #define A_USB_INIT_PHY() -#define A_USB_EP0_SETUP() -#define A_USB_EP0_TX() -#define A_USB_EP0_RX() - -#define A_USB_GET_CONFIG() -#define A_USB_SET_CONFIG() - -#define A_USB_GET_INTERFACE() -#define A_USB_SET_INTERFACE() - -#define A_USB_STANDARD_CMD() -#define A_USB_VENDOR_CMD() - +#define A_USB_EP0_SETUP() +#define A_USB_EP0_TX() +#define A_USB_EP0_RX() + +#define A_USB_GET_CONFIG() +#define A_USB_SET_CONFIG() + +#define A_USB_GET_INTERFACE() +#define A_USB_SET_INTERFACE() + +#define A_USB_STANDARD_CMD() +#define A_USB_VENDOR_CMD() + #define A_USB_POWER_OFF() #define A_USB_RESET_FIFO() #define A_USB_GEN_WDT() #define A_USB_JUMP_BOOT() #define A_USB_GET_DESCRIPTOR() -#define A_USB_SET_ADDRESS() -#define A_USB_SET_FEATURE() -#define A_USB_CLEAR_FEATURE() +#define A_USB_SET_ADDRESS() +#define A_USB_SET_FEATURE() +#define A_USB_CLEAR_FEATURE() #define A_USB_GET_STATUS() #define A_USB_SETUP_DESC() @@ -458,10 +458,10 @@ do { \ A_CMN(timer._timer_run()) #define A_PCI_BOOT_INIT() \ - A_CMN(pci.pci_boot_init()) + A_CMN(pci.pci_boot_init()) #define A_GMAC_BOOT_INIT() \ - A_CMN(gmac.gmac_boot_init()) + A_CMN(gmac.gmac_boot_init()) #if SYSTEM_MODULE_ALLOCRAM /* Default size of ALLOCRAM area */ @@ -541,7 +541,7 @@ typedef struct _A_cmnos_indirection_table { int (* hal_linkage_check)(int sz, struct _A_os_linkage_check *); unsigned int *start_bss; void (* app_start)(void); - + #if SYSTEM_MODULE_MEM struct mem_api mem; #endif diff --git a/target_firmware/magpie_fw_dev/target/cmnos/cmnos_clock.c b/target_firmware/magpie_fw_dev/target/cmnos/cmnos_clock.c index d1b959d..9f31210 100755 --- a/target_firmware/magpie_fw_dev/target/cmnos/cmnos_clock.c +++ b/target_firmware/magpie_fw_dev/target/cmnos/cmnos_clock.c @@ -61,29 +61,29 @@ LOCAL const struct cmnos_clock_s { A_UINT32 pll_settling_time; /* 50us */ } cmnos_clocking_table[] = { {A_REFCLK_10_MHZ, - //10485760, + //10485760, 10000000, - 0x0, + 0x0, 0x0, 0x0}, - {A_REFCLK_20_MHZ, - //20971520, + {A_REFCLK_20_MHZ, + //20971520, 20000000, - 0x0, + 0x0, 0x0, 0x0}, {A_REFCLK_40_MHZ, - //41943040, - 40000000, + //41943040, + 40000000, 0x0, 0x0, 0x0}, - {A_REFCLK_UNKNOWN, - 0, - 0x0, + {A_REFCLK_UNKNOWN, + 0, + 0x0, 0x0, 0x0}, }; @@ -147,7 +147,7 @@ cmnos_delay_us(int us) A_UINT32 ref_clk = (clock_info->ticks_per_sec) >> 20; A_UINT32 start_time = NOW(); unsigned int num_ticks = us*ref_clk; // system_freq == number of ticks per 1us - + while ( (NOW() - start_time) < num_ticks) { /* busy spin */; } @@ -267,7 +267,7 @@ cmnos_clock_init(A_UINT32 ref_clk) clock_info = (struct cmnos_clock_s *)&cmnos_clocking_table[i]; // HOST_INTEREST->hi_clock_info = (A_UINT32)clock_info; - + #endif } @@ -277,7 +277,7 @@ LOCAL void cmnos_tick(void) { #if 0 - + set_ccompare0(xthal_get_ccompare(XTENSA_TIMER_0)+ONE_MSEC); cticks++; diff --git a/target_firmware/magpie_fw_dev/target/cmnos/cmnos_sflash.c b/target_firmware/magpie_fw_dev/target/cmnos/cmnos_sflash.c index 1d02293..4641162 100755 --- a/target_firmware/magpie_fw_dev/target/cmnos/cmnos_sflash.c +++ b/target_firmware/magpie_fw_dev/target/cmnos/cmnos_sflash.c @@ -449,7 +449,7 @@ cmnos_sflash_init(void) /* "Autosize-determination of the address size of serial flash" is obsolete according to Brian Yang's mail : * The designers reached an conclusion that the spi master (the apb_spi interface control) will be - * modified as ¡§presuming the attached flash model to be 24-bit addressing¡¨, i.e., no more + * modified as presuming the attached flash model to be 24-bit addressing, i.e., no more * auto-size detection! * Hence you are free to force the 24-bit addressing in the *.c test code. */ diff --git a/target_firmware/magpie_fw_dev/target/cmnos/dbg_api.c b/target_firmware/magpie_fw_dev/target/cmnos/dbg_api.c index 2391034..583ca57 100755 --- a/target_firmware/magpie_fw_dev/target/cmnos/dbg_api.c +++ b/target_firmware/magpie_fw_dev/target/cmnos/dbg_api.c @@ -564,7 +564,7 @@ static int db_intr_cmd(char *cmd, char *param1, char *param2, char *param3) pending_intrs = A_INTR_GET_INTRENABLE()&(~CMNOS_IMASK_XTTIMER); A_INTR_SET_INTRENABLE(pending_intrs); A_PRINTF("- intr [0x%08x]\n\r", pending_intrs); - + } else if( db_ascii_to_hex(param2, &data)==0 ) { @@ -572,7 +572,7 @@ static int db_intr_cmd(char *cmd, char *param1, char *param2, char *param3) delay = data; else delay = 3; - + A_PRINTF("==>set cb to %d seconds \n\r", delay); } @@ -623,7 +623,7 @@ static void clk_change(uint32_t clk, uint32_t ratio, uint32_t baud) clk_sel = 4; break; case 40: - clk_sel = 6; + clk_sel = 6; break; default: clk_sel = 6; @@ -640,7 +640,7 @@ static int db_clock_cmd(char *cmd, char *param1, char *param2, char *param3) uint32_t ratio = 1; uint32_t baud = 19200; uint32_t clk = 0; - + if( db_ascii_to_int(param1, &clk) != -1 ) { A_PRINTF("changing clock to %d\n", clk); @@ -667,7 +667,7 @@ static int db_info_cmd(char *cmd, char *param1, char *param2, char *param3) return 1; #else - + { uint32_t ccount1; uint32_t ccount2; diff --git a/target_firmware/magpie_fw_dev/target/cmnos/k2_cmnos_clock_patch.c b/target_firmware/magpie_fw_dev/target/cmnos/k2_cmnos_clock_patch.c index acfcab2..b6816a2 100755 --- a/target_firmware/magpie_fw_dev/target/cmnos/k2_cmnos_clock_patch.c +++ b/target_firmware/magpie_fw_dev/target/cmnos/k2_cmnos_clock_patch.c @@ -38,7 +38,7 @@ a_uint32_t ref_clk = 0; extern a_uint32_t cticks; -// clock change +// clock change // void cmnos_clock_init_patch(a_uint32_t refclk) { @@ -46,7 +46,7 @@ void cmnos_clock_init_patch(a_uint32_t refclk) } // retrieve current clock setting -// +// a_uint32_t cmnos_refclk_speed_get_patch(void) { return ref_clk; @@ -59,7 +59,7 @@ void cmnos_delay_us_patch(int us) { a_uint32_t start_time = NOW(); unsigned int num_ticks = us*ref_clk; // system_freq == number of ticks per 1us - + while ( (NOW() - start_time) < num_ticks) { /* busy spin */ ; @@ -84,11 +84,11 @@ void cmnos_tick_patch(void) } // get current sysmem up time in milliseconds based -// +// a_uint32_t cmnos_milliseconds_patch(void) { cmnos_tick_patch(); - + return (cticks); } diff --git a/target_firmware/magpie_fw_dev/target/hif/k2_HIF_usb_patch.c b/target_firmware/magpie_fw_dev/target/hif/k2_HIF_usb_patch.c index fd0075c..6276f79 100755 --- a/target_firmware/magpie_fw_dev/target/hif/k2_HIF_usb_patch.c +++ b/target_firmware/magpie_fw_dev/target/hif/k2_HIF_usb_patch.c @@ -40,14 +40,14 @@ #include #include #include -#include +#include #include #include #include "hif_usb.h" /* - * -- support more than 64 bytes command on ep4 -- + * -- support more than 64 bytes command on ep4 -- */ int _HIFusb_get_max_msg_len_patch(hif_handle_t handle, int pipe) { @@ -55,7 +55,7 @@ int _HIFusb_get_max_msg_len_patch(hif_handle_t handle, int pipe) case HIF_USB_PIPE_INTERRUPT: case HIF_USB_PIPE_COMMAND: return 512; - + default: return 1600; } diff --git a/target_firmware/magpie_fw_dev/target/hif/usb_api_magpie_patch.c b/target_firmware/magpie_fw_dev/target/hif/usb_api_magpie_patch.c index 3391a69..4586a08 100755 --- a/target_firmware/magpie_fw_dev/target/hif/usb_api_magpie_patch.c +++ b/target_firmware/magpie_fw_dev/target/hif/usb_api_magpie_patch.c @@ -126,11 +126,11 @@ static void turn_off_merlin() default_data[6] = 0x1aaabe40; default_data[7] = 0xbe105554; default_data[8] = 0x00043007; - + for(i=0; i<9; i++) { A_DELAY_USECS(10); - + iowrite32(0x10ff4040, default_data[i]); } A_DELAY_USECS(10); @@ -143,7 +143,7 @@ static void turn_off_merlin() * -- turn_off_phy -- * * . write shift register to both pcie ep and rc - * . + * . */ static void turn_off_phy() @@ -164,16 +164,16 @@ static void turn_off_phy() for(i=0; i<9; i++) { - // check for the done bit to be set + // check for the done bit to be set while (1) { if (ioread32(0x40028) & BIT31) break; } - + A_DELAY_USECS(1); - + iowrite32(0x40024, default_data[i]); } iowrite32(0x40028, BIT0); @@ -181,12 +181,12 @@ static void turn_off_phy() static void turn_off_phy_rc() { - + volatile uint32_t default_data[9]; uint32_t i=0; - + A_PRINTF("turn_off_phy_rc\n"); - + default_data[0] = 0x9248fd00; default_data[1] = 0x24924924; default_data[2] = 0xa8000019; @@ -196,11 +196,11 @@ static void turn_off_phy_rc() default_data[6] = 0x1aaabe40; default_data[7] = 0xbe105554; default_data[8] = 0x00043007; - + for(i=0; i<9; i++) { - // check for the done bit to be set - + // check for the done bit to be set + while (1) { if (ioread32(0x40028) & BIT31) @@ -221,7 +221,7 @@ volatile uint32_t gpio = 0x0; * -- patch zfTurnOffPower -- * * . set suspend counter to non-zero value - * . + * . */ void zfTurnOffPower_patch(void) { @@ -237,13 +237,13 @@ void zfTurnOffPower_patch(void) //32clk wait for External ETH PLL stable A_DELAY_USECS(100); - + iowrite32(0x52000, 0x70303); /* read back 0x703f7 */ iowrite32(0x52008, 0x0e91c); /* read back 0x1e948 */ - + io32_set(MAGPIE_REG_SUSPEND_ENABLE_ADDR, BIT0); - // wake up, and turn on cpu, eth, pcie and usb pll + // wake up, and turn on cpu, eth, pcie and usb pll _fw_power_on(); // restore gpio and other settings _fw_restore_dma_fifo(); @@ -297,7 +297,7 @@ static void _fw_reset_dma_fifo() A_PRINTF("0x4048 0x%x ......\n", ioread32(0x10ff4048)); A_PRINTF("0x404C 0x%x ......\n", ioread32(0x10ff404C)); A_PRINTF("0x4088 0x%x ......\n", ioread32(0x10ff4088)); - + // turn off merlin turn_off_merlin(); // pcie ep @@ -308,7 +308,7 @@ static void _fw_reset_dma_fifo() io32_clr(0x40040, BIT0 | BIT1); A_PRINTF("turn_off_magpie_ep_end ......\n"); - // pcie rc + // pcie rc A_PRINTF("turn_off_magpie_rc_start ......\n"); A_DELAY_USECS(measure_time); io32_clr(0x40040, BIT0); @@ -318,7 +318,7 @@ static void _fw_reset_dma_fifo() A_PRINTF("0x4001C %p ......\n", ioread32(0x4001c)); A_PRINTF("0x40040 %p ......\n", ioread32(0x40040)); - + /* turn off pcie_pll - power down (bit16) */ A_PRINTF(" before pwd PCIE PLL CFG:0x5601C: 0x%08x\n", ioread32(0x5601C)); @@ -351,7 +351,7 @@ static void _fw_power_off() * 2. turn off CPU PLL * 3. turn off ETH PLL * 4. disable ETH PLL bypass and update - * 4.1 set suspend timeout + * 4.1 set suspend timeout * 5. set SUSPEND_ENABLE */ @@ -374,14 +374,14 @@ static void _fw_power_off() } static void _fw_power_on() -{ +{ /* * 1. turn on CPU PLL * 2. disable CPU bypass * 3. turn on ETH PLL * 4. disable ETH PLL bypass and update * 5. turn on pcie pll - */ + */ io32_clr(MAGPIE_REG_ETH_PLL_ADDR, BIT16); @@ -392,7 +392,7 @@ static void _fw_power_on() static void _fw_restore_dma_fifo(void) { io32_clr(0x5601C, BIT18); - + /* reset pcie_rc shift */ io32_clr(0x50010, BIT10 | BIT8 | BIT7); A_DELAY_USECS(1); diff --git a/target_firmware/magpie_fw_dev/target/hif/usb_api_main_patch.c b/target_firmware/magpie_fw_dev/target/hif/usb_api_main_patch.c index b7cbfab..97385ad 100644 --- a/target_firmware/magpie_fw_dev/target/hif/usb_api_main_patch.c +++ b/target_firmware/magpie_fw_dev/target/hif/usb_api_main_patch.c @@ -173,7 +173,7 @@ void usb_status_in_patch(void) } /* - * support more than 64 bytes command on ep4 + * support more than 64 bytes command on ep4 */ void usb_reg_out_patch(void) { diff --git a/target_firmware/magpie_fw_dev/target/htc/htc.c b/target_firmware/magpie_fw_dev/target/htc/htc.c index 476155e..9d11f63 100755 --- a/target_firmware/magpie_fw_dev/target/htc/htc.c +++ b/target_firmware/magpie_fw_dev/target/htc/htc.c @@ -33,21 +33,21 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* - * @File: - * + * @File: + * * @Abstract: host target communications - * - * @Notes: + * + * @Notes: */ #include -#include +#include #include #include #include -#include -#include +#include +#include -#include "htc_internal.h" +#include "htc_internal.h" #define A_UNCACHED_ADDR(addr) addr @@ -74,106 +74,106 @@ void _HTC_PauseRecv(HTC_ENDPOINT_ID EndpointID); void _HTC_ResumeRecv(HTC_ENDPOINT_ID EndpointID); LOCAL void HTCProcessConnectMsg(HTC_CONTEXT *pHTC, HTC_CONNECT_SERVICE_MSG *pMsg); LOCAL void HTCProcessConfigPipeMsg(HTC_CONTEXT *pHTC, HTC_CONFIG_PIPE_MSG *pMsg); -LOCAL void RedistributeCredit(adf_nbuf_t buf, int toPipeId); +LOCAL void RedistributeCredit(adf_nbuf_t buf, int toPipeId); LOCAL void _HTC_Shutdown(htc_handle_t htcHandle); -/* macro to check if the service wants to prevent credit dribbling by using +/* macro to check if the service wants to prevent credit dribbling by using a dynamic threshold */ #define CHECK_AND_ADJUST_CREDIT_THRESHOLD(pEndpoint) \ if ((pEndpoint)->ConnectionFlags & HTC_CONNECT_FLAGS_REDUCE_CREDIT_DRIBBLE) { \ AdjustCreditThreshold((pEndpoint)); \ - } + } LOCAL void HTC_AssembleBuffers(HTC_CONTEXT *pHTC, int Count, int Size) { - BUF_Pool_create_pool(pHTC->PoolHandle, POOL_ID_HTC_CONTROL, Count, Size); + BUF_Pool_create_pool(pHTC->PoolHandle, POOL_ID_HTC_CONTROL, Count, Size); } LOCAL htc_handle_t _HTC_Init(HTC_SETUP_COMPLETE_CB SetupComplete, HTC_CONFIG *pConfig) { HIF_CALLBACK hifCBConfig; - HTC_CONTEXT *pHTC; - + HTC_CONTEXT *pHTC; + pHTC = (HTC_CONTEXT *)adf_os_mem_alloc(sizeof(HTC_CONTEXT)); - + adf_os_mem_zero(pHTC, sizeof(HTC_CONTEXT)); pHTC->OSHandle = pConfig->OSHandle; pHTC->PoolHandle = pConfig->PoolHandle; pHTC->hifHandle = pConfig->HIFHandle; - + hifCBConfig.send_buf_done = A_INDIR(htc._HTC_SendDoneHandler); hifCBConfig.recv_buf = A_INDIR(htc._HTC_MsgRecvHandler); hifCBConfig.context = pHTC; - + /* initialize hardware layer */ HIF_register_callback(pConfig->HIFHandle, &hifCBConfig); - + /* see if the host wants us to override the number of ctrl buffers */ pHTC->NumBuffersForCreditRpts = 0; - + if (0 == pHTC->NumBuffersForCreditRpts) { /* nothing to override, simply set default */ - pHTC->NumBuffersForCreditRpts = HTC_DEFAULT_NUM_CTRL_BUFFERS; - } - + pHTC->NumBuffersForCreditRpts = HTC_DEFAULT_NUM_CTRL_BUFFERS; + } + pHTC->MaxEpPendingCreditRpts = 0; - + if (0 == pHTC->MaxEpPendingCreditRpts) { - pHTC->MaxEpPendingCreditRpts = HTC_DEFAULT_MAX_EP_PENDING_CREDIT_REPORTS; + pHTC->MaxEpPendingCreditRpts = HTC_DEFAULT_MAX_EP_PENDING_CREDIT_REPORTS; } /* calculate the total allocation size based on the number of credit report buffers */ pHTC->CtrlBufferAllocSize = MIN_CREDIT_BUFFER_ALLOC_SIZE * pHTC->NumBuffersForCreditRpts; /* we need at least enough buffer space for 1 ctrl message */ pHTC->CtrlBufferAllocSize = A_MAX(pHTC->CtrlBufferAllocSize,MAX_HTC_SETUP_MSG_SIZE); - + /* save the size of each buffer/credit we will receive */ pHTC->RecvBufferSize = pConfig->CreditSize; //RecvBufferSize; pHTC->TotalCredits = pConfig->CreditNumber; pHTC->TotalCreditsAssigned = 0; - + /* setup the pseudo service that handles HTC control messages */ pHTC->HTCControlService.ProcessRecvMsg = A_INDIR(htc._HTC_ControlSvcProcessMsg); pHTC->HTCControlService.ProcessSendBufferComplete = A_INDIR(htc._HTC_ControlSvcProcessSendComplete); pHTC->HTCControlService.TrailerSpcCheckLimit = HTC_CTRL_BUFFER_CHECK_SIZE; pHTC->HTCControlService.MaxSvcMsgSize = MAX_HTC_SETUP_MSG_SIZE; pHTC->HTCControlService.ServiceCtx = pHTC; - + /* automatically register this pseudo service to endpoint 1 */ pHTC->Endpoints[ENDPOINT0].pService = &pHTC->HTCControlService; - HIF_get_default_pipe(pHTC->hifHandle, &pHTC->Endpoints[ENDPOINT0].UpLinkPipeID, + HIF_get_default_pipe(pHTC->hifHandle, &pHTC->Endpoints[ENDPOINT0].UpLinkPipeID, &pHTC->Endpoints[ENDPOINT0].DownLinkPipeID); - + /* Initialize control pipe so we could receive the HTC control packets */ // @TODO: msg size! - HIF_config_pipe(pHTC->hifHandle, pHTC->Endpoints[ENDPOINT0].UpLinkPipeID, 1); - + HIF_config_pipe(pHTC->hifHandle, pHTC->Endpoints[ENDPOINT0].UpLinkPipeID, 1); + /* set the first free endpoint */ pHTC->CurrentEpIndex = ENDPOINT1; pHTC->SetupCompleteCb = SetupComplete; - + /* setup buffers for just the setup phase, we only need 1 buffer to handle * setup */ HTC_AssembleBuffers(pHTC, 4, MAX_HTC_SETUP_MSG_SIZE); - + /* start hardware layer so that we can queue buffers */ HIF_start(pHTC->hifHandle); - + return pHTC; } LOCAL void _HTC_Shutdown(htc_handle_t htcHandle) { HTC_CONTEXT *pHTC = (HTC_CONTEXT *)htcHandle; - + adf_os_mem_free(pHTC); } LOCAL void _HTC_RegisterService(htc_handle_t htcHandle, HTC_SERVICE *pService) { HTC_CONTEXT *pHTC = (HTC_CONTEXT *)htcHandle; - + /* add it to the list */ pService->pNext = pHTC->pServiceList; pHTC->pServiceList = pService; @@ -185,20 +185,20 @@ LOCAL void _HTC_Ready(htc_handle_t htcHandle) HTC_READY_MSG *pReady; a_uint8_t *addr; HTC_CONTEXT *pHTC = (HTC_CONTEXT *)htcHandle; - + pBuffer = HTCAllocMsgBuffer(pHTC); - + /* an optimization... the header length is chosen to * be aligned on a 16 bit bounday, the fields in the message are designed to * be aligned */ - addr = adf_nbuf_put_tail(pBuffer, sizeof(HTC_READY_MSG)); - pReady = (HTC_READY_MSG *)addr; - A_MEMZERO(pReady,sizeof(HTC_READY_MSG)); + addr = adf_nbuf_put_tail(pBuffer, sizeof(HTC_READY_MSG)); + pReady = (HTC_READY_MSG *)addr; + A_MEMZERO(pReady,sizeof(HTC_READY_MSG)); pReady->MessageID = adf_os_htons(HTC_MSG_READY_ID); pReady->CreditSize = adf_os_htons((A_UINT16)pHTC->RecvBufferSize); pReady->CreditCount = adf_os_htons((A_UINT16)pHTC->TotalCredits); pReady->MaxEndpoints = ENDPOINT_MAX; - + /* send out the message */ HTC_SendMsg(pHTC, ENDPOINT0, pBuffer); /* now we need to wait for service connection requests */ @@ -206,24 +206,24 @@ LOCAL void _HTC_Ready(htc_handle_t htcHandle) LOCAL void ReturnBuffers(htc_handle_t htcHandle, HTC_ENDPOINT_ID EndpointID, adf_nbuf_t pBuffers, A_BOOL sendCreditFlag) -{ +{ int nbufs = 1; HTC_CONTEXT *pHTC = (HTC_CONTEXT *)htcHandle; - + /* supply some head-room again */ adf_nbuf_push_head(pBuffers, HTC_HDR_LENGTH); - + /* enqueue all buffers to the single mailbox */ - HIF_return_recv_buf(pHTC->hifHandle, pHTC->Endpoints[EndpointID].UpLinkPipeID, pBuffers); - - if (pHTC->StateFlags & HTC_STATE_SETUP_COMPLETE) { + HIF_return_recv_buf(pHTC->hifHandle, pHTC->Endpoints[EndpointID].UpLinkPipeID, pBuffers); + + if (pHTC->StateFlags & HTC_STATE_SETUP_COMPLETE) { A_UINT32 epCreditMask = (1 << EndpointID); /* we are running normally */ /* update pending credit counts with the number of buffers that were added */ pHTC->Endpoints[EndpointID].CreditsToReturn += (A_INT16)nbufs; - pHTC->Endpoints[EndpointID].CreditsConsumed -= (A_INT16)nbufs; + pHTC->Endpoints[EndpointID].CreditsConsumed -= (A_INT16)nbufs; /* update bit map that this endpoint has non-zero credits */ - pHTC->EpCreditPendingMap |= epCreditMask; + pHTC->EpCreditPendingMap |= epCreditMask; if (sendCreditFlag) { HTCCheckAndSendCreditReport(pHTC, epCreditMask,&pHTC->Endpoints[EndpointID],EndpointID); @@ -231,11 +231,11 @@ LOCAL void ReturnBuffers(htc_handle_t htcHandle, HTC_ENDPOINT_ID EndpointID, } else { /* we have not started yet so all return operations are simply adding buffers - * to the interface at startup, so we can keep track of how many total + * to the interface at startup, so we can keep track of how many total * credits we get */ /* update global count that will be returned to the host */ pHTC->TotalCredits += nbufs; - } + } } LOCAL void _HTC_ReturnBuffersList(htc_handle_t htcHandle, @@ -264,38 +264,38 @@ LOCAL void _HTC_ReturnBuffers(htc_handle_t htcHandle, HTC_ENDPOINT_ID EndpointID { ReturnBuffers(htcHandle, EndpointID, pBuffers, TRUE); } - + LOCAL void _HTC_SendMsg(htc_handle_t htcHandle, HTC_ENDPOINT_ID EndpointID, adf_nbuf_t pBuffers) { HTC_FRAME_HDR *pHTCHdr; int totsz; - HTC_CONTEXT *pHTC = (HTC_CONTEXT *)htcHandle; + HTC_CONTEXT *pHTC = (HTC_CONTEXT *)htcHandle; HTC_BUF_CONTEXT *ctx; - + ctx = (HTC_BUF_CONTEXT *)adf_nbuf_get_priv(pBuffers); - + /* init total size (this does not include the space we will put in for the HTC header) */ totsz = adf_nbuf_len(pBuffers); - + /* the first buffer stores the header */ /* back up buffer by a header size when we pass it down, by agreed upon convention the caller - * points the buffer to it's payload and leaves head room for the HTC header + * points the buffer to it's payload and leaves head room for the HTC header * Note: in HTCSendDoneHandler(), we undo this so that the caller get's it's buffer - * back untainted */ + * back untainted */ pHTCHdr = (HTC_FRAME_HDR *)adf_nbuf_push_head(pBuffers, HTC_HDR_LENGTH); - + /* flag that this is the header buffer that was modified */ - ctx->htc_flags |= HTC_FLAGS_BUF_HDR; + ctx->htc_flags |= HTC_FLAGS_BUF_HDR; /* mark where this buffer came from */ - ctx->end_point = EndpointID; + ctx->end_point = EndpointID; /* the header start is ALWAYS aligned since we DMA it directly */ /* set some fields, the rest of them will be filled below when we check for * trailer space */ pHTCHdr->Flags = 0; - pHTCHdr->EndpointID = EndpointID; - + pHTCHdr->EndpointID = EndpointID; + /* check opportunistically if we can return any reports via a trailer */ do { int room,i,totalReportBytes; @@ -304,7 +304,7 @@ LOCAL void _HTC_SendMsg(htc_handle_t htcHandle, HTC_ENDPOINT_ID EndpointID, HTC_RECORD_HDR *pRecHdr; int pipeMaxLen; A_UINT32 roomForPipeMaxLen; - + /* figure out how much room the last buffer can spare */ pipeMaxLen = HIF_get_max_msg_len(pHTC->hifHandle, pHTC->Endpoints[EndpointID].DownLinkPipeID); @@ -312,52 +312,52 @@ LOCAL void _HTC_SendMsg(htc_handle_t htcHandle, HTC_ENDPOINT_ID EndpointID, if ( roomForPipeMaxLen < 0 ) { roomForPipeMaxLen = 0; } - + room = adf_os_min( adf_nbuf_tailroom(pBuffers), roomForPipeMaxLen); if (room < (int)(sizeof(HTC_CREDIT_REPORT) + sizeof(HTC_RECORD_HDR))) { /* no room for any reports */ - break; - } + break; + } /* note, a record header only has 8 bit fields, so this is safe. - * we need an uncached pointer here too */ + * we need an uncached pointer here too */ totalReportBytes = 0; - - /* get a copy */ - creditsPendingMap = pHTC->EpCreditPendingMap; - + + /* get a copy */ + creditsPendingMap = pHTC->EpCreditPendingMap; + /* test pending map to see if we can send a report , if any - * credits are available, we might as well send them on the + * credits are available, we might as well send them on the * unused space in the buffer */ - if (creditsPendingMap) { - + if (creditsPendingMap) { + pRecHdr = (HTC_RECORD_HDR *)adf_nbuf_put_tail(pBuffers, sizeof(HTC_RECORD_HDR)); - + /* set the ID, the length will be updated with the number of credit reports we * can fit (see below) */ pRecHdr->RecordID = HTC_RECORD_CREDITS; pRecHdr->Length = 0; - /* the credit report follows the record header */ + /* the credit report follows the record header */ totalReportBytes += sizeof(HTC_RECORD_HDR); room -= sizeof(HTC_RECORD_HDR); - + /* walkthrough pending credits map and build the records */ - for (i = 0; - (creditsPendingMap != 0) && (room >= (int)sizeof(HTC_CREDIT_REPORT)); - i++) { + for (i = 0; + (creditsPendingMap != 0) && (room >= (int)sizeof(HTC_CREDIT_REPORT)); + i++) { compareMask = (1 << i); if (compareMask & creditsPendingMap) { - + pCreditRpt = (HTC_CREDIT_REPORT *)adf_nbuf_put_tail(pBuffers, sizeof(HTC_CREDIT_REPORT)); - + /* clear pending mask, we are going to return all these credits */ creditsPendingMap &= ~(compareMask); /* add this record */ pCreditRpt->EndpointID = i; pCreditRpt->Credits = (A_UINT8)pHTC->Endpoints[i].CreditsToReturn; /* remove pending credits, we always send deltas */ - pHTC->Endpoints[i].CreditsToReturn = 0; + pHTC->Endpoints[i].CreditsToReturn = 0; /* adjust new threshold for this endpoint if needed */ CHECK_AND_ADJUST_CREDIT_THRESHOLD(&pHTC->Endpoints[i]); /* update this record length */ @@ -370,36 +370,36 @@ LOCAL void _HTC_SendMsg(htc_handle_t htcHandle, HTC_ENDPOINT_ID EndpointID, } } } - - /* update new pending credits map */ + + /* update new pending credits map */ pHTC->EpCreditPendingMap = creditsPendingMap; } - + if (totalReportBytes <= 0) { break; } - + /* must fit into a byte, this should never actually happen since - * the maximum possible number of endpoints is 32. + * the maximum possible number of endpoints is 32. * The trailer can have at most 1 credit record with up to 32 reports in the record. * The trailer can have at most 1 lookahead record with only 1 lookahead report in the record. */ - - /* set header option bytes */ + + /* set header option bytes */ pHTCHdr->ControlBytes[0] = totalReportBytes; /* HTC frame contains a trailer */ pHTCHdr->Flags |= HTC_FLAGS_RECV_TRAILER; /* increment total size by the reports we added */ totsz += totalReportBytes; - /* adjust the last buffer we used for adding on the trailer */ + /* adjust the last buffer we used for adding on the trailer */ } while (FALSE); - + if (totsz == 0) { } - + /* set length for message (this includes any reports that were added above) */ - pHTCHdr->PayloadLen = adf_os_htons(totsz); - HIF_send_buffer(pHTC->hifHandle, pHTC->Endpoints[EndpointID].DownLinkPipeID, pBuffers); + pHTCHdr->PayloadLen = adf_os_htons(totsz); + HIF_send_buffer(pHTC->hifHandle, pHTC->Endpoints[EndpointID].DownLinkPipeID, pBuffers); } void _HTC_PauseRecv(HTC_ENDPOINT_ID EndpointID) @@ -412,19 +412,19 @@ void _HTC_ResumeRecv(HTC_ENDPOINT_ID EndpointID) int _HTC_GetReservedHeadroom(htc_handle_t htcHandle) { - HTC_CONTEXT *pHTC = (HTC_CONTEXT *)htcHandle; - + HTC_CONTEXT *pHTC = (HTC_CONTEXT *)htcHandle; + return HTC_HDR_LENGTH + HIF_get_reserved_headroom(pHTC->hifHandle); } void htc_module_install(struct htc_apis *pAPIs) -{ +{ pAPIs->_HTC_Init = _HTC_Init; pAPIs->_HTC_ReturnBuffers = _HTC_ReturnBuffers; pAPIs->_HTC_ReturnBuffersList = _HTC_ReturnBuffersList; pAPIs->_HTC_Ready = _HTC_Ready; pAPIs->_HTC_RegisterService = _HTC_RegisterService; - pAPIs->_HTC_SendMsg = _HTC_SendMsg; + pAPIs->_HTC_SendMsg = _HTC_SendMsg; pAPIs->_HTC_Shutdown = _HTC_Shutdown; pAPIs->_HTC_GetReservedHeadroom = _HTC_GetReservedHeadroom; pAPIs->_HTC_MsgRecvHandler = HTCMsgRecvHandler; @@ -434,9 +434,9 @@ void htc_module_install(struct htc_apis *pAPIs) } /* free message to the free list */ -LOCAL void HTCFreeMsgBuffer(HTC_CONTEXT *pHTC, adf_nbuf_t buf) +LOCAL void HTCFreeMsgBuffer(HTC_CONTEXT *pHTC, adf_nbuf_t buf) { - BUF_Pool_free_buf(pHTC->PoolHandle, POOL_ID_HTC_CONTROL, buf); + BUF_Pool_free_buf(pHTC->PoolHandle, POOL_ID_HTC_CONTROL, buf); } /* HTC control message allocator (also used for empty frames to send trailer options) */ @@ -444,26 +444,26 @@ LOCAL adf_nbuf_t HTCAllocMsgBuffer(HTC_CONTEXT *pHTC) { return BUF_Pool_alloc_buf(pHTC->PoolHandle, POOL_ID_HTC_CONTROL, - HTC_GetReservedHeadroom(pHTC)); + HTC_GetReservedHeadroom(pHTC)); } LOCAL void HTCCheckAndSendCreditReport(HTC_CONTEXT *pHTC, A_UINT32 EpMask, HTC_ENDPOINT *pEndpoint, HTC_ENDPOINT_ID Eid) { adf_nbuf_t pCredBuffer; - HTC_BUF_CONTEXT *ctx; - + HTC_BUF_CONTEXT *ctx; + do { /* check if host needs credits */ if (!(pHTC->EpHostNeedsCreditMap & EpMask)) { /* host does not need any credits for this set */ - break; + break; } /* check if any are pending */ if (!(pHTC->EpCreditPendingMap & EpMask)) { /* nothing to send up */ - break; - } + break; + } /* was an endpoint specified? */ if (pEndpoint != NULL) { /* see if a threshold is in effect for this endpoint */ @@ -474,19 +474,19 @@ LOCAL void HTCCheckAndSendCreditReport(HTC_CONTEXT *pHTC, A_UINT32 EpMask, break; } } - + if (pEndpoint->PendingCreditReports >= pHTC->MaxEpPendingCreditRpts) { /* this endpoint already has some reports outstanding */ /* flag that as soon as a buffer is reaped, we issue a credit update to * pick up this credit that is being held up because the endpoint has already - * exceeded the max outstanding credit report limit */ + * exceeded the max outstanding credit report limit */ pHTC->StateFlags |= HTC_SEND_CREDIT_UPDATE_SOON; - break; - } + break; + } } - + /* if we get here we have some credits to send up */ - + /* allocate a message buffer for the trailer */ pCredBuffer = HTCAllocMsgBuffer(pHTC); if (NULL == pCredBuffer) { @@ -494,25 +494,25 @@ LOCAL void HTCCheckAndSendCreditReport(HTC_CONTEXT *pHTC, A_UINT32 EpMask, * have to wait until we get our endpoint 0 messages back.. */ /* mark that we need to send an update as soon as we can get a buffer back */ pHTC->StateFlags |= HTC_SEND_CREDIT_UPDATE_SOON; - break; + break; } - + ctx = (HTC_BUF_CONTEXT *)adf_nbuf_get_priv(pCredBuffer); if (pEndpoint != NULL) { /* keep track of pending reports */ - pEndpoint->PendingCreditReports++; + pEndpoint->PendingCreditReports++; /* save the endpoint in order to decrement the count when the send completes */ ctx->htc_flags = Eid | HTC_FLAGS_CREDIT_RPT; - } - + } + /* this is an empty message, the HTC_SendMsg will tack on a trailer in the remaining * space, NOTE: no need to flush the cache, the header and trailers are assembled * using uncached addresses */ - HTC_SendMsg(pHTC, ENDPOINT0, pCredBuffer); - - } while (FALSE); + HTC_SendMsg(pHTC, ENDPOINT0, pCredBuffer); + + } while (FALSE); } - + /* called in response to the arrival of a service connection message */ LOCAL void HTCProcessConnectMsg(HTC_CONTEXT *pHTC, HTC_CONNECT_SERVICE_MSG *pMsg) { @@ -522,33 +522,33 @@ LOCAL void HTCProcessConnectMsg(HTC_CONTEXT *pHTC, HTC_CONNECT_SERVICE_MSG *pMsg HTC_CONNECT_SERVICE_RESPONSE_MSG *pRspMsg; int metaDataOutLen = 0; A_UINT16 serviceId = adf_os_ntohs(pMsg->ServiceID); - + pBuffer = HTCAllocMsgBuffer(pHTC); /* note : this will be aligned */ pRspMsg = (HTC_CONNECT_SERVICE_RESPONSE_MSG *) adf_nbuf_put_tail(pBuffer, sizeof(HTC_CONNECT_SERVICE_RESPONSE_MSG)); - + A_MEMZERO(pRspMsg,sizeof(HTC_CONNECT_SERVICE_RESPONSE_MSG)); pRspMsg->MessageID = adf_os_htons(HTC_MSG_CONNECT_SERVICE_RESPONSE_ID); /* reflect the service ID for this connect attempt */ pRspMsg->ServiceID = adf_os_htons(serviceId); while (pService) { - + if (pHTC->CurrentEpIndex >= ENDPOINT_MAX) { /* no more endpoints */ connectStatus = HTC_SERVICE_NO_RESOURCES; - break; + break; } if (serviceId == pService->ServiceID) { - /* we found a match */ - A_UINT8 *pMetaDataIN = NULL; + /* we found a match */ + A_UINT8 *pMetaDataIN = NULL; A_UINT8 *pMetaDataOut; - + /* outgoing meta data resides in the space after the response message */ pMetaDataOut = ((A_UINT8 *)pRspMsg) + sizeof(HTC_CONNECT_SERVICE_RESPONSE_MSG); - + if (pMsg->ServiceMetaLength != 0) { /* the meta data follows the connect service message */ pMetaDataIN = ((A_UINT8 *)pMsg) + sizeof(HTC_CONNECT_SERVICE_MSG); @@ -561,7 +561,7 @@ LOCAL void HTCProcessConnectMsg(HTC_CONTEXT *pHTC, HTC_CONNECT_SERVICE_MSG *pMsg pMsg->ServiceMetaLength, pMetaDataOut, &metaDataOutLen); - + /* check if the service accepted this connection request */ if (HTC_SERVICE_SUCCESS == connectStatus) { /* set the length of the response meta data going back to the host */ @@ -574,49 +574,49 @@ LOCAL void HTCProcessConnectMsg(HTC_CONTEXT *pHTC, HTC_CONNECT_SERVICE_MSG *pMsg pHTC->Endpoints[pHTC->CurrentEpIndex].pService = pService; /* set connection flags */ pHTC->Endpoints[pHTC->CurrentEpIndex].ConnectionFlags = pMsg->ConnectionFlags; - + pHTC->Endpoints[pHTC->CurrentEpIndex].DownLinkPipeID = pMsg->DownLinkPipeID; pHTC->Endpoints[pHTC->CurrentEpIndex].UpLinkPipeID = pMsg->UpLinkPipeID; - + /* mark that we are now connected */ pService->ServiceFlags |= HTC_SERVICE_FLAGS_CONNECTED; /* bump up our index, this EP is now in use */ - pHTC->CurrentEpIndex++; + pHTC->CurrentEpIndex++; } break; - } - - pService = pService->pNext; + } + + pService = pService->pNext; } - - pRspMsg->Status = connectStatus; - + + pRspMsg->Status = connectStatus; + /* send out the response message */ - HTC_SendMsg(pHTC, ENDPOINT0, pBuffer); + HTC_SendMsg(pHTC, ENDPOINT0, pBuffer); } LOCAL void HTCProcessConfigPipeMsg(HTC_CONTEXT *pHTC, HTC_CONFIG_PIPE_MSG *pMsg) { adf_nbuf_t pBuffer; HTC_CONFIG_PIPE_RESPONSE_MSG *pRspMsg; - + pBuffer = HTCAllocMsgBuffer(pHTC); - + /* note : this will be aligned */ pRspMsg = (HTC_CONFIG_PIPE_RESPONSE_MSG *) - adf_nbuf_put_tail(pBuffer, sizeof(HTC_CONFIG_PIPE_RESPONSE_MSG)); - + adf_nbuf_put_tail(pBuffer, sizeof(HTC_CONFIG_PIPE_RESPONSE_MSG)); + A_MEMZERO(pRspMsg,sizeof(HTC_CONFIG_PIPE_RESPONSE_MSG)); - + pRspMsg->MessageID = adf_os_htons(HTC_MSG_CONFIG_PIPE_RESPONSE_ID); /* reflect the service ID for this connect attempt */ pRspMsg->PipeID = pMsg->PipeID; if ( HIF_is_pipe_supported(pHTC->hifHandle, pMsg->PipeID) ) { - pRspMsg->Status = 0; + pRspMsg->Status = 0; } else { - pRspMsg->Status = 1; + pRspMsg->Status = 1; goto config_done; } @@ -626,65 +626,65 @@ LOCAL void HTCProcessConfigPipeMsg(HTC_CONTEXT *pHTC, HTC_CONFIG_PIPE_MSG *pMsg) pRspMsg->Status = 2; goto config_done; } - + HIF_config_pipe(pHTC->hifHandle, pMsg->PipeID, pMsg->CreditCount); - -config_done: + +config_done: /* send out the response message */ - HTC_SendMsg(pHTC, ENDPOINT0, pBuffer); + HTC_SendMsg(pHTC, ENDPOINT0, pBuffer); } /* process an incomming control message from the host */ LOCAL void HTCControlSvcProcessMsg(HTC_ENDPOINT_ID EndpointID, adf_nbuf_t hdr_buf, adf_nbuf_t pBuffers, void *arg) -{ +{ A_BOOL setupComplete = FALSE; a_uint8_t *anbdata; a_uint32_t anblen; HTC_CONTEXT *pHTC = (HTC_CONTEXT *)arg; HTC_UNKNOWN_MSG *pMsg; - + adf_os_assert(hdr_buf == ADF_NBUF_NULL); /* we assume buffers are aligned such that we can access the message * parameters directly*/ adf_nbuf_peek_header(pBuffers, &anbdata, &anblen); pMsg = (HTC_UNKNOWN_MSG *)anbdata; - + /* we cannot handle fragmented messages across buffers */ - - switch ( adf_os_ntohs(pMsg->MessageID) ) { + + switch ( adf_os_ntohs(pMsg->MessageID) ) { case HTC_MSG_CONNECT_SERVICE_ID: - HTCProcessConnectMsg(pHTC, (HTC_CONNECT_SERVICE_MSG *)pMsg); + HTCProcessConnectMsg(pHTC, (HTC_CONNECT_SERVICE_MSG *)pMsg); break; case HTC_MSG_CONFIG_PIPE_ID: - HTCProcessConfigPipeMsg(pHTC, (HTC_CONFIG_PIPE_MSG *)pMsg); - break; + HTCProcessConfigPipeMsg(pHTC, (HTC_CONFIG_PIPE_MSG *)pMsg); + break; case HTC_MSG_SETUP_COMPLETE_ID: /* the host has indicated that it has completed all setup tasks and we can now let the services take over to run the rest of the application */ - setupComplete = TRUE; + setupComplete = TRUE; /* can't get this more than once */ break; default: ; - } - + } + if (pHTC->StateFlags & HTC_STATE_SETUP_COMPLETE) { /* recycle buffer only if we are fully running */ HTC_ReturnBuffers(pHTC, ENDPOINT0,pBuffers); } else { /* supply some head-room again */ adf_nbuf_push_head(pBuffers, HTC_HDR_LENGTH); - + /* otherwise return the packet back to mbox */ - HIF_return_recv_buf(pHTC->hifHandle, pHTC->Endpoints[EndpointID].UpLinkPipeID, pBuffers); + HIF_return_recv_buf(pHTC->hifHandle, pHTC->Endpoints[EndpointID].UpLinkPipeID, pBuffers); } - if (setupComplete) { + if (setupComplete) { /* mark that setup has completed */ - pHTC->StateFlags |= HTC_STATE_SETUP_COMPLETE; + pHTC->StateFlags |= HTC_STATE_SETUP_COMPLETE; if (pHTC->SetupCompleteCb != NULL) { pHTC->SetupCompleteCb(); } @@ -698,25 +698,25 @@ LOCAL void HTCControlSvcProcessSendComplete(HTC_ENDPOINT_ID EndpointID, HTC_CONTEXT *pHTC = (HTC_CONTEXT *)arg; HTC_BUF_CONTEXT *ctx; HTC_ENDPOINT_ID creditRptEndpoint; - - ctx = (HTC_BUF_CONTEXT *)adf_nbuf_get_priv(pBuffers); - + + ctx = (HTC_BUF_CONTEXT *)adf_nbuf_get_priv(pBuffers); + /* put them back into the pool */ - if ( ctx->htc_flags & HTC_FLAGS_CREDIT_RPT ) { - /* extract the endpoint number that requested this credit report */ - creditRptEndpoint = ctx->htc_flags & HTC_FLAGS_CRPT_EP_MASK; - pHTC->Endpoints[creditRptEndpoint].PendingCreditReports--; + if ( ctx->htc_flags & HTC_FLAGS_CREDIT_RPT ) { + /* extract the endpoint number that requested this credit report */ + creditRptEndpoint = ctx->htc_flags & HTC_FLAGS_CRPT_EP_MASK; + pHTC->Endpoints[creditRptEndpoint].PendingCreditReports--; } - + HTCFreeMsgBuffer(pHTC, pBuffers); - + if (pHTC->StateFlags & HTC_SEND_CREDIT_UPDATE_SOON) { /* this flag is set when the host could not send a credit report * because we ran out of HTC control buffers */ pHTC->StateFlags &= ~HTC_SEND_CREDIT_UPDATE_SOON; /* send out a report if anything is pending */ HTCCheckAndSendCreditReport(pHTC, HTC_ANY_ENDPOINT_MASK,NULL,ENDPOINT_MAX); - } + } } LOCAL void HTCSendDoneHandler(adf_nbuf_t buf, void *context) @@ -724,18 +724,18 @@ LOCAL void HTCSendDoneHandler(adf_nbuf_t buf, void *context) A_UINT8 current_eid; HTC_CONTEXT *pHTC = (HTC_CONTEXT *)context; HTC_BUF_CONTEXT *ctx; - + ctx = (HTC_BUF_CONTEXT *)adf_nbuf_get_priv(buf); current_eid = ctx->end_point; - + /* Walk through the buffers and fixup the ones we used for HTC headers. * The buffer list may contain more than one string of HTC buffers comprising of an - * HTC message so we need to check every buffer */ + * HTC message so we need to check every buffer */ adf_nbuf_pull_head(buf, HTC_HDR_LENGTH); - + pHTC->Endpoints[current_eid].pService-> - ProcessSendBufferComplete(current_eid, - buf, + ProcessSendBufferComplete(current_eid, + buf, pHTC->Endpoints[current_eid].pService->ServiceCtx); } @@ -744,43 +744,43 @@ LOCAL void AdjustCreditThreshold(HTC_ENDPOINT *pEndpoint) A_INT16 creditsOutstanding = pEndpoint->CreditsToReturn + pEndpoint->CreditsConsumed; /* set the new threshold based on the number of credits that have been consumed * and which have not been returned by the app. - * Note: it is okay for this threshold to be zero which indicates no threshold - * is in use */ + * Note: it is okay for this threshold to be zero which indicates no threshold + * is in use */ switch (pEndpoint->ConnectionFlags & HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_MASK) { case HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_ONE_FOURTH : creditsOutstanding >>= 2; - break; + break; case HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_ONE_HALF : creditsOutstanding >>= 1; break; - case HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_THREE_FOURTHS : - creditsOutstanding = (creditsOutstanding * 3) >> 2; + case HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_THREE_FOURTHS : + creditsOutstanding = (creditsOutstanding * 3) >> 2; break; - /* default case is unity */ + /* default case is unity */ } - + pEndpoint->CreditReturnThreshhold = creditsOutstanding; - + } LOCAL void RedistributeCredit(adf_nbuf_t buf, int toPipeId) { } - + /* callback from the mailbox hardware layer when a full message arrives */ LOCAL void HTCMsgRecvHandler(adf_nbuf_t hdr_buf, adf_nbuf_t buffer, void *context) { A_UINT16 totsz; HTC_ENDPOINT *pEndpoint; A_UINT32 eidMask; - int eid; + int eid; a_uint8_t *anbdata; a_uint32_t anblen; HTC_FRAME_HDR *pHTCHdr; HTC_CONTEXT *pHTC = (HTC_CONTEXT *)context; adf_nbuf_t tmp_nbuf; - + if (hdr_buf == ADF_NBUF_NULL) { /* HTC hdr is not in the hdr_buf */ tmp_nbuf = buffer; @@ -788,14 +788,14 @@ LOCAL void HTCMsgRecvHandler(adf_nbuf_t hdr_buf, adf_nbuf_t buffer, void *contex else { tmp_nbuf = hdr_buf; } - - adf_nbuf_peek_header(tmp_nbuf, &anbdata, &anblen); - pHTCHdr = (HTC_FRAME_HDR *)anbdata; - - totsz = adf_os_ntohs(pHTCHdr->PayloadLen); - - eid = pHTCHdr->EndpointID; - + + adf_nbuf_peek_header(tmp_nbuf, &anbdata, &anblen); + pHTCHdr = (HTC_FRAME_HDR *)anbdata; + + totsz = adf_os_ntohs(pHTCHdr->PayloadLen); + + eid = pHTCHdr->EndpointID; + pEndpoint = &pHTC->Endpoints[eid]; eidMask = 1 << eid; @@ -808,7 +808,7 @@ LOCAL void HTCMsgRecvHandler(adf_nbuf_t hdr_buf, adf_nbuf_t buffer, void *contex if (pHTC->StateFlags & HTC_STATE_SETUP_COMPLETE) { /* after setup we keep track of credit consumption to allow us to - * adjust thresholds to reduce credit dribbling */ + * adjust thresholds to reduce credit dribbling */ pEndpoint->CreditsConsumed ++; } @@ -816,35 +816,35 @@ LOCAL void HTCMsgRecvHandler(adf_nbuf_t hdr_buf, adf_nbuf_t buffer, void *contex * when we receive a frame with the NEED_CREDIT_UPDATE flag set . * if the host received credits through an opportunistic path, then it can * issue a another frame with this bit cleared, this signals the target to clear - * the "host-needs-credit" state */ + * the "host-needs-credit" state */ if (pHTCHdr->Flags & HTC_FLAGS_NEED_CREDIT_UPDATE) { /* the host is running low (or is out) of credits on this * endpoint, update mask */ - pHTC->EpHostNeedsCreditMap |= eidMask; + pHTC->EpHostNeedsCreditMap |= eidMask; /* check and set new threshold since host has reached a low credit situation */ - CHECK_AND_ADJUST_CREDIT_THRESHOLD(pEndpoint); + CHECK_AND_ADJUST_CREDIT_THRESHOLD(pEndpoint); } else { /* clear the flag */ - pHTC->EpHostNeedsCreditMap &= ~(eidMask); - pEndpoint->CreditReturnThreshhold = 0; + pHTC->EpHostNeedsCreditMap &= ~(eidMask); + pEndpoint->CreditReturnThreshhold = 0; } - /* Adjust the first buffer to point to the start of the actual + /* Adjust the first buffer to point to the start of the actual payload, the first buffer contains the header */ adf_nbuf_pull_head(tmp_nbuf, HTC_HDR_LENGTH); - + /* NOTE : This callback could re-queue the recv buffers within this calling context. * The callback could also send a response message within the context of this callback * as the result of parsing this message. In either case, if there are - * pending credits and the host needs them, a credit report will be sent either through + * pending credits and the host needs them, a credit report will be sent either through * the response message trailer or a NULL message through HTC_ReturnBuffers(). - */ - + */ + pEndpoint->pService->ProcessRecvMsg(eid, hdr_buf, buffer, pEndpoint->pService->ServiceCtx); - /* Calls to HTC_ReturnBuffers drives the endpoint credit reporting state machine. - * We do not want to delay credits for too long in the event that the application is + /* Calls to HTC_ReturnBuffers drives the endpoint credit reporting state machine. + * We do not want to delay credits for too long in the event that the application is * holding onto buffers for excessive periods of time. This gives us "some" better * opportunities to send up credits. */ - HTCCheckAndSendCreditReport(pHTC, eidMask, pEndpoint, eid); + HTCCheckAndSendCreditReport(pHTC, eidMask, pEndpoint, eid); } diff --git a/target_firmware/magpie_fw_dev/target/htc/htc_api.h b/target_firmware/magpie_fw_dev/target/htc/htc_api.h index 963c564..a7f01c6 100755 --- a/target_firmware/magpie_fw_dev/target/htc/htc_api.h +++ b/target_firmware/magpie_fw_dev/target/htc/htc_api.h @@ -34,10 +34,10 @@ */ /* * @File: htc_api.h - * + * * @Abstract: host-target communications API - * - * @Notes: + * + * @Notes: */ #ifndef __HTC_API_H__ @@ -53,7 +53,7 @@ typedef void (* HTC_SERVICE_ProcessRecvMsg)(HTC_ENDPOINT_ID EndpointID, adf_nbuf_t, adf_nbuf_t, void *ServiceCtx); typedef void (* HTC_SERVICE_ProcessSendBufferComplete)(HTC_ENDPOINT_ID EndpointID, adf_nbuf_t, void *ServiceCtx); - + /* HTC service structure : * the caller is required to allocate storage for the service structure and register the * structure using HTC_RegisterService() The service must set the following fields: @@ -65,31 +65,31 @@ typedef void (* HTC_SERVICE_ProcessSendBufferComplete)(HTC_ENDPOINT_ID EndpointI * */ typedef struct _HTC_SERVICE { struct _HTC_SERVICE *pNext; - /* Callback for processing receive messages. HTC calls this callback whenever a + /* Callback for processing receive messages. HTC calls this callback whenever a * message arrives on the endpoint assigned to this service. * HTC_BUFFER is a chain of buffers containing a full application message. * HTC_BUFFER->buffer points to the start of the msg buffer (past the HTC header) */ - void (* ProcessRecvMsg)(HTC_ENDPOINT_ID EndpointID, adf_nbuf_t, adf_nbuf_t, void *ServiceCtx); + void (* ProcessRecvMsg)(HTC_ENDPOINT_ID EndpointID, adf_nbuf_t, adf_nbuf_t, void *ServiceCtx); /* callback to process completed send buffers */ - void (* ProcessSendBufferComplete)(HTC_ENDPOINT_ID EndpointID, adf_nbuf_t, void *ServiceCtx); + void (* ProcessSendBufferComplete)(HTC_ENDPOINT_ID EndpointID, adf_nbuf_t, void *ServiceCtx); /* optional callback when a connection request occurs. - * The EndpointID is the assigned endpoint, the callback returns a connect + * The EndpointID is the assigned endpoint, the callback returns a connect * response status code to allow or disallow the connection. * pDataIn points to the optional meta data supplied in the connection request - * pDataOut points to a buffer to send back meta data + * pDataOut points to a buffer to send back meta data * If no callback is supplied, HTC assumes the connect is allowed */ A_UINT8 (* ProcessConnect)(struct _HTC_SERVICE *pService, - HTC_ENDPOINT_ID EndpointID, - A_UINT8 *pDataIn, + HTC_ENDPOINT_ID EndpointID, + A_UINT8 *pDataIn, int LengthIn, A_UINT8 *pDataOut, - int *pLengthOut); + int *pLengthOut); A_UINT16 ServiceID; /* service ID to match connection requests */ A_UINT16 ServiceFlags; /* service flags */ A_UINT16 MaxSvcMsgSize; /* maximum length of service-specific messages exchanged on the endpoint */ A_UINT16 TrailerSpcCheckLimit; /* amount of space in each send buffer that HTC can check for trailer - data. This should be set to the smallest HTC buffer that can be sent + data. This should be set to the smallest HTC buffer that can be sent through the service. The service can disable trailer data insertion by setting this value to 0. */ void *ServiceCtx; @@ -110,7 +110,7 @@ typedef struct _HTC_CONFIG { typedef struct _HTC_BUF_CONTEXT { A_UINT8 end_point; - A_UINT8 htc_flags; /* htc flags (used by HTC layer only) */ + A_UINT8 htc_flags; /* htc flags (used by HTC layer only) */ } HTC_BUF_CONTEXT; typedef void* htc_handle_t; @@ -119,20 +119,20 @@ typedef void* htc_handle_t; * setup complete function, supplied by HTC caller at HTC_init time. * HTC calls this function after the host has indicated that the service connection * phase is complete. - * + * */ typedef void (* HTC_SETUP_COMPLETE_CB)(void); struct htc_apis { - htc_handle_t (* _HTC_Init)(HTC_SETUP_COMPLETE_CB, HTC_CONFIG *pConfig); + htc_handle_t (* _HTC_Init)(HTC_SETUP_COMPLETE_CB, HTC_CONFIG *pConfig); void (* _HTC_Shutdown)(htc_handle_t); void (* _HTC_RegisterService)(htc_handle_t, HTC_SERVICE *); void (* _HTC_Ready)(htc_handle_t); void (* _HTC_ReturnBuffers)(htc_handle_t handle, HTC_ENDPOINT_ID EndpointID, adf_nbuf_t); void (* _HTC_ReturnBuffersList)(htc_handle_t handle, HTC_ENDPOINT_ID EndpointID, adf_nbuf_queue_t); - void (* _HTC_SendMsg)(htc_handle_t handle, HTC_ENDPOINT_ID EndpointID, adf_nbuf_t); + void (* _HTC_SendMsg)(htc_handle_t handle, HTC_ENDPOINT_ID EndpointID, adf_nbuf_t); int (* _HTC_GetReservedHeadroom)(htc_handle_t handle); - + /* These APIs below are for patch purpose only */ void (*_HTC_MsgRecvHandler)(adf_nbuf_t hdr_buf, adf_nbuf_t buf, void *context); void (*_HTC_SendDoneHandler)(adf_nbuf_t buf, void *context); diff --git a/target_firmware/magpie_fw_dev/target/htc/htc_internal.h b/target_firmware/magpie_fw_dev/target/htc/htc_internal.h index 241bb03..e2951d5 100755 --- a/target_firmware/magpie_fw_dev/target/htc/htc_internal.h +++ b/target_firmware/magpie_fw_dev/target/htc/htc_internal.h @@ -33,11 +33,11 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* - * @File: - * + * @File: + * * @Abstract: internal data and structure definitions for HTC - * - * @Notes: + * + * @Notes: */ #ifndef HTC_INTERNAL_H_ @@ -49,7 +49,7 @@ (sizeof(HTC_RECORD_HDR)) * 2 ) + \ HTC_HDR_LENGTH, \ sizeof(A_UINT32))) -/* minimum allocation for a credit message */ +/* minimum allocation for a credit message */ #define MIN_CREDIT_BUFFER_ALLOC_SIZE (MIN_BUF_SIZE_FOR_RPTS) /* max ctrl buffers size for a setup message */ @@ -62,14 +62,14 @@ #define HTC_DEFAULT_MAX_EP_PENDING_CREDIT_REPORTS 3 /* an EP should not have more than this many outstanding reports */ -#define HTC_FLAGS_CRPT_EP_MASK 0x1F /* if the message is a credit report this is the endpoint +#define HTC_FLAGS_CRPT_EP_MASK 0x1F /* if the message is a credit report this is the endpoint that issued it */ #define HTC_FLAGS_CREDIT_RPT (1 << 5) /* the buffer was a credit report */ #define HTC_FLAGS_BUF_HDR (1 << 6) /* the buffer was manipulated and a header added */ #define HTC_FLAGS_RECV_END_MSG (1 << 7) /* this buffer is the last buffer for the recev - message (used for recv pause logic) */ - + message (used for recv pause logic) */ + #define HTC_MAILBOX 0 /* we use mailbox 0 for all communications */ #define HTC_ANY_ENDPOINT_MASK 0xFFFFFFFF #define HTC_LOOKAHEAD_POST_VALID 0x55 @@ -79,14 +79,14 @@ typedef struct _HTC_ENDPOINT { A_INT16 CreditsToReturn; /* credits that are ready to be returned to the host */ HTC_SERVICE *pService; /* service that is bound to this endpoint */ -#ifdef HTC_PAUSE_RESUME_REF_COUNTING +#ifdef HTC_PAUSE_RESUME_REF_COUNTING int PauseRefCount; /* reference count */ #endif A_INT16 CreditReturnThreshhold; /* threshold before credits are returned via NULL pkts, - this reduces dribbling effect */ - A_INT16 CreditsConsumed; /* number of credits consumed (outstanding) on the endpoint */ - A_UINT16 ConnectionFlags; /* HTC connection flags */ - int PendingCreditReports; /* no. of pending credit reports issued by this endpoint */ + this reduces dribbling effect */ + A_INT16 CreditsConsumed; /* number of credits consumed (outstanding) on the endpoint */ + A_UINT16 ConnectionFlags; /* HTC connection flags */ + int PendingCreditReports; /* no. of pending credit reports issued by this endpoint */ A_UINT8 DownLinkPipeID; /* The pipe ID to be use for the direction: target -> host */ A_UINT8 UpLinkPipeID; /* The pipe ID to be use for the direction: host -> target */ } HTC_ENDPOINT; @@ -113,7 +113,7 @@ typedef struct _HTC_CONTEXT { pool_handle_t PoolHandle; // Left a door for extension the structure - void *pReserved; + void *pReserved; } HTC_CONTEXT; #define HTC_STATE_SETUP_COMPLETE (1 << 0) /* HTC host-target setup is complete */ diff --git a/target_firmware/magpie_fw_dev/target/inc/OTUS/OTUS_misc.h b/target_firmware/magpie_fw_dev/target/inc/OTUS/OTUS_misc.h index 4ac5c9b..7476d3a 100755 --- a/target_firmware/magpie_fw_dev/target/inc/OTUS/OTUS_misc.h +++ b/target_firmware/magpie_fw_dev/target/inc/OTUS/OTUS_misc.h @@ -53,7 +53,7 @@ * * By convention, hostless boards set INTERFACE to SDIO, and INFO to * something OTHER than SDIO_NORMAL or 0. - * + * * Layout of Board HW Cfg Info is below. These values are captured at * reset and made available to software. * diff --git a/target_firmware/magpie_fw_dev/target/inc/OTUS/OTUS_soc.h b/target_firmware/magpie_fw_dev/target/inc/OTUS/OTUS_soc.h index 3956148..52bb6c6 100755 --- a/target_firmware/magpie_fw_dev/target/inc/OTUS/OTUS_soc.h +++ b/target_firmware/magpie_fw_dev/target/inc/OTUS/OTUS_soc.h @@ -96,7 +96,7 @@ typedef A_ULONG A_ADDR; ((void *)((((A_UINT32)(addr)) & ~A_MIPS_KSEG_MASK) | A_MIPS_KSEG_CACHED)) /* Read/Write a 32-bit AR6000 SOC register, specified by its physical address */ -#define A_SOC_ADDR_READ(addr) (*((volatile A_UINT32 *)A_UNCACHED_ADDR(addr))) +#define A_SOC_ADDR_READ(addr) (*((volatile A_UINT32 *)A_UNCACHED_ADDR(addr))) #define A_SOC_ADDR_WRITE(addr, val) \ do { \ @@ -126,7 +126,7 @@ typedef A_ULONG A_ADDR; #define A_UNCACHED_ADDR(addr) (addr) #define A_CACHED_ADDR(addr) (addr) -#define A_SOC_ADDR_READ(addr) (*((volatile A_UINT32 *)(addr))) +#define A_SOC_ADDR_READ(addr) (*((volatile A_UINT32 *)(addr))) #define A_SOC_ADDR_WRITE(addr, val) \ do { \ @@ -199,7 +199,7 @@ do { \ HF_TIMER_CONTROL_RESET_MASK); \ } while (0) -/* +/* * Turn it OFF when you're done: */ #define A_TIMESTAMP_DISABLE() A_RTC_REG_WRITE(HF_TIMER_CONTROL_ADDRESS, 0) 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); diff --git a/target_firmware/magpie_fw_dev/target/inc/adf_net.h b/target_firmware/magpie_fw_dev/target/inc/adf_net.h index 3279b03..7b753bc 100755 --- a/target_firmware/magpie_fw_dev/target/inc/adf_net.h +++ b/target_firmware/magpie_fw_dev/target/inc/adf_net.h @@ -43,9 +43,9 @@ */ /** - * @mainpage + * @mainpage * @section Introduction - * The Atheros Driver Framework provides a mechanism to run the Atheros + * The Atheros Driver Framework provides a mechanism to run the Atheros * WLAN driver on a variety of Operating Systems and Platforms. It achieves * this by abstracting all OS-specific and platform-specific functionality * the driver requires. This ensures the core logic in the driver is OS- @@ -58,7 +58,7 @@ * This component abstracts the OS network buffer. See @ref adf_nbuf_public for details. * @subsection sec3 OS services * This component abstracts any OS services. See @ref adf_os_public for details. - */ + */ #ifndef _ADF_NET_H #define _ADF_NET_H @@ -73,17 +73,17 @@ /* * check for a NULL handle * */ -#define ADF_NET_NULL __ADF_NET_NULL +#define ADF_NET_NULL __ADF_NET_NULL /** * @brief this register the driver to the shim, but won't get * any handle until create device is called. - * + * * @param[in] drv driver info structure - * + * * @return status of operation */ -static inline a_status_t +static inline a_status_t adf_net_register_drv(adf_drv_info_t *drv) { return(__adf_net_register_drv(drv)); @@ -92,7 +92,7 @@ adf_net_register_drv(adf_drv_info_t *drv) /** * @brief deregister the driver from the shim - * + * * @param[in] name driver name passed in adf_drv_info_t * * @see adf_net_register_drv() @@ -106,16 +106,16 @@ adf_net_unregister_drv(a_uint8_t *drv_name) /** * @brief register a real device with the kernel - * + * * @param[in] hdl driver handle for this device * @param[in] op per-device switch structure * @param[in] info basic device information - * + * * @return opaque device handle */ -static inline adf_net_handle_t -adf_net_dev_create(adf_drv_handle_t hdl, - adf_dev_sw_t *op, +static inline adf_net_handle_t +adf_net_dev_create(adf_drv_handle_t hdl, + adf_dev_sw_t *op, adf_net_dev_info_t *info) { return (__adf_net_dev_create(hdl, op, info)); @@ -124,30 +124,30 @@ adf_net_dev_create(adf_drv_handle_t hdl, /** * @brief register a virtual device with the kernel. * A virtual device is always backed by a real device. - * + * * @param[in] dev_hdl opaque device handle for the real device * @param[in] hdl driver handle for this virtual device * @param[in] op per-virtual-device switch structure * @param[in] info basic virtual device information - * + * * @return opaque device handle * * @see adf_net_dev_create() */ -static inline adf_net_handle_t -adf_net_vdev_create(adf_net_handle_t dev_hdl, - adf_drv_handle_t hdl, - adf_vdev_sw_t *op, - adf_net_dev_info_t *info) +static inline adf_net_handle_t +adf_net_vdev_create(adf_net_handle_t dev_hdl, + adf_drv_handle_t hdl, + adf_vdev_sw_t *op, + adf_net_dev_info_t *info) { return (__adf_net_vdev_create(dev_hdl, hdl, op, info)); } /** * @brief Checks if the interface is running or not - * + * * @param[in] hdl opaque device handle - * + * * @return true if running, false if not */ static inline a_bool_t @@ -158,9 +158,9 @@ adf_net_is_running(adf_net_handle_t hdl) /** * @brief Checks if the interface is up or not - * + * * @param[in] hdl opaque device handle - * + * * @return true if up, false if not */ static inline a_bool_t @@ -172,12 +172,12 @@ adf_net_is_up(adf_net_handle_t hdl) /** * @brief check whether the carrier is available or not - * + * * @param[in] hdl opaque device handle - * + * * @return a_bool_t true if available, false if not */ -static inline a_bool_t +static inline a_bool_t adf_net_carrier_ok(adf_net_handle_t hdl) { return(__adf_net_carrier_ok(hdl)); @@ -186,10 +186,10 @@ adf_net_carrier_ok(adf_net_handle_t hdl) /** * @brief inform the networking stack that the link is down - * + * * @param[in] hdl opaque device handle */ -static inline void +static inline void adf_net_carrier_off(adf_net_handle_t hdl) { __adf_net_carrier_off(hdl); @@ -198,12 +198,12 @@ adf_net_carrier_off(adf_net_handle_t hdl) /** * @brief inform the networking stack that the link is up - * + * * @param[in] hdl opaque device handle - * + * * @see adf_net_carrier_off() */ -static inline void +static inline void adf_net_carrier_on(adf_net_handle_t hdl) { __adf_net_carrier_on(hdl); @@ -217,12 +217,12 @@ adf_net_carrier_on(adf_net_handle_t hdl) */ /** - * @brief inform the networking stack that the device is ready to receive + * @brief inform the networking stack that the device is ready to receive * transmit packets. Typically called during init. - * + * * @param[in] hdl opaque device handle */ -static inline void +static inline void adf_net_start_queue(adf_net_handle_t hdl) { __adf_net_start_queue(hdl); @@ -231,10 +231,10 @@ adf_net_start_queue(adf_net_handle_t hdl) /** * @brief inform the networking stack to stop sending transmit packets. * Typically called if the driver runs out of resources for the device. - * + * * @param[in] hdl opaque device handle */ -static inline void +static inline void adf_net_stop_queue(adf_net_handle_t hdl) { __adf_net_stop_queue(hdl); @@ -244,13 +244,13 @@ adf_net_stop_queue(adf_net_handle_t hdl) /** * @brief inform the native stack to resume sending packets * to transmit.Typically called when the driver has resources - * available again for the device. + * available again for the device. * * @note adf_net_wake_queue() is the counterpart of adf_net_stop_queue() * * @param[in] hdl opaque device handle */ -static inline void +static inline void adf_net_wake_queue(adf_net_handle_t hdl) { __adf_net_wake_queue(hdl); @@ -259,12 +259,12 @@ adf_net_wake_queue(adf_net_handle_t hdl) /** * @brief Check the state of the queue - * + * * @param[in] hdl opaque device handle - * + * * @return true if stopped, false if not */ -static inline a_bool_t +static inline a_bool_t adf_net_queue_stopped(adf_net_handle_t hdl) { return(__adf_net_queue_stopped(hdl)); @@ -272,9 +272,9 @@ adf_net_queue_stopped(adf_net_handle_t hdl) /** * @brief get interface name - * + * * @param[in] hdl opaque device handle - * + * * @return name of interface */ static inline const a_uint8_t * @@ -287,9 +287,9 @@ adf_net_ifname(adf_net_handle_t hdl) * @brief Get OS Handle from OS device object. * * @param[in] osdev OS device object - * + * * @return OS handle - */ + */ static inline adf_os_handle_t adf_net_dev_to_os(adf_os_device_t osdev) { @@ -300,9 +300,9 @@ adf_net_dev_to_os(adf_os_device_t osdev) * @brief Get OS Handle from OS net handle. * * @param[in] osdev OS net handle - * + * * @return OS handle - */ + */ static inline adf_os_handle_t adf_net_hdl_to_os(adf_net_handle_t hdl) { diff --git a/target_firmware/magpie_fw_dev/target/inc/adf_net_sw.h b/target_firmware/magpie_fw_dev/target/inc/adf_net_sw.h index 40b8e58..66783af 100755 --- a/target_firmware/magpie_fw_dev/target/inc/adf_net_sw.h +++ b/target_firmware/magpie_fw_dev/target/inc/adf_net_sw.h @@ -36,7 +36,7 @@ * @ingroup adf_net_public * @file adf_net_sw.h * This file defines the device and virtual device switch tables. - */ + */ #ifndef __ADF_NET_SW_H #define __ADF_NET_SW_H @@ -49,7 +49,7 @@ typedef struct _adf_dev_sw{ /** * @brief Handler for device open - mandatory interface */ - a_status_t (*drv_open) (adf_drv_handle_t hdl); + a_status_t (*drv_open) (adf_drv_handle_t hdl); /** * @brief Handler for device close - mandatory interface */ @@ -66,7 +66,7 @@ typedef struct _adf_dev_sw{ /** * @brief Handler for ioctl - mandatory interface */ - a_status_t (*drv_ioctl) (adf_drv_handle_t hdl, int num, + a_status_t (*drv_ioctl) (adf_drv_handle_t hdl, int num, void *data); /** * @brief Handler for transmission timeout - mandatory interface @@ -77,17 +77,17 @@ typedef struct _adf_dev_sw{ */ a_status_t (*drv_wcmd) (adf_drv_handle_t hdl, adf_net_wcmd_type_t cmd, adf_net_wcmd_data_t *data); - /** - * @brief Handler for polling if polling/deferred processing required - + /** + * @brief Handler for polling if polling/deferred processing required - * optional interface */ - adf_net_poll_resp_t (*drv_poll) (adf_drv_handle_t hdl, int quota, + adf_net_poll_resp_t (*drv_poll) (adf_drv_handle_t hdl, int quota, int *work_done); /** * @brief Handler for per cpu deffered callback (e.g. for RSS) - optional * interface */ - adf_net_poll_resp_t (*drv_poll_cpu) (adf_drv_handle_t hdl, int quota, + adf_net_poll_resp_t (*drv_poll_cpu) (adf_drv_handle_t hdl, int quota, int *work_done, void *arg); /** * @brief Handler for disabling receive interrupts for polling. diff --git a/target_firmware/magpie_fw_dev/target/inc/adf_net_types.h b/target_firmware/magpie_fw_dev/target/inc/adf_net_types.h index 4238c38..dcd032c 100755 --- a/target_firmware/magpie_fw_dev/target/inc/adf_net_types.h +++ b/target_firmware/magpie_fw_dev/target/inc/adf_net_types.h @@ -72,7 +72,7 @@ typedef enum { /** - * @brief Indicates what features are supported by the interface. + * @brief Indicates what features are supported by the interface. */ #define ADF_NET_LINK_SUPP_10baseT_Half (1 << 0) #define ADF_NET_LINK_SUPP_10baseT_Full (1 << 1) @@ -93,7 +93,7 @@ typedef enum { ADF_NET_LINK_SUPP_1000baseT_Full) /** - * @brief Indicates what features are advertised by the interface. + * @brief Indicates what features are advertised by the interface. */ #define ADF_NET_LINK_ADV_10baseT_Half (1 << 0) #define ADF_NET_LINK_ADV_10baseT_Full (1 << 1) @@ -196,7 +196,7 @@ typedef struct adf_net_vlanhdr{ typedef struct adf_net_vid{ #if defined (ADF_LITTLE_ENDIAN_MACHINE) a_uint16_t val:12; - a_uint8_t res:4; + a_uint8_t res:4; #elif defined (ADF_BIG_ENDIAN_MACHINE) a_uint8_t res:4; a_uint16_t val:12; @@ -314,7 +314,7 @@ typedef union { }adf_net_cmd_data_t; /** - * @brief For polled devices, adf_drv responds with one of the following status in + * @brief For polled devices, adf_drv responds with one of the following status in * its poll function. */ typedef enum { @@ -368,7 +368,7 @@ typedef enum adf_net_wireless_events{ ADF_IEEE80211_SCAN = __ADF_IEEE80211_SCAN, ADF_IEEE80211_REPLAY = __ADF_IEEE80211_REPLAY, ADF_IEEE80211_MICHAEL = __ADF_IEEE80211_MICHAEL, - ADF_IEEE80211_REJOIN = __ADF_IEEE80211_REJOIN, + ADF_IEEE80211_REJOIN = __ADF_IEEE80211_REJOIN, ADF_CUSTOM_PUSH_BUTTON = __ADF_CUSTOM_PUSH_BUTTON }adf_net_wireless_event_t; diff --git a/target_firmware/magpie_fw_dev/target/inc/adf_net_wcmd.h b/target_firmware/magpie_fw_dev/target/inc/adf_net_wcmd.h index ea0aebb..1964195 100755 --- a/target_firmware/magpie_fw_dev/target/inc/adf_net_wcmd.h +++ b/target_firmware/magpie_fw_dev/target/inc/adf_net_wcmd.h @@ -34,7 +34,7 @@ */ /** * Copyright (c) Atheros Communications Inc. 2002-2008 - * + * */ #ifndef __ADF_NET_WCMD_H @@ -50,8 +50,8 @@ * Defines */ #define ADF_NET_WCMD_NAME_SIZE __ADF_OS_NAME_SIZE -#define ADF_NET_WCMD_NICK_NAME 32 /**< Max Device nick name size*/ -#define ADF_NET_WCMD_MODE_NAME_LEN 6 +#define ADF_NET_WCMD_NICK_NAME 32 /**< Max Device nick name size*/ +#define ADF_NET_WCMD_MODE_NAME_LEN 6 #define ADF_NET_WCMD_IE_MAXLEN 256 /** Max Len for IE */ #define ADF_NET_WCMD_MAX_BITRATES 32 @@ -64,7 +64,7 @@ * @brief key set/get info */ #define ADF_NET_WCMD_KEYBUF_SIZE 16 -#define ADF_NET_WCMD_MICBUF_SIZE 16/**< space for tx+rx keys */ +#define ADF_NET_WCMD_MICBUF_SIZE 16/**< space for tx+rx keys */ #define ADF_NET_WCMD_KEY_DEFAULT 0x80/**< default xmit key */ #define ADF_NET_WCMD_ADDR_LEN 6 #define ADF_NET_WCMD_KEYDATA_SZ \ @@ -75,8 +75,8 @@ */ #define ADF_NET_WCMD_VAPKEY_XMIT 0x01/**< xmit */ #define ADF_NET_WCMD_VAPKEY_RECV 0x02/**< recv */ -#define ADF_NET_WCMD_VAPKEY_GROUP 0x04/**< WPA group*/ -#define ADF_NET_WCMD_VAPKEY_SWCRYPT 0x10/**< Encrypt/decrypt*/ +#define ADF_NET_WCMD_VAPKEY_GROUP 0x04/**< WPA group*/ +#define ADF_NET_WCMD_VAPKEY_SWCRYPT 0x10/**< Encrypt/decrypt*/ #define ADF_NET_WCMD_VAPKEY_SWMIC 0x20/**< Enmic/Demic */ #define ADF_NET_WCMD_VAPKEY_DEFAULT 0x80/**< Default key */ @@ -101,9 +101,9 @@ * @brief Ethtool specific */ #define ADF_NET_WCMD_BUSINFO_LEN 32 -#define ADF_NET_WCMD_DRIVSIZ 32 -#define ADF_NET_WCMD_VERSIZ 32 -#define ADF_NET_WCMD_FIRMSIZ 32 +#define ADF_NET_WCMD_DRIVSIZ 32 +#define ADF_NET_WCMD_VERSIZ 32 +#define ADF_NET_WCMD_FIRMSIZ 32 /** * *******************************Enums****************** */ @@ -133,21 +133,21 @@ typedef enum adf_net_wcmd_ciphermode{ */ typedef enum adf_net_wcmd_type{ /* net80211 */ - ADF_NET_WCMD_GET_RTS_THRES, - ADF_NET_WCMD_SET_RTS_THRES, - ADF_NET_WCMD_GET_FRAGMENT, - ADF_NET_WCMD_SET_FRAGMENT, - ADF_NET_WCMD_GET_VAPMODE, + ADF_NET_WCMD_GET_RTS_THRES, + ADF_NET_WCMD_SET_RTS_THRES, + ADF_NET_WCMD_GET_FRAGMENT, + ADF_NET_WCMD_SET_FRAGMENT, + ADF_NET_WCMD_GET_VAPMODE, ADF_NET_WCMD_SET_VAPMODE, - ADF_NET_WCMD_GET_BSSID, - ADF_NET_WCMD_SET_BSSID, - ADF_NET_WCMD_GET_NICKNAME, - ADF_NET_WCMD_SET_NICKNAME, - ADF_NET_WCMD_GET_FREQUENCY, - ADF_NET_WCMD_SET_FREQUENCY, - ADF_NET_WCMD_GET_ESSID, - ADF_NET_WCMD_SET_ESSID, - ADF_NET_WCMD_GET_TX_POWER, + ADF_NET_WCMD_GET_BSSID, + ADF_NET_WCMD_SET_BSSID, + ADF_NET_WCMD_GET_NICKNAME, + ADF_NET_WCMD_SET_NICKNAME, + ADF_NET_WCMD_GET_FREQUENCY, + ADF_NET_WCMD_SET_FREQUENCY, + ADF_NET_WCMD_GET_ESSID, + ADF_NET_WCMD_SET_ESSID, + ADF_NET_WCMD_GET_TX_POWER, ADF_NET_WCMD_SET_TX_POWER, ADF_NET_WCMD_GET_PARAM, ADF_NET_WCMD_SET_PARAM, @@ -158,14 +158,14 @@ typedef enum adf_net_wcmd_type{ ADF_NET_WCMD_SET_ENC, ADF_NET_WCMD_GET_KEY, ADF_NET_WCMD_SET_KEY, - ADF_NET_WCMD_GET_SCAN, - ADF_NET_WCMD_SET_SCAN, - ADF_NET_WCMD_GET_MODE, - ADF_NET_WCMD_SET_MODE, - ADF_NET_WCMD_GET_CHAN_LIST, - ADF_NET_WCMD_SET_CHAN_LIST, - ADF_NET_WCMD_GET_WMM_PARAM, - ADF_NET_WCMD_SET_WMM_PARAM, + ADF_NET_WCMD_GET_SCAN, + ADF_NET_WCMD_SET_SCAN, + ADF_NET_WCMD_GET_MODE, + ADF_NET_WCMD_SET_MODE, + ADF_NET_WCMD_GET_CHAN_LIST, + ADF_NET_WCMD_SET_CHAN_LIST, + ADF_NET_WCMD_GET_WMM_PARAM, + ADF_NET_WCMD_SET_WMM_PARAM, ADF_NET_WCMD_GET_VAPNAME, ADF_NET_WCMD_GET_IC_CAPS, ADF_NET_WCMD_GET_RETRIES, @@ -202,7 +202,7 @@ typedef enum adf_net_wcmd_type{ ADF_NET_WCMD_GET_DEV_DIALOG, ADF_NET_WCMD_GET_DEV_PHYERR, ADF_NET_WCMD_GET_DEV_CWM, - ADF_NET_WCMD_GET_DEV_ETHTOOL, + ADF_NET_WCMD_GET_DEV_ETHTOOL, ADF_NET_WCMD_SET_DEV_MAC, ADF_NET_WCMD_SET_DEV_CAP,/*ATH_CAP*/ /* Device write specific */ @@ -348,7 +348,7 @@ typedef enum adf_net_wcmd_param_id{ ADF_NET_WCMD_PARAM_FAST_CC,/**< fast channel change */ /** * 11n A-MPDU, A-MSDU support - */ + */ ADF_NET_WCMD_PARAM_AMPDU,/**< 11n a-mpdu support */ ADF_NET_WCMD_PARAM_AMPDU_LIMIT,/**< a-mpdu length limit */ ADF_NET_WCMD_PARAM_AMPDU_DENSITY,/**< a-mpdu density */ @@ -369,7 +369,7 @@ typedef enum adf_net_wcmd_param_id{ ADF_NET_WCMD_PARAM_RB,/**< Switch in/out of RB */ /** * RB Detection knobs. - */ + */ ADF_NET_WCMD_PARAM_RB_DETECT,/**< Do RB detection */ ADF_NET_WCMD_PARAM_RB_SKIP_THRESHOLD,/**< seqno-skip-by-1s to detect */ ADF_NET_WCMD_PARAM_RB_TIMEOUT,/**< (in ms) to restore non-RB */ @@ -419,7 +419,7 @@ typedef enum adf_net_wcmd_wmmparams{ ADF_NET_WCMD_WMMPARAMS_AIFS, ADF_NET_WCMD_WMMPARAMS_TXOPLIMIT, ADF_NET_WCMD_WMMPARAMS_ACM, - ADF_NET_WCMD_WMMPARAMS_NOACKPOLICY, + ADF_NET_WCMD_WMMPARAMS_NOACKPOLICY, }adf_net_wcmd_wmmparams_t; /** @@ -448,8 +448,8 @@ typedef enum adf_net_wcmd_txpow_flags{ ADF_NET_WCMD_TXPOW_DBM = 0,/**< dBm */ ADF_NET_WCMD_TXPOW_MWATT = 0x1,/**< mW */ ADF_NET_WCMD_TXPOW_RELATIVE = 0x2,/**< Arbitrary units */ - ADF_NET_WCMD_TXPOW_TYPE = 0xFF,/**< Type of value */ - ADF_NET_WCMD_TXPOW_RANGE = 0x1000/**< Range (min - max) */ + ADF_NET_WCMD_TXPOW_TYPE = 0xFF,/**< Type of value */ + ADF_NET_WCMD_TXPOW_RANGE = 0x1000/**< Range (min - max) */ }adf_net_wcmd_txpow_flags_t; /** * @brief Retry flags @@ -460,7 +460,7 @@ typedef enum adf_net_wcmd_retry_flags{ ADF_NET_WCMD_RETRY_MAX = 0x2,/**< Maximum */ ADF_NET_WCMD_RETRY_RELATIVE = 0x4,/**< Not in seconds/ms/us */ ADF_NET_WCMD_RETRY_SHORT = 0x10,/**< Short packets */ - ADF_NET_WCMD_RETRY_LONG = 0x20,/**< Long packets */ + ADF_NET_WCMD_RETRY_LONG = 0x20,/**< Long packets */ ADF_NET_WCMD_RETRY_MODIFIER = 0xFF,/**< Modify a parameter */ ADF_NET_WCMD_RETRY_LIMIT = 0x1000,/**< Max retries*/ ADF_NET_WCMD_RETRY_LIFETIME = 0x2000,/**< Max retries us*/ @@ -495,7 +495,7 @@ typedef enum adf_net_wcmd_cwm_event{ ADF_NET_WCMD_CWMEVENT_EXTCHRESUME,/**< ext channel sensing resume */ ADF_NET_WCMD_CWMEVENT_DESTCW20, /**< dest channel width changed to 20 */ ADF_NET_WCMD_CWMEVENT_DESTCW40, /**< dest channel width changed to 40 */ - ADF_NET_WCMD_CWMEVENT_MAX + ADF_NET_WCMD_CWMEVENT_MAX } adf_net_wcmd_cwm_event_t; /** @@ -510,7 +510,7 @@ typedef enum adf_net_wcmd_ethtool_cmd{ ADF_NET_WCMD_ETHTOOL_SWOL,/**< Set wake-on-lan options. */ ADF_NET_WCMD_ETHTOOL_GMSGLVL,/**< Get driver message level */ ADF_NET_WCMD_ETHTOOL_SMSGLVL,/**< Set driver msg level */ - ADF_NET_WCMD_ETHTOOL_NWAY_RST,/**< Restart autonegotiation. */ + ADF_NET_WCMD_ETHTOOL_NWAY_RST,/**< Restart autonegotiation. */ ADF_NET_WCMD_ETHTOOL_GEEPROM,/**< Get EEPROM data */ ADF_NET_WCMD_ETHTOOL_SEEPROM,/** < Set EEPROM data. */ ADF_NET_WCMD_ETHTOOL_GCOALESCE,/** < Get coalesce config */ @@ -582,7 +582,7 @@ typedef struct adf_net_wcmd_discard{ * @brief Link quality info */ typedef struct adf_net_wcmd_linkqty{ - a_uint8_t qual;/*link quality(retries, SNR, missed beacons)*/ + a_uint8_t qual;/*link quality(retries, SNR, missed beacons)*/ a_uint8_t level;/*Signal level (dBm) */ a_uint8_t noise;/*Noise level (dBm) */ a_uint8_t updated;/*Update flag*/ @@ -601,7 +601,7 @@ typedef struct adf_net_wcmd_freq{ * @brief VAP parameter range info */ typedef struct adf_net_wcmd_vapparam_range{ - + /** * @brief Informative stuff (to choose between different * interface) In theory this value should be the maximum @@ -612,7 +612,7 @@ typedef struct adf_net_wcmd_vapparam_range{ * benchmark... */ a_uint32_t throughput;/**< To give an idea... */ - + /** @brief NWID (or domain id) */ a_uint32_t min_nwid;/**< Min NWID to set */ a_uint32_t max_nwid;/**< Max NWID to set */ @@ -648,9 +648,9 @@ typedef struct adf_net_wcmd_vapparam_range{ * quality level (using a geometric subdivision centered on the * average). I expect that people doing the user space apps will * feedback us on which value we need to put in each - * driver... + * driver... */ - adf_net_wcmd_linkqty_t avg_qual; + adf_net_wcmd_linkqty_t avg_qual; /**@brief Rates */ a_uint8_t num_bitrates; /**< Number of entries in the list */ @@ -684,11 +684,11 @@ typedef struct adf_net_wcmd_vapparam_range{ a_uint16_t txpower_capa;/**< options supported */ a_uint8_t num_txpower;/**< Number of entries in the list */ a_int32_t txpower[ADF_NET_WCMD_MAX_TXPOWER];/**< in bps */ - + /**@brief Wireless Extension version info */ a_uint8_t we_version_compiled;/**< Must be WIRELESS_EXT */ a_uint8_t we_version_source;/**< Last update of source */ - + /**@brief Retry limits and lifetime */ a_uint16_t retry_capa;/**< retry options supported */ a_uint16_t retry_flags;/**< decode max/min retry limit*/ @@ -697,7 +697,7 @@ typedef struct adf_net_wcmd_vapparam_range{ a_int32_t max_retry;/**< Max retries */ a_int32_t min_r_time;/**< Min retry lifetime */ a_int32_t max_r_time;/**< Max retry lifetime */ - + /**@brief Frequency */ a_uint16_t num_channels;/**< Num channels [0 - (num - 1)] */ a_uint8_t num_frequency;/**< Num entries*/ @@ -706,7 +706,7 @@ typedef struct adf_net_wcmd_vapparam_range{ * numbers, because each entry contain its channel index */ adf_net_wcmd_freq_t freq[ADF_NET_WCMD_MAX_FREQ]; - + a_uint32_t enc_capa; /**< IW_ENC_CAPA_* bit field */ }adf_net_wcmd_vapparam_range_t; /** @@ -751,12 +751,12 @@ typedef struct adf_net_wcmd_param{ typedef adf_net_ie_info_t adf_net_wcmd_optie_t; /** - * @brief status of VAP interface - */ + * @brief status of VAP interface + */ typedef struct adf_net_wcmd_vapstats{ a_uint8_t status;/**< Status*/ adf_net_wcmd_linkqty_t qual;/**< Quality of the link*/ - adf_net_wcmd_discard_t discard;/**< Packet discarded counts */ + adf_net_wcmd_discard_t discard;/**< Packet discarded counts */ adf_net_wcmd_miss_t miss;/**< Packet missed counts */ } adf_net_wcmd_vapstats_t; @@ -807,7 +807,7 @@ typedef struct adf_net_wcmd_delba{ * @brief MLME */ typedef struct adf_net_wcmd_mlme{ - adf_net_wcmd_mlme_op_type_t op;/**< operation to perform */ + adf_net_wcmd_mlme_op_type_t op;/**< operation to perform */ a_uint8_t reason;/**< 802.11 reason code */ //a_uint8_t macaddr[ADF_NET_WCMD_ADDR_LEN]; adf_net_ethaddr_t mac; @@ -845,8 +845,8 @@ typedef struct adf_net_wcmd_chaninfo{ }adf_net_wcmd_chaninfo_t; /** - * @brief wmm-param info - */ + * @brief wmm-param info + */ typedef struct adf_net_wcmd_wmmparaminfo{ adf_net_wcmd_wmmparams_t cmd; a_uint32_t ac; @@ -923,8 +923,8 @@ typedef struct adf_net_wcmd_txpower{ }adf_net_wcmd_txpower_t; /** - * @brief tx-power-limit info - */ + * @brief tx-power-limit info + */ typedef a_uint32_t adf_net_wcmd_txpowlimit_t; @@ -961,7 +961,7 @@ typedef struct adf_net_wcmd_scan{ */ typedef struct adf_net_wcmd_vaplist{ a_uint8_t list[ADF_NET_WCMD_MAX_AP]; - a_uint32_t len; + a_uint32_t len; }adf_net_wcmd_vaplist_t; /** * @brief list of stations @@ -973,10 +973,10 @@ typedef struct adf_net_wcmd_stainfo{ /** * @brief ath caps info */ -typedef struct adf_net_wcmd_devcap{ - a_int32_t cap; - a_int32_t setting; -}adf_net_wcmd_devcap_t; +typedef struct adf_net_wcmd_devcap{ + a_int32_t cap; + a_int32_t setting; +}adf_net_wcmd_devcap_t; /** * @brief station stats @@ -992,7 +992,7 @@ typedef struct adf_net_wcmd_stastats{ a_uint64_t ns_rx_bytes;/**< rx data count (bytes) */ a_uint64_t ns_rx_beacons;/**< rx beacon frames */ a_uint32_t ns_rx_proberesp;/**< rx probe response frames */ - + a_uint32_t ns_rx_dup;/**< rx discard 'cuz dup */ a_uint32_t ns_rx_noprivacy;/**< rx w/ wep but privacy off */ a_uint32_t ns_rx_wepfail;/**< rx wep processing failed */ @@ -1005,7 +1005,7 @@ typedef struct adf_net_wcmd_stastats{ a_uint32_t ns_rx_decryptcrc;/**< rx decrypt failed on crc */ a_uint32_t ns_rx_unauth;/**< rx on unauthorized port */ a_uint32_t ns_rx_unencrypted;/**< rx unecrypted w/ privacy */ - + a_uint32_t ns_tx_data;/**< tx data frames */ a_uint32_t ns_tx_mgmt;/**< tx management frames */ a_uint32_t ns_tx_ucast;/**< tx unicast frames */ @@ -1013,16 +1013,16 @@ typedef struct adf_net_wcmd_stastats{ a_uint64_t ns_tx_bytes;/**< tx data count (bytes) */ a_uint32_t ns_tx_probereq;/**< tx probe request frames */ a_uint32_t ns_tx_uapsd;/**< tx on uapsd queue */ - + a_uint32_t ns_tx_novlantag;/**< tx discard 'cuz no tag */ a_uint32_t ns_tx_vlanmismatch;/**< tx discard 'cuz bad tag */ - + a_uint32_t ns_tx_eosplost;/**< uapsd EOSP retried out */ - + a_uint32_t ns_ps_discard;/**< ps discard 'cuz of age */ - + a_uint32_t ns_uapsd_triggers;/**< uapsd triggers */ - + /* MIB-related state */ a_uint32_t ns_tx_assoc;/**< [re]associations */ a_uint32_t ns_tx_assoc_fail;/**< [re]association failures */ @@ -1124,8 +1124,8 @@ typedef struct adf_net_wcmd_11n_stats { /** - * @brief ampdu info - */ + * @brief ampdu info + */ typedef struct adf_net_wcmd_ampdu_trc { a_uint32_t tr_head; a_uint32_t tr_tail; @@ -1140,8 +1140,8 @@ typedef struct adf_net_wcmd_ampdu_trc { } adf_net_wcmd_ampdu_trc_t; /** - * @brief phy stats info - */ + * @brief phy stats info + */ typedef struct adf_net_wcmd_phystats{ a_uint32_t ast_watchdog;/**< device reset by watchdog */ a_uint32_t ast_hardware;/**< fatal hardware error interrupts */ @@ -1245,8 +1245,8 @@ typedef struct adf_net_wcmd_phystats{ } adf_net_wcmd_phystats_t; /** - * @brief diag info - */ + * @brief diag info + */ typedef struct adf_net_wcmd_diag{ a_int8_t ad_name[ADF_NET_WCMD_NAME_SIZE];/**< if name*/ a_uint16_t ad_id; @@ -1283,7 +1283,7 @@ typedef struct adf_net_wcmd_cwminfo{ typedef struct adf_net_wcmd_cwmdbg{ adf_net_wcmd_cwm_cmd_t dc_cmd;/**< dbg commands*/ adf_net_wcmd_cwm_event_t dc_arg;/**< events*/ -} adf_net_wcmd_cwmdbg_t; +} adf_net_wcmd_cwmdbg_t; /** * @brief device cwm info @@ -1309,11 +1309,11 @@ typedef struct adf_net_wcmd_ethtool{ a_int8_t driver[ADF_NET_WCMD_DRIVSIZ];/**< driver short name */ a_int8_t version[ADF_NET_WCMD_VERSIZ];/**< driver ver string */ a_int8_t fw_version[ADF_NET_WCMD_FIRMSIZ];/**< firmware ver string*/ - a_int8_t bus_info[ADF_NET_WCMD_BUSINFO_LEN];/**< Bus info */ + a_int8_t bus_info[ADF_NET_WCMD_BUSINFO_LEN];/**< Bus info */ a_int8_t reserved1[32]; a_int8_t reserved2[16]; a_uint32_t n_stats;/**< number of u64's from ETHTOOL_GSTATS */ - a_uint32_t testinfo_len; + a_uint32_t testinfo_len; a_uint32_t eedump_len;/**< Size of data from EEPROM(bytes) */ a_uint32_t regdump_len;/**< Size of data from REG(bytes) */ }adf_net_wcmd_ethtool_t ; @@ -1323,12 +1323,12 @@ typedef struct adf_net_wcmd_ethtool_info{ adf_net_wcmd_ethtool_t drv; }adf_net_wcmd_ethtool_info_t; -/** - * @brief vap create flag info - */ +/** + * @brief vap create flag info + */ typedef enum adf_net_wcmd_vapcreate_flags{ ADF_NET_WCMD_CLONE_BSSID=0x1,/**< allocate unique mac/bssid */ - ADF_NET_WCMD_NO_STABEACONS/**< Do not setup the sta beacon timers*/ + ADF_NET_WCMD_NO_STABEACONS/**< Do not setup the sta beacon timers*/ }adf_net_wcmd_vapcreate_flags_t; /** @@ -1355,7 +1355,7 @@ typedef struct adf_net_wcmd_devstats{ a_uint64_t tx_dropped;/**< no space available in linux */ a_uint64_t multicast;/**< multicast packets received */ a_uint64_t collisions; - + /* detailed rx_errors: */ a_uint64_t rx_length_errors; a_uint64_t rx_over_errors;/**< receiver ring buff overflow */ @@ -1363,14 +1363,14 @@ typedef struct adf_net_wcmd_devstats{ a_uint64_t rx_frame_errors;/**< recv'd frame alignment error */ a_uint64_t rx_fifo_errors;/**< recv'r fifo overrun */ a_uint64_t rx_missed_errors;/**< receiver missed packet */ - + /* detailed tx_errors */ a_uint64_t tx_aborted_errors; a_uint64_t tx_carrier_errors; a_uint64_t tx_fifo_errors; a_uint64_t tx_heartbeat_errors; a_uint64_t tx_window_errors; - + /* for cslip etc */ a_uint64_t rx_compressed; a_uint64_t tx_compressed; @@ -1442,11 +1442,11 @@ typedef union adf_net_wcmd_data{ /** * @brief ioctl structure to configure the wireless interface. - */ + */ typedef struct adf_net_wcmd{ char if_name[ADF_NET_WCMD_NAME_SIZE];/**< Iface name*/ adf_net_wcmd_type_t type; /**< Type of wcmd */ - adf_net_wcmd_data_t data; /**< Data */ + adf_net_wcmd_data_t data; /**< Data */ } adf_net_wcmd_t; /** * @brief helper macros @@ -1505,19 +1505,19 @@ typedef struct adf_net_wcmd_chansw{ a_uint8_t chan; a_uint8_t ttbt; }adf_net_wcmd_chansw_t; -/** +/** * ***************************Unresoloved******************* */ // typedef struct adf_net_wcmd_chansw_info{ // a_uint8_t chan; // a_uint8_t ttbt; // }adf_net_wcmd_chansw_info_t; -// +// /** * @brief ath mac info */ // typedef struct { // a_uint16_t sa_family;/**< address family, AF_xxx*/ -// a_int8_t sa_data[ADF_NET_WCMD_ADDR_LEN];/**< 14 bytes address */ +// a_int8_t sa_data[ADF_NET_WCMD_ADDR_LEN];/**< 14 bytes address */ // }adf_net_wcmd_ath_mac_info_t; #endif diff --git a/target_firmware/magpie_fw_dev/target/inc/adf_os_atomic.h b/target_firmware/magpie_fw_dev/target/inc/adf_os_atomic.h index cadd0d7..321b5fe 100755 --- a/target_firmware/magpie_fw_dev/target/inc/adf_os_atomic.h +++ b/target_firmware/magpie_fw_dev/target/inc/adf_os_atomic.h @@ -32,12 +32,12 @@ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/** +/** * @ingroup adf_os_public * @file adf_os_atomic.h * This file abstracts an atomic counter. */ - + #ifndef _ADF_OS_ATOMIC_H #define _ADF_OS_ATOMIC_H @@ -50,7 +50,7 @@ */ typedef __adf_os_atomic_t adf_os_atomic_t; -/** +/** * @brief Initialize an atomic type variable * @param[in] v a pointer to an opaque atomic variable */ diff --git a/target_firmware/magpie_fw_dev/target/inc/adf_os_bitops.h b/target_firmware/magpie_fw_dev/target/inc/adf_os_bitops.h index b8b7b02..6b414af 100755 --- a/target_firmware/magpie_fw_dev/target/inc/adf_os_bitops.h +++ b/target_firmware/magpie_fw_dev/target/inc/adf_os_bitops.h @@ -32,7 +32,7 @@ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/** +/** * @ingroup adf_os_public * @file adf_os_bitops.h * This file abstracts bit-level operations on a stream of bytes. @@ -136,7 +136,7 @@ static inline void adf_os_change_bit(a_uint32_t nr, volatile a_uint32_t *addr) * Note that nr may be almost arbitrarily large; this function is not * restricted to acting on a single-word quantity. */ -static inline void adf_os_test_and_set_bit_a(a_uint32_t nr, +static inline void adf_os_test_and_set_bit_a(a_uint32_t nr, volatile a_uint32_t *addr) { __adf_os_test_and_set_bit_a(nr, addr); @@ -151,7 +151,7 @@ static inline void adf_os_test_and_set_bit_a(a_uint32_t nr, * Note that nr may be almost arbitrarily large; this function is not * restricted to acting on a single-word quantity. */ -static inline void adf_os_test_and_set_bit(a_uint32_t nr, +static inline void adf_os_test_and_set_bit(a_uint32_t nr, volatile a_uint32_t *addr) { __adf_os_test_and_set_bit(nr, addr); @@ -166,7 +166,7 @@ static inline void adf_os_test_and_set_bit(a_uint32_t nr, * Note that nr may be almost arbitrarily large; this function is not * restricted to acting on a single-word quantity. */ -static inline void adf_os_test_and_clear_bit_a(a_uint32_t nr, +static inline void adf_os_test_and_clear_bit_a(a_uint32_t nr, volatile a_uint32_t *addr) { __adf_os_test_and_clear_bit_a(nr, addr); @@ -181,7 +181,7 @@ static inline void adf_os_test_and_clear_bit_a(a_uint32_t nr, * Note that nr may be almost arbitrarily large; this function is not * restricted to acting on a single-word quantity. */ -static inline void adf_os_test_and_clear_bit(a_uint32_t nr, +static inline void adf_os_test_and_clear_bit(a_uint32_t nr, volatile a_uint32_t *addr) { __adf_os_test_and_clear_bit(nr, addr); @@ -196,7 +196,7 @@ static inline void adf_os_test_and_clear_bit(a_uint32_t nr, * Note that nr may be almost arbitrarily large; this function is not * restricted to acting on a single-word quantity. */ -static inline void adf_os_test_and_change_bit_a(a_uint32_t nr, +static inline void adf_os_test_and_change_bit_a(a_uint32_t nr, volatile a_uint32_t *addr) { __adf_os_test_and_change_bit_a(nr, addr); @@ -211,7 +211,7 @@ static inline void adf_os_test_and_change_bit_a(a_uint32_t nr, * Note that nr may be almost arbitrarily large; this function is not * restricted to acting on a single-word quantity. */ -static inline void adf_os_test_and_change_bit(a_uint32_t nr, +static inline void adf_os_test_and_change_bit(a_uint32_t nr, volatile a_uint32_t *addr) { __adf_os_test_and_change_bit(nr, addr); diff --git a/target_firmware/magpie_fw_dev/target/inc/adf_os_crypto.h b/target_firmware/magpie_fw_dev/target/inc/adf_os_crypto.h index 25776bd..71ac9c5 100755 --- a/target_firmware/magpie_fw_dev/target/inc/adf_os_crypto.h +++ b/target_firmware/magpie_fw_dev/target/inc/adf_os_crypto.h @@ -45,12 +45,12 @@ /** * @brief Representation of a cipher context. - */ + */ typedef __adf_os_cipher_t adf_os_cipher_t; /** * @brief Types of crypto algorithms - */ + */ typedef enum adf_os_crypto_alg{ ADF_OS_CRYPTO_AES = __ADF_OS_CRYPTO_AES, ADF_OS_CRYPTO_OTHER = __ADF_OS_CRYPTO_OTHER, @@ -60,7 +60,7 @@ typedef enum adf_os_crypto_alg{ /** * @brief allocate the cipher context * @param[in] type crypto algorithm - * + * * @return the new cipher context */ static inline adf_os_cipher_t @@ -71,7 +71,7 @@ adf_os_crypto_alloc_cipher(adf_os_crypto_alg_t type) /** * @brief free the cipher context - * + * * @param[in] cipher cipher context */ static inline void @@ -82,11 +82,11 @@ adf_os_crypto_free_cipher(adf_os_cipher_t cipher) /** * @brief set the key for cipher context with length keylen - * + * * @param[in] cipher cipher context * @param[in] key key material * @param[in] keylen length of key material - * + * * @return a_uint32_t */ static inline a_uint32_t @@ -97,7 +97,7 @@ adf_os_crypto_cipher_setkey(adf_os_cipher_t cipher, const a_uint8_t *key, a_uint /** * @brief encrypt the data with AES - * + * * @param[in] cipher cipher context * @param[in] src unencrypted data * @param[out] dst encrypted data diff --git a/target_firmware/magpie_fw_dev/target/inc/adf_os_defer.h b/target_firmware/magpie_fw_dev/target/inc/adf_os_defer.h index 4c16056..094e541 100755 --- a/target_firmware/magpie_fw_dev/target/inc/adf_os_defer.h +++ b/target_firmware/magpie_fw_dev/target/inc/adf_os_defer.h @@ -46,37 +46,37 @@ /** * TODO This implements work queues (worker threads, kernel threads etc.). - * Note that there is no cancel on a scheduled work. You cannot free a work + * Note that there is no cancel on a scheduled work. You cannot free a work * item if its queued. You cannot know if a work item is queued or not unless * its running, whence you know its not queued. * * so if, say, a module is asked to unload itself, how exactly will it make - * sure that the work's not queued, for OS'es that dont provide such a + * sure that the work's not queued, for OS'es that dont provide such a * mechanism?? */ /** * @brief Representation of a work queue. - */ + */ typedef __adf_os_work_t adf_os_work_t; /** * @brief Representation of a bottom half. - */ + */ typedef __adf_os_bh_t adf_os_bh_t; /** * @brief This initiallizes the Bottom half deferred handler - * + * * @param[in] hdl OS handle * @param[in] bh bottom instance * @param[in] func deferred function to run at bottom half interrupt * context. * @param[in] arg argument for the deferred function */ -static inline void +static inline void adf_os_init_bh(adf_os_handle_t hdl, adf_os_bh_t *bh, adf_os_defer_fn_t func,void *arg) { @@ -86,11 +86,11 @@ adf_os_init_bh(adf_os_handle_t hdl, adf_os_bh_t *bh, /** * @brief schedule a bottom half (DPC) - * + * * @param[in] hdl OS handle * @param[in] bh bottom instance */ -static inline void +static inline void adf_os_sched_bh(adf_os_handle_t hdl, adf_os_bh_t *bh) { __adf_os_sched_bh(hdl, bh); @@ -98,11 +98,11 @@ adf_os_sched_bh(adf_os_handle_t hdl, adf_os_bh_t *bh) /** * @brief disable the bh (synchronous) - * + * * @param[in] hdl OS handle * @param[in] bh bottom instance */ -static inline void +static inline void adf_os_disable_bh(adf_os_handle_t hdl, adf_os_bh_t *bh) { __adf_os_disable_bh(hdl,bh); @@ -113,14 +113,14 @@ adf_os_disable_bh(adf_os_handle_t hdl, adf_os_bh_t *bh) /** * @brief allocate a work/task queue, This runs in non-interrupt * context, so can be preempted by H/W & S/W intr - * + * * @param[in] hdl OS handle * @param[in] work work instance * @param[in] func deferred function to run at bottom half non-interrupt * context. * @param[in] arg argument for the deferred function */ -static inline void +static inline void adf_os_init_work(adf_os_handle_t hdl, adf_os_work_t *work, adf_os_defer_fn_t func, void *arg) { @@ -129,11 +129,11 @@ adf_os_init_work(adf_os_handle_t hdl, adf_os_work_t *work, /** * @brief Schedule a deferred task on non-interrupt context - * + * * @param[in] hdl OS handle * @param[in] work work instance */ -static inline void +static inline void adf_os_sched_work(adf_os_handle_t hdl, adf_os_work_t *work) { __adf_os_sched_work(hdl, work); @@ -145,8 +145,8 @@ adf_os_sched_work(adf_os_handle_t hdl, adf_os_work_t *work) *@param[in] hdl OS handle *@param[in] work work instance */ -static inline void -adf_os_disable_work(adf_os_handle_t hdl, adf_os_work_t *work) +static inline void +adf_os_disable_work(adf_os_handle_t hdl, adf_os_work_t *work) { __adf_os_disable_work(hdl, work); } diff --git a/target_firmware/magpie_fw_dev/target/inc/adf_os_dma.h b/target_firmware/magpie_fw_dev/target/inc/adf_os_dma.h index f0979f6..782292a 100755 --- a/target_firmware/magpie_fw_dev/target/inc/adf_os_dma.h +++ b/target_firmware/magpie_fw_dev/target/inc/adf_os_dma.h @@ -55,13 +55,13 @@ * @param[in] size DMA buffer size * @param[in] coherent 0 => cached. * @param[out] dmap opaque coherent memory handle - * + * * @return returns the virtual address of the memory */ static inline void * -adf_os_dmamem_alloc(adf_os_device_t osdev, - adf_os_size_t size, - a_bool_t coherent, +adf_os_dmamem_alloc(adf_os_device_t osdev, + adf_os_size_t size, + a_bool_t coherent, adf_os_dma_map_t *dmap) { return __adf_os_dmamem_alloc(osdev, size, coherent, dmap); @@ -69,7 +69,7 @@ adf_os_dmamem_alloc(adf_os_device_t osdev, /** * @brief Free a previously mapped DMA buffer - * + * * @param[in] osdev platform device instance * @param[in] size DMA buffer size * @param[in] coherent 0 => cached. @@ -107,8 +107,8 @@ adf_os_dmamem_map2addr(adf_os_dma_map_t dmap) * @param[in] op op code for sync type, (see @ref adf_os_types.h) */ static inline void -adf_os_dmamem_cache_sync(adf_os_device_t osdev, - adf_os_dma_map_t dmap, +adf_os_dmamem_cache_sync(adf_os_device_t osdev, + adf_os_dma_map_t dmap, adf_os_cache_sync_t op) { __adf_os_dmamem_cache_sync(osdev, dmap, op); @@ -116,7 +116,7 @@ adf_os_dmamem_cache_sync(adf_os_device_t osdev, /** * @brief Get the cpu cache line size - * + * * @return The CPU cache line size in bytes. */ static inline adf_os_size_t diff --git a/target_firmware/magpie_fw_dev/target/inc/adf_os_lock.h b/target_firmware/magpie_fw_dev/target/inc/adf_os_lock.h index 72d3310..3828ea0 100755 --- a/target_firmware/magpie_fw_dev/target/inc/adf_os_lock.h +++ b/target_firmware/magpie_fw_dev/target/inc/adf_os_lock.h @@ -124,7 +124,7 @@ adf_os_spin_unlock_irq(adf_os_spinlock_t *lock, a_uint32_t *flags) /** * @brief locks the spinlock mutex in soft irq context - * + * * @param[in] lock spinlock object pointer */ static inline void @@ -136,7 +136,7 @@ adf_os_spin_lock_bh(adf_os_spinlock_t *lock) /** * @brief unlocks the spinlock mutex in soft irq context - * + * * @param[in] lock spinlock object pointer */ static inline void @@ -153,7 +153,7 @@ adf_os_spin_unlock_bh(adf_os_spinlock_t *lock) * @param[in] lock spinlock to be held for the critical region * @param[in] func critical region function that to be executed * @param[in] context context of the critical region function - * + * * @return Boolean status returned by the critical region function */ static inline a_bool_t diff --git a/target_firmware/magpie_fw_dev/target/inc/adf_os_mem.h b/target_firmware/magpie_fw_dev/target/inc/adf_os_mem.h index ec7691f..02c6d75 100755 --- a/target_firmware/magpie_fw_dev/target/inc/adf_os_mem.h +++ b/target_firmware/magpie_fw_dev/target/inc/adf_os_mem.h @@ -88,7 +88,7 @@ adf_os_mem_copy(void *dst, const void *src, adf_os_size_t size) * @param[in] src source address * @param[in] size buffer size */ -static inline void +static inline void adf_os_mem_move(void *dst, void *src, adf_os_size_t size) { __adf_os_mem_move(dst,src,size); @@ -97,7 +97,7 @@ adf_os_mem_move(void *dst, void *src, adf_os_size_t size) /** * @brief Fill a memory buffer - * + * * @param[in] buf buffer to be filled * @param[in] b byte to fill * @param[in] size buffer size @@ -111,7 +111,7 @@ adf_os_mem_set(void *buf, a_uint8_t b, adf_os_size_t size) /** * @brief Zero a memory buffer - * + * * @param[in] buf buffer to be zeroed * @param[in] size buffer size */ diff --git a/target_firmware/magpie_fw_dev/target/inc/adf_os_module.h b/target_firmware/magpie_fw_dev/target/inc/adf_os_module.h index ea8d32a..2ad690f 100755 --- a/target_firmware/magpie_fw_dev/target/inc/adf_os_module.h +++ b/target_firmware/magpie_fw_dev/target/inc/adf_os_module.h @@ -47,36 +47,36 @@ typedef a_status_t (*module_init_func_t)(void); /** * @brief Specify the module's entry point. - */ + */ #define adf_os_virt_module_init(_mod_init_func) __adf_os_virt_module_init(_mod_init_func) /** * @brief Specify the module's exit point. - */ + */ #define adf_os_virt_module_exit(_mod_exit_func) __adf_os_virt_module_exit(_mod_exit_func) /** * @brief Specify the module's dependency on another module. - */ + */ #define adf_os_module_dep(_name,_dep) __adf_os_module_dep(_name,_dep) /** * @brief Export a symbol from a module. - */ + */ #define adf_os_export_symbol(_sym) __adf_os_export_symbol(_sym) - + /** * @brief Module parameter of type integer. - */ + */ #define ADF_OS_PARAM_TYPE_INT32 __ADF_OS_PARAM_TYPE_INT32 /** * @brief Module parameter of type string. - */ + */ #define ADF_OS_PARAM_TYPE_STRING __ADF_OS_PARAM_TYPE_STRING /** - * @brief Declare a module parameter. + * @brief Declare a module parameter. * * @param[in] name name of the parameter * @param[in] type type of the parameter @@ -86,8 +86,8 @@ typedef a_status_t (*module_init_func_t)(void); * Only two types are supported * ADF_OS_PARAM_TYPE_STRING * ADF_OS_PARAM_TYPE_INT32 - * For example, say, the parameters name "my_int" and "my_name" are of - * variables of type int and string respectively. Then you would declare them + * For example, say, the parameters name "my_int" and "my_name" are of + * variables of type int and string respectively. Then you would declare them * as follows: * @code * adf_os_declare_param(my_int, ADF_OS_PARAM_TYPE_INT32); @@ -99,7 +99,7 @@ typedef a_status_t (*module_init_func_t)(void); * adf_os_read_param(my_name, &softc->sc_my_name); * @endcode * - * or + * or * @code * st = adf_os_read_param(my_int, &softc->sc_my_int); * @endcode diff --git a/target_firmware/magpie_fw_dev/target/inc/adf_os_pci.h b/target_firmware/magpie_fw_dev/target/inc/adf_os_pci.h index 274ae50..d8116e5 100755 --- a/target_firmware/magpie_fw_dev/target/inc/adf_os_pci.h +++ b/target_firmware/magpie_fw_dev/target/inc/adf_os_pci.h @@ -44,18 +44,18 @@ /** * @brief Define the entry point for the PCI module. - */ + */ #define adf_os_pci_module_init(_fn) __adf_os_pci_module_init(_fn) /** * @brief Define the exit point for the PCI module. - */ + */ #define adf_os_pci_module_exit(_fn) __adf_os_pci_module_exit(_fn) /** * @brief Setup the following driver information: name, PCI IDs of devices * supported and some device handlers. - */ + */ #define adf_os_pci_set_drv_info(_name, _pci_ids, _attach, _detach, _suspend, _resume) \ __adf_os_pci_set_drv_info(_name, _pci_ids, _attach, _detach, _suspend, _resume) @@ -67,8 +67,8 @@ * @param[out] val value read * * @return status of operation - */ -static inline int + */ +static inline int adf_os_pci_config_read8(adf_os_device_t osdev, int offset, a_uint8_t *val) { return __adf_os_pci_config_read8(osdev, offset, val); @@ -82,8 +82,8 @@ adf_os_pci_config_read8(adf_os_device_t osdev, int offset, a_uint8_t *val) * @param[in] val value to write * * @return status of operation - */ -static inline int + */ +static inline int adf_os_pci_config_write8(adf_os_device_t osdev, int offset, a_uint8_t val) { return __adf_os_pci_config_write8(osdev, offset, val); @@ -97,8 +97,8 @@ adf_os_pci_config_write8(adf_os_device_t osdev, int offset, a_uint8_t val) * @param[out] val value read * * @return status of operation - */ -static inline int + */ +static inline int adf_os_pci_config_read16(adf_os_device_t osdev, int offset, a_uint16_t *val) { return __adf_os_pci_config_read16(osdev, offset, val); @@ -112,8 +112,8 @@ adf_os_pci_config_read16(adf_os_device_t osdev, int offset, a_uint16_t *val) * @param[in] val value to write * * @return status of operation - */ -static inline int + */ +static inline int adf_os_pci_config_write16(adf_os_device_t osdev, int offset, a_uint16_t val) { return __adf_os_pci_config_write16(osdev, offset, val); @@ -127,8 +127,8 @@ adf_os_pci_config_write16(adf_os_device_t osdev, int offset, a_uint16_t val) * @param[out] val value read * * @return status of operation - */ -static inline int + */ +static inline int adf_os_pci_config_read32(adf_os_device_t osdev, int offset, a_uint32_t *val) { return __adf_os_pci_config_read32(osdev, offset, val); @@ -142,8 +142,8 @@ adf_os_pci_config_read32(adf_os_device_t osdev, int offset, a_uint32_t *val) * @param[in] val value to write * * @return status of operation - */ -static inline int + */ +static inline int adf_os_pci_config_write32(adf_os_device_t osdev, int offset, a_uint32_t val) { return __adf_os_pci_config_write32(osdev, offset, val); diff --git a/target_firmware/magpie_fw_dev/target/inc/adf_os_pseudo.h b/target_firmware/magpie_fw_dev/target/inc/adf_os_pseudo.h index 65bf1e8..69693f1 100755 --- a/target_firmware/magpie_fw_dev/target/inc/adf_os_pseudo.h +++ b/target_firmware/magpie_fw_dev/target/inc/adf_os_pseudo.h @@ -44,18 +44,18 @@ /** * @brief Specify the module's entry point. - */ + */ #define adf_os_pseudo_module_init(_fn) __adf_os_pseudo_module_init(_fn) /** * @brief Specify the module's exit point. - */ + */ #define adf_os_pseudo_module_exit(_fn) __adf_os_pseudo_module_exit(_fn) /** * @brief Setup the following driver information: name, pseudo IDs of devices * supported and some device handlers. - */ + */ #define adf_os_pseudo_set_drv_info(_name, _ifname, _pseudo_ids, _attach, _detach, \ _suspend, _resume) \ __adf_os_pseudo_set_drv_info(_name, _ifname, _pseudo_ids, \ diff --git a/target_firmware/magpie_fw_dev/target/inc/adf_os_stdtypes.h b/target_firmware/magpie_fw_dev/target/inc/adf_os_stdtypes.h index f8f3f45..e31a67a 100755 --- a/target_firmware/magpie_fw_dev/target/inc/adf_os_stdtypes.h +++ b/target_firmware/magpie_fw_dev/target/inc/adf_os_stdtypes.h @@ -34,7 +34,7 @@ */ /** * @defgroup adf_os_public OS abstraction API - */ + */ /** * @ingroup adf_os_public @@ -48,11 +48,11 @@ #include /** - * @brief basic data types. + * @brief basic data types. */ typedef enum { A_FALSE, - A_TRUE + A_TRUE }a_bool_t; typedef __a_uint8_t a_uint8_t; diff --git a/target_firmware/magpie_fw_dev/target/inc/adf_os_time.h b/target_firmware/magpie_fw_dev/target/inc/adf_os_time.h index 034bfe8..827120b 100755 --- a/target_firmware/magpie_fw_dev/target/inc/adf_os_time.h +++ b/target_firmware/magpie_fw_dev/target/inc/adf_os_time.h @@ -45,7 +45,7 @@ /** * @brief count the number of ticks elapsed from the time when * the system booted - * + * * @return ticks */ static inline unsigned long @@ -59,7 +59,7 @@ adf_os_ticks(void) * * @param[in] ticks number of ticks * @return time in milliseconds - */ + */ static inline a_uint32_t adf_os_ticks_to_msecs(unsigned long ticks) { @@ -71,7 +71,7 @@ adf_os_ticks_to_msecs(unsigned long ticks) * * @param[in] time in milliseconds * @return number of ticks - */ + */ static inline unsigned long adf_os_msecs_to_ticks(a_uint32_t msecs) { @@ -111,19 +111,19 @@ adf_os_mdelay(int msecs) /** * @brief Check if _a is later than _b. - */ + */ #define adf_os_time_after(_a, _b) __adf_os_time_after(_a, _b) /** * @brief Check if _a is prior to _b. - */ + */ #define adf_os_time_before(_a, _b) __adf_os_time_before(_a, _b) /** * @brief Check if _a atleast as recent as _b, if not later. - */ + */ #define adf_os_time_after_eq(_a, _b) __adf_os_time_after_eq(_a, _b) #endif - + diff --git a/target_firmware/magpie_fw_dev/target/inc/adf_os_timer.h b/target_firmware/magpie_fw_dev/target/inc/adf_os_timer.h index 81d4450..9e48cb2 100755 --- a/target_firmware/magpie_fw_dev/target/inc/adf_os_timer.h +++ b/target_firmware/magpie_fw_dev/target/inc/adf_os_timer.h @@ -53,7 +53,7 @@ typedef __adf_os_timer_t adf_os_timer_t; /** * @brief Initialize a timer - * + * * @param[in] hdl OS handle * @param[in] timer timer object pointer * @param[in] func timer function @@ -70,7 +70,7 @@ adf_os_timer_init(adf_os_handle_t hdl, /** * @brief Start a one-shot timer - * + * * @param[in] timer timer object pointer * @param[in] msec expiration period in milliseconds */ @@ -84,7 +84,7 @@ adf_os_timer_start(adf_os_timer_t *timer, int msec) * @brief Cancel a timer * * @param[in] timer timer object pointer - * + * * @retval TRUE timer was cancelled and deactived * @retval FALSE timer was cancelled but already got fired. */ diff --git a/target_firmware/magpie_fw_dev/target/inc/adf_os_types.h b/target_firmware/magpie_fw_dev/target/inc/adf_os_types.h index 109b7c4..44d77da 100755 --- a/target_firmware/magpie_fw_dev/target/inc/adf_os_types.h +++ b/target_firmware/magpie_fw_dev/target/inc/adf_os_types.h @@ -48,12 +48,12 @@ #define ADF_OS_MAX_SCATTER __ADF_OS_MAX_SCATTER /** * @brief Max number of scatter-gather segments. - */ + */ #define ADF_OS_MAX_SGLIST 4 /** * @brief denotes structure is packed. - */ + */ #define adf_os_packed __adf_os_packed /** @@ -86,34 +86,34 @@ typedef __adf_os_off_t adf_os_off_t; /** * @brief DMA mapping object. - */ + */ typedef __adf_os_dma_map_t adf_os_dma_map_t; /** * @brief DMA address. - */ + */ typedef __adf_os_dma_addr_t adf_os_dma_addr_t; /** * @brief DMA size. - */ + */ typedef __adf_os_dma_size_t adf_os_dma_size_t; /** * @brief Information inside a DMA map. - */ + */ typedef struct adf_os_dmamap_info{ a_uint32_t nsegs; /**< total number mapped segments*/ struct __dma_segs{ adf_os_dma_addr_t paddr; /**< physical(dma'able) address of the segment*/ adf_os_dma_size_t len; /**< length of the segment*/ - } dma_segs[ADF_OS_MAX_SCATTER]; + } dma_segs[ADF_OS_MAX_SCATTER]; }adf_os_dmamap_info_t; /** * @brief Representation of a scatter-gather list. - */ + */ typedef struct adf_os_sglist{ a_uint32_t nsegs; /**< total number of segments*/ struct __sg_segs{ @@ -133,7 +133,7 @@ typedef struct adf_os_sglist{ * operations, where reading a network packet or * storage sector corresponds to a read operation in * bus_dma. - * + * * ADF_SYNC_PREREAD Perform any synchronization * required prior to an update * of host memory by the DMA @@ -180,7 +180,7 @@ typedef enum { } a_status_t; /** - * @brief An ecore needs to provide a table of all pci device/vendor id's it + * @brief An ecore needs to provide a table of all pci device/vendor id's it * supports * * This table should be terminated by a NULL entry , i.e. {0} @@ -214,7 +214,7 @@ typedef enum { /** * @brief Representation of a h/w resource. - */ + */ typedef struct { a_uint64_t start; a_uint64_t end; @@ -225,7 +225,7 @@ typedef struct { /** * @brief Representation of bus registration data. - */ + */ typedef union { adf_os_pci_dev_id_t *pci; void *raw; @@ -233,7 +233,7 @@ typedef union { /** * @brief Representation of data required for attach. - */ + */ typedef union { adf_os_pci_dev_id_t pci; void *raw; @@ -243,7 +243,7 @@ typedef union { /** * @brief Types of buses. - */ + */ typedef enum { ADF_OS_BUS_TYPE_PCI = 1, ADF_OS_BUS_TYPE_GENERIC, @@ -251,7 +251,7 @@ typedef enum { /** * @brief IRQ handler response codes. - */ + */ typedef enum { ADF_OS_IRQ_NONE, ADF_OS_IRQ_HANDLED, @@ -259,7 +259,7 @@ typedef enum { /** * @brief DMA mask types. - */ + */ typedef enum { ADF_OS_DMA_MASK_32BIT, ADF_OS_DMA_MASK_64BIT, @@ -272,8 +272,8 @@ typedef enum { * ADF_OS_DMA_FROM_DEVICE (data going from memory to device) */ typedef enum { - ADF_OS_DMA_TO_DEVICE = __ADF_OS_DMA_TO_DEVICE, - ADF_OS_DMA_FROM_DEVICE = __ADF_OS_DMA_FROM_DEVICE, + ADF_OS_DMA_TO_DEVICE = __ADF_OS_DMA_TO_DEVICE, + ADF_OS_DMA_FROM_DEVICE = __ADF_OS_DMA_FROM_DEVICE, } adf_os_dma_dir_t; /* @@ -300,12 +300,12 @@ typedef void (*adf_os_timer_func_t)(void *); /** * @brief Prototype of IRQ function. - */ -typedef adf_os_irq_resp_t (*adf_os_drv_intr)(adf_drv_handle_t hdl); + */ +typedef adf_os_irq_resp_t (*adf_os_drv_intr)(adf_drv_handle_t hdl); /** * @brief The OS print routine. - */ + */ #define adf_os_print __adf_os_print /** @@ -316,8 +316,8 @@ typedef struct _adf_drv_info{ /** * @brief driver specific functions */ - adf_drv_handle_t (*drv_attach) (adf_os_resource_t *res, int count, - adf_os_attach_data_t *data, + adf_drv_handle_t (*drv_attach) (adf_os_resource_t *res, int count, + adf_os_attach_data_t *data, adf_os_device_t osdev); void (*drv_detach) (adf_drv_handle_t hdl); void (*drv_suspend) (adf_drv_handle_t hdl, adf_os_pm_t pm); diff --git a/target_firmware/magpie_fw_dev/target/inc/adf_os_util.h b/target_firmware/magpie_fw_dev/target/inc/adf_os_util.h index 5296f16..a9a13fc 100755 --- a/target_firmware/magpie_fw_dev/target/inc/adf_os_util.h +++ b/target_firmware/magpie_fw_dev/target/inc/adf_os_util.h @@ -54,40 +54,40 @@ #define adf_os_likely(_expr) __adf_os_likely(_expr) /** - * @brief read memory barrier. + * @brief read memory barrier. */ #define adf_os_wmb() __adf_os_wmb() /** - * @brief write memory barrier. + * @brief write memory barrier. */ #define adf_os_rmb() __adf_os_rmb() /** - * @brief read + write memory barrier. + * @brief read + write memory barrier. */ #define adf_os_mb() __adf_os_mb() /** * @brief return the lesser of a, b - */ + */ #define adf_os_min(_a, _b) __adf_os_min(_a, _b) /** * @brief return the larger of a, b - */ + */ #define adf_os_max(_a, _b) __adf_os_max(_a, _b) /** * @brief assert "expr" evaluates to true. - */ + */ #define adf_os_assert(expr) __adf_os_assert(expr) /** * @brief supply pseudo-random numbers */ -static inline void adf_os_get_rand(adf_os_handle_t hdl, - a_uint8_t *ptr, +static inline void adf_os_get_rand(adf_os_handle_t hdl, + a_uint8_t *ptr, a_uint32_t len) { __adf_os_get_rand(hdl, ptr, len); diff --git a/target_firmware/magpie_fw_dev/target/inc/k2/Magpie_api.h b/target_firmware/magpie_fw_dev/target/inc/k2/Magpie_api.h index c638b69..3093367 100755 --- a/target_firmware/magpie_fw_dev/target/inc/k2/Magpie_api.h +++ b/target_firmware/magpie_fw_dev/target/inc/k2/Magpie_api.h @@ -34,9 +34,9 @@ */ /* * @File: Magpie_api.h - * + * * @Abstract: Magpie FW api - * + * * @Notes: */ @@ -113,8 +113,8 @@ #define dma_lib_tx_init(eng_no, if_type) A_INDIR(dma_lib.tx_init(eng_no, if_type)) #define dma_lib_rx_init(eng_no, if_type) A_INDIR(dma_lib.rx_init(eng_no, if_type)) #define dma_lib_rx_config(eng_no, desc, gran) A_INDIR(dma_lib.rx_config(eng_no, desc, gran)) -#define dma_lib_tx_start(eng_no) A_INDIR(dma_lib.tx_start(eng_no)) -#define dma_lib_rx_start(eng_no) A_INDIR(dma_lib.rx_start(eng_no)) +#define dma_lib_tx_start(eng_no) A_INDIR(dma_lib.tx_start(eng_no)) +#define dma_lib_rx_start(eng_no) A_INDIR(dma_lib.rx_start(eng_no)) #define dma_lib_intr_status(if_type) A_INDIR(dma_lib.intr_status(if_type)) #define dma_lib_hard_xmit(eng_no, buf) A_INDIR(dma_lib.hard_xmit(eng_no, buf)) #define dma_lib_flush_xmit(eng_no) A_INDIR(dma_lib.flush_xmit(eng_no)) @@ -129,11 +129,11 @@ #define HIF_init(pConfig) A_INDIR(hif._init(pConfig)) #define HIF_shutdown(h) A_INDIR(hif._shutdown(h)) #define HIF_register_callback(h, pConfig) A_INDIR(hif._register_callback(h, pConfig)) -#define HIF_start(h) A_INDIR(hif._start(h)) -#define HIF_config_pipe(h, pipe, desc_list) A_INDIR(hif._config_pipe(h, pipe, desc_list)) -#define HIF_send_buffer(h, pipe, buf) A_INDIR(hif._send_buffer(h, pipe, buf)) -#define HIF_return_recv_buf(h, pipe, buf) A_INDIR(hif._return_recv_buf(h, pipe, buf)) -#define HIF_isr_handler(h) A_INDIR(hif._isr_handler(h)) +#define HIF_start(h) A_INDIR(hif._start(h)) +#define HIF_config_pipe(h, pipe, desc_list) A_INDIR(hif._config_pipe(h, pipe, desc_list)) +#define HIF_send_buffer(h, pipe, buf) A_INDIR(hif._send_buffer(h, pipe, buf)) +#define HIF_return_recv_buf(h, pipe, buf) A_INDIR(hif._return_recv_buf(h, pipe, buf)) +#define HIF_isr_handler(h) A_INDIR(hif._isr_handler(h)) #define HIF_is_pipe_supported(h, pipe) A_INDIR(hif._is_pipe_supported(h, pipe)) #define HIF_get_max_msg_len(h, pipe) A_INDIR(hif._get_max_msg_len(h, pipe)) #define HIF_get_reserved_headroom(h) A_INDIR(hif._get_reserved_headroom(h)) @@ -163,7 +163,7 @@ #define HTC_GetReservedHeadroom(h) A_INDIR(htc._HTC_GetReservedHeadroom(h)) #define HTC_NotifyTargetInserted(h) -#define HTC_NotifyTargetDetached(h) +#define HTC_NotifyTargetDetached(h) /* WMI SVC module */ #define WMI_SERVICE_MODULE_INSTALL() WMI_service_module_install(&_A_MAGPIE_INDIRECTION_TABLE->wmi_svc_api) @@ -205,7 +205,7 @@ typedef struct _A_magpie_indirection_table { struct sflash_api sflash; struct hif_api hif; struct htc_apis htc; - WMI_SVC_APIS wmi_svc_api; + WMI_SVC_APIS wmi_svc_api; struct usbfifo_api usbfifo_api; struct buf_pool_api buf_pool; struct vbuf_api vbuf; diff --git a/target_firmware/magpie_fw_dev/target/inc/k2/allocram_api.h b/target_firmware/magpie_fw_dev/target/inc/k2/allocram_api.h index 4a849a8..551d709 100755 --- a/target_firmware/magpie_fw_dev/target/inc/k2/allocram_api.h +++ b/target_firmware/magpie_fw_dev/target/inc/k2/allocram_api.h @@ -71,7 +71,7 @@ struct allocram_api { * be set to 0 -- only a single arena is currently supported. */ void *(* cmnos_allocram)(void *which_arena, A_UINT32 nbytes); - + void (* cmnos_allocram_debug)(void); }; diff --git a/target_firmware/magpie_fw_dev/target/inc/k2/athos_api.h b/target_firmware/magpie_fw_dev/target/inc/k2/athos_api.h index 01f75aa..93188fb 100755 --- a/target_firmware/magpie_fw_dev/target/inc/k2/athos_api.h +++ b/target_firmware/magpie_fw_dev/target/inc/k2/athos_api.h @@ -82,7 +82,7 @@ struct _A_os_linkage_check { int table; }; -/* +/* * A_INIT() handles any initialization needed by the OS abstraction, * and it clears the application's BSS, if necessary. (Application BSS * is not cleared if the application is linked into a single image that @@ -96,7 +96,7 @@ A_INIT(void) { struct _A_os_linkage_check link_check; unsigned int *clrptr; - + if (&START_BSS != _A_MAGPIE_INDIRECTION_TABLE->cmnos.start_bss) { /* Clear BSS */ for (clrptr = &START_BSS; clrptr < &END_BSS; clrptr++) { diff --git a/target_firmware/magpie_fw_dev/target/inc/k2/cmnos_api.h b/target_firmware/magpie_fw_dev/target/inc/k2/cmnos_api.h index 6bd18fb..6814901 100755 --- a/target_firmware/magpie_fw_dev/target/inc/k2/cmnos_api.h +++ b/target_firmware/magpie_fw_dev/target/inc/k2/cmnos_api.h @@ -449,10 +449,10 @@ do { \ A_CMN(timer._timer_run()) #define A_PCI_BOOT_INIT() \ - A_CMN(pci.pci_boot_init()) + A_CMN(pci.pci_boot_init()) #define A_GMAC_BOOT_INIT() \ - A_CMN(gmac.gmac_boot_init()) + A_CMN(gmac.gmac_boot_init()) #if SYSTEM_MODULE_ALLOCRAM /* Default size of ALLOCRAM area */ diff --git a/target_firmware/magpie_fw_dev/target/inc/k2/dma_engine_api.h b/target_firmware/magpie_fw_dev/target/inc/k2/dma_engine_api.h index fad2016..e57c5e0 100755 --- a/target_firmware/magpie_fw_dev/target/inc/k2/dma_engine_api.h +++ b/target_firmware/magpie_fw_dev/target/inc/k2/dma_engine_api.h @@ -34,9 +34,9 @@ */ /* * @File: dma_engine_api.h - * + * * @Abstract: DMA Engine api - * + * * @Notes: */ @@ -75,44 +75,44 @@ struct zsTxDmaQueue { struct zsDmaDesc* head; struct zsDmaDesc* terminator; - + /* Below are fields specific to TX */ VBUF *xmited_buf_head; - VBUF *xmited_buf_tail; + VBUF *xmited_buf_tail; }; /* hardware API table structure (API descriptions below) */ -struct dma_engine_api +struct dma_engine_api { void (*_init)(); void (*_init_rx_queue)(struct zsDmaQueue *q); - + void (*_init_tx_queue)(struct zsTxDmaQueue *q); - + void (*_config_rx_queue)(struct zsDmaQueue *q, int num_desc, int buf_size); - + void (*_xmit_buf)(struct zsTxDmaQueue *q, VBUF *buf); - + void (*_flush_xmit)(struct zsDmaQueue *q); - + VBUF* (*_reap_recv_buf)(struct zsDmaQueue *q); - + void (*_return_recv_buf)(struct zsDmaQueue *q, VBUF *buf); - + VBUF* (*_reap_xmited_buf)(struct zsTxDmaQueue *q); - + void (*_swap_data)(struct zsDmaDesc* desc); - + int (*_has_compl_packets)(struct zsDmaQueue *q); - + void (*_desc_dump)(struct zsDmaQueue *q); - + /* The functions below are for patchable */ struct zsDmaDesc* (*_get_packet)(struct zsDmaQueue* q); void (*_reclaim_packet)(struct zsDmaQueue* q, struct zsDmaDesc* desc); void (*_put_packet)(struct zsDmaQueue* q, struct zsDmaDesc* desc); - + /* room to expand this table by another table */ void *pReserved; }; diff --git a/target_firmware/magpie_fw_dev/target/inc/k2/dma_lib.h b/target_firmware/magpie_fw_dev/target/inc/k2/dma_lib.h index 983e8b3..8b89d87 100755 --- a/target_firmware/magpie_fw_dev/target/inc/k2/dma_lib.h +++ b/target_firmware/magpie_fw_dev/target/inc/k2/dma_lib.h @@ -68,7 +68,7 @@ struct dma_lib_api{ A_UINT16 (*rx_init)(dma_engine_t eng_no, dma_iftype_t if_type); void (*rx_config)(dma_engine_t eng_no, a_uint16_t num_desc, a_uint16_t gran); - void (*rx_start)(dma_engine_t eng_no); + void (*rx_start)(dma_engine_t eng_no); A_UINT32 (*intr_status)(dma_iftype_t if_type); A_UINT16 (*hard_xmit)(dma_engine_t eng_no, VBUF *buf); void (*flush_xmit)(dma_engine_t eng_no); @@ -83,7 +83,7 @@ struct dma_lib_api{ /** * @brief Install the DMA lib api's this for ROM patching * support - * + * * @param apis */ void dma_lib_module_install(struct dma_lib_api *apis); diff --git a/target_firmware/magpie_fw_dev/target/inc/k2/eeprom_api.h b/target_firmware/magpie_fw_dev/target/inc/k2/eeprom_api.h index b340f35..67191be 100755 --- a/target_firmware/magpie_fw_dev/target/inc/k2/eeprom_api.h +++ b/target_firmware/magpie_fw_dev/target/inc/k2/eeprom_api.h @@ -36,13 +36,13 @@ #define __EEPROM_API_H__ typedef enum { - RET_SUCCESS = 0, + RET_SUCCESS = 0, RET_NOT_INIT, RET_NOT_EXIST, RET_EEP_CORRUPT, RET_EEP_OVERFLOW, - - // add return code from here + + // add return code from here RET_UNKNOWN } T_EEP_RET; diff --git a/target_firmware/magpie_fw_dev/target/inc/k2/hif_api.h b/target_firmware/magpie_fw_dev/target/inc/k2/hif_api.h index a47a483..ff18226 100755 --- a/target_firmware/magpie_fw_dev/target/inc/k2/hif_api.h +++ b/target_firmware/magpie_fw_dev/target/inc/k2/hif_api.h @@ -34,9 +34,9 @@ */ /* * @File: HIF_api.h - * + * * @Abstract: Host Interface api - * + * * @Notes: */ @@ -64,33 +64,33 @@ typedef void* hif_handle_t; /* hardware API table structure (API descriptions below) */ struct hif_api { hif_handle_t (*_init)(HIF_CONFIG *pConfig); - + void (* _shutdown)(hif_handle_t); - + void (*_register_callback)(hif_handle_t, HIF_CALLBACK *); - + int (*_get_total_credit_count)(hif_handle_t); - + void (*_start)(hif_handle_t); void (*_config_pipe)(hif_handle_t handle, int pipe, int creditCount); - + int (*_send_buffer)(hif_handle_t handle, int pipe, adf_nbuf_t buf); - void (*_return_recv_buf)(hif_handle_t handle, int pipe, adf_nbuf_t buf); + void (*_return_recv_buf)(hif_handle_t handle, int pipe, adf_nbuf_t buf); //void (*_set_recv_bufsz)(int pipe, int bufsz); //void (*_pause_recv)(int pipe); //void (*_resume_recv)(int pipe); int (*_is_pipe_supported)(hif_handle_t handle, int pipe); - + int (*_get_max_msg_len)(hif_handle_t handle, int pipe); - + int (*_get_reserved_headroom)(hif_handle_t handle); - + void (*_isr_handler)(hif_handle_t handle); - + void (*_get_default_pipe)(hif_handle_t handle, A_UINT8 *pipe_uplink, A_UINT8 *pipe_downlink); - + /* room to expand this table by another table */ void *pReserved; }; diff --git a/target_firmware/magpie_fw_dev/target/inc/k2/hif_gmac.h b/target_firmware/magpie_fw_dev/target/inc/k2/hif_gmac.h index 9625dca..4e1714f 100755 --- a/target_firmware/magpie_fw_dev/target/inc/k2/hif_gmac.h +++ b/target_firmware/magpie_fw_dev/target/inc/k2/hif_gmac.h @@ -50,7 +50,7 @@ #define ATH_P_MAGNORM 0x13 /*Magpie GMAC 19 for HTC & others*/ #define ETH_P_ATH 0x88bd - + typedef enum hif_gmac_pipe{ HIF_GMAC_PIPE_RX = 1, /*Normal Priority RX*/ HIF_GMAC_PIPE_TX = 2, /*Normal Priority TX*/ diff --git a/target_firmware/magpie_fw_dev/target/inc/k2/hif_pci.h b/target_firmware/magpie_fw_dev/target/inc/k2/hif_pci.h index 40d96b5..eb85897 100755 --- a/target_firmware/magpie_fw_dev/target/inc/k2/hif_pci.h +++ b/target_firmware/magpie_fw_dev/target/inc/k2/hif_pci.h @@ -39,8 +39,8 @@ #define PCI_MAX_PKT_LEN 1600 -#define PCI_MAX_DESC 2 - +#define PCI_MAX_DESC 2 + typedef enum hif_pci_pipe_rx{ HIF_PCI_PIPE_RX0, /*Normal Priority RX*/ HIF_PCI_PIPE_RX1, diff --git a/target_firmware/magpie_fw_dev/target/inc/k2/k2/rom_cfg.h b/target_firmware/magpie_fw_dev/target/inc/k2/k2/rom_cfg.h index 3ff173a..2ff05de 100755 --- a/target_firmware/magpie_fw_dev/target/inc/k2/k2/rom_cfg.h +++ b/target_firmware/magpie_fw_dev/target/inc/k2/k2/rom_cfg.h @@ -49,7 +49,7 @@ #define _ROM_CFG_H_ /************************** FPGA version **************************/ -#define MAGPIE_FPGA_RAM_256K 0 +#define MAGPIE_FPGA_RAM_256K 0 /************************** SYSTEM WIDE ***************************/ /* Release Code : @@ -210,7 +210,7 @@ typedef enum { #define WATCH_DOG_MAGIC_PATTERN_ADDR (SYS_D_RAM_REGION_0_BASE+SYS_RAM_SZIE-0x4) // 0x53fffc,magic pattern address #define WATCH_DOG_RESET_COUNTER_ADDR (SYS_D_RAM_REGION_0_BASE+SYS_RAM_SZIE-0x8) // 0x53fff8,record the reset counter #define DEBUG_SYSTEM_STATE_ADDR (SYS_D_RAM_REGION_0_BASE+SYS_RAM_SZIE-0xc) // 0x53fff4,record the state of system -#define CURRENT_PROGRAM_ADDR (SYS_D_RAM_REGION_0_BASE+SYS_RAM_SZIE-0x10) // 0x53fff0,reserved +#define CURRENT_PROGRAM_ADDR (SYS_D_RAM_REGION_0_BASE+SYS_RAM_SZIE-0x10) // 0x53fff0,reserved #define WATCH_DOG_MAGIC_PATTERN (*((volatile u32_t*)(WATCH_DOG_MAGIC_PATTERN_ADDR))) #define WATCH_DOG_RESET_COUNTER (*((volatile u32_t*)(WATCH_DOG_RESET_COUNTER_ADDR))) diff --git a/target_firmware/magpie_fw_dev/target/inc/k2/k2_mem.h b/target_firmware/magpie_fw_dev/target/inc/k2/k2_mem.h index 830a073..c0aba81 100755 --- a/target_firmware/magpie_fw_dev/target/inc/k2/k2_mem.h +++ b/target_firmware/magpie_fw_dev/target/inc/k2/k2_mem.h @@ -59,15 +59,15 @@ /* instruction port area */ #define SYS_I_R0M_REGION_0_BASE 0x8e0000 - + #define SYS_I_RAM_REGION_0_BASE 0x900000 #define SYS_I_RAM_REGION_1_BASE (SYS_I_RAM_REGION_0_BASE+SYS_RAM_BLOCK_SIZE) #define SYS_I_RAM_REGION_2_BASE (SYS_I_RAM_REGION_1_BASE+SYS_RAM_BLOCK_SIZE) #define SYS_I_RAM_REGION_3_BASE (SYS_I_RAM_REGION_2_BASE+SYS_RAM_BLOCK_SIZE) - -/* data port area */ + +/* data port area */ #define SYS_D_R0M_REGION_0_BASE 0x4e0000 - + #define SYS_D_RAM_REGION_0_BASE 0x500000 #define SYS_D_RAM_REGION_1_BASE (SYS_D_RAM_REGION_0_BASE+SYS_RAM_BLOCK_SIZE) #define SYS_D_RAM_REGION_2_BASE (SYS_D_RAM_REGION_1_BASE+SYS_RAM_BLOCK_SIZE) @@ -106,7 +106,7 @@ #define USB_DEVICE_PID_SIZE 1 // PID SIZE, 1 halfword offset #define USB_DEVICE_VID_SIZE 1 // VID SIZE, 1 halfword offset - + #define USB_DESC_IN_EEPROM_FLAG_OFFSET USB_DESCRIPTOR_ADDR #define USB_DEVICE_DESCRIPTOR_OFFSET (USB_DESC_IN_EEPROM_FLAG_OFFSET+USB_DESC_IN_EEPROM_SIZE) #define USB_STRING00_DESCRIPTOR_OFFSET (USB_DEVICE_DESCRIPTOR_OFFSET+USB_DEVICE_DESCRIPTOR_SIZE) diff --git a/target_firmware/magpie_fw_dev/target/inc/k2/magpie_mem.h b/target_firmware/magpie_fw_dev/target/inc/k2/magpie_mem.h index fcef691..651f94c 100755 --- a/target_firmware/magpie_fw_dev/target/inc/k2/magpie_mem.h +++ b/target_firmware/magpie_fw_dev/target/inc/k2/magpie_mem.h @@ -49,16 +49,16 @@ #define _MEM_ADDRS_H_ #define SYS_ROM_BLOCK_SIZE (32*1024) -#if MAGPIE_FPGA_RAM_256K == 1 +#if MAGPIE_FPGA_RAM_256K == 1 #define SYS_ROM_BLOCK_NUM 2 //ram 256K version is also rom 64k version #else #define SYS_ROM_BLOCK_NUM 3 #endif #define SYS_ROM_SIZE (SYS_ROM_BLOCK_SIZE*SYS_ROM_BLOCK_NUM) - + #if MAGPIE_FPGA_RAM_256K == 1 #define SYS_RAM_BLOCK_SIZE 64*1024 -#else +#else #define SYS_RAM_BLOCK_SIZE 40*1024 #endif @@ -67,15 +67,15 @@ /* instruction port area */ #define SYS_I_R0M_REGION_0_BASE 0x8e0000 - + #define SYS_I_RAM_REGION_0_BASE 0x900000 #define SYS_I_RAM_REGION_1_BASE (SYS_I_RAM_REGION_0_BASE+SYS_RAM_BLOCK_SIZE) #define SYS_I_RAM_REGION_2_BASE (SYS_I_RAM_REGION_1_BASE+SYS_RAM_BLOCK_SIZE) #define SYS_I_RAM_REGION_3_BASE (SYS_I_RAM_REGION_2_BASE+SYS_RAM_BLOCK_SIZE) - -/* data port area */ + +/* data port area */ #define SYS_D_R0M_REGION_0_BASE 0x4e0000 - + #define SYS_D_RAM_REGION_0_BASE 0x500000 #define SYS_D_RAM_REGION_1_BASE (SYS_D_RAM_REGION_0_BASE+SYS_RAM_BLOCK_SIZE) #define SYS_D_RAM_REGION_2_BASE (SYS_D_RAM_REGION_1_BASE+SYS_RAM_BLOCK_SIZE) @@ -109,7 +109,7 @@ #define USB_DEVICE_PID_SIZE 1 // PID SIZE, 1 halfword offset #define USB_DEVICE_VID_SIZE 1 // VID SIZE, 1 halfword offset - + #define USB_DESC_IN_EEPROM_FLAG_OFFSET USB_DESCRIPTOR_ADDR #define USB_DEVICE_DESCRIPTOR_OFFSET (USB_DESC_IN_EEPROM_FLAG_OFFSET+USB_DESC_IN_EEPROM_SIZE) #define USB_STRING00_DESCRIPTOR_OFFSET (USB_DEVICE_DESCRIPTOR_OFFSET+USB_DEVICE_DESCRIPTOR_SIZE) diff --git a/target_firmware/magpie_fw_dev/target/inc/k2/magpie_regdump.h b/target_firmware/magpie_fw_dev/target/inc/k2/magpie_regdump.h index 5370727..5622d8b 100755 --- a/target_firmware/magpie_fw_dev/target/inc/k2/magpie_regdump.h +++ b/target_firmware/magpie_fw_dev/target/inc/k2/magpie_regdump.h @@ -64,7 +64,7 @@ struct XTensa_exception_frame_s { } wb[MAGPIE_REGDUMP_FRAMES]; }; -typedef struct XTensa_exception_frame_s CPU_exception_frame_t; +typedef struct XTensa_exception_frame_s CPU_exception_frame_t; #define RD_SIZE sizeof(CPU_exception_frame_t) #endif diff --git a/target_firmware/magpie_fw_dev/target/inc/k2/regdump.h b/target_firmware/magpie_fw_dev/target/inc/k2/regdump.h index 7b570a4..b5cd6ab 100755 --- a/target_firmware/magpie_fw_dev/target/inc/k2/regdump.h +++ b/target_firmware/magpie_fw_dev/target/inc/k2/regdump.h @@ -44,7 +44,7 @@ * XTensa CPU state * This must match the state saved by the target exception handler. */ - + #define RD_SIZE sizeof(CPU_exception_frame_t) /* diff --git a/target_firmware/magpie_fw_dev/target/inc/k2/sys_cfg.h b/target_firmware/magpie_fw_dev/target/inc/k2/sys_cfg.h index 41198b8..55bcf1a 100755 --- a/target_firmware/magpie_fw_dev/target/inc/k2/sys_cfg.h +++ b/target_firmware/magpie_fw_dev/target/inc/k2/sys_cfg.h @@ -56,8 +56,8 @@ #if defined(_ROM_) #include "rom_cfg.h" -#if MAGPIE_FPGA_RAM_256K == 1 -#undef MAX_BUF_NUM +#if MAGPIE_FPGA_RAM_256K == 1 +#undef MAX_BUF_NUM #define MAX_BUF_NUM 100 #endif @@ -76,13 +76,13 @@ #endif #undef SYSTEM_MODULE_DBG -#undef MOVE_PRINT_TO_RAM +#undef MOVE_PRINT_TO_RAM #ifdef _DEBUG_BUILD_ #define SYSTEM_MODULE_DBG 1 #define MOVE_PRINT_TO_RAM 1 #else #define SYSTEM_MODULE_DBG 0 -#define MOVE_PRINT_TO_RAM 1 +#define MOVE_PRINT_TO_RAM 1 #endif #undef SYSTEM_MODULE_SFLASH #define SYSTEM_MODULE_SFLASH 0 diff --git a/target_firmware/magpie_fw_dev/target/inc/k2/vbuf_api.h b/target_firmware/magpie_fw_dev/target/inc/k2/vbuf_api.h index d818301..c0f5006 100755 --- a/target_firmware/magpie_fw_dev/target/inc/k2/vbuf_api.h +++ b/target_firmware/magpie_fw_dev/target/inc/k2/vbuf_api.h @@ -34,9 +34,9 @@ */ /* * @File: VBUF_api.h - * + * * @Abstract: Host Interface api - * + * * @Notes: */ @@ -50,10 +50,10 @@ typedef struct _VBUF { VDESC *desc_list; - struct _VBUF *next_buf; - A_UINT16 buf_length; + struct _VBUF *next_buf; + A_UINT16 buf_length; A_UINT8 reserved[2]; - A_UINT8 ctx[MAX_BUF_CTX_LEN]; + A_UINT8 ctx[MAX_BUF_CTX_LEN]; } VBUF; #define VBUF_GET_DATA_ADDR(vbuf) (vbuf->desc_list->buf_addr + vbuf->desc_list->data_offset) @@ -66,7 +66,7 @@ struct vbuf_api { void (*_free_vbuf)(VBUF *buf); /* room to expand this table by another table */ - void *pReserved; + void *pReserved; }; extern void vbuf_module_install(struct vbuf_api *apis); diff --git a/target_firmware/magpie_fw_dev/target/inc/k2/vdesc_api.h b/target_firmware/magpie_fw_dev/target/inc/k2/vdesc_api.h index 3876889..8929e1a 100755 --- a/target_firmware/magpie_fw_dev/target/inc/k2/vdesc_api.h +++ b/target_firmware/magpie_fw_dev/target/inc/k2/vdesc_api.h @@ -34,9 +34,9 @@ */ /* * @File: VBUF_api.h - * + * * @Abstract: Host Interface api - * + * * @Notes: */ @@ -53,7 +53,7 @@ typedef struct _VDESC A_UINT16 data_offset; A_UINT16 data_size; A_UINT16 control; - A_UINT8 hw_desc_buf[MAX_HW_DESC_SIZE]; + A_UINT8 hw_desc_buf[MAX_HW_DESC_SIZE]; } VDESC; #define VDESC_HW_TO_VDESC(hwdesc) ((VDESC *)(((A_UINT32 *)hwdesc - 4))) @@ -65,9 +65,9 @@ struct vdesc_api { void (*_swap_vdesc)(VDESC *dest, VDESC *src); /* room to expand this table by another table */ - void *pReserved; + void *pReserved; }; extern void vdesc_module_install(struct vdesc_api *apis); -#endif +#endif diff --git a/target_firmware/magpie_fw_dev/target/inc/magpie/Magpie_api.h b/target_firmware/magpie_fw_dev/target/inc/magpie/Magpie_api.h index 5103d64..c28f5a8 100755 --- a/target_firmware/magpie_fw_dev/target/inc/magpie/Magpie_api.h +++ b/target_firmware/magpie_fw_dev/target/inc/magpie/Magpie_api.h @@ -34,9 +34,9 @@ */ /* * @File: Magpie_api.h - * + * * @Abstract: Magpie FW api - * + * * @Notes: */ @@ -115,8 +115,8 @@ #define dma_lib_tx_init(eng_no, if_type) A_INDIR(dma_lib.tx_init(eng_no, if_type)) #define dma_lib_rx_init(eng_no, if_type) A_INDIR(dma_lib.rx_init(eng_no, if_type)) #define dma_lib_rx_config(eng_no, desc, gran) A_INDIR(dma_lib.rx_config(eng_no, desc, gran)) -#define dma_lib_tx_start(eng_no) A_INDIR(dma_lib.tx_start(eng_no)) -#define dma_lib_rx_start(eng_no) A_INDIR(dma_lib.rx_start(eng_no)) +#define dma_lib_tx_start(eng_no) A_INDIR(dma_lib.tx_start(eng_no)) +#define dma_lib_rx_start(eng_no) A_INDIR(dma_lib.rx_start(eng_no)) #define dma_lib_intr_status(if_type) A_INDIR(dma_lib.intr_status(if_type)) #define dma_lib_hard_xmit(eng_no, buf) A_INDIR(dma_lib.hard_xmit(eng_no, buf)) #define dma_lib_flush_xmit(eng_no) A_INDIR(dma_lib.flush_xmit(eng_no)) @@ -142,11 +142,11 @@ #define HIF_init(pConfig) A_INDIR(hif._init(pConfig)) #define HIF_shutdown(h) A_INDIR(hif._shutdown(h)) #define HIF_register_callback(h, pConfig) A_INDIR(hif._register_callback(h, pConfig)) -#define HIF_start(h) A_INDIR(hif._start(h)) -#define HIF_config_pipe(h, pipe, desc_list) A_INDIR(hif._config_pipe(h, pipe, desc_list)) -#define HIF_send_buffer(h, pipe, buf) A_INDIR(hif._send_buffer(h, pipe, buf)) -#define HIF_return_recv_buf(h, pipe, buf) A_INDIR(hif._return_recv_buf(h, pipe, buf)) -#define HIF_isr_handler(h) A_INDIR(hif._isr_handler(h)) +#define HIF_start(h) A_INDIR(hif._start(h)) +#define HIF_config_pipe(h, pipe, desc_list) A_INDIR(hif._config_pipe(h, pipe, desc_list)) +#define HIF_send_buffer(h, pipe, buf) A_INDIR(hif._send_buffer(h, pipe, buf)) +#define HIF_return_recv_buf(h, pipe, buf) A_INDIR(hif._return_recv_buf(h, pipe, buf)) +#define HIF_isr_handler(h) A_INDIR(hif._isr_handler(h)) #define HIF_is_pipe_supported(h, pipe) A_INDIR(hif._is_pipe_supported(h, pipe)) #define HIF_get_max_msg_len(h, pipe) A_INDIR(hif._get_max_msg_len(h, pipe)) #define HIF_get_reserved_headroom(h) A_INDIR(hif._get_reserved_headroom(h)) @@ -181,7 +181,7 @@ typedef void (*HIF_INSTALL_FUNC_T)(struct hif_api *apis); #define HTC_GetReservedHeadroom(h) A_INDIR(htc._HTC_GetReservedHeadroom(h)) #define HTC_NotifyTargetInserted(h) -#define HTC_NotifyTargetDetached(h) +#define HTC_NotifyTargetDetached(h) /* WMI SVC module */ #define WMI_SERVICE_MODULE_INSTALL() WMI_service_module_install(&_A_MAGPIE_INDIRECTION_TABLE->wmi_svc_api) @@ -225,14 +225,14 @@ typedef struct _A_magpie_indirection_table { //#endif struct hif_api hif; struct htc_apis htc; - WMI_SVC_APIS wmi_svc_api; + WMI_SVC_APIS wmi_svc_api; struct usbfifo_api usbfifo_api; struct buf_pool_api buf_pool; -#ifdef MAGPIE_FW_BUILD +#ifdef MAGPIE_FW_BUILD struct vbuf_api vbuf; struct vdesc_api vdesc; struct allocram_api allocram; -#endif +#endif struct dma_engine_api dma_engine; struct dma_lib_api dma_lib; diff --git a/target_firmware/magpie_fw_dev/target/inc/magpie/adf_nbuf_pvt.h b/target_firmware/magpie_fw_dev/target/inc/magpie/adf_nbuf_pvt.h index 8c5f406..9e21e17 100755 --- a/target_firmware/magpie_fw_dev/target/inc/magpie/adf_nbuf_pvt.h +++ b/target_firmware/magpie_fw_dev/target/inc/magpie/adf_nbuf_pvt.h @@ -34,7 +34,7 @@ */ /* * (c) Copyright Atheros Communications - * FreeBSD specific prototypes + * FreeBSD specific prototypes */ #ifndef _ADF_NBUF_PVT_H #define _ADF_NBUF_PVT_H @@ -45,7 +45,7 @@ //#include #define __ADF_NBUF_NULL NULL -#define __ADF_NBUF_CTX_BUF +#define __ADF_NBUF_CTX_BUF typedef VBUF * __adf_nbuf_t; @@ -54,101 +54,101 @@ typedef VBUF * __adf_nbuf_t; */ typedef struct __adf_nbuf_qhead { VBUF *head; - VBUF *tail; + VBUF *tail; a_uint32_t qlen; }__adf_nbuf_qhead_t; typedef __adf_nbuf_qhead_t __adf_nbuf_queue_t; -__adf_nbuf_t -__adf_nbuf_alloc(adf_os_size_t size, - a_uint32_t reserve, a_uint32_t align); +__adf_nbuf_t +__adf_nbuf_alloc(adf_os_size_t size, + a_uint32_t reserve, a_uint32_t align); -void +void __adf_nbuf_free(__adf_nbuf_t buf); #ifndef _ROM_ -a_uint8_t * +a_uint8_t * __adf_nbuf_push_head(__adf_nbuf_t buf, adf_os_size_t size); - -a_uint8_t * + +a_uint8_t * __adf_nbuf_pull_head(__adf_nbuf_t buf, adf_os_size_t size); -a_uint8_t * +a_uint8_t * __adf_nbuf_put_tail(__adf_nbuf_t buf, adf_os_size_t size); #endif -void +void __adf_nbuf_trim_tail(__adf_nbuf_t buf, adf_os_size_t size); -__adf_nbuf_t +__adf_nbuf_t __adf_nbuf_realloc_headroom(__adf_nbuf_t buf, - a_uint32_t headroom); - -__adf_nbuf_t -__adf_nbuf_realloc_tailroom(__adf_nbuf_t buf, + a_uint32_t headroom); + +__adf_nbuf_t +__adf_nbuf_realloc_tailroom(__adf_nbuf_t buf, a_uint32_t tailroom); - -__adf_nbuf_t + +__adf_nbuf_t __adf_nbuf_expand(__adf_nbuf_t buf, a_uint32_t headroom, a_uint32_t tailroom); - -__adf_nbuf_t + +__adf_nbuf_t __adf_nbuf_copy(__adf_nbuf_t src); -__adf_nbuf_t +__adf_nbuf_t __adf_nbuf_unshare(__adf_nbuf_t src); -void +void __adf_nbuf_frag_info(__adf_nbuf_t buf, adf_os_sglist_t *sg); #ifndef _ROM_ -a_uint8_t * +a_uint8_t * __adf_nbuf_get_priv(__adf_nbuf_t buf); #endif -void -__adf_nbuf_queue_add(__adf_nbuf_qhead_t *qhead, +void +__adf_nbuf_queue_add(__adf_nbuf_qhead_t *qhead, __adf_nbuf_t buf); - -__adf_nbuf_t + +__adf_nbuf_t __adf_nbuf_queue_remove(__adf_nbuf_qhead_t *qhead); -a_uint32_t -__adf_nbuf_tx_cksum_info(__adf_nbuf_t buf, - a_uint8_t **hdr_off, +a_uint32_t +__adf_nbuf_tx_cksum_info(__adf_nbuf_t buf, + a_uint8_t **hdr_off, a_uint8_t **where); - -void + +void __adf_nbuf_set_rx_cksum(__adf_nbuf_t buf, adf_nbuf_rx_cksum_t *cksum); -void +void __adf_nbuf_get_tso_info(__adf_nbuf_t buf, adf_nbuf_tso_t *tso); -a_status_t -__adf_nbuf_get_vlan_info(adf_net_handle_t hdl, - __adf_nbuf_t buf, - adf_net_vlanhdr_t *vlan); - -void +a_status_t +__adf_nbuf_get_vlan_info(adf_net_handle_t hdl, + __adf_nbuf_t buf, + adf_net_vlanhdr_t *vlan); + +void __adf_nbuf_dmamap_info(__adf_os_dma_map_t bmap, adf_os_dmamap_info_t *sg); /** * @brief return the last mbuf - * + * * @param m0 - * + * * @return struct mbuf* */ #ifndef _ROM_ -VDESC * +VDESC * __adf_nbuf_last(VBUF *buf); #endif /** * @brief num bytes in the head - * + * * @param adf_nbuf - * + * * @return num of bytes available */ #ifndef _ROM_ @@ -159,23 +159,23 @@ __adf_nbuf_headroom(__adf_nbuf_t buf); /** * @brief num of bytes available in the tail excluding the priv * portion - * + * * @param adf_nbuf - * + * * @return num of bytes */ #ifndef _ROM_ -a_uint32_t +a_uint32_t __adf_nbuf_tailroom(__adf_nbuf_t buf); #endif /** * @brief get the entire packet length - * + * * @param adf_nbuf - * + * * @return total length of packet (sum of all frag lengths) - */ + */ #ifndef _ROM_ a_uint32_t __adf_nbuf_len(__adf_nbuf_t buf); @@ -183,12 +183,12 @@ __adf_nbuf_len(__adf_nbuf_t buf); /** * @brief Clone the nbuf (will not create writeable copies) - * + * * @param adf_nbuf - * + * * @return Read-only copy of the nbuf (including clusters) */ -__adf_nbuf_t +__adf_nbuf_t __adf_nbuf_clone(__adf_nbuf_t src); void @@ -197,9 +197,9 @@ __adf_nbuf_cat(__adf_nbuf_t dst, __adf_nbuf_t src); /* * @brief check if the mbuf is cloned or not - * + * * @param buf - * + * * @return a_bool_t */ a_bool_t @@ -210,7 +210,7 @@ __adf_nbuf_is_cloned(__adf_nbuf_t buf); */ #ifndef _ROM_ void -__adf_nbuf_peek_header(__adf_nbuf_t buf, a_uint8_t **addr, +__adf_nbuf_peek_header(__adf_nbuf_t buf, a_uint8_t **addr, a_uint32_t *len); #endif @@ -218,48 +218,48 @@ __adf_nbuf_peek_header(__adf_nbuf_t buf, a_uint8_t **addr, * @brief init the queue * @param qhead */ -void +void __adf_nbuf_queue_init(__adf_nbuf_qhead_t *qhead); /** * @brief return the length of queue * @param adf_qhead - * + * * @return length - * + * */ -a_uint32_t +a_uint32_t __adf_nbuf_queue_len(__adf_nbuf_qhead_t *qhead); /** * @brief returns the first guy in the Q * @param qhead - * + * * @return (NULL if the Q is empty) */ #ifndef _ROM_ -__adf_nbuf_t +__adf_nbuf_t __adf_nbuf_queue_first(__adf_nbuf_queue_t *qhead); /** * @brief return the next packet from packet chain - * + * * @param buf (packet) - * + * * @return (NULL if no packets are there) */ -__adf_nbuf_t +__adf_nbuf_t __adf_nbuf_queue_next(__adf_nbuf_t buf); #endif /** * @brief check if the queue is empty or not - * + * * @param qhead - * + * * @return a_bool_t */ -a_bool_t +a_bool_t __adf_nbuf_is_queue_empty(__adf_nbuf_qhead_t *qhead); __adf_nbuf_t @@ -273,42 +273,42 @@ __adf_nbuf_split_to_frag(__adf_nbuf_t buf, __adf_nbuf_queue_t *qhead); * @brief This will return the header's addr & m_len */ static inline void -__adf_nbuf_peek_header(__adf_nbuf_t buf, a_uint8_t **addr, +__adf_nbuf_peek_header(__adf_nbuf_t buf, a_uint8_t **addr, a_uint32_t *len) { VDESC *desc = buf->desc_list; - + *addr = desc->buf_addr + desc->data_offset; - *len = desc->data_size; + *len = desc->data_size; } /** * @brief return the last mbuf - * + * * @param m0 - * + * * @return struct mbuf* */ -static inline VDESC * +static inline VDESC * __adf_nbuf_last(VBUF *buf) { VDESC *desc = buf->desc_list; - + //for(; desc->next_desc != NULL; desc = desc->next_desc) // ; while(desc->next_desc != NULL) { desc = desc->next_desc; } - + return desc; } /** * @brief num bytes in the head - * + * * @param adf_nbuf - * + * * @return num of bytes available */ static inline a_uint32_t @@ -320,48 +320,48 @@ __adf_nbuf_headroom(__adf_nbuf_t buf) /** * @brief num of bytes available in the tail excluding the priv * portion - * + * * @param adf_nbuf - * + * * @return num of bytes */ -static inline a_uint32_t +static inline a_uint32_t __adf_nbuf_tailroom(__adf_nbuf_t buf) { VDESC *last_desc = __adf_nbuf_last(buf); - + return last_desc->buf_size - last_desc->data_offset - last_desc->data_size; } /** * @brief get the entire packet length - * + * * @param adf_nbuf - * + * * @return total length of packet (sum of all frag lengths) - */ + */ static inline a_uint32_t __adf_nbuf_len(__adf_nbuf_t buf) { - return buf->buf_length; + return buf->buf_length; } /** * @brief put data in the head - * + * * @param buf * @param len (how much data to put) - * + * * @return new data pointer ,NULL if the len is more than the * space available in the head frag. */ -static inline a_uint8_t * +static inline a_uint8_t * __adf_nbuf_push_head(__adf_nbuf_t buf, adf_os_size_t len) { - a_uint8_t *ptr = NULL; + a_uint8_t *ptr = NULL; VDESC *desc = buf->desc_list; - + desc->data_offset -= len; desc->data_size += len; buf->buf_length += len; @@ -370,12 +370,12 @@ __adf_nbuf_push_head(__adf_nbuf_t buf, adf_os_size_t len) } /** - * + * * @brief add data in the end of tail - * + * * @param buf * @param len (how much data to put) - * + * * @return previous tail (data+len),NULL if the len is more than * space available */ @@ -384,41 +384,41 @@ __adf_nbuf_put_tail(__adf_nbuf_t buf, adf_os_size_t len) { a_uint8_t *tail = NULL; VDESC *last_desc = __adf_nbuf_last(buf); - + tail = last_desc->buf_addr + last_desc->data_offset + last_desc->data_size; last_desc->data_size += len; buf->buf_length += len; - + return tail; } /** * @brief strip data from head - * + * * @param adf_nbuf * @param len (how much data to rip) - * + * * @return new data pointer */ -static inline a_uint8_t * +static inline a_uint8_t * __adf_nbuf_pull_head(__adf_nbuf_t buf, adf_os_size_t len) { a_uint8_t *ptr = NULL; VDESC *desc = buf->desc_list; - + desc->data_offset += len; desc->data_size -= len; buf->buf_length -= len; ptr = desc->buf_addr + desc->data_offset; - + return ptr; } /** * @brief retrieve the priv space pointer from nbuf - * + * * @param buf (nbuf to attach the priv space) - * + * * @return uint8_t* ( pointer to the data ) */ static inline a_uint8_t * @@ -432,22 +432,22 @@ __adf_nbuf_get_priv(__adf_nbuf_t buf) /** * @brief returns the first guy in the Q * @param qhead - * + * * @return (NULL if the Q is empty) */ -static inline __adf_nbuf_t +static inline __adf_nbuf_t __adf_nbuf_queue_first(__adf_nbuf_queue_t *qhead) { return qhead->head; } /** * @brief return the next packet from packet chain - * + * * @param buf (packet) - * + * * @return (NULL if no packets are there) */ -static inline __adf_nbuf_t +static inline __adf_nbuf_t __adf_nbuf_queue_next(__adf_nbuf_t buf) { return buf->next_buf; diff --git a/target_firmware/magpie_fw_dev/target/inc/magpie/allocram_api.h b/target_firmware/magpie_fw_dev/target/inc/magpie/allocram_api.h index 2413f3a..8db81dc 100755 --- a/target_firmware/magpie_fw_dev/target/inc/magpie/allocram_api.h +++ b/target_firmware/magpie_fw_dev/target/inc/magpie/allocram_api.h @@ -71,7 +71,7 @@ struct allocram_api { * be set to 0 -- only a single arena is currently supported. */ void *(* cmnos_allocram)(void *which_arena, A_UINT32 nbytes); - + void (* cmnos_allocram_debug)(void); }; diff --git a/target_firmware/magpie_fw_dev/target/inc/magpie/athos_api.h b/target_firmware/magpie_fw_dev/target/inc/magpie/athos_api.h index 010dd63..dc7d682 100755 --- a/target_firmware/magpie_fw_dev/target/inc/magpie/athos_api.h +++ b/target_firmware/magpie_fw_dev/target/inc/magpie/athos_api.h @@ -74,11 +74,11 @@ /* HIF support */ #define HIF_MODULE_INSTALL() hif_module_install(&_A_OS_INDIRECTION_TABLE->hif) #define HIF_init(pConfig) A_INDIR(hif._init(pConfig)) -#define HIF_start() A_INDIR(hif._start()) -#define HIF_config_pipe(pipe, desc_list) A_INDIR(hif._config_pipe(pipe, desc_list)) -#define HIF_send_buffer(pipe, buf) A_INDIR(hif._send_buffer(pipe, buf)) -#define HIF_return_recv_buf(pipe, buf) A_INDIR(hif._return_recv_buf(pipe, buf)) -#define HIF_isr_handler() A_INDIR(hif._isr_handler()) +#define HIF_start() A_INDIR(hif._start()) +#define HIF_config_pipe(pipe, desc_list) A_INDIR(hif._config_pipe(pipe, desc_list)) +#define HIF_send_buffer(pipe, buf) A_INDIR(hif._send_buffer(pipe, buf)) +#define HIF_return_recv_buf(pipe, buf) A_INDIR(hif._return_recv_buf(pipe, buf)) +#define HIF_isr_handler() A_INDIR(hif._isr_handler()) #define HIF_is_pipe_supported(pipe) A_INDIR(hif._is_pipe_supported(pipe)) /* VBUF APIs */ @@ -125,13 +125,13 @@ */ typedef struct _A_athos_indirection_table { _A_cmnos_indirection_table_t cmnos; - + /* TBD: to be added */ struct hif_api hif; struct vbuf_api vbuf; struct vdesc_api vdesc; struct htc_apis htc; - //WMI_SVC_APIS wmi_svc_api; + //WMI_SVC_APIS wmi_svc_api; } _A_athos_indirection_table_t; #if 1 @@ -167,7 +167,7 @@ struct _A_os_linkage_check { }; -/* +/* * A_INIT() handles any initialization needed by the OS abstraction, * and it clears the application's BSS, if necessary. (Application BSS * is not cleared if the application is linked into a single image that @@ -181,7 +181,7 @@ A_INIT(void) { struct _A_os_linkage_check link_check; unsigned int *clrptr; - + if (&START_BSS != _A_MAGPIE_INDIRECTION_TABLE->cmnos.start_bss) { /* Clear BSS */ for (clrptr = &START_BSS; clrptr < &END_BSS; clrptr++) { diff --git a/target_firmware/magpie_fw_dev/target/inc/magpie/buf_pool_api.h b/target_firmware/magpie_fw_dev/target/inc/magpie/buf_pool_api.h index b4ff2b5..54cdd1d 100755 --- a/target_firmware/magpie_fw_dev/target/inc/magpie/buf_pool_api.h +++ b/target_firmware/magpie_fw_dev/target/inc/magpie/buf_pool_api.h @@ -34,9 +34,9 @@ */ /* * @File: buf_pool_api.h - * + * * @Abstract: BUF Pool api - * + * * @Notes: */ @@ -48,11 +48,11 @@ /* endpoint defines */ typedef enum { - POOL_ID_HTC_CONTROL = 0, - POOL_ID_WMI_SVC_CMD_REPLY = 1, + POOL_ID_HTC_CONTROL = 0, + POOL_ID_WMI_SVC_CMD_REPLY = 1, POOL_ID_WMI_SVC_EVENT = 2, POOL_ID_WLAN_RX_BUF = 3, - POOL_ID_MAX = 10 + POOL_ID_MAX = 10 } BUF_POOL_ID; typedef void* pool_handle_t; @@ -60,19 +60,19 @@ typedef void* pool_handle_t; /* hardware API table structure (API descriptions below) */ struct buf_pool_api { pool_handle_t (*_init)(adf_os_handle_t handle); - + void (*_shutdown)(pool_handle_t handle); - + void (*_create_pool)(pool_handle_t handle, BUF_POOL_ID poolId, int nItems, int nSize); - + adf_nbuf_t (*_alloc_buf)(pool_handle_t handle, BUF_POOL_ID poolId, int reserve); - + adf_nbuf_t (*_alloc_buf_align)(pool_handle_t handle, BUF_POOL_ID poolId, int reserve, int align); - + void (*_free_buf)(pool_handle_t handle, BUF_POOL_ID poolId, adf_nbuf_t buf); - + /* room to expand this table by another table */ - void *pReserved; + void *pReserved; }; extern void buf_pool_module_install(struct buf_pool_api *apis); diff --git a/target_firmware/magpie_fw_dev/target/inc/magpie/clock_api.h b/target_firmware/magpie_fw_dev/target/inc/magpie/clock_api.h index c7aae71..82b80fe 100755 --- a/target_firmware/magpie_fw_dev/target/inc/magpie/clock_api.h +++ b/target_firmware/magpie_fw_dev/target/inc/magpie/clock_api.h @@ -48,7 +48,7 @@ struct clock_api { A_UINT32 (* _refclk_speed_get)(void); A_UINT32 (* _milliseconds)(void); void (* _sysclk_change)(void); - + void (* _clock_tick)(void); }; diff --git a/target_firmware/magpie_fw_dev/target/inc/magpie/cmnos_api.h b/target_firmware/magpie_fw_dev/target/inc/magpie/cmnos_api.h index 392ec29..08c66c2 100755 --- a/target_firmware/magpie_fw_dev/target/inc/magpie/cmnos_api.h +++ b/target_firmware/magpie_fw_dev/target/inc/magpie/cmnos_api.h @@ -458,7 +458,7 @@ do { \ A_CMN(timer._timer_run()) #define A_GMAC_BOOT_INIT() \ - A_CMN(gmac.gmac_boot_init()) + A_CMN(gmac.gmac_boot_init()) #if SYSTEM_MODULE_ALLOCRAM /* Default size of ALLOCRAM area */ diff --git a/target_firmware/magpie_fw_dev/target/inc/magpie/dma_engine_api.h b/target_firmware/magpie_fw_dev/target/inc/magpie/dma_engine_api.h index 2f80c24..4a57add 100755 --- a/target_firmware/magpie_fw_dev/target/inc/magpie/dma_engine_api.h +++ b/target_firmware/magpie_fw_dev/target/inc/magpie/dma_engine_api.h @@ -34,9 +34,9 @@ */ /* * @File: dma_engine_api.h - * + * * @Abstract: DMA Engine api - * + * * @Notes: */ @@ -75,44 +75,44 @@ struct zsTxDmaQueue { struct zsDmaDesc* head; struct zsDmaDesc* terminator; - + /* Below are fields specific to TX */ VBUF *xmited_buf_head; - VBUF *xmited_buf_tail; + VBUF *xmited_buf_tail; }; /* hardware API table structure (API descriptions below) */ -struct dma_engine_api +struct dma_engine_api { void (*_init)(); void (*_init_rx_queue)(struct zsDmaQueue *q); - + void (*_init_tx_queue)(struct zsTxDmaQueue *q); - + void (*_config_rx_queue)(struct zsDmaQueue *q, int num_desc, int buf_size); - + void (*_xmit_buf)(struct zsTxDmaQueue *q, VBUF *buf); - + void (*_flush_xmit)(struct zsDmaQueue *q); - + VBUF* (*_reap_recv_buf)(struct zsDmaQueue *q); - + void (*_return_recv_buf)(struct zsDmaQueue *q, VBUF *buf); - + VBUF* (*_reap_xmited_buf)(struct zsTxDmaQueue *q); - + void (*_swap_data)(struct zsDmaDesc* desc); - + int (*_has_compl_packets)(struct zsDmaQueue *q); - + void (*_desc_dump)(struct zsDmaQueue *q); - + /* The functions below are for patchable */ struct zsDmaDesc* (*_get_packet)(struct zsDmaQueue* q); void (*_reclaim_packet)(struct zsDmaQueue* q, struct zsDmaDesc* desc); void (*_put_packet)(struct zsDmaQueue* q, struct zsDmaDesc* desc); - + /* room to expand this table by another table */ void *pReserved; }; diff --git a/target_firmware/magpie_fw_dev/target/inc/magpie/dma_lib.h b/target_firmware/magpie_fw_dev/target/inc/magpie/dma_lib.h index 41aa6d8..af99b53 100755 --- a/target_firmware/magpie_fw_dev/target/inc/magpie/dma_lib.h +++ b/target_firmware/magpie_fw_dev/target/inc/magpie/dma_lib.h @@ -70,7 +70,7 @@ struct dma_lib_api{ A_UINT16 (*rx_init)(dma_engine_t eng_no, dma_iftype_t if_type); void (*rx_config)(dma_engine_t eng_no, a_uint16_t num_desc, a_uint16_t gran); - void (*rx_start)(dma_engine_t eng_no); + void (*rx_start)(dma_engine_t eng_no); A_UINT32 (*intr_status)(dma_iftype_t if_type); A_UINT16 (*hard_xmit)(dma_engine_t eng_no, VBUF *buf); void (*flush_xmit)(dma_engine_t eng_no); @@ -85,7 +85,7 @@ struct dma_lib_api{ /** * @brief Install the DMA lib api's this for ROM patching * support - * + * * @param apis */ void dma_lib_module_install(struct dma_lib_api *apis); diff --git a/target_firmware/magpie_fw_dev/target/inc/magpie/eeprom_api.h b/target_firmware/magpie_fw_dev/target/inc/magpie/eeprom_api.h index b9668c8..bfcb8f4 100755 --- a/target_firmware/magpie_fw_dev/target/inc/magpie/eeprom_api.h +++ b/target_firmware/magpie_fw_dev/target/inc/magpie/eeprom_api.h @@ -40,13 +40,13 @@ typedef enum { - RET_SUCCESS = 0, + RET_SUCCESS = 0, RET_NOT_INIT, RET_NOT_EXIST, RET_EEP_CORRUPT, RET_EEP_OVERFLOW, - - // add return code from here + + // add return code from here RET_UNKNOWN }T_EEP_RET; diff --git a/target_firmware/magpie_fw_dev/target/inc/magpie/hif_api.h b/target_firmware/magpie_fw_dev/target/inc/magpie/hif_api.h index eff92df..e7fb943 100755 --- a/target_firmware/magpie_fw_dev/target/inc/magpie/hif_api.h +++ b/target_firmware/magpie_fw_dev/target/inc/magpie/hif_api.h @@ -34,9 +34,9 @@ */ /* * @File: HIF_api.h - * + * * @Abstract: Host Interface api - * + * * @Notes: */ @@ -64,33 +64,33 @@ typedef void* hif_handle_t; /* hardware API table structure (API descriptions below) */ struct hif_api { hif_handle_t (*_init)(HIF_CONFIG *pConfig); - + void (* _shutdown)(hif_handle_t); - + void (*_register_callback)(hif_handle_t, HIF_CALLBACK *); - + int (*_get_total_credit_count)(hif_handle_t); - + void (*_start)(hif_handle_t); void (*_config_pipe)(hif_handle_t handle, int pipe, int creditCount); - + int (*_send_buffer)(hif_handle_t handle, int pipe, adf_nbuf_t buf); - void (*_return_recv_buf)(hif_handle_t handle, int pipe, adf_nbuf_t buf); + void (*_return_recv_buf)(hif_handle_t handle, int pipe, adf_nbuf_t buf); //void (*_set_recv_bufsz)(int pipe, int bufsz); //void (*_pause_recv)(int pipe); //void (*_resume_recv)(int pipe); int (*_is_pipe_supported)(hif_handle_t handle, int pipe); - + int (*_get_max_msg_len)(hif_handle_t handle, int pipe); - + int (*_get_reserved_headroom)(hif_handle_t handle); - + void (*_isr_handler)(hif_handle_t handle); - + void (*_get_default_pipe)(hif_handle_t handle, A_UINT8 *pipe_uplink, A_UINT8 *pipe_downlink); - + /* room to expand this table by another table */ void *pReserved; }; diff --git a/target_firmware/magpie_fw_dev/target/inc/magpie/hif_gmac.h b/target_firmware/magpie_fw_dev/target/inc/magpie/hif_gmac.h index 3ca57b7..40c2972 100755 --- a/target_firmware/magpie_fw_dev/target/inc/magpie/hif_gmac.h +++ b/target_firmware/magpie_fw_dev/target/inc/magpie/hif_gmac.h @@ -50,7 +50,7 @@ #define ATH_P_MAGNORM 0x13 /*Magpie GMAC 19 for HTC & others*/ #define ETH_P_ATH 0x88bd - + typedef enum hif_gmac_pipe{ HIF_GMAC_PIPE_RX = 1, /*Normal Priority RX*/ HIF_GMAC_PIPE_TX = 2, /*Normal Priority TX*/ @@ -162,7 +162,7 @@ enum __gmac_reg_mac_cfg2{ MAC_CFG2_PREAMBLE = (7 << 12),/*Default Preamble Length*/ }; enum __gmac_reg_mii_cfg{ - MII_CFG_CLK_2MHZ = 0x0006,/*Clock is 2Mhz*/ + MII_CFG_CLK_2MHZ = 0x0006,/*Clock is 2Mhz*/ }; @@ -198,7 +198,7 @@ enum __gmac_reg_mii_addr{ #define MII_ADDR_RESET_ENABLE_AUTONEG (1 << 12) #define MII_ADDR_RESET_ENABLE_LOOPBACK (1<<14) #define MII_ADDR_RESET_SOFT_RESET (1<<15) -/* flags for autonegotiaion register MII_ADDR_AUTONEG_ADV, +/* flags for autonegotiaion register MII_ADDR_AUTONEG_ADV, All writes to this register should be followed by a soft reset on the phy The list is not exhaustive, only required fields added @@ -230,7 +230,7 @@ enum __gmac_reg_fifo_cfg4{ FIFO_CFG4_RX_ALL = 0x3ffff,/*receive all frames*/ }; enum __gmac_reg_if_ctrl{ - IF_CTRL_SPEED_100 = (1 << 16),/*Interface speed 100 Mbps for MII*/ + IF_CTRL_SPEED_100 = (1 << 16),/*Interface speed 100 Mbps for MII*/ }; @@ -257,15 +257,15 @@ struct __ethhdr{ }__attribute__((packed)); /** * @brief this is will be in big endian format - */ + */ struct __athhdr{ #ifdef LITTLE_ENDIAN A_UINT8 proto:6, res:2; -#else +#else A_UINT8 res:2, proto:6; -#endif +#endif A_UINT8 res_lo; A_UINT16 res_hi; }__attribute__((packed)); diff --git a/target_firmware/magpie_fw_dev/target/inc/magpie/hif_pci.h b/target_firmware/magpie_fw_dev/target/inc/magpie/hif_pci.h index a9ab6a2..a2621b1 100755 --- a/target_firmware/magpie_fw_dev/target/inc/magpie/hif_pci.h +++ b/target_firmware/magpie_fw_dev/target/inc/magpie/hif_pci.h @@ -43,8 +43,8 @@ #define PCI_MAX_DATA_PKT_LEN 1664 #define PCI_MAX_CMD_PKT_LEN 512 -#define PCI_MAX_BOOT_DESC 2 - +#define PCI_MAX_BOOT_DESC 2 + typedef enum hif_pci_pipe_rx{ HIF_PCI_PIPE_RX0, /*Normal Priority RX*/ HIF_PCI_PIPE_RX1, @@ -68,7 +68,7 @@ struct hif_pci_api{ hif_handle_t (*pci_init)(HIF_CONFIG *pConfig); void (*pci_reset)(void); void (*pci_enable)(void); - void (*pci_reap_xmitted)(__pci_softc_t *sc, + void (*pci_reap_xmitted)(__pci_softc_t *sc, dma_engine_t eng_no); void (*pci_reap_recv)(__pci_softc_t *sc, dma_engine_t eng_no); A_UINT8 (*pci_get_pipe)(dma_engine_t eng); diff --git a/target_firmware/magpie_fw_dev/target/inc/magpie/hif_usb.h b/target_firmware/magpie_fw_dev/target/inc/magpie/hif_usb.h index 0f71c9c..1f52483 100755 --- a/target_firmware/magpie_fw_dev/target/inc/magpie/hif_usb.h +++ b/target_firmware/magpie_fw_dev/target/inc/magpie/hif_usb.h @@ -60,7 +60,7 @@ struct VBUF_QUEUE /* the mailbox hardware layer context */ typedef struct _HIF_USB_CONTEXT { - HIF_CALLBACK hifCb; + HIF_CALLBACK hifCb; struct zsDmaQueue dnQ; struct zsTxDmaQueue upQ; #if SYSTEM_MODULE_HP_EP5 @@ -72,11 +72,11 @@ typedef struct _HIF_USB_CONTEXT { //struct VBUF_QUEUE upVbufQ; VBUF *cmdQueue; struct VBUF_QUEUE eventBufQ; - + // Left a door for extension the structure - void *pReserved; + void *pReserved; } HIF_USB_CONTEXT; void hif_usb_module_install(struct hif_api *apis); - + #endif diff --git a/target_firmware/magpie_fw_dev/target/inc/magpie/htc_api.h b/target_firmware/magpie_fw_dev/target/inc/magpie/htc_api.h index d774c8e..14fd8d2 100755 --- a/target_firmware/magpie_fw_dev/target/inc/magpie/htc_api.h +++ b/target_firmware/magpie_fw_dev/target/inc/magpie/htc_api.h @@ -1,150 +1,150 @@ -/* - * Copyright (c) 2013 Qualcomm Atheros, Inc. - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted (subject to the limitations in the - * disclaimer below) provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Qualcomm Atheros nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE - * GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT - * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __HTC_API_H__ -#define __HTC_API_H__ - -#include -#include -//#include -//#include -#include -#include - -#define HTC_HDR_SZ HTC_HDR_LENGTH -#define HTC_BUFSZ_MAX_SEND 2048 - -typedef void (* HTC_SERVICE_ProcessRecvMsg)(HTC_ENDPOINT_ID EndpointID, adf_nbuf_t, adf_nbuf_t, void *ServiceCtx); -typedef void (* HTC_SERVICE_ProcessSendBufferComplete)(HTC_ENDPOINT_ID EndpointID, adf_nbuf_t, void *ServiceCtx); - -/* HTC service structure : - * the caller is required to allocate storage for the service structure and register the - * structure using HTC_RegisterService() The service must set the following fields: - * ProcessRecvMsg - * ProcessSendBufferComplete - * ProcessConnect - * ServiceID - * MaxSvcMsgSize (for message validation) - * */ -typedef struct _HTC_SERVICE { - struct _HTC_SERVICE *pNext; - /* Callback for processing receive messages. HTC calls this callback whenever a - * message arrives on the endpoint assigned to this service. - * HTC_BUFFER is a chain of buffers containing a full application message. - * HTC_BUFFER->buffer points to the start of the msg buffer (past the HTC header) */ - //void (* ProcessRecvMsg)(HTC_ENDPOINT_ID EndpointID, HTC_BUFFER *); - void (* ProcessRecvMsg)(HTC_ENDPOINT_ID EndpointID, adf_nbuf_t, adf_nbuf_t, void *ServiceCtx); - /* callback to process completed send buffers */ - //void (* ProcessSendBufferComplete)(HTC_ENDPOINT_ID EndpointID, HTC_BUFFER *); - void (* ProcessSendBufferComplete)(HTC_ENDPOINT_ID EndpointID, adf_nbuf_t, void *ServiceCtx); - /* optional callback when a connection request occurs. - * The EndpointID is the assigned endpoint, the callback returns a connect - * response status code to allow or disallow the connection. - * pDataIn points to the optional meta data supplied in the connection request - * pDataOut points to a buffer to send back meta data - * If no callback is supplied, HTC assumes the connect is allowed */ - A_UINT8 (* ProcessConnect)(struct _HTC_SERVICE *pService, - HTC_ENDPOINT_ID EndpointID, - A_UINT8 *pDataIn, - int LengthIn, - A_UINT8 *pDataOut, - int *pLengthOut); - A_UINT16 ServiceID; /* service ID to match connection requests */ - A_UINT16 ServiceFlags; /* service flags */ - A_UINT16 MaxSvcMsgSize; /* maximum length of service-specific messages exchanged on the endpoint */ - A_UINT16 TrailerSpcCheckLimit; /* amount of space in each send buffer that HTC can check for trailer - data. This should be set to the smallest HTC buffer that can be sent - through the service. The service can disable trailer data insertion - by setting this value to 0. */ - void *ServiceCtx; -} HTC_SERVICE; - -#define HTC_SERVICE_FLAGS_CONNECTED (1 << 0) /* service has at least 1 connection */ - -#define IS_SERVICE_CONNECTED(s) ((s)->ServiceFlags & HTC_SERVICE_FLAGS_CONNECTED) - - /* configuration settings for the WMI service */ -typedef struct _HTC_CONFIG { - int CreditSize; /* */ - int CreditNumber; - //int ControlDownLinkPipeID; - //int ControlUpLinkPipeID; - adf_os_handle_t OSHandle; - hif_handle_t HIFHandle; - pool_handle_t PoolHandle; -} HTC_CONFIG; - -typedef struct _HTC_BUF_CONTEXT { - A_UINT8 end_point; - A_UINT8 htc_flags; /* htc flags (used by HTC layer only) */ -} HTC_BUF_CONTEXT; - -typedef void* htc_handle_t; - -/* - * setup complete function, supplied by HTC caller at HTC_init time. - * HTC calls this function after the host has indicated that the service connection - * phase is complete. - * - */ -typedef void (* HTC_SETUP_COMPLETE_CB)(void); - -struct htc_apis { - htc_handle_t (* _HTC_Init)(HTC_SETUP_COMPLETE_CB, HTC_CONFIG *pConfig); - void (* _HTC_Shutdown)(htc_handle_t); - void (* _HTC_RegisterService)(htc_handle_t, HTC_SERVICE *); - void (* _HTC_Ready)(htc_handle_t); - void (* _HTC_ReturnBuffers)(htc_handle_t handle, HTC_ENDPOINT_ID EndpointID, adf_nbuf_t); - void (* _HTC_ReturnBuffersList)(htc_handle_t handle, HTC_ENDPOINT_ID EndpointID, adf_nbuf_queue_t); - void (* _HTC_SendMsg)(htc_handle_t handle, HTC_ENDPOINT_ID EndpointID, adf_nbuf_t); - int (* _HTC_GetReservedHeadroom)(htc_handle_t handle); - - //void (* _HTC_PauseRecv)(HTC_ENDPOINT_ID EndpointID); - //void (* _HTC_ResumeRecv)(HTC_ENDPOINT_ID EndpointID); - //void (* _HTC_AddBufferResources)(int buffers); - - /* These APIs below are for patch purpose only */ - void (*_HTC_MsgRecvHandler)(adf_nbuf_t hdr_buf, adf_nbuf_t buf, void *context); - void (*_HTC_SendDoneHandler)(adf_nbuf_t buf, void *context); - void (*_HTC_ControlSvcProcessMsg)(HTC_ENDPOINT_ID EndpointID, adf_nbuf_t hdr_buf, adf_nbuf_t buf, void *arg); - void (*_HTC_ControlSvcProcessSendComplete)(HTC_ENDPOINT_ID EndpointID, adf_nbuf_t pBuffers, void *arg); - - void *pReserved; /* for expansion if need be */ -}; - -extern void htc_module_install(struct htc_apis *pAPIs); - -#endif /* _HTC_API_H__ */ +/* + * Copyright (c) 2013 Qualcomm Atheros, Inc. + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted (subject to the limitations in the + * disclaimer below) provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Qualcomm Atheros nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE + * GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT + * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __HTC_API_H__ +#define __HTC_API_H__ + +#include +#include +//#include +//#include +#include +#include + +#define HTC_HDR_SZ HTC_HDR_LENGTH +#define HTC_BUFSZ_MAX_SEND 2048 + +typedef void (* HTC_SERVICE_ProcessRecvMsg)(HTC_ENDPOINT_ID EndpointID, adf_nbuf_t, adf_nbuf_t, void *ServiceCtx); +typedef void (* HTC_SERVICE_ProcessSendBufferComplete)(HTC_ENDPOINT_ID EndpointID, adf_nbuf_t, void *ServiceCtx); + +/* HTC service structure : + * the caller is required to allocate storage for the service structure and register the + * structure using HTC_RegisterService() The service must set the following fields: + * ProcessRecvMsg + * ProcessSendBufferComplete + * ProcessConnect + * ServiceID + * MaxSvcMsgSize (for message validation) + * */ +typedef struct _HTC_SERVICE { + struct _HTC_SERVICE *pNext; + /* Callback for processing receive messages. HTC calls this callback whenever a + * message arrives on the endpoint assigned to this service. + * HTC_BUFFER is a chain of buffers containing a full application message. + * HTC_BUFFER->buffer points to the start of the msg buffer (past the HTC header) */ + //void (* ProcessRecvMsg)(HTC_ENDPOINT_ID EndpointID, HTC_BUFFER *); + void (* ProcessRecvMsg)(HTC_ENDPOINT_ID EndpointID, adf_nbuf_t, adf_nbuf_t, void *ServiceCtx); + /* callback to process completed send buffers */ + //void (* ProcessSendBufferComplete)(HTC_ENDPOINT_ID EndpointID, HTC_BUFFER *); + void (* ProcessSendBufferComplete)(HTC_ENDPOINT_ID EndpointID, adf_nbuf_t, void *ServiceCtx); + /* optional callback when a connection request occurs. + * The EndpointID is the assigned endpoint, the callback returns a connect + * response status code to allow or disallow the connection. + * pDataIn points to the optional meta data supplied in the connection request + * pDataOut points to a buffer to send back meta data + * If no callback is supplied, HTC assumes the connect is allowed */ + A_UINT8 (* ProcessConnect)(struct _HTC_SERVICE *pService, + HTC_ENDPOINT_ID EndpointID, + A_UINT8 *pDataIn, + int LengthIn, + A_UINT8 *pDataOut, + int *pLengthOut); + A_UINT16 ServiceID; /* service ID to match connection requests */ + A_UINT16 ServiceFlags; /* service flags */ + A_UINT16 MaxSvcMsgSize; /* maximum length of service-specific messages exchanged on the endpoint */ + A_UINT16 TrailerSpcCheckLimit; /* amount of space in each send buffer that HTC can check for trailer + data. This should be set to the smallest HTC buffer that can be sent + through the service. The service can disable trailer data insertion + by setting this value to 0. */ + void *ServiceCtx; +} HTC_SERVICE; + +#define HTC_SERVICE_FLAGS_CONNECTED (1 << 0) /* service has at least 1 connection */ + +#define IS_SERVICE_CONNECTED(s) ((s)->ServiceFlags & HTC_SERVICE_FLAGS_CONNECTED) + + /* configuration settings for the WMI service */ +typedef struct _HTC_CONFIG { + int CreditSize; /* */ + int CreditNumber; + //int ControlDownLinkPipeID; + //int ControlUpLinkPipeID; + adf_os_handle_t OSHandle; + hif_handle_t HIFHandle; + pool_handle_t PoolHandle; +} HTC_CONFIG; + +typedef struct _HTC_BUF_CONTEXT { + A_UINT8 end_point; + A_UINT8 htc_flags; /* htc flags (used by HTC layer only) */ +} HTC_BUF_CONTEXT; + +typedef void* htc_handle_t; + +/* + * setup complete function, supplied by HTC caller at HTC_init time. + * HTC calls this function after the host has indicated that the service connection + * phase is complete. + * + */ +typedef void (* HTC_SETUP_COMPLETE_CB)(void); + +struct htc_apis { + htc_handle_t (* _HTC_Init)(HTC_SETUP_COMPLETE_CB, HTC_CONFIG *pConfig); + void (* _HTC_Shutdown)(htc_handle_t); + void (* _HTC_RegisterService)(htc_handle_t, HTC_SERVICE *); + void (* _HTC_Ready)(htc_handle_t); + void (* _HTC_ReturnBuffers)(htc_handle_t handle, HTC_ENDPOINT_ID EndpointID, adf_nbuf_t); + void (* _HTC_ReturnBuffersList)(htc_handle_t handle, HTC_ENDPOINT_ID EndpointID, adf_nbuf_queue_t); + void (* _HTC_SendMsg)(htc_handle_t handle, HTC_ENDPOINT_ID EndpointID, adf_nbuf_t); + int (* _HTC_GetReservedHeadroom)(htc_handle_t handle); + + //void (* _HTC_PauseRecv)(HTC_ENDPOINT_ID EndpointID); + //void (* _HTC_ResumeRecv)(HTC_ENDPOINT_ID EndpointID); + //void (* _HTC_AddBufferResources)(int buffers); + + /* These APIs below are for patch purpose only */ + void (*_HTC_MsgRecvHandler)(adf_nbuf_t hdr_buf, adf_nbuf_t buf, void *context); + void (*_HTC_SendDoneHandler)(adf_nbuf_t buf, void *context); + void (*_HTC_ControlSvcProcessMsg)(HTC_ENDPOINT_ID EndpointID, adf_nbuf_t hdr_buf, adf_nbuf_t buf, void *arg); + void (*_HTC_ControlSvcProcessSendComplete)(HTC_ENDPOINT_ID EndpointID, adf_nbuf_t pBuffers, void *arg); + + void *pReserved; /* for expansion if need be */ +}; + +extern void htc_module_install(struct htc_apis *pAPIs); + +#endif /* _HTC_API_H__ */ diff --git a/target_firmware/magpie_fw_dev/target/inc/magpie/intr_api.h b/target_firmware/magpie_fw_dev/target/inc/magpie/intr_api.h index 7481f6b..675cf40 100755 --- a/target_firmware/magpie_fw_dev/target/inc/magpie/intr_api.h +++ b/target_firmware/magpie_fw_dev/target/inc/magpie/intr_api.h @@ -127,7 +127,7 @@ typedef enum inum_intr { A_INTR_USB_DMA, A_INTR_ERROR, /* add intr above here */ - A_INTR_NUM + A_INTR_NUM }A_INUM_INTR_T; ////////////////////////////////////////////////////////////////// @@ -147,7 +147,7 @@ typedef int (* A_handler_t)(void *); * An Interrupt Service Routine, which must be called * directly in interrupt context (not delayed), and which * must be very small and may not have access to all OS - * functions. These are for use only when interrupt + * functions. These are for use only when interrupt * latency is critical; otherwise, an A_handler_t ("dsr") * is preferable. */ @@ -170,7 +170,7 @@ struct intr_api { void (* _intr_mask_inum)(uint32_t inum); void (* _intr_unmask_inum)(uint32_t inum); void (* _intr_attach_isr)(uint32_t inum, A_isr_t isr, void *arg); -/* +/* BOOLEAN (*_intr_dsrs_pending)(void); void (* _intr_handle_pending_dsrs)(void); uint32_t (* _intr_nmi)(void *); diff --git a/target_firmware/magpie_fw_dev/target/inc/magpie/magpie/reg_defs.h b/target_firmware/magpie_fw_dev/target/inc/magpie/magpie/reg_defs.h index 11ad649..99ddfdc 100755 --- a/target_firmware/magpie_fw_dev/target/inc/magpie/magpie/reg_defs.h +++ b/target_firmware/magpie_fw_dev/target/inc/magpie/magpie/reg_defs.h @@ -1,262 +1,262 @@ -/* - * Copyright (c) 2013 Qualcomm Atheros, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted (subject to the limitations in the - * disclaimer below) provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Qualcomm Atheros nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE - * GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT - * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -/*************************************************************************/ -/* Copyright (c) 2006 Atheros Communications, Inc., All Rights Reserved */ -/* */ -/* Module Name : reg_defs.h */ -/* */ -/* Abstract */ -/* This file contains the register addr and marco definition. */ -/* */ -/* NOTES */ -/* None */ -/* */ -/*************************************************************************/ -#ifndef _REG_DEFS_H_ -#define _REG_DEFS_H_ - -#include "dt_defs.h" - -#define BIT_SET(bit) (1<desc_list->buf_addr + vbuf->desc_list->data_offset) @@ -68,7 +68,7 @@ struct vbuf_api { void (*_free_vbuf)(VBUF *buf); /* room to expand this table by another table */ - void *pReserved; + void *pReserved; }; extern void vbuf_module_install(struct vbuf_api *apis); diff --git a/target_firmware/magpie_fw_dev/target/inc/magpie/vdesc_api.h b/target_firmware/magpie_fw_dev/target/inc/magpie/vdesc_api.h index 9fd27f8..c7f4ee1 100755 --- a/target_firmware/magpie_fw_dev/target/inc/magpie/vdesc_api.h +++ b/target_firmware/magpie_fw_dev/target/inc/magpie/vdesc_api.h @@ -49,7 +49,7 @@ typedef struct _VDESC A_UINT16 data_offset; A_UINT16 data_size; A_UINT16 control; - A_UINT8 hw_desc_buf[MAX_HW_DESC_SIZE]; + A_UINT8 hw_desc_buf[MAX_HW_DESC_SIZE]; } VDESC; //#define VDESC_HW_TO_VDESC(hwdesc) ((VDESC *)(((A_UINT32 *)hwdesc - 4))) @@ -62,9 +62,9 @@ struct vdesc_api { void (*_swap_vdesc)(VDESC *dest, VDESC *src); //void (*_free_vdesc)(void); /* room to expand this table by another table */ - void *pReserved; + void *pReserved; }; extern void vdesc_module_install(struct vdesc_api *apis); -#endif +#endif diff --git a/target_firmware/magpie_fw_dev/target/inc/osapi.h b/target_firmware/magpie_fw_dev/target/inc/osapi.h index 1959fdb..897b580 100755 --- a/target_firmware/magpie_fw_dev/target/inc/osapi.h +++ b/target_firmware/magpie_fw_dev/target/inc/osapi.h @@ -139,7 +139,7 @@ /* * Intentional Misaligned Load special "addresses". - * Loads from misaligned addresses have special semantics, + * Loads from misaligned addresses have special semantics, * handled by the OS, depending on the lower nibble. * * NOTE1: word-aligned nibbles will not cause any exception, @@ -165,7 +165,7 @@ #endif #ifdef HTC_TRACE_MBOX_PAUSE -#define A_ASSERT( __bool ) +#define A_ASSERT( __bool ) #else /* * Code space dedicated to asserts is minimal. We use an Intentional diff --git a/target_firmware/magpie_fw_dev/target/inc/usb_api.h b/target_firmware/magpie_fw_dev/target/inc/usb_api.h index c3ca296..8b612ad 100755 --- a/target_firmware/magpie_fw_dev/target/inc/usb_api.h +++ b/target_firmware/magpie_fw_dev/target/inc/usb_api.h @@ -46,7 +46,7 @@ struct usb_api { // ep0 operation void (*_usb_ep0_setup)(void); - + void (*_usb_ep0_tx)(void); void (*_usb_ep0_rx)(void); @@ -59,16 +59,16 @@ struct usb_api { BOOLEAN (*_usb_set_configuration)(void); // standard/vendor command - BOOLEAN (*_usb_standard_cmd)(void); + BOOLEAN (*_usb_standard_cmd)(void); void (*_usb_vendor_cmd)(void); void (*_usb_power_off)(void); void (*_usb_reset_fifo)(void); void (*_usb_gen_wdt)(void); void (*_usb_jump_boot)(void); - + BOOLEAN (*_usb_clr_feature)(void); - BOOLEAN (*_usb_set_feature)(void); + BOOLEAN (*_usb_set_feature)(void); BOOLEAN (*_usb_set_address)(void); BOOLEAN (*_usb_get_descriptor)(void); diff --git a/target_firmware/magpie_fw_dev/target/inc/usb_defs.h b/target_firmware/magpie_fw_dev/target/inc/usb_defs.h index 2d0af69..ce2e24e 100755 --- a/target_firmware/magpie_fw_dev/target/inc/usb_defs.h +++ b/target_firmware/magpie_fw_dev/target/inc/usb_defs.h @@ -137,7 +137,7 @@ #define ZM_ADDR_CONV 0x0 #define ZM_CBUS_FIFO_SIZE_REG (ZM_CBUS_FIFO_SIZE_OFFSET^ZM_ADDR_CONV) - + #define ZM_CBUS_CTRL_REG (cSOC_USB_OFST+cSOC_CBUS_CTL_OFFSET^ZM_ADDR_CONV) #define ZM_MAIN_CTRL_REG (ZM_MAIN_CTRL_OFFSET^ZM_ADDR_CONV) @@ -179,7 +179,7 @@ #define ZM_INTR_SOURCE_2_REG (ZM_INTR_SOURCE_2_OFFSET^ZM_ADDR_CONV) #define ZM_INTR_SOURCE_3_REG (ZM_INTR_SOURCE_3_OFFSET^ZM_ADDR_CONV) - + #define ZM_INTR_SOURCE_4_REG (ZM_INTR_SOURCE_4_OFFSET^ZM_ADDR_CONV) #define ZM_INTR_SOURCE_5_REG (ZM_INTR_SOURCE_5_OFFSET^ZM_ADDR_CONV) @@ -239,7 +239,7 @@ USB_BYTE_REG_READ(ZM_MAIN_CTRL_OFFSET)&~BIT0) #define mUsbRmWkupSet() USB_BYTE_REG_WRITE(ZM_MAIN_CTRL_OFFSET, \ USB_BYTE_REG_READ(ZM_MAIN_CTRL_OFFSET)|BIT0) - + #define mUsbGlobIntEnable() USB_BYTE_REG_WRITE(ZM_MAIN_CTRL_OFFSET, \ USB_BYTE_REG_READ(ZM_MAIN_CTRL_OFFSET)|BIT2) @@ -296,7 +296,7 @@ #if (HS_C1_INTERFACE_NUMBER >= 1) // Interface 0 #define HS_C1_I0_ALT_NUMBER 0X01 - #if (HS_C1_I0_ALT_NUMBER >= 1) + #if (HS_C1_I0_ALT_NUMBER >= 1) // AlternateSetting 0X00 #define HS_C1_I0_A0_bInterfaceNumber 0X00 #define HS_C1_I0_A0_bAlternateSetting 0X00 @@ -850,7 +850,7 @@ /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #define USB_ENABLE_UP_DMA() USB_WORD_REG_WRITE(ZM_SOC_USB_MODE_CTRL_OFFSET, \ (USB_WORD_REG_READ(ZM_SOC_USB_MODE_CTRL_OFFSET)|BIT0)) // upstream DMA enable - + #define USB_DISABLE_UP_DMA() USB_WORD_REG_WRITE(ZM_SOC_USB_MODE_CTRL_OFFSET, \ (USB_WORD_REG_READ(ZM_SOC_USB_MODE_CTRL_OFFSET)&(~BIT0))) // upstream DMA disable @@ -875,10 +875,10 @@ /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #define USB_ENABLE_HP_DN_DMA() USB_WORD_REG_WRITE(ZM_SOC_USB_MODE_CTRL_OFFSET, \ - (USB_WORD_REG_READ(ZM_SOC_USB_MODE_CTRL_OFFSET)|BIT8)) // hp downstream DMA enable + (USB_WORD_REG_READ(ZM_SOC_USB_MODE_CTRL_OFFSET)|BIT8)) // hp downstream DMA enable #define USB_DISABLE_HP_DN_DMA() USB_WORD_REG_WRITE(ZM_SOC_USB_MODE_CTRL_OFFSET, \ - (USB_WORD_REG_READ(ZM_SOC_USB_MODE_CTRL_OFFSET)&(~BIT8))) // hp downstream DMA disable + (USB_WORD_REG_READ(ZM_SOC_USB_MODE_CTRL_OFFSET)&(~BIT8))) // hp downstream DMA disable #define USB_HP_DN_PACKET_MODE() USB_WORD_REG_WRITE(ZM_SOC_USB_MODE_CTRL_OFFSET, \ (USB_WORD_REG_READ(ZM_SOC_USB_MODE_CTRL_OFFSET)&(~BIT7))) // hpQ packet mode @@ -887,9 +887,9 @@ (USB_WORD_REG_READ(ZM_SOC_USB_MODE_CTRL_OFFSET)|BIT7)) // hpQ stream mode /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -#define USB_ENABLE_MP_DN_DMA() USB_WORD_REG_WRITE(ZM_SOC_USB_MODE_CTRL_OFFSET, (USB_WORD_REG_READ(ZM_SOC_USB_MODE_CTRL_OFFSET)|BIT9)) // mp downstream DMA enable +#define USB_ENABLE_MP_DN_DMA() USB_WORD_REG_WRITE(ZM_SOC_USB_MODE_CTRL_OFFSET, (USB_WORD_REG_READ(ZM_SOC_USB_MODE_CTRL_OFFSET)|BIT9)) // mp downstream DMA enable -#define USB_DISABLE_MP_DN_DMA() USB_WORD_REG_WRITE(ZM_SOC_USB_MODE_CTRL_OFFSET, (USB_WORD_REG_READ(ZM_SOC_USB_MODE_CTRL_OFFSET)&(~BIT9))) // mp downstream DMA disable +#define USB_DISABLE_MP_DN_DMA() USB_WORD_REG_WRITE(ZM_SOC_USB_MODE_CTRL_OFFSET, (USB_WORD_REG_READ(ZM_SOC_USB_MODE_CTRL_OFFSET)&(~BIT9))) // mp downstream DMA disable #define USB_MP_DN_PACKET_MODE() USB_WORD_REG_WRITE(ZM_SOC_USB_MODE_CTRL_OFFSET, (USB_WORD_REG_READ(ZM_SOC_USB_MODE_CTRL_OFFSET)&(~BIT10))) // hpQ packet mode @@ -931,7 +931,7 @@ USB_ENABLE_HP_DN_DMA(); #define USB_STREAM_HOST_BUF_SIZE(size) USB_WORD_REG_WRITE(ZM_SOC_USB_MODE_CTRL_OFFSET, \ - (USB_WORD_REG_READ(ZM_SOC_USB_MODE_CTRL_OFFSET)|(size))); + (USB_WORD_REG_READ(ZM_SOC_USB_MODE_CTRL_OFFSET)|(size))); #define USB_STREAM_TIMEOUT(time_cnt) USB_WORD_REG_WRITE(ZM_SOC_USB_TIME_CTRL_OFFSET, time_cnt); // set stream mode timeout critirea #define USB_STREAM_AGG_PKT_CNT(cnt) USB_WORD_REG_WRITE(ZM_SOC_USB_MAX_AGGREGATE_OFFSET, cnt); // set stream mode packet buffer critirea diff --git a/target_firmware/magpie_fw_dev/target/inc/usbfifo_api.h b/target_firmware/magpie_fw_dev/target/inc/usbfifo_api.h index 9ec5398..08f85af 100755 --- a/target_firmware/magpie_fw_dev/target/inc/usbfifo_api.h +++ b/target_firmware/magpie_fw_dev/target/inc/usbfifo_api.h @@ -34,9 +34,9 @@ */ /* * @File: HIF_api.h - * + * * @Abstract: Host Interface api - * + * * @Notes: */ @@ -49,12 +49,12 @@ typedef struct _USB_FIFO_CONFIG { /* callback to get the buf for receiving commands from USB FIFO */ VBUF* (*get_command_buf)(void); /* callback when receiving a command */ - void (*recv_command)(VBUF *cmd); + void (*recv_command)(VBUF *cmd); /* callback to get the buf for event to send to the host */ VBUF* (*get_event_buf)(void); /* callback to indicate the event has been sent to the host */ void (*send_event_done)(VBUF *buf); - + /* context used for all callbacks */ //void *context; } USB_FIFO_CONFIG; @@ -65,7 +65,7 @@ struct usbfifo_api { void (*_enable_event_isr)(void); /* room to expand this table by another table */ - void *pReserved; + void *pReserved; }; extern void usbfifo_module_install(struct usbfifo_api *apis); diff --git a/target_firmware/magpie_fw_dev/target/init/init.c b/target_firmware/magpie_fw_dev/target/init/init.c index aa9f830..7484c05 100755 --- a/target_firmware/magpie_fw_dev/target/init/init.c +++ b/target_firmware/magpie_fw_dev/target/init/init.c @@ -109,7 +109,7 @@ change_magpie_clk(void) A_DELAY_USECS(60); // wait for stable - /* CPU & AHB settings */ + /* CPU & AHB settings */ /* * AHB clk = ( CPU clk / 2 ) */ @@ -193,7 +193,7 @@ LOCAL void zfGenExceptionEvent(uint32_t exccause, uint32_t pc, uint32_t badvaddr iowrite32_usb(ZM_EP3_DATA_OFFSET, exccause); iowrite32_usb(ZM_EP3_DATA_OFFSET, pc); iowrite32_usb(ZM_EP3_DATA_OFFSET, badvaddr); - + mUSB_EP3_XFER_DONE(); } @@ -237,14 +237,14 @@ AR6002_fatal_exception_handler_patch(CPU_exception_frame_t *exc_frame) #endif A_ASSFAIL(&dump); -#if defined(_ROM_) +#if defined(_ROM_) A_WDT_ENABLE(); #endif while(1) ; } -void +void HTCControlSvcProcessMsg_patch(HTC_ENDPOINT_ID EndpointID, adf_nbuf_t hdr_buf, adf_nbuf_t pBuffers, void *arg) { @@ -265,7 +265,7 @@ HTCControlSvcProcessMsg_patch(HTC_ENDPOINT_ID EndpointID, adf_nbuf_t hdr_buf, } /* Patch callback for check the endpoint ID is correct or not */ -void +void HTCMsgRecvHandler_patch(adf_nbuf_t hdr_buf, adf_nbuf_t buffer, void *context) { int eid; @@ -273,27 +273,27 @@ HTCMsgRecvHandler_patch(adf_nbuf_t hdr_buf, adf_nbuf_t buffer, void *context) a_uint32_t anblen; adf_nbuf_t tmp_nbuf; HTC_FRAME_HDR *pHTCHdr; - + if (hdr_buf == ADF_NBUF_NULL) { /* HTC hdr is not in the hdr_buf */ tmp_nbuf = buffer; } else { tmp_nbuf = hdr_buf; } - - adf_nbuf_peek_header(tmp_nbuf, &anbdata, &anblen); - pHTCHdr = (HTC_FRAME_HDR *)anbdata; - + + adf_nbuf_peek_header(tmp_nbuf, &anbdata, &anblen); + pHTCHdr = (HTC_FRAME_HDR *)anbdata; + eid = pHTCHdr->EndpointID; - + if ((eid != 0) && (htc_complete_setup == 0)) { A_PRINTF("\nHTC Hdr EndpointID = %d, anblen = %d\n", pHTCHdr->EndpointID, anblen); A_PRINTF("HTC Hder : %2x-%2x-%2x-%2x-%2x-%2x-%2x-%2x-%2x-%2x-%2x-%2x\n", - *anbdata, *(anbdata+1), *(anbdata+2), *(anbdata+3), + *anbdata, *(anbdata+1), *(anbdata+2), *(anbdata+3), *(anbdata+4), *(anbdata+5), *(anbdata+6), *(anbdata+7), - *(anbdata+8), *(anbdata+9), *(anbdata+10), *(anbdata+11)); + *(anbdata+8), *(anbdata+9), *(anbdata+10), *(anbdata+11)); A_PRINTF("init_htc_handle = 0x%8x\n", init_htc_handle); - + if (pHTCHdr->EndpointID == 1) { A_PRINTF("Return WMI Command buffer\n"); HTC_ReturnBuffers(init_htc_handle, 1, tmp_nbuf); @@ -305,8 +305,8 @@ HTCMsgRecvHandler_patch(adf_nbuf_t hdr_buf, adf_nbuf_t buffer, void *context) } else { if ((pHTCHdr->EndpointID < 0) || (pHTCHdr->EndpointID >= ENDPOINT_MAX)) { A_PRINTF("HTC Hdr EndpointID = %d, anblen = %d\n", pHTCHdr->EndpointID, anblen); - A_PRINTF("HTC Hder : %2x-%2x-%2x-%2x-%2x-%2x-%2x-%2x\n", - *anbdata, *(anbdata+1), *(anbdata+2), *(anbdata+3), + A_PRINTF("HTC Hder : %2x-%2x-%2x-%2x-%2x-%2x-%2x-%2x\n", + *anbdata, *(anbdata+1), *(anbdata+2), *(anbdata+3), *(anbdata+4), *(anbdata+5), *(anbdata+6), *(anbdata+7)); if (anblen > 64) { diff --git a/target_firmware/magpie_fw_dev/target/init/magpie.c b/target_firmware/magpie_fw_dev/target/init/magpie.c index 186153d..ecf506c 100755 --- a/target_firmware/magpie_fw_dev/target/init/magpie.c +++ b/target_firmware/magpie_fw_dev/target/init/magpie.c @@ -97,7 +97,7 @@ void _wmi_cmd_rsp(void *pContext, WMI_COMMAND_ID cmd_id, A_UINT16 SeqNo, A_UINT8 *pData; netbuf = WMI_AllocEvent(pContext, WMI_EVT_CLASS_CMD_REPLY, sizeof(WMI_CMD_HDR) + Length); - + if (netbuf == ADF_NBUF_NULL) { adf_os_print("%s: buffer allocation for event_id %x failed!\n", __FUNCTION__, cmd_id); adf_os_assert(0); @@ -116,10 +116,10 @@ void _wmi_cmd_rsp(void *pContext, WMI_COMMAND_ID cmd_id, A_UINT16 SeqNo, void Magpie_init(void) { A_PRINTF("[+++Magpie_init]\n\r"); - + A_PRINTF("[+++VBUF_init(%d)]\n\r", MAX_BUF_NUM); VBUF_init(MAX_BUF_NUM); - + A_PRINTF("[+++VBUF_init(%d)]\n\r", MAX_DESC_NUM); VDESC_init(MAX_DESC_NUM); @@ -137,7 +137,7 @@ void Magpie_init(void) #if SYSTEM_MODULE_HP_EP6 HIF_config_pipe(hif_handle, HIF_USB_PIPE_MP_TX, 3); #endif - + A_PRINTF("[+++HIF_init(0)]\n\r"); HIF_start(hif_handle); @@ -172,7 +172,7 @@ void Magpie_init(void) WMI_RegisterDispatchTable(Magpie_Sys_Commands_Tbl.pContext, &Magpie_Sys_Commands_Tbl); #endif/* ZM_FM_LOOPBACK == 0 */ -#endif /* MAGPIE_ENABLE_WLAN */ +#endif /* MAGPIE_ENABLE_WLAN */ } #endif /* #if MAGPIE==1 */ diff --git a/target_firmware/magpie_fw_dev/target/rompatch/HIF_usb_patch.c b/target_firmware/magpie_fw_dev/target/rompatch/HIF_usb_patch.c index db3a89e..c90f318 100755 --- a/target_firmware/magpie_fw_dev/target/rompatch/HIF_usb_patch.c +++ b/target_firmware/magpie_fw_dev/target/rompatch/HIF_usb_patch.c @@ -1,105 +1,105 @@ -/* - * Copyright (c) 2013 Qualcomm Atheros, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted (subject to the limitations in the - * disclaimer below) provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Qualcomm Atheros nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE - * GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT - * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#include "sys_cfg.h" -#include "dt_defs.h" -#include "reg_defs.h" - +/* + * Copyright (c) 2013 Qualcomm Atheros, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted (subject to the limitations in the + * disclaimer below) provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Qualcomm Atheros nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE + * GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT + * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "sys_cfg.h" +#include "dt_defs.h" +#include "reg_defs.h" + #include -#include -#include -#include -#include -#include -#include - -#include "hif_usb.h" - -/* - * -- support more than 64 bytes command on ep4 -- - */ -int _HIFusb_get_max_msg_len_patch(hif_handle_t handle, int pipe) -{ - switch(pipe) { - case HIF_USB_PIPE_INTERRUPT: - case HIF_USB_PIPE_COMMAND: - return 512; - - default: - return 1600; - } -} - -/* - * -- move the usb_task to here -- - */ -void _HIFusb_isr_handler_patch(hif_handle_t h) -{ - A_USB_FW_TASK(); - +#include +#include +#include +#include +#include +#include + +#include "hif_usb.h" + +/* + * -- support more than 64 bytes command on ep4 -- + */ +int _HIFusb_get_max_msg_len_patch(hif_handle_t handle, int pipe) +{ + switch(pipe) { + case HIF_USB_PIPE_INTERRUPT: + case HIF_USB_PIPE_COMMAND: + return 512; + + default: + return 1600; + } +} + +/* + * -- move the usb_task to here -- + */ +void _HIFusb_isr_handler_patch(hif_handle_t h) +{ + A_USB_FW_TASK(); + _HIFusb_isr_handler(h); -} - - -/* - * -- reset usb dma -- - * - * - make sure DMA_START bit0 is zero - * - update DMA_START bit4 to 1 - * - update DESC_START_ADDR - * - update DMA_START bit 0 - */ -void _HIFusb_start_patch(hif_handle_t handle) -{ - MAGPIE_REG_USB_TX0_DMA_START = 0x0; - MAGPIE_REG_USB_RX0_DMA_START = 0x0; - MAGPIE_REG_USB_RX1_DMA_START = 0x0; - MAGPIE_REG_USB_RX2_DMA_START = 0x0; - - while( 1 ) - { - if(!MAGPIE_REG_USB_TX0_DMA_START && - !MAGPIE_REG_USB_RX0_DMA_START && - !MAGPIE_REG_USB_RX1_DMA_START && - !MAGPIE_REG_USB_RX2_DMA_START ) - { - MAGPIE_REG_USB_TX0_DMA_START = MAGPIE_REG_USB_TX0_DMA_START|BIT4; - MAGPIE_REG_USB_RX0_DMA_START = MAGPIE_REG_USB_RX0_DMA_START|BIT4; - MAGPIE_REG_USB_RX1_DMA_START = MAGPIE_REG_USB_RX1_DMA_START|BIT4; - MAGPIE_REG_USB_RX2_DMA_START = MAGPIE_REG_USB_RX2_DMA_START|BIT4; - break; - } - } +} + + +/* + * -- reset usb dma -- + * + * - make sure DMA_START bit0 is zero + * - update DMA_START bit4 to 1 + * - update DESC_START_ADDR + * - update DMA_START bit 0 + */ +void _HIFusb_start_patch(hif_handle_t handle) +{ + MAGPIE_REG_USB_TX0_DMA_START = 0x0; + MAGPIE_REG_USB_RX0_DMA_START = 0x0; + MAGPIE_REG_USB_RX1_DMA_START = 0x0; + MAGPIE_REG_USB_RX2_DMA_START = 0x0; + + while( 1 ) + { + if(!MAGPIE_REG_USB_TX0_DMA_START && + !MAGPIE_REG_USB_RX0_DMA_START && + !MAGPIE_REG_USB_RX1_DMA_START && + !MAGPIE_REG_USB_RX2_DMA_START ) + { + MAGPIE_REG_USB_TX0_DMA_START = MAGPIE_REG_USB_TX0_DMA_START|BIT4; + MAGPIE_REG_USB_RX0_DMA_START = MAGPIE_REG_USB_RX0_DMA_START|BIT4; + MAGPIE_REG_USB_RX1_DMA_START = MAGPIE_REG_USB_RX1_DMA_START|BIT4; + MAGPIE_REG_USB_RX2_DMA_START = MAGPIE_REG_USB_RX2_DMA_START|BIT4; + break; + } + } _HIFusb_start(handle); -} +} diff --git a/target_firmware/magpie_fw_dev/target/rompatch/cmnos_clock_patch.c b/target_firmware/magpie_fw_dev/target/rompatch/cmnos_clock_patch.c index 83594c2..c71007e 100755 --- a/target_firmware/magpie_fw_dev/target/rompatch/cmnos_clock_patch.c +++ b/target_firmware/magpie_fw_dev/target/rompatch/cmnos_clock_patch.c @@ -38,7 +38,7 @@ a_uint32_t ref_clk = 0; extern a_uint32_t cticks; -// clock change +// clock change // void cmnos_clock_init_patch(a_uint32_t refclk) { @@ -57,7 +57,7 @@ void cmnos_delay_us_patch(int us) { a_uint32_t start_time = NOW(); unsigned int num_ticks = us*ref_clk; // system_freq == number of ticks per 1us - + while ( (NOW() - start_time) < num_ticks) { /* busy spin */ ; @@ -84,6 +84,6 @@ void cmnos_tick_patch(void) a_uint32_t cmnos_milliseconds_patch(void) { cmnos_tick_patch(); - + return (cticks); } diff --git a/target_firmware/magpie_fw_dev/target/wlan/wlan_pci.c b/target_firmware/magpie_fw_dev/target/wlan/wlan_pci.c index d8db1e4..4bf63e3 100755 --- a/target_firmware/magpie_fw_dev/target/wlan/wlan_pci.c +++ b/target_firmware/magpie_fw_dev/target/wlan/wlan_pci.c @@ -47,7 +47,7 @@ A_PCI_INIT_FUNC g_pci_init_func; #define EMULATE_PCI_CONFIG #endif -#define PCI_CONFIG_BASE_ADDR 0x14000000 +#define PCI_CONFIG_BASE_ADDR 0x14000000 extern A_PCI_INIT_FUNC g_pci_init_func; adf_drv_info_t* g_wlan_drv = NULL; @@ -67,13 +67,13 @@ void wlan_pci_register_drv(adf_drv_info_t *drv) } #define ATHEROS_VENDOR_ID 0x168c -#define AR5416_DEVID_PCIE 0x24 +#define AR5416_DEVID_PCIE 0x24 void wlan_pci_probe(void) { __adf_softc_t *sc; adf_os_resource_t drv_res = {0}; - adf_os_attach_data_t drv_data = {{0}}; + adf_os_attach_data_t drv_data = {{0}}; int vendor_id; int device_id; @@ -82,17 +82,17 @@ void wlan_pci_probe(void) #if MAGPIE_ENABLE_PCIE == 0 vendor_id = ATHEROS_VENDOR_ID; device_id = AR5416_DEVID_PCIE; -#else +#else vendor_id = wlan_pci_config_read(0, 2); device_id = wlan_pci_config_read(2, 2); -#endif - A_PRINTF(": Vendor id 0x%x Dev id 0x%x\n", vendor_id, device_id); - +#endif + A_PRINTF(": Vendor id 0x%x Dev id 0x%x\n", vendor_id, device_id); + if (vendor_id != ATHEROS_VENDOR_ID) { - A_PRINTF(": Atheros card not found\n"); + A_PRINTF(": Atheros card not found\n"); return; } - + /** * Allocate the sc & zero down */ @@ -101,60 +101,60 @@ void wlan_pci_probe(void) A_PRINTF("Cannot malloc softc\n"); goto mem_fail; } - -#define AR5416_DEVID_PCIE 0x24 + +#define AR5416_DEVID_PCIE 0x24 drv_data.pci.device = AR5416_DEVID_PCIE; drv_data.pci.vendor = 0x168c; drv_data.pci.subvendor = 0; drv_data.pci.subdevice = 0; - + drv_res.start = (a_uint32_t) 0; drv_res.end = 0; drv_res.type = ADF_OS_RESOURCE_TYPE_MEM; - + g_wlan_drv_handle = g_wlan_drv->drv_attach(&drv_res, 1, &drv_data, NULL); - + return; mem_fail: - return; + return; } int wlan_pci_config_write(int offset, a_uint32_t val, int width) { -#if MAGPIE_ENABLE_PCIE == 1 +#if MAGPIE_ENABLE_PCIE == 1 unsigned long addr = ( PCI_CONFIG_BASE_ADDR + offset ) & 0xfffffffc; - A_UINT8 *ptr = (A_UINT8 *)addr; - A_UINT8 *valptr = (A_UINT8 *)&val; + A_UINT8 *ptr = (A_UINT8 *)addr; + A_UINT8 *valptr = (A_UINT8 *)&val; int idx = offset & 0x3; int i; - + for (i = 0; i < width; i++) { ptr[idx + i] = valptr[3-i]; - } + } #endif - - return 0; + + return 0; } int wlan_pci_config_read(int offset, int width) { -#if MAGPIE_ENABLE_PCIE == 0 - return 0; +#if MAGPIE_ENABLE_PCIE == 0 + return 0; #else unsigned long addr = ( PCI_CONFIG_BASE_ADDR + offset ) & 0xfffffffc; unsigned long value = *((unsigned long *)addr); - A_UINT8 *ptr = (A_UINT8 *)&value; + A_UINT8 *ptr = (A_UINT8 *)&value; int idx = offset & 0x3; int result = 0; int i; - + for (i = 0; i < width; i++) { result |= (ptr[ 3 - (idx + i)] << (8*i)); - } - - return result; -#endif + } + + return result; +#endif } void wlan_pci_isr() diff --git a/target_firmware/magpie_fw_dev/target/wlan/wlan_pci.h b/target_firmware/magpie_fw_dev/target/wlan/wlan_pci.h index 6afc895..3bbd446 100755 --- a/target_firmware/magpie_fw_dev/target/wlan/wlan_pci.h +++ b/target_firmware/magpie_fw_dev/target/wlan/wlan_pci.h @@ -34,9 +34,9 @@ */ /* * @File: wlan_pci.h - * - * @Abstract: - * + * + * @Abstract: + * * @Notes: */ diff --git a/target_firmware/magpie_fw_dev/target/wmi/wmi_internal.h b/target_firmware/magpie_fw_dev/target/wmi/wmi_internal.h index 123f2e0..d9480c4 100755 --- a/target_firmware/magpie_fw_dev/target/wmi/wmi_internal.h +++ b/target_firmware/magpie_fw_dev/target/wmi/wmi_internal.h @@ -33,11 +33,11 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* - * @File: - * + * @File: + * * @Abstract: internal data and structure definitions for WMI service - * - * @Notes: + * + * @Notes: */ #ifndef WMI_INTERNAL_H_ @@ -68,7 +68,7 @@ #endif /* WMI_DEBUG */ #define EVT_PKT_IN_USE (1 << 0) -#define EVT_PKT_IS_FREE(e) !((e)->Flags & EVT_PKT_IN_USE) +#define EVT_PKT_IS_FREE(e) !((e)->Flags & EVT_PKT_IN_USE) #define EVT_MARK_FREE(e) (e)->Flags &= ~EVT_PKT_IN_USE; #define EVT_MARK_INUSE(e) (e)->Flags |= EVT_PKT_IN_USE #define IS_EVT_CLASS_BUFFERED(ec) ((ec) != WMI_EVT_CLASS_DIRECT_BUFFER) @@ -76,16 +76,16 @@ typedef struct _WMI_POOL_STATE { int MaxAllocation; /* maximum allocations allowed for this pool */ int CurrentAllocation; /* current allocations outstanding */ -} WMI_POOL_STATE; +} WMI_POOL_STATE; typedef struct _WMI_SVC_CONTEXT { htc_handle_t HtcHandle; - pool_handle_t PoolHandle; + pool_handle_t PoolHandle; int PendingEvents; /* no. of pending events */ HTC_SERVICE WMIControlService; /* registered control service */ HTC_ENDPOINT_ID ControlEp; /* endpoint assigned to us */ WMI_DISPATCH_TABLE *pDispatchHead; /* dispatch list head ptr */ - WMI_DISPATCH_TABLE *pDispatchTail; /* dispatch list tail ptr */ + WMI_DISPATCH_TABLE *pDispatchTail; /* dispatch list tail ptr */ // Left a door for extension the structure void *pReserved; diff --git a/target_firmware/magpie_fw_dev/target/wmi/wmi_svc.c b/target_firmware/magpie_fw_dev/target/wmi/wmi_svc.c index 600c43d..b68dcfc 100755 --- a/target_firmware/magpie_fw_dev/target/wmi/wmi_svc.c +++ b/target_firmware/magpie_fw_dev/target/wmi/wmi_svc.c @@ -33,18 +33,18 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* - * @File: - * + * @File: + * * @Abstract: Wireless Module Interface Service Implementation - * - * @Notes: + * + * @Notes: */ #include #include #include #include #include -#include +#include #include #include "wmi_internal.h" @@ -55,9 +55,9 @@ static void WMIRecvMessageHandler(HTC_ENDPOINT_ID EndPt, adf_nbuf_t hdr_buf, void *pContext; WMI_SVC_CONTEXT *pWMI = (WMI_SVC_CONTEXT *)arg; WMI_DISPATCH_TABLE *pCurrentTable; - WMI_DISPATCH_ENTRY*pCurrentEntry; + WMI_DISPATCH_ENTRY*pCurrentEntry; WMI_CMD_HANDLER pCmdHandler; - A_UINT8* pCmdBuffer; + A_UINT8* pCmdBuffer; int i; A_UINT16 cmd; A_UINT16 seq; @@ -65,76 +65,76 @@ static void WMIRecvMessageHandler(HTC_ENDPOINT_ID EndPt, adf_nbuf_t hdr_buf, a_uint8_t *anbdata; a_uint32_t anblen; WMI_CMD_HDR *cmdHdr; - + adf_os_assert(hdr_buf == ADF_NBUF_NULL); do { length = adf_nbuf_len(pHTCBuf); if (length < sizeof(WMI_CMD_HDR)) { - break; + break; } adf_nbuf_peek_header(pHTCBuf, &anbdata, &anblen); - + pCurrentTable = pWMI->pDispatchHead; length = length - sizeof(WMI_CMD_HDR); - + cmdHdr = (WMI_CMD_HDR *)anbdata; cmd = adf_os_ntohs(cmdHdr->commandId); seq = adf_os_ntohs(cmdHdr->seqNo); - - pCmdBuffer = anbdata + sizeof(WMI_CMD_HDR); + + pCmdBuffer = anbdata + sizeof(WMI_CMD_HDR); pCmdHandler = NULL; - + while (pCurrentTable != NULL) { - + pContext = pCurrentTable->pContext; pCurrentEntry = pCurrentTable->pTable; - + /* scan table entries */ for (i = 0; i < pCurrentTable->NumberOfEntries; i++, pCurrentEntry++) { if (pCurrentEntry->CmdID == cmd) { /* found a match */ pCmdHandler = pCurrentEntry->pCmdHandler; - + /* optionally check length */ if ((pCurrentEntry->CheckLength != 0) && (length < pCurrentEntry->CheckLength)) { /* do not process command */ pCmdHandler = NULL; } - /* end search */ - break; - } - } - + /* end search */ + break; + } + } + if (pCmdHandler != NULL) { /* found a handler */ break; } - + /* scan next table */ pCurrentTable = pCurrentTable->pNext; } - + if (NULL == pCmdHandler) { - break; + break; } - + /* if we get here, we have a command handler to dispatch */ - + /* call dispatch function */ pCmdHandler(pContext, cmd, seq, pCmdBuffer, length); - + } while (FALSE); - - + + /* Invalidate the buffer (including HTC header). Note : we only need to invalidate up to the portion - * that was used (cache invalidate will also round up to the nearest cache line). + * that was used (cache invalidate will also round up to the nearest cache line). * The rest of the buffer should still be coherent. * */ - HTC_ReturnBuffers(pWMI->HtcHandle, EndPt, pHTCBuf); + HTC_ReturnBuffers(pWMI->HtcHandle, EndPt, pHTCBuf); } /* send completion handler when any HTC buffers are returned */ @@ -143,70 +143,70 @@ static void _WMI_SendCompleteHandler(HTC_ENDPOINT_ID Endpt, adf_nbuf_t pHTCBuf, WMI_SVC_CONTEXT *pWMI = (WMI_SVC_CONTEXT *)arg; WMI_BUF_CONTEXT *ctx; BUF_POOL_ID poolId; - + ctx = (WMI_BUF_CONTEXT *)adf_nbuf_get_priv(pHTCBuf); - + if ( ctx->EventClass == WMI_EVT_CLASS_CMD_EVENT ) { poolId = POOL_ID_WMI_SVC_EVENT; } else { poolId = POOL_ID_WMI_SVC_CMD_REPLY; } - + BUF_Pool_free_buf(pWMI->PoolHandle, poolId, pHTCBuf); } static A_UINT8 WMIServiceConnect(HTC_SERVICE *pService, - HTC_ENDPOINT_ID eid, - A_UINT8 *pDataIn, + HTC_ENDPOINT_ID eid, + A_UINT8 *pDataIn, int LengthIn, A_UINT8 *pDataOut, int *pLengthOut) { WMI_SVC_CONTEXT *pWMI = (WMI_SVC_CONTEXT *)pService->ServiceCtx; - + /* save the eid to use */ pWMI->ControlEp = eid; return HTC_SERVICE_SUCCESS; } /************** public APIS ********************************************/ - + static wmi_handle_t _WMI_Init(WMI_SVC_CONFIG *pWmiConfig) { WMI_SVC_CONTEXT *pWMI = NULL; int eventSize = WMI_SVC_MAX_BUFFERED_EVENT_SIZE + sizeof(WMI_CMD_HDR) + HTC_HDR_SZ; - + pWMI = (WMI_SVC_CONTEXT *)adf_os_mem_alloc(sizeof(WMI_SVC_CONTEXT)); if (pWMI == NULL) { - return NULL; + return NULL; } - + pWMI->pDispatchHead = NULL; pWMI->PoolHandle = pWmiConfig->PoolHandle; - pWMI->HtcHandle = pWmiConfig->HtcHandle; - - BUF_Pool_create_pool(pWmiConfig->PoolHandle, POOL_ID_WMI_SVC_CMD_REPLY, + pWMI->HtcHandle = pWmiConfig->HtcHandle; + + BUF_Pool_create_pool(pWmiConfig->PoolHandle, POOL_ID_WMI_SVC_CMD_REPLY, pWmiConfig->MaxCmdReplyEvts, eventSize); - - BUF_Pool_create_pool(pWmiConfig->PoolHandle, POOL_ID_WMI_SVC_EVENT, + + BUF_Pool_create_pool(pWmiConfig->PoolHandle, POOL_ID_WMI_SVC_EVENT, pWmiConfig->MaxEventEvts, eventSize); - - /* NOTE: since RAM allocation is zero-initialized, there is nothing to do for the + + /* NOTE: since RAM allocation is zero-initialized, there is nothing to do for the * direct event pool */ - + /* register the WMI control service */ pWMI->WMIControlService.ProcessRecvMsg = A_INDIR(wmi_svc_api._WMI_RecvMessageHandler); pWMI->WMIControlService.ProcessSendBufferComplete = A_INDIR(wmi_svc_api._WMI_SendCompleteHandler); pWMI->WMIControlService.ProcessConnect = A_INDIR(wmi_svc_api._WMI_ServiceConnect); pWMI->WMIControlService.MaxSvcMsgSize = WMI_SVC_MSG_SIZE + sizeof(WMI_CMD_HDR); - /* all buffers that are sent through the control endpoint are at least WMI_SVC_MAX_BUFFERED_EVENT_SIZE + /* all buffers that are sent through the control endpoint are at least WMI_SVC_MAX_BUFFERED_EVENT_SIZE * in size. Any WMI event that supplies a data buffer must insure that the space in the buffer * is at least this size. */ - pWMI->WMIControlService.TrailerSpcCheckLimit = WMI_SVC_MAX_BUFFERED_EVENT_SIZE; + pWMI->WMIControlService.TrailerSpcCheckLimit = WMI_SVC_MAX_BUFFERED_EVENT_SIZE; pWMI->WMIControlService.ServiceID = WMI_CONTROL_SVC; pWMI->WMIControlService.ServiceCtx = pWMI; HTC_RegisterService(pWmiConfig->HtcHandle, &pWMI->WMIControlService); - + return pWMI; } @@ -226,35 +226,35 @@ static void _WMI_RegisterDispatchTable(wmi_handle_t handle, WMI_DISPATCH_TABLE *pDispatchTable) { WMI_SVC_CONTEXT *pWMI = (WMI_SVC_CONTEXT *)handle; - + if (NULL == pWMI->pDispatchHead) { pWMI->pDispatchHead = pDispatchTable; - pWMI->pDispatchTail = pDispatchTable; + pWMI->pDispatchTail = pDispatchTable; } else { /* link to the tail */ pWMI->pDispatchTail->pNext = pDispatchTable; - pWMI->pDispatchTail = pDispatchTable; + pWMI->pDispatchTail = pDispatchTable; } } static adf_nbuf_t _WMI_AllocEvent(wmi_handle_t handle, WMI_EVT_CLASS EventClass, int Length) -{ +{ BUF_POOL_ID poolId; WMI_SVC_CONTEXT *pWMI = (WMI_SVC_CONTEXT *)handle; adf_nbuf_t buf; WMI_BUF_CONTEXT *ctx; - + if ( EventClass == WMI_EVT_CLASS_CMD_EVENT ) { poolId = POOL_ID_WMI_SVC_EVENT; } else { poolId = POOL_ID_WMI_SVC_CMD_REPLY; } - - buf = BUF_Pool_alloc_buf(pWMI->PoolHandle, - poolId, + + buf = BUF_Pool_alloc_buf(pWMI->PoolHandle, + poolId, sizeof(WMI_CMD_HDR) + HTC_GetReservedHeadroom(pWMI->HtcHandle)); - + if ( buf != NULL ) { ctx = (WMI_BUF_CONTEXT *)adf_nbuf_get_priv(buf); ctx->EventClass = EventClass; @@ -262,17 +262,17 @@ static adf_nbuf_t _WMI_AllocEvent(wmi_handle_t handle, WMI_EVT_CLASS EventClass, return buf; } -static void _WMI_SendEvent(wmi_handle_t handle, adf_nbuf_t pEvt, +static void _WMI_SendEvent(wmi_handle_t handle, adf_nbuf_t pEvt, A_UINT16 EventId, A_UINT16 SeqNo, int Length) { WMI_SVC_CONTEXT *pWMI = (WMI_SVC_CONTEXT *)handle; A_UINT8 *pBuffer; - + pBuffer = adf_nbuf_push_head(pEvt, sizeof(WMI_CMD_HDR)); - A_SET_UINT16_FIELD(pBuffer, WMI_CMD_HDR, commandId, adf_os_htons(EventId)); + A_SET_UINT16_FIELD(pBuffer, WMI_CMD_HDR, commandId, adf_os_htons(EventId)); A_SET_UINT16_FIELD(pBuffer, WMI_CMD_HDR, seqNo, adf_os_htons(SeqNo)); - - HTC_SendMsg(pWMI->HtcHandle, pWMI->ControlEp, pEvt); + + HTC_SendMsg(pWMI->HtcHandle, pWMI->ControlEp, pEvt); } static void _WMI_Shutdown(wmi_handle_t handle) diff --git a/target_firmware/magpie_fw_dev/target/wmi/wmi_svc_api.h b/target_firmware/magpie_fw_dev/target/wmi/wmi_svc_api.h index 68484e0..c6cb0db 100755 --- a/target_firmware/magpie_fw_dev/target/wmi/wmi_svc_api.h +++ b/target_firmware/magpie_fw_dev/target/wmi/wmi_svc_api.h @@ -52,7 +52,7 @@ typedef enum WMI_EVT_CLASS { WMI_EVT_CLASS_NONE = -1, WMI_EVT_CLASS_CMD_EVENT = 0, - WMI_EVT_CLASS_CMD_REPLY = 1, + WMI_EVT_CLASS_CMD_REPLY = 1, WMI_EVT_CLASS_MAX } WMI_EVT_CLASS; @@ -70,25 +70,25 @@ typedef struct _WMI_SVC_CONFIG { int MaxCmdReplyEvts; /* total buffers for command replies */ int MaxEventEvts; /* total buffers for low priority events */ } WMI_SVC_CONFIG; - + /* command dispatch entry */ typedef struct _WMI_DISPATCH_ENTRY { WMI_CMD_HANDLER pCmdHandler; /* dispatch function */ A_UINT16 CmdID; /* WMI command to dispatch from */ - A_UINT16 CheckLength; /* expected length of command, set to 0 to bypass check */ + A_UINT16 CheckLength; /* expected length of command, set to 0 to bypass check */ } WMI_DISPATCH_ENTRY; /* dispatch table that is used to register a set of dispatch entries */ typedef struct _WMI_DISPATCH_TABLE { struct _WMI_DISPATCH_TABLE *pNext; /* next dispatch, WMI-reserved */ - void *pContext; /* optional context that is passed to command handlers + void *pContext; /* optional context that is passed to command handlers assigned to this dispatch table */ int NumberOfEntries; /* number of elements pointed to by pTable */ WMI_DISPATCH_ENTRY *pTable; /* start of table */ } WMI_DISPATCH_TABLE; #define WMI_DISPATCH_ENTRY_COUNT(table) \ - (sizeof((table)) / sizeof(WMI_DISPATCH_ENTRY)) + (sizeof((table)) / sizeof(WMI_DISPATCH_ENTRY)) /* handy macro to declare a dispatch table */ #define WMI_DECLARE_DISPATCH_TABLE(name,dispatchEntries) \ @@ -100,15 +100,15 @@ WMI_DISPATCH_TABLE name = \ typedef struct _WMI_BUF_CONTEXT { HTC_BUF_CONTEXT HtcBufCtx; - - WMI_EVT_CLASS EventClass; /* the event class this packet belongs to */ - A_UINT16 Flags; /* internal flags reserved for WMI */ + + WMI_EVT_CLASS EventClass; /* the event class this packet belongs to */ + A_UINT16 Flags; /* internal flags reserved for WMI */ } WMI_BUF_CONTEXT; /* ROM-version, eventually. For now, in RAM */ - + typedef void* wmi_handle_t; - + /* the API table */ typedef struct _wmi_svc_apis { wmi_handle_t (* _WMI_Init)(WMI_SVC_CONFIG *pWmiConfig); @@ -119,15 +119,15 @@ typedef struct _wmi_svc_apis { void (* _WMI_SendCompleteHandler)(HTC_ENDPOINT_ID Endpt, adf_nbuf_t pHTCBuf, void *arg); int (* _WMI_GetControlEp)(wmi_handle_t h); void (* _WMI_Shutdown)(wmi_handle_t h); - + /* */ void (*_WMI_RecvMessageHandler)(HTC_ENDPOINT_ID EndPt, adf_nbuf_t hdr_buf, adf_nbuf_t pHTCBuf, void *arg); - A_UINT8 (*_WMI_ServiceConnect)(HTC_SERVICE *pService, HTC_ENDPOINT_ID eid, - A_UINT8 *pDataIn, + A_UINT8 (*_WMI_ServiceConnect)(HTC_SERVICE *pService, HTC_ENDPOINT_ID eid, + A_UINT8 *pDataIn, int LengthIn, A_UINT8 *pDataOut, int *pLengthOut); - + void *pReserved; /* for expansion if need be */ } WMI_SVC_APIS; diff --git a/target_firmware/wlan/_ieee80211.h b/target_firmware/wlan/_ieee80211.h index 1e64078..77a6883 100755 --- a/target_firmware/wlan/_ieee80211.h +++ b/target_firmware/wlan/_ieee80211.h @@ -83,9 +83,9 @@ enum ieee80211_protmode { */ #define IEEE80211_AMPDU_LIMIT_MIN (1 * 1024) #define IEEE80211_AMPDU_LIMIT_MAX (64 * 1024 - 1) -#define IEEE80211_AMPDU_SUBFRAME_MIN 2 -#define IEEE80211_AMPDU_SUBFRAME_MAX 64 -#define IEEE80211_AMPDU_SUBFRAME_DEFAULT 32 +#define IEEE80211_AMPDU_SUBFRAME_MIN 2 +#define IEEE80211_AMPDU_SUBFRAME_MAX 64 +#define IEEE80211_AMPDU_SUBFRAME_DEFAULT 32 #define IEEE80211_AMSDU_LIMIT_MAX 4096 struct ieee80211_rateset { diff --git a/target_firmware/wlan/ah.c b/target_firmware/wlan/ah.c index 0011d32..6d91fc0 100755 --- a/target_firmware/wlan/ah.c +++ b/target_firmware/wlan/ah.c @@ -142,14 +142,14 @@ ath_hal_computetxtime(struct ath_hal *ah, #undef OFDM_SYMBOL_TIME #ifdef MAGPIE_MERLIN -a_uint32_t +a_uint32_t ath_hal_get_curmode(struct ath_hal *ah, HAL_CHANNEL_INTERNAL *chan) { if (!chan) return HAL_MODE_11NG; if (IS_CHAN_NA(chan)) - return HAL_MODE_11NA; + return HAL_MODE_11NA; if (IS_CHAN_A(chan)) return HAL_MODE_11A; diff --git a/target_firmware/wlan/ah.h b/target_firmware/wlan/ah.h index 5bdc818..3c7b4c4 100755 --- a/target_firmware/wlan/ah.h +++ b/target_firmware/wlan/ah.h @@ -359,7 +359,7 @@ struct ath_hal a_uint32_t ah_magic; HAL_SOFTC ah_sc; adf_os_device_t ah_dev; - + a_uint32_t ah_macVersion; a_uint16_t ah_macRev; a_uint16_t ah_phyRev; @@ -368,20 +368,20 @@ struct ath_hal void __ahdecl(*ah_detach)(struct ath_hal*); HAL_BOOL __ahdecl(*ah_updateTxTrigLevel)(struct ath_hal*, HAL_BOOL incTrigLevel); - + /* Misc Functions */ - void __ahdecl(*ah_setDefAntenna)(struct ath_hal*, a_uint32_t); + void __ahdecl(*ah_setDefAntenna)(struct ath_hal*, a_uint32_t); void __ahdecl(*ah_setRxFilter)(struct ath_hal*, a_uint32_t); - - + + /* Target Transmit Functions */ HAL_BOOL __ahdecl(*ah_setTxDP)(struct ath_hal*, a_uint32_t, a_uint32_t txdp); - a_uint32_t __ahdecl(*ah_numTxPending)(struct ath_hal *, a_uint32_t q); + a_uint32_t __ahdecl(*ah_numTxPending)(struct ath_hal *, a_uint32_t q); HAL_BOOL __ahdecl(*ah_startTxDma)(struct ath_hal*, a_uint32_t); HAL_BOOL __ahdecl(*ah_stopTxDma)(struct ath_hal*, a_uint32_t); - + HAL_BOOL __ahdecl(*ah_abortTxDma)(struct ath_hal *); - + void __ahdecl(*ah_set11nTxDesc)(struct ath_tx_desc *ds, a_uint32_t pktLen, HAL_PKT_TYPE type, a_uint32_t txPower, a_uint32_t keyIx, @@ -400,7 +400,7 @@ struct ath_hal void __ahdecl(*ah_set11nBurstDuration)(struct ath_tx_desc *ds, a_uint32_t burstDuration); void __ahdecl(*ah_set11nVirtualMoreFrag)(struct ath_tx_desc *ds, a_uint32_t vmf); - + HAL_BOOL __ahdecl(*ah_setupTxDesc)(struct ath_tx_desc *, a_uint32_t pktLen, a_uint32_t hdrLen, HAL_PKT_TYPE type, a_uint32_t txPower, @@ -418,21 +418,21 @@ struct ath_hal a_uint32_t filter0, a_uint32_t filter1); u_int64_t __ahdecl(*ah_getTsf64)(struct ath_hal*); - + /* Target receive Functions */ void __ahdecl(*ah_setRxDP)(struct ath_hal*, a_uint32_t rxdp); HAL_BOOL __ahdecl(*ah_setupRxDesc)(struct ath_rx_desc *, a_uint32_t size, a_uint32_t flags); HAL_STATUS __ahdecl(*ah_procRxDesc)(struct ath_hal *, struct ath_desc *, a_uint32_t phyAddr, struct ath_desc *next, u_int64_t tsf); - HAL_STATUS __ahdecl(*ah_procRxDescFast)(struct ath_hal *ah, + HAL_STATUS __ahdecl(*ah_procRxDescFast)(struct ath_hal *ah, struct ath_rx_desc *ds, a_uint32_t pa, - struct ath_desc *nds, + struct ath_desc *nds, struct ath_rx_status *rx_stats); HAL_BOOL __ahdecl(*ah_stopDmaReceive)(struct ath_hal*); void __ahdecl(*ah_stopPcuReceive)(struct ath_hal*); void __ahdecl(*ah_enableReceive)(struct ath_hal*); - + /* Interrupt functions */ HAL_BOOL __ahdecl(*ah_isInterruptPending)(struct ath_hal*); HAL_BOOL __ahdecl(*ah_getPendingInterrupts)(struct ath_hal*, HAL_INT*); diff --git a/target_firmware/wlan/ar5416.h b/target_firmware/wlan/ar5416.h index df18434..535bbc2 100755 --- a/target_firmware/wlan/ar5416.h +++ b/target_firmware/wlan/ar5416.h @@ -77,8 +77,8 @@ typedef enum Ar5416_Rates { #define AR5416_PWR_TABLE_OFFSET -5 #define AR5416_LEGACY_CHAINMASK 1 #define AR5416_1_CHAINMASK 1 -#define AR5416_2LOHI_CHAINMASK 5 -#define AR5416_2LOMID_CHAINMASK 3 +#define AR5416_2LOHI_CHAINMASK 5 +#define AR5416_2LOMID_CHAINMASK 3 #define AR5416_3_CHAINMASK 7 #define AH5416(_ah) ((struct ath_hal_5416 *)(_ah)) @@ -104,10 +104,10 @@ struct ath_hal_5416 struct ath_hal_private ah_priv; /* base class */ a_uint16_t ah_antennaSwitchSwap; /* Controls mapping of OID request */ a_uint32_t ah_maskReg; /* copy of AR_IMR */ - + a_uint32_t ah_slottime; /* user-specified slot time */ a_int16_t ah_txPowerIndexOffset; - + a_uint32_t ah_intrTxqs; void *ah_cal_mem; a_uint16_t ah_ratesArray[Ar5416RateSize]; diff --git a/target_firmware/wlan/ar5416Phy.c b/target_firmware/wlan/ar5416Phy.c index 64f907b..ec80f20 100755 --- a/target_firmware/wlan/ar5416Phy.c +++ b/target_firmware/wlan/ar5416Phy.c @@ -55,13 +55,13 @@ /* TRUE_ALL_11N - valid for 20/40/Legacy, TRUE - Legacy only, TRUE_20 - HT 20 only, TRUE_40 - HT 40 only */ /* 4ms frame limit not used for NG mode. The values filled for HT are the 64K max aggregate limit */ -#ifndef MAGPIE_MERLIN // K2 +#ifndef MAGPIE_MERLIN // K2 RATE_TABLE_11N ar5416_11ngRateTable = { - 54, /* number of rates - should match the no. of rows below */ - 100, /* probe interval */ - 50, /* rssi reduce interval */ + 54, /* number of rates - should match the no. of rows below */ + 100, /* probe interval */ + 50, /* rssi reduce interval */ WLAN_RC_HT_FLAG, /* Phy rates allowed initially */ {/* Multiple Single */ /* stream stream short dot11 ctrl RssiAck RssiAck Base CW40 SGI Ht tx chain 4ms tx valid for*/ @@ -110,7 +110,7 @@ RATE_TABLE_11N ar5416_11ngRateTable = { /* 121.5Mb [41] */ { FALSE, TRUE_40, WLAN_PHY_HT_40_SS,121500,102700,0x86, 0x00, 6, 8, 23, 3, 20, 41, 42, 42, 1, 1, 60156, FALSE}, /* 135 Mb [42] */ { FALSE, TRUE_40, WLAN_PHY_HT_40_SS_HGI,135000,111900,0x86, 0x00, 6, 8, 23, 3, 20, 41, 42, 42, 1, 1, 66840, FALSE}, /* 135 Mb [43] */ { FALSE, TRUE_40, WLAN_PHY_HT_40_SS,135000,112000,0x87, 0x00, 7, 8, 25, 3, 22, 43, 44, 44, 1, 1, 66840, TRUE}, - /* 150 Mb [44] */ { FALSE, TRUE_40, WLAN_PHY_HT_40_SS_HGI,150000,122000,0x87, 0x00, 7, 8, 25, 3, 22, 43, 44, 44, 1, 1, 74200, TRUE}, + /* 150 Mb [44] */ { FALSE, TRUE_40, WLAN_PHY_HT_40_SS_HGI,150000,122000,0x87, 0x00, 7, 8, 25, 3, 22, 43, 44, 44, 1, 1, 74200, TRUE}, /* 108 Mb [45] */ { TRUE_40, FALSE, WLAN_PHY_HT_40_DS,108000,92500, 0x8b, 0x00, 11, 8, 10, 3, 24, 45, 45, 45, 3, 7, 53440, FALSE}, /* 162 Mb [46] */ { TRUE_40, FALSE, WLAN_PHY_HT_40_DS,162000,130300,0x8c, 0x00, 12, 8, 14, 3, 25, 46, 47, 47, 3, 7, 80160, TRUE}, /* 180 Mb [47] */ { FALSE, FALSE, WLAN_PHY_HT_40_DS_HGI,180000,156900,0x8c, 0x00, 12, 8, 14, 3, 25, 46, 47, 47, 3, 7, 89090, TRUE}, @@ -122,7 +122,7 @@ RATE_TABLE_11N ar5416_11ngRateTable = { /* 300 Mb [53] */ { TRUE_40, FALSE, WLAN_PHY_HT_40_DS_HGI,300000,207000,0x8f, 0x00, 15, 8, 25, 3, 31, 52, 53, 53, 3, 5, 148400, TRUE}, /* Multiple Single */ /* stream stream short dot11 ctrl RssiAck RssiAck Base CW40 SGI Ht tx chain 4ms tx valid for*/ - /* valid valid Kbps uKbps RC Preamble Rate Rate ValidMin DeltaMin Idx Idx Idx Idx mask limit UAPSD */ + /* valid valid Kbps uKbps RC Preamble Rate Rate ValidMin DeltaMin Idx Idx Idx Idx mask limit UAPSD */ }, }; @@ -130,9 +130,9 @@ RATE_TABLE_11N ar5416_11ngRateTable = { RATE_TABLE_11N ar5416_11ngRateTable = { - 46, /* number of rates - should match the no. of rows below */ - 50, /* probe interval */ - 50, /* rssi reduce interval */ + 46, /* number of rates - should match the no. of rows below */ + 50, /* probe interval */ + 50, /* rssi reduce interval */ WLAN_RC_HT_FLAG, /* Phy rates allowed initially */ {/* Multiple Single Single */ /* stream stream stream short dot11 ctrl RssiAck RssiAck Base CW40 SGI Ht tx chain 4ms tx valid for*/ @@ -173,7 +173,7 @@ RATE_TABLE_11N ar5416_11ngRateTable = { /* 108 Mb [33] */ { FALSE, TRUE_40, TRUE_40, WLAN_PHY_HT_40_SS,108000,92900, 0x85, 0x00, 5, 8, 20, 3, 17, 33, 33, 33, 1, 1, 53476, FALSE}, /* 121.5Mb [34] */ { FALSE, TRUE_40, TRUE_40, WLAN_PHY_HT_40_SS,121500,102700,0x86, 0x00, 6, 8, 23, 3, 18, 34, 34, 34, 1, 1, 60156, FALSE}, /* 135 Mb [35] */ { FALSE, TRUE_40, FALSE, WLAN_PHY_HT_40_SS,135000,112000,0x87, 0x00, 7, 8, 25, 3, 19, 35, 36, 36, 1, 1, 66840, TRUE}, - /* 150 Mb [36] */ { FALSE, TRUE_40, FALSE, WLAN_PHY_HT_40_SS_HGI,150000,122000,0x87, 0x00, 7, 8, 25, 3, 19, 35, 36, 36, 1, 1, 74200, TRUE}, + /* 150 Mb [36] */ { FALSE, TRUE_40, FALSE, WLAN_PHY_HT_40_SS_HGI,150000,122000,0x87, 0x00, 7, 8, 25, 3, 19, 35, 36, 36, 1, 1, 74200, TRUE}, /* 27 Mb [37] */ { FALSE, FALSE, FALSE, WLAN_PHY_HT_40_DS,27000, 25800, 0x88, 0x00, 8, 8, 2, 3, 20, 37, 37, 37, 3, 7, 13360, TRUE}, /* 54 Mb [38] */ { FALSE, FALSE, FALSE, WLAN_PHY_HT_40_DS,54000, 49800, 0x89, 0x00, 9, 8, 4, 3, 21, 38, 38, 38, 3, 7, 26720, FALSE}, /* 81 Mb [39] */ { FALSE, FALSE, FALSE, WLAN_PHY_HT_40_DS,81000, 71900, 0x8a, 0x00, 10, 8, 6, 3, 22, 39, 39, 39, 3, 7, 40080, TRUE}, @@ -185,7 +185,7 @@ RATE_TABLE_11N ar5416_11ngRateTable = { /* 300 Mb [45] */ { TRUE_40, FALSE, TRUE_40, WLAN_PHY_HT_40_DS_HGI,300000,207000,0x8f, 0x00, 15, 8, 25, 3, 27, 44, 45, 45, 3, 5, 148400, TRUE}, /* Multiple Single */ /* stream stream short dot11 ctrl RssiAck RssiAck Base CW40 SGI Ht tx chain 4ms tx valid for*/ - /* valid valid Kbps uKbps RC Preamble Rate Rate ValidMin DeltaMin Idx Idx Idx Idx mask limit UAPSD */ + /* valid valid Kbps uKbps RC Preamble Rate Rate ValidMin DeltaMin Idx Idx Idx Idx mask limit UAPSD */ }, }; @@ -193,9 +193,9 @@ RATE_TABLE_11N ar5416_11ngRateTable = { //static RATE_TABLE_11N ar5416_11naRateTable = { RATE_TABLE_11N ar5416_11naRateTable = { - 42, /* number of rates */ - 50, /* probe interval */ - 50, /* rssi reduce interval */ + 42, /* number of rates */ + 50, /* probe interval */ + 50, /* rssi reduce interval */ WLAN_RC_HT_FLAG, /* Phy rates allowed initially */ {/* Multiple Single Single*/ /* stream stream stream rate short dot11 ctrl RssiAck RssiAck Base CW40 SGI Ht tx chain 4ms tx valid for */ @@ -232,7 +232,7 @@ RATE_TABLE_11N ar5416_11naRateTable = { /* 108 Mb [29] */ { FALSE, TRUE_40, TRUE_40, WLAN_PHY_HT_40_SS,108000,92900, 0x85, 0x00, 5, 4, 20, 3, 13, 29, 29, 29, 1, 1, 53476, FALSE}, /* 121.5Mb [30] */ { FALSE, TRUE_40, TRUE_40, WLAN_PHY_HT_40_SS,121500,102700,0x86, 0x00, 6, 4, 23, 3, 14, 30, 30, 30, 1, 1, 60156, FALSE}, /* 135 Mb [31] */ { FALSE, TRUE_40, FALSE, WLAN_PHY_HT_40_SS,135000,112000,0x87, 0x00, 7, 4, 25, 3, 15, 31, 32, 32, 1, 1, 66840, TRUE}, - /* 150 Mb [32] */ { FALSE, TRUE_40, FALSE, WLAN_PHY_HT_40_SS_HGI,150000,122000,0x87, 0x00, 7, 8, 25, 3, 15, 31, 32, 32, 1, 1, 65535, TRUE}, + /* 150 Mb [32] */ { FALSE, TRUE_40, FALSE, WLAN_PHY_HT_40_SS_HGI,150000,122000,0x87, 0x00, 7, 8, 25, 3, 15, 31, 32, 32, 1, 1, 65535, TRUE}, /* 27 Mb [33] */ { FALSE, FALSE, FALSE, WLAN_PHY_HT_40_DS,27000, 25800, 0x88, 0x00, 8, 0, 2, 3, 16, 33, 33, 33, 3, 7, 13360, TRUE}, /* 54 Mb [34] */ { FALSE, FALSE, FALSE, WLAN_PHY_HT_40_DS,54000, 49800, 0x89, 0x00, 9, 2, 4, 3, 17, 34, 34, 34, 3, 7, 26720, FALSE}, /* 81 Mb [35] */ { FALSE, FALSE, FALSE, WLAN_PHY_HT_40_DS,81000, 71900, 0x8a, 0x00, 10, 2, 6, 3, 18, 35, 35, 35, 3, 7, 40080, TRUE}, @@ -243,12 +243,12 @@ RATE_TABLE_11N ar5416_11naRateTable = { /* 270 Mb [40] */ { TRUE_40, FALSE, TRUE_40, WLAN_PHY_HT_40_DS,270000,192100,0x8f, 0x00, 15, 4, 25, 3, 23, 40, 41, 41, 3, 5, 133600, TRUE}, /* 300 Mb [41] */ { TRUE_40, FALSE, TRUE_40, WLAN_PHY_HT_40_DS_HGI,300000,207000,0x8f, 0x00, 15, 4, 25, 3, 23, 40, 41, 41, 3, 5, 148400, TRUE}, /* stream stream rate short dot11 ctrl RssiAck RssiAck Base CW40 SGI Ht tx chain 4ms tx valid for */ - /* valid valid Kbps uKbps Code Preamble Rate Rate ValidMin DeltaMin Idx Idx Idx Idx mask limit UAPSD */ + /* valid valid Kbps uKbps Code Preamble Rate Rate ValidMin DeltaMin Idx Idx Idx Idx mask limit UAPSD */ }, }; #endif //ATH_SUPPORT_A_MODE -#endif //#ifdef MAGPIE_MERLIN // MAGPIE_MERLIN +#endif //#ifdef MAGPIE_MERLIN // MAGPIE_MERLIN void ar5416AttachRateTables(struct atheros_softc *sc) diff --git a/target_firmware/wlan/ar5416_hw.c b/target_firmware/wlan/ar5416_hw.c index 4d2a9f4..becd89d 100644 --- a/target_firmware/wlan/ar5416_hw.c +++ b/target_firmware/wlan/ar5416_hw.c @@ -58,7 +58,7 @@ static const struct ath_hal_private ar5416hal_10 = {{ /* Transmit functions */ .ah_updateTxTrigLevel = ar5416UpdateTxTrigLevel, .ah_setTxDP = ar5416SetTxDP, - .ah_numTxPending = ar5416NumTxPending, + .ah_numTxPending = ar5416NumTxPending, .ah_startTxDma = ar5416StartTxDma, .ah_stopTxDma = ar5416StopTxDma, @@ -316,7 +316,7 @@ HAL_BOOL ar5416StopDmaReceive(struct ath_hal *ah) void ar5416SetRxFilter(struct ath_hal *ah, a_uint32_t bits) { a_uint32_t phybits; - + iowrite32_mac(AR_RX_FILTER, (bits & 0xff) | AR_RX_COMPR_BAR); phybits = 0; if (bits & HAL_RX_FILTER_PHYRADAR) @@ -382,7 +382,7 @@ HAL_STATUS ar5416ProcRxDescFast_20(struct ath_hal *ah, struct ath_rx_desc *ds, return HAL_EINPROGRESS; /* - * Now we need to get the stats from the descriptor. Since desc are + * Now we need to get the stats from the descriptor. Since desc are * uncached, lets make a copy of the stats first. Note that, since we * touch most of the rx stats, a memcpy would always be more efficient * @@ -400,7 +400,7 @@ HAL_STATUS ar5416ProcRxDescFast_20(struct ath_hal *ah, struct ath_rx_desc *ds, rx_stats->rs_tstamp = ads.AR_RcvTimestamp; /* XXX what about KeyCacheMiss? */ - rx_stats->rs_rssi_combined = + rx_stats->rs_rssi_combined = MS(ads.ds_rxstatus4, AR_RxRSSICombined); rx_stats->rs_rssi_ctl0 = MS(ads.ds_rxstatus0, AR_RxRSSIAnt00); rx_stats->rs_rssi_ctl1 = MS(ads.ds_rxstatus0, AR_RxRSSIAnt01); @@ -601,7 +601,7 @@ HAL_BOOL ar5416AbortTxDma(struct ath_hal *ah) HAL_BOOL ar5416StopTxDma(struct ath_hal*ah, a_uint32_t q) { a_uint32_t i; - + HALASSERT(q < AH_PRIVATE(ah)->ah_caps.halTotalQueues); HALASSERT(AH5416(ah)->ah_txq[q].tqi_type != HAL_TX_QUEUE_INACTIVE); @@ -655,9 +655,9 @@ HAL_BOOL ar5416SetupTxDesc_20(struct ath_tx_desc *ds, ads->ds_ctl2 = SM(txTries0, AR_XmitDataTries0); ads->ds_ctl3 = (txRate0 << AR_XmitRate0_S); - ads->ds_ctl7 = SM(AR5416_LEGACY_CHAINMASK, AR_ChainSel0) + ads->ds_ctl7 = SM(AR5416_LEGACY_CHAINMASK, AR_ChainSel0) | SM(AR5416_LEGACY_CHAINMASK, AR_ChainSel1) - | SM(AR5416_LEGACY_CHAINMASK, AR_ChainSel2) + | SM(AR5416_LEGACY_CHAINMASK, AR_ChainSel2) | SM(AR5416_LEGACY_CHAINMASK, AR_ChainSel3); if (keyIx != HAL_TXKEYIX_INVALID) { @@ -732,7 +732,7 @@ HAL_STATUS ar5416ProcTxDesc_20(struct ath_hal *ah, struct ath_tx_desc *gds) { struct ar5416_desc *ads = AR5416DESC(gds); struct ath_tx_desc *ds = (struct ath_tx_desc *)gds; - + if ((ads->ds_txstatus9 & AR_TxDone) == 0) return HAL_EINPROGRESS; @@ -776,7 +776,7 @@ HAL_STATUS ar5416ProcTxDesc_20(struct ath_hal *ah, struct ath_tx_desc *gds) * ``alternate'' if it wasn't the series 0 rate. */ ds->ds_txstat.ts_rate = MS(ads->ds_txstatus9, AR_FinalTxIdx); - ds->ds_txstat.ts_rssi_combined = + ds->ds_txstat.ts_rssi_combined = MS(ads->ds_txstatus5, AR_TxRSSICombined); ds->ds_txstat.ts_rssi_ctl0 = MS(ads->ds_txstatus0, AR_TxRSSIAnt00); ds->ds_txstat.ts_rssi_ctl1 = MS(ads->ds_txstatus0, AR_TxRSSIAnt01); @@ -903,7 +903,7 @@ void ar5416Set11nAggrMiddle_20(struct ath_tx_desc *ds, a_uint32_t numDelims) ads->ds_ctl1 |= (AR_IsAggr | AR_MoreAggr); /* - * We use a stack variable to manipulate ctl6 to reduce uncached + * We use a stack variable to manipulate ctl6 to reduce uncached * read modify, modfiy, write. */ ctl6 = ads->ds_ctl6; diff --git a/target_firmware/wlan/ar5416desc.h b/target_firmware/wlan/ar5416desc.h index a56bd54..be7fac6 100755 --- a/target_firmware/wlan/ar5416desc.h +++ b/target_firmware/wlan/ar5416desc.h @@ -473,7 +473,7 @@ extern void ar5416Set11nTxDesc_20(struct ath_tx_desc *ds, a_uint32_t pktLen, HAL_PKT_TYPE type, a_uint32_t txPower, a_uint32_t keyIx, HAL_KEY_TYPE keyType, a_uint32_t flags); extern void ar5416Set11nRateScenario_20(struct ath_tx_desc *ds, - a_uint32_t durUpdateEn, a_uint32_t rtsctsRate, HAL_11N_RATE_SERIES series[], + a_uint32_t durUpdateEn, a_uint32_t rtsctsRate, HAL_11N_RATE_SERIES series[], a_uint32_t nseries, a_uint32_t flags); extern void ar5416Set11nAggrFirst_20(struct ath_tx_desc *ds, a_uint32_t aggrLen, a_uint32_t numDelims); @@ -487,7 +487,7 @@ extern void ar5416Set11nVirtualMoreFrag_20(struct ath_tx_desc *ds, a_uint32_t vmf); extern HAL_BOOL ar5416SetupRxDesc_20(struct ath_rx_desc *, a_uint32_t size, a_uint32_t flags); -extern HAL_STATUS ar5416ProcRxDescFast_20(struct ath_hal *ah, +extern HAL_STATUS ar5416ProcRxDescFast_20(struct ath_hal *ah, struct ath_rx_desc *, a_uint32_t, struct ath_desc *, struct ath_rx_status *); diff --git a/target_firmware/wlan/ar5416reg.h b/target_firmware/wlan/ar5416reg.h index 902f897..044a226 100755 --- a/target_firmware/wlan/ar5416reg.h +++ b/target_firmware/wlan/ar5416reg.h @@ -172,7 +172,7 @@ #define AR_SREV_VERSION_HOWL 0x014 #define AR_SREV_5416_V20_OR_LATER(_ah) (AR_SREV_HOWL((_ah)) || AR_SREV_OWL_20_OR_LATER(_ah)) -#define AR_SREV_5416_V22_OR_LATER(_ah) (AR_SREV_HOWL((_ah)) || AR_SREV_OWL_22_OR_LATER(_ah)) +#define AR_SREV_5416_V22_OR_LATER(_ah) (AR_SREV_HOWL((_ah)) || AR_SREV_OWL_22_OR_LATER(_ah)) #ifdef AR5416_EMULATION /* XXX - AR5416 Emulation only @@ -788,7 +788,7 @@ ((AH_PRIVATE((_ah))->ah_macVersion == AR_SREV_VERSION_MERLIN) && \ (AH_PRIVATE((_ah))->ah_macRev >= AR_SREV_REVISION_MERLIN_20))) -#define AR_SREV_SOWL(_ah) ((AH_PRIVATE((_ah))->ah_macVersion == AR_SREV_VERSION_SOWL)) +#define AR_SREV_SOWL(_ah) ((AH_PRIVATE((_ah))->ah_macVersion == AR_SREV_VERSION_SOWL)) #define AR_SREV_SOWL_11(_ah) (AR_SREV_SOWL(_ah) && (AH_PRIVATE((_ah))->ah_macRev == AR_SREV_REVISION_SOWL_11)) #define AR_RADIO_SREV_MAJOR 0xf0 diff --git a/target_firmware/wlan/ieee80211.h b/target_firmware/wlan/ieee80211.h index 39418b1..22565b8 100755 --- a/target_firmware/wlan/ieee80211.h +++ b/target_firmware/wlan/ieee80211.h @@ -42,7 +42,7 @@ /* is 802.11 address multicast/broadcast? */ #define IEEE80211_IS_MULTICAST(_a) (*(_a) & 0x01) -#ifdef __CARRIER_PLATFORM__ +#ifdef __CARRIER_PLATFORM__ #include #endif @@ -55,7 +55,7 @@ struct ieee80211_plcp_hdr { a_uint16_t i_crc; } adf_os_packed; -#define IEEE80211_PLCP_SFD 0xF3A0 +#define IEEE80211_PLCP_SFD 0xF3A0 #define IEEE80211_PLCP_SERVICE 0x00 /* @@ -339,7 +339,7 @@ enum CountryCode { CTRY_CANADA2 = 5001 /* Canada */ }; -/* +/* * Country information element. */ #define IEEE80211_COUNTRY_MAX_TRIPLETS (83) @@ -513,7 +513,7 @@ struct ieee80211_xr_param { } adf_os_packed; /* - * Management Action Frames + * Management Action Frames */ /* generic frame format */ @@ -535,7 +535,7 @@ struct ieee80211_action { /* HT - recommended transmission channel width */ struct ieee80211_action_ht_txchwidth { struct ieee80211_action at_header; - a_uint8_t at_chwidth; + a_uint8_t at_chwidth; } adf_os_packed; #define IEEE80211_A_HT_TXCHWIDTH_20 0 @@ -600,7 +600,7 @@ struct ieee80211_delba_parameterset { struct ieee80211_action_ba_addbarequest { struct ieee80211_action rq_header; a_uint8_t rq_dialogtoken; - struct ieee80211_ba_parameterset rq_baparamset; + struct ieee80211_ba_parameterset rq_baparamset; a_uint16_t rq_batimeout; /* in TUs */ struct ieee80211_ba_seqctrl rq_basequencectrl; } adf_os_packed; @@ -610,7 +610,7 @@ struct ieee80211_action_ba_addbaresponse { struct ieee80211_action rs_header; a_uint8_t rs_dialogtoken; a_uint16_t rs_statuscode; - struct ieee80211_ba_parameterset rs_baparamset; + struct ieee80211_ba_parameterset rs_baparamset; a_uint16_t rs_batimeout; /* in TUs */ } adf_os_packed; @@ -789,7 +789,7 @@ struct vendor_ie_htcap { /* HT capability flags */ #define IEEE80211_HTCAP_C_ADVCODING 0x0001 -#define IEEE80211_HTCAP_C_CHWIDTH40 0x0002 +#define IEEE80211_HTCAP_C_CHWIDTH40 0x0002 #define IEEE80211_HTCAP_C_SMPOWERSAVE_STATIC 0x0000 /* Capable of SM Power Save (Static) */ #define IEEE80211_HTCAP_C_SMPOWERSAVE_DYNAMIC 0x0004 /* Capable of SM Power Save (Dynamic) */ #define IEEE80211_HTCAP_C_SM_RESERVED 0x0008 /* Reserved */ @@ -801,10 +801,10 @@ struct vendor_ie_htcap { #define IEEE80211_HTCAP_C_RXSTBC 0x0100 /* 2 bits */ #define IEEE80211_HTCAP_C_DELAYEDBLKACK 0x0400 #define IEEE80211_HTCAP_C_MAXAMSDUSIZE 0x0800 /* 1 = 8K, 0 = 3839B */ -#define IEEE80211_HTCAP_C_DSSSCCK40 0x1000 -#define IEEE80211_HTCAP_C_PSMP 0x2000 -#define IEEE80211_HTCAP_C_INTOLERANT40 0x4000 -#define IEEE80211_HTCAP_C_LSIGTXOPPROT 0x8000 +#define IEEE80211_HTCAP_C_DSSSCCK40 0x1000 +#define IEEE80211_HTCAP_C_PSMP 0x2000 +#define IEEE80211_HTCAP_C_INTOLERANT40 0x4000 +#define IEEE80211_HTCAP_C_LSIGTXOPPROT 0x8000 #define IEEE80211_HTCAP_C_SM_MASK 0x000c /* Spatial Multiplexing (SM) capabitlity bitmask */ @@ -831,10 +831,10 @@ enum { /* HT extended capability flags */ #define IEEE80211_HTCAP_EXTC_PCO 0x0001 -#define IEEE80211_HTCAP_EXTC_TRANS_TIME_RSVD 0x0000 +#define IEEE80211_HTCAP_EXTC_TRANS_TIME_RSVD 0x0000 #define IEEE80211_HTCAP_EXTC_TRANS_TIME_400 0x0002 /* 20-40 switch time */ #define IEEE80211_HTCAP_EXTC_TRANS_TIME_1500 0x0004 /* in us */ -#define IEEE80211_HTCAP_EXTC_TRANS_TIME_5000 0x0006 +#define IEEE80211_HTCAP_EXTC_TRANS_TIME_5000 0x0006 #define IEEE80211_HTCAP_EXTC_RSVD_1 0x00f8 #define IEEE80211_HTCAP_EXTC_MCS_FEEDBACK_NONE 0x0000 #define IEEE80211_HTCAP_EXTC_MCS_FEEDBACK_RSVD 0x0100 @@ -898,23 +898,23 @@ struct vendor_ie_htinfo { /* extension channel offset (2 bit signed number) */ enum { - IEEE80211_HTINFO_EXTOFFSET_NA = 0, /* 0 no extension channel is present */ - IEEE80211_HTINFO_EXTOFFSET_ABOVE = 1, /* +1 extension channel above control channel */ - IEEE80211_HTINFO_EXTOFFSET_UNDEF = 2, /* -2 undefined */ + IEEE80211_HTINFO_EXTOFFSET_NA = 0, /* 0 no extension channel is present */ + IEEE80211_HTINFO_EXTOFFSET_ABOVE = 1, /* +1 extension channel above control channel */ + IEEE80211_HTINFO_EXTOFFSET_UNDEF = 2, /* -2 undefined */ IEEE80211_HTINFO_EXTOFFSET_BELOW = 3 /* -1 extension channel below control channel*/ }; /* recommended transmission width set */ enum { - IEEE80211_HTINFO_TXWIDTH_20, - IEEE80211_HTINFO_TXWIDTH_2040 + IEEE80211_HTINFO_TXWIDTH_20, + IEEE80211_HTINFO_TXWIDTH_2040 }; /* operating flags */ #define IEEE80211_HTINFO_OPMODE_PURE 0x00 /* no protection */ -#define IEEE80211_HTINFO_OPMODE_MIXED_PROT_OPT 0x01 /* prot optional (legacy device maybe present) */ -#define IEEE80211_HTINFO_OPMODE_MIXED_PROT_40 0x02 /* prot required (20 MHz) */ -#define IEEE80211_HTINFO_OPMODE_MIXED_PROT_ALL 0x03 /* prot required (legacy devices present) */ +#define IEEE80211_HTINFO_OPMODE_MIXED_PROT_OPT 0x01 /* prot optional (legacy device maybe present) */ +#define IEEE80211_HTINFO_OPMODE_MIXED_PROT_40 0x02 /* prot required (20 MHz) */ +#define IEEE80211_HTINFO_OPMODE_MIXED_PROT_ALL 0x03 /* prot required (legacy devices present) */ #define IEEE80211_HTINFO_OPMODE_MASK 0x03 /* For protection 0x00-0x03 */ /* Non-greenfield STAs present */ @@ -1180,7 +1180,7 @@ enum { #define IEEE80211_WEP_EXTIV 0x20 #define IEEE80211_WEP_EXTIVLEN 4 /* extended IV length */ #define IEEE80211_WEP_MICLEN 8 /* trailing MIC */ -#define IEEE80211_WEP_ICVLEN 4 +#define IEEE80211_WEP_ICVLEN 4 #define IEEE80211_WAPI_MICLEN 16 /* trailing MIC */ #define IEEE80211_WAPI_IVLEN 16 @@ -1232,7 +1232,7 @@ A length of 3839 bytes is chosen here to support unaggregated data frames, any s #define IEEE80211_AID(b) ((b) &~ 0xc000) -/* +/* * RTS frame length parameters. The default is specified in * the 802.11 spec. The max may be wrong for jumbo frames. */ @@ -1240,7 +1240,7 @@ A length of 3839 bytes is chosen here to support unaggregated data frames, any s #define IEEE80211_RTS_MIN 1 #define IEEE80211_RTS_MAX 2346 -/* +/* * Regulatory extention identifier for country IE. */ #define IEEE80211_REG_EXT_ID 201 diff --git a/target_firmware/wlan/ieee80211_node.h b/target_firmware/wlan/ieee80211_node.h index 16d361c..a6f283f 100755 --- a/target_firmware/wlan/ieee80211_node.h +++ b/target_firmware/wlan/ieee80211_node.h @@ -52,7 +52,7 @@ struct ieee80211_node_table { }; #define IEEE80211_KEYBUF_SIZE 16 -#define IEEE80211_TID_SIZE 17 +#define IEEE80211_TID_SIZE 17 #define IEEE80211_MICBUF_SIZE (8+8) /* space for both tx+rx keys */ struct ieee80211_key_target { diff --git a/target_firmware/wlan/ieee80211_output.c b/target_firmware/wlan/ieee80211_output.c index 1230e2c..dcfe9d4 100755 --- a/target_firmware/wlan/ieee80211_output.c +++ b/target_firmware/wlan/ieee80211_output.c @@ -136,4 +136,4 @@ ieee80211_tgt_crypto_encap(struct ieee80211_frame *wh, #undef CRYPTO_KEY_TYPE_WAPI #undef IEEE80211_WLAN_HDR_LEN } -#undef IEEE80211_ADDR_LEN +#undef IEEE80211_ADDR_LEN diff --git a/target_firmware/wlan/ieee80211_var.h b/target_firmware/wlan/ieee80211_var.h index fb7423e..c523413 100755 --- a/target_firmware/wlan/ieee80211_var.h +++ b/target_firmware/wlan/ieee80211_var.h @@ -47,7 +47,7 @@ /* * Built-in implementation for local skb free. Only interesting for platforms * that pass skbs between OS instances. - */ + */ #define ieee80211_tgt_free_local_nbuf( _nbuf) ieee80211_tgt_free_nbuf( _nbuf) diff --git a/target_firmware/wlan/if_ath_pci.h b/target_firmware/wlan/if_ath_pci.h index 69e10e0..b7e3719 100755 --- a/target_firmware/wlan/if_ath_pci.h +++ b/target_firmware/wlan/if_ath_pci.h @@ -39,7 +39,7 @@ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - + #ifndef _DEV_ATH_PCI_H_ #define _DEV_ATH_PCI_H_ diff --git a/target_firmware/wlan/if_athrate.h b/target_firmware/wlan/if_athrate.h index 9983c61..ca9d2fb 100755 --- a/target_firmware/wlan/if_athrate.h +++ b/target_firmware/wlan/if_athrate.h @@ -61,20 +61,20 @@ struct ath_ratectrl { #define ATH_RC_RTSCTS_FLAG 0x10 #define ATH_RC_TX_STBC_FLAG 0x20 /* TX STBC */ #define ATH_RC_RX_STBC_FLAG 0xC0 /* RX STBC ,2 bits */ -#define ATH_RC_RX_STBC_FLAG_S 6 +#define ATH_RC_RX_STBC_FLAG_S 6 #define ATH_RC_WEP_TKIP_FLAG 0x100 /* WEP/TKIP encryption */ enum ath_rc_cwmode{ ATH_RC_CW20_MODE, - ATH_RC_CW40_MODE, + ATH_RC_CW40_MODE, }; #define ATH_RC_PROBE_ALLOWED 0x00000001 #define ATH_RC_MINRATE_LASTRATE 0x00000002 struct ath_rc_series { - a_uint8_t rix; - a_uint8_t tries; + a_uint8_t rix; + a_uint8_t tries; u_int8_t tx_chainmask; a_uint8_t flags; a_uint32_t max4msframelen; @@ -113,7 +113,7 @@ void ath_rate_tx_complete(struct ath_softc_tgt *, struct ath_node_target *, a_int32_t nframes, a_int32_t nbad); -void ath_rate_stateupdate(struct ath_softc_tgt *sc, struct ath_node_target *an, +void ath_rate_stateupdate(struct ath_softc_tgt *sc, struct ath_node_target *an, enum ath_rc_cwmode cwmode); diff --git a/target_firmware/wlan/include/htc.h b/target_firmware/wlan/include/htc.h index a445a1f..15cdfee 100755 --- a/target_firmware/wlan/include/htc.h +++ b/target_firmware/wlan/include/htc.h @@ -42,8 +42,8 @@ #define ASSEMBLE_UNALIGNED_UINT16(p,highbyte,lowbyte) \ (((a_uint16_t)(((a_uint8_t *)(p))[(highbyte)])) << 8 | (a_uint16_t)(((a_uint8_t *)(p))[(lowbyte)])) - -/* alignment independent macros (little-endian) to fetch UINT16s or UINT8s from a + +/* alignment independent macros (little-endian) to fetch UINT16s or UINT8s from a * structure using only the type and field name. * Use these macros if there is the potential for unaligned buffer accesses. */ #define A_GET_UINT16_FIELD(p,type,field) \ @@ -56,23 +56,23 @@ ((a_uint8_t *)(p))[A_OFFSETOF(type,field)] = (a_uint8_t)((value) >> 8); \ ((a_uint8_t *)(p))[A_OFFSETOF(type,field) + 1] = (a_uint8_t)(value); \ } - + #define A_GET_UINT8_FIELD(p,type,field) \ ((a_uint8_t *)(p))[A_OFFSETOF(type,field)] - + #define A_SET_UINT8_FIELD(p,type,field,value) \ ((a_uint8_t *)(p))[A_OFFSETOF(type,field)] = (value) /****** DANGER DANGER *************** - * + * * The frame header length and message formats defined herein were * selected to accommodate optimal alignment for target processing. This reduces code * size and improves performance. - * + * * Any changes to the header length may alter the alignment and cause exceptions * on the target. When adding to the message structures insure that fields are * properly aligned. - * + * */ /* endpoint defines */ @@ -80,8 +80,8 @@ typedef enum { ENDPOINT_UNUSED = -1, ENDPOINT0 = 0, /* this is reserved for the control endpoint */ - ENDPOINT1 = 1, - ENDPOINT2 = 2, + ENDPOINT1 = 1, + ENDPOINT2 = 2, ENDPOINT3 = 3, ENDPOINT4, ENDPOINT5, @@ -99,13 +99,13 @@ typedef PREPACK struct _HTC_FRAME_HDR{ a_uint8_t EndpointID; a_uint8_t Flags; a_uint16_t PayloadLen; /* length of data (including trailer) that follows the header */ - + /***** end of 4-byte lookahead ****/ - + a_uint8_t ControlBytes[4]; - + /* message payload starts after the header */ - + } POSTPACK HTC_FRAME_HDR; /* frame header flags */ @@ -121,24 +121,24 @@ typedef PREPACK struct _HTC_FRAME_HDR{ typedef enum { HTC_MSG_READY_ID = 1, HTC_MSG_CONNECT_SERVICE_ID = 2, - HTC_MSG_CONNECT_SERVICE_RESPONSE_ID = 3, + HTC_MSG_CONNECT_SERVICE_RESPONSE_ID = 3, HTC_MSG_SETUP_COMPLETE_ID = 4, HTC_MSG_CONFIG_PIPE_ID = 5, HTC_MSG_CONFIG_PIPE_RESPONSE_ID = 6, } HTC_MSG_IDS; - + #define HTC_MAX_CONTROL_MESSAGE_LENGTH 256 - + /* base message ID header */ typedef PREPACK struct { - a_uint16_t MessageID; + a_uint16_t MessageID; } POSTPACK HTC_UNKNOWN_MSG; - + /* HTC ready message * direction : target-to-host */ typedef PREPACK struct { a_uint16_t MessageID; /* ID */ - a_uint16_t CreditCount; /* number of credits the target can offer */ + a_uint16_t CreditCount; /* number of credits the target can offer */ a_uint16_t CreditSize; /* size of each credit */ a_uint8_t MaxEndpoints; /* maximum number of endpoints the target has resources for */ a_uint8_t _Pad1; @@ -150,24 +150,24 @@ typedef PREPACK struct { * direction : host-to-target */ typedef PREPACK struct { a_uint16_t MessageID; - a_uint16_t ServiceID; /* service ID of the service to connect to */ + a_uint16_t ServiceID; /* service ID of the service to connect to */ a_uint16_t ConnectionFlags; /* connection flags */ a_uint8_t DownLinkPipeID; a_uint8_t UpLinkPipeID; -#define HTC_CONNECT_FLAGS_REDUCE_CREDIT_DRIBBLE (1 << 2) /* reduce credit dribbling when - the host needs credits */ -#define HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_MASK (0x3) +#define HTC_CONNECT_FLAGS_REDUCE_CREDIT_DRIBBLE (1 << 2) /* reduce credit dribbling when + the host needs credits */ +#define HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_MASK (0x3) #define HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_ONE_FOURTH 0x0 #define HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_ONE_HALF 0x1 #define HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_THREE_FOURTHS 0x2 #define HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_UNITY 0x3 - + a_uint8_t ServiceMetaLength; /* length of meta data that follows */ a_uint8_t _Pad1; - + /* service-specific meta data starts after the header */ - + } POSTPACK HTC_CONNECT_SERVICE_MSG; /* connect response @@ -175,14 +175,14 @@ typedef PREPACK struct { typedef PREPACK struct { a_uint16_t MessageID; a_uint16_t ServiceID; /* service ID that the connection request was made */ - a_uint8_t Status; /* service connection status */ + a_uint8_t Status; /* service connection status */ a_uint8_t EndpointID; /* assigned endpoint ID */ a_uint16_t MaxMsgSize; /* maximum expected message size on this endpoint */ a_uint8_t ServiceMetaLength; /* length of meta data that follows */ - a_uint8_t _Pad1; - + a_uint8_t _Pad1; + /* service-specific meta data starts after the header */ - + } POSTPACK HTC_CONNECT_SERVICE_RESPONSE_MSG; typedef PREPACK struct { @@ -194,26 +194,26 @@ typedef PREPACK struct { * direction : host-to-target */ typedef PREPACK struct { a_uint16_t MessageID; - a_uint8_t PipeID; /* Pipe ID of the service to connect to */ - a_uint8_t CreditCount; /* CreditCount */ - //a_uint8_t _Pad1; + a_uint8_t PipeID; /* Pipe ID of the service to connect to */ + a_uint8_t CreditCount; /* CreditCount */ + //a_uint8_t _Pad1; } POSTPACK HTC_CONFIG_PIPE_MSG; /* config pipe * direction : host-to-target */ typedef PREPACK struct { a_uint16_t MessageID; - a_uint8_t PipeID; /* Pipe ID of the service to connect to */ - a_uint8_t Status; /* status */ - //a_uint8_t _Pad1; + a_uint8_t PipeID; /* Pipe ID of the service to connect to */ + a_uint8_t Status; /* status */ + //a_uint8_t _Pad1; } POSTPACK HTC_CONFIG_PIPE_RESPONSE_MSG; /* connect response status codes */ #define HTC_SERVICE_SUCCESS 0 /* success */ #define HTC_SERVICE_NOT_FOUND 1 /* service could not be found */ #define HTC_SERVICE_FAILED 2 /* specific service failed the connect */ -#define HTC_SERVICE_NO_RESOURCES 3 /* no resources (i.e. no more endpoints) */ -#define HTC_SERVICE_NO_MORE_EP 4 /* specific service is not allowing any more +#define HTC_SERVICE_NO_RESOURCES 3 /* no resources (i.e. no more endpoints) */ +#define HTC_SERVICE_NO_MORE_EP 4 /* specific service is not allowing any more endpoints */ /* shihhung: config pipe response status code */ @@ -225,7 +225,7 @@ typedef PREPACK struct { typedef enum { HTC_RECORD_NULL = 0, HTC_RECORD_CREDITS = 1, - HTC_RECORD_LOOKAHEAD = 2, + HTC_RECORD_LOOKAHEAD = 2, } HTC_RPT_IDS; typedef PREPACK struct { @@ -238,14 +238,14 @@ typedef PREPACK struct { a_uint8_t Credits; /* credits to report since last report */ } POSTPACK HTC_CREDIT_REPORT; -typedef PREPACK struct { +typedef PREPACK struct { a_uint8_t PreValid; /* pre valid guard */ a_uint8_t LookAhead[4]; /* 4 byte lookahead */ a_uint8_t PostValid; /* post valid guard */ - + /* NOTE: the LookAhead array is guarded by a PreValid and Post Valid guard bytes. * The PreValid bytes must equal the inverse of the PostValid byte */ - + } POSTPACK HTC_LOOKAHEAD_REPORT; #ifndef ATH_TARGET diff --git a/target_firmware/wlan/include/htc_services.h b/target_firmware/wlan/include/htc_services.h index d2ae5fc..41e437c 100755 --- a/target_firmware/wlan/include/htc_services.h +++ b/target_firmware/wlan/include/htc_services.h @@ -39,8 +39,8 @@ typedef enum { RSVD_SERVICE_GROUP = 0, - WMI_SERVICE_GROUP = 1, - + WMI_SERVICE_GROUP = 1, + HTC_TEST_GROUP = 254, HTC_SERVICE_GROUP_LAST = 255 } HTC_SERVICE_GROUP_IDS; @@ -53,8 +53,8 @@ typedef enum { #define HTC_LOOPBACK_RSVD_SVC MAKE_SERVICE_ID(RSVD_SERVICE_GROUP,2) #define WMI_CONTROL_SVC MAKE_SERVICE_ID(WMI_SERVICE_GROUP,0) -#define WMI_BEACON_SVC MAKE_SERVICE_ID(WMI_SERVICE_GROUP,1) -#define WMI_CAB_SVC MAKE_SERVICE_ID(WMI_SERVICE_GROUP,2) +#define WMI_BEACON_SVC MAKE_SERVICE_ID(WMI_SERVICE_GROUP,1) +#define WMI_CAB_SVC MAKE_SERVICE_ID(WMI_SERVICE_GROUP,2) #define WMI_UAPSD_SVC MAKE_SERVICE_ID(WMI_SERVICE_GROUP,3) #define WMI_MGMT_SVC MAKE_SERVICE_ID(WMI_SERVICE_GROUP,4) diff --git a/target_firmware/wlan/include/k2/wlan_cfg.h b/target_firmware/wlan/include/k2/wlan_cfg.h index ce42d2c..85a04c9 100755 --- a/target_firmware/wlan/include/k2/wlan_cfg.h +++ b/target_firmware/wlan/include/k2/wlan_cfg.h @@ -82,7 +82,7 @@ #define ATH_VERSION_MAJOR 1 #define ATH_VERSION_MINOR 4 - + /************************** HAL configurations **************************/ #define HAL_DESC_OPTIMIZATION diff --git a/target_firmware/wlan/include/magpie/wlan_cfg.h b/target_firmware/wlan/include/magpie/wlan_cfg.h index 2590e9f..ebd7a69 100755 --- a/target_firmware/wlan/include/magpie/wlan_cfg.h +++ b/target_firmware/wlan/include/magpie/wlan_cfg.h @@ -63,7 +63,7 @@ #define ATH_NO_VIRTUAL_MEMORY //#define ATH_SUPPORT_XB_ONLY -#define ATH_SUPPORT_A_MODE +#define ATH_SUPPORT_A_MODE #define ATH_VERSION_MAJOR 1 #define ATH_VERSION_MINOR 4 diff --git a/target_firmware/wlan/include/wlan_hdr.h b/target_firmware/wlan/include/wlan_hdr.h index cfcfa0a..b343637 100755 --- a/target_firmware/wlan/include/wlan_hdr.h +++ b/target_firmware/wlan/include/wlan_hdr.h @@ -61,8 +61,8 @@ typedef struct _mgt_header { } POSTPACK ath_mgt_hdr_t; typedef struct _beacon_header { - a_uint8_t vap_index; - a_uint8_t len_changed; + a_uint8_t vap_index; + a_uint8_t len_changed; a_uint16_t reserved; } ath_beacon_hdr_t; @@ -79,7 +79,7 @@ typedef struct __data_header { a_uint8_t ni_index; a_uint8_t vap_index; a_uint8_t tidno; - a_uint32_t flags; + a_uint32_t flags; a_int8_t keytype; a_int8_t keyix; a_uint8_t cookie; @@ -101,7 +101,7 @@ struct ieee80211com_target { #define VAP_TARGET_SIZE 12 -struct ieee80211vap_target +struct ieee80211vap_target { a_uint8_t iv_vapindex; a_uint8_t iv_opmode; /* enum ieee80211_opmode */ @@ -170,11 +170,11 @@ struct ath_tx_stats { a_uint32_t ast_tx_altrate; /* tx frames with alternate rate */ a_uint32_t ast_tx_protect; /* tx frames with protection */ - a_uint32_t tx_tgt; /* tx data pkts recieved on target */ + a_uint32_t tx_tgt; /* tx data pkts recieved on target */ a_uint32_t tx_qnull; /* txq empty occurences */ a_uint32_t txaggr_nframes; /* no. of frames aggregated */ - a_uint32_t tx_compunaggr; /* tx unaggregated frame completions */ + a_uint32_t tx_compunaggr; /* tx unaggregated frame completions */ a_uint32_t tx_compaggr; /* tx aggregated completions */ a_uint32_t txaggr_retries; /* tx retries of sub frames */ a_uint32_t txaggr_single; /* tx frames not aggregated */ @@ -219,7 +219,7 @@ struct ath_aggr_info { a_uint8_t tidno; a_uint8_t aggr_enable; a_uint8_t padding; -}; +}; struct wmi_data_delba { a_uint8_t ni_nodeindex; @@ -233,4 +233,4 @@ struct wmi_fw_version { a_uint16_t minor; }; -#endif +#endif diff --git a/target_firmware/wlan/include/wmi.h b/target_firmware/wlan/include/wmi.h index 1c66797..194c38e 100755 --- a/target_firmware/wlan/include/wmi.h +++ b/target_firmware/wlan/include/wmi.h @@ -103,13 +103,13 @@ typedef enum { typedef PREPACK struct { - a_int8_t rssi; + a_int8_t rssi; a_uint8_t info; /* WMI_MSG_TYPE in lower 2 bits - b1b0 */ /* UP in next 3 bits - b4b3b2 */ #define WMI_DATA_HDR_MSG_TYPE_MASK 0x03 #define WMI_DATA_HDR_MSG_TYPE_SHIFT 0 #define WMI_DATA_HDR_UP_MASK 0x07 -#define WMI_DATA_HDR_UP_SHIFT 2 +#define WMI_DATA_HDR_UP_SHIFT 2 #define WMI_DATA_HDR_IS_MSG_TYPE(h, t) (((h)->info & (WMI_DATA_HDR_MSG_TYPE_MASK)) == (t)) } POSTPACK WMI_DATA_HDR; @@ -174,7 +174,7 @@ typedef enum { WMI_FRAME_PROBE_RESP, WMI_FRAME_ASSOC_REQ, WMI_FRAME_ASSOC_RESP, - WMI_NUM_MGMT_FRAME + WMI_NUM_MGMT_FRAME } WMI_MGMT_FRAME_TYPE; /* @@ -194,7 +194,7 @@ typedef enum { } DOT11_AUTH_MODE; typedef enum { - NONE_AUTH = 0x01, + NONE_AUTH = 0x01, WPA_AUTH = 0x02, WPA_PSK_AUTH = 0x03, WPA2_AUTH = 0x04, diff --git a/target_firmware/wlan/ratectrl.h b/target_firmware/wlan/ratectrl.h index 020d9df..68c021f 100755 --- a/target_firmware/wlan/ratectrl.h +++ b/target_firmware/wlan/ratectrl.h @@ -115,7 +115,7 @@ enum { #define RX_FLIP_THRESHOLD 3 /* XXX */ -#ifdef MAGPIE_MERLIN +#ifdef MAGPIE_MERLIN #define MAX_TX_RATE_TBL 46 #else #define MAX_TX_RATE_TBL 54//46 @@ -149,7 +149,7 @@ typedef struct TxRateCtrl_s { typedef struct phy_rate_ctrl { /* 11n state */ A_UINT8 validPhyRateCount[WLAN_RC_PHY_MAX]; /* valid rate count */ - A_UINT8 validPhyRateIndex[WLAN_RC_PHY_MAX][MAX_TX_RATE_TBL]; /* index */ + A_UINT8 validPhyRateIndex[WLAN_RC_PHY_MAX][MAX_TX_RATE_TBL]; /* index */ }PHY_STATE_CTRL; /* per-node state */ @@ -272,7 +272,7 @@ void rcSibInit(struct ath_softc_tgt *, struct ath_node_target *); /* * Determines and returns the new Tx rate index. - */ + */ A_UINT16 rcRateFind(struct ath_softc_tgt *, struct atheros_node *, A_UINT32 frameLen,const RATE_TABLE *pRateTable); diff --git a/target_firmware/wlan/ratectrl11n.h b/target_firmware/wlan/ratectrl11n.h index 28b8ebd..ccd6f77 100755 --- a/target_firmware/wlan/ratectrl11n.h +++ b/target_firmware/wlan/ratectrl11n.h @@ -40,8 +40,8 @@ * used only in 20 mode. If both 20/40 bits are enabled * then that rate can be used for both 20 and 40 mode */ -#define TRUE_20 0x2 -#define TRUE_40 0x4 +#define TRUE_20 0x2 +#define TRUE_40 0x4 #define TRUE_2040 (TRUE_20|TRUE_40) #define TRUE_ALL_11N (TRUE_2040|TRUE) @@ -62,19 +62,19 @@ typedef enum { #define WLAN_RC_PHY_DS(_phy) ((_phy == WLAN_RC_PHY_HT_20_DS) \ || (_phy == WLAN_RC_PHY_HT_40_DS) \ || (_phy == WLAN_RC_PHY_HT_20_DS_HGI) \ - || (_phy == WLAN_RC_PHY_HT_40_DS_HGI)) + || (_phy == WLAN_RC_PHY_HT_40_DS_HGI)) #define WLAN_RC_PHY_40(_phy) ((_phy == WLAN_RC_PHY_HT_40_SS) \ || (_phy == WLAN_RC_PHY_HT_40_DS) \ || (_phy == WLAN_RC_PHY_HT_40_SS_HGI) \ - || (_phy == WLAN_RC_PHY_HT_40_DS_HGI)) + || (_phy == WLAN_RC_PHY_HT_40_DS_HGI)) #define WLAN_RC_PHY_20(_phy) ((_phy == WLAN_RC_PHY_HT_20_SS) \ || (_phy == WLAN_RC_PHY_HT_20_DS) \ || (_phy == WLAN_RC_PHY_HT_20_SS_HGI) \ - || (_phy == WLAN_RC_PHY_HT_20_DS_HGI)) + || (_phy == WLAN_RC_PHY_HT_20_DS_HGI)) #define WLAN_RC_PHY_SGI(_phy) ((_phy == WLAN_RC_PHY_HT_20_SS_HGI) \ || (_phy == WLAN_RC_PHY_HT_20_DS_HGI) \ || (_phy == WLAN_RC_PHY_HT_40_SS_HGI) \ - || (_phy == WLAN_RC_PHY_HT_40_DS_HGI)) + || (_phy == WLAN_RC_PHY_HT_40_DS_HGI)) #define WLAN_RC_PHY_HT(_phy) (_phy >= WLAN_RC_PHY_HT_20_SS) @@ -102,7 +102,7 @@ typedef enum { #define WLAN_RC_WEP_TKIP_FLAG (0x100) /* Index into the rate table */ -#define INIT_RATE_MAX_20 23 +#define INIT_RATE_MAX_20 23 #define INIT_RATE_MAX_40 40 /* @@ -129,7 +129,7 @@ typedef struct { A_BOOL validSingleStream;/* Valid for use in rate control for single stream operation */ #ifdef MAGPIE_MERLIN A_BOOL validSTBC; /* Valid for use in rate control for single stream operation */ -#endif +#endif WLAN_PHY phy; /* CCK/OFDM/TURBO/XR */ A_UINT32 rateKbps; /* Rate in Kbits per second */ A_UINT32 userRateKbps; /* User rate in KBits per second */ @@ -159,7 +159,7 @@ typedef struct { /* * Determines and returns the new Tx rate index. - */ + */ void rcRateFind_11n(struct ath_softc_tgt *sc, struct ath_node_target *an, int numTries, diff --git a/target_firmware/wlan/ratectrl_11n_ln.c b/target_firmware/wlan/ratectrl_11n_ln.c index de10a27..9358823 100755 --- a/target_firmware/wlan/ratectrl_11n_ln.c +++ b/target_firmware/wlan/ratectrl_11n_ln.c @@ -56,13 +56,13 @@ #include "ratectrl.h" #include "ratectrl11n.h" -static void ath_rate_newassoc_11n(struct ath_softc_tgt *sc, struct ath_node_target *an, int isnew, +static void ath_rate_newassoc_11n(struct ath_softc_tgt *sc, struct ath_node_target *an, int isnew, unsigned int capflag, struct ieee80211_rate *rs); -static void ath_rate_tx_complete_11n(struct ath_softc_tgt *sc, struct ath_node_target *an, +static void ath_rate_tx_complete_11n(struct ath_softc_tgt *sc, struct ath_node_target *an, struct ath_tx_desc *ds, - struct ath_rc_series rcs[], int nframes, + struct ath_rc_series rcs[], int nframes, int nbad); static void ath_rate_findrate_11n(struct ath_softc_tgt *sc, @@ -82,7 +82,7 @@ rcSortValidRates(const RATE_TABLE_11N *pRateTable, TX_RATE_CTRL *pRc) for (i=pRc->maxValidRate-1; i > 0; i--) { for (j=0; j <= i-1; j++) { -#ifdef MAGPIE_MERLIN +#ifdef MAGPIE_MERLIN if (pRateTable->info[pRc->validRateIndex[j]].rateKbps > pRateTable->info[pRc->validRateIndex[j+1]].rateKbps) #else @@ -122,7 +122,7 @@ rcSetValidTxMask(TX_RATE_CTRL *pRc, A_UINT8 index, A_BOOL validTxRate) /* Iterators for validTxRateMask */ static INLINE A_BOOL -rcGetNextValidTxRate(const RATE_TABLE_11N *pRateTable, TX_RATE_CTRL *pRc, +rcGetNextValidTxRate(const RATE_TABLE_11N *pRateTable, TX_RATE_CTRL *pRc, A_UINT8 curValidTxRate, A_UINT8 *pNextIndex) { A_UINT8 i; @@ -136,12 +136,12 @@ rcGetNextValidTxRate(const RATE_TABLE_11N *pRateTable, TX_RATE_CTRL *pRc, /* No more valid rates */ *pNextIndex = 0; - + return FALSE; } static INLINE A_BOOL -rcGetNextLowerValidTxRate(const RATE_TABLE_11N *pRateTable, TX_RATE_CTRL *pRc, +rcGetNextLowerValidTxRate(const RATE_TABLE_11N *pRateTable, TX_RATE_CTRL *pRc, A_UINT8 curValidTxRate, A_UINT8 *pNextIndex) { A_INT8 i; @@ -181,12 +181,12 @@ rcIsValidPhyRate(A_UINT32 phy, A_UINT32 capflag, A_BOOL ignoreCW) return FALSE; } } - + return TRUE; } -/* - * Initialize the Valid Rate Index from valid entries in Rate Table +/* + * Initialize the Valid Rate Index from valid entries in Rate Table */ static A_UINT8 rcSibInitValidRates(const RATE_TABLE_11N *pRateTable, TX_RATE_CTRL *pRc, @@ -196,18 +196,18 @@ static A_UINT8 rcSibInitValidRates(const RATE_TABLE_11N *pRateTable, A_UINT8 i, hi = 0; A_UINT8 singleStream = (capflag & WLAN_RC_DS_FLAG) ? 0 : 1; A_UINT8 valid; - + for (i = 0; i < pRateTable->rateCount; i++) { if (singleStream) { valid = pRateTable->info[i].validSingleStream; } else { valid = pRateTable->info[i].valid; } - + if (valid == TRUE) { A_UINT32 phy = pRateTable->info[i].phy; - if (!rcIsValidPhyRate(phy, capflag, FALSE)) + if (!rcIsValidPhyRate(phy, capflag, FALSE)) continue; pPhyStateCtrl->validPhyRateIndex[phy][pPhyStateCtrl->validPhyRateCount[phy]] = i; @@ -217,17 +217,17 @@ static A_UINT8 rcSibInitValidRates(const RATE_TABLE_11N *pRateTable, hi = A_MAX(hi, i); } - } - + } + return hi; } -/* - * Initialize the Valid Rate Index from Rate Set +/* + * Initialize the Valid Rate Index from Rate Set */ static A_UINT8 rcSibSetValidRates(const RATE_TABLE_11N *pRateTable, - TX_RATE_CTRL *pRc, + TX_RATE_CTRL *pRc, struct ieee80211_rateset *pRateSet, A_UINT32 capflag, struct ath_node_target *an, @@ -236,7 +236,7 @@ rcSibSetValidRates(const RATE_TABLE_11N *pRateTable, A_UINT8 i, j, hi = 0; A_UINT8 singleStream = (capflag & WLAN_RC_DS_FLAG) ? 0 : 1; A_UINT32 valid; - + /* Use intersection of working rates and valid rates */ for (i = 0; i < pRateSet->rs_nrates; i++) { for (j = 0; j < pRateTable->rateCount; j++) { @@ -249,22 +249,22 @@ rcSibSetValidRates(const RATE_TABLE_11N *pRateTable, } else if (singleStream) { #else if (singleStream) { -#endif +#endif valid = pRateTable->info[j].validSingleStream; } else { valid = pRateTable->info[j].valid; } - + /* * We allow a rate only if its valid and the capflag matches one of * the validity (TRUE/TRUE_20/TRUE_40) flags */ - if (((pRateSet->rs_rates[i] & 0x7F) == + if (((pRateSet->rs_rates[i] & 0x7F) == (pRateTable->info[j].dot11Rate & 0x7F)) - && ((valid & WLAN_RC_CAP_MODE(capflag)) == + && ((valid & WLAN_RC_CAP_MODE(capflag)) == WLAN_RC_CAP_MODE(capflag)) && !WLAN_RC_PHY_HT(phy)) { - if (!rcIsValidPhyRate(phy, capflag, FALSE)) + if (!rcIsValidPhyRate(phy, capflag, FALSE)) continue; pPhyStateCtrl->validPhyRateIndex[phy][pPhyStateCtrl->validPhyRateCount[phy]] = j; @@ -275,13 +275,13 @@ rcSibSetValidRates(const RATE_TABLE_11N *pRateTable, } } } - + return hi; } static A_UINT8 rcSibSetValidHtRates(const RATE_TABLE_11N *pRateTable, - TX_RATE_CTRL *pRc, + TX_RATE_CTRL *pRc, A_UINT8 *pMcsSet, A_UINT32 capflag, struct ath_node_target *an, @@ -290,7 +290,7 @@ rcSibSetValidHtRates(const RATE_TABLE_11N *pRateTable, A_UINT8 i, j, hi = 0; A_UINT8 singleStream = (capflag & WLAN_RC_DS_FLAG) ? 0 : 1; A_UINT8 valid; - + /* Use intersection of working rates and valid rates */ for (i = 0; i < ((struct ieee80211_rateset *)pMcsSet)->rs_nrates; i++) { for (j = 0; j < pRateTable->rateCount; j++) { @@ -308,21 +308,21 @@ rcSibSetValidHtRates(const RATE_TABLE_11N *pRateTable, } else { valid = pRateTable->info[j].valid; } - - if (((((struct ieee80211_rateset *)pMcsSet)->rs_rates[i] & 0x7F) - != (pRateTable->info[j].dot11Rate & 0x7F)) - || !WLAN_RC_PHY_HT(phy) + + if (((((struct ieee80211_rateset *)pMcsSet)->rs_rates[i] & 0x7F) + != (pRateTable->info[j].dot11Rate & 0x7F)) + || !WLAN_RC_PHY_HT(phy) || !WLAN_RC_PHY_HT_VALID(valid, capflag) - || ((pRateTable->info[j].dot11Rate == 15) && - (valid & TRUE_20) && + || ((pRateTable->info[j].dot11Rate == 15) && + (valid & TRUE_20) && (capflag & WLAN_RC_WEP_TKIP_FLAG)) ) { continue; } - - if (!rcIsValidPhyRate(phy, capflag, FALSE)) + + if (!rcIsValidPhyRate(phy, capflag, FALSE)) continue; - + pPhyStateCtrl->validPhyRateIndex[phy][pPhyStateCtrl->validPhyRateCount[phy]] = j; pPhyStateCtrl->validPhyRateCount[phy] += 1; @@ -351,7 +351,7 @@ rcSibUpdate_ht(struct ath_softc_tgt *sc, struct ath_node_target *an, struct atheros_softc *asc = (struct atheros_softc*)sc->sc_rc; A_UINT8 *phtMcs = (A_UINT8*)&pRateSet->htrates; TX_RATE_CTRL *pRc = (TX_RATE_CTRL *)(pSib); - PHY_STATE_CTRL mPhyCtrlState; + PHY_STATE_CTRL mPhyCtrlState; A_UINT8 i, j, k, hi = 0, htHi = 0; @@ -371,7 +371,7 @@ rcSibUpdate_ht(struct ath_softc_tgt *sc, struct ath_node_target *an, for (i = 0; i < WLAN_RC_PHY_MAX; i++) { for (j = 0; j < MAX_TX_RATE_TBL; j++) { mPhyCtrlState.validPhyRateIndex[i][j] = 0; - } + } mPhyCtrlState.validPhyRateCount[i] = 0; } @@ -395,21 +395,21 @@ rcSibUpdate_ht(struct ath_softc_tgt *sc, struct ath_node_target *an, pRc->rateTableSize = hi + 1; pRc->rateMaxPhy = 0; - + ASSERT(pRc->rateTableSize <= MAX_TX_RATE_TBL); for (i = 0, k = 0; i < WLAN_RC_PHY_MAX; i++) { for (j = 0; j < mPhyCtrlState.validPhyRateCount[i]; j++) { pRc->validRateIndex[k++] = mPhyCtrlState.validPhyRateIndex[i][j]; - } + } if (!rcIsValidPhyRate(i, pRateTable->initialRateMax, TRUE) || - !mPhyCtrlState.validPhyRateCount[i]) + !mPhyCtrlState.validPhyRateCount[i]) continue; - pRc->rateMaxPhy = mPhyCtrlState.validPhyRateIndex[i][j-1]; + pRc->rateMaxPhy = mPhyCtrlState.validPhyRateIndex[i][j-1]; } - + ASSERT(pRc->rateTableSize <= MAX_TX_RATE_TBL); ASSERT(k <= MAX_TX_RATE_TBL); @@ -457,21 +457,21 @@ rcRateFind_ht(struct ath_softc_tgt *sc, struct atheros_node *pSib, minIndex = 0; bestRate = minIndex; - + /* * Try the higher rate first. It will reduce memory moving time * if we have very good channel characteristics. */ for (index = maxIndex; index >= minIndex ; index--) { A_UINT8 perThres; - + rate = pRc->validRateIndex[index]; if (rate > pRc->rateMaxPhy) { continue; } /* if the best throughput is already larger than the userRateKbps.. - * then we could skip of rest of calculation.. + * then we could skip of rest of calculation.. */ if( bestThruput >= pRateTable->info[rate].userRateKbps) break; @@ -511,7 +511,7 @@ rcRateFind_ht(struct ath_softc_tgt *sc, struct atheros_node *pSib, /* Probe the next allowed phy state */ /* FIXME: Check to make sure ratMax is checked properly */ - if (rcGetNextValidTxRate( pRateTable, pRc, rate, &nextRate) && + if (rcGetNextValidTxRate( pRateTable, pRc, rate, &nextRate) && (nowMsec - pRc->probeTime > pRateTable->probeInterval) && (pRc->hwMaxRetryPktCnt >= 1)) { @@ -551,14 +551,14 @@ rcRateSetseries(const RATE_TABLE_11N *pRateTable , A_BOOL rtsctsenable, A_UINT32 chainmask,int stbc) { series->tries = tries; - series->flags = (rtsctsenable? ATH_RC_RTSCTS_FLAG : 0) | - (WLAN_RC_PHY_DS(pRateTable->info[rix].phy) ? ATH_RC_DS_FLAG : 0) | - (WLAN_RC_PHY_40(pRateTable->info[rix].phy) ? ATH_RC_CW40_FLAG : 0) | + series->flags = (rtsctsenable? ATH_RC_RTSCTS_FLAG : 0) | + (WLAN_RC_PHY_DS(pRateTable->info[rix].phy) ? ATH_RC_DS_FLAG : 0) | + (WLAN_RC_PHY_40(pRateTable->info[rix].phy) ? ATH_RC_CW40_FLAG : 0) | (WLAN_RC_PHY_SGI(pRateTable->info[rix].phy) ? ATH_RC_HT40_SGI_FLAG : 0); #ifdef MAGPIE_MERLIN if (stbc) { /* For now, only single stream STBC is supported */ - if (pRateTable->info[rix].rateCode >= 0x80 && + if (pRateTable->info[rix].rateCode >= 0x80 && pRateTable->info[rix].rateCode <= 0x87) { series->flags |= ATH_RC_TX_STBC_FLAG; @@ -569,31 +569,31 @@ rcRateSetseries(const RATE_TABLE_11N *pRateTable , series->max4msframelen = pRateTable->info[rix].max4msframelen; series->txrateKbps = pRateTable->info[rix].rateKbps; - /* If the hardware is capable of multiple transmit chains (chainmask is 3, 5 or 7), + /* If the hardware is capable of multiple transmit chains (chainmask is 3, 5 or 7), * then choose the number of transmit chains dynamically based on entries in the rate table. */ #ifndef ATH_ENABLE_WLAN_FOR_K2 if(chainmask == 7) series->tx_chainmask = pRateTable->info[rix].txChainMask_3ch; - else if(chainmask == 1) + else if(chainmask == 1) series->tx_chainmask = 1; - else + else series->tx_chainmask = pRateTable->info[rix].txChainMask_2ch; /*Chainmask is 3 or 5*/ #else series->tx_chainmask = 1; #endif } -static A_UINT8 -rcRateGetIndex(struct ath_softc_tgt *sc, struct ath_node_target *an, - const RATE_TABLE_11N *pRateTable , +static A_UINT8 +rcRateGetIndex(struct ath_softc_tgt *sc, struct ath_node_target *an, + const RATE_TABLE_11N *pRateTable , A_UINT8 rix, A_UINT16 stepDown, A_UINT16 minRate) { A_UINT32 j; A_UINT8 nextIndex; struct atheros_node *pSib = ATH_NODE_ATHEROS(an); TX_RATE_CTRL *pRc = (TX_RATE_CTRL *)(pSib); - + if (minRate) { for (j = RATE_TABLE_11N_SIZE; j > 0; j-- ) { if (rcGetNextLowerValidTxRate(pRateTable, pRc, rix, &nextIndex)) { @@ -615,11 +615,11 @@ rcRateGetIndex(struct ath_softc_tgt *sc, struct ath_node_target *an, return rix; } -void rcRateFind_11n(struct ath_softc_tgt *sc, struct ath_node_target *an, +void rcRateFind_11n(struct ath_softc_tgt *sc, struct ath_node_target *an, int numTries, int numRates, int stepDnInc, unsigned int rcflag, struct ath_rc_series series[], int *isProbe) { - A_UINT8 i = 0; + A_UINT8 i = 0; A_UINT8 tryPerRate = 0; struct atheros_softc *asc = (struct atheros_softc*)sc->sc_rc; RATE_TABLE_11N *pRateTable = (RATE_TABLE_11N *)asc->hwRateTable[sc->sc_curmode]; @@ -628,7 +628,7 @@ void rcRateFind_11n(struct ath_softc_tgt *sc, struct ath_node_target *an, A_UINT8 dot11Rate; WLAN_PHY phy; - rix = rcRateFind_ht(sc, asn, pRateTable, (rcflag & ATH_RC_PROBE_ALLOWED) ? 1 : 0, + rix = rcRateFind_ht(sc, asn, pRateTable, (rcflag & ATH_RC_PROBE_ALLOWED) ? 1 : 0, isProbe); nrix = rix; @@ -636,7 +636,7 @@ void rcRateFind_11n(struct ath_softc_tgt *sc, struct ath_node_target *an, /* set one try for probe rates. For the probes don't enable rts */ rcRateSetseries(pRateTable, &series[i++], 1, nrix, FALSE, asc->tx_chainmask, asn->stbc); - + /* * Get the next tried/allowed rate. No RTS for the next series * after the probe rate @@ -667,7 +667,7 @@ void rcRateFind_11n(struct ath_softc_tgt *sc, struct ath_node_target *an, /* * BUG 26545: - * Change rate series to enable aggregation when operating at lower MCS rates. + * Change rate series to enable aggregation when operating at lower MCS rates. * When first rate in series is MCS2 in HT40 @ 2.4GHz, series should look like: * {MCS2, MCS1, MCS0, MCS0}. * When first rate in series is MCS3 in HT20 @ 2.4GHz, series should look like: @@ -678,8 +678,8 @@ void rcRateFind_11n(struct ath_softc_tgt *sc, struct ath_node_target *an, dot11Rate = pRateTable->info[rix].dot11Rate; phy = pRateTable->info[rix].phy; if (i == 4 && - ((dot11Rate == 2 && phy == WLAN_RC_PHY_HT_40_SS) || - (dot11Rate == 3 && phy == WLAN_RC_PHY_HT_20_SS))) + ((dot11Rate == 2 && phy == WLAN_RC_PHY_HT_40_SS) || + (dot11Rate == 3 && phy == WLAN_RC_PHY_HT_20_SS))) { series[3].rix = series[2].rix; series[3].flags = series[2].flags; @@ -695,14 +695,14 @@ void rcRateFind_11n(struct ath_softc_tgt *sc, struct ath_node_target *an, if (sc->sc_curmode == IEEE80211_MODE_11NG) { dot11Rate = pRateTable->info[rix].dot11Rate; if (dot11Rate <= 3 ) { - series[0].flags |= ATH_RC_RTSCTS_FLAG; + series[0].flags |= ATH_RC_RTSCTS_FLAG; } } } static void -rcUpdate_ht(struct ath_softc_tgt *sc, struct ath_node_target *an, int txRate, - A_BOOL Xretries, int retries, A_UINT8 curTxAnt, +rcUpdate_ht(struct ath_softc_tgt *sc, struct ath_node_target *an, int txRate, + A_BOOL Xretries, int retries, A_UINT8 curTxAnt, A_UINT16 nFrames, A_UINT16 nBad) { TX_RATE_CTRL *pRc; @@ -733,7 +733,7 @@ rcUpdate_ht(struct ath_softc_tgt *sc, struct ath_node_target *an, int txRate, ASSERT(retries >= 0 && retries < MAX_TX_RETRIES); ASSERT(txRate >= 0); - + if (txRate < 0) { return; } @@ -756,7 +756,7 @@ rcUpdate_ht(struct ath_softc_tgt *sc, struct ath_node_target *an, int txRate, } /* new_PER = 7/8*old_PER + 1/8*(currentPER) */ - pRc->state[txRate].per = (A_UINT8)(pRc->state[txRate].per - + pRc->state[txRate].per = (A_UINT8)(pRc->state[txRate].per - (pRc->state[txRate].per / 8) + ((100) / 8)); } @@ -789,13 +789,13 @@ rcUpdate_ht(struct ath_softc_tgt *sc, struct ath_node_target *an, int txRate, * of the sum of these two terms. */ if (nFrames > 0) - pRc->state[txRate].per = (A_UINT8)(pRc->state[txRate].per - - (pRc->state[txRate].per / 8) + + pRc->state[txRate].per = (A_UINT8)(pRc->state[txRate].per - + (pRc->state[txRate].per / 8) + ((100*(retries*nFrames + nBad)/(nFrames*(retries+1))) / 8)); } else { /* new_PER = 7/8*old_PER + 1/8*(currentPER) */ - pRc->state[txRate].per = (A_UINT8)(pRc->state[txRate].per - + pRc->state[txRate].per = (A_UINT8)(pRc->state[txRate].per - (pRc->state[txRate].per / 8) + (nRetry2PerLookup[retries] / 8)); } @@ -856,18 +856,18 @@ rcUpdate_ht(struct ath_softc_tgt *sc, struct ath_node_target *an, int txRate, /* For all cases */ - ASSERT((pRc->rateMaxPhy >= 0 && pRc->rateMaxPhy <= pRc->rateTableSize && + ASSERT((pRc->rateMaxPhy >= 0 && pRc->rateMaxPhy <= pRc->rateTableSize && pRc->rateMaxPhy != INVALID_RATE_MAX)); - + /* * If this rate looks bad (high PER) then stop using it for * a while (except if we are probing). */ if (pRc->state[txRate].per >= 55 && txRate > 0 && - pRateTable->info[txRate].rateKbps <= + pRateTable->info[txRate].rateKbps <= pRateTable->info[pRc->rateMaxPhy].rateKbps) { - rcGetNextLowerValidTxRate(pRateTable, pRc, (A_UINT8) txRate, + rcGetNextLowerValidTxRate(pRateTable, pRc, (A_UINT8) txRate, &pRc->rateMaxPhy); /* Don't probe for a little while. */ @@ -910,9 +910,9 @@ rcUpdate_ht(struct ath_softc_tgt *sc, struct ath_node_target *an, int txRate, * the status of previous frames. */ void rcUpdate_11n(struct ath_softc_tgt *sc, struct ath_node_target *an, - A_UINT8 curTxAnt, + A_UINT8 curTxAnt, int finalTSIdx, int Xretries, - struct ath_rc_series rcs[], int nFrames, + struct ath_rc_series rcs[], int nFrames, int nBad, int long_retry) { A_UINT32 series = 0; @@ -941,7 +941,7 @@ void rcUpdate_11n(struct ath_softc_tgt *sc, struct ath_node_target *an, if (rcs[series].tries != 0) { flags = rcs[series].flags; /* If HT40 and we have switched mode from 40 to 20 => don't update */ - if ((flags & ATH_RC_CW40_FLAG) && + if ((flags & ATH_RC_CW40_FLAG) && (pRc->rcPhyMode != (flags & ATH_RC_CW40_FLAG))) { return; } @@ -956,7 +956,7 @@ void rcUpdate_11n(struct ath_softc_tgt *sc, struct ath_node_target *an, } /* FIXME:XXXX, too many args! */ - rcUpdate_ht(sc, an, rix, Xretries? 1 : 2, rcs[series].tries, + rcUpdate_ht(sc, an, rix, Xretries? 1 : 2, rcs[series].tries, curTxAnt, nFrames, nFrames); } } @@ -973,7 +973,7 @@ void rcUpdate_11n(struct ath_softc_tgt *sc, struct ath_node_target *an, flags = rcs[series].flags; /* If HT40 and we have switched mode from 40 to 20 => don't update */ - if ((flags & ATH_RC_CW40_FLAG) && + if ((flags & ATH_RC_CW40_FLAG) && (pRc->rcPhyMode != (flags & ATH_RC_CW40_FLAG))) { return; } @@ -988,7 +988,7 @@ void rcUpdate_11n(struct ath_softc_tgt *sc, struct ath_node_target *an, } /* FIXME:XXXX, too many args! */ - rcUpdate_ht(sc, an, rix, Xretries, long_retry, curTxAnt, + rcUpdate_ht(sc, an, rix, Xretries, long_retry, curTxAnt, nFrames, nBad); } @@ -1036,7 +1036,7 @@ ath_rate_attach(struct ath_softc_tgt *sc) ar5416AttachRateTables(asc); asc->tx_chainmask = 1; - + return &asc->arc; } @@ -1068,14 +1068,14 @@ void ath_rate_tx_complete(struct ath_softc_tgt *sc, struct ath_node_target *an, struct ath_tx_desc *ds, - struct ath_rc_series rcs[], + struct ath_rc_series rcs[], int nframes, int nbad) { ath_rate_tx_complete_11n(sc, an, ds, rcs, nframes, nbad); } void -ath_rate_newassoc(struct ath_softc_tgt *sc, struct ath_node_target *an, int isnew, +ath_rate_newassoc(struct ath_softc_tgt *sc, struct ath_node_target *an, int isnew, unsigned int capflag, struct ieee80211_rate *rs) { ath_rate_newassoc_11n(sc, an, isnew, capflag, rs); @@ -1089,7 +1089,7 @@ void ath_rate_node_update(struct ath_softc_tgt *sc, { struct ieee80211_node_target *ni = &an->ni; - ath_rate_newassoc(sc, ATH_NODE_TARGET(ni), isnew, capflag, rs); + ath_rate_newassoc(sc, ATH_NODE_TARGET(ni), isnew, capflag, rs); } static int init_ath_rate_atheros(void); @@ -1132,14 +1132,14 @@ static void ath_rate_tx_complete_11n(struct ath_softc_tgt *sc, struct ath_node_target *an, struct ath_tx_desc *ds, - struct ath_rc_series rcs[], + struct ath_rc_series rcs[], int nframes, int nbad) { int finalTSIdx = ds->ds_txstat.ts_rate; int tx_status = 0; if ((ds->ds_txstat.ts_status & HAL_TXERR_XRETRY) || - (ds->ds_txstat.ts_status & HAL_TXERR_FIFO) || + (ds->ds_txstat.ts_status & HAL_TXERR_FIFO) || (ds->ds_txstat.ts_flags & HAL_TX_DATA_UNDERRUN) || (ds->ds_txstat.ts_flags & HAL_TX_DELIM_UNDERRUN)) { tx_status = 1; @@ -1152,7 +1152,7 @@ ath_rate_tx_complete_11n(struct ath_softc_tgt *sc, } static void -ath_rate_newassoc_11n(struct ath_softc_tgt *sc, struct ath_node_target *an, int isnew, +ath_rate_newassoc_11n(struct ath_softc_tgt *sc, struct ath_node_target *an, int isnew, unsigned int capflag, struct ieee80211_rate *rs) { if (isnew) {