/* * Append a generic IE as a pass through TLV to a TLV buffer. * * This function is called from the network join command preparation routine. * * If the IE buffer has been setup by the application, this routine appends * the buffer as a pass through TLV type to the request.
*/ staticint
mwifiex_cmd_append_generic_ie(struct mwifiex_private *priv, u8 **buffer)
{ int ret_len = 0; struct mwifiex_ie_types_header ie_header;
/* Null Checks */ if (!buffer) return 0; if (!(*buffer)) return 0;
/* * If there is a generic ie buffer setup, append it to the return * parameter buffer pointer.
*/ if (priv->gen_ie_buf_len) {
mwifiex_dbg(priv->adapter, INFO, "info: %s: append generic ie len %d to %p\n",
__func__, priv->gen_ie_buf_len, *buffer);
/* Wrap the generic IE buffer with a pass through TLV type */
ie_header.type = cpu_to_le16(TLV_TYPE_PASSTHROUGH);
ie_header.len = cpu_to_le16(priv->gen_ie_buf_len);
memcpy(*buffer, &ie_header, sizeof(ie_header));
/* Increment the return size and the return buffer pointer
param */
*buffer += sizeof(ie_header);
ret_len += sizeof(ie_header);
/* Copy the generic IE buffer to the output buffer, advance
pointer */
memcpy(*buffer, priv->gen_ie_buf, priv->gen_ie_buf_len);
/* Increment the return size and the return buffer pointer
param */
*buffer += priv->gen_ie_buf_len;
ret_len += priv->gen_ie_buf_len;
/* return the length appended to the buffer */ return ret_len;
}
/* * Append TSF tracking info from the scan table for the target AP. * * This function is called from the network join command preparation routine. * * The TSF table TSF sent to the firmware contains two TSF values: * - The TSF of the target AP from its previous beacon/probe response * - The TSF timestamp of our local MAC at the time we observed the * beacon/probe response. * * The firmware uses the timestamp values to set an initial TSF value * in the MAC for the new association after a reassociation attempt.
*/ staticint
mwifiex_cmd_append_tsf_tlv(struct mwifiex_private *priv, u8 **buffer, struct mwifiex_bssdescriptor *bss_desc)
{ struct mwifiex_ie_types_tsf_timestamp tsf_tlv;
__le64 tsf_val;
/* Null Checks */ if (buffer == NULL) return 0; if (*buffer == NULL) return 0;
/* TSF at the time when beacon/probe_response was received */
tsf_val = cpu_to_le64(bss_desc->fw_tsf);
memcpy(*buffer, &tsf_val, sizeof(tsf_val));
*buffer += sizeof(tsf_val);
/* * This function finds out the common rates between rate1 and rate2. * * It will fill common rates in rate1 as output if found. * * NOTE: Setting the MSB of the basic rates needs to be taken * care of, either before or after calling this function.
*/ staticint mwifiex_get_common_rates(struct mwifiex_private *priv, u8 *rate1,
u32 rate1_size, u8 *rate2, u32 rate2_size)
{ int ret;
u8 *ptr = rate1, *tmp;
u32 i, j;
tmp = kmemdup(rate1, rate1_size, GFP_KERNEL); if (!tmp) {
mwifiex_dbg(priv->adapter, ERROR, "failed to alloc tmp buf\n"); return -ENOMEM;
}
memset(rate1, 0, rate1_size);
for (i = 0; i < rate2_size && rate2[i]; i++) { for (j = 0; j < rate1_size && tmp[j]; j++) { /* Check common rate, excluding the bit for
basic rate */ if ((rate2[i] & 0x7F) == (tmp[j] & 0x7F)) {
*rate1++ = tmp[j]; break;
}
}
}
mwifiex_dbg(priv->adapter, INFO, "info: Tx data rate set to %#x\n",
priv->data_rate);
if (!priv->is_data_rate_auto) { while (*ptr) { if ((*ptr & 0x7f) == priv->data_rate) {
ret = 0; goto done;
}
ptr++;
}
mwifiex_dbg(priv->adapter, ERROR, "previously set fixed data rate %#x\t" "is not compatible with the network\n",
priv->data_rate);
ret = -1; goto done;
}
ret = 0;
done:
kfree(tmp); return ret;
}
/* * This function creates the intersection of the rates supported by a * target BSS and our adapter settings for use in an assoc/join command.
*/ staticint
mwifiex_setup_rates_from_bssdesc(struct mwifiex_private *priv, struct mwifiex_bssdescriptor *bss_desc,
u8 *out_rates, u32 *out_rates_size)
{
u8 card_rates[MWIFIEX_SUPPORTED_RATES];
u32 card_rates_size;
/* Copy AP supported rates */
memcpy(out_rates, bss_desc->supported_rates, MWIFIEX_SUPPORTED_RATES); /* Get the STA supported rates */
card_rates_size = mwifiex_get_active_data_rates(priv, card_rates); /* Get the common rates between AP and STA supported rates */ if (mwifiex_get_common_rates(priv, out_rates, MWIFIEX_SUPPORTED_RATES,
card_rates, card_rates_size)) {
*out_rates_size = 0;
mwifiex_dbg(priv->adapter, ERROR, "%s: cannot get common rates\n",
__func__); return -1;
}
/* * This function appends a WPS IE. It is called from the network join command * preparation routine. * * If the IE buffer has been setup by the application, this routine appends * the buffer as a WPS TLV type to the request.
*/ staticint
mwifiex_cmd_append_wps_ie(struct mwifiex_private *priv, u8 **buffer)
{ int retLen = 0; struct mwifiex_ie_types_header ie_header;
if (!buffer || !*buffer) return 0;
/* * If there is a wps ie buffer setup, append it to the return * parameter buffer pointer.
*/ if (priv->wps_ie_len) {
mwifiex_dbg(priv->adapter, CMD, "cmd: append wps ie %d to %p\n",
priv->wps_ie_len, *buffer);
/* Wrap the generic IE buffer with a pass through TLV type */
ie_header.type = cpu_to_le16(TLV_TYPE_PASSTHROUGH);
ie_header.len = cpu_to_le16(priv->wps_ie_len);
memcpy(*buffer, &ie_header, sizeof(ie_header));
*buffer += sizeof(ie_header);
retLen += sizeof(ie_header);
/* * This function appends a WAPI IE. * * This function is called from the network join command preparation routine. * * If the IE buffer has been setup by the application, this routine appends * the buffer as a WAPI TLV type to the request.
*/ staticint
mwifiex_cmd_append_wapi_ie(struct mwifiex_private *priv, u8 **buffer)
{ int retLen = 0; struct mwifiex_ie_types_header ie_header;
/* Null Checks */ if (buffer == NULL) return 0; if (*buffer == NULL) return 0;
/* * If there is a wapi ie buffer setup, append it to the return * parameter buffer pointer.
*/ if (priv->wapi_ie_len) {
mwifiex_dbg(priv->adapter, CMD, "cmd: append wapi ie %d to %p\n",
priv->wapi_ie_len, *buffer);
/* Wrap the generic IE buffer with a pass through TLV type */
ie_header.type = cpu_to_le16(TLV_TYPE_WAPI_IE);
ie_header.len = cpu_to_le16(priv->wapi_ie_len);
memcpy(*buffer, &ie_header, sizeof(ie_header));
/* Increment the return size and the return buffer pointer
param */
*buffer += sizeof(ie_header);
retLen += sizeof(ie_header);
/* Copy the wapi IE buffer to the output buffer, advance
pointer */
memcpy(*buffer, priv->wapi_ie, priv->wapi_ie_len);
/* Increment the return size and the return buffer pointer
param */
*buffer += priv->wapi_ie_len;
retLen += priv->wapi_ie_len;
} /* return the length appended to the buffer */ return retLen;
}
/* * This function appends rsn ie tlv for wpa/wpa2 security modes. * It is called from the network join command preparation routine.
*/ staticint mwifiex_append_rsn_ie_wpa_wpa2(struct mwifiex_private *priv,
u8 **buffer)
{ struct mwifiex_ie_types_rsn_param_set *rsn_ie_tlv; int rsn_ie_len;
/* Set the listen interval */
assoc->listen_interval = cpu_to_le16(priv->listen_interval); /* Set the beacon period */
assoc->beacon_period = cpu_to_le16(bss_desc->beacon_period);
/* Get the common rates supported between the driver and the BSS Desc */ if (mwifiex_setup_rates_from_bssdesc
(priv, bss_desc, rates, &rates_size)) return -1;
/* Save the data rates into Current BSS state structure */
priv->curr_bss_params.num_of_rates = rates_size;
memcpy(&priv->curr_bss_params.data_rates, rates, rates_size);
/* Setup the Rates TLV in the association command */
rates_tlv = (struct mwifiex_ie_types_rates_param_set *) pos;
rates_tlv->header.type = cpu_to_le16(WLAN_EID_SUPP_RATES);
rates_tlv->header.len = cpu_to_le16((u16) rates_size);
memcpy(rates_tlv->rates, rates, rates_size);
pos += sizeof(rates_tlv->header) + rates_size;
mwifiex_dbg(priv->adapter, INFO, "info: ASSOC_CMD: rates size = %d\n",
rates_size);
/* Add the Authentication type to be used for Auth frames */
auth_tlv = (struct mwifiex_ie_types_auth_type *) pos;
auth_tlv->header.type = cpu_to_le16(TLV_TYPE_AUTH_TYPE);
auth_tlv->header.len = cpu_to_le16(sizeof(auth_tlv->auth_type)); if (priv->sec_info.wep_enabled)
auth_tlv->auth_type = cpu_to_le16(
(u16) priv->sec_info.authentication_mode); else
auth_tlv->auth_type = cpu_to_le16(NL80211_AUTHTYPE_OPEN_SYSTEM);
staticconstchar *assoc_failure_reason_to_str(u16 cap_info)
{ switch (cap_info) { case CONNECT_ERR_AUTH_ERR_STA_FAILURE: return"CONNECT_ERR_AUTH_ERR_STA_FAILURE"; case CONNECT_ERR_AUTH_MSG_UNHANDLED: return"CONNECT_ERR_AUTH_MSG_UNHANDLED"; case CONNECT_ERR_ASSOC_ERR_TIMEOUT: return"CONNECT_ERR_ASSOC_ERR_TIMEOUT"; case CONNECT_ERR_ASSOC_ERR_AUTH_REFUSED: return"CONNECT_ERR_ASSOC_ERR_AUTH_REFUSED"; case CONNECT_ERR_STA_FAILURE: return"CONNECT_ERR_STA_FAILURE";
}
return"Unknown connect failure";
} /* * Association firmware command response handler * * The response buffer for the association command has the following * memory layout. * * For cases where an association response was not received (indicated * by the CapInfo and AId field): * * .------------------------------------------------------------. * | Header(4 * sizeof(t_u16)): Standard command response hdr | * .------------------------------------------------------------. * | cap_info/Error Return(t_u16): | * | 0xFFFF(-1): Internal error | * | 0xFFFE(-2): Authentication unhandled message | * | 0xFFFD(-3): Authentication refused | * | 0xFFFC(-4): Timeout waiting for AP response | * .------------------------------------------------------------. * | status_code(t_u16): | * | If cap_info is -1: | * | An internal firmware failure prevented the | * | command from being processed. The status_code | * | will be set to 1. | * | | * | If cap_info is -2: | * | An authentication frame was received but was | * | not handled by the firmware. IEEE Status | * | code for the failure is returned. | * | | * | If cap_info is -3: | * | An authentication frame was received and the | * | status_code is the IEEE Status reported in the | * | response. | * | | * | If cap_info is -4: | * | (1) Association response timeout | * | (2) Authentication response timeout | * .------------------------------------------------------------. * | a_id(t_u16): 0xFFFF | * .------------------------------------------------------------. * * * For cases where an association response was received, the IEEE * standard association response frame is returned: * * .------------------------------------------------------------. * | Header(4 * sizeof(t_u16)): Standard command response hdr | * .------------------------------------------------------------. * | cap_info(t_u16): IEEE Capability | * .------------------------------------------------------------. * | status_code(t_u16): IEEE Status Code | * .------------------------------------------------------------. * | a_id(t_u16): IEEE Association ID | * .------------------------------------------------------------. * | IEEE IEs(variable): Any received IEs comprising the | * | remaining portion of a received | * | association response frame. | * .------------------------------------------------------------. * * For simplistic handling, the status_code field can be used to determine * an association success (0) or failure (non-zero).
*/ int mwifiex_ret_802_11_associate(struct mwifiex_private *priv, struct host_cmd_ds_command *resp)
{ struct mwifiex_adapter *adapter = priv->adapter; int ret = 0; struct ieee_types_assoc_rsp *assoc_rsp; struct mwifiex_bssdescriptor *bss_desc; bool enable_data = true;
u16 cap_info, status_code, aid; const u8 *ie_ptr;
if (!priv->attempted_bss_desc) {
mwifiex_dbg(priv->adapter, ERROR, "ASSOC_RESP: failed, association terminated by host\n"); goto done;
}
if (adapter->host_mlme_enabled) { struct ieee80211_mgmt *hdr;
/* Store the bandwidth information from assoc response */
ie_ptr = cfg80211_find_ie(WLAN_EID_HT_OPERATION, assoc_rsp->ie_buffer,
priv->assoc_rsp_size
- sizeof(struct ieee_types_assoc_rsp));
priv->ht_param_present = ie_ptr ? true : false;
mwifiex_dbg(priv->adapter, INFO, "info: ASSOC_RESP: curr_pkt_filter is %#x\n",
priv->curr_pkt_filter); if (priv->sec_info.wpa_enabled || priv->sec_info.wpa2_enabled)
priv->wpa_is_gtk_set = false;
if (priv->wmm_enabled) { /* Don't re-enable carrier until we get the WMM_GET_STATUS
event */
enable_data = false;
} else { /* Since WMM is not enabled, setup the queues with the
defaults */
mwifiex_wmm_setup_queue_priorities(priv, NULL);
mwifiex_wmm_setup_ac_downgrade(priv);
}
if (enable_data)
mwifiex_dbg(priv->adapter, INFO, "info: post association, re-enabling data flow\n");
mwifiex_dbg(priv->adapter, MSG, "assoc: associated with %pM\n",
priv->attempted_bss_desc->mac_address);
/* Add the ra_list here for infra mode as there will be only 1 ra
always */
mwifiex_ralist_add(priv,
priv->curr_bss_params.bss_descriptor.mac_address);
if (!netif_carrier_ok(priv->netdev))
netif_carrier_on(priv->netdev);
mwifiex_wake_up_net_dev_queue(priv->netdev, adapter);
/* * Fill in the parameters for 2 data structures: * 1. struct host_cmd_ds_802_11_ad_hoc_start command * 2. bss_desc * Driver will fill up SSID, bss_mode,IBSS param, Physical Param, * probe delay, and Cap info. * Firmware will fill up beacon period, Basic rates * and operational rates.
*/
/* Set Capability info */
bss_desc->cap_info_bitmap |= WLAN_CAPABILITY_IBSS;
tmp_cap = WLAN_CAPABILITY_IBSS;
/* Set up privacy in bss_desc */ if (priv->sec_info.encryption_mode) { /* Ad-Hoc capability privacy on */
mwifiex_dbg(adapter, INFO, "info: ADHOC_S_CMD: wep_status set privacy to WEP\n");
bss_desc->privacy = MWIFIEX_802_11_PRIV_FILTER_8021X_WEP;
tmp_cap |= WLAN_CAPABILITY_PRIVACY;
} else {
mwifiex_dbg(adapter, INFO, "info: ADHOC_S_CMD: wep_status NOT set,\t" "setting privacy to ACCEPT ALL\n");
bss_desc->privacy = MWIFIEX_802_11_PRIV_FILTER_ACCEPT_ALL;
}
memset(adhoc_start->data_rate, 0, sizeof(adhoc_start->data_rate));
mwifiex_get_active_data_rates(priv, adhoc_start->data_rate); if ((adapter->adhoc_start_band & BAND_G) &&
(priv->curr_pkt_filter & HostCmd_ACT_MAC_ADHOC_G_PROTECTION_ON)) { if (mwifiex_send_cmd(priv, HostCmd_CMD_MAC_CONTROL,
HostCmd_ACT_GEN_SET, 0,
&priv->curr_pkt_filter, false)) {
mwifiex_dbg(adapter, ERROR, "ADHOC_S_CMD: G Protection config failed\n"); return -1;
}
} /* Find the last non zero */ for (i = 0; i < sizeof(adhoc_start->data_rate); i++) if (!adhoc_start->data_rate[i]) break;
priv->curr_bss_params.num_of_rates = i;
/* Copy the ad-hoc creating rates into Current BSS rate structure */
memcpy(&priv->curr_bss_params.data_rates,
&adhoc_start->data_rate, priv->curr_bss_params.num_of_rates);
/* * This function prepares command for ad-hoc join. * * Most of the parameters are set up by copying from the target BSS descriptor * from the scan response. * * In addition, the following TLVs are added - * - Channel TLV * - Vendor specific IE * - WPA/WPA2 IE * - 11n IE * * Preparation also includes - * - Setting command ID and proper size * - Ensuring correct endian-ness
*/ int
mwifiex_cmd_802_11_ad_hoc_join(struct mwifiex_private *priv, struct host_cmd_ds_command *cmd, struct mwifiex_bssdescriptor *bss_desc)
{ int rsn_ie_len = 0; struct host_cmd_ds_802_11_ad_hoc_join *adhoc_join =
&cmd->params.adhoc_join; struct mwifiex_ie_types_chan_list_param_set *chan_tlv;
u32 cmd_append_size = 0;
u16 tmp_cap;
u32 i, rates_size = 0;
u16 curr_pkt_filter;
u8 *pos =
(u8 *) adhoc_join + sizeof(struct host_cmd_ds_802_11_ad_hoc_join);
/* Use G protection */ #define USE_G_PROTECTION 0x02 if (bss_desc->erp_flags & USE_G_PROTECTION) {
curr_pkt_filter =
priv->
curr_pkt_filter | HostCmd_ACT_MAC_ADHOC_G_PROTECTION_ON;
if (mwifiex_send_cmd(priv, HostCmd_CMD_MAC_CONTROL,
HostCmd_ACT_GEN_SET, 0,
&curr_pkt_filter, false)) {
mwifiex_dbg(priv->adapter, ERROR, "ADHOC_J_CMD: G Protection config failed\n"); return -1;
}
}
/* Information on BSSID descriptor passed to FW */
mwifiex_dbg(priv->adapter, INFO, "info: ADHOC_J_CMD: BSSID=%pM, SSID='%s'\n",
adhoc_join->bss_descriptor.bssid,
adhoc_join->bss_descriptor.ssid);
for (i = 0; i < MWIFIEX_SUPPORTED_RATES &&
bss_desc->supported_rates[i]; i++)
;
rates_size = i;
/* Copy Data Rates from the Rates recorded in scan response */
memset(adhoc_join->bss_descriptor.data_rates, 0, sizeof(adhoc_join->bss_descriptor.data_rates));
memcpy(adhoc_join->bss_descriptor.data_rates,
bss_desc->supported_rates, rates_size);
/* Copy the adhoc join rates into Current BSS state structure */
priv->curr_bss_params.num_of_rates = rates_size;
memcpy(&priv->curr_bss_params.data_rates, bss_desc->supported_rates,
rates_size);
/* Copy the channel information */
priv->curr_bss_params.bss_descriptor.channel = bss_desc->channel;
priv->curr_bss_params.band = (u8) bss_desc->bss_band;
if (priv->sec_info.wep_enabled || priv->sec_info.wpa_enabled)
tmp_cap |= WLAN_CAPABILITY_PRIVACY;
/* * This function handles the command response of ad-hoc start and * ad-hoc join. * * The function generates a device-connected event to notify * the applications, in case of successful ad-hoc start/join, and * saves the beacon buffer.
*/ int mwifiex_ret_802_11_ad_hoc(struct mwifiex_private *priv, struct host_cmd_ds_command *resp)
{ int ret = 0; struct mwifiex_adapter *adapter = priv->adapter; struct host_cmd_ds_802_11_ad_hoc_start_result *start_result =
&resp->params.start_result; struct host_cmd_ds_802_11_ad_hoc_join_result *join_result =
&resp->params.join_result; struct mwifiex_bssdescriptor *bss_desc;
u16 cmd = le16_to_cpu(resp->command);
u8 result;
if (!priv->attempted_bss_desc) {
mwifiex_dbg(priv->adapter, ERROR, "ADHOC_RESP: failed, association terminated by host\n"); goto done;
}
if (cmd == HostCmd_CMD_802_11_AD_HOC_START)
result = start_result->result; else
result = join_result->result;
bss_desc = priv->attempted_bss_desc;
/* Join result code 0 --> SUCCESS */ if (result) {
mwifiex_dbg(priv->adapter, ERROR, "ADHOC_RESP: failed\n"); if (priv->media_connected)
mwifiex_reset_connect_state(priv, result, true);
/* Update the created network descriptor with the new BSSID */
memcpy(bss_desc->mac_address,
start_result->bssid, ETH_ALEN);
priv->adhoc_state = ADHOC_STARTED;
} else { /* * Now the join cmd should be successful. * If BSSID has changed use SSID to compare instead of BSSID
*/
mwifiex_dbg(priv->adapter, INFO, "info: ADHOC_J_RESP %s\n",
bss_desc->ssid.ssid);
/* * Make a copy of current BSSID descriptor, only needed for * join since the current descriptor is already being used * for adhoc start
*/
memcpy(&priv->curr_bss_params.bss_descriptor,
bss_desc, sizeof(struct mwifiex_bssdescriptor));
if (!netif_carrier_ok(priv->netdev))
netif_carrier_on(priv->netdev);
mwifiex_wake_up_net_dev_queue(priv->netdev, adapter);
mwifiex_save_curr_bcn(priv);
done: /* Need to indicate IOCTL complete */ if (adapter->curr_cmd->wait_q_enabled) { if (ret)
adapter->cmd_wait_q.status = -1; else
adapter->cmd_wait_q.status = 0;
}
return ret;
}
/* * This function associates to a specific BSS discovered in a scan. * * It clears any past association response stored for application * retrieval and calls the command preparation routine to send the * command to firmware.
*/ int mwifiex_associate(struct mwifiex_private *priv, struct mwifiex_bssdescriptor *bss_desc)
{ /* Return error if the adapter is not STA role or table entry * is not marked as infra.
*/ if ((GET_BSS_ROLE(priv) != MWIFIEX_BSS_ROLE_STA) ||
(bss_desc->bss_mode != NL80211_IFTYPE_STATION)) return -1;
/* * This function joins an ad-hoc network found in a previous scan. * * It calls the command preparation routine to send the command to firmware, * if already not connected to the requested SSID.
*/ int mwifiex_adhoc_join(struct mwifiex_private *priv, struct mwifiex_bssdescriptor *bss_desc)
{
mwifiex_dbg(priv->adapter, INFO, "info: adhoc join: curr_bss ssid =%s\n",
priv->curr_bss_params.bss_descriptor.ssid.ssid);
mwifiex_dbg(priv->adapter, INFO, "info: adhoc join: curr_bss ssid_len =%u\n",
priv->curr_bss_params.bss_descriptor.ssid.ssid_len);
mwifiex_dbg(priv->adapter, INFO, "info: adhoc join: ssid =%s\n",
bss_desc->ssid.ssid);
mwifiex_dbg(priv->adapter, INFO, "info: adhoc join: ssid_len =%u\n",
bss_desc->ssid.ssid_len);
/* Check if the requested SSID is already joined */ if (priv->curr_bss_params.bss_descriptor.ssid.ssid_len &&
cfg80211_ssid_eq(&bss_desc->ssid,
&priv->curr_bss_params.bss_descriptor.ssid) &&
(priv->curr_bss_params.bss_descriptor.bss_mode ==
NL80211_IFTYPE_ADHOC)) {
mwifiex_dbg(priv->adapter, INFO, "info: ADHOC_J_CMD: new ad-hoc SSID\t" "is the same as current; not attempting to re-join\n"); return -1;
}
/* * This function deauthenticates/disconnects from infra network by sending * deauthentication request.
*/ staticint mwifiex_deauthenticate_infra(struct mwifiex_private *priv, u8 *mac)
{
u8 mac_address[ETH_ALEN]; int ret;
ret = mwifiex_send_cmd(priv, HostCmd_CMD_802_11_DEAUTHENTICATE,
HostCmd_ACT_GEN_SET, 0, mac_address, true);
return ret;
}
/* * This function deauthenticates/disconnects from a BSS. * * In case of infra made, it sends deauthentication request, and * in case of ad-hoc mode, a stop network request is sent to the firmware. * In AP mode, a command to stop bss is sent to firmware.
*/ int mwifiex_deauthenticate(struct mwifiex_private *priv, u8 *mac)
{ int ret = 0;
switch (priv->bss_mode) { case NL80211_IFTYPE_STATION: case NL80211_IFTYPE_P2P_CLIENT:
ret = mwifiex_deauthenticate_infra(priv, mac); if (ret)
cfg80211_disconnected(priv->netdev, 0, NULL, 0, true, GFP_KERNEL); break; case NL80211_IFTYPE_ADHOC: return mwifiex_send_cmd(priv, HostCmd_CMD_802_11_AD_HOC_STOP,
HostCmd_ACT_GEN_SET, 0, NULL, true); case NL80211_IFTYPE_AP: return mwifiex_send_cmd(priv, HostCmd_CMD_UAP_BSS_STOP,
HostCmd_ACT_GEN_SET, 0, NULL, true); default: break;
}
return ret;
}
/* This function deauthenticates/disconnects from all BSS. */ void mwifiex_deauthenticate_all(struct mwifiex_adapter *adapter)
{ struct mwifiex_private *priv; int i;
for (i = 0; i < adapter->priv_num; i++) {
priv = adapter->priv[i];
mwifiex_deauthenticate(priv, NULL);
}
}
EXPORT_SYMBOL_GPL(mwifiex_deauthenticate_all);
/* * This function converts band to radio type used in channel TLV.
*/
u8
mwifiex_band_to_radio_type(u8 band)
{ switch (band) { case BAND_A: case BAND_AN: case BAND_A | BAND_AN: case BAND_A | BAND_AN | BAND_AAC: return HostCmd_SCAN_RADIO_TYPE_A; case BAND_B: case BAND_G: case BAND_B | BAND_G: default: return HostCmd_SCAN_RADIO_TYPE_BG;
}
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.43 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.