mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-15 01:01:56 -04:00
qcacld-3.0: Remove wext support for scan commands
Scan results obtained through wext interface is incomplete due to limitation on number of bytes passed through wext interface. Wext scan command is replaced with NL scan. Remove code references related to wext scan command support. Change-Id: I05ccc13d1b658e62b19a389e6a480707b5c446b9 CRs-Fixed: 2063667
This commit is contained in:
parent
994f620e23
commit
dbdf6c93c1
3 changed files with 1 additions and 728 deletions
|
|
@ -140,372 +140,6 @@ static int hdd_add_iw_stream_event(int cmd, int length, char *data,
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* hdd_get_wparsn_ies() - get wpa RSN IEs
|
||||
* @ieFields: Pointer to the Bss Descriptor IEs
|
||||
* @ie_length: IE Length
|
||||
* @last_event: Points to last event
|
||||
* @current_event: Points to current event
|
||||
*
|
||||
* This function extract the WPA/RSN IE from the Bss descriptor IEs fields
|
||||
*
|
||||
* Return: 0 for success, non zero for failure
|
||||
*/
|
||||
static int hdd_get_wparsn_ies(uint8_t *ieFields, uint16_t ie_length,
|
||||
char **last_event, char **current_event,
|
||||
hdd_scan_info_t *pscanInfo)
|
||||
{
|
||||
uint8_t eid, elen, *element;
|
||||
uint16_t tie_length = 0;
|
||||
|
||||
ENTER();
|
||||
|
||||
element = ieFields;
|
||||
tie_length = ie_length;
|
||||
|
||||
while (tie_length > 2 && element != NULL) {
|
||||
eid = element[0];
|
||||
elen = element[1];
|
||||
|
||||
/* If element length is greater than total remaining ie length,
|
||||
* break the loop
|
||||
*/
|
||||
if ((elen + 2) > tie_length)
|
||||
break;
|
||||
|
||||
switch (eid) {
|
||||
case DOT11F_EID_WPA:
|
||||
case DOT11F_EID_RSN:
|
||||
#ifdef FEATURE_WLAN_WAPI
|
||||
case DOT11F_EID_WAPI:
|
||||
#endif
|
||||
if (hdd_add_iw_stream_event
|
||||
(IWEVGENIE, elen + 2, (char *)element, pscanInfo,
|
||||
last_event, current_event) < 0)
|
||||
return -E2BIG;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
/* Next element */
|
||||
tie_length -= (2 + elen);
|
||||
element += 2 + elen;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
/**
|
||||
* hdd_indicate_scan_result() - indicate scan results
|
||||
* @scanInfo: Pointer to the scan info structure.
|
||||
* @descriptor: Pointer to the Bss Descriptor.
|
||||
*
|
||||
* This function returns the scan results to the wpa_supplicant
|
||||
*
|
||||
* @Return: 0 for success, non zero for failure
|
||||
*/
|
||||
#define MAX_CUSTOM_LEN 64
|
||||
static int hdd_indicate_scan_result(hdd_scan_info_t *scanInfo,
|
||||
tCsrScanResultInfo *scan_result)
|
||||
{
|
||||
hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(scanInfo->dev);
|
||||
tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter);
|
||||
tSirBssDescription *descriptor = &scan_result->BssDescriptor;
|
||||
struct iw_event event;
|
||||
char *current_event = scanInfo->start;
|
||||
char *end = scanInfo->end;
|
||||
char *last_event;
|
||||
char *current_pad;
|
||||
uint16_t ie_length = 0;
|
||||
uint16_t capabilityInfo;
|
||||
char *modestr;
|
||||
int error;
|
||||
char custom[MAX_CUSTOM_LEN];
|
||||
char *p;
|
||||
|
||||
hdd_debug(MAC_ADDRESS_STR, MAC_ADDR_ARRAY(descriptor->bssId));
|
||||
|
||||
error = 0;
|
||||
last_event = current_event;
|
||||
qdf_mem_zero(&event, sizeof(event));
|
||||
|
||||
/* BSSID */
|
||||
event.cmd = SIOCGIWAP;
|
||||
event.u.ap_addr.sa_family = ARPHRD_ETHER;
|
||||
qdf_mem_copy(event.u.ap_addr.sa_data, descriptor->bssId,
|
||||
sizeof(descriptor->bssId));
|
||||
current_event = iwe_stream_add_event(scanInfo->info, current_event, end,
|
||||
&event, IW_EV_ADDR_LEN);
|
||||
|
||||
if (last_event == current_event) {
|
||||
/* no space to add event */
|
||||
/* Error code may be E2BIG */
|
||||
hdd_err("no space for SIOCGIWAP");
|
||||
return -E2BIG;
|
||||
}
|
||||
|
||||
last_event = current_event;
|
||||
qdf_mem_zero(&event, sizeof(struct iw_event));
|
||||
|
||||
/* Protocol Name */
|
||||
event.cmd = SIOCGIWNAME;
|
||||
|
||||
switch (descriptor->nwType) {
|
||||
case eSIR_11A_NW_TYPE:
|
||||
modestr = "a";
|
||||
break;
|
||||
case eSIR_11B_NW_TYPE:
|
||||
modestr = "b";
|
||||
break;
|
||||
case eSIR_11G_NW_TYPE:
|
||||
modestr = "g";
|
||||
break;
|
||||
case eSIR_11N_NW_TYPE:
|
||||
modestr = "n";
|
||||
break;
|
||||
default:
|
||||
hdd_warn("Unknown network type: %d", descriptor->nwType);
|
||||
modestr = "?";
|
||||
break;
|
||||
}
|
||||
snprintf(event.u.name, IFNAMSIZ, "IEEE 802.11%s", modestr);
|
||||
current_event = iwe_stream_add_event(scanInfo->info, current_event, end,
|
||||
&event, IW_EV_CHAR_LEN);
|
||||
|
||||
if (last_event == current_event) { /* no space to add event */
|
||||
hdd_err("no space for SIOCGIWNAME");
|
||||
/* Error code, may be E2BIG */
|
||||
return -E2BIG;
|
||||
}
|
||||
|
||||
last_event = current_event;
|
||||
qdf_mem_zero(&event, sizeof(struct iw_event));
|
||||
|
||||
/*Freq */
|
||||
event.cmd = SIOCGIWFREQ;
|
||||
|
||||
event.u.freq.m = descriptor->channelId;
|
||||
event.u.freq.e = 0;
|
||||
event.u.freq.i = 0;
|
||||
current_event = iwe_stream_add_event(scanInfo->info, current_event, end,
|
||||
&event, IW_EV_FREQ_LEN);
|
||||
|
||||
if (last_event == current_event) { /* no space to add event */
|
||||
hdd_err("no space for SIOCGIWFREQ");
|
||||
return -E2BIG;
|
||||
}
|
||||
|
||||
last_event = current_event;
|
||||
qdf_mem_zero(&event, sizeof(struct iw_event));
|
||||
|
||||
/* BSS Mode */
|
||||
event.cmd = SIOCGIWMODE;
|
||||
|
||||
capabilityInfo = descriptor->capabilityInfo;
|
||||
|
||||
if (SIR_MAC_GET_ESS(capabilityInfo)) {
|
||||
event.u.mode = IW_MODE_MASTER;
|
||||
} else if (SIR_MAC_GET_IBSS(capabilityInfo)) {
|
||||
event.u.mode = IW_MODE_ADHOC;
|
||||
} else {
|
||||
/* neither ESS or IBSS */
|
||||
event.u.mode = IW_MODE_AUTO;
|
||||
}
|
||||
|
||||
current_event = iwe_stream_add_event(scanInfo->info, current_event, end,
|
||||
&event, IW_EV_UINT_LEN);
|
||||
|
||||
if (last_event == current_event) { /* no space to add event */
|
||||
hdd_err("no space for SIOCGIWMODE");
|
||||
return -E2BIG;
|
||||
}
|
||||
/* To extract SSID */
|
||||
ie_length = GET_IE_LEN_IN_BSS(descriptor->length);
|
||||
|
||||
if (ie_length > 0) {
|
||||
/*
|
||||
* dot11BeaconIEs is a large struct, so we make it static to
|
||||
* avoid stack overflow. This API is only invoked via ioctl,
|
||||
* so it is serialized by the kernel rtnl_lock and hence does
|
||||
* not need to be reentrant
|
||||
*/
|
||||
static tDot11fBeaconIEs dot11BeaconIEs;
|
||||
tDot11fIESSID *pDot11SSID;
|
||||
tDot11fIESuppRates *pDot11SuppRates;
|
||||
tDot11fIEExtSuppRates *pDot11ExtSuppRates;
|
||||
tDot11fIEHTCaps *pDot11IEHTCaps;
|
||||
int numBasicRates = 0;
|
||||
int maxNumRates = 0;
|
||||
|
||||
pDot11IEHTCaps = NULL;
|
||||
|
||||
dot11f_unpack_beacon_i_es((tpAniSirGlobal)
|
||||
hHal, (uint8_t *) descriptor->ieFields,
|
||||
ie_length, &dot11BeaconIEs, false);
|
||||
|
||||
pDot11SSID = &dot11BeaconIEs.SSID;
|
||||
|
||||
if (pDot11SSID->present) {
|
||||
last_event = current_event;
|
||||
qdf_mem_zero(&event, sizeof(struct iw_event));
|
||||
|
||||
event.cmd = SIOCGIWESSID;
|
||||
event.u.data.flags = 1;
|
||||
event.u.data.length = scan_result->ssId.length;
|
||||
current_event =
|
||||
iwe_stream_add_point(scanInfo->info, current_event,
|
||||
end, &event,
|
||||
(char *)scan_result->ssId.
|
||||
ssId);
|
||||
|
||||
if (last_event == current_event) { /* no space to add event */
|
||||
hdd_err("no space for SIOCGIWESSID");
|
||||
return -E2BIG;
|
||||
}
|
||||
}
|
||||
|
||||
if (hdd_get_wparsn_ies
|
||||
((uint8_t *) descriptor->ieFields, ie_length, &last_event,
|
||||
¤t_event, scanInfo) < 0) {
|
||||
hdd_err("no space for SIOCGIWESSID");
|
||||
return -E2BIG;
|
||||
}
|
||||
|
||||
last_event = current_event;
|
||||
current_pad = current_event + IW_EV_LCP_LEN;
|
||||
qdf_mem_zero(&event, sizeof(struct iw_event));
|
||||
|
||||
/*Rates */
|
||||
event.cmd = SIOCGIWRATE;
|
||||
|
||||
pDot11SuppRates = &dot11BeaconIEs.SuppRates;
|
||||
|
||||
if (pDot11SuppRates->present) {
|
||||
int i;
|
||||
|
||||
numBasicRates = pDot11SuppRates->num_rates;
|
||||
for (i = 0; i < pDot11SuppRates->num_rates; i++) {
|
||||
if (0 != (pDot11SuppRates->rates[i] & 0x7F)) {
|
||||
event.u.bitrate.value =
|
||||
hdd_translate_abg_rate_to_mbps_rate
|
||||
(&pDot11SuppRates->rates[i]);
|
||||
|
||||
current_pad =
|
||||
iwe_stream_add_value(scanInfo->info,
|
||||
current_event,
|
||||
current_pad,
|
||||
end, &event,
|
||||
IW_EV_PARAM_LEN);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
pDot11ExtSuppRates = &dot11BeaconIEs.ExtSuppRates;
|
||||
|
||||
if (pDot11ExtSuppRates->present) {
|
||||
int i, no_of_rates;
|
||||
maxNumRates =
|
||||
numBasicRates + pDot11ExtSuppRates->num_rates;
|
||||
|
||||
/* Check to make sure the total number of rates
|
||||
* doesn't exceed IW_MAX_BITRATES
|
||||
*/
|
||||
|
||||
maxNumRates = QDF_MIN(maxNumRates, IW_MAX_BITRATES);
|
||||
|
||||
if ((maxNumRates - numBasicRates) > MAX_RATES) {
|
||||
no_of_rates = MAX_RATES;
|
||||
hdd_debug("Limit rates to MAX_RATES");
|
||||
} else {
|
||||
no_of_rates = maxNumRates - numBasicRates;
|
||||
}
|
||||
for (i = 0; i < no_of_rates; i++) {
|
||||
if (0 != (pDot11ExtSuppRates->rates[i] & 0x7F)) {
|
||||
event.u.bitrate.value =
|
||||
hdd_translate_abg_rate_to_mbps_rate
|
||||
(&pDot11ExtSuppRates->rates[i]);
|
||||
|
||||
current_pad =
|
||||
iwe_stream_add_value(scanInfo->info,
|
||||
current_event,
|
||||
current_pad,
|
||||
end, &event,
|
||||
IW_EV_PARAM_LEN);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((current_pad - current_event) >= IW_EV_LCP_LEN) {
|
||||
current_event = current_pad;
|
||||
} else {
|
||||
if (last_event == current_event) { /* no space to add event */
|
||||
hdd_err("no space for SIOCGIWRATE");
|
||||
return -E2BIG;
|
||||
}
|
||||
}
|
||||
|
||||
last_event = current_event;
|
||||
qdf_mem_zero(&event, sizeof(struct iw_event));
|
||||
|
||||
event.cmd = SIOCGIWENCODE;
|
||||
|
||||
if (SIR_MAC_GET_PRIVACY(capabilityInfo)) {
|
||||
event.u.data.flags =
|
||||
IW_ENCODE_ENABLED | IW_ENCODE_NOKEY;
|
||||
} else {
|
||||
event.u.data.flags = IW_ENCODE_DISABLED;
|
||||
}
|
||||
event.u.data.length = 0;
|
||||
|
||||
current_event =
|
||||
iwe_stream_add_point(scanInfo->info, current_event, end,
|
||||
&event, (char *)pDot11SSID->ssid);
|
||||
if (last_event == current_event) {
|
||||
hdd_err("no space for SIOCGIWENCODE");
|
||||
return -E2BIG;
|
||||
}
|
||||
}
|
||||
|
||||
last_event = current_event;
|
||||
qdf_mem_zero(&event, sizeof(struct iw_event));
|
||||
|
||||
/* RSSI */
|
||||
event.cmd = IWEVQUAL;
|
||||
event.u.qual.qual = descriptor->rssi;
|
||||
event.u.qual.noise = descriptor->sinr;
|
||||
event.u.qual.level = QDF_MIN((descriptor->rssi + descriptor->sinr), 0);
|
||||
|
||||
event.u.qual.updated = IW_QUAL_ALL_UPDATED;
|
||||
|
||||
current_event = iwe_stream_add_event(scanInfo->info, current_event,
|
||||
end, &event, IW_EV_QUAL_LEN);
|
||||
|
||||
if (last_event == current_event) { /* no space to add event */
|
||||
hdd_err("no space for IWEVQUAL");
|
||||
return -E2BIG;
|
||||
}
|
||||
|
||||
/* AGE */
|
||||
event.cmd = IWEVCUSTOM;
|
||||
p = custom;
|
||||
p += scnprintf(p, MAX_CUSTOM_LEN, " Age: %llu",
|
||||
qdf_mc_timer_get_system_time() -
|
||||
descriptor->received_time);
|
||||
event.u.data.length = p - custom;
|
||||
current_event = iwe_stream_add_point(scanInfo->info, current_event, end,
|
||||
&event, custom);
|
||||
if (last_event == current_event) { /* no space to add event */
|
||||
hdd_err("no space for IWEVCUSTOM (age)");
|
||||
return -E2BIG;
|
||||
}
|
||||
|
||||
scanInfo->start = current_event;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* wlan_hdd_is_scan_pending() - Utility function to check pending scans
|
||||
* @adapter: Pointer to the adapter
|
||||
|
|
@ -549,6 +183,7 @@ static bool wlan_hdd_is_scan_pending(hdd_adapter_t *adapter)
|
|||
qdf_spin_unlock(&hdd_ctx->hdd_scan_req_q_lock);
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* wlan_hdd_scan_request_enqueue() - enqueue Scan Request
|
||||
* @adapter: Pointer to the adapter
|
||||
|
|
@ -663,357 +298,6 @@ static QDF_STATUS wlan_hdd_scan_request_dequeue(hdd_context_t *hdd_ctx,
|
|||
hdd_err("Failed to find scan id %d", scan_id);
|
||||
return status;
|
||||
}
|
||||
/**
|
||||
* hdd_scan_request_callback() - scan complete callback from SME
|
||||
* @halHandle: Pointer to the Hal Handle
|
||||
* @pContext: Pointer to the data context
|
||||
* @sessionId: Session identifier
|
||||
* @scanId: Scan ID
|
||||
* @status: CSR Status
|
||||
*
|
||||
* The sme module calls this callback function once it finish the scan request
|
||||
* and this function notifies the scan complete event to the wpa_supplicant.
|
||||
*
|
||||
* Return: 0 for success, non zero for failure
|
||||
*/
|
||||
|
||||
static QDF_STATUS
|
||||
hdd_scan_request_callback(tHalHandle halHandle, void *pContext,
|
||||
uint8_t sessionId, uint32_t scanId,
|
||||
eCsrScanStatus status)
|
||||
{
|
||||
struct net_device *dev = (struct net_device *)pContext;
|
||||
hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
|
||||
hdd_context_t *hddctx = WLAN_HDD_GET_CTX(pAdapter);
|
||||
union iwreq_data wrqu;
|
||||
int we_event;
|
||||
char *msg;
|
||||
uint8_t source;
|
||||
struct cfg80211_scan_request *req;
|
||||
uint32_t timestamp;
|
||||
|
||||
ENTER();
|
||||
hdd_debug("called with halHandle = %p, pContext = %p, scanID = %d, returned status = %d",
|
||||
halHandle, pContext, (int)scanId, (int)status);
|
||||
|
||||
/* if there is a scan request pending when the wlan driver is unloaded
|
||||
* we may be invoked as SME flushes its pending queue. If that is the
|
||||
* case, the underlying net_device may have already been destroyed, so
|
||||
* do some quick sanity before proceeding
|
||||
*/
|
||||
if (pAdapter->dev != dev) {
|
||||
hdd_debug("device mismatch %p vs %p", pAdapter->dev, dev);
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
wlan_hdd_scan_request_dequeue(hddctx, scanId, &req, &source,
|
||||
×tamp);
|
||||
|
||||
if (req != NULL)
|
||||
hdd_err("Got unexpected request struct for Scan id %d",
|
||||
scanId);
|
||||
|
||||
/* Scan is no longer pending */
|
||||
if (!wlan_hdd_is_scan_pending(pAdapter))
|
||||
pAdapter->scan_info.mScanPending = false;
|
||||
|
||||
/* notify any applications that may be interested */
|
||||
memset(&wrqu, '\0', sizeof(wrqu));
|
||||
we_event = SIOCGIWSCAN;
|
||||
msg = NULL;
|
||||
wireless_send_event(dev, we_event, &wrqu, msg);
|
||||
|
||||
EXIT();
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* __iw_set_scan() - set scan request
|
||||
* @dev: Pointer to the net device
|
||||
* @info: Pointer to the iw_request_info
|
||||
* @wrqu: Pointer to the iwreq_data
|
||||
* @extra: Pointer to the data
|
||||
*
|
||||
* This function process the scan request from the wpa_supplicant
|
||||
* and set the scan request to the SME
|
||||
*
|
||||
* Return: 0 for success, non zero for failure
|
||||
*/
|
||||
|
||||
static int __iw_set_scan(struct net_device *dev, struct iw_request_info *info,
|
||||
union iwreq_data *wrqu, char *extra)
|
||||
{
|
||||
hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
|
||||
hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
|
||||
hdd_wext_state_t *pwextBuf = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
|
||||
tCsrScanRequest scanRequest;
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
struct iw_scan_req *scanReq = (struct iw_scan_req *)extra;
|
||||
hdd_adapter_t *con_sap_adapter;
|
||||
uint16_t con_dfs_ch;
|
||||
int ret;
|
||||
|
||||
ENTER_DEV(dev);
|
||||
|
||||
hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
|
||||
ret = wlan_hdd_validate_context(hdd_ctx);
|
||||
if (0 != ret)
|
||||
return ret;
|
||||
|
||||
ret = hdd_check_standard_wext_control(hdd_ctx, info);
|
||||
if (0 != ret)
|
||||
return ret;
|
||||
|
||||
/* Block All Scan during DFS operation and send null scan result */
|
||||
con_sap_adapter = hdd_get_con_sap_adapter(pAdapter, true);
|
||||
if (con_sap_adapter) {
|
||||
con_dfs_ch = con_sap_adapter->sessionCtx.ap.operatingChannel;
|
||||
|
||||
if (wlan_reg_is_dfs_ch(hdd_ctx->hdd_pdev, con_dfs_ch)) {
|
||||
hdd_warn("##In DFS Master mode. Scan aborted");
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
}
|
||||
|
||||
qdf_mem_zero(&scanRequest, sizeof(scanRequest));
|
||||
|
||||
if (NULL != wrqu->data.pointer) {
|
||||
/* set scanType, active or passive */
|
||||
if ((IW_SCAN_TYPE_ACTIVE == scanReq->scan_type) ||
|
||||
(eSIR_ACTIVE_SCAN == hdd_ctx->ioctl_scan_mode)) {
|
||||
scanRequest.scanType = eSIR_ACTIVE_SCAN;
|
||||
} else {
|
||||
scanRequest.scanType = eSIR_PASSIVE_SCAN;
|
||||
}
|
||||
|
||||
/* set bssid using sockaddr from iw_scan_req */
|
||||
qdf_mem_copy(scanRequest.bssid.bytes,
|
||||
&scanReq->bssid.sa_data,
|
||||
QDF_MAC_ADDR_SIZE);
|
||||
|
||||
if (wrqu->data.flags & IW_SCAN_THIS_ESSID) {
|
||||
|
||||
if (scanReq->essid_len &&
|
||||
(scanReq->essid_len <= SIR_MAC_MAX_SSID_LENGTH)) {
|
||||
scanRequest.SSIDs.numOfSSIDs = 1;
|
||||
scanRequest.SSIDs.SSIDList =
|
||||
(tCsrSSIDInfo *)
|
||||
qdf_mem_malloc(sizeof(tCsrSSIDInfo));
|
||||
if (scanRequest.SSIDs.SSIDList) {
|
||||
scanRequest.SSIDs.SSIDList->SSID.
|
||||
length = scanReq->essid_len;
|
||||
qdf_mem_copy(scanRequest.SSIDs.
|
||||
SSIDList->SSID.ssId,
|
||||
scanReq->essid,
|
||||
scanReq->essid_len);
|
||||
} else {
|
||||
scanRequest.SSIDs.numOfSSIDs = 0;
|
||||
hdd_err("Unable to allocate memory");
|
||||
QDF_ASSERT(0);
|
||||
}
|
||||
} else {
|
||||
hdd_err("Invalid essid length: %d",
|
||||
scanReq->essid_len);
|
||||
}
|
||||
}
|
||||
|
||||
/* set min and max channel time */
|
||||
scanRequest.minChnTime = scanReq->min_channel_time;
|
||||
scanRequest.maxChnTime = scanReq->max_channel_time;
|
||||
|
||||
} else {
|
||||
if (hdd_ctx->ioctl_scan_mode == eSIR_ACTIVE_SCAN) {
|
||||
/* set the scan type to active */
|
||||
scanRequest.scanType = eSIR_ACTIVE_SCAN;
|
||||
} else {
|
||||
scanRequest.scanType = eSIR_PASSIVE_SCAN;
|
||||
}
|
||||
|
||||
qdf_set_macaddr_broadcast(&scanRequest.bssid);
|
||||
|
||||
/* set min and max channel time to zero */
|
||||
scanRequest.minChnTime = 0;
|
||||
scanRequest.maxChnTime = 0;
|
||||
}
|
||||
|
||||
/* set BSSType to default type */
|
||||
scanRequest.BSSType = eCSR_BSS_TYPE_ANY;
|
||||
|
||||
/*Scan all the channels */
|
||||
scanRequest.ChannelInfo.numOfChannels = 0;
|
||||
|
||||
scanRequest.ChannelInfo.ChannelList = NULL;
|
||||
|
||||
/* set requestType to full scan */
|
||||
scanRequest.requestType = eCSR_SCAN_REQUEST_FULL_SCAN;
|
||||
|
||||
/* if previous genIE is not NULL, update ScanIE */
|
||||
if (0 != pwextBuf->genIE.length) {
|
||||
memset(&pAdapter->scan_info.scanAddIE, 0,
|
||||
sizeof(pAdapter->scan_info.scanAddIE));
|
||||
memcpy(pAdapter->scan_info.scanAddIE.addIEdata,
|
||||
pwextBuf->genIE.addIEdata, pwextBuf->genIE.length);
|
||||
pAdapter->scan_info.scanAddIE.length = pwextBuf->genIE.length;
|
||||
|
||||
pwextBuf->roamProfile.pAddIEScan =
|
||||
pAdapter->scan_info.scanAddIE.addIEdata;
|
||||
pwextBuf->roamProfile.nAddIEScanLength =
|
||||
pAdapter->scan_info.scanAddIE.length;
|
||||
|
||||
/* clear previous genIE after use it */
|
||||
memset(&pwextBuf->genIE, 0, sizeof(pwextBuf->genIE));
|
||||
}
|
||||
|
||||
/* push addIEScan in scanRequset if exist */
|
||||
if (pAdapter->scan_info.scanAddIE.length &&
|
||||
pAdapter->scan_info.scanAddIE.length <=
|
||||
sizeof(pAdapter->scan_info.scanAddIE.addIEdata)) {
|
||||
scanRequest.uIEFieldLen = pAdapter->scan_info.scanAddIE.length;
|
||||
scanRequest.pIEField = pAdapter->scan_info.scanAddIE.addIEdata;
|
||||
}
|
||||
scanRequest.timestamp = qdf_mc_timer_get_system_time();
|
||||
status = sme_scan_request((WLAN_HDD_GET_CTX(pAdapter))->hHal,
|
||||
pAdapter->sessionId, &scanRequest,
|
||||
&hdd_scan_request_callback, dev);
|
||||
if (!QDF_IS_STATUS_SUCCESS(status)) {
|
||||
hdd_err("sme_scan_request fail %d!!!", status);
|
||||
goto error;
|
||||
}
|
||||
|
||||
wlan_hdd_scan_request_enqueue(pAdapter, NULL, NL_SCAN,
|
||||
scanRequest.scan_id,
|
||||
scanRequest.timestamp);
|
||||
|
||||
pAdapter->scan_info.mScanPending = true;
|
||||
error:
|
||||
if ((wrqu->data.flags & IW_SCAN_THIS_ESSID) && (scanReq->essid_len))
|
||||
qdf_mem_free(scanRequest.SSIDs.SSIDList);
|
||||
EXIT();
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* iw_set_scan() - SSR wrapper for __iw_set_scan
|
||||
* @dev: Pointer to the net device.
|
||||
* @info: Pointer to the iw_request_info.
|
||||
* @wrqu: Pointer to the iwreq_data.
|
||||
* @extra: Pointer to the data.
|
||||
*
|
||||
* Return: 0 on success, error number otherwise
|
||||
*/
|
||||
int iw_set_scan(struct net_device *dev, struct iw_request_info *info,
|
||||
union iwreq_data *wrqu, char *extra)
|
||||
{
|
||||
int ret;
|
||||
|
||||
cds_ssr_protect(__func__);
|
||||
ret = __iw_set_scan(dev, info, wrqu, extra);
|
||||
cds_ssr_unprotect(__func__);
|
||||
|
||||
return ret;
|
||||
}
|
||||
/**
|
||||
* __iw_get_scan() - get scan
|
||||
* @dev: Pointer to the net device.
|
||||
* @info: Pointer to the iw_request_info.
|
||||
* @wrqu: Pointer to the iwreq_data.
|
||||
* @extra: Pointer to the data.
|
||||
*
|
||||
* This function returns the scan results to the wpa_supplicant
|
||||
*
|
||||
* Return: 0 for success, non zero for failure
|
||||
*/
|
||||
|
||||
static int __iw_get_scan(struct net_device *dev,
|
||||
struct iw_request_info *info,
|
||||
union iwreq_data *wrqu, char *extra)
|
||||
{
|
||||
hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
|
||||
hdd_context_t *hdd_ctx;
|
||||
tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter);
|
||||
tCsrScanResultInfo *pScanResult;
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
hdd_scan_info_t scanInfo;
|
||||
tScanResultHandle pResult;
|
||||
int i = 0;
|
||||
int ret;
|
||||
|
||||
ENTER_DEV(dev);
|
||||
|
||||
hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
|
||||
ret = wlan_hdd_validate_context(hdd_ctx);
|
||||
if (0 != ret)
|
||||
return ret;
|
||||
|
||||
ret = hdd_check_standard_wext_control(hdd_ctx, info);
|
||||
if (0 != ret)
|
||||
return ret;
|
||||
|
||||
hdd_debug("enter buffer length %d!!!",
|
||||
(wrqu->data.length) ? wrqu->data.length : IW_SCAN_MAX_DATA);
|
||||
|
||||
if (true == pAdapter->scan_info.mScanPending) {
|
||||
hdd_err("mScanPending is true !!!");
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
scanInfo.dev = dev;
|
||||
scanInfo.start = extra;
|
||||
scanInfo.info = info;
|
||||
|
||||
if (0 == wrqu->data.length) {
|
||||
scanInfo.end = extra + IW_SCAN_MAX_DATA;
|
||||
} else {
|
||||
scanInfo.end = extra + wrqu->data.length;
|
||||
}
|
||||
|
||||
status = sme_scan_get_result(hHal, pAdapter->sessionId, NULL, &pResult);
|
||||
|
||||
if (NULL == pResult) {
|
||||
/* no scan results */
|
||||
hdd_debug("iw_get_scan: NULL Scan Result ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
pScanResult = sme_scan_result_get_first(hHal, pResult);
|
||||
|
||||
while (pScanResult) {
|
||||
status = hdd_indicate_scan_result(&scanInfo, pScanResult);
|
||||
if (0 != status) {
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
pScanResult = sme_scan_result_get_next(hHal, pResult);
|
||||
}
|
||||
|
||||
sme_scan_result_purge(pResult);
|
||||
|
||||
hdd_debug("exit total %d BSS reported !!!", i);
|
||||
EXIT();
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* iw_get_scan() - SSR wrapper function for __iw_get_scan
|
||||
* @dev: Pointer to the net device.
|
||||
* @info: Pointer to the iw_request_info.
|
||||
* @wrqu: Pointer to the iwreq_data.
|
||||
* @extra: Pointer to the data.
|
||||
*
|
||||
* Return: 0 on success, error number otherwise
|
||||
*/
|
||||
int iw_get_scan(struct net_device *dev,
|
||||
struct iw_request_info *info,
|
||||
union iwreq_data *wrqu, char *extra)
|
||||
{
|
||||
int ret;
|
||||
|
||||
cds_ssr_protect(__func__);
|
||||
ret = __iw_get_scan(dev, info, wrqu, extra);
|
||||
cds_ssr_unprotect(__func__);
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -37,12 +37,6 @@
|
|||
/* (30 Mins) */
|
||||
#define MIN_TIME_REQUIRED_FOR_NEXT_BUG_REPORT (30 * 60 * 1000)
|
||||
|
||||
int iw_get_scan(struct net_device *dev, struct iw_request_info *info,
|
||||
union iwreq_data *wrqu, char *extra);
|
||||
|
||||
int iw_set_scan(struct net_device *dev, struct iw_request_info *info,
|
||||
union iwreq_data *wrqu, char *extra);
|
||||
|
||||
int hdd_scan_context_init(hdd_context_t *hdd_ctx);
|
||||
void hdd_scan_context_destroy(hdd_context_t *hdd_ctx);
|
||||
|
||||
|
|
|
|||
|
|
@ -12772,13 +12772,8 @@ static const iw_handler we_handler[] = {
|
|||
(iw_handler) iw_get_ap_address, /* SIOCGIWAP */
|
||||
(iw_handler) iw_set_mlme, /* SIOCSIWMLME */
|
||||
(iw_handler) NULL, /* SIOCGIWAPLIST */
|
||||
#ifndef NAPIER_SCAN
|
||||
(iw_handler) iw_set_scan, /* SIOCSIWSCAN */
|
||||
(iw_handler) iw_get_scan, /* SIOCGIWSCAN */
|
||||
#else
|
||||
(iw_handler) NULL, /* SIOCSIWSCAN */
|
||||
(iw_handler) NULL, /* SIOCGIWSCAN */
|
||||
#endif
|
||||
(iw_handler) iw_set_essid, /* SIOCSIWESSID */
|
||||
(iw_handler) iw_get_essid, /* SIOCGIWESSID */
|
||||
(iw_handler) iw_set_nick, /* SIOCSIWNICKN */
|
||||
|
|
|
|||
Loading…
Reference in a new issue