本文整理汇总了C++中rtl_usbdev函数的典型用法代码示例。如果您正苦于以下问题:C++ rtl_usbdev函数的具体用法?C++ rtl_usbdev怎么用?C++ rtl_usbdev使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rtl_usbdev函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: netdev_open
int netdev_open(struct net_device *ndev)
{
int ret;
int _unused;
struct rtl_priv *rtlpriv = rtl_priv(ndev);
/* ULLI: orignal driver doesn't use the return value */
_unused = mutex_lock_interruptible(&(rtl_usbdev(rtlpriv)->hw_init_mutex));
ret = _netdev_open(ndev);
mutex_unlock(&(rtl_usbdev(rtlpriv)->hw_init_mutex));
return ret;
}
开发者ID:directhex,项目名称:rtl8821au-dkms,代码行数:14,代码来源:os_intfs.c
示例2: rtl_usb_cleanup
/*======================= tx =========================================*/
static void rtl_usb_cleanup(struct ieee80211_hw *hw)
{
u32 i;
struct sk_buff *_skb;
struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw));
struct ieee80211_tx_info *txinfo;
SET_USB_STOP(rtlusb);
/* clean up rx stuff. */
_rtl_usb_cleanup_rx(hw);
/* clean up tx stuff */
for (i = 0; i < RTL_USB_MAX_EP_NUM; i++) {
while ((_skb = skb_dequeue(&rtlusb->tx_skb_queue[i]))) {
rtlusb->usb_tx_cleanup(hw, _skb);
txinfo = IEEE80211_SKB_CB(_skb);
ieee80211_tx_info_clear_status(txinfo);
txinfo->flags |= IEEE80211_TX_STAT_ACK;
ieee80211_tx_status_irqsafe(hw, _skb);
}
usb_kill_anchored_urbs(&rtlusb->tx_pending[i]);
}
usb_kill_anchored_urbs(&rtlusb->tx_submitted);
}
开发者ID:03199618,项目名称:linux,代码行数:26,代码来源:usb.c
示例3: LeaveAllPowerSaveMode
//
// Description: Leave all power save mode: LPS, FwLPS, IPS if needed.
// Move code to function by tynli. 2010.03.26.
//
void LeaveAllPowerSaveMode(IN struct rtl_priv *rtlpriv)
{
struct mlme_priv *pmlmepriv = &(rtlpriv->mlmepriv);
uint8_t enqueue = 0;
//DBG_871X("%s.....\n",__FUNCTION__);
if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
{ //connect
rtw_lps_ctrl_wk_cmd(rtlpriv, LPS_CTRL_LEAVE, enqueue);
} else {
if(rtlpriv->pwrctrlpriv.rf_pwrstate== rf_off) {
#ifdef CONFIG_AUTOSUSPEND
if(rtlpriv->registrypriv.usbss_enable) {
usb_disable_autosuspend(rtl_usbdev(rtlpriv)->pusbdev);
} else
#endif
{
}
}
}
}
开发者ID:paralin,项目名称:rtl8821au-1,代码行数:30,代码来源:rtw_pwrctrl.c
示例4: rtl_usb_stop
static void rtl_usb_stop(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw));
struct urb *urb;
/* should after adapter start and interrupt enable. */
set_hal_stop(rtlhal);
cancel_work_sync(&rtlpriv->works.fill_h2c_cmd);
/* Enable software */
SET_USB_STOP(rtlusb);
rtl_usb_deinit(hw);
/* free pre-allocated URBs from rtl_usb_start() */
usb_kill_anchored_urbs(&rtlusb->rx_submitted);
tasklet_kill(&rtlusb->rx_work_tasklet);
cancel_work_sync(&rtlpriv->works.lps_change_work);
flush_workqueue(rtlpriv->works.rtl_wq);
skb_queue_purge(&rtlusb->rx_queue);
while ((urb = usb_get_from_anchor(&rtlusb->rx_cleanup_urbs))) {
usb_free_coherent(urb->dev, urb->transfer_buffer_length,
urb->transfer_buffer, urb->transfer_dma);
usb_free_urb(urb);
}
rtlpriv->cfg->ops->hw_disable(hw);
}
开发者ID:AICP,项目名称:kernel_moto_shamu,代码行数:32,代码来源:usb.c
示例5: rtl_usb_disconnect
void rtl_usb_disconnect(struct usb_interface *intf)
{
struct ieee80211_hw *hw = usb_get_intfdata(intf);
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_mac *rtlmac = rtl_mac(rtl_priv(hw));
struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw));
if (unlikely(!rtlpriv))
return;
/* just in case driver is removed before firmware callback */
wait_for_completion(&rtlpriv->firmware_loading_complete);
/*ieee80211_unregister_hw will call ops_stop */
if (rtlmac->mac80211_registered == 1) {
ieee80211_unregister_hw(hw);
rtlmac->mac80211_registered = 0;
} else {
rtl_deinit_deferred_work(hw);
rtlpriv->intf_ops->adapter_stop(hw);
}
/*deinit rfkill */
/* rtl_deinit_rfkill(hw); */
rtl_usb_deinit(hw);
rtl_deinit_core(hw);
kfree(rtlpriv->usb_data);
rtlpriv->cfg->ops->deinit_sw_leds(hw);
rtlpriv->cfg->ops->deinit_sw_vars(hw);
_rtl_usb_io_handler_release(hw);
usb_put_dev(rtlusb->udev);
usb_set_intfdata(intf, NULL);
ieee80211_free_hw(hw);
}
开发者ID:38c02aee,项目名称:android_kernel_jiayu_g4,代码行数:32,代码来源:usb.c
示例6: _rtl_usb_transmit
static void _rtl_usb_transmit(struct ieee80211_hw *hw, struct sk_buff *skb,
enum rtl_txq qnum)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw));
u32 ep_num;
struct urb *_urb = NULL;
struct sk_buff *_skb = NULL;
struct sk_buff_head *skb_list;
struct usb_anchor *urb_list;
WARN_ON(NULL == rtlusb->usb_tx_aggregate_hdl);
if (unlikely(IS_USB_STOP(rtlusb))) {
RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
"USB device is stopping...\n");
kfree_skb(skb);
return;
}
ep_num = rtlusb->ep_map.ep_mapping[qnum];
skb_list = &rtlusb->tx_skb_queue[ep_num];
_skb = skb;
_urb = _rtl_usb_tx_urb_setup(hw, _skb, ep_num);
if (unlikely(!_urb)) {
RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
"Can't allocate urb. Drop skb!\n");
return;
}
urb_list = &rtlusb->tx_pending[ep_num];
_rtl_submit_tx_urb(hw, _urb);
}
开发者ID:38c02aee,项目名称:android_kernel_jiayu_g4,代码行数:30,代码来源:usb.c
示例7: rtl_usb_stop
static void rtl_usb_stop(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw));
set_hal_stop(rtlhal);
SET_USB_STOP(rtlusb);
rtl_usb_deinit(hw);
rtlpriv->cfg->ops->hw_disable(hw);
}
开发者ID:mjduddin,项目名称:B14CKB1RD_kernel_m8,代码行数:13,代码来源:usb.c
示例8: usb_bulkout_zero
static u32 usb_bulkout_zero(struct rtl_priv *rtlpriv, u32 addr)
{
int pipe, status, len;
u32 ret;
unsigned char *pbuf;
struct zero_bulkout_context *pcontext;
PURB purb = NULL;
struct rtl_usb *pdvobj = rtl_usbdev(rtlpriv);
struct usb_device *pusbd = pdvobj->udev;
/* DBG_871X("%s\n", __func__); */
if((rtlpriv->bDriverStopped) || (rtlpriv->bSurpriseRemoved) ||(rtlpriv->pwrctrlpriv.pnp_bstop_trx)) {
return _FAIL;
}
pcontext = (struct zero_bulkout_context *)rtw_zmalloc(sizeof(struct zero_bulkout_context));
pbuf = (unsigned char *)rtw_zmalloc(sizeof(int));
purb = usb_alloc_urb(0, GFP_ATOMIC);
len = 0;
pcontext->pbuf = pbuf;
pcontext->purb = purb;
pcontext->pirp = NULL;
pcontext->rtlpriv = rtlpriv;
/*
* translate DMA FIFO addr to pipehandle
* pipe = ffaddr2pipehdl(pdvobj, addr);
*/
usb_fill_bulk_urb(purb, pusbd, pipe,
pbuf,
len,
usb_bulkout_zero_complete,
pcontext); /* context is pcontext */
status = usb_submit_urb(purb, GFP_ATOMIC);
if (!status) {
ret= _SUCCESS;
} else {
ret= _FAIL;
}
return _SUCCESS;
}
开发者ID:directhex,项目名称:rtl8821au-dkms,代码行数:51,代码来源:usb_ops_linux.c
示例9: _rtl_usb_init_rx
static int _rtl_usb_init_rx(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_usb_priv *usb_priv = rtl_usbpriv(hw);
struct rtl_usb *rtlusb = rtl_usbdev(usb_priv);
rtlusb->rx_max_size = rtlpriv->cfg->usb_interface_cfg->rx_max_size;
rtlusb->rx_urb_num = rtlpriv->cfg->usb_interface_cfg->rx_urb_num;
rtlusb->in_ep = rtlpriv->cfg->usb_interface_cfg->in_ep_num;
rtlusb->usb_rx_hdl = rtlpriv->cfg->usb_interface_cfg->usb_rx_hdl;
rtlusb->usb_rx_segregate_hdl =
rtlpriv->cfg->usb_interface_cfg->usb_rx_segregate_hdl;
pr_info("rx_max_size %d, rx_urb_num %d, in_ep %d\n",
rtlusb->rx_max_size, rtlusb->rx_urb_num, rtlusb->in_ep);
init_usb_anchor(&rtlusb->rx_submitted);
return 0;
}
开发者ID:38c02aee,项目名称:android_kernel_jiayu_g4,代码行数:18,代码来源:usb.c
示例10: rtl92c_enable_interrupt
void rtl92c_enable_interrupt(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw));
if (IS_HARDWARE_TYPE_8192CE(rtlhal)) {
rtl_write_dword(rtlpriv, REG_HIMR, rtlpci->irq_mask[0] &
0xFFFFFFFF);
rtl_write_dword(rtlpriv, REG_HIMRE, rtlpci->irq_mask[1] &
0xFFFFFFFF);
} else {
rtl_write_dword(rtlpriv, REG_HIMR, rtlusb->irq_mask[0] &
0xFFFFFFFF);
rtl_write_dword(rtlpriv, REG_HIMRE, rtlusb->irq_mask[1] &
0xFFFFFFFF);
}
}
开发者ID:7799,项目名称:linux,代码行数:19,代码来源:mac.c
示例11: _rtl_submit_tx_urb
static void _rtl_submit_tx_urb(struct ieee80211_hw *hw, struct urb *_urb)
{
int err;
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw));
usb_anchor_urb(_urb, &rtlusb->tx_submitted);
err = usb_submit_urb(_urb, GFP_ATOMIC);
if (err < 0) {
struct sk_buff *skb;
RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
"Failed to submit urb\n");
usb_unanchor_urb(_urb);
skb = (struct sk_buff *)_urb->context;
kfree_skb(skb);
}
usb_free_urb(_urb);
}
开发者ID:38c02aee,项目名称:android_kernel_jiayu_g4,代码行数:19,代码来源:usb.c
示例12: rtl_usb_tx
static int rtl_usb_tx(struct ieee80211_hw *hw, struct sk_buff *skb,
struct rtl_tcb_desc *dummy)
{
struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw));
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)(skb->data);
__le16 fc = hdr->frame_control;
u16 hw_queue;
if (unlikely(is_hal_stop(rtlhal)))
goto err_free;
hw_queue = rtlusb->usb_mq_to_hwq(fc, skb_get_queue_mapping(skb));
_rtl_usb_tx_preprocess(hw, skb, hw_queue);
_rtl_usb_transmit(hw, skb, hw_queue);
return NETDEV_TX_OK;
err_free:
dev_kfree_skb_any(skb);
return NETDEV_TX_OK;
}
开发者ID:38c02aee,项目名称:android_kernel_jiayu_g4,代码行数:20,代码来源:usb.c
示例13: _usb_tx_post
static int _usb_tx_post(struct ieee80211_hw *hw, struct urb *urb,
struct sk_buff *skb)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw));
struct ieee80211_tx_info *txinfo;
rtlusb->usb_tx_post_hdl(hw, urb, skb);
skb_pull(skb, RTL_TX_HEADER_SIZE);
txinfo = IEEE80211_SKB_CB(skb);
ieee80211_tx_info_clear_status(txinfo);
txinfo->flags |= IEEE80211_TX_STAT_ACK;
if (urb->status) {
RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
"Urb has error status 0x%X\n", urb->status);
goto out;
}
/* TODO: statistics */
out:
ieee80211_tx_status_irqsafe(hw, skb);
return urb->status;
}
开发者ID:38c02aee,项目名称:android_kernel_jiayu_g4,代码行数:23,代码来源:usb.c
注:本文中的rtl_usbdev函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论