Beispiel #1
0
int dfs_get_filter_threshold(struct ath_softc *sc, struct dfs_filter *rf, int is_extchan_detect)
{
    int ext_chan_busy=0;
    int thresh, adjust_thresh=0;
    struct ath_dfs *dfs = sc->sc_dfs;

    thresh = rf->rf_threshold;    

    if (IS_CHAN_HT40(&sc->sc_curchan)) {
        ext_chan_busy = ath_hal_get11nextbusy(sc->sc_ah);
        if(ext_chan_busy >= 0) {
	        dfs->dfs_rinfo.ext_chan_busy_ts = ath_hal_gettsf64(sc->sc_ah);
            dfs->dfs_rinfo.dfs_ext_chan_busy = ext_chan_busy;
        } else {
            // Check to see if the cached value of ext_chan_busy can be used
            ext_chan_busy = 0;
            if (dfs->dfs_rinfo.dfs_ext_chan_busy) {
	        if (dfs->dfs_rinfo.rn_lastfull_ts < dfs->dfs_rinfo.ext_chan_busy_ts) {
                        ext_chan_busy = dfs->dfs_rinfo.dfs_ext_chan_busy; 
                        DFS_DPRINTK(sc, ATH_DEBUG_DFS2," THRESH Use cached copy of ext_chan_busy extchanbusy=%d rn_lastfull_ts=%llu ext_chan_busy_ts=%llu\n", ext_chan_busy ,(unsigned long long)dfs->dfs_rinfo.rn_lastfull_ts, (unsigned long long)dfs->dfs_rinfo.ext_chan_busy_ts);
                }
            }
        }

        adjust_thresh = adjust_thresh_per_chan_busy(ext_chan_busy, thresh);

        DFS_DPRINTK(sc, ATH_DEBUG_DFS2," filterID=%d extchanbusy=%d adjust_thresh=%d\n", rf->rf_pulseid, ext_chan_busy, adjust_thresh);

        thresh += adjust_thresh;
    }
    return thresh;
}
Beispiel #2
0
int dfs_get_pri_margin(struct ath_softc *sc, int is_extchan_detect, int is_fixed_pattern)
{

    int adjust_pri=0, ext_chan_busy=0;
    int pri_margin;
    struct ath_dfs *dfs = sc->sc_dfs;

    if (is_fixed_pattern)
        pri_margin = DFS_DEFAULT_FIXEDPATTERN_PRI_MARGIN;
    else
        pri_margin = DFS_DEFAULT_PRI_MARGIN;

    if (IS_CHAN_HT40(&sc->sc_curchan)) {
        ext_chan_busy = ath_hal_get11nextbusy(sc->sc_ah);
        if(ext_chan_busy >= 0) {
            dfs->dfs_rinfo.ext_chan_busy_ts = ath_hal_gettsf64(sc->sc_ah);
            dfs->dfs_rinfo.dfs_ext_chan_busy = ext_chan_busy;
        } else {
            // Check to see if the cached value of ext_chan_busy can be used
            ext_chan_busy = 0;
            if (dfs->dfs_rinfo.dfs_ext_chan_busy ) {
                if (dfs->dfs_rinfo.rn_lastfull_ts < dfs->dfs_rinfo.ext_chan_busy_ts) {
                    ext_chan_busy = dfs->dfs_rinfo.dfs_ext_chan_busy; 
                    DFS_DPRINTK(sc, ATH_DEBUG_DFS2," PRI Use cached copy of ext_chan_busy extchanbusy=%d \n", ext_chan_busy);
                }
            }
        }
        adjust_pri = adjust_pri_per_chan_busy(ext_chan_busy, pri_margin);

        pri_margin -= adjust_pri;
    }
    return pri_margin;
}
Beispiel #3
0
void dfs_print_activity(struct ath_softc *sc)
{
    int chan_busy=0, ext_chan_busy=0;
    u_int32_t rxclear=0, rxframe=0, txframe=0, cycles=0;


    cycles = ath_hal_getMibCycleCountsPct(sc->sc_ah,&rxclear, &rxframe, &txframe);
    chan_busy = cycles;

    ext_chan_busy = ath_hal_get11nextbusy(sc->sc_ah);

    DFS_DPRINTK(sc, ATH_DEBUG_DFS,"cycles=%d rxclear=%d rxframe=%d txframe=%d extchanbusy=%d\n", cycles, rxclear, rxframe, txframe, ext_chan_busy);
    DFS_DPRINTK(sc, ATH_DEBUG_DFS, "FILT_OFDM=0x%x FILT_CCK=0x%x\n",(0x00FFFFFF & OS_REG_READ(sc->sc_ah, 0x8124)), (0x00FFFFFF & OS_REG_READ(sc->sc_ah, 0x8128)));
    return;
}