static int rtl_usb_tx(struct ieee80211_hw *hw, struct ieee80211_sta *sta, struct sk_buff *skb, struct rtl_tcb_desc *tcb_desc) { struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw)); struct rtl_hal *rtlhal = rtl_hal(rtlpriv); struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)(skb->data); __le16 fc = hdr->frame_control; u16 hw_queue; if (unlikely(IS_USB_STOP(rtlusb)) && tcb_desc->cmd_or_init != DESC_PACKET_TYPE_INIT) { RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG, "USB device is stopping...\n"); goto err_free; } 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, sta, 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; }
static int _rtl92s_cmd_send_packet(struct ieee80211_hw *hw, struct sk_buff *skb, u8 last) { struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_tcb_desc *tcb_desc; u8 *pdesc; int err; pdesc = (u8 *)skb_push(skb, RTL_TX_HEADER_SIZE); rtlpriv->cfg->ops->fill_tx_cmddesc(hw, pdesc, 1, 1, skb); tcb_desc = (struct rtl_tcb_desc *)(skb->cb); err = rtl_usb_transmit(hw, skb, tcb_desc->queue_index, _rtl92s_cmd_complete); /* * If an error occured in rtl_usb_transmit, the skb is * being freed automatically. */ return err; }