Commit 168b1400 authored by Kevin McKinney's avatar Kevin McKinney Committed by Greg Kroah-Hartman

Staging: bcm: Remove typedef for _FLASH_CS_INFO and call directly.

This patch removes typedef for _FLASH_CS_INFO, and
changes the name of the struct to bcm_flash_cs_info.
In addition, any calls to typedefs FLASH_CS_INFO, or
*PFLASH_CS_INFO are changed to call the struct
directly.
Signed-off-by: default avatarKevin McKinney <klmckinney1@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 08391731
...@@ -367,7 +367,7 @@ struct bcm_mini_adapter { ...@@ -367,7 +367,7 @@ struct bcm_mini_adapter {
/* BOOLEAN InterfaceUpStatus; */ /* BOOLEAN InterfaceUpStatus; */
struct bcm_flash2x_cs_info *psFlash2xCSInfo; struct bcm_flash2x_cs_info *psFlash2xCSInfo;
PFLASH_CS_INFO psFlashCSInfo; struct bcm_flash_cs_info *psFlashCSInfo;
struct bcm_flash2x_vendor_info *psFlash2xVendorInfo; struct bcm_flash2x_vendor_info *psFlash2xVendorInfo;
UINT uiFlashBaseAdd; /* Flash start address */ UINT uiFlashBaseAdd; /* Flash start address */
UINT uiActiveISOOffset; /* Active ISO offset chosen before f/w download */ UINT uiActiveISOOffset; /* Active ISO offset chosen before f/w download */
......
...@@ -1789,7 +1789,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg) ...@@ -1789,7 +1789,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
if (copy_to_user(IoBuffer.OutputBuffer, Adapter->psFlash2xCSInfo, sizeof(struct bcm_flash2x_cs_info))) if (copy_to_user(IoBuffer.OutputBuffer, Adapter->psFlash2xCSInfo, sizeof(struct bcm_flash2x_cs_info)))
return -EFAULT; return -EFAULT;
} else { } else {
if (IoBuffer.OutputLength < sizeof(FLASH_CS_INFO)) if (IoBuffer.OutputLength < sizeof(struct bcm_flash_cs_info))
return -EINVAL; return -EINVAL;
if (copy_to_user(IoBuffer.OutputBuffer, Adapter->psFlashCSInfo, sizeof(struct bcm_flash2x_cs_info))) if (copy_to_user(IoBuffer.OutputBuffer, Adapter->psFlashCSInfo, sizeof(struct bcm_flash2x_cs_info)))
......
...@@ -1978,7 +1978,7 @@ int BeceemNVMWrite(struct bcm_mini_adapter *Adapter, ...@@ -1978,7 +1978,7 @@ int BeceemNVMWrite(struct bcm_mini_adapter *Adapter,
int BcmUpdateSectorSize(struct bcm_mini_adapter *Adapter, unsigned int uiSectorSize) int BcmUpdateSectorSize(struct bcm_mini_adapter *Adapter, unsigned int uiSectorSize)
{ {
int Status = -1; int Status = -1;
FLASH_CS_INFO sFlashCsInfo = {0}; struct bcm_flash_cs_info sFlashCsInfo = {0};
unsigned int uiTemp = 0; unsigned int uiTemp = 0;
unsigned int uiSectorSig = 0; unsigned int uiSectorSig = 0;
unsigned int uiCurrentSectorSize = 0; unsigned int uiCurrentSectorSize = 0;
...@@ -2228,7 +2228,7 @@ int BcmAllocFlashCSStructure(struct bcm_mini_adapter *psAdapter) ...@@ -2228,7 +2228,7 @@ int BcmAllocFlashCSStructure(struct bcm_mini_adapter *psAdapter)
BCM_DEBUG_PRINT(psAdapter, DBG_TYPE_PRINTK, 0, 0, "Adapter structure point is NULL"); BCM_DEBUG_PRINT(psAdapter, DBG_TYPE_PRINTK, 0, 0, "Adapter structure point is NULL");
return -EINVAL; return -EINVAL;
} }
psAdapter->psFlashCSInfo = (PFLASH_CS_INFO)kzalloc(sizeof(FLASH_CS_INFO), GFP_KERNEL); psAdapter->psFlashCSInfo = (struct bcm_flash_cs_info *)kzalloc(sizeof(struct bcm_flash_cs_info), GFP_KERNEL);
if (psAdapter->psFlashCSInfo == NULL) { if (psAdapter->psFlashCSInfo == NULL) {
BCM_DEBUG_PRINT(psAdapter, DBG_TYPE_PRINTK, 0, 0, "Can't Allocate memory for Flash 1.x"); BCM_DEBUG_PRINT(psAdapter, DBG_TYPE_PRINTK, 0, 0, "Can't Allocate memory for Flash 1.x");
return -ENOMEM; return -ENOMEM;
...@@ -2381,7 +2381,7 @@ static int ConvertEndianOf2XCSStructure(struct bcm_flash2x_cs_info *psFlash2xCSI ...@@ -2381,7 +2381,7 @@ static int ConvertEndianOf2XCSStructure(struct bcm_flash2x_cs_info *psFlash2xCSI
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
static int ConvertEndianOfCSStructure(PFLASH_CS_INFO psFlashCSInfo) static int ConvertEndianOfCSStructure(struct bcm_flash_cs_info *psFlashCSInfo)
{ {
/* unsigned int Index = 0; */ /* unsigned int Index = 0; */
psFlashCSInfo->MagicNumber = ntohl(psFlashCSInfo->MagicNumber); psFlashCSInfo->MagicNumber = ntohl(psFlashCSInfo->MagicNumber);
...@@ -2509,7 +2509,7 @@ static VOID UpdateVendorInfo(struct bcm_mini_adapter *Adapter) ...@@ -2509,7 +2509,7 @@ static VOID UpdateVendorInfo(struct bcm_mini_adapter *Adapter)
static int BcmGetFlashCSInfo(struct bcm_mini_adapter *Adapter) static int BcmGetFlashCSInfo(struct bcm_mini_adapter *Adapter)
{ {
/* FLASH_CS_INFO sFlashCsInfo = {0}; */ /* struct bcm_flash_cs_info sFlashCsInfo = {0}; */
#if !defined(BCM_SHM_INTERFACE) || defined(FLASH_DIRECT_ACCESS) #if !defined(BCM_SHM_INTERFACE) || defined(FLASH_DIRECT_ACCESS)
unsigned int value; unsigned int value;
...@@ -2522,7 +2522,7 @@ static int BcmGetFlashCSInfo(struct bcm_mini_adapter *Adapter) ...@@ -2522,7 +2522,7 @@ static int BcmGetFlashCSInfo(struct bcm_mini_adapter *Adapter)
Adapter->uiFlashBaseAdd = 0; Adapter->uiFlashBaseAdd = 0;
Adapter->ulFlashCalStart = 0; Adapter->ulFlashCalStart = 0;
memset(Adapter->psFlashCSInfo, 0 , sizeof(FLASH_CS_INFO)); memset(Adapter->psFlashCSInfo, 0 , sizeof(struct bcm_flash_cs_info));
memset(Adapter->psFlash2xCSInfo, 0 , sizeof(struct bcm_flash2x_cs_info)); memset(Adapter->psFlash2xCSInfo, 0 , sizeof(struct bcm_flash2x_cs_info));
if (!Adapter->bDDRInitDone) { if (!Adapter->bDDRInitDone) {
...@@ -2551,7 +2551,7 @@ static int BcmGetFlashCSInfo(struct bcm_mini_adapter *Adapter) ...@@ -2551,7 +2551,7 @@ static int BcmGetFlashCSInfo(struct bcm_mini_adapter *Adapter)
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, NVM_RW, DBG_LVL_ALL, "FLASH LAYOUT MAJOR VERSION :%X", uiFlashLayoutMajorVersion); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, NVM_RW, DBG_LVL_ALL, "FLASH LAYOUT MAJOR VERSION :%X", uiFlashLayoutMajorVersion);
if (uiFlashLayoutMajorVersion < FLASH_2X_MAJOR_NUMBER) { if (uiFlashLayoutMajorVersion < FLASH_2X_MAJOR_NUMBER) {
BeceemFlashBulkRead(Adapter, (PUINT)Adapter->psFlashCSInfo, Adapter->ulFlashControlSectionStart, sizeof(FLASH_CS_INFO)); BeceemFlashBulkRead(Adapter, (PUINT)Adapter->psFlashCSInfo, Adapter->ulFlashControlSectionStart, sizeof(struct bcm_flash_cs_info));
ConvertEndianOfCSStructure(Adapter->psFlashCSInfo); ConvertEndianOfCSStructure(Adapter->psFlashCSInfo);
Adapter->ulFlashCalStart = (Adapter->psFlashCSInfo->OffsetFromZeroForCalibrationStart); Adapter->ulFlashCalStart = (Adapter->psFlashCSInfo->OffsetFromZeroForCalibrationStart);
......
...@@ -26,7 +26,7 @@ typedef struct _FLASH_SECTOR_INFO { ...@@ -26,7 +26,7 @@ typedef struct _FLASH_SECTOR_INFO {
unsigned int uiSectorSize; unsigned int uiSectorSize;
} FLASH_SECTOR_INFO, *PFLASH_SECTOR_INFO; } FLASH_SECTOR_INFO, *PFLASH_SECTOR_INFO;
typedef struct _FLASH_CS_INFO { struct bcm_flash_cs_info {
u32 MagicNumber; u32 MagicNumber;
/* let the magic number be 0xBECE-F1A5 - F1A5 for "flas-h" */ /* let the magic number be 0xBECE-F1A5 - F1A5 for "flas-h" */
u32 FlashLayoutVersion; u32 FlashLayoutVersion;
...@@ -53,7 +53,7 @@ typedef struct _FLASH_CS_INFO { ...@@ -53,7 +53,7 @@ typedef struct _FLASH_CS_INFO {
u32 IsCDLessDeviceBootSig; u32 IsCDLessDeviceBootSig;
/* MSC Timeout after reset to switch from MSC to NW Mode */ /* MSC Timeout after reset to switch from MSC to NW Mode */
u32 MassStorageTimeout; u32 MassStorageTimeout;
} FLASH_CS_INFO, *PFLASH_CS_INFO; };
#define FLASH2X_TOTAL_SIZE (64 * 1024 * 1024) #define FLASH2X_TOTAL_SIZE (64 * 1024 * 1024)
#define DEFAULT_SECTOR_SIZE (64 * 1024) #define DEFAULT_SECTOR_SIZE (64 * 1024)
......
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