iwlwifi: adjust TSF in IBSS
authorAssaf Krauss <assaf.krauss@intel.com>
Mon, 30 Jun 2008 09:23:17 +0000 (17:23 +0800)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 30 Jun 2008 21:37:42 +0000 (17:37 -0400)
This patch makes the driver, in IBSS mode, comply with TSF requirements
in 2 ways:
1. It notifies mac80211 of its TSF timestamp.
2. It uses the given timestamp in the beacon template to update the ucode.

Signed-off-by: Assaf Krauss <assaf.krauss@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl-rx.c
drivers/net/wireless/iwlwifi/iwl4965-base.c

index bfe1ad262484dd5821af37b018490eaceded0641..0c734fd529acb71a4052eef29cf117cb4d483ad9 100644 (file)
@@ -1063,7 +1063,6 @@ static void iwl_pass_packet_to_mac80211(struct iwl_priv *priv,
                return;
        }
 
-       stats->flag = 0;
        hdr = (struct ieee80211_hdr *)rxb->skb->data;
 
        /*  in case of HW accelerated crypto and bad decryption, drop */
@@ -1197,6 +1196,7 @@ void iwl_rx_reply_rx(struct iwl_priv *priv,
 
        rx_status.antenna = 0;
        rx_status.flag = 0;
+       rx_status.flag |= RX_FLAG_TSFT;
 
        if ((unlikely(rx_start->cfg_phy_cnt > 20))) {
                IWL_DEBUG_DROP("dsp size out of range [0,20]: %d/n",
index 1b2d9f12a3a1a65fa07348f56a98dced429891e1..d1bf599e483f129e436eb6107be7d60145f6bf9c 100644 (file)
@@ -3492,6 +3492,7 @@ static int iwl4965_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *sk
 {
        struct iwl_priv *priv = hw->priv;
        unsigned long flags;
+       __le64 timestamp;
 
        mutex_lock(&priv->mutex);
        IWL_DEBUG_MAC80211("enter\n");
@@ -3516,6 +3517,8 @@ static int iwl4965_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *sk
        priv->ibss_beacon = skb;
 
        priv->assoc_id = 0;
+       timestamp = ((struct ieee80211_mgmt *)skb->data)->u.beacon.timestamp;
+       priv->timestamp = le64_to_cpu(timestamp) +  (priv->beacon_int * 1000);
 
        IWL_DEBUG_MAC80211("leave\n");
        spin_unlock_irqrestore(&priv->lock, flags);