Staging: rtl8192su: Remove Firmware from r8192SU_HWImg.c

Because the Firmware is loaded from RTL8192SU/rtl8192sfw.bin,
it it save, to remove it from r8192SU_HWImg.c

Signed-off-by: Florian Schilhabel <florian.c.schilhabel@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Florian Schilhabel 2010-02-19 20:10:00 +01:00 committed by Greg Kroah-Hartman
parent c852ab6672
commit 2f22560880
5 changed files with 35 additions and 4380 deletions

File diff suppressed because it is too large Load Diff

View File

@ -5,8 +5,6 @@
/*Created on 2009/ 3/ 6, 5:29*/ /*Created on 2009/ 3/ 6, 5:29*/
#define ImgArrayLength 68368
extern u8 Rtl8192SUFwImgArray[ImgArrayLength];
#define MainArrayLength 1 #define MainArrayLength 1
extern u8 Rtl8192SUFwMainArray[MainArrayLength]; extern u8 Rtl8192SUFwMainArray[MainArrayLength];
#define DataArrayLength 1 #define DataArrayLength 1

View File

@ -360,117 +360,58 @@ bool FirmwareDownload92S(struct net_device *dev)
RT_TRACE(COMP_FIRMWARE, " --->FirmwareDownload92S()\n"); RT_TRACE(COMP_FIRMWARE, " --->FirmwareDownload92S()\n");
//3// /*
//3 //<1> Open Image file, and map file to contineous memory if open file success. * Load the firmware from RTL8192SU/rtl8192sfw.bin
//3 // or read image file from array. Default load from BIN file */
//3// if(pFirmware->szFwTmpBufferLen == 0)
priv->firmware_source = FW_SOURCE_IMG_FILE;// We should decided by Reg.
switch( priv->firmware_source )
{ {
case FW_SOURCE_IMG_FILE: rc = request_firmware(&fw_entry, pFwImageFileName[ulInitStep],&priv->udev->dev);
if(pFirmware->szFwTmpBufferLen == 0) if(rc < 0 ) {
{ RT_TRACE(COMP_ERR, "request firmware fail!\n");
goto DownloadFirmware_Fail;
rc = request_firmware(&fw_entry, pFwImageFileName[ulInitStep],&priv->udev->dev);//===>1
if(rc < 0 ) {
RT_TRACE(COMP_ERR, "request firmware fail!\n");
goto DownloadFirmware_Fail;
}
if(fw_entry->size > sizeof(pFirmware->szFwTmpBuffer))
{
RT_TRACE(COMP_ERR, "img file size exceed the container buffer fail!\n");
release_firmware(fw_entry);
goto DownloadFirmware_Fail;
}
memcpy(pFirmware->szFwTmpBuffer,fw_entry->data,fw_entry->size);
pFirmware->szFwTmpBufferLen = fw_entry->size;
release_firmware(fw_entry);
pucMappedFile = pFirmware->szFwTmpBuffer;
file_length = pFirmware->szFwTmpBufferLen;
//Retrieve FW header.
pFirmware->pFwHeader = (PRT_8192S_FIRMWARE_HDR) pucMappedFile;
pFwHdr = pFirmware->pFwHeader;
RT_TRACE(COMP_FIRMWARE,"signature:%x, version:%x, size:%x, imemsize:%x, sram size:%x\n", \
pFwHdr->Signature, pFwHdr->Version, pFwHdr->DMEMSize, \
pFwHdr->IMG_IMEM_SIZE, pFwHdr->IMG_SRAM_SIZE);
pFirmware->FirmwareVersion = byte(pFwHdr->Version ,0);
if ((pFwHdr->IMG_IMEM_SIZE==0) || (pFwHdr->IMG_IMEM_SIZE > sizeof(pFirmware->FwIMEM)))
{
RT_TRACE(COMP_ERR, "%s: memory for data image is less than IMEM required\n",\
__FUNCTION__);
goto DownloadFirmware_Fail;
} else {
pucMappedFile+=FwHdrSize;
//Retrieve IMEM image.
memcpy(pFirmware->FwIMEM, pucMappedFile, pFwHdr->IMG_IMEM_SIZE);
pFirmware->FwIMEMLen = pFwHdr->IMG_IMEM_SIZE;
}
if (pFwHdr->IMG_SRAM_SIZE > sizeof(pFirmware->FwEMEM))
{
RT_TRACE(COMP_ERR, "%s: memory for data image is less than EMEM required\n",\
__FUNCTION__);
goto DownloadFirmware_Fail;
} else {
pucMappedFile += pFirmware->FwIMEMLen;
/* Retriecve EMEM image */
memcpy(pFirmware->FwEMEM, pucMappedFile, pFwHdr->IMG_SRAM_SIZE);//===>6
pFirmware->FwEMEMLen = pFwHdr->IMG_SRAM_SIZE;
}
} }
break;
case FW_SOURCE_HEADER_FILE: if(fw_entry->size > sizeof(pFirmware->szFwTmpBuffer)) {
#if 1 RT_TRACE(COMP_ERR, "img file size exceed the container buffer fail!\n");
#define Rtl819XFwImageArray Rtl8192SUFwImgArray release_firmware(fw_entry);
//2008.11.10 Add by tynli. goto DownloadFirmware_Fail;
pucMappedFile = Rtl819XFwImageArray; }
ulFileLength = ImgArrayLength;
RT_TRACE(COMP_INIT,"Fw download from header.\n"); memcpy(pFirmware->szFwTmpBuffer,fw_entry->data,fw_entry->size);
/* Retrieve FW header*/ pFirmware->szFwTmpBufferLen = fw_entry->size;
release_firmware(fw_entry);
pucMappedFile = pFirmware->szFwTmpBuffer;
file_length = pFirmware->szFwTmpBufferLen;
/* Retrieve FW header. */
pFirmware->pFwHeader = (PRT_8192S_FIRMWARE_HDR) pucMappedFile; pFirmware->pFwHeader = (PRT_8192S_FIRMWARE_HDR) pucMappedFile;
pFwHdr = pFirmware->pFwHeader; pFwHdr = pFirmware->pFwHeader;
RT_TRACE(COMP_FIRMWARE,"signature:%x, version:%x, size:%x, imemsize:%x, sram size:%x\n", \ RT_TRACE(COMP_FIRMWARE,"signature:%x, version:%x, size:%x, imemsize:%x, sram size:%x\n", \
pFwHdr->Signature, pFwHdr->Version, pFwHdr->DMEMSize, \ pFwHdr->Signature, pFwHdr->Version, pFwHdr->DMEMSize, \
pFwHdr->IMG_IMEM_SIZE, pFwHdr->IMG_SRAM_SIZE); pFwHdr->IMG_IMEM_SIZE, pFwHdr->IMG_SRAM_SIZE);
pFirmware->FirmwareVersion = byte(pFwHdr->Version ,0); pFirmware->FirmwareVersion = byte(pFwHdr->Version ,0);
if ((pFwHdr->IMG_IMEM_SIZE==0) || (pFwHdr->IMG_IMEM_SIZE > sizeof(pFirmware->FwIMEM))) {
if ((pFwHdr->IMG_IMEM_SIZE==0) || (pFwHdr->IMG_IMEM_SIZE > sizeof(pFirmware->FwIMEM))) RT_TRACE(COMP_ERR, "%s: memory for data image is less than IMEM required\n",\
{ __FUNCTION__);
printk("FirmwareDownload92S(): memory for data image is less than IMEM required\n");
goto DownloadFirmware_Fail; goto DownloadFirmware_Fail;
} else { } else {
pucMappedFile+=FwHdrSize; pucMappedFile+=FwHdrSize;
//Retrieve IMEM image. /* Retrieve IMEM image. */
memcpy(pFirmware->FwIMEM, pucMappedFile, pFwHdr->IMG_IMEM_SIZE); memcpy(pFirmware->FwIMEM, pucMappedFile, pFwHdr->IMG_IMEM_SIZE);
pFirmware->FwIMEMLen = pFwHdr->IMG_IMEM_SIZE; pFirmware->FwIMEMLen = pFwHdr->IMG_IMEM_SIZE;
} }
if (pFwHdr->IMG_SRAM_SIZE > sizeof(pFirmware->FwEMEM)) if (pFwHdr->IMG_SRAM_SIZE > sizeof(pFirmware->FwEMEM)) {
{ RT_TRACE(COMP_ERR, "%s: memory for data image is less than EMEM required\n",\
printk(" FirmwareDownload92S(): memory for data image is less than EMEM required\n"); __FUNCTION__);
goto DownloadFirmware_Fail; goto DownloadFirmware_Fail;
} else { } else {
pucMappedFile+= pFirmware->FwIMEMLen; pucMappedFile += pFirmware->FwIMEMLen;
/* Retriecve EMEM image */
//Retriecve EMEM image. memcpy(pFirmware->FwEMEM, pucMappedFile, pFwHdr->IMG_SRAM_SIZE);//===>6
memcpy(pFirmware->FwEMEM, pucMappedFile, pFwHdr->IMG_SRAM_SIZE); pFirmware->FwEMEMLen = pFwHdr->IMG_SRAM_SIZE;
pFirmware->FwEMEMLen = pFwHdr->IMG_SRAM_SIZE; }
}
#endif
break;
default:
break;
} }
FwStatus = FirmwareGetNextStatus(pFirmware->FWStatus); FwStatus = FirmwareGetNextStatus(pFirmware->FWStatus);

View File

@ -59,12 +59,6 @@ typedef enum _desc_packet_type_e{
DESC_PACKET_TYPE_NORMAL = 1, DESC_PACKET_TYPE_NORMAL = 1,
}desc_packet_type_e; }desc_packet_type_e;
typedef enum _firmware_source{
FW_SOURCE_IMG_FILE = 0,
FW_SOURCE_HEADER_FILE = 1,
}firmware_source_e, *pfirmware_source_e;
typedef enum _opt_rst_type{ typedef enum _opt_rst_type{
OPT_SYSTEM_RESET = 0, OPT_SYSTEM_RESET = 0,
OPT_FIRMWARE_RESET = 1, OPT_FIRMWARE_RESET = 1,
@ -185,7 +179,6 @@ typedef enum _FIRMWARE_8192S_STATUS{
#define RTL8190_MAX_FIRMWARE_CODE_SIZE 64000 //64k #define RTL8190_MAX_FIRMWARE_CODE_SIZE 64000 //64k
typedef struct _rt_firmware{ typedef struct _rt_firmware{
firmware_source_e eFWSource;
PRT_8192S_FIRMWARE_HDR pFwHeader; PRT_8192S_FIRMWARE_HDR pFwHeader;
FIRMWARE_8192S_STATUS FWStatus; FIRMWARE_8192S_STATUS FWStatus;
u16 FirmwareVersion; u16 FirmwareVersion;

View File

@ -1258,7 +1258,6 @@ typedef struct r8192_priv
u8 Rf_Mode; //add for Firmware RF -R/W switch u8 Rf_Mode; //add for Firmware RF -R/W switch
prt_firmware pFirmware; prt_firmware pFirmware;
rtl819xUsb_loopback_e LoopbackMode; rtl819xUsb_loopback_e LoopbackMode;
firmware_source_e firmware_source;
bool usb_error; bool usb_error;
u16 EEPROMTxPowerDiff; u16 EEPROMTxPowerDiff;