staging: r8188eu: rename three functions
Commit Message
Prefix the names of the following functions with the driver name. The
original names are bad for the global namespace. While at it, convert
is_IBSS_empty() to all lower case to follow kernel coding style.
is_client_associated_to_ap()
is_client_associated_to_ibss()
is_IBSS_empty()
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
drivers/staging/r8188eu/core/rtw_mlme_ext.c | 14 +++++++-------
drivers/staging/r8188eu/core/rtw_wlan_util.c | 8 ++++----
drivers/staging/r8188eu/include/rtw_mlme_ext.h | 6 +++---
3 files changed, 14 insertions(+), 14 deletions(-)
Comments
On 11/10/22 10:09, Michael Straube wrote:
> Prefix the names of the following functions with the driver name. The
> original names are bad for the global namespace. While at it, convert
> is_IBSS_empty() to all lower case to follow kernel coding style.
>
> is_client_associated_to_ap()
> is_client_associated_to_ibss()
> is_IBSS_empty()
>
> Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Michael Straube <straube.linux@gmail.com>
> ---
> drivers/staging/r8188eu/core/rtw_mlme_ext.c | 14 +++++++-------
> drivers/staging/r8188eu/core/rtw_wlan_util.c | 8 ++++----
> drivers/staging/r8188eu/include/rtw_mlme_ext.h | 6 +++---
> 3 files changed, 14 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
> index be33489d3dfd..161cb67f7882 100644
> --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c
> +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
> @@ -5831,7 +5831,7 @@ void rtw_mlme_site_survey_done(struct adapter *adapter)
> int res;
> u8 reg;
>
> - if ((is_client_associated_to_ap(adapter)) ||
> + if ((r8188eu_is_client_associated_to_ap(adapter)) ||
> ((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE)) {
> /* enable to rx data frame */
> rtw_write16(adapter, REG_RXFLTMAP2, 0xFFFF);
> @@ -5982,7 +5982,7 @@ void site_survey(struct adapter *padapter)
> Restore_DM_Func_Flag(padapter);
> /* Switch_DM_Func(padapter, DYNAMIC_ALL_FUNC_ENABLE, true); */
>
> - if (is_client_associated_to_ap(padapter))
> + if (r8188eu_is_client_associated_to_ap(padapter))
> issue_nulldata(padapter, NULL, 0, 3, 500);
>
> rtw_mlme_site_survey_done(padapter);
> @@ -6952,7 +6952,7 @@ void mlmeext_sta_del_event_callback(struct adapter *padapter)
> struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
> struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
>
> - if (is_client_associated_to_ap(padapter) || is_IBSS_empty(padapter)) {
> + if (r8188eu_is_client_associated_to_ap(padapter) || r8188eu_is_ibss_empty(padapter)) {
> mlme_disconnect(padapter);
> rtw_set_bssid(padapter, null_addr);
>
> @@ -7025,7 +7025,7 @@ void linked_status_chk(struct adapter *padapter)
>
> rtl8188e_sreset_linked_status_check(padapter);
>
> - if (is_client_associated_to_ap(padapter)) {
> + if (r8188eu_is_client_associated_to_ap(padapter)) {
> /* linked infrastructure client mode */
>
> int tx_chk = _SUCCESS, rx_chk = _SUCCESS;
> @@ -7097,7 +7097,7 @@ void linked_status_chk(struct adapter *padapter)
> pmlmeinfo->link_count = 0;
> }
> } /* end of if ((psta = rtw_get_stainfo(pstapriv, passoc_res->network.MacAddress)) != NULL) */
> - } else if (is_client_associated_to_ibss(padapter)) {
> + } else if (r8188eu_is_client_associated_to_ibss(padapter)) {
> /* linked IBSS mode */
> /* for each assoc list entry to check the rx pkt counter */
> for (i = IBSS_START_MAC_ID; i < NUM_STA; i++) {
> @@ -7415,7 +7415,7 @@ u8 disconnect_hdl(struct adapter *padapter, unsigned char *pbuf)
> u8 val8;
> int res;
>
> - if (is_client_associated_to_ap(padapter))
> + if (r8188eu_is_client_associated_to_ap(padapter))
> issue_deauth_ex(padapter, pnetwork->MacAddress, WLAN_REASON_DEAUTH_LEAVING, param->deauth_timeout_ms / 100, 100);
>
> mlme_disconnect(padapter);
> @@ -7527,7 +7527,7 @@ u8 sitesurvey_cmd_hdl(struct adapter *padapter, u8 *pbuf)
> pmlmeext->sitesurvey_res.scan_mode = pparm->scan_mode;
>
> /* issue null data if associating to the AP */
> - if (is_client_associated_to_ap(padapter)) {
> + if (r8188eu_is_client_associated_to_ap(padapter)) {
> pmlmeext->sitesurvey_res.state = SCAN_TXNULL;
>
> issue_nulldata(padapter, NULL, 1, 3, 500);
> diff --git a/drivers/staging/r8188eu/core/rtw_wlan_util.c b/drivers/staging/r8188eu/core/rtw_wlan_util.c
> index c95438a12b59..965bb7da4cce 100644
> --- a/drivers/staging/r8188eu/core/rtw_wlan_util.c
> +++ b/drivers/staging/r8188eu/core/rtw_wlan_util.c
> @@ -331,7 +331,7 @@ u16 get_beacon_interval(struct wlan_bssid_ex *bss)
> return le16_to_cpu(val);
> }
>
> -bool is_client_associated_to_ap(struct adapter *padapter)
> +bool r8188eu_is_client_associated_to_ap(struct adapter *padapter)
> {
> struct mlme_ext_priv *pmlmeext;
> struct mlme_ext_info *pmlmeinfo;
> @@ -348,7 +348,7 @@ bool is_client_associated_to_ap(struct adapter *padapter)
> return false;
> }
>
> -bool is_client_associated_to_ibss(struct adapter *padapter)
> +bool r8188eu_is_client_associated_to_ibss(struct adapter *padapter)
> {
> struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
> struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
> @@ -359,7 +359,7 @@ bool is_client_associated_to_ibss(struct adapter *padapter)
> return false;
> }
>
> -bool is_IBSS_empty(struct adapter *padapter)
> +bool r8188eu_is_ibss_empty(struct adapter *padapter)
> {
> unsigned int i;
> struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
> @@ -893,7 +893,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len)
> unsigned short ht_cap_info;
> unsigned char ht_info_infos_0;
>
> - if (!is_client_associated_to_ap(Adapter))
> + if (!r8188eu_is_client_associated_to_ap(Adapter))
> return true;
>
> len = packet_len - sizeof(struct ieee80211_hdr_3addr);
> diff --git a/drivers/staging/r8188eu/include/rtw_mlme_ext.h b/drivers/staging/r8188eu/include/rtw_mlme_ext.h
> index 9c0af4704607..c46fc1a53085 100644
> --- a/drivers/staging/r8188eu/include/rtw_mlme_ext.h
> +++ b/drivers/staging/r8188eu/include/rtw_mlme_ext.h
> @@ -431,9 +431,9 @@ void update_network(struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src,
> u8 *get_my_bssid(struct wlan_bssid_ex *pnetwork);
> u16 get_beacon_interval(struct wlan_bssid_ex *bss);
>
> -bool is_client_associated_to_ap(struct adapter *padapter);
> -bool is_client_associated_to_ibss(struct adapter *padapter);
> -bool is_IBSS_empty(struct adapter *padapter);
> +bool r8188eu_is_client_associated_to_ap(struct adapter *padapter);
> +bool r8188eu_is_client_associated_to_ibss(struct adapter *padapter);
> +bool r8188eu_is_ibss_empty(struct adapter *padapter);
>
> unsigned char check_assoc_AP(u8 *pframe, uint len);
>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
@@ -5831,7 +5831,7 @@ void rtw_mlme_site_survey_done(struct adapter *adapter)
int res;
u8 reg;
- if ((is_client_associated_to_ap(adapter)) ||
+ if ((r8188eu_is_client_associated_to_ap(adapter)) ||
((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE)) {
/* enable to rx data frame */
rtw_write16(adapter, REG_RXFLTMAP2, 0xFFFF);
@@ -5982,7 +5982,7 @@ void site_survey(struct adapter *padapter)
Restore_DM_Func_Flag(padapter);
/* Switch_DM_Func(padapter, DYNAMIC_ALL_FUNC_ENABLE, true); */
- if (is_client_associated_to_ap(padapter))
+ if (r8188eu_is_client_associated_to_ap(padapter))
issue_nulldata(padapter, NULL, 0, 3, 500);
rtw_mlme_site_survey_done(padapter);
@@ -6952,7 +6952,7 @@ void mlmeext_sta_del_event_callback(struct adapter *padapter)
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
- if (is_client_associated_to_ap(padapter) || is_IBSS_empty(padapter)) {
+ if (r8188eu_is_client_associated_to_ap(padapter) || r8188eu_is_ibss_empty(padapter)) {
mlme_disconnect(padapter);
rtw_set_bssid(padapter, null_addr);
@@ -7025,7 +7025,7 @@ void linked_status_chk(struct adapter *padapter)
rtl8188e_sreset_linked_status_check(padapter);
- if (is_client_associated_to_ap(padapter)) {
+ if (r8188eu_is_client_associated_to_ap(padapter)) {
/* linked infrastructure client mode */
int tx_chk = _SUCCESS, rx_chk = _SUCCESS;
@@ -7097,7 +7097,7 @@ void linked_status_chk(struct adapter *padapter)
pmlmeinfo->link_count = 0;
}
} /* end of if ((psta = rtw_get_stainfo(pstapriv, passoc_res->network.MacAddress)) != NULL) */
- } else if (is_client_associated_to_ibss(padapter)) {
+ } else if (r8188eu_is_client_associated_to_ibss(padapter)) {
/* linked IBSS mode */
/* for each assoc list entry to check the rx pkt counter */
for (i = IBSS_START_MAC_ID; i < NUM_STA; i++) {
@@ -7415,7 +7415,7 @@ u8 disconnect_hdl(struct adapter *padapter, unsigned char *pbuf)
u8 val8;
int res;
- if (is_client_associated_to_ap(padapter))
+ if (r8188eu_is_client_associated_to_ap(padapter))
issue_deauth_ex(padapter, pnetwork->MacAddress, WLAN_REASON_DEAUTH_LEAVING, param->deauth_timeout_ms / 100, 100);
mlme_disconnect(padapter);
@@ -7527,7 +7527,7 @@ u8 sitesurvey_cmd_hdl(struct adapter *padapter, u8 *pbuf)
pmlmeext->sitesurvey_res.scan_mode = pparm->scan_mode;
/* issue null data if associating to the AP */
- if (is_client_associated_to_ap(padapter)) {
+ if (r8188eu_is_client_associated_to_ap(padapter)) {
pmlmeext->sitesurvey_res.state = SCAN_TXNULL;
issue_nulldata(padapter, NULL, 1, 3, 500);
@@ -331,7 +331,7 @@ u16 get_beacon_interval(struct wlan_bssid_ex *bss)
return le16_to_cpu(val);
}
-bool is_client_associated_to_ap(struct adapter *padapter)
+bool r8188eu_is_client_associated_to_ap(struct adapter *padapter)
{
struct mlme_ext_priv *pmlmeext;
struct mlme_ext_info *pmlmeinfo;
@@ -348,7 +348,7 @@ bool is_client_associated_to_ap(struct adapter *padapter)
return false;
}
-bool is_client_associated_to_ibss(struct adapter *padapter)
+bool r8188eu_is_client_associated_to_ibss(struct adapter *padapter)
{
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
@@ -359,7 +359,7 @@ bool is_client_associated_to_ibss(struct adapter *padapter)
return false;
}
-bool is_IBSS_empty(struct adapter *padapter)
+bool r8188eu_is_ibss_empty(struct adapter *padapter)
{
unsigned int i;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
@@ -893,7 +893,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len)
unsigned short ht_cap_info;
unsigned char ht_info_infos_0;
- if (!is_client_associated_to_ap(Adapter))
+ if (!r8188eu_is_client_associated_to_ap(Adapter))
return true;
len = packet_len - sizeof(struct ieee80211_hdr_3addr);
@@ -431,9 +431,9 @@ void update_network(struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src,
u8 *get_my_bssid(struct wlan_bssid_ex *pnetwork);
u16 get_beacon_interval(struct wlan_bssid_ex *bss);
-bool is_client_associated_to_ap(struct adapter *padapter);
-bool is_client_associated_to_ibss(struct adapter *padapter);
-bool is_IBSS_empty(struct adapter *padapter);
+bool r8188eu_is_client_associated_to_ap(struct adapter *padapter);
+bool r8188eu_is_client_associated_to_ibss(struct adapter *padapter);
+bool r8188eu_is_ibss_empty(struct adapter *padapter);
unsigned char check_assoc_AP(u8 *pframe, uint len);