Skip to content

Commit

Permalink
Importing pfSense patches net80211HEAD.tgz and conf.file.ieee80211.diff
Browse files Browse the repository at this point in the history
  • Loading branch information
rbgarga committed Aug 17, 2015
1 parent 924a927 commit 6ee75bd
Show file tree
Hide file tree
Showing 168 changed files with 44,542 additions and 5,104 deletions.
47 changes: 45 additions & 2 deletions sys/conf/files
Expand Up @@ -1592,6 +1592,48 @@ iwn1000.fw optional iwn1000fw | iwnfw \
compile-with "${NORMAL_FW}" \
no-obj no-implicit-rule \
clean "iwn1000.fw"
iwn100fw.c optional iwn100fw | iwnfw \
compile-with "${AWK} -f $S/tools/fw_stub.awk iwn100.fw:iwn100fw -miwn100fw -c${.TARGET}" \
no-implicit-rule before-depend local \
clean "iwn100fw.c"
iwn100fw.fwo optional iwn100fw | iwnfw \
dependency "iwn100.fw" \
compile-with "${NORMAL_FWO}" \
no-implicit-rule \
clean "iwn100fw.fwo"
iwn100.fw optional iwn100fw | iwnfw \
dependency "$S/contrib/dev/iwn/iwlwifi-100-39.31.5.1.fw.uu" \
compile-with "${NORMAL_FW}" \
no-obj no-implicit-rule \
clean "iwn100.fw"
iwn105fw.c optional iwn105fw | iwnfw \
compile-with "${AWK} -f $S/tools/fw_stub.awk iwn105.fw:iwn105fw -miwn105fw -c${.TARGET}" \
no-implicit-rule before-depend local \
clean "iwn105fw.c"
iwn105fw.fwo optional iwn105fw | iwnfw \
dependency "iwn105.fw" \
compile-with "${NORMAL_FWO}" \
no-implicit-rule \
clean "iwn105fw.fwo"
iwn105.fw optional iwn105fw | iwnfw \
dependency "$S/contrib/dev/iwn/iwlwifi-105-6-18.168.6.1.fw.uu" \
compile-with "${NORMAL_FW}" \
no-obj no-implicit-rule \
clean "iwn105.fw"
iwn135fw.c optional iwn135fw | iwnfw \
compile-with "${AWK} -f $S/tools/fw_stub.awk iwn135.fw:iwn135fw -miwn135fw -c${.TARGET}" \
no-implicit-rule before-depend local \
clean "iwn135fw.c"
iwn135fw.fwo optional iwn135fw | iwnfw \
dependency "iwn135.fw" \
compile-with "${NORMAL_FWO}" \
no-implicit-rule \
clean "iwn135fw.fwo"
iwn135.fw optional iwn135fw | iwnfw \
dependency "$S/contrib/dev/iwn/iwlwifi-135-6-18.168.6.1.fw.uu" \
compile-with "${NORMAL_FW}" \
no-obj no-implicit-rule \
clean "iwn135.fw"
iwn2000fw.c optional iwn2000fw | iwnfw \
compile-with "${AWK} -f $S/tools/fw_stub.awk iwn2000.fw:iwn2000fw -miwn2000fw -c${.TARGET}" \
no-implicit-rule before-depend local \
Expand Down Expand Up @@ -1686,7 +1728,7 @@ iwn6000g2afw.fwo optional iwn6000g2afw | iwnfw \
no-implicit-rule \
clean "iwn6000g2afw.fwo"
iwn6000g2a.fw optional iwn6000g2afw | iwnfw \
dependency "$S/contrib/dev/iwn/iwlwifi-6000g2a-17.168.5.2.fw.uu" \
dependency "$S/contrib/dev/iwn/iwlwifi-6000g2b-18.168.6.1.fw.uu" \
compile-with "${NORMAL_FW}" \
no-obj no-implicit-rule \
clean "iwn6000g2a.fw"
Expand All @@ -1700,7 +1742,7 @@ iwn6000g2bfw.fwo optional iwn6000g2bfw | iwnfw \
no-implicit-rule \
clean "iwn6000g2bfw.fwo"
iwn6000g2b.fw optional iwn6000g2bfw | iwnfw \
dependency "$S/contrib/dev/iwn/iwlwifi-6000g2b-17.168.5.2.fw.uu" \
dependency "$S/contrib/dev/iwn/iwlwifi-6000g2b-18.168.6.1.fw.uu" \
compile-with "${NORMAL_FW}" \
no-obj no-implicit-rule \
clean "iwn6000g2b.fw"
Expand Down Expand Up @@ -3364,6 +3406,7 @@ net80211/ieee80211_scan_sta.c optional wlan
net80211/ieee80211_sta.c optional wlan \
compile-with "${NORMAL_C} -Wno-unused-function"
net80211/ieee80211_superg.c optional wlan ieee80211_support_superg
net80211/ieee80211_scan_sw.c optional wlan
net80211/ieee80211_tdma.c optional wlan ieee80211_support_tdma
net80211/ieee80211_wds.c optional wlan
net80211/ieee80211_xauth.c optional wlan wlan_xauth
Expand Down
1 change: 1 addition & 0 deletions sys/conf/options
Expand Up @@ -852,6 +852,7 @@ MWL_TX_NODROP opt_mwl.h

