• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ os_free_mem函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中os_free_mem函数的典型用法代码示例。如果您正苦于以下问题:C++ os_free_mem函数的具体用法?C++ os_free_mem怎么用?C++ os_free_mem使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了os_free_mem函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: APPeerDlsTearDownAction

/*
========================================================================
Routine Description:
	Handle peer DLS Tear down action frame.

Arguments:
    pAd				points to our adapter
    *pElem			action frame

Return Value:
    None

Note:
========================================================================
*/
VOID APPeerDlsTearDownAction(
    IN PRTMP_ADAPTER	pAd,
    IN MLME_QUEUE_ELEM	*pElem)
{
	PMAC_TABLE_ENTRY	pDAEntry, pSAEntry;
	UCHAR				DA[MAC_ADDR_LEN], SA[MAC_ADDR_LEN];
	UINT16				ReasonCode;
	PUCHAR				pOutBuffer = NULL;
	PFRAME_802_11		Fr;
	UINT32				FrameLen = 0;


	/* frame sanity check */
    if (! PeerDlsTearDownSanity(pAd, pElem->Msg, pElem->MsgLen,
									DA, SA, &ReasonCode))
	{
        return;
	}

    MTWF_LOG(DBG_CAT_ALL, DBG_SUBCAT_ALL, DBG_LVL_TRACE,
			("DLS - PeerDlsTearDownAction() from %02x:%02x:%02x:%02x:%02x:%02x\n",
			SA[0], SA[1], SA[2], SA[3], SA[4], SA[5]));

	pSAEntry = MacTableLookup(pAd, SA);
    if (!pSAEntry)
    	return;

	pDAEntry = MacTableLookup(pAd, DA);
	if (!pDAEntry)
	{
		MTWF_LOG(DBG_CAT_ALL, DBG_SUBCAT_ALL, DBG_LVL_TRACE, ("Destination station does not exist!\n"));
		return;
	}

	pSAEntry->bDlsInit = FALSE;

    /* forward Tear-down to real destination */
    Fr = (PFRAME_802_11)pElem->Msg;

	os_alloc_mem(pAd, (UCHAR **)&pOutBuffer, MAX_LEN_OF_MLME_BUFFER);
	if (pOutBuffer == NULL)
		return; /* fatal error, no available memory */

	NdisMoveMemory(Fr->Hdr.Addr1, DA, MAC_ADDR_LEN);
	NdisMoveMemory(Fr->Hdr.Addr2, pAd->ApCfg.MBSSID[pSAEntry->apidx].wdev.bssid, MAC_ADDR_LEN);
	NdisMoveMemory(Fr->Hdr.Addr3, SA, MAC_ADDR_LEN);

	NdisMoveMemory(pOutBuffer, pElem->Msg, pElem->MsgLen);
	FrameLen = pElem->MsgLen;

	/* transmit the tear down frame */
	MiniportMMRequest(pAd, QID_AC_BE, pOutBuffer, FrameLen);
	os_free_mem(NULL, pOutBuffer);
}
开发者ID:AnyoeDove,项目名称:mtk-sources,代码行数:69,代码来源:ap_dls.c


示例2: ChannelInfoDestroy

void ChannelInfoDestroy(
	IN PRTMP_ADAPTER pAd)
{
	if (pAd->pChannelInfo)
	{
		os_free_mem(NULL, pAd->pChannelInfo);
		pAd->pChannelInfo = NULL;
	}

	return;
}
开发者ID:vm3vuy,项目名称:my-local-repository,代码行数:11,代码来源:ap_autoChSel.c


示例3: AutoChBssTableDestroy

void AutoChBssTableDestroy(
	IN PRTMP_ADAPTER pAd)
{
	if (pAd->pBssInfoTab)
	{
		os_free_mem(NULL, pAd->pBssInfoTab);
		pAd->pBssInfoTab = NULL;
	}

	return;
}
开发者ID:schidler,项目名称:flyzjhz-rt-n56u,代码行数:11,代码来源:ap_autoChSel.c


示例4: MultipathPoolExit

VOID MultipathPoolExit(
	IN PRTMP_ADAPTER pAd)
{
	NdisFreeSpinLock(&pAd->MeshTab.MultipathTabLock);

	if (pAd->MeshTab.pMultipathEntryPool)
/*		kfree(pAd->MeshTab.pMultipathEntryPool); */
		os_free_mem(NULL, pAd->MeshTab.pMultipathEntryPool);
	pAd->MeshTab.pMultipathEntryPool = NULL;

	return;
}
开发者ID:23171580,项目名称:ralink,代码行数:12,代码来源:mesh_bmpkt.c


