Ejemplo n.º 1
0
VOID
kalP2PIndicateChannelReady(IN P_GLUE_INFO_T prGlueInfo,
			   IN UINT_64 u8SeqNum,
			   IN UINT_32 u4ChannelNum,
			   IN ENUM_BAND_T eBand, IN ENUM_CHNL_EXT_T eSco, IN UINT_32 u4Duration)
{
	struct ieee80211_channel *prIEEE80211ChnlStruct = (struct ieee80211_channel *)NULL;
	RF_CHANNEL_INFO_T rChannelInfo;
	enum nl80211_channel_type eChnlType = NL80211_CHAN_NO_HT;

	do {
		if (prGlueInfo == NULL)
			break;

		kalMemZero(&rChannelInfo, sizeof(RF_CHANNEL_INFO_T));

		rChannelInfo.ucChannelNum = u4ChannelNum;
		rChannelInfo.eBand = eBand;

		prIEEE80211ChnlStruct = kalP2pFuncGetChannelEntry(prGlueInfo->prP2PInfo, &rChannelInfo);

		kalP2pFuncGetChannelType(eSco, &eChnlType);

		cfg80211_ready_on_channel(prGlueInfo->prP2PInfo->prWdev,	/* struct wireless_dev, */
					  u8SeqNum,	/* u64 cookie, */
					  prIEEE80211ChnlStruct,	/* struct ieee80211_channel * chan, */
					  u4Duration,	/* unsigned int duration, */
					  GFP_KERNEL);	/* gfp_t gfp */    /* allocation flags */
	} while (FALSE);

}				/* kalP2PIndicateChannelReady */
Ejemplo n.º 2
0
VOID
kalP2PIndicateChannelReady (
    IN P_GLUE_INFO_T prGlueInfo,
    IN UINT_64 u8SeqNum,
    IN UINT_32 u4ChannelNum,
    IN ENUM_BAND_T eBand,
    IN ENUM_CHNL_EXT_T eSco,
    IN UINT_32 u4Duration
    )
{
    struct ieee80211_channel *prIEEE80211ChnlStruct = (struct ieee80211_channel *)NULL;
    RF_CHANNEL_INFO_T rChannelInfo;
    enum nl80211_channel_type eChnlType = NL80211_CHAN_NO_HT;
    P_MSG_P2P_MGMT_TX_REQUEST_T prMsgTxReq = (P_MSG_P2P_MGMT_TX_REQUEST_T)NULL;
    INT_32 i4Rslt = -EINVAL;
	P_P2P_FSM_INFO_T prP2pFsmInfo = (P_P2P_FSM_INFO_T)NULL;
    prP2pFsmInfo = prGlueInfo->prAdapter->rWifiVar.prP2pFsmInfo;
 	P_P2P_CHNL_REQ_INFO_T prChnlReqInfo = &(prP2pFsmInfo->rChnlReqInfo);
	
	 
    do {
        if (prGlueInfo == NULL) {
            break;
        }

	if (prChnlReqInfo->fgNeedIndSupp) {
        kalMemZero(&rChannelInfo, sizeof(RF_CHANNEL_INFO_T));

        rChannelInfo.ucChannelNum = u4ChannelNum;
        rChannelInfo.eBand = eBand;

        prIEEE80211ChnlStruct = kalP2pFuncGetChannelEntry(prGlueInfo->prP2PInfo, &rChannelInfo);

        kalP2pFuncGetChannelType(eSco, &eChnlType);

        cfg80211_ready_on_channel(prGlueInfo->prP2PInfo->prDevHandler, //struct net_device * dev,
                        u8SeqNum, //u64 cookie,
                        prIEEE80211ChnlStruct, //struct ieee80211_channel * chan,
                        eChnlType, //enum nl80211_channel_type channel_type,
                        u4Duration, //unsigned int duration,
                        GFP_KERNEL); //gfp_t gfp    /* allocation flags */
	} 

	if (prChnlReqInfo->prMsgTxReq!=NULL) {
		prMsgTxReq = prChnlReqInfo->prMsgTxReq;
		mboxSendMsg(prGlueInfo->prAdapter,
                            MBOX_ID_0,
                            (P_MSG_HDR_T)prMsgTxReq,
                            MSG_SEND_METHOD_UNBUF);
		i4Rslt = 0;
		prChnlReqInfo->prMsgTxReq=NULL;
		atomic_set(&prGlueInfo->rMgmtTxAto, 0);
		complete(&prGlueInfo->rMgmtTxComp);
		init_completion(&prGlueInfo->rMgmtTxComp);
	}
	} while (FALSE);
	return i4Rslt;

} /* kalP2PIndicateChannelReady */
Ejemplo n.º 3
0
VOID
kalP2PIndicateBssInfo (
    IN P_GLUE_INFO_T prGlueInfo,
    IN PUINT_8 pucFrameBuf,
    IN UINT_32 u4BufLen,
    IN P_RF_CHANNEL_INFO_T prChannelInfo,
    IN INT_32 i4SignalStrength
    )
{
    P_GL_P2P_INFO_T prGlueP2pInfo = (P_GL_P2P_INFO_T)NULL;
    struct ieee80211_channel *prChannelEntry = (struct ieee80211_channel *)NULL;
    struct ieee80211_mgmt *prBcnProbeRspFrame = (struct ieee80211_mgmt *)pucFrameBuf;
    struct cfg80211_bss *prCfg80211Bss = (struct cfg80211_bss *)NULL;

    do {
        if ((prGlueInfo == NULL) || (pucFrameBuf == NULL) || (prChannelInfo == NULL)) {
            ASSERT(FALSE);
            break;
        }

        prGlueP2pInfo = prGlueInfo->prP2PInfo;

        if (prGlueP2pInfo == NULL) {
            ASSERT(FALSE);
            break;
        }


        prChannelEntry = kalP2pFuncGetChannelEntry(prGlueP2pInfo, prChannelInfo);

        if (prChannelEntry == NULL) {
            DBGLOG(P2P, TRACE, ("Unknown channel info\n"));
            break;
        }


        //rChannelInfo.center_freq = nicChannelNum2Freq((UINT_32)prChannelInfo->ucChannelNum) / 1000;

        prCfg80211Bss = cfg80211_inform_bss_frame(prGlueP2pInfo->wdev.wiphy, //struct wiphy * wiphy,
                                prChannelEntry,
                                prBcnProbeRspFrame,
                                u4BufLen,
                                i4SignalStrength,
                                GFP_KERNEL);


        /* Return this structure. */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0)
        cfg80211_put_bss(prGlueP2pInfo->wdev.wiphy, prCfg80211Bss);
#else
        cfg80211_put_bss(prCfg80211Bss);
#endif

    } while (FALSE);

    return;

} /* kalP2PIndicateBssInfo */
Ejemplo n.º 4
0
VOID
kalP2PIndicateChannelExpired (
    IN P_GLUE_INFO_T prGlueInfo,
    IN UINT_64 u8SeqNum,
    IN UINT_32 u4ChannelNum,
    IN ENUM_BAND_T eBand,
    IN ENUM_CHNL_EXT_T eSco
    )
{

    P_GL_P2P_INFO_T prGlueP2pInfo = (P_GL_P2P_INFO_T)NULL;
    struct ieee80211_channel *prIEEE80211ChnlStruct = (struct ieee80211_channel *)NULL;
    enum nl80211_channel_type eChnlType = NL80211_CHAN_NO_HT;
    RF_CHANNEL_INFO_T rRfChannelInfo;

    do {
        if (prGlueInfo == NULL) {
            ASSERT(FALSE);
            break;
        }

        prGlueP2pInfo = prGlueInfo->prP2PInfo;

        if (prGlueP2pInfo == NULL) {
            ASSERT(FALSE);
            break;
        }


        DBGLOG(P2P, TRACE, ("kalP2PIndicateChannelExpired\n"));

        rRfChannelInfo.eBand = eBand;
        rRfChannelInfo.ucChannelNum = u4ChannelNum;

        prIEEE80211ChnlStruct = kalP2pFuncGetChannelEntry(prGlueP2pInfo, &rRfChannelInfo);


        kalP2pFuncGetChannelType(eSco, &eChnlType);

#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)  
        cfg80211_remain_on_channel_expired(&prGlueP2pInfo->wdev, //struct wireless_dev,
                        u8SeqNum,
                        prIEEE80211ChnlStruct,
                        GFP_KERNEL);  
#else
        cfg80211_remain_on_channel_expired(prGlueP2pInfo->prDevHandler, //struct net_device * dev,
                        u8SeqNum,
                        prIEEE80211ChnlStruct,
                        eChnlType,
                        GFP_KERNEL);
#endif
    } while (FALSE);

} /* kalP2PIndicateChannelExpired */
Ejemplo n.º 5
0
VOID
kalP2PIndicateChannelExpired (
    IN P_GLUE_INFO_T prGlueInfo,
    IN P_P2P_CHNL_REQ_INFO_T prChnlReqInfo
    )
{

    P_GL_P2P_INFO_T prGlueP2pInfo = (P_GL_P2P_INFO_T)NULL;
    struct ieee80211_channel *prIEEE80211ChnlStruct = (struct ieee80211_channel *)NULL;
    enum nl80211_channel_type eChnlType = NL80211_CHAN_NO_HT;
    RF_CHANNEL_INFO_T rRfChannelInfo;

    do {
        if ((prGlueInfo == NULL) || (prChnlReqInfo == NULL)) {

            ASSERT(FALSE);
            break;
        }

        prGlueP2pInfo = prGlueInfo->prP2PInfo;

        if (prGlueP2pInfo == NULL) {
            ASSERT(FALSE);
            break;
        }


        DBGLOG(P2P, TRACE, ("kalP2PIndicateChannelExpired\n"));

        rRfChannelInfo.eBand = prChnlReqInfo->eBand;
        rRfChannelInfo.ucChannelNum = prChnlReqInfo->ucReqChnlNum;

        prIEEE80211ChnlStruct = kalP2pFuncGetChannelEntry(prGlueP2pInfo, &rRfChannelInfo);


        kalP2pFuncGetChannelType(prChnlReqInfo->eChnlSco,
                                    &eChnlType);


        cfg80211_remain_on_channel_expired(prGlueP2pInfo->prDevHandler, //struct net_device * dev,
                        prChnlReqInfo->u8Cookie,
                        prIEEE80211ChnlStruct,
                        eChnlType,
                        GFP_KERNEL);

    } while (FALSE);

} /* kalP2PIndicateChannelExpired */
Ejemplo n.º 6
0
VOID
kalP2PIndicateBssInfo(IN P_GLUE_INFO_T prGlueInfo,
		      IN PUINT_8 pucFrameBuf,
		      IN UINT_32 u4BufLen, IN P_RF_CHANNEL_INFO_T prChannelInfo, IN INT_32 i4SignalStrength)
{
	P_GL_P2P_INFO_T prGlueP2pInfo = (P_GL_P2P_INFO_T) NULL;
	struct ieee80211_channel *prChannelEntry = (struct ieee80211_channel *)NULL;
	struct ieee80211_mgmt *prBcnProbeRspFrame = (struct ieee80211_mgmt *)pucFrameBuf;
	struct cfg80211_bss *prCfg80211Bss = (struct cfg80211_bss *)NULL;

	do {
		if ((prGlueInfo == NULL) || (pucFrameBuf == NULL) || (prChannelInfo == NULL)) {
			ASSERT(FALSE);
			break;
		}

		prGlueP2pInfo = prGlueInfo->prP2PInfo;

		if (prGlueP2pInfo == NULL) {
			ASSERT(FALSE);
			break;
		}

		prChannelEntry = kalP2pFuncGetChannelEntry(prGlueP2pInfo, prChannelInfo);

		if (prChannelEntry == NULL) {
			DBGLOG(P2P, WARN, "Unknown channel info\n");
			break;
		}
		/* rChannelInfo.center_freq = nicChannelNum2Freq((UINT_32)prChannelInfo->ucChannelNum) / 1000; */

		prCfg80211Bss = cfg80211_inform_bss_frame(prGlueP2pInfo->prWdev->wiphy,	/* struct wiphy * wiphy, */
							  prChannelEntry,
							  prBcnProbeRspFrame, u4BufLen, i4SignalStrength, GFP_KERNEL);

		/* Return this structure. */
		if (!prCfg80211Bss) {
			DBGLOG(P2P, WARN, "inform bss to cfg80211 failed, bss channel %d, rcpi %d\n",
					prChannelInfo->ucChannelNum, i4SignalStrength);
		} else {
			cfg80211_put_bss(prGlueP2pInfo->prWdev->wiphy, prCfg80211Bss);
			DBGLOG(P2P, TRACE, "inform bss to cfg80211, bss channel %d, rcpi %d\n",
					prChannelInfo->ucChannelNum, i4SignalStrength);
		}
	} while (FALSE);

}				/* kalP2PIndicateBssInfo */
Ejemplo n.º 7
0
VOID
kalP2PIndicateChannelReady (
    IN P_GLUE_INFO_T prGlueInfo,
    IN UINT_64 u8SeqNum,
    IN UINT_32 u4ChannelNum,
    IN ENUM_BAND_T eBand,
    IN ENUM_CHNL_EXT_T eSco,
    IN UINT_32 u4Duration
    )
{
    struct ieee80211_channel *prIEEE80211ChnlStruct = (struct ieee80211_channel *)NULL;
    RF_CHANNEL_INFO_T rChannelInfo;
    enum nl80211_channel_type eChnlType = NL80211_CHAN_NO_HT;

    do {
        if (prGlueInfo == NULL) {
            break;
        }


        kalMemZero(&rChannelInfo, sizeof(RF_CHANNEL_INFO_T));

        rChannelInfo.ucChannelNum = u4ChannelNum;
        rChannelInfo.eBand = eBand;

        prIEEE80211ChnlStruct = kalP2pFuncGetChannelEntry(prGlueInfo->prP2PInfo, &rChannelInfo);

        kalP2pFuncGetChannelType(eSco, &eChnlType);
        
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)    
        cfg80211_ready_on_channel(&prGlueInfo->prP2PInfo->wdev, //struct wireless_dev,
                        u8SeqNum, //u64 cookie,
                        prIEEE80211ChnlStruct, //struct ieee80211_channel * chan,
                        u4Duration, //unsigned int duration,
                        GFP_KERNEL); //gfp_t gfp    /* allocation flags */
#else
        cfg80211_ready_on_channel(prGlueInfo->prP2PInfo->prDevHandler, //struct net_device * dev,
                        u8SeqNum, //u64 cookie,
                        prIEEE80211ChnlStruct, //struct ieee80211_channel * chan,
                        eChnlType, //enum nl80211_channel_type channel_type,
                        u4Duration, //unsigned int duration,
                        GFP_KERNEL); //gfp_t gfp    /* allocation flags */
#endif
    } while (FALSE);

} /* kalP2PIndicateChannelReady */