From: Jes Sorensen Date: Fri, 9 May 2014 13:03:19 +0000 (+0200) Subject: staging: rtl8723au: Make event callbacks take a const u8 * X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e2601960e9d5119f20fb3f5dca562378502ed7e6;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git staging: rtl8723au: Make event callbacks take a const u8 * This avoids an ugly cast in mlme_evt_hdl23a() Signed-off-by: Jes Sorensen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8723au/core/rtw_mlme.c b/drivers/staging/rtl8723au/core/rtw_mlme.c index d39f879790bb..f02b314d25e0 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme.c @@ -626,14 +626,14 @@ static int rtw_is_desired_network(struct rtw_adapter *adapter, } /* TODO: Perry : For Power Management */ -void rtw_atimdone_event_callback23a(struct rtw_adapter *adapter, u8 *pbuf) +void rtw_atimdone_event_callback23a(struct rtw_adapter *adapter, const u8 *pbuf) { RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("receive atimdone_evet\n")); return; } -void rtw_survey_event_cb23a(struct rtw_adapter *adapter, u8 *pbuf) +void rtw_survey_event_cb23a(struct rtw_adapter *adapter, const u8 *pbuf) { u32 len; struct wlan_bssid_ex *pnetwork; @@ -693,7 +693,8 @@ exit: return; } -void rtw_surveydone_event_callback23a(struct rtw_adapter *adapter, u8 *pbuf) +void +rtw_surveydone_event_callback23a(struct rtw_adapter *adapter, const u8 *pbuf) { struct mlme_priv *pmlmepriv = &adapter->mlmepriv; struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv; @@ -814,11 +815,11 @@ void rtw_surveydone_event_callback23a(struct rtw_adapter *adapter, u8 *pbuf) rtw_cfg80211_surveydone_event_callback(adapter); } -void rtw_dummy_event_callback23a(struct rtw_adapter *adapter , u8 *pbuf) +void rtw_dummy_event_callback23a(struct rtw_adapter *adapter, const u8 *pbuf) { } -void rtw23a_fwdbg_event_callback(struct rtw_adapter *adapter , u8 *pbuf) +void rtw23a_fwdbg_event_callback(struct rtw_adapter *adapter, const u8 *pbuf) { } @@ -1335,7 +1336,7 @@ ignore_joinbss_callback: spin_unlock_bh(&pmlmepriv->lock); } -void rtw23a_joinbss_event_cb(struct rtw_adapter *adapter, u8 *pbuf) +void rtw23a_joinbss_event_cb(struct rtw_adapter *adapter, const u8 *pbuf) { struct wlan_network *pnetwork = (struct wlan_network *)pbuf; @@ -1344,7 +1345,7 @@ void rtw23a_joinbss_event_cb(struct rtw_adapter *adapter, u8 *pbuf) rtw_os_xmit_schedule23a(adapter); } -void rtw_stassoc_event_callback23a(struct rtw_adapter *adapter, u8 *pbuf) +void rtw_stassoc_event_callback23a(struct rtw_adapter *adapter, const u8 *pbuf) { struct sta_info *psta; struct mlme_priv *pmlmepriv = &adapter->mlmepriv; @@ -1422,7 +1423,7 @@ void rtw_stassoc_event_callback23a(struct rtw_adapter *adapter, u8 *pbuf) mlmeext_sta_add_event_callback23a(adapter, psta); } -void rtw_stadel_event_callback23a(struct rtw_adapter *adapter, u8 *pbuf) +void rtw_stadel_event_callback23a(struct rtw_adapter *adapter, const u8 *pbuf) { int mac_id; struct sta_info *psta; @@ -1531,7 +1532,7 @@ void rtw_stadel_event_callback23a(struct rtw_adapter *adapter, u8 *pbuf) spin_unlock_bh(&pmlmepriv->lock); } -void rtw_cpwm_event_callback23a(struct rtw_adapter *padapter, u8 *pbuf) +void rtw_cpwm_event_callback23a(struct rtw_adapter *padapter, const u8 *pbuf) { RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("+rtw_cpwm_event_callback23a !!!\n")); diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c index 0372820538fd..3a0a4229e5ed 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c @@ -6417,7 +6417,7 @@ u8 mlme_evt_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf) u8 evt_code, evt_seq; u16 evt_sz; const struct C2HEvent_Header *c2h; - void (*event_callback)(struct rtw_adapter *dev, u8 *pbuf); + void (*event_callback)(struct rtw_adapter *dev, const u8 *pbuf); c2h = (struct C2HEvent_Header *)pbuf; evt_sz = c2h->len; @@ -6439,7 +6439,7 @@ u8 mlme_evt_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf) } event_callback = wlanevents[evt_code].event_callback; - event_callback(padapter, (u8 *)pbuf + sizeof(struct C2HEvent_Header)); + event_callback(padapter, pbuf + sizeof(struct C2HEvent_Header)); _abort_event_: diff --git a/drivers/staging/rtl8723au/include/rtw_event.h b/drivers/staging/rtl8723au/include/rtw_event.h index bb20640e6855..3520d383a8ef 100644 --- a/drivers/staging/rtl8723au/include/rtw_event.h +++ b/drivers/staging/rtl8723au/include/rtw_event.h @@ -81,7 +81,7 @@ struct addba_event struct fwevent { u32 parmsize; - void (*event_callback)(struct rtw_adapter *dev, u8 *pbuf); + void (*event_callback)(struct rtw_adapter *dev, const u8 *pbuf); }; diff --git a/drivers/staging/rtl8723au/include/rtw_mlme.h b/drivers/staging/rtl8723au/include/rtw_mlme.h index 38203f16aee8..50a2f9009526 100644 --- a/drivers/staging/rtl8723au/include/rtw_mlme.h +++ b/drivers/staging/rtl8723au/include/rtw_mlme.h @@ -333,13 +333,13 @@ void hostapd_mode_unload(struct rtw_adapter *padapter); #endif void rtw_joinbss_event_prehandle23a(struct rtw_adapter *adapter, u8 *pbuf); -void rtw_survey_event_cb23a(struct rtw_adapter *adapter, u8 *pbuf); -void rtw_surveydone_event_callback23a(struct rtw_adapter *adapter, u8 *pbuf); -void rtw23a_joinbss_event_cb(struct rtw_adapter *adapter, u8 *pbuf); -void rtw_stassoc_event_callback23a(struct rtw_adapter *adapter, u8 *pbuf); -void rtw_stadel_event_callback23a(struct rtw_adapter *adapter, u8 *pbuf); -void rtw_atimdone_event_callback23a(struct rtw_adapter *adapter, u8 *pbuf); -void rtw_cpwm_event_callback23a(struct rtw_adapter *adapter, u8 *pbuf); +void rtw_survey_event_cb23a(struct rtw_adapter *adapter, const u8 *pbuf); +void rtw_surveydone_event_callback23a(struct rtw_adapter *adapter, const u8 *pbuf); +void rtw23a_joinbss_event_cb(struct rtw_adapter *adapter, const u8 *pbuf); +void rtw_stassoc_event_callback23a(struct rtw_adapter *adapter, const u8 *pbuf); +void rtw_stadel_event_callback23a(struct rtw_adapter *adapter, const u8 *pbuf); +void rtw_atimdone_event_callback23a(struct rtw_adapter *adapter, const u8 *pbuf); +void rtw_cpwm_event_callback23a(struct rtw_adapter *adapter, const u8 *pbuf); int event_thread(void *context); diff --git a/drivers/staging/rtl8723au/include/rtw_mlme_ext.h b/drivers/staging/rtl8723au/include/rtw_mlme_ext.h index 26d360178eac..6a4aa2b11808 100644 --- a/drivers/staging/rtl8723au/include/rtw_mlme_ext.h +++ b/drivers/staging/rtl8723au/include/rtw_mlme_ext.h @@ -699,8 +699,8 @@ struct C2HEvent_Header { unsigned int rsvd; }; -void rtw_dummy_event_callback23a(struct rtw_adapter *adapter , u8 *pbuf); -void rtw23a_fwdbg_event_callback(struct rtw_adapter *adapter , u8 *pbuf); +void rtw_dummy_event_callback23a(struct rtw_adapter *adapter, const u8 *pbuf); +void rtw23a_fwdbg_event_callback(struct rtw_adapter *adapter, const u8 *pbuf); enum rtw_c2h_event { GEN_EVT_CODE(_Read_MACREG) = 0, /*0*/