mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2024-11-22 04:23:39 +00:00
rtl8188eu: Fix checkpatch errors in core/rtw_mp.c
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
1212be3220
commit
7b5b86f621
1 changed files with 191 additions and 221 deletions
|
@ -61,7 +61,6 @@ void write_macreg(struct adapter *padapter, u32 addr, u32 val, u32 sz)
|
|||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
u32 read_bbreg(struct adapter *padapter, u32 addr, u32 bitmask)
|
||||
|
@ -137,7 +136,8 @@ static int init_mp_priv_by_os(struct mp_priv *pmp_priv)
|
|||
int i, res;
|
||||
struct mp_xmit_frame *pmp_xmitframe;
|
||||
|
||||
if (pmp_priv == NULL) return _FAIL;
|
||||
if (pmp_priv == NULL)
|
||||
return _FAIL;
|
||||
|
||||
_rtw_init_queue(&pmp_priv->free_mp_xmitqueue);
|
||||
|
||||
|
@ -152,8 +152,7 @@ static int init_mp_priv_by_os(struct mp_priv *pmp_priv)
|
|||
|
||||
pmp_xmitframe = (struct mp_xmit_frame *)pmp_priv->pmp_xmtframe_buf;
|
||||
|
||||
for (i = 0; i < NR_MP_XMITFRAME; i++)
|
||||
{
|
||||
for (i = 0; i < NR_MP_XMITFRAME; i++) {
|
||||
_rtw_init_listhead(&pmp_xmitframe->list);
|
||||
rtw_list_insert_tail(&pmp_xmitframe->list, &pmp_priv->free_mp_xmitqueue.queue);
|
||||
|
||||
|
@ -244,23 +243,15 @@ void free_mp_priv(struct mp_priv *pmp_priv)
|
|||
#define PHY_LCCalibrate(a) PHY_LCCalibrate_8188E(a)
|
||||
#define PHY_SetRFPathSwitch(a, b) PHY_SetRFPathSwitch_8188E(a, b)
|
||||
|
||||
s32
|
||||
MPT_InitializeAdapter(
|
||||
struct adapter * pAdapter,
|
||||
u8 Channel
|
||||
)
|
||||
s32 MPT_InitializeAdapter(struct adapter *pAdapter, u8 Channel)
|
||||
{
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(pAdapter);
|
||||
s32 rtStatus = _SUCCESS;
|
||||
struct mpt_context *pMptCtx = &pAdapter->mppriv.MptCtx;
|
||||
struct mlme_priv *pmlmepriv = &pAdapter->mlmepriv;
|
||||
|
||||
/* */
|
||||
/* HW Initialization for 8190 MPT. */
|
||||
/* */
|
||||
/* */
|
||||
/* SW Initialization for 8190 MP. */
|
||||
/* */
|
||||
pMptCtx->bMptDrvUnload = false;
|
||||
pMptCtx->bMassProdTest = false;
|
||||
pMptCtx->bMptIndexEven = true; /* default gain index is -6.0db */
|
||||
|
@ -312,10 +303,7 @@ MPT_InitializeAdapter(
|
|||
* 05/18/2007 MHC Add normal driver MPHalt code.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
void
|
||||
MPT_DeInitAdapter(
|
||||
struct adapter * pAdapter
|
||||
)
|
||||
void MPT_DeInitAdapter(struct adapter *pAdapter)
|
||||
{
|
||||
struct mpt_context *pMptCtx = &pAdapter->mppriv.MptCtx;
|
||||
|
||||
|
@ -342,7 +330,6 @@ static u8 mpt_ProStartTest(struct adapter * padapter)
|
|||
*/
|
||||
s32 SetPowerTracking(struct adapter *padapter, u8 enable)
|
||||
{
|
||||
|
||||
Hal_SetPowerTracking(padapter, enable);
|
||||
return 0;
|
||||
}
|
||||
|
@ -399,7 +386,6 @@ s32 mp_start_test(struct adapter * padapter)
|
|||
/* 3 0. update mp_priv */
|
||||
|
||||
if (padapter->registrypriv.rf_config == RF_819X_MAX_TYPE) {
|
||||
/* switch (phal->rf_type) { */
|
||||
switch (GET_RF_TYPE(padapter)) {
|
||||
case RF_1T1R:
|
||||
pmppriv->antenna_tx = ANTENNA_A;
|
||||
|
@ -458,7 +444,8 @@ s32 mp_start_test(struct adapter * padapter)
|
|||
/* 3 2. create a new psta for mp driver */
|
||||
/* clear psta in the cur_network, if any */
|
||||
psta = rtw_get_stainfo(&padapter->stapriv, tgt_network->network.MacAddress);
|
||||
if (psta) rtw_free_stainfo(padapter, psta);
|
||||
if (psta)
|
||||
rtw_free_stainfo(padapter, psta);
|
||||
|
||||
psta = rtw_alloc_stainfo(&padapter->stapriv, bssid.MacAddress);
|
||||
if (psta == NULL) {
|
||||
|
@ -470,7 +457,8 @@ s32 mp_start_test(struct adapter * padapter)
|
|||
|
||||
/* 3 3. join psudo AdHoc */
|
||||
tgt_network->join_res = 1;
|
||||
tgt_network->aid = psta->aid = 1;
|
||||
tgt_network->aid = 1;
|
||||
psta->aid = 1;
|
||||
_rtw_memcpy(&tgt_network->network, &bssid, length);
|
||||
|
||||
rtw_indicate_connect(padapter);
|
||||
|
@ -480,8 +468,7 @@ end_of_mp_start_test:
|
|||
|
||||
_exit_critical_bh(&pmlmepriv->lock, &irqL);
|
||||
|
||||
if (res == _SUCCESS)
|
||||
{
|
||||
if (res == _SUCCESS) {
|
||||
/* set MSR to WIFI_FW_ADHOC_STATE */
|
||||
val8 = rtw_read8(padapter, MSR) & 0xFC; /* 0x0102 */
|
||||
val8 |= WIFI_FW_ADHOC_STATE;
|
||||
|
@ -500,8 +487,7 @@ void mp_stop_test(struct adapter * padapter)
|
|||
|
||||
unsigned long irqL;
|
||||
|
||||
if (pmppriv->mode==MP_ON)
|
||||
{
|
||||
if (pmppriv->mode == MP_ON) {
|
||||
pmppriv->bSetTxPower = 0;
|
||||
_enter_critical_bh(&pmlmepriv->lock, &irqL);
|
||||
if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == false)
|
||||
|
@ -511,9 +497,9 @@ void mp_stop_test(struct adapter * padapter)
|
|||
rtw_indicate_disconnect(padapter);
|
||||
|
||||
/* 3 2. clear psta used in mp test mode. */
|
||||
/* rtw_free_assoc_resources(padapter, 1); */
|
||||
psta = rtw_get_stainfo(&padapter->stapriv, tgt_network->network.MacAddress);
|
||||
if (psta) rtw_free_stainfo(padapter, psta);
|
||||
if (psta)
|
||||
rtw_free_stainfo(padapter, psta);
|
||||
|
||||
/* 3 3. return to normal state (default:station mode) */
|
||||
pmlmepriv->fw_state = pmppriv->prev_fw_state; /* WIFI_STATION_STATE; */
|
||||
|
@ -574,7 +560,6 @@ static void MPT_CCKTxPowerAdjustbyIndex(struct adapter * pAdapter, bool beven)
|
|||
void SetChannel(struct adapter *pAdapter)
|
||||
{
|
||||
Hal_SetChannel(pAdapter);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -584,7 +569,6 @@ void SetChannel(struct adapter * pAdapter)
|
|||
void SetBandwidth(struct adapter *pAdapter)
|
||||
{
|
||||
Hal_SetBandwidth(pAdapter);
|
||||
|
||||
}
|
||||
|
||||
static void SetCCKTxPower(struct adapter *pAdapter, u8 *TxPower)
|
||||
|
@ -633,9 +617,7 @@ void SetDataRate(struct adapter * pAdapter)
|
|||
|
||||
void MP_PHY_SetRFPathSwitch(struct adapter *pAdapter , bool bMain)
|
||||
{
|
||||
|
||||
PHY_SetRFPathSwitch(pAdapter, bMain);
|
||||
|
||||
}
|
||||
|
||||
s32 SetThermalMeter(struct adapter *pAdapter, u8 target_ther)
|
||||
|
@ -714,13 +696,12 @@ static struct xmit_frame *alloc_mp_xmitframe(struct xmit_priv *pxmitpriv)
|
|||
struct xmit_frame *pmpframe;
|
||||
struct xmit_buf *pxmitbuf;
|
||||
|
||||
if ((pmpframe = rtw_alloc_xmitframe(pxmitpriv)) == NULL)
|
||||
{
|
||||
pmpframe = rtw_alloc_xmitframe(pxmitpriv);
|
||||
if (pmpframe == NULL)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if ((pxmitbuf = rtw_alloc_xmitbuf(pxmitpriv)) == NULL)
|
||||
{
|
||||
pxmitbuf = rtw_alloc_xmitbuf(pxmitpriv);
|
||||
if (pxmitbuf == NULL) {
|
||||
rtw_free_xmitframe(pxmitpriv, pmpframe);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -734,7 +715,6 @@ static struct xmit_frame *alloc_mp_xmitframe(struct xmit_priv *pxmitpriv)
|
|||
pxmitbuf->priv_data = pmpframe;
|
||||
|
||||
return pmpframe;
|
||||
|
||||
}
|
||||
|
||||
static int mp_xmit_packet_thread(void *context)
|
||||
|
@ -760,8 +740,7 @@ static int mp_xmit_packet_thread(void *context)
|
|||
padapter->bSurpriseRemoved ||
|
||||
padapter->bDriverStopped) {
|
||||
goto exit;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
rtw_msleep_os(1);
|
||||
continue;
|
||||
}
|
||||
|
@ -814,7 +793,8 @@ void SetPacketTx(struct adapter * padapter)
|
|||
|
||||
|
||||
pmp_priv = &padapter->mppriv;
|
||||
if (pmp_priv->tx.stop) return;
|
||||
if (pmp_priv->tx.stop)
|
||||
return;
|
||||
pmp_priv->tx.sended = 0;
|
||||
pmp_priv->tx.stop = 0;
|
||||
pmp_priv->tx_pktcount = 0;
|
||||
|
@ -860,7 +840,8 @@ void SetPacketTx(struct adapter * padapter)
|
|||
desc->txdw0 |= cpu_to_le32(OWN | FSG | LSG);
|
||||
desc->txdw0 |= cpu_to_le32(pkt_size & 0x0000FFFF); /* packet size */
|
||||
desc->txdw0 |= cpu_to_le32(((TXDESC_SIZE + OFFSET_SZ) << OFFSET_SHT) & 0x00FF0000); /* 32 bytes for TX Desc */
|
||||
if (bmcast) desc->txdw0 |= cpu_to_le32(BMC); /* broadcast packet */
|
||||
if (bmcast)
|
||||
desc->txdw0 |= cpu_to_le32(BMC); /* broadcast packet */
|
||||
|
||||
desc->txdw1 |= cpu_to_le32((0x01 << 26) & 0xff000000);
|
||||
/* offset 4 */
|
||||
|
@ -1058,8 +1039,7 @@ u32 mp_query_psd(struct adapter * pAdapter, u8 *data)
|
|||
_rtw_memset(data, '\0', sizeof(data));
|
||||
|
||||
i = psd_start;
|
||||
while (i < psd_stop)
|
||||
{
|
||||
while (i < psd_stop) {
|
||||
if (i >= psd_pts) {
|
||||
psd_data = rtw_GetPSDData(pAdapter, i-psd_pts);
|
||||
} else {
|
||||
|
@ -1073,8 +1053,6 @@ u32 mp_query_psd(struct adapter * pAdapter, u8 *data)
|
|||
return strlen(data)+1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void _rtw_mp_xmit_priv(struct xmit_priv *pxmitpriv)
|
||||
{
|
||||
int i, res;
|
||||
|
@ -1084,36 +1062,28 @@ void _rtw_mp_xmit_priv (struct xmit_priv *pxmitpriv)
|
|||
|
||||
u32 max_xmit_extbuf_size = MAX_XMIT_EXTBUF_SZ;
|
||||
u32 num_xmit_extbuf = NR_XMIT_EXTBUFF;
|
||||
if (padapter->registrypriv.mp_mode ==0)
|
||||
{
|
||||
if (padapter->registrypriv.mp_mode == 0) {
|
||||
max_xmit_extbuf_size = MAX_XMIT_EXTBUF_SZ;
|
||||
num_xmit_extbuf = NR_XMIT_EXTBUFF;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
max_xmit_extbuf_size = 20000;
|
||||
num_xmit_extbuf = 1;
|
||||
}
|
||||
|
||||
pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmit_extbuf;
|
||||
for (i=0; i<num_xmit_extbuf; i++)
|
||||
{
|
||||
for (i = 0; i < num_xmit_extbuf; i++) {
|
||||
rtw_os_xmit_resource_free(padapter, pxmitbuf, (max_xmit_extbuf_size + XMITBUF_ALIGN_SZ));
|
||||
|
||||
pxmitbuf++;
|
||||
}
|
||||
|
||||
if (pxmitpriv->pallocated_xmit_extbuf) {
|
||||
if (pxmitpriv->pallocated_xmit_extbuf)
|
||||
rtw_vmfree(pxmitpriv->pallocated_xmit_extbuf, num_xmit_extbuf * sizeof(struct xmit_buf) + 4);
|
||||
}
|
||||
|
||||
if (padapter->registrypriv.mp_mode ==0)
|
||||
{
|
||||
if (padapter->registrypriv.mp_mode == 0) {
|
||||
max_xmit_extbuf_size = 20000;
|
||||
num_xmit_extbuf = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
max_xmit_extbuf_size = MAX_XMIT_EXTBUF_SZ;
|
||||
num_xmit_extbuf = NR_XMIT_EXTBUFF;
|
||||
}
|
||||
|
@ -1133,15 +1103,15 @@ void _rtw_mp_xmit_priv (struct xmit_priv *pxmitpriv)
|
|||
|
||||
pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmit_extbuf;
|
||||
|
||||
for (i = 0; i < num_xmit_extbuf; i++)
|
||||
{
|
||||
for (i = 0; i < num_xmit_extbuf; i++) {
|
||||
_rtw_init_listhead(&pxmitbuf->list);
|
||||
|
||||
pxmitbuf->priv_data = NULL;
|
||||
pxmitbuf->padapter = padapter;
|
||||
pxmitbuf->ext_tag = true;
|
||||
|
||||
if ((res=rtw_os_xmit_resource_alloc(padapter, pxmitbuf,max_xmit_extbuf_size + XMITBUF_ALIGN_SZ)) == _FAIL) {
|
||||
res = rtw_os_xmit_resource_alloc(padapter, pxmitbuf, max_xmit_extbuf_size + XMITBUF_ALIGN_SZ);
|
||||
if (res == _FAIL) {
|
||||
res = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue