Merge pull request #4 from olerem/master
authorAdrian Chadd <adrian.chadd@gmail.com>
Mon, 1 Apr 2013 16:16:16 +0000 (09:16 -0700)
committerAdrian Chadd <adrian.chadd@gmail.com>
Mon, 1 Apr 2013 16:16:16 +0000 (09:16 -0700)
Merge build fixes from Oleksij! Thanks!

18 files changed:
target_firmware/magpie_fw_dev/build/utility/bin2hex/bin2hex.c
target_firmware/magpie_fw_dev/target/adf/adf_os_mem_pvt.h
target_firmware/magpie_fw_dev/target/inc/adf_os_mem.h
target_firmware/magpie_fw_dev/target/init/init.c
target_firmware/magpie_fw_dev/target/init/magpie.c
target_firmware/wlan/ah.h
target_firmware/wlan/ah_desc.h
target_firmware/wlan/ah_osdep.c
target_firmware/wlan/ah_osdep.h
target_firmware/wlan/ar5416_hw.c
target_firmware/wlan/ar5416_phy.c
target_firmware/wlan/ieee80211.h
target_firmware/wlan/if_ath.c
target_firmware/wlan/if_ath_pci.c
target_firmware/wlan/if_athrate.h
target_firmware/wlan/if_athvar.h
target_firmware/wlan/if_llc.h
target_firmware/wlan/if_owl.c

index 2da53c2e3d8610a359eab671f968dee9fcdafebe..5aa447320171ac9c3642f9dffd9161a2fe79bdd3 100755 (executable)
  */
 #include <stdio.h>
 #include <string.h>
+#include <stdint.h>
 
 #define MAX_READ_SIZE  80
 
-unsigned long checksum = 0;
+uint32_t checksum = 0;
 
-void write_file(FILE *out, unsigned char *buf, unsigned long size, unsigned char *endian, unsigned char nl)
+void write_file(FILE *out, unsigned char *buf, uint32_t size, unsigned char *endian, unsigned char nl)
 {
        int i=0;
        unsigned char tmp_buf[4];
@@ -57,7 +58,7 @@ void write_file(FILE *out, unsigned char *buf, unsigned long size, unsigned char
                    tmp_buf[2] = buf[i+2];
                    tmp_buf[3] = buf[i+3];
 
-                       fprintf(out, "0x%08X, ", *((unsigned long *)(&tmp_buf[0])));
+                       fprintf(out, "0x%08X, ", *((uint32_t *)(&tmp_buf[0])));
 
         } else {
             
@@ -68,9 +69,9 @@ void write_file(FILE *out, unsigned char *buf, unsigned long size, unsigned char
                        tmp_buf[1] = buf[i+2];
                        tmp_buf[2] = buf[i+1];
                        tmp_buf[3] = buf[i+0];
-                       fprintf(out, "0x%08X, ", *((unsigned long *)(&tmp_buf[0])));
+                       fprintf(out, "0x%08X, ", *((uint32_t *)(&tmp_buf[0])));
                }
-        checksum = checksum ^ *((unsigned long *)(&tmp_buf[0]));
+        checksum = checksum ^ *((uint32_t *)(&tmp_buf[0]));
        }
 }
 
@@ -143,7 +144,7 @@ void write_array(FILE *out, FILE *in, unsigned char hif)
                        }
 
                        fprintf(out, "};\n");
-                       fprintf(out, "\nconst unsigned long zcFwImageSize=%ld;\n", file_size);
+                       fprintf(out, "\nconst uint32_t zcFwImageSize=%ld;\n", file_size);
 
                        goto ERR_DONE;
                }
@@ -159,7 +160,7 @@ void write_array(FILE *out, FILE *in, unsigned char hif)
 
                        file_size += 4;
                        fprintf(out, "};\n");
-                       fprintf(out, "\nconst unsigned long zcFwImageSize=%ld;\n", file_size);
+                       fprintf(out, "\nconst uint32_t zcFwImageSize=%ld;\n", file_size);
 
                        goto ERR_DONE;
                }
index 0519ad14aa6463fdd7ebc29c0a4e15c8feed0201..b5bcfa1b492d8493100ce0b9575df8e34d81eb24 100755 (executable)
@@ -51,7 +51,7 @@ static inline void            __adf_os_mem_free(void *buf)
 }
 
 /* move a memory buffer */
-static inline void             __adf_os_mem_copy(void *dst, void *src, adf_os_size_t size)
+static inline void             __adf_os_mem_copy(void *dst, const void *src, adf_os_size_t size)
 {
     A_MEMCPY(dst,src,size);    
 }
index 2e8b44a7d459f1575e0797f721b467f0f3575bcb..ec7691fb333a551712f15c7180201004f2bbaaf9 100755 (executable)
@@ -76,7 +76,7 @@ adf_os_mem_free(void *buf)
  * @param[in] size    buffer size
  */
 static inline void