示例5: BMPktSigTabExit

VOID BMPktSigTabExit(
	IN PRTMP_ADAPTER pAd)
{
	NdisFreeSpinLock(&pAd->MeshTab.MeshBMPktTabLock);

	if (pAd->MeshTab.pBMPktSigTab)
/*		kfree(pAd->MeshTab.pBMPktSigTab); */
		os_free_mem(NULL, pAd->MeshTab.pBMPktSigTab);
	pAd->MeshTab.pBMPktSigTab = NULL;

	return;
}
开发者ID:23171580,项目名称:ralink,代码行数:12,代码来源:mesh_bmpkt.c


示例6: Set_NfcPasswdToken_Proc

INT Set_NfcPasswdToken_Proc(RTMP_ADAPTER *pAd, RTMP_STRING *arg)
{
	POS_COOKIE	pObj = (POS_COOKIE) pAd->OS_Cookie;
	PWSC_CTRL	pWscCtrl = &pAd->ApCfg.MBSSID[pObj->ioctl_if].WscControl;
	PUCHAR pBuf = NULL;
	USHORT BufLen = 0;
	UCHAR action = 1, type = TYPE_PASSWORD;
	UCHAR val=0;
	BOOLEAN		bHandover=FALSE;
	/*
		Action: b¡¦<7:6>: 0x00 ¡V Request, 0x01 ¡V Notify
        		b¡¦<5:0>: 0x00 ¡V Get, 0x01 - Set
	*/
	val = (UCHAR)simple_strtol(arg, 0, 10);
	if (val == 1) /* Password Token */
	{
		bHandover = FALSE;
		type = TYPE_PASSWORD;
	}
	else if (val == 2) /* Handover Select */
	{
		bHandover = TRUE;
		type = TYPE_PASSWDHO_S;
	}	
	else if (val == 3) /* Handover Request */
	{
		bHandover = TRUE;
		type = TYPE_PASSWDHO_R;
	}	

	os_alloc_mem(pAd, (UCHAR **)&pBuf, (NFC_WSC_TLV_SIZE*sizeof(UCHAR)));
	if (pBuf == NULL)
	{
		return FALSE;
	}

	MTWF_LOG(DBG_CAT_ALL, DBG_SUBCAT_ALL, DBG_LVL_TRACE, ("%s: NfcBuildOOBDevPasswdTLV value(=%d) type(=%d)\n", __FUNCTION__,val,  type));
	NfcBuildOOBDevPasswdTLV(pAd, pWscCtrl, type, pBuf, &BufLen);
	if (pBuf && (BufLen != 0))
	{
		pWscCtrl->bTriggerByNFC = TRUE;
		if (type ==TYPE_PASSWORD)
			pWscCtrl->NfcModel = MODEL_PASSWORD_TOKEN;
		else
			pWscCtrl->NfcModel = MODEL_HANDOVER;
		
		MTWF_LOG(DBG_CAT_ALL, DBG_SUBCAT_ALL, DBG_LVL_TRACE, ("%s: NfcBuildOOBDevPasswdTLV NfcModel(=%d)\n", __FUNCTION__,pWscCtrl->NfcModel));
		NfcCommand(pAd, action, type, BufLen, pBuf);
		os_free_mem(NULL, pBuf);
	}
	
	return TRUE;
}
开发者ID:andy-padavan,项目名称:rt-n56u,代码行数:53,代码来源:nfc.c


示例7: parse_option_string

static void parse_option_string(nv_stack_t *sp)
{
    unsigned int i;
    nv_parm_t *entry;
    char *option_string = NULL;
    char *ptr, *token;
    char *name, *value;
    NvU32 data;

    if (NVreg_RegistryDwords != NULL)
    {
        if ((option_string = remove_spaces(NVreg_RegistryDwords)) == NULL)
        {
            return;
        }

        ptr = option_string;

        while ((token = strsep(&ptr, ";")) != NULL)
        {
            if (!(name = strsep(&token, "=")) || !strlen(name))
            {
                continue;
            }

            if (!(value = strsep(&token, "=")) || !strlen(value))
            {
                continue;
            }

            if (strsep(&token, "=") != NULL)
            {
                continue;
            }

            data = (NvU32)simple_strtoul(value, NULL, 0);

            for (i = 0; (entry = &nv_parms[i])->name != NULL; i++)
            {
                if (strcmp(entry->name, name) == 0)
                    break;
            }

            if (!entry->name)
                rm_write_registry_dword(sp, NULL, "NVreg", name, data);
            else
                *entry->data = data;
        }

        os_free_mem(option_string);
    }
}
开发者ID:crespo2014,项目名称:kernel_configuration,代码行数:52,代码来源:os-registry.c


