logo       
Google Custom Search
    AddThis Social Bookmark Button

revision 2483 committed: msg#00068

Subject: revision 2483 committed
Project     : madwifi
Revision    : 2483
Author      : mtaylor (Michael Taylor)
Date        : 2007-06-18 19:57:45 +0200 (Mon, 18 Jun 2007)

Log Message :
Merge trunk r2482

Affected Files:
* branches/madwifi-dfs/ath/if_ath.c                   updated             
* branches/madwifi-dfs/ath/if_athvar.h                updated             
* branches/madwifi-dfs/ath_hal/ah_os.c                updated             
* branches/madwifi-dfs/net80211/ieee80211_input.c     updated             
* branches/madwifi-dfs/net80211/ieee80211_linux.h     updated             
* branches/madwifi-dfs/net80211/ieee80211_node.c      updated             
* branches/madwifi-dfs/net80211/ieee80211_node.h      updated             
* branches/madwifi-dfs/net80211/ieee80211_proto.h     updated             
* branches/madwifi-dfs/net80211/ieee80211_scan.c      updated             
* branches/madwifi-dfs/net80211/ieee80211_scan.h      updated             
* branches/madwifi-dfs/net80211/ieee80211_scan_ap.c   updated             
* branches/madwifi-dfs/net80211/ieee80211_scan_sta.c  updated             
* branches/madwifi-dfs/net80211/ieee80211_var.h       updated             
* branches/madwifi-dfs/net80211/ieee80211_wireless.c  updated             


Modified: branches/madwifi-dfs/ath/if_ath.c
===================================================================
--- branches/madwifi-dfs/ath/if_ath.c   2007-06-18 17:14:03 UTC (rev 2482)
+++ branches/madwifi-dfs/ath/if_ath.c   2007-06-18 17:57:45 UTC (rev 2483)
@@ -172,7 +172,7 @@
 static u_int8_t ath_node_getrssi(const struct ieee80211_node *);
 static int ath_rxbuf_init(struct ath_softc *, struct ath_buf *);
 static void ath_recv_mgmt(struct ieee80211_node *, struct sk_buff *, int,
-       int, u_int32_t);
+       int, u_int64_t);
 static void ath_setdefantenna(struct ath_softc *, u_int);
 static struct ath_txq *ath_txq_setup(struct ath_softc *, int, int);
 static void ath_rx_tasklet(TQUEUE_ARG);
@@ -237,7 +237,7 @@
 static unsigned int ath_write_register(struct ieee80211com *ic, unsigned int 
address, unsigned int value);
 static void ath_ar5212_registers_dump(struct ath_softc *sc);
 static void ath_print_register(const char* name, u_int32_t address, u_int32_t 
v);
-static void ath_print_register_delta(const char* name, u_int32_t address, 
u_int32_t v_old,u_int32_t v_new);
+static void ath_print_register_delta(const char* name, u_int32_t address, 
u_int32_t v_old, u_int32_t v_new);
 #endif /* #ifdef ATH_REVERSE_ENGINEERING */
 
 static int ath_set_mac_address(struct net_device *, void *);
@@ -1267,7 +1267,7 @@
        if (vap->iv_flags & IEEE80211_F_XR) {
                if (ath_descdma_setup(sc, &sc->sc_grppolldma, 
&sc->sc_grppollbuf,
                        "grppoll", (sc->sc_xrpollcount + 1) * 
HAL_ANTENNA_MAX_MODE, 1) != 0)
-                       printk("%s:grppoll Buf allocation failed \n",__func__);
+                       printk("%s:grppoll Buf allocation failed \n", __func__);
                if (!sc->sc_xrtxq)
                        sc->sc_xrtxq = ath_txq_setup(sc, HAL_TX_QUEUE_DATA, 
HAL_XR_DATA);
                if (sc->sc_hasdiversity) {
@@ -1491,6 +1491,10 @@
                if (HAL_EINPROGRESS == retval)
                        break;
 
+               /* update the per packet TSF with sc_tsf, sc_tsf is updated on
+                  each RX interrupt. */
+               bf->bf_tsf = sc->sc_tsf;
+
                /* XXX: We do not support frames spanning multiple descriptors 
*/
                bf->bf_status |= ATH_BUFSTATUS_DONE;
 
@@ -3615,7 +3619,7 @@
  * called only if dynamic turbo has been enabled (sc_turbo).
  */
 static void
-ath_beacon_dturbo_update(struct ieee80211vap *vap, int *needmark,u_int8_t dtim)
+ath_beacon_dturbo_update(struct ieee80211vap *vap, int *needmark, u_int8_t 
dtim)
 {
        struct ieee80211com *ic = vap->iv_ic;
        struct ath_softc *sc = ic->ic_dev->priv;
@@ -4030,7 +4034,7 @@
                        ctsrate |= rt->info[cix].shortPreamble;
                flags |= HAL_TXDESC_CTSENA;
                rt = sc->sc_xr_rates;
-               ctsduration = ath_hal_computetxtime(ah,rt, pktlen,
+               ctsduration = ath_hal_computetxtime(ah, rt, pktlen,
                        IEEE80211_XR_DEFAULT_RATE_INDEX, AH_FALSE);
                rate = rt->info[IEEE80211_XR_DEFAULT_RATE_INDEX].rateCode;
        }
@@ -5109,7 +5113,7 @@
                        STAILQ_INSERT_TAIL(&sc->sc_txbuf, bf, bf_list);
                        ATH_TXBUF_UNLOCK_IRQ(sc);
 
-                       ath_hardstart(skb,sc->sc_dev);
+                       ath_hardstart(skb, sc->sc_dev);
                        ATH_TXQ_REMOVE_HEAD(&tmp_q, bf_list);
                        bf = STAILQ_FIRST(&tmp_q.axq_q);
                        index++;
@@ -5149,7 +5153,7 @@
                        if (status == HAL_EINPROGRESS)
                                break;
                        prev= bf;
-                       bf = STAILQ_NEXT(bf,bf_list);
+                       bf = STAILQ_NEXT(bf, bf_list);
                }
                /* 
                 * save the pointer to the last buf that's
@@ -5165,14 +5169,14 @@
                while (bf) {
                        if (ni == bf->bf_node) {
                                if (prev == bf) {
-                                       STAILQ_REMOVE_HEAD(&txq->axq_q,bf_list);
+                                       STAILQ_REMOVE_HEAD(&txq->axq_q, 
bf_list);
                                        bf_tmp=bf;
                                        bf = STAILQ_FIRST(&txq->axq_q);
                                        prev = bf;
                                } else {
-                                       
STAILQ_REMOVE_AFTER(&(txq->axq_q),prev,bf_list);
+                                       STAILQ_REMOVE_AFTER(&(txq->axq_q), 
prev, bf_list);
                                        bf_tmp=bf;
-                                       bf = STAILQ_NEXT(prev,bf_list);
+                                       bf = STAILQ_NEXT(prev, bf_list);
                                }
                                count++;
                                skb = bf_tmp->bf_skb;
@@ -5241,7 +5245,7 @@
                 * buffer that was not DMA'd.
                 */
                if (bf_tmp1)
-                       bf = STAILQ_NEXT(bf_tmp1,bf_list);
+                       bf = STAILQ_NEXT(bf_tmp1, bf_list);
                else
                        bf = STAILQ_FIRST(&txq->axq_q);
 
@@ -5409,6 +5413,7 @@
  * Extend 15-bit time stamp from rx descriptor to
  * a full 64-bit TSF using the current h/w TSF.
  */
+/* NB: Not all chipsets return the same precision rstamp */
 static __inline u_int64_t
 ath_extend_tsf(u_int64_t tsf, u_int32_t rstamp)
 {
@@ -5422,21 +5427,13 @@
  * dispatch it to capture tools like kismet.
  */
 static void
-ath_rx_capture(struct net_device *dev, const struct ath_buf *bf, struct 
sk_buff *skb)
+ath_rx_capture(struct net_device *dev, const struct ath_buf *bf, 
+               struct sk_buff *skb, u_int64_t rtsf)
 {
        struct ath_softc *sc = dev->priv;
-       const struct ath_rx_status *rs = &bf->bf_dsstatus.ds_rxstat;
        struct ieee80211com *ic = &sc->sc_ic;
        struct ieee80211_frame *wh;
 
-       /* Pass up tsf clock in mactime
-        * Rx descriptor has the low 15 bits of the tsf at
-        * the time the frame was received.  Use the current
-        * tsf to extend this to 64 bits.
-        */
-       /* NB: Not all chipsets return the same precision rstamp */
-       u_int64_t tsf = ath_extend_tsf(sc->sc_tsf, rs->rs_tstamp);
-
        KASSERT(ic->ic_flags & IEEE80211_F_DATAPAD,
                ("data padding not enabled?"));
 
@@ -5450,10 +5447,10 @@
                        memmove(skb1->data + padbytes, skb1->data, headersize);
                        skb_pull(skb1, padbytes);
                }
-               ieee80211_input_monitor(ic, skb1, bf, 0, tsf, sc);
+               ieee80211_input_monitor(ic, skb1, bf, 0, rtsf, sc);
                dev_kfree_skb(skb1);
        } else {
-               ieee80211_input_monitor(ic, skb, bf, 0, tsf, sc);
+               ieee80211_input_monitor(ic, skb, bf, 0, rtsf, sc);
        }
 }
 
@@ -5526,7 +5523,7 @@
  */
 static void
 ath_recv_mgmt(struct ieee80211_node *ni, struct sk_buff *skb,
-       int subtype, int rssi, u_int32_t rstamp)
+       int subtype, int rssi, u_int64_t rtsf)
 {
        struct ath_softc *sc = ni->ni_ic->ic_dev->priv;
        struct ieee80211vap *vap = ni->ni_vap;
@@ -5535,7 +5532,7 @@
         * Call up first so subsequent work can use information
         * potentially stored in the node (e.g. for ibss merge).
         */
-       sc->sc_recv_mgmt(ni, skb, subtype, rssi, rstamp);
+       sc->sc_recv_mgmt(ni, skb, subtype, rssi, rtsf);
        switch (subtype) {
        case IEEE80211_FC0_SUBTYPE_BEACON:
                /* update rssi statistics for use by the HAL */
@@ -5553,7 +5550,6 @@
        case IEEE80211_FC0_SUBTYPE_PROBE_RESP:
                if (vap->iv_opmode == IEEE80211_M_IBSS &&
                    vap->iv_state == IEEE80211_S_RUN) {
-                       u_int64_t tsf = ath_extend_tsf(sc->sc_tsf, rstamp);
                        /*
                         * Handle ibss merge as needed; check the tsf on the
                         * frame before attempting the merge.  The 802.11 spec
@@ -5567,10 +5563,10 @@
                        /* jal: added: don't merge if we have a desired
                           BSSID */
                        if (!(vap->iv_flags & IEEE80211_F_DESBSSID) &&
-                               le64_to_cpu(ni->ni_tstamp.tsf) >= tsf) {
+                               le64_to_cpu(ni->ni_tstamp.tsf) >= rtsf) {
                                DPRINTF(sc, ATH_DEBUG_STATE,
-                                       "ibss merge, rstamp %u tsf %llu "
-                                       "tstamp %llu\n", rstamp, (unsigned long 
long) tsf,
+                                       "ibss merge, rtsf %10llu local tsf 
%10llu\n",
+                                       rtsf,
                                        (unsigned long long) 
le64_to_cpu(ni->ni_tstamp.tsf));
                                (void) ieee80211_ibss_merge(ni);
                        }
@@ -5610,6 +5606,7 @@
        unsigned int len;
        int type;
        u_int phyerr;
+       u_int64_t rs_tsf;
 
        /* Let the 802.11 layer know about the new noise floor */
        sc->sc_channoise = ath_hal_get_channel_noise(ah, &(sc->sc_curchan));
@@ -5744,6 +5741,12 @@
                skb_put(skb, len);
                skb->protocol = __constant_htons(ETH_P_CONTROL);
 
+               /* Pass up TSF clock in MAC time
+                * Rx descriptor has the low 15 bits of the TSf at
+                * the time the frame was received.  Use the current
+                * TSF to extend this to 64 bits. */
+               rs_tsf = ath_extend_tsf(bf->bf_tsf, rs->rs_tstamp);
+
                if (sc->sc_nmonvaps > 0) {
                        /* 
                         * Some vap is in monitor mode, so send to
@@ -5759,7 +5762,7 @@
                                goto rx_next;
                        }
 #endif
-                       ath_rx_capture(dev, bf, skb);
+                       ath_rx_capture(dev, bf, skb, rs_tsf);
                        if (sc->sc_ic.ic_opmode == IEEE80211_M_MONITOR) {
                                /* no other VAPs need the packet */
                                dev_kfree_skb(skb);
@@ -5818,7 +5821,7 @@
                         */
                        an = ATH_NODE(ieee80211_ref_node(ni));
                        ATH_RSSI_LPF(an->an_avgrssi, rs->rs_rssi);
-                       type = ieee80211_input(ni, skb, rs->rs_rssi, 
rs->rs_tstamp);
+                       type = ieee80211_input(ni, skb, rs->rs_rssi, rs_tsf);
                        ieee80211_unref_node(&ni);
                } else {
                        /*
@@ -5832,7 +5835,7 @@
                                ieee80211_keyix_t keyix;
 
                                ATH_RSSI_LPF(an->an_avgrssi, rs->rs_rssi);
-                               type = ieee80211_input(ni, skb, 
rs->rs_rssi,rs->rs_tstamp);
+                               type = ieee80211_input(ni, skb, rs->rs_rssi, 
rs_tsf);
                                /*
                                 * If the station has a key cache slot assigned
                                 * update the key->node mapping table.
@@ -5843,8 +5846,7 @@
                                        sc->sc_keyixmap[keyix] = 
ieee80211_ref_node(ni);
                                ieee80211_unref_node(&ni);
                        } else
-                               type = ieee80211_input_all(ic, skb,
-                                       rs->rs_rssi, rs->rs_tstamp);
+                               type = ieee80211_input_all(ic, skb, 
rs->rs_rssi, rs_tsf);
                }
 
                if (sc->sc_diversity) {
@@ -5918,7 +5920,7 @@
        if (allsta == xrsta) {
                if (sc->sc_xrpollint != XR_MIN_POLL_INTERVAL) {
                        sc->sc_xrpollint = XR_MIN_POLL_INTERVAL;
-                       ath_grppoll_txq_update(sc,XR_MIN_POLL_INTERVAL);
+                       ath_grppoll_txq_update(sc, XR_MIN_POLL_INTERVAL);
                }
                return;
        }
@@ -5935,7 +5937,7 @@
 
        if (sc->sc_xrpollint != interval) {
                sc->sc_xrpollint = interval;
-               ath_grppoll_txq_update(sc,interval);
+               ath_grppoll_txq_update(sc, interval);
        }
 
        /*
@@ -5966,7 +5968,7 @@
        qi.tqi_compBuf = 0;
        qi.tqi_cbrPeriod = IEEE80211_TU_TO_MS(period) * 1000; /* usec */
        qi.tqi_cbrOverflowLimit = 2;
-       ath_hal_settxqueueprops(ah, txq->axq_qnum,&qi);
+       ath_hal_settxqueueprops(ah, txq->axq_qnum, &qi);
        ath_hal_resettxqueue(ah, txq->axq_qnum); /* push to h/w */
 }
 
@@ -6146,7 +6148,7 @@
                                                        
XR_FRAGMENTATION_THRESHOLD,
                                                        
IEEE80211_XR_DEFAULT_RATE_INDEX,
                                                        AH_FALSE) /* Data 
packet time */
-                                               + ath_hal_computetxtime(ah,rt,
+                                               + ath_hal_computetxtime(ah, rt,
                                                        IEEE80211_ACK_LEN,
                                                        
IEEE80211_XR_DEFAULT_RATE_INDEX,
                                                        AH_FALSE); /* ACK frame 
time */
@@ -6945,7 +6947,7 @@
        /*
         * When servicing one or more stations in power-save mode (or)
         * if there is some mcast data waiting on mcast queue
-        * (to prevent out of order delivery of mcast,bcast packets)
+        * (to prevent out of order delivery of mcast/bcast packets)
         * multicast frames must be buffered until after the beacon.
         * We use the private mcast queue for that.
         */
@@ -8318,7 +8320,7 @@
 
                /* XXX: if it is SCAN state, disable beacons. */
                if (nstate == IEEE80211_S_SCAN) {
-                       ath_hal_intrset(ah,sc->sc_imask &~ (HAL_INT_SWBA | 
HAL_INT_BMISS));
+                       ath_hal_intrset(ah, sc->sc_imask &~ (HAL_INT_SWBA | 
HAL_INT_BMISS));
                        sc->sc_imask &= ~(HAL_INT_SWBA | HAL_INT_BMISS);
                        /* need to reconfigure the beacons when it moves to RUN 
*/
                        sc->sc_beacons = 0;
@@ -8344,7 +8346,7 @@
 #ifdef ATH_SUPERG_XR
        if (vap->iv_flags & IEEE80211_F_XR &&
                nstate == IEEE80211_S_RUN)
-               ATH_SETUP_XR_VAP(sc,vap,rfilt);
+               ATH_SETUP_XR_VAP(sc, vap, rfilt);
        if (vap->iv_flags & IEEE80211_F_XR &&
                nstate == IEEE80211_S_INIT && sc->sc_xrgrppoll)
                ath_grppoll_stop(vap);
@@ -9510,7 +9512,7 @@
                                if (val != sc->sc_softled) {
                                        if (val)
                                                ath_hal_gpioCfgOutput(ah, 
sc->sc_ledpin);
-                                       ath_hal_gpioset(ah, 
sc->sc_ledpin,!sc->sc_ledon);
+                                       ath_hal_gpioset(ah, sc->sc_ledpin, 
!sc->sc_ledon);
                                        sc->sc_softled = val;
                                }
                                break;
@@ -10885,7 +10887,7 @@
        if (address == AR5K_AR5212_PHY_ERR_FIL) {
                printk(KERN_DEBUG "%18s info:%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s"
                                "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
-                      (name == strstr(name,"AR5K_AR5212_") ? (name + 
strlen("AR5K_AR5212_"))
+                      (name == strstr(name, "AR5K_AR5212_") ? (name + 
strlen("AR5K_AR5212_"))
                                : name),
                       (v & (1 << 31)                ? " (1 << 31)"     : ""),
                       (v & (1 << 30)                ? " (1 << 30)"     : ""),
@@ -10924,7 +10926,7 @@
        if (address == AR5K_AR5212_PISR || address == AR5K_AR5212_PIMR) {
                printk(KERN_DEBUG "%18s info:%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s"
                                "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
-                       (name == strstr(name,"AR5K_AR5212_") ? (name + 
strlen("AR5K_AR5212_"))
+                       (name == strstr(name, "AR5K_AR5212_") ? (name + 
strlen("AR5K_AR5212_"))
                                : name),
                        (v & HAL_INT_GLOBAL           ?  " HAL_INT_GLOBAL" : 
""),
                        (v & HAL_INT_FATAL            ?  " HAL_INT_FATAL"  : 
""),
@@ -11035,7 +11037,7 @@
        printk(KERN_DEBUG
                "%23s: %s0x%08x%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s"
                        "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
-               (name == strstr(name,"AR5K_AR5212_") ? 
(name+strlen("AR5K_AR5212_"))
+               (name == strstr(name, "AR5K_AR5212_") ? 
(name+strlen("AR5K_AR5212_"))
                        : name),
                address_string,
                v_new,
@@ -11381,7 +11383,7 @@
                        break;
                }
                if (static_label) {
-                       snprintf(buf,buflen,static_label);
+                       snprintf(buf, buflen, static_label);
                        return AH_TRUE;
                }
 
@@ -11436,7 +11438,7 @@
 static void
 ath_print_register(const char* name, u_int32_t address, u_int32_t v)
 {
-       ath_print_register_delta(name,address,v,v);
+       ath_print_register_delta(name, address, v, v);
        ath_print_register_details(name, address, v);
 }
 #endif /* #ifdef ATH_REVERSE_ENGINEERING */
@@ -11488,7 +11490,7 @@
                if (ath_regdump_filter(sc, address))
                        continue;
                ath_lookup_register_name(sc, name, MAX_REGISTER_NAME_LEN, 
address);
-               value = ath_reg_read(sc,address);
+               value = ath_reg_read(sc, address);
                ath_print_register(name, address, value);
        } while ((address += 4) < MAX_REGISTER_ADDRESS);
 }
@@ -11508,7 +11510,7 @@
        do {
                if (ath_regdump_filter(sc, address))
                        continue;
-               value = ath_reg_read(sc,address);
+               value = ath_reg_read(sc, address);
                p_old = (unsigned int*)&sc->register_snapshot[address];
                if (*p_old != value) {
                        ath_lookup_register_name(sc, name, 
MAX_REGISTER_NAME_LEN, address);
@@ -11531,7 +11533,7 @@
        do {
                *((unsigned int*)&sc->register_snapshot[address]) =
                        ath_regdump_filter(sc, address) ? 
-                       0x0 : ath_reg_read(sc,address);
+                       0x0 : ath_reg_read(sc, address);
        } while ((address += 4) < MAX_REGISTER_ADDRESS);
 }
 #endif /* #ifdef ATH_REVERSE_ENGINEERING */

Modified: branches/madwifi-dfs/ath/if_athvar.h
===================================================================
--- branches/madwifi-dfs/ath/if_athvar.h        2007-06-18 17:14:03 UTC (rev 
2482)
+++ branches/madwifi-dfs/ath/if_athvar.h        2007-06-18 17:57:45 UTC (rev 
2483)
@@ -395,6 +395,7 @@
        struct ieee80211_node *bf_node;                 /* pointer to the node 
*/
        u_int32_t bf_status;                            /* status flags */
        u_int16_t bf_flags;                             /* tx descriptor flags 
*/
+       u_int64_t bf_tsf;
 #ifdef ATH_SUPERG_FF
        /* XXX: combine this with bf_skbaddr if it ever changes to accommodate
         *      multiple segments.
@@ -539,7 +540,7 @@
        struct ath_stats sc_stats;              /* private statistics */
        int devid;
        int sc_debug;
-       void (*sc_recv_mgmt)(struct ieee80211_node *, struct sk_buff *, int, 
int, u_int32_t);
+       void (*sc_recv_mgmt)(struct ieee80211_node *, struct sk_buff *, int, 
int, u_int64_t);
        void (*sc_node_cleanup)(struct ieee80211_node *);
        void (*sc_node_free)(struct ieee80211_node *);
        void *sc_bdev;                          /* associated bus device */

Modified: branches/madwifi-dfs/ath_hal/ah_os.c
===================================================================
--- branches/madwifi-dfs/ath_hal/ah_os.c        2007-06-18 17:14:03 UTC (rev 
2482)
+++ branches/madwifi-dfs/ath_hal/ah_os.c        2007-06-18 17:57:45 UTC (rev 
2483)
@@ -64,25 +64,13 @@
 #include <ah.h>
 #include <ah_os.h>
 
-#ifndef __MOD_INC_USE_COUNT
-#define        AH_MOD_INC_USE_COUNT(_m)                                        
\
-       if (!try_module_get(_m)) {                                      \
-               printk(KERN_WARNING "try_module_get failed\n");         \
-               return NULL;                                            \
-       }
-#define        AH_MOD_DEC_USE_COUNT(_m)        module_put(_m)
-#else
-#define        AH_MOD_INC_USE_COUNT(_m)        MOD_INC_USE_COUNT
-#define        AH_MOD_DEC_USE_COUNT(_m)        MOD_DEC_USE_COUNT
-#endif
-
 #ifdef AH_DEBUG
 static int ath_hal_debug = 0;
 #endif
 
-int    ath_hal_dma_beacon_response_time = 2;   /* in TU's */
-int    ath_hal_sw_beacon_response_time = 10;   /* in TU's */
-int    ath_hal_additional_swba_backoff = 0;    /* in TU's */
+int    ath_hal_dma_beacon_response_time = 2;   /* in TUs */
+int    ath_hal_sw_beacon_response_time = 10;   /* in TUs */
+int    ath_hal_additional_swba_backoff = 0;    /* in TUs */
 
 struct ath_hal *
 _ath_hal_attach(u_int16_t devid, HAL_SOFTC sc,
@@ -91,7 +79,16 @@
        struct ath_hal *ah = ath_hal_attach(devid, sc, t, h, s);
 
        if (ah)
-               AH_MOD_INC_USE_COUNT(THIS_MODULE);
+#ifndef __MOD_INC_USE_COUNT
+               if (!try_module_get(THIS_MODULE)) {
+                       printk(KERN_WARNING "%s: try_module_get failed\n",
+                                       __func__);
+                       _ath_hal_detach(ah);
+                       return NULL;
+               }
+#else
+               MOD_INC_USE_COUNT;
+#endif
        return ah;
 }
 
@@ -99,7 +96,11 @@
 _ath_hal_detach(struct ath_hal *ah)
 {
        (*ah->ah_detach)(ah);
-       AH_MOD_DEC_USE_COUNT(THIS_MODULE);
+#ifndef __MOD_INC_USE_COUNT
+       module_put(THIS_MODULE);
+#else
+       MOD_DEC_USE_COUNT;
+#endif
 }
 
 /*

Modified: branches/madwifi-dfs/net80211/ieee80211_input.c
===================================================================
--- branches/madwifi-dfs/net80211/ieee80211_input.c     2007-06-18 17:14:03 UTC 
(rev 2482)
+++ branches/madwifi-dfs/net80211/ieee80211_input.c     2007-06-18 17:57:45 UTC 
(rev 2483)
@@ -193,7 +193,7 @@
  */
 int
 ieee80211_input(struct ieee80211_node *ni,
-       struct sk_buff *skb, int rssi, u_int32_t rstamp)
+       struct sk_buff *skb, int rssi, u_int64_t rtsf)
 {
 #define        HAS_SEQ(type)   ((type & 0x4) == 0)
        struct ieee80211vap *vap = ni->ni_vap;
@@ -385,7 +385,7 @@
                        goto out;
                }
                ni->ni_rssi = rssi;
-               ni->ni_rstamp = rstamp;
+               ni->ni_rtsf = rtsf;
                ni->ni_last_rx = jiffies;
                if (HAS_SEQ(type)) {
                        u_int8_t tid;
@@ -793,7 +793,7 @@
                        wh = (struct ieee80211_frame *)skb->data;
                        wh->i_fc[1] &= ~IEEE80211_FC1_PROT;
                }
-               ic->ic_recv_mgmt(ni, skb, subtype, rssi, rstamp);
+               ic->ic_recv_mgmt(ni, skb, subtype, rssi, rtsf);
                goto out;
 
        case IEEE80211_FC0_TYPE_CTL:
@@ -894,7 +894,7 @@
  */
 int
 ieee80211_input_all(struct ieee80211com *ic,
-       struct sk_buff *skb, int rssi, u_int32_t rstamp)
+       struct sk_buff *skb, int rssi, u_int64_t rtsf)
 {
        struct ieee80211vap *vap;
        int type = -1;
@@ -915,7 +915,7 @@
                        skb = NULL;
                }
                ni = ieee80211_ref_node(vap->iv_bss);
-               type = ieee80211_input(ni, skb1, rssi, rstamp);
+               type = ieee80211_input(ni, skb1, rssi, rtsf);
                ieee80211_unref_node(&ni);
        }
        if (skb != NULL)                /* no vaps, reclaim skb */
@@ -1229,7 +1229,7 @@
 
 static void
 ieee80211_auth_open(struct ieee80211_node *ni, struct ieee80211_frame *wh,
-       int rssi, u_int32_t rstamp, u_int16_t seq, u_int16_t status)
+       int rssi, u_int64_t rtsf, u_int16_t seq, u_int16_t status)
 {
        struct ieee80211vap *vap = ni->ni_vap;
        unsigned int tmpnode = 0;
@@ -1372,7 +1372,7 @@
 /* XXX TODO: add statistics */
 static void
 ieee80211_auth_shared(struct ieee80211_node *ni, struct ieee80211_frame *wh,
-       u_int8_t *frm, u_int8_t *efrm, int rssi, u_int32_t rstamp,
+       u_int8_t *frm, u_int8_t *efrm, int rssi, u_int64_t rtsf,
        u_int16_t seq, u_int16_t status)
 {
        struct ieee80211vap *vap = ni->ni_vap;
@@ -1480,7 +1480,7 @@
                        }
 
                        ni->ni_rssi = rssi;
-                       ni->ni_rstamp = rstamp;
+                       ni->ni_rtsf = rtsf;
                        ni->ni_last_rx = jiffies;
                        if (!alloc_challenge(ni)) {
                                /* NB: don't return error so they rexmit */
@@ -2859,7 +2859,7 @@
  */
 void
 ieee80211_recv_mgmt(struct ieee80211_node *ni, struct sk_buff *skb,
-       int subtype, int rssi, u_int32_t rstamp)
+       int subtype, int rssi, u_int64_t rtsf)
 {
 #define        ISPROBE(_st)    ((_st) == IEEE80211_FC0_SUBTYPE_PROBE_RESP)
 #define        ISREASSOC(_st)  ((_st) == IEEE80211_FC0_SUBTYPE_REASSOC_RESP)
@@ -3190,7 +3190,7 @@
                         */
                        if (ic->ic_flags & IEEE80211_F_SCAN)
                                ieee80211_add_scan(vap, &scan, wh,
-                                       subtype, rssi, rstamp);
+                                       subtype, rssi, rtsf);
                        else if (contbgscan(vap) || startbgscan(vap))
                                ieee80211_bg_scan(vap);
                        return;
@@ -3199,7 +3199,7 @@
                 * If scanning, just pass information to the scan module.
                 */
                if (ic->ic_flags & IEEE80211_F_SCAN) {
-                       ieee80211_add_scan(vap, &scan, wh, subtype, rssi, 
rstamp);
+                       ieee80211_add_scan(vap, &scan, wh, subtype, rssi, rtsf);
                        return;
                }
                if (scan.capinfo & IEEE80211_CAPINFO_IBSS) {
@@ -3240,7 +3240,7 @@
                        }
                        if (ni != NULL) {
                                ni->ni_rssi = rssi;
-                               ni->ni_rstamp = rstamp;
+                               ni->ni_rtsf = rtsf;
                                ni->ni_last_rx = jiffies;
                        }
                }
@@ -3329,7 +3329,7 @@
                IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_INPUT, wh->i_addr2,
                        "%s", "recv probe req");
                ni->ni_rssi = rssi;
-               ni->ni_rstamp = rstamp;
+               ni->ni_rtsf = rtsf;
                ni->ni_last_rx = jiffies;
                rate = ieee80211_setup_rates(ni, rates, xrates,
                        IEEE80211_F_DOSORT | IEEE80211_F_DOFRATE |
@@ -3415,9 +3415,9 @@
                }
                if (algo == IEEE80211_AUTH_ALG_SHARED)
                        ieee80211_auth_shared(ni, wh, frm + 6, efrm, rssi,
-                               rstamp, seq, status);
+                               rtsf, seq, status);
                else if (algo == IEEE80211_AUTH_ALG_OPEN)
-                       ieee80211_auth_open(ni, wh, rssi, rstamp, seq, status);
+                       ieee80211_auth_open(ni, wh, rssi, rtsf, seq, status);
                else {
                        IEEE80211_DISCARD(vap, IEEE80211_MSG_ANY,
                                wh, "auth", "unsupported alg %d", algo);
@@ -3662,7 +3662,7 @@
                }
 
                ni->ni_rssi = rssi;
-               ni->ni_rstamp = rstamp;
+               ni->ni_rtsf = rtsf;
                ni->ni_last_rx = jiffies;
                ni->ni_intval = IEEE80211_BINTVAL_SANITISE(bintval);
                ni->ni_capinfo = capinfo;

Modified: branches/madwifi-dfs/net80211/ieee80211_linux.h
===================================================================
--- branches/madwifi-dfs/net80211/ieee80211_linux.h     2007-06-18 17:14:03 UTC 
(rev 2482)
+++ branches/madwifi-dfs/net80211/ieee80211_linux.h     2007-06-18 17:57:45 UTC 
(rev 2483)
@@ -419,7 +419,7 @@
 #define        _MOD_INC_USE(_m, _err)                                          
\
        if (!try_module_get(_m)) {                                      \
                printk(KERN_WARNING "%s: try_module_get failed\n",      \
-                       __func__); \
+                       __func__);                                      \
                _err;                                                   \
        }
 #define        _MOD_DEC_USE(_m)                module_put(_m)

Modified: branches/madwifi-dfs/net80211/ieee80211_node.c
===================================================================
--- branches/madwifi-dfs/net80211/ieee80211_node.c      2007-06-18 17:14:03 UTC 
(rev 2482)
+++ branches/madwifi-dfs/net80211/ieee80211_node.c      2007-06-18 17:57:45 UTC 
(rev 2483)
@@ -659,7 +659,7 @@
        IEEE80211_ADDR_COPY(ni->ni_bssid, se->se_bssid);
        ni->ni_esslen = se->se_ssid[1];
        memcpy(ni->ni_essid, se->se_ssid + 2, ni->ni_esslen);
-       ni->ni_rstamp = se->se_rstamp;
+       ni->ni_rtsf = se->se_rtsf;
        ni->ni_tstamp.tsf = se->se_tstamp.tsf;
        ni->ni_intval = IEEE80211_BINTVAL_SANITISE(se->se_intval);
        ni->ni_capinfo = se->se_capinfo;
@@ -1608,8 +1608,8 @@
                       ni->ni_rxseqs[i] >> IEEE80211_SEQ_SEQ_SHIFT,
                       ni->ni_rxseqs[i] & IEEE80211_SEQ_FRAG_MASK);
        }
-       printf("\trstamp %u rssi %u intval %u capinfo 0x%x\n",
-               ni->ni_rstamp, ni->ni_rssi, ni->ni_intval, ni->ni_capinfo);
+       printf("\trtsf %10llu rssi %u intval %u capinfo 0x%x\n",
+               ni->ni_rtsf, ni->ni_rssi, ni->ni_intval, ni->ni_capinfo);
        printf("\tbssid %s essid \"%.*s\" channel %u:0x%x\n",
                ether_sprintf(ni->ni_bssid),
                ni->ni_esslen, ni->ni_essid,

Modified: branches/madwifi-dfs/net80211/ieee80211_node.h
===================================================================
--- branches/madwifi-dfs/net80211/ieee80211_node.h      2007-06-18 17:14:03 UTC 
(rev 2482)
+++ branches/madwifi-dfs/net80211/ieee80211_node.h      2007-06-18 17:57:45 UTC 
(rev 2483)
@@ -140,7 +140,7 @@
        int ni_rxkeyoff;                        /* Receive key offset */
 
        /* hardware */
-       u_int32_t ni_rstamp;                    /* recv timestamp */
+       u_int64_t ni_rtsf;                      /* recv timestamp */
        u_int32_t ni_last_rx;                   /* recv jiffies */
        u_int8_t ni_rssi;                       /* recv ssi */
 

Modified: branches/madwifi-dfs/net80211/ieee80211_proto.h
===================================================================
--- branches/madwifi-dfs/net80211/ieee80211_proto.h     2007-06-18 17:14:03 UTC 
(rev 2482)
+++ branches/madwifi-dfs/net80211/ieee80211_proto.h     2007-06-18 17:57:45 UTC 
(rev 2483)
@@ -63,14 +63,14 @@
 
 struct ieee80211_node;
 struct ieee80211_channel *ieee80211_doth_findchan(struct ieee80211vap *, 
u_int8_t);
-int ieee80211_input(struct ieee80211_node *, struct sk_buff *, int, u_int32_t);
-int ieee80211_input_all(struct ieee80211com *, struct sk_buff *, int, 
u_int32_t);
+int ieee80211_input(struct ieee80211_node *, struct sk_buff *, int, u_int64_t);
+int ieee80211_input_all(struct ieee80211com *, struct sk_buff *, int, 
u_int64_t);
 int ieee80211_setup_rates(struct ieee80211_node *, const u_int8_t *,
        const u_int8_t *, int);
 void ieee80211_saveie(u_int8_t **, const u_int8_t *);
 void ieee80211_saveath(struct ieee80211_node *, u_int8_t *);
 void ieee80211_recv_mgmt(struct ieee80211_node *, struct sk_buff *,
-       int, int, u_int32_t);
+       int, int, u_int64_t);
 void ieee80211_sta_pwrsave(struct ieee80211vap *, int);
 int ieee80211_hardstart(struct sk_buff *, struct net_device *);
 void ieee80211_parent_queue_xmit(struct sk_buff *);

Modified: branches/madwifi-dfs/net80211/ieee80211_scan.c
===================================================================
--- branches/madwifi-dfs/net80211/ieee80211_scan.c      2007-06-18 17:14:03 UTC 
(rev 2482)
+++ branches/madwifi-dfs/net80211/ieee80211_scan.c      2007-06-18 17:57:45 UTC 
(rev 2483)
@@ -832,7 +832,7 @@
 ieee80211_add_scan(struct ieee80211vap *vap,
        const struct ieee80211_scanparams *sp,
        const struct ieee80211_frame *wh,
-       int subtype, int rssi, int rstamp)
+       int subtype, int rssi, u_int64_t rtsf)
 {
        struct ieee80211com *ic = vap->iv_ic;
        struct ieee80211_scan_state *ss = ic->ic_scan;
@@ -852,7 +852,7 @@
                dump_probe_beacon(subtype, 1, wh->i_addr2, sp);
 #endif
        if (ss->ss_ops != NULL &&
-           ss->ss_ops->scan_add(ss, sp, wh, subtype, rssi, rstamp)) {
+           ss->ss_ops->scan_add(ss, sp, wh, subtype, rssi, rtsf)) {
                /*
                 * If we've reached the min dwell time terminate
                 * the timer so we'll switch to the next channel.

Modified: branches/madwifi-dfs/net80211/ieee80211_scan.h
===================================================================
--- branches/madwifi-dfs/net80211/ieee80211_scan.h      2007-06-18 17:14:03 UTC 
(rev 2482)
+++ branches/madwifi-dfs/net80211/ieee80211_scan.h      2007-06-18 17:57:45 UTC 
(rev 2483)
@@ -39,7 +39,7 @@
 struct ieee80211_scan_entry;
 
 struct ieee80211_scan_ssid {
-       int len;                                        /* length in bytes */
+       int len;                                /* length in bytes */
        u_int8_t ssid[IEEE80211_NWID_LEN];      /* ssid contents */
 };
 #define        IEEE80211_SCAN_MAX_SSID 1
@@ -100,7 +100,7 @@
 
 struct ieee80211_scanparams;
 void ieee80211_add_scan(struct ieee80211vap *, const struct 
ieee80211_scanparams *,
-       const struct ieee80211_frame *, int, int, int);
+       const struct ieee80211_frame *, int, int, u_int64_t);
 void ieee80211_scan_timeout(struct ieee80211com *);
 
 void ieee80211_scan_assoc_success(struct ieee80211com *,
@@ -156,7 +156,7 @@
        u_int8_t se_ssid[2 + IEEE80211_NWID_LEN];
        u_int8_t se_rates[2 + IEEE80211_RATE_MAXSIZE];
        u_int8_t se_xrates[2 + IEEE80211_RATE_MAXSIZE];
-       u_int32_t se_rstamp;            /* recv timestamp */
+       u_int64_t se_rtsf;              /* recv timestamp */
        union {
                u_int8_t data[8];
                __le64 tsf;
@@ -196,7 +196,7 @@
        /* add an entry to the cache */
        int (*scan_add)(struct ieee80211_scan_state *,
                const struct ieee80211_scanparams *,
-               const struct ieee80211_frame *, int, int, int);
+               const struct ieee80211_frame *, int, int, u_int64_t);
        /* age and/or purge entries in the cache */
        void (*scan_age)(struct ieee80211_scan_state *);
        /* note that association failed for an entry */

Modified: branches/madwifi-dfs/net80211/ieee80211_scan_ap.c
===================================================================
--- branches/madwifi-dfs/net80211/ieee80211_scan_ap.c   2007-06-18 17:14:03 UTC 
(rev 2482)
+++ branches/madwifi-dfs/net80211/ieee80211_scan_ap.c   2007-06-18 17:57:45 UTC 
(rev 2483)
@@ -320,7 +320,7 @@
  */
 static int
 ap_add(struct ieee80211_scan_state *ss, const struct ieee80211_scanparams *sp,
-       const struct ieee80211_frame *wh, int subtype, int rssi, int rstamp)
+       const struct ieee80211_frame *wh, int subtype, int rssi, u_int64_t rtsf)
 {
        struct ap_state *as = ss->ss_priv;
        struct ieee80211vap *vap = ss->ss_vap;

Modified: branches/madwifi-dfs/net80211/ieee80211_scan_sta.c
===================================================================
--- branches/madwifi-dfs/net80211/ieee80211_scan_sta.c  2007-06-18 17:14:03 UTC 
(rev 2482)
+++ branches/madwifi-dfs/net80211/ieee80211_scan_sta.c  2007-06-18 17:57:45 UTC 
(rev 2483)
@@ -215,7 +215,7 @@
  */
 static int
 sta_add(struct ieee80211_scan_state *ss, const struct ieee80211_scanparams *sp,
-       const struct ieee80211_frame *wh, int subtype, int rssi, int rstamp)
+       const struct ieee80211_frame *wh, int subtype, int rssi, u_int64_t rtsf)
 {
 #define        ISPROBE(_st)    ((_st) == IEEE80211_FC0_SUBTYPE_PROBE_RESP)
 #define        PICK1ST(_ss) \
@@ -272,7 +272,7 @@
        else                                    /* avg w/ previous samples */
                RSSI_LPF(se->se_avgrssi, rssi);
        se->base.se_rssi = RSSI_GET(se->se_avgrssi);
-       ise->se_rstamp = rstamp;
+       ise->se_rtsf = rtsf;
        memcpy(ise->se_tstamp.data, sp->tstamp, sizeof(ise->se_tstamp));
        ise->se_intval = sp->bintval;
        ise->se_capinfo = sp->capinfo;

Modified: branches/madwifi-dfs/net80211/ieee80211_var.h
===================================================================
--- branches/madwifi-dfs/net80211/ieee80211_var.h       2007-06-18 17:14:03 UTC 
(rev 2482)
+++ branches/madwifi-dfs/net80211/ieee80211_var.h       2007-06-18 17:57:45 UTC 
(rev 2483)
@@ -131,7 +131,7 @@
 #define IW_MAX_SPY 8
 struct ieee80211_spy {
        u_int8_t mac[IW_MAX_SPY * IEEE80211_ADDR_LEN];
-       u_int32_t ts_rssi[IW_MAX_SPY];          /* ts of rssi value from last 
read */
+       u_int64_t ts_rssi[IW_MAX_SPY];          /* ts of rssi value from last 
read */
        u_int8_t thr_low;                       /* 1 byte rssi value, 0 = 
threshold is off */
        u_int8_t thr_high;                      /* 1 byte rssi value */
        u_int8_t num;
@@ -395,7 +395,7 @@
        /* Send/recv 802.11 management frame */
        int (*ic_send_mgmt)(struct ieee80211_node *, int, int);
        void (*ic_recv_mgmt)(struct ieee80211_node *, struct sk_buff *, int,
-               int, u_int32_t);
+               int, u_int64_t);
 
        /* Send management frame to driver (like hardstart) */
        int (*ic_mgtstart)(struct ieee80211com *, struct sk_buff *);

Modified: branches/madwifi-dfs/net80211/ieee80211_wireless.c
===================================================================
--- branches/madwifi-dfs/net80211/ieee80211_wireless.c  2007-06-18 17:14:03 UTC 
(rev 2482)
+++ branches/madwifi-dfs/net80211/ieee80211_wireless.c  2007-06-18 17:57:45 UTC 
(rev 2483)
@@ -1064,8 +1064,8 @@
                for (i = 0; i < number; i++)
                        memcpy(&vap->iv_spy.mac[i * IEEE80211_ADDR_LEN],
                                address[i].sa_data, IEEE80211_ADDR_LEN);
-               /* init rssi timestamps */
-               memset(vap->iv_spy.ts_rssi, 0, IW_MAX_SPY * sizeof(u_int32_t));
+               /* init rssi timestamps to 0 */
+               memset(vap->iv_spy.ts_rssi, 0, sizeof(vap->iv_spy.ts_rssi));
        }
        vap->iv_spy.num = number;
 
@@ -1105,8 +1105,8 @@
                /* check we are associated w/ this vap */
                if (ni && (ni->ni_vap == vap)) {
                        set_quality(&spy_stat[i], ni->ni_rssi, 
ic->ic_channoise);
-                       if (ni->ni_rstamp != vap->iv_spy.ts_rssi[i]) {
-                               vap->iv_spy.ts_rssi[i] = ni->ni_rstamp;
+                       if (ni->ni_rtsf != vap->iv_spy.ts_rssi[i]) {
+                               vap->iv_spy.ts_rssi[i] = ni->ni_rtsf;
                        } else {
                                spy_stat[i].updated = 0;
                        }

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/



Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>