Commit 0b465150 authored by Michael Straube's avatar Michael Straube Committed by Greg Kroah-Hartman
Browse files

staging: r8188eu: remove HAL_DEF_IS_SUPPORT_ANT_DIV



In order to get rid of the function GetHalDefVar8188EUsb(), remove
the HAL_DEF_IS_SUPPORT_ANT_DIV case from it and move the functionality
into a new function. This is part of the ongoing effort to get rid of
the unwanted hal layer.

Signed-off-by: default avatarMichael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20220405104910.9769-3-straube.linux@gmail.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a290d640
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -1094,16 +1094,21 @@ static void antenna_select_wk_hdl(struct adapter *padapter, u8 antenna)
	}
}

static bool rtw_antenna_diversity(struct adapter *adapter)
{
	struct hal_data_8188e *haldata = &adapter->haldata;

	return haldata->AntDivCfg != 0;
}

u8 rtw_antenna_select_cmd(struct adapter *padapter, u8 antenna, u8 enqueue)
{
	struct cmd_obj		*ph2c;
	struct drvextra_cmd_parm	*pdrvextra_cmd_parm;
	struct cmd_priv	*pcmdpriv = &padapter->cmdpriv;
	u8	support_ant_div;
	u8	res = _SUCCESS;

	GetHalDefVar8188EUsb(padapter, HAL_DEF_IS_SUPPORT_ANT_DIV, &support_ant_div);
	if (!support_ant_div)
	if (!rtw_antenna_diversity(padapter))
		return res;

	if (enqueue) {
+0 −3
Original line number Diff line number Diff line
@@ -1200,9 +1200,6 @@ void GetHalDefVar8188EUsb(struct adapter *Adapter, enum hal_def_variable eVariab
	struct hal_data_8188e *haldata = &Adapter->haldata;

	switch (eVariable) {
	case HAL_DEF_IS_SUPPORT_ANT_DIV:
		*((u8 *)pValue) = (haldata->AntDivCfg == 0) ? false : true;
		break;
	case HAL_DEF_CURRENT_ANTENNA:
		*((u8 *)pValue) = haldata->CurAntenna;
		break;
+0 −1
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@ enum hw_variables {
};

enum hal_def_variable {
	HAL_DEF_IS_SUPPORT_ANT_DIV,
	HAL_DEF_CURRENT_ANTENNA,
	HAL_DEF_DBG_DM_FUNC,/* for dbg */
};