static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
{
PPER_TARANG_DATA pTarang = (PPER_TARANG_DATA)filp->private_data;
+ void __user *argp = (void __user *)argp;
PMINI_ADAPTER Adapter = pTarang->Adapter;
INT Status = STATUS_FAILURE;
- IOCTL_BUFFER IoBuffer={0};
+ IOCTL_BUFFER IoBuffer={};
#ifndef BCM_SHM_INTERFACE
int timeout = 0;
#endif
if(_IOC_TYPE(cmd) != BCM_IOCTL)
return -EFAULT;
if(_IOC_DIR(cmd) & _IOC_READ)
- Status = !access_ok(VERIFY_WRITE, (PVOID)arg, _IOC_SIZE(cmd));
+ Status = !access_ok(VERIFY_WRITE, argp, _IOC_SIZE(cmd));
else if (_IOC_DIR(cmd) & _IOC_WRITE)
- Status = !access_ok(VERIFY_READ, (PVOID)arg, _IOC_SIZE(cmd));
+ Status = !access_ok(VERIFY_READ, argp, _IOC_SIZE(cmd));
else if (_IOC_NONE == (_IOC_DIR(cmd) & _IOC_NONE))
Status = STATUS_SUCCESS;
PCHAR temp_buff = NULL;
UINT Bufflen = 0;
/* Copy Ioctl Buffer structure */
- if(copy_from_user((PCHAR)&IoBuffer, (PCHAR)arg,
+ if(copy_from_user((PCHAR)&IoBuffer, argp,
sizeof(IOCTL_BUFFER)))
{
Status = -EFAULT;
bcm_kfree(temp_buff);
return Status;
}
- if(copy_to_user((PCHAR)IoBuffer.OutputBuffer,
+ if(copy_to_user(IoBuffer.OutputBuffer,
(PCHAR)temp_buff, (UINT)IoBuffer.OutputLength))
{
Status = -EFAULT;
UINT uiTempVar=0;
/* Copy Ioctl Buffer structure */
- if(copy_from_user((PCHAR)&IoBuffer, (PCHAR)arg,
+ if(copy_from_user(&IoBuffer, argp,
sizeof(IOCTL_BUFFER)))
{
Status = -EFAULT;
break;
}
/* Copy Ioctl Buffer structure */
- if(copy_from_user((PCHAR)&IoBuffer, (PCHAR)arg,
+ if(copy_from_user(&IoBuffer, argp,
sizeof(IOCTL_BUFFER)))
{
Status = -EFAULT;
bcm_kfree(temp_buff);
return Status;
}
- if(copy_to_user((PCHAR)IoBuffer.OutputBuffer,
+ if(copy_to_user(IoBuffer.OutputBuffer,
(PCHAR)temp_buff, (UINT)IoBuffer.OutputLength))
{
Status = -EFAULT;
break;
}
/* Copy Ioctl Buffer structure */
- if(copy_from_user((PCHAR)&IoBuffer, (PCHAR)arg,
+ if(copy_from_user((PCHAR)&IoBuffer, argp,
sizeof(IOCTL_BUFFER)))
{
Status = -EFAULT;
Status = -EACCES;
break;
}
- if(copy_from_user((PCHAR)&IoBuffer, (PCHAR)arg, sizeof(IOCTL_BUFFER)))
+ if(copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER)))
{
Status = -EFAULT;
break;
Status = -EACCES;
break;
}
- Status =copy_from_user((PCHAR)&IoBuffer, (PCHAR)arg, sizeof(IOCTL_BUFFER));
+ Status =copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER));
if(Status)
{
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0,"Failed while copying the IOBufer from user space err:%d",Status);
Status = -EACCES;
break;
}
- if(copy_from_user((PCHAR)&IoBuffer, (PCHAR)arg, sizeof(IOCTL_BUFFER)))
+ if(copy_from_user((PCHAR)&IoBuffer, argp, sizeof(IOCTL_BUFFER)))
{
Status = -EFAULT;
break;
Status = -EINVAL;
break;
}
- Status = copy_from_user( (PCHAR)&IoBuffer, ( PCHAR)arg, sizeof( IOCTL_BUFFER));
+ Status = copy_from_user( (PCHAR)&IoBuffer, argp, sizeof( IOCTL_BUFFER));
if(Status)
{
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0,"Failed while copying the IOBufer from user space err:%d",Status);
pgpio_multi_info[WIMAX_IDX].uiGPIOMask);
}
- Status = copy_to_user( (PCHAR)IoBuffer.OutputBuffer, &gpio_multi_info, IoBuffer.OutputLength);
+ Status = copy_to_user(IoBuffer.OutputBuffer, &gpio_multi_info, IoBuffer.OutputLength);
if(Status)
{
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0,"Failed while copying Content to IOBufer for user space err:%d",Status);
Status = -EINVAL;
break;
}
- Status = copy_from_user( (PCHAR)&IoBuffer, ( PCHAR)arg, sizeof( IOCTL_BUFFER));
+ Status = copy_from_user(&IoBuffer, argp, sizeof( IOCTL_BUFFER));
if(Status)
{
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0,"Failed while copying the IOBufer from user space err:%d",Status);
{
pgpio_multi_mode[WIMAX_IDX].uiGPIOMode = *( UINT*) ucResetValue;
}
- Status = copy_to_user( (PCHAR)IoBuffer.OutputBuffer, &gpio_multi_mode, IoBuffer.OutputLength);
+ Status = copy_to_user(IoBuffer.OutputBuffer, &gpio_multi_mode, IoBuffer.OutputLength);
if(Status)
{
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0,"Failed while copying Content to IOBufer for user space err:%d",Status);
{
PVOID pvBuffer=NULL;
/* Copy Ioctl Buffer structure */
- if(copy_from_user((PCHAR)&IoBuffer, (PCHAR)arg,
+ if(copy_from_user(&IoBuffer, argp,
sizeof(IOCTL_BUFFER)))
{
Status = -EFAULT;
break;
}
/* Copy Ioctl Buffer structure */
- if(copy_from_user((PCHAR)&IoBuffer, (PCHAR)arg,
- sizeof(IOCTL_BUFFER)))
+ if(copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER)))
{
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "copy_from_user 1 failed\n");
Status = -EFAULT;
break;
case IOCTL_GET_PACK_INFO:
- if(copy_to_user((PCHAR)arg, &Adapter->PackInfo,
+ if(copy_to_user(argp, &Adapter->PackInfo,
sizeof(PacketInfo)*NO_OF_QUEUES))
{
Status = -EFAULT;
case IOCTL_BCM_SWITCH_TRANSFER_MODE:
{
UINT uiData = 0;
- if(copy_from_user(&uiData, (PUINT)arg, sizeof(UINT)))
+ if(copy_from_user(&uiData, argp, sizeof(UINT)))
{
Status = -EFAULT;
break;
case IOCTL_BCM_GET_DRIVER_VERSION:
{
/* Copy Ioctl Buffer structure */
- if(copy_from_user((PCHAR)&IoBuffer,
- (PCHAR)arg, sizeof(IOCTL_BUFFER)))
+ if(copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER)))
{
Status = -EFAULT;
break;
}
- if(copy_to_user((PUCHAR)IoBuffer.OutputBuffer,
+ if(copy_to_user(IoBuffer.OutputBuffer,
VER_FILEVERSION_STR, (UINT)IoBuffer.OutputLength))
{
Status = -EFAULT;
{
LINK_STATE *plink_state = NULL;
/* Copy Ioctl Buffer structure */
- if(copy_from_user((PCHAR)&IoBuffer,
- (PCHAR)arg, sizeof(IOCTL_BUFFER)))
+ if(copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER)))
{
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "copy_from_user failed..\n");
Status = -EFAULT;
plink_state->bIdleMode = (UCHAR)Adapter->IdleMode;
plink_state->bShutdownMode = Adapter->bShutStatus;
plink_state->ucLinkStatus = (UCHAR)Adapter->LinkStatus;
- if(copy_to_user((PUCHAR)IoBuffer.OutputBuffer,
+ if(copy_to_user(IoBuffer.OutputBuffer,
(PUCHAR)plink_state, (UINT)IoBuffer.OutputLength))
{
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "Copy_to_user Failed..\n");
{
UINT tracing_flag;
/* copy ioctl Buffer structure */
- if(copy_from_user((PCHAR)&IoBuffer,
- (PCHAR)arg, sizeof(IOCTL_BUFFER)))
+ if(copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER)))
{
Status = -EFAULT;
break;
}
- if(copy_from_user((PCHAR)&tracing_flag,
- (PCHAR)IoBuffer.InputBuffer,sizeof(UINT)))
+ if(copy_from_user(&tracing_flag, IoBuffer.InputBuffer,sizeof(UINT)))
{
Status = -EFAULT;
break;
case IOCTL_BCM_GET_DSX_INDICATION:
{
ULONG ulSFId=0;
- if(copy_from_user((PCHAR)&IoBuffer, (PCHAR)arg,
+ if(copy_from_user((PCHAR)&IoBuffer, argp,
sizeof(IOCTL_BUFFER)))
{
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "Invalid IO buffer!!!" );
IoBuffer.OutputLength, sizeof(stLocalSFAddIndicationAlt));
return -EINVAL;
}
- if(copy_from_user((PCHAR)&ulSFId, (PCHAR)IoBuffer.InputBuffer,
+ if(copy_from_user(&ulSFId, IoBuffer.InputBuffer,
sizeof(ulSFId)))
{
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0,"Invalid SFID!!! %lu", ulSFId );
{
PCHAR temp_buff;
- if(copy_from_user((PCHAR)&IoBuffer,
- (PCHAR)arg, sizeof(IOCTL_BUFFER)))
+ if(copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER)))
{
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "Copy_from user for IoBuff failed\n");
Status = -EFAULT;
Status = GetDroppedAppCntrlPktMibs((PVOID)temp_buff,
(PPER_TARANG_DATA)filp->private_data);
- if(copy_to_user((PCHAR)IoBuffer.OutputBuffer,(PCHAR)temp_buff,
+ if(copy_to_user(IoBuffer.OutputBuffer,(PCHAR)temp_buff,
sizeof(S_MIBS_HOST_STATS_MIBS)))
{
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "Copy to user failed\n");
break;
}
/* Copy Ioctl Buffer structure */
- if(copy_from_user((PCHAR)&IoBuffer, (PCHAR)arg, sizeof(IOCTL_BUFFER)))
+ if(copy_from_user((PCHAR)&IoBuffer, argp, sizeof(IOCTL_BUFFER)))
{
Status = -EFAULT;
break;
case IOCTL_BCM_GET_NVM_SIZE:
{
- if(copy_from_user((unsigned char *)&IoBuffer,
- (unsigned char *)arg, sizeof(IOCTL_BUFFER)))
+ if(copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER)))
{
//IOLog("failed NVM first");
Status = -EFAULT;
UINT uiSectorSize = 0 ;
if(Adapter->eNVMType == NVM_FLASH)
{
- Status = copy_from_user((PCHAR)&IoBuffer, (PCHAR)arg, sizeof(IOCTL_BUFFER));
+ Status = copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER));
if(Status)
{
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0,"Copy From User space failed. status :%d", Status);
return Status;
}
- uiSectorSize = *((PUINT)(IoBuffer.InputBuffer));
+ uiSectorSize = *((PUINT)(IoBuffer.InputBuffer)); /* FIXME: unchecked __user access */
if((uiSectorSize < MIN_SECTOR_SIZE) || (uiSectorSize > MAX_SECTOR_SIZE))
{
// BCM_DEBUG_PRINT (Adapter, DBG_TYPE_PRINTK, 0, 0, "Entered the ioctl %x \n", IOCTL_BCM_SET_DEBUG );
BCM_DEBUG_PRINT (Adapter, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL, "In SET_DEBUG ioctl\n");
- Status = copy_from_user((PCHAR)&IoBuffer, (PCHAR)arg, sizeof(IOCTL_BUFFER));
+ Status = copy_from_user((PCHAR)&IoBuffer, argp, sizeof(IOCTL_BUFFER));
if(Status)
{
BCM_DEBUG_PRINT (Adapter, DBG_TYPE_PRINTK, 0, 0, "Copy from user failed\n");
break;
}
- Status = copy_from_user(&sUserDebugState,(USER_BCM_DBG_STATE *)IoBuffer.InputBuffer, sizeof(USER_BCM_DBG_STATE));
+ Status = copy_from_user(&sUserDebugState,IoBuffer.InputBuffer, sizeof(USER_BCM_DBG_STATE));
if(Status)
{
BCM_DEBUG_PRINT (Adapter, DBG_TYPE_PRINTK, 0, 0, "Copy of IoBuffer.InputBuffer failed");
case IOCTL_BCM_NVM_WRITE:
{
- NVM_READWRITE stNVMReadWrite = {0};
+ NVM_READWRITE stNVMReadWrite = {};
PUCHAR pReadData = NULL;
- PUCHAR pBuffertobeCopied = NULL;
+ void __user * pBuffertobeCopied = NULL;
ULONG ulDSDMagicNumInUsrBuff = 0 ;
struct timeval tv0, tv1;
memset(&tv0,0,sizeof(struct timeval));
/* Copy Ioctl Buffer structure */
- if(copy_from_user((PCHAR)&IoBuffer, (PCHAR)arg, sizeof(IOCTL_BUFFER)))
+ if(copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER)))
{
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0,"copy_from_user failed\n");
Status = -EFAULT;
bcm_kfree(pReadData);
return Status;
}
- if(copy_to_user((PCHAR)stNVMReadWrite.pBuffer,
- (PCHAR)pReadData, (UINT)stNVMReadWrite.uiNumBytes))
+ if(copy_to_user(stNVMReadWrite.pBuffer,
+ pReadData, (UINT)stNVMReadWrite.uiNumBytes))
{
bcm_kfree(pReadData);
Status = -EFAULT;
UINT BuffSize = 0;
UINT ReadBytes = 0;
UINT ReadOffset = 0;
- PUCHAR OutPutBuff = NULL;
+ char __user *OutPutBuff = NULL;
if(IsFlash2x(Adapter) != TRUE)
{
}
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL, "IOCTL_BCM_FLASH2X_SECTION_READ Called");
- Status = copy_from_user((PCHAR)&IoBuffer, (PCHAR)arg, sizeof(IOCTL_BUFFER));
+ Status = copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER));
if(Status)
{
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "Copy of IOCTL BUFFER failed");
}
//Reading FLASH 2.x READ structure
- Status = copy_from_user((PUCHAR)&sFlash2xRead, (PUCHAR)IoBuffer.InputBuffer,sizeof(FLASH2X_READWRITE));
+ Status = copy_from_user(&sFlash2xRead, IoBuffer.InputBuffer,sizeof(FLASH2X_READWRITE));
if(Status)
{
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "Copy of Input Buffer failed");
BuffSize = NOB ;
ReadOffset = sFlash2xRead.offset ;
- OutPutBuff = (PUCHAR)(IoBuffer.OutputBuffer) ;
+ OutPutBuff = IoBuffer.OutputBuffer;
pReadBuff = (PCHAR)kzalloc(BuffSize , GFP_KERNEL);
{
FLASH2X_READWRITE sFlash2xWrite = {0};
PUCHAR pWriteBuff = NULL;
- PUCHAR InputAddr = NULL;
+ void __user *InputAddr = NULL;
UINT NOB = 0;
UINT BuffSize = 0;
UINT WriteOffset = 0;
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL, " IOCTL_BCM_FLASH2X_SECTION_WRITE Called");
- Status = copy_from_user((PCHAR)&IoBuffer, (PCHAR)arg, sizeof(IOCTL_BUFFER));
+ Status = copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER));
if(Status)
{
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "Copy of IOCTL BUFFER failed");
}
//Reading FLASH 2.x READ structure
- Status = copy_from_user((PCHAR)&sFlash2xWrite, (PCHAR)IoBuffer.InputBuffer, sizeof(FLASH2X_READWRITE));
+ Status = copy_from_user(&sFlash2xWrite, IoBuffer.InputBuffer, sizeof(FLASH2X_READWRITE));
if(Status)
{
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "Reading of output Buffer from IOCTL buffer fails");
if(validateFlash2xReadWrite(Adapter,&sFlash2xWrite) == FALSE)
return STATUS_FAILURE ;
- InputAddr = (PCHAR)(sFlash2xWrite.pDataBuff) ;
+ InputAddr = sFlash2xWrite.pDataBuff;
WriteOffset = sFlash2xWrite.offset ;
NOB = sFlash2xWrite.numOfBytes;
PFLASH2X_BITMAP psFlash2xBitMap = NULL ;
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL, "IOCTL_BCM_GET_FLASH2X_SECTION_BITMAP Called");
- Status = copy_from_user((PCHAR)&IoBuffer, (PCHAR)arg, sizeof(IOCTL_BUFFER));
+ Status = copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER));
if(Status)
{
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "Copy of IOCTL BUFFER failed");
BcmGetFlash2xSectionalBitMap(Adapter, psFlash2xBitMap);
up(&Adapter->NVMRdmWrmLock);
- Status = copy_to_user((PCHAR)IoBuffer.OutputBuffer, (PCHAR)psFlash2xBitMap, sizeof(FLASH2X_BITMAP));
+ Status = copy_to_user(IoBuffer.OutputBuffer, psFlash2xBitMap, sizeof(FLASH2X_BITMAP));
if(Status)
{
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "copying Flash2x bitMap failed");
return -EINVAL;
}
- Status = copy_from_user((PCHAR)&IoBuffer, (PCHAR)arg, sizeof(IOCTL_BUFFER));
+ Status = copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER));
if(Status)
{
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "Copy of IOCTL BUFFER failed");
return Status;
}
- Status = copy_from_user((PCHAR)&eFlash2xSectionVal,(PCHAR)IoBuffer.InputBuffer, sizeof(INT));
+ Status = copy_from_user(&eFlash2xSectionVal,IoBuffer.InputBuffer, sizeof(INT));
if(Status)
{
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "Copy of flash section val failed");
return -EINVAL;
}
- Status = copy_from_user((PCHAR)&IoBuffer, (PCHAR)arg, sizeof(IOCTL_BUFFER));
+ Status = copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER));
if(Status)
{
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "Copy of IOCTL BUFFER failed Status :%d", Status);
return Status;
}
- Status = copy_from_user((PCHAR)&sCopySectStrut,(PCHAR)IoBuffer.InputBuffer, sizeof(FLASH2X_COPY_SECTION));
+ Status = copy_from_user(&sCopySectStrut,IoBuffer.InputBuffer, sizeof(FLASH2X_COPY_SECTION));
if(Status)
{
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "Copy of Copy_Section_Struct failed with Status :%d", Status);
Status = STATUS_SUCCESS;
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL, " IOCTL_BCM_GET_FLASH_CS_INFO Called");
- Status = copy_from_user((PCHAR)&IoBuffer, (PCHAR)arg, sizeof(IOCTL_BUFFER));
+ Status = copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER));
if(Status)
{
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "Copy of IOCTL BUFFER failed");
break;
}
- Status = copy_to_user((PCHAR)IoBuffer.OutputBuffer, (PCHAR)Adapter->psFlash2xCSInfo, sizeof(FLASH2X_CS_INFO));
+ Status = copy_to_user(IoBuffer.OutputBuffer, Adapter->psFlash2xCSInfo, sizeof(FLASH2X_CS_INFO));
if(Status)
{
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "copying Flash2x cs info failed");
Status = -EINVAL;
break;
}
- Status = copy_to_user((PCHAR)IoBuffer.OutputBuffer, (PCHAR)Adapter->psFlashCSInfo, sizeof(FLASH_CS_INFO));
+ Status = copy_to_user(IoBuffer.OutputBuffer, Adapter->psFlashCSInfo, sizeof(FLASH_CS_INFO));
if(Status)
{
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "copying Flash CS info failed");
return -EINVAL;
}
- Status = copy_from_user((PCHAR)&IoBuffer, (PCHAR)arg, sizeof(IOCTL_BUFFER));
+ Status = copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER));
if(Status)
{
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "Copy of IOCTL BUFFER failed");
return Status;
}
- Status = copy_from_user((PCHAR)&eFlash2xSectionVal,(PCHAR)IoBuffer.InputBuffer, sizeof(INT));
+ Status = copy_from_user(&eFlash2xSectionVal,IoBuffer.InputBuffer, sizeof(INT));
if(Status)
{
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "Copy of flash section val failed");
case IOCTL_BCM_NVM_RAW_READ :
{
- NVM_READWRITE stNVMRead = {0};
+ NVM_READWRITE stNVMRead = {};
INT NOB ;
INT BuffSize ;
INT ReadOffset = 0;
UINT ReadBytes = 0 ;
PUCHAR pReadBuff = NULL ;
- PUCHAR OutPutBuff = NULL ;
+ char __user *OutPutBuff = NULL ;
if(Adapter->eNVMType != NVM_FLASH)
{
}
/* Copy Ioctl Buffer structure */
- if(copy_from_user((PCHAR)&IoBuffer, (PCHAR)arg, sizeof(IOCTL_BUFFER)))
+ if(copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER)))
{
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "copy_from_user 1 failed\n");
Status = -EFAULT;
break;
}
- if(copy_from_user(&stNVMRead, (PUCHAR)IoBuffer.OutputBuffer,sizeof(NVM_READWRITE)))
+ if(copy_from_user(&stNVMRead, IoBuffer.OutputBuffer,sizeof(NVM_READWRITE)))
{
Status = -EFAULT;
break;
BuffSize = NOB ;
ReadOffset = stNVMRead.uiOffset ;
- OutPutBuff = (PUCHAR)(stNVMRead.pBuffer) ;
+ OutPutBuff = stNVMRead.pBuffer;
pReadBuff = (PCHAR)kzalloc(BuffSize , GFP_KERNEL);
ULONG RxCntrlMsgBitMask = 0 ;
/* Copy Ioctl Buffer structure */
- Status = copy_from_user((PCHAR)&IoBuffer, (PCHAR)arg, sizeof(IOCTL_BUFFER));
+ Status = copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER));
if(Status)
{
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL,"copy of Ioctl buffer is failed from user space");
DevInfo.u32NVMType = Adapter->eNVMType;
DevInfo.u32InterfaceType = BCM_USB;
- Status = copy_from_user((PCHAR)&IoBuffer, (PCHAR)arg, sizeof(IOCTL_BUFFER));
+ Status = copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER));
if(Status)
{
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "Copy of IOCTL BUFFER failed");
Status = -EINVAL;
break;
}
- Status = copy_to_user((PCHAR)IoBuffer.OutputBuffer, (PCHAR)&DevInfo, sizeof(DevInfo));
+ Status = copy_to_user(IoBuffer.OutputBuffer, &DevInfo, sizeof(DevInfo));
if(Status)
{
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0,"copying Dev info structure to user space buffer failed");
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL,"IOCTL_BCM_TIME_SINCE_NET_ENTRY called");
- Status = copy_from_user((PCHAR)&IoBuffer, (PCHAR)arg, sizeof(IOCTL_BUFFER));
+ Status = copy_from_user(&IoBuffer, argp, sizeof(IOCTL_BUFFER));
if(Status)
{
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "Copy of IOCTL BUFFER failed");
do_gettimeofday(&tv);
stTimeElapsedSinceNetEntry.ul64TimeElapsedSinceNetEntry = tv.tv_sec - Adapter->liTimeSinceLastNetEntry;
- Status = copy_to_user((PCHAR)IoBuffer.OutputBuffer, (PCHAR)&stTimeElapsedSinceNetEntry, sizeof(ST_TIME_ELAPSED));
+ Status = copy_to_user(IoBuffer.OutputBuffer, &stTimeElapsedSinceNetEntry, sizeof(ST_TIME_ELAPSED));
if(Status)
{
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0,"copying ST_TIME_ELAPSED structure to user space buffer failed");
//
//-----------------------------------------------------------------------------
-UCHAR ReadEEPROMStatusRegister( PMINI_ADAPTER Adapter )
+static UCHAR ReadEEPROMStatusRegister( PMINI_ADAPTER Adapter )
{
UCHAR uiData = 0;
DWORD dwRetries = MAX_EEPROM_RETRIES*RETRIES_PER_DELAY;
//-----------------------------------------------------------------------------
-INT FlashSectorErase(PMINI_ADAPTER Adapter,
+static INT FlashSectorErase(PMINI_ADAPTER Adapter,
UINT addr,
UINT numOfSectors)
{
//
//-----------------------------------------------------------------------------
-INT flashByteWrite(
+static INT flashByteWrite(
PMINI_ADAPTER Adapter,
UINT uiOffset,
PVOID pData)
//
//-----------------------------------------------------------------------------
-INT flashWrite(
+static INT flashWrite(
PMINI_ADAPTER Adapter,
UINT uiOffset,
PVOID pData)
// OSAL_STATUS_CODE
//
//-----------------------------------------------------------------------------
-INT flashByteWriteStatus(
+static INT flashByteWriteStatus(
PMINI_ADAPTER Adapter,
UINT uiOffset,
PVOID pData)
//
//-----------------------------------------------------------------------------
-INT flashWriteStatus(
+static INT flashWriteStatus(
PMINI_ADAPTER Adapter,
UINT uiOffset,
PVOID pData)
//
//-----------------------------------------------------------------------------
-VOID BcmRestoreBlockProtectStatus(PMINI_ADAPTER Adapter,ULONG ulWriteStatus)
+static VOID BcmRestoreBlockProtectStatus(PMINI_ADAPTER Adapter,ULONG ulWriteStatus)
{
UINT value;
value = (FLASH_CMD_WRITE_ENABLE<< 24);
// ULONG - Status value before UnProtect.
//
//-----------------------------------------------------------------------------
-ULONG BcmFlashUnProtectBlock(PMINI_ADAPTER Adapter,UINT uiOffset, UINT uiLength)
+static ULONG BcmFlashUnProtectBlock(PMINI_ADAPTER Adapter,UINT uiOffset, UINT uiLength)
{
ULONG ulStatus = 0;
ULONG ulWriteStatus = 0;
uiSectBoundary = uiSectAlignAddr + Adapter->uiSectorSize;
//pTempBuff = OsalMemAlloc(MAX_SECTOR_SIZE,'!MVN');
- pTempBuff = OsalMemAlloc(Adapter->uiSectorSize ,'!MVN');
+ pTempBuff = OsalMemAlloc(Adapter->uiSectorSize ,"!MVN");
if(NULL == pTempBuff)
{
goto BeceemFlashBulkWrite_EXIT;
//
//-----------------------------------------------------------------------------
-INT BeceemFlashBulkWriteStatus(
+static INT BeceemFlashBulkWriteStatus(
PMINI_ADAPTER Adapter,
PUINT pBuffer,
UINT uiOffset,
// pTempBuff = OsalMemAlloc(MAX_SECTOR_SIZE,'!MVN');
- pTempBuff = OsalMemAlloc(Adapter->uiSectorSize,'!MVN');
+ pTempBuff = OsalMemAlloc(Adapter->uiSectorSize,"!MVN");
if(NULL == pTempBuff)
{
goto BeceemFlashBulkWriteStatus_EXIT;
INT PropagateCalParamsFromEEPROMToMemory(PMINI_ADAPTER Adapter)
{
- PCHAR pBuff = OsalMemAlloc(BUFFER_4K,'3MVN');
+ PCHAR pBuff = OsalMemAlloc(BUFFER_4K,"3MVN");
UINT uiEepromSize = 0;
UINT uiIndex = 0;
UINT uiBytesToCopy = 0;
//
//-----------------------------------------------------------------------------
-INT BeceemEEPROMReadBackandVerify(
+static INT BeceemEEPROMReadBackandVerify(
PMINI_ADAPTER Adapter,
PUINT pBuffer,
UINT uiOffset,
return 0;
}
-VOID BcmSwapWord(UINT *ptr1) {
+static VOID BcmSwapWord(UINT *ptr1) {
UINT tempval = (UINT)*ptr1;
char *ptr2 = (char *)&tempval;
// OSAL_STATUS_CODE
//
//-----------------------------------------------------------------------------
-INT BeceemEEPROMWritePage( PMINI_ADAPTER Adapter, UINT uiData[], UINT uiOffset )
+static INT BeceemEEPROMWritePage( PMINI_ADAPTER Adapter, UINT uiData[], UINT uiOffset )
{
UINT uiRetries = MAX_EEPROM_RETRIES*RETRIES_PER_DELAY;
UINT uiStatus = 0;
// <OSAL_STATUS_CODE>
//-----------------------------------------------------------------------------
-INT BcmInitEEPROMQueues(PMINI_ADAPTER Adapter)
+static INT BcmInitEEPROMQueues(PMINI_ADAPTER Adapter)
{
UINT value = 0;
/* CHIP Bug : Clear the Avail bits on the Read queue. The default
// Returns:
// Flash ID
//-----------------------------------------------------------------------------
-ULONG BcmReadFlashRDID(PMINI_ADAPTER Adapter)
+static ULONG BcmReadFlashRDID(PMINI_ADAPTER Adapter)
{
ULONG ulRDID = 0;
UINT value;
return STATUS_SUCCESS ;
}
-INT BcmDumpFlash2XCSStructure(PFLASH2X_CS_INFO psFlash2xCSInfo,PMINI_ADAPTER Adapter)
+static INT BcmDumpFlash2XCSStructure(PFLASH2X_CS_INFO psFlash2xCSInfo,PMINI_ADAPTER Adapter)
{
UINT Index = 0;
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, NVM_RW, DBG_LVL_ALL, "**********************FLASH2X CS Structure *******************");
}
-INT ConvertEndianOf2XCSStructure(PFLASH2X_CS_INFO psFlash2xCSInfo)
+static INT ConvertEndianOf2XCSStructure(PFLASH2X_CS_INFO psFlash2xCSInfo)
{
UINT Index = 0;
psFlash2xCSInfo->MagicNumber = ntohl(psFlash2xCSInfo->MagicNumber);
return STATUS_SUCCESS;
}
-INT ConvertEndianOfCSStructure(PFLASH_CS_INFO psFlashCSInfo)
+static INT ConvertEndianOfCSStructure(PFLASH_CS_INFO psFlashCSInfo)
{
//UINT Index = 0;
psFlashCSInfo->MagicNumber =ntohl(psFlashCSInfo->MagicNumber);
(Adapter->psFlash2xVendorInfo->VendorSection[section].OffsetFromZeroForSectionStart != UNINIT_PTR_IN_CS) );
}
-VOID UpdateVendorInfo(PMINI_ADAPTER Adapter)
+static VOID UpdateVendorInfo(PMINI_ADAPTER Adapter)
{
B_UINT32 i = 0;
UINT uiSizeSection = 0;
return FALSE;
}
-INT BcmDumpFlash2xSectionBitMap(PFLASH2X_BITMAP psFlash2xBitMap)
+static INT BcmDumpFlash2xSectionBitMap(PFLASH2X_BITMAP psFlash2xBitMap)
{
PMINI_ADAPTER Adapter = GET_BCM_ADAPTER(gblpnetdev);
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, NVM_RW, DBG_LVL_ALL, "***************Flash 2.x Section Bitmap***************");
**/
INT BcmSetActiveSection(PMINI_ADAPTER Adapter, FLASH2X_SECTION_VAL eFlash2xSectVal)
{
- INT SectImagePriority = 0;
+ unsigned int SectImagePriority = 0;
INT Status =STATUS_SUCCESS;
//DSD_HEADER sDSD = {0};
INT ReadDSDPriority(PMINI_ADAPTER Adapter, FLASH2X_SECTION_VAL dsd)
{
//UINT priOffsetInMap = 0 ;
- INT uiDSDPri = STATUS_FAILURE;
+ unsigned int uiDSDPri = STATUS_FAILURE;
//DSD_HEADER dsdHeader = {0};
//priOffsetInMap = (PUCHAR)&(dsdHeader.DSDImagePriority) -(PUCHAR)&dsdHeader;
if(IsSectionWritable(Adapter,dsd))
INT ReadISOPriority(PMINI_ADAPTER Adapter, FLASH2X_SECTION_VAL iso)
{
- INT ISOPri = STATUS_FAILURE;
+ unsigned int ISOPri = STATUS_FAILURE;
if(IsSectionWritable(Adapter,iso))
{
if(ReadISOSignature(Adapter,iso)== ISO_IMAGE_MAGIC_NUMBER)
INT CorruptDSDSig(PMINI_ADAPTER Adapter, FLASH2X_SECTION_VAL eFlash2xSectionVal)
{
- PUCHAR pBuff = 0 ;
+ PUCHAR pBuff = NULL;
UINT sig = 0;
UINT uiOffset = 0;
UINT BlockStatus = 0;
INT CorruptISOSig(PMINI_ADAPTER Adapter, FLASH2X_SECTION_VAL eFlash2xSectionVal)
{
- PUCHAR pBuff = 0 ;
+ PUCHAR pBuff = NULL;
UINT sig = 0;
UINT uiOffset = 0;