Esempio n. 1
0
void
wlan_refresh_inactive_nodes (struct ieee80211_node_table *nt)
{
    bss_t *bss, *nextBss;
    A_UINT8 myBssid[IEEE80211_ADDR_LEN];
    A_UINT32 timeoutValue = 0;
    A_UINT32 now = A_GET_MS(0);
    timeoutValue = nt->nt_nodeAge;

    wmi_get_current_bssid(nt->nt_wmip, myBssid);

    bss = nt->nt_node_first;
    while (bss != NULL)
    {
        nextBss = bss->ni_list_next;
        if (A_MEMCMP(myBssid, bss->ni_macaddr, sizeof(myBssid)) != 0)
        {

            if (((now - bss->ni_tstamp) > timeoutValue)  || --bss->ni_actcnt == 0)
            {
               /*
                * free up all but the current bss - if set
                */
                wlan_node_reclaim(nt, bss);
            }
        }
        bss = nextBss;
    }
}
Esempio n. 2
0
void wlan_free_allnodes(struct ath6kl_node_table *nt)
{
	struct bss *ni;

	while ((ni = nt->nt_node_first) != NULL)
		wlan_node_reclaim(nt, ni);
}
Esempio n. 3
0
void
wlan_refresh_scan_table (struct ieee80211_node_table *nt, ULONGLONG OldestAllowedEntry)
{
    bss_t *bss, *nextBss;
    A_UINT8 myBssid[IEEE80211_ADDR_LEN], reArmTimer = FALSE;

    wmi_get_current_bssid(nt->nt_wmip, myBssid);

    bss = nt->nt_node_first;
    while (bss != NULL)
    {
        nextBss = bss->ni_list_next;
        if (A_MEMCMP(myBssid, bss->ni_macaddr, sizeof(myBssid)) != 0)
        {
            if (bss->HostTimestamp <= OldestAllowedEntry)
            {
               /*
                * free up all but the current bss - if set
                */
                wlan_node_reclaim(nt, bss);
            }
        }
        bss = nextBss;
    }
}
Esempio n. 4
0
static void
wlan_node_timeout(void *arg)
{
    struct ieee80211_node_table *nt = (struct ieee80211_node_table *)arg;
    bss_t *bss, *nextBss;
    A_UINT8 myBssid[IEEE80211_ADDR_LEN];

    wmi_get_current_bssid(nt->nt_wmip, myBssid);

    IEEE80211_NODE_LOCK(nt);
    bss = nt->nt_node_first;
    while (bss != NULL) {
        nextBss = bss->ni_list_next;
        if ((A_MEMCMP(myBssid, bss->ni_macaddr, sizeof(myBssid)) != 0) &&
            (bss->ni_tstamp <= A_MS_TICKGET()))
        {
            /*
             * free up all but the current bss - if set
             */
            wlan_node_reclaim(nt, bss);
        }
        bss = nextBss;
    }

    IEEE80211_NODE_UNLOCK(nt);
    A_TIMEOUT_MS(&nt->nt_inact_timer, WLAN_NODE_INACT_TIMEOUT_MSEC, 0);
}
Esempio n. 5
0
void
wlan_refresh_inactive_nodes (struct ieee80211_node_table *nt)
{
    bss_t *bss, *nextBss;
    A_UINT8 myBssid[IEEE80211_ADDR_LEN];
    A_UINT32 timeoutValue = 0;
    A_UINT32 now = A_GET_MS(0);
    timeoutValue = nt->nt_nodeAge;

    wmi_get_current_bssid(nt->nt_wmip, myBssid);

    bss = nt->nt_node_first;
    while (bss != NULL)
    {
        nextBss = bss->ni_list_next;
        if (A_MEMCMP(myBssid, bss->ni_macaddr, sizeof(myBssid)) != 0)
        {
            if (((now - bss->ni_tstamp) > timeoutValue)  || --bss->ni_actcnt == 0)
            {
            		
                PBYTE                      pIE;
		char a[128];
		A_UINT32 length, ch, freq;
		//wchar_t b[128] = {0};
		pIE = bss->ni_cie.ie_ssid;
		length = pIE[1];
		memcpy( a, &pIE[2], length );
		a[length] = '\0';
		//MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, a, 32, b, 64 );
		freq = bss->ni_cie.ie_chan;
		if (freq == 2484)
        		ch = 14;
    		else if (freq < 2484)
        		ch =  (freq - 2407) / 5;
    		else if (freq < 5000)
        		ch = 15 + ((freq - 2512) / 20);
    		else 
			ch = (freq - 5000) / 5;


			RETAIL_DEBUG_PRINTF(debugBssInfo, (TEXT("builder:ar6k2: remove bss info, SSID  = %S, RSSI = %d, CHANNEL = %d\r\n"), a, bss->ni_rssi, ch));
			RETAIL_DEBUG_PRINTF(debugBssInfo, (TEXT("builder:ar6k2: BSSID = %02x:%02x:%02x:%02x:%02x:%02x \r\n") ,
					bss->ni_macaddr[0], bss->ni_macaddr[1], bss->ni_macaddr[2],
					bss->ni_macaddr[3], bss->ni_macaddr[4], bss->ni_macaddr[5]));
			logPrintf( (debugFileLog && debugBssInfo), "builder:ar6k2: remove bss info, SSID  = %s, RSSI = %d, CHANNEL = %d\r\n", a, bss->ni_rssi, ch);
			logPrintf( (debugFileLog && debugBssInfo), "builder:ar6k2: BSSID = %02x:%02x:%02x:%02x:%02x:%02x \r\n",
					bss->ni_macaddr[0], bss->ni_macaddr[1], bss->ni_macaddr[2],
					bss->ni_macaddr[3], bss->ni_macaddr[4], bss->ni_macaddr[5]);			

               /*
                * free up all but the current bss - if set
                */
                wlan_node_reclaim(nt, bss);
			   
            }
        }
        bss = nextBss;
    }
}
Esempio n. 6
0
void
wlan_free_allnodes(struct ieee80211_node_table *nt)
{
    bss_t *ni;

    while ((ni = nt->nt_node_first) != NULL) {
        wlan_node_reclaim(nt, ni);
    }
}
Esempio n. 7
0
void
wlan_node_ret_n_remove(struct ieee80211_node_table *nt, bss_t *ni)
{
    IEEE80211_NODE_LOCK(nt);

    ieee80211_node_decref(ni);
    if (ieee80211_node_refcnt(ni) == 0) {
        wlan_node_free(ni);
    } else {
        wlan_node_reclaim(nt, ni);
    }

    IEEE80211_NODE_UNLOCK(nt);
}
Esempio n. 8
0
void wlan_refresh_inactive_nodes(struct ath6kl *ar)
{
	struct ath6kl_node_table *nt = &ar->scan_table;
	struct bss *bss;
	u32 now;

	now = jiffies_to_msecs(jiffies);
	bss = nt->nt_node_first;
	while (bss != NULL) {
		/* refresh all nodes except the current bss */
		if (memcmp(ar->bssid, bss->ni_macaddr, ETH_ALEN) != 0) {
			if (((now - bss->ni_tstamp) > nt->nt_node_age)
			    || --bss->ni_actcnt == 0) {
				wlan_node_reclaim(nt, bss);
			}
		}
		bss = bss->ni_list_next;
	}
}
Esempio n. 9
0
static void
wlan_node_timeout (A_ATH_TIMER arg)
{
    struct ieee80211_node_table *nt = (struct ieee80211_node_table *)arg;
    bss_t *bss, *nextBss;
    A_UINT8 myBssid[IEEE80211_ADDR_LEN], reArmTimer = FALSE;
    A_UINT32 timeoutValue = 0;

    timeoutValue = nt->nt_nodeAge;

    wmi_get_current_bssid(nt->nt_wmip, myBssid);

    bss = nt->nt_node_first;
    while (bss != NULL)
    {
        nextBss = bss->ni_list_next;
        if (A_MEMCMP(myBssid, bss->ni_macaddr, sizeof(myBssid)) != 0)
        {

            if (bss->ni_tstamp <= A_GET_MS(0))
            {
               /*
                * free up all but the current bss - if set
                */
                wlan_node_reclaim(nt, bss);
            }
            else
            {
                /*
                 * Re-arm timer, only when we have a bss other than
                 * current bss AND it is not aged-out.
                 */
                reArmTimer = TRUE;
            }
        }
        bss = nextBss;
    }

    if (reArmTimer)
        A_TIMEOUT_MS (&nt->nt_inact_timer, timeoutValue, 0);

    nt->isTimerArmed = reArmTimer;
}
Esempio n. 10
0
static void
wlan_node_timeout(A_ATH_TIMER arg)
{
    struct ieee80211_node_table *nt = (struct ieee80211_node_table *)arg;
    bss_t *bss, *nextBss;
    A_UINT8 myBssid[IEEE80211_ADDR_LEN], reArmTimer = FALSE;
    A_UINT32 timeoutValue = 0;

    timeoutValue = nt->nt_nodeAge;

    wmi_get_current_bssid(nt->nt_wmip, myBssid);

    bss = nt->nt_node_first;
    while (bss != NULL)
    {
        nextBss = bss->ni_list_next;
        if (A_MEMCMP(myBssid, bss->ni_macaddr, sizeof(myBssid)) != 0)
        {

            if (bss->ni_tstamp <= A_GET_MS(0))
            {
                PBYTE                      pIE;
		char a[128];
		A_UINT32 length, ch, freq;
		//wchar_t b[128] = {0};
		pIE = bss->ni_cie.ie_ssid;
		length = pIE[1];
		memcpy( a, &pIE[2], length );
		a[length] = '\0';
		//MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, a, 32, b, 64 );
		freq = bss->ni_cie.ie_chan;
		if (freq == 2484)
        		ch = 14;
    		else if (freq < 2484)
        		ch =  (freq - 2407) / 5;
    		else if (freq < 5000)
        		ch = 15 + ((freq - 2512) / 20);
    		else 
			ch = (freq - 5000) / 5;


			RETAIL_DEBUG_PRINTF(debugBssInfo, (TEXT("builder:ar6k2: remove bss info, SSID  = %S, RSSI = %d, CHANNEL = %d\r\n"), a, bss->ni_rssi, ch));
			RETAIL_DEBUG_PRINTF(debugBssInfo, (TEXT("builder:ar6k2: BSSID = %02x:%02x:%02x:%02x:%02x:%02x \r\n") ,
					bss->ni_macaddr[0], bss->ni_macaddr[1], bss->ni_macaddr[2],
					bss->ni_macaddr[3], bss->ni_macaddr[4], bss->ni_macaddr[5]));
			logPrintf( (debugFileLog && debugBssInfo), "builder:ar6k2: remove bss info, SSID  = %s, RSSI = %d, CHANNEL = %d\r\n", a, bss->ni_rssi, ch);
			logPrintf( (debugFileLog && debugBssInfo), "builder:ar6k2: BSSID = %02x:%02x:%02x:%02x:%02x:%02x \r\n",
					bss->ni_macaddr[0], bss->ni_macaddr[1], bss->ni_macaddr[2],
					bss->ni_macaddr[3], bss->ni_macaddr[4], bss->ni_macaddr[5]);			

               /*
                * free up all but the current bss - if set
                */
                wlan_node_reclaim(nt, bss);
            }
            else
            {
                /*
                 * Re-arm timer, only when we have a bss other than
                 * current bss AND it is not aged-out.
                 */
                reArmTimer = TRUE;
            }
        }
        bss = nextBss;
    }

    if(reArmTimer)
        A_TIMEOUT_MS(&nt->nt_inact_timer, timeoutValue, 0);

    nt->isTimerArmed = reArmTimer;
}