-adf_os_mem_copy(void *dst, void *src, adf_os_size_t size)
+adf_os_mem_copy(void *dst, const void *src, adf_os_size_t size)
 {
     __adf_os_mem_copy(dst, src, size);
 }
index 0e6efaaa013b57161fe63b53a1871356ae096a91..b32661e96df22995d79a8ec6d4caf6d7abed9c33 100755 (executable)
@@ -86,7 +86,7 @@ void fatal_exception_func()
 void
 change_magpie_clk(void)
 {
-       volatile uint32_t i=0, rd_data;
+       volatile uint32_t rd_data;
 
        HAL_WORD_REG_WRITE(0x00056004, 0x11);
        rd_data = HAL_WORD_REG_READ(0x00056004) & 0x1;
@@ -218,7 +218,6 @@ void
 AR6002_fatal_exception_handler_patch(CPU_exception_frame_t *exc_frame)
 {
        struct register_dump_s dump;
-       void (*reset_func)(void) = (void*)(RESET_VECTOR_ADDRESS);
        uint32_t  exc_cause, exc_vaddr;
        asm volatile("rsr %0,%1" : "=r" (exc_cause) : "n" (EXCCAUSE));
        asm volatile("rsr %0,%1" : "=r" (exc_vaddr) : "n" (EXCVADDR));
index 990e005e3f4bebefe1b564fc5e883f83d9b6abfc..2ed5e8f9522d90db8fe0f213871012c570ad1903 100755 (executable)
@@ -53,6 +53,7 @@ void htc_setup_comp(void)
 static void dispatch_magpie_sys_cmds(void *pContext, A_UINT16 Command,
                                     A_UINT16 SeqNo, A_UINT8 *buffer, int Length);
 
+#if MAGPIE_ENABLE_WLAN == 0
 static WMI_DISPATCH_ENTRY Magpie_Sys_DispatchEntries[] =
 {
        {dispatch_magpie_sys_cmds,  WMI_ECHO_CMDID, 0},
@@ -60,6 +61,7 @@ static WMI_DISPATCH_ENTRY Magpie_Sys_DispatchEntries[] =
 };
 
 static WMI_DECLARE_DISPATCH_TABLE(Magpie_Sys_Commands_Tbl, Magpie_Sys_DispatchEntries);
+#endif
 
 htc_handle_t htc_handle;
 
index 7365e1957200ca9b99a643dfcc39bc45f4eb0edb..6425de60e76a8f8670fcbe74b31189919b7e3da5 100755 (executable)
@@ -44,6 +44,7 @@
 #endif
 
 #define AR5416_DEVID_PCIE   0x0024  /* AR5416 PCI-E (XB) (Owl) */
+#define HAL_RATE_TABLE_SIZE 33
 
 typedef enum {
        HAL_OK           = 0,    /* No error */
@@ -275,7 +276,7 @@ typedef struct {
 
 typedef struct {
        a_int32_t    rateCount;
-       a_uint8_t    rateCodeToIndex[32];
+       a_uint8_t    rateCodeToIndex[HAL_RATE_TABLE_SIZE];
        struct {
                a_uint8_t    valid;
                a_uint8_t    phy;
@@ -289,7 +290,7 @@ typedef struct {
                a_uint8_t    controlRate;
                a_uint16_t   lpAckDuration;
                a_uint16_t   spAckDuration;
-       } info[32];
+       } info[HAL_RATE_TABLE_SIZE];
 } HAL_RATE_TABLE;
 
 typedef struct {
@@ -306,7 +307,7 @@ typedef struct {
 
 typedef struct {
        a_int32_t    rateCount;
-       a_uint8_t    rateCodeToIndex[32];
+       a_uint8_t    rateCodeToIndex[HAL_RATE_TABLE_SIZE];
        struct {
                a_uint8_t    valid;
                a_uint8_t    phy;
@@ -317,7 +318,7 @@ typedef struct {
                a_uint8_t    controlRate;
                a_uint16_t   lpAckDuration;
                a_uint16_t   spAckDuration;
-       } info[32];
+       } info[HAL_RATE_TABLE_SIZE];
 } HAL_RATE_TABLE;
 
 #define HAL_RATESERIES_RTS_CTS    0x0001  /* use rts/cts w/this series */
@@ -456,12 +457,12 @@ struct ath_hal
        /* Target receive Functions */
        a_uint32_t __ahdecl(*ah_getRxDP)(struct ath_hal*);
        void       __ahdecl(*ah_setRxDP)(struct ath_hal*, a_uint32_t rxdp);
-       HAL_BOOL  __ahdecl(*ah_setupRxDesc)(struct ath_hal *, struct ath_desc *,
+       HAL_BOOL  __ahdecl(*ah_setupRxDesc)(struct ath_hal *, 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, 
-                                               struct ath_desc *ds, a_uint32_t pa, 
+                                               struct ath_rx_desc *ds, a_uint32_t pa,
                                                struct ath_desc *nds, 
                                                struct ath_rx_status *rx_stats);
        HAL_BOOL  __ahdecl(*ah_stopDmaReceive)(struct ath_hal*);
index f0e5c2818bf35f70c32ca3d72fbc3f07632527a8..8e09200b9cd09cc26bb428df1defde42bd7ae425 100755 (executable)
@@ -125,7 +125,7 @@ struct ath_rx_status {
 
 #define HAL_RXKEYIX_INVALID ((a_uint8_t) -1)
 
-#define HAL_TXKEYIX_INVALID ((a_uint32_t) -1)
+#define HAL_TXKEYIX_INVALID ((a_uint8_t) -1)
 
 /*
  * The following definitions are passed directly
index 9fda0744611724ce6eb201f4f246c859a19b52e2..7cb22663580b80ebdecb315864dc7e0e6eb5dfd6 100755 (executable)
@@ -142,7 +142,7 @@ ath_hal_memzero(void *dst, adf_os_size_t n)
 }
 
 void * __ahdecl
-ath_hal_memcpy(void *dst, void *src, adf_os_size_t n)
+ath_hal_memcpy(void *dst, const void *src, adf_os_size_t n)
 {
        adf_os_mem_copy(dst, src, n);
        return 0;
index 54b2a9b7a6a0f905d4cdf95aa19078479f3495a4..58a07ecc2881153e861953f4a544773de33ad84b 100755 (executable)
@@ -131,7 +131,7 @@ extern  void* __ahdecl ath_hal_ioremap(a_uint32_t addr, a_uint32_t len);
 #define OS_MEMZERO(_a, _n)  ath_hal_memzero((_a), (_n))
 extern void __ahdecl ath_hal_memzero(void *, size_t);
 #define OS_MEMCPY(_d, _s, _n)   ath_hal_memcpy(_d,_s,_n)
-extern void * __ahdecl ath_hal_memcpy(void *, void *, size_t);
+extern void * __ahdecl ath_hal_memcpy(void *, const void *, size_t);
 
 #ifndef abs
 #define abs(_a)     __builtin_abs(_a)
@@ -141,41 +141,12 @@ struct ath_hal;
 extern  a_uint32_t __ahdecl ath_hal_getuptime(struct ath_hal *);
 #define OS_GETUPTIME(_ah)   ath_hal_getuptime(_ah)
 
-/*
- * Byte order/swapping support.
- */
-#define AH_LITTLE_ENDIAN    1234
-#define AH_BIG_ENDIAN       4321
-
-#if AH_BYTE_ORDER == AH_BIG_ENDIAN
-/*
- * This could be optimized but since we only use it for
- * a few registers there's little reason to do so.
- */
-#ifndef __bswap32
-static inline a_uint32_t
-__bswap32(a_uint32_t _x)
-{
-    return ((a_uint32_t)(
-          (((const a_uint8_t *)(&_x))[0]    ) |
-          (((const a_uint8_t *)(&_x))[1]<< 8) |
-          (((const a_uint8_t *)(&_x))[2]<<16) |
-          (((const a_uint8_t *)(&_x))[3]<<24))
-    );
-}
-#endif
-#ifndef __bswap16
-#define __bswap16(_x) ( (a_uint16_t)( (((const a_uint8_t *)(&_x))[0] ) |\
-                         ( ( (const a_uint8_t *)( &_x ) )[1]<< 8) ) )
-#endif
-#else
 #ifndef __bswap32
 #define __bswap32(_x)  (_x)
 #endif
 #ifndef __bswap16
 #define __bswap16(_x)  (_x)
 #endif
-#endif
 
 #define OS_REG_WRITE(_ah, _reg, _val)   ath_hal_reg_write_target(_ah, _reg, _val)
 #define OS_REG_READ(_ah, _reg)      ath_hal_reg_read_target(_ah, _reg)
index 51326774716d9daa12b64843e7acb016002253f8..797dd8dd56f71de67f4489c1fe98bcfc75705be4 100644 (file)
@@ -766,7 +766,6 @@ HAL_BOOL ar5416SetupTxDesc_20(struct ath_hal *ah, struct ath_desc *ds,
 #define RTSCTS  (HAL_TXDESC_RTSENA|HAL_TXDESC_CTSENA)
 
         struct ar5416_desc *ads = AR5416DESC(ds);
-        struct ath_hal_5416 *ahp = AH5416(ah);
 
         (void) hdrLen;
 
@@ -937,7 +936,6 @@ void ar5416Set11nTxDesc_20(struct ath_hal *ah, struct ath_desc *ds,
                           a_uint32_t flags)
 {
         struct ar5416_desc *ads = AR5416DESC(ds);
-        struct ath_hal_5416 *ahp = AH5416(ah);
 
         HALASSERT(isValidPktType(type));
         HALASSERT(isValidKeyType(keyType));
@@ -973,11 +971,7 @@ void ar5416Set11nRateScenario_20(struct ath_hal *ah, struct ath_desc *ds,
                                 a_uint32_t flags)
 {
         struct ar5416_desc *ads = AR5416DESC(ds);
-        struct ar5416_desc_20 *ads_20 = AR5416DESC_20(ds);
         a_uint32_t ds_ctl0;
-        a_int16_t txpower;
-        a_uint32_t count;
-        struct ath_hal_private *ahpriv = AH_PRIVATE(ah);
 
         HALASSERT(nseries == 4);
         (void)nseries;
index 0068af2e38634a7c668a9b57289cee4391e047f6..7842bd96a6974e53aabfe127293ecc082221db50 100755 (executable)
@@ -171,8 +171,6 @@ HAL_RATE_TABLE ar5416_11na_table = {
        },
 };
 
-adf_os_export_symbol(ar5416_11na_table);
-
 #undef  OFDM
 #undef  CCK
 #undef  TURBO
index 8fc53ea21443650da3716896a391e194c9055f66..39418b1043eea4c5545eaa6387426455bbd17172 100755 (executable)
@@ -1008,7 +1008,7 @@ struct ieee80211_country_ie {
                a_uint8_t schan;                        /* starting channel */
                a_uint8_t nchan;                        /* number channels */
                a_uint8_t maxtxpwr;             /* tx power cap */
-       } band[4] adf_os_packed;                        /* up to 4 sub bands */
+       } adf_os_packed band[4];                        /* up to 4 sub bands */
 } adf_os_packed;
 
 #define IEEE80211_CHALLENGE_LEN                128
index 228f60ef8269dfacb19ebca72814a63731f9a0b0..409aecfb1be8f4ad5caa65edb293591aa39e847e 100755 (executable)
@@ -70,12 +70,10 @@ uint32_t *init_htc_handle = 0;
 #define UAPSDQ_NUM   9
 #define CABQ_NUM     8
 
-void wmi_event(wmi_handle_t handle, WMI_EVENT_ID evt_id, A_UINT8 *buffer, a_int32_t Length);
 void owl_tgt_tx_tasklet(TQUEUE_ARG data);
 static void ath_tgt_send_beacon(struct ath_softc_tgt *sc,adf_nbuf_t bc_hdr,adf_nbuf_t nbuf,HTC_ENDPOINT_ID EndPt);
-void wmi_cmd_rsp(void *pContext, WMI_COMMAND_ID cmd_id, A_UINT16 SeqNo, A_UINT8 *buffer, a_int32_t Length);
 static void ath_hal_reg_write_tgt(void *Context, A_UINT16 Command, A_UINT16 SeqNo, A_UINT8 *data, a_int32_t datalen);
-extern struct ath_buf * ath_tgt_tx_prepare(struct ath_softc_tgt *sc, adf_nbuf_t skb, ath_data_hdr_t *dh);
+extern struct ath_tx_buf* ath_tgt_tx_prepare(struct ath_softc_tgt *sc, adf_nbuf_t skb, ath_data_hdr_t *dh);
 extern void  ath_tgt_send_mgt(struct ath_softc_tgt *sc,adf_nbuf_t mgt_hdr, adf_nbuf_t skb,HTC_ENDPOINT_ID EndPt);
 extern HAL_BOOL ath_hal_wait(struct ath_hal *ah, a_uint32_t reg, a_uint32_t mask, a_uint32_t val);
 extern void owltgt_tx_processq(struct ath_softc_tgt *sc, struct ath_txq *txq,  owl_txq_state_t txqstate);
@@ -160,7 +158,7 @@ static void ath_setcurmode(struct ath_softc_tgt *sc,
 }
 
 void wmi_event(wmi_handle_t handle, WMI_EVENT_ID evt_id,
-              A_UINT8 *buffer, a_int32_t Length)
+              void *buffer, a_int32_t Length)
 {
        adf_nbuf_t netbuf = ADF_NBUF_NULL;
        a_uint8_t *pData;
@@ -182,7 +180,7 @@ void wmi_event(wmi_handle_t handle, WMI_EVENT_ID evt_id,
 }
 
 void wmi_cmd_rsp(void *pContext, WMI_COMMAND_ID cmd_id, A_UINT16 SeqNo,
-                A_UINT8 *buffer, a_int32_t Length)
+                void *buffer, a_int32_t Length)
 {
        adf_nbuf_t netbuf = ADF_NBUF_NULL;
        A_UINT8 *pData;
@@ -380,7 +378,7 @@ static void ath_uapsd_processtriggers(struct ath_softc_tgt *sc)
                        break;
                }
 
-               if (ds->ds_link == NULL) {
+               if (ds->ds_link == 0) {
                        break;
                }
 
@@ -446,7 +444,7 @@ static void ath_uapsd_processtriggers(struct ath_softc_tgt *sc)
 
                        bf->bf_status |= ATH_BUFSTATUS_DONE;
 
-                       bf = asf_tailq_next(bf, bf_list);
+                       bf = (struct ath_rx_buf *)asf_tailq_next(bf, bf_list);
                }
                else {
                        ds = asf_tailq_next(ds, ds_list);
@@ -485,7 +483,6 @@ static void ath_tgt_rx_tasklet(TQUEUE_ARG data)
        struct ath_rx_buf *bf = NULL;
        struct ath_hal *ah = sc->sc_ah;
        struct rx_frame_header *rxhdr;
-       struct ieee80211_frame *wh;
        struct ath_rx_status *rxstats;
        adf_nbuf_t skb = ADF_NBUF_NULL;
 
@@ -519,7 +516,6 @@ static void ath_tgt_rx_tasklet(TQUEUE_ARG data)
                HTC_SendMsg(sc->tgt_htc_handle, RX_ENDPOINT_ID, skb);
                sc->sc_rx_stats.ast_rx_send++;
 
-       next_buf:
                bf->bf_status &= ~ATH_BUFSTATUS_DONE;
                asf_tailq_insert_tail(&sc->sc_rxbuf, bf, bf_list);
 
@@ -538,13 +534,13 @@ static void ath_tgt_rx_tasklet(TQUEUE_ARG data)
  * FIXME: Short Preamble.
  */
 static void ath_beacon_setup(struct ath_softc_tgt *sc,
-                            struct ath_buf *bf,
+                            struct ath_tx_buf *bf,
                             struct ath_vap_target *avp)
 {
        adf_nbuf_t skb = bf->bf_skb;
        struct ath_hal *ah = sc->sc_ah;
        struct ath_desc *ds;
-       a_int32_t flags, antenna;
+       a_int32_t flags;
        const HAL_RATE_TABLE *rt;
        a_uint8_t rix, rate;
        HAL_11N_RATE_SERIES series[4] = {{ 0 }};
@@ -607,7 +603,7 @@ static void ath_tgt_send_beacon(struct ath_softc_tgt *sc, adf_nbuf_t bc_hdr,
 
        vap_index = bhdr->vap_index;
        adf_os_assert(vap_index < TARGET_VAP_MAX);
-       vap = &sc->sc_vap[vap_index];
+       vap = &sc->sc_vap[vap_index].av_vap;
 
        wh = (struct ieee80211_frame *)adf_nbuf_pull_head(nbuf,
                                                  sizeof(ath_beacon_hdr_t));
@@ -884,7 +880,7 @@ static void ath_descdma_cleanup(struct ath_softc_tgt *sc,
                                ath_bufhead *head, a_int32_t dir)
 {
        struct ath_tx_buf *bf;
-       struct ieee80211_node *ni;
+       struct ieee80211_node_target *ni;
 
        asf_tailq_foreach(bf, head, bf_list) {
                if (adf_nbuf_queue_len(&bf->bf_skbhead) != 0) {
@@ -1020,7 +1016,6 @@ adf_os_irq_resp_t ath_intr(adf_drv_handle_t hdl)
 {
        struct ath_softc_tgt *sc = (struct ath_softc_tgt *)hdl;
        struct ath_hal *ah = sc->sc_ah;
-       struct ieee80211com_target *ic = &sc->sc_ic;
        HAL_INT status;
 
        if (sc->sc_invalid)
@@ -1642,7 +1637,6 @@ static void ath_setcurmode_tgt(void *Context, A_UINT16 Command,
 {
        struct ath_softc_tgt *sc = (struct ath_softc_tgt *)Context;
        a_uint16_t mode;
-       struct ath_hal *ah = sc->sc_ah;
 
        mode= *((a_uint16_t *)data);
        mode = adf_os_ntohs(mode);
@@ -1652,7 +1646,7 @@ static void ath_setcurmode_tgt(void *Context, A_UINT16 Command,
        wmi_cmd_rsp(sc->tgt_wmi_handle, Command, SeqNo, NULL, 0);
 }
 
-static a_uint32_t ath_detach_tgt(void *Context, A_UINT16 Command, A_UINT16 SeqNo,
+static void ath_detach_tgt(void *Context, A_UINT16 Command, A_UINT16 SeqNo,
                                 A_UINT8 *data, a_int32_t datalen)
 {
        struct ath_softc_tgt *sc = (struct ath_softc_tgt *)Context;
index 8f37c08f7fa596f6b9423b121183ba570119cf2e..d4499ffaeb9b4680b863b4052e5d52dee3ff8360 100755 (executable)
@@ -176,8 +176,6 @@ ath_pci_resume(adf_drv_handle_t hdl)
 {
 }
 
-static char *dev_info = "ath_pci_tgt";
-
 void
 bus_read_cachesize(struct ath_softc *sc, a_uint8_t *csz)
 {
index 1ca50b1d7b17c502f2cb0f0a7c4d28fac51ea670..12088dd07cb23460bf9f809f64d66481b7d4c12d 100755 (executable)
@@ -46,6 +46,7 @@ struct ath_node_target;
 struct ath_desc;
 struct ieee80211vap;
 struct ieee80211com_target;
+struct ath_tx_desc;
 
 struct ath_ratectrl {
        size_t  arc_space;      /* space required for per-node state */
index d47fa94e03b7de164bdf236326480f4989971145..db1dfee9af9a3108deb853e9fce5e4ee8c713d0a 100755 (executable)
@@ -124,8 +124,6 @@ typedef enum {
 #define TARGET_NODE_MAX ATH_NODE_MAX
 #define TARGET_VAP_MAX  ATH_VAP_MAX
 
-#define ATH_NODE_TARGET(_n) ((struct ath_node *)(_n))
-
 #define MAX_RATE_POWER               63
 #define ATH_COMP_PROC_NO_COMP_NO_CCS 3
 
@@ -385,7 +383,7 @@ struct ath_softc_tgt
 
        ath_deschead       sc_rxdesc_idle;
        ath_deschead       sc_rxdesc;
-       struct ath_desc    *sc_rxdesc_held;
+       struct ath_rx_desc    *sc_rxdesc_held;
 
        struct ath_buf    *sc_txbuf_held;
 
index 4fc7ee3d4ece189a2a1c3580412cfd704b2ef3db..f6d8e17e4de103588ce4018436fe3b4edd7f3ce8 100755 (executable)
@@ -94,15 +94,15 @@ struct llc {
                a_uint8_t format_id;
                a_uint8_t class;
                a_uint8_t window_x2;
-           } type_u adf_os_packed;
+           } adf_os_packed type_u;
            struct {
                a_uint8_t num_snd_x2;
                a_uint8_t num_rcv_x2;
-           } type_i adf_os_packed;
+           } adf_os_packed type_i;
            struct {
                a_uint8_t control;
                a_uint8_t num_rcv_x2;
-           } type_s adf_os_packed;
+           } adf_os_packed type_s;
            struct {
                a_uint8_t control;
                /*
@@ -114,16 +114,16 @@ struct llc {
                a_uint8_t frmr_control;
                a_uint8_t frmr_control_ext;
                a_uint8_t frmr_cause;
-           } type_frmr adf_os_packed;
+           } adf_os_packed type_frmr;
            struct {
                a_uint8_t  control;
                a_uint8_t  org_code[3];
                a_uint16_t ether_type;
-           } type_snap adf_os_packed;
+           } adf_os_packed type_snap;
            struct {
                a_uint8_t control;
                a_uint8_t control_ext;
-           } type_raw adf_os_packed;
+           } adf_os_packed type_raw;
        } llc_un /* XXX adf_os_packed ??? */;
 } adf_os_packed;
 
index 39a48c2db29f09b05bfda9852b84c2bf0d1ec8fa..2b901fa6a4441e58b3b75a9f18113533ed67d574 100755 (executable)
@@ -110,8 +110,6 @@ static void ath_update_stats(struct ath_softc_tgt *sc, struct ath_buf *bf);
 void adf_print_buf(adf_nbuf_t buf);
 static void ath_tgt_tx_enqueue(struct ath_txq *txq, struct ath_atx_tid  *tid);
 
-struct ath_buf * ath_tgt_tx_prepare(struct ath_softc_tgt *sc,
-                                   adf_nbuf_t skb, ath_data_hdr_t *dh);
 void ath_tgt_tx_comp_aggr(struct ath_softc_tgt *sc, struct ath_tx_buf *bf);
 struct ieee80211_frame *ATH_SKB_2_WH(adf_nbuf_t skb);
 
@@ -120,9 +118,6 @@ void ath_tgt_tx_send_normal(struct ath_softc_tgt *sc, struct ath_tx_buf *bf);
 static void ath_tgt_tx_sched_normal(struct ath_softc_tgt *sc, ath_atx_tid_t *tid);
 static void ath_tgt_tx_sched_aggr(struct ath_softc_tgt *sc, ath_atx_tid_t *tid);
 
-static struct ath_node_target * owltarget_findnode(struct  tx_frame_heade *dh,
-                                                  struct ath_softc_tgt *sc,
-                                                  struct adf_nbuf_t *skb);
 extern a_int32_t ath_chainmask_sel_logic(void *);
 static a_int32_t ath_get_pktlen(struct ath_buf *bf, a_int32_t hdrlen);
 static void ath_tgt_txq_schedule(struct ath_softc *sc, struct ath_txq *txq);
@@ -225,7 +220,7 @@ static a_uint32_t ath_pkt_duration(struct ath_softc_tgt *sc,
        return duration;
 }
 
-static void ath_dma_map(struct ath_softc_tgt *sc, struct ath_buf *bf)
+static void ath_dma_map(struct ath_softc_tgt *sc, struct ath_tx_buf *bf)
 {
        adf_nbuf_t skb = bf->bf_skb;
 
@@ -233,7 +228,7 @@ static void ath_dma_map(struct ath_softc_tgt *sc, struct ath_buf *bf)
        adf_nbuf_map(sc->sc_dev, bf->bf_dmamap, skb, ADF_OS_DMA_TO_DEVICE);
 }
 
-static void ath_dma_unmap(struct ath_softc_tgt *sc, struct ath_buf *bf)
+static void ath_dma_unmap(struct ath_softc_tgt *sc, struct ath_tx_buf *bf)
 {
        adf_nbuf_t skb = bf->bf_skb;
 
@@ -269,10 +264,7 @@ static void ath_filltxdesc(struct ath_softc_tgt *sc, struct ath_tx_buf *bf)
 
 static void ath_tx_tgt_setds(struct ath_softc_tgt *sc, struct ath_tx_buf *bf)
 {
-       struct ath_desc *ds0, *ds = bf->bf_desc;
-       adf_nbuf_t skb;
-       adf_nbuf_queue_t skbhead;
-       a_int32_t i, dscnt = 0;
+       struct ath_desc *ds = bf->bf_desc;
 
        switch (bf->bf_protmode) {
        case IEEE80211_PROT_RTSCTS:
@@ -380,7 +372,6 @@ static void ath_buf_set_rate(struct ath_softc_tgt *sc, struct ath_tx_buf *bf)
     HAL_11N_RATE_SERIES series[4];
     a_int32_t i, flags;
     a_uint8_t rix, cix, rtsctsrate;
-    a_uint32_t aggr_limit_with_rts;
     a_uint32_t ctsduration = 0;
     a_int32_t prot_mode = AH_FALSE;
 
@@ -408,13 +399,6 @@ static void ath_buf_set_rate(struct ath_softc_tgt *sc, struct ath_tx_buf *bf)
            }
     }
 
-    ath_hal_getrtsaggrlimit(sc->sc_ah, &aggr_limit_with_rts);
-
-    if (bf->bf_isaggr && aggr_limit_with_rts &&
-       bf->bf_al > aggr_limit_with_rts) {
-           flags &= ~(HAL_TXDESC_RTSENA);
-    }
-
     adf_os_mem_set(series, 0, sizeof(HAL_11N_RATE_SERIES) * 4);
 
     for (i = 0; i < 4; i++) {
@@ -521,7 +505,7 @@ static void owl_tgt_tid_cleanup(struct ath_softc_tgt *sc,
 void owl_tgt_node_init(struct ath_node_target * an)
 {
        struct ath_atx_tid *tid;
-       int tidno, i;
+       int tidno;
 
        for (tidno = 0, tid = &an->tid[tidno]; tidno < WME_NUM_TID;tidno++, tid++) {
                tid->tidno = tidno;
@@ -546,7 +530,7 @@ void ath_tx_status_clear(struct ath_softc_tgt *sc)
        }
 }
 
-struct WMI_TXSTATUS_EVENT* ath_tx_status_get(struct ath_softc_tgt *sc)
+static WMI_TXSTATUS_EVENT *ath_tx_status_get(struct ath_softc_tgt *sc)
 {
        WMI_TXSTATUS_EVENT *txs = NULL;
        int i;
@@ -643,9 +627,7 @@ void owl_tgt_tx_tasklet(TQUEUE_ARG data)
 {
        struct ath_softc_tgt *sc = (struct ath_softc_tgt *)data;
        a_int32_t i;
-       a_uint32_t qcumask = ((1 << HAL_NUM_TX_QUEUES) - 1);
        struct ath_txq *txq;
-       ath_data_hdr_t *dh;
 
        ath_tx_status_clear(sc);
 
@@ -741,7 +723,6 @@ static void ath_tgt_tx_comp_normal(struct ath_softc_tgt *sc,
                                   struct ath_tx_buf *bf)
 {
        struct ath_node_target *an = ATH_NODE_TARGET(bf->bf_node);
-       struct ath_desc *ds = bf->bf_lastds;
        ath_atx_tid_t *tid = ATH_AN_2_TID(an, bf->bf_tidno);
 
        if (tid->flag & TID_CLEANUP_INPROGRES) {
@@ -759,7 +740,6 @@ static struct ieee80211_node_target * ath_tgt_find_node(struct ath_softc_tgt *sc
                                                        a_int32_t node_index)
 {
        struct ath_node_target *an;
-       a_int32_t i;
        struct ieee80211_node_target *ni;
 
        if (node_index > TARGET_NODE_MAX)
@@ -793,13 +773,11 @@ static struct ath_buf* ath_buf_alloc(struct ath_softc_tgt *sc)
        return  bf;
 }
 
-struct ath_buf* ath_tgt_tx_prepare(struct ath_softc_tgt *sc,
+struct ath_tx_buf* ath_tgt_tx_prepare(struct ath_softc_tgt *sc,
                                   adf_nbuf_t skb, ath_data_hdr_t *dh)
 {
        struct ath_tx_buf *bf;
-       struct ath_txq *txq;
        struct ieee80211_node_target *ni;
-       a_uint32_t flags = adf_os_ntohl(dh->flags);
        struct ath_atx_tid *tid;
 
        ni = ath_tgt_find_node(sc, dh->ni_index);
@@ -868,8 +846,6 @@ static a_int32_t ath_key_setup(struct ieee80211_node_target *ni,
                               struct ath_tx_buf *bf)
 {
        struct ieee80211_frame *wh = ATH_SKB_2_WH(bf->bf_skb);
-       const struct ieee80211_cipher *cip;
-       struct ieee80211_key *k;
 
        if (!(wh->i_fc[1] & IEEE80211_FC1_WEP)) {
                bf->bf_keytype = HAL_KEY_TYPE_CLEAR;
@@ -902,9 +878,7 @@ static void ath_tgt_txq_add_ucast(struct ath_softc_tgt *sc, struct ath_tx_buf *b
 {
        struct ath_hal *ah = sc->sc_ah;
        struct ath_txq *txq;
-       struct ath_node_target *an;
        HAL_STATUS status;
-       static a_int32_t count = 0,i;
        volatile a_int32_t txe_val;
 
        adf_os_assert(bf);
@@ -994,14 +968,14 @@ ath_tgt_tx_send_normal(struct ath_softc_tgt *sc, struct ath_tx_buf *bf)
                ath_tgt_rate_findrate(sc, an, shortPreamble,
                                      0, 0, 0, 0, 0,
                                      rcs, &isProbe);
-               memcpy(bf->bf_rcs, rcs, sizeof(rcs));
+               ath_hal_memcpy(bf->bf_rcs, rcs, sizeof(rcs));
        } else {
                mrcs[1].tries = mrcs[2].tries = mrcs[3].tries = 0;
                mrcs[1].rix = mrcs[2].rix = mrcs[3].rix = 0;
                mrcs[0].rix   = 0;
                mrcs[0].tries = 1;
                mrcs[0].flags = 0;
-               memcpy(bf->bf_rcs, mrcs, sizeof(mrcs));
+               ath_hal_memcpy(bf->bf_rcs, mrcs, sizeof(mrcs));
        }
 
        ath_buf_set_rate(sc, bf);
@@ -1048,11 +1022,8 @@ ath_tx_uc_comp(struct ath_softc_tgt *sc, struct ath_tx_buf *bf)
 static void
 ath_update_stats(struct ath_softc_tgt *sc, struct ath_buf *bf)
 {
-       struct ieee80211_node_target *ni = bf->bf_node;
        struct ath_tx_desc *ds = bf->bf_desc;
-       struct ath_node_target *an = ATH_NODE_TARGET(ni);
        u_int32_t sr, lr;
-       struct ieee80211_cb *cb;
 
        if (ds->ds_txstat.ts_status == 0) {
                if (ds->ds_txstat.ts_rate & HAL_TXSTAT_ALTRATE)
@@ -1082,9 +1053,9 @@ ath_tgt_send_mgt(struct ath_softc_tgt *sc,adf_nbuf_t hdr_buf, adf_nbuf_t skb,
        struct ath_vap_target *avp;
        struct ath_hal *ah = sc->sc_ah;
        a_uint8_t rix, txrate, ctsrate, cix = 0xff, *data;
-       a_uint32_t ivlen = 0, icvlen = 0, subtype, flags, ctsduration, fval;
+       a_uint32_t ivlen = 0, icvlen = 0, subtype, flags, ctsduration;
        a_int32_t i, iswep, ismcast, hdrlen, pktlen, try0, len;
-       struct ath_desc *ds=NULL, *ds0=NULL;
+       struct ath_desc *ds=NULL;
        struct ath_txq *txq=NULL;
        struct ath_tx_buf *bf;
        HAL_PKT_TYPE atype;
@@ -1094,7 +1065,6 @@ ath_tgt_send_mgt(struct ath_softc_tgt *sc,adf_nbuf_t hdr_buf, adf_nbuf_t skb,
        struct ath_rc_series rcs[4];
        HAL_11N_RATE_SERIES series[4];
        ath_mgt_hdr_t *mh;
-       struct ieee80211com_target *ic = &sc->sc_ic;
        a_int8_t keyix;
 
        if (!hdr_buf) {
@@ -1297,9 +1267,6 @@ void ath_tgt_handle_normal(struct ath_softc_tgt *sc, struct ath_tx_buf *bf)
 {
        ath_atx_tid_t *tid;
        struct ath_node_target *an;
-       struct ath_desc *ds;
-       struct ath_txq *txq = bf->bf_txq;
-       a_bool_t queue_frame;
 
        an = (struct ath_node_target *)bf->bf_node;
        adf_os_assert(an);
@@ -1330,10 +1297,6 @@ ath_tgt_txq_schedule(struct ath_softc *sc, struct ath_txq *txq)
 {
        struct ath_atx_tid  *tid;
        u_int8_t bdone;
-       HAL_STATUS status;
-       u_int8_t smps_mode;
-       struct ieee80211_node *ieee_node;
-       u_int32_t aggr_limit_with_rts;
 
        bdone = AH_FALSE;
 
@@ -1367,7 +1330,6 @@ ath_tgt_handle_aggr(struct ath_softc_tgt *sc, struct ath_tx_buf *bf)
 {
        ath_atx_tid_t *tid;
        struct ath_node_target *an;
-       struct ath_desc *ds;
        struct ath_txq *txq = bf->bf_txq;
        a_bool_t queue_frame, within_baw;