Lines Matching refs:rtwdev

19 	struct rtw_dev *rtwdev = hw->priv;  in rtw_ops_tx()  local
22 if (!rtw_flag_check(rtwdev, RTW_FLAG_RUNNING)) in rtw_ops_tx()
25 rtw_tx_pkt_info_update(rtwdev, &pkt_info, control, skb); in rtw_ops_tx()
26 if (rtw_hci_tx(rtwdev, &pkt_info, skb)) in rtw_ops_tx()
37 struct rtw_dev *rtwdev = hw->priv; in rtw_ops_start() local
40 mutex_lock(&rtwdev->mutex); in rtw_ops_start()
41 ret = rtw_core_start(rtwdev); in rtw_ops_start()
42 mutex_unlock(&rtwdev->mutex); in rtw_ops_start()
49 struct rtw_dev *rtwdev = hw->priv; in rtw_ops_stop() local
51 mutex_lock(&rtwdev->mutex); in rtw_ops_stop()
52 rtw_core_stop(rtwdev); in rtw_ops_stop()
53 mutex_unlock(&rtwdev->mutex); in rtw_ops_stop()
58 struct rtw_dev *rtwdev = hw->priv; in rtw_ops_config() local
61 mutex_lock(&rtwdev->mutex); in rtw_ops_config()
65 rtw_enter_ips(rtwdev); in rtw_ops_config()
67 ret = rtw_leave_ips(rtwdev); in rtw_ops_config()
69 rtw_err(rtwdev, "failed to leave idle state\n"); in rtw_ops_config()
76 rtw_set_channel(rtwdev); in rtw_ops_config()
79 mutex_unlock(&rtwdev->mutex); in rtw_ops_config()
124 struct rtw_dev *rtwdev = hw->priv; in rtw_ops_add_interface() local
140 mutex_lock(&rtwdev->mutex); in rtw_ops_add_interface()
165 rtw_vif_port_config(rtwdev, rtwvif, config); in rtw_ops_add_interface()
167 mutex_unlock(&rtwdev->mutex); in rtw_ops_add_interface()
169 rtw_info(rtwdev, "start vif %pM on port %d\n", vif->addr, rtwvif->port); in rtw_ops_add_interface()
176 struct rtw_dev *rtwdev = hw->priv; in rtw_ops_remove_interface() local
180 rtw_info(rtwdev, "stop vif %pM on port %d\n", vif->addr, rtwvif->port); in rtw_ops_remove_interface()
182 mutex_lock(&rtwdev->mutex); in rtw_ops_remove_interface()
190 rtw_vif_port_config(rtwdev, rtwvif, config); in rtw_ops_remove_interface()
192 mutex_unlock(&rtwdev->mutex); in rtw_ops_remove_interface()
200 struct rtw_dev *rtwdev = hw->priv; in rtw_ops_configure_filter() local
205 mutex_lock(&rtwdev->mutex); in rtw_ops_configure_filter()
209 rtwdev->hal.rcr |= BIT_AM | BIT_AB; in rtw_ops_configure_filter()
211 rtwdev->hal.rcr &= ~(BIT_AM | BIT_AB); in rtw_ops_configure_filter()
215 rtwdev->hal.rcr |= BIT_ACRC32; in rtw_ops_configure_filter()
217 rtwdev->hal.rcr &= ~(BIT_ACRC32); in rtw_ops_configure_filter()
221 rtwdev->hal.rcr |= BIT_AAP; in rtw_ops_configure_filter()
223 rtwdev->hal.rcr &= ~(BIT_AAP); in rtw_ops_configure_filter()
227 rtwdev->hal.rcr &= ~(BIT_CBSSID_BCN | BIT_CBSSID_DATA); in rtw_ops_configure_filter()
229 rtwdev->hal.rcr |= BIT_CBSSID_BCN; in rtw_ops_configure_filter()
232 rtw_dbg(rtwdev, RTW_DBG_RX, in rtw_ops_configure_filter()
234 changed_flags, *new_flags, rtwdev->hal.rcr); in rtw_ops_configure_filter()
236 rtw_write32(rtwdev, REG_RCR, rtwdev->hal.rcr); in rtw_ops_configure_filter()
238 mutex_unlock(&rtwdev->mutex); in rtw_ops_configure_filter()
246 struct rtw_dev *rtwdev = hw->priv; in rtw_ops_bss_info_changed() local
250 mutex_lock(&rtwdev->mutex); in rtw_ops_bss_info_changed()
253 struct rtw_chip_info *chip = rtwdev->chip; in rtw_ops_bss_info_changed()
257 rtw_coex_connect_notify(rtwdev, COEX_ASSOCIATE_FINISH); in rtw_ops_bss_info_changed()
259 chip->ops->phy_calibration(rtwdev); in rtw_ops_bss_info_changed()
262 rtw_add_rsvd_page(rtwdev, RSVD_PS_POLL, true); in rtw_ops_bss_info_changed()
263 rtw_add_rsvd_page(rtwdev, RSVD_QOS_NULL, true); in rtw_ops_bss_info_changed()
264 rtw_add_rsvd_page(rtwdev, RSVD_NULL, true); in rtw_ops_bss_info_changed()
265 rtw_fw_download_rsvd_page(rtwdev, vif); in rtw_ops_bss_info_changed()
266 rtw_send_rsvd_page_h2c(rtwdev); in rtw_ops_bss_info_changed()
267 rtw_coex_media_status_notify(rtwdev, conf->assoc); in rtw_ops_bss_info_changed()
271 rtw_reset_rsvd_page(rtwdev); in rtw_ops_bss_info_changed()
285 rtw_fw_download_rsvd_page(rtwdev, vif); in rtw_ops_bss_info_changed()
287 rtw_vif_port_config(rtwdev, rtwvif, config); in rtw_ops_bss_info_changed()
289 mutex_unlock(&rtwdev->mutex); in rtw_ops_bss_info_changed()
292 static u8 rtw_acquire_macid(struct rtw_dev *rtwdev) in rtw_acquire_macid() argument
296 mac_id = find_first_zero_bit(rtwdev->mac_id_map, RTW_MAX_MAC_ID_NUM); in rtw_acquire_macid()
298 set_bit(mac_id, rtwdev->mac_id_map); in rtw_acquire_macid()
303 static void rtw_release_macid(struct rtw_dev *rtwdev, u8 mac_id) in rtw_release_macid() argument
305 clear_bit(mac_id, rtwdev->mac_id_map); in rtw_release_macid()
312 struct rtw_dev *rtwdev = hw->priv; in rtw_ops_sta_add() local
316 mutex_lock(&rtwdev->mutex); in rtw_ops_sta_add()
318 si->mac_id = rtw_acquire_macid(rtwdev); in rtw_ops_sta_add()
329 rtw_update_sta_info(rtwdev, si); in rtw_ops_sta_add()
330 rtw_fw_media_status_report(rtwdev, si->mac_id, true); in rtw_ops_sta_add()
332 rtwdev->sta_cnt++; in rtw_ops_sta_add()
334 rtw_info(rtwdev, "sta %pM joined with macid %d\n", in rtw_ops_sta_add()
338 mutex_unlock(&rtwdev->mutex); in rtw_ops_sta_add()
346 struct rtw_dev *rtwdev = hw->priv; in rtw_ops_sta_remove() local
349 mutex_lock(&rtwdev->mutex); in rtw_ops_sta_remove()
351 rtw_release_macid(rtwdev, si->mac_id); in rtw_ops_sta_remove()
352 rtw_fw_media_status_report(rtwdev, si->mac_id, false); in rtw_ops_sta_remove()
354 rtwdev->sta_cnt--; in rtw_ops_sta_remove()
356 rtw_info(rtwdev, "sta %pM with macid %d left\n", in rtw_ops_sta_remove()
359 mutex_unlock(&rtwdev->mutex); in rtw_ops_sta_remove()
367 struct rtw_dev *rtwdev = hw->priv; in rtw_ops_set_key() local
368 struct rtw_sec_desc *sec = &rtwdev->sec; in rtw_ops_set_key()
398 mutex_lock(&rtwdev->mutex); in rtw_ops_set_key()
417 rtw_sec_write_cam(rtwdev, sec, sta, key, in rtw_ops_set_key()
421 rtw_sec_clear_cam(rtwdev, sec, key->hw_key_idx); in rtw_ops_set_key()
426 mutex_unlock(&rtwdev->mutex); in rtw_ops_set_key()
463 struct rtw_dev *rtwdev = hw->priv; in rtw_ops_sw_scan_start() local
467 rtw_leave_lps(rtwdev, rtwvif); in rtw_ops_sw_scan_start()
469 mutex_lock(&rtwdev->mutex); in rtw_ops_sw_scan_start()
473 rtw_vif_port_config(rtwdev, rtwvif, config); in rtw_ops_sw_scan_start()
475 rtw_coex_scan_notify(rtwdev, COEX_SCAN_START); in rtw_ops_sw_scan_start()
477 rtw_flag_set(rtwdev, RTW_FLAG_DIG_DISABLE); in rtw_ops_sw_scan_start()
478 rtw_flag_set(rtwdev, RTW_FLAG_SCANNING); in rtw_ops_sw_scan_start()
480 mutex_unlock(&rtwdev->mutex); in rtw_ops_sw_scan_start()
486 struct rtw_dev *rtwdev = hw->priv; in rtw_ops_sw_scan_complete() local
490 mutex_lock(&rtwdev->mutex); in rtw_ops_sw_scan_complete()
492 rtw_flag_clear(rtwdev, RTW_FLAG_SCANNING); in rtw_ops_sw_scan_complete()
493 rtw_flag_clear(rtwdev, RTW_FLAG_DIG_DISABLE); in rtw_ops_sw_scan_complete()
497 rtw_vif_port_config(rtwdev, rtwvif, config); in rtw_ops_sw_scan_complete()
499 rtw_coex_scan_notify(rtwdev, COEX_SCAN_FINISH); in rtw_ops_sw_scan_complete()
501 mutex_unlock(&rtwdev->mutex); in rtw_ops_sw_scan_complete()
508 struct rtw_dev *rtwdev = hw->priv; in rtw_ops_mgd_prepare_tx() local
510 mutex_lock(&rtwdev->mutex); in rtw_ops_mgd_prepare_tx()
511 rtw_coex_connect_notify(rtwdev, COEX_ASSOCIATE_START); in rtw_ops_mgd_prepare_tx()
512 mutex_unlock(&rtwdev->mutex); in rtw_ops_mgd_prepare_tx()