# Options for the Intel 802.11n wireless driver
IWN_DEBUG opt_iwn.h
WPI_DEBUG opt_wpi.h

# dcons options
DCONS_BUF_SIZE opt_dcons.h
Expand Down
41 changes: 36 additions & 5 deletions sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h
Expand Up @@ -185,6 +185,8 @@ struct ar9300_ani_state {
int32_t rssi; /* The current RSSI */
u_int32_t tx_frame_count; /* Last tx_frame_count */
u_int32_t rx_frame_count; /* Last rx Frame count */
u_int32_t rx_busy_count; /* Last rx busy count */
u_int32_t rx_ext_busy_count; /* Last rx busy count; extension channel */
u_int32_t cycle_count; /* Last cycle_count (can detect wrap-around) */
u_int32_t ofdm_phy_err_count;/* OFDM err count since last reset */
u_int32_t cck_phy_err_count; /* CCK err count since last reset */
Expand All @@ -204,6 +206,7 @@ struct ar9300_ani_state {
#define DO_ANI(ah) \
((AH9300(ah)->ah_proc_phy_err & HAL_PROCESS_ANI))

#if 0
struct ar9300_stats {
u_int32_t ast_ani_niup; /* ANI increased noise immunity */
u_int32_t ast_ani_nidown; /* ANI decreased noise immunity */
Expand All @@ -223,6 +226,7 @@ struct ar9300_stats {
HAL_MIB_STATS ast_mibstats; /* MIB counter stats */
HAL_NODE_STATS ast_nodestats; /* Latest rssi stats from driver */
};
#endif

struct ar9300_rad_reader {
u_int16_t rd_index;
Expand Down Expand Up @@ -429,7 +433,7 @@ struct ath_hal_9300 {
u_int32_t ah_mask2Reg; /* copy of AR_IMR_S2 */
u_int32_t ah_msi_reg; /* copy of AR_PCIE_MSI */
os_atomic_t ah_ier_ref_count; /* reference count for enabling interrupts */
struct ar9300_stats ah_stats; /* various statistics */
HAL_ANI_STATS ah_stats; /* various statistics */
RF_HAL_FUNCS ah_rf_hal;
u_int32_t ah_tx_desc_mask; /* mask for TXDESC */
u_int32_t ah_tx_ok_interrupt_mask;
Expand Down Expand Up @@ -576,6 +580,9 @@ struct ath_hal_9300 {
u_int8_t ah_tx_chainmask; /* tx chain mask */
u_int8_t ah_rx_chainmask; /* rx chain mask */

/* optional tx chainmask */
u_int8_t ah_tx_chainmaskopt;

u_int8_t ah_tx_cal_chainmask; /* tx cal chain mask */
u_int8_t ah_rx_cal_chainmask; /* rx cal chain mask */

Expand Down Expand Up @@ -845,13 +852,22 @@ struct ath_hal_9300 {
HAL_BOOL ah_aic_enabled;
u_int32_t ah_aic_sram[ATH_AIC_MAX_BT_CHANNEL];
#endif

#endif /* ATH_SUPPORT_MCI */
u_int8_t ah_cac_quiet_enabled;
#if ATH_WOW_OFFLOAD
u_int32_t ah_mcast_filter_l32_set;
u_int32_t ah_mcast_filter_u32_set;
#endif
HAL_BOOL ah_reduced_self_gen_mask;
HAL_BOOL ah_chip_reset_done;
HAL_BOOL ah_abort_txdma_norx;
/* store previous passive RX Cal info */
HAL_BOOL ah_skip_rx_iq_cal;
HAL_BOOL ah_rx_cal_complete; /* previous rx cal completed or not */
u_int32_t ah_rx_cal_chan; /* chan on which rx cal is done */
u_int32_t ah_rx_cal_chan_flag;
u_int32_t ah_rx_cal_corr[AR9300_MAX_CHAINS];

/* Local additions for FreeBSD */
/*
Expand All @@ -873,11 +889,11 @@ struct ath_hal_9300 {
int ah_fccaifs;
int ah_reset_reason;
int ah_dcs_enable;
HAL_ANI_STATE ext_ani_state; /* FreeBSD; external facing ANI state */

struct ar9300NfLimits nf_2GHz;
struct ar9300NfLimits nf_5GHz;
struct ar9300NfLimits *nfp;

};

#define AH9300(_ah) ((struct ath_hal_9300 *)(_ah))
Expand Down Expand Up @@ -1181,10 +1197,11 @@ struct ath_hal;

extern struct ath_hal_9300 * ar9300_new_state(u_int16_t devid,
HAL_SOFTC sc, HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata,
HAL_OPS_CONFIG *ah_config,
HAL_STATUS *status);
extern struct ath_hal * ar9300_attach(u_int16_t devid,
HAL_SOFTC sc, HAL_BUS_TAG st, HAL_BUS_HANDLE sh, uint16_t *eepromdata,
HAL_STATUS *status);
HAL_OPS_CONFIG *ah_config, HAL_STATUS *status);
extern void ar9300_detach(struct ath_hal *ah);
extern void ar9300_read_revisions(struct ath_hal *ah);
extern HAL_BOOL ar9300_chip_test(struct ath_hal *ah);
Expand All @@ -1193,7 +1210,8 @@ extern HAL_BOOL ar9300_get_channel_edges(struct ath_hal *ah,
extern HAL_BOOL ar9300_fill_capability_info(struct ath_hal *ah);

extern void ar9300_beacon_init(struct ath_hal *ah,
u_int32_t next_beacon, u_int32_t beacon_period, HAL_OPMODE opmode);
u_int32_t next_beacon, u_int32_t beacon_period,
u_int32_t beacon_period_fraction, HAL_OPMODE opmode);
extern void ar9300_set_sta_beacon_timers(struct ath_hal *ah,
const HAL_BEACON_STATE *);

Expand All @@ -1216,12 +1234,21 @@ extern HAL_BOOL ar9300_set_key_cache_entry_mac(struct ath_hal *,
extern HAL_BOOL ar9300_set_key_cache_entry(struct ath_hal *ah, u_int16_t entry,
const HAL_KEYVAL *k, const u_int8_t *mac, int xor_key);
extern HAL_BOOL ar9300_print_keycache(struct ath_hal *ah);
#if ATH_SUPPORT_KEYPLUMB_WAR
extern HAL_BOOL ar9300_check_key_cache_entry(struct ath_hal *ah, u_int16_t entry,
const HAL_KEYVAL *k, int xorKey);
#endif

extern void ar9300_get_mac_address(struct ath_hal *ah, u_int8_t *mac);
extern HAL_BOOL ar9300_set_mac_address(struct ath_hal *ah, const u_int8_t *);
extern void ar9300_get_bss_id_mask(struct ath_hal *ah, u_int8_t *mac);
extern HAL_BOOL ar9300_set_bss_id_mask(struct ath_hal *, const u_int8_t *);
extern HAL_STATUS ar9300_select_ant_config(struct ath_hal *ah, u_int32_t cfg);
#if 0
extern u_int32_t ar9300_ant_ctrl_common_get(struct ath_hal *ah, HAL_BOOL is_2ghz);
#endif
extern HAL_BOOL ar9300_ant_swcom_sel(struct ath_hal *ah, u_int8_t ops,
u_int32_t *common_tbl1, u_int32_t *common_tbl2);
extern HAL_BOOL ar9300_set_regulatory_domain(struct ath_hal *ah,
u_int16_t reg_domain, HAL_STATUS *stats);
extern u_int ar9300_get_wireless_modes(struct ath_hal *ah);
Expand Down Expand Up @@ -1396,6 +1423,8 @@ extern HAL_BOOL ar9300_set_tx_power_limit(struct ath_hal *ah, u_int32_t limit,
u_int16_t extra_txpow, u_int16_t tpc_in_db);
extern void ar9300_chain_noise_floor(struct ath_hal *ah, int16_t *nf_buf,
struct ieee80211_channel *chan, int is_scan);
extern int16_t ar9300_get_nf_from_reg(struct ath_hal *ah, struct ieee80211_channel *chan, int wait_time);
extern int ar9300_get_rx_nf_offset(struct ath_hal *ah, struct ieee80211_channel *chan, int8_t *nf_pwr, int8_t *nf_cal);
extern HAL_BOOL ar9300_load_nf(struct ath_hal *ah, int16_t nf[]);

extern HAL_RFGAIN ar9300_get_rfgain(struct ath_hal *ah);
Expand All @@ -1417,7 +1446,7 @@ extern void ar9300_disable_mib_counters(struct ath_hal *);
extern void ar9300_ani_attach(struct ath_hal *);
extern void ar9300_ani_detach(struct ath_hal *);
extern struct ar9300_ani_state *ar9300_ani_get_current_state(struct ath_hal *);
extern struct ar9300_stats *ar9300_ani_get_current_stats(struct ath_hal *);
extern HAL_ANI_STATS *ar9300_ani_get_current_stats(struct ath_hal *);
extern HAL_BOOL ar9300_ani_control(struct ath_hal *, HAL_ANI_CMD cmd, int param);
struct ath_rx_status;

Expand Down Expand Up @@ -1680,6 +1709,8 @@ extern void ar9300_tx99_start(struct ath_hal *ah, u_int8_t *data);
extern void ar9300_tx99_stop(struct ath_hal *ah);
#endif /* ATH_SUPPORT_HTC */
#endif /* ATH_TX99_DIAG */
extern HAL_BOOL ar9300_set_ctl_pwr(struct ath_hal *ah, u_int8_t *ctl_array);
extern void ar9300_set_txchainmaskopt(struct ath_hal *ah, u_int8_t mask);

enum {
AR9300_COEFF_TX_TYPE = 0,
Expand Down
38 changes: 32 additions & 6 deletions sys/contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c
Expand Up @@ -210,7 +210,7 @@ ar9300_ani_get_current_state(struct ath_hal *ah)
/*
* Return the current statistics.
*/
struct ar9300_stats *
HAL_ANI_STATS *
ar9300_ani_get_current_stats(struct ath_hal *ah)
{
return &AH9300(ah)->ah_stats;
Expand Down Expand Up @@ -484,6 +484,9 @@ ar9300_ani_control(struct ath_hal *ah, HAL_ANI_CMD cmd, int param)
*/
is_on = param ? 1 : 0;

if (AR_SREV_JUPITER(ah) || AR_SREV_APHRODITE(ah))
goto skip_ws_det;

/*
* make register setting for default (weak sig detect ON)
* come from INI file
Expand Down Expand Up @@ -528,6 +531,7 @@ ar9300_ani_control(struct ath_hal *ah, HAL_ANI_CMD cmd, int param)
m1_thresh_ext);
OS_REG_RMW_FIELD(ah, AR_PHY_SFCORR_EXT, AR_PHY_SFCORR_EXT_M2_THRESH,
m2_thresh_ext);
skip_ws_det:
if (is_on) {
OS_REG_SET_BIT(ah, AR_PHY_SFCORR_LOW,
AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW);
Expand Down Expand Up @@ -1057,10 +1061,13 @@ ar9300_ani_get_listen_time(struct ath_hal *ah, HAL_ANISTATS *ani_stats)
struct ath_hal_9300 *ahp = AH9300(ah);
struct ar9300_ani_state *ani_state;
u_int32_t tx_frame_count, rx_frame_count, cycle_count;
u_int32_t rx_busy_count, rx_ext_busy_count;
int32_t listen_time;

tx_frame_count = OS_REG_READ(ah, AR_TFCNT);
rx_frame_count = OS_REG_READ(ah, AR_RFCNT);
rx_busy_count = OS_REG_READ(ah, AR_RCCNT);
rx_ext_busy_count = OS_REG_READ(ah, AR_EXTRCCNT);
cycle_count = OS_REG_READ(ah, AR_CCCNT);

ani_state = ahp->ah_curani;
Expand All @@ -1081,17 +1088,30 @@ ar9300_ani_get_listen_time(struct ath_hal *ah, HAL_ANISTATS *ani_stats)
int32_t ccdelta = cycle_count - ani_state->cycle_count;
int32_t rfdelta = rx_frame_count - ani_state->rx_frame_count;
int32_t tfdelta = tx_frame_count - ani_state->tx_frame_count;
int32_t rcdelta = rx_busy_count - ani_state->rx_busy_count;
int32_t extrcdelta = rx_ext_busy_count - ani_state->rx_ext_busy_count;
listen_time = (ccdelta - rfdelta - tfdelta) / CLOCK_RATE(ah);
#if HAL_ANI_DEBUG
//#if HAL_ANI_DEBUG
HALDEBUG(ah, HAL_DEBUG_ANI,
"%s: cyclecount=%d, rfcount=%d, tfcount=%d, listen_time=%d "
"%s: cyclecount=%d, rfcount=%d, tfcount=%d, rcdelta=%d, extrcdelta=%d, listen_time=%d "
"CLOCK_RATE=%d\n",
__func__, ccdelta, rfdelta, tfdelta, listen_time, CLOCK_RATE(ah));
#endif
__func__, ccdelta, rfdelta, tfdelta, rcdelta, extrcdelta,
listen_time, CLOCK_RATE(ah));
//#endif
/* Populate as appropriate */
ani_stats->cyclecnt_diff = ccdelta;
ani_stats->rxclr_cnt = rcdelta;
ani_stats->txframecnt_diff = tfdelta;
ani_stats->rxframecnt_diff = rfdelta;
ani_stats->extrxclr_cnt = extrcdelta;
ani_stats->listen_time = listen_time;
ani_stats->valid = AH_TRUE;
}
ani_state->cycle_count = cycle_count;
ani_state->tx_frame_count = tx_frame_count;
ani_state->rx_frame_count = rx_frame_count;
ani_state->rx_busy_count = rx_busy_count;
ani_state->rx_ext_busy_count = rx_ext_busy_count;
return listen_time;
}

Expand Down Expand Up @@ -1151,7 +1171,13 @@ ar9300_ani_ar_poll(struct ath_hal *ah, const HAL_NODE_STATS *stats,
ofdm_phy_err_cnt = OS_REG_READ(ah, AR_PHY_ERR_1);
cck_phy_err_cnt = OS_REG_READ(ah, AR_PHY_ERR_2);


/* Populate HAL_ANISTATS */
if (ani_stats) {
ani_stats->cckphyerr_cnt =
cck_phy_err_cnt - ani_state->cck_phy_err_count;
ani_stats->ofdmphyerrcnt_diff =
ofdm_phy_err_cnt - ani_state->ofdm_phy_err_count;
}

/* NB: only use ast_ani_*errs with AH_PRIVATE_DIAG */
ahp->ah_stats.ast_ani_ofdmerrs +=
Expand Down

0 comments on commit 6ee75bd

Please sign in to comment.