示例8: RTMP_CFG80211_RemoveVifEntry

void RTMP_CFG80211_RemoveVifEntry(void *pAdSrc, PNET_DEV pNewNetDev)
{
	PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)pAdSrc;
	PLIST_ENTRY pListEntry = NULL;

	pListEntry = (PLIST_ENTRY)RTMP_CFG80211_FindVifEntry_ByMac(pAd, pNewNetDev);
	if (pListEntry) {
		delEntryList(&pAd->cfg80211_ctrl.Cfg80211VifDevSet.vifDevList, pListEntry);
		os_free_mem(pListEntry);
	} else {
		DBGPRINT(RT_DEBUG_ERROR, ("Error in RTMP_CFG80211_RemoveVifEntry.\n"));
	}
}
开发者ID:BenMueller,项目名称:netgear-a6210-driver-dkms,代码行数:13,代码来源:cfg80211_inf.c


示例9: function

/*
	========================================================================

	Routine Description:
		The pseudo-random function(PRF) that hashes various inputs to 
		derive a pseudo-random value. To add liveness to the pseudo-random 
		value, a nonce should be one of the inputs.

		It is used to generate PTK, GTK or some specific random value.  

	Arguments:
		UCHAR	*key,		-	the key material for HMAC_SHA1 use
		INT		key_len		-	the length of key
		UCHAR	*prefix		-	a prefix label
		INT		prefix_len	-	the length of the label
		UCHAR	*data		-	a specific data with variable length		
		INT		data_len	-	the length of a specific data	
		INT		len			-	the output lenght

	Return Value:
		UCHAR	*output		-	the calculated result 

	Note:
		802.11i-2004	Annex H.3

	========================================================================
*/
VOID	PRF(
	IN	UCHAR	*key,
	IN	INT		key_len,
	IN	UCHAR	*prefix,
	IN	INT		prefix_len,
	IN	UCHAR	*data,
	IN	INT		data_len,
	OUT	UCHAR	*output,
	IN	INT		len)
{
	INT		i;
    UCHAR   *input;
	INT		currentindex = 0;
	INT		total_len;

	// Allocate memory for input
	os_alloc_mem(NULL, (PUCHAR *)&input, 1024);
	
    if (input == NULL)
    {
        DBGPRINT(RT_DEBUG_ERROR, ("!!!PRF: no memory!!!\n"));
        return;
    }
	
	// Generate concatenation input
	NdisMoveMemory(input, prefix, prefix_len);

	// Concatenate a single octet containing 0
	input[prefix_len] =	0;

	// Concatenate specific data
	NdisMoveMemory(&input[prefix_len + 1], data, data_len);
	total_len =	prefix_len + 1 + data_len;

	// Concatenate a single octet containing 0
	// This octet shall be update later
	input[total_len] = 0;
	total_len++;

	// Iterate to calculate the result by hmac-sha-1
	// Then concatenate to last result
	for	(i = 0;	i <	(len + 19) / 20; i++)
	{
		HMAC_SHA1(input, total_len,	key, key_len, &output[currentindex]);
		currentindex +=	20;

		// update the last octet 
		input[total_len - 1]++;
	}	
    os_free_mem(NULL, input);
}
开发者ID:acassis,项目名称:emlinux-ssd1935,代码行数:78,代码来源:cmm_wpa.c


示例10: testmod_init

