Lines Matching refs:rtlpriv
146 static u32 _usb_read_sync(struct rtl_priv *rtlpriv, u32 addr, u16 len) in _usb_read_sync() argument
148 struct device *dev = rtlpriv->io.dev; in _usb_read_sync()
156 spin_lock_irqsave(&rtlpriv->locks.usb_lock, flags); in _usb_read_sync()
157 if (++rtlpriv->usb_data_index >= RTL_USB_MAX_RX_COUNT) in _usb_read_sync()
158 rtlpriv->usb_data_index = 0; in _usb_read_sync()
159 data = &rtlpriv->usb_data[rtlpriv->usb_data_index]; in _usb_read_sync()
160 spin_unlock_irqrestore(&rtlpriv->locks.usb_lock, flags); in _usb_read_sync()
169 static u8 _usb_read8_sync(struct rtl_priv *rtlpriv, u32 addr) in _usb_read8_sync() argument
171 return (u8)_usb_read_sync(rtlpriv, addr, 1); in _usb_read8_sync()
174 static u16 _usb_read16_sync(struct rtl_priv *rtlpriv, u32 addr) in _usb_read16_sync() argument
176 return (u16)_usb_read_sync(rtlpriv, addr, 2); in _usb_read16_sync()
179 static u32 _usb_read32_sync(struct rtl_priv *rtlpriv, u32 addr) in _usb_read32_sync() argument
181 return _usb_read_sync(rtlpriv, addr, 4); in _usb_read32_sync()
200 static void _usb_write8_async(struct rtl_priv *rtlpriv, u32 addr, u8 val) in _usb_write8_async() argument
202 struct device *dev = rtlpriv->io.dev; in _usb_write8_async()
207 static void _usb_write16_async(struct rtl_priv *rtlpriv, u32 addr, u16 val) in _usb_write16_async() argument
209 struct device *dev = rtlpriv->io.dev; in _usb_write16_async()
214 static void _usb_write32_async(struct rtl_priv *rtlpriv, u32 addr, u32 val) in _usb_write32_async() argument
216 struct device *dev = rtlpriv->io.dev; in _usb_write32_async()
221 static void _usb_writeN_sync(struct rtl_priv *rtlpriv, u32 addr, void *data, in _usb_writeN_sync() argument
224 struct device *dev = rtlpriv->io.dev; in _usb_writeN_sync()
246 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl_usb_io_handler_init() local
248 rtlpriv->io.dev = dev; in _rtl_usb_io_handler_init()
249 mutex_init(&rtlpriv->io.bb_mutex); in _rtl_usb_io_handler_init()
250 rtlpriv->io.write8_async = _usb_write8_async; in _rtl_usb_io_handler_init()
251 rtlpriv->io.write16_async = _usb_write16_async; in _rtl_usb_io_handler_init()
252 rtlpriv->io.write32_async = _usb_write32_async; in _rtl_usb_io_handler_init()
253 rtlpriv->io.read8_sync = _usb_read8_sync; in _rtl_usb_io_handler_init()
254 rtlpriv->io.read16_sync = _usb_read16_sync; in _rtl_usb_io_handler_init()
255 rtlpriv->io.read32_sync = _usb_read32_sync; in _rtl_usb_io_handler_init()
256 rtlpriv->io.writeN_sync = _usb_writeN_sync; in _rtl_usb_io_handler_init()
261 struct rtl_priv __maybe_unused *rtlpriv = rtl_priv(hw); in _rtl_usb_io_handler_release() local
263 mutex_destroy(&rtlpriv->io.bb_mutex); in _rtl_usb_io_handler_release()
282 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl_usb_init_tx() local
289 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "USB Max Bulk-out Size=%d\n", in _rtl_usb_init_tx()
295 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, in _rtl_usb_init_tx()
302 rtlpriv->cfg->usb_interface_cfg->usb_tx_post_hdl; in _rtl_usb_init_tx()
304 rtlpriv->cfg->usb_interface_cfg->usb_tx_cleanup; in _rtl_usb_init_tx()
306 (rtlpriv->cfg->usb_interface_cfg->usb_tx_aggregate_hdl) in _rtl_usb_init_tx()
307 ? rtlpriv->cfg->usb_interface_cfg->usb_tx_aggregate_hdl in _rtl_usb_init_tx()
322 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl_usb_init_rx() local
326 rtlusb->rx_max_size = rtlpriv->cfg->usb_interface_cfg->rx_max_size; in _rtl_usb_init_rx()
327 rtlusb->rx_urb_num = rtlpriv->cfg->usb_interface_cfg->rx_urb_num; in _rtl_usb_init_rx()
328 rtlusb->in_ep = rtlpriv->cfg->usb_interface_cfg->in_ep_num; in _rtl_usb_init_rx()
329 rtlusb->usb_rx_hdl = rtlpriv->cfg->usb_interface_cfg->usb_rx_hdl; in _rtl_usb_init_rx()
331 rtlpriv->cfg->usb_interface_cfg->usb_rx_segregate_hdl; in _rtl_usb_init_rx()
347 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl_usb_init() local
365 RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, in _rtl_usb_init()
370 if (rtlusb->in_ep_nums < rtlpriv->cfg->usb_interface_cfg->in_ep_num) { in _rtl_usb_init()
379 err = rtlpriv->cfg->usb_interface_cfg->usb_endpoint_mapping(hw); in _rtl_usb_init()
380 rtlusb->usb_mq_to_hwq = rtlpriv->cfg->usb_interface_cfg->usb_mq_to_hwq; in _rtl_usb_init()
428 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl_prep_rx_urb() local
434 RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG, in _rtl_prep_rx_urb()
450 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl_usb_rx_process_agg() local
462 rtlpriv->cfg->ops->query_rx_desc(hw, &stats, &rx_status, rxdesc, skb); in _rtl_usb_rx_process_agg()
475 rtlpriv->stats.rxbytesunicast += skb->len; in _rtl_usb_rx_process_agg()
479 rtlpriv->cfg->ops->led_control(hw, LED_CTL_RX); in _rtl_usb_rx_process_agg()
482 rtlpriv->link_info.num_rx_inperiod++; in _rtl_usb_rx_process_agg()
492 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl_usb_rx_process_noagg() local
504 rtlpriv->cfg->ops->query_rx_desc(hw, &stats, &rx_status, rxdesc, skb); in _rtl_usb_rx_process_noagg()
517 rtlpriv->stats.rxbytesunicast += skb->len; in _rtl_usb_rx_process_noagg()
521 rtlpriv->cfg->ops->led_control(hw, LED_CTL_RX); in _rtl_usb_rx_process_noagg()
524 rtlpriv->link_info.num_rx_inperiod++; in _rtl_usb_rx_process_noagg()
621 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl_rx_completed() local
635 RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG, in _rtl_rx_completed()
643 RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG, in _rtl_rx_completed()
654 RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG, in _rtl_rx_completed()
706 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl_usb_cleanup_rx() local
713 cancel_work_sync(&rtlpriv->works.lps_change_work); in _rtl_usb_cleanup_rx()
715 flush_workqueue(rtlpriv->works.rtl_wq); in _rtl_usb_cleanup_rx()
716 destroy_workqueue(rtlpriv->works.rtl_wq); in _rtl_usb_cleanup_rx()
732 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl_usb_receive() local
743 RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG, in _rtl_usb_receive()
750 RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG, in _rtl_usb_receive()
773 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl_usb_start() local
777 err = rtlpriv->cfg->ops->hw_init(hw); in rtl_usb_start()
834 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl_usb_stop() local
840 cancel_work_sync(&rtlpriv->works.fill_h2c_cmd); in rtl_usb_stop()
843 rtlpriv->cfg->ops->hw_disable(hw); in rtl_usb_stop()
849 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl_submit_tx_urb() local
857 RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG, in _rtl_submit_tx_urb()
869 struct rtl_priv *rtlpriv = rtl_priv(hw); in _usb_tx_post() local
880 RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG, in _usb_tx_post()
910 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl_usb_tx_urb_setup() local
917 RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG, in _rtl_usb_tx_urb_setup()
932 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl_usb_transmit() local
940 RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG, in _rtl_usb_transmit()
949 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, in _rtl_usb_transmit()
962 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl_usb_tx_preprocess() local
977 RT_TRACE(rtlpriv, COMP_SEND, DBG_DMESG, "MAC80211_LINKING\n"); in _rtl_usb_tx_preprocess()
981 if (rtlpriv->psc.sw_ps_enabled) { in _rtl_usb_tx_preprocess()
989 rtlpriv->stats.txbytesmulticast += skb->len; in _rtl_usb_tx_preprocess()
991 rtlpriv->stats.txbytesbroadcast += skb->len; in _rtl_usb_tx_preprocess()
993 rtlpriv->stats.txbytesunicast += skb->len; in _rtl_usb_tx_preprocess()
1002 rtlpriv->cfg->ops->fill_tx_desc(hw, hdr, (u8 *)pdesc, NULL, info, sta, skb, in _rtl_usb_tx_preprocess()
1009 rtlpriv->cfg->ops->led_control(hw, LED_CTL_TX); in _rtl_usb_tx_preprocess()
1047 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl_fill_h2c_cmd_work_callback() local
1049 rtlpriv->cfg->ops->fill_h2c_cmd(hw, H2C_RA_MASK, 5, rtlpriv->rate_mask); in rtl_fill_h2c_cmd_work_callback()
1065 struct rtl_priv *rtlpriv = NULL; in rtl_usb_probe() local
1075 rtlpriv = hw->priv; in rtl_usb_probe()
1076 rtlpriv->usb_data = kzalloc(RTL_USB_MAX_RX_COUNT * sizeof(u32), in rtl_usb_probe()
1078 if (!rtlpriv->usb_data) in rtl_usb_probe()
1082 spin_lock_init(&rtlpriv->locks.usb_lock); in rtl_usb_probe()
1083 INIT_WORK(&rtlpriv->works.fill_h2c_cmd, in rtl_usb_probe()
1085 INIT_WORK(&rtlpriv->works.lps_change_work, in rtl_usb_probe()
1088 rtlpriv->usb_data_index = 0; in rtl_usb_probe()
1089 init_completion(&rtlpriv->firmware_loading_complete); in rtl_usb_probe()
1099 rtlpriv->rtlhal.interface = INTF_USB; in rtl_usb_probe()
1100 rtlpriv->cfg = rtl_hal_cfg; in rtl_usb_probe()
1101 rtlpriv->intf_ops = &rtl_usb_ops; in rtl_usb_probe()
1105 rtlpriv->cfg->ops->read_chip_version(hw); in rtl_usb_probe()
1107 rtlpriv->cfg->ops->read_eeprom_info(hw); in rtl_usb_probe()
1115 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, in rtl_usb_probe()
1119 if (rtlpriv->cfg->ops->init_sw_vars(hw)) { in rtl_usb_probe()
1120 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n"); in rtl_usb_probe()
1123 rtlpriv->cfg->ops->init_sw_leds(hw); in rtl_usb_probe()
1127 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, in rtl_usb_probe()
1132 rtlpriv->mac80211.mac80211_registered = 1; in rtl_usb_probe()
1134 set_bit(RTL_STATUS_INTERFACE_START, &rtlpriv->status); in rtl_usb_probe()
1141 complete(&rtlpriv->firmware_loading_complete); in rtl_usb_probe()
1149 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl_usb_disconnect() local
1153 if (unlikely(!rtlpriv)) in rtl_usb_disconnect()
1156 wait_for_completion(&rtlpriv->firmware_loading_complete); in rtl_usb_disconnect()
1157 clear_bit(RTL_STATUS_INTERFACE_START, &rtlpriv->status); in rtl_usb_disconnect()
1164 rtlpriv->intf_ops->adapter_stop(hw); in rtl_usb_disconnect()
1170 kfree(rtlpriv->usb_data); in rtl_usb_disconnect()
1171 rtlpriv->cfg->ops->deinit_sw_leds(hw); in rtl_usb_disconnect()
1172 rtlpriv->cfg->ops->deinit_sw_vars(hw); in rtl_usb_disconnect()