Commit a1d46529 authored by Joe Perches's avatar Joe Perches Committed by Greg Kroah-Hartman

staging: ath6kl: Convert (status != A_OK) to (status)

Just use the status variable as a test not a comparison.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent f68057e6
...@@ -121,7 +121,7 @@ BMIDone(HIF_DEVICE *device) ...@@ -121,7 +121,7 @@ BMIDone(HIF_DEVICE *device)
cid = BMI_DONE; cid = BMI_DONE;
status = bmiBufferSend(device, (A_UCHAR *)&cid, sizeof(cid)); status = bmiBufferSend(device, (A_UCHAR *)&cid, sizeof(cid));
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
return A_ERROR; return A_ERROR;
} }
...@@ -156,14 +156,14 @@ BMIGetTargetInfo(HIF_DEVICE *device, struct bmi_target_info *targ_info) ...@@ -156,14 +156,14 @@ BMIGetTargetInfo(HIF_DEVICE *device, struct bmi_target_info *targ_info)
cid = BMI_GET_TARGET_INFO; cid = BMI_GET_TARGET_INFO;
status = bmiBufferSend(device, (A_UCHAR *)&cid, sizeof(cid)); status = bmiBufferSend(device, (A_UCHAR *)&cid, sizeof(cid));
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
return A_ERROR; return A_ERROR;
} }
status = bmiBufferReceive(device, (A_UCHAR *)&targ_info->target_ver, status = bmiBufferReceive(device, (A_UCHAR *)&targ_info->target_ver,
sizeof(targ_info->target_ver), true); sizeof(targ_info->target_ver), true);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read Target Version from the device\n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read Target Version from the device\n"));
return A_ERROR; return A_ERROR;
} }
...@@ -172,7 +172,7 @@ BMIGetTargetInfo(HIF_DEVICE *device, struct bmi_target_info *targ_info) ...@@ -172,7 +172,7 @@ BMIGetTargetInfo(HIF_DEVICE *device, struct bmi_target_info *targ_info)
/* Determine how many bytes are in the Target's targ_info */ /* Determine how many bytes are in the Target's targ_info */
status = bmiBufferReceive(device, (A_UCHAR *)&targ_info->target_info_byte_count, status = bmiBufferReceive(device, (A_UCHAR *)&targ_info->target_info_byte_count,
sizeof(targ_info->target_info_byte_count), true); sizeof(targ_info->target_info_byte_count), true);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read Target Info Byte Count from the device\n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read Target Info Byte Count from the device\n"));
return A_ERROR; return A_ERROR;
} }
...@@ -187,7 +187,7 @@ BMIGetTargetInfo(HIF_DEVICE *device, struct bmi_target_info *targ_info) ...@@ -187,7 +187,7 @@ BMIGetTargetInfo(HIF_DEVICE *device, struct bmi_target_info *targ_info)
status = bmiBufferReceive(device, status = bmiBufferReceive(device,
((A_UCHAR *)targ_info)+sizeof(targ_info->target_info_byte_count), ((A_UCHAR *)targ_info)+sizeof(targ_info->target_info_byte_count),
sizeof(*targ_info)-sizeof(targ_info->target_info_byte_count), true); sizeof(*targ_info)-sizeof(targ_info->target_info_byte_count), true);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read Target Info (%d bytes) from the device\n", AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read Target Info (%d bytes) from the device\n",
targ_info->target_info_byte_count)); targ_info->target_info_byte_count));
return A_ERROR; return A_ERROR;
...@@ -239,12 +239,12 @@ BMIReadMemory(HIF_DEVICE *device, ...@@ -239,12 +239,12 @@ BMIReadMemory(HIF_DEVICE *device,
offset += sizeof(length); offset += sizeof(length);
status = bmiBufferSend(device, pBMICmdBuf, offset); status = bmiBufferSend(device, pBMICmdBuf, offset);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
return A_ERROR; return A_ERROR;
} }
status = bmiBufferReceive(device, pBMICmdBuf, rxlen, true); status = bmiBufferReceive(device, pBMICmdBuf, rxlen, true);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read from the device\n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read from the device\n"));
return A_ERROR; return A_ERROR;
} }
...@@ -309,7 +309,7 @@ BMIWriteMemory(HIF_DEVICE *device, ...@@ -309,7 +309,7 @@ BMIWriteMemory(HIF_DEVICE *device,
A_MEMCPY(&(pBMICmdBuf[offset]), src, txlen); A_MEMCPY(&(pBMICmdBuf[offset]), src, txlen);
offset += txlen; offset += txlen;
status = bmiBufferSend(device, pBMICmdBuf, offset); status = bmiBufferSend(device, pBMICmdBuf, offset);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
return A_ERROR; return A_ERROR;
} }
...@@ -352,13 +352,13 @@ BMIExecute(HIF_DEVICE *device, ...@@ -352,13 +352,13 @@ BMIExecute(HIF_DEVICE *device,
A_MEMCPY(&(pBMICmdBuf[offset]), param, sizeof(*param)); A_MEMCPY(&(pBMICmdBuf[offset]), param, sizeof(*param));
offset += sizeof(*param); offset += sizeof(*param);
status = bmiBufferSend(device, pBMICmdBuf, offset); status = bmiBufferSend(device, pBMICmdBuf, offset);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
return A_ERROR; return A_ERROR;
} }
status = bmiBufferReceive(device, pBMICmdBuf, sizeof(*param), false); status = bmiBufferReceive(device, pBMICmdBuf, sizeof(*param), false);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read from the device\n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read from the device\n"));
return A_ERROR; return A_ERROR;
} }
...@@ -397,7 +397,7 @@ BMISetAppStart(HIF_DEVICE *device, ...@@ -397,7 +397,7 @@ BMISetAppStart(HIF_DEVICE *device,
A_MEMCPY(&(pBMICmdBuf[offset]), &address, sizeof(address)); A_MEMCPY(&(pBMICmdBuf[offset]), &address, sizeof(address));
offset += sizeof(address); offset += sizeof(address);
status = bmiBufferSend(device, pBMICmdBuf, offset); status = bmiBufferSend(device, pBMICmdBuf, offset);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
return A_ERROR; return A_ERROR;
} }
...@@ -436,13 +436,13 @@ BMIReadSOCRegister(HIF_DEVICE *device, ...@@ -436,13 +436,13 @@ BMIReadSOCRegister(HIF_DEVICE *device,
offset += sizeof(address); offset += sizeof(address);
status = bmiBufferSend(device, pBMICmdBuf, offset); status = bmiBufferSend(device, pBMICmdBuf, offset);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
return A_ERROR; return A_ERROR;
} }
status = bmiBufferReceive(device, pBMICmdBuf, sizeof(*param), true); status = bmiBufferReceive(device, pBMICmdBuf, sizeof(*param), true);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read from the device\n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read from the device\n"));
return A_ERROR; return A_ERROR;
} }
...@@ -483,7 +483,7 @@ BMIWriteSOCRegister(HIF_DEVICE *device, ...@@ -483,7 +483,7 @@ BMIWriteSOCRegister(HIF_DEVICE *device,
A_MEMCPY(&(pBMICmdBuf[offset]), &param, sizeof(param)); A_MEMCPY(&(pBMICmdBuf[offset]), &param, sizeof(param));
offset += sizeof(param); offset += sizeof(param);
status = bmiBufferSend(device, pBMICmdBuf, offset); status = bmiBufferSend(device, pBMICmdBuf, offset);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
return A_ERROR; return A_ERROR;
} }
...@@ -532,13 +532,13 @@ BMIrompatchInstall(HIF_DEVICE *device, ...@@ -532,13 +532,13 @@ BMIrompatchInstall(HIF_DEVICE *device,
A_MEMCPY(&(pBMICmdBuf[offset]), &do_activate, sizeof(do_activate)); A_MEMCPY(&(pBMICmdBuf[offset]), &do_activate, sizeof(do_activate));
offset += sizeof(do_activate); offset += sizeof(do_activate);
status = bmiBufferSend(device, pBMICmdBuf, offset); status = bmiBufferSend(device, pBMICmdBuf, offset);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
return A_ERROR; return A_ERROR;
} }
status = bmiBufferReceive(device, pBMICmdBuf, sizeof(*rompatch_id), true); status = bmiBufferReceive(device, pBMICmdBuf, sizeof(*rompatch_id), true);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read from the device\n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read from the device\n"));
return A_ERROR; return A_ERROR;
} }
...@@ -576,7 +576,7 @@ BMIrompatchUninstall(HIF_DEVICE *device, ...@@ -576,7 +576,7 @@ BMIrompatchUninstall(HIF_DEVICE *device,
A_MEMCPY(&(pBMICmdBuf[offset]), &rompatch_id, sizeof(rompatch_id)); A_MEMCPY(&(pBMICmdBuf[offset]), &rompatch_id, sizeof(rompatch_id));
offset += sizeof(rompatch_id); offset += sizeof(rompatch_id);
status = bmiBufferSend(device, pBMICmdBuf, offset); status = bmiBufferSend(device, pBMICmdBuf, offset);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
return A_ERROR; return A_ERROR;
} }
...@@ -619,7 +619,7 @@ _BMIrompatchChangeActivation(HIF_DEVICE *device, ...@@ -619,7 +619,7 @@ _BMIrompatchChangeActivation(HIF_DEVICE *device,
A_MEMCPY(&(pBMICmdBuf[offset]), rompatch_list, length); A_MEMCPY(&(pBMICmdBuf[offset]), rompatch_list, length);
offset += length; offset += length;
status = bmiBufferSend(device, pBMICmdBuf, offset); status = bmiBufferSend(device, pBMICmdBuf, offset);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
return A_ERROR; return A_ERROR;
} }
...@@ -683,7 +683,7 @@ BMILZData(HIF_DEVICE *device, ...@@ -683,7 +683,7 @@ BMILZData(HIF_DEVICE *device,
A_MEMCPY(&(pBMICmdBuf[offset]), &buffer[length - remaining], txlen); A_MEMCPY(&(pBMICmdBuf[offset]), &buffer[length - remaining], txlen);
offset += txlen; offset += txlen;
status = bmiBufferSend(device, pBMICmdBuf, offset); status = bmiBufferSend(device, pBMICmdBuf, offset);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
return A_ERROR; return A_ERROR;
} }
...@@ -722,7 +722,7 @@ BMILZStreamStart(HIF_DEVICE *device, ...@@ -722,7 +722,7 @@ BMILZStreamStart(HIF_DEVICE *device,
A_MEMCPY(&(pBMICmdBuf[offset]), &address, sizeof(address)); A_MEMCPY(&(pBMICmdBuf[offset]), &address, sizeof(address));
offset += sizeof(address); offset += sizeof(address);
status = bmiBufferSend(device, pBMICmdBuf, offset); status = bmiBufferSend(device, pBMICmdBuf, offset);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to Start LZ Stream to the device\n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to Start LZ Stream to the device\n"));
return A_ERROR; return A_ERROR;
} }
...@@ -757,7 +757,7 @@ bmiBufferSend(HIF_DEVICE *device, ...@@ -757,7 +757,7 @@ bmiBufferSend(HIF_DEVICE *device,
* make all HIF accesses 4-byte aligned */ * make all HIF accesses 4-byte aligned */
status = HIFReadWrite(device, address, (u8 *)pBMICmdCredits, 4, status = HIFReadWrite(device, address, (u8 *)pBMICmdCredits, 4,
HIF_RD_SYNC_BYTE_INC, NULL); HIF_RD_SYNC_BYTE_INC, NULL);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to decrement the command credit count register\n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to decrement the command credit count register\n"));
return A_ERROR; return A_ERROR;
} }
...@@ -769,7 +769,7 @@ bmiBufferSend(HIF_DEVICE *device, ...@@ -769,7 +769,7 @@ bmiBufferSend(HIF_DEVICE *device,
address = mboxAddress[ENDPOINT1]; address = mboxAddress[ENDPOINT1];
status = HIFReadWrite(device, address, buffer, length, status = HIFReadWrite(device, address, buffer, length,
HIF_WR_SYNC_BYTE_INC, NULL); HIF_WR_SYNC_BYTE_INC, NULL);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to send the BMI data to the device\n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to send the BMI data to the device\n"));
return A_ERROR; return A_ERROR;
} }
...@@ -868,7 +868,7 @@ bmiBufferReceive(HIF_DEVICE *device, ...@@ -868,7 +868,7 @@ bmiBufferReceive(HIF_DEVICE *device,
status = getPendingEventsFunc(device, status = getPendingEventsFunc(device,
&hifPendingEvents, &hifPendingEvents,
NULL); NULL);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("BMI: Failed to get pending events \n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("BMI: Failed to get pending events \n"));
break; break;
} }
...@@ -881,7 +881,7 @@ bmiBufferReceive(HIF_DEVICE *device, ...@@ -881,7 +881,7 @@ bmiBufferReceive(HIF_DEVICE *device,
status = HIFReadWrite(device, RX_LOOKAHEAD_VALID_ADDRESS, (u8 *)&word_available, status = HIFReadWrite(device, RX_LOOKAHEAD_VALID_ADDRESS, (u8 *)&word_available,
sizeof(word_available), HIF_RD_SYNC_BYTE_INC, NULL); sizeof(word_available), HIF_RD_SYNC_BYTE_INC, NULL);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read RX_LOOKAHEAD_VALID register\n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read RX_LOOKAHEAD_VALID register\n"));
return A_ERROR; return A_ERROR;
} }
...@@ -932,7 +932,7 @@ bmiBufferReceive(HIF_DEVICE *device, ...@@ -932,7 +932,7 @@ bmiBufferReceive(HIF_DEVICE *device,
* The rationale here is to make all HIF accesses a multiple of 4 bytes */ * The rationale here is to make all HIF accesses a multiple of 4 bytes */
status = HIFReadWrite(device, address, (u8 *)pBMICmdCredits, sizeof(*pBMICmdCredits), status = HIFReadWrite(device, address, (u8 *)pBMICmdCredits, sizeof(*pBMICmdCredits),
HIF_RD_SYNC_BYTE_FIX, NULL); HIF_RD_SYNC_BYTE_FIX, NULL);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read the command credit count register\n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read the command credit count register\n"));
return A_ERROR; return A_ERROR;
} }
...@@ -949,7 +949,7 @@ bmiBufferReceive(HIF_DEVICE *device, ...@@ -949,7 +949,7 @@ bmiBufferReceive(HIF_DEVICE *device,
address = mboxAddress[ENDPOINT1]; address = mboxAddress[ENDPOINT1];
status = HIFReadWrite(device, address, buffer, length, HIF_RD_SYNC_BYTE_INC, NULL); status = HIFReadWrite(device, address, buffer, length, HIF_RD_SYNC_BYTE_INC, NULL);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read the BMI data from the device\n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read the BMI data from the device\n"));
return A_ERROR; return A_ERROR;
} }
......
...@@ -1088,7 +1088,7 @@ static int hifDeviceSuspend(struct device *dev) ...@@ -1088,7 +1088,7 @@ static int hifDeviceSuspend(struct device *dev)
if (device && device->claimedContext && osdrvCallbacks.deviceSuspendHandler) { if (device && device->claimedContext && osdrvCallbacks.deviceSuspendHandler) {
device->is_suspend = true; /* set true first for PowerStateChangeNotify(..) */ device->is_suspend = true; /* set true first for PowerStateChangeNotify(..) */
status = osdrvCallbacks.deviceSuspendHandler(device->claimedContext); status = osdrvCallbacks.deviceSuspendHandler(device->claimedContext);
if (status != A_OK) { if (status) {
device->is_suspend = false; device->is_suspend = false;
} }
} }
......
...@@ -106,7 +106,7 @@ int DevSetup(AR6K_DEVICE *pDev) ...@@ -106,7 +106,7 @@ int DevSetup(AR6K_DEVICE *pDev)
status = HIFConfigureDevice(pDev->HIFDevice, HIF_DEVICE_GET_MBOX_ADDR, status = HIFConfigureDevice(pDev->HIFDevice, HIF_DEVICE_GET_MBOX_ADDR,
&pDev->MailBoxInfo, sizeof(pDev->MailBoxInfo)); &pDev->MailBoxInfo, sizeof(pDev->MailBoxInfo));
if (status != A_OK) { if (status) {
A_ASSERT(false); A_ASSERT(false);
break; break;
} }
...@@ -127,7 +127,7 @@ int DevSetup(AR6K_DEVICE *pDev) ...@@ -127,7 +127,7 @@ int DevSetup(AR6K_DEVICE *pDev)
status = HIFConfigureDevice(pDev->HIFDevice, HIF_DEVICE_GET_MBOX_BLOCK_SIZE, status = HIFConfigureDevice(pDev->HIFDevice, HIF_DEVICE_GET_MBOX_BLOCK_SIZE,
blocksizes, sizeof(blocksizes)); blocksizes, sizeof(blocksizes));
if (status != A_OK) { if (status) {
A_ASSERT(false); A_ASSERT(false);
break; break;
} }
...@@ -266,7 +266,7 @@ int DevEnableInterrupts(AR6K_DEVICE *pDev) ...@@ -266,7 +266,7 @@ int DevEnableInterrupts(AR6K_DEVICE *pDev)
HIF_WR_SYNC_BYTE_INC, HIF_WR_SYNC_BYTE_INC,
NULL); NULL);
if (status != A_OK) { if (status) {
/* Can't write it for some reason */ /* Can't write it for some reason */
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
("Failed to update interrupt control registers err: %d\n", status)); ("Failed to update interrupt control registers err: %d\n", status));
...@@ -510,7 +510,7 @@ int DevWaitForPendingRecv(AR6K_DEVICE *pDev,u32 TimeoutInMs,bool *pbIsRecvPendin ...@@ -510,7 +510,7 @@ int DevWaitForPendingRecv(AR6K_DEVICE *pDev,u32 TimeoutInMs,bool *pbIsRecvPendin
sizeof(A_UCHAR), sizeof(A_UCHAR),
HIF_RD_SYNC_BYTE_INC, HIF_RD_SYNC_BYTE_INC,
NULL); NULL);
if(status) if (status)
{ {
AR_DEBUG_PRINTF(ATH_LOG_ERR,("DevWaitForPendingRecv:Read HOST_INT_STATUS_ADDRESS Failed 0x%X\n",status)); AR_DEBUG_PRINTF(ATH_LOG_ERR,("DevWaitForPendingRecv:Read HOST_INT_STATUS_ADDRESS Failed 0x%X\n",status));
break; break;
...@@ -1156,7 +1156,7 @@ static int SendBuffers(AR6K_DEVICE *pDev, int mbox) ...@@ -1156,7 +1156,7 @@ static int SendBuffers(AR6K_DEVICE *pDev, int mbox)
paddedLength, paddedLength,
request, request,
NULL); NULL);
if (status != A_OK) { if (status) {
break; break;
} }
totalBytes += sendList[i].length; totalBytes += sendList[i].length;
...@@ -1182,7 +1182,7 @@ static int GetCredits(AR6K_DEVICE *pDev, int mbox, int *pCredits) ...@@ -1182,7 +1182,7 @@ static int GetCredits(AR6K_DEVICE *pDev, int mbox, int *pCredits)
address = COUNT_DEC_ADDRESS + (AR6K_MAILBOXES + mbox) * 4; address = COUNT_DEC_ADDRESS + (AR6K_MAILBOXES + mbox) * 4;
status = HIFReadWrite(pDev->HIFDevice, address, &credits, sizeof(credits), status = HIFReadWrite(pDev->HIFDevice, address, &credits, sizeof(credits),
HIF_RD_SYNC_BYTE_FIX, NULL); HIF_RD_SYNC_BYTE_FIX, NULL);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
("Unable to decrement the command credit count register (mbox=%d)\n",mbox)); ("Unable to decrement the command credit count register (mbox=%d)\n",mbox));
status = A_ERROR; status = A_ERROR;
...@@ -1244,7 +1244,7 @@ static int RecvBuffers(AR6K_DEVICE *pDev, int mbox) ...@@ -1244,7 +1244,7 @@ static int RecvBuffers(AR6K_DEVICE *pDev, int mbox)
* until we get at least 1 credit or it times out */ * until we get at least 1 credit or it times out */
status = GetCredits(pDev, mbox, &credits); status = GetCredits(pDev, mbox, &credits);
if (status != A_OK) { if (status) {
break; break;
} }
...@@ -1264,7 +1264,7 @@ static int RecvBuffers(AR6K_DEVICE *pDev, int mbox) ...@@ -1264,7 +1264,7 @@ static int RecvBuffers(AR6K_DEVICE *pDev, int mbox)
paddedLength, paddedLength,
request, request,
NULL); NULL);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Failed to read %d bytes on mailbox:%d : address:0x%X \n", AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Failed to read %d bytes on mailbox:%d : address:0x%X \n",
recvList[curBuffer].length, mbox, g_MailboxAddrs[mbox])); recvList[curBuffer].length, mbox, g_MailboxAddrs[mbox]));
break; break;
...@@ -1275,7 +1275,7 @@ static int RecvBuffers(AR6K_DEVICE *pDev, int mbox) ...@@ -1275,7 +1275,7 @@ static int RecvBuffers(AR6K_DEVICE *pDev, int mbox)
curBuffer++; curBuffer++;
} }
if (status != A_OK) { if (status) {
break; break;
} }
/* go back and get some more */ /* go back and get some more */
...@@ -1302,7 +1302,7 @@ static int DoOneMboxHWTest(AR6K_DEVICE *pDev, int mbox) ...@@ -1302,7 +1302,7 @@ static int DoOneMboxHWTest(AR6K_DEVICE *pDev, int mbox)
/* send out buffers */ /* send out buffers */
status = SendBuffers(pDev,mbox); status = SendBuffers(pDev,mbox);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Sending buffers Failed : %d mbox:%d\n",status,mbox)); AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Sending buffers Failed : %d mbox:%d\n",status,mbox));
break; break;
} }
...@@ -1310,7 +1310,7 @@ static int DoOneMboxHWTest(AR6K_DEVICE *pDev, int mbox) ...@@ -1310,7 +1310,7 @@ static int DoOneMboxHWTest(AR6K_DEVICE *pDev, int mbox)
/* go get them, this will block */ /* go get them, this will block */
status = RecvBuffers(pDev, mbox); status = RecvBuffers(pDev, mbox);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Recv buffers Failed : %d mbox:%d\n",status,mbox)); AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Recv buffers Failed : %d mbox:%d\n",status,mbox));
break; break;
} }
...@@ -1348,7 +1348,7 @@ int DoMboxHWTest(AR6K_DEVICE *pDev) ...@@ -1348,7 +1348,7 @@ int DoMboxHWTest(AR6K_DEVICE *pDev)
status = HIFConfigureDevice(pDev->HIFDevice, HIF_DEVICE_GET_MBOX_ADDR, status = HIFConfigureDevice(pDev->HIFDevice, HIF_DEVICE_GET_MBOX_ADDR,
g_MailboxAddrs, sizeof(g_MailboxAddrs)); g_MailboxAddrs, sizeof(g_MailboxAddrs));
if (status != A_OK) { if (status) {
A_ASSERT(false); A_ASSERT(false);
break; break;
} }
...@@ -1357,7 +1357,7 @@ int DoMboxHWTest(AR6K_DEVICE *pDev) ...@@ -1357,7 +1357,7 @@ int DoMboxHWTest(AR6K_DEVICE *pDev)
status = HIFConfigureDevice(pDev->HIFDevice, HIF_DEVICE_GET_MBOX_BLOCK_SIZE, status = HIFConfigureDevice(pDev->HIFDevice, HIF_DEVICE_GET_MBOX_BLOCK_SIZE,
g_BlockSizes, sizeof(g_BlockSizes)); g_BlockSizes, sizeof(g_BlockSizes));
if (status != A_OK) { if (status) {
A_ASSERT(false); A_ASSERT(false);
break; break;
} }
...@@ -1380,7 +1380,7 @@ int DoMboxHWTest(AR6K_DEVICE *pDev) ...@@ -1380,7 +1380,7 @@ int DoMboxHWTest(AR6K_DEVICE *pDev)
* mailbox 0 */ * mailbox 0 */
status = GetCredits(pDev, 0, &credits); status = GetCredits(pDev, 0, &credits);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Failed to wait for target ready \n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Failed to wait for target ready \n"));
break; break;
} }
...@@ -1395,7 +1395,7 @@ int DoMboxHWTest(AR6K_DEVICE *pDev) ...@@ -1395,7 +1395,7 @@ int DoMboxHWTest(AR6K_DEVICE *pDev)
HIF_RD_SYNC_BYTE_INC, HIF_RD_SYNC_BYTE_INC,
NULL); NULL);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Failed to wait get parameters \n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Failed to wait get parameters \n"));
break; break;
} }
...@@ -1423,7 +1423,7 @@ int DoMboxHWTest(AR6K_DEVICE *pDev) ...@@ -1423,7 +1423,7 @@ int DoMboxHWTest(AR6K_DEVICE *pDev)
HIF_WR_SYNC_BYTE_INC, HIF_WR_SYNC_BYTE_INC,
NULL); NULL);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Failed to write end marker \n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Failed to write end marker \n"));
break; break;
} }
...@@ -1440,7 +1440,7 @@ int DoMboxHWTest(AR6K_DEVICE *pDev) ...@@ -1440,7 +1440,7 @@ int DoMboxHWTest(AR6K_DEVICE *pDev)
HIF_WR_SYNC_BYTE_INC, HIF_WR_SYNC_BYTE_INC,
NULL); NULL);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Failed to write block mask \n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Failed to write block mask \n"));
break; break;
} }
...@@ -1450,7 +1450,7 @@ int DoMboxHWTest(AR6K_DEVICE *pDev) ...@@ -1450,7 +1450,7 @@ int DoMboxHWTest(AR6K_DEVICE *pDev)
/* execute the test on each mailbox */ /* execute the test on each mailbox */
for (i = 0; i < AR6K_MAILBOXES; i++) { for (i = 0; i < AR6K_MAILBOXES; i++) {
status = DoOneMboxHWTest(pDev, i); status = DoOneMboxHWTest(pDev, i);
if (status != A_OK) { if (status) {
break; break;
} }
} }
......
...@@ -240,7 +240,7 @@ int HTCWaitTarget(HTC_HANDLE HTCHandle) ...@@ -240,7 +240,7 @@ int HTCWaitTarget(HTC_HANDLE HTCHandle)
status = DoMboxHWTest(&target->Device); status = DoMboxHWTest(&target->Device);
if (status != A_OK) { if (status) {
break; break;
} }
......
...@@ -107,12 +107,12 @@ int ar6000_SetAddressWindowRegister(HIF_DEVICE *hifDevice, u32 RegisterAddr, u32 ...@@ -107,12 +107,12 @@ int ar6000_SetAddressWindowRegister(HIF_DEVICE *hifDevice, u32 RegisterAddr, u32
4, 4,
HIF_WR_SYNC_BYTE_FIX, HIF_WR_SYNC_BYTE_FIX,
NULL); NULL);
if (status != A_OK) { if (status) {
break; break;
} }
} }
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot write initial bytes of 0x%x to window reg: 0x%X \n", AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot write initial bytes of 0x%x to window reg: 0x%X \n",
Address, RegisterAddr)); Address, RegisterAddr));
return status; return status;
...@@ -128,7 +128,7 @@ int ar6000_SetAddressWindowRegister(HIF_DEVICE *hifDevice, u32 RegisterAddr, u32 ...@@ -128,7 +128,7 @@ int ar6000_SetAddressWindowRegister(HIF_DEVICE *hifDevice, u32 RegisterAddr, u32
HIF_WR_SYNC_BYTE_INC, HIF_WR_SYNC_BYTE_INC,
NULL); NULL);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot write 0x%x to window reg: 0x%X \n", AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot write 0x%x to window reg: 0x%X \n",
Address, RegisterAddr)); Address, RegisterAddr));
return status; return status;
...@@ -157,7 +157,7 @@ int ar6000_SetAddressWindowRegister(HIF_DEVICE *hifDevice, u32 RegisterAddr, u32 ...@@ -157,7 +157,7 @@ int ar6000_SetAddressWindowRegister(HIF_DEVICE *hifDevice, u32 RegisterAddr, u32
HIF_WR_SYNC_BYTE_INC, HIF_WR_SYNC_BYTE_INC,
NULL); NULL);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot write initial bytes of 0x%x to window reg: 0x%X \n", AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot write initial bytes of 0x%x to window reg: 0x%X \n",
RegisterAddr, Address)); RegisterAddr, Address));
return status; return status;
...@@ -171,7 +171,7 @@ int ar6000_SetAddressWindowRegister(HIF_DEVICE *hifDevice, u32 RegisterAddr, u32 ...@@ -171,7 +171,7 @@ int ar6000_SetAddressWindowRegister(HIF_DEVICE *hifDevice, u32 RegisterAddr, u32
HIF_WR_SYNC_BYTE_INC, HIF_WR_SYNC_BYTE_INC,
NULL); NULL);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot write 0x%x to window reg: 0x%X \n", AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot write 0x%x to window reg: 0x%X \n",
RegisterAddr, Address)); RegisterAddr, Address));
return status; return status;
...@@ -196,7 +196,7 @@ ar6000_ReadRegDiag(HIF_DEVICE *hifDevice, u32 *address, u32 *data) ...@@ -196,7 +196,7 @@ ar6000_ReadRegDiag(HIF_DEVICE *hifDevice, u32 *address, u32 *data)
WINDOW_READ_ADDR_ADDRESS, WINDOW_READ_ADDR_ADDRESS,
*address); *address);
if (status != A_OK) { if (status) {
return status; return status;
} }
...@@ -207,7 +207,7 @@ ar6000_ReadRegDiag(HIF_DEVICE *hifDevice, u32 *address, u32 *data) ...@@ -207,7 +207,7 @@ ar6000_ReadRegDiag(HIF_DEVICE *hifDevice, u32 *address, u32 *data)
sizeof(u32), sizeof(u32),
HIF_RD_SYNC_BYTE_INC, HIF_RD_SYNC_BYTE_INC,
NULL); NULL);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot read from WINDOW_DATA_ADDRESS\n")); AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot read from WINDOW_DATA_ADDRESS\n"));
return status; return status;
} }
...@@ -232,7 +232,7 @@ ar6000_WriteRegDiag(HIF_DEVICE *hifDevice, u32 *address, u32 *data) ...@@ -232,7 +232,7 @@ ar6000_WriteRegDiag(HIF_DEVICE *hifDevice, u32 *address, u32 *data)
sizeof(u32), sizeof(u32),
HIF_WR_SYNC_BYTE_INC, HIF_WR_SYNC_BYTE_INC,
NULL); NULL);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot write 0x%x to WINDOW_DATA_ADDRESS\n", *data)); AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot write 0x%x to WINDOW_DATA_ADDRESS\n", *data));
return status; return status;
} }
...@@ -294,7 +294,7 @@ ar6k_ReadTargetRegister(HIF_DEVICE *hifDevice, int regsel, u32 *regval) ...@@ -294,7 +294,7 @@ ar6k_ReadTargetRegister(HIF_DEVICE *hifDevice, int regsel, u32 *regval)
HIF_WR_SYNC_BYTE_FIX, HIF_WR_SYNC_BYTE_FIX,
NULL); NULL);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot write CPU_DBG_SEL (%d)\n", regsel)); AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot write CPU_DBG_SEL (%d)\n", regsel));
return status; return status;
} }
...@@ -305,7 +305,7 @@ ar6k_ReadTargetRegister(HIF_DEVICE *hifDevice, int regsel, u32 *regval) ...@@ -305,7 +305,7 @@ ar6k_ReadTargetRegister(HIF_DEVICE *hifDevice, int regsel, u32 *regval)
sizeof(vals), sizeof(vals),
HIF_RD_SYNC_BYTE_INC, HIF_RD_SYNC_BYTE_INC,
NULL); NULL);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot read from CPU_DBG_ADDRESS\n")); AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot read from CPU_DBG_ADDRESS\n"));
return status; return status;
} }
...@@ -335,7 +335,7 @@ _do_write_diag(HIF_DEVICE *hifDevice, u32 addr, u32 value) ...@@ -335,7 +335,7 @@ _do_write_diag(HIF_DEVICE *hifDevice, u32 addr, u32 value)
int status; int status;
status = ar6000_WriteRegDiag(hifDevice, &addr, &value); status = ar6000_WriteRegDiag(hifDevice, &addr, &value);
if (status != A_OK) if (status)
{ {
AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot force Target to execute ROM!\n")); AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot force Target to execute ROM!\n"));
} }
......
...@@ -692,7 +692,7 @@ ar6000_init_module(void) ...@@ -692,7 +692,7 @@ ar6000_init_module(void)
#endif /* CONFIG_HOST_GPIO_SUPPORT */ #endif /* CONFIG_HOST_GPIO_SUPPORT */
status = HIFInit(&osdrvCallbacks); status = HIFInit(&osdrvCallbacks);
if(status != A_OK) if (status)
return -ENODEV; return -ENODEV;
return 0; return 0;
...@@ -1126,7 +1126,7 @@ ar6000_transfer_bin_file(AR_SOFTC_T *ar, AR6K_BIN_FILE file, u32 address, bool c ...@@ -1126,7 +1126,7 @@ ar6000_transfer_bin_file(AR_SOFTC_T *ar, AR6K_BIN_FILE file, u32 address, bool c
status = BMIWriteMemory(ar->arHifDevice, board_ext_address, (A_UCHAR *)(fw_entry->data + board_data_size), board_ext_data_size); status = BMIWriteMemory(ar->arHifDevice, board_ext_address, (A_UCHAR *)(fw_entry->data + board_data_size), board_ext_data_size);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("BMI operation failed: %d\n", __LINE__)); AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("BMI operation failed: %d\n", __LINE__));
A_RELEASE_FIRMWARE(fw_entry); A_RELEASE_FIRMWARE(fw_entry);
return A_ERROR; return A_ERROR;
...@@ -1145,7 +1145,7 @@ ar6000_transfer_bin_file(AR_SOFTC_T *ar, AR6K_BIN_FILE file, u32 address, bool c ...@@ -1145,7 +1145,7 @@ ar6000_transfer_bin_file(AR_SOFTC_T *ar, AR6K_BIN_FILE file, u32 address, bool c
status = BMIWriteMemory(ar->arHifDevice, address, (A_UCHAR *)fw_entry->data, fw_entry_size); status = BMIWriteMemory(ar->arHifDevice, address, (A_UCHAR *)fw_entry->data, fw_entry_size);
} }
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("BMI operation failed: %d\n", __LINE__)); AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("BMI operation failed: %d\n", __LINE__));
A_RELEASE_FIRMWARE(fw_entry); A_RELEASE_FIRMWARE(fw_entry);
return A_ERROR; return A_ERROR;
...@@ -1808,12 +1808,12 @@ ar6000_avail_ev(void *context, void *hif_handle) ...@@ -1808,12 +1808,12 @@ ar6000_avail_ev(void *context, void *hif_handle)
rtnl_lock(); rtnl_lock();
status = (ar6000_init(dev)==0) ? A_OK : A_ERROR; status = (ar6000_init(dev)==0) ? A_OK : A_ERROR;
rtnl_unlock(); rtnl_unlock();
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("ar6000_avail: ar6000_init\n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("ar6000_avail: ar6000_init\n"));
} }
} while (false); } while (false);
if (status != A_OK) { if (status) {
init_status = status; init_status = status;
goto avail_ev_failed; goto avail_ev_failed;
} }
...@@ -1911,7 +1911,7 @@ ar6000_restart_endpoint(struct net_device *dev) ...@@ -1911,7 +1911,7 @@ ar6000_restart_endpoint(struct net_device *dev)
status = (ar6000_init(dev)==0) ? A_OK : A_ERROR; status = (ar6000_init(dev)==0) ? A_OK : A_ERROR;
rtnl_unlock(); rtnl_unlock();
if (status!=A_OK) { if (status) {
break; break;
} }
if (ar->arSsidLen && ar->arWlanState == WLAN_ENABLED) { if (ar->arSsidLen && ar->arWlanState == WLAN_ENABLED) {
...@@ -2666,7 +2666,7 @@ int ar6000_init(struct net_device *dev) ...@@ -2666,7 +2666,7 @@ int ar6000_init(struct net_device *dev)
/* start HTC */ /* start HTC */
status = HTCStart(ar->arHtcTarget); status = HTCStart(ar->arHtcTarget);
if (status != A_OK) { if (status) {
if (ar->arWmiEnabled == true) { if (ar->arWmiEnabled == true) {
wmi_shutdown(ar->arWmi); wmi_shutdown(ar->arWmi);
ar->arWmiEnabled = false; ar->arWmiEnabled = false;
...@@ -3575,13 +3575,13 @@ ar6000_rx(void *Context, HTC_PACKET *pPacket) ...@@ -3575,13 +3575,13 @@ ar6000_rx(void *Context, HTC_PACKET *pPacket)
int status = pPacket->Status; int status = pPacket->Status;
HTC_ENDPOINT_ID ept = pPacket->Endpoint; HTC_ENDPOINT_ID ept = pPacket->Endpoint;
A_ASSERT((status != A_OK) || A_ASSERT((status) ||
(pPacket->pBuffer == (A_NETBUF_DATA(skb) + HTC_HEADER_LEN))); (pPacket->pBuffer == (A_NETBUF_DATA(skb) + HTC_HEADER_LEN)));
AR_DEBUG_PRINTF(ATH_DEBUG_WLAN_RX,("ar6000_rx ar=0x%lx eid=%d, skb=0x%lx, data=0x%lx, len=0x%x status:%d", AR_DEBUG_PRINTF(ATH_DEBUG_WLAN_RX,("ar6000_rx ar=0x%lx eid=%d, skb=0x%lx, data=0x%lx, len=0x%x status:%d",
(unsigned long)ar, ept, (unsigned long)skb, (unsigned long)pPacket->pBuffer, (unsigned long)ar, ept, (unsigned long)skb, (unsigned long)pPacket->pBuffer,
pPacket->ActualLength, status)); pPacket->ActualLength, status));
if (status != A_OK) { if (status) {
if (status != A_ECANCELED) { if (status != A_ECANCELED) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("RX ERR (%d) \n",status)); AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("RX ERR (%d) \n",status));
} }
...@@ -3612,7 +3612,7 @@ ar6000_rx(void *Context, HTC_PACKET *pPacket) ...@@ -3612,7 +3612,7 @@ ar6000_rx(void *Context, HTC_PACKET *pPacket)
AR6000_SPIN_UNLOCK(&ar->arLock, 0); AR6000_SPIN_UNLOCK(&ar->arLock, 0);
skb->dev = ar->arNetDev; skb->dev = ar->arNetDev;
if (status != A_OK) { if (status) {
AR6000_STAT_INC(ar, rx_errors); AR6000_STAT_INC(ar, rx_errors);
A_NETBUF_FREE(skb); A_NETBUF_FREE(skb);
} else if (ar->arWmiEnabled == true) { } else if (ar->arWmiEnabled == true) {
...@@ -3790,7 +3790,7 @@ ar6000_rx(void *Context, HTC_PACKET *pPacket) ...@@ -3790,7 +3790,7 @@ ar6000_rx(void *Context, HTC_PACKET *pPacket)
status = wmi_dot3_2_dix(skb); status = wmi_dot3_2_dix(skb);
} }
if (status != A_OK) { if (status) {
/* Drop frames that could not be processed (lack of memory, etc.) */ /* Drop frames that could not be processed (lack of memory, etc.) */
A_NETBUF_FREE(skb); A_NETBUF_FREE(skb);
goto rx_done; goto rx_done;
...@@ -5335,7 +5335,7 @@ ar6000_control_tx(void *devt, void *osbuf, HTC_ENDPOINT_ID eid) ...@@ -5335,7 +5335,7 @@ ar6000_control_tx(void *devt, void *osbuf, HTC_ENDPOINT_ID eid)
status = A_OK; status = A_OK;
} }
if (status != A_OK) { if (status) {
A_NETBUF_FREE(osbuf); A_NETBUF_FREE(osbuf);
} }
return status; return status;
...@@ -6141,7 +6141,7 @@ ar6000_connect_to_ap(struct ar6_softc *ar) ...@@ -6141,7 +6141,7 @@ ar6000_connect_to_ap(struct ar6_softc *ar)
ar->arSsidLen, ar->arSsid, ar->arSsidLen, ar->arSsid,
ar->arReqBssid, ar->arChannelHint, ar->arReqBssid, ar->arChannelHint,
ar->arConnectCtrlFlags); ar->arConnectCtrlFlags);
if (status != A_OK) { if (status) {
wmi_listeninterval_cmd(ar->arWmi, ar->arListenIntervalT, ar->arListenIntervalB); wmi_listeninterval_cmd(ar->arWmi, ar->arListenIntervalT, ar->arListenIntervalB);
if (!ar->arUserBssFilter) { if (!ar->arUserBssFilter) {
wmi_bssfilter_cmd(ar->arWmi, NONE_BSS_FILTER, 0); wmi_bssfilter_cmd(ar->arWmi, NONE_BSS_FILTER, 0);
......
...@@ -155,7 +155,7 @@ static void ar6000_wow_suspend(AR_SOFTC_T *ar) ...@@ -155,7 +155,7 @@ static void ar6000_wow_suspend(AR_SOFTC_T *ar)
addWowCmd.filter_size = 6; /* MAC address */ addWowCmd.filter_size = 6; /* MAC address */
addWowCmd.filter_offset = 0; addWowCmd.filter_offset = 0;
status = wmi_add_wow_pattern_cmd(ar->arWmi, &addWowCmd, ar->arNetDev->dev_addr, macMask, addWowCmd.filter_size); status = wmi_add_wow_pattern_cmd(ar->arWmi, &addWowCmd, ar->arNetDev->dev_addr, macMask, addWowCmd.filter_size);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Fail to add WoW pattern\n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Fail to add WoW pattern\n"));
} }
} }
...@@ -172,7 +172,7 @@ static void ar6000_wow_suspend(AR_SOFTC_T *ar) ...@@ -172,7 +172,7 @@ static void ar6000_wow_suspend(AR_SOFTC_T *ar)
memset(&ipCmd, 0, sizeof(ipCmd)); memset(&ipCmd, 0, sizeof(ipCmd));
ipCmd.ips[0] = ifa->ifa_local; ipCmd.ips[0] = ifa->ifa_local;
status = wmi_set_ip_cmd(ar->arWmi, &ipCmd); status = wmi_set_ip_cmd(ar->arWmi, &ipCmd);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Fail to setup IP for ARP agent\n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Fail to setup IP for ARP agent\n"));
} }
} }
...@@ -182,13 +182,13 @@ static void ar6000_wow_suspend(AR_SOFTC_T *ar) ...@@ -182,13 +182,13 @@ static void ar6000_wow_suspend(AR_SOFTC_T *ar)
#endif #endif
status = wmi_set_wow_mode_cmd(ar->arWmi, &wowMode); status = wmi_set_wow_mode_cmd(ar->arWmi, &wowMode);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Fail to enable wow mode\n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Fail to enable wow mode\n"));
} }
ar6k_send_asleep_event_to_app(ar, true); ar6k_send_asleep_event_to_app(ar, true);
status = wmi_set_host_sleep_mode_cmd(ar->arWmi, &hostSleepMode); status = wmi_set_host_sleep_mode_cmd(ar->arWmi, &hostSleepMode);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Fail to set host asleep\n")); AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Fail to set host asleep\n"));
} }
...@@ -529,7 +529,7 @@ ar6000_setup_deep_sleep_state(struct ar6_softc *ar, AR6000_WLAN_STATE state) ...@@ -529,7 +529,7 @@ ar6000_setup_deep_sleep_state(struct ar6_softc *ar, AR6000_WLAN_STATE state)
} }
} while (0); } while (0);
if (status!=A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Fail to enter/exit deep sleep %d\n", state)); AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Fail to enter/exit deep sleep %d\n", state));
} }
...@@ -628,7 +628,7 @@ ar6000_update_wlan_pwr_state(struct ar6_softc *ar, AR6000_WLAN_STATE state, bool ...@@ -628,7 +628,7 @@ ar6000_update_wlan_pwr_state(struct ar6_softc *ar, AR6000_WLAN_STATE state, bool
} }
if (status!=A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Fail to setup WLAN state %d\n", ar->arWlanState)); AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Fail to setup WLAN state %d\n", ar->arWlanState));
ar->arWlanState = oldstate; ar->arWlanState = oldstate;
} else if (status == A_OK) { } else if (status == A_OK) {
......
...@@ -311,7 +311,7 @@ ar6k_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, ...@@ -311,7 +311,7 @@ ar6k_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
ar->arChannelHint); ar->arChannelHint);
up(&ar->arSem); up(&ar->arSem);
if (status != A_OK) { if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: wmi_reconnect_cmd failed\n", __func__)); AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: wmi_reconnect_cmd failed\n", __func__));
return -EIO; return -EIO;
} }
...@@ -410,7 +410,7 @@ ar6k_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, ...@@ -410,7 +410,7 @@ ar6k_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
ar->arSsidLen = 0; ar->arSsidLen = 0;
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Invalid request\n", __func__)); AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Invalid request\n", __func__));
return -ENOENT; return -ENOENT;
} else if (status != A_OK) { } else if (status) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: wmi_connect_cmd failed\n", __func__)); AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: wmi_connect_cmd failed\n", __func__));
return -EIO; return -EIO;
} }
...@@ -892,7 +892,7 @@ ar6k_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev, ...@@ -892,7 +892,7 @@ ar6k_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev,
(u8 *)mac_addr, SYNC_BOTH_WMIFLAG); (u8 *)mac_addr, SYNC_BOTH_WMIFLAG);
if(status != A_OK) { if (status) {
return -EIO; return -EIO;
} }
...@@ -1015,7 +1015,7 @@ ar6k_cfg80211_set_default_key(struct wiphy *wiphy, struct net_device *ndev, ...@@ -1015,7 +1015,7 @@ ar6k_cfg80211_set_default_key(struct wiphy *wiphy, struct net_device *ndev,
ar->arPairwiseCrypto, GROUP_USAGE | TX_USAGE, ar->arPairwiseCrypto, GROUP_USAGE | TX_USAGE,
key->key_len, key->seq, key->key, KEY_OP_INIT_VAL, key->key_len, key->seq, key->key, KEY_OP_INIT_VAL,
NULL, SYNC_BOTH_WMIFLAG); NULL, SYNC_BOTH_WMIFLAG);
if (status != A_OK) { if (status) {
return -EIO; return -EIO;
} }
......
...@@ -1127,7 +1127,7 @@ hcibridge_init_module(void) ...@@ -1127,7 +1127,7 @@ hcibridge_init_module(void)
hciTransCallbacks.cleanupTransport = ar6000_cleanup_hci; hciTransCallbacks.cleanupTransport = ar6000_cleanup_hci;
status = ar6000_register_hci_transport(&hciTransCallbacks); status = ar6000_register_hci_transport(&hciTransCallbacks);
if(status != A_OK) if (status)
return -ENODEV; return -ENODEV;
return 0; return 0;
......
...@@ -1826,7 +1826,7 @@ ar6000_ioctl_setkey(AR_SOFTC_T *ar, struct ieee80211req_key *ik) ...@@ -1826,7 +1826,7 @@ ar6000_ioctl_setkey(AR_SOFTC_T *ar, struct ieee80211req_key *ik)
ik->ik_keydata, KEY_OP_INIT_VAL, ik->ik_macaddr, ik->ik_keydata, KEY_OP_INIT_VAL, ik->ik_macaddr,
SYNC_BOTH_WMIFLAG); SYNC_BOTH_WMIFLAG);
if (status != A_OK) { if (status) {
return -EIO; return -EIO;
} }
} else { } else {
...@@ -2003,7 +2003,7 @@ int ar6000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) ...@@ -2003,7 +2003,7 @@ int ar6000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
status = wmi_setPmkid_cmd(ar->arWmi, req.pi_bssid, req.pi_pmkid, status = wmi_setPmkid_cmd(ar->arWmi, req.pi_bssid, req.pi_pmkid,
req.pi_enable); req.pi_enable);
if (status != A_OK) { if (status) {
ret = -EIO; ret = -EIO;
goto ioctl_done; goto ioctl_done;
} }
......
...@@ -622,7 +622,7 @@ ar6000_ioctl_siwessid(struct net_device *dev, ...@@ -622,7 +622,7 @@ ar6000_ioctl_siwessid(struct net_device *dev,
status = wmi_reconnect_cmd(ar->arWmi,ar->arReqBssid, status = wmi_reconnect_cmd(ar->arWmi,ar->arReqBssid,
ar->arChannelHint); ar->arChannelHint);
up(&ar->arSem); up(&ar->arSem);
if (status != A_OK) { if (status) {
return -EIO; return -EIO;
} }
return 0; return 0;
...@@ -1575,7 +1575,7 @@ ar6000_ioctl_siwpmksa(struct net_device *dev, ...@@ -1575,7 +1575,7 @@ ar6000_ioctl_siwpmksa(struct net_device *dev,
ret=-1; ret=-1;
break; break;
} }
if (status != A_OK) { if (status) {
ret = -1; ret = -1;
} }
...@@ -1793,7 +1793,7 @@ ar6000_ioctl_siwencodeext(struct net_device *dev, ...@@ -1793,7 +1793,7 @@ ar6000_ioctl_siwencodeext(struct net_device *dev,
keyData, KEY_OP_INIT_VAL, keyData, KEY_OP_INIT_VAL,
(u8 *)ext->addr.sa_data, (u8 *)ext->addr.sa_data,
SYNC_BOTH_WMIFLAG); SYNC_BOTH_WMIFLAG);
if (status != A_OK) { if (status) {
return -EIO; return -EIO;
} }
......
...@@ -92,7 +92,7 @@ aggr_init(ALLOC_NETBUFS netbuf_allocator) ...@@ -92,7 +92,7 @@ aggr_init(ALLOC_NETBUFS netbuf_allocator)
A_PRINTF("going out of aggr_init..status %s\n", A_PRINTF("going out of aggr_init..status %s\n",
(status == A_OK) ? "OK":"Error"); (status == A_OK) ? "OK":"Error");
if(status != A_OK) { if (status) {
/* Cleanup */ /* Cleanup */
aggr_module_destroy(p_aggr); aggr_module_destroy(p_aggr);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment