summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRajeev Kumar <rajekuma@qca.qualcomm.com>2013-12-05 19:12:42 -0800
committerPrakash Dhavali <pdhavali@qca.qualcomm.com>2013-12-08 02:47:07 -0800
commita07c6eb805161eded999555a88c361e9b44e4fb6 (patch)
tree10d148f4140342104c613f1d7435c692fba22b81
parent212bc1c386a7d0e0325ea7ab849c40556535cfbf (diff)
wlan: IBSS open/wep support using NL interface
Current driver does not work when we create/join the IBSS over NL interface. Modify driver to support IBSS using NL interface. Change-Id: Id958aff48c97a59f7872438fb87b4c62abb4689e CRs-Fixed: 584646
-rw-r--r--CORE/HDD/inc/wlan_hdd_cfg80211.h3
-rw-r--r--CORE/HDD/inc/wlan_hdd_main.h2
-rw-r--r--CORE/HDD/src/wlan_hdd_assoc.c65
-rw-r--r--CORE/HDD/src/wlan_hdd_cfg80211.c112
-rw-r--r--CORE/SME/src/csr/csrApiRoam.c1
5 files changed, 93 insertions, 90 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_cfg80211.h b/CORE/HDD/inc/wlan_hdd_cfg80211.h
index e67f226f8139..4faec258e1a6 100644
--- a/CORE/HDD/inc/wlan_hdd_cfg80211.h
+++ b/CORE/HDD/inc/wlan_hdd_cfg80211.h
@@ -157,6 +157,9 @@ extern void wlan_hdd_cfg80211_update_replayCounterCallback(void *callbackContext
tpSirGtkOffloadGetInfoRspParams pGtkOffloadGetInfoRsp);
#endif
+void hdd_select_cbmode( hdd_adapter_t *pAdapter,v_U8_t operationChannel);
+
+
#if defined(QCA_WIFI_2_0) && defined(QCA_WIFI_FTM) \
&& !defined(QCA_WIFI_ISOC) && defined(CONFIG_NL80211_TESTMODE)
void wlan_hdd_testmode_rx_event(void *buf, size_t buf_len);
diff --git a/CORE/HDD/inc/wlan_hdd_main.h b/CORE/HDD/inc/wlan_hdd_main.h
index 2ba9e7fbe358..851d46584569 100644
--- a/CORE/HDD/inc/wlan_hdd_main.h
+++ b/CORE/HDD/inc/wlan_hdd_main.h
@@ -533,6 +533,8 @@ struct hdd_station_ctx
#ifdef WLAN_FEATURE_GTK_OFFLOAD
tSirGtkOffloadParams gtkOffloadReqParams;
#endif
+ /*Increment whenever ibss New peer joins and departs the network */
+ int ibss_sta_generation;
};
#define BSS_STOP 0
diff --git a/CORE/HDD/src/wlan_hdd_assoc.c b/CORE/HDD/src/wlan_hdd_assoc.c
index 762689a7374d..433387ceb799 100644
--- a/CORE/HDD/src/wlan_hdd_assoc.c
+++ b/CORE/HDD/src/wlan_hdd_assoc.c
@@ -1031,7 +1031,7 @@ static VOS_STATUS hdd_roamRegisterSTA( hdd_adapter_t *pAdapter,
if (staDesc.wSTAType != WLAN_STA_IBSS)
VOS_ASSERT( fConnected );
- if ( !pRoamInfo->fAuthRequired )
+ if ( !pRoamInfo->fAuthRequired && (WLAN_STA_IBSS == staDesc.wSTAType) )
{
// Connections that do not need Upper layer auth, transition TL directly
// to 'Authenticated' state.
@@ -1047,7 +1047,7 @@ static VOS_STATUS hdd_roamRegisterSTA( hdd_adapter_t *pAdapter,
"at Join time", pHddStaCtx->conn_info.staId[0] );
vosStatus = WLANTL_ChangeSTAState( pHddCtx->pvosContext, staDesc.ucSTAId,
WLANTL_STA_CONNECTED );
- pHddStaCtx->conn_info.uIsAuthenticated = VOS_FALSE;
+ pHddStaCtx->conn_info.uIsAuthenticated = VOS_FALSE;
}
return( vosStatus );
@@ -1562,6 +1562,7 @@ static void hdd_RoamIbssIndicationHandler( hdd_adapter_t *pAdapter,
// 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:
{
hdd_context_t *pHddCtx = (hdd_context_t*)pAdapter->pHddCtx;
v_MACADDR_t broadcastMacAddr = VOS_MAC_ADDR_BROADCAST_INITIALIZER;
@@ -1895,9 +1896,9 @@ static eHalStatus roamRoamConnectStatusUpdateHandler( hdd_adapter_t *pAdapter, t
case eCSR_ROAM_RESULT_IBSS_NEW_PEER:
{
hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
+ struct station_info staInfo;
- VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_MED,
- "IBSS New Peer indication from SME "
+ pr_info ( "IBSS New Peer indication from SME "
"with peerMac " MAC_ADDRESS_STR " BSSID: " MAC_ADDRESS_STR " and stationID= %d",
MAC_ADDR_ARRAY(pRoamInfo->peerMac),
MAC_ADDR_ARRAY(pHddStaCtx->conn_info.bssId),
@@ -1928,6 +1929,14 @@ static eHalStatus roamRoamConnectStatusUpdateHandler( hdd_adapter_t *pAdapter, t
"Cannot register STA with TL for IBSS. Failed with vosStatus = %d [%08lX]",
vosStatus, vosStatus );
}
+ pHddStaCtx->ibss_sta_generation++;
+ memset(&staInfo, 0, sizeof(staInfo));
+ staInfo.filled = 0;
+ staInfo.generation = pHddStaCtx->ibss_sta_generation;
+
+ cfg80211_new_sta(pAdapter->dev,
+ (const u8 *)pRoamInfo->peerMac,
+ &staInfo, GFP_KERNEL);
netif_carrier_on(pAdapter->dev);
netif_tx_start_all_queues(pAdapter->dev);
@@ -1951,7 +1960,7 @@ static eHalStatus roamRoamConnectStatusUpdateHandler( hdd_adapter_t *pAdapter, t
"IBSS peer departed by cannot find peer in our registration table with TL" );
}
- VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_MED,
+ pr_info ( "IBSS Peer Departed from SME "
"IBSS Peer Departed from SME "
"with peerMac " MAC_ADDRESS_STR " BSSID: " MAC_ADDRESS_STR " and stationID= %d",
MAC_ADDR_ARRAY(pRoamInfo->peerMac),
@@ -1961,6 +1970,10 @@ static eHalStatus roamRoamConnectStatusUpdateHandler( hdd_adapter_t *pAdapter, t
hdd_roamDeregisterSTA( pAdapter, pRoamInfo->staId );
pHddCtx->sta_to_adapter[pRoamInfo->staId] = NULL;
+ pHddStaCtx->ibss_sta_generation++;
+ cfg80211_del_sta(pAdapter->dev,
+ (const u8 *)&pRoamInfo->peerMac,
+ GFP_KERNEL);
break;
}
@@ -3164,40 +3177,16 @@ int iw_set_essid(struct net_device *dev,
if ( eCSR_BSS_TYPE_START_IBSS == pRoamProfile->BSSType )
{
- v_U8_t iniDot11Mode = (WLAN_HDD_GET_CTX(pAdapter))->cfg_ini->dot11Mode;
- eHddDot11Mode hddDot11Mode = iniDot11Mode;
-
- switch ( iniDot11Mode )
- {
- case eHDD_DOT11_MODE_AUTO:
- case eHDD_DOT11_MODE_11ac:
- case eHDD_DOT11_MODE_11ac_ONLY:
-#ifdef WLAN_FEATURE_11AC
- hddDot11Mode = eHDD_DOT11_MODE_11ac;
-#else
- hddDot11Mode = eHDD_DOT11_MODE_11n;
-#endif
- break;
- case eHDD_DOT11_MODE_11n:
- case eHDD_DOT11_MODE_11n_ONLY:
- hddDot11Mode = eHDD_DOT11_MODE_11n;
- break;
- default:
- hddDot11Mode = iniDot11Mode;
- break;
- }
-
- /* This call decides required channel bonding mode */
- sme_SelectCBMode((WLAN_HDD_GET_CTX(pAdapter)->hHal),
- hdd_cfg_xlate_to_csr_phy_mode(hddDot11Mode),
- (WLAN_HDD_GET_CTX(pAdapter))->cfg_ini->AdHocChannel5G);
- }
- status = sme_RoamConnect( hHal,pAdapter->sessionId, &(pWextState->roamProfile),&roamId);
- pRoamProfile->ChannelInfo.ChannelList = NULL;
- pRoamProfile->ChannelInfo.numOfChannels = 0;
+ hdd_select_cbmode(pAdapter,
+ (WLAN_HDD_GET_CTX(pAdapter))->cfg_ini->AdHocChannel5G);
+ }
+ status = sme_RoamConnect( hHal,pAdapter->sessionId,
+ &(pWextState->roamProfile),&roamId);
+ pRoamProfile->ChannelInfo.ChannelList = NULL;
+ pRoamProfile->ChannelInfo.numOfChannels = 0;
- EXIT();
- return status;
+ EXIT();
+ return status;
}
/**---------------------------------------------------------------------------
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index 75838aa6e45a..17ee8926a8b4 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -4741,6 +4741,37 @@ free_mem:
return status;
}
+void hdd_select_cbmode( hdd_adapter_t *pAdapter,v_U8_t operationChannel)
+{
+ v_U8_t iniDot11Mode =
+ (WLAN_HDD_GET_CTX(pAdapter))->cfg_ini->dot11Mode;
+ eHddDot11Mode hddDot11Mode = iniDot11Mode;
+
+ switch ( iniDot11Mode )
+ {
+ case eHDD_DOT11_MODE_AUTO:
+ case eHDD_DOT11_MODE_11ac:
+ case eHDD_DOT11_MODE_11ac_ONLY:
+#ifdef WLAN_FEATURE_11AC
+ hddDot11Mode = eHDD_DOT11_MODE_11ac;
+#else
+ hddDot11Mode = eHDD_DOT11_MODE_11n;
+#endif
+ break;
+ case eHDD_DOT11_MODE_11n:
+ case eHDD_DOT11_MODE_11n_ONLY:
+ hddDot11Mode = eHDD_DOT11_MODE_11n;
+ break;
+ default:
+ hddDot11Mode = iniDot11Mode;
+ break;
+ }
+ /* This call decides required channel bonding mode */
+ sme_SelectCBMode((WLAN_HDD_GET_CTX(pAdapter)->hHal),
+ hdd_cfg_xlate_to_csr_phy_mode(hddDot11Mode),
+ operationChannel);
+}
+
/*
* FUNCTION: wlan_hdd_cfg80211_connect_start
* This function is used to start the association process
@@ -4905,7 +4936,10 @@ int wlan_hdd_cfg80211_connect_start( hdd_adapter_t *pAdapter,
pRoamProfile->ChannelInfo.ChannelList = NULL;
pRoamProfile->ChannelInfo.numOfChannels = 0;
}
-
+ if ( (WLAN_HDD_IBSS == pAdapter->device_mode) && operatingChannel )
+ {
+ hdd_select_cbmode(pAdapter,operatingChannel);
+ }
/* change conn_state to connecting before sme_RoamConnect(), because sme_RoamConnect()
* has a direct path to call hdd_smeRoamCallback(), which will change the conn_state
* If direct path, conn_state will be accordingly changed to NotConnected or Associated
@@ -5942,21 +5976,10 @@ static int wlan_hdd_cfg80211_join_ibss( struct wiphy *wiphy,
#endif
{
u8 channelNum;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0))
- if (IEEE80211_BAND_5GHZ == params->chandef.chan->band)
-#else
- if (IEEE80211_BAND_5GHZ == params->channel->band)
-#endif
- {
- hddLog(VOS_TRACE_LEVEL_ERROR,
- "%s: IBSS join is called with unsupported band %d",
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0))
- __func__, params->chandef.chan->band);
-#else
- __func__, params->channel->band);
-#endif
- return -EOPNOTSUPP;
- }
+ v_U32_t numChans = WNI_CFG_VALID_CHANNEL_LIST_LEN;
+ v_U8_t validChan[WNI_CFG_VALID_CHANNEL_LIST_LEN];
+ tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter);
+ int indx;
/* Get channel number */
channelNum =
@@ -5967,49 +5990,34 @@ static int wlan_hdd_cfg80211_join_ibss( struct wiphy *wiphy,
params->channel->center_freq);
#endif
- /*TODO: use macro*/
- if (14 >= channelNum)
+ if (0 != ccmCfgGetStr(hHal, WNI_CFG_VALID_CHANNEL_LIST,
+ validChan, &numChans))
{
- v_U32_t numChans = WNI_CFG_VALID_CHANNEL_LIST_LEN;
- v_U8_t validChan[WNI_CFG_VALID_CHANNEL_LIST_LEN];
- tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter);
- int indx;
-
- if (0 != ccmCfgGetStr(hHal, WNI_CFG_VALID_CHANNEL_LIST,
- validChan, &numChans))
- {
- hddLog(VOS_TRACE_LEVEL_ERROR, "%s: No valid channel list",
- __func__);
- return -EOPNOTSUPP;
- }
+ hddLog(VOS_TRACE_LEVEL_ERROR, "%s: No valid channel list",
+ __func__);
+ return -EOPNOTSUPP;
+ }
- for (indx = 0; indx < numChans; indx++)
- {
- if (channelNum == validChan[indx])
- {
- break;
- }
- }
- if (indx >= numChans)
+ for (indx = 0; indx < numChans; indx++)
+ {
+ if (channelNum == validChan[indx])
{
- hddLog(VOS_TRACE_LEVEL_ERROR, "%s: Not valid Channel %d",
- __func__, channelNum);
- return -EINVAL;
+ break;
}
- /* Set the Operational Channel */
- hddLog(VOS_TRACE_LEVEL_INFO_HIGH, "%s: set channel %d", __func__,
- channelNum);
- pRoamProfile->ChannelInfo.numOfChannels = 1;
- pHddStaCtx->conn_info.operationChannel = channelNum;
- pRoamProfile->ChannelInfo.ChannelList =
- &pHddStaCtx->conn_info.operationChannel;
}
- else
+ if (indx >= numChans)
{
- hddLog(VOS_TRACE_LEVEL_ERROR, "%s: Not valid Channel %hu",
+ hddLog(VOS_TRACE_LEVEL_ERROR, "%s: Not valid Channel %d",
__func__, channelNum);
return -EINVAL;
}
+ /* Set the Operational Channel */
+ hddLog(VOS_TRACE_LEVEL_INFO_HIGH, "%s: set channel %d", __func__,
+ channelNum);
+ pRoamProfile->ChannelInfo.numOfChannels = 1;
+ pHddStaCtx->conn_info.operationChannel = channelNum;
+ pRoamProfile->ChannelInfo.ChannelList =
+ &pHddStaCtx->conn_info.operationChannel;
}
/* Initialize security parameters */
@@ -6023,7 +6031,8 @@ static int wlan_hdd_cfg80211_join_ibss( struct wiphy *wiphy,
/* Issue connect start */
status = wlan_hdd_cfg80211_connect_start(pAdapter, params->ssid,
- params->ssid_len, params->bssid, 0);
+ params->ssid_len, params->bssid,
+ pHddStaCtx->conn_info.operationChannel);
if (NULL != params->bssid &&
pHddCtx->cfg_ini->isCoalesingInIBSSAllowed == 0 &&
@@ -6032,7 +6041,6 @@ static int wlan_hdd_cfg80211_join_ibss( struct wiphy *wiphy,
vos_mem_free(params->bssid);
}
-
if (0 > status)
{
hddLog(VOS_TRACE_LEVEL_ERROR, "%s: connect failed", __func__);
diff --git a/CORE/SME/src/csr/csrApiRoam.c b/CORE/SME/src/csr/csrApiRoam.c
index c6dfcd6dc708..a163685dd8c0 100644
--- a/CORE/SME/src/csr/csrApiRoam.c
+++ b/CORE/SME/src/csr/csrApiRoam.c
@@ -5496,6 +5496,7 @@ static tANI_BOOLEAN csrRoamProcessResults( tpAniSirGlobal pMac, tSmeCmd *pComman
roamInfo.pBssDesc = pSirBssDesc;
}
roamInfo.staId = (tANI_U8)pSmeStartBssRsp->staId;
+ vos_mem_copy (roamInfo.bssid, pSirBssDesc->bssId, sizeof(tCsrBssid));
//Remove this code once SLM_Sessionization is supported
//BMPS_WORKAROUND_NOT_NEEDED
if(!IS_FEATURE_SUPPORTED_BY_FW(SLM_SESSIONIZATION) &&