static int testmod_init(void)
{
	PSTRING					src = NULL;
	RTMP_OS_FD				srcf;
	RTMP_OS_FS_INFO				osFSInfo;
	INT					retval = NDIS_STATUS_FAILURE;
	PSTRING					buffer;

	os_alloc_mem(NULL, (UCHAR **)&buffer, MAX_INI_BUFFER_SIZE);
	if(buffer == NULL)
		return NDIS_STATUS_FAILURE;
	memset(buffer, 0x00, MAX_INI_BUFFER_SIZE);

	src = STA_PROFILE_PATH;

	if (src && *src)
	{
		// it must call set_fs() before read, otherwise it get errCode=-14( address error)
		RtmpOSFSInfoChange(&osFSInfo, TRUE);
		srcf = RtmpOSFileOpen(src, O_RDONLY, 0);
		if (IS_FILE_OPEN_ERR(srcf)) 
		{
			DBGPRINT(RT_DEBUG_ERROR, ("Open file \"%s\" failed!\n", src));
		}
		else 
		{
			retval =RtmpOSFileRead(srcf, buffer, MAX_INI_BUFFER_SIZE);
			if (retval > 0)
			{
//				RTMPSetProfileParameters(pAd, buffer);
				DBGPRINT(RT_DEBUG_ERROR, ("Read file \"%s\": buffer = %s !\n", src, buffer));
				retval = NDIS_STATUS_SUCCESS;
			}
			else
				DBGPRINT(RT_DEBUG_ERROR, ("Read file \"%s\" failed(errCode=%d)!\n", src, retval));

			retval = RtmpOSFileClose(srcf);
			if ( retval != 0)
			{
				retval = NDIS_STATUS_FAILURE;
				DBGPRINT(RT_DEBUG_ERROR, ("Close file \"%s\" failed(errCode=%d)!\n", src, retval));
			}
		}

		RtmpOSFSInfoChange(&osFSInfo, FALSE);
	}

	os_free_mem(NULL, buffer);

	return (retval);
}
开发者ID:feimengspirit,项目名称:galen-emacs,代码行数:51,代码来源:chardev.c


示例11: MultiCastFilterTableReset

/*
    ==========================================================================
    Description:
        This routine reset the entire IGMP table.
    ==========================================================================
 */
VOID MultiCastFilterTableReset(
	IN PMULTICAST_FILTER_TABLE *ppMulticastFilterTable)
{
	if(*ppMulticastFilterTable == NULL)
	{
		DBGPRINT(RT_DEBUG_ERROR, ("%s Multicase filter table is not ready.\n", __FUNCTION__));
		return;
	}

	NdisFreeSpinLock(&((*ppMulticastFilterTable)->FreeMemberPoolTabLock));
	NdisFreeSpinLock(&((*ppMulticastFilterTable)->MulticastFilterTabLock));
	os_free_mem(NULL, *ppMulticastFilterTable);
	*ppMulticastFilterTable = NULL;
}
开发者ID:andy-padavan,项目名称:rt-n56u,代码行数:20,代码来源:igmp_snoop.c


示例12: SET_NETDEV_DEV

/*
========================================================================
Routine Description:
	Register MAC80211 Module.

Arguments:
	pAdCB			- WLAN control block pointer
	pDev			- Generic device interface
	pNetDev			- Network device

Return Value:
	NONE

Note:
	pDev != pNetDev
	#define SET_NETDEV_DEV(net, pdev)	((net)->dev.parent = (pdev))

	Can not use pNetDev to replace pDev; Or kernel panic.
========================================================================
*/
BOOLEAN CFG80211_Register(
	IN VOID						*pAd,
	IN struct device			*pDev,
	IN struct net_device		*pNetDev)
{
	CFG80211_CB *pCfg80211_CB = NULL;
	CFG80211_BAND BandInfo;


	/* allocate MAC80211 structure */
	os_alloc_mem(NULL, (UCHAR **)&pCfg80211_CB, sizeof(CFG80211_CB));
	if (pCfg80211_CB == NULL)
	{
		DBGPRINT(RT_DEBUG_ERROR, ("80211> Allocate MAC80211 CB fail!\n"));
		return FALSE;
	} /* End of if */

	/* allocate wireless device */
	RTMP_DRIVER_80211_BANDINFO_GET(pAd, &BandInfo);

	pCfg80211_CB->pCfg80211_Wdev = \
				CFG80211_WdevAlloc(pCfg80211_CB, &BandInfo, pAd, pDev);
	if (pCfg80211_CB->pCfg80211_Wdev == NULL)
	{
		DBGPRINT(RT_DEBUG_ERROR, ("80211> Allocate Wdev fail!\n"));
		os_free_mem(NULL, pCfg80211_CB);
		return FALSE;
	} /* End of if */

	/* bind wireless device with net device */

#ifdef CONFIG_STA_SUPPORT
	/* default we are station mode */
	pCfg80211_CB->pCfg80211_Wdev->iftype = NL80211_IFTYPE_STATION;
#endif /* CONFIG_STA_SUPPORT */

	pNetDev->ieee80211_ptr = pCfg80211_CB->pCfg80211_Wdev;
	SET_NETDEV_DEV(pNetDev, wiphy_dev(pCfg80211_CB->pCfg80211_Wdev->wiphy));
	pCfg80211_CB->pCfg80211_Wdev->netdev = pNetDev;

#ifdef RFKILL_HW_SUPPORT
	wiphy_rfkill_start_polling(pCfg80211_CB->pCfg80211_Wdev->wiphy);
#endif /* RFKILL_HW_SUPPORT */

	RTMP_DRIVER_80211_CB_SET(pAd, pCfg80211_CB);

	CFG80211DBG(RT_DEBUG_ERROR, ("80211> CFG80211_Register\n"));
	return TRUE;
} /* End of CFG80211_Register */
开发者ID:Sleuthhound,项目名称:RT28XX-RT539X-Linux-driver,代码行数:69,代码来源:cfg80211.c


