qcacld-3.0: Remove IBSS support from HDD

Remove IBSS support from HDD layer.

Change-Id: Ie581faa15317b8523b36507bb1662246b95c2e47
CRs-Fixed: 2684352
This commit is contained in:
gaurank kathpalia 2020-05-07 03:52:58 +05:30 • committed by nshrivas
commit f47d2eb63f
19 changed files with 68 additions and 2415 deletions

View file

@ -44,21 +44,13 @@
/* Timeout (in ms) for Link to Up before Registering Station */
#define ASSOC_LINKUP_TIMEOUT 60
/* Timeout in ms for peer info request commpletion */
#define IBSS_PEER_INFO_REQ_TIMOEUT 1000
#define INVALID_PEER_IDX -1
/**
* enum eConnectionState - connection state values at HDD
* @eConnectionState_NotConnected: Not associated in Infra or participating in
* in an IBSS / Ad-hoc network
* @eConnectionState_NotConnected: Not associated in Infra
* @eConnectionState_Connecting: While connection in progress
* @eConnectionState_Associated: Associated in an Infrastructure network
* @eConnectionState_IbssDisconnected: Participating in an IBSS network though
* disconnected (no partner stations in the IBSS)
* @eConnectionState_IbssConnected: Participating in an IBSS network with
* partner stations also present
* @eConnectionState_Disconnecting: Disconnecting in an Infrastructure network.
* @eConnectionState_NdiDisconnected: NDI in disconnected state - no peers
* @eConnectionState_NdiConnected: NDI in connected state - at least one peer
@ -67,8 +59,6 @@ typedef enum {
eConnectionState_NotConnected,
eConnectionState_Connecting,
eConnectionState_Associated,
eConnectionState_IbssDisconnected,
eConnectionState_IbssConnected,
eConnectionState_Disconnecting,
eConnectionState_NdiDisconnected,
eConnectionState_NdiConnected,

View file

@ -761,13 +761,6 @@ struct hdd_mon_set_ch_info {
* @conn_info: current connection information
* @roam_info: current roaming information
* @ft_carrier_on: is carrier on
* @ibss_sta_generation: current ibss generation. Incremented whenever
* ibss New peer joins and departs the network
* @ibss_enc_key_installed: is the ibss wep/wpa-none encryptions key
* installed?
* @ibss_enc_key: current ibss wep/wpa-none encryption key (if
* @ibss_enc_key_installed is %true)
* @ibss_peer_info: information about the ibss peer
* @hdd_reassoc_scenario: is station in the middle of reassociation?
* @sta_debug_state: STA context debug variable
* @broadcast_sta_id: STA ID assigned for broadcast frames
@ -785,10 +778,6 @@ struct hdd_station_ctx {
struct hdd_connection_info conn_info;
struct hdd_connection_info cache_conn_info;
int ft_carrier_on;
int ibss_sta_generation;
bool ibss_enc_key_installed;
tCsrRoamSetKey ibss_enc_key;
tSirPeerInfoRspParams ibss_peer_info;
bool hdd_reassoc_scenario;
int sta_debug_state;
struct hdd_mon_set_ch_info ch_info;
@ -1193,8 +1182,6 @@ struct hdd_adapter {
struct completion sta_authorized_event;
struct completion ibss_peer_info_comp;
/* Track whether the linkup handling is needed */
bool is_link_up_service_needed;
@ -2469,27 +2456,6 @@ struct hdd_adapter *hdd_get_first_valid_adapter(struct hdd_context *hdd_ctx);
void hdd_allow_suspend(uint32_t reason);
void hdd_prevent_suspend_timeout(uint32_t timeout, uint32_t reason);
#ifdef QCA_IBSS_SUPPORT
/**
* hdd_set_ibss_power_save_params() - update IBSS Power Save params to WMA.
* @struct hdd_adapter Hdd adapter.
*
* This function sets the IBSS power save config parameters to WMA
* which will send it to firmware if FW supports IBSS power save
* before vdev start.
*
* Return: QDF_STATUS QDF_STATUS_SUCCESS on Success and QDF_STATUS_E_FAILURE
* on failure.
*/
QDF_STATUS hdd_set_ibss_power_save_params(struct hdd_adapter *adapter);
#else
static inline QDF_STATUS
hdd_set_ibss_power_save_params(struct hdd_adapter *adapter)
{
return QDF_STATUS_SUCCESS;
}
#endif
/**
* wlan_hdd_validate_context() - check the HDD context
* @hdd_ctx: Global HDD context pointer

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2016-2020 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@ -29,7 +29,6 @@ struct hdd_context;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) || defined(WITH_BACKPORTS)
#define IEEE80211_CHAN_PASSIVE_SCAN IEEE80211_CHAN_NO_IR
#define IEEE80211_CHAN_NO_IBSS IEEE80211_CHAN_NO_IR
#endif
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014-2018 The Linux Foundation. All rights reserved.
* Copyright (c) 2014-2018, 2020 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@ -60,8 +60,6 @@
ENUM(TRACE_CODE_HDD_CFG80211_SET_DEFAULT_KEY) \
ENUM(TRACE_CODE_HDD_CFG80211_CONNECT) \
ENUM(TRACE_CODE_HDD_CFG80211_DISCONNECT) \
ENUM(TRACE_CODE_HDD_CFG80211_JOIN_IBSS) \
ENUM(TRACE_CODE_HDD_CFG80211_LEAVE_IBSS) \
ENUM(TRACE_CODE_HDD_CFG80211_SET_WIPHY_PARAMS) \
ENUM(TRACE_CODE_HDD_CFG80211_SET_TXPOWER) \
ENUM(TRACE_CODE_HDD_CFG80211_GET_TXPOWER) \

View file

@ -313,7 +313,7 @@ void hdd_conn_set_connection_state(struct hdd_adapter *adapter,
*
* This function updates the global HDD station context connection state.
*
* Return: true if (Infra Associated or IBSS Connected)
* Return: true if (Infra Associated)
* and sets output parameter pConnState;
* false otherwise
*/
@ -328,8 +328,6 @@ hdd_conn_get_connection_state(struct hdd_station_ctx *sta_ctx,
switch (state) {
case eConnectionState_Associated:
case eConnectionState_IbssConnected:
case eConnectionState_IbssDisconnected:
case eConnectionState_NdiConnected:
return true;
default:
@ -1109,12 +1107,9 @@ hdd_conn_save_connect_info(struct hdd_adapter *adapter,
qdf_copy_macaddr(&sta_ctx->conn_info.bssid,
&roam_info->bssid);
} else if (eCSR_BSS_TYPE_IBSS == bss_type) {
qdf_copy_macaddr(&sta_ctx->conn_info.bssid,
&roam_info->bssid);
} else {
/*
* can't happen. We need a valid IBSS or Infra setting
* can't happen. We need a valid Infra setting
* in the BSSDescription or we can't function.
*/
QDF_ASSERT(0);
@ -1584,15 +1579,6 @@ static void hdd_send_association_event(struct net_device *dev,
if (ucfg_pkt_capture_get_pktcap_mode(hdd_ctx->psoc))
ucfg_pkt_capture_record_channel(adapter->vdev);
} else if (eConnectionState_IbssConnected == /* IBss Associated */
sta_ctx->conn_info.conn_state) {
policy_mgr_update_connection_info(hdd_ctx->psoc,
adapter->vdev_id);
memcpy(wrqu.ap_addr.sa_data, sta_ctx->conn_info.bssid.bytes,
ETH_ALEN);
hdd_debug("%s(vdevid-%d): new IBSS peer connection to BSSID " QDF_MAC_ADDR_STR,
dev->name, adapter->vdev_id,
QDF_MAC_ADDR_ARRAY(sta_ctx->conn_info.bssid.bytes));
} else { /* Not Associated */
hdd_nofl_info("%s(vdevid-%d): disconnected", dev->name,
adapter->vdev_id);
@ -1671,8 +1657,6 @@ static void hdd_conn_remove_connect_info(struct hdd_station_ctx *sta_ctx)
sta_ctx->conn_info.mc_encrypt_type = eCSR_ENCRYPT_TYPE_NONE;
sta_ctx->conn_info.uc_encrypt_type = eCSR_ENCRYPT_TYPE_NONE;
qdf_mem_zero(&sta_ctx->ibss_enc_key, sizeof(tCsrRoamSetKey));
sta_ctx->conn_info.proxy_arp_service = 0;
qdf_mem_zero(&sta_ctx->conn_info.ssid, sizeof(tCsrSSIDInfo));
@ -1886,46 +1870,44 @@ static QDF_STATUS hdd_dis_connect_handler(struct hdd_adapter *adapter,
}
/* indicate disconnected event to nl80211 */
if (roam_status != eCSR_ROAM_IBSS_LEAVE) {
/*
* Only send indication to kernel if not initiated
* by kernel
*/
if (sendDisconInd) {
int reason = WLAN_REASON_UNSPECIFIED;
/*
* Only send indication to kernel if not initiated
* by kernel
*/
if (sendDisconInd) {
int reason = WLAN_REASON_UNSPECIFIED;
if (roam_info && roam_info->disconnect_ies) {
disconnect_ies.data =
roam_info->disconnect_ies->data;
disconnect_ies.len =
roam_info->disconnect_ies->len;
}
/*
* To avoid wpa_supplicant sending "HANGED" CMD
* to ICS UI.
*/
if (roam_info && eCSR_ROAM_LOSTLINK == roam_status) {
reason = roam_info->reasonCode;
if (reason ==
eSIR_MAC_PEER_STA_REQ_LEAVING_BSS_REASON)
pr_info("wlan: disconnected due to poor signal, rssi is %d dB\n",
roam_info->rxRssi);
}
ucfg_mlme_get_discon_reason_n_from_ap(hdd_ctx->psoc,
adapter->vdev_id,
&from_ap,
&reason_code);
wlan_hdd_cfg80211_indicate_disconnect(
adapter, !from_ap,
reason_code,
disconnect_ies.data,
disconnect_ies.len);
if (roam_info && roam_info->disconnect_ies) {
disconnect_ies.data =
roam_info->disconnect_ies->data;
disconnect_ies.len =
roam_info->disconnect_ies->len;
}
/* update P2P connection status */
ucfg_p2p_status_disconnect(adapter->vdev);
/*
* To avoid wpa_supplicant sending "HANGED" CMD
* to ICS UI.
*/
if (roam_info && eCSR_ROAM_LOSTLINK == roam_status) {
reason = roam_info->reasonCode;
if (reason ==
eSIR_MAC_PEER_STA_REQ_LEAVING_BSS_REASON)
pr_info("wlan: disconnected due to poor signal, rssi is %d dB\n",
roam_info->rxRssi);
}
ucfg_mlme_get_discon_reason_n_from_ap(hdd_ctx->psoc,
adapter->vdev_id,
&from_ap,
&reason_code);
wlan_hdd_cfg80211_indicate_disconnect(
adapter, !from_ap,
reason_code,
disconnect_ies.data,
disconnect_ies.len);
}
/* update P2P connection status */
ucfg_p2p_status_disconnect(adapter->vdev);
if (adapter->device_mode == QDF_STA_MODE) {
/* Inform BLM about the disconnection with the AP */
ucfg_blm_update_bssid_connect_params(hdd_ctx->pdev,
@ -1949,15 +1931,13 @@ static QDF_STATUS hdd_dis_connect_handler(struct hdd_adapter *adapter,
SCAN_EVENT_TYPE_MAX, true);
}
/* clear scan cache for Link Lost */
if (roam_status != eCSR_ROAM_IBSS_LEAVE) {
if (eCSR_ROAM_LOSTLINK == roam_status) {
wlan_hdd_cfg80211_unlink_bss(adapter,
sta_ctx->conn_info.bssid.bytes,
sta_ctx->conn_info.ssid.SSID.ssId,
sta_ctx->conn_info.ssid.SSID.length);
sme_remove_bssid_from_scan_list(mac_handle,
sta_ctx->conn_info.bssid.bytes);
}
if (eCSR_ROAM_LOSTLINK == roam_status) {
wlan_hdd_cfg80211_unlink_bss(adapter,
sta_ctx->conn_info.bssid.bytes,
sta_ctx->conn_info.ssid.SSID.ssId,
sta_ctx->conn_info.ssid.SSID.length);
sme_remove_bssid_from_scan_list(mac_handle,
sta_ctx->conn_info.bssid.bytes);
}
/* Clear saved connection information in HDD */
@ -2555,200 +2535,6 @@ bool hdd_is_roam_sync_in_progress(struct csr_roam_info *roaminfo)
}
#endif
#ifdef QCA_IBSS_SUPPORT
/**
* hdd_roam_ibss_indication_handler() - update the status of the IBSS
* @adapter: pointer to adapter
* @roam_info: pointer to roam info
* @roam_id: roam id
* @roam_status: roam status
* @roam_result: roam result
*
* Here we update the status of the Ibss when we receive information that we
* have started/joined an ibss session.
*
* Return: none
*/
static void hdd_roam_ibss_indication_handler(struct hdd_adapter *adapter,
struct csr_roam_info *roam_info,
uint32_t roam_id,
eRoamCmdStatus roam_status,
eCsrRoamResult roam_result)
{
struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
hdd_debug("%s: id %d, status %d, result %d",
adapter->dev->name, roam_id,
roam_status, roam_result);
switch (roam_result) {
/* both IBSS Started and IBSS Join should come in here. */
case eCSR_ROAM_RESULT_IBSS_STARTED:
case eCSR_ROAM_RESULT_IBSS_JOIN_SUCCESS:
case eCSR_ROAM_RESULT_IBSS_COALESCED:
{
if (!roam_info) {
QDF_ASSERT(0);
return;
}
/* When IBSS Started comes from CSR, we need to move
* connection state to IBSS Disconnected (meaning no peers
* are in the IBSS).
*/
hdd_conn_set_connection_state(adapter,
eConnectionState_IbssDisconnected);
/* notify wmm */
hdd_wmm_connect(adapter, roam_info,
eCSR_BSS_TYPE_IBSS);
hdd_roam_register_sta(adapter, roam_info, roam_info->bss_desc);
if (roam_info->bss_desc) {
struct cfg80211_bss *bss;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0))
struct ieee80211_channel *chan;
#endif
/* we created the IBSS, notify supplicant */
hdd_debug("%s: created ibss " QDF_MAC_ADDR_STR,
adapter->dev->name,
QDF_MAC_ADDR_ARRAY(
roam_info->bss_desc->bssId));
/* we must first give cfg80211 the BSS information */
bss = wlan_hdd_cfg80211_update_bss_db(adapter,
roam_info);
if (!bss) {
hdd_err("%s: unable to create IBSS entry",
adapter->dev->name);
return;
}
hdd_debug("Enabling queues");
wlan_hdd_netif_queue_control(adapter,
WLAN_START_ALL_NETIF_QUEUE_N_CARRIER,
WLAN_CONTROL_PATH);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0))
chan = ieee80211_get_channel(
adapter->wdev.wiphy,
roam_info->bss_desc->chan_freq);
if (chan)
cfg80211_ibss_joined(adapter->dev,
bss->bssid, chan,
GFP_KERNEL);
else
hdd_warn("%s: freq: %d, can't find channel",
adapter->dev->name,
roam_info->bss_desc->chan_freq);
#else
cfg80211_ibss_joined(adapter->dev, bss->bssid,
GFP_KERNEL);
#endif
cfg80211_put_bss(
hdd_ctx->wiphy,
bss);
}
if (eCSR_ROAM_RESULT_IBSS_STARTED == roam_result) {
policy_mgr_incr_active_session(hdd_ctx->psoc,
adapter->device_mode, adapter->vdev_id);
hdd_green_ap_start_state_mc(hdd_ctx,
adapter->device_mode, true);
} else if (eCSR_ROAM_RESULT_IBSS_JOIN_SUCCESS == roam_result ||
eCSR_ROAM_RESULT_IBSS_COALESCED == roam_result) {
policy_mgr_update_connection_info(hdd_ctx->psoc,
adapter->vdev_id);
}
break;
}
case eCSR_ROAM_RESULT_IBSS_START_FAILED:
{
hdd_err("%s: unable to create IBSS", adapter->dev->name);
break;
}
default:
hdd_err("%s: unexpected result %d",
adapter->dev->name, (int)roam_result);
break;
}
}
/**
* hdd_is_key_install_required_for_ibss() - check encryption type to identify
* if key installation is required
* @encr_type: encryption type
*
* Return: true if key installation is required and false otherwise.
*/
static inline bool hdd_is_key_install_required_for_ibss(
eCsrEncryptionType encr_type)
{
if (eCSR_ENCRYPT_TYPE_WEP40_STATICKEY == encr_type ||
eCSR_ENCRYPT_TYPE_WEP104_STATICKEY == encr_type ||
eCSR_ENCRYPT_TYPE_TKIP == encr_type ||
eCSR_ENCRYPT_TYPE_AES_GCMP == encr_type ||
eCSR_ENCRYPT_TYPE_AES_GCMP_256 == encr_type ||
eCSR_ENCRYPT_TYPE_AES == encr_type)
return true;
else
return false;
}
#else
/**
* hdd_roam_ibss_indication_handler() - update the status of the IBSS
* @adapter: pointer to adapter
* @roam_info: pointer to roam info
* @roam_id: roam id
* @roam_status: roam status
* @roam_result: roam result
*
* This function is dummy
*
* Return: none
*/
static inline void
hdd_roam_ibss_indication_handler(struct hdd_adapter *adapter,
struct csr_roam_info *roam_info,
uint32_t roam_id,
eRoamCmdStatus roam_status,
eCsrRoamResult roam_result)
{
}
/**
* hdd_get_ibss_peer_sta_id() - get sta id for IBSS peer
* @hddstactx: pointer to HDD sta context
* @roaminfo: pointer to roaminfo structure
*
* This function is dummy
*
* Return: WLAN_MAX_STA_COUNT if peer not found.
*/
static inline uint8_t
hdd_get_ibss_peer_sta_id(struct hdd_station_ctx *hddstactx,
struct csr_roam_info *roaminfo)
{
return WLAN_MAX_STA_COUNT;
}
/**
* hdd_is_key_install_required_for_ibss() - check encryption type to identify
* if key installation is required
* @encr_type: encryption type
*
* This function is dummy
*
* Return: true.
*/
static inline bool
hdd_is_key_install_required_for_ibss(eCsrEncryptionType encr_type)
{
return true;
}
#endif
/**
* hdd_change_sta_state_authenticated()-
* This function changes STA state to authenticated
@ -2776,10 +2562,7 @@ static int hdd_change_sta_state_authenticated(struct hdd_adapter *adapter,
AUTO_PS_ENTRY_TIMER_DEFAULT_VALUE :
(auto_bmps_timer_val * 1000);
if (QDF_IBSS_MODE == adapter->device_mode)
mac_addr = roaminfo->peerMac.bytes;
else
mac_addr = hddstactx->conn_info.bssid.bytes;
mac_addr = hddstactx->conn_info.bssid.bytes;
hdd_debug("Changing Peer state to AUTHENTICATED for Sta = "
QDF_MAC_ADDR_STR, QDF_MAC_ADDR_ARRAY(mac_addr));
@ -2825,19 +2608,6 @@ static void hdd_change_peer_state_after_set_key(struct hdd_adapter *adapter,
WLAN_HDD_GET_STATION_CTX_PTR(adapter);
eCsrEncryptionType encr_type = hdd_sta_ctx->conn_info.uc_encrypt_type;
/*
* If the security mode is one of the following, IBSS peer will be
* waiting in CONN state and we will move the peer state to AUTH
* here. For non-secure connection, no need to wait for set-key complete
* peer will be moved to AUTH in hdd_roam_register_sta.
*/
if (QDF_IBSS_MODE == adapter->device_mode) {
if (hdd_is_key_install_required_for_ibss(encr_type))
hdd_change_sta_state_authenticated(adapter, roaminfo);
return;
}
if (eCSR_ROAM_RESULT_AUTHENTICATED == roam_result) {
hdd_sta_ctx->conn_info.gtk_installed = true;
/*
@ -3809,110 +3579,6 @@ bool hdd_any_valid_peer_present(struct hdd_adapter *adapter)
return false;
}
/**
* roam_remove_ibss_station() - Remove the IBSS peer MAC address in the adapter
* @adapter: pointer to adapter
* @sta_id: station id
*
* Return:
* true if we remove MAX_PEERS or less STA
* false otherwise.
*/
static bool roam_remove_ibss_station(struct hdd_adapter *adapter,
uint8_t *mac_addr)
{
bool successful = false;
int idx = 0;
uint8_t valid_idx = 0;
uint8_t del_idx = 0;
uint8_t empty_slots = 0;
struct hdd_station_ctx *sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
for (idx = 0; idx < MAX_PEERS; idx++) {
if (WLAN_ADDR_EQ(mac_addr,
sta_ctx->conn_info.peer_macaddr[idx].bytes)) {
qdf_zero_macaddr(&sta_ctx->conn_info.peer_macaddr[idx]);
successful = true;
/*
* Note the deleted Index, if its 0 we need special
* handling.
*/
del_idx = idx;
empty_slots++;
} else {
if (hdd_is_valid_mac_address(
sta_ctx->conn_info.peer_macaddr[idx].bytes))
valid_idx = idx;
else
empty_slots++;
}
}
if (MAX_PEERS == empty_slots) {
/* Last peer departed, set the IBSS state appropriately */
hdd_conn_set_connection_state(adapter,
eConnectionState_IbssDisconnected);
hdd_debug("Last IBSS Peer Departed!!!");
}
/* Find next active sta_id, to have a valid sta trigger for TL. */
if (successful) {
if (del_idx == 0) {
if (hdd_is_valid_mac_address(
sta_ctx->conn_info.peer_macaddr[valid_idx].bytes)) {
qdf_copy_macaddr(&sta_ctx->conn_info.
peer_macaddr[0],
&sta_ctx->conn_info.
peer_macaddr[valid_idx]);
qdf_zero_macaddr(&sta_ctx->conn_info.
peer_macaddr[valid_idx]);
}
}
}
return successful;
}
/**
* roam_ibss_connect_handler() - IBSS connection handler
* @adapter: pointer to adapter
* @roam_info: pointer to roam info
*
* We update the status of the IBSS to connected in this function.
*
* Return: QDF_STATUS enumeration
*/
static QDF_STATUS roam_ibss_connect_handler(struct hdd_adapter *adapter,
struct csr_roam_info *roam_info)
{
struct cfg80211_bss *bss;
/*
* Set the internal connection state to show 'IBSS Connected' (IBSS with
* a partner stations).
*/
hdd_conn_set_connection_state(adapter, eConnectionState_IbssConnected);
/* Save the connection info from CSR... */
hdd_conn_save_connect_info(adapter, roam_info, eCSR_BSS_TYPE_IBSS);
/* Send the bssid address to the wext. */
hdd_send_association_event(adapter->dev, roam_info);
/* add bss_id to cfg80211 data base */
bss = wlan_hdd_cfg80211_update_bss_db(adapter, roam_info);
if (!bss) {
hdd_err("%s: unable to create IBSS entry",
adapter->dev->name);
return QDF_STATUS_E_FAILURE;
}
cfg80211_put_bss(
WLAN_HDD_GET_CTX(adapter)->wiphy,
bss);
return QDF_STATUS_SUCCESS;
}
/**
* hdd_roam_mic_error_indication_handler() - MIC error indication handler
* @adapter: pointer to adapter
@ -3946,175 +3612,6 @@ hdd_roam_mic_error_indication_handler(struct hdd_adapter *adapter,
GFP_KERNEL);
}
static QDF_STATUS wlan_hdd_set_key_helper(struct hdd_adapter *adapter,
uint32_t *roam_id)
{
int ret;
struct wlan_objmgr_vdev *vdev;
vdev = hdd_objmgr_get_vdev(adapter);
if (!vdev)
return QDF_STATUS_E_FAILURE;
ret = wlan_cfg80211_crypto_add_key(vdev,
WLAN_CRYPTO_KEY_TYPE_UNICAST, 0);
hdd_objmgr_put_vdev(vdev);
if (ret != 0) {
hdd_err("crypto add key fail, status: %d", ret);
return QDF_STATUS_E_FAILURE;
}
return QDF_STATUS_SUCCESS;
}
/**
* roam_roam_connect_status_update_handler() - IBSS connect status update
* @adapter: pointer to adapter
* @roam_info: pointer to roam info
* @roam_id: roam id
* @roam_status: roam status
* @roam_result: roam result
*
* The Ibss connection status is updated regularly here in this function.
*
* Return: QDF_STATUS enumeration
*/
static QDF_STATUS
roam_roam_connect_status_update_handler(struct hdd_adapter *adapter,
struct csr_roam_info *roam_info,
uint32_t roam_id,
eRoamCmdStatus roam_status,
eCsrRoamResult roam_result)
{
struct wlan_objmgr_vdev *vdev;
QDF_STATUS qdf_status;
switch (roam_result) {
case eCSR_ROAM_RESULT_IBSS_NEW_PEER:
{
struct hdd_station_ctx *sta_ctx =
WLAN_HDD_GET_STATION_CTX_PTR(adapter);
struct station_info *stainfo;
eCsrEncryptionType encr_type = sta_ctx->ibss_enc_key.encType;
hdd_debug("IBSS New Peer indication from SME "
"with peerMac " QDF_MAC_ADDR_STR " BSSID: "
QDF_MAC_ADDR_STR " and stationID= %d",
QDF_MAC_ADDR_ARRAY(roam_info->peerMac.bytes),
QDF_MAC_ADDR_ARRAY(sta_ctx->conn_info.bssid.bytes),
roam_info->staId);
if (!hdd_save_peer
(WLAN_HDD_GET_STATION_CTX_PTR(adapter),
&roam_info->peerMac)) {
hdd_warn("Max reached: Can't register new IBSS peer");
break;
}
if (hdd_is_key_install_required_for_ibss(encr_type))
roam_info->fAuthRequired = true;
/* Register the Station with datapath for the new peer. */
qdf_status = hdd_roam_register_sta(adapter,
roam_info,
roam_info->bss_desc);
if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
hdd_err("Cannot register STA for IBSS. qdf_status: %d [%08X]",
qdf_status, qdf_status);
}
sta_ctx->ibss_sta_generation++;
stainfo = qdf_mem_malloc(sizeof(*stainfo));
if (!stainfo)
return QDF_STATUS_E_NOMEM;
stainfo->filled = 0;
stainfo->generation = sta_ctx->ibss_sta_generation;
cfg80211_new_sta(adapter->dev,
(const u8 *)roam_info->peerMac.bytes,
stainfo, GFP_KERNEL);
qdf_mem_free(stainfo);
if (hdd_is_key_install_required_for_ibss(encr_type)) {
sta_ctx->ibss_enc_key.keyDirection =
eSIR_TX_RX;
qdf_copy_macaddr(&sta_ctx->ibss_enc_key.peerMac,
&roam_info->peerMac);
vdev = hdd_objmgr_get_vdev(adapter);
if (!vdev)
return QDF_STATUS_E_FAILURE;
wlan_crypto_update_set_key_peer(vdev, true, 0,
&roam_info->peerMac);
hdd_objmgr_put_vdev(vdev);
hdd_debug("New peer joined set PTK encType=%d",
encr_type);
qdf_status = wlan_hdd_set_key_helper(adapter, &roam_id);
if (QDF_STATUS_SUCCESS != qdf_status) {
hdd_err("sme set_key fail status: %d",
qdf_status);
return QDF_STATUS_E_FAILURE;
}
}
hdd_debug("Enabling queues");
wlan_hdd_netif_queue_control(adapter,
WLAN_START_ALL_NETIF_QUEUE_N_CARRIER,
WLAN_CONTROL_PATH);
break;
}
case eCSR_ROAM_RESULT_IBSS_CONNECT:
{
roam_ibss_connect_handler(adapter, roam_info);
break;
}
case eCSR_ROAM_RESULT_IBSS_PEER_DEPARTED:
{
struct hdd_station_ctx *sta_ctx =
WLAN_HDD_GET_STATION_CTX_PTR(adapter);
if (!roam_remove_ibss_station(adapter,
roam_info->peerMac.bytes))
hdd_warn("IBSS peer departed by cannot find peer in our registration table with TL");
hdd_debug("IBSS Peer Departed from SME "
"with peerMac " QDF_MAC_ADDR_STR " BSSID: "
QDF_MAC_ADDR_STR " and stationID= %d",
QDF_MAC_ADDR_ARRAY(roam_info->peerMac.bytes),
QDF_MAC_ADDR_ARRAY(sta_ctx->conn_info.bssid.bytes),
roam_info->staId);
sta_ctx->ibss_sta_generation++;
cfg80211_del_sta(adapter->dev,
(const u8 *)&roam_info->peerMac.bytes,
GFP_KERNEL);
break;
}
case eCSR_ROAM_RESULT_IBSS_INACTIVE:
{
hdd_debug("Received eCSR_ROAM_RESULT_IBSS_INACTIVE from SME");
/* Stop only when we are inactive */
hdd_debug("Disabling queues");
wlan_hdd_netif_queue_control(adapter,
WLAN_STOP_ALL_NETIF_QUEUE_N_CARRIER,
WLAN_CONTROL_PATH);
hdd_conn_set_connection_state(adapter,
eConnectionState_NotConnected);
/* Send the bssid address to the wext. */
hdd_send_association_event(adapter->dev, roam_info);
break;
}
default:
break;
}
return QDF_STATUS_SUCCESS;
}
#ifdef FEATURE_WLAN_TDLS
QDF_STATUS hdd_roam_register_tdlssta(struct hdd_adapter *adapter,
const uint8_t *peerMac, uint8_t qos)
@ -4841,12 +4338,6 @@ hdd_sme_roam_callback(void *context, struct csr_roam_info *roam_info,
roam_status, roam_result);
}
break;
case eCSR_ROAM_IBSS_LEAVE:
hdd_debug("****eCSR_ROAM_IBSS_LEAVE****");
qdf_ret_status =
hdd_dis_connect_handler(adapter, roam_info, roam_id,
roam_status, roam_result);
break;
case eCSR_ROAM_ASSOCIATION_COMPLETION:
hdd_debug("****eCSR_ROAM_ASSOCIATION_COMPLETION****");
/*
@ -4877,20 +4368,6 @@ hdd_sme_roam_callback(void *context, struct csr_roam_info *roam_info,
roam_status,
roam_result);
break;
case eCSR_ROAM_IBSS_IND:
hdd_roam_ibss_indication_handler(adapter, roam_info, roam_id,
roam_status, roam_result);
break;
case eCSR_ROAM_CONNECT_STATUS_UPDATE:
qdf_ret_status =
roam_roam_connect_status_update_handler(adapter,
roam_info,
roam_id,
roam_status,
roam_result);
break;
case eCSR_ROAM_MIC_ERROR_IND:
hdd_roam_mic_error_indication_handler(adapter, roam_info);
break;
@ -5618,24 +5095,6 @@ int hdd_set_genie_to_csr(struct hdd_adapter *adapter,
roam_profile->mcEncryptionType.encryptionType[0] =
mc_rsn_encrypt_type;
if ((QDF_IBSS_MODE == adapter->device_mode) &&
((eCSR_ENCRYPT_TYPE_AES == mc_rsn_encrypt_type) ||
(eCSR_ENCRYPT_TYPE_AES_GCMP == mc_rsn_encrypt_type) ||
(eCSR_ENCRYPT_TYPE_AES_GCMP_256 == mc_rsn_encrypt_type) ||
(eCSR_ENCRYPT_TYPE_TKIP == mc_rsn_encrypt_type))) {
/*
* For wpa none supplicant sends the WPA IE with unicast
* cipher as eCSR_ENCRYPT_TYPE_NONE ,where as the
* multicast cipher as either AES/TKIP based on group
* cipher configuration mentioned in the
* wpa_supplicant.conf.
*/
/* Set the unicast cipher same as multicast cipher */
roam_profile->EncryptionType.encryptionType[0]
= mc_rsn_encrypt_type;
}
hdd_update_values_mfp_cap(roam_profile, mfp_required,
mfp_capable);
}

