Commit 44a17eff authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Greg Kroah-Hartman

staging/bcm: add sparse annotations

This marks up the code where sparse complains in most cases.
Most of the changes are in the ioctl handling code, which
gets __user annotations, finding one unchecked user access.

The rest is mostly about marking functions static when they
are only used in one file.
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 9f1c75ac
...@@ -652,7 +652,7 @@ typedef struct _ETH_HEADER_STRUC ETH_HEADER_STRUC, *PETH_HEADER_STRUC; ...@@ -652,7 +652,7 @@ typedef struct _ETH_HEADER_STRUC ETH_HEADER_STRUC, *PETH_HEADER_STRUC;
typedef struct FirmwareInfo typedef struct FirmwareInfo
{ {
PVOID pvMappedFirmwareAddress; void __user * pvMappedFirmwareAddress;
ULONG u32FirmwareLength; ULONG u32FirmwareLength;
ULONG u32StartingAddress; ULONG u32StartingAddress;
}__attribute__((packed)) FIRMWARE_INFO, *PFIRMWARE_INFO; }__attribute__((packed)) FIRMWARE_INFO, *PFIRMWARE_INFO;
......
This diff is collapsed.
...@@ -111,7 +111,7 @@ static struct net_device_stats *bcm_get_stats(struct net_device *dev) ...@@ -111,7 +111,7 @@ static struct net_device_stats *bcm_get_stats(struct net_device *dev)
Register other driver entry points with the kernel Register other driver entry points with the kernel
*/ */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
struct net_device_ops bcmNetDevOps = { static struct net_device_ops bcmNetDevOps = {
.ndo_open = bcm_open, .ndo_open = bcm_open,
.ndo_stop = bcm_close, .ndo_stop = bcm_close,
.ndo_get_stats = bcm_get_stats, .ndo_get_stats = bcm_get_stats,
......
...@@ -1014,7 +1014,7 @@ static VOID CopyToAdapter( register PMINI_ADAPTER Adapter, /**<Pointer to the A ...@@ -1014,7 +1014,7 @@ static VOID CopyToAdapter( register PMINI_ADAPTER Adapter, /**<Pointer to the A
* *
* Returns - None * Returns - None
*************************************************************************/ *************************************************************************/
VOID DumpCmControlPacket(PVOID pvBuffer) static VOID DumpCmControlPacket(PVOID pvBuffer)
{ {
UINT uiLoopIndex; UINT uiLoopIndex;
UINT nIndex; UINT nIndex;
...@@ -2362,7 +2362,7 @@ BOOLEAN CmControlResponseMessage(PMINI_ADAPTER Adapter, /**<Pointer to the Adap ...@@ -2362,7 +2362,7 @@ BOOLEAN CmControlResponseMessage(PMINI_ADAPTER Adapter, /**<Pointer to the Adap
return TRUE; return TRUE;
} }
int get_dsx_sf_data_to_application(PMINI_ADAPTER Adapter, UINT uiSFId, PUCHAR user_buffer) int get_dsx_sf_data_to_application(PMINI_ADAPTER Adapter, UINT uiSFId, void __user *user_buffer)
{ {
int status = 0; int status = 0;
struct _packet_info *psSfInfo=NULL; struct _packet_info *psSfInfo=NULL;
...@@ -2375,8 +2375,8 @@ int get_dsx_sf_data_to_application(PMINI_ADAPTER Adapter, UINT uiSFId, PUCHAR us ...@@ -2375,8 +2375,8 @@ int get_dsx_sf_data_to_application(PMINI_ADAPTER Adapter, UINT uiSFId, PUCHAR us
} }
BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "status =%d",status); BCM_DEBUG_PRINT( Adapter,DBG_TYPE_OTHERS, CONN_MSG, DBG_LVL_ALL, "status =%d",status);
psSfInfo=&Adapter->PackInfo[status]; psSfInfo=&Adapter->PackInfo[status];
if(psSfInfo->pstSFIndication && copy_to_user((PCHAR)user_buffer, if(psSfInfo->pstSFIndication && copy_to_user(user_buffer,
(PCHAR)psSfInfo->pstSFIndication, sizeof(stLocalSFAddIndicationAlt))) psSfInfo->pstSFIndication, sizeof(stLocalSFAddIndicationAlt)))
{ {
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "copy to user failed SFID %d, present in queue !!!", uiSFId ); BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "copy to user failed SFID %d, present in queue !!!", uiSFId );
status = -EFAULT; status = -EFAULT;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
static UINT current_debug_level=BCM_SCREAM; static UINT current_debug_level=BCM_SCREAM;
int bcm_print_buffer( UINT debug_level, const char *function_name, int bcm_print_buffer( UINT debug_level, const char *function_name,
char *file_name, int line_number, unsigned char *buffer, int bufferlen, unsigned int base) char *file_name, int line_number, unsigned char *buffer, int bufferlen, enum _BASE_TYPE base)
{ {
static const char * const buff_dump_base[] = { static const char * const buff_dump_base[] = {
"DEC", "HEX", "OCT", "BIN" "DEC", "HEX", "OCT", "BIN"
......
...@@ -223,7 +223,7 @@ int control_packet_handler (PMINI_ADAPTER Adapter /**< pointer to adapter obje ...@@ -223,7 +223,7 @@ int control_packet_handler (PMINI_ADAPTER Adapter /**< pointer to adapter obje
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
INT flushAllAppQ() INT flushAllAppQ(void)
{ {
PMINI_ADAPTER Adapter = GET_BCM_ADAPTER(gblpnetdev); PMINI_ADAPTER Adapter = GET_BCM_ADAPTER(gblpnetdev);
PPER_TARANG_DATA pTarang = NULL; PPER_TARANG_DATA pTarang = NULL;
......
#include "headers.h" #include "headers.h"
UCHAR * GetNextIPV6ChainedHeader(UCHAR **ppucPayload,UCHAR *pucNextHeader,BOOLEAN *bParseDone,USHORT *pusPayloadLength) static UCHAR * GetNextIPV6ChainedHeader(UCHAR **ppucPayload,UCHAR *pucNextHeader,BOOLEAN *bParseDone,USHORT *pusPayloadLength)
{ {
UCHAR *pucRetHeaderPtr = NULL; UCHAR *pucRetHeaderPtr = NULL;
UCHAR *pucPayloadPtr = NULL; UCHAR *pucPayloadPtr = NULL;
...@@ -130,7 +130,7 @@ UCHAR * GetNextIPV6ChainedHeader(UCHAR **ppucPayload,UCHAR *pucNextHeader,BOOLEA ...@@ -130,7 +130,7 @@ UCHAR * GetNextIPV6ChainedHeader(UCHAR **ppucPayload,UCHAR *pucNextHeader,BOOLEA
} }
UCHAR GetIpv6ProtocolPorts(UCHAR *pucPayload,USHORT *pusSrcPort,USHORT *pusDestPort,USHORT usPayloadLength,UCHAR ucNextHeader) static UCHAR GetIpv6ProtocolPorts(UCHAR *pucPayload,USHORT *pusSrcPort,USHORT *pusDestPort,USHORT usPayloadLength,UCHAR ucNextHeader)
{ {
UCHAR *pIpv6HdrScanContext = pucPayload; UCHAR *pIpv6HdrScanContext = pucPayload;
BOOLEAN bDone = FALSE; BOOLEAN bDone = FALSE;
......
...@@ -22,7 +22,7 @@ int InterfaceFileDownload( PVOID arg, ...@@ -22,7 +22,7 @@ int InterfaceFileDownload( PVOID arg,
while(1) while(1)
{ {
oldfs=get_fs(); set_fs(get_ds()); oldfs=get_fs(); set_fs(get_ds());
len=vfs_read(flp, buff, MAX_TRANSFER_CTRL_BYTE_USB, &pos); len=vfs_read(flp, (void __force __user *)buff, MAX_TRANSFER_CTRL_BYTE_USB, &pos);
set_fs(oldfs); set_fs(oldfs);
if(len<=0) if(len<=0)
{ {
...@@ -83,7 +83,7 @@ int InterfaceFileReadbackFromChip( PVOID arg, ...@@ -83,7 +83,7 @@ int InterfaceFileReadbackFromChip( PVOID arg,
while(1) while(1)
{ {
oldfs=get_fs(); set_fs(get_ds()); oldfs=get_fs(); set_fs(get_ds());
len=vfs_read(flp, buff, MAX_TRANSFER_CTRL_BYTE_USB, &pos); len=vfs_read(flp, (void __force __user *)buff, MAX_TRANSFER_CTRL_BYTE_USB, &pos);
set_fs(oldfs); set_fs(oldfs);
fw_down++; fw_down++;
if(len<=0) if(len<=0)
...@@ -381,7 +381,7 @@ int bcm_ioctl_fw_download(PMINI_ADAPTER Adapter, FIRMWARE_INFO *psFwInfo) ...@@ -381,7 +381,7 @@ int bcm_ioctl_fw_download(PMINI_ADAPTER Adapter, FIRMWARE_INFO *psFwInfo)
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL,"Failed in allocation memory"); BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL,"Failed in allocation memory");
return -ENOMEM; return -ENOMEM;
} }
retval = copy_from_user(buff,(PUCHAR)psFwInfo->pvMappedFirmwareAddress, psFwInfo->u32FirmwareLength); retval = copy_from_user(buff,psFwInfo->pvMappedFirmwareAddress, psFwInfo->u32FirmwareLength);
if(retval != STATUS_SUCCESS) if(retval != STATUS_SUCCESS)
{ {
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "copying buffer from user space failed"); BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "copying buffer from user space failed");
......
...@@ -42,7 +42,7 @@ send to f/w with in 200 ms after the Idle/Shutdown req issued ...@@ -42,7 +42,7 @@ send to f/w with in 200 ms after the Idle/Shutdown req issued
*/ */
int InterfaceIdleModeRespond(PMINI_ADAPTER Adapter,int* puiBuffer) int InterfaceIdleModeRespond(PMINI_ADAPTER Adapter, unsigned int* puiBuffer)
{ {
int status = STATUS_SUCCESS; int status = STATUS_SUCCESS;
unsigned int uiRegRead = 0; unsigned int uiRegRead = 0;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
INT InterfaceIdleModeWakeup(PMINI_ADAPTER Adapter); INT InterfaceIdleModeWakeup(PMINI_ADAPTER Adapter);
INT InterfaceIdleModeRespond(PMINI_ADAPTER Adapter,PINT puiBuffer); INT InterfaceIdleModeRespond(PMINI_ADAPTER Adapter, unsigned int *puiBuffer);
VOID InterfaceWriteIdleModeWakePattern(PMINI_ADAPTER Adapter); VOID InterfaceWriteIdleModeWakePattern(PMINI_ADAPTER Adapter);
......
...@@ -68,12 +68,12 @@ static int usbbcm_release(struct inode *inode, struct file *file) ...@@ -68,12 +68,12 @@ static int usbbcm_release(struct inode *inode, struct file *file)
return 0; return 0;
} }
static ssize_t usbbcm_read(struct file *file, char *buffer, size_t count, loff_t *ppos) static ssize_t usbbcm_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
{ {
return 0; return 0;
} }
static ssize_t usbbcm_write(struct file *file, const char *user_buffer, size_t count, loff_t *ppos) static ssize_t usbbcm_write(struct file *file, const char __user *user_buffer, size_t count, loff_t *ppos)
{ {
return 0; return 0;
} }
...@@ -188,14 +188,12 @@ usbbcm_device_probe(struct usb_interface *intf, const struct usb_device_id *id) ...@@ -188,14 +188,12 @@ usbbcm_device_probe(struct usb_interface *intf, const struct usb_device_id *id)
} }
/* Allocate Adapter structure */ /* Allocate Adapter structure */
if((psAdapter = kmalloc(sizeof(MINI_ADAPTER), GFP_KERNEL)) == NULL) if((psAdapter = kzalloc(sizeof(MINI_ADAPTER), GFP_KERNEL)) == NULL)
{ {
//BCM_DEBUG_PRINT(psAdapter,DBG_TYPE_PRINTK, 0, 0, "Out of memory"); BCM_DEBUG_PRINT(psAdapter,DBG_TYPE_PRINTK, 0, 0, "Out of memory");
return -ENOMEM; return -ENOMEM;
} }
memset(psAdapter, 0, sizeof(MINI_ADAPTER));
/* Init default driver debug state */ /* Init default driver debug state */
psAdapter->stDebugState.debug_level = DBG_LVL_CURR; psAdapter->stDebugState.debug_level = DBG_LVL_CURR;
...@@ -618,9 +616,9 @@ INT InterfaceAdapterInit(PS_INTERFACE_ADAPTER psIntfAdapter) ...@@ -618,9 +616,9 @@ INT InterfaceAdapterInit(PS_INTERFACE_ADAPTER psIntfAdapter)
if((psIntfAdapter->bHighSpeedDevice == FALSE) && bcm_usb_endpoint_is_bulk_out(endpoint)) if((psIntfAdapter->bHighSpeedDevice == FALSE) && bcm_usb_endpoint_is_bulk_out(endpoint))
{ {
// Once BULK is selected in FS mode. Revert it back to INT. Else USB_IF will fail. // Once BULK is selected in FS mode. Revert it back to INT. Else USB_IF will fail.
UINT uiData = ntohl(EP2_CFG_INT); UINT _uiData = ntohl(EP2_CFG_INT);
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL,"Reverting Bulk to INT as it is FS MODE"); BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL,"Reverting Bulk to INT as it is FS MODE");
BeceemEEPROMBulkWrite(psIntfAdapter->psAdapter,(PUCHAR)&uiData,0x136,4,TRUE); BeceemEEPROMBulkWrite(psIntfAdapter->psAdapter,(PUCHAR)&_uiData,0x136,4,TRUE);
} }
} }
else else
...@@ -773,7 +771,8 @@ INT InterfaceAdapterInit(PS_INTERFACE_ADAPTER psIntfAdapter) ...@@ -773,7 +771,8 @@ INT InterfaceAdapterInit(PS_INTERFACE_ADAPTER psIntfAdapter)
return 0; return 0;
} }
int InterfaceSuspend (struct usb_interface *intf, pm_message_t message)
static int InterfaceSuspend (struct usb_interface *intf, pm_message_t message)
{ {
PS_INTERFACE_ADAPTER psIntfAdapter = usb_get_intfdata(intf); PS_INTERFACE_ADAPTER psIntfAdapter = usb_get_intfdata(intf);
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "=================================\n"); BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "=================================\n");
...@@ -802,7 +801,8 @@ int InterfaceSuspend (struct usb_interface *intf, pm_message_t message) ...@@ -802,7 +801,8 @@ int InterfaceSuspend (struct usb_interface *intf, pm_message_t message)
return 0; return 0;
} }
int InterfaceResume (struct usb_interface *intf)
static int InterfaceResume (struct usb_interface *intf)
{ {
PS_INTERFACE_ADAPTER psIntfAdapter = usb_get_intfdata(intf); PS_INTERFACE_ADAPTER psIntfAdapter = usb_get_intfdata(intf);
printk("=================================\n"); printk("=================================\n");
...@@ -816,12 +816,14 @@ int InterfaceResume (struct usb_interface *intf) ...@@ -816,12 +816,14 @@ int InterfaceResume (struct usb_interface *intf)
InterfaceRx(psIntfAdapter); InterfaceRx(psIntfAdapter);
return 0; return 0;
} }
int InterfacePreReset(struct usb_interface *intf)
static int InterfacePreReset(struct usb_interface *intf)
{ {
printk("====================>"); printk("====================>");
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
int InterfacePostReset(struct usb_interface *intf)
static int InterfacePostReset(struct usb_interface *intf)
{ {
printk("Do Post chip reset setting here if it is required"); printk("Do Post chip reset setting here if it is required");
return STATUS_SUCCESS; return STATUS_SUCCESS;
......
...@@ -18,9 +18,9 @@ typedef struct wrmbuffer ...@@ -18,9 +18,9 @@ typedef struct wrmbuffer
typedef struct ioctlbuffer typedef struct ioctlbuffer
{ {
PVOID InputBuffer; void __user *InputBuffer;
ULONG InputLength; ULONG InputLength;
PVOID OutputBuffer; void __user *OutputBuffer;
ULONG OutputLength; ULONG OutputLength;
}__attribute__((packed)) IOCTL_BUFFER, *PIOCTL_BUFFER; }__attribute__((packed)) IOCTL_BUFFER, *PIOCTL_BUFFER;
...@@ -209,7 +209,7 @@ typedef struct _DEVICE_DRIVER_INFO ...@@ -209,7 +209,7 @@ typedef struct _DEVICE_DRIVER_INFO
typedef struct _NVM_READWRITE typedef struct _NVM_READWRITE
{ {
void *pBuffer; void __user *pBuffer;
// Data to be written from|read to. Memory should be allocated by the caller. // Data to be written from|read to. Memory should be allocated by the caller.
uint32_t uiOffset; uint32_t uiOffset;
...@@ -269,7 +269,7 @@ typedef struct _FLASH2X_READWRITE ...@@ -269,7 +269,7 @@ typedef struct _FLASH2X_READWRITE
B_UINT32 offset; //Offset within Section. B_UINT32 offset; //Offset within Section.
B_UINT32 numOfBytes; //NOB from the offset B_UINT32 numOfBytes; //NOB from the offset
B_UINT32 bVerify; B_UINT32 bVerify;
PVOID pDataBuff; //Buffer for reading/writing void __user *pDataBuff; //Buffer for reading/writing
}FLASH2X_READWRITE, *PFLASH2X_READWRITE; }FLASH2X_READWRITE, *PFLASH2X_READWRITE;
/* /*
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* Returns - None * Returns - None
**********************************************************************/ **********************************************************************/
VOID UpdateTokenCount(register PMINI_ADAPTER Adapter) static VOID UpdateTokenCount(register PMINI_ADAPTER Adapter)
{ {
ULONG liCurrentTime; ULONG liCurrentTime;
INT i = 0; INT i = 0;
......
...@@ -503,6 +503,7 @@ INT CopyBufferToControlPacket(PMINI_ADAPTER Adapter,/**<Logical Adapter*/ ...@@ -503,6 +503,7 @@ INT CopyBufferToControlPacket(PMINI_ADAPTER Adapter,/**<Logical Adapter*/
return Status; return Status;
} }
#if 0
/***************************************************************** /*****************************************************************
* Function - SendStatisticsPointerRequest() * Function - SendStatisticsPointerRequest()
* *
...@@ -514,7 +515,7 @@ INT CopyBufferToControlPacket(PMINI_ADAPTER Adapter,/**<Logical Adapter*/ ...@@ -514,7 +515,7 @@ INT CopyBufferToControlPacket(PMINI_ADAPTER Adapter,/**<Logical Adapter*/
* *
* Returns - None. * Returns - None.
*****************************************************************/ *****************************************************************/
VOID SendStatisticsPointerRequest(PMINI_ADAPTER Adapter, static VOID SendStatisticsPointerRequest(PMINI_ADAPTER Adapter,
PLINK_REQUEST pstStatisticsPtrRequest) PLINK_REQUEST pstStatisticsPtrRequest)
{ {
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL, "======>"); BCM_DEBUG_PRINT(Adapter,DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL, "======>");
...@@ -526,7 +527,7 @@ VOID SendStatisticsPointerRequest(PMINI_ADAPTER Adapter, ...@@ -526,7 +527,7 @@ VOID SendStatisticsPointerRequest(PMINI_ADAPTER Adapter,
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL, "<====="); BCM_DEBUG_PRINT(Adapter,DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL, "<=====");
return; return;
} }
#endif
void SendLinkDown(PMINI_ADAPTER Adapter) void SendLinkDown(PMINI_ADAPTER Adapter)
...@@ -1379,7 +1380,7 @@ int bcm_parse_target_params(PMINI_ADAPTER Adapter) ...@@ -1379,7 +1380,7 @@ int bcm_parse_target_params(PMINI_ADAPTER Adapter)
return -ENOENT; return -ENOENT;
} }
oldfs=get_fs(); set_fs(get_ds()); oldfs=get_fs(); set_fs(get_ds());
len=vfs_read(flp, buff, BUFFER_1K, &pos); len=vfs_read(flp, (void __user __force *)buff, BUFFER_1K, &pos);
set_fs(oldfs); set_fs(oldfs);
if(len != sizeof(STARGETPARAMS)) if(len != sizeof(STARGETPARAMS))
...@@ -1535,7 +1536,9 @@ VOID doPowerAutoCorrection(PMINI_ADAPTER psAdapter) ...@@ -1535,7 +1536,9 @@ VOID doPowerAutoCorrection(PMINI_ADAPTER psAdapter)
BCM_DEBUG_PRINT(psAdapter,DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL,"Using Forced User Choice: %lx\n", psAdapter->ulPowerSaveMode); BCM_DEBUG_PRINT(psAdapter,DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL,"Using Forced User Choice: %lx\n", psAdapter->ulPowerSaveMode);
} }
} }
unsigned char *ReadMacAddrEEPROM(PMINI_ADAPTER Adapter, ulong dwAddress)
#if 0
static unsigned char *ReadMacAddrEEPROM(PMINI_ADAPTER Adapter, ulong dwAddress)
{ {
unsigned char *pucmacaddr = NULL; unsigned char *pucmacaddr = NULL;
int status = 0, i=0; int status = 0, i=0;
...@@ -1575,6 +1578,7 @@ unsigned char *ReadMacAddrEEPROM(PMINI_ADAPTER Adapter, ulong dwAddress) ...@@ -1575,6 +1578,7 @@ unsigned char *ReadMacAddrEEPROM(PMINI_ADAPTER Adapter, ulong dwAddress)
OUT: OUT:
return pucmacaddr; return pucmacaddr;
} }
#endif
#if 0 #if 0
INT ReadMacAddressFromEEPROM(PMINI_ADAPTER Adapter) INT ReadMacAddressFromEEPROM(PMINI_ADAPTER Adapter)
...@@ -1614,7 +1618,7 @@ INT ReadMacAddressFromEEPROM(PMINI_ADAPTER Adapter) ...@@ -1614,7 +1618,7 @@ INT ReadMacAddressFromEEPROM(PMINI_ADAPTER Adapter)
} }
#endif #endif
void convertEndian(B_UINT8 rwFlag, PUINT puiBuffer, UINT uiByteCount) static void convertEndian(B_UINT8 rwFlag, PUINT puiBuffer, UINT uiByteCount)
{ {
UINT uiIndex = 0; UINT uiIndex = 0;
...@@ -1814,7 +1818,7 @@ int rdmaltWithLock (PMINI_ADAPTER Adapter, UINT uiAddress, PUINT pucBuff, size_t ...@@ -1814,7 +1818,7 @@ int rdmaltWithLock (PMINI_ADAPTER Adapter, UINT uiAddress, PUINT pucBuff, size_t
} }
VOID HandleShutDownModeWakeup(PMINI_ADAPTER Adapter) static VOID HandleShutDownModeWakeup(PMINI_ADAPTER Adapter)
{ {
int clear_abort_pattern = 0,Status = 0; int clear_abort_pattern = 0,Status = 0;
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, MP_SHUTDOWN, DBG_LVL_ALL, "====>\n"); BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, MP_SHUTDOWN, DBG_LVL_ALL, "====>\n");
...@@ -1844,7 +1848,7 @@ VOID HandleShutDownModeWakeup(PMINI_ADAPTER Adapter) ...@@ -1844,7 +1848,7 @@ VOID HandleShutDownModeWakeup(PMINI_ADAPTER Adapter)
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, MP_SHUTDOWN, DBG_LVL_ALL, "<====\n"); BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, MP_SHUTDOWN, DBG_LVL_ALL, "<====\n");
} }
VOID SendShutModeResponse(PMINI_ADAPTER Adapter) static VOID SendShutModeResponse(PMINI_ADAPTER Adapter)
{ {
CONTROL_MESSAGE stShutdownResponse; CONTROL_MESSAGE stShutdownResponse;
UINT NVMAccess = 0,lowPwrAbortMsg = 0; UINT NVMAccess = 0,lowPwrAbortMsg = 0;
......
...@@ -1345,7 +1345,7 @@ BOOLEAN DerefPhsRule(IN B_UINT16 uiClsId,S_CLASSIFIER_TABLE *psaClassifiertable ...@@ -1345,7 +1345,7 @@ BOOLEAN DerefPhsRule(IN B_UINT16 uiClsId,S_CLASSIFIER_TABLE *psaClassifiertable
} }
} }
void DumpBuffer(PVOID BuffVAddress, int xferSize) static void DumpBuffer(PVOID BuffVAddress, int xferSize)
{ {
int i; int i;
int iPrintLength; int iPrintLength;
......
...@@ -108,8 +108,7 @@ int wrmalt (PMINI_ADAPTER Adapter, UINT uiAddress, PUINT pucBuff, size_t sSize); ...@@ -108,8 +108,7 @@ int wrmalt (PMINI_ADAPTER Adapter, UINT uiAddress, PUINT pucBuff, size_t sSize);
int rdmalt (PMINI_ADAPTER Adapter, UINT uiAddress, PUINT pucBuff, size_t sSize); int rdmalt (PMINI_ADAPTER Adapter, UINT uiAddress, PUINT pucBuff, size_t sSize);
int get_dsx_sf_data_to_application(PMINI_ADAPTER Adapter, UINT uiSFId, int get_dsx_sf_data_to_application(PMINI_ADAPTER Adapter, UINT uiSFId, void __user * user_buffer);
PUCHAR user_buffer);
void SendLinkDown(PMINI_ADAPTER Adapter); void SendLinkDown(PMINI_ADAPTER Adapter);
......
...@@ -692,7 +692,7 @@ USHORT ClassifyPacket(PMINI_ADAPTER Adapter,struct sk_buff* skb) ...@@ -692,7 +692,7 @@ USHORT ClassifyPacket(PMINI_ADAPTER Adapter,struct sk_buff* skb)
return INVALID_QUEUE_INDEX; return INVALID_QUEUE_INDEX;
} }
BOOLEAN EthCSMatchSrcMACAddress(S_CLASSIFIER_RULE *pstClassifierRule,PUCHAR Mac) static BOOLEAN EthCSMatchSrcMACAddress(S_CLASSIFIER_RULE *pstClassifierRule,PUCHAR Mac)
{ {
UINT i=0; UINT i=0;
PMINI_ADAPTER Adapter = GET_BCM_ADAPTER(gblpnetdev); PMINI_ADAPTER Adapter = GET_BCM_ADAPTER(gblpnetdev);
...@@ -709,7 +709,7 @@ BOOLEAN EthCSMatchSrcMACAddress(S_CLASSIFIER_RULE *pstClassifierRule,PUCHAR Mac) ...@@ -709,7 +709,7 @@ BOOLEAN EthCSMatchSrcMACAddress(S_CLASSIFIER_RULE *pstClassifierRule,PUCHAR Mac)
return TRUE; return TRUE;
} }
BOOLEAN EthCSMatchDestMACAddress(S_CLASSIFIER_RULE *pstClassifierRule,PUCHAR Mac) static BOOLEAN EthCSMatchDestMACAddress(S_CLASSIFIER_RULE *pstClassifierRule,PUCHAR Mac)
{ {
UINT i=0; UINT i=0;
PMINI_ADAPTER Adapter = GET_BCM_ADAPTER(gblpnetdev); PMINI_ADAPTER Adapter = GET_BCM_ADAPTER(gblpnetdev);
...@@ -726,7 +726,7 @@ BOOLEAN EthCSMatchDestMACAddress(S_CLASSIFIER_RULE *pstClassifierRule,PUCHAR Mac ...@@ -726,7 +726,7 @@ BOOLEAN EthCSMatchDestMACAddress(S_CLASSIFIER_RULE *pstClassifierRule,PUCHAR Mac
return TRUE; return TRUE;
} }
BOOLEAN EthCSMatchEThTypeSAP(S_CLASSIFIER_RULE *pstClassifierRule,struct sk_buff* skb,PS_ETHCS_PKT_INFO pstEthCsPktInfo) static BOOLEAN EthCSMatchEThTypeSAP(S_CLASSIFIER_RULE *pstClassifierRule,struct sk_buff* skb,PS_ETHCS_PKT_INFO pstEthCsPktInfo)
{ {
PMINI_ADAPTER Adapter = GET_BCM_ADAPTER(gblpnetdev); PMINI_ADAPTER Adapter = GET_BCM_ADAPTER(gblpnetdev);
if((pstClassifierRule->ucEtherTypeLen==0)|| if((pstClassifierRule->ucEtherTypeLen==0)||
...@@ -761,7 +761,7 @@ BOOLEAN EthCSMatchEThTypeSAP(S_CLASSIFIER_RULE *pstClassifierRule,struct sk_buff ...@@ -761,7 +761,7 @@ BOOLEAN EthCSMatchEThTypeSAP(S_CLASSIFIER_RULE *pstClassifierRule,struct sk_buff
} }
BOOLEAN EthCSMatchVLANRules(S_CLASSIFIER_RULE *pstClassifierRule,struct sk_buff* skb,PS_ETHCS_PKT_INFO pstEthCsPktInfo) static BOOLEAN EthCSMatchVLANRules(S_CLASSIFIER_RULE *pstClassifierRule,struct sk_buff* skb,PS_ETHCS_PKT_INFO pstEthCsPktInfo)
{ {
BOOLEAN bClassificationSucceed = FALSE; BOOLEAN bClassificationSucceed = FALSE;
USHORT usVLANID; USHORT usVLANID;
......
...@@ -22,7 +22,7 @@ BOOLEAN IsReqGpioIsLedInNVM(PMINI_ADAPTER Adapter, UINT gpios) ...@@ -22,7 +22,7 @@ BOOLEAN IsReqGpioIsLedInNVM(PMINI_ADAPTER Adapter, UINT gpios)
return TRUE; return TRUE;
} }
INT LED_Blink(PMINI_ADAPTER Adapter, UINT GPIO_Num, UCHAR uiLedIndex, ULONG timeout, INT num_of_time, LedEventInfo_t currdriverstate) static INT LED_Blink(PMINI_ADAPTER Adapter, UINT GPIO_Num, UCHAR uiLedIndex, ULONG timeout, INT num_of_time, LedEventInfo_t currdriverstate)
{ {
int Status = STATUS_SUCCESS; int Status = STATUS_SUCCESS;
BOOLEAN bInfinite = FALSE; BOOLEAN bInfinite = FALSE;
...@@ -69,7 +69,7 @@ INT LED_Blink(PMINI_ADAPTER Adapter, UINT GPIO_Num, UCHAR uiLedIndex, ULONG time ...@@ -69,7 +69,7 @@ INT LED_Blink(PMINI_ADAPTER Adapter, UINT GPIO_Num, UCHAR uiLedIndex, ULONG time
return Status; return Status;
} }
INT ScaleRateofTransfer(ULONG rate) static INT ScaleRateofTransfer(ULONG rate)
{ {
if(rate <= 3) if(rate <= 3)
return rate; return rate;
...@@ -91,7 +91,7 @@ INT ScaleRateofTransfer(ULONG rate) ...@@ -91,7 +91,7 @@ INT ScaleRateofTransfer(ULONG rate)
INT LED_Proportional_Blink(PMINI_ADAPTER Adapter, UCHAR GPIO_Num_tx, static INT LED_Proportional_Blink(PMINI_ADAPTER Adapter, UCHAR GPIO_Num_tx,
UCHAR uiTxLedIndex, UCHAR GPIO_Num_rx, UCHAR uiRxLedIndex, LedEventInfo_t currdriverstate) UCHAR uiTxLedIndex, UCHAR GPIO_Num_rx, UCHAR uiRxLedIndex, LedEventInfo_t currdriverstate)
{ {
/* Initial values of TX and RX packets*/ /* Initial values of TX and RX packets*/
...@@ -281,7 +281,7 @@ INT LED_Proportional_Blink(PMINI_ADAPTER Adapter, UCHAR GPIO_Num_tx, ...@@ -281,7 +281,7 @@ INT LED_Proportional_Blink(PMINI_ADAPTER Adapter, UCHAR GPIO_Num_tx,
// <OSAL_STATUS_CODE> // <OSAL_STATUS_CODE>
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
INT ValidateDSDParamsChecksum( static INT ValidateDSDParamsChecksum(
PMINI_ADAPTER Adapter, PMINI_ADAPTER Adapter,
ULONG ulParamOffset, ULONG ulParamOffset,
USHORT usParamLen ) USHORT usParamLen )
...@@ -293,7 +293,7 @@ INT ValidateDSDParamsChecksum( ...@@ -293,7 +293,7 @@ INT ValidateDSDParamsChecksum(
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, LED_DUMP_INFO, DBG_LVL_ALL,"LED Thread:ValidateDSDParamsChecksum: 0x%lx 0x%X",ulParamOffset, usParamLen); BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, LED_DUMP_INFO, DBG_LVL_ALL,"LED Thread:ValidateDSDParamsChecksum: 0x%lx 0x%X",ulParamOffset, usParamLen);
puBuffer = OsalMemAlloc(usParamLen,'!MEM'); puBuffer = OsalMemAlloc(usParamLen,"!MEM");
if(!puBuffer) if(!puBuffer)
{ {
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, LED_DUMP_INFO, DBG_LVL_ALL,"LED Thread: ValidateDSDParamsChecksum Allocation failed"); BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, LED_DUMP_INFO, DBG_LVL_ALL,"LED Thread: ValidateDSDParamsChecksum Allocation failed");
...@@ -362,7 +362,7 @@ INT ValidateDSDParamsChecksum( ...@@ -362,7 +362,7 @@ INT ValidateDSDParamsChecksum(
// <OSAL_STATUS_CODE> // <OSAL_STATUS_CODE>
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
INT ValidateHWParmStructure(PMINI_ADAPTER Adapter, ULONG ulHwParamOffset) static INT ValidateHWParmStructure(PMINI_ADAPTER Adapter, ULONG ulHwParamOffset)
{ {
INT Status = STATUS_SUCCESS ; INT Status = STATUS_SUCCESS ;
...@@ -383,7 +383,7 @@ INT ValidateHWParmStructure(PMINI_ADAPTER Adapter, ULONG ulHwParamOffset) ...@@ -383,7 +383,7 @@ INT ValidateHWParmStructure(PMINI_ADAPTER Adapter, ULONG ulHwParamOffset)
return Status; return Status;
} /* ValidateHWParmStructure() */ } /* ValidateHWParmStructure() */
int ReadLEDInformationFromEEPROM(PMINI_ADAPTER Adapter, UCHAR GPIO_Array[]) static int ReadLEDInformationFromEEPROM(PMINI_ADAPTER Adapter, UCHAR GPIO_Array[])
{ {
int Status = STATUS_SUCCESS; int Status = STATUS_SUCCESS;
...@@ -493,7 +493,7 @@ int ReadLEDInformationFromEEPROM(PMINI_ADAPTER Adapter, UCHAR GPIO_Array[]) ...@@ -493,7 +493,7 @@ int ReadLEDInformationFromEEPROM(PMINI_ADAPTER Adapter, UCHAR GPIO_Array[])
} }
int ReadConfigFileStructure(PMINI_ADAPTER Adapter, BOOLEAN *bEnableThread) static int ReadConfigFileStructure(PMINI_ADAPTER Adapter, BOOLEAN *bEnableThread)
{ {
int Status = STATUS_SUCCESS; int Status = STATUS_SUCCESS;
UCHAR GPIO_Array[NUM_OF_LEDS+1]; /*Array to store GPIO numbers from EEPROM*/ UCHAR GPIO_Array[NUM_OF_LEDS+1]; /*Array to store GPIO numbers from EEPROM*/
...@@ -610,7 +610,7 @@ int ReadConfigFileStructure(PMINI_ADAPTER Adapter, BOOLEAN *bEnableThread) ...@@ -610,7 +610,7 @@ int ReadConfigFileStructure(PMINI_ADAPTER Adapter, BOOLEAN *bEnableThread)
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
VOID LedGpioInit(PMINI_ADAPTER Adapter) static VOID LedGpioInit(PMINI_ADAPTER Adapter)
{ {
UINT uiResetValue = 0; UINT uiResetValue = 0;
UINT uiIndex = 0; UINT uiIndex = 0;
...@@ -631,7 +631,7 @@ VOID LedGpioInit(PMINI_ADAPTER Adapter) ...@@ -631,7 +631,7 @@ VOID LedGpioInit(PMINI_ADAPTER Adapter)
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
INT BcmGetGPIOPinInfo(PMINI_ADAPTER Adapter, UCHAR *GPIO_num_tx, UCHAR *GPIO_num_rx ,UCHAR *uiLedTxIndex, UCHAR *uiLedRxIndex,LedEventInfo_t currdriverstate) static INT BcmGetGPIOPinInfo(PMINI_ADAPTER Adapter, UCHAR *GPIO_num_tx, UCHAR *GPIO_num_rx ,UCHAR *uiLedTxIndex, UCHAR *uiLedRxIndex,LedEventInfo_t currdriverstate)
{ {
UINT uiIndex = 0; UINT uiIndex = 0;
...@@ -676,7 +676,7 @@ INT BcmGetGPIOPinInfo(PMINI_ADAPTER Adapter, UCHAR *GPIO_num_tx, UCHAR *GPIO_num ...@@ -676,7 +676,7 @@ INT BcmGetGPIOPinInfo(PMINI_ADAPTER Adapter, UCHAR *GPIO_num_tx, UCHAR *GPIO_num
} }
return STATUS_SUCCESS ; return STATUS_SUCCESS ;
} }
VOID LEDControlThread(PMINI_ADAPTER Adapter) static VOID LEDControlThread(PMINI_ADAPTER Adapter)
{ {
UINT uiIndex = 0; UINT uiIndex = 0;
UCHAR GPIO_num = 0; UCHAR GPIO_num = 0;
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
UCHAR ReadEEPROMStatusRegister( PMINI_ADAPTER Adapter ) static UCHAR ReadEEPROMStatusRegister( PMINI_ADAPTER Adapter )
{ {
UCHAR uiData = 0; UCHAR uiData = 0;
DWORD dwRetries = MAX_EEPROM_RETRIES*RETRIES_PER_DELAY; DWORD dwRetries = MAX_EEPROM_RETRIES*RETRIES_PER_DELAY;
...@@ -804,7 +804,7 @@ INT WriteBeceemEEPROM(PMINI_ADAPTER Adapter,UINT uiEEPROMOffset, UINT uiData) ...@@ -804,7 +804,7 @@ INT WriteBeceemEEPROM(PMINI_ADAPTER Adapter,UINT uiEEPROMOffset, UINT uiData)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
INT FlashSectorErase(PMINI_ADAPTER Adapter, static INT FlashSectorErase(PMINI_ADAPTER Adapter,
UINT addr, UINT addr,
UINT numOfSectors) UINT numOfSectors)
{ {
...@@ -866,7 +866,7 @@ INT FlashSectorErase(PMINI_ADAPTER Adapter, ...@@ -866,7 +866,7 @@ INT FlashSectorErase(PMINI_ADAPTER Adapter,
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
INT flashByteWrite( static INT flashByteWrite(
PMINI_ADAPTER Adapter, PMINI_ADAPTER Adapter,
UINT uiOffset, UINT uiOffset,
PVOID pData) PVOID pData)
...@@ -954,7 +954,7 @@ INT flashByteWrite( ...@@ -954,7 +954,7 @@ INT flashByteWrite(
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
INT flashWrite( static INT flashWrite(
PMINI_ADAPTER Adapter, PMINI_ADAPTER Adapter,
UINT uiOffset, UINT uiOffset,
PVOID pData) PVOID pData)
...@@ -1038,7 +1038,7 @@ INT flashWrite( ...@@ -1038,7 +1038,7 @@ INT flashWrite(
// OSAL_STATUS_CODE // OSAL_STATUS_CODE
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
INT flashByteWriteStatus( static INT flashByteWriteStatus(
PMINI_ADAPTER Adapter, PMINI_ADAPTER Adapter,
UINT uiOffset, UINT uiOffset,
PVOID pData) PVOID pData)
...@@ -1123,7 +1123,7 @@ INT flashByteWriteStatus( ...@@ -1123,7 +1123,7 @@ INT flashByteWriteStatus(
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
INT flashWriteStatus( static INT flashWriteStatus(
PMINI_ADAPTER Adapter, PMINI_ADAPTER Adapter,
UINT uiOffset, UINT uiOffset,
PVOID pData) PVOID pData)
...@@ -1201,7 +1201,7 @@ INT flashWriteStatus( ...@@ -1201,7 +1201,7 @@ INT flashWriteStatus(
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
VOID BcmRestoreBlockProtectStatus(PMINI_ADAPTER Adapter,ULONG ulWriteStatus) static VOID BcmRestoreBlockProtectStatus(PMINI_ADAPTER Adapter,ULONG ulWriteStatus)
{ {
UINT value; UINT value;
value = (FLASH_CMD_WRITE_ENABLE<< 24); value = (FLASH_CMD_WRITE_ENABLE<< 24);
...@@ -1224,7 +1224,7 @@ VOID BcmRestoreBlockProtectStatus(PMINI_ADAPTER Adapter,ULONG ulWriteStatus) ...@@ -1224,7 +1224,7 @@ VOID BcmRestoreBlockProtectStatus(PMINI_ADAPTER Adapter,ULONG ulWriteStatus)
// ULONG - Status value before UnProtect. // 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 ulStatus = 0;
ULONG ulWriteStatus = 0; ULONG ulWriteStatus = 0;
...@@ -1378,7 +1378,7 @@ INT BeceemFlashBulkWrite( ...@@ -1378,7 +1378,7 @@ INT BeceemFlashBulkWrite(
uiSectBoundary = uiSectAlignAddr + Adapter->uiSectorSize; uiSectBoundary = uiSectAlignAddr + Adapter->uiSectorSize;
//pTempBuff = OsalMemAlloc(MAX_SECTOR_SIZE,'!MVN'); //pTempBuff = OsalMemAlloc(MAX_SECTOR_SIZE,'!MVN');
pTempBuff = OsalMemAlloc(Adapter->uiSectorSize ,'!MVN'); pTempBuff = OsalMemAlloc(Adapter->uiSectorSize ,"!MVN");
if(NULL == pTempBuff) if(NULL == pTempBuff)
{ {
goto BeceemFlashBulkWrite_EXIT; goto BeceemFlashBulkWrite_EXIT;
...@@ -1567,7 +1567,7 @@ INT BeceemFlashBulkWrite( ...@@ -1567,7 +1567,7 @@ INT BeceemFlashBulkWrite(
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
INT BeceemFlashBulkWriteStatus( static INT BeceemFlashBulkWriteStatus(
PMINI_ADAPTER Adapter, PMINI_ADAPTER Adapter,
PUINT pBuffer, PUINT pBuffer,
UINT uiOffset, UINT uiOffset,
...@@ -1602,7 +1602,7 @@ INT BeceemFlashBulkWriteStatus( ...@@ -1602,7 +1602,7 @@ INT BeceemFlashBulkWriteStatus(
// pTempBuff = OsalMemAlloc(MAX_SECTOR_SIZE,'!MVN'); // pTempBuff = OsalMemAlloc(MAX_SECTOR_SIZE,'!MVN');
pTempBuff = OsalMemAlloc(Adapter->uiSectorSize,'!MVN'); pTempBuff = OsalMemAlloc(Adapter->uiSectorSize,"!MVN");
if(NULL == pTempBuff) if(NULL == pTempBuff)
{ {
goto BeceemFlashBulkWriteStatus_EXIT; goto BeceemFlashBulkWriteStatus_EXIT;
...@@ -1771,7 +1771,7 @@ INT BeceemFlashBulkWriteStatus( ...@@ -1771,7 +1771,7 @@ INT BeceemFlashBulkWriteStatus(
INT PropagateCalParamsFromEEPROMToMemory(PMINI_ADAPTER Adapter) INT PropagateCalParamsFromEEPROMToMemory(PMINI_ADAPTER Adapter)
{ {
PCHAR pBuff = OsalMemAlloc(BUFFER_4K,'3MVN'); PCHAR pBuff = OsalMemAlloc(BUFFER_4K,"3MVN");
UINT uiEepromSize = 0; UINT uiEepromSize = 0;
UINT uiIndex = 0; UINT uiIndex = 0;
UINT uiBytesToCopy = 0; UINT uiBytesToCopy = 0;
...@@ -1925,7 +1925,7 @@ INT PropagateCalParamsFromFlashToMemory(PMINI_ADAPTER Adapter) ...@@ -1925,7 +1925,7 @@ INT PropagateCalParamsFromFlashToMemory(PMINI_ADAPTER Adapter)
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
INT BeceemEEPROMReadBackandVerify( static INT BeceemEEPROMReadBackandVerify(
PMINI_ADAPTER Adapter, PMINI_ADAPTER Adapter,
PUINT pBuffer, PUINT pBuffer,
UINT uiOffset, UINT uiOffset,
...@@ -2000,7 +2000,7 @@ INT BeceemEEPROMReadBackandVerify( ...@@ -2000,7 +2000,7 @@ INT BeceemEEPROMReadBackandVerify(
return 0; return 0;
} }
VOID BcmSwapWord(UINT *ptr1) { static VOID BcmSwapWord(UINT *ptr1) {
UINT tempval = (UINT)*ptr1; UINT tempval = (UINT)*ptr1;
char *ptr2 = (char *)&tempval; char *ptr2 = (char *)&tempval;
...@@ -2025,7 +2025,7 @@ VOID BcmSwapWord(UINT *ptr1) { ...@@ -2025,7 +2025,7 @@ VOID BcmSwapWord(UINT *ptr1) {
// OSAL_STATUS_CODE // 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 uiRetries = MAX_EEPROM_RETRIES*RETRIES_PER_DELAY;
UINT uiStatus = 0; UINT uiStatus = 0;
...@@ -2604,7 +2604,7 @@ UINT BcmGetFlashSectorSize(PMINI_ADAPTER Adapter, UINT FlashSectorSizeSig, UINT ...@@ -2604,7 +2604,7 @@ UINT BcmGetFlashSectorSize(PMINI_ADAPTER Adapter, UINT FlashSectorSizeSig, UINT
// <OSAL_STATUS_CODE> // <OSAL_STATUS_CODE>
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
INT BcmInitEEPROMQueues(PMINI_ADAPTER Adapter) static INT BcmInitEEPROMQueues(PMINI_ADAPTER Adapter)
{ {
UINT value = 0; UINT value = 0;
/* CHIP Bug : Clear the Avail bits on the Read queue. The default /* CHIP Bug : Clear the Avail bits on the Read queue. The default
...@@ -2734,7 +2734,7 @@ VOID BcmValidateNvmType(PMINI_ADAPTER Adapter) ...@@ -2734,7 +2734,7 @@ VOID BcmValidateNvmType(PMINI_ADAPTER Adapter)
// Returns: // Returns:
// Flash ID // Flash ID
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
ULONG BcmReadFlashRDID(PMINI_ADAPTER Adapter) static ULONG BcmReadFlashRDID(PMINI_ADAPTER Adapter)
{ {
ULONG ulRDID = 0; ULONG ulRDID = 0;
UINT value; UINT value;
...@@ -2804,7 +2804,7 @@ INT BcmDeAllocFlashCSStructure(PMINI_ADAPTER psAdapter) ...@@ -2804,7 +2804,7 @@ INT BcmDeAllocFlashCSStructure(PMINI_ADAPTER psAdapter)
return STATUS_SUCCESS ; 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; UINT Index = 0;
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, NVM_RW, DBG_LVL_ALL, "**********************FLASH2X CS Structure *******************"); BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, NVM_RW, DBG_LVL_ALL, "**********************FLASH2X CS Structure *******************");
...@@ -2865,7 +2865,7 @@ INT BcmDumpFlash2XCSStructure(PFLASH2X_CS_INFO psFlash2xCSInfo,PMINI_ADAPTER Ada ...@@ -2865,7 +2865,7 @@ INT BcmDumpFlash2XCSStructure(PFLASH2X_CS_INFO psFlash2xCSInfo,PMINI_ADAPTER Ada
} }
INT ConvertEndianOf2XCSStructure(PFLASH2X_CS_INFO psFlash2xCSInfo) static INT ConvertEndianOf2XCSStructure(PFLASH2X_CS_INFO psFlash2xCSInfo)
{ {
UINT Index = 0; UINT Index = 0;
psFlash2xCSInfo->MagicNumber = ntohl(psFlash2xCSInfo->MagicNumber); psFlash2xCSInfo->MagicNumber = ntohl(psFlash2xCSInfo->MagicNumber);
...@@ -2921,7 +2921,7 @@ INT ConvertEndianOf2XCSStructure(PFLASH2X_CS_INFO psFlash2xCSInfo) ...@@ -2921,7 +2921,7 @@ INT ConvertEndianOf2XCSStructure(PFLASH2X_CS_INFO psFlash2xCSInfo)
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
INT ConvertEndianOfCSStructure(PFLASH_CS_INFO psFlashCSInfo) static INT ConvertEndianOfCSStructure(PFLASH_CS_INFO psFlashCSInfo)
{ {
//UINT Index = 0; //UINT Index = 0;
psFlashCSInfo->MagicNumber =ntohl(psFlashCSInfo->MagicNumber); psFlashCSInfo->MagicNumber =ntohl(psFlashCSInfo->MagicNumber);
...@@ -2961,7 +2961,7 @@ INT IsSectionExistInVendorInfo(PMINI_ADAPTER Adapter, FLASH2X_SECTION_VAL sectio ...@@ -2961,7 +2961,7 @@ INT IsSectionExistInVendorInfo(PMINI_ADAPTER Adapter, FLASH2X_SECTION_VAL sectio
(Adapter->psFlash2xVendorInfo->VendorSection[section].OffsetFromZeroForSectionStart != UNINIT_PTR_IN_CS) ); (Adapter->psFlash2xVendorInfo->VendorSection[section].OffsetFromZeroForSectionStart != UNINIT_PTR_IN_CS) );
} }
VOID UpdateVendorInfo(PMINI_ADAPTER Adapter) static VOID UpdateVendorInfo(PMINI_ADAPTER Adapter)
{ {
B_UINT32 i = 0; B_UINT32 i = 0;
UINT uiSizeSection = 0; UINT uiSizeSection = 0;
...@@ -3742,7 +3742,7 @@ B_UINT8 IsOffsetWritable(PMINI_ADAPTER Adapter, UINT uiOffset) ...@@ -3742,7 +3742,7 @@ B_UINT8 IsOffsetWritable(PMINI_ADAPTER Adapter, UINT uiOffset)
return FALSE; return FALSE;
} }
INT BcmDumpFlash2xSectionBitMap(PFLASH2X_BITMAP psFlash2xBitMap) static INT BcmDumpFlash2xSectionBitMap(PFLASH2X_BITMAP psFlash2xBitMap)
{ {
PMINI_ADAPTER Adapter = GET_BCM_ADAPTER(gblpnetdev); PMINI_ADAPTER Adapter = GET_BCM_ADAPTER(gblpnetdev);
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, NVM_RW, DBG_LVL_ALL, "***************Flash 2.x Section Bitmap***************"); BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, NVM_RW, DBG_LVL_ALL, "***************Flash 2.x Section Bitmap***************");
...@@ -4074,7 +4074,7 @@ Return Value:- Make the priorit highest else return erorr code ...@@ -4074,7 +4074,7 @@ Return Value:- Make the priorit highest else return erorr code
**/ **/
INT BcmSetActiveSection(PMINI_ADAPTER Adapter, FLASH2X_SECTION_VAL eFlash2xSectVal) INT BcmSetActiveSection(PMINI_ADAPTER Adapter, FLASH2X_SECTION_VAL eFlash2xSectVal)
{ {
INT SectImagePriority = 0; unsigned int SectImagePriority = 0;
INT Status =STATUS_SUCCESS; INT Status =STATUS_SUCCESS;
//DSD_HEADER sDSD = {0}; //DSD_HEADER sDSD = {0};
...@@ -5178,7 +5178,7 @@ INT ReadDSDSignature(PMINI_ADAPTER Adapter, FLASH2X_SECTION_VAL dsd) ...@@ -5178,7 +5178,7 @@ INT ReadDSDSignature(PMINI_ADAPTER Adapter, FLASH2X_SECTION_VAL dsd)
INT ReadDSDPriority(PMINI_ADAPTER Adapter, FLASH2X_SECTION_VAL dsd) INT ReadDSDPriority(PMINI_ADAPTER Adapter, FLASH2X_SECTION_VAL dsd)
{ {
//UINT priOffsetInMap = 0 ; //UINT priOffsetInMap = 0 ;
INT uiDSDPri = STATUS_FAILURE; unsigned int uiDSDPri = STATUS_FAILURE;
//DSD_HEADER dsdHeader = {0}; //DSD_HEADER dsdHeader = {0};
//priOffsetInMap = (PUCHAR)&(dsdHeader.DSDImagePriority) -(PUCHAR)&dsdHeader; //priOffsetInMap = (PUCHAR)&(dsdHeader.DSDImagePriority) -(PUCHAR)&dsdHeader;
if(IsSectionWritable(Adapter,dsd)) if(IsSectionWritable(Adapter,dsd))
...@@ -5260,7 +5260,7 @@ INT ReadISOSignature(PMINI_ADAPTER Adapter, FLASH2X_SECTION_VAL iso) ...@@ -5260,7 +5260,7 @@ INT ReadISOSignature(PMINI_ADAPTER Adapter, FLASH2X_SECTION_VAL iso)
INT ReadISOPriority(PMINI_ADAPTER Adapter, FLASH2X_SECTION_VAL iso) INT ReadISOPriority(PMINI_ADAPTER Adapter, FLASH2X_SECTION_VAL iso)
{ {
INT ISOPri = STATUS_FAILURE; unsigned int ISOPri = STATUS_FAILURE;
if(IsSectionWritable(Adapter,iso)) if(IsSectionWritable(Adapter,iso))
{ {
if(ReadISOSignature(Adapter,iso)== ISO_IMAGE_MAGIC_NUMBER) if(ReadISOSignature(Adapter,iso)== ISO_IMAGE_MAGIC_NUMBER)
...@@ -5482,7 +5482,7 @@ INT IsSectionWritable(PMINI_ADAPTER Adapter, FLASH2X_SECTION_VAL Section) ...@@ -5482,7 +5482,7 @@ INT IsSectionWritable(PMINI_ADAPTER Adapter, FLASH2X_SECTION_VAL Section)
INT CorruptDSDSig(PMINI_ADAPTER Adapter, FLASH2X_SECTION_VAL eFlash2xSectionVal) INT CorruptDSDSig(PMINI_ADAPTER Adapter, FLASH2X_SECTION_VAL eFlash2xSectionVal)
{ {
PUCHAR pBuff = 0 ; PUCHAR pBuff = NULL;
UINT sig = 0; UINT sig = 0;
UINT uiOffset = 0; UINT uiOffset = 0;
UINT BlockStatus = 0; UINT BlockStatus = 0;
...@@ -5555,7 +5555,7 @@ INT CorruptDSDSig(PMINI_ADAPTER Adapter, FLASH2X_SECTION_VAL eFlash2xSectionVal) ...@@ -5555,7 +5555,7 @@ INT CorruptDSDSig(PMINI_ADAPTER Adapter, FLASH2X_SECTION_VAL eFlash2xSectionVal)
INT CorruptISOSig(PMINI_ADAPTER Adapter, FLASH2X_SECTION_VAL eFlash2xSectionVal) INT CorruptISOSig(PMINI_ADAPTER Adapter, FLASH2X_SECTION_VAL eFlash2xSectionVal)
{ {
PUCHAR pBuff = 0 ; PUCHAR pBuff = NULL;
UINT sig = 0; UINT sig = 0;
UINT uiOffset = 0; UINT uiOffset = 0;
......
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