qcacld-3.0: update timestamp of bss while informing frame to kernel

Inform the bss using the new API cfg80211_inform_bss_frame_data() which
also has the ability to inform the timestamp when the frame has
been received.
If the support is not present in the kernel fallback to the legacy
inform bss.

Change-Id: Iaa512248a5e56d77cff39da562e0c9ee4eaeeefd
CRs-Fixed: 1082423
This commit is contained in:
Arun Khandavalli 2017-01-03 20:23:56 +05:30 • committed by qcabuildsw
commit 8a711cbd49
6 changed files with 51 additions and 13 deletions

View file

@ -12170,6 +12170,42 @@ struct cfg80211_bss *wlan_hdd_cfg80211_update_bss_list(
return bss;
}
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4 , 3, 0)) || \
defined (CFG80211_INFORM_BSS_FRAME_DATA)
static struct cfg80211_bss *
wlan_hdd_cfg80211_inform_bss_frame_data(struct wiphy *wiphy,
struct ieee80211_channel *chan,
struct ieee80211_mgmt *mgmt,
size_t frame_len,
int rssi, gfp_t gfp,
uint64_t boottime_ns)
{
struct cfg80211_bss *bss_status = NULL;
struct cfg80211_inform_bss data = {0};
data.chan = chan;
data.boottime_ns = boottime_ns;
data.signal = rssi;
bss_status = cfg80211_inform_bss_frame_data(wiphy, &data, mgmt,
frame_len, gfp);
return bss_status;
}
#else
static struct cfg80211_bss *
wlan_hdd_cfg80211_inform_bss_frame_data(struct wiphy *wiphy,
struct ieee80211_channel *chan,
struct ieee80211_mgmt *mgmt,
size_t frame_len,
int rssi, gfp_t gfp,
uint64_t boottime_ns)
{
struct cfg80211_bss *bss_status = NULL;
bss_status = cfg80211_inform_bss_frame(wiphy, chan, mgmt, frame_len,
rssi, gfp);
return bss_status;
}
#endif
/**
* wlan_hdd_cfg80211_inform_bss_frame() - inform bss details to NL80211
@ -12335,9 +12371,10 @@ struct cfg80211_bss *wlan_hdd_cfg80211_inform_bss_frame(hdd_adapter_t *pAdapter,
(int)(rssi / 100),
bss_desc->timeStamp[0]);
bss_status =
cfg80211_inform_bss_frame(wiphy, chan, mgmt, frame_len, rssi,
GFP_KERNEL);
bss_status = wlan_hdd_cfg80211_inform_bss_frame_data(wiphy, chan, mgmt,
frame_len, rssi,
GFP_KERNEL,
bss_desc->scansystimensec);
pHddCtx->beacon_probe_rsp_cnt_per_scan++;
qdf_mem_free(mgmt);
return bss_status;

View file

@ -711,7 +711,7 @@ typedef struct sSirBssDescription {
/* offset of the ieFields from bssId. */
uint16_t length;
tSirMacAddr bssId;
unsigned long scanSysTimeMsec;
unsigned long scansystimensec;
uint32_t timeStamp[2];
uint16_t beaconInterval;
uint16_t capabilityInfo;

View file

@ -115,7 +115,7 @@ lim_collect_bss_description(tpAniSirGlobal pMac,
(uint8_t *) pHdr->bssId, sizeof(tSirMacAddr));
/* Copy Timestamp, Beacon Interval and Capability Info */
pBssDescr->scanSysTimeMsec = qdf_mc_timer_get_system_time();
pBssDescr->scansystimensec = qdf_get_monotonic_boottime_ns();
pBssDescr->timeStamp[0] = pBPR->timeStamp[0];
pBssDescr->timeStamp[1] = pBPR->timeStamp[1];

View file

@ -1971,16 +1971,16 @@ QDF_STATUS csr_roam_read_tsf(tpAniSirGlobal pMac, uint8_t *pTimestamp,
{
QDF_STATUS status = QDF_STATUS_SUCCESS;
tCsrNeighborRoamBSSInfo handoffNode = {{0} };
uint32_t timer_diff = 0;
uint64_t timer_diff = 0;
uint32_t timeStamp[2];
tpSirBssDescription pBssDescription = NULL;
csr_neighbor_roam_get_handoff_ap_info(pMac, &handoffNode, sessionId);
pBssDescription = handoffNode.pBssDescription;
/* Get the time diff in milli seconds */
timer_diff = qdf_mc_timer_get_system_time() -
pBssDescription->scanSysTimeMsec;
/* Get the time diff in nano seconds */
timer_diff = (qdf_get_monotonic_boottime_ns() -
pBssDescription->scansystimensec);
/* Convert msec to micro sec timer */
timer_diff = (uint32_t) (timer_diff * SYSTEM_TIME_MSEC_TO_USEC);
timer_diff = (timer_diff / SYSTEM_TIME_NSEC_TO_USEC);
timeStamp[0] = pBssDescription->timeStamp[0];
timeStamp[1] = pBssDescription->timeStamp[1];
update_cckmtsf(&(timeStamp[0]), &(timeStamp[1]), &timer_diff);

View file

@ -7305,10 +7305,10 @@ free_mem:
#ifdef FEATURE_WLAN_ESE
/* Update the TSF with the difference in system time */
void update_cckmtsf(uint32_t *timeStamp0, uint32_t *timeStamp1,
uint32_t *incr)
uint64_t *incr)
{
uint64_t timeStamp64 = ((uint64_t) *timeStamp1 << 32) | (*timeStamp0);
timeStamp64 = (uint64_t) (timeStamp64 + (uint64_t) *incr);
timeStamp64 = (uint64_t)(timeStamp64 + (*incr));
*timeStamp0 = (uint32_t) (timeStamp64 & 0xffffffff);
*timeStamp1 = (uint32_t) ((timeStamp64 >> 32) & 0xffffffff);
}

View file

@ -67,6 +67,7 @@
#define CSR_MAX_BSS_SUPPORT 512
#define SYSTEM_TIME_MSEC_TO_USEC 1000
#define SYSTEM_TIME_SEC_TO_MSEC 1000
#define SYSTEM_TIME_NSEC_TO_USEC 1000
/* This number minus 1 means the number of times a channel is scanned before a BSS is remvoed from */
/* cache scan result */
@ -996,7 +997,7 @@ static inline void csr_release_command_preauth(tpAniSirGlobal mac_ctx,
#if defined(FEATURE_WLAN_ESE)
void update_cckmtsf(uint32_t *timeStamp0, uint32_t *timeStamp1,
uint32_t *incr);
uint64_t *incr);
#endif
QDF_STATUS csr_roam_enqueue_preauth(tpAniSirGlobal pMac, uint32_t sessionId,