本文整理汇总了C++中RTMP_OS_NETDEV_GET_PRIV函数的典型用法代码示例。如果您正苦于以下问题:C++ RTMP_OS_NETDEV_GET_PRIV函数的具体用法?C++ RTMP_OS_NETDEV_GET_PRIV怎么用?C++ RTMP_OS_NETDEV_GET_PRIV使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RTMP_OS_NETDEV_GET_PRIV函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MBSS_VirtualIF_Close
/*
========================================================================
Routine Description:
Close a virtual network interface.
Arguments:
pDev which WLAN network interface
Return Value:
0: close successfully
otherwise: close fail
Note:
========================================================================
*/
INT MBSS_VirtualIF_Close(
IN PNET_DEV pDev)
{
PRTMP_ADAPTER pAd;
INT BssId;
DBGPRINT(RT_DEBUG_TRACE, ("%s: ===> MBSSVirtualIF_close\n", RTMP_OS_NETDEV_GET_DEVNAME(pDev)));
pAd = RTMP_OS_NETDEV_GET_PRIV(pDev);
BssId = RT28xx_MBSS_IdxGet(pAd, pDev);
if (BssId < 0)
return -1;
RTMP_OS_NETDEV_STOP_QUEUE(pDev);
/* kick out all stas behind the Bss */
MbssKickOutStas(pAd, BssId, REASON_DISASSOC_INACTIVE);
pAd->ApCfg.MBSSID[BssId].bBcnSntReq = FALSE;
APMakeAllBssBeacon(pAd);
APUpdateAllBeaconFrame(pAd);
VIRTUAL_IF_DOWN(pAd);
RT_MOD_DEC_USE_COUNT();
return 0;
} /* End of MBSS_VirtualIF_Close */
示例2: CFG80211_VirtualIF_Close
static INT CFG80211_VirtualIF_Close(PNET_DEV dev_p)
{
VOID *pAdSrc;
pAdSrc = RTMP_OS_NETDEV_GET_PRIV(dev_p);
ASSERT(pAdSrc);
PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)pAdSrc;
#ifdef RT_CFG80211_P2P_SUPPORT
if (dev_p->ieee80211_ptr->iftype == RT_CMD_80211_IFTYPE_P2P_CLIENT)
{
DBGPRINT(RT_DEBUG_TRACE, ("CFG80211_VirtualIF_Close\n"));
CFG80211OS_ScanEnd(pAd->pCfg80211_CB, TRUE);
RT_MOD_DEC_USE_COUNT();
return ApCli_Close(pAd, dev_p);
}
#endif /* RT_CFG80211_P2P_SUPPORT */
DBGPRINT(RT_DEBUG_TRACE, ("%s: ===> %s\n", __FUNCTION__, RTMP_OS_NETDEV_GET_DEVNAME(dev_p)));
RTMP_OS_NETDEV_STOP_QUEUE(dev_p);
if (netif_carrier_ok(dev_p))
netif_carrier_off(dev_p);
else
AsicDisableSync(pAd);
//VIRTUAL_IF_DOWN(pAd);
RT_MOD_DEC_USE_COUNT();
return 0;
}
示例3: CFG80211_VirtualIF_Close
static INT CFG80211_VirtualIF_Close(struct net_device *dev_p)
{
struct rtmp_adapter *pAd;
pAd = RTMP_OS_NETDEV_GET_PRIV(dev_p);
ASSERT(pAd);
DBGPRINT(RT_DEBUG_TRACE, ("%s: ===> %s\n", __FUNCTION__, RTMP_OS_NETDEV_GET_DEVNAME(dev_p)));
RTMP_OS_NETDEV_STOP_QUEUE(dev_p);
if (netif_carrier_ok(dev_p))
netif_carrier_off(dev_p);
#ifdef CONFIG_STA_SUPPORT
if (INFRA_ON(pAd))
AsicEnableBssSync(pAd);
else if (ADHOC_ON(pAd))
AsicEnableIbssSync(pAd);
#else
else
AsicDisableSync(pAd);
#endif
//VIRTUAL_IF_DOWN(pAd);
RT_MOD_DEC_USE_COUNT();
return 0;
}
示例4: CFG80211_VirtualIF_Open
static INT CFG80211_VirtualIF_Open(PNET_DEV dev_p)
{
VOID *pAdSrc;
pAdSrc = RTMP_OS_NETDEV_GET_PRIV(dev_p);
ASSERT(pAdSrc);
PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)pAdSrc;
DBGPRINT(RT_DEBUG_TRACE, ("%s: ===> %d,%s\n", __FUNCTION__, dev_p->ifindex,
RTMP_OS_NETDEV_GET_DEVNAME(dev_p)));
//if (VIRTUAL_IF_UP(pAd) != 0)
// return -1;
/* increase MODULE use count */
RT_MOD_INC_USE_COUNT();
if ((dev_p->ieee80211_ptr->iftype == RT_CMD_80211_IFTYPE_P2P_CLIENT)
#ifdef CFG80211_MULTI_STA
|| (dev_p->ieee80211_ptr->iftype == RT_CMD_80211_IFTYPE_STATION)
#endif /* CFG80211_MULTI_STA */
)
{
DBGPRINT(RT_DEBUG_TRACE, ("CFG80211_VirtualIF_Open\n"));
pAd->flg_apcli_init = TRUE;
ApCli_Open(pAd, dev_p);
return 0;
}
RTMP_OS_NETDEV_START_QUEUE(dev_p);
DBGPRINT(RT_DEBUG_TRACE, ("%s: <=== %s\n", __FUNCTION__, RTMP_OS_NETDEV_GET_DEVNAME(dev_p)));
return 0;
}
示例5: rt2860_suspend
static int rt2860_suspend(
struct pci_dev *pci_dev,
pm_message_t state)
{
struct net_device *net_dev = pci_get_drvdata(pci_dev);
PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)NULL;
INT32 retval = 0;
DBGPRINT(RT_DEBUG_TRACE, ("===> rt2860_suspend()\n"));
if (net_dev == NULL)
{
DBGPRINT(RT_DEBUG_ERROR, ("net_dev == NULL!\n"));
}
else
{
pAd = (PRTMP_ADAPTER)RTMP_OS_NETDEV_GET_PRIV(net_dev);
/* we can not use IFF_UP because ra0 down but ra1 up */
/* and 1 suspend/resume function for 1 module, not for each interface */
/* so Linux will call suspend/resume function once */
if (VIRTUAL_IF_NUM(pAd) > 0)
{
// avoid users do suspend after interface is down
// stop interface
netif_carrier_off(net_dev);
netif_stop_queue(net_dev);
// mark device as removed from system and therefore no longer available
netif_device_detach(net_dev);
// mark halt flag
RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS);
RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF);
// take down the device
rt28xx_close((PNET_DEV)net_dev);
RT_MOD_DEC_USE_COUNT();
}
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
// reference to http://vovo2000.com/type-lab/linux/kernel-api/linux-kernel-api.html
// enable device to generate PME# when suspended
// pci_choose_state(): Choose the power state of a PCI device to be suspended
retval = pci_enable_wake(pci_dev, pci_choose_state(pci_dev, state), 1);
// save the PCI configuration space of a device before suspending
pci_save_state(pci_dev);
// disable PCI device after use
pci_disable_device(pci_dev);
retval = pci_set_power_state(pci_dev, pci_choose_state(pci_dev, state));
#endif
DBGPRINT(RT_DEBUG_TRACE, ("<=== rt2860_suspend()\n"));
return retval;
}
示例6: ApCli_VirtualIF_Close
/*
========================================================================
Routine Description:
Close a virtual network interface.
Arguments:
dev_p which WLAN network interface
Return Value:
0: close successfully
otherwise: close fail
Note:
========================================================================
*/
INT ApCli_VirtualIF_Close(
IN PNET_DEV dev_p)
{
UCHAR ifIndex;
PRTMP_ADAPTER pAd;
pAd = RTMP_OS_NETDEV_GET_PRIV(dev_p);
ASSERT(pAd);
DBGPRINT(RT_DEBUG_TRACE, ("%s: ===> %s\n", __FUNCTION__, RTMP_OS_NETDEV_GET_DEVNAME(dev_p)));
for (ifIndex = 0; ifIndex < MAX_APCLI_NUM; ifIndex++)
{
if (pAd->ApCfg.ApCliTab[ifIndex].dev == dev_p)
{
RTMP_OS_NETDEV_STOP_QUEUE(dev_p);
// send disconnect-req to sta State Machine.
if (pAd->ApCfg.ApCliTab[ifIndex].Enable)
{
MlmeEnqueue(pAd, APCLI_CTRL_STATE_MACHINE, APCLI_CTRL_DISCONNECT_REQ, 0, NULL, ifIndex);
RTMP_MLME_HANDLER(pAd);
DBGPRINT(RT_DEBUG_TRACE, ("(%s) ApCli interface[%d] startdown.\n", __FUNCTION__, ifIndex));
}
break;
}
}
VIRTUAL_IF_DOWN(pAd);
RT_MOD_DEC_USE_COUNT();
return 0;
} /* End of ApCli_VirtualIF_Close */
示例7: RTMP_OS_NETDEV_GET_PRIV
struct iw_statistics *rt73_get_wireless_stats(
IN struct net_device *net_dev)
{
PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) RTMP_OS_NETDEV_GET_PRIV(net_dev);
DBGPRINT(RT_DEBUG_TRACE, "rt73_get_wireless_stats --->\n");
// TODO: All elements are zero before be implemented
pAd->iw_stats.status = 0; // Status - device dependent for now
pAd->iw_stats.qual.qual = pAd->Mlme.ChannelQuality; // link quality (%retries, SNR, %missed beacons or better...)
#ifdef RTMP_EMBEDDED
pAd->iw_stats.qual.level = rt_abs(pAd->PortCfg.LastRssi); // signal level (dBm)
#else
pAd->iw_stats.qual.level = abs(pAd->PortCfg.LastRssi); // signal level (dBm)
#endif
pAd->iw_stats.qual.level += 256 - pAd->BbpRssiToDbmDelta;
pAd->iw_stats.qual.noise = (pAd->BbpWriteLatch[17] > pAd->BbpTuning.R17UpperBoundG) ? pAd->BbpTuning.R17UpperBoundG : ((ULONG) pAd->BbpWriteLatch[17]); // noise level (dBm)
pAd->iw_stats.qual.noise += 256 - 143;
pAd->iw_stats.qual.updated = 1; // Flags to know if updated
pAd->iw_stats.discard.nwid = 0; // Rx : Wrong nwid/essid
pAd->iw_stats.miss.beacon = 0; // Missed beacons/superframe
// pAd->iw_stats.discard.code, discard.fragment, discard.retries, discard.misc has counted in other place
return &pAd->iw_stats;
}
示例8: MBSS_Close
/*
========================================================================
Routine Description:
Close a virtual network interface.
Arguments:
pDev which WLAN network interface
Return Value:
0: close successfully
otherwise: close fail
Note:
========================================================================
*/
INT MBSS_Close(PNET_DEV pDev)
{
PRTMP_ADAPTER pAd;
INT BssId;
pAd = RTMP_OS_NETDEV_GET_PRIV(pDev);
BssId = RT28xx_MBSS_IdxGet(pAd, pDev);
if (BssId < 0)
return -1;
RTMP_OS_NETDEV_STOP_QUEUE(pDev);
/* kick out all stas behind the Bss */
MbssKickOutStas(pAd, BssId, REASON_DISASSOC_INACTIVE);
pAd->ApCfg.MBSSID[BssId].bBcnSntReq = FALSE;
APMakeAllBssBeacon(pAd);
APUpdateAllBeaconFrame(pAd);
#ifdef MESH_SUPPORT
MeshMakeBeacon(pAd, MESH_BEACON_IDX(pAd));
MeshUpdateBeaconFrame(pAd, MESH_BEACON_IDX(pAd));
#endif /* MESH_SUPPORT */
return 0;
}
示例9: MBSS_VirtualIF_Open
/*
========================================================================
Routine Description:
Open a virtual network interface.
Arguments:
pDev which WLAN network interface
Return Value:
0: open successfully
otherwise: open fail
Note:
========================================================================
*/
INT MBSS_VirtualIF_Open(
IN PNET_DEV pDev)
{
PRTMP_ADAPTER pAd;
INT BssId;
DBGPRINT(RT_DEBUG_TRACE, ("%s: ===> MBSSVirtualIF_open\n", RTMP_OS_NETDEV_GET_DEVNAME(pDev)));
pAd = RTMP_OS_NETDEV_GET_PRIV(pDev);
BssId = RT28xx_MBSS_IdxGet(pAd, pDev);
if (BssId < 0)
return -1;
pAd->ApCfg.MBSSID[BssId].bBcnSntReq = TRUE;
if (VIRTUAL_IF_UP(pAd) != 0)
return -1;
/* increase MODULE use count */
RT_MOD_INC_USE_COUNT();
RTMP_OS_NETDEV_START_QUEUE(pDev);
return 0;
} /* End of MBSS_VirtualIF_Open */
示例10: rt28xx_ioctl
INT rt28xx_ioctl(
IN PNET_DEV net_dev,
IN OUT struct ifreq *rq,
IN INT cmd)
{
RTMP_ADAPTER *pAd = NULL;
INT ret = 0;
pAd = RTMP_OS_NETDEV_GET_PRIV(net_dev);
if (pAd == NULL)
{
/* if 1st open fail, pAd will be free;
So the net_dev->priv will be NULL in 2rd open */
return -ENETDOWN;
}
#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
ret = rt28xx_sta_ioctl(net_dev, rq, cmd);
}
#endif // CONFIG_STA_SUPPORT //
return ret;
}
示例11: P2P_VirtualIF_Open
/*
========================================================================
Routine Description:
Open a virtual network interface.
Arguments:
dev_p which WLAN network interface
Return Value:
0: open successfully
otherwise: open fail
Note:
========================================================================
*/
int P2P_VirtualIF_Open(
IN PNET_DEV dev_p)
{
VOID *pAd;
/*PMULTISSID_STRUCT pMbss; */
pAd = RTMP_OS_NETDEV_GET_PRIV(dev_p);
ASSERT(pAd);
DBGPRINT(RT_DEBUG_TRACE, ("%s: ===> %s\n", __FUNCTION__, RTMP_OS_NETDEV_GET_DEVNAME(dev_p)));
if (RTMP_COM_IoctlHandle(pAd, NULL, CMD_RTPRIV_IOCTL_P2P_OPEN_PRE, 0,
dev_p, 0) != NDIS_STATUS_SUCCESS)
return -1;
if (VIRTUAL_IF_UP(pAd) != 0)
return -1;
/* increase MODULE use count */
RT_MOD_INC_USE_COUNT();
RTMP_OS_NETDEV_START_QUEUE(dev_p);
if (RTMP_COM_IoctlHandle(pAd, NULL, CMD_RTPRIV_IOCTL_P2P_OPEN_POST, 0,
dev_p, 0) != NDIS_STATUS_SUCCESS)
return -1;
DBGPRINT(RT_DEBUG_TRACE, ("%s: <=== %s\n", __FUNCTION__, RTMP_OS_NETDEV_GET_DEVNAME(dev_p)));
return 0;
}
示例12: ApCli_VirtualIF_Open
/*
========================================================================
Routine Description:
Open a virtual network interface.
Arguments:
dev_p which WLAN network interface
Return Value:
0: open successfully
otherwise: open fail
Note:
========================================================================
*/
INT ApCli_VirtualIF_Open(
IN PNET_DEV dev_p)
{
UCHAR ifIndex;
PRTMP_ADAPTER pAd;
pAd = RTMP_OS_NETDEV_GET_PRIV(dev_p);
ASSERT(pAd);
DBGPRINT(RT_DEBUG_TRACE, ("%s: ===> %s\n", __FUNCTION__, RTMP_OS_NETDEV_GET_DEVNAME(dev_p)));
if (VIRTUAL_IF_UP(pAd) != 0)
return -1;
// increase MODULE use count
RT_MOD_INC_USE_COUNT();
for (ifIndex = 0; ifIndex < MAX_APCLI_NUM; ifIndex++)
{
if (pAd->ApCfg.ApCliTab[ifIndex].dev == dev_p)
{
RTMP_OS_NETDEV_START_QUEUE(dev_p);
ApCliIfUp(pAd);
}
}
return 0;
} /* End of ApCli_VirtualIF_Open */
示例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)
{
RTMP_ADAPTER *pAd;
MULTISSID_STRUCT *pMbss;
PNDIS_PACKET pPkt = (PNDIS_PACKET)pPktSrc;
INT IdBss;
pAd = RTMP_OS_NETDEV_GET_PRIV(pDev);
ASSERT(pAd);
#ifdef RALINK_ATE
if (ATE_ON(pAd))
{
RELEASE_NDIS_PACKET(pAd, pPkt, 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)))
{
/* wlan is scanning/disabled/reset */
RELEASE_NDIS_PACKET(pAd, pPkt, NDIS_STATUS_FAILURE);
return 0;
}
if(!(RTMP_OS_NETDEV_STATE_RUNNING(pDev)))
{
/* the interface is down */
RELEASE_NDIS_PACKET(pAd, pPkt, NDIS_STATUS_FAILURE);
return 0;
}
/* 0 is main BSS, dont handle it here */
/* FIRST_MBSSID = 1 */
pMbss = pAd->ApCfg.MBSSID;
for(IdBss=FIRST_MBSSID; IdBss<pAd->ApCfg.BssidNum; IdBss++)
{
/* find the device in our MBSS list */
if (pMbss[IdBss].MSSIDDev == pDev)
{
NdisZeroMemory((PUCHAR)&(RTPKT_TO_OSPKT(pPktSrc))->cb[CB_OFF], 15);
RTMP_SET_PACKET_NET_DEVICE_MBSSID(pPktSrc, IdBss);
// SET_OS_PKT_NETDEV(pPktSrc, pDev); /* MBSS used original interface for TX */
/* transmit the packet */
return rt28xx_packet_xmit(pPktSrc);
}
}
/* can not find the BSS so discard the packet */
RELEASE_NDIS_PACKET(pAd, pPkt, NDIS_STATUS_FAILURE);
return 0;
} /* End of MBSS_VirtualIF_PacketSend */
示例14: MBSS_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_PacketSend(
IN PNDIS_PACKET pPktSrc,
IN PNET_DEV pDev,
IN RTMP_NET_PACKET_TRANSMIT Func)
{
RTMP_ADAPTER *pAd;
MULTISSID_STRUCT *pMbss;
PNDIS_PACKET pPkt = (PNDIS_PACKET)pPktSrc;
int IdBss;
pAd = RTMP_OS_NETDEV_GET_PRIV(pDev);
ASSERT(pAd);
#ifdef RALINK_ATE
if (ATE_ON(pAd))
{
RELEASE_NDIS_PACKET(pAd, pPkt, 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)))
{
/* wlan is scanning/disabled/reset */
RELEASE_NDIS_PACKET(pAd, pPkt, NDIS_STATUS_FAILURE);
return 0;
}
/* 0 is main BSS, dont handle it here */
/* FIRST_MBSSID = 1 */
pMbss = pAd->ApCfg.MBSSID;
for(IdBss=FIRST_MBSSID; IdBss<pAd->ApCfg.BssidNum; IdBss++)
{
/* find the device in our MBSS list */
if (pMbss[IdBss].MSSIDDev == pDev)
{
/* NdisZeroMemory((PUCHAR)&(RTPKT_TO_OSPKT(pPktSrc))->cb[CB_OFF], 15); */
NdisZeroMemory((PUCHAR)(GET_OS_PKT_CB(pPktSrc) + CB_OFF), 15);
RTMP_SET_PACKET_NET_DEVICE_MBSSID(pPktSrc, IdBss);
/* SET_OS_PKT_NETDEV(pPktSrc, pDev); */
/* transmit the packet */
return Func(pPktSrc);
}
}
/* can not find the BSS so discard the packet */
RELEASE_NDIS_PACKET(pAd, pPkt, NDIS_STATUS_FAILURE);
return 0;
}
示例15: rt73_ethtool_get_link
static uint32 rt73_ethtool_get_link(struct net_device *dev)
{
RTMP_ADAPTER *pAd;
ASSERT((dev));
pAd = (PRTMP_ADAPTER) RTMP_OS_NETDEV_GET_PRIV(dev);
//We return true if we already associated to some AP.
return(OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED));
}