示例13: RTMP_AllocateFragPacketBuffer

struct cmd_msg *AndesAllocCmdMsg(RTMP_ADAPTER *ad, unsigned int length)
{
	struct cmd_msg *msg = NULL;
	RTMP_CHIP_CAP *cap = &ad->chipCap;
	struct MCU_CTRL *ctl = &ad->MCUCtrl;
	PNDIS_PACKET net_pkt = NULL;
	INT32 AllocateSize = cap->cmd_header_len + length + cap->cmd_padding_len;

#ifdef RTMP_SDIO_SUPPORT
	if (AllocateSize >= ad->BlockSize)
		AllocateSize = (AllocateSize + ((-AllocateSize) & (ad->BlockSize - 1)));
#endif

	net_pkt = RTMP_AllocateFragPacketBuffer(ad, AllocateSize);

	if (!net_pkt) {
		DBGPRINT(RT_DEBUG_ERROR, ("can not allocate net_pkt\n"));
		goto error0;
	}

	if ((ctl->Stage == FW_NO_INIT) || (ctl->Stage == FW_DOWNLOAD) || (ctl->Stage == ROM_PATCH_DOWNLOAD))
		OS_PKT_RESERVE(net_pkt, cap->cmd_header_len);
	else if (ctl->Stage == FW_RUN_TIME)
		OS_PKT_RESERVE(net_pkt, sizeof(FW_TXD *));

	os_alloc_mem(NULL, (PUCHAR *)&msg, sizeof(*msg));
	if (!msg) {
		DBGPRINT(RT_DEBUG_ERROR, ("can not allocate cmd msg\n"));
		goto error1;
	}

	CMD_MSG_CB(net_pkt)->msg = msg;

	memset(msg, 0x00, sizeof(*msg));


	msg->priv = (void *)ad;
	msg->net_pkt = net_pkt;

	ctl->alloc_cmd_msg++;

	return msg;

	os_free_mem(NULL, msg);
error1:
	RTMPFreeNdisPacket(ad, net_pkt);
error0:
	return NULL;
}
开发者ID:javitu,项目名称:rt-n56u,代码行数:49,代码来源:andes_core.c


示例14: CFG80211_SendMgmtFrame

