iwlwifi: set HT flags in ieee80211_rx_status for received packets
authorDaniel C Halperin <daniel.c.halperin@intel.com>
Fri, 21 Aug 2009 20:34:21 +0000 (13:34 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 28 Aug 2009 18:40:38 +0000 (14:40 -0400)
Add code to set the HT flags (HT, 40 MHz, Short guard interval) in
the ieee80211_rx_status field passed to mac80211.  This ensures that mac80211
processes these HT packets correctly.

Signed-off-by: Daniel C Halperin <daniel.c.halperin@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl-rx.c

index 353d9a2ddbca9a677a492e6bf8943b6c7833b697..e34d3fcb6c3d318143a89d266d316fcd89fdc88e 100644 (file)
@@ -915,6 +915,7 @@ void iwl_rx_reply_rx(struct iwl_priv *priv,
        u32 len;
        u32 ampdu_status;
        u16 fc;
+       u32 rate_n_flags;
 
        /**
         * REPLY_RX and REPLY_RX_MPDU_CMD are handled differently.
@@ -1032,6 +1033,15 @@ void iwl_rx_reply_rx(struct iwl_priv *priv,
        if (phy_res->phy_flags & RX_RES_PHY_FLAGS_SHORT_PREAMBLE_MSK)
                rx_status.flag |= RX_FLAG_SHORTPRE;
 
+       /* Set up the HT phy flags */
+       rate_n_flags = le32_to_cpu(phy_res->rate_n_flags);
+       if (rate_n_flags & RATE_MCS_HT_MSK)
+               rx_status.flag |= RX_FLAG_HT;
+       if (rate_n_flags & RATE_MCS_HT40_MSK)
+               rx_status.flag |= RX_FLAG_40MHZ;
+       if (rate_n_flags & RATE_MCS_SGI_MSK)
+               rx_status.flag |= RX_FLAG_SHORT_GI;
+
        if (iwl_is_network_packet(priv, header)) {
                priv->last_rx_rssi = rx_status.signal;
                priv->last_beacon_time =  priv->ucode_beacon_time;