Performing Active scan with flush of old scanned data from the Wireless NIC - how ?
-
Hi, I wrote a program using VC++ that should scan for available wireless networks in the area. In my SW I use the commands OID_802_11_BSSID_LIST_SCAN and OID_802_11_BSSID_LIST. My questions are: 1. How can I Force the Wireless NIC to do ACTIVE SCAN ? 2. According to tests that I did, the card does not flush the list between scans, i.e. I get for several scan a results of an AP that was on air during an old scan, but is no longer there and new scans return's it's data as if it is still there. I am using Intel PRO 2200BG Wireless NIC, with driver version 8.1.0.28 (dated 24/8/2004). Relevant information That I used is here: Some relevant info from the above link: --------------------------------------- " The device must do the following when performing an explicit scan in response to a setting of OID_802_11_BSSID_LIST_SCAN: * The device must flush the current contents of its cached BSSID scan list before initiating the explicit scan request. * The device must scan both infrastructure and ad hoc networks, regardless of the current setting of its network mode. * The device can use either the active or passive scanning methods, or a combination of both scanning methods. Note Active scanning is preferred whenever appropriate. * When performing an active scan, the device sets the BSSID to the broadcast MAC address in the 802.11 probe request that it sends. The device also sets the SSID to the zero-length broadcast SSID in the probe request. * The device must perform the scan across all the frequency channels and bands that it supports. * The miniport driver must minimize its response time for this OID. It is recommended that the driver just initiate the scan and return NDIS_STATUS_SUCCESS in response to the setting of OID_802_11_BSSID_LIST_SCAN. The driver must not return NDIS_STATUS_PENDING or wait for the scan to complete before returning NDIS_STATUS_SUCCESS. " ------- Any help will be appreciated. -- Amit.
-
Hi, I wrote a program using VC++ that should scan for available wireless networks in the area. In my SW I use the commands OID_802_11_BSSID_LIST_SCAN and OID_802_11_BSSID_LIST. My questions are: 1. How can I Force the Wireless NIC to do ACTIVE SCAN ? 2. According to tests that I did, the card does not flush the list between scans, i.e. I get for several scan a results of an AP that was on air during an old scan, but is no longer there and new scans return's it's data as if it is still there. I am using Intel PRO 2200BG Wireless NIC, with driver version 8.1.0.28 (dated 24/8/2004). Relevant information That I used is here: Some relevant info from the above link: --------------------------------------- " The device must do the following when performing an explicit scan in response to a setting of OID_802_11_BSSID_LIST_SCAN: * The device must flush the current contents of its cached BSSID scan list before initiating the explicit scan request. * The device must scan both infrastructure and ad hoc networks, regardless of the current setting of its network mode. * The device can use either the active or passive scanning methods, or a combination of both scanning methods. Note Active scanning is preferred whenever appropriate. * When performing an active scan, the device sets the BSSID to the broadcast MAC address in the 802.11 probe request that it sends. The device also sets the SSID to the zero-length broadcast SSID in the probe request. * The device must perform the scan across all the frequency channels and bands that it supports. * The miniport driver must minimize its response time for this OID. It is recommended that the driver just initiate the scan and return NDIS_STATUS_SUCCESS in response to the setting of OID_802_11_BSSID_LIST_SCAN. The driver must not return NDIS_STATUS_PENDING or wait for the scan to complete before returning NDIS_STATUS_SUCCESS. " ------- Any help will be appreciated. -- Amit.
-
The missing link of data source that I used is attached again http://msdn.microsoft.com/en-us/library/aa504190.aspx[^]
NDIS_802_11_BSSID_LIST* m_pBSSIDList;
m_pBSSIDList = (NDIS_802_11_BSSID_LIST *) VirtualAlloc (NULL,
sizeof (NDIS_802_11_BSSID_LIST) * NUMBEROF_BSSIDS,
MEM_RESERVE | MEM_COMMIT,
PAGE_READWRITE) ;memset (m_pBSSIDList, 0, sizeof (NDIS_802_11_BSSID_LIST) * NUMBEROF_BSSIDS);
oidcode = OID_802_11_BSSID_LIST_SCAN;
DeviceIoControl (m_handle,
IOCTL_NDIS_QUERY_GLOBAL_STATS,
&oidcode,
sizeof(oidcode),
(ULONG *) NULL,
0,
&bytesreturned,
NULL);Sleep (6100); // According to the documentation the result of the scan should be valid after 6 seconds.
// The original line was delay of 2000 mSec. find out why...
//Sleep (2000);memset (m_pBSSIDList, 0, sizeof (NDIS_802_11_BSSID_LIST) * NUMBEROF_BSSIDS); // @@@ why is this required ???
oidcode = OID_802_11_BSSID_LIST;
if (DeviceIoControl( m_handle,
IOCTL_NDIS_QUERY_GLOBAL_STATS,
&oidcode,
sizeof( oidcode),
( ULONG *) m_pBSSIDList,
sizeof( NDIS_802_11_BSSID_LIST) * NUMBEROF_BSSIDS,
&bytesreturned,
NULL) == 0)
{
// List failed
return NULL;
}
else
{
return m_pBSSIDList;
}