INT CFG80211_SendMgmtFrame(RTMP_ADAPTER *pAd, VOID *pData, ULONG Data)
{
	if (pData != NULL) 
	{
#ifdef CONFIG_AP_SUPPORT
		struct ieee80211_mgmt *mgmt;
#endif /* CONFIG_AP_SUPPORT */
		{		

			PCFG80211_CTRL pCfg80211_ctrl = &pAd->cfg80211_ctrl;

			pCfg80211_ctrl->TxStatusInUsed = TRUE;
			pCfg80211_ctrl->TxStatusSeq = pAd->Sequence;

			if (pCfg80211_ctrl->pTxStatusBuf != NULL)
			{
				os_free_mem(NULL, pCfg80211_ctrl->pTxStatusBuf);
				pCfg80211_ctrl->pTxStatusBuf = NULL;
			}

			os_alloc_mem(NULL, (UCHAR **)&pCfg80211_ctrl->pTxStatusBuf, Data);
			if (pCfg80211_ctrl->pTxStatusBuf != NULL)
			{
				NdisCopyMemory(pCfg80211_ctrl->pTxStatusBuf, pData, Data);
				pCfg80211_ctrl->TxStatusBufLen = Data;
			}
			else
			{
				pCfg80211_ctrl->TxStatusBufLen = 0;
				MTWF_LOG(DBG_CAT_ALL, DBG_SUBCAT_ALL, DBG_LVL_ERROR, ("CFG_TX_STATUS: MEM ALLOC ERROR\n"));
				return NDIS_STATUS_FAILURE;
			}
			CFG80211_CheckActionFrameType(pAd, "TX", pData, Data);

#ifdef CONFIG_AP_SUPPORT
    		mgmt = (struct ieee80211_mgmt *)pData;
    		if (ieee80211_is_probe_resp(mgmt->frame_control))
			{
				INT offset = sizeof(HEADER_802_11) + 12;
				CFG80211_SyncPacketWmmIe(pAd, pData + offset , Data - offset);
			}
#endif /* CONFIG_AP_SUPPORT */

			MiniportMMRequest(pAd, 0, pData, Data);
		}
	}

	return 0;
}
开发者ID:andy-padavan,项目名称:rt-n56u,代码行数:49,代码来源:cfg80211_tx.c


示例15: PeerAuthRspAtSeq4Action

/*
    ==========================================================================
    Description:
        
	IRQL = DISPATCH_LEVEL

    ==========================================================================
 */
VOID PeerAuthRspAtSeq4Action(
	IN PRTMP_ADAPTER pAd,
	IN MLME_QUEUE_ELEM *Elem)
{
	UCHAR Addr2[MAC_ADDR_LEN];
	USHORT Alg, Seq, Status;
/*    CHAR          ChlgText[CIPHER_TEXT_LEN]; */
	CHAR *ChlgText = NULL;
	BOOLEAN TimerCancelled;

	/* allocate memory */
	os_alloc_mem(NULL, (UCHAR **) & ChlgText, CIPHER_TEXT_LEN);
	if (ChlgText == NULL) {
		DBGPRINT(RT_DEBUG_ERROR,
			 ("%s: ChlgText Allocate memory fail!!!\n",
			  __FUNCTION__));
		return;
	}

	if (PeerAuthSanity
	    (pAd, Elem->Msg, Elem->MsgLen, Addr2, &Alg, &Seq, &Status,
	     ChlgText)) {
		if (MAC_ADDR_EQUAL(pAd->MlmeAux.Bssid, Addr2) && Seq == 4) {
			DBGPRINT(RT_DEBUG_TRACE,
				 ("AUTH - Receive AUTH_RSP seq#4 to me\n"));
			RTMPCancelTimer(&pAd->MlmeAux.AuthTimer,
					&TimerCancelled);

			if (Status != MLME_SUCCESS) {
				pAd->StaCfg.AuthFailReason = Status;
				COPY_MAC_ADDR(pAd->StaCfg.AuthFailSta, Addr2);
				RTMPSendWirelessEvent(pAd, IW_SHARED_WEP_FAIL,
						      NULL, BSS0, 0);
			}

			pAd->Mlme.AuthMachine.CurrState = AUTH_REQ_IDLE;
			MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_AUTH_CONF,
				    2, &Status, 0);
		}
	} else {
		DBGPRINT(RT_DEBUG_TRACE,
			 ("AUTH - PeerAuthRspAtSeq4Action() sanity check fail\n"));
	}

	if (ChlgText != NULL)
		os_free_mem(NULL, ChlgText);
}
开发者ID:0x000000FF,项目名称:MT7601u,代码行数:55,代码来源:auth.c


示例16: NfcCommand

