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 ** 09 12 2012 wcpadmin
19 ** [ALPS00276400] Remove MTK copyright and legal header on GPL/LGPL related packages
23 ** [ALPS00351547] [6577JB][WiFi direct]The 3rd device fail to establish p2p connection with GO sometimes
24 ** sync with the ICS code.
26 ** 08 31 2012 yuche.tsai
27 ** [ALPS00349585] [6577JB][WiFi direct][KE]Establish p2p connection while both device have connected to AP previously,one device reboots automatically with KE
28 ** Fix possible KE when concurrent & disconnect.
30 ** 08 21 2012 yuche.tsai
32 ** Fix compile warning.
34 ** 08 20 2012 yuche.tsai
36 ** Fix possible KE issue.
38 ** 08 17 2012 yuche.tsai
40 ** Fix compile warning.
42 ** 08 16 2012 yuche.tsai
44 ** Fix compile warning.
46 ** 08 14 2012 yuche.tsai
48 ** Fix p2p bug find on ALPS.JB trunk.
50 ** 07 26 2012 yuche.tsai
51 ** [ALPS00324337] [ALPS.JB][Hot-Spot] Driver update for Hot-Spot
52 ** Update driver code of ALPS.JB for hot-spot.
54 ** 07 19 2012 yuche.tsai
56 ** Code update for JB.
58 * 07 17 2012 yuche.tsai
60 * Fix compile error for JB.
62 * 07 17 2012 yuche.tsai
64 * Compile no error before trial run.
66 * 09 21 2010 kevin.huang
67 * [WCXRP00000054] [MT6620 Wi-Fi][Driver] Restructure driver for second Interface
68 * Isolate P2P related function for Hardware Software Bundle
72 * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
74 * 06 06 2010 kevin.huang
75 * [WPD00003832][MT6620 5931] Create driver base
76 * [MT6620 5931] Create driver base
79 * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support
80 * add cfg80211 interface, which is to replace WE, for further extension
85 /*******************************************************************************
86 * C O M P I L E R F L A G S
87 ********************************************************************************
90 /*******************************************************************************
91 * E X T E R N A L R E F E R E N C E S
92 ********************************************************************************
97 #if CFG_ENABLE_WIFI_DIRECT && CFG_ENABLE_WIFI_DIRECT_CFG_80211
98 #include <linux/kernel.h>
99 #include <linux/netdevice.h>
100 #include <linux/wireless.h>
101 #include <linux/ieee80211.h>
102 #include <net/cfg80211.h>
106 #pragma GCC diagnostic ignored "-Wformat"
109 /*******************************************************************************
111 ********************************************************************************
114 /*******************************************************************************
116 ********************************************************************************
119 /*******************************************************************************
120 * P U B L I C D A T A
121 ********************************************************************************
124 /*******************************************************************************
125 * P R I V A T E D A T A
126 ********************************************************************************
129 /*******************************************************************************
131 ********************************************************************************
134 /*******************************************************************************
135 * F U N C T I O N D E C L A R A T I O N S
136 ********************************************************************************
141 mtk_p2p_cfg80211func_channel_format_switch(
142 IN struct ieee80211_channel *channel,
143 IN enum nl80211_channel_type channel_type,
144 IN P_RF_CHANNEL_INFO_T prRfChnlInfo,
145 IN P_ENUM_CHNL_EXT_T prChnlSco
148 /*******************************************************************************
150 ********************************************************************************
153 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 32)
154 int mtk_p2p_cfg80211_add_key(
156 struct net_device *ndev,
160 struct key_params *params
163 P_GLUE_INFO_T prGlueInfo = NULL;
164 INT_32 i4Rslt = -EINVAL;
165 WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS;
166 UINT_32 u4BufLen = 0;
167 P2P_PARAM_KEY_T rKey;
171 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
173 kalMemZero(&rKey, sizeof(P2P_PARAM_KEY_T));
175 rKey.u4KeyIndex = key_index;
177 memcpy(rKey.arBSSID, mac_addr, ETH_ALEN);
178 if ((rKey.arBSSID[0] == 0x00) && (rKey.arBSSID[1] == 0x00) && (rKey.arBSSID[2] == 0x00) &&
179 (rKey.arBSSID[3] == 0x00) && (rKey.arBSSID[4] == 0x00) && (rKey.arBSSID[5] == 0x00)) {
180 rKey.arBSSID[0] = 0xff;
181 rKey.arBSSID[1] = 0xff;
182 rKey.arBSSID[2] = 0xff;
183 rKey.arBSSID[3] = 0xff;
184 rKey.arBSSID[4] = 0xff;
185 rKey.arBSSID[5] = 0xff;
187 if (rKey.arBSSID[0] != 0xFF) {
188 rKey.u4KeyIndex |= BIT(31);
189 if ((rKey.arBSSID[0] != 0x00) || (rKey.arBSSID[1] != 0x00) || (rKey.arBSSID[2] != 0x00) ||
190 (rKey.arBSSID[3] != 0x00) || (rKey.arBSSID[4] != 0x00) || (rKey.arBSSID[5] != 0x00))
191 rKey.u4KeyIndex |= BIT(30);
194 rKey.u4KeyIndex |= BIT(31);
198 rKey.arBSSID[0] = 0xff;
199 rKey.arBSSID[1] = 0xff;
200 rKey.arBSSID[2] = 0xff;
201 rKey.arBSSID[3] = 0xff;
202 rKey.arBSSID[4] = 0xff;
203 rKey.arBSSID[5] = 0xff;
204 rKey.u4KeyIndex |= BIT(31); //????
208 //rKey.aucKeyMaterial[0] = kalMemAlloc(params->key_len, VIR_MEM_TYPE);
209 kalMemCopy(rKey.aucKeyMaterial, params->key, params->key_len);
211 rKey.u4KeyLength = params->key_len;
212 rKey.u4Length = ((UINT_32)&(((P_P2P_PARAM_KEY_T)0)->aucKeyMaterial)) + rKey.u4KeyLength;
214 rStatus = kalIoctl(prGlueInfo,
223 if (rStatus == WLAN_STATUS_SUCCESS)
230 int mtk_p2p_cfg80211_get_key(
232 struct net_device *ndev,
237 void (*callback)(void *cookie, struct key_params*)
240 P_GLUE_INFO_T prGlueInfo = NULL;
244 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
246 // not implemented yet
251 int mtk_p2p_cfg80211_del_key(
253 struct net_device *ndev,
259 P_GLUE_INFO_T prGlueInfo = NULL;
260 PARAM_REMOVE_KEY_T prRemoveKey;
261 INT_32 i4Rslt = -EINVAL;
262 WLAN_STATUS rStatus = WLAN_STATUS_SUCCESS;
263 UINT_32 u4BufLen = 0;
267 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
269 kalMemZero(&prRemoveKey, sizeof(PARAM_REMOVE_KEY_T));
271 memcpy(prRemoveKey.arBSSID, mac_addr, PARAM_MAC_ADDR_LEN);
272 prRemoveKey.u4KeyIndex = key_index;
273 prRemoveKey.u4Length = sizeof(PARAM_REMOVE_KEY_T);
275 rStatus = kalIoctl(prGlueInfo,
276 wlanoidSetRemoveP2PKey,
278 prRemoveKey.u4Length,
285 if (rStatus == WLAN_STATUS_SUCCESS)
293 mtk_p2p_cfg80211_set_default_key (
295 struct net_device *netdev,
301 P_GLUE_INFO_T prGlueInfo = NULL;
305 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
307 // not implemented yet
312 int mtk_p2p_cfg80211_get_station(
314 struct net_device *ndev,
316 struct station_info *sinfo
319 INT_32 i4RetRslt = -EINVAL;
320 P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL;
321 P_GL_P2P_INFO_T prP2pGlueInfo = (P_GL_P2P_INFO_T)NULL;
322 P2P_STATION_INFO_T rP2pStaInfo;
327 if ((wiphy == NULL) ||
334 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_get_station\n"));
336 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
337 prP2pGlueInfo = prGlueInfo->prP2PInfo;
341 /* Get station information. */
342 /* 1. Inactive time? */
343 p2pFuncGetStationInfo(prGlueInfo->prAdapter,
348 sinfo->filled |= STATION_INFO_INACTIVE_TIME;
349 sinfo->inactive_time = rP2pStaInfo.u4InactiveTime;
350 sinfo->generation = prP2pGlueInfo->i4Generation;
359 mtk_p2p_cfg80211_scan (
361 struct net_device *ndev,
362 struct cfg80211_scan_request *request
365 P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL;
366 P_GL_P2P_INFO_T prP2pGlueInfo = (P_GL_P2P_INFO_T)NULL;
367 P_MSG_P2P_SCAN_REQUEST_T prMsgScanRequest = (P_MSG_P2P_SCAN_REQUEST_T)NULL;
368 UINT_32 u4MsgSize = 0, u4Idx = 0;
369 INT_32 i4RetRslt = -EINVAL;
370 P_RF_CHANNEL_INFO_T prRfChannelInfo = (P_RF_CHANNEL_INFO_T)NULL;
371 P_P2P_SSID_STRUCT_T prSsidStruct = (P_P2P_SSID_STRUCT_T)NULL;
372 struct ieee80211_channel *prChannel = NULL;
373 struct cfg80211_ssid *prSsid = NULL;
375 /* [---------Channel---------] [---------SSID---------][---------IE---------] */
379 if ((wiphy == NULL) || (request == NULL)) {
383 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
385 prP2pGlueInfo = prGlueInfo->prP2PInfo;
387 if (prP2pGlueInfo == NULL) {
392 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_scan.\n"));
395 if (prP2pGlueInfo->prScanRequest != NULL) {
396 /* There have been a scan request on-going processing. */
397 DBGLOG(P2P, TRACE, ("There have been a scan request on-going processing.\n"));
401 prP2pGlueInfo->prScanRequest = request;
403 /* Should find out why the n_channels so many? */
404 if (request->n_channels > MAXIMUM_OPERATION_CHANNEL_LIST) {
405 request->n_channels = MAXIMUM_OPERATION_CHANNEL_LIST;
406 DBGLOG(P2P, TRACE, ("Channel list exceed the maximun support.\n"));
409 u4MsgSize = sizeof(MSG_P2P_SCAN_REQUEST_T) +
410 (request->n_channels * sizeof(RF_CHANNEL_INFO_T)) +
411 (request->n_ssids * sizeof(PARAM_SSID_T)) +
414 prMsgScanRequest = cnmMemAlloc(prGlueInfo->prAdapter, RAM_TYPE_MSG, u4MsgSize);
416 if (prMsgScanRequest == NULL) {
422 DBGLOG(P2P, TRACE, ("Generating scan request message.\n"));
424 prMsgScanRequest->rMsgHdr.eMsgId = MID_MNY_P2P_DEVICE_DISCOVERY;
428 DBGLOG(P2P, TRACE, ("Requesting channel number:%d.\n", request->n_channels));
430 for (u4Idx = 0; u4Idx < request->n_channels; u4Idx++) {
431 /* Translate Freq from MHz to channel number. */
432 prRfChannelInfo = &(prMsgScanRequest->arChannelListInfo[u4Idx]);
433 prChannel = request->channels[u4Idx];
435 prRfChannelInfo->ucChannelNum = nicFreq2ChannelNum(prChannel->center_freq * 1000);
436 DBGLOG(P2P, TRACE, ("Scanning Channel:%d, freq: %d\n",
437 prRfChannelInfo->ucChannelNum,
438 prChannel->center_freq));
439 switch (prChannel->band) {
440 case IEEE80211_BAND_2GHZ:
441 prRfChannelInfo->eBand = BAND_2G4;
443 case IEEE80211_BAND_5GHZ:
444 prRfChannelInfo->eBand = BAND_5G;
447 DBGLOG(P2P, TRACE, ("UNKNOWN Band info from supplicant\n"));
448 prRfChannelInfo->eBand = BAND_NULL;
455 prMsgScanRequest->u4NumChannel = request->n_channels;
457 DBGLOG(P2P, TRACE, ("Finish channel list.\n"));
460 prSsid = request->ssids;
461 prSsidStruct = (P_P2P_SSID_STRUCT_T)prRfChannelInfo;
462 if (request->n_ssids) {
463 ASSERT(prSsidStruct == &(prMsgScanRequest->arChannelListInfo[u4Idx]));
464 prMsgScanRequest->prSSID = prSsidStruct;
467 for (u4Idx = 0; u4Idx < request->n_ssids; u4Idx++) {
468 COPY_SSID(prSsidStruct->aucSsid,
469 prSsidStruct->ucSsidLen,
470 request->ssids->ssid,
471 request->ssids->ssid_len);
477 prMsgScanRequest->i4SsidNum = request->n_ssids;
479 DBGLOG(P2P, TRACE, ("Finish SSID list:%d.\n", request->n_ssids));
482 prMsgScanRequest->pucIEBuf = (PUINT_8)prSsidStruct;
483 if (request->ie_len) {
484 kalMemCopy(prMsgScanRequest->pucIEBuf, request->ie, request->ie_len);
485 prMsgScanRequest->u4IELen = request->ie_len;
488 DBGLOG(P2P, TRACE, ("Finish IE Buffer.\n"));
491 mboxSendMsg(prGlueInfo->prAdapter,
493 (P_MSG_HDR_T)prMsgScanRequest,
494 MSG_SEND_METHOD_BUF);
500 } /* mtk_p2p_cfg80211_scan */
502 int mtk_p2p_cfg80211_set_wiphy_params(
507 INT_32 i4Rslt = -EINVAL;
508 P_GLUE_INFO_T prGlueInfo = NULL;
516 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_set_wiphy_params\n"));
517 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
519 if (changed & WIPHY_PARAM_RETRY_SHORT) {
521 DBGLOG(P2P, TRACE, ("The RETRY short param is changed.\n"));
524 if (changed & WIPHY_PARAM_RETRY_LONG) {
526 DBGLOG(P2P, TRACE, ("The RETRY long param is changed.\n"));
530 if (changed & WIPHY_PARAM_FRAG_THRESHOLD) {
532 DBGLOG(P2P, TRACE, ("The RETRY fragmentation threshold is changed.\n"));
535 if (changed & WIPHY_PARAM_RTS_THRESHOLD) {
537 DBGLOG(P2P, TRACE, ("The RETRY RTS threshold is changed.\n"));
540 if (changed & WIPHY_PARAM_COVERAGE_CLASS) {
542 DBGLOG(P2P, TRACE, ("The coverage class is changed???\n"));
552 } /* mtk_p2p_cfg80211_set_wiphy_params */
557 mtk_p2p_cfg80211_join_ibss(
559 struct net_device *dev,
560 struct cfg80211_ibss_params *params
563 P_GLUE_INFO_T prGlueInfo = NULL;
567 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
569 // not implemented yet
575 mtk_p2p_cfg80211_leave_ibss(
577 struct net_device *dev
580 P_GLUE_INFO_T prGlueInfo = NULL;
584 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
586 // not implemented yet
592 mtk_p2p_cfg80211_set_txpower(
594 enum nl80211_tx_power_setting type,
598 P_GLUE_INFO_T prGlueInfo = NULL;
602 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
604 // not implemented yet
610 mtk_p2p_cfg80211_get_txpower(
615 P_GLUE_INFO_T prGlueInfo = NULL;
619 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
621 // not implemented yet
627 mtk_p2p_cfg80211_set_power_mgmt(
629 struct net_device *dev,
634 P_GLUE_INFO_T prGlueInfo = NULL;
638 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
640 // not implemented yet
646 //&&&&&&&&&&&&&&&&&&&&&&&&&& Add for ICS Wi-Fi Direct Support. &&&&&&&&&&&&&&&&&&&&&&&
647 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
649 mtk_p2p_cfg80211_start_ap (
651 struct net_device *dev,
652 struct cfg80211_ap_settings *settings
655 P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL;
656 INT_32 i4Rslt = -EINVAL;
657 P_MSG_P2P_BEACON_UPDATE_T prP2pBcnUpdateMsg = (P_MSG_P2P_BEACON_UPDATE_T)NULL;
658 P_MSG_P2P_START_AP_T prP2pStartAPMsg = (P_MSG_P2P_START_AP_T)NULL;
659 PUINT_8 pucBuffer = (PUINT_8)NULL;
660 // P_IE_SSID_T prSsidIE = (P_IE_SSID_T)NULL;
663 if ((wiphy == NULL) || (settings == NULL)) {
667 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_start_ap.\n"));
668 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
670 prP2pBcnUpdateMsg = (P_MSG_P2P_BEACON_UPDATE_T)cnmMemAlloc(
671 prGlueInfo->prAdapter,
673 (sizeof(MSG_P2P_BEACON_UPDATE_T) + settings->beacon.head_len + settings->beacon.tail_len));
675 if (prP2pBcnUpdateMsg == NULL) {
682 prP2pBcnUpdateMsg->rMsgHdr.eMsgId = MID_MNY_P2P_BEACON_UPDATE;
683 pucBuffer = prP2pBcnUpdateMsg->aucBuffer;
685 if (settings->beacon.head_len != 0) {
686 kalMemCopy(pucBuffer, settings->beacon.head, settings->beacon.head_len);
688 prP2pBcnUpdateMsg->u4BcnHdrLen = settings->beacon.head_len;
690 prP2pBcnUpdateMsg->pucBcnHdr = pucBuffer;
692 pucBuffer = (PUINT_8)((UINT_32)pucBuffer + (UINT_32)settings->beacon.head_len);
695 prP2pBcnUpdateMsg->u4BcnHdrLen = 0;
697 prP2pBcnUpdateMsg->pucBcnHdr = NULL;
700 if (settings->beacon.tail_len != 0) {
701 UINT_8 ucLen = settings->beacon.tail_len;
703 prP2pBcnUpdateMsg->pucBcnBody = pucBuffer;
706 // IEEE 802.11 2007 - 7.3.2.6
707 TIM_IE(pucBuffer)->ucId = ELEM_ID_TIM;
708 TIM_IE(pucBuffer)->ucLength = (3 + MAX_LEN_TIM_PARTIAL_BMP)/*((u4N2 - u4N1) + 4)*/; // NOTE: fixed PVB length (AID is allocated from 8 ~ 15 only)
709 TIM_IE(pucBuffer)->ucDTIMCount = 0/*prBssInfo->ucDTIMCount*/; // will be overwrite by FW
710 TIM_IE(pucBuffer)->ucDTIMPeriod = 1;
711 TIM_IE(pucBuffer)->ucBitmapControl = 0/*ucBitmapControl | (UINT_8)u4N1*/; // will be overwrite by FW
712 ucLen += IE_SIZE(pucBuffer);
713 pucBuffer += IE_SIZE(pucBuffer);
715 kalMemCopy(pucBuffer, settings->beacon.tail, settings->beacon.tail_len);
717 prP2pBcnUpdateMsg->u4BcnBodyLen = ucLen;
720 prP2pBcnUpdateMsg->u4BcnBodyLen = 0;
722 prP2pBcnUpdateMsg->pucBcnBody = NULL;
726 mboxSendMsg(prGlueInfo->prAdapter,
728 (P_MSG_HDR_T)prP2pBcnUpdateMsg,
729 MSG_SEND_METHOD_BUF);
732 prP2pStartAPMsg = (P_MSG_P2P_START_AP_T)cnmMemAlloc(
733 prGlueInfo->prAdapter,
735 sizeof(MSG_P2P_START_AP_T));
737 if (prP2pStartAPMsg == NULL) {
743 prP2pStartAPMsg->rMsgHdr.eMsgId = MID_MNY_P2P_START_AP;
745 prP2pStartAPMsg->fgIsPrivacy = settings->privacy;
747 prP2pStartAPMsg->u4BcnInterval = settings->beacon_interval;
749 prP2pStartAPMsg->u4DtimPeriod = settings->dtim_period;
752 prP2pStartAPMsg->ucHiddenSsidType = settings->hidden_ssid;
754 COPY_SSID(prP2pStartAPMsg->aucSsid,
755 prP2pStartAPMsg->u2SsidLen,
759 mboxSendMsg(prGlueInfo->prAdapter,
761 (P_MSG_HDR_T)prP2pStartAPMsg,
762 MSG_SEND_METHOD_BUF);
771 /////////////////////////
773 * struct cfg80211_ap_settings - AP configuration
775 * Used to configure an AP interface.
777 * @beacon: beacon data
778 * @beacon_interval: beacon interval
779 * @dtim_period: DTIM period
780 * @ssid: SSID to be used in the BSS (note: may be %NULL if not provided from
782 * @ssid_len: length of @ssid
783 * @hidden_ssid: whether to hide the SSID in Beacon/Probe Response frames
784 * @crypto: crypto settings
785 * @privacy: the BSS uses privacy
786 * @auth_type: Authentication type (algorithm)
787 * @inactivity_timeout: time in seconds to determine station's inactivity.
789 // struct cfg80211_ap_settings {
790 // struct cfg80211_beacon_data beacon;
792 // int beacon_interval, dtim_period;
795 // enum nl80211_hidden_ssid hidden_ssid;
796 // struct cfg80211_crypto_settings crypto;
798 // enum nl80211_auth_type auth_type;
799 // int inactivity_timeout;
804 } /* mtk_p2p_cfg80211_start_ap */
808 mtk_p2p_cfg80211_change_beacon (
810 struct net_device *dev,
811 struct cfg80211_beacon_data *info
814 P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL;
815 INT_32 i4Rslt = -EINVAL;
816 P_MSG_P2P_BEACON_UPDATE_T prP2pBcnUpdateMsg = (P_MSG_P2P_BEACON_UPDATE_T)NULL;
817 PUINT_8 pucBuffer = (PUINT_8)NULL;
820 if ((wiphy == NULL) || (info == NULL)) {
824 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_change_beacon.\n"));
825 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
827 prP2pBcnUpdateMsg = (P_MSG_P2P_BEACON_UPDATE_T)cnmMemAlloc(
828 prGlueInfo->prAdapter,
830 (sizeof(MSG_P2P_BEACON_UPDATE_T) + info->head_len + info->tail_len));
833 if (prP2pBcnUpdateMsg == NULL) {
839 prP2pBcnUpdateMsg->rMsgHdr.eMsgId = MID_MNY_P2P_BEACON_UPDATE;
840 pucBuffer = prP2pBcnUpdateMsg->aucBuffer;
842 if (info->head_len != 0) {
843 kalMemCopy(pucBuffer, info->head, info->head_len);
845 prP2pBcnUpdateMsg->u4BcnHdrLen = info->head_len;
847 prP2pBcnUpdateMsg->pucBcnHdr = pucBuffer;
849 pucBuffer = (PUINT_8)((UINT_32)pucBuffer + (UINT_32)info->head_len);
852 prP2pBcnUpdateMsg->u4BcnHdrLen = 0;
854 prP2pBcnUpdateMsg->pucBcnHdr = NULL;
857 if (info->tail_len != 0) {
858 UINT_8 ucLen = info->tail_len;
860 prP2pBcnUpdateMsg->pucBcnBody = pucBuffer;
863 // IEEE 802.11 2007 - 7.3.2.6
864 TIM_IE(pucBuffer)->ucId = ELEM_ID_TIM;
865 TIM_IE(pucBuffer)->ucLength = (3 + MAX_LEN_TIM_PARTIAL_BMP)/*((u4N2 - u4N1) + 4)*/; // NOTE: fixed PVB length (AID is allocated from 8 ~ 15 only)
866 TIM_IE(pucBuffer)->ucDTIMCount = 0/*prBssInfo->ucDTIMCount*/; // will be overwrite by FW
867 TIM_IE(pucBuffer)->ucDTIMPeriod = 1;
868 TIM_IE(pucBuffer)->ucBitmapControl = 0/*ucBitmapControl | (UINT_8)u4N1*/; // will be overwrite by FW
869 ucLen += IE_SIZE(pucBuffer);
870 pucBuffer += IE_SIZE(pucBuffer);
872 kalMemCopy(pucBuffer, info->tail, info->tail_len);
874 prP2pBcnUpdateMsg->u4BcnBodyLen = ucLen;
877 prP2pBcnUpdateMsg->u4BcnBodyLen = 0;
879 prP2pBcnUpdateMsg->pucBcnBody = NULL;
883 mboxSendMsg(prGlueInfo->prAdapter,
885 (P_MSG_HDR_T)prP2pBcnUpdateMsg,
886 MSG_SEND_METHOD_BUF);
888 ////////////////////////////
890 * struct cfg80211_beacon_data - beacon data
891 * @head: head portion of beacon (before TIM IE)
892 * or %NULL if not changed
893 * @tail: tail portion of beacon (after TIM IE)
894 * or %NULL if not changed
895 * @head_len: length of @head
896 * @tail_len: length of @tail
897 * @beacon_ies: extra information element(s) to add into Beacon frames or %NULL
898 * @beacon_ies_len: length of beacon_ies in octets
899 * @proberesp_ies: extra information element(s) to add into Probe Response
901 * @proberesp_ies_len: length of proberesp_ies in octets
902 * @assocresp_ies: extra information element(s) to add into (Re)Association
903 * Response frames or %NULL
904 * @assocresp_ies_len: length of assocresp_ies in octets
905 * @probe_resp_len: length of probe response template (@probe_resp)
906 * @probe_resp: probe response template (AP mode only)
908 //struct cfg80211_beacon_data {
909 // const u8 *head, *tail;
910 // const u8 *beacon_ies;
911 // const u8 *proberesp_ies;
912 // const u8 *assocresp_ies;
913 // const u8 *probe_resp;
915 // size_t head_len, tail_len;
916 // size_t beacon_ies_len;
917 // size_t proberesp_ies_len;
918 // size_t assocresp_ies_len;
919 // size_t probe_resp_len;
922 ////////////////////////////
927 } /* mtk_p2p_cfg80211_change_beacon */
931 mtk_p2p_cfg80211_add_set_beacon (
933 struct net_device *dev,
934 struct beacon_parameters *info
937 P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL;
938 INT_32 i4Rslt = -EINVAL;
939 P_MSG_P2P_BEACON_UPDATE_T prP2pBcnUpdateMsg = (P_MSG_P2P_BEACON_UPDATE_T)NULL;
940 P_MSG_P2P_START_AP_T prP2pStartAPMsg = (P_MSG_P2P_START_AP_T)NULL;
941 PUINT_8 pucBuffer = (PUINT_8)NULL;
942 P_IE_SSID_T prSsidIE = (P_IE_SSID_T)NULL;
945 if ((wiphy == NULL) || (info == NULL)) {
949 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_add_set_beacon.\n"));
950 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
952 prP2pBcnUpdateMsg = (P_MSG_P2P_BEACON_UPDATE_T)cnmMemAlloc(
953 prGlueInfo->prAdapter,
955 (sizeof(MSG_P2P_BEACON_UPDATE_T) + info->head_len + info->tail_len));
957 if (prP2pBcnUpdateMsg == NULL) {
964 prP2pBcnUpdateMsg->rMsgHdr.eMsgId = MID_MNY_P2P_BEACON_UPDATE;
965 pucBuffer = prP2pBcnUpdateMsg->aucBuffer;
967 if (info->head_len != 0) {
968 kalMemCopy(pucBuffer, info->head, info->head_len);
970 prP2pBcnUpdateMsg->u4BcnHdrLen = info->head_len;
972 prP2pBcnUpdateMsg->pucBcnHdr = pucBuffer;
974 pucBuffer = (PUINT_8)((UINT_32)pucBuffer + (UINT_32)info->head_len);
977 prP2pBcnUpdateMsg->u4BcnHdrLen = 0;
979 prP2pBcnUpdateMsg->pucBcnHdr = NULL;
982 if (info->tail_len != 0) {
983 UINT_8 ucLen = info->tail_len;
985 prP2pBcnUpdateMsg->pucBcnBody = pucBuffer;
988 // IEEE 802.11 2007 - 7.3.2.6
989 TIM_IE(pucBuffer)->ucId = ELEM_ID_TIM;
990 TIM_IE(pucBuffer)->ucLength = (3 + MAX_LEN_TIM_PARTIAL_BMP)/*((u4N2 - u4N1) + 4)*/; // NOTE: fixed PVB length (AID is allocated from 8 ~ 15 only)
991 TIM_IE(pucBuffer)->ucDTIMCount = 0/*prBssInfo->ucDTIMCount*/; // will be overwrite by FW
992 TIM_IE(pucBuffer)->ucDTIMPeriod = 1;
993 TIM_IE(pucBuffer)->ucBitmapControl = 0/*ucBitmapControl | (UINT_8)u4N1*/; // will be overwrite by FW
994 ucLen += IE_SIZE(pucBuffer);
995 pucBuffer += IE_SIZE(pucBuffer);
997 kalMemCopy(pucBuffer, info->tail, info->tail_len);
999 prP2pBcnUpdateMsg->u4BcnBodyLen = ucLen;
1002 prP2pBcnUpdateMsg->u4BcnBodyLen = 0;
1004 prP2pBcnUpdateMsg->pucBcnBody = NULL;
1008 mboxSendMsg(prGlueInfo->prAdapter,
1010 (P_MSG_HDR_T)prP2pBcnUpdateMsg,
1011 MSG_SEND_METHOD_BUF);
1014 prP2pStartAPMsg = (P_MSG_P2P_START_AP_T)cnmMemAlloc(
1015 prGlueInfo->prAdapter,
1017 sizeof(MSG_P2P_START_AP_T));
1019 if (prP2pStartAPMsg == NULL) {
1025 prP2pStartAPMsg->rMsgHdr.eMsgId = MID_MNY_P2P_START_AP;
1027 prP2pStartAPMsg->fgIsPrivacy = FALSE;
1029 prP2pStartAPMsg->u4BcnInterval = info->interval;
1031 prP2pStartAPMsg->u4DtimPeriod = info->dtim_period;
1034 prP2pStartAPMsg->ucHiddenSsidType = ENUM_HIDDEN_SSID_NONE;
1037 if (info->head_len > OFFSET_OF(WLAN_BEACON_FRAME_T, aucInfoElem)) {
1038 P_WLAN_BEACON_FRAME_T prWlanBcnFrame = info->head;
1040 prSsidIE = (P_IE_HDR_T)p2pFuncGetSpecIE(prGlueInfo->prAdapter,
1041 (PUINT_8)prWlanBcnFrame->aucInfoElem,
1042 (info->head_len - OFFSET_OF(WLAN_BEACON_FRAME_T, aucInfoElem)),
1046 kalMemCopy(prP2pStartAPMsg->aucSsid, SSID_IE(prSsidIE)->aucSSID, IE_LEN(prSsidIE));
1051 mboxSendMsg(prGlueInfo->prAdapter,
1053 (P_MSG_HDR_T)prP2pStartAPMsg,
1054 MSG_SEND_METHOD_BUF);
1062 /* mtk_p2p_cfg80211_add_set_beacon */
1066 mtk_p2p_cfg80211_stop_ap (
1067 struct wiphy *wiphy,
1068 struct net_device *dev
1071 P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL;
1072 INT_32 i4Rslt = -EINVAL;
1073 P_MSG_P2P_SWITCH_OP_MODE_T prP2pSwitchMode = (P_MSG_P2P_SWITCH_OP_MODE_T)NULL;
1076 if (wiphy == NULL) {
1081 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_stop_ap.\n"));
1082 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
1085 prP2pSwitchMode = cnmMemAlloc(prGlueInfo->prAdapter, RAM_TYPE_MSG, sizeof(MSG_P2P_SWITCH_OP_MODE_T));
1087 if (prP2pSwitchMode == NULL) {
1093 prP2pSwitchMode->rMsgHdr.eMsgId = MID_MNY_P2P_STOP_AP;
1095 mboxSendMsg(prGlueInfo->prAdapter,
1097 (P_MSG_HDR_T)prP2pSwitchMode,
1098 MSG_SEND_METHOD_BUF);
1105 } /* mtk_p2p_cfg80211_stop_ap */
1109 mtk_p2p_cfg80211_deauth (
1110 struct wiphy *wiphy,
1111 struct net_device *dev,
1112 struct cfg80211_deauth_request *req
1113 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0)
1118 P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL;
1122 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
1124 // not implemented yet
1125 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_deauth.\n"));
1128 } /* mtk_p2p_cfg80211_deauth */
1133 mtk_p2p_cfg80211_disassoc (
1134 struct wiphy *wiphy,
1135 struct net_device *dev,
1136 struct cfg80211_disassoc_request *req
1137 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0)
1142 P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL;
1146 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
1148 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_disassoc.\n"));
1150 // not implemented yet
1153 } /* mtk_p2p_cfg80211_disassoc */
1157 mtk_p2p_cfg80211_remain_on_channel (
1158 struct wiphy *wiphy,
1159 struct net_device *dev,
1160 struct ieee80211_channel *chan,
1161 enum nl80211_channel_type channel_type,
1162 unsigned int duration,
1166 INT_32 i4Rslt = -EINVAL;
1167 P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL;
1168 P_GL_P2P_INFO_T prGlueP2pInfo = (P_GL_P2P_INFO_T)NULL;
1169 P_MSG_P2P_CHNL_REQUEST_T prMsgChnlReq = (P_MSG_P2P_CHNL_REQUEST_T)NULL;
1173 if ((wiphy == NULL) ||
1180 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
1181 prGlueP2pInfo = prGlueInfo->prP2PInfo;
1183 *cookie = prGlueP2pInfo->u8Cookie++;
1185 prMsgChnlReq = cnmMemAlloc(prGlueInfo->prAdapter, RAM_TYPE_MSG, sizeof(MSG_P2P_CHNL_REQUEST_T));
1187 if (prMsgChnlReq == NULL) {
1193 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_remain_on_channel\n"));
1195 prMsgChnlReq->rMsgHdr.eMsgId = MID_MNY_P2P_CHNL_REQ;
1196 prMsgChnlReq->u8Cookie = *cookie;
1197 prMsgChnlReq->u4Duration = duration;
1200 mtk_p2p_cfg80211func_channel_format_switch(chan,
1202 &prMsgChnlReq->rChannelInfo,
1203 &prMsgChnlReq->eChnlSco);
1205 mboxSendMsg(prGlueInfo->prAdapter,
1207 (P_MSG_HDR_T)prMsgChnlReq,
1208 MSG_SEND_METHOD_BUF);
1218 /* mtk_p2p_cfg80211_remain_on_channel */
1222 mtk_p2p_cfg80211_cancel_remain_on_channel (
1223 struct wiphy *wiphy,
1224 struct net_device *dev,
1228 INT_32 i4Rslt = -EINVAL;
1229 P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL;
1230 P_MSG_P2P_CHNL_ABORT_T prMsgChnlAbort = (P_MSG_P2P_CHNL_ABORT_T)NULL;
1233 if ((wiphy == NULL) || (dev == NULL)) {
1238 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
1240 prMsgChnlAbort = cnmMemAlloc(prGlueInfo->prAdapter, RAM_TYPE_MSG, sizeof(MSG_P2P_CHNL_ABORT_T));
1242 if (prMsgChnlAbort == NULL) {
1248 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_cancel_remain_on_channel\n"));
1250 prMsgChnlAbort->rMsgHdr.eMsgId = MID_MNY_P2P_CHNL_ABORT;
1251 prMsgChnlAbort->u8Cookie = cookie;
1254 mboxSendMsg(prGlueInfo->prAdapter,
1256 (P_MSG_HDR_T)prMsgChnlAbort,
1257 MSG_SEND_METHOD_BUF);
1263 } /* mtk_p2p_cfg80211_cancel_remain_on_channel */
1266 mtk_p2p_cfg80211_mgmt_tx (
1267 struct wiphy *wiphy, struct net_device *dev,
1268 struct ieee80211_channel *chan, bool offchan,
1269 enum nl80211_channel_type channel_type,
1270 bool channel_type_valid, unsigned int wait,
1273 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
1275 bool dont_wait_for_ack,
1280 P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL;
1281 P_GL_P2P_INFO_T prGlueP2pInfo = (P_GL_P2P_INFO_T)NULL;
1282 INT_32 i4Rslt = -EINVAL;
1283 P_MSG_P2P_MGMT_TX_REQUEST_T prMsgTxReq = (P_MSG_P2P_MGMT_TX_REQUEST_T)NULL;
1284 P_MSDU_INFO_T prMgmtFrame = (P_MSDU_INFO_T)NULL;
1285 PUINT_8 pucFrameBuf = (PUINT_8)NULL;
1288 if ((wiphy == NULL) ||
1296 //DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_mgmt_tx\n"));
1298 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
1299 prGlueP2pInfo = prGlueInfo->prP2PInfo;
1301 *cookie = prGlueP2pInfo->u8Cookie++;
1303 /* Channel & Channel Type & Wait time are ignored. */
1304 prMsgTxReq = cnmMemAlloc(prGlueInfo->prAdapter, RAM_TYPE_MSG, sizeof(MSG_P2P_MGMT_TX_REQUEST_T));
1306 if (prMsgTxReq == NULL) {
1312 prMsgTxReq->fgNoneCckRate = FALSE;
1313 prMsgTxReq->fgIsWaitRsp = TRUE;
1315 prMgmtFrame = cnmMgtPktAlloc(prGlueInfo->prAdapter, (UINT_32)(len + MAC_TX_RESERVED_FIELD));
1317 if ((prMsgTxReq->prMgmtMsduInfo = prMgmtFrame) == NULL) {
1323 prMsgTxReq->u8Cookie = *cookie;
1324 prMsgTxReq->rMsgHdr.eMsgId = MID_MNY_P2P_MGMT_TX;
1326 pucFrameBuf = (PUINT_8)((UINT_32)prMgmtFrame->prPacket + MAC_TX_RESERVED_FIELD);
1328 kalMemCopy(pucFrameBuf, buf, len);
1330 prMgmtFrame->u2FrameLength = len;
1332 mboxSendMsg(prGlueInfo->prAdapter,
1334 (P_MSG_HDR_T)prMsgTxReq,
1335 MSG_SEND_METHOD_BUF);
1340 if ((i4Rslt != 0) && (prMsgTxReq != NULL)) {
1341 if (prMsgTxReq->prMgmtMsduInfo != NULL) {
1342 cnmMgtPktFree(prGlueInfo->prAdapter, prMsgTxReq->prMgmtMsduInfo);
1345 cnmMemFree(prGlueInfo->prAdapter, prMsgTxReq);
1349 } /* mtk_p2p_cfg80211_mgmt_tx */
1354 mtk_p2p_cfg80211_change_bss (
1355 struct wiphy *wiphy,
1356 struct net_device *dev,
1357 struct bss_parameters *params
1360 P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL;
1361 INT_32 i4Rslt = -EINVAL;
1365 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
1368 switch (params->use_cts_prot) {
1370 DBGLOG(P2P, TRACE, ("CTS protection no change\n"));
1373 DBGLOG(P2P, TRACE, ("CTS protection disable.\n"));
1376 DBGLOG(P2P, TRACE, ("CTS protection enable\n"));
1379 DBGLOG(P2P, TRACE, ("CTS protection unknown\n"));
1385 switch (params->use_short_preamble) {
1387 DBGLOG(P2P, TRACE, ("Short prreamble no change\n"));
1390 DBGLOG(P2P, TRACE, ("Short prreamble disable.\n"));
1393 DBGLOG(P2P, TRACE, ("Short prreamble enable\n"));
1396 DBGLOG(P2P, TRACE, ("Short prreamble unknown\n"));
1403 // not implemented yet
1404 p2pFuncChangeBssParam(prGlueInfo->prAdapter,
1405 prBssInfo->fgIsProtection,
1406 prBssInfo->fgIsShortPreambleAllowed,
1407 prBssInfo->fgUseShortSlotTime,
1418 } /* mtk_p2p_cfg80211_change_bss */
1423 mtk_p2p_cfg80211_del_station (
1424 struct wiphy *wiphy,
1425 struct net_device *dev,
1429 P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL;
1430 INT_32 i4Rslt = -EINVAL;
1431 P_MSG_P2P_CONNECTION_ABORT_T prDisconnectMsg = (P_MSG_P2P_CONNECTION_ABORT_T)NULL;
1432 UINT_8 aucBcMac[] = BC_MAC_ADDR;
1436 if ((wiphy == NULL) ||
1445 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_del_station.\n"));
1447 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
1449 //prDisconnectMsg = (P_MSG_P2P_CONNECTION_ABORT_T)kalMemAlloc(sizeof(MSG_P2P_CONNECTION_ABORT_T), VIR_MEM_TYPE);
1450 prDisconnectMsg = (P_MSG_P2P_CONNECTION_ABORT_T)cnmMemAlloc(prGlueInfo->prAdapter, RAM_TYPE_MSG, sizeof(MSG_P2P_CONNECTION_ABORT_T));
1452 if (prDisconnectMsg == NULL) {
1458 prDisconnectMsg->rMsgHdr.eMsgId = MID_MNY_P2P_CONNECTION_ABORT;
1459 COPY_MAC_ADDR(prDisconnectMsg->aucTargetID, mac);
1460 prDisconnectMsg->u2ReasonCode = REASON_CODE_UNSPECIFIED;
1462 mboxSendMsg(prGlueInfo->prAdapter,
1464 (P_MSG_HDR_T)prDisconnectMsg,
1465 MSG_SEND_METHOD_BUF);
1472 } /* mtk_p2p_cfg80211_del_station */
1476 mtk_p2p_cfg80211_connect (
1477 struct wiphy *wiphy,
1478 struct net_device *dev,
1479 struct cfg80211_connect_params *sme
1482 INT_32 i4Rslt = -EINVAL;
1483 P_GLUE_INFO_T prGlueInfo = NULL;
1484 P_MSG_P2P_CONNECTION_REQUEST_T prConnReqMsg = (P_MSG_P2P_CONNECTION_REQUEST_T)NULL;
1488 if ((wiphy == NULL) ||
1494 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_connect.\n"));
1496 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
1498 prConnReqMsg = (P_MSG_P2P_CONNECTION_REQUEST_T)cnmMemAlloc(prGlueInfo->prAdapter, RAM_TYPE_MSG, (sizeof(MSG_P2P_CONNECTION_REQUEST_T) + sme->ie_len));
1500 if (prConnReqMsg == NULL) {
1506 prConnReqMsg->rMsgHdr.eMsgId = MID_MNY_P2P_CONNECTION_REQ;
1508 COPY_SSID(prConnReqMsg->rSsid.aucSsid,
1509 prConnReqMsg->rSsid.ucSsidLen,
1513 COPY_MAC_ADDR(prConnReqMsg->aucBssid, sme->bssid);
1515 DBGLOG(P2P, TRACE, ("Assoc Req IE Buffer Length:%d\n", sme->ie_len));
1516 kalMemCopy(prConnReqMsg->aucIEBuf, sme->ie, sme->ie_len);
1517 prConnReqMsg->u4IELen = sme->ie_len;
1519 mtk_p2p_cfg80211func_channel_format_switch(sme->channel,
1521 &prConnReqMsg->rChannelInfo,
1522 &prConnReqMsg->eChnlSco);
1524 mboxSendMsg(prGlueInfo->prAdapter,
1526 (P_MSG_HDR_T)prConnReqMsg,
1527 MSG_SEND_METHOD_BUF);
1534 } /* mtk_p2p_cfg80211_connect */
1537 mtk_p2p_cfg80211_disconnect (
1538 struct wiphy *wiphy,
1539 struct net_device *dev,
1543 INT_32 i4Rslt = -EINVAL;
1544 P_GLUE_INFO_T prGlueInfo = NULL;
1545 P_MSG_P2P_CONNECTION_ABORT_T prDisconnMsg = (P_MSG_P2P_CONNECTION_ABORT_T)NULL;
1546 UINT_8 aucBCAddr[] = BC_MAC_ADDR;
1549 if ((wiphy == NULL) ||
1554 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_disconnect.\n"));
1556 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
1558 // prDisconnMsg = (P_MSG_P2P_CONNECTION_ABORT_T)kalMemAlloc(sizeof(P_MSG_P2P_CONNECTION_ABORT_T), VIR_MEM_TYPE);
1559 prDisconnMsg = (P_MSG_P2P_CONNECTION_ABORT_T)cnmMemAlloc(prGlueInfo->prAdapter, RAM_TYPE_MSG, sizeof(MSG_P2P_CONNECTION_ABORT_T));
1561 if (prDisconnMsg == NULL) {
1567 prDisconnMsg->rMsgHdr.eMsgId = MID_MNY_P2P_CONNECTION_ABORT;
1568 prDisconnMsg->u2ReasonCode = reason_code;
1569 prDisconnMsg->fgSendDeauth = TRUE;
1570 COPY_MAC_ADDR(prDisconnMsg->aucTargetID, aucBCAddr);
1572 mboxSendMsg(prGlueInfo->prAdapter,
1574 (P_MSG_HDR_T)prDisconnMsg,
1575 MSG_SEND_METHOD_UNBUF);
1581 } /* mtk_p2p_cfg80211_disconnect */
1585 mtk_p2p_cfg80211_change_iface (
1586 IN struct wiphy *wiphy,
1587 IN struct net_device *ndev,
1588 IN enum nl80211_iftype type,
1590 IN struct vif_params *params
1593 P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL;
1594 INT_32 i4Rslt = -EINVAL;
1595 P_MSG_P2P_SWITCH_OP_MODE_T prSwitchModeMsg = (P_MSG_P2P_SWITCH_OP_MODE_T)NULL;
1598 if ((wiphy == NULL) ||
1603 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_change_iface.\n"));
1605 if (ndev->ieee80211_ptr) {
1606 ndev->ieee80211_ptr->iftype = type;
1609 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
1613 prSwitchModeMsg = (P_MSG_P2P_SWITCH_OP_MODE_T)cnmMemAlloc(prGlueInfo->prAdapter, RAM_TYPE_MSG, sizeof(MSG_P2P_SWITCH_OP_MODE_T));
1615 if (prSwitchModeMsg == NULL) {
1621 prSwitchModeMsg->rMsgHdr.eMsgId = MID_MNY_P2P_FUN_SWITCH;
1624 case NL80211_IFTYPE_P2P_CLIENT:
1625 DBGLOG(P2P, TRACE, ("NL80211_IFTYPE_P2P_CLIENT.\n"));
1626 case NL80211_IFTYPE_STATION:
1627 if (type == NL80211_IFTYPE_STATION) {
1628 DBGLOG(P2P, TRACE, ("NL80211_IFTYPE_STATION.\n"));
1630 prSwitchModeMsg->eOpMode = OP_MODE_INFRASTRUCTURE;
1632 case NL80211_IFTYPE_AP:
1633 DBGLOG(P2P, TRACE, ("NL80211_IFTYPE_AP.\n"));
1634 case NL80211_IFTYPE_P2P_GO:
1635 if (type == NL80211_IFTYPE_P2P_GO) {
1636 DBGLOG(P2P, TRACE, ("NL80211_IFTYPE_P2P_GO not AP.\n"));
1638 prSwitchModeMsg->eOpMode = OP_MODE_ACCESS_POINT;
1641 DBGLOG(P2P, TRACE, ("Other type :%d .\n", type));
1642 prSwitchModeMsg->eOpMode = OP_MODE_P2P_DEVICE;
1647 mboxSendMsg(prGlueInfo->prAdapter,
1649 (P_MSG_HDR_T)prSwitchModeMsg,
1650 MSG_SEND_METHOD_BUF);
1658 } /* mtk_p2p_cfg80211_change_iface */
1662 mtk_p2p_cfg80211_set_channel (
1663 IN struct wiphy *wiphy,
1664 IN struct net_device *dev,
1665 IN struct ieee80211_channel *chan,
1666 IN enum nl80211_channel_type channel_type)
1668 INT_32 i4Rslt = -EINVAL;
1669 P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL;
1670 RF_CHANNEL_INFO_T rRfChnlInfo;
1673 if ((wiphy == NULL) ||
1679 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_set_channel.\n"));
1681 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
1683 mtk_p2p_cfg80211func_channel_format_switch(chan,
1688 p2pFuncSetChannel(prGlueInfo->prAdapter, &rRfChnlInfo);
1697 /* mtk_p2p_cfg80211_set_channel */
1700 mtk_p2p_cfg80211_set_bitrate_mask (
1701 IN struct wiphy *wiphy,
1702 IN struct net_device *dev,
1704 IN const struct cfg80211_bitrate_mask *mask
1707 INT_32 i4Rslt = -EINVAL;
1708 P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL;
1711 if ((wiphy == NULL) ||
1717 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_set_bitrate_mask\n"));
1719 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
1721 // TODO: Set bitrate mask of the peer?
1728 } /* mtk_p2p_cfg80211_set_bitrate_mask */
1732 mtk_p2p_cfg80211_mgmt_frame_register (
1733 IN struct wiphy *wiphy,
1734 IN struct net_device *dev,
1740 P_MSG_P2P_MGMT_FRAME_REGISTER_T prMgmtFrameRegister = (P_MSG_P2P_MGMT_FRAME_REGISTER_T)NULL;
1742 P_GLUE_INFO_T prGlueInfo = (P_GLUE_INFO_T)NULL;
1745 if ((wiphy == NULL) ||
1750 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_mgmt_frame_register\n"));
1752 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
1755 switch (frame_type) {
1756 case MAC_FRAME_PROBE_REQ:
1758 prGlueInfo->prP2PInfo->u4OsMgmtFrameFilter |= PARAM_PACKET_FILTER_PROBE_REQ;
1759 DBGLOG(P2P, TRACE, ("Open packet filer probe request\n"));
1762 prGlueInfo->prP2PInfo->u4OsMgmtFrameFilter &= ~PARAM_PACKET_FILTER_PROBE_REQ;
1763 DBGLOG(P2P, TRACE, ("Close packet filer probe request\n"));
1766 case MAC_FRAME_ACTION:
1768 prGlueInfo->prP2PInfo->u4OsMgmtFrameFilter |= PARAM_PACKET_FILTER_ACTION_FRAME;
1769 DBGLOG(P2P, TRACE, ("Open packet filer action frame.\n"));
1772 prGlueInfo->prP2PInfo->u4OsMgmtFrameFilter &= ~PARAM_PACKET_FILTER_ACTION_FRAME;
1773 DBGLOG(P2P, TRACE, ("Close packet filer action frame.\n"));
1777 DBGLOG(P2P, ERROR, ("Ask frog to add code for mgmt:%x\n", frame_type));
1783 if((prGlueInfo->prAdapter != NULL) && (prGlueInfo->prAdapter->fgIsP2PRegistered == TRUE)){
1785 prGlueInfo->u4Flag |= GLUE_FLAG_FRAME_FILTER;
1787 /* wake up main thread */
1788 wake_up_interruptible(&prGlueInfo->waitq);
1790 if (in_interrupt()) {
1791 DBGLOG(P2P, TRACE, ("It is in interrupt level\n"));
1799 prMgmtFrameRegister = (P_MSG_P2P_MGMT_FRAME_REGISTER_T)cnmMemAlloc(prGlueInfo->prAdapter,
1801 sizeof(MSG_P2P_MGMT_FRAME_REGISTER_T));
1803 if (prMgmtFrameRegister == NULL) {
1808 prMgmtFrameRegister->rMsgHdr.eMsgId = MID_MNY_P2P_MGMT_FRAME_REGISTER;
1810 prMgmtFrameRegister->u2FrameType = frame_type;
1811 prMgmtFrameRegister->fgIsRegister = reg;
1813 mboxSendMsg(prGlueInfo->prAdapter,
1815 (P_MSG_HDR_T)prMgmtFrameRegister,
1816 MSG_SEND_METHOD_BUF);
1824 } /* mtk_p2p_cfg80211_mgmt_frame_register */
1828 mtk_p2p_cfg80211func_channel_format_switch (
1829 IN struct ieee80211_channel *channel,
1830 IN enum nl80211_channel_type channel_type,
1831 IN P_RF_CHANNEL_INFO_T prRfChnlInfo,
1832 IN P_ENUM_CHNL_EXT_T prChnlSco
1835 BOOLEAN fgIsValid = FALSE;
1838 if (channel == NULL) {
1843 prRfChnlInfo->ucChannelNum = nicFreq2ChannelNum(channel->center_freq * 1000);
1845 switch (channel->band) {
1846 case IEEE80211_BAND_2GHZ:
1847 prRfChnlInfo->eBand = BAND_2G4;
1849 case IEEE80211_BAND_5GHZ:
1850 prRfChnlInfo->eBand = BAND_5G;
1853 prRfChnlInfo->eBand = BAND_2G4;
1862 switch (channel_type) {
1863 case NL80211_CHAN_NO_HT:
1864 *prChnlSco = CHNL_EXT_SCN;
1866 case NL80211_CHAN_HT20:
1867 *prChnlSco = CHNL_EXT_SCN;
1869 case NL80211_CHAN_HT40MINUS:
1870 *prChnlSco = CHNL_EXT_SCA;
1872 case NL80211_CHAN_HT40PLUS:
1873 *prChnlSco = CHNL_EXT_SCB;
1877 *prChnlSco = CHNL_EXT_SCN;
1888 /* mtk_p2p_cfg80211func_channel_format_switch */
1891 #if CONFIG_NL80211_TESTMODE
1892 int mtk_p2p_cfg80211_testmode_cmd(
1893 IN struct wiphy *wiphy,
1898 P_GLUE_INFO_T prGlueInfo = NULL;
1899 P_NL80211_DRIVER_TEST_PARAMS prParams = (P_NL80211_DRIVER_TEST_PARAMS)NULL;
1900 BOOLEAN fgIsValid = FALSE;
1904 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
1906 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_testmode_cmd\n"));
1909 prParams = (P_NL80211_DRIVER_TEST_PARAMS)data;
1911 if(prParams->index >> 24 == 0x01) {
1913 prParams->index = prParams->index & ~ BITS(24,31);
1917 mtk_p2p_cfg80211_testmode_p2p_sigma_pre_cmd(wiphy, data, len);
1922 /* Clear the version byte */
1923 prParams->index = prParams->index & ~ BITS(24,31);
1926 switch(prParams->index){
1927 case 1: /* P2P Simga */
1928 if(mtk_p2p_cfg80211_testmode_p2p_sigma_cmd(wiphy, data, len))
1933 if(mtk_p2p_cfg80211_testmode_wfd_update_cmd(wiphy, data, len))
1937 case 3: /* Hotspot Client Management */
1938 if(mtk_p2p_cfg80211_testmode_hotspot_block_list_cmd(wiphy, data, len))
1952 int mtk_p2p_cfg80211_testmode_p2p_sigma_pre_cmd(
1953 IN struct wiphy *wiphy,
1958 P_GLUE_INFO_T prGlueInfo = NULL;
1959 NL80211_DRIVER_TEST_PRE_PARAMS rParams;
1960 P_P2P_SPECIFIC_BSS_INFO_T prP2pSpecificBssInfo = (P_P2P_SPECIFIC_BSS_INFO_T)NULL;
1961 P_P2P_CONNECTION_SETTINGS_T prP2pConnSettings = (P_P2P_CONNECTION_SETTINGS_T)NULL;
1970 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
1972 kalMemZero(&rParams, sizeof(NL80211_DRIVER_TEST_PRE_PARAMS));
1974 prP2pSpecificBssInfo = prGlueInfo->prAdapter->rWifiVar.prP2pSpecificBssInfo;
1975 prP2pConnSettings = prGlueInfo->prAdapter->rWifiVar.prP2PConnSettings;
1977 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_testmode_p2p_sigma_pre_cmd\n"));
1980 memcpy(&rParams, data, len);
1982 DBGLOG(P2P, TRACE, ("NL80211_ATTR_TESTDATA,idx_mode=%d idx=%d value=%lu\n",
1983 (INT_16)rParams.idx_mode, (INT_16)rParams.idx, rParams.value));
1985 index_mode = rParams.idx_mode;
1986 index = rParams.idx;
1987 value = rParams.value;
1990 case 0: /* Listen CH */
1992 case 1: /* P2p mode */
1994 case 4: /* Noa duration */
1995 prP2pSpecificBssInfo->rNoaParam.u4NoaDurationMs = value;
1996 // only to apply setting when setting NOA count
1997 //status = mtk_p2p_wext_set_noa_param(prDev, info, wrqu, (char *)&prP2pSpecificBssInfo->rNoaParam);
1999 case 5: /* Noa interval */
2000 prP2pSpecificBssInfo->rNoaParam.u4NoaIntervalMs = 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 6: /* Noa count */
2005 prP2pSpecificBssInfo->rNoaParam.u4NoaCount = value;
2006 //status = mtk_p2p_wext_set_noa_param(prDev, info, wrqu, (char *)&prP2pSpecificBssInfo->rNoaParam);
2008 case 100: /* Oper CH */
2009 // 20110920 - frog: User configurations are placed in ConnSettings.
2010 // prP2pConnSettings->ucOperatingChnl = value;
2012 case 101: /* Local config Method, for P2P SDK */
2013 prP2pConnSettings->u2LocalConfigMethod = value;
2015 case 102: /* Sigma P2p reset */
2016 //kalMemZero(prP2pConnSettings->aucTargetDevAddr, MAC_ADDR_LEN);
2017 //prP2pConnSettings->eConnectionPolicy = ENUM_P2P_CONNECTION_POLICY_AUTO;
2018 p2pFsmUninit(prGlueInfo->prAdapter);
2019 p2pFsmInit(prGlueInfo->prAdapter);
2021 case 103: /* WPS MODE */
2022 kalP2PSetWscMode(prGlueInfo, value);
2024 case 104: /* P2p send persence, duration */
2026 case 105: /* P2p send persence, interval */
2028 case 106: /* P2P set sleep */
2030 kalIoctl(prGlueInfo,
2031 wlanoidSetP2pPowerSaveProfile,
2040 case 107: /* P2P set opps, CTWindowl */
2041 prP2pSpecificBssInfo->rOppPsParam.u4CTwindowMs = value;
2042 //status = mtk_p2p_wext_set_oppps_param(prDev, info, wrqu, (char *)&prP2pSpecificBssInfo->rOppPsParam);
2044 case 108: /* p2p_set_power_save */
2045 kalIoctl(prGlueInfo,
2046 wlanoidSetP2pPowerSaveProfile,
2066 mtk_p2p_cfg80211_testmode_p2p_sigma_cmd(
2067 IN struct wiphy *wiphy,
2071 P_GLUE_INFO_T prGlueInfo = NULL;
2072 P_NL80211_DRIVER_P2P_SIGMA_PARAMS prParams = (P_NL80211_DRIVER_P2P_SIGMA_PARAMS)NULL;
2073 P_P2P_SPECIFIC_BSS_INFO_T prP2pSpecificBssInfo = (P_P2P_SPECIFIC_BSS_INFO_T)NULL;
2074 P_P2P_CONNECTION_SETTINGS_T prP2pConnSettings = (P_P2P_CONNECTION_SETTINGS_T)NULL;
2082 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
2084 prP2pSpecificBssInfo = prGlueInfo->prAdapter->rWifiVar.prP2pSpecificBssInfo;
2085 prP2pConnSettings = prGlueInfo->prAdapter->rWifiVar.prP2PConnSettings;
2087 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_testmode_p2p_sigma_cmd\n"));
2090 prParams = (P_NL80211_DRIVER_P2P_SIGMA_PARAMS)data;
2092 index = (INT_32)prParams->idx;
2093 value = (INT_32)prParams->value;
2095 DBGLOG(P2P, TRACE, ("NL80211_ATTR_TESTDATA, idx=%lu value=%lu\n",
2096 (INT_32)prParams->idx, (INT_32)prParams->value));
2099 case 0: /* Listen CH */
2101 case 1: /* P2p mode */
2103 case 4: /* Noa duration */
2104 prP2pSpecificBssInfo->rNoaParam.u4NoaDurationMs = value;
2105 // only to apply setting when setting NOA count
2106 //status = mtk_p2p_wext_set_noa_param(prDev, info, wrqu, (char *)&prP2pSpecificBssInfo->rNoaParam);
2108 case 5: /* Noa interval */
2109 prP2pSpecificBssInfo->rNoaParam.u4NoaIntervalMs = 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 6: /* Noa count */
2114 prP2pSpecificBssInfo->rNoaParam.u4NoaCount = value;
2115 //status = mtk_p2p_wext_set_noa_param(prDev, info, wrqu, (char *)&prP2pSpecificBssInfo->rNoaParam);
2117 case 100: /* Oper CH */
2118 // 20110920 - frog: User configurations are placed in ConnSettings.
2119 // prP2pConnSettings->ucOperatingChnl = value;
2121 case 101: /* Local config Method, for P2P SDK */
2122 prP2pConnSettings->u2LocalConfigMethod = value;
2124 case 102: /* Sigma P2p reset */
2125 //kalMemZero(prP2pConnSettings->aucTargetDevAddr, MAC_ADDR_LEN);
2126 //prP2pConnSettings->eConnectionPolicy = ENUM_P2P_CONNECTION_POLICY_AUTO;
2128 case 103: /* WPS MODE */
2129 kalP2PSetWscMode(prGlueInfo, value);
2131 case 104: /* P2p send persence, duration */
2133 case 105: /* P2p send persence, interval */
2135 case 106: /* P2P set sleep */
2137 kalIoctl(prGlueInfo,
2138 wlanoidSetP2pPowerSaveProfile,
2147 case 107: /* P2P set opps, CTWindowl */
2148 prP2pSpecificBssInfo->rOppPsParam.u4CTwindowMs = value;
2149 //status = mtk_p2p_wext_set_oppps_param(prDev, info, wrqu, (char *)&prP2pSpecificBssInfo->rOppPsParam);
2151 case 108: /* p2p_set_power_save */
2152 kalIoctl(prGlueInfo,
2153 wlanoidSetP2pPowerSaveProfile,
2163 case 109: /* Max Clients*/
2164 kalP2PSetMaxClients(prGlueInfo, value);
2176 mtk_p2p_cfg80211_testmode_wfd_update_cmd(
2177 IN struct wiphy *wiphy,
2181 P_GLUE_INFO_T prGlueInfo = NULL;
2182 P_NL80211_DRIVER_WFD_PARAMS prParams = (P_NL80211_DRIVER_WFD_PARAMS)NULL;
2184 P_WFD_CFG_SETTINGS_T prWfdCfgSettings = (P_WFD_CFG_SETTINGS_T)NULL;
2185 P_MSG_WFD_CONFIG_SETTINGS_CHANGED_T prMsgWfdCfgUpdate = (P_MSG_WFD_CONFIG_SETTINGS_CHANGED_T)NULL;
2189 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
2191 prParams = (P_NL80211_DRIVER_WFD_PARAMS)data;
2194 DBGLOG(P2P, INFO, ("mtk_p2p_cfg80211_testmode_wfd_update_cmd\n"));
2198 DBGLOG(P2P, INFO,("WFD Enable:%x\n", prParams->WfdEnable));
2199 DBGLOG(P2P, INFO,("WFD Session Available:%x\n", prParams->WfdSessionAvailable));
2200 DBGLOG(P2P, INFO,("WFD Couple Sink Status:%x\n", prParams->WfdCoupleSinkStatus));
2202 DBGLOG(P2P, INFO,("WFD Device Info:%x\n", prParams->WfdDevInfo));
2203 DBGLOG(P2P, INFO,("WFD Control Port:%x\n", prParams->WfdControlPort));
2204 DBGLOG(P2P, INFO,("WFD Maximum Throughput:%x\n", prParams->WfdMaximumTp));
2205 DBGLOG(P2P, INFO,("WFD Extend Capability:%x\n", prParams->WfdExtendCap));
2206 DBGLOG(P2P, INFO,("WFD Couple Sink Addr "MACSTR" \n", MAC2STR(prParams->WfdCoupleSinkAddress)));
2207 DBGLOG(P2P, INFO,("WFD Associated BSSID "MACSTR" \n", MAC2STR(prParams->WfdAssociatedBssid)));
2208 //UINT_8 aucVideolp[4];
2209 //UINT_8 aucAudiolp[4];
2210 DBGLOG(P2P, INFO,("WFD Video Port:%x\n", prParams->WfdVideoPort));
2211 DBGLOG(P2P, INFO,("WFD Audio Port:%x\n", prParams->WfdAudioPort));
2212 DBGLOG(P2P, INFO,("WFD Flag:%x\n", prParams->WfdFlag));
2213 DBGLOG(P2P, INFO,("WFD Policy:%x\n", prParams->WfdPolicy));
2214 DBGLOG(P2P, INFO,("WFD State:%x\n", prParams->WfdState));
2215 //UINT_8 aucWfdSessionInformationIE[24*8];
2216 DBGLOG(P2P, INFO,("WFD Session Info Length:%x\n", prParams->WfdSessionInformationIELen));
2217 //UINT_8 aucReserved1[2];
2218 DBGLOG(P2P, INFO,("WFD Primary Sink Addr "MACSTR" \n", MAC2STR(prParams->aucWfdPrimarySinkMac)));
2219 DBGLOG(P2P, INFO,("WFD Secondary Sink Addr "MACSTR" \n", MAC2STR(prParams->aucWfdSecondarySinkMac)));
2220 DBGLOG(P2P, INFO,("WFD Advanced Flag:%x\n", prParams->WfdAdvanceFlag));
2221 DBGLOG(P2P, INFO,("WFD Sigma mode:%x\n", prParams->WfdSigmaMode));
2222 //UINT_8 aucReserved2[64];
2223 //UINT_8 aucReserved3[64];
2224 //UINT_8 aucReserved4[64];
2228 prWfdCfgSettings = &(prGlueInfo->prAdapter->rWifiVar.prP2pFsmInfo->rWfdConfigureSettings);
2230 kalMemCopy(&prWfdCfgSettings->u4WfdCmdType, &prParams->WfdCmdType, sizeof(WFD_CFG_SETTINGS_T));
2232 prMsgWfdCfgUpdate = cnmMemAlloc(prGlueInfo->prAdapter, RAM_TYPE_MSG, sizeof(MSG_WFD_CONFIG_SETTINGS_CHANGED_T));
2234 if (prMsgWfdCfgUpdate == NULL) {
2239 prMsgWfdCfgUpdate->rMsgHdr.eMsgId = MID_MNY_P2P_WFD_CFG_UPDATE;
2240 prMsgWfdCfgUpdate->prWfdCfgSettings = prWfdCfgSettings;
2243 mboxSendMsg(prGlueInfo->prAdapter,
2245 (P_MSG_HDR_T)prMsgWfdCfgUpdate,
2246 MSG_SEND_METHOD_BUF);
2248 // prWfdCfgSettings->ucWfdEnable = 1;
2249 // prWfdCfgSettings->u4WfdFlag |= WFD_FLAGS_DEV_INFO_VALID;
2250 prWfdCfgSettings->u4WfdFlag |= WFD_FLAGS_DEV_INFO_VALID;
2251 prWfdCfgSettings->u2WfdDevInfo = 123;
2252 prWfdCfgSettings->u2WfdControlPort = 456;
2253 prWfdCfgSettings->u2WfdMaximumTp = 789;
2256 prWfdCfgSettings->u4WfdFlag |= WFD_FLAGS_SINK_INFO_VALID;
2257 prWfdCfgSettings->ucWfdCoupleSinkStatus = 0xAB;
2259 UINT_8 aucTestAddr[MAC_ADDR_LEN] = {0x77, 0x66, 0x55, 0x44, 0x33, 0x22};
2260 COPY_MAC_ADDR(prWfdCfgSettings->aucWfdCoupleSinkAddress, aucTestAddr);
2263 prWfdCfgSettings->u4WfdFlag |= WFD_FLAGS_EXT_CAPABILITY_VALID;
2264 prWfdCfgSettings->u2WfdExtendCap = 0xCDE;
2271 #endif /* CFG_SUPPORT_WFD */
2276 mtk_p2p_cfg80211_testmode_hotspot_block_list_cmd(
2277 IN struct wiphy *wiphy,
2281 P_GLUE_INFO_T prGlueInfo = NULL;
2282 P_NL80211_DRIVER_hotspot_block_PARAMS prParams = (P_NL80211_DRIVER_hotspot_block_PARAMS)NULL;
2287 prGlueInfo = *((P_GLUE_INFO_T *) wiphy_priv(wiphy));
2290 prParams = (P_NL80211_DRIVER_hotspot_block_PARAMS)data;
2292 DBGLOG(P2P, TRACE, ("mtk_p2p_cfg80211_testmode_hotspot_block_list_cmd\n"));
2294 fgIsValid = kalP2PSetBlackList(prGlueInfo, prParams->aucBssid, prParams->ucblocked);
2303 #endif // LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 32)
2305 #endif // CFG_ENABLE_WIFI_DIRECT && CFG_ENABLE_WIFI_DIRECT_CFG_80211