rtl8188eu: Fix checkpatch errors in hal/HalHWImg8188E_MAC.c

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2013-08-04 17:14:19 -05:00
parent 265bcabda9
commit 4e6e85f466

View file

@ -21,30 +21,30 @@
#include "odm_precomp.h"
#include <rtw_iol.h>
static bool CheckCondition(const u4Byte Condition, const u4Byte Hex)
static bool Checkcondition(const u4Byte condition, const u4Byte hex)
{
u4Byte _board = (Hex & 0x000000FF);
u4Byte _interface = (Hex & 0x0000FF00) >> 8;
u4Byte _platform = (Hex & 0x00FF0000) >> 16;
u4Byte cond = Condition;
u4Byte _board = (hex & 0x000000FF);
u4Byte _interface = (hex & 0x0000FF00) >> 8;
u4Byte _platform = (hex & 0x00FF0000) >> 16;
u4Byte cond = condition;
if ( Condition == 0xCDCDCDCD )
return true;
if (condition == 0xCDCDCDCD)
return true;
cond = Condition & 0x000000FF;
if ( (_board == cond) && cond != 0x00)
return false;
cond = condition & 0x000000FF;
if ((_board == cond) && cond != 0x00)
return false;
cond = Condition & 0x0000FF00;
cond = cond >> 8;
if ( (_interface & cond) == 0 && cond != 0x07)
return false;
cond = condition & 0x0000FF00;
cond = cond >> 8;
if ((_interface & cond) == 0 && cond != 0x07)
return false;
cond = Condition & 0x00FF0000;
cond = cond >> 16;
if ( (_platform & cond) == 0 && cond != 0x0F)
return false;
return true;
cond = condition & 0x00FF0000;
cond = cond >> 16;
if ((_platform & cond) == 0 && cond != 0x0F)
return false;
return true;
}
@ -52,7 +52,7 @@ static bool CheckCondition(const u4Byte Condition, const u4Byte Hex)
* MAC_REG.TXT
******************************************************************************/
static u4Byte Array_MAC_REG_8188E[] = {
static u4Byte array_MAC_REG_8188E[] = {
0x026, 0x00000041,
0x027, 0x00000035,
0x428, 0x0000000A,
@ -145,110 +145,89 @@ static u4Byte Array_MAC_REG_8188E[] = {
0x70B, 0x00000087,
};
enum HAL_STATUS
ODM_ReadAndConfig_MAC_REG_8188E(
struct odm_dm_struct * pDM_Odm
)
enum HAL_STATUS ODM_ReadAndConfig_MAC_REG_8188E(struct odm_dm_struct *dm_odm)
{
#define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while (0)
#define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = array[i]; v2 = array[i+1]; } while (0)
u4Byte hex = 0;
u4Byte i = 0;
u4Byte i;
u2Byte count = 0;
pu4Byte ptr_array = NULL;
u1Byte platform = pDM_Odm->SupportPlatform;
u1Byte interfaceValue = pDM_Odm->SupportInterface;
u1Byte board = pDM_Odm->BoardType;
u4Byte ArrayLen = sizeof(Array_MAC_REG_8188E)/sizeof(u4Byte);
pu4Byte Array = Array_MAC_REG_8188E;
bool biol = false;
u1Byte platform = dm_odm->SupportPlatform;
u1Byte interface_val = dm_odm->SupportInterface;
u1Byte board = dm_odm->BoardType;
u4Byte array_len = sizeof(array_MAC_REG_8188E)/sizeof(u4Byte);
pu4Byte array = array_MAC_REG_8188E;
bool biol = false;
struct adapter * Adapter = pDM_Odm->Adapter;
struct adapter *adapt = dm_odm->Adapter;
struct xmit_frame *pxmit_frame;
u8 bndy_cnt = 1;
enum HAL_STATUS rst = HAL_STATUS_SUCCESS;
hex += board;
hex += interfaceValue << 8;
hex += interface_val << 8;
hex += platform << 16;
hex += 0xFF000000;
biol = rtw_IOL_applied(Adapter);
biol = rtw_IOL_applied(adapt);
if (biol){
if ((pxmit_frame=rtw_IOL_accquire_xmit_frame(Adapter)) == NULL)
{
printk("rtw_IOL_accquire_xmit_frame failed\n");
if (biol) {
pxmit_frame = rtw_IOL_accquire_xmit_frame(adapt);
if (pxmit_frame == NULL) {
pr_info("rtw_IOL_accquire_xmit_frame failed\n");
return HAL_STATUS_FAILURE;
}
}
for (i = 0; i < ArrayLen; i += 2 )
{
u4Byte v1 = Array[i];
u4Byte v2 = Array[i+1];
for (i = 0; i < array_len; i += 2) {
u4Byte v1 = array[i];
u4Byte v2 = array[i+1];
/* This (offset, data) pair meets the condition. */
if ( v1 < 0xCDCDCDCD )
{
if (biol){
if (v1 < 0xCDCDCDCD) {
if (biol) {
if (rtw_IOL_cmd_boundary_handle(pxmit_frame))
bndy_cnt++;
rtw_IOL_append_WB_cmd(pxmit_frame,(u2Byte)v1, (u1Byte)v2,0xFF);
}
else
{
odm_ConfigMAC_8188E(pDM_Odm, v1, (u1Byte)v2);
rtw_IOL_append_WB_cmd(pxmit_frame, (u2Byte)v1, (u1Byte)v2, 0xFF);
} else {
odm_ConfigMAC_8188E(dm_odm, v1, (u1Byte)v2);
}
continue;
}
else
{ /* This line is the start line of branch. */
if ( !CheckCondition(Array[i], hex) )
{ /* Discard the following (offset, data) pairs. */
READ_NEXT_PAIR(v1, v2, i);
while ( v2 != 0xDEAD &&
v2 != 0xCDEF &&
v2 != 0xCDCD && i < ArrayLen -2)
{
} else { /* This line is the start line of branch. */
if (!Checkcondition(array[i], hex)) {
/* Discard the following (offset, data) pairs. */
READ_NEXT_PAIR(v1, v2, i);
while (v2 != 0xDEAD &&
v2 != 0xCDEF &&
v2 != 0xCDCD && i < array_len - 2) {
READ_NEXT_PAIR(v1, v2, i);
}
i -= 2; /* prevent from for-loop += 2 */
}
else /* Configure matched pairs and skip to end of if-else. */
{
} else { /* Configure matched pairs and skip to end of if-else. */
READ_NEXT_PAIR(v1, v2, i);
while ( v2 != 0xDEAD &&
v2 != 0xCDEF &&
v2 != 0xCDCD && i < ArrayLen -2)
{
if (biol){
while (v2 != 0xDEAD &&
v2 != 0xCDEF &&
v2 != 0xCDCD && i < array_len - 2) {
if (biol) {
if (rtw_IOL_cmd_boundary_handle(pxmit_frame))
bndy_cnt++;
rtw_IOL_append_WB_cmd(pxmit_frame,(u2Byte)v1, (u1Byte)v2,0xFF);
}
else
{
odm_ConfigMAC_8188E(pDM_Odm, v1, (u1Byte)v2);
rtw_IOL_append_WB_cmd(pxmit_frame, (u2Byte)v1, (u1Byte)v2, 0xFF);
} else {
odm_ConfigMAC_8188E(dm_odm, v1, (u1Byte)v2);
}
READ_NEXT_PAIR(v1, v2, i);
}
while (v2 != 0xDEAD && i < ArrayLen -2)
{
while (v2 != 0xDEAD && i < array_len - 2)
READ_NEXT_PAIR(v1, v2, i);
}
}
}
}
if (biol){
if (!rtw_IOL_exec_cmds_sync(pDM_Odm->Adapter, pxmit_frame, 1000, bndy_cnt)) {
printk("~~~ MAC IOL_exec_cmds Failed !!!\n");
if (biol) {
if (!rtw_IOL_exec_cmds_sync(dm_odm->Adapter, pxmit_frame, 1000, bndy_cnt)) {
pr_info("~~~ MAC IOL_exec_cmds Failed !!!\n");
rst = HAL_STATUS_FAILURE;
}
}
return rst;
}