mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2024-11-22 04:23:39 +00:00
rtl8188eu: Fix checkpatch errors in hal/HalHWImg8188E_MAC.c
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
265bcabda9
commit
4e6e85f466
1 changed files with 63 additions and 84 deletions
|
@ -21,30 +21,30 @@
|
||||||
#include "odm_precomp.h"
|
#include "odm_precomp.h"
|
||||||
#include <rtw_iol.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 _board = (hex & 0x000000FF);
|
||||||
u4Byte _interface = (Hex & 0x0000FF00) >> 8;
|
u4Byte _interface = (hex & 0x0000FF00) >> 8;
|
||||||
u4Byte _platform = (Hex & 0x00FF0000) >> 16;
|
u4Byte _platform = (hex & 0x00FF0000) >> 16;
|
||||||
u4Byte cond = Condition;
|
u4Byte cond = condition;
|
||||||
|
|
||||||
if ( Condition == 0xCDCDCDCD )
|
if (condition == 0xCDCDCDCD)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
cond = Condition & 0x000000FF;
|
cond = condition & 0x000000FF;
|
||||||
if ( (_board == cond) && cond != 0x00)
|
if ((_board == cond) && cond != 0x00)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
cond = Condition & 0x0000FF00;
|
cond = condition & 0x0000FF00;
|
||||||
cond = cond >> 8;
|
cond = cond >> 8;
|
||||||
if ( (_interface & cond) == 0 && cond != 0x07)
|
if ((_interface & cond) == 0 && cond != 0x07)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
cond = Condition & 0x00FF0000;
|
cond = condition & 0x00FF0000;
|
||||||
cond = cond >> 16;
|
cond = cond >> 16;
|
||||||
if ( (_platform & cond) == 0 && cond != 0x0F)
|
if ((_platform & cond) == 0 && cond != 0x0F)
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ static bool CheckCondition(const u4Byte Condition, const u4Byte Hex)
|
||||||
* MAC_REG.TXT
|
* MAC_REG.TXT
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
static u4Byte Array_MAC_REG_8188E[] = {
|
static u4Byte array_MAC_REG_8188E[] = {
|
||||||
0x026, 0x00000041,
|
0x026, 0x00000041,
|
||||||
0x027, 0x00000035,
|
0x027, 0x00000035,
|
||||||
0x428, 0x0000000A,
|
0x428, 0x0000000A,
|
||||||
|
@ -145,110 +145,89 @@ static u4Byte Array_MAC_REG_8188E[] = {
|
||||||
0x70B, 0x00000087,
|
0x70B, 0x00000087,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum HAL_STATUS
|
enum HAL_STATUS ODM_ReadAndConfig_MAC_REG_8188E(struct odm_dm_struct *dm_odm)
|
||||||
ODM_ReadAndConfig_MAC_REG_8188E(
|
|
||||||
struct odm_dm_struct * pDM_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 hex = 0;
|
||||||
u4Byte i = 0;
|
u4Byte i;
|
||||||
u2Byte count = 0;
|
u2Byte count = 0;
|
||||||
pu4Byte ptr_array = NULL;
|
pu4Byte ptr_array = NULL;
|
||||||
u1Byte platform = pDM_Odm->SupportPlatform;
|
u1Byte platform = dm_odm->SupportPlatform;
|
||||||
u1Byte interfaceValue = pDM_Odm->SupportInterface;
|
u1Byte interface_val = dm_odm->SupportInterface;
|
||||||
u1Byte board = pDM_Odm->BoardType;
|
u1Byte board = dm_odm->BoardType;
|
||||||
u4Byte ArrayLen = sizeof(Array_MAC_REG_8188E)/sizeof(u4Byte);
|
u4Byte array_len = sizeof(array_MAC_REG_8188E)/sizeof(u4Byte);
|
||||||
pu4Byte Array = Array_MAC_REG_8188E;
|
pu4Byte array = array_MAC_REG_8188E;
|
||||||
bool biol = false;
|
bool biol = false;
|
||||||
|
|
||||||
struct adapter * Adapter = pDM_Odm->Adapter;
|
struct adapter *adapt = dm_odm->Adapter;
|
||||||
struct xmit_frame *pxmit_frame;
|
struct xmit_frame *pxmit_frame;
|
||||||
u8 bndy_cnt = 1;
|
u8 bndy_cnt = 1;
|
||||||
enum HAL_STATUS rst = HAL_STATUS_SUCCESS;
|
enum HAL_STATUS rst = HAL_STATUS_SUCCESS;
|
||||||
hex += board;
|
hex += board;
|
||||||
hex += interfaceValue << 8;
|
hex += interface_val << 8;
|
||||||
hex += platform << 16;
|
hex += platform << 16;
|
||||||
hex += 0xFF000000;
|
hex += 0xFF000000;
|
||||||
|
|
||||||
biol = rtw_IOL_applied(Adapter);
|
biol = rtw_IOL_applied(adapt);
|
||||||
|
|
||||||
if (biol){
|
if (biol) {
|
||||||
if ((pxmit_frame=rtw_IOL_accquire_xmit_frame(Adapter)) == NULL)
|
pxmit_frame = rtw_IOL_accquire_xmit_frame(adapt);
|
||||||
{
|
if (pxmit_frame == NULL) {
|
||||||
printk("rtw_IOL_accquire_xmit_frame failed\n");
|
pr_info("rtw_IOL_accquire_xmit_frame failed\n");
|
||||||
return HAL_STATUS_FAILURE;
|
return HAL_STATUS_FAILURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < ArrayLen; i += 2 )
|
for (i = 0; i < array_len; i += 2) {
|
||||||
{
|
u4Byte v1 = array[i];
|
||||||
u4Byte v1 = Array[i];
|
u4Byte v2 = array[i+1];
|
||||||
u4Byte v2 = Array[i+1];
|
|
||||||
|
|
||||||
/* This (offset, data) pair meets the condition. */
|
/* This (offset, data) pair meets the condition. */
|
||||||
if ( v1 < 0xCDCDCDCD )
|
if (v1 < 0xCDCDCDCD) {
|
||||||
{
|
if (biol) {
|
||||||
if (biol){
|
|
||||||
if (rtw_IOL_cmd_boundary_handle(pxmit_frame))
|
if (rtw_IOL_cmd_boundary_handle(pxmit_frame))
|
||||||
bndy_cnt++;
|
bndy_cnt++;
|
||||||
rtw_IOL_append_WB_cmd(pxmit_frame,(u2Byte)v1, (u1Byte)v2,0xFF);
|
rtw_IOL_append_WB_cmd(pxmit_frame, (u2Byte)v1, (u1Byte)v2, 0xFF);
|
||||||
}
|
} else {
|
||||||
else
|
odm_ConfigMAC_8188E(dm_odm, v1, (u1Byte)v2);
|
||||||
{
|
|
||||||
odm_ConfigMAC_8188E(pDM_Odm, v1, (u1Byte)v2);
|
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
} else { /* This line is the start line of branch. */
|
||||||
else
|
if (!Checkcondition(array[i], hex)) {
|
||||||
{ /* This line is the start line of branch. */
|
/* Discard the following (offset, data) pairs. */
|
||||||
if ( !CheckCondition(Array[i], hex) )
|
READ_NEXT_PAIR(v1, v2, i);
|
||||||
{ /* Discard the following (offset, data) pairs. */
|
while (v2 != 0xDEAD &&
|
||||||
READ_NEXT_PAIR(v1, v2, i);
|
v2 != 0xCDEF &&
|
||||||
while ( v2 != 0xDEAD &&
|
v2 != 0xCDCD && i < array_len - 2) {
|
||||||
v2 != 0xCDEF &&
|
|
||||||
v2 != 0xCDCD && i < ArrayLen -2)
|
|
||||||
{
|
|
||||||
READ_NEXT_PAIR(v1, v2, i);
|
READ_NEXT_PAIR(v1, v2, i);
|
||||||
}
|
}
|
||||||
i -= 2; /* prevent from for-loop += 2 */
|
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);
|
READ_NEXT_PAIR(v1, v2, i);
|
||||||
while ( v2 != 0xDEAD &&
|
while (v2 != 0xDEAD &&
|
||||||
v2 != 0xCDEF &&
|
v2 != 0xCDEF &&
|
||||||
v2 != 0xCDCD && i < ArrayLen -2)
|
v2 != 0xCDCD && i < array_len - 2) {
|
||||||
{
|
if (biol) {
|
||||||
if (biol){
|
|
||||||
if (rtw_IOL_cmd_boundary_handle(pxmit_frame))
|
if (rtw_IOL_cmd_boundary_handle(pxmit_frame))
|
||||||
bndy_cnt++;
|
bndy_cnt++;
|
||||||
rtw_IOL_append_WB_cmd(pxmit_frame,(u2Byte)v1, (u1Byte)v2,0xFF);
|
rtw_IOL_append_WB_cmd(pxmit_frame, (u2Byte)v1, (u1Byte)v2, 0xFF);
|
||||||
}
|
} else {
|
||||||
else
|
odm_ConfigMAC_8188E(dm_odm, v1, (u1Byte)v2);
|
||||||
{
|
|
||||||
odm_ConfigMAC_8188E(pDM_Odm, v1, (u1Byte)v2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
READ_NEXT_PAIR(v1, v2, i);
|
READ_NEXT_PAIR(v1, v2, i);
|
||||||
}
|
}
|
||||||
|
while (v2 != 0xDEAD && i < array_len - 2)
|
||||||
while (v2 != 0xDEAD && i < ArrayLen -2)
|
|
||||||
{
|
|
||||||
READ_NEXT_PAIR(v1, v2, i);
|
READ_NEXT_PAIR(v1, v2, i);
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (biol) {
|
||||||
if (biol){
|
if (!rtw_IOL_exec_cmds_sync(dm_odm->Adapter, pxmit_frame, 1000, bndy_cnt)) {
|
||||||
if (!rtw_IOL_exec_cmds_sync(pDM_Odm->Adapter, pxmit_frame, 1000, bndy_cnt)) {
|
pr_info("~~~ MAC IOL_exec_cmds Failed !!!\n");
|
||||||
printk("~~~ MAC IOL_exec_cmds Failed !!!\n");
|
|
||||||
rst = HAL_STATUS_FAILURE;
|
rst = HAL_STATUS_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rst;
|
return rst;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue