提交 04fad92a 编写于 作者: J Jes Sorensen 提交者: Greg Kroah-Hartman

staging: rtl8723au: clean up update_TSF()

Clean up and simplify update_TSF() using proper Linux functions and
move it to rtw_mlme_ext.c which is the only user of it.
Signed-off-by: NJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 9af36808
...@@ -249,6 +249,12 @@ static struct fwevent wlanevents[] = ...@@ -249,6 +249,12 @@ static struct fwevent wlanevents[] =
}; };
static void
rtw_update_TSF(struct mlme_ext_priv *pmlmeext, struct ieee80211_mgmt *mgmt)
{
pmlmeext->TSFValue = get_unaligned_le64(&mgmt->u.beacon.timestamp);
}
/* /*
* Search the @param channel_num in given @param channel_set * Search the @param channel_num in given @param channel_set
* @ch_set: the given channel set * @ch_set: the given channel set
...@@ -785,7 +791,7 @@ OnBeacon23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) ...@@ -785,7 +791,7 @@ OnBeacon23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame)
offsetof(struct ieee80211_mgmt, u)); offsetof(struct ieee80211_mgmt, u));
/* update TSF Value */ /* update TSF Value */
update_TSF23a(pmlmeext, pframe, pkt_len); rtw_update_TSF(pmlmeext, mgmt);
/* start auth */ /* start auth */
start_clnt_auth23a(padapter); start_clnt_auth23a(padapter);
...@@ -838,7 +844,7 @@ OnBeacon23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) ...@@ -838,7 +844,7 @@ OnBeacon23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame)
} }
/* update TSF Value */ /* update TSF Value */
update_TSF23a(pmlmeext, pframe, pkt_len); rtw_update_TSF(pmlmeext, mgmt);
/* report sta add event */ /* report sta add event */
report_add_sta_event23a(padapter, mgmt->sa, report_add_sta_event23a(padapter, mgmt->sa,
...@@ -5492,9 +5498,6 @@ void mlmeext_sta_add_event_callback23a(struct rtw_adapter *padapter, struct sta_ ...@@ -5492,9 +5498,6 @@ void mlmeext_sta_add_event_callback23a(struct rtw_adapter *padapter, struct sta_
} }
else/* adhoc client */ else/* adhoc client */
{ {
/* update TSF Value */
/* update_TSF23a(pmlmeext, pframe, len); */
/* correcting TSF */ /* correcting TSF */
correct_TSF23a(padapter, pmlmeext); correct_TSF23a(padapter, pmlmeext);
......
...@@ -1643,21 +1643,6 @@ void process_addba_req23a(struct rtw_adapter *padapter, u8 *paddba_req, u8 *addr ...@@ -1643,21 +1643,6 @@ void process_addba_req23a(struct rtw_adapter *padapter, u8 *paddba_req, u8 *addr
} }
} }
void update_TSF23a(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len)
{
u8 *pIE;
u32 *pbuf;
pIE = pframe + sizeof(struct ieee80211_hdr_3addr);
pbuf = (u32 *)pIE;
pmlmeext->TSFValue = le32_to_cpu(*(pbuf+1));
pmlmeext->TSFValue = pmlmeext->TSFValue << 32;
pmlmeext->TSFValue |= le32_to_cpu(*pbuf);
}
void correct_TSF23a(struct rtw_adapter *padapter, void correct_TSF23a(struct rtw_adapter *padapter,
struct mlme_ext_priv *pmlmeext) struct mlme_ext_priv *pmlmeext)
{ {
......
...@@ -635,7 +635,6 @@ int cckratesonly_included23a(unsigned char *rate, int ratelen); ...@@ -635,7 +635,6 @@ int cckratesonly_included23a(unsigned char *rate, int ratelen);
void process_addba_req23a(struct rtw_adapter *padapter, u8 *paddba_req, u8 *addr); void process_addba_req23a(struct rtw_adapter *padapter, u8 *paddba_req, u8 *addr);
void update_TSF23a(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len);
void correct_TSF23a(struct rtw_adapter *padapter, struct mlme_ext_priv *pmlmeext); void correct_TSF23a(struct rtw_adapter *padapter, struct mlme_ext_priv *pmlmeext);
struct cmd_hdl { struct cmd_hdl {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册