本文整理汇总了C++中RELEASE_NDIS_PACKET函数的典型用法代码示例。如果您正苦于以下问题:C++ RELEASE_NDIS_PACKET函数的具体用法?C++ RELEASE_NDIS_PACKET怎么用?C++ RELEASE_NDIS_PACKET使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RELEASE_NDIS_PACKET函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: WDS_PacketSend
int WDS_PacketSend(
IN PNDIS_PACKET pSkb,
IN PNET_DEV dev,
IN RTMP_NET_PACKET_TRANSMIT Func)
{
UCHAR i;
RTMP_ADAPTER *pAd;
PNDIS_PACKET pPacket = (PNDIS_PACKET) pSkb;
pAd = (PRTMP_ADAPTER) RTMP_OS_NETDEV_GET_PRIV(dev);
#ifdef RALINK_ATE
if (ATE_ON(pAd))
{
RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_FAILURE);
return 0;
}
#endif // RALINK_ATE //
if ((RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS)) ||
(RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF)) ||
(RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS)))
{
RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_FAILURE);
return 0;
}
if (!(RTMP_OS_NETDEV_STATE_RUNNING(dev)))
{
RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_FAILURE);
return 0;
}
for (i = 0; i < MAX_WDS_ENTRY; i++)
{
if (ValidWdsEntry(pAd, i) && (pAd->WdsTab.WdsEntry[i].dev == dev))
{
RTMP_SET_PACKET_NET_DEVICE_WDS(pSkb, i);
SET_OS_PKT_NETDEV(pSkb, pAd->net_dev);
return Func(pSkb);
}
}
RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_FAILURE);
return 0;
}
开发者ID:philenotfound,项目名称:belkin-wemo-linux-2.6.21.x,代码行数:50,代码来源:ap_wds.c
示例2: TxSwQDepthAdjust
VOID TxSwQDepthAdjust(IN RTMP_ADAPTER *pAd, IN UINT32 qLen)
{
ULONG IrqFlags;
INT qIdx;
QUEUE_HEADER *pTxQ, *pEntry;
PNDIS_PACKET pPacket;
RTMP_IRQ_LOCK(&pAd->irq_lock, IrqFlags);
pAd->TxSwQMaxLen = qLen;
for (qIdx = 0; qIdx < NUM_OF_TX_RING; qIdx++)
{
pTxQ = &pAd->TxSwQueue[qIdx];
while(pTxQ->Number >= pAd->TxSwQMaxLen)
{
pEntry = RemoveHeadQueue(pTxQ);
if (pEntry)
{
pPacket = QUEUE_ENTRY_TO_PACKET(pEntry);
RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_FAILURE);
}
else
break;
}
}
RTMP_IRQ_UNLOCK(&pAd->irq_lock, IrqFlags);
DBGPRINT(RT_DEBUG_OFF, ("%s():Set TxSwQMaxLen as %d\n",
__FUNCTION__, pAd->TxSwQMaxLen));
}
开发者ID:mickeyreg,项目名称:driver,代码行数:29,代码来源:cmm_video.c
示例3: ba_reordering_resource_release
/*
* free all resource for reordering mechanism
*/
void ba_reordering_resource_release(PRTMP_ADAPTER pAd)
{
BA_TABLE *Tab;
PBA_REC_ENTRY pBAEntry;
struct reordering_mpdu *mpdu_blk;
int i;
Tab = &pAd->BATable;
/* I. release all pending reordering packet */
NdisAcquireSpinLock(&pAd->BATabLock);
for (i = 0; i < MAX_LEN_OF_BA_REC_TABLE; i++)
{
pBAEntry = &Tab->BARecEntry[i];
if (pBAEntry->REC_BA_Status != Recipient_NONE)
{
while ((mpdu_blk = ba_reordering_mpdu_dequeue(&pBAEntry->list)))
{
ASSERT(mpdu_blk->pPacket);
RELEASE_NDIS_PACKET(pAd, mpdu_blk->pPacket, NDIS_STATUS_FAILURE);
ba_mpdu_blk_free(pAd, mpdu_blk);
}
}
}
NdisReleaseSpinLock(&pAd->BATabLock);
ASSERT(pBAEntry->list.qlen == 0);
/* II. free memory of reordering mpdu table */
NdisAcquireSpinLock(&pAd->mpdu_blk_pool.lock);
os_free_mem(pAd, pAd->mpdu_blk_pool.mem);
NdisReleaseSpinLock(&pAd->mpdu_blk_pool.lock);
}
开发者ID:acassis,项目名称:emlinux-ssd1935,代码行数:35,代码来源:ba_action.c
示例4: RTUSBRejectPendingPackets
/*
========================================================================
Routine Description:
Arguments:
Return Value:
IRQL =
Note:
========================================================================
*/
VOID RTUSBRejectPendingPackets(
IN PRTMP_ADAPTER pAd)
{
UCHAR Index;
PQUEUE_ENTRY pEntry;
PNDIS_PACKET pPacket;
PQUEUE_HEADER pQueue;
#ifdef RELEASE_EXCLUDE
DBGPRINT_RAW(RT_DEBUG_INFO, ("--->RejectPendingPackets\n"));
#endif // RELEASE_EXCLUDE //
for (Index = 0; Index < 4; Index++)
{
NdisAcquireSpinLock(&pAd->TxSwQueueLock[Index]);
while (pAd->TxSwQueue[Index].Head != NULL)
{
pQueue = (PQUEUE_HEADER) &(pAd->TxSwQueue[Index]);
pEntry = RemoveHeadQueue(pQueue);
pPacket = QUEUE_ENTRY_TO_PACKET(pEntry);
RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_FAILURE);
}
NdisReleaseSpinLock(&pAd->TxSwQueueLock[Index]);
}
#ifdef RELEASE_EXCLUDE
DBGPRINT_RAW(RT_DEBUG_INFO, ("<---RejectPendingPackets\n"));
#endif // RELEASE_EXCLUDE //
}
开发者ID:vanhoefm,项目名称:rt2870linux,代码行数:45,代码来源:rtusb_data.c
示例5: ba_enqueue_reordering_packet
static void ba_enqueue_reordering_packet(struct rt_rtmp_adapter *pAd,
struct rt_ba_rec_entry *pBAEntry,
struct rt_rx_blk *pRxBlk,
u8 FromWhichBSSID)
{
struct reordering_mpdu *mpdu_blk;
u16 Sequence = (u16)pRxBlk->pHeader->Sequence;
mpdu_blk = ba_mpdu_blk_alloc(pAd);
if ((mpdu_blk != NULL) && (!RX_BLK_TEST_FLAG(pRxBlk, fRX_EAP))) {
/* Write RxD buffer address & allocated buffer length */
NdisAcquireSpinLock(&pBAEntry->RxReRingLock);
mpdu_blk->Sequence = Sequence;
mpdu_blk->bAMSDU = RX_BLK_TEST_FLAG(pRxBlk, fRX_AMSDU);
convert_reordering_packet_to_preAMSDU_or_802_3_packet(pAd,
pRxBlk,
FromWhichBSSID);
STATS_INC_RX_PACKETS(pAd, FromWhichBSSID);
/* */
/* it is necessary for reordering packet to record */
/* which BSS it come from */
/* */
RTMP_SET_PACKET_IF(pRxBlk->pRxPacket, FromWhichBSSID);
mpdu_blk->pPacket = pRxBlk->pRxPacket;
if (ba_reordering_mpdu_insertsorted(&pBAEntry->list, mpdu_blk)
== FALSE) {
/* had been already within reordering list */
/* don't indicate */
RELEASE_NDIS_PACKET(pAd, pRxBlk->pRxPacket,
NDIS_STATUS_SUCCESS);
ba_mpdu_blk_free(pAd, mpdu_blk);
}
ASSERT((0 <= pBAEntry->list.qlen)
&& (pBAEntry->list.qlen <= pBAEntry->BAWinSize));
NdisReleaseSpinLock(&pBAEntry->RxReRingLock);
} else {
DBGPRINT(RT_DEBUG_ERROR,
(" (%d) Can't allocate reordering mpdu blk\n",
pBAEntry->list.qlen));
/*
* flush all pending reordering mpdus
* and receving mpdu to upper layer
* make tcp/ip to take care reordering mechanism
*/
/*ba_refresh_reordering_mpdus(pAd, pBAEntry); */
ba_indicate_reordering_mpdus_le_seq(pAd, pBAEntry, Sequence);
pBAEntry->LastIndSeq = Sequence;
INDICATE_LEGACY_OR_AMSDU(pAd, pRxBlk, FromWhichBSSID);
}
}
开发者ID:ANFS,项目名称:ANFS-kernel,代码行数:60,代码来源:ba_action.c
示例6: client
/*
========================================================================
Routine Description:
This routine is used to do insert packet into power-saveing queue.
Arguments:
pAd: Pointer to our adapter
pPacket: Pointer to send packet
pMacEntry: portint to entry of MacTab. the pMacEntry store attribute of client (STA).
QueIdx: Priority queue idex.
Return Value:
NDIS_STATUS_SUCCESS:If succes to queue the packet into TxSwQueue.
NDIS_STATUS_FAILURE: If failed to do en-queue.
========================================================================
*/
NDIS_STATUS RtmpInsertPsQueue(
IN PRTMP_ADAPTER pAd,
IN PNDIS_PACKET pPacket,
IN MAC_TABLE_ENTRY *pMacEntry,
IN UCHAR QueIdx)
{
ULONG IrqFlags;
#ifdef UAPSD_SUPPORT
/* put the U-APSD packet to its U-APSD queue by AC ID */
UINT32 ac_id = QueIdx - QID_AC_BE; /* should be >= 0 */
if (UAPSD_MR_IS_UAPSD_AC(pMacEntry, ac_id))
{
UAPSD_PacketEnqueue(pAd, pMacEntry, pPacket, ac_id);
#ifdef DOT11Z_TDLS_SUPPORT
TDLS_UAPSDP_TrafficIndSend(pAd, pMacEntry->Addr);
#endif /* DOT11Z_TDLS_SUPPORT */
}
else
#endif /* UAPSD_SUPPORT */
{
if (pMacEntry->PsQueue.Number >= MAX_PACKETS_IN_PS_QUEUE)
{
RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_FAILURE);
return NDIS_STATUS_FAILURE;
}
else
{
DBGPRINT(RT_DEBUG_TRACE, ("legacy ps> queue a packet!\n"));
RTMP_IRQ_LOCK(&pAd->irq_lock, IrqFlags);
InsertTailQueue(&pMacEntry->PsQueue, PACKET_TO_QUEUE_ENTRY(pPacket));
RTMP_IRQ_UNLOCK(&pAd->irq_lock, IrqFlags);
}
}
#ifdef CONFIG_AP_SUPPORT
/* mark corresponding TIM bit in outgoing BEACON frame */
#ifdef UAPSD_SUPPORT
if (UAPSD_MR_IS_NOT_TIM_BIT_NEEDED_HANDLED(pMacEntry, QueIdx))
{
/* 1. the station is UAPSD station;
2. one of AC is non-UAPSD (legacy) AC;
3. the destinated AC of the packet is UAPSD AC. */
/* So we can not set TIM bit due to one of AC is legacy AC */
}
else
#endif /* UAPSD_SUPPORT */
{
WLAN_MR_TIM_BIT_SET(pAd, pMacEntry->apidx, pMacEntry->Aid);
}
#endif /* CONFIG_AP_SUPPORT */
return NDIS_STATUS_SUCCESS;
}
开发者ID:32743069,项目名称:amlogic_common_3050,代码行数:73,代码来源:ps.c
示例7: CFG80211_PacketSend
static INT CFG80211_PacketSend(PNDIS_PACKET pPktSrc, PNET_DEV pDev, RTMP_NET_PACKET_TRANSMIT Func)
{
PRTMP_ADAPTER pAd;
pAd = RTMP_OS_NETDEV_GET_PRIV(pDev);
ASSERT(pAd);
/* To Indicate from Which VIF */
switch (pDev->ieee80211_ptr->iftype)
{
case RT_CMD_80211_IFTYPE_AP:
//minIdx = MIN_NET_DEVICE_FOR_CFG80211_VIF_AP;
RTMP_SET_PACKET_OPMODE(pPktSrc, OPMODE_AP);
break;
case RT_CMD_80211_IFTYPE_P2P_GO:;
//minIdx = MIN_NET_DEVICE_FOR_CFG80211_VIF_P2P_GO;
if(!OPSTATUS_TEST_FLAG(pAd, fOP_AP_STATUS_MEDIA_STATE_CONNECTED))
{
DBGPRINT(RT_DEBUG_TRACE, ("Drop the Packet due P2P GO not in ready state\n"));
RELEASE_NDIS_PACKET(pAd, pPktSrc, NDIS_STATUS_FAILURE);
return 0;
}
RTMP_SET_PACKET_OPMODE(pPktSrc, OPMODE_AP);
break;
case RT_CMD_80211_IFTYPE_P2P_CLIENT:
//minIdx = MIN_NET_DEVICE_FOR_CFG80211_VIF_P2P_CLI;
RTMP_SET_PACKET_OPMODE(pPktSrc, OPMODE_AP);
break;
case RT_CMD_80211_IFTYPE_STATION:
default:
DBGPRINT(RT_DEBUG_TRACE, ("Unknown CFG80211 I/F Type(%d)\n", pDev->ieee80211_ptr->iftype));
RELEASE_NDIS_PACKET(pAd, pPktSrc, NDIS_STATUS_FAILURE);
return 0;
}
DBGPRINT(RT_DEBUG_INFO, ("CFG80211 Packet Type [%s](%d)\n",
pDev->name, pDev->ieee80211_ptr->iftype));
RTMP_SET_PACKET_NET_DEVICE_MBSSID(pPktSrc, MAIN_MBSSID);
return Func(RTPKT_TO_OSPKT(pPktSrc));
}
开发者ID:pierce1234,项目名称:rt-n56u,代码行数:44,代码来源:cfg80211_inf.c
示例8: IgmpPktInfoQuery
NDIS_STATUS IgmpPktInfoQuery(
IN PRTMP_ADAPTER pAd,
IN PUCHAR pSrcBufVA,
IN PNDIS_PACKET pPacket,
IN UCHAR FromWhichBSSID,
OUT INT *pInIgmpGroup,
OUT PMULTICAST_FILTER_TABLE_ENTRY *ppGroupEntry)
{
if(IS_MULTICAST_MAC_ADDR(pSrcBufVA))
{
INT32 ExcludedGroupType = -1;
UINT16 EtherType = ntohs(*((UINT16 *)(pSrcBufVA + 12)));
if (EtherType == ETH_P_IPV6)
{
ExcludedGroupType = IPv6MulticastFilterExcluded(pSrcBufVA);
}
else if(EtherType == ETH_P_IP)
{
ExcludedGroupType = IPv4MulticastFilterExcluded(pSrcBufVA);
}
if (ExcludedGroupType)
{
*ppGroupEntry = NULL;
if (ExcludedGroupType == 1)
*pInIgmpGroup = IGMP_PKT;
}
else if ((*ppGroupEntry = MulticastFilterTableLookup(pAd->pMulticastFilterTable, pSrcBufVA,
get_netdev_from_bssid(pAd, FromWhichBSSID))) == NULL)
{
RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_FAILURE);
return NDIS_STATUS_FAILURE;
}
else
*pInIgmpGroup = IGMP_IN_GROUP;
}
else if (IS_BROADCAST_MAC_ADDR(pSrcBufVA))
{
PUCHAR pDstIpAddr = pSrcBufVA + 30; /* point to Destination of Ip address of IP header. */
UCHAR GroupMacAddr[6];
PUCHAR pGroupMacAddr = (PUCHAR)&GroupMacAddr;
ConvertMulticastIP2MAC(pDstIpAddr, (PUCHAR *)&pGroupMacAddr, ETH_P_IP);
if ((*ppGroupEntry = MulticastFilterTableLookup(pAd->pMulticastFilterTable, pGroupMacAddr,
get_netdev_from_bssid(pAd, FromWhichBSSID))) != NULL)
{
*pInIgmpGroup = IGMP_IN_GROUP;
}
}
return NDIS_STATUS_SUCCESS;
}
开发者ID:andy-padavan,项目名称:rt-n56u,代码行数:54,代码来源:igmp_snoop.c
示例9: MtEnqTxSwqFromPsQueue
VOID MtEnqTxSwqFromPsQueue(RTMP_ADAPTER *pAd, UCHAR qidx, STA_TR_ENTRY *tr_entry)
{
ULONG IrqFlags = 0;
//struct tx_swq_fifo *fifo_swq;
QUEUE_ENTRY *pQEntry;
QUEUE_HEADER *pAcPsQue;
QUEUE_HEADER *pAcTxQue;
#ifdef UAPSD_SUPPORT
MAC_TABLE_ENTRY *pEntry = &pAd->MacTab.Content[tr_entry->wcid];
#endif /* UAPSD_SUPPORT */
//fifo_swq = &pAd->tx_swq[qidx];
pAcPsQue = &tr_entry->ps_queue;
pAcTxQue = &tr_entry->tx_queue[qidx];
RTMP_IRQ_LOCK(&pAd->irq_lock, IrqFlags);
#ifdef UAPSD_SUPPORT
if (UAPSD_MR_IS_UAPSD_AC(pEntry, qidx))
{
while(pAcPsQue->Head)
{
pQEntry = RemoveTailQueue(pAcPsQue);
UAPSD_PacketEnqueue(pAd, pEntry, PACKET_TO_QUEUE_ENTRY(pQEntry), qidx, TRUE);
}
}
else
#endif /* UAPSD_SUPPORT */
{
/*check and insert PS Token queue*/
if(pAcPsQue->Number > 0 && tr_entry->wcid > 0 && tr_entry->wcid < MAX_LEN_OF_TR_TABLE)
{
rtmp_ps_enq(pAd,tr_entry);
DBGPRINT(RT_DEBUG_TRACE | DBG_FUNC_PS, ("pAcPsQue->Number=%d,PS:%d\n",pAcPsQue->Number,tr_entry->PsTokenFlag));
}
while(pAcPsQue->Head)
{
pQEntry = RemoveTailQueue(pAcPsQue);
if(tr_entry->enqCount > SQ_ENQ_NORMAL_MAX) {
RELEASE_NDIS_PACKET(pAd, QUEUE_ENTRY_TO_PACKET(pQEntry), NDIS_STATUS_FAILURE);
continue;
}
InsertHeadQueue(pAcTxQue, pQEntry);
#ifdef LIMIT_GLOBAL_SW_QUEUE
TR_ENQ_COUNT_INC(tr_entry, &pAd->TxSwQueue[qidx]);
#else /* LIMIT_GLOBAL_SW_QUEUE */
TR_ENQ_COUNT_INC(tr_entry);
#endif /* ! LIMIT_GLOBAL_SW_QUEUE */
}
}
RTMP_IRQ_UNLOCK(&pAd->irq_lock, IrqFlags);
return;
}
开发者ID:pierce1234,项目名称:rt-n56u,代码行数:54,代码来源:mt_ps.c
示例10: CFG80211_PacketSend
static INT CFG80211_PacketSend(PNDIS_PACKET pPktSrc, PNET_DEV pDev, RTMP_NET_PACKET_TRANSMIT Func)
{
PRTMP_ADAPTER pAd;
pAd = RTMP_OS_NETDEV_GET_PRIV(pDev);
ASSERT(pAd);
/* To Indicate from Which VIF */
switch (pDev->ieee80211_ptr->iftype)
{
case RT_CMD_80211_IFTYPE_AP:
RTMP_SET_PACKET_OPMODE(pPktSrc, OPMODE_AP);
break;
case RT_CMD_80211_IFTYPE_P2P_GO:;
if(!OPSTATUS_TEST_FLAG(pAd, fOP_AP_STATUS_MEDIA_STATE_CONNECTED))
{
MTWF_LOG(DBG_CAT_ALL, DBG_SUBCAT_ALL, DBG_LVL_TRACE, ("Drop the Packet due P2P GO not in ready state\n"));
RELEASE_NDIS_PACKET(pAd, pPktSrc, NDIS_STATUS_FAILURE);
return 0;
}
RTMP_SET_PACKET_OPMODE(pPktSrc, OPMODE_AP);
break;
case RT_CMD_80211_IFTYPE_P2P_CLIENT:
case RT_CMD_80211_IFTYPE_STATION:
RTMP_SET_PACKET_OPMODE(pPktSrc, OPMODE_AP);
//printk("%s: tx ==> %d\n", __FUNCTION__, RTMP_GET_PACKET_OPMODE(pPktSrc));
break;
default:
MTWF_LOG(DBG_CAT_ALL, DBG_SUBCAT_ALL, DBG_LVL_TRACE, ("Unknown CFG80211 I/F Type(%d)\n", pDev->ieee80211_ptr->iftype));
RELEASE_NDIS_PACKET(pAd, pPktSrc, NDIS_STATUS_FAILURE);
return 0;
}
MTWF_LOG(DBG_CAT_ALL, DBG_SUBCAT_ALL, DBG_LVL_INFO, ("CFG80211 Packet Type [%s](%d)\n",
pDev->name, pDev->ieee80211_ptr->iftype));
return Func(RTPKT_TO_OSPKT(pPktSrc));
}
开发者ID:andy-padavan,项目名称:rt-n56u,代码行数:40,代码来源:cfg80211_inf.c
示例11: RTMPHandleMgmtRingDmaDoneInterrupt
/*
========================================================================
Routine Description:
Process MGMT ring DMA done interrupt, running in DPC level
Arguments:
pAd Pointer to our adapter
Return Value:
None
IRQL = DISPATCH_LEVEL
Note:
========================================================================
*/
void RTMPHandleMgmtRingDmaDoneInterrupt(struct rt_rtmp_adapter *pAd)
{
struct rt_txd * pTxD;
void *pPacket;
/* int i; */
u8 FREE = 0;
struct rt_rtmp_mgmt_ring *pMgmtRing = &pAd->MgmtRing;
NdisAcquireSpinLock(&pAd->MgmtRingLock);
RTMP_IO_READ32(pAd, TX_MGMTDTX_IDX, &pMgmtRing->TxDmaIdx);
while (pMgmtRing->TxSwFreeIdx != pMgmtRing->TxDmaIdx) {
FREE++;
pTxD =
(struct rt_txd *) (pMgmtRing->Cell[pAd->MgmtRing.TxSwFreeIdx].
AllocVa);
pTxD->DMADONE = 0;
pPacket = pMgmtRing->Cell[pMgmtRing->TxSwFreeIdx].pNdisPacket;
if (pPacket) {
PCI_UNMAP_SINGLE(pAd, pTxD->SDPtr0, pTxD->SDLen0,
PCI_DMA_TODEVICE);
RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_SUCCESS);
}
pMgmtRing->Cell[pMgmtRing->TxSwFreeIdx].pNdisPacket = NULL;
pPacket =
pMgmtRing->Cell[pMgmtRing->TxSwFreeIdx].pNextNdisPacket;
if (pPacket) {
PCI_UNMAP_SINGLE(pAd, pTxD->SDPtr1, pTxD->SDLen1,
PCI_DMA_TODEVICE);
RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_SUCCESS);
}
pMgmtRing->Cell[pMgmtRing->TxSwFreeIdx].pNextNdisPacket = NULL;
INC_RING_INDEX(pMgmtRing->TxSwFreeIdx, MGMT_RING_SIZE);
}
NdisReleaseSpinLock(&pAd->MgmtRingLock);
}
开发者ID:AbheekG,项目名称:XIA-for-Linux,代码行数:58,代码来源:cmm_data_pci.c
示例12: IgmpPktInfoQuery
NDIS_STATUS IgmpPktInfoQuery(
IN PRTMP_ADAPTER pAd,
IN PUCHAR pSrcBufVA,
IN PNDIS_PACKET pPacket,
IN struct wifi_dev *wdev,
OUT INT *pInIgmpGroup,
OUT PMULTICAST_FILTER_TABLE_ENTRY *ppGroupEntry)
{
if(IS_MULTICAST_MAC_ADDR(pSrcBufVA))
{
BOOLEAN IgmpMldPkt = FALSE;
PUCHAR pIpHeader = pSrcBufVA + 12;
if(ntohs(*((UINT16 *)(pIpHeader))) == ETH_P_IPV6)
IgmpMldPkt = IPv6MulticastFilterExcluded(pSrcBufVA, pIpHeader);
else
IgmpMldPkt = isIgmpPkt(pSrcBufVA, pIpHeader);
if (IgmpMldPkt)
{
*ppGroupEntry = NULL;
*pInIgmpGroup = IGMP_PKT;
}
else if ((*ppGroupEntry = MulticastFilterTableLookup(pAd->pMulticastFilterTable, pSrcBufVA,
wdev->if_dev)) == NULL)
{
RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_FAILURE);
return NDIS_STATUS_FAILURE;
}
else
*pInIgmpGroup = IGMP_IN_GROUP;
}
else if (IS_BROADCAST_MAC_ADDR(pSrcBufVA))
{
PUCHAR pDstIpAddr = pSrcBufVA + 30; /* point to Destination of Ip address of IP header. */
UCHAR GroupMacAddr[6];
PUCHAR pGroupMacAddr = (PUCHAR)&GroupMacAddr;
ConvertMulticastIP2MAC(pDstIpAddr, (PUCHAR *)&pGroupMacAddr, ETH_P_IP);
if ((*ppGroupEntry = MulticastFilterTableLookup(pAd->pMulticastFilterTable, pGroupMacAddr,
wdev->if_dev)) != NULL)
{
*pInIgmpGroup = IGMP_IN_GROUP;
}
}
return NDIS_STATUS_SUCCESS;
}
开发者ID:jing-git,项目名称:rt-n56u-1,代码行数:48,代码来源:igmp_snoop.c
示例13: MBSS_VirtualIF_PacketSend
/*
========================================================================
Routine Description:
Send a packet to WLAN.
Arguments:
pPktSrc points to our adapter
pDev which WLAN network interface
Return Value:
0: transmit successfully
otherwise: transmit fail
Note:
========================================================================
*/
int MBSS_VirtualIF_PacketSend(
IN PNDIS_PACKET pPktSrc,
IN PNET_DEV pDev)
{
MEM_DBG_PKT_ALLOC_INC(pPktSrc);
if(!(RTMP_OS_NETDEV_STATE_RUNNING(pDev)))
{
/* the interface is down */
RELEASE_NDIS_PACKET(NULL, pPktSrc, NDIS_STATUS_FAILURE);
return 0;
} /* End of if */
return MBSS_PacketSend(pPktSrc, pDev, rt28xx_packet_xmit);
} /* End of MBSS_VirtualIF_PacketSend */
开发者ID:32743069,项目名称:amlogic_common_3050,代码行数:32,代码来源:ap_mbss_inf.c
示例14: wdev_tx_pkts
/*
========================================================================
Routine Description:
Early checking and OS-depened parsing for Tx packet to AP device.
Arguments:
NDIS_HANDLE MiniportAdapterContext Pointer refer to the device handle, i.e., the pAd.
PPNDIS_PACKET ppPacketArray The packet array need to do transmission.
UINT NumberOfPackets Number of packet in packet array.
Return Value:
NONE
Note:
This function do early checking and classification for send-out packet.
You only can put OS-depened & AP related code in here.
========================================================================
*/
VOID wdev_tx_pkts(NDIS_HANDLE dev_hnd, PPNDIS_PACKET pkt_list, UINT pkt_cnt, struct wifi_dev *wdev)
{
RTMP_ADAPTER *pAd = (RTMP_ADAPTER *)dev_hnd;
PNDIS_PACKET pPacket;
BOOLEAN allowToSend;
UCHAR wcid = MCAST_WCID;
UINT Index;
for (Index = 0; Index < pkt_cnt; Index++)
{
pPacket = pkt_list[Index];
if (RTMP_TEST_FLAG(pAd, (fRTMP_ADAPTER_RESET_IN_PROGRESS |
fRTMP_ADAPTER_HALT_IN_PROGRESS |
fRTMP_ADAPTER_RADIO_OFF |
fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS)))
{
/* Drop send request since hardware is in reset state */
RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_FAILURE);
continue;
}
if ((wdev->allow_data_tx == TRUE) && (wdev->tx_pkt_allowed))
allowToSend = wdev->tx_pkt_allowed(pAd, wdev, pPacket, &wcid);
else
allowToSend = FALSE;
if (allowToSend == TRUE)
{
RTMP_SET_PACKET_WCID(pPacket, wcid);
RTMP_SET_PACKET_WDEV(pPacket, wdev->wdev_idx);
NDIS_SET_PACKET_STATUS(pPacket, NDIS_STATUS_PENDING);
pAd->RalinkCounters.PendingNdisPacketCount++;
#ifdef CONFIG_AP_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_AP(pAd)
{
#ifdef DELAYED_TCP_ACK
if(!delay_tcp_ack(pAd, wcid, pPacket))
#endif /* DELAYED_TCP_ACK */
APSendPacket(pAd, pPacket);
}
#endif /* CONFIG_AP_SUPPORT */
} else {
开发者ID:jing-git,项目名称:rt-n56u,代码行数:65,代码来源:wdev_tx.c
示例15: rt28xx_send_packets
/*
========================================================================
Routine Description:
Send a packet to WLAN.
Arguments:
skb_p points to our adapter
dev_p which WLAN network interface
Return Value:
0: transmit successfully
otherwise: transmit fail
Note:
========================================================================
*/
static int rt28xx_send_packets(
IN struct sk_buff *skb_p,
IN struct net_device *net_dev)
{
RTMP_ADAPTER *pAd = RTMP_OS_NETDEV_GET_PRIV(net_dev);
if (!(net_dev->flags & IFF_UP))
{
RELEASE_NDIS_PACKET(pAd, (PNDIS_PACKET)skb_p, NDIS_STATUS_FAILURE);
return 0;
}
NdisZeroMemory((PUCHAR)&skb_p->cb[CB_OFF], 15);
RTMP_SET_PACKET_NET_DEVICE_MBSSID(skb_p, MAIN_MBSSID);
return rt28xx_packet_xmit(skb_p);
}
开发者ID:mikuhatsune001,项目名称:linux2.6.32,代码行数:33,代码来源:rt_main_dev.c
示例16: RTUSBRejectPendingPackets
/*
========================================================================
Routine Description:
Arguments:
Return Value:
IRQL =
Note:
========================================================================
*/
void RTUSBRejectPendingPackets(struct rt_rtmp_adapter *pAd)
{
u8 Index;
struct rt_queue_entry *pEntry;
void *pPacket;
struct rt_queue_header *pQueue;
for (Index = 0; Index < 4; Index++) {
NdisAcquireSpinLock(&pAd->TxSwQueueLock[Index]);
while (pAd->TxSwQueue[Index].Head != NULL) {
pQueue = (struct rt_queue_header *)& (pAd->TxSwQueue[Index]);
pEntry = RemoveHeadQueue(pQueue);
pPacket = QUEUE_ENTRY_TO_PACKET(pEntry);
RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_FAILURE);
}
NdisReleaseSpinLock(&pAd->TxSwQueueLock[Index]);
}
}
开发者ID:A2109devs,项目名称:lenovo_a2109a_kernel,代码行数:35,代码来源:rtusb_data.c
示例17: P2P_VirtualIF_PacketSend
/*
========================================================================
Routine Description:
Send a packet to WLAN.
Arguments:
skb_p points to our adapter
dev_p which WLAN network interface
Return Value:
0: transmit successfully
otherwise: transmit fail
Note:
========================================================================
*/
int P2P_VirtualIF_PacketSend(
IN PNDIS_PACKET skb_p,
IN PNET_DEV dev_p)
{
/*PRTMP_ADAPTER pAd; */
/*PAPCLI_STRUCT pApCli; */
MEM_DBG_PKT_ALLOC_INC(skb_p);
if(!(RTMP_OS_NETDEV_STATE_RUNNING(dev_p)))
{
/* the interface is down */
RELEASE_NDIS_PACKET(NULL, skb_p, NDIS_STATUS_FAILURE);
return 0;
}
return P2P_PacketSend(skb_p, dev_p, rt28xx_packet_xmit);
} /* End of P2P_VirtualIF_PacketSend */
开发者ID:vision8520,项目名称:kernel-amlogic-mx,代码行数:36,代码来源:p2p_inf.c
示例18: RtmpCleanupPsQueue
/*
==========================================================================
Description:
This routine is used to clean up a specified power-saving queue. It's
used whenever a wireless client is deleted.
==========================================================================
*/
VOID RtmpCleanupPsQueue(RTMP_ADAPTER *pAd, QUEUE_HEADER *pQueue)
{
QUEUE_ENTRY *pQEntry;
PNDIS_PACKET pPacket;
DBGPRINT(RT_DEBUG_TRACE, ("RtmpCleanupPsQueue (0x%08lx)...\n", (ULONG)pQueue));
while (pQueue->Head)
{
DBGPRINT(RT_DEBUG_TRACE,
("RtmpCleanupPsQueue %ld...\n",pQueue->Number));
pQEntry = RemoveHeadQueue(pQueue);
/*pPacket = CONTAINING_RECORD(pEntry, NDIS_PACKET, MiniportReservedEx); */
pPacket = QUEUE_ENTRY_TO_PACKET(pQEntry);
RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_FAILURE);
DBGPRINT(RT_DEBUG_TRACE, ("RtmpCleanupPsQueue pkt = %lx...\n", (ULONG)pPacket));
}
}
开发者ID:23171580,项目名称:ralink,代码行数:27,代码来源:ps.c
示例19: CFG80211_VirtualIF_PacketSend
static INT CFG80211_VirtualIF_PacketSend(
struct sk_buff *skb, PNET_DEV dev_p)
{
struct wifi_dev *wdev;
DBGPRINT(RT_DEBUG_INFO, ("%s ---> %d\n", __FUNCTION__, dev_p->ieee80211_ptr->iftype));
if(!(RTMP_OS_NETDEV_STATE_RUNNING(dev_p)))
{
/* the interface is down */
RELEASE_NDIS_PACKET(NULL, skb, NDIS_STATUS_FAILURE);
return 0;
}
/* The device not ready to send packt. */
wdev = RTMP_OS_NETDEV_GET_WDEV(dev_p);
ASSERT(wdev);
if (!wdev) return -1;
return CFG80211_PacketSend(skb, dev_p, rt28xx_packet_xmit);
}
开发者ID:pierce1234,项目名称:rt-n56u,代码行数:21,代码来源:cfg80211_inf.c
示例20: rt28xx_send_packets
/*
========================================================================
Routine Description:
Send a packet to WLAN.
Arguments:
skb_p points to our adapter
dev_p which WLAN network interface
Return Value:
0: transmit successfully
otherwise: transmit fail
Note:
========================================================================
*/
static int rt28xx_send_packets(
IN struct sk_buff *skb_p,
IN struct net_device *net_dev)
{
RTMP_ADAPTER *pAd = NULL;
GET_PAD_FROM_NET_DEV(pAd, net_dev);
if (!(RTMP_OS_NETDEV_STATE_RUNNING(net_dev)))
{
RELEASE_NDIS_PACKET(pAd, (PNDIS_PACKET)skb_p, NDIS_STATUS_FAILURE);
return 0;
}
NdisZeroMemory((PUCHAR)&skb_p->cb[CB_OFF], 15);
RTMP_SET_PACKET_NET_DEVICE_MBSSID(skb_p, MAIN_MBSSID);
MEM_DBG_PKT_ALLOC_INC(pAd);
return rt28xx_packet_xmit(skb_p);
}
开发者ID:jing-git,项目名称:rt-n56u,代码行数:37,代码来源:rt_main_dev.c
注:本文中的RELEASE_NDIS_PACKET函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论