View file

@ -169,13 +169,6 @@
*/
#define MAX_REMAIN_ON_CHANNEL_DURATION (5000)
/*
* Refer @tCfgProtection structure for definition of the bit map.
* below value is obtained by setting the following bit-fields.
* enable obss, fromllb, overlapOBSS and overlapFromllb protection.
*/
#define IBSS_CFG_PROTECTION_ENABLE_MASK 0x8282
#define HDD2GHZCHAN(freq, chan, flag) { \
.band = HDD_NL80211_BAND_2GHZ, \
.center_freq = (freq), \
@ -543,19 +536,6 @@ static const struct ieee80211_iface_limit
},
};
/* ADHOC (IBSS) limit */
static const struct ieee80211_iface_limit
wlan_hdd_adhoc_iface_limit[] = {
{
.max = 1,
.types = BIT(NL80211_IFTYPE_STATION),
},
{
.max = 1,
.types = BIT(NL80211_IFTYPE_ADHOC),
},
};
/* AP ( + AP ) combination */
static const struct ieee80211_iface_limit
wlan_hdd_ap_iface_limit[] = {
@ -684,13 +664,6 @@ static struct ieee80211_iface_combination
.max_interfaces = 3,
.n_limits = ARRAY_SIZE(wlan_hdd_sta_iface_limit),
},
/* ADHOC */
{
.limits = wlan_hdd_adhoc_iface_limit,
.num_different_channels = 2,
.max_interfaces = 2,
.n_limits = ARRAY_SIZE(wlan_hdd_adhoc_iface_limit),
},
/* AP */
{
.limits = wlan_hdd_ap_iface_limit,
@ -9964,11 +9937,6 @@ __wlan_hdd_cfg80211_set_ns_offload(struct wiphy *wiphy,
hdd_ctx->ns_offload_enable =
nla_get_u8(tb[QCA_WLAN_VENDOR_ATTR_ND_OFFLOAD_FLAG]);
if (QDF_IBSS_MODE == adapter->device_mode) {
hdd_debug("NS Offload is not supported in IBSS mode");
return -EINVAL;
}
/* update ns offload in case it is already enabled/disabled */
if (hdd_ctx->ns_offload_enable)
hdd_enable_ns_offload(adapter, pmo_ns_offload_dynamic_update);
@ -14894,12 +14862,6 @@ int wlan_hdd_cfg80211_init(struct device *dev,
| WIPHY_FLAG_TDLS_EXTERNAL_SETUP;
#endif
wiphy->features |= NL80211_FEATURE_HT_IBSS;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_VHT_IBSS);
#endif
wlan_hdd_cfg80211_set_wiphy_scan_flags(wiphy);
wlan_scan_cfg80211_add_connected_pno_support(wiphy);
@ -14911,7 +14873,6 @@ int wlan_hdd_cfg80211_init(struct device *dev,
wiphy->max_acl_mac_addrs = MAX_ACL_MAC_ADDRESS;
wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION)
| BIT(NL80211_IFTYPE_ADHOC)
| BIT(NL80211_IFTYPE_P2P_CLIENT)
| BIT(NL80211_IFTYPE_P2P_GO)
| BIT(NL80211_IFTYPE_AP)
@ -15409,10 +15370,13 @@ QDF_STATUS wlan_hdd_update_wiphy_supported_band(struct hdd_context *hdd_ctx)
/* In this function we are registering wiphy. */
int wlan_hdd_cfg80211_register(struct wiphy *wiphy)
{
int ret;
hdd_enter();
ret = wiphy_register(wiphy);
/* Register our wiphy dev with cfg80211 */
if (0 > wiphy_register(wiphy)) {
hdd_err("wiphy register failed");
if (ret < 0) {
hdd_err("wiphy register failed %d", ret);
return -EIO;
}
@ -15729,7 +15693,6 @@ static int hdd_change_adapter_mode(struct hdd_adapter *adapter,
{
struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
struct net_device *netdev = adapter->dev;
struct hdd_config *config = hdd_ctx->config;
struct csr_roam_profile *roam_profile;
QDF_STATUS status = QDF_STATUS_SUCCESS;
@ -15745,13 +15708,6 @@ static int hdd_change_adapter_mode(struct hdd_adapter *adapter,
roam_profile->pAddIEScan = adapter->scan_info.scan_add_ie.addIEdata;
roam_profile->nAddIEScanLength = adapter->scan_info.scan_add_ie.length;
if (new_mode == QDF_IBSS_MODE) {
status = hdd_start_station_adapter(adapter);
roam_profile->BSSType = eCSR_BSS_TYPE_START_IBSS;
roam_profile->phyMode =
hdd_cfg_xlate_to_csr_phy_mode(config->dot11Mode);
}
hdd_exit();
return qdf_status_to_os_return(status);
@ -15781,7 +15737,6 @@ static bool hdd_is_client_mode(enum QDF_OPMODE mode)
case QDF_STA_MODE:
case QDF_P2P_CLIENT_MODE:
case QDF_P2P_DEVICE_MODE:
case QDF_IBSS_MODE:
return true;
default:
return false;
@ -15871,11 +15826,6 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy,
if (hdd_is_client_mode(adapter->device_mode)) {
if (hdd_is_client_mode(new_mode)) {
if (new_mode == QDF_IBSS_MODE) {
hdd_deregister_hl_netdev_fc_timer(adapter);
hdd_deregister_tx_flow_control(adapter);
}
errno = hdd_change_adapter_mode(adapter, new_mode);
if (errno) {
hdd_err("change intf mode fail %d", errno);
@ -16246,81 +16196,6 @@ static bool hdd_is_btk_enc_type(uint32_t cipher_type)
}
#endif
#ifdef QCA_IBSS_SUPPORT
/**
* wlan_hdd_add_key_ibss() - API to add IBSS key
* @adapter: Pointer to adapter
* @pairwise: need to add key pairwise
* @key_index: key index
* @mac_addr: Pointer to mac_addr
* @params: Pointer to key params
* @key_already_installed: pointer to key already installed state
*
* This API will add IBSS key for given mac address.
*
* Return: 0 for success, error number on failure.
*/
static int wlan_hdd_add_key_ibss(struct hdd_adapter *adapter,
bool pairwise, u8 key_index,
const u8 *mac_addr, struct key_params *params,
bool *key_already_installed)
{
struct wlan_objmgr_vdev *vdev;
int errno;
if (pairwise)
return 0;
/* if a key is already installed, block all subsequent ones */
if (adapter->session.station.ibss_enc_key_installed) {
hdd_debug("IBSS key installed already");
*key_already_installed = true;
return 0;
}
/*Set the group key */
vdev = hdd_objmgr_get_vdev(adapter);
if (!vdev)
return -EINVAL;
errno = wlan_cfg80211_crypto_add_key(vdev, WLAN_CRYPTO_KEY_TYPE_GROUP,
key_index);
if (errno) {
hdd_err("add_ibss_key failed, errno: %d", errno);
hdd_objmgr_put_vdev(vdev);
return errno;
}
/* Save the keys here and call set_key for setting
* the PTK after peer joins the IBSS network
*/
wlan_cfg80211_store_key(vdev, key_index, WLAN_CRYPTO_KEY_TYPE_UNICAST,
mac_addr, params);
hdd_objmgr_put_vdev(vdev);
adapter->session.station.ibss_enc_key_installed = 1;
return 0;
}
#else
/**
* wlan_hdd_add_key_ibss() - API to add IBSS key
* @adapter: Pointer to adapter
* @pairwise: need to add key pairwise
* @key_index: key index
* @mac_addr: Pointer to mac_addr
* @params: Pointer to key params
* @key_already_installed: pointer to key already installed state
*
* This function is dummy
*
* Return: 0
*/
static inline int
wlan_hdd_add_key_ibss(struct hdd_adapter *adapter,
bool pairwise, u8 key_index,
const u8 *mac_addr, struct key_params *params,
bool *key_already_installed)
{
return 0;
}
#endif
static int wlan_hdd_add_key_sap(struct hdd_adapter *adapter,
bool pairwise, u8 key_index,
enum wlan_crypto_cipher_type cipher)
@ -16391,7 +16266,7 @@ static int __wlan_hdd_cfg80211_add_key(struct wiphy *wiphy,
mac_handle_t mac_handle;
struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(ndev);
struct wlan_objmgr_vdev *vdev;
bool key_already_installed = false, ft_mode = false;
bool ft_mode = false;
enum wlan_crypto_cipher_type cipher;
int errno;
struct qdf_mac_addr mac_address;
@ -16453,13 +16328,6 @@ static int __wlan_hdd_cfg80211_add_key(struct wiphy *wiphy,
wma_set_peer_ucast_cipher(mac_address.bytes, cipher);
switch (adapter->device_mode) {
case QDF_IBSS_MODE:
errno = wlan_hdd_add_key_ibss(adapter, pairwise, key_index,
mac_addr, params,
&key_already_installed);
if (key_already_installed)
return 0;
break;
case QDF_SAP_MODE:
case QDF_P2P_GO_MODE:
errno = wlan_hdd_add_key_sap(adapter, pairwise,
@ -17631,32 +17499,6 @@ static int wlan_hdd_cfg80211_connect_start(struct hdd_adapter *adapter,
roam_profile->ChannelInfo.freq_list = NULL;
roam_profile->ChannelInfo.numOfChannels = 0;
}
if (QDF_IBSS_MODE == adapter->device_mode && oper_freq) {
/*
* Need to post the IBSS power save parameters
* to WMA. WMA will configure this parameters
* to firmware if power save is enabled by the
* firmware.
*/
qdf_status = hdd_set_ibss_power_save_params(adapter);
if (QDF_STATUS_SUCCESS != qdf_status) {
hdd_err("Set IBSS Power Save Params Failed");
status = -EINVAL;
goto conn_failure;
}
roam_profile->ch_params.ch_width =
hdd_map_nl_chan_width(ch_width);
/*
* In IBSS mode while operating in 2.4 GHz,
* the device supports only 20 MHz.
*/
if (WLAN_REG_IS_24GHZ_CH_FREQ(oper_freq))
roam_profile->ch_params.ch_width =
CH_WIDTH_20MHZ;
hdd_select_cbmode(adapter, oper_freq,
&roam_profile->ch_params);
}
if (wlan_hdd_cfg80211_check_pmf_valid(roam_profile)) {
status = -EINVAL;
@ -18899,521 +18741,6 @@ static int wlan_hdd_cfg80211_set_ie(struct hdd_adapter *adapter,
return 0;
}
#ifdef QCA_IBSS_SUPPORT
/**
* hdd_is_wpaie_present() - check for WPA ie
* @ie: Pointer to ie
* @ie_len: Ie length
*
* Parse the received IE to find the WPA IE
*
* Return: true if wpa ie is found else false
*/
static bool hdd_is_wpaie_present(const uint8_t *ie, uint8_t ie_len)
{
uint8_t eLen = 0;
uint16_t remLen = ie_len;
uint8_t elementId = 0;
while (remLen >= 2) {
elementId = *ie++;
eLen = *ie++;
remLen -= 2;
if (eLen > remLen) {
hdd_err("Invalid IE length: %d", eLen);
return false;
}
if ((elementId == DOT11F_EID_WPA) && (remLen > 5)) {
/* OUI - 0x00 0X50 0XF2
* WPA Information Element - 0x01
* WPA version - 0x01
*/
if (0 == memcmp(&ie[0], "\x00\x50\xf2\x01\x01", 5))
return true;
}
ie += eLen;
remLen -= eLen;
}
return false;
}
/**
* wlan_hdd_cfg80211_set_privacy_ibss() - set ibss privacy
* @adapter: Pointer to adapter
* @param: Pointer to IBSS parameters
*
* This function is used to initialize the security settings in IBSS mode
*
* Return: 0 for success, non-zero for failure
*/
static int wlan_hdd_cfg80211_set_privacy_ibss(struct hdd_adapter *adapter,
struct cfg80211_ibss_params
*params)
{
uint32_t ret;
int status = 0;
eCsrEncryptionType encryptionType = eCSR_ENCRYPT_TYPE_NONE;
struct hdd_station_ctx *sta_ctx =
WLAN_HDD_GET_STATION_CTX_PTR(adapter);
struct csr_roam_profile *roam_profile;
hdd_enter();
sta_ctx->wpa_versions = 0;
qdf_mem_zero(&sta_ctx->ibss_enc_key, sizeof(tCsrRoamSetKey));
sta_ctx->ibss_enc_key_installed = 0;
if (params->ie_len && (params->ie)) {
if (wlan_get_ie_ptr_from_eid(WLAN_EID_RSN, params->ie,
params->ie_len)) {
sta_ctx->wpa_versions = NL80211_WPA_VERSION_2;
encryptionType = eCSR_ENCRYPT_TYPE_AES;
} else if (hdd_is_wpaie_present(params->ie, params->ie_len)) {
tDot11fIEWPA dot11_wpa_ie;
mac_handle_t mac_handle =
hdd_adapter_get_mac_handle(adapter);
const u8 *ie;
memset(&dot11_wpa_ie, 0, sizeof(dot11_wpa_ie));
ie = wlan_get_ie_ptr_from_eid(DOT11F_EID_WPA,
params->ie, params->ie_len);
if (ie) {
sta_ctx->wpa_versions = NL80211_WPA_VERSION_1;
/* Unpack the WPA IE
* Skip past the EID byte and length byte
* and four byte WiFi OUI
*/
if (ie[1] < DOT11F_IE_WPA_MIN_LEN ||
ie[1] > DOT11F_IE_WPA_MAX_LEN) {
hdd_err("invalid ie len:%d", ie[1]);
return -EINVAL;
}
ret = dot11f_unpack_ie_wpa(
MAC_CONTEXT(mac_handle),
(uint8_t *)&ie[2 + 4],
ie[1] - 4, &dot11_wpa_ie, false);
if (DOT11F_FAILED(ret)) {
hdd_err("unpack failed ret: 0x%x", ret);
return -EINVAL;
}
/*
* Extract the multicast cipher, the
* encType for unicast cipher for
* wpa-none is none
*/
encryptionType =
hdd_translate_wpa_to_csr_encryption_type
(dot11_wpa_ie.multicast_cipher);
}
}
status =
wlan_hdd_cfg80211_set_ie(adapter, params->ie,
params->ie_len);
if (0 > status) {
hdd_err("Failed to parse WPA/RSN IE");
return status;
}
}
roam_profile = hdd_roam_profile(adapter);
roam_profile->AuthType.authType[0] =
sta_ctx->conn_info.auth_type = eCSR_AUTH_TYPE_OPEN_SYSTEM;
if (params->privacy) {
/* Security enabled IBSS, At this time there is no information
* available about the security parameters, so initialise the
* encryption type to eCSR_ENCRYPT_TYPE_WEP40_STATICKEY.
* The correct security parameters will be updated later in
* wlan_hdd_cfg80211_add_key Hal expects encryption type to be
* set inorder enable privacy bit in beacons
*/
encryptionType = eCSR_ENCRYPT_TYPE_WEP40_STATICKEY;
}
hdd_debug("encryptionType=%d", encryptionType);
sta_ctx->conn_info.uc_encrypt_type = encryptionType;
roam_profile->EncryptionType.numEntries = 1;
roam_profile->EncryptionType.encryptionType[0] =
encryptionType;
return status;
}
/**
* __wlan_hdd_cfg80211_join_ibss() - join ibss
* @wiphy: Pointer to wiphy
* @dev: Pointer to network device
* @param: Pointer to IBSS join parameters
*
* This function is used to create/join an IBSS network
*
* Return: 0 for success, non-zero for failure
*/
static int __wlan_hdd_cfg80211_join_ibss(struct wiphy *wiphy,
struct net_device *dev,
struct cfg80211_ibss_params *params)
{
struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
struct csr_roam_profile *roam_profile;
int status;
struct hdd_station_ctx *sta_ctx =
WLAN_HDD_GET_STATION_CTX_PTR(adapter);
struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
struct qdf_mac_addr bssid;
uint8_t channelNum = 0;
mac_handle_t mac_handle;
struct wlan_mlme_ibss_cfg ibss_cfg = {0};
uint8_t conn_info_channel;
hdd_enter();
if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
hdd_err("Command not allowed in FTM mode");
return -EINVAL;
}
if (wlan_hdd_validate_vdev_id(adapter->vdev_id))
return -EINVAL;
qdf_mtrace(QDF_MODULE_ID_HDD, QDF_MODULE_ID_HDD,
TRACE_CODE_HDD_CFG80211_JOIN_IBSS,
adapter->vdev_id, adapter->device_mode);
hdd_debug("Device_mode %s(%d)",
qdf_opmode_str(adapter->device_mode), adapter->device_mode);
status = wlan_hdd_validate_context(hdd_ctx);
if (0 != status)
return status;
if (QDF_IS_STATUS_ERROR(ucfg_mlme_get_ibss_cfg(hdd_ctx->psoc,
&ibss_cfg))) {
return -EINVAL;
}
mac_handle = hdd_ctx->mac_handle;
if (NULL !=
params->chandef.chan) {
uint32_t numChans = CFG_VALID_CHANNEL_LIST_LEN;
uint32_t validChan[CFG_VALID_CHANNEL_LIST_LEN];
int indx;
/* Get channel number */
channelNum = ieee80211_frequency_to_channel(
params->
chandef.
chan->
center_freq);
ucfg_mlme_get_valid_channel_freq_list(hdd_ctx->psoc, validChan,
&numChans);
for (indx = 0; indx < numChans; indx++) {
if (channelNum ==
wlan_reg_freq_to_chan(hdd_ctx->pdev, validChan[indx]))
break;
}
if (indx >= numChans) {
hdd_err("Not valid Channel: %d", channelNum);
return -EINVAL;
}
}
/* Disable NAN Discovery if enabled */
ucfg_nan_disable_concurrency(hdd_ctx->psoc);
if (!policy_mgr_allow_concurrency(
hdd_ctx->psoc, PM_IBSS_MODE,
wlan_reg_chan_to_freq(hdd_ctx->pdev, channelNum),
HW_MODE_20_MHZ)) {
hdd_err("This concurrency combination is not allowed");
return -ECONNREFUSED;
}
status = policy_mgr_reset_connection_update(hdd_ctx->psoc);
if (!QDF_IS_STATUS_SUCCESS(status))
hdd_err("qdf_reset_connection_update failed status: %d", status);
status = policy_mgr_current_connections_update(
hdd_ctx->psoc, adapter->vdev_id,
wlan_reg_chan_to_freq(hdd_ctx->pdev, channelNum),
POLICY_MGR_UPDATE_REASON_JOIN_IBSS);
if (QDF_STATUS_E_FAILURE == status) {
hdd_err("connections update failed!!");
return -EINVAL;
}
if (QDF_STATUS_SUCCESS == status) {
status = policy_mgr_wait_for_connection_update(
hdd_ctx->psoc);
if (!QDF_IS_STATUS_SUCCESS(status)) {
hdd_err("qdf wait for event failed!!");
return -EINVAL;
}
}
/*Try disconnecting if already in connected state */
status = wlan_hdd_try_disconnect(adapter,
eSIR_MAC_UNSPEC_FAILURE_REASON);
if (0 > status) {
hdd_err("Failed to disconnect the existing IBSS connection");
return -EALREADY;
}
roam_profile = hdd_roam_profile(adapter);
if (eCSR_BSS_TYPE_START_IBSS != roam_profile->BSSType) {
hdd_err("Interface type is not set to IBSS");
return -EINVAL;
}
/* enable selected protection checks in IBSS mode */
roam_profile->cfg_protection = IBSS_CFG_PROTECTION_ENABLE_MASK;
/* BSSID is provided by upper layers hence no need to AUTO generate */
if (params->bssid) {
if (ucfg_mlme_set_ibss_auto_bssid(hdd_ctx->psoc, 0)
== QDF_STATUS_E_FAILURE) {
hdd_err("Unable to update MLME IBSS Auto BSSID config");
return -EIO;
}
qdf_mem_copy(bssid.bytes, params->bssid, QDF_MAC_ADDR_SIZE);
} else if (ibss_cfg.coalesing_enable == 0) {
if (ucfg_mlme_set_ibss_auto_bssid(hdd_ctx->psoc, 0)
== QDF_STATUS_E_FAILURE) {
hdd_err("Unable to update MLME IBSS Auto BSSID config");
return -EIO;
}
qdf_copy_macaddr(&bssid, &ibss_cfg.bssid);
}
if (cfg_in_range(CFG_BEACON_INTERVAL, params->beacon_interval))
roam_profile->beaconInterval = params->beacon_interval;
else
roam_profile->beaconInterval = cfg_get(hdd_ctx->psoc,
CFG_BEACON_INTERVAL);
/* Set Channel */
if (channelNum) {
/* Set the Operational Channel */
hdd_debug("set channel %d", channelNum);
roam_profile->ChannelInfo.numOfChannels = 1;
sta_ctx->conn_info.chan_freq =
wlan_reg_chan_to_freq(hdd_ctx->pdev,
channelNum);
roam_profile->ChannelInfo.freq_list =
&sta_ctx->conn_info.chan_freq;
}
/* Initialize security parameters */
status = wlan_hdd_cfg80211_set_privacy_ibss(adapter, params);
if (status < 0) {
hdd_err("failed to set security parameters");
return status;
}
conn_info_channel =
wlan_reg_freq_to_chan(
hdd_ctx->pdev,
sta_ctx->conn_info.chan_freq);
/* Issue connect start */
status = wlan_hdd_cfg80211_connect_start(adapter, params->ssid,
params->ssid_len,
bssid.bytes, NULL,
conn_info_channel,
params->chandef.width);
if (0 > status) {
hdd_err("connect failed");
return status;
}
hdd_exit();
return 0;
}
/**
* wlan_hdd_cfg80211_join_ibss() - join ibss
* @wiphy: Pointer to wiphy
* @dev: Pointer to network device
* @param: Pointer to IBSS join parameters
*
* This function is used to create/join an IBSS network
*
* Return: 0 for success, non-zero for failure
*/
static int wlan_hdd_cfg80211_join_ibss(struct wiphy *wiphy,
struct net_device *dev,
struct cfg80211_ibss_params *params)
{
int errno;
struct osif_vdev_sync *vdev_sync;
errno = osif_vdev_sync_op_start(dev, &vdev_sync);
if (errno)
return errno;
errno = __wlan_hdd_cfg80211_join_ibss(wiphy, dev, params);
osif_vdev_sync_op_stop(vdev_sync);
return errno;
}
/**
* __wlan_hdd_cfg80211_leave_ibss() - leave ibss
* @wiphy: Pointer to wiphy
* @dev: Pointer to network device
*
* This function is used to leave an IBSS network
*
* Return: 0 for success, non-zero for failure
*/
static int __wlan_hdd_cfg80211_leave_ibss(struct wiphy *wiphy,
struct net_device *dev)
{
struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
struct csr_roam_profile *roam_profile;
struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
int status;
mac_handle_t mac_handle;
unsigned long rc;
tSirUpdateIE update_ie;
hdd_enter();
if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
hdd_err("Command not allowed in FTM mode");
return -EINVAL;
}
if (wlan_hdd_validate_vdev_id(adapter->vdev_id))
return -EINVAL;
qdf_mtrace(QDF_MODULE_ID_HDD, QDF_MODULE_ID_HDD,
TRACE_CODE_HDD_CFG80211_LEAVE_IBSS,
adapter->vdev_id, eCSR_DISCONNECT_REASON_IBSS_LEAVE);
status = wlan_hdd_validate_context(hdd_ctx);
if (0 != status)
return status;
hdd_debug("Device_mode %s(%d)",
qdf_opmode_str(adapter->device_mode), adapter->device_mode);
roam_profile = hdd_roam_profile(adapter);
/* Issue disconnect only if interface type is set to IBSS */
if (eCSR_BSS_TYPE_START_IBSS != roam_profile->BSSType) {
hdd_err("BSS Type is not set to IBSS");
return -EINVAL;
}
/* Clearing add IE of beacon */
qdf_mem_copy(update_ie.bssid.bytes, adapter->mac_addr.bytes,
sizeof(tSirMacAddr));
update_ie.vdev_id = adapter->vdev_id;
update_ie.ieBufferlength = 0;
update_ie.pAdditionIEBuffer = NULL;
update_ie.append = true;
update_ie.notify = true;
mac_handle = hdd_ctx->mac_handle;
if (sme_update_add_ie(mac_handle,
&update_ie,
eUPDATE_IE_PROBE_BCN) == QDF_STATUS_E_FAILURE) {
hdd_err("Could not pass on PROBE_RSP_BCN data to PE");
}
/* Reset WNI_CFG_PROBE_RSP Flags */
wlan_hdd_reset_prob_rspies(adapter);
/* Issue Disconnect request */
INIT_COMPLETION(adapter->disconnect_comp_var);
status = sme_roam_disconnect(mac_handle,
adapter->vdev_id,
eCSR_DISCONNECT_REASON_IBSS_LEAVE,
eSIR_MAC_UNSPEC_FAILURE_REASON);
if (!QDF_IS_STATUS_SUCCESS(status)) {
hdd_err("sme_roam_disconnect failed status: %d",
status);
return -EAGAIN;
}
/* wait for mc thread to cleanup and then return to upper stack
* so by the time upper layer calls the change interface, we are
* all set to proceed further
*/
rc = wait_for_completion_timeout(&adapter->disconnect_comp_var,
msecs_to_jiffies(SME_DISCONNECT_TIMEOUT));
if (!rc) {
hdd_err("Failed to disconnect, timed out");
return -ETIMEDOUT;
}
hdd_exit();
return 0;
}
/**
* wlan_hdd_cfg80211_leave_ibss() - leave ibss
* @wiphy: Pointer to wiphy
* @dev: Pointer to network device
*
* This function is used to leave an IBSS network
*
* Return: 0 for success, non-zero for failure
*/
static int wlan_hdd_cfg80211_leave_ibss(struct wiphy *wiphy,
struct net_device *dev)
{
int errno;
struct osif_vdev_sync *vdev_sync;
errno = osif_vdev_sync_op_start(dev, &vdev_sync);
if (errno)
return errno;
errno = __wlan_hdd_cfg80211_leave_ibss(wiphy, dev);
osif_vdev_sync_op_stop(vdev_sync);
return errno;
}
#else
/**
* wlan_hdd_cfg80211_join_ibss() - join ibss
* @wiphy: Pointer to wiphy
* @dev: Pointer to network device
* @param: Pointer to IBSS join parameters
*
* This function is dummy
*
* Return: 0
*/
static inline int
wlan_hdd_cfg80211_join_ibss(struct wiphy *wiphy,
struct net_device *dev,
struct cfg80211_ibss_params *params)
{
return 0;
}
/**
* wlan_hdd_cfg80211_leave_ibss() - leave ibss
* @wiphy: Pointer to wiphy
* @dev: Pointer to network device
*
* This function is dummy
*
* Return: 0
*/
static inline int
wlan_hdd_cfg80211_leave_ibss(struct wiphy *wiphy,
struct net_device *dev)
{
return 0;
}
#endif
static void wlan_hdd_cfg80211_store_wep_key(struct hdd_adapter *adapter,
struct wlan_objmgr_vdev *vdev,
struct cfg80211_connect_params *req)
@ -19612,8 +18939,7 @@ static int wlan_hdd_wait_for_disconnect(mac_handle_t mac_handle,
uint32_t wait_time = SME_DISCONNECT_TIMEOUT;
/* Return if already disconnected */
if (sta_ctx->conn_info.conn_state == eConnectionState_NotConnected ||
sta_ctx->conn_info.conn_state == eConnectionState_IbssDisconnected)
if (sta_ctx->conn_info.conn_state == eConnectionState_NotConnected)
return 0;
/* If already in disconnecting state just wait for its completion */
@ -23297,8 +22623,6 @@ void hdd_send_update_owe_info_event(struct hdd_adapter *adapter,
* @scan: Scan
* @connect: Connect
* @disconnect: Disconnect
* @join_ibss = Join ibss
* @leave_ibss = Leave ibss
* @set_wiphy_params = Set wiphy params
* @set_tx_power = Set tx power
* @get_tx_power = get tx power
@ -23346,8 +22670,6 @@ static struct cfg80211_ops wlan_hdd_cfg80211_ops = {
.scan = wlan_hdd_cfg80211_scan,
.connect = wlan_hdd_cfg80211_connect,
.disconnect = wlan_hdd_cfg80211_disconnect,
.join_ibss = wlan_hdd_cfg80211_join_ibss,
.leave_ibss = wlan_hdd_cfg80211_leave_ibss,
.set_wiphy_params = wlan_hdd_cfg80211_set_wiphy_params,
.set_tx_power = wlan_hdd_cfg80211_set_txpower,
.get_tx_power = wlan_hdd_cfg80211_get_txpower,

View file

@ -75,8 +75,6 @@ static uint8_t wlan_hdd_valid_type_of_persona(uint32_t sub_type)
switch (sub_type) {
case PM_STA_MODE:
return WMI_VDEV_TYPE_STA;
case PM_IBSS_MODE:
return WMI_VDEV_TYPE_IBSS;
case PM_SAP_MODE:
case PM_P2P_CLIENT_MODE:
case PM_P2P_GO_MODE:
@ -105,7 +103,6 @@ static const char *device_mode_to_string(uint8_t idx)
CASE_RETURN_STRING(PM_SAP_MODE);
CASE_RETURN_STRING(PM_P2P_CLIENT_MODE);
CASE_RETURN_STRING(PM_P2P_GO_MODE);
CASE_RETURN_STRING(PM_IBSS_MODE);
default:
return "none";
}

View file

@ -134,7 +134,6 @@ int hdd_green_ap_start_state_mc(struct hdd_context *hdd_ctx,
switch (mode) {
case QDF_STA_MODE:
case QDF_P2P_CLIENT_MODE:
case QDF_IBSS_MODE:
if (!num_sap_sessions && !num_p2p_go_sessions)
return 0;

View file

@ -3801,13 +3801,6 @@ int wlan_hdd_set_channel(struct wiphy *wiphy,
struct hdd_station_ctx *sta_ctx =
WLAN_HDD_GET_STATION_CTX_PTR(adapter);
if (eConnectionState_IbssConnected ==
sta_ctx->conn_info.conn_state) {
/* Link is up then return cant set channel */
hdd_err("IBSS Associated, can't set the channel");
return -EINVAL;
}
roam_profile = hdd_roam_profile(adapter);
num_ch = roam_profile->ChannelInfo.numOfChannels = 1;
sta_ctx->conn_info.chan_freq = chandef->chan->center_freq;

View file

@ -240,806 +240,6 @@ static int hdd_get_tsm_stats(struct hdd_adapter *adapter,
}
#endif /*FEATURE_WLAN_ESE */
#ifdef QCA_IBSS_SUPPORT
/*
* Ibss prop IE from command will be of size:
* size = sizeof(oui) + sizeof(oui_data) + 1(Element ID) + 1(EID Length)
* OUI_DATA should be at least 3 bytes long
*/
#define WLAN_HDD_IBSS_MIN_OUI_DATA_LENGTH (3)
static uint16_t cesium_pid;
void
hdd_get_ibss_peer_info_cb(void *context,
tSirPeerInfoRspParams *peer_info)
{
struct hdd_adapter *adapter = context;
struct hdd_station_ctx *sta_ctx;
uint8_t i;
if ((!adapter) ||
(WLAN_HDD_ADAPTER_MAGIC != adapter->magic)) {
hdd_err("invalid adapter or adapter has invalid magic");
return;
}
sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
if (peer_info && QDF_STATUS_SUCCESS == peer_info->status) {
/* validate number of peers */
if (peer_info->numPeers > SIR_MAX_NUM_STA_IN_IBSS) {
hdd_warn("Limiting num_peers %u to %u",
peer_info->numPeers, SIR_MAX_NUM_STA_IN_IBSS);
peer_info->numPeers = SIR_MAX_NUM_STA_IN_IBSS;
}
sta_ctx->ibss_peer_info.status = peer_info->status;
sta_ctx->ibss_peer_info.numPeers = peer_info->numPeers;
for (i = 0; i < peer_info->numPeers; i++)
sta_ctx->ibss_peer_info.peerInfoParams[i] =
peer_info->peerInfoParams[i];
} else {
hdd_debug("peerInfo %s: status %u, numPeers %u",
peer_info ? "valid" : "null",
peer_info ? peer_info->status : QDF_STATUS_E_FAILURE,
peer_info ? peer_info->numPeers : 0);
sta_ctx->ibss_peer_info.numPeers = 0;
sta_ctx->ibss_peer_info.status = QDF_STATUS_E_FAILURE;
}
complete(&adapter->ibss_peer_info_comp);
}
/**
* hdd_cfg80211_get_ibss_peer_info_all() - get ibss peers' info
* @adapter: Adapter context
*
* Request function to get IBSS peer info from lower layers
*
* Return: 0 for success non-zero for failure
*/
static
QDF_STATUS hdd_cfg80211_get_ibss_peer_info_all(struct hdd_adapter *adapter)
{
QDF_STATUS status;
unsigned long rc;
struct qdf_mac_addr bcast = QDF_MAC_ADDR_BCAST_INIT;
INIT_COMPLETION(adapter->ibss_peer_info_comp);
status = sme_request_ibss_peer_info(adapter->hdd_ctx->mac_handle,
adapter,
hdd_get_ibss_peer_info_cb,
true, bcast.bytes);
if (QDF_STATUS_SUCCESS == status) {
rc = wait_for_completion_timeout
(&adapter->ibss_peer_info_comp,
msecs_to_jiffies(IBSS_PEER_INFO_REQ_TIMOEUT));
/* status will be 0 if timed out */
if (!rc) {
hdd_warn("Warning: IBSS_PEER_INFO_TIMEOUT");
status = QDF_STATUS_E_FAILURE;
}
} else {
hdd_warn("Warning: sme_request_ibss_peer_info Request failed");
}
return status;
}
/**
* hdd_cfg80211_get_ibss_peer_info() - get ibss peer info
* @adapter: Adapter context
* @sta_id: Sta index for which the peer info is requested
*
* Request function to get IBSS peer info from lower layers
*
* Return: 0 for success non-zero for failure
*/
static QDF_STATUS
hdd_cfg80211_get_ibss_peer_info(struct hdd_adapter *adapter, uint8_t *mac_addr)
{
unsigned long rc;
QDF_STATUS status;
INIT_COMPLETION(adapter->ibss_peer_info_comp);
status = sme_request_ibss_peer_info(adapter->hdd_ctx->mac_handle,
adapter,
hdd_get_ibss_peer_info_cb,
false, mac_addr);
if (QDF_STATUS_SUCCESS == status) {
rc = wait_for_completion_timeout(
&adapter->ibss_peer_info_comp,
msecs_to_jiffies(IBSS_PEER_INFO_REQ_TIMOEUT));
/* status = 0 on timeout */
if (!rc) {
hdd_warn("Warning: IBSS_PEER_INFO_TIMEOUT");
status = QDF_STATUS_E_FAILURE;
}
} else {
hdd_warn("Warning: sme_request_ibss_peer_info Request failed");
}
return status;
}
/* Function header is left blank intentionally */
static QDF_STATUS
hdd_parse_get_ibss_peer_info(uint8_t *command,
struct qdf_mac_addr *peer_macaddr)
{
uint8_t *in_ptr = command;
size_t in_ptr_len = strlen(command);
in_ptr = strnchr(command, in_ptr_len, SPACE_ASCII_VALUE);
if (!in_ptr)
return QDF_STATUS_E_FAILURE;
else if (SPACE_ASCII_VALUE != *in_ptr)
return QDF_STATUS_E_FAILURE;
while ((SPACE_ASCII_VALUE == *in_ptr) && ('\0' != *in_ptr))
in_ptr++;
if ('\0' == *in_ptr)
return QDF_STATUS_E_FAILURE;
in_ptr_len -= (in_ptr - command);
if (in_ptr_len < 17)
return QDF_STATUS_E_FAILURE;
if (in_ptr[2] != ':' || in_ptr[5] != ':' || in_ptr[8] != ':' ||
in_ptr[11] != ':' || in_ptr[14] != ':')
return QDF_STATUS_E_FAILURE;
sscanf(in_ptr, "%2x:%2x:%2x:%2x:%2x:%2x",
(unsigned int *)&peer_macaddr->bytes[0],
(unsigned int *)&peer_macaddr->bytes[1],
(unsigned int *)&peer_macaddr->bytes[2],
(unsigned int *)&peer_macaddr->bytes[3],
(unsigned int *)&peer_macaddr->bytes[4],
(unsigned int *)&peer_macaddr->bytes[5]);
return QDF_STATUS_SUCCESS;
}
static void hdd_tx_fail_ind_callback(uint8_t *macaddr, uint8_t seq_no)
{
int payload_len;
struct sk_buff *skb;
struct nlmsghdr *nlh;
uint8_t *data;
payload_len = ETH_ALEN;
if (0 == cesium_pid || !cesium_nl_srv_sock) {
hdd_err("cesium process not registered");
return;
}
skb = nlmsg_new(payload_len, GFP_ATOMIC);
if (!skb) {
hdd_err("nlmsg_new() failed for msg size[%d]",
NLMSG_SPACE(payload_len));
return;
}
nlh = nlmsg_put(skb, cesium_pid, seq_no, 0, payload_len, NLM_F_REQUEST);
if (!nlh) {
hdd_err("nlmsg_put() failed for msg size[%d]",
NLMSG_SPACE(payload_len));
kfree_skb(skb);
return;
}
data = nlmsg_data(nlh);
memcpy(data, macaddr, ETH_ALEN);
if (nlmsg_unicast(cesium_nl_srv_sock, skb, cesium_pid) < 0) {
hdd_err("nlmsg_unicast() failed for msg size[%d]",
NLMSG_SPACE(payload_len));
}
}
/**
* hdd_parse_user_params() - return a pointer to the next argument
* @command: Input argument string
* @arg: Output pointer to the next argument
*
* This function parses argument stream and finds the pointer
* to the next argument
*
* Return: 0 if the next argument found; -EINVAL otherwise
*/
static int hdd_parse_user_params(uint8_t *command, uint8_t **arg)
{
uint8_t *cursor;
cursor = strnchr(command, strlen(command), SPACE_ASCII_VALUE);
/* no argument remains ? */
if (!cursor)
return -EINVAL;
/* no space after the current arg ? */
if (SPACE_ASCII_VALUE != *cursor)
return -EINVAL;
cursor++;
/* remove empty spaces */
while (SPACE_ASCII_VALUE == *cursor)
cursor++;
/* no argument after the spaces ? */
if ('\0' == *cursor)
return -EINVAL;
*arg = cursor;
return 0;
}
/**
* hdd_parse_ibsstx_fail_event_params - Parse params
* for SETIBSSTXFAILEVENT
* @command: Input ibss tx fail event argument
* @tx_fail_count: (Output parameter) Tx fail counter
* @pid: (Output parameter) PID
*
* Return: 0 if the parsing succeeds; -EINVAL otherwise
*/
static int hdd_parse_ibsstx_fail_event_params(uint8_t *command,
uint8_t *tx_fail_count,
uint16_t *pid)
{
uint8_t *param = NULL;
int ret;
ret = hdd_parse_user_params(command, &param);
if (0 == ret && param) {
if (1 != sscanf(param, "%hhu", tx_fail_count)) {
ret = -EINVAL;
goto done;
}
} else {
goto done;
}
if (0 == *tx_fail_count) {
*pid = 0;
goto done;
}
command = param;
command++;
ret = hdd_parse_user_params(command, &param);
if (0 == ret) {
if (1 != sscanf(param, "%hu", pid)) {
ret = -EINVAL;
goto done;
}
} else {
goto done;
}
done:
return ret;
}
/* Function header is left blank intentionally */
static int hdd_parse_set_ibss_oui_data_command(uint8_t *command, uint8_t *ie,
int32_t *oui_length, int32_t limit)
{
uint8_t len;
uint8_t data;
while ((SPACE_ASCII_VALUE == *command) && ('\0' != *command)) {
command++;
limit--;
}
len = 2;
while ((SPACE_ASCII_VALUE != *command) && ('\0' != *command) &&
(limit > 1)) {
sscanf(command, "%02x", (unsigned int *)&data);
ie[len++] = data;
command += 2;
limit -= 2;
}
*oui_length = len - 2;
while ((SPACE_ASCII_VALUE == *command) && ('\0' != *command)) {
command++;
limit--;
}
while ((SPACE_ASCII_VALUE != *command) && ('\0' != *command) &&
(limit > 1)) {
sscanf(command, "%02x", (unsigned int *)&data);
ie[len++] = data;
command += 2;
limit -= 2;
}
ie[0] = WLAN_ELEMID_VENDOR;
ie[1] = len - 2;
return len;
}
/**
* drv_cmd_set_ibss_beacon_oui_data() - set ibss oui data command
* @adapter: Pointer to adapter
* @hdd_ctx: Pointer to HDD context
* @command: Pointer to command string
* @command_len : Command length
* @priv_data : Pointer to priv data
*
* Return:
* int status code
*/
static int drv_cmd_set_ibss_beacon_oui_data(struct hdd_adapter *adapter,
struct hdd_context *hdd_ctx,
uint8_t *command,
uint8_t command_len,
struct hdd_priv_data *priv_data)
{
int i = 0;
int status;
int ret = 0;
uint8_t *ibss_ie;
int32_t oui_length = 0;
uint32_t ibss_ie_length;
uint8_t *value = command;
tSirModifyIE modify_ie;
struct csr_roam_profile *roam_profile;
mac_handle_t mac_handle;
if (QDF_IBSS_MODE != adapter->device_mode) {
hdd_debug("Device_mode %s(%d) not IBSS",
qdf_opmode_str(adapter->device_mode),
adapter->device_mode);
return ret;
}
hdd_debug("received command %s", ((char *)value));
/* validate argument of command */
if (strlen(value) <= command_len) {
hdd_err("No arguments in command length %zu",
strlen(value));
ret = -EFAULT;
goto exit;
}
/* moving to arguments of commands */
value = value + command_len;
command_len = strlen(value);
/* oui_data can't be less than 3 bytes */
if (command_len < (2 * WLAN_HDD_IBSS_MIN_OUI_DATA_LENGTH)) {
hdd_err("Invalid SETIBSSBEACONOUIDATA command length %d",
command_len);
ret = -EFAULT;
goto exit;
}
ibss_ie = qdf_mem_malloc(command_len);
if (!ibss_ie) {
hdd_err("Could not allocate memory for command length %d",
command_len);
ret = -ENOMEM;
goto exit;
}
ibss_ie_length = hdd_parse_set_ibss_oui_data_command(value, ibss_ie,
&oui_length,
command_len);
if (ibss_ie_length <= (2 * WLAN_HDD_IBSS_MIN_OUI_DATA_LENGTH)) {
hdd_err("Could not parse command %s return length %d",
value, ibss_ie_length);
ret = -EFAULT;
qdf_mem_free(ibss_ie);
goto exit;
}
roam_profile = hdd_roam_profile(adapter);
qdf_copy_macaddr(&modify_ie.bssid,
roam_profile->BSSIDs.bssid);
modify_ie.vdev_id = adapter->vdev_id;
modify_ie.notify = true;
modify_ie.ieID = WLAN_ELEMID_VENDOR;
modify_ie.ieIDLen = ibss_ie_length;
modify_ie.ieBufferlength = ibss_ie_length;
modify_ie.pIEBuffer = ibss_ie;
modify_ie.oui_length = oui_length;
hdd_warn("ibss_ie length %d oui_length %d ibss_ie:",
ibss_ie_length, oui_length);
while (i < modify_ie.ieBufferlength)
hdd_warn("0x%x", ibss_ie[i++]);
/* Probe Bcn modification */
mac_handle = hdd_ctx->mac_handle;
sme_modify_add_ie(mac_handle, &modify_ie, eUPDATE_IE_PROBE_BCN);
/* Populating probe resp frame */
sme_modify_add_ie(mac_handle, &modify_ie, eUPDATE_IE_PROBE_RESP);
qdf_mem_free(ibss_ie);
status = sme_send_cesium_enable_ind(mac_handle,
adapter->vdev_id);
if (QDF_STATUS_SUCCESS != status) {
hdd_err("Could not send cesium enable indication %d",
status);
ret = -EINVAL;
goto exit;
}
exit:
return ret;
}
static int drv_cmd_get_ibss_peer_info_all(struct hdd_adapter *adapter,
struct hdd_context *hdd_ctx,
uint8_t *command,
uint8_t command_len,
struct hdd_priv_data *priv_data)
{
int ret = 0;
int status = QDF_STATUS_SUCCESS;
struct hdd_station_ctx *sta_ctx = NULL;
char *extra = NULL;
int idx = 0;
int length = 0;
uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
uint32_t print_break_index = 0;
if (QDF_IBSS_MODE != adapter->device_mode) {
hdd_warn("Unsupported in mode %s(%d)",
qdf_opmode_str(adapter->device_mode),
adapter->device_mode);
return -EINVAL;
}
sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
hdd_debug("Received GETIBSSPEERINFOALL Command");
/* Handle the command */
status = hdd_cfg80211_get_ibss_peer_info_all(adapter);
if (QDF_STATUS_SUCCESS == status) {
size_t user_size = qdf_min(WLAN_MAX_BUF_SIZE,
priv_data->total_len);
/*
* The variable extra needed to be allocated on the heap since
* amount of memory required to copy the data for 32 devices
* exceeds the size of 1024 bytes of default stack size. On
* 64 bit devices, the default max stack size of 2048 bytes
*/
extra = qdf_mem_malloc(user_size);
if (!extra) {
hdd_err("memory allocation failed");
ret = -ENOMEM;
goto exit;
}
/* Copy number of stations */
length = scnprintf(extra, user_size, "%d ",
sta_ctx->ibss_peer_info.numPeers);
print_break_index = length;
for (idx = 0; idx < sta_ctx->ibss_peer_info.numPeers;
idx++) {
int8_t rssi;
uint32_t tx_rate;
qdf_mem_copy(mac_addr,
sta_ctx->ibss_peer_info.peerInfoParams[idx].
mac_addr, sizeof(mac_addr));
tx_rate =
sta_ctx->ibss_peer_info.peerInfoParams[idx].
txRate;
/*
* Only lower 3 bytes are rate info. Mask of the MSByte
*/
tx_rate &= 0x00FFFFFF;
rssi = sta_ctx->ibss_peer_info.peerInfoParams[idx].
rssi;
length += scnprintf(extra + length,
user_size - length,
QDF_MAC_ADDR_STR" %d %d ",
QDF_MAC_ADDR_ARRAY(mac_addr),
tx_rate, rssi);
/*
* cdf_trace_msg has limitation of 512 bytes for the
* print buffer. Hence printing the data in two chunks.
* The first chunk will have the data for 16 devices
* and the second chunk will have the rest.
*/
if (idx < NUM_OF_STA_DATA_TO_PRINT)
print_break_index = length;
}
/*
* Copy the data back into buffer, if the data to copy is
* more than 512 bytes than we will split the data and do
* it in two shots
*/
if (copy_to_user(priv_data->buf, extra, print_break_index)) {
hdd_err("Copy into user data buffer failed");
ret = -EFAULT;
goto mem_free;
}
/* This overwrites the last space, which we already copied */
extra[print_break_index - 1] = '\0';
hdd_debug("%s", extra);
if (length > print_break_index) {
if (copy_to_user
(priv_data->buf + print_break_index,
extra + print_break_index,
length - print_break_index + 1)) {
hdd_err("Copy into user data buffer failed");
ret = -EFAULT;
goto mem_free;
}
hdd_debug("%s", &extra[print_break_index]);
}
} else {
/* Command failed, log error */
hdd_err("GETIBSSPEERINFOALL command failed with status code %d",
status);
ret = -EINVAL;
goto exit;
}
ret = 0;
mem_free:
qdf_mem_free(extra);
exit:
return ret;
}
/* Peer Info <Peer Addr> command */
static int drv_cmd_get_ibss_peer_info(struct hdd_adapter *adapter,
struct hdd_context *hdd_ctx,
uint8_t *command,
uint8_t command_len,
struct hdd_priv_data *priv_data)
{
int ret = 0;
uint8_t *value = command;
QDF_STATUS status;
struct hdd_station_ctx *sta_ctx = NULL;
char extra[128] = { 0 };
uint32_t length = 0;
struct qdf_mac_addr peer_macaddr;
if (QDF_IBSS_MODE != adapter->device_mode) {
hdd_warn("Unsupported in mode %s(%d)",
qdf_opmode_str(adapter->device_mode),
adapter->device_mode);
return -EINVAL;
}
sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
hdd_debug("Received GETIBSSPEERINFO Command");
/* if there are no peers, no need to continue with the command */
if (eConnectionState_IbssConnected !=
sta_ctx->conn_info.conn_state) {
hdd_err("No IBSS Peers coalesced");
ret = -EINVAL;
goto exit;
}
/* Parse the incoming command buffer */
status = hdd_parse_get_ibss_peer_info(value, &peer_macaddr);
if (QDF_STATUS_SUCCESS != status) {
hdd_err("Invalid GETIBSSPEERINFO command");
ret = -EINVAL;
goto exit;
}
/* Handle the command */
status = hdd_cfg80211_get_ibss_peer_info(adapter, peer_macaddr.bytes);
if (QDF_STATUS_SUCCESS == status) {
uint32_t tx_rate =
sta_ctx->ibss_peer_info.peerInfoParams[0].txRate;
/* Only lower 3 bytes are rate info. Mask of the MSByte */
tx_rate &= 0x00FFFFFF;
length = scnprintf(extra, sizeof(extra), "%d %d",
(int)tx_rate,
(int)sta_ctx->ibss_peer_info.
peerInfoParams[0].rssi);
length = QDF_MIN(priv_data->total_len, length + 1);
/* Copy the data back into buffer */
if (copy_to_user(priv_data->buf, &extra, length)) {
hdd_err("copy data to user buffer failed GETIBSSPEERINFO command");
ret = -EFAULT;
goto exit;
}
} else {
/* Command failed, log error */
hdd_err("GETIBSSPEERINFO command failed with status code %d",
status);
ret = -EINVAL;
goto exit;
}
/* Success ! */
hdd_debug("%s", extra);
ret = 0;
exit:
return ret;
}
static int drv_cmd_set_ibss_tx_fail_event(struct hdd_adapter *adapter,
struct hdd_context *hdd_ctx,
uint8_t *command,
uint8_t command_len,
struct hdd_priv_data *priv_data)
{
int ret = 0;
char *value;
uint8_t tx_fail_count = 0;
uint16_t pid = 0;
mac_handle_t mac_handle;
value = command;
ret = hdd_parse_ibsstx_fail_event_params(value, &tx_fail_count, &pid);
if (0 != ret) {
hdd_err("Failed to parse SETIBSSTXFAILEVENT arguments");
goto exit;
}
hdd_debug("tx_fail_cnt=%hhu, pid=%hu", tx_fail_count, pid);
mac_handle = hdd_ctx->mac_handle;
if (0 == tx_fail_count) {
/* Disable TX Fail Indication */
if (QDF_STATUS_SUCCESS ==
sme_tx_fail_monitor_start_stop_ind(mac_handle,
tx_fail_count,
NULL)) {
cesium_pid = 0;
} else {
hdd_err("failed to disable TX Fail Event");
ret = -EINVAL;
}
} else {
if (QDF_STATUS_SUCCESS ==
sme_tx_fail_monitor_start_stop_ind(mac_handle,
tx_fail_count,
(void *)hdd_tx_fail_ind_callback)) {
cesium_pid = pid;
hdd_debug("Registered Cesium pid %u",
cesium_pid);
} else {
hdd_err("Failed to enable TX Fail Monitoring");
ret = -EINVAL;
}
}
exit:
return ret;
}
#else
/**
* drv_cmd_get_ibss_peer_info() - get ibss peer info all
* @adapter: Pointer to adapter
* @hdd_ctx: Pointer to HDD context
* @command: Pointer to command string
* @command_len : Command length
* @priv_data : Pointer to priv data
*
* This function is dummy
*
* Return: 0
*/
static inline int
drv_cmd_get_ibss_peer_info_all(struct hdd_adapter *adapter,
struct hdd_context *hdd_ctx,
uint8_t *command,
uint8_t command_len,
struct hdd_priv_data *priv_data)
{
return 0;
}
/**
* drv_cmd_get_ibss_peer_info() - get ibss peer info
* @adapter: Pointer to adapter
* @hdd_ctx: Pointer to HDD context
* @command: Pointer to command string
* @command_len : Command length
* @priv_data : Pointer to priv data
*
* This function is dummy
*
* Return: 0
*/
static inline int
drv_cmd_get_ibss_peer_info(struct hdd_adapter *adapter,
struct hdd_context *hdd_ctx,
uint8_t *command,
uint8_t command_len,
struct hdd_priv_data *priv_data)
{
return 0;
}
/**
* drv_cmd_set_ibss_tx_fail_event() - set ibss tx fail event
* @adapter: Pointer to adapter
* @hdd_ctx: Pointer to HDD context
* @command: Pointer to command string
* @command_len : Command length
* @priv_data : Pointer to priv data
*
* This function is dummy
*
* Return: 0
*/
static inline int
drv_cmd_set_ibss_tx_fail_event(struct hdd_adapter *adapter,
struct hdd_context *hdd_ctx,
uint8_t *command,
uint8_t command_len,
struct hdd_priv_data *priv_data)
{
return 0;
}
/**
* drv_cmd_set_ibss_beacon_oui_data() - set ibss oui data command
* @adapter: Pointer to adapter
* @hdd_ctx: Pointer to HDD context
* @command: Pointer to command string
* @command_len : Command length
* @priv_data : Pointer to priv data
*
* This function is dummy
*
* Return: 0
*/
static inline int
drv_cmd_set_ibss_beacon_oui_data(struct hdd_adapter *adapter,
struct hdd_context *hdd_ctx,
uint8_t *command,
uint8_t command_len,
struct hdd_priv_data *priv_data)
{
return 0;
}
#endif
static void hdd_get_band_helper(struct hdd_context *hdd_ctx, int *ui_band)
{
enum band_info band = -1;
@ -3269,13 +2469,12 @@ int wlan_hdd_set_mc_rate(struct hdd_adapter *adapter, int target_rate)
hdd_err("HDD context is null");
return -EINVAL;
}
if ((QDF_IBSS_MODE != adapter->device_mode) &&
(QDF_SAP_MODE != adapter->device_mode) &&
if ((QDF_SAP_MODE != adapter->device_mode) &&
(QDF_STA_MODE != adapter->device_mode)) {
hdd_err("Received SETMCRATE cmd in invalid mode %s(%d)",
qdf_opmode_str(adapter->device_mode),
adapter->device_mode);
hdd_err("SETMCRATE cmd is allowed only in STA, IBSS or SOFTAP mode");
hdd_err("SETMCRATE cmd is allowed only in STA or SOFTAP mode");
return -EINVAL;
}
@ -5550,12 +4749,11 @@ static int drv_cmd_set_rmc_enable(struct hdd_adapter *adapter,
int status;
mac_handle_t mac_handle;
if ((QDF_IBSS_MODE != adapter->device_mode) &&
(QDF_SAP_MODE != adapter->device_mode)) {
if (QDF_SAP_MODE != adapter->device_mode) {
hdd_err("Received SETRMCENABLE cmd in invalid mode %s(%d)",
qdf_opmode_str(adapter->device_mode),
adapter->device_mode);
hdd_err("SETRMCENABLE cmd is allowed only in IBSS/SOFTAP mode");
hdd_err("SETRMCENABLE cmd is allowed only in SOFTAP mode");
ret = -EINVAL;
goto exit;
}
@ -5602,12 +4800,11 @@ static int drv_cmd_set_rmc_action_period(struct hdd_adapter *adapter,
int status;
mac_handle_t mac_handle;
if ((QDF_IBSS_MODE != adapter->device_mode) &&
(QDF_SAP_MODE != adapter->device_mode)) {
if (QDF_SAP_MODE != adapter->device_mode) {
hdd_err("Received SETRMC cmd in invalid mode %s(%d)",
qdf_opmode_str(adapter->device_mode),
adapter->device_mode);
hdd_err("SETRMC cmd is allowed only in IBSS/SOFTAP mode");
hdd_err("SETRMC cmd is allowed only in SOFTAP mode");
ret = -EINVAL;
goto exit;
}
@ -5657,12 +4854,11 @@ static int drv_cmd_set_rmc_tx_rate(struct hdd_adapter *adapter,
int status;
bool bval = false;
if ((QDF_IBSS_MODE != adapter->device_mode) &&
(QDF_SAP_MODE != adapter->device_mode)) {
if (QDF_SAP_MODE != adapter->device_mode) {
hdd_err("Received SETRMCTXRATE cmd in invalid mode %s(%d)",
qdf_opmode_str(adapter->device_mode),
adapter->device_mode);
hdd_err("SETRMCTXRATE cmd is allowed only in IBSS/SOFTAP mode");
hdd_err("SETRMCTXRATE cmd is allowed only in SOFTAP mode");
ret = -EINVAL;
goto exit;
}
@ -7977,15 +7173,11 @@ static const struct hdd_drv_cmd hdd_drv_cmds[] = {
{"GETDWELLTIME", drv_cmd_get_dwell_time, false},
{"SETDWELLTIME", drv_cmd_set_dwell_time, true},
{"MIRACAST", drv_cmd_miracast, true},
{"SETIBSSBEACONOUIDATA", drv_cmd_set_ibss_beacon_oui_data, true},
#ifdef FEATURE_WLAN_RMC
{"SETRMCENABLE", drv_cmd_set_rmc_enable, true},
{"SETRMCACTIONPERIOD", drv_cmd_set_rmc_action_period, true},
{"SETRMCTXRATE", drv_cmd_set_rmc_tx_rate, true},
#endif
{"GETIBSSPEERINFOALL", drv_cmd_get_ibss_peer_info_all, false},
{"GETIBSSPEERINFO", drv_cmd_get_ibss_peer_info, true},
{"SETIBSSTXFAILEVENT", drv_cmd_set_ibss_tx_fail_event, true},
#ifdef FEATURE_WLAN_ESE
{"SETCCXROAMSCANCHANNELS", drv_cmd_set_ccx_roam_scan_channels, true},
{"GETTSMSTATS", drv_cmd_get_tsm_stats, true},

View file

@ -73,26 +73,4 @@ hdd_get_roam_scan_ch_cb(hdd_handle_t hdd_handle,
{
}
#endif
#ifdef QCA_IBSS_SUPPORT
/**
* hdd_get_ibss_peer_info_cb() - IBSS peer Info request callback
* @context: callback context (adapter supplied by caller)
* @peer_info: Peer info response
*
* This is an asynchronous callback function from SME when the peer info
* is received
*
* Return: 0 for success non-zero for failure
*/
void hdd_get_ibss_peer_info_cb(void *context,
tSirPeerInfoRspParams *peer_info);
#else
static inline void
hdd_get_ibss_peer_info_cb(void *context,
tSirPeerInfoRspParams *peer_info)
{
}
#endif
#endif /* end #if !defined(WLAN_HDD_IOCTL_H) */

View file

@ -134,7 +134,6 @@ void hdd_ipa_set_tx_flow_info(void)
#endif /* QCA_LL_LEGACY_TX_FLOW_CONTROL */
}
break;
case QDF_IBSS_MODE:
default:
break;
}

View file

@ -1156,9 +1156,6 @@ QDF_STATUS hdd_nl_to_qdf_iface_type(enum nl80211_iftype nl_type,
QDF_STATUS status = QDF_STATUS_SUCCESS;
switch (nl_type) {
case NL80211_IFTYPE_ADHOC:
*out_qdf_type = QDF_IBSS_MODE;
break;
case NL80211_IFTYPE_AP:
*out_qdf_type = QDF_SAP_MODE;
break;
@ -1376,21 +1373,6 @@ bool wlan_hdd_validate_modules_state(struct hdd_context *hdd_ctx)
return true;
}
#ifdef QCA_IBSS_SUPPORT
QDF_STATUS hdd_set_ibss_power_save_params(struct hdd_adapter *adapter)
{
struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
if (!hdd_ctx) {
hdd_err("HDD context is null");
return QDF_STATUS_E_FAILURE;
}
return ucfg_mlme_ibss_power_save_setup(hdd_ctx->psoc,
adapter->vdev_id);
}
#endif
#ifdef FEATURE_RUNTIME_PM
/**
* hdd_runtime_suspend_context_init() - API to initialize HDD Runtime Contexts
@ -2831,12 +2813,6 @@ int hdd_start_adapter(struct hdd_adapter *adapter)
goto err_start_adapter;
hdd_mic_enable_work(adapter);
break;
case QDF_IBSS_MODE:
/*
* For IBSS interface is initialized as part of
* hdd_init_station_mode()
*/
goto exit_with_success;
case QDF_FTM_MODE:
/* vdevs are dynamically managed by firmware in FTM */
hdd_register_wext(adapter->dev);
@ -5349,7 +5325,6 @@ void hdd_deinit_adapter(struct hdd_context *hdd_ctx,
case QDF_P2P_CLIENT_MODE:
case QDF_MONITOR_MODE:
case QDF_P2P_DEVICE_MODE:
case QDF_IBSS_MODE:
case QDF_NDI_MODE:
case QDF_NAN_DISC_MODE:
{
@ -5888,7 +5863,6 @@ static void hdd_init_completion(struct hdd_adapter *adapter)
init_completion(&adapter->sta_authorized_event);
init_completion(&adapter->offchannel_tx_event);
init_completion(&adapter->tx_action_cnf_event);
init_completion(&adapter->ibss_peer_info_comp);
init_completion(&adapter->lfr_fw_status.disable_lfr_event);
}
@ -6309,7 +6283,6 @@ void wlan_hdd_reset_prob_rspies(struct hdd_adapter *adapter)
}
case QDF_SAP_MODE:
case QDF_P2P_GO_MODE:
case QDF_IBSS_MODE:
{
bssid = &adapter->mac_addr;
break;
@ -6421,7 +6394,6 @@ QDF_STATUS hdd_stop_adapter(struct hdd_context *hdd_ctx,
switch (adapter->device_mode) {
case QDF_STA_MODE:
case QDF_P2P_CLIENT_MODE:
case QDF_IBSS_MODE:
case QDF_P2P_DEVICE_MODE:
case QDF_NDI_MODE:
case QDF_NAN_DISC_MODE:
@ -6444,13 +6416,7 @@ QDF_STATUS hdd_stop_adapter(struct hdd_context *hdd_ctx,
adapter->vdev_id,
eCSR_DISCONNECT_REASON_NDI_DELETE,
reason);
} else if (roam_profile->BSSType ==
eCSR_BSS_TYPE_START_IBSS)
status = sme_roam_disconnect(
mac_handle,
adapter->vdev_id,
eCSR_DISCONNECT_REASON_IBSS_LEAVE,
reason);
}
else if (adapter->device_mode == QDF_STA_MODE) {
rc = wlan_hdd_disconnect(
adapter,
@ -6750,7 +6716,6 @@ static void hdd_reset_scan_operation(struct hdd_context *hdd_ctx,
switch (adapter->device_mode) {
case QDF_STA_MODE:
case QDF_P2P_CLIENT_MODE:
case QDF_IBSS_MODE:
case QDF_P2P_DEVICE_MODE:
case QDF_NDI_MODE:
wlan_hdd_scan_abort(adapter);
@ -7599,9 +7564,7 @@ QDF_STATUS hdd_start_all_adapters(struct hdd_context *hdd_ctx)
* if associated previously
*/
if (eConnectionState_Associated == conn_state ||
eConnectionState_IbssConnected == conn_state ||
eConnectionState_NotConnected == conn_state ||
eConnectionState_IbssDisconnected == conn_state ||
eConnectionState_Disconnecting == conn_state) {
union iwreq_data wrqu;
@ -8027,7 +7990,6 @@ static inline QDF_STATUS hdd_unregister_wext_all_adapters(struct hdd_context *
hdd_for_each_adapter(hdd_ctx, adapter) {
if (adapter->device_mode == QDF_STA_MODE ||
adapter->device_mode == QDF_P2P_CLIENT_MODE ||
adapter->device_mode == QDF_IBSS_MODE ||
adapter->device_mode == QDF_P2P_DEVICE_MODE ||
adapter->device_mode == QDF_SAP_MODE ||
adapter->device_mode == QDF_P2P_GO_MODE) {
@ -8049,7 +8011,6 @@ QDF_STATUS hdd_abort_mac_scan_all_adapters(struct hdd_context *hdd_ctx)
hdd_for_each_adapter(hdd_ctx, adapter) {
if (adapter->device_mode == QDF_STA_MODE ||
adapter->device_mode == QDF_P2P_CLIENT_MODE ||
adapter->device_mode == QDF_IBSS_MODE ||
adapter->device_mode == QDF_P2P_DEVICE_MODE ||
adapter->device_mode == QDF_SAP_MODE ||
adapter->device_mode == QDF_P2P_GO_MODE) {
@ -8079,7 +8040,6 @@ static QDF_STATUS hdd_abort_sched_scan_all_adapters(struct hdd_context *hdd_ctx)
hdd_for_each_adapter(hdd_ctx, adapter) {
if (adapter->device_mode == QDF_STA_MODE ||
adapter->device_mode == QDF_P2P_CLIENT_MODE ||
adapter->device_mode == QDF_IBSS_MODE ||
adapter->device_mode == QDF_P2P_DEVICE_MODE ||
adapter->device_mode == QDF_SAP_MODE ||
adapter->device_mode == QDF_P2P_GO_MODE) {
@ -9217,7 +9177,6 @@ static void __hdd_bus_bw_work_handler(struct hdd_context *hdd_ctx)
if (adapter->device_mode == QDF_SAP_MODE ||
adapter->device_mode == QDF_P2P_GO_MODE ||
adapter->device_mode == QDF_IBSS_MODE ||
adapter->device_mode == QDF_NDI_MODE) {
ret = cdp_get_intra_bss_fwd_pkts_count(
@ -17042,8 +17001,7 @@ wlan_hdd_add_monitor_check(struct hdd_context *hdd_ctx,
struct hdd_adapter *adapter;
if (mode == QDF_FTM_MODE ||
mode == QDF_MONITOR_MODE ||
mode == QDF_IBSS_MODE)
mode == QDF_MONITOR_MODE)
continue;
adapter = hdd_get_adapter(hdd_ctx, mode);

View file

@ -133,7 +133,6 @@ static bool hdd_is_ndp_allowed(struct hdd_context *hdd_ctx)
return false;
break;
case QDF_P2P_CLIENT_MODE:
case QDF_IBSS_MODE:
sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
if (hdd_conn_is_connected(sta_ctx) ||
hdd_is_connecting(sta_ctx))
@ -161,7 +160,6 @@ static bool hdd_is_ndp_allowed(struct hdd_context *hdd_ctx)
return false;
break;
case QDF_P2P_CLIENT_MODE:
case QDF_IBSS_MODE:
sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
if (hdd_conn_is_connected(sta_ctx) ||
hdd_is_connecting(sta_ctx))

View file

@ -1144,8 +1144,7 @@ static void hdd_update_conn_state_mask(struct hdd_adapter *adapter,
conn_state = sta_ctx->conn_info.conn_state;
if (conn_state == eConnectionState_Associated ||
conn_state == eConnectionState_IbssConnected)
if (conn_state == eConnectionState_Associated)
*conn_state_mask |= (1 << adapter->vdev_id);
}

View file

@ -514,15 +514,10 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
}
/*
* IBSS vdev does not need to scan to establish
* IBSS connection. If IBSS vdev need to support scan,
* Firmware need to make the change to add self peer
* per mac for IBSS vdev.
* NDI does not need scan from userspace to establish connection
* and it does not support scan request either.
*/
if (QDF_IBSS_MODE == adapter->device_mode ||
QDF_NDI_MODE == adapter->device_mode) {
if (QDF_NDI_MODE == adapter->device_mode) {
hdd_err("Scan not supported for %s",
qdf_opmode_str(adapter->device_mode));
return -EINVAL;

View file

@ -567,8 +567,6 @@ static tSirWifiInterfaceMode hdd_map_device_to_ll_iface_mode(int device_mode)
return WIFI_INTERFACE_P2P_CLIENT;
case QDF_P2P_GO_MODE:
return WIFI_INTERFACE_P2P_GO;
case QDF_IBSS_MODE:
return WIFI_INTERFACE_IBSS;
default:
/* Return Interface Mode as STA for all the unsupported modes */
return WIFI_INTERFACE_STA;

View file

@ -881,14 +881,7 @@ void hdd_get_transmit_mac_addr(struct hdd_adapter *adapter, struct sk_buff *skb,
if (QDF_NBUF_CB_GET_IS_BCAST(skb) || QDF_NBUF_CB_GET_IS_MCAST(skb))
is_mc_bc_addr = true;
if (adapter->device_mode == QDF_IBSS_MODE) {
if (is_mc_bc_addr)
qdf_copy_macaddr(mac_addr_tx_allowed,
&adapter->mac_addr);
else
qdf_copy_macaddr(mac_addr_tx_allowed,
(struct qdf_mac_addr *)skb->data);
} else if (adapter->device_mode == QDF_NDI_MODE &&
if (adapter->device_mode == QDF_NDI_MODE &&
hdd_is_xmit_allowed_on_ndi(adapter)) {
if (is_mc_bc_addr)
qdf_copy_macaddr(mac_addr_tx_allowed,

View file

@ -889,7 +889,7 @@
* @OUTPUT: None
*
* This IOCTL sets the data rate for multicast data. Note that this command
* is allowed only in STA, IBSS, or QCMobileAP mode
* is allowed only in STA or QCMobileAP mode
*
* @E.g: iwpriv wlan0 setMcRate <value>
*
@ -2015,27 +2015,6 @@
#define WE_GET_11W_INFO 9
#endif
#define WE_GET_STATES 10
/*
* <ioctl>
* getIbssSTAs - get ibss sta info
*
* @INPUT: None
*
* @OUTPUT: Give the MAC of the IBSS STA
* wlan0 getIbssSTAs:
* 1 .8c:fd:f0:01:9c:bf
*
* This IOCTL is used to get ibss sta info
*
* @E.g: iwpriv wlan0 getIbssSTAs
*
* Supported Feature: IBSS
*
* Usage: Internal/External
*
* </ioctl>
*/
#define WE_GET_IBSS_STA_INFO 11
/*
* <ioctl>
* getphymode - Get the current phymode.
@ -2156,28 +2135,7 @@
* </ioctl>
*/
#define WE_SET_REASSOC_TRIGGER 8
/*
* <ioctl>
* ibssPeerInfoAll - Print the ibss peers's MAC, rate and RSSI
*
* @INPUT: None
*
* @OUTPUT: print ibss peer in info logs
* peer_info->numIBSSPeers = 1
* PEER ADDR : 8c:fd:f0:01:9c:bf TxRate: 1 Mbps RSSI: -35
*
* This IOCTL is used to rint the ibss peers's MAC, rate and RSSI
* in info logs
*
* @E.g: iwpriv wlan0 ibssPeerInfoAll
*
* Supported Feature: IBSS
*
* Usage: Internal/External
*
* </ioctl>
*/
#define WE_IBSS_GET_PEER_INFO_ALL 10
/* Sub ioctls 11 to 16 are not used */
#define WE_GET_FW_PROFILE_DATA 18
/*
@ -3298,93 +3256,6 @@ int hdd_wlan_dump_stats(struct hdd_adapter *adapter, int value)
return ret;
}
#ifdef QCA_IBSS_SUPPORT
/**
* hdd_wlan_get_ibss_peer_info_all() - Print all IBSS peers
* @adapter: Adapter upon which the IBSS clients are active
*
* Return: QDF_STATUS_STATUS if the peer information was retrieved and
* displayed, otherwise an appropriate QDF_STATUS_E_* failure code.
*/
static QDF_STATUS hdd_wlan_get_ibss_peer_info_all(struct hdd_adapter *adapter)
{
QDF_STATUS status = QDF_STATUS_E_FAILURE;
mac_handle_t mac_handle = adapter->hdd_ctx->mac_handle;
struct hdd_station_ctx *sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
tSirPeerInfoRspParams *peer_info = &sta_ctx->ibss_peer_info;
struct qdf_mac_addr bcast = QDF_MAC_ADDR_BCAST_INIT;
int i;
INIT_COMPLETION(adapter->ibss_peer_info_comp);
status = sme_request_ibss_peer_info(mac_handle, adapter,
hdd_get_ibss_peer_info_cb,
true, bcast.bytes);
if (QDF_STATUS_SUCCESS == status) {
unsigned long rc;
rc = wait_for_completion_timeout
(&adapter->ibss_peer_info_comp,
msecs_to_jiffies(IBSS_PEER_INFO_REQ_TIMOEUT));
if (!rc) {
hdd_err("failed wait on ibss_peer_info_comp");
return QDF_STATUS_E_FAILURE;
}
/** Print the peer info */
hdd_debug("peer_info->numIBSSPeers = %d ",
(int)peer_info->numPeers);
for (i = 0; i < peer_info->numPeers; i++) {
uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
uint32_t tx_rate;
tx_rate = peer_info->peerInfoParams[i].txRate;
qdf_mem_copy(mac_addr,
peer_info->peerInfoParams[i].mac_addr,
sizeof(mac_addr));
hdd_debug(" PEER ADDR : %pM TxRate: %d Mbps RSSI: %d",
mac_addr, (int)tx_rate,
(int)peer_info->peerInfoParams[i].rssi);
}
} else {
hdd_warn("Warning: sme_request_ibss_peer_info Request failed");
}
return status;
}
#else
/**
* hdd_wlan_get_ibss_peer_info() - Print IBSS peer information
* @adapter: Adapter upon which the IBSS client is active
* @sta_id: Station index of the IBSS peer
*
* This function is dummy
*
* Return: QDF_STATUS_STATUS
*/
static inline QDF_STATUS
hdd_wlan_get_ibss_peer_info(struct hdd_adapter *adapter,
uint8_t sta_id)
{
return QDF_STATUS_SUCCESS;
}
/**
* hdd_wlan_get_ibss_peer_info_all() - Print all IBSS peers
* @adapter: Adapter upon which the IBSS clients are active
*
* This function is dummy
*
* Return: QDF_STATUS_STATUS
*/
static inline QDF_STATUS
hdd_wlan_get_ibss_peer_info_all(struct hdd_adapter *adapter)
{
return QDF_STATUS_SUCCESS;
}
#endif
/**
* hdd_get_ldpc() - Get adapter LDPC
* @adapter: adapter being queried
@ -6643,8 +6514,6 @@ hdd_connection_state_string(eConnectionState connection_state)
CASE_RETURN_STRING(eConnectionState_NotConnected);
CASE_RETURN_STRING(eConnectionState_Connecting);
CASE_RETURN_STRING(eConnectionState_Associated);
CASE_RETURN_STRING(eConnectionState_IbssDisconnected);
CASE_RETURN_STRING(eConnectionState_IbssConnected);
CASE_RETURN_STRING(eConnectionState_Disconnecting);
default:
return "UNKNOWN";
@ -7062,40 +6931,6 @@ static int __iw_get_char_setnone(struct net_device *dev,
break;
}
#endif
case WE_GET_IBSS_STA_INFO:
{
struct hdd_station_ctx *sta_ctx =
WLAN_HDD_GET_STATION_CTX_PTR(adapter);
int idx = 0;
int length = 0, buf = 0;
for (idx = 0; idx < MAX_PEERS; idx++) {
if (!hdd_is_valid_mac_address(
sta_ctx->conn_info.peer_macaddr[idx].bytes))
continue;
buf = snprintf
((extra + length),
WE_MAX_STR_LEN - length,
"\n" QDF_MAC_ADDR_STR "\n",
sta_ctx->conn_info.
peer_macaddr[idx].bytes[0],
sta_ctx->conn_info.
peer_macaddr[idx].bytes[1],
sta_ctx->conn_info.
peer_macaddr[idx].bytes[2],
sta_ctx->conn_info.
peer_macaddr[idx].bytes[3],
sta_ctx->conn_info.
peer_macaddr[idx].bytes[4],
sta_ctx->conn_info.
peer_macaddr[idx].bytes[5]
);
length += buf;
}
wrqu->data.length = strlen(extra) + 1;
break;
}
case WE_GET_PHYMODE:
{
bool ch_bond24 = false, ch_bond5g = false;
@ -7337,10 +7172,6 @@ static int __iw_setnone_getnone(struct net_device *dev,
0, DBG_CMD);
break;
case WE_IBSS_GET_PEER_INFO_ALL:
hdd_wlan_get_ibss_peer_info_all(adapter);
break;
case WE_SET_REASSOC_TRIGGER:
{
struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
@ -10576,11 +10407,6 @@ static const struct iw_priv_args we_private_args[] = {
IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN,
"get_cxn_info" },
{WE_GET_IBSS_STA_INFO,
0,
IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN,
"getIbssSTAs"},
{WE_GET_PHYMODE,
0,
IW_PRIV_TYPE_CHAR | WE_MAX_STR_LEN,
@ -10607,12 +10433,6 @@ static const struct iw_priv_args we_private_args[] = {
0,
""},
/* handlers for sub-ioctl */
{WE_IBSS_GET_PEER_INFO_ALL,
0,
0,
"ibssPeerInfoAll"},
{WE_GET_FW_PROFILE_DATA,
0,
0,