summaryrefslogtreecommitdiff
path: root/debian/patches/debian/dfsg
diff options
context:
space:
mode:
authorBen Hutchings <benh@debian.org>2010-03-15 13:44:38 +0000
committerBen Hutchings <benh@debian.org>2010-03-15 13:44:38 +0000
commit103df23a00025b79e7363292810b102b2d8fe993 (patch)
treeea1c7c43e619ef508e83d188fbc2a3d463323cc4 /debian/patches/debian/dfsg
parentf92b8885538019910753a556d68a58d069693f51 (diff)
downloaddebian-kernel-packaging-103df23a00025b79e7363292810b102b2d8fe993.tar.gz
[x86] Enable rtl8192su driver using external firmware
svn path=/dists/trunk/linux-2.6/; revision=15377
Diffstat (limited to 'debian/patches/debian/dfsg')
-rw-r--r--debian/patches/debian/dfsg/drivers-staging-rtl8192su-disable.patch11
-rw-r--r--debian/patches/debian/dfsg/files-12
-rw-r--r--debian/patches/debian/dfsg/rtl8192su-Remove-Firmware-from-r8192SU_HWImg.patch236
3 files changed, 237 insertions, 12 deletions
diff --git a/debian/patches/debian/dfsg/drivers-staging-rtl8192su-disable.patch b/debian/patches/debian/dfsg/drivers-staging-rtl8192su-disable.patch
deleted file mode 100644
index e4fd5b065..000000000
--- a/debian/patches/debian/dfsg/drivers-staging-rtl8192su-disable.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff --git a/drivers/staging/rtl8192su/Kconfig b/drivers/staging/rtl8192su/Kconfig
-index 123fa6d..5e081b1 100644
---- a/drivers/staging/rtl8192su/Kconfig
-+++ b/drivers/staging/rtl8192su/Kconfig
-@@ -2,5 +2,6 @@ config RTL8192SU
- tristate "RealTek RTL8192SU Wireless LAN NIC driver"
- depends on PCI && WLAN && USB
- depends on WIRELESS_EXT
-+ depends on BROKEN
- default N
- ---help---
diff --git a/debian/patches/debian/dfsg/files-1 b/debian/patches/debian/dfsg/files-1
index c96713c82..9b8d7cbbc 100644
--- a/debian/patches/debian/dfsg/files-1
+++ b/debian/patches/debian/dfsg/files-1
@@ -56,7 +56,7 @@ rm drivers/staging/rt3070/firmware.h
rm drivers/staging/rt3090/firmware.h
-rm drivers/staging/rtl8192su/r8192SU_HWImg.c
+unifdef drivers/staging/rtl8192su/r8192SU_HWImg.c -UREMOVE_DFSG
rm drivers/staging/rtl8192u/r819xU_firmware_img.c
diff --git a/debian/patches/debian/dfsg/rtl8192su-Remove-Firmware-from-r8192SU_HWImg.patch b/debian/patches/debian/dfsg/rtl8192su-Remove-Firmware-from-r8192SU_HWImg.patch
new file mode 100644
index 000000000..d436bea91
--- /dev/null
+++ b/debian/patches/debian/dfsg/rtl8192su-Remove-Firmware-from-r8192SU_HWImg.patch
@@ -0,0 +1,236 @@
+From: Florian Schilhabel <florian.c.schilhabel@googlemail.com>
+Date: Fri, 19 Feb 2010 20:10:00 +0100
+Subject: [PATCH] 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>
+[bwh: Use unifdef to remove the firmware itself]
+
+diff --git a/drivers/staging/rtl8192su/r8192SU_HWImg.c b/drivers/staging/rtl8192su/r8192SU_HWImg.c
+index cbb6579..ba8e12c 100644
+--- a/drivers/staging/rtl8192su/r8192SU_HWImg.c
++++ b/drivers/staging/rtl8192su/r8192SU_HWImg.c
+@@ -2,6 +2,7 @@
+
+ #include "r8192SU_HWImg.h"
+
++#ifdef REMOVE_DFSG
+ u8 Rtl8192SUFwImgArray[ImgArrayLength] = {
+ 0x92,0x81,0x2b,0x90,0x30,0x00,0x00,0x00,0x08,0x74,0x00,0x00,0x88,0x96,0x00,0x00,
+ 0x30,0x00,0x00,0x00,0x00,0x95,0x00,0x00,0x00,0x00,0x2b,0x00,0x03,0x03,0x23,0x00,
+@@ -4277,6 +4278,7 @@
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0xf2,0x30,0xb8,0xff,0xff,0xff,0xff,
+ };
+
++#endif
+ u8 Rtl8192SUFwMainArray[MainArrayLength] = {
+ 0x0, };
+
+diff --git a/drivers/staging/rtl8192su/r8192SU_HWImg.h b/drivers/staging/rtl8192su/r8192SU_HWImg.h
+index 96b1525..36e84af 100644
+--- a/drivers/staging/rtl8192su/r8192SU_HWImg.h
++++ b/drivers/staging/rtl8192su/r8192SU_HWImg.h
+@@ -5,8 +5,6 @@
+
+ /*Created on 2009/ 3/ 6, 5:29*/
+
+-#define ImgArrayLength 68368
+-extern u8 Rtl8192SUFwImgArray[ImgArrayLength];
+ #define MainArrayLength 1
+ extern u8 Rtl8192SUFwMainArray[MainArrayLength];
+ #define DataArrayLength 1
+diff --git a/drivers/staging/rtl8192su/r8192S_firmware.c b/drivers/staging/rtl8192su/r8192S_firmware.c
+index ff65bd1..752a3f1 100644
+--- a/drivers/staging/rtl8192su/r8192S_firmware.c
++++ b/drivers/staging/rtl8192su/r8192S_firmware.c
+@@ -360,117 +360,58 @@ bool FirmwareDownload92S(struct net_device *dev)
+
+ RT_TRACE(COMP_FIRMWARE, " --->FirmwareDownload92S()\n");
+
+- //3//
+- //3 //<1> Open Image file, and map file to contineous memory if open file success.
+- //3 // or read image file from array. Default load from BIN file
+- //3//
+- priv->firmware_source = FW_SOURCE_IMG_FILE;// We should decided by Reg.
+-
+- switch( priv->firmware_source )
++/*
++* Load the firmware from RTL8192SU/rtl8192sfw.bin
++*/
++ if(pFirmware->szFwTmpBufferLen == 0)
+ {
+- case FW_SOURCE_IMG_FILE:
+- if(pFirmware->szFwTmpBufferLen == 0)
+- {
+-
+- 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;
+- }
++ rc = request_firmware(&fw_entry, pFwImageFileName[ulInitStep],&priv->udev->dev);
++ if(rc < 0 ) {
++ RT_TRACE(COMP_ERR, "request firmware fail!\n");
++ goto DownloadFirmware_Fail;
++ }
+
+- memcpy(pFirmware->szFwTmpBuffer,fw_entry->data,fw_entry->size);
+- pFirmware->szFwTmpBufferLen = fw_entry->size;
++ if(fw_entry->size > sizeof(pFirmware->szFwTmpBuffer)) {
++ RT_TRACE(COMP_ERR, "img file size exceed the container buffer fail!\n");
+ 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;
+- }
+-
+-
++ goto DownloadFirmware_Fail;
+ }
+- break;
+
+- case FW_SOURCE_HEADER_FILE:
+-#if 1
+-#define Rtl819XFwImageArray Rtl8192SUFwImgArray
+- //2008.11.10 Add by tynli.
+- pucMappedFile = Rtl819XFwImageArray;
+- ulFileLength = ImgArrayLength;
++ 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;
+
+- RT_TRACE(COMP_INIT,"Fw download from header.\n");
+- /* Retrieve FW header*/
++ /* 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)))
+- {
+- printk("FirmwareDownload92S(): memory for data image is less than IMEM required\n");
++ 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.
++ /* 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))
+- {
+- printk(" FirmwareDownload92S(): memory for data image is less than EMEM required\n");
+- goto DownloadFirmware_Fail;
+- } else {
+- pucMappedFile+= pFirmware->FwIMEMLen;
+-
+- //Retriecve EMEM image.
+- memcpy(pFirmware->FwEMEM, pucMappedFile, pFwHdr->IMG_SRAM_SIZE);
+- pFirmware->FwEMEMLen = pFwHdr->IMG_SRAM_SIZE;
+- }
+-#endif
+- break;
+- default:
+- break;
++ 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;
++ }
+ }
+
+ FwStatus = FirmwareGetNextStatus(pFirmware->FWStatus);
+diff --git a/drivers/staging/rtl8192su/r8192S_firmware.h b/drivers/staging/rtl8192su/r8192S_firmware.h
+index c525380..2c2cf80 100644
+--- a/drivers/staging/rtl8192su/r8192S_firmware.h
++++ b/drivers/staging/rtl8192su/r8192S_firmware.h
+@@ -59,12 +59,6 @@ typedef enum _desc_packet_type_e{
+ DESC_PACKET_TYPE_NORMAL = 1,
+ }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{
+ OPT_SYSTEM_RESET = 0,
+ OPT_FIRMWARE_RESET = 1,
+@@ -185,7 +179,6 @@ typedef enum _FIRMWARE_8192S_STATUS{
+ #define RTL8190_MAX_FIRMWARE_CODE_SIZE 64000 //64k
+
+ typedef struct _rt_firmware{
+- firmware_source_e eFWSource;
+ PRT_8192S_FIRMWARE_HDR pFwHeader;
+ FIRMWARE_8192S_STATUS FWStatus;
+ u16 FirmwareVersion;
+diff --git a/drivers/staging/rtl8192su/r8192U.h b/drivers/staging/rtl8192su/r8192U.h
+index 2a11e01..ba87623 100644
+--- a/drivers/staging/rtl8192su/r8192U.h
++++ b/drivers/staging/rtl8192su/r8192U.h
+@@ -1258,7 +1258,6 @@ typedef struct r8192_priv
+ u8 Rf_Mode; //add for Firmware RF -R/W switch
+ prt_firmware pFirmware;
+ rtl819xUsb_loopback_e LoopbackMode;
+- firmware_source_e firmware_source;
+ bool usb_error;
+
+ u16 EEPROMTxPowerDiff;