wlan: Handling duplicate rates and adding RSSI.

Duplicate rates needs to be handled seperately in
radiotap header of monitor mode packets. Along
with it, adding signal strength (dbM) in radiotap
header.

Change-Id: Ibfc921b8b5e5a5d4606b42798aac9e8bdfcc9ee0
CRs-Fixed: 852346
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index 9467205..6afb563 100755
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -6756,9 +6756,9 @@
     pMonCtx->state = 0;
     pMonCtx->ChannelNo = 1;
     pMonCtx->ChannelBW = 20;
-    pMonCtx->crcCheckEnabled = 0;
-    pMonCtx->typeSubtypeBitmap = 0xFFFFFFFFFFFF;
-    pMonCtx->is80211to803ConReq = 0;
+    pMonCtx->crcCheckEnabled = 1;
+    pMonCtx->typeSubtypeBitmap = 0xFFFF00000000;
+    pMonCtx->is80211to803ConReq = 1;
     pMonCtx->numOfMacFilters = 0;
  }
 
diff --git a/CORE/HDD/src/wlan_hdd_tx_rx.c b/CORE/HDD/src/wlan_hdd_tx_rx.c
index 821e274..af949bd 100644
--- a/CORE/HDD/src/wlan_hdd_tx_rx.c
+++ b/CORE/HDD/src/wlan_hdd_tx_rx.c
@@ -2332,8 +2332,16 @@
     unsigned char *pos;
     u16 rx_flags = 0;
     u16 rateIdx;
+    s8        currentRSSI, currentRSSI0, currentRSSI1;
 
     rateIdx = WDA_GET_RX_MAC_RATE_IDX(pRxPacket);
+    if( rateIdx >= 210 && rateIdx <= 217)
+       rateIdx-=202;
+    if( rateIdx >= 218 && rateIdx <= 225 )
+       rateIdx-=210;
+    currentRSSI0 = WDA_GETRSSI0(pRxPacket) - 100;
+    currentRSSI1 = WDA_GETRSSI1(pRxPacket) - 100;
+    currentRSSI  = (currentRSSI0 > currentRSSI1) ? currentRSSI0 : currentRSSI1;
 
     rthdr = (struct ieee80211_radiotap_header *)(&rtap_temp[0]);
 
@@ -2357,7 +2365,12 @@
 
     /* IEEE80211_RADIOTAP_CHANNEL */
     put_unaligned_le16(pMonCtx->ChannelNo, pos);
-    pos += 2;
+    pos += 4;
+
+    /* IEEE80211_RADIOTAP_DBM_ANTSIGNAL */
+    *pos = currentRSSI;
+    rthdr->it_present |=cpu_to_le32(1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL);
+    pos++;
 
     if ((pos - (u8 *)rthdr) & 1)
         pos++;
@@ -2423,7 +2436,7 @@
     if(!conversion)
     {
          pMonCtx = WLAN_HDD_GET_MONITOR_CTX_PTR(pAdapter);
-         needed_headroom = sizeof(struct ieee80211_radiotap_header) + 9;
+         needed_headroom = sizeof(struct ieee80211_radiotap_header) + 10;
          hdd_mon_add_rx_radiotap_hdr( skb, needed_headroom, pvBDHeader, pMonCtx );
     }