//Fragmentation might be required
frag_threshold = pfirmware->cmdpacket_frag_thresold;
do {
- if((buffer_len - frag_offset) > frag_threshold) {
+ if ((buffer_len - frag_offset) > frag_threshold) {
frag_length = frag_threshold ;
bLastIniPkt = 0;
tcb_desc->txbuf_size= (u16)i;
skb_put(skb, i);
- if(!priv->ieee80211->check_nic_enough_desc(dev,tcb_desc->queue_index)||
+ if (!priv->ieee80211->check_nic_enough_desc(dev,tcb_desc->queue_index)||
(!skb_queue_empty(&priv->ieee80211->skb_waitQ[tcb_desc->queue_index]))||\
(priv->ieee80211->queue_stop) ) {
RT_TRACE(COMP_FIRMWARE,"=====================================================> tx full!\n");
memset(ptr_buf,0,Length);
tcb_desc->txbuf_size= (u16)Length;
- if(!priv->ieee80211->check_nic_enough_desc(dev,tcb_desc->queue_index)||
+ if (!priv->ieee80211->check_nic_enough_desc(dev,tcb_desc->queue_index)||
(!skb_queue_empty(&priv->ieee80211->skb_waitQ[tcb_desc->queue_index]))||\
(priv->ieee80211->queue_stop) ) {
RT_TRACE(COMP_FIRMWARE,"===================NULL packet==================================> tx full!\n");
do {
CPU_status = read_nic_dword(dev, CPU_GEN);
- if(CPU_status&CPU_GEN_PUT_CODE_OK)
+ if (CPU_status&CPU_GEN_PUT_CODE_OK)
break;
}while(check_putcodeOK_time--);
- if(!(CPU_status&CPU_GEN_PUT_CODE_OK)) {
+ if (!(CPU_status&CPU_GEN_PUT_CODE_OK)) {
RT_TRACE(COMP_ERR, "Download Firmware: Put code fail!\n");
goto CPUCheckMainCodeOKAndTurnOnCPU_Fail;
} else {
do {
CPU_status = read_nic_dword(dev, CPU_GEN);
- if(CPU_status&CPU_GEN_BOOT_RDY)
+ if (CPU_status&CPU_GEN_BOOT_RDY)
break;
}while(check_bootOk_time--);
- if(!(CPU_status&CPU_GEN_BOOT_RDY)) {
+ if (!(CPU_status&CPU_GEN_BOOT_RDY)) {
goto CPUCheckMainCodeOKAndTurnOnCPU_Fail;
} else {
RT_TRACE(COMP_FIRMWARE, "Download Firmware: Boot ready!\n");
do {
CPU_status = read_nic_dword(dev, CPU_GEN);
- if(CPU_status&CPU_GEN_FIRM_RDY)
+ if (CPU_status&CPU_GEN_FIRM_RDY)
break;
}while(check_time--);
- if(!(CPU_status&CPU_GEN_FIRM_RDY))
+ if (!(CPU_status&CPU_GEN_FIRM_RDY))
goto CPUCheckFirmwareReady_Fail;
else
RT_TRACE(COMP_FIRMWARE, "Download Firmware: Firmware ready!\n");
starting_state = FW_INIT_STEP0_BOOT;
// TODO: system reset
- }else if(pfirmware->firmware_status == FW_STATUS_5_READY) {
+ }else if (pfirmware->firmware_status == FW_STATUS_5_READY) {
/* it is called by Initialize */
rst_opt = OPT_FIRMWARE_RESET;
starting_state = FW_INIT_STEP2_DATA;
* Open image file, and map file to continuous memory if open file success.
* or read image file from array. Default load from IMG file
*/
- if(rst_opt == OPT_SYSTEM_RESET) {
+ if (rst_opt == OPT_SYSTEM_RESET) {
rc = request_firmware(&fw_entry, fw_name[init_step],&priv->udev->dev);
- if(rc < 0 ) {
+ if (rc < 0 ) {
RT_TRACE(COMP_ERR, "request firmware fail!\n");
goto download_firmware_fail;
}
- if(fw_entry->size > sizeof(pfirmware->firmware_buf)) {
+ if (fw_entry->size > sizeof(pfirmware->firmware_buf)) {
RT_TRACE(COMP_ERR, "img file size exceed the container buffer fail!\n");
goto download_firmware_fail;
}
- if(init_step != FW_INIT_STEP1_MAIN) {
+ if (init_step != FW_INIT_STEP1_MAIN) {
memcpy(pfirmware->firmware_buf,fw_entry->data,fw_entry->size);
mapped_file = pfirmware->firmware_buf;
file_length = fw_entry->size;
#endif
}
pfirmware->firmware_buf_size = file_length;
- }else if(rst_opt == OPT_FIRMWARE_RESET ) {
+ }else if (rst_opt == OPT_FIRMWARE_RESET ) {
/* we only need to download data.img here */
mapped_file = pfirmware->firmware_buf;
file_length = pfirmware->firmware_buf_size;
* and Tx descriptor info
* */
rt_status = fw_download_code(dev,mapped_file,file_length);
- if(rst_opt == OPT_SYSTEM_RESET) {
+ if (rst_opt == OPT_SYSTEM_RESET) {
release_firmware(fw_entry);
}
- if(rt_status != TRUE) {
+ if (rt_status != TRUE) {
goto download_firmware_fail;
}
#ifdef RTL8190P
// To initialize IMEM, CPU move code from 0x80000080, hence, we send 0x80 byte packet
rt_status = fwSendNullPacket(dev, RTL8190_CPU_START_OFFSET);
- if(rt_status != true)
+ if (rt_status != true)
{
RT_TRACE(COMP_INIT, "fwSendNullPacket() fail ! \n");
goto download_firmware_fail;
/* Check Put Code OK and Turn On CPU */
rt_status = CPUcheck_maincodeok_turnonCPU(dev);
- if(rt_status != TRUE) {
+ if (rt_status != TRUE) {
RT_TRACE(COMP_ERR, "CPUcheck_maincodeok_turnonCPU fail!\n");
goto download_firmware_fail;
}
mdelay(1);
rt_status = CPUcheck_firmware_ready(dev);
- if(rt_status != TRUE) {
+ if (rt_status != TRUE) {
RT_TRACE(COMP_ERR, "CPUcheck_firmware_ready fail(%d)!\n",rt_status);
goto download_firmware_fail;
}