Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0348dc74 authored by Jes Sorensen's avatar Jes Sorensen Committed by Greg Kroah-Hartman
Browse files

staging: rtl8723au: Preserve const attribute of cmd handler argument

parent b25b7b32
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -1446,7 +1446,7 @@ static void c2h_wk_callback(struct work_struct *work)

u8 rtw_drvextra_cmd_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
{
	struct drvextra_cmd_parm *pdrvextra_cmd;
	const struct drvextra_cmd_parm *pdrvextra_cmd;

	if (!pbuf)
		return H2C_PARAMETERS_ERROR;
@@ -1482,7 +1482,11 @@ u8 rtw_drvextra_cmd_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)

	if (pdrvextra_cmd->pbuf && (pdrvextra_cmd->type_size > 0)) {
		kfree(pdrvextra_cmd->pbuf);
		pdrvextra_cmd->pbuf = NULL;
		/*
		 * No need to set pdrvextra_cmd->pbuf = NULL as we were
		 * operating on a copy of the original pcmd->parmbuf
		 * created in rtw_cmd_work().
		 */
	}

	return H2C_SUCCESS;
+18 −15
Original line number Diff line number Diff line
@@ -3959,7 +3959,8 @@ void issue_action_spct_ch_switch23a(struct rtw_adapter *padapter,
	dump_mgntframe23a(padapter, pmgntframe);
}

void issue_action_BA23a(struct rtw_adapter *padapter, unsigned char *raddr,
void issue_action_BA23a(struct rtw_adapter *padapter,
			const unsigned char *raddr,
			unsigned char action, unsigned short status)
{
	u8 category = WLAN_CATEGORY_BACK;
@@ -5844,7 +5845,7 @@ u8 setopmode_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
	u8	type;
	struct mlme_ext_priv	*pmlmeext = &padapter->mlmeextpriv;
	struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
	struct setopmode_parm *psetop = (struct setopmode_parm *)pbuf;
	const struct setopmode_parm *psetop = (struct setopmode_parm *)pbuf;

	if (psetop->mode == Ndis802_11APMode) {
		pmlmeinfo->state = WIFI_FW_AP_STATE;
@@ -5869,7 +5870,7 @@ u8 createbss_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
	struct mlme_ext_priv	*pmlmeext = &padapter->mlmeextpriv;
	struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
	struct wlan_bssid_ex *pnetwork = &pmlmeinfo->network;
	struct wlan_bssid_ex *pparm = (struct wlan_bssid_ex *)pbuf;
	const struct wlan_bssid_ex *pparm = (struct wlan_bssid_ex *)pbuf;
	/* u32	initialgain; */

	if (pparm->InfrastructureMode == Ndis802_11APMode) {
@@ -5927,7 +5928,7 @@ u8 join_cmd_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
	struct mlme_ext_priv	*pmlmeext = &padapter->mlmeextpriv;
	struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
	struct wlan_bssid_ex *pnetwork = &pmlmeinfo->network;
	struct wlan_bssid_ex *pparm = (struct wlan_bssid_ex *)pbuf;
	const struct wlan_bssid_ex *pparm = (struct wlan_bssid_ex *)pbuf;
	struct HT_info_element *pht_info;
	u32 i;
        /* u32	initialgain; */
@@ -6045,7 +6046,7 @@ u8 join_cmd_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)

u8 disconnect_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
{
	struct disconnect_parm *param = (struct disconnect_parm *)pbuf;
	const struct disconnect_parm *param = (struct disconnect_parm *)pbuf;
	struct mlme_ext_priv	*pmlmeext = &padapter->mlmeextpriv;
	struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
	struct wlan_bssid_ex *pnetwork = &pmlmeinfo->network;
@@ -6089,8 +6090,10 @@ u8 disconnect_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
	return	H2C_SUCCESS;
}

static int rtw_scan_ch_decision(struct rtw_adapter *padapter, struct rtw_ieee80211_channel *out,
	u32 out_num, struct rtw_ieee80211_channel *in, u32 in_num)
static int
rtw_scan_ch_decision(struct rtw_adapter *padapter,
		     struct rtw_ieee80211_channel *out, u32 out_num,
		     const struct rtw_ieee80211_channel *in, u32 in_num)
{
	int i, j;
	int scan_ch_num = 0;
@@ -6157,7 +6160,7 @@ static int rtw_scan_ch_decision(struct rtw_adapter *padapter, struct rtw_ieee802
u8 sitesurvey_cmd_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
{
	struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
	struct sitesurvey_parm *pparm = (struct sitesurvey_parm *)pbuf;
	const struct sitesurvey_parm *pparm = (struct sitesurvey_parm *)pbuf;
	u8 bdelayscan = false;
	u32 initialgain;
	u32 i;
@@ -6238,7 +6241,7 @@ u8 sitesurvey_cmd_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)

u8 setauth_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
{
	struct setauth_parm		*pparm = (struct setauth_parm *)pbuf;
	const struct setauth_parm *pparm = (struct setauth_parm *)pbuf;
	struct mlme_ext_priv	*pmlmeext = &padapter->mlmeextpriv;
	struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;

@@ -6253,7 +6256,7 @@ u8 setauth_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
u8 setkey_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
{
	unsigned short				ctrl;
	struct setkey_parm		*pparm = (struct setkey_parm *)pbuf;
	const struct setkey_parm *pparm = (struct setkey_parm *)pbuf;
	struct mlme_ext_priv	*pmlmeext = &padapter->mlmeextpriv;
	struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
	unsigned char					null_sta[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
@@ -6281,7 +6284,7 @@ u8 set_stakey_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
	u8 cam_id;/* cam_entry */
	struct mlme_ext_priv	*pmlmeext = &padapter->mlmeextpriv;
	struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
	struct set_stakey_parm	*pparm = (struct set_stakey_parm *)pbuf;
	const struct set_stakey_parm *pparm = (struct set_stakey_parm *)pbuf;

	/* cam_entry: */
	/* 0~3 for default key */
@@ -6364,7 +6367,7 @@ u8 set_stakey_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)

u8 add_ba_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
{
	struct addBaReq_parm	*pparm = (struct addBaReq_parm *)pbuf;
	const struct addBaReq_parm *pparm = (struct addBaReq_parm *)pbuf;
	struct mlme_ext_priv	*pmlmeext = &padapter->mlmeextpriv;
	struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;

@@ -6436,7 +6439,7 @@ u8 mlme_evt_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
{
	u8 evt_code, evt_seq;
	u16 evt_sz;
	uint	*peventbuf;
	const uint *peventbuf;
	void (*event_callback)(struct rtw_adapter *dev, u8 *pbuf);
	struct evt_priv *pevt_priv = &padapter->evtpriv;

@@ -6544,7 +6547,7 @@ u8 tx_beacon_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)

u8 set_ch_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
{
	struct set_ch_parm *set_ch_parm;
	const struct set_ch_parm *set_ch_parm;
	struct mlme_ext_priv	*pmlmeext = &padapter->mlmeextpriv;

	if (!pbuf)
@@ -6567,7 +6570,7 @@ u8 set_ch_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)

u8 set_chplan_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
{
	struct SetChannelPlan_param *setChannelPlan_param;
	const struct SetChannelPlan_param *setChannelPlan_param;
	struct mlme_ext_priv	*pmlmeext = &padapter->mlmeextpriv;

	if (!pbuf)
+2 −2
Original line number Diff line number Diff line
@@ -405,12 +405,12 @@ void rtw_free_all_stainfo23a(struct rtw_adapter *padapter)
}

/* any station allocated can be searched by hash list */
struct sta_info *rtw_get_stainfo23a(struct sta_priv *pstapriv, u8 *hwaddr)
struct sta_info *rtw_get_stainfo23a(struct sta_priv *pstapriv, const u8 *hwaddr)
{
	struct list_head *plist, *phead;
	struct sta_info *psta = NULL;
	u32	index;
	u8 *addr;
	const u8 *addr;
	u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};

	if (hwaddr == NULL)
+1 −1
Original line number Diff line number Diff line
@@ -686,7 +686,7 @@ void rtl8723a_cam_invalid_all(struct rtw_adapter *padapter)
}

void rtl8723a_cam_write(struct rtw_adapter *padapter,
			u8 entry, u16 ctrl, u8 *mac, u8 *key)
			u8 entry, u16 ctrl, const u8 *mac, const u8 *key)
{
	u32 cmd;
	unsigned int i, val, addr;
+1 −1
Original line number Diff line number Diff line
@@ -184,7 +184,7 @@ void rtl8723a_set_sec_cfg(struct rtw_adapter *padapter, u8 sec);
void rtl8723a_cam_empty_entry(struct rtw_adapter *padapter, u8 ucIndex);
void rtl8723a_cam_invalid_all(struct rtw_adapter *padapter);
void rtl8723a_cam_write(struct rtw_adapter *padapter,
			u8 entry, u16 ctrl, u8 *mac, u8 *key);
			u8 entry, u16 ctrl, const u8 *mac, const u8 *key);
void rtl8723a_fifo_cleanup(struct rtw_adapter *padapter);
void rtl8723a_set_apfm_on_mac(struct rtw_adapter *padapter, u8 val);
void rtl8723a_bcn_valid(struct rtw_adapter *padapter);
Loading