VOID NfcCommand(
	IN	PRTMP_ADAPTER	pAd, 
	IN	UCHAR Action,
	IN  UCHAR Type,
	IN  SHORT DataLen,
	IN  PUCHAR pData) 
{
	PNET_DEV pNetDev = pAd->net_dev;
	UCHAR *pBuffer = NULL;
	USHORT len;
	USHORT vendor_id = NFC_VENDOR_ID, type = ETH_MTK_NFC, net_type;
	UCHAR Header802_3[LENGTH_802_3];
	UCHAR SrcMacAddr[MAC_ADDR_LEN]  = {0x00, 0x00, 0x00, 0x00, 0x66, 0x05};
	struct wifi_dev *wdev;
	MULTISSID_STRUCT *pMbss;

	len = sizeof(vendor_id) + sizeof(Action) + sizeof(Type) + sizeof(USHORT) + LENGTH_802_3;
	if (DataLen > 0)
		len += DataLen;

	os_alloc_mem(pAd, (UCHAR **)&pBuffer, (len*sizeof(UCHAR)));
	if (pBuffer == NULL)
		return;

	pMbss = &pAd->ApCfg.MBSSID[0];
	wdev = &pMbss->wdev;
	NdisZeroMemory(pBuffer, len);
	NdisZeroMemory(&Header802_3[0], LENGTH_802_3);

	NdisMoveMemory(&Header802_3[0], wdev->bssid, MAC_ADDR_LEN);
    NdisMoveMemory((&Header802_3[0] + MAC_ADDR_LEN), &SrcMacAddr[0], MAC_ADDR_LEN);
	net_type = htons(type);
    NdisMoveMemory((&Header802_3[0] + MAC_ADDR_LEN * 2), &net_type, LENGTH_802_3_TYPE);
	//hex_dump("Header802_3", &Header802_3[0], LENGTH_802_3);

	NdisMoveMemory(pBuffer, &Header802_3[0], LENGTH_802_3);
	NdisMoveMemory(pBuffer+LENGTH_802_3, &vendor_id, sizeof(vendor_id));
	NdisMoveMemory(pBuffer+LENGTH_802_3+sizeof(vendor_id), &Action, sizeof(Action));
	NdisMoveMemory(pBuffer+LENGTH_802_3+sizeof(vendor_id)+sizeof(Action), &Type, sizeof(Type));
	NdisMoveMemory(pBuffer+LENGTH_802_3+sizeof(vendor_id)+sizeof(Action)+sizeof(Type), &DataLen, sizeof(USHORT));
	if ((DataLen > 0) && (pData != NULL))
		NdisMoveMemory(pBuffer+LENGTH_802_3+sizeof(vendor_id)+sizeof(Action)+sizeof(Type)+sizeof(USHORT), pData, DataLen);
	hex_dump("NfcCommand", pBuffer, len);
	RtmpOSNotifyRawData(pNetDev, pBuffer, len, 0, ETH_MTK_NFC);
	os_free_mem(NULL,pBuffer);
	return;
}
开发者ID:23171580,项目名称:ralink,代码行数:47,代码来源:nfc.c


示例17: nv_i2c_add_adapter

void* NV_API_CALL nv_i2c_add_adapter(nv_state_t *nv, NvU32 port)
{
    RM_STATUS rmStatus;
    nv_linux_state_t *nvl = NV_GET_NVL_FROM_NV_STATE(nv);
    struct i2c_adapter *pI2cAdapter = NULL;
    int osstatus = 0;

#if defined(KERNEL_2_4)
    if (!NV_WEAK_SYMBOL_PRESENT(i2c_add_adapter))
        return NULL;
    if (!NV_WEAK_SYMBOL_PRESENT(i2c_del_adapter))
        return NULL;
#endif

    // get a i2c adapter
    rmStatus = os_alloc_mem((void **)&pI2cAdapter,sizeof(struct i2c_adapter));

    if (rmStatus != RM_OK)
        return NULL;

    // fill in with default structure
    os_mem_copy((void *)pI2cAdapter, (void *)&nv_i2c_adapter_prototype, sizeof(struct i2c_adapter));

#if !defined(KERNEL_2_4)
    pI2cAdapter->dev.parent = &nvl->dev->dev;
#endif

    snprintf(pI2cAdapter->name, I2C_NAME_SIZE,
             "NVIDIA i2c adapter %u at %x:%02x.%u", port, nv->bus,
             nv->slot, PCI_FUNC(nvl->dev->devfn));

    // add our data to the structure
    pI2cAdapter->algo_data = (void *)nv;

    // attempt to register with the kernel
    osstatus = i2c_add_adapter(pI2cAdapter);

    if (osstatus)
    {
        // free the memory and NULL the ptr
        os_free_mem(pI2cAdapter);

        pI2cAdapter = NULL;
    }

    return ((void *)pI2cAdapter);
}
开发者ID:lll-project,项目名称:nvidia,代码行数:47,代码来源:nv-i2c.c


