Commit 52ac3ff9 authored by Philipp Hortmann's avatar Philipp Hortmann Committed by Greg Kroah-Hartman

staging: rtl8192e: Rename state to link_state

Rename state to link_state to align with rtlwifi driver and to
increase readability as state is to general.
Signed-off-by: default avatarPhilipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/9cf4d0b01c6a84a11939099b628754d4c6d54839.1687007788.git.philipp.g.hortmann@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f6689808
......@@ -52,15 +52,15 @@ static void _rtl92e_update_msr(struct net_device *dev)
switch (priv->rtllib->iw_mode) {
case IW_MODE_INFRA:
if (priv->rtllib->state == RTLLIB_LINKED)
if (priv->rtllib->link_state == RTLLIB_LINKED)
msr |= MSR_LINK_MANAGED;
break;
case IW_MODE_ADHOC:
if (priv->rtllib->state == RTLLIB_LINKED)
if (priv->rtllib->link_state == RTLLIB_LINKED)
msr |= MSR_LINK_ADHOC;
break;
case IW_MODE_MASTER:
if (priv->rtllib->state == RTLLIB_LINKED)
if (priv->rtllib->link_state == RTLLIB_LINKED)
msr |= MSR_LINK_MASTER;
break;
default:
......@@ -745,7 +745,7 @@ void rtl92e_link_change(struct net_device *dev)
if (!priv->up)
return;
if (ieee->state == RTLLIB_LINKED) {
if (ieee->link_state == RTLLIB_LINKED) {
_rtl92e_net_update(dev);
rtl92e_update_ratr_table(dev);
if ((ieee->pairwise_key_type == KEY_TYPE_WEP40) ||
......@@ -760,7 +760,7 @@ void rtl92e_link_change(struct net_device *dev)
u32 reg;
reg = rtl92e_readl(dev, RCR);
if (priv->rtllib->state == RTLLIB_LINKED) {
if (priv->rtllib->link_state == RTLLIB_LINKED) {
if (ieee->intel_promiscuous_md_info.promiscuous_on)
;
else
......
......@@ -169,7 +169,7 @@ bool rtl92e_set_rf_state(struct net_device *dev,
(priv->rtllib->iw_mode == IW_MODE_ADHOC)) {
if ((priv->rtllib->rf_off_reason > RF_CHANGE_BY_IPS) ||
(change_source > RF_CHANGE_BY_IPS)) {
if (ieee->state == RTLLIB_LINKED)
if (ieee->link_state == RTLLIB_LINKED)
priv->blinked_ingpio = true;
else
priv->blinked_ingpio = false;
......@@ -327,7 +327,7 @@ static void _rtl92e_qos_activate(void *data)
int i;
mutex_lock(&priv->mutex);
if (priv->rtllib->state != RTLLIB_LINKED)
if (priv->rtllib->link_state != RTLLIB_LINKED)
goto success;
for (i = 0; i < QOS_QUEUE_NUM; i++)
......@@ -344,7 +344,7 @@ static int _rtl92e_qos_handle_probe_response(struct r8192_priv *priv,
int ret = 0;
u32 size = sizeof(struct rtllib_qos_parameters);
if (priv->rtllib->state != RTLLIB_LINKED)
if (priv->rtllib->link_state != RTLLIB_LINKED)
return ret;
if (priv->rtllib->iw_mode != IW_MODE_INFRA)
......@@ -400,7 +400,7 @@ static int _rtl92e_qos_assoc_resp(struct r8192_priv *priv,
if (!priv || !network)
return 0;
if (priv->rtllib->state != RTLLIB_LINKED)
if (priv->rtllib->link_state != RTLLIB_LINKED)
return 0;
if (priv->rtllib->iw_mode != IW_MODE_INFRA)
......@@ -635,7 +635,7 @@ static int _rtl92e_sta_up(struct net_device *dev, bool is_silent_reset)
if (priv->polling_timer_on == 0)
rtl92e_check_rfctrl_gpio_timer(&priv->gpio_polling_timer);
if (priv->rtllib->state != RTLLIB_LINKED)
if (priv->rtllib->link_state != RTLLIB_LINKED)
rtllib_softmac_start_protocol(priv->rtllib, 0);
rtllib_reset_queue(priv->rtllib);
_rtl92e_watchdog_timer_cb(&priv->watch_dog_timer);
......@@ -660,7 +660,7 @@ static int _rtl92e_sta_down(struct net_device *dev, bool shutdownrf)
priv->rtllib->rtllib_ips_leave(dev);
if (priv->rtllib->state == RTLLIB_LINKED)
if (priv->rtllib->link_state == RTLLIB_LINKED)
rtl92e_leisure_ps_leave(dev);
priv->up = 0;
......@@ -1009,7 +1009,7 @@ static enum reset_type _rtl92e_if_check_reset(struct net_device *dev)
if (rfState == rf_on &&
(priv->rtllib->iw_mode == IW_MODE_INFRA) &&
(priv->rtllib->state == RTLLIB_LINKED))
(priv->rtllib->link_state == RTLLIB_LINKED))
RxResetType = _rtl92e_rx_check_stuck(dev);
if (TxResetType == RESET_TYPE_NORMAL ||
......@@ -1051,7 +1051,7 @@ static void _rtl92e_if_silent_reset(struct net_device *dev)
mutex_lock(&priv->wx_mutex);
if (priv->rtllib->state == RTLLIB_LINKED)
if (priv->rtllib->link_state == RTLLIB_LINKED)
rtl92e_leisure_ps_leave(dev);
if (priv->up) {
......@@ -1073,9 +1073,9 @@ static void _rtl92e_if_silent_reset(struct net_device *dev)
rtl92e_dm_deinit(dev);
rtllib_stop_scan_syncro(ieee);
if (ieee->state == RTLLIB_LINKED) {
if (ieee->link_state == RTLLIB_LINKED) {
mutex_lock(&ieee->wx_mutex);
netdev_info(dev, "ieee->state is RTLLIB_LINKED\n");
netdev_info(dev, "ieee->link_state is RTLLIB_LINKED\n");
rtllib_stop_send_beacons(priv->rtllib);
del_timer_sync(&ieee->associate_timer);
cancel_delayed_work(&ieee->associate_retry_wq);
......@@ -1083,7 +1083,7 @@ static void _rtl92e_if_silent_reset(struct net_device *dev)
netif_carrier_off(dev);
mutex_unlock(&ieee->wx_mutex);
} else {
netdev_info(dev, "ieee->state is NOT LINKED\n");
netdev_info(dev, "ieee->link_state is NOT LINKED\n");
rtllib_softmac_stop_protocol(priv->rtllib, 0, true);
}
......@@ -1110,14 +1110,14 @@ static void _rtl92e_if_silent_reset(struct net_device *dev)
rtl92e_enable_hw_security_config(dev);
if (ieee->state == RTLLIB_LINKED && ieee->iw_mode ==
if (ieee->link_state == RTLLIB_LINKED && ieee->iw_mode ==
IW_MODE_INFRA) {
ieee->set_chan(ieee->dev,
ieee->current_network.channel);
schedule_work(&ieee->associate_complete_wq);
} else if (ieee->state == RTLLIB_LINKED && ieee->iw_mode ==
} else if (ieee->link_state == RTLLIB_LINKED && ieee->iw_mode ==
IW_MODE_ADHOC) {
ieee->set_chan(ieee->dev,
ieee->current_network.channel);
......@@ -1181,7 +1181,7 @@ static void _rtl92e_watchdog_wq_cb(void *data)
if (!priv->up || priv->hw_radio_off)
return;
if (priv->rtllib->state >= RTLLIB_LINKED) {
if (priv->rtllib->link_state >= RTLLIB_LINKED) {
if (priv->rtllib->CntAfterLink < 2)
priv->rtllib->CntAfterLink++;
} else {
......@@ -1191,7 +1191,7 @@ static void _rtl92e_watchdog_wq_cb(void *data)
rtl92e_dm_watchdog(dev);
if (!rtllib_act_scanning(priv->rtllib, false)) {
if ((ieee->iw_mode == IW_MODE_INFRA) && (ieee->state ==
if ((ieee->iw_mode == IW_MODE_INFRA) && (ieee->link_state ==
RTLLIB_NOLINK) &&
(ieee->rf_power_state == rf_on) && !ieee->is_set_key &&
(!ieee->proto_stoppping) && !ieee->wx_set_enc) {
......@@ -1202,7 +1202,7 @@ static void _rtl92e_watchdog_wq_cb(void *data)
}
}
}
if ((ieee->state == RTLLIB_LINKED) && (ieee->iw_mode ==
if ((ieee->link_state == RTLLIB_LINKED) && (ieee->iw_mode ==
IW_MODE_INFRA) && (!ieee->net_promiscuous_md)) {
if (ieee->link_detect_info.NumRxOkInPeriod > 100 ||
ieee->link_detect_info.NumTxOkInPeriod > 100)
......@@ -1244,7 +1244,7 @@ static void _rtl92e_watchdog_wq_cb(void *data)
ieee->link_detect_info.bHigherBusyTraffic = bHigherBusyTraffic;
ieee->link_detect_info.bHigherBusyRxTraffic = bHigherBusyRxTraffic;
if (ieee->state == RTLLIB_LINKED && ieee->iw_mode == IW_MODE_INFRA) {
if (ieee->link_state == RTLLIB_LINKED && ieee->iw_mode == IW_MODE_INFRA) {
u32 TotalRxBcnNum = 0;
u32 TotalRxDataNum = 0;
......@@ -1263,7 +1263,7 @@ static void _rtl92e_watchdog_wq_cb(void *data)
"===>%s(): AP is power off, chan:%d, connect another one\n",
__func__, priv->chan);
ieee->state = RTLLIB_ASSOCIATING;
ieee->link_state = RTLLIB_ASSOCIATING;
RemovePeerTS(priv->rtllib,
priv->rtllib->current_network.bssid);
......
......@@ -291,7 +291,7 @@ static void _rtl92e_dm_check_rate_adaptive(struct net_device *dev)
if (priv->rtllib->mode != WIRELESS_MODE_N_24G)
return;
if (priv->rtllib->state == RTLLIB_LINKED) {
if (priv->rtllib->link_state == RTLLIB_LINKED) {
bshort_gi_enabled = (ht_info->cur_tx_bw40mhz &&
ht_info->bCurShortGI40MHz) ||
(!ht_info->cur_tx_bw40mhz &&
......@@ -1075,7 +1075,7 @@ static void _rtl92e_dm_ctrl_initgain_byrssi_driver(struct net_device *dev)
dm_digtable.dig_state = DM_STA_DIG_OFF;
}
if (priv->rtllib->state == RTLLIB_LINKED)
if (priv->rtllib->link_state == RTLLIB_LINKED)
dm_digtable.cur_sta_connect_state = DIG_STA_CONNECT;
else
dm_digtable.cur_sta_connect_state = DIG_STA_DISCONNECT;
......@@ -1105,7 +1105,7 @@ static void _rtl92e_dm_ctrl_initgain_byrssi_false_alarm(struct net_device *dev)
dm_digtable.dig_algorithm_switch = 0;
}
if (priv->rtllib->state != RTLLIB_LINKED)
if (priv->rtllib->link_state != RTLLIB_LINKED)
return;
if ((priv->undecorated_smoothed_pwdb > dm_digtable.rssi_low_thresh) &&
......@@ -1406,7 +1406,7 @@ static void _rtl92e_dm_check_edca_turbo(struct net_device *dev)
if (priv->rtllib->iw_mode == IW_MODE_ADHOC)
goto dm_CheckEdcaTurbo_EXIT;
if (priv->rtllib->state != RTLLIB_LINKED)
if (priv->rtllib->link_state != RTLLIB_LINKED)
goto dm_CheckEdcaTurbo_EXIT;
if (priv->rtllib->ht_info->iot_action & HT_IOT_ACT_DISABLE_EDCA_TURBO)
goto dm_CheckEdcaTurbo_EXIT;
......@@ -1820,7 +1820,7 @@ static void _rtl92e_dm_fsync_timer_callback(struct timer_list *t)
bool bSwitchFromCountDiff = false;
bool bDoubleTimeInterval = false;
if (priv->rtllib->state == RTLLIB_LINKED &&
if (priv->rtllib->link_state == RTLLIB_LINKED &&
priv->rtllib->bfsync_enable &&
(priv->rtllib->ht_info->iot_action & HT_IOT_ACT_CDD_FSYNC)) {
u32 rate_bitmap;
......@@ -1990,7 +1990,7 @@ static void _rtl92e_dm_check_fsync(struct net_device *dev)
static u8 reg_c38_State = RegC38_Default;
static u32 reset_cnt;
if (priv->rtllib->state == RTLLIB_LINKED &&
if (priv->rtllib->link_state == RTLLIB_LINKED &&
priv->rtllib->ht_info->IOTPeer == HT_IOT_PEER_BROADCOM) {
if (priv->rtllib->bfsync_enable == 0) {
switch (priv->rtllib->fsync_state) {
......@@ -2043,7 +2043,7 @@ static void _rtl92e_dm_check_fsync(struct net_device *dev)
break;
}
if (priv->rtllib->state == RTLLIB_LINKED) {
if (priv->rtllib->link_state == RTLLIB_LINKED) {
if (priv->undecorated_smoothed_pwdb <=
RegC38_TH) {
if (reg_c38_State !=
......@@ -2112,7 +2112,7 @@ static void _rtl92e_dm_dynamic_tx_power(struct net_device *dev)
txlowpower_threshold = TX_POWER_NEAR_FIELD_THRESH_LOW;
}
if (priv->rtllib->state == RTLLIB_LINKED) {
if (priv->rtllib->link_state == RTLLIB_LINKED) {
if (priv->undecorated_smoothed_pwdb >= txhipower_threshold) {
priv->dynamic_tx_high_pwr = true;
priv->dynamic_tx_low_pwr = false;
......
......@@ -27,8 +27,8 @@ static u32 _rtl92e_ethtool_get_link(struct net_device *dev)
{
struct r8192_priv *priv = rtllib_priv(dev);
return ((priv->rtllib->state == RTLLIB_LINKED) ||
(priv->rtllib->state == RTLLIB_LINKED_SCANNING));
return ((priv->rtllib->link_state == RTLLIB_LINKED) ||
(priv->rtllib->link_state == RTLLIB_LINKED_SCANNING));
}
const struct ethtool_ops rtl819x_ethtool_ops = {
......
......@@ -118,7 +118,7 @@ void rtl92e_ips_enter(struct net_device *dev)
rt_state = priv->rtllib->rf_power_state;
if (rt_state == rf_on && !psc->bSwRfProcessing &&
(priv->rtllib->state != RTLLIB_LINKED) &&
(priv->rtllib->link_state != RTLLIB_LINKED) &&
(priv->rtllib->iw_mode != IW_MODE_MASTER)) {
psc->eInactivePowerState = rf_off;
_rtl92e_ps_update_rf_state(dev);
......@@ -209,7 +209,7 @@ void rtl92e_leisure_ps_enter(struct net_device *dev)
&priv->rtllib->pwr_save_ctrl;
if (!((priv->rtllib->iw_mode == IW_MODE_INFRA) &&
(priv->rtllib->state == RTLLIB_LINKED))
(priv->rtllib->link_state == RTLLIB_LINKED))
|| (priv->rtllib->iw_mode == IW_MODE_ADHOC) ||
(priv->rtllib->iw_mode == IW_MODE_MASTER))
return;
......
......@@ -169,7 +169,7 @@ static int _rtl92e_wx_adapter_power_status(struct net_device *dev,
priv->ps_force = false;
psc->bLeisurePs = true;
} else {
if (priv->rtllib->state == RTLLIB_LINKED)
if (priv->rtllib->link_state == RTLLIB_LINKED)
rtl92e_leisure_ps_leave(dev);
priv->ps_force = true;
......@@ -375,10 +375,10 @@ static int _rtl92e_wx_set_scan(struct net_device *dev,
int ret;
if (!(ieee->softmac_features & IEEE_SOFTMAC_SCAN)) {
if ((ieee->state >= RTLLIB_ASSOCIATING) &&
(ieee->state <= RTLLIB_ASSOCIATING_AUTHENTICATED))
if ((ieee->link_state >= RTLLIB_ASSOCIATING) &&
(ieee->link_state <= RTLLIB_ASSOCIATING_AUTHENTICATED))
return 0;
if ((priv->rtllib->state == RTLLIB_LINKED) &&
if ((priv->rtllib->link_state == RTLLIB_LINKED) &&
(priv->rtllib->CntAfterLink < 2))
return 0;
}
......@@ -409,7 +409,7 @@ static int _rtl92e_wx_set_scan(struct net_device *dev,
priv->rtllib->FirstIe_InScan = true;
if (priv->rtllib->state != RTLLIB_LINKED) {
if (priv->rtllib->link_state != RTLLIB_LINKED) {
if (rt_state == rf_off) {
if (priv->rtllib->rf_off_reason >
RF_CHANGE_BY_IPS) {
......@@ -1124,7 +1124,7 @@ static struct iw_statistics *_rtl92e_get_wireless_stats(struct net_device *dev)
int tmp_qual = 0;
int tmp_noise = 0;
if (ieee->state < RTLLIB_LINKED) {
if (ieee->link_state < RTLLIB_LINKED) {
wstats->qual.qual = 10;
wstats->qual.level = 0;
wstats->qual.noise = 0x100 - 100; /* -100 dBm */
......
......@@ -1489,7 +1489,7 @@ struct rtllib_device {
*/
struct rtllib_network current_network;
enum rtl_link_state state;
enum rtl_link_state link_state;
int short_slot;
int mode; /* A, B, G */
......
......@@ -1196,7 +1196,7 @@ static void rtllib_rx_check_leave_lps(struct rtllib_device *ieee, u8 unicast,
u8 nr_subframes)
{
if (unicast) {
if (ieee->state == RTLLIB_LINKED) {
if (ieee->link_state == RTLLIB_LINKED) {
if (((ieee->link_detect_info.NumRxUnicastOkInPeriod +
ieee->link_detect_info.NumTxOkInPeriod) > 8) ||
(ieee->link_detect_info.NumRxUnicastOkInPeriod > 2)) {
......@@ -2117,7 +2117,7 @@ int rtllib_parse_info_param(struct rtllib_device *ieee,
network->tim.tim_period = info_element->data[1];
network->dtim_period = info_element->data[1];
if (ieee->state != RTLLIB_LINKED)
if (ieee->link_state != RTLLIB_LINKED)
break;
network->last_dtim_sta_time = jiffies;
......@@ -2585,7 +2585,7 @@ static inline void rtllib_process_probe_response(
ieee->current_network.buseprotection = false;
}
if (is_beacon(frame_ctl)) {
if (ieee->state >= RTLLIB_LINKED)
if (ieee->link_state >= RTLLIB_LINKED)
ieee->link_detect_info.NumRecvBcnInPeriod++;
}
}
......@@ -2643,7 +2643,7 @@ static inline void rtllib_process_probe_response(
|| ((ieee->current_network.ssid_len == network->ssid_len) &&
(strncmp(ieee->current_network.ssid, network->ssid,
network->ssid_len) == 0) &&
(ieee->state == RTLLIB_NOLINK))))
(ieee->link_state == RTLLIB_NOLINK))))
renew = 1;
update_network(ieee, target, network);
if (renew && (ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE))
......@@ -2654,7 +2654,7 @@ static inline void rtllib_process_probe_response(
if (is_beacon(frame_ctl) &&
is_same_network(&ieee->current_network, network,
(network->ssid_len ? 1 : 0)) &&
(ieee->state == RTLLIB_LINKED)) {
(ieee->link_state == RTLLIB_LINKED)) {
ieee->handle_beacon(ieee->dev, beacon, &ieee->current_network);
}
free_network:
......@@ -2683,7 +2683,7 @@ static void rtllib_rx_mgt(struct rtllib_device *ieee,
if (ieee->sta_sleep || (ieee->ps != RTLLIB_PS_DISABLED &&
ieee->iw_mode == IW_MODE_INFRA &&
ieee->state == RTLLIB_LINKED))
ieee->link_state == RTLLIB_LINKED))
schedule_work(&ieee->ps_task);
break;
......@@ -2700,7 +2700,7 @@ static void rtllib_rx_mgt(struct rtllib_device *ieee,
if ((ieee->softmac_features & IEEE_SOFTMAC_PROBERS) &&
((ieee->iw_mode == IW_MODE_ADHOC ||
ieee->iw_mode == IW_MODE_MASTER) &&
ieee->state == RTLLIB_LINKED))
ieee->link_state == RTLLIB_LINKED))
rtllib_rx_probe_rq(ieee, skb);
break;
}
......
This diff is collapsed.
......@@ -53,7 +53,7 @@ int rtllib_wx_set_freq(struct rtllib_device *ieee, struct iw_request_info *a,
if (ieee->iw_mode == IW_MODE_ADHOC ||
ieee->iw_mode == IW_MODE_MASTER)
if (ieee->state == RTLLIB_LINKED) {
if (ieee->link_state == RTLLIB_LINKED) {
rtllib_stop_send_beacons(ieee);
rtllib_start_send_beacons(ieee);
}
......@@ -95,8 +95,8 @@ int rtllib_wx_get_wap(struct rtllib_device *ieee,
/* We want avoid to give to the user inconsistent infos*/
spin_lock_irqsave(&ieee->lock, flags);
if (ieee->state != RTLLIB_LINKED &&
ieee->state != RTLLIB_LINKED_SCANNING &&
if (ieee->link_state != RTLLIB_LINKED &&
ieee->link_state != RTLLIB_LINKED_SCANNING &&
ieee->wap_set == 0)
eth_zero_addr(wrqu->ap_addr.sa_data);
......@@ -184,8 +184,8 @@ int rtllib_wx_get_essid(struct rtllib_device *ieee, struct iw_request_info *a,
goto out;
}
if (ieee->state != RTLLIB_LINKED &&
ieee->state != RTLLIB_LINKED_SCANNING &&
if (ieee->link_state != RTLLIB_LINKED &&
ieee->link_state != RTLLIB_LINKED_SCANNING &&
ieee->ssid_set == 0) {
ret = -1;
goto out;
......@@ -323,7 +323,7 @@ void rtllib_wx_sync_scan_wq(void *data)
rtllib_stop_all_queues(ieee);
rtllib_stop_send_beacons(ieee);
ieee->state = RTLLIB_LINKED_SCANNING;
ieee->link_state = RTLLIB_LINKED_SCANNING;
ieee->link_change(ieee->dev);
/* wait for ps packet to be kicked out successfully */
msleep(50);
......@@ -355,7 +355,7 @@ void rtllib_wx_sync_scan_wq(void *data)
ieee->ScanOperationBackupHandler(ieee->dev, SCAN_OPT_RESTORE);
ieee->state = RTLLIB_LINKED;
ieee->link_state = RTLLIB_LINKED;
ieee->link_change(ieee->dev);
/* Notify AP that I wake up again */
......@@ -385,7 +385,7 @@ int rtllib_wx_set_scan(struct rtllib_device *ieee, struct iw_request_info *a,
goto out;
}
if (ieee->state == RTLLIB_LINKED) {
if (ieee->link_state == RTLLIB_LINKED) {
schedule_work(&ieee->wx_sync_scan_wq);
/* intentionally forget to up sem */
return 0;
......
......@@ -619,7 +619,7 @@ int rtllib_wx_set_mlme(struct rtllib_device *ieee,
bool deauth = false;
struct iw_mlme *mlme = (struct iw_mlme *)extra;
if (ieee->state != RTLLIB_LINKED)
if (ieee->link_state != RTLLIB_LINKED)
return -ENOLINK;
mutex_lock(&ieee->wx_mutex);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment