static int rtw89_ops_start(struct ieee80211_hw *hw)
{
struct rtw89_dev *rtwdev = hw->priv;
- int ret;
lockdep_assert_wiphy(hw->wiphy);
- ret = rtw89_core_start(rtwdev);
- return ret;
+ return rtw89_core_start(rtwdev);
}
static void rtw89_ops_stop(struct ieee80211_hw *hw, bool suspend)
struct rtw89_dev *rtwdev = hw->priv;
lockdep_assert_wiphy(hw->wiphy);
+
rtw89_core_stop(rtwdev);
}
{
struct rtw89_dev *rtwdev = hw->priv;
+ lockdep_assert_wiphy(hw->wiphy);
+
/* let previous ips work finish to ensure we don't leave ips twice */
wiphy_work_cancel(hw->wiphy, &rtwdev->ips_work);
- lockdep_assert_wiphy(hw->wiphy);
rtw89_leave_ps_mode(rtwdev);
if ((changed & IEEE80211_CONF_CHANGE_IDLE) &&
struct rtw89_vif_link *rtwvif_link)
{
lockdep_assert_wiphy(rtwdev->hw->wiphy);
+
wiphy_work_cancel(rtwdev->hw->wiphy, &rtwvif_link->update_beacon_work);
rtw89_leave_ps_mode(rtwdev);
u8 mac_id, port;
int ret = 0;
+ lockdep_assert_wiphy(hw->wiphy);
+
rtw89_debug(rtwdev, RTW89_DBG_STATE, "add vif %pM type %d, p2p %d\n",
vif->addr, vif->type, vif->p2p);
- lockdep_assert_wiphy(hw->wiphy);
-
rtw89_leave_ips_by_hwflags(rtwdev);
if (RTW89_CHK_FW_FEATURE(BEACON_FILTER, &rtwdev->fw))
IEEE80211_VIF_SUPPORTS_CQM_RSSI;
mac_id = rtw89_acquire_mac_id(rtwdev);
- if (mac_id == RTW89_MAX_MAC_ID_NUM) {
- ret = -ENOSPC;
- goto err;
- }
+ if (mac_id == RTW89_MAX_MAC_ID_NUM)
+ return -ENOSPC;
port = rtw89_core_acquire_bit_map(rtwdev->hw_port, RTW89_PORT_NUM);
if (port == RTW89_PORT_NUM) {
rtw89_core_release_bit_map(rtwdev->hw_port, port);
release_macid:
rtw89_release_mac_id(rtwdev, mac_id);
-err:
return ret;
}
u8 port = rtw89_vif_get_main_port(rtwvif);
struct rtw89_vif_link *rtwvif_link;
+ lockdep_assert_wiphy(hw->wiphy);
+
rtw89_debug(rtwdev, RTW89_DBG_STATE, "remove vif %pM type %d p2p %d\n",
vif->addr, vif->type, vif->p2p);
wiphy_delayed_work_cancel(hw->wiphy, &rtwvif->roc.roc_work);
- lockdep_assert_wiphy(hw->wiphy);
-
rtwvif_link = rtwvif->links[RTW89_VIF_IDLE_LINK_ID];
if (unlikely(!rtwvif_link)) {
rtw89_err(rtwdev,
u32 rx_fltr;
lockdep_assert_wiphy(hw->wiphy);
+
rtw89_leave_ps_mode(rtwdev);
*new_flags &= FIF_ALLMULTI | FIF_OTHER_BSS | FIF_FCSFAIL |
B_AX_RX_FLTR_CFG_MASK,
rx_fltr);
if (!rtwdev->dbcc_en)
- goto out;
+ return;
rtw89_write32_mask(rtwdev,
rtw89_mac_reg_by_idx(rtwdev, mac->rx_fltr, RTW89_MAC_1),
B_AX_RX_FLTR_CFG_MASK,
rx_fltr);
-
-out:
}
static const u8 ac_to_fw_idx[IEEE80211_NUM_ACS] = {
struct rtw89_vif *rtwvif = vif_to_rtwvif(vif);
lockdep_assert_wiphy(hw->wiphy);
+
rtw89_leave_ps_mode(rtwdev);
if (changed & BSS_CHANGED_ASSOC) {
struct rtw89_vif_link *rtwvif_link;
lockdep_assert_wiphy(hw->wiphy);
+
rtw89_leave_ps_mode(rtwdev);
rtwvif_link = rtwvif->links[conf->link_id];
rtw89_err(rtwdev,
"%s: rtwvif link (link_id %u) is not active\n",
__func__, conf->link_id);
- goto out;
+ return;
}
if (changed & BSS_CHANGED_BSSID) {
if (changed & BSS_CHANGED_TPE)
rtw89_reg_6ghz_recalc(rtwdev, rtwvif_link, true);
-
-out:
}
static int rtw89_ops_start_ap(struct ieee80211_hw *hw,
rtw89_err(rtwdev,
"%s: rtwvif link (link_id %u) is not active\n",
__func__, link_conf->link_id);
- ret = -ENOLINK;
- goto out;
+ return -ENOLINK;
}
chan = rtw89_chan_get(rtwdev, rtwvif_link->chanctx_idx);
- if (chan->band_type == RTW89_BAND_6G) {
+ if (chan->band_type == RTW89_BAND_6G)
return -EOPNOTSUPP;
- }
if (rtwdev->scanning)
rtw89_hw_scan_abort(rtwdev, rtwdev->scan_info.scanning_vif);
if (RTW89_CHK_FW_FEATURE(NOTIFY_AP_INFO, &rtwdev->fw)) {
ret = rtw89_fw_h2c_ap_info_refcount(rtwdev, true);
if (ret)
- goto out;
+ return ret;
}
rtw89_queue_chanctx_work(rtwdev);
-out:
-
- return ret;
+ return 0;
}
static
rtw89_err(rtwdev,
"%s: rtwvif link (link_id %u) is not active\n",
__func__, link_conf->link_id);
- goto out;
+ return;
}
if (RTW89_CHK_FW_FEATURE(NOTIFY_AP_INFO, &rtwdev->fw))
rtw89_mac_stop_ap(rtwdev, rtwvif_link);
rtw89_chip_h2c_assoc_cmac_tbl(rtwdev, rtwvif_link, NULL);
rtw89_fw_h2c_join_info(rtwdev, rtwvif_link, NULL, true);
-
-out:
}
static int rtw89_ops_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
struct rtw89_dev *rtwdev = hw->priv;
struct rtw89_vif *rtwvif = vif_to_rtwvif(vif);
struct rtw89_vif_link *rtwvif_link;
- int ret = 0;
lockdep_assert_wiphy(hw->wiphy);
+
rtw89_leave_ps_mode(rtwdev);
rtwvif_link = rtwvif->links[link_id];
rtw89_err(rtwdev,
"%s: rtwvif link (link_id %u) is not active\n",
__func__, link_id);
- ret = -ENOLINK;
- goto out;
+ return -ENOLINK;
}
rtwvif_link->tx_params[ac] = *params;
__rtw89_conf_tx(rtwdev, rtwvif_link, ac);
-out:
-
- return ret;
+ return 0;
}
static int __rtw89_ops_sta_state(struct ieee80211_hw *hw,
enum ieee80211_sta_state new_state)
{
struct rtw89_dev *rtwdev = hw->priv;
- int ret;
lockdep_assert_wiphy(hw->wiphy);
- rtw89_leave_ps_mode(rtwdev);
- ret = __rtw89_ops_sta_state(hw, vif, sta, old_state, new_state);
- return ret;
+ rtw89_leave_ps_mode(rtwdev);
+ return __rtw89_ops_sta_state(hw, vif, sta, old_state, new_state);
}
static int rtw89_ops_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
struct ieee80211_key_conf *key)
{
struct rtw89_dev *rtwdev = hw->priv;
- int ret = 0;
+ int ret;
lockdep_assert_wiphy(hw->wiphy);
+
rtw89_leave_ps_mode(rtwdev);
switch (cmd) {
ret = rtw89_cam_sec_key_add(rtwdev, vif, sta, key);
if (ret && ret != -EOPNOTSUPP) {
rtw89_err(rtwdev, "failed to add key to sec cam\n");
- goto out;
+ return ret;
}
break;
case DISABLE_KEY:
ret = rtw89_cam_sec_key_del(rtwdev, vif, sta, key, true);
if (ret) {
rtw89_err(rtwdev, "failed to remove key from sec cam\n");
- goto out;
+ return ret;
}
break;
}
-out:
-
return ret;
}
struct ieee80211_txq *txq = sta->txq[tid];
struct rtw89_txq *rtwtxq = (struct rtw89_txq *)txq->drv_priv;
+ lockdep_assert_wiphy(rtwdev->hw->wiphy);
+
switch (params->action) {
case IEEE80211_AMPDU_TX_START:
return IEEE80211_AMPDU_TX_START_IMMEDIATE;
case IEEE80211_AMPDU_TX_STOP_CONT:
case IEEE80211_AMPDU_TX_STOP_FLUSH:
case IEEE80211_AMPDU_TX_STOP_FLUSH_CONT:
- lockdep_assert_wiphy(rtwdev->hw->wiphy);
clear_bit(RTW89_TXQ_F_AMPDU, &rtwtxq->flags);
clear_bit(tid, rtwsta->ampdu_map);
rtw89_chip_h2c_ampdu_cmac_tbl(rtwdev, rtwvif, rtwsta);
ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid);
break;
case IEEE80211_AMPDU_TX_OPERATIONAL:
- lockdep_assert_wiphy(rtwdev->hw->wiphy);
set_bit(RTW89_TXQ_F_AMPDU, &rtwtxq->flags);
rtwsta->ampdu_params[tid].agg_num = params->buf_size;
rtwsta->ampdu_params[tid].amsdu = params->amsdu;
rtw89_chip_h2c_ampdu_cmac_tbl(rtwdev, rtwvif, rtwsta);
break;
case IEEE80211_AMPDU_RX_START:
- lockdep_assert_wiphy(rtwdev->hw->wiphy);
rtw89_chip_h2c_ba_cam(rtwdev, rtwsta, true, params);
break;
case IEEE80211_AMPDU_RX_STOP:
- lockdep_assert_wiphy(rtwdev->hw->wiphy);
rtw89_chip_h2c_ba_cam(rtwdev, rtwsta, false, params);
break;
default:
struct rtw89_dev *rtwdev = hw->priv;
lockdep_assert_wiphy(hw->wiphy);
+
rtw89_leave_ps_mode(rtwdev);
if (test_bit(RTW89_FLAG_POWERON, rtwdev->flags))
rtw89_mac_update_rts_threshold(rtwdev);
struct rtw89_dev *rtwdev = hw->priv;
lockdep_assert_wiphy(hw->wiphy);
+
rtw89_leave_lps(rtwdev);
rtw89_hci_flush_queues(rtwdev, queues, drop);
struct rtw89_dev *rtwdev = hw->priv;
lockdep_assert_wiphy(hw->wiphy);
+
rtw89_phy_rate_pattern_vif(rtwdev, vif, mask);
rtw89_ra_mask_info_update(rtwdev, vif, mask);
struct rtw89_dev *rtwdev = hw->priv;
struct rtw89_hal *hal = &rtwdev->hal;
+ lockdep_assert_wiphy(hw->wiphy);
+
if (hal->ant_diversity) {
if (tx_ant != rx_ant || hweight32(tx_ant) != 1)
return -EINVAL;
return -EINVAL;
}
- lockdep_assert_wiphy(hw->wiphy);
hal->antenna_tx = tx_ant;
hal->antenna_rx = rx_ant;
hal->tx_path_diversity = false;
rtwvif_link = rtw89_vif_get_link_inst(rtwvif, 0);
if (unlikely(!rtwvif_link)) {
rtw89_err(rtwdev, "sw scan start: find no link on HW-0\n");
- goto out;
+ return;
}
rtw89_core_scan_start(rtwdev, rtwvif_link, mac_addr, false);
-
-out:
}
static void rtw89_ops_sw_scan_complete(struct ieee80211_hw *hw,
rtwvif_link = rtw89_vif_get_link_inst(rtwvif, 0);
if (unlikely(!rtwvif_link)) {
rtw89_err(rtwdev, "sw scan complete: find no link on HW-0\n");
- goto out;
+ return;
}
rtw89_core_scan_complete(rtwdev, rtwvif_link, false);
-
-out:
}
static void rtw89_ops_reconfig_complete(struct ieee80211_hw *hw,
struct rtw89_vif_link *rtwvif_link;
int ret;
+ lockdep_assert_wiphy(hw->wiphy);
+
if (!RTW89_CHK_FW_FEATURE(SCAN_OFFLOAD, &rtwdev->fw))
return 1;
- lockdep_assert_wiphy(hw->wiphy);
-
- if (rtwdev->scanning || rtwvif->offchan) {
- ret = -EBUSY;
- goto out;
- }
+ if (rtwdev->scanning || rtwvif->offchan)
+ return -EBUSY;
rtwvif_link = rtw89_vif_get_link_inst(rtwvif, 0);
if (unlikely(!rtwvif_link)) {
rtw89_err(rtwdev, "hw scan: find no link on HW-0\n");
- ret = -ENOLINK;
- goto out;
+ return -ENOLINK;
}
rtw89_hw_scan_start(rtwdev, rtwvif_link, req);
rtw89_err(rtwdev, "HW scan failed with status: %d\n", ret);
}
-out:
-
return ret;
}
struct rtw89_vif *rtwvif = vif_to_rtwvif(vif);
struct rtw89_vif_link *rtwvif_link;
+ lockdep_assert_wiphy(hw->wiphy);
+
if (!RTW89_CHK_FW_FEATURE(SCAN_OFFLOAD, &rtwdev->fw))
return;
- lockdep_assert_wiphy(hw->wiphy);
-
if (!rtwdev->scanning)
- goto out;
+ return;
rtwvif_link = rtw89_vif_get_link_inst(rtwvif, 0);
if (unlikely(!rtwvif_link)) {
rtw89_err(rtwdev, "cancel hw scan: find no link on HW-0\n");
- goto out;
+ return;
}
rtw89_hw_scan_abort(rtwdev, rtwvif_link);
-
-out:
}
static void rtw89_ops_sta_rc_update(struct ieee80211_hw *hw,
struct ieee80211_chanctx_conf *ctx)
{
struct rtw89_dev *rtwdev = hw->priv;
- int ret;
lockdep_assert_wiphy(hw->wiphy);
- ret = rtw89_chanctx_ops_add(rtwdev, ctx);
- return ret;
+ return rtw89_chanctx_ops_add(rtwdev, ctx);
}
static void rtw89_ops_remove_chanctx(struct ieee80211_hw *hw,
struct rtw89_dev *rtwdev = hw->priv;
lockdep_assert_wiphy(hw->wiphy);
+
rtw89_chanctx_ops_remove(rtwdev, ctx);
}
struct rtw89_dev *rtwdev = hw->priv;
lockdep_assert_wiphy(hw->wiphy);
+
rtw89_chanctx_ops_change(rtwdev, ctx, changed);
}
struct rtw89_dev *rtwdev = hw->priv;
struct rtw89_vif *rtwvif = vif_to_rtwvif(vif);
struct rtw89_vif_link *rtwvif_link;
- int ret;
lockdep_assert_wiphy(hw->wiphy);
rtw89_err(rtwdev,
"%s: rtwvif link (link_id %u) is not active\n",
__func__, link_conf->link_id);
- ret = -ENOLINK;
- goto out;
+ return -ENOLINK;
}
- ret = rtw89_chanctx_ops_assign_vif(rtwdev, rtwvif_link, ctx);
-
-out:
-
- return ret;
+ return rtw89_chanctx_ops_assign_vif(rtwdev, rtwvif_link, ctx);
}
static void rtw89_ops_unassign_vif_chanctx(struct ieee80211_hw *hw,
struct rtw89_vif *rtwvif = vif_to_rtwvif_safe(vif);
struct rtw89_roc *roc = &rtwvif->roc;
+ lockdep_assert_wiphy(hw->wiphy);
+
if (!rtwvif)
return -EINVAL;
- lockdep_assert_wiphy(hw->wiphy);
-
if (roc->state != RTW89_ROC_IDLE) {
return -EBUSY;
}
struct rtw89_dev *rtwdev = hw->priv;
struct rtw89_vif *rtwvif = vif_to_rtwvif_safe(vif);
+ lockdep_assert_wiphy(hw->wiphy);
+
if (!rtwvif)
return -EINVAL;
wiphy_delayed_work_cancel(hw->wiphy, &rtwvif->roc.roc_work);
- lockdep_assert_wiphy(hw->wiphy);
rtw89_roc_end(rtwdev, rtwvif);
return 0;
struct rtw89_dev *rtwdev = hw->priv;
lockdep_assert_wiphy(hw->wiphy);
+
if (sta)
rtw89_core_set_tid_config(rtwdev, sta, tid_config);
else
struct rtw89_dev *rtwdev = hw->priv;
int ret;
+ lockdep_assert_wiphy(hw->wiphy);
+
set_bit(RTW89_FLAG_FORBIDDEN_TRACK_WROK, rtwdev->flags);
wiphy_delayed_work_cancel(hw->wiphy, &rtwdev->track_work);
- lockdep_assert_wiphy(hw->wiphy);
ret = rtw89_wow_suspend(rtwdev, wowlan);
-
if (ret) {
rtw89_warn(rtwdev, "failed to suspend for wow %d\n", ret);
clear_bit(RTW89_FLAG_FORBIDDEN_TRACK_WROK, rtwdev->flags);
int ret;
lockdep_assert_wiphy(hw->wiphy);
+
ret = rtw89_wow_resume(rtwdev);
if (ret)
rtw89_warn(rtwdev, "failed to resume for wow %d\n", ret);
struct rtw89_wow_param *rtw_wow = &rtwdev->wow;
struct rtw89_wow_gtk_info *gtk_info = &rtw_wow->gtk_info;
+ lockdep_assert_wiphy(hw->wiphy);
+
if (data->kek_len > sizeof(gtk_info->kek) ||
data->kck_len > sizeof(gtk_info->kck)) {
rtw89_warn(rtwdev, "kek or kck length over fw limit\n");
return;
}
- lockdep_assert_wiphy(hw->wiphy);
-
memcpy(gtk_info->kek, data->kek, data->kek_len);
memcpy(gtk_info->kck, data->kck, data->kck_len);
}
/* wl_disable GPIO get floating when entering LPS */
if (test_bit(RTW89_FLAG_RUNNING, rtwdev->flags))
- goto out;
+ return;
rtw89_core_rfkill_poll(rtwdev, false);
-
-out:
}
const struct ieee80211_ops rtw89_ops = {