示例18: AndesFreeCmdMsg

VOID AndesFreeCmdMsg(struct cmd_msg *msg)
{
	RTMP_ADAPTER *ad = (RTMP_ADAPTER *)(msg->priv);
	struct MCU_CTRL *ctl = &ad->MCUCtrl;

	if (msg->need_wait) {
		RTMP_OS_EXIT_COMPLETION(&msg->ack_done);
	}




	os_free_mem(NULL, msg);


	ctl->free_cmd_msg++;
}
开发者ID:eager7,项目名称:linux-kernel,代码行数:17,代码来源:andes_core.c


示例19: Set_NfcConfigurationToken_Proc

INT Set_NfcConfigurationToken_Proc(
	IN RTMP_ADAPTER		*pAd,
	IN PSTRING			arg)
{
	POS_COOKIE	pObj = (POS_COOKIE) pAd->OS_Cookie;
	PWSC_CTRL	pWscCtrl = &pAd->ApCfg.MBSSID[pObj->ioctl_if].WscControl;
	PUCHAR pBuf = NULL;
	USHORT BufLen = 0;
	/*
		Action: b¡¦<7:6>: 0x00 ¡V Request, 0x01 ¡V Notify
        		b¡¦<5:0>: 0x00 ¡V Get, 0x01 - Set
	*/
	UCHAR action = 1, type = TYPE_CONFIGURATION;

	os_alloc_mem(pAd, (UCHAR **)&pBuf, (NFC_WSC_TLV_SIZE*sizeof(UCHAR)));
	if (pBuf == NULL)
	{
		return FALSE;
	}

	NfcBuildWscProfileTLV(pAd, pWscCtrl, pBuf, &BufLen);
	if (pBuf && (BufLen != 0))
	{
		NfcCommand(pAd, action, type, BufLen, pBuf);
		os_free_mem(NULL, pBuf);
	}

	if ((pAd->OpMode == OPMODE_AP) && (pWscCtrl->WscConfStatus == WSC_SCSTATE_UNCONFIGURED))
	{				
		pWscCtrl->WscConfStatus = WSC_SCSTATE_CONFIGURED;
		WscBuildBeaconIE(pAd, WSC_SCSTATE_CONFIGURED, FALSE, 0, 0, 0, NULL, 0,AP_MODE);
		WscBuildProbeRespIE(pAd, WSC_MSGTYPE_AP_WLAN_MGR, WSC_SCSTATE_CONFIGURED, FALSE, 0, 0, 0, NULL, 0,AP_MODE);
		APUpdateAllBeaconFrame(pAd);
		
	}
	if (pWscCtrl->WscUpdatePortCfgTimerRunning)
	{
		BOOLEAN bCancel;
		RTMPCancelTimer(&pWscCtrl->WscUpdatePortCfgTimer, &bCancel);
	}
	else
		pWscCtrl->WscUpdatePortCfgTimerRunning = TRUE;
	RTMPSetTimer(&pWscCtrl->WscUpdatePortCfgTimer, 1000);
	return TRUE;
}
开发者ID:23171580,项目名称:ralink,代码行数:45,代码来源:nfc.c


示例20: RTMP_CFG80211_RemoveVifEntry

VOID RTMP_CFG80211_RemoveVifEntry(VOID *pAdSrc, PNET_DEV pNewNetDev)
{
	PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)pAdSrc;
	RT_LIST_ENTRY *pListEntry = NULL;

	pListEntry = (RT_LIST_ENTRY *)RTMP_CFG80211_FindVifEntry_ByMac(pAd, pNewNetDev);	
	
	if (pListEntry)
	{
		delEntryList(&pAd->cfg80211_ctrl.Cfg80211VifDevSet.vifDevList, pListEntry);
		os_free_mem(NULL, pListEntry);	
		pListEntry = NULL;
	}
	else
	{
		MTWF_LOG(DBG_CAT_ALL, DBG_SUBCAT_ALL, DBG_LVL_ERROR, ("Error in RTMP_CFG80211_RemoveVifEntry.\n"));
	}
}
开发者ID:andy-padavan,项目名称:rt-n56u,代码行数:18,代码来源:cfg80211_inf.c



注:本文中的os_free_mem函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ os_get_random函数代码示例发布时间:2022-05-30
下一篇:
C++ os_error函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap