2 ** $Id: @(#) gl_p2p_cfg80211.c@@
5 /*! \file gl_p2p_cfg80211.c
6 \brief Main routines of Linux driver interface for Wi-Fi Direct
7 using cfg80211 interface
9 This file contains the main routines of Linux driver for MediaTek Inc. 802.11
10 Wireless LAN Adapters.
16 ** $Log: gl_p2p_cfg80211.c $
18 ** 01 30 2013 yuche.tsai
19 ** [ALPS00455459] [GN_WIFI]??wifi direct???????????
20 ** Fix possible race condition under GO mode.
22 ** 09 12 2012 wcpadmin
23 ** [ALPS00276400] Remove MTK copyright and legal header on GPL/LGPL related packages
27 ** [ALPS00351547] [6577JB][WiFi direct]The 3rd device fail to establish p2p connection with GO sometimes
28 ** sync with the ICS code.
30 ** 08 31 2012 yuche.tsai
31 ** [ALPS00349585] [6577JB][WiFi direct][KE]Establish p2p connection while both device have connected to AP previously,one device reboots automatically with KE
32 ** Fix possible KE when concurrent & disconnect.
34 ** 08 21 2012 yuche.tsai
36 ** Fix compile warning.
38 ** 08 20 2012 yuche.tsai
40 ** Fix possible KE issue.
42 ** 08 17 2012 yuche.tsai
44 ** Fix compile warning.
46 ** 08 16 2012 yuche.tsai
48 ** Fix compile warning.
50 ** 08 14 2012 yuche.tsai
52 ** Fix p2p bug find on ALPS.JB trunk.
54 ** 07 26 2012 yuche.tsai
55 ** [ALPS00324337] [ALPS.JB][Hot-Spot] Driver update for Hot-Spot
56 ** Update driver code of ALPS.JB for hot-spot.
58 ** 07 19 2012 yuche.tsai
60 ** Code update for JB.
62 * 07 17 2012 yuche.tsai
64 * Fix compile error for JB.
66 * 07 17 2012 yuche.tsai
68 * Compile no error before trial run.
70 * 09 21 2010 kevin.huang
71 * [WCXRP00000054] [MT6620 Wi-Fi][Driver] Restructure driver for second Interface
72 * Isolate P2P related function for Hardware Software Bundle
76 * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
78 * 06 06 2010 kevin.huang
79 * [WPD00003832][MT6620 5931] Create driver base
80 * [MT6620 5931] Create driver base
83 * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support
84 * add cfg80211 interface, which is to replace WE, for further extension
89 /*******************************************************************************
90 * C O M P I L E R F L A G S
91 ********************************************************************************
94 /*******************************************************************************
95 * E X T E R N A L R E F E R E N C E S
96 ********************************************************************************
101 #if CFG_ENABLE_WIFI_DIRECT && CFG_ENABLE_WIFI_DIRECT_CFG_80211
102 #include <linux/kernel.h>
103 #include <linux/netdevice.h>
104 #include <linux/wireless.h>
105 #include <linux/ieee80211.h>
106 #include <net/cfg80211.h>
110 #pragma GCC diagnostic ignored "-Wformat"
113 /*******************************************************************************
115 ********************************************************************************
118 /*******************************************************************************
120 ********************************************************************************
123 /*******************************************************************************
124 * P U B L I C D A T A
125 ********************************************************************************
128 /*******************************************************************************
129 * P R I V A T E D A T A
130 ********************************************************************************
133 /*******************************************************************************
135 ********************************************************************************
138 /*******************************************************************************
139 * F U N C T I O N D E C L A R A T I O N S
140 ********************************************************************************
145 mtk_p2p_cfg80211func_channel_format_switch(
146 IN struct ieee80211_channel *channel,
147 IN enum nl80211_channel_type channel_type,
148 IN P_RF_CHANNEL_INFO_T prRfChnlInfo,
149 IN P_ENUM_CHNL_EXT_T prChnlSco
152 /*******************************************************************************
154 ********************************************************************************
157 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 32)
158 int mtk_p2p_cfg80211_add_key(
160 struct net_device *ndev,
164 struct key_params *params
167 P_GLUE_INFO_T prGlueInfo = NULL;
168 INT_32 i4Rslt = -EINVAL;
169 WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS;
170 UINT_32 u4BufLen = 0;
171 P2P_PARAM_KEY_T rKey;
175 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
177 kalMemZero(&rKey, sizeof(P2P_PARAM_KEY_T));
179 rKey.u4KeyIndex = key_index;
181 memcpy(rKey.arBSSID, mac_addr, ETH_ALEN);
182 if ((rKey.arBSSID[0] == 0x00) && (rKey.arBSSID[1] == 0x00) && (rKey.arBSSID[2] == 0x00) &&
183 (rKey.arBSSID[3] == 0x00) && (rKey.arBSSID[4] == 0x00) && (rKey.arBSSID[5] == 0x00)) {
184 rKey.arBSSID[0] = 0xff;
185 rKey.arBSSID[1] = 0xff;
186 rKey.arBSSID[2] = 0xff;
187 rKey.arBSSID[3] = 0xff;
188 rKey.arBSSID[4] = 0xff;
189 rKey.arBSSID[5] = 0xff;
191 if (rKey.arBSSID[0] != 0xFF) {
192 rKey.u4KeyIndex |= BIT(31);
193 if ((rKey.arBSSID[0] != 0x00) || (rKey.arBSSID[1] != 0x00) || (rKey.arBSSID[2] != 0x00) ||
194 (rKey.arBSSID[3] != 0x00) || (rKey.arBSSID[4] != 0x00) || (rKey.arBSSID[5] != 0x00))
195 rKey.u4KeyIndex |= BIT(30);
198 rKey.u4KeyIndex |= BIT(31);
202 rKey.arBSSID[0] = 0xff;
203 rKey.arBSSID[1] = 0xff;
204 rKey.arBSSID[2] = 0xff;
205 rKey.arBSSID[3] = 0xff;
206 rKey.arBSSID[4] = 0xff;
207 rKey.arBSSID[5] = 0xff;
208 rKey.u4KeyIndex |= BIT(31); //????
212 //rKey.aucKeyMaterial[0] = kalMemAlloc(params->key_len, VIR_MEM_TYPE);
213 kalMemCopy(rKey.aucKeyMaterial, params->key, params->key_len);
215 rKey.u4KeyLength = params->key_len;
216 rKey.u4Length = ((UINT_32)&(((P_P2P_PARAM_KEY_T)0)->aucKeyMaterial)) + rKey.u4KeyLength;
218 rStatus = kalIoctl(prGlueInfo,
227 if (rStatus == WLAN_STATUS_SUCCESS)
234 int mtk_p2p_cfg80211_get_key(
236 struct net_device *ndev,
241 void (*callback)(void *cookie, struct key_params*)
244 P_GLUE_INFO_T prGlueInfo = NULL;
248 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
250 // not implemented yet
255 int mtk_p2p_cfg80211_del_key(
257 struct net_device *ndev,
263 P_GLUE_INFO_T prGlueInfo = NULL;
264 PARAM_REMOVE_KEY_T prRemoveKey;
265 INT_32 i4Rslt = -EINVAL;
266 WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS;
267 UINT_32 u4BufLen = 0;
271 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
273 kalMemZero(&prRemoveKey, sizeof(PARAM_REMOVE_KEY_T));
275 memcpy(prRemoveKey.arBSSID, mac_addr, PARAM_MAC_ADDR_LEN);
276 prRemoveKey.u4KeyIndex = key_index;
277 prRemoveKey.u4Length = sizeof(PARAM_REMOVE_KEY_T);
279 rStatus = kalIoctl(prGlueInfo,
280 wlanoidSetRemoveP2PKey,
282 prRemoveKey.u4Length,
289 if (rStatus == WLAN_STATUS_SUCCESS)
297 mtk_p2p_cfg80211_set_default_key (
299 struct net_device *netdev,
305 P_GLUE_INFO_T prGlueInfo = NULL;
309 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
311 // not implemented yet
316 int mtk_p2p_cfg80211_get_station(
318 struct net_device *ndev,
320 struct station_info *sinfo
323 INT_32 i4RetRslt = -EINVAL;
324 P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL;
325 P_GL_P2P_INFO_T prP2pGlueInfo = (P_GL_P2P_INFO_T)NULL;
326 P2P_STATION_INFO_T rP2pStaInfo;
331 if ((wiphy == NULL) ||
338 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_get_station\n"));
340 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
341 prP2pGlueInfo = prGlueInfo->prP2PInfo;
345 /* Get station information. */
346 /* 1. Inactive time? */
347 p2pFuncGetStationInfo(prGlueInfo->prAdapter,
352 sinfo->filled |= STATION_INFO_INACTIVE_TIME;
353 sinfo->inactive_time = rP2pStaInfo.u4InactiveTime;
354 sinfo->generation = prP2pGlueInfo->i4Generation;
363 mtk_p2p_cfg80211_scan (
365 struct net_device *ndev,
366 struct cfg80211_scan_request *request
369 P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL;
370 P_GL_P2P_INFO_T prP2pGlueInfo = (P_GL_P2P_INFO_T)NULL;
371 P_MSG_P2P_SCAN_REQUEST_T prMsgScanRequest = (P_MSG_P2P_SCAN_REQUEST_T)NULL;
372 UINT_32 u4MsgSize = 0, u4Idx = 0;
373 INT_32 i4RetRslt = -EINVAL;
374 P_RF_CHANNEL_INFO_T prRfChannelInfo = (P_RF_CHANNEL_INFO_T)NULL;
375 P_P2P_SSID_STRUCT_T prSsidStruct = (P_P2P_SSID_STRUCT_T)NULL;
376 struct ieee80211_channel *prChannel = NULL;
377 struct cfg80211_ssid *prSsid = NULL;
379 /* [---------Channel---------] [---------SSID---------][---------IE---------] */
383 if ((wiphy == NULL) || (request == NULL)) {
387 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
389 prP2pGlueInfo = prGlueInfo->prP2PInfo;
391 if (prP2pGlueInfo == NULL) {
396 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_scan.\n"));
399 if (prP2pGlueInfo->prScanRequest != NULL) {
400 /* There have been a scan request on-going processing. */
401 DBGLOG(P2P, TRACE, ("There have been a scan request on-going processing.\n"));
405 prP2pGlueInfo->prScanRequest = request;
407 /* Should find out why the n_channels so many? */
408 if (request->n_channels > MAXIMUM_OPERATION_CHANNEL_LIST) {
409 request->n_channels = MAXIMUM_OPERATION_CHANNEL_LIST;
410 DBGLOG(P2P, TRACE, ("Channel list exceed the maximun support.\n"));
413 u4MsgSize = sizeof(MSG_P2P_SCAN_REQUEST_T) +
414 (request->n_channels * sizeof(RF_CHANNEL_INFO_T)) +
415 (request->n_ssids * sizeof(PARAM_SSID_T)) +
418 prMsgScanRequest = cnmMemAlloc(prGlueInfo->prAdapter, RAM_TYPE_MSG, u4MsgSize);
420 if (prMsgScanRequest == NULL) {
426 DBGLOG(P2P, TRACE, ("Generating scan request message.\n"));
428 prMsgScanRequest->rMsgHdr.eMsgId = MID_MNY_P2P_DEVICE_DISCOVERY;
432 DBGLOG(P2P, TRACE, ("Requesting channel number:%d.\n", request->n_channels));
434 for (u4Idx = 0; u4Idx < request->n_channels; u4Idx++) {
435 /* Translate Freq from MHz to channel number. */
436 prRfChannelInfo = &(prMsgScanRequest->arChannelListInfo[u4Idx]);
437 prChannel = request->channels[u4Idx];
439 prRfChannelInfo->ucChannelNum = nicFreq2ChannelNum(prChannel->center_freq * 1000);
440 DBGLOG(P2P, TRACE, ("Scanning Channel:%d, freq: %d\n",
441 prRfChannelInfo->ucChannelNum,
442 prChannel->center_freq));
443 switch (prChannel->band) {
444 case IEEE80211_BAND_2GHZ:
445 prRfChannelInfo->eBand = BAND_2G4;
447 case IEEE80211_BAND_5GHZ:
448 prRfChannelInfo->eBand = BAND_5G;
451 DBGLOG(P2P, TRACE, ("UNKNOWN Band info from supplicant\n"));
452 prRfChannelInfo->eBand = BAND_NULL;
459 prMsgScanRequest->u4NumChannel = request->n_channels;
461 DBGLOG(P2P, TRACE, ("Finish channel list.\n"));
464 prSsid = request->ssids;
465 prSsidStruct = (P_P2P_SSID_STRUCT_T)prRfChannelInfo;
466 if (request->n_ssids) {
467 ASSERT(prSsidStruct == &(prMsgScanRequest->arChannelListInfo[u4Idx]));
468 prMsgScanRequest->prSSID = prSsidStruct;
471 for (u4Idx = 0; u4Idx < request->n_ssids; u4Idx++) {
472 COPY_SSID(prSsidStruct->aucSsid,
473 prSsidStruct->ucSsidLen,
474 request->ssids->ssid,
475 request->ssids->ssid_len);
481 prMsgScanRequest->i4SsidNum = request->n_ssids;
483 DBGLOG(P2P, TRACE, ("Finish SSID list:%d.\n", request->n_ssids));
486 prMsgScanRequest->pucIEBuf = (PUINT_8)prSsidStruct;
487 if (request->ie_len) {
488 kalMemCopy(prMsgScanRequest->pucIEBuf, request->ie, request->ie_len);
489 prMsgScanRequest->u4IELen = request->ie_len;
492 DBGLOG(P2P, TRACE, ("Finish IE Buffer.\n"));
495 mboxSendMsg(prGlueInfo->prAdapter,
497 (P_MSG_HDR_T)prMsgScanRequest,
498 MSG_SEND_METHOD_BUF);
504 } /* mtk_p2p_cfg80211_scan */
506 int mtk_p2p_cfg80211_set_wiphy_params(
511 INT_32 i4Rslt = -EINVAL;
512 P_GLUE_INFO_T prGlueInfo = NULL;
520 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_set_wiphy_params\n"));
521 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
523 if (changed & WIPHY_PARAM_RETRY_SHORT) {
525 DBGLOG(P2P, TRACE, ("The RETRY short param is changed.\n"));
528 if (changed & WIPHY_PARAM_RETRY_LONG) {
530 DBGLOG(P2P, TRACE, ("The RETRY long param is changed.\n"));
534 if (changed & WIPHY_PARAM_FRAG_THRESHOLD) {
536 DBGLOG(P2P, TRACE, ("The RETRY fragmentation threshold is changed.\n"));
539 if (changed & WIPHY_PARAM_RTS_THRESHOLD) {
541 DBGLOG(P2P, TRACE, ("The RETRY RTS threshold is changed.\n"));
544 if (changed & WIPHY_PARAM_COVERAGE_CLASS) {
546 DBGLOG(P2P, TRACE, ("The coverage class is changed???\n"));
556 } /* mtk_p2p_cfg80211_set_wiphy_params */
561 mtk_p2p_cfg80211_join_ibss(
563 struct net_device *dev,
564 struct cfg80211_ibss_params *params
567 P_GLUE_INFO_T prGlueInfo = NULL;
571 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
573 // not implemented yet
579 mtk_p2p_cfg80211_leave_ibss(
581 struct net_device *dev
584 P_GLUE_INFO_T prGlueInfo = NULL;
588 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
590 // not implemented yet
596 mtk_p2p_cfg80211_set_txpower(
598 enum nl80211_tx_power_setting type,
602 P_GLUE_INFO_T prGlueInfo = NULL;
606 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
608 // not implemented yet
614 mtk_p2p_cfg80211_get_txpower(
619 P_GLUE_INFO_T prGlueInfo = NULL;
623 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
625 // not implemented yet
631 mtk_p2p_cfg80211_set_power_mgmt(
633 struct net_device *dev,
638 P_GLUE_INFO_T prGlueInfo = NULL;
642 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
644 // not implemented yet
650 //&&&&&&&&&&&&&&&&&&&&&&&&&& Add for ICS Wi-Fi Direct Support. &&&&&&&&&&&&&&&&&&&&&&&
651 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
653 mtk_p2p_cfg80211_start_ap (
655 struct net_device *dev,
656 struct cfg80211_ap_settings *settings
659 P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL;
660 INT_32 i4Rslt = -EINVAL;
661 P_MSG_P2P_BEACON_UPDATE_T prP2pBcnUpdateMsg = (P_MSG_P2P_BEACON_UPDATE_T)NULL;
662 P_MSG_P2P_START_AP_T prP2pStartAPMsg = (P_MSG_P2P_START_AP_T)NULL;
663 PUINT_8 pucBuffer = (PUINT_8)NULL;
664 // P_IE_SSID_T prSsidIE = (P_IE_SSID_T)NULL;
667 if ((wiphy == NULL) || (settings == NULL)) {
671 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_start_ap.\n"));
672 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
674 prP2pBcnUpdateMsg = (P_MSG_P2P_BEACON_UPDATE_T)cnmMemAlloc(
675 prGlueInfo->prAdapter,
677 (sizeof(MSG_P2P_BEACON_UPDATE_T) + settings->beacon.head_len + settings->beacon.tail_len));
679 if (prP2pBcnUpdateMsg == NULL) {
686 prP2pBcnUpdateMsg->rMsgHdr.eMsgId = MID_MNY_P2P_BEACON_UPDATE;
687 pucBuffer = prP2pBcnUpdateMsg->aucBuffer;
689 if (settings->beacon.head_len != 0) {
690 kalMemCopy(pucBuffer, settings->beacon.head, settings->beacon.head_len);
692 prP2pBcnUpdateMsg->u4BcnHdrLen = settings->beacon.head_len;
694 prP2pBcnUpdateMsg->pucBcnHdr = pucBuffer;
696 pucBuffer = (PUINT_8)((UINT_32)pucBuffer + (UINT_32)settings->beacon.head_len);
699 prP2pBcnUpdateMsg->u4BcnHdrLen = 0;
701 prP2pBcnUpdateMsg->pucBcnHdr = NULL;
704 if (settings->beacon.tail_len != 0) {
705 UINT_8 ucLen = settings->beacon.tail_len;
707 prP2pBcnUpdateMsg->pucBcnBody = pucBuffer;
710 // IEEE 802.11 2007 - 7.3.2.6
711 TIM_IE(pucBuffer)->ucId = ELEM_ID_TIM;
712 TIM_IE(pucBuffer)->ucLength = (3 + MAX_LEN_TIM_PARTIAL_BMP)/*((u4N2 - u4N1) + 4)*/; // NOTE: fixed PVB length (AID is allocated from 8 ~ 15 only)
713 TIM_IE(pucBuffer)->ucDTIMCount = 0/*prBssInfo->ucDTIMCount*/; // will be overwrite by FW
714 TIM_IE(pucBuffer)->ucDTIMPeriod = 1;
715 TIM_IE(pucBuffer)->ucBitmapControl = 0/*ucBitmapControl | (UINT_8)u4N1*/; // will be overwrite by FW
716 ucLen += IE_SIZE(pucBuffer);
717 pucBuffer += IE_SIZE(pucBuffer);
719 kalMemCopy(pucBuffer, settings->beacon.tail, settings->beacon.tail_len);
721 prP2pBcnUpdateMsg->u4BcnBodyLen = ucLen;
724 prP2pBcnUpdateMsg->u4BcnBodyLen = 0;
726 prP2pBcnUpdateMsg->pucBcnBody = NULL;
730 mboxSendMsg(prGlueInfo->prAdapter,
732 (P_MSG_HDR_T)prP2pBcnUpdateMsg,
733 MSG_SEND_METHOD_BUF);
736 prP2pStartAPMsg = (P_MSG_P2P_START_AP_T)cnmMemAlloc(
737 prGlueInfo->prAdapter,
739 sizeof(MSG_P2P_START_AP_T));
741 if (prP2pStartAPMsg == NULL) {
747 prP2pStartAPMsg->rMsgHdr.eMsgId = MID_MNY_P2P_START_AP;
749 prP2pStartAPMsg->fgIsPrivacy = settings->privacy;
751 prP2pStartAPMsg->u4BcnInterval = settings->beacon_interval;
753 prP2pStartAPMsg->u4DtimPeriod = settings->dtim_period;
756 prP2pStartAPMsg->ucHiddenSsidType = settings->hidden_ssid;
758 COPY_SSID(prP2pStartAPMsg->aucSsid,
759 prP2pStartAPMsg->u2SsidLen,
763 mboxSendMsg(prGlueInfo->prAdapter,
765 (P_MSG_HDR_T)prP2pStartAPMsg,
766 MSG_SEND_METHOD_BUF);
775 /////////////////////////
777 * struct cfg80211_ap_settings - AP configuration
779 * Used to configure an AP interface.
781 * @beacon: beacon data
782 * @beacon_interval: beacon interval
783 * @dtim_period: DTIM period
784 * @ssid: SSID to be used in the BSS (note: may be %NULL if not provided from
786 * @ssid_len: length of @ssid
787 * @hidden_ssid: whether to hide the SSID in Beacon/Probe Response frames
788 * @crypto: crypto settings
789 * @privacy: the BSS uses privacy
790 * @auth_type: Authentication type (algorithm)
791 * @inactivity_timeout: time in seconds to determine station's inactivity.
793 // struct cfg80211_ap_settings {
794 // struct cfg80211_beacon_data beacon;
796 // int beacon_interval, dtim_period;
799 // enum nl80211_hidden_ssid hidden_ssid;
800 // struct cfg80211_crypto_settings crypto;
802 // enum nl80211_auth_type auth_type;
803 // int inactivity_timeout;
808 } /* mtk_p2p_cfg80211_start_ap */
812 mtk_p2p_cfg80211_change_beacon (
814 struct net_device *dev,
815 struct cfg80211_beacon_data *info
818 P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL;
819 INT_32 i4Rslt = -EINVAL;
820 P_MSG_P2P_BEACON_UPDATE_T prP2pBcnUpdateMsg = (P_MSG_P2P_BEACON_UPDATE_T)NULL;
821 PUINT_8 pucBuffer = (PUINT_8)NULL;
824 if ((wiphy == NULL) || (info == NULL)) {
828 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_change_beacon.\n"));
829 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
831 prP2pBcnUpdateMsg = (P_MSG_P2P_BEACON_UPDATE_T)cnmMemAlloc(
832 prGlueInfo->prAdapter,
834 (sizeof(MSG_P2P_BEACON_UPDATE_T) + info->head_len + info->tail_len));
837 if (prP2pBcnUpdateMsg == NULL) {
843 prP2pBcnUpdateMsg->rMsgHdr.eMsgId = MID_MNY_P2P_BEACON_UPDATE;
844 pucBuffer = prP2pBcnUpdateMsg->aucBuffer;
846 if (info->head_len != 0) {
847 kalMemCopy(pucBuffer, info->head, info->head_len);
849 prP2pBcnUpdateMsg->u4BcnHdrLen = info->head_len;
851 prP2pBcnUpdateMsg->pucBcnHdr = pucBuffer;
853 pucBuffer = (PUINT_8)((UINT_32)pucBuffer + (UINT_32)info->head_len);
856 prP2pBcnUpdateMsg->u4BcnHdrLen = 0;
858 prP2pBcnUpdateMsg->pucBcnHdr = NULL;
861 if (info->tail_len != 0) {
862 UINT_8 ucLen = info->tail_len;
864 prP2pBcnUpdateMsg->pucBcnBody = pucBuffer;
867 // IEEE 802.11 2007 - 7.3.2.6
868 TIM_IE(pucBuffer)->ucId = ELEM_ID_TIM;
869 TIM_IE(pucBuffer)->ucLength = (3 + MAX_LEN_TIM_PARTIAL_BMP)/*((u4N2 - u4N1) + 4)*/; // NOTE: fixed PVB length (AID is allocated from 8 ~ 15 only)
870 TIM_IE(pucBuffer)->ucDTIMCount = 0/*prBssInfo->ucDTIMCount*/; // will be overwrite by FW
871 TIM_IE(pucBuffer)->ucDTIMPeriod = 1;
872 TIM_IE(pucBuffer)->ucBitmapControl = 0/*ucBitmapControl | (UINT_8)u4N1*/; // will be overwrite by FW
873 ucLen += IE_SIZE(pucBuffer);
874 pucBuffer += IE_SIZE(pucBuffer);
876 kalMemCopy(pucBuffer, info->tail, info->tail_len);
878 prP2pBcnUpdateMsg->u4BcnBodyLen = ucLen;
881 prP2pBcnUpdateMsg->u4BcnBodyLen = 0;
883 prP2pBcnUpdateMsg->pucBcnBody = NULL;
887 mboxSendMsg(prGlueInfo->prAdapter,
889 (P_MSG_HDR_T)prP2pBcnUpdateMsg,
890 MSG_SEND_METHOD_BUF);
892 ////////////////////////////
894 * struct cfg80211_beacon_data - beacon data
895 * @head: head portion of beacon (before TIM IE)
896 * or %NULL if not changed
897 * @tail: tail portion of beacon (after TIM IE)
898 * or %NULL if not changed
899 * @head_len: length of @head
900 * @tail_len: length of @tail
901 * @beacon_ies: extra information element(s) to add into Beacon frames or %NULL
902 * @beacon_ies_len: length of beacon_ies in octets
903 * @proberesp_ies: extra information element(s) to add into Probe Response
905 * @proberesp_ies_len: length of proberesp_ies in octets
906 * @assocresp_ies: extra information element(s) to add into (Re)Association
907 * Response frames or %NULL
908 * @assocresp_ies_len: length of assocresp_ies in octets
909 * @probe_resp_len: length of probe response template (@probe_resp)
910 * @probe_resp: probe response template (AP mode only)
912 //struct cfg80211_beacon_data {
913 // const u8 *head, *tail;
914 // const u8 *beacon_ies;
915 // const u8 *proberesp_ies;
916 // const u8 *assocresp_ies;
917 // const u8 *probe_resp;
919 // size_t head_len, tail_len;
920 // size_t beacon_ies_len;
921 // size_t proberesp_ies_len;
922 // size_t assocresp_ies_len;
923 // size_t probe_resp_len;
926 ////////////////////////////
931 } /* mtk_p2p_cfg80211_change_beacon */
935 mtk_p2p_cfg80211_add_set_beacon (
937 struct net_device *dev,
938 struct beacon_parameters *info
941 P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL;
942 INT_32 i4Rslt = -EINVAL;
943 P_MSG_P2P_BEACON_UPDATE_T prP2pBcnUpdateMsg = (P_MSG_P2P_BEACON_UPDATE_T)NULL;
944 P_MSG_P2P_START_AP_T prP2pStartAPMsg = (P_MSG_P2P_START_AP_T)NULL;
945 PUINT_8 pucBuffer = (PUINT_8)NULL;
946 P_IE_SSID_T prSsidIE = (P_IE_SSID_T)NULL;
949 if ((wiphy == NULL) || (info == NULL)) {
953 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_add_set_beacon.\n"));
954 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
956 prP2pBcnUpdateMsg = (P_MSG_P2P_BEACON_UPDATE_T)cnmMemAlloc(
957 prGlueInfo->prAdapter,
959 (sizeof(MSG_P2P_BEACON_UPDATE_T) + info->head_len + info->tail_len));
961 if (prP2pBcnUpdateMsg == NULL) {
968 prP2pBcnUpdateMsg->rMsgHdr.eMsgId = MID_MNY_P2P_BEACON_UPDATE;
969 pucBuffer = prP2pBcnUpdateMsg->aucBuffer;
971 if (info->head_len != 0) {
972 kalMemCopy(pucBuffer, info->head, info->head_len);
974 prP2pBcnUpdateMsg->u4BcnHdrLen = info->head_len;
976 prP2pBcnUpdateMsg->pucBcnHdr = pucBuffer;
978 pucBuffer = (PUINT_8)((UINT_32)pucBuffer + (UINT_32)info->head_len);
981 prP2pBcnUpdateMsg->u4BcnHdrLen = 0;
983 prP2pBcnUpdateMsg->pucBcnHdr = NULL;
986 if (info->tail_len != 0) {
987 UINT_8 ucLen = info->tail_len;
989 prP2pBcnUpdateMsg->pucBcnBody = pucBuffer;
992 // IEEE 802.11 2007 - 7.3.2.6
993 TIM_IE(pucBuffer)->ucId = ELEM_ID_TIM;
994 TIM_IE(pucBuffer)->ucLength = (3 + MAX_LEN_TIM_PARTIAL_BMP)/*((u4N2 - u4N1) + 4)*/; // NOTE: fixed PVB length (AID is allocated from 8 ~ 15 only)
995 TIM_IE(pucBuffer)->ucDTIMCount = 0/*prBssInfo->ucDTIMCount*/; // will be overwrite by FW
996 TIM_IE(pucBuffer)->ucDTIMPeriod = 1;
997 TIM_IE(pucBuffer)->ucBitmapControl = 0/*ucBitmapControl | (UINT_8)u4N1*/; // will be overwrite by FW
998 ucLen += IE_SIZE(pucBuffer);
999 pucBuffer += IE_SIZE(pucBuffer);
1001 kalMemCopy(pucBuffer, info->tail, info->tail_len);
1003 prP2pBcnUpdateMsg->u4BcnBodyLen = ucLen;
1006 prP2pBcnUpdateMsg->u4BcnBodyLen = 0;
1008 prP2pBcnUpdateMsg->pucBcnBody = NULL;
1012 mboxSendMsg(prGlueInfo->prAdapter,
1014 (P_MSG_HDR_T)prP2pBcnUpdateMsg,
1015 MSG_SEND_METHOD_BUF);
1018 prP2pStartAPMsg = (P_MSG_P2P_START_AP_T)cnmMemAlloc(
1019 prGlueInfo->prAdapter,
1021 sizeof(MSG_P2P_START_AP_T));
1023 if (prP2pStartAPMsg == NULL) {
1029 prP2pStartAPMsg->rMsgHdr.eMsgId = MID_MNY_P2P_START_AP;
1031 prP2pStartAPMsg->fgIsPrivacy = FALSE;
1033 prP2pStartAPMsg->u4BcnInterval = info->interval;
1035 prP2pStartAPMsg->u4DtimPeriod = info->dtim_period;
1038 prP2pStartAPMsg->ucHiddenSsidType = ENUM_HIDDEN_SSID_NONE;
1041 if (info->head_len > OFFSET_OF(WLAN_BEACON_FRAME_T, aucInfoElem)) {
1042 P_WLAN_BEACON_FRAME_T prWlanBcnFrame = info->head;
1044 prSsidIE = (P_IE_HDR_T)p2pFuncGetSpecIE(prGlueInfo->prAdapter,
1045 (PUINT_8)prWlanBcnFrame->aucInfoElem,
1046 (info->head_len - OFFSET_OF(WLAN_BEACON_FRAME_T, aucInfoElem)),
1050 kalMemCopy(prP2pStartAPMsg->aucSsid, SSID_IE(prSsidIE)->aucSSID, IE_LEN(prSsidIE));
1055 mboxSendMsg(prGlueInfo->prAdapter,
1057 (P_MSG_HDR_T)prP2pStartAPMsg,
1058 MSG_SEND_METHOD_BUF);
1066 /* mtk_p2p_cfg80211_add_set_beacon */
1070 mtk_p2p_cfg80211_stop_ap (
1071 struct wiphy *wiphy,
1072 struct net_device *dev
1075 P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL;
1076 INT_32 i4Rslt = -EINVAL;
1077 P_MSG_P2P_SWITCH_OP_MODE_T prP2pSwitchMode = (P_MSG_P2P_SWITCH_OP_MODE_T)NULL;
1080 if (wiphy == NULL) {
1085 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_stop_ap.\n"));
1086 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
1089 prP2pSwitchMode = cnmMemAlloc(prGlueInfo->prAdapter, RAM_TYPE_MSG, sizeof(MSG_P2P_SWITCH_OP_MODE_T));
1091 if (prP2pSwitchMode == NULL) {
1097 prP2pSwitchMode->rMsgHdr.eMsgId = MID_MNY_P2P_STOP_AP;
1099 mboxSendMsg(prGlueInfo->prAdapter,
1101 (P_MSG_HDR_T)prP2pSwitchMode,
1102 MSG_SEND_METHOD_BUF);
1109 } /* mtk_p2p_cfg80211_stop_ap */
1113 mtk_p2p_cfg80211_deauth (
1114 struct wiphy *wiphy,
1115 struct net_device *dev,
1116 struct cfg80211_deauth_request *req
1117 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0)
1122 P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL;
1126 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
1128 // not implemented yet
1129 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_deauth.\n"));
1132 } /* mtk_p2p_cfg80211_deauth */
1137 mtk_p2p_cfg80211_disassoc (
1138 struct wiphy *wiphy,
1139 struct net_device *dev,
1140 struct cfg80211_disassoc_request *req
1141 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0)
1146 P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL;
1150 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
1152 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_disassoc.\n"));
1154 // not implemented yet
1157 } /* mtk_p2p_cfg80211_disassoc */
1161 mtk_p2p_cfg80211_remain_on_channel (
1162 struct wiphy *wiphy,
1163 struct net_device *dev,
1164 struct ieee80211_channel *chan,
1165 enum nl80211_channel_type channel_type,
1166 unsigned int duration,
1170 INT_32 i4Rslt = -EINVAL;
1171 P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL;
1172 P_GL_P2P_INFO_T prGlueP2pInfo = (P_GL_P2P_INFO_T)NULL;
1173 P_MSG_P2P_CHNL_REQUEST_T prMsgChnlReq = (P_MSG_P2P_CHNL_REQUEST_T)NULL;
1177 if ((wiphy == NULL) ||
1184 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
1185 prGlueP2pInfo = prGlueInfo->prP2PInfo;
1187 *cookie = prGlueP2pInfo->u8Cookie++;
1189 prMsgChnlReq = cnmMemAlloc(prGlueInfo->prAdapter, RAM_TYPE_MSG, sizeof(MSG_P2P_CHNL_REQUEST_T));
1191 if (prMsgChnlReq == NULL) {
1197 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_remain_on_channel\n"));
1199 prMsgChnlReq->rMsgHdr.eMsgId = MID_MNY_P2P_CHNL_REQ;
1200 prMsgChnlReq->u8Cookie = *cookie;
1201 prMsgChnlReq->u4Duration = duration;
1204 mtk_p2p_cfg80211func_channel_format_switch(chan,
1206 &prMsgChnlReq->rChannelInfo,
1207 &prMsgChnlReq->eChnlSco);
1209 mboxSendMsg(prGlueInfo->prAdapter,
1211 (P_MSG_HDR_T)prMsgChnlReq,
1212 MSG_SEND_METHOD_BUF);
1222 /* mtk_p2p_cfg80211_remain_on_channel */
1226 mtk_p2p_cfg80211_cancel_remain_on_channel (
1227 struct wiphy *wiphy,
1228 struct net_device *dev,
1232 INT_32 i4Rslt = -EINVAL;
1233 P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL;
1234 P_MSG_P2P_CHNL_ABORT_T prMsgChnlAbort = (P_MSG_P2P_CHNL_ABORT_T)NULL;
1237 if ((wiphy == NULL) || (dev == NULL)) {
1242 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
1244 prMsgChnlAbort = cnmMemAlloc(prGlueInfo->prAdapter, RAM_TYPE_MSG, sizeof(MSG_P2P_CHNL_ABORT_T));
1246 if (prMsgChnlAbort == NULL) {
1252 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_cancel_remain_on_channel\n"));
1254 prMsgChnlAbort->rMsgHdr.eMsgId = MID_MNY_P2P_CHNL_ABORT;
1255 prMsgChnlAbort->u8Cookie = cookie;
1258 mboxSendMsg(prGlueInfo->prAdapter,
1260 (P_MSG_HDR_T)prMsgChnlAbort,
1261 MSG_SEND_METHOD_BUF);
1267 } /* mtk_p2p_cfg80211_cancel_remain_on_channel */
1270 mtk_p2p_cfg80211_mgmt_tx (
1271 struct wiphy *wiphy, struct net_device *dev,
1272 struct ieee80211_channel *chan, bool offchan,
1273 enum nl80211_channel_type channel_type,
1274 bool channel_type_valid, unsigned int wait,
1277 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
1279 bool dont_wait_for_ack,
1284 P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL;
1285 P_GL_P2P_INFO_T prGlueP2pInfo = (P_GL_P2P_INFO_T)NULL;
1286 INT_32 i4Rslt = -EINVAL;
1287 P_MSG_P2P_MGMT_TX_REQUEST_T prMsgTxReq = (P_MSG_P2P_MGMT_TX_REQUEST_T)NULL;
1288 P_MSDU_INFO_T prMgmtFrame = (P_MSDU_INFO_T)NULL;
1289 PUINT_8 pucFrameBuf = (PUINT_8)NULL;
1292 if ((wiphy == NULL) ||
1300 //DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_mgmt_tx\n"));
1302 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
1303 prGlueP2pInfo = prGlueInfo->prP2PInfo;
1305 *cookie = prGlueP2pInfo->u8Cookie++;
1307 /* Channel & Channel Type & Wait time are ignored. */
1308 prMsgTxReq = cnmMemAlloc(prGlueInfo->prAdapter, RAM_TYPE_MSG, sizeof(MSG_P2P_MGMT_TX_REQUEST_T));
1310 if (prMsgTxReq == NULL) {
1316 prMsgTxReq->fgNoneCckRate = FALSE;
1317 prMsgTxReq->fgIsWaitRsp = TRUE;
1319 prMgmtFrame = cnmMgtPktAlloc(prGlueInfo->prAdapter, (UINT_32)(len + MAC_TX_RESERVED_FIELD));
1321 if ((prMsgTxReq->prMgmtMsduInfo = prMgmtFrame) == NULL) {
1327 prMsgTxReq->u8Cookie = *cookie;
1328 prMsgTxReq->rMsgHdr.eMsgId = MID_MNY_P2P_MGMT_TX;
1330 pucFrameBuf = (PUINT_8)((UINT_32)prMgmtFrame->prPacket + MAC_TX_RESERVED_FIELD);
1332 kalMemCopy(pucFrameBuf, buf, len);
1334 prMgmtFrame->u2FrameLength = len;
1336 mboxSendMsg(prGlueInfo->prAdapter,
1338 (P_MSG_HDR_T)prMsgTxReq,
1339 MSG_SEND_METHOD_BUF);
1344 if ((i4Rslt != 0) && (prMsgTxReq != NULL)) {
1345 if (prMsgTxReq->prMgmtMsduInfo != NULL) {
1346 cnmMgtPktFree(prGlueInfo->prAdapter, prMsgTxReq->prMgmtMsduInfo);
1349 cnmMemFree(prGlueInfo->prAdapter, prMsgTxReq);
1353 } /* mtk_p2p_cfg80211_mgmt_tx */
1358 mtk_p2p_cfg80211_change_bss (
1359 struct wiphy *wiphy,
1360 struct net_device *dev,
1361 struct bss_parameters *params
1364 P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL;
1365 INT_32 i4Rslt = -EINVAL;
1369 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
1372 switch (params->use_cts_prot) {
1374 DBGLOG(P2P, TRACE, ("CTS protection no change\n"));
1377 DBGLOG(P2P, TRACE, ("CTS protection disable.\n"));
1380 DBGLOG(P2P, TRACE, ("CTS protection enable\n"));
1383 DBGLOG(P2P, TRACE, ("CTS protection unknown\n"));
1389 switch (params->use_short_preamble) {
1391 DBGLOG(P2P, TRACE, ("Short prreamble no change\n"));
1394 DBGLOG(P2P, TRACE, ("Short prreamble disable.\n"));
1397 DBGLOG(P2P, TRACE, ("Short prreamble enable\n"));
1400 DBGLOG(P2P, TRACE, ("Short prreamble unknown\n"));
1407 // not implemented yet
1408 p2pFuncChangeBssParam(prGlueInfo->prAdapter,
1409 prBssInfo->fgIsProtection,
1410 prBssInfo->fgIsShortPreambleAllowed,
1411 prBssInfo->fgUseShortSlotTime,
1422 } /* mtk_p2p_cfg80211_change_bss */
1427 mtk_p2p_cfg80211_del_station (
1428 struct wiphy *wiphy,
1429 struct net_device *dev,
1433 P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL;
1434 INT_32 i4Rslt = -EINVAL;
1435 P_MSG_P2P_CONNECTION_ABORT_T prDisconnectMsg = (P_MSG_P2P_CONNECTION_ABORT_T)NULL;
1436 UINT_8 aucBcMac[] = BC_MAC_ADDR;
1440 if ((wiphy == NULL) ||
1449 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_del_station.\n"));
1451 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
1453 //prDisconnectMsg = (P_MSG_P2P_CONNECTION_ABORT_T)kalMemAlloc(sizeof(MSG_P2P_CONNECTION_ABORT_T), VIR_MEM_TYPE);
1454 prDisconnectMsg = (P_MSG_P2P_CONNECTION_ABORT_T)cnmMemAlloc(prGlueInfo->prAdapter, RAM_TYPE_MSG, sizeof(MSG_P2P_CONNECTION_ABORT_T));
1456 if (prDisconnectMsg == NULL) {
1462 prDisconnectMsg->rMsgHdr.eMsgId = MID_MNY_P2P_CONNECTION_ABORT;
1463 COPY_MAC_ADDR(prDisconnectMsg->aucTargetID, mac);
1464 prDisconnectMsg->u2ReasonCode = REASON_CODE_UNSPECIFIED;
1466 mboxSendMsg(prGlueInfo->prAdapter,
1468 (P_MSG_HDR_T)prDisconnectMsg,
1469 MSG_SEND_METHOD_BUF);
1476 } /* mtk_p2p_cfg80211_del_station */
1480 mtk_p2p_cfg80211_connect (
1481 struct wiphy *wiphy,
1482 struct net_device *dev,
1483 struct cfg80211_connect_params *sme
1486 INT_32 i4Rslt = -EINVAL;
1487 P_GLUE_INFO_T prGlueInfo = NULL;
1488 P_MSG_P2P_CONNECTION_REQUEST_T prConnReqMsg = (P_MSG_P2P_CONNECTION_REQUEST_T)NULL;
1492 if ((wiphy == NULL) ||
1498 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_connect.\n"));
1500 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
1502 prConnReqMsg = (P_MSG_P2P_CONNECTION_REQUEST_T)cnmMemAlloc(prGlueInfo->prAdapter, RAM_TYPE_MSG, (sizeof(MSG_P2P_CONNECTION_REQUEST_T) + sme->ie_len));
1504 if (prConnReqMsg == NULL) {
1510 prConnReqMsg->rMsgHdr.eMsgId = MID_MNY_P2P_CONNECTION_REQ;
1512 COPY_SSID(prConnReqMsg->rSsid.aucSsid,
1513 prConnReqMsg->rSsid.ucSsidLen,
1517 COPY_MAC_ADDR(prConnReqMsg->aucBssid, sme->bssid);
1519 DBGLOG(P2P, TRACE, ("Assoc Req IE Buffer Length:%d\n", sme->ie_len));
1520 kalMemCopy(prConnReqMsg->aucIEBuf, sme->ie, sme->ie_len);
1521 prConnReqMsg->u4IELen = sme->ie_len;
1523 mtk_p2p_cfg80211func_channel_format_switch(sme->channel,
1525 &prConnReqMsg->rChannelInfo,
1526 &prConnReqMsg->eChnlSco);
1528 mboxSendMsg(prGlueInfo->prAdapter,
1530 (P_MSG_HDR_T)prConnReqMsg,
1531 MSG_SEND_METHOD_BUF);
1538 } /* mtk_p2p_cfg80211_connect */
1541 mtk_p2p_cfg80211_disconnect (
1542 struct wiphy *wiphy,
1543 struct net_device *dev,
1547 INT_32 i4Rslt = -EINVAL;
1548 P_GLUE_INFO_T prGlueInfo = NULL;
1549 P_MSG_P2P_CONNECTION_ABORT_T prDisconnMsg = (P_MSG_P2P_CONNECTION_ABORT_T)NULL;
1550 UINT_8 aucBCAddr[] = BC_MAC_ADDR;
1553 if ((wiphy == NULL) ||
1558 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_disconnect.\n"));
1560 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
1562 // prDisconnMsg = (P_MSG_P2P_CONNECTION_ABORT_T)kalMemAlloc(sizeof(P_MSG_P2P_CONNECTION_ABORT_T), VIR_MEM_TYPE);
1563 prDisconnMsg = (P_MSG_P2P_CONNECTION_ABORT_T)cnmMemAlloc(prGlueInfo->prAdapter, RAM_TYPE_MSG, sizeof(MSG_P2P_CONNECTION_ABORT_T));
1565 if (prDisconnMsg == NULL) {
1571 prDisconnMsg->rMsgHdr.eMsgId = MID_MNY_P2P_CONNECTION_ABORT;
1572 prDisconnMsg->u2ReasonCode = reason_code;
1573 prDisconnMsg->fgSendDeauth = TRUE;
1574 COPY_MAC_ADDR(prDisconnMsg->aucTargetID, aucBCAddr);
1576 mboxSendMsg(prGlueInfo->prAdapter,
1578 (P_MSG_HDR_T)prDisconnMsg,
1579 MSG_SEND_METHOD_BUF);
1585 } /* mtk_p2p_cfg80211_disconnect */
1589 mtk_p2p_cfg80211_change_iface (
1590 IN struct wiphy *wiphy,
1591 IN struct net_device *ndev,
1592 IN enum nl80211_iftype type,
1594 IN struct vif_params *params
1597 P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL;
1598 INT_32 i4Rslt = -EINVAL;
1599 P_MSG_P2P_SWITCH_OP_MODE_T prSwitchModeMsg = (P_MSG_P2P_SWITCH_OP_MODE_T)NULL;
1602 if ((wiphy == NULL) ||
1607 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_change_iface.\n"));
1609 if (ndev->ieee80211_ptr) {
1610 ndev->ieee80211_ptr->iftype = type;
1613 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
1617 prSwitchModeMsg = (P_MSG_P2P_SWITCH_OP_MODE_T)cnmMemAlloc(prGlueInfo->prAdapter, RAM_TYPE_MSG, sizeof(MSG_P2P_SWITCH_OP_MODE_T));
1619 if (prSwitchModeMsg == NULL) {
1625 prSwitchModeMsg->rMsgHdr.eMsgId = MID_MNY_P2P_FUN_SWITCH;
1628 case NL80211_IFTYPE_P2P_CLIENT:
1629 DBGLOG(P2P, TRACE, ("NL80211_IFTYPE_P2P_CLIENT.\n"));
1630 case NL80211_IFTYPE_STATION:
1631 if (type == NL80211_IFTYPE_STATION) {
1632 DBGLOG(P2P, TRACE, ("NL80211_IFTYPE_STATION.\n"));
1634 prSwitchModeMsg->eOpMode = OP_MODE_INFRASTRUCTURE;
1636 case NL80211_IFTYPE_AP:
1637 DBGLOG(P2P, TRACE, ("NL80211_IFTYPE_AP.\n"));
1638 case NL80211_IFTYPE_P2P_GO:
1639 if (type == NL80211_IFTYPE_P2P_GO) {
1640 DBGLOG(P2P, TRACE, ("NL80211_IFTYPE_P2P_GO not AP.\n"));
1642 prSwitchModeMsg->eOpMode = OP_MODE_ACCESS_POINT;
1645 DBGLOG(P2P, TRACE, ("Other type :%d .\n", type));
1646 prSwitchModeMsg->eOpMode = OP_MODE_P2P_DEVICE;
1651 mboxSendMsg(prGlueInfo->prAdapter,
1653 (P_MSG_HDR_T)prSwitchModeMsg,
1654 MSG_SEND_METHOD_BUF);
1662 } /* mtk_p2p_cfg80211_change_iface */
1666 mtk_p2p_cfg80211_set_channel (
1667 IN struct wiphy *wiphy,
1668 IN struct net_device *dev,
1669 IN struct ieee80211_channel *chan,
1670 IN enum nl80211_channel_type channel_type)
1672 INT_32 i4Rslt = -EINVAL;
1673 P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL;
1674 RF_CHANNEL_INFO_T rRfChnlInfo;
1677 if ((wiphy == NULL) ||
1683 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_set_channel.\n"));
1685 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
1687 mtk_p2p_cfg80211func_channel_format_switch(chan,
1692 p2pFuncSetChannel(prGlueInfo->prAdapter, &rRfChnlInfo);
1701 /* mtk_p2p_cfg80211_set_channel */
1704 mtk_p2p_cfg80211_set_bitrate_mask (
1705 IN struct wiphy *wiphy,
1706 IN struct net_device *dev,
1708 IN const struct cfg80211_bitrate_mask *mask
1711 INT_32 i4Rslt = -EINVAL;
1712 P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL;
1715 if ((wiphy == NULL) ||
1721 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_set_bitrate_mask\n"));
1723 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
1725 // TODO: Set bitrate mask of the peer?
1732 } /* mtk_p2p_cfg80211_set_bitrate_mask */
1736 mtk_p2p_cfg80211_mgmt_frame_register (
1737 IN struct wiphy *wiphy,
1738 IN struct net_device *dev,
1744 P_MSG_P2P_MGMT_FRAME_REGISTER_T prMgmtFrameRegister = (P_MSG_P2P_MGMT_FRAME_REGISTER_T)NULL;
1746 P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL;
1749 if ((wiphy == NULL) ||
1754 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_mgmt_frame_register\n"));
1756 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
1759 switch (frame_type) {
1760 case MAC_FRAME_PROBE_REQ:
1762 prGlueInfo->prP2PInfo->u4OsMgmtFrameFilter |= PARAM_PACKET_FILTER_PROBE_REQ;
1763 DBGLOG(P2P, TRACE, ("Open packet filer probe request\n"));
1766 prGlueInfo->prP2PInfo->u4OsMgmtFrameFilter &= ~PARAM_PACKET_FILTER_PROBE_REQ;
1767 DBGLOG(P2P, TRACE, ("Close packet filer probe request\n"));
1770 case MAC_FRAME_ACTION:
1772 prGlueInfo->prP2PInfo->u4OsMgmtFrameFilter |= PARAM_PACKET_FILTER_ACTION_FRAME;
1773 DBGLOG(P2P, TRACE, ("Open packet filer action frame.\n"));
1776 prGlueInfo->prP2PInfo->u4OsMgmtFrameFilter &= ~PARAM_PACKET_FILTER_ACTION_FRAME;
1777 DBGLOG(P2P, TRACE, ("Close packet filer action frame.\n"));
1781 DBGLOG(P2P, ERROR, ("Ask frog to add code for mgmt:%x\n", frame_type));
1787 if((prGlueInfo->prAdapter != NULL) && (prGlueInfo->prAdapter->fgIsP2PRegistered == TRUE)){
1789 prGlueInfo->u4Flag |= GLUE_FLAG_FRAME_FILTER;
1791 /* wake up main thread */
1792 wake_up_interruptible(&prGlueInfo->waitq);
1794 if (in_interrupt()) {
1795 DBGLOG(P2P, TRACE, ("It is in interrupt level\n"));
1803 prMgmtFrameRegister = (P_MSG_P2P_MGMT_FRAME_REGISTER_T)cnmMemAlloc(prGlueInfo->prAdapter,
1805 sizeof(MSG_P2P_MGMT_FRAME_REGISTER_T));
1807 if (prMgmtFrameRegister == NULL) {
1812 prMgmtFrameRegister->rMsgHdr.eMsgId = MID_MNY_P2P_MGMT_FRAME_REGISTER;
1814 prMgmtFrameRegister->u2FrameType = frame_type;
1815 prMgmtFrameRegister->fgIsRegister = reg;
1817 mboxSendMsg(prGlueInfo->prAdapter,
1819 (P_MSG_HDR_T)prMgmtFrameRegister,
1820 MSG_SEND_METHOD_BUF);
1828 } /* mtk_p2p_cfg80211_mgmt_frame_register */
1832 mtk_p2p_cfg80211func_channel_format_switch (
1833 IN struct ieee80211_channel *channel,
1834 IN enum nl80211_channel_type channel_type,
1835 IN P_RF_CHANNEL_INFO_T prRfChnlInfo,
1836 IN P_ENUM_CHNL_EXT_T prChnlSco
1839 BOOLEAN fgIsValid = FALSE;
1842 if (channel == NULL) {
1847 prRfChnlInfo->ucChannelNum = nicFreq2ChannelNum(channel->center_freq * 1000);
1849 switch (channel->band) {
1850 case IEEE80211_BAND_2GHZ:
1851 prRfChnlInfo->eBand = BAND_2G4;
1853 case IEEE80211_BAND_5GHZ:
1854 prRfChnlInfo->eBand = BAND_5G;
1857 prRfChnlInfo->eBand = BAND_2G4;
1866 switch (channel_type) {
1867 case NL80211_CHAN_NO_HT:
1868 *prChnlSco = CHNL_EXT_SCN;
1870 case NL80211_CHAN_HT20:
1871 *prChnlSco = CHNL_EXT_SCN;
1873 case NL80211_CHAN_HT40MINUS:
1874 *prChnlSco = CHNL_EXT_SCA;
1876 case NL80211_CHAN_HT40PLUS:
1877 *prChnlSco = CHNL_EXT_SCB;
1881 *prChnlSco = CHNL_EXT_SCN;
1892 /* mtk_p2p_cfg80211func_channel_format_switch */
1895 #if CONFIG_NL80211_TESTMODE
1896 int mtk_p2p_cfg80211_testmode_cmd(
1897 IN struct wiphy *wiphy,
1902 P_GLUE_INFO_T prGlueInfo = NULL;
1903 P_NL80211_DRIVER_TEST_PARAMS prParams = (P_NL80211_DRIVER_TEST_PARAMS)NULL;
1904 BOOLEAN fgIsValid = FALSE;
1908 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
1910 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_testmode_cmd\n"));
1914 prParams = (P_NL80211_DRIVER_TEST_PARAMS)data;
1916 if(prParams->index >> 24 == 0x01) {
1918 prParams->index = prParams->index & ~ BITS(24,31);
1922 mtk_p2p_cfg80211_testmode_p2p_sigma_pre_cmd(wiphy, data, len);
1927 /* Clear the version byte */
1928 prParams->index = prParams->index & ~ BITS(24,31);
1931 switch(prParams->index){
1932 case 1: /* P2P Simga */
1933 if(mtk_p2p_cfg80211_testmode_p2p_sigma_cmd(wiphy, data, len))
1938 if(mtk_p2p_cfg80211_testmode_wfd_update_cmd(wiphy, data, len))
1942 case 3: /* Hotspot Client Management */
1943 if(mtk_p2p_cfg80211_testmode_hotspot_block_list_cmd(wiphy, data, len))
1957 int mtk_p2p_cfg80211_testmode_p2p_sigma_pre_cmd(
1958 IN struct wiphy *wiphy,
1963 P_GLUE_INFO_T prGlueInfo = NULL;
1964 NL80211_DRIVER_TEST_PRE_PARAMS rParams;
1965 P_P2P_SPECIFIC_BSS_INFO_T prP2pSpecificBssInfo = (P_P2P_SPECIFIC_BSS_INFO_T)NULL;
1966 P_P2P_CONNECTION_SETTINGS_T prP2pConnSettings = (P_P2P_CONNECTION_SETTINGS_T)NULL;
1975 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
1977 kalMemZero(&rParams, sizeof(NL80211_DRIVER_TEST_PRE_PARAMS));
1979 prP2pSpecificBssInfo = prGlueInfo->prAdapter->rWifiVar.prP2pSpecificBssInfo;
1980 prP2pConnSettings = prGlueInfo->prAdapter->rWifiVar.prP2PConnSettings;
1982 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_testmode_p2p_sigma_pre_cmd\n"));
1985 memcpy(&rParams, data, len);
1987 DBGLOG(P2P, TRACE, ("NL80211_ATTR_TESTDATA,idx_mode=%d idx=%d value=%lu\n",
1988 (INT_16)rParams.idx_mode, (INT_16)rParams.idx, rParams.value));
1990 index_mode = rParams.idx_mode;
1991 index = rParams.idx;
1992 value = rParams.value;
1995 case 0: /* Listen CH */
1997 case 1: /* P2p mode */
1999 case 4: /* Noa duration */
2000 prP2pSpecificBssInfo->rNoaParam.u4NoaDurationMs = value;
2001 // only to apply setting when setting NOA count
2002 //status = mtk_p2p_wext_set_noa_param(prDev, info, wrqu, (char *)&prP2pSpecificBssInfo->rNoaParam);
2004 case 5: /* Noa interval */
2005 prP2pSpecificBssInfo->rNoaParam.u4NoaIntervalMs = value;
2006 // only to apply setting when setting NOA count
2007 //status = mtk_p2p_wext_set_noa_param(prDev, info, wrqu, (char *)&prP2pSpecificBssInfo->rNoaParam);
2009 case 6: /* Noa count */
2010 prP2pSpecificBssInfo->rNoaParam.u4NoaCount = value;
2011 //status = mtk_p2p_wext_set_noa_param(prDev, info, wrqu, (char *)&prP2pSpecificBssInfo->rNoaParam);
2013 case 100: /* Oper CH */
2014 // 20110920 - frog: User configurations are placed in ConnSettings.
2015 // prP2pConnSettings->ucOperatingChnl = value;
2017 case 101: /* Local config Method, for P2P SDK */
2018 prP2pConnSettings->u2LocalConfigMethod = value;
2020 case 102: /* Sigma P2p reset */
2021 //kalMemZero(prP2pConnSettings->aucTargetDevAddr, MAC_ADDR_LEN);
2022 //prP2pConnSettings->eConnectionPolicy = ENUM_P2P_CONNECTION_POLICY_AUTO;
2023 p2pFsmUninit(prGlueInfo->prAdapter);
2024 p2pFsmInit(prGlueInfo->prAdapter);
2026 case 103: /* WPS MODE */
2027 kalP2PSetWscMode(prGlueInfo, value);
2029 case 104: /* P2p send persence, duration */
2031 case 105: /* P2p send persence, interval */
2033 case 106: /* P2P set sleep */
2035 kalIoctl(prGlueInfo,
2036 wlanoidSetP2pPowerSaveProfile,
2045 case 107: /* P2P set opps, CTWindowl */
2046 prP2pSpecificBssInfo->rOppPsParam.u4CTwindowMs = value;
2047 //status = mtk_p2p_wext_set_oppps_param(prDev, info, wrqu, (char *)&prP2pSpecificBssInfo->rOppPsParam);
2049 case 108: /* p2p_set_power_save */
2050 kalIoctl(prGlueInfo,
2051 wlanoidSetP2pPowerSaveProfile,
2071 mtk_p2p_cfg80211_testmode_p2p_sigma_cmd(
2072 IN struct wiphy *wiphy,
2076 P_GLUE_INFO_T prGlueInfo = NULL;
2077 P_NL80211_DRIVER_P2P_SIGMA_PARAMS prParams = (P_NL80211_DRIVER_P2P_SIGMA_PARAMS)NULL;
2078 P_P2P_SPECIFIC_BSS_INFO_T prP2pSpecificBssInfo = (P_P2P_SPECIFIC_BSS_INFO_T)NULL;
2079 P_P2P_CONNECTION_SETTINGS_T prP2pConnSettings = (P_P2P_CONNECTION_SETTINGS_T)NULL;
2087 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
2089 prP2pSpecificBssInfo = prGlueInfo->prAdapter->rWifiVar.prP2pSpecificBssInfo;
2090 prP2pConnSettings = prGlueInfo->prAdapter->rWifiVar.prP2PConnSettings;
2092 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_testmode_p2p_sigma_cmd\n"));
2095 prParams = (P_NL80211_DRIVER_P2P_SIGMA_PARAMS)data;
2097 index = (INT_32)prParams->idx;
2098 value = (INT_32)prParams->value;
2100 DBGLOG(P2P, TRACE, ("NL80211_ATTR_TESTDATA, idx=%lu value=%lu\n",
2101 (INT_32)prParams->idx, (INT_32)prParams->value));
2104 case 0: /* Listen CH */
2106 case 1: /* P2p mode */
2108 case 4: /* Noa duration */
2109 prP2pSpecificBssInfo->rNoaParam.u4NoaDurationMs = value;
2110 // only to apply setting when setting NOA count
2111 //status = mtk_p2p_wext_set_noa_param(prDev, info, wrqu, (char *)&prP2pSpecificBssInfo->rNoaParam);
2113 case 5: /* Noa interval */
2114 prP2pSpecificBssInfo->rNoaParam.u4NoaIntervalMs = value;
2115 // only to apply setting when setting NOA count
2116 //status = mtk_p2p_wext_set_noa_param(prDev, info, wrqu, (char *)&prP2pSpecificBssInfo->rNoaParam);
2118 case 6: /* Noa count */
2119 prP2pSpecificBssInfo->rNoaParam.u4NoaCount = value;
2120 //status = mtk_p2p_wext_set_noa_param(prDev, info, wrqu, (char *)&prP2pSpecificBssInfo->rNoaParam);
2122 case 100: /* Oper CH */
2123 // 20110920 - frog: User configurations are placed in ConnSettings.
2124 // prP2pConnSettings->ucOperatingChnl = value;
2126 case 101: /* Local config Method, for P2P SDK */
2127 prP2pConnSettings->u2LocalConfigMethod = value;
2129 case 102: /* Sigma P2p reset */
2130 //kalMemZero(prP2pConnSettings->aucTargetDevAddr, MAC_ADDR_LEN);
2131 //prP2pConnSettings->eConnectionPolicy = ENUM_P2P_CONNECTION_POLICY_AUTO;
2133 case 103: /* WPS MODE */
2134 kalP2PSetWscMode(prGlueInfo, value);
2136 case 104: /* P2p send persence, duration */
2138 case 105: /* P2p send persence, interval */
2140 case 106: /* P2P set sleep */
2142 kalIoctl(prGlueInfo,
2143 wlanoidSetP2pPowerSaveProfile,
2152 case 107: /* P2P set opps, CTWindowl */
2153 prP2pSpecificBssInfo->rOppPsParam.u4CTwindowMs = value;
2154 //status = mtk_p2p_wext_set_oppps_param(prDev, info, wrqu, (char *)&prP2pSpecificBssInfo->rOppPsParam);
2156 case 108: /* p2p_set_power_save */
2157 kalIoctl(prGlueInfo,
2158 wlanoidSetP2pPowerSaveProfile,
2168 case 109: /* Max Clients*/
2169 kalP2PSetMaxClients(prGlueInfo, value);
2171 case 110: /* Hotspot WPS mode */
2172 kalIoctl(prGlueInfo,
2173 wlanoidSetP2pWPSmode,
2192 mtk_p2p_cfg80211_testmode_wfd_update_cmd(
2193 IN struct wiphy *wiphy,
2197 P_GLUE_INFO_T prGlueInfo = NULL;
2198 P_NL80211_DRIVER_WFD_PARAMS prParams = (P_NL80211_DRIVER_WFD_PARAMS)NULL;
2200 P_WFD_CFG_SETTINGS_T prWfdCfgSettings = (P_WFD_CFG_SETTINGS_T)NULL;
2201 P_MSG_WFD_CONFIG_SETTINGS_CHANGED_T prMsgWfdCfgUpdate = (P_MSG_WFD_CONFIG_SETTINGS_CHANGED_T)NULL;
2205 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
2207 prParams = (P_NL80211_DRIVER_WFD_PARAMS)data;
2210 DBGLOG(P2P, INFO, ("mtk_p2p_cfg80211_testmode_wfd_update_cmd\n"));
2214 DBGLOG(P2P, INFO,("WFD Enable:%x\n", prParams->WfdEnable));
2215 DBGLOG(P2P, INFO,("WFD Session Available:%x\n", prParams->WfdSessionAvailable));
2216 DBGLOG(P2P, INFO,("WFD Couple Sink Status:%x\n", prParams->WfdCoupleSinkStatus));
2218 DBGLOG(P2P, INFO,("WFD Device Info:%x\n", prParams->WfdDevInfo));
2219 DBGLOG(P2P, INFO,("WFD Control Port:%x\n", prParams->WfdControlPort));
2220 DBGLOG(P2P, INFO,("WFD Maximum Throughput:%x\n", prParams->WfdMaximumTp));
2221 DBGLOG(P2P, INFO,("WFD Extend Capability:%x\n", prParams->WfdExtendCap));
2222 DBGLOG(P2P, INFO,("WFD Couple Sink Addr "MACSTR" \n", MAC2STR(prParams->WfdCoupleSinkAddress)));
2223 DBGLOG(P2P, INFO,("WFD Associated BSSID "MACSTR" \n", MAC2STR(prParams->WfdAssociatedBssid)));
2224 //UINT_8 aucVideolp[4];
2225 //UINT_8 aucAudiolp[4];
2226 DBGLOG(P2P, INFO,("WFD Video Port:%x\n", prParams->WfdVideoPort));
2227 DBGLOG(P2P, INFO,("WFD Audio Port:%x\n", prParams->WfdAudioPort));
2228 DBGLOG(P2P, INFO,("WFD Flag:%x\n", prParams->WfdFlag));
2229 DBGLOG(P2P, INFO,("WFD Policy:%x\n", prParams->WfdPolicy));
2230 DBGLOG(P2P, INFO,("WFD State:%x\n", prParams->WfdState));
2231 //UINT_8 aucWfdSessionInformationIE[24*8];
2232 DBGLOG(P2P, INFO,("WFD Session Info Length:%x\n", prParams->WfdSessionInformationIELen));
2233 //UINT_8 aucReserved1[2];
2234 DBGLOG(P2P, INFO,("WFD Primary Sink Addr "MACSTR" \n", MAC2STR(prParams->aucWfdPrimarySinkMac)));
2235 DBGLOG(P2P, INFO,("WFD Secondary Sink Addr "MACSTR" \n", MAC2STR(prParams->aucWfdSecondarySinkMac)));
2236 DBGLOG(P2P, INFO,("WFD Advanced Flag:%x\n", prParams->WfdAdvanceFlag));
2237 DBGLOG(P2P, INFO,("WFD Sigma mode:%x\n", prParams->WfdSigmaMode));
2238 //UINT_8 aucReserved2[64];
2239 //UINT_8 aucReserved3[64];
2240 //UINT_8 aucReserved4[64];
2244 prWfdCfgSettings = &(prGlueInfo->prAdapter->rWifiVar.prP2pFsmInfo->rWfdConfigureSettings);
2246 kalMemCopy(&prWfdCfgSettings->u4WfdCmdType, &prParams->WfdCmdType, sizeof(WFD_CFG_SETTINGS_T));
2248 prMsgWfdCfgUpdate = cnmMemAlloc(prGlueInfo->prAdapter, RAM_TYPE_MSG, sizeof(MSG_WFD_CONFIG_SETTINGS_CHANGED_T));
2250 if (prMsgWfdCfgUpdate == NULL) {
2255 prMsgWfdCfgUpdate->rMsgHdr.eMsgId = MID_MNY_P2P_WFD_CFG_UPDATE;
2256 prMsgWfdCfgUpdate->prWfdCfgSettings = prWfdCfgSettings;
2259 mboxSendMsg(prGlueInfo->prAdapter,
2261 (P_MSG_HDR_T)prMsgWfdCfgUpdate,
2262 MSG_SEND_METHOD_BUF);
2264 // prWfdCfgSettings->ucWfdEnable = 1;
2265 // prWfdCfgSettings->u4WfdFlag |= WFD_FLAGS_DEV_INFO_VALID;
2266 prWfdCfgSettings->u4WfdFlag |= WFD_FLAGS_DEV_INFO_VALID;
2267 prWfdCfgSettings->u2WfdDevInfo = 123;
2268 prWfdCfgSettings->u2WfdControlPort = 456;
2269 prWfdCfgSettings->u2WfdMaximumTp = 789;
2272 prWfdCfgSettings->u4WfdFlag |= WFD_FLAGS_SINK_INFO_VALID;
2273 prWfdCfgSettings->ucWfdCoupleSinkStatus = 0xAB;
2275 UINT_8 aucTestAddr[MAC_ADDR_LEN] = {0x77, 0x66, 0x55, 0x44, 0x33, 0x22};
2276 COPY_MAC_ADDR(prWfdCfgSettings->aucWfdCoupleSinkAddress, aucTestAddr);
2279 prWfdCfgSettings->u4WfdFlag |= WFD_FLAGS_EXT_CAPABILITY_VALID;
2280 prWfdCfgSettings->u2WfdExtendCap = 0xCDE;
2287 #endif /* CFG_SUPPORT_WFD */
2292 mtk_p2p_cfg80211_testmode_hotspot_block_list_cmd(
2293 IN struct wiphy *wiphy,
2297 P_GLUE_INFO_T prGlueInfo = NULL;
2298 P_NL80211_DRIVER_hotspot_block_PARAMS prParams = (P_NL80211_DRIVER_hotspot_block_PARAMS)NULL;
2303 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
2306 prParams = (P_NL80211_DRIVER_hotspot_block_PARAMS)data;
2308 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_testmode_hotspot_block_list_cmd\n"));
2310 fgIsValid = kalP2PSetBlackList(prGlueInfo, prParams->aucBssid, prParams->ucblocked);
2319 #endif // LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 32)
2321 #endif // CFG_ENABLE_WIFI_DIRECT && CFG_ENABLE_WIFI_DIRECT_CFG_80211