staging: r8188eu: start migrating mlme_linux.c
cover staging: r8188eu: start migrating mlme_linux.c
This series starts to migrate the functions, or their functionalitiy, from os_dep/mlme_linux.c to the core/* part of the driver. The goal is to remove os_dep/mlme_linux.c at some point.
Tested on x86_64 with Inter-Tech DMG-02.
Michael Straube (11):
staging: r8188eu: make init_mlme_ext_timer() static
staging: r8188eu: make init_addba_retry_timer() static
staging: r8188eu: make rtw_indicate_sta_disassoc_event() static
staging: r8188eu: move rtw_indicate_sta_assoc_event() to rtw_ap.c
staging: r8188eu: make rtw_report_sec_ie() static
staging: r8188eu: remove unneeded initializations
staging: r8188eu: make rtw_reset_securitypriv() static
staging: r8188eu: merge rtw_{os,}_indicate_disconnect()
staging: r8188eu: merge rtw_{os,}_indicate_connect()
staging: r8188eu: merge rtw_{os,}_indicate_scan_done()
staging: r8188eu: remove unused function parameter
drivers/staging/r8188eu/core/rtw_ap.c | 42 +++++ drivers/staging/r8188eu/core/rtw_mlme.c | 86 ++++++++- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 22 +++ drivers/staging/r8188eu/core/rtw_sta_mgt.c | 12 ++ drivers/staging/r8188eu/include/mlme_osdep.h | 5 - drivers/staging/r8188eu/include/rtw_ap.h | 2 - drivers/staging/r8188eu/include/rtw_mlme.h | 2 +- .../staging/r8188eu/include/rtw_mlme_ext.h | 2 - drivers/staging/r8188eu/os_dep/mlme_linux.c | 166 ------------------ drivers/staging/r8188eu/os_dep/usb_intf.c | 2 +- 10 files changed, 159 insertions(+), 182 deletions(-)
Signature · 1 line
2.37.1
PATCH 1/11 staging: r8188eu: make init_mlme_ext_timer() static
The function init_mlme_ext_timer() is only used in rtw_mlme_ext.c. Make it static to get one step closer to removing os_dep/mlme_linux.c.
--- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 22 +++++++++++++++++++ .../staging/r8188eu/include/rtw_mlme_ext.h | 1 - drivers/staging/r8188eu/os_dep/mlme_linux.c | 21 ------------------ 3 files changed, 22 insertions(+), 22 deletions(-)
drivers/staging/r8188eu/core/rtw_mlme_ext.c +22 -0
@@ -334,6 +334,28 @@ static u8 init_channel_set(struct adapter *padapter, u8 ChannelPlan, struct rt_creturn chanset_size; } +static void _survey_timer_hdl (struct timer_list *t) +{ +struct adapter *padapter =from_timer (padapter, t, mlmeextpriv.survey_timer); + +survey_timer_hdl (padapter); +} + +static void _link_timer_hdl (struct timer_list *t) +{ +struct adapter *padapter =from_timer (padapter, t, mlmeextpriv.link_timer); + +link_timer_hdl (padapter); +} + +static void init_mlme_ext_timer (struct adapter *padapter) +{ +struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; + +timer_setup (&pmlmeext->survey_timer, _survey_timer_hdl,0 ); +timer_setup (&pmlmeext->link_timer, _link_timer_hdl,0 ); +} +void init_mlme_ext_priv (struct adapter *padapter) {struct registry_priv *pregistrypriv = &padapter->registrypriv;
drivers/staging/r8188eu/include/rtw_mlme_ext.h +0 -1
@@ -388,7 +388,6 @@ struct mlme_ext_priv {void init_mlme_ext_priv (struct adapter *adapter);int init_hw_mlme_ext (struct adapter *padapter);void free_mlme_ext_priv (struct mlme_ext_priv *pmlmeext); -extern void init_mlme_ext_timer (struct adapter *padapter);extern void init_addba_retry_timer (struct adapter *adapt,struct sta_info *sta);extern struct xmit_frame *alloc_mgtxmitframe (struct xmit_priv *pxmitpriv);
drivers/staging/r8188eu/os_dep/mlme_linux.c +0 -21
@@ -130,19 +130,6 @@ void rtw_report_sec_ie(struct adapter *adapter, u8 authmode, u8 *sec_ie) } } -static void _survey_timer_hdl (struct timer_list *t) -{ -struct adapter *padapter =from_timer (padapter, t, mlmeextpriv.survey_timer); - -survey_timer_hdl (padapter); -} - -static void _link_timer_hdl (struct timer_list *t) -{ -struct adapter *padapter =from_timer (padapter, t, mlmeextpriv.link_timer); -link_timer_hdl (padapter); -} -static void _addba_timer_hdl (struct timer_list *t) {struct sta_info *psta =from_timer (psta, t, addba_retry_timer);
@@ -154,14 +141,6 @@ void init_addba_retry_timer(struct adapter *padapter, struct sta_info *psta)timer_setup (&psta->addba_retry_timer, _addba_timer_hdl,0 ); } -void init_mlme_ext_timer (struct adapter *padapter) -{ -struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; - -timer_setup (&pmlmeext->survey_timer, _survey_timer_hdl,0 ); -timer_setup (&pmlmeext->link_timer, _link_timer_hdl,0 ); -} -void rtw_indicate_sta_assoc_event (struct adapter *padapter,struct sta_info *psta) {union iwreq_data wrqu;
Signature · 1 line
2.37.1
PATCH 2/11 staging: r8188eu: make init_addba_retry_timer() static
In reply to Michael StraubeThe function init_addba_retry_timer() is only used in rtw_sta_mgt.c. Make it static to get one step closer to removing os_dep/mlme_linux.c.
--- drivers/staging/r8188eu/core/rtw_sta_mgt.c | 12 ++++++++++++ drivers/staging/r8188eu/include/rtw_mlme_ext.h | 1 - drivers/staging/r8188eu/os_dep/mlme_linux.c | 11 ----------- 3 files changed, 12 insertions(+), 12 deletions(-)
drivers/staging/r8188eu/core/rtw_sta_mgt.c +12 -0
@@ -154,6 +154,18 @@ static void rtw_init_recv_timer(struct recv_reorder_ctrl *preorder_ctrl)timer_setup (&preorder_ctrl->reordering_ctrl_timer, _rtw_reordering_ctrl_timeout_handler,0 ); } +static void _addba_timer_hdl (struct timer_list *t) +{ +struct sta_info *psta =from_timer (psta, t, addba_retry_timer); + +addba_timer_hdl (psta); +} + +static void init_addba_retry_timer (struct adapter *padapter,struct sta_info *psta) +{ +timer_setup (&psta->addba_retry_timer, _addba_timer_hdl,0 ); +} +struct sta_info *rtw_alloc_stainfo (struct sta_priv *pstapriv,u8 *hwaddr) {s32 index;
drivers/staging/r8188eu/include/rtw_mlme_ext.h +0 -1
@@ -388,7 +388,6 @@ struct mlme_ext_priv {void init_mlme_ext_priv (struct adapter *adapter);int init_hw_mlme_ext (struct adapter *padapter);void free_mlme_ext_priv (struct mlme_ext_priv *pmlmeext); -extern void init_addba_retry_timer (struct adapter *adapt,struct sta_info *sta);extern struct xmit_frame *alloc_mgtxmitframe (struct xmit_priv *pxmitpriv);unsigned char networktype_to_raid (unsigned char network_type);
drivers/staging/r8188eu/os_dep/mlme_linux.c +0 -11
@@ -130,17 +130,6 @@ void rtw_report_sec_ie(struct adapter *adapter, u8 authmode, u8 *sec_ie) } } -static void _addba_timer_hdl (struct timer_list *t) -{ -struct sta_info *psta =from_timer (psta, t, addba_retry_timer); -addba_timer_hdl (psta); -} - -void init_addba_retry_timer (struct adapter *padapter,struct sta_info *psta) -{ -timer_setup (&psta->addba_retry_timer, _addba_timer_hdl,0 ); -} -void rtw_indicate_sta_assoc_event (struct adapter *padapter,struct sta_info *psta) {union iwreq_data wrqu;
Signature · 1 line
2.37.1
PATCH 3/11 staging: r8188eu: make rtw_indicate_sta_disassoc_event() static
In reply to Michael StraubeThe function rtw_indicate_sta_disassoc_event() is only used in rtw_ap.c. Make it static to get one step closer to removing os_dep/mlme_linux.c.
--- drivers/staging/r8188eu/core/rtw_ap.c | 21 +++++++++++++++++++++ drivers/staging/r8188eu/include/rtw_ap.h | 2 -- drivers/staging/r8188eu/os_dep/mlme_linux.c | 21 --------------------- 3 files changed, 21 insertions(+), 23 deletions(-)
drivers/staging/r8188eu/core/rtw_ap.c +21 -0
@@ -935,6 +935,27 @@ u8 bss_cap_update_on_sta_leave(struct adapter *padapter, struct sta_info *psta)return beacon_updated; } +static void rtw_indicate_sta_disassoc_event (struct adapter *padapter,struct sta_info *psta) +{ +union iwreq_data wrqu; +struct sta_priv *pstapriv = &padapter->stapriv; + +if (!psta) +return ; + +if (psta->aid >NUM_STA ) +return ; + +if (pstapriv->sta_aid[psta->aid -1 ] != psta) +return ; + + wrqu.addr.sa_family =ARPHRD_ETHER ; + +memcpy (wrqu.addr.sa_data, psta->hwaddr,ETH_ALEN ); + +wireless_send_event (padapter->pnetdev,IWEVEXPIRED , &wrqu,NULL ); +} +u8 ap_free_sta (struct adapter *padapter,struct sta_info *psta,bool active,u16 reason) {
drivers/staging/r8188eu/include/rtw_ap.h +0 -2
@@ -10,8 +10,6 @@/* external function */ void rtw_indicate_sta_assoc_event (struct adapter *padapter,struct sta_info *psta); -void rtw_indicate_sta_disassoc_event (struct adapter *padapter, -struct sta_info *psta);void init_mlme_ap_info (struct adapter *padapter);void free_mlme_ap_info (struct adapter *padapter); void update_beacon(struct adapter *padapter, u8 ie_id,
drivers/staging/r8188eu/os_dep/mlme_linux.c +0 -21
@@ -150,24 +150,3 @@ void rtw_indicate_sta_assoc_event(struct adapter *padapter, struct sta_info *pstwireless_send_event (padapter->pnetdev,IWEVREGISTERED , &wrqu,NULL ); } - -void rtw_indicate_sta_disassoc_event (struct adapter *padapter,struct sta_info *psta) -{ -union iwreq_data wrqu; -struct sta_priv *pstapriv = &padapter->stapriv; - -if (!psta) -return ; - -if (psta->aid >NUM_STA ) -return ; - -if (pstapriv->sta_aid[psta->aid -1 ] != psta) -return ; - - wrqu.addr.sa_family =ARPHRD_ETHER ; - -memcpy (wrqu.addr.sa_data, psta->hwaddr,ETH_ALEN ); - -wireless_send_event (padapter->pnetdev,IWEVEXPIRED , &wrqu,NULL ); -}
Signature · 1 line
2.37.1
PATCH 4/11 staging: r8188eu: move rtw_indicate_sta_assoc_event() to rtw_ap.c
In reply to Michael StraubeMove the function rtw_indicate_sta_assoc_event() to core/rtw_ap.c to get one step closer to removing os_dep/mlme_linux.c.
--- drivers/staging/r8188eu/core/rtw_ap.c | 21 +++++++++++++++++++++ drivers/staging/r8188eu/os_dep/mlme_linux.c | 21 --------------------- 2 files changed, 21 insertions(+), 21 deletions(-)
drivers/staging/r8188eu/core/rtw_ap.c +21 -0
@@ -935,6 +935,27 @@ u8 bss_cap_update_on_sta_leave(struct adapter *padapter, struct sta_info *psta)return beacon_updated; } +void rtw_indicate_sta_assoc_event (struct adapter *padapter,struct sta_info *psta) +{ +union iwreq_data wrqu; +struct sta_priv *pstapriv = &padapter->stapriv; + +if (!psta) +return ; + +if (psta->aid >NUM_STA ) +return ; + +if (pstapriv->sta_aid[psta->aid -1 ] != psta) +return ; + + wrqu.addr.sa_family =ARPHRD_ETHER ; + +memcpy (wrqu.addr.sa_data, psta->hwaddr,ETH_ALEN ); + +wireless_send_event (padapter->pnetdev,IWEVREGISTERED , &wrqu,NULL ); +} +static void rtw_indicate_sta_disassoc_event (struct adapter *padapter,struct sta_info *psta) {union iwreq_data wrqu;
drivers/staging/r8188eu/os_dep/mlme_linux.c +0 -21
@@ -129,24 +129,3 @@ void rtw_report_sec_ie(struct adapter *adapter, u8 authmode, u8 *sec_ie)kfree (buff); } } - -void rtw_indicate_sta_assoc_event (struct adapter *padapter,struct sta_info *psta) -{ -union iwreq_data wrqu; -struct sta_priv *pstapriv = &padapter->stapriv; - -if (!psta) -return ; - -if (psta->aid >NUM_STA ) -return ; - -if (pstapriv->sta_aid[psta->aid -1 ] != psta) -return ; - - wrqu.addr.sa_family =ARPHRD_ETHER ; - -memcpy (wrqu.addr.sa_data, psta->hwaddr,ETH_ALEN ); - -wireless_send_event (padapter->pnetdev,IWEVREGISTERED , &wrqu,NULL ); -}
Signature · 1 line
2.37.1
PATCH 5/11 staging: r8188eu: make rtw_report_sec_ie() static
In reply to Michael StraubeThe function rtw_report_sec_ie() is only used in rtw_mlme.c. Make it static to get one step closer to removing os_dep/mlme_linux.c.
--- drivers/staging/r8188eu/core/rtw_mlme.c | 27 ++++++++++++++++++++ drivers/staging/r8188eu/include/mlme_osdep.h | 1 - drivers/staging/r8188eu/os_dep/mlme_linux.c | 27 -------------------- 3 files changed, 27 insertions(+), 28 deletions(-)
drivers/staging/r8188eu/core/rtw_mlme.c +27 -0
@@ -1639,6 +1639,33 @@ static int rtw_append_pmkid(struct adapter *Adapter, int iEntry, u8 *ie, uint iereturn ie_len; } +static void rtw_report_sec_ie (struct adapter *adapter,u8 authmode,u8 *sec_ie) +{ +uint len; +u8 *buff, *p, i; +union iwreq_data wrqu; + + buff =NULL ; +if (authmode == _WPA_IE_ID_) { + buff =kzalloc (IW_CUSTOM_MAX ,GFP_ATOMIC ); +if (!buff) +return ; + p = buff; + p +=sprintf (p,"ASSOCINFO(ReqIEs =" ); + len = sec_ie[1 ] +2 ; + len = (len <IW_CUSTOM_MAX ) ? len :IW_CUSTOM_MAX ; +for (i =0 ; i < len; i++) + p +=sprintf (p,"%02x" , sec_ie[i]); + p +=sprintf (p,")" ); +memset (&wrqu,0 ,sizeof (wrqu)); + wrqu.data.length = p - buff; + wrqu.data.length = (wrqu.data.length <IW_CUSTOM_MAX ) ? + wrqu.data.length :IW_CUSTOM_MAX ; +wireless_send_event (adapter->pnetdev,IWEVCUSTOM , &wrqu, buff); +kfree (buff); + } +} +int rtw_restruct_sec_ie (struct adapter *adapter,u8 *in_ie,u8 *out_ie,uint in_len) {u8 authmode =0 ;
drivers/staging/r8188eu/include/mlme_osdep.h +0 -1
@@ -11,7 +11,6 @@ void rtw_init_mlme_timer(struct adapter *padapter);void rtw_os_indicate_disconnect (struct adapter *adapter);void rtw_os_indicate_connect (struct adapter *adapter);void rtw_os_indicate_scan_done (struct adapter *padapter,bool aborted); -void rtw_report_sec_ie (struct adapter *adapter,u8 authmode,u8 *sec_ie);void rtw_reset_securitypriv (struct adapter *adapter);void indicate_wx_scan_complete_event (struct adapter *padapter);
drivers/staging/r8188eu/os_dep/mlme_linux.c +0 -27
@@ -102,30 +102,3 @@ void rtw_os_indicate_disconnect(struct adapter *adapter)rtw_indicate_wx_disassoc_event (adapter);rtw_reset_securitypriv (adapter); } - -void rtw_report_sec_ie (struct adapter *adapter,u8 authmode,u8 *sec_ie) -{ -uint len; -u8 *buff, *p, i; -union iwreq_data wrqu; - - buff =NULL ; -if (authmode == _WPA_IE_ID_) { - buff =kzalloc (IW_CUSTOM_MAX ,GFP_ATOMIC ); -if (!buff) -return ; - p = buff; - p +=sprintf (p,"ASSOCINFO(ReqIEs =" ); - len = sec_ie[1 ] +2 ; - len = (len <IW_CUSTOM_MAX ) ? len :IW_CUSTOM_MAX ; -for (i =0 ; i < len; i++) - p +=sprintf (p,"%02x" , sec_ie[i]); - p +=sprintf (p,")" ); -memset (&wrqu,0 ,sizeof (wrqu)); - wrqu.data.length = p - buff; - wrqu.data.length = (wrqu.data.length <IW_CUSTOM_MAX ) ? - wrqu.data.length :IW_CUSTOM_MAX ; -wireless_send_event (adapter->pnetdev,IWEVCUSTOM , &wrqu, buff); -kfree (buff); - } -}
Signature · 1 line
2.37.1
PATCH 6/11 staging: r8188eu: remove unneeded initializations
In reply to Michael StraubeIn the function rtw_reset_securitypriv() three variables are initialized to zero. That is not necessary because they are all set before use in the code. Remove the initializations.
--- drivers/staging/r8188eu/os_dep/mlme_linux.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/r8188eu/os_dep/mlme_linux.c +3 -3
@@ -57,9 +57,9 @@ static struct rt_pmkid_list backup_pmkid[NUM_PMKID_CACHE];void rtw_reset_securitypriv (struct adapter *adapter) { -u8 backup_index =0 ; -u8 backup_counter =0x00 ; -u32 backup_time =0 ; +u8 backup_index; +u8 backup_counter; +u32 backup_time;if (adapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) {/* 802.1x */
Signature · 1 line
2.37.1
PATCH 7/11 staging: r8188eu: make rtw_reset_securitypriv() static
In reply to Michael StraubeThe function rtw_reset_securitypriv() is only used in rtw_mlme.c. Make rtw_reset_securitypriv() and its user rtw_os_indicate_disconnect() static to get one step closer to removing os_dep/mlme_linux.c.
--- drivers/staging/r8188eu/core/rtw_mlme.c | 51 ++++++++++++++++++++ drivers/staging/r8188eu/include/mlme_osdep.h | 2 - drivers/staging/r8188eu/os_dep/mlme_linux.c | 50 ------------------- 3 files changed, 51 insertions(+), 52 deletions(-)
drivers/staging/r8188eu/core/rtw_mlme.c +51 -0
@@ -795,6 +795,57 @@ void rtw_free_assoc_resources(struct adapter *adapter, int lock_scanned_queue) } +static struct rt_pmkid_list backup_pmkid[NUM_PMKID_CACHE ]; + +static void rtw_reset_securitypriv (struct adapter *adapter) +{ +u8 backup_index; +u8 backup_counter; +u32 backup_time; + +if (adapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) { +/* 802.1x */ +/* We have to backup the PMK information for WiFi PMK Caching test item. */ +/* Backup the btkip_countermeasure information. */ +/* When the countermeasure is trigger, the driver have to disconnect with AP for 60 seconds. */ +memcpy (&backup_pmkid[0 ], &adapter->securitypriv.PMKIDList[0 ],sizeof (struct rt_pmkid_list ) *NUM_PMKID_CACHE ); + backup_index = adapter->securitypriv.PMKIDIndex; + backup_counter = adapter->securitypriv.btkip_countermeasure; + backup_time = adapter->securitypriv.btkip_countermeasure_time; +memset ((unsigned char *)&adapter->securitypriv,0 ,sizeof (struct security_priv )); + +/* Restore the PMK information to securitypriv structure for the following connection. */ +memcpy (&adapter->securitypriv.PMKIDList[0 ], + &backup_pmkid[0 ], +sizeof (struct rt_pmkid_list ) *NUM_PMKID_CACHE ); + adapter->securitypriv.PMKIDIndex = backup_index; + adapter->securitypriv.btkip_countermeasure = backup_counter; + adapter->securitypriv.btkip_countermeasure_time = backup_time; + adapter->securitypriv.ndisauthtype = Ndis802_11AuthModeOpen; + adapter->securitypriv.ndisencryptstatus = Ndis802_11WEPDisabled; + }else { +/* reset values in securitypriv */ +struct security_priv *psec_priv = &adapter->securitypriv; + + psec_priv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open;/* open system */ + psec_priv->dot11PrivacyAlgrthm = _NO_PRIVACY_; + psec_priv->dot11PrivacyKeyIndex =0 ; + psec_priv->dot118021XGrpPrivacy = _NO_PRIVACY_; + psec_priv->dot118021XGrpKeyid =1 ; + psec_priv->ndisauthtype = Ndis802_11AuthModeOpen; + psec_priv->ndisencryptstatus = Ndis802_11WEPDisabled; + } +} + +static void rtw_os_indicate_disconnect (struct adapter *adapter) +{ +/* Do it first for tx broadcast pkt after disconnection issue! */ +netif_carrier_off (adapter->pnetdev); + +rtw_indicate_wx_disassoc_event (adapter); +rtw_reset_securitypriv (adapter); +} +/* *rtw_indicate_connect: the caller has to lock pmlmepriv->lock */
drivers/staging/r8188eu/include/mlme_osdep.h +0 -2
@@ -8,11 +8,9 @@#include "drv_types.h" void rtw_init_mlme_timer (struct adapter *padapter); -void rtw_os_indicate_disconnect (struct adapter *adapter);void rtw_os_indicate_connect (struct adapter *adapter);void rtw_os_indicate_scan_done (struct adapter *padapter,bool aborted); -void rtw_reset_securitypriv (struct adapter *adapter);void indicate_wx_scan_complete_event (struct adapter *padapter);#endif /* _MLME_OSDEP_H_ */
drivers/staging/r8188eu/os_dep/mlme_linux.c +0 -50
53 lines not on this page · raw message
Signature · 1 line
2.37.1
PATCH 8/11 staging: r8188eu: merge rtw_{os,}_indicate_disconnect()
In reply to Michael StraubeMerge rtw_os_indicate_disconnect() into rtw_indicate_disconnect(). The function rtw_os_indicate_disconnect() was moved from the os_dep directory. It looks like the driver was originaly written to support different operating systems. We do not need this wrapping into an extra _os_ function obviously.
--- drivers/staging/r8188eu/core/rtw_mlme.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-)
drivers/staging/r8188eu/core/rtw_mlme.c +5 -10
@@ -837,15 +837,6 @@ static void rtw_reset_securitypriv(struct adapter *adapter) } } -static void rtw_os_indicate_disconnect (struct adapter *adapter) -{ -/* Do it first for tx broadcast pkt after disconnection issue! */ -netif_carrier_off (adapter->pnetdev); - -rtw_indicate_wx_disassoc_event (adapter); -rtw_reset_securitypriv (adapter); -} -/* *rtw_indicate_connect: the caller has to lock pmlmepriv->lock */
@@ -882,7 +873,11 @@ void rtw_indicate_disconnect(struct adapter *padapter)if (check_fwstate (&padapter->mlmepriv, _FW_LINKED) || (pmlmepriv->to_roaming <=0 )) { -rtw_os_indicate_disconnect (padapter); +/* Do it first for tx broadcast pkt after disconnection issue! */ +netif_carrier_off (padapter->pnetdev); + +rtw_indicate_wx_disassoc_event (padapter); +rtw_reset_securitypriv (padapter);_clr_fwstate_ (pmlmepriv, _FW_LINKED);rtw_led_control (padapter,LED_CTL_NO_LINK );
Signature · 1 line
2.37.1
PATCH 9/11 staging: r8188eu: merge rtw_{os,}_indicate_connect()
In reply to Michael StraubeMerge rtw_os_indicate_connect() into rtw_indicate_connect(). It looks like the driver was originaly written to support different operating systems. We do not need this wrapping into an extra _os_ function obviously.
--- drivers/staging/r8188eu/core/rtw_mlme.c | 5 ++++- drivers/staging/r8188eu/include/mlme_osdep.h | 1 - drivers/staging/r8188eu/os_dep/mlme_linux.c | 10 ---------- 3 files changed, 4 insertions(+), 12 deletions(-)
drivers/staging/r8188eu/core/rtw_mlme.c +4 -1
@@ -851,7 +851,10 @@ void rtw_indicate_connect(struct adapter *padapter)rtw_led_control (padapter,LED_CTL_LINK ); -rtw_os_indicate_connect (padapter); +rtw_indicate_wx_assoc_event (padapter); +netif_carrier_on (padapter->pnetdev); +if (padapter->pid[2 ] !=0 ) +rtw_signal_process (padapter->pid[2 ],SIGALRM ); } pmlmepriv->to_roaming =0 ;
drivers/staging/r8188eu/include/mlme_osdep.h +0 -1
@@ -8,7 +8,6 @@#include "drv_types.h" void rtw_init_mlme_timer (struct adapter *padapter); -void rtw_os_indicate_connect (struct adapter *adapter);void rtw_os_indicate_scan_done (struct adapter *padapter,bool aborted);void indicate_wx_scan_complete_event (struct adapter *padapter);
drivers/staging/r8188eu/os_dep/mlme_linux.c +0 -10
@@ -38,16 +38,6 @@ void rtw_init_mlme_timer(struct adapter *padapter)timer_setup (&pmlmepriv->dynamic_chk_timer, _dynamic_check_timer_handlder,0 ); } -void rtw_os_indicate_connect (struct adapter *adapter) -{ - -rtw_indicate_wx_assoc_event (adapter); -netif_carrier_on (adapter->pnetdev); -if (adapter->pid[2 ] !=0 ) -rtw_signal_process (adapter->pid[2 ],SIGALRM ); - -} -void rtw_os_indicate_scan_done (struct adapter *padapter,bool aborted) {indicate_wx_scan_complete_event (padapter);
Signature · 1 line
2.37.1
PATCH 10/11 staging: r8188eu: merge rtw_{os,}_indicate_scan_done()
In reply to Michael StraubeMerge rtw_os_indicate_scan_done() into rtw_indicate_scan_done(). It looks like the driver was originaly written to support different operating systems. We do not need this wrapping into an extra _os_ function obviously.
--- drivers/staging/r8188eu/core/rtw_mlme.c | 2 +- drivers/staging/r8188eu/include/mlme_osdep.h | 1 - drivers/staging/r8188eu/os_dep/mlme_linux.c | 5 ----- 3 files changed, 1 insertion(+), 7 deletions(-)
drivers/staging/r8188eu/core/rtw_mlme.c +1 -1
@@ -894,7 +894,7 @@ void rtw_indicate_disconnect(struct adapter *padapter)inline void rtw_indicate_scan_done (struct adapter *padapter,bool aborted) { -rtw_os_indicate_scan_done (padapter, aborted); +indicate_wx_scan_complete_event (padapter); }static struct sta_info *rtw_joinbss_update_stainfo (struct adapter *padapter,struct wlan_network *pnetwork)
drivers/staging/r8188eu/include/mlme_osdep.h +0 -1
@@ -8,7 +8,6 @@#include "drv_types.h" void rtw_init_mlme_timer (struct adapter *padapter); -void rtw_os_indicate_scan_done (struct adapter *padapter,bool aborted);void indicate_wx_scan_complete_event (struct adapter *padapter);
drivers/staging/r8188eu/os_dep/mlme_linux.c +0 -5
@@ -37,8 +37,3 @@ void rtw_init_mlme_timer(struct adapter *padapter)timer_setup (&pmlmepriv->scan_to_timer, _rtw_scan_timeout_handler,0 );timer_setup (&pmlmepriv->dynamic_chk_timer, _dynamic_check_timer_handlder,0 ); } - -void rtw_os_indicate_scan_done (struct adapter *padapter,bool aborted) -{ -indicate_wx_scan_complete_event (padapter); -}
Signature · 1 line
2.37.1
PATCH 11/11 staging: r8188eu: remove unused function parameter
In reply to Michael StraubeThe parameter 'aborted' of rtw_indicate_scan_done() is not used. Remove it.
--- drivers/staging/r8188eu/core/rtw_mlme.c | 4 ++-- drivers/staging/r8188eu/include/rtw_mlme.h | 2 +- drivers/staging/r8188eu/os_dep/usb_intf.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/staging/r8188eu/core/rtw_mlme.c +2 -2
@@ -892,7 +892,7 @@ void rtw_indicate_disconnect(struct adapter *padapter) } -inline void rtw_indicate_scan_done (struct adapter *padapter,bool aborted) +inline void rtw_indicate_scan_done (struct adapter *padapter) {indicate_wx_scan_complete_event (padapter); }
@@ -1365,7 +1365,7 @@ void rtw_scan_timeout_handler (struct adapter *adapter)spin_lock_bh (&pmlmepriv->lock);_clr_fwstate_ (pmlmepriv, _FW_UNDER_SURVEY);spin_unlock_bh (&pmlmepriv->lock); -rtw_indicate_scan_done (adapter, true); +rtw_indicate_scan_done (adapter); }static void rtw_auto_scan_handler (struct adapter *padapter)
drivers/staging/r8188eu/include/rtw_mlme.h +1 -1
@@ -537,7 +537,7 @@ struct wlan_network *rtw_get_oldest_wlan_network(struct __queue *scanned_queue);void rtw_free_assoc_resources (struct adapter *adapter,int lock_scanned_queue);void rtw_indicate_disconnect (struct adapter *adapter);void rtw_indicate_connect (struct adapter *adapter); -void rtw_indicate_scan_done (struct adapter *padapter,bool aborted); +void rtw_indicate_scan_done (struct adapter *padapter);int rtw_restruct_sec_ie (struct adapter *adapter,u8 *in_ie,u8 *out_ie,uint in_len);
drivers/staging/r8188eu/os_dep/usb_intf.c +1 -1
@@ -231,7 +231,7 @@ static int rtw_suspend(struct usb_interface *pusb_intf, pm_message_t message)mutex_unlock (&pwrpriv->lock);if (check_fwstate (pmlmepriv, _FW_UNDER_SURVEY)) -rtw_indicate_scan_done (padapter,1 ); +rtw_indicate_scan_done (padapter);if (check_fwstate (pmlmepriv, _FW_UNDER_LINKING))rtw_indicate_disconnect (padapter);
Signature · 1 line
2.37.1
Quoted 19 lines · Michael Straube
This series starts to migrate the functions, or their functionalitiy, from
os_dep/mlme_linux.cto the core/* part of the driver. The goal is to removeos_dep/mlme_linux.cat some point.Tested on
x86_64with Inter-Tech DMG-02.Michael Straube (11):
staging: r8188eu: makeinit_mlme_ext_timer()static
staging: r8188eu: makeinit_addba_retry_timer()static
staging: r8188eu: makertw_indicate_sta_disassoc_event()static
staging: r8188eu: movertw_indicate_sta_assoc_event()tortw_ap.c
staging: r8188eu: makertw_report_sec_ie()static
staging: r8188eu: remove unneeded initializations
staging: r8188eu: makertw_reset_securitypriv()static
staging: r8188eu: merge rtw_{os,}_indicate_disconnect()
staging: r8188eu: merge rtw_{os,}_indicate_connect()
staging: r8188eu: merge rtw_{os,}_indicate_scan_done()
staging: r8188eu: remove unused function parameter
Quoted 12 lines
drivers/staging/r8188eu/core/rtw_ap.c | 42 +++++ drivers/staging/r8188eu/core/rtw_mlme.c | 86 ++++++++- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 22 +++ drivers/staging/r8188eu/core/rtw_sta_mgt.c | 12 ++ drivers/staging/r8188eu/include/mlme_osdep.h | 5 - drivers/staging/r8188eu/include/rtw_ap.h | 2 - drivers/staging/r8188eu/include/rtw_mlme.h | 2 +- .../staging/r8188eu/include/rtw_mlme_ext.h | 2 - drivers/staging/r8188eu/os_dep/mlme_linux.c | 166 ------------------ drivers/staging/r8188eu/os_dep/usb_intf.c | 2 +- 10 files changed, 159 insertions(+), 182 deletions(-)