]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/wireless/ath9k/main.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6
[linux-2.6-omap-h63xx.git] / drivers / net / wireless / ath9k / main.c
index 2caba440316728ec75e1c4f85849978394c7deef..f05f584ab7bc960f9e8ba5ea29207ec63582bd2c 100644 (file)
@@ -274,10 +274,12 @@ static void ath9k_rx_prepare(struct ath_softc *sc,
        rx_status->mactime = status->tsf;
        rx_status->band = curchan->band;
        rx_status->freq =  curchan->center_freq;
-       rx_status->noise = ATH_DEFAULT_NOISE_FLOOR;
+       rx_status->noise = sc->sc_ani.sc_noise_floor;
        rx_status->signal = rx_status->noise + status->rssi;
        rx_status->rate_idx = ath_rate2idx(sc, (status->rateKbps / 100));
        rx_status->antenna = status->antenna;
+
+       /* XXX Fix me, 64 cannot be the max rssi value, rigure it out */
        rx_status->qual = status->rssi * 100 / 64;
 
        if (status->flags & ATH_RX_MIC_ERROR)
@@ -427,6 +429,11 @@ static void ath9k_bss_assoc_info(struct ath_softc *sc,
                ath_rate_newstate(sc, avp);
                /* Update ratectrl about the new state */
                ath_rc_node_update(hw, avp->rc_node);
+
+               /* Start ANI */
+               mod_timer(&sc->sc_ani.timer,
+                       jiffies + msecs_to_jiffies(ATH_ANI_POLLINTERVAL));
+
        } else {
                DPRINTF(sc, ATH_DBG_CONFIG,
                "%s: Bss Info DISSOC\n", __func__);
@@ -1173,6 +1180,13 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
                return error;
        }
 
+       if (conf->type == NL80211_IFTYPE_AP) {
+               /* TODO: is this a suitable place to start ANI for AP mode? */
+               /* Start ANI */
+               mod_timer(&sc->sc_ani.timer,
+                         jiffies + msecs_to_jiffies(ATH_ANI_POLLINTERVAL));
+       }
+
        return 0;
 }
 
@@ -1195,6 +1209,8 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw,
 #ifdef CONFIG_SLOW_ANT_DIV
        ath_slow_ant_div_stop(&sc->sc_antdiv);
 #endif
+       /* Stop ANI */
+       del_timer_sync(&sc->sc_ani.timer);
 
        /* Update ratectrl */
        ath_rate_newstate(sc, avp);
@@ -1624,6 +1640,11 @@ static int ath9k_ampdu_action(struct ieee80211_hw *hw,
        return ret;
 }
 
+static int ath9k_no_fragmentation(struct ieee80211_hw *hw, u32 value)
+{
+       return -EOPNOTSUPP;
+}
+
 static struct ieee80211_ops ath9k_ops = {
        .tx                 = ath9k_tx,
        .start              = ath9k_start,
@@ -1648,7 +1669,8 @@ static struct ieee80211_ops ath9k_ops = {
        .get_tsf            = ath9k_get_tsf,
        .reset_tsf          = ath9k_reset_tsf,
        .tx_last_beacon     = NULL,
-       .ampdu_action       = ath9k_ampdu_action
+       .ampdu_action       = ath9k_ampdu_action,
+       .set_frag_threshold = ath9k_no_fragmentation,
 };
 
 static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)