Sunday, April 17, 2011

Intel 5300AGN

A couple of months ago, I got hold of a second handed Dell Latitude E4300. The laptop is great, featurin the top of the line intel SP9600 processor and 6gigs of ram. Only drawback, the Broadcom 4322 based Dell WiFi card which wasn't supported natively on Linux*.

After reading a bit I decided to go for an Intel 5000 series replacement. Off to eBay, I was stunned by the plethora of Intel 5300 AGN cards from China/HongKong/Singapore costing about $19.99US including international shipping. That was dead chep so I bit their bullet...

... and about 40 days later owing to Chinese new year or whatever was going on around February 12th, I had my card onto my hands. I installed it and booted 2.6.39-rc0 but a wireless device was nowhere to be found!!

Some searching through dmesg messages couple minutes later and there comes the culprit:

iwlagn 0000:0c:00.0: Unsupported (too old) EEPROM VER=0x114 < 0x11a CALIB=0x1 < 0x4

Googling for a solution I came across several hits describing with the same problem. Everybody concluded that these were all pre-production or engineering sample devices. They were apparently carrying the correct hardware but lacked all the calibration and whatever else made the card worthy of the CE or any like certification. As everybody with such a card reported to have acquired it through some questionable channel (notably eBay oriental sellers), it was apparent that these were probably some test runs by manufacturers which should have never hit the market... in other words all these cards could be regarded as "fake".

And oh my, upon closer inspection there did appear ... from sticker alignment, to printed vs reported MAC address and copied/scanned 3d barcode images and more... see here for a good example.

What puzzled people though was that these cards were working (sufficiently?) under Windows and probably that's the reason they're still selling. It was quickly revealed that the Windows driver didn't check the EEPROM version of calibration data and therefore happily utilized the hardware. People suggested and succeeded in "patching" the Linux iwlagn driver, removing the version check which made it abort, getting a working card in return.

I wasn't successful.

The card was brought up after patching the driver but at least with the 2.6.39-rc0 included driver, or the firmware version: 8.83.5.1 build 33692 had some more troubles beside that. Soon after trying to use the wifi, Linux logged an interminent series of:

[34531.440894] iwlagn 0000:0c:00.0: Microcode SW error detected. Restarting 0x82000000.
[34531.440909] iwlagn 0000:0c:00.0: Loaded firmware version: 8.83.5.1 build 33692
[34531.440936] iwlagn 0000:0c:00.0: Start IWL Error Log Dump:
[34531.440944] iwlagn 0000:0c:00.0: Status: 0x00020224, count: 5
[34531.441198] iwlagn 0000:0c:00.0: Desc Time data1 data2 line
[34531.441211] iwlagn 0000:0c:00.0: SYSASSERT (0x0005) 0000006053 0x00000000 0x0000096E 2414
[34531.441221] iwlagn 0000:0c:00.0: pc blink1 blink2 ilink1 ilink2 hcmd
[34531.441232] iwlagn 0000:0c:00.0: 0x1B67C 0x1B678 0x1B678 0x00000 0x00000 0x00000
[34531.441241] iwlagn 0000:0c:00.0: CSR values:
[34531.441248] iwlagn 0000:0c:00.0: (2nd byte of CSR_INT_COALESCING is CSR_INT_PERIODIC_REG)
[34531.441262] iwlagn 0000:0c:00.0: CSR_HW_IF_CONFIG_REG: 0X00480301
[34531.441275] iwlagn 0000:0c:00.0: CSR_INT_COALESCING: 0X00000040
[34531.441286] iwlagn 0000:0c:00.0: CSR_INT: 0X80000000
[34531.441297] iwlagn 0000:0c:00.0: CSR_INT_MASK: 0X00000000
[34531.441309] iwlagn 0000:0c:00.0: CSR_FH_INT_STATUS: 0X40010000
[34531.441320] iwlagn 0000:0c:00.0: CSR_GPIO_IN: 0X00000000
[34531.441331] iwlagn 0000:0c:00.0: CSR_RESET: 0X00000000
[34531.441345] iwlagn 0000:0c:00.0: CSR_GP_CNTRL: 0X080403c5
[34531.441355] iwlagn 0000:0c:00.0: CSR_HW_REV: 0X00000024
[34531.441368] iwlagn 0000:0c:00.0: CSR_EEPROM_REG: 0X00000000
[34531.441379] iwlagn 0000:0c:00.0: CSR_EEPROM_GP: 0X90000004
[34531.441390] iwlagn 0000:0c:00.0: CSR_OTP_GP_REG: 0X00060000
[34531.441401] iwlagn 0000:0c:00.0: CSR_GIO_REG: 0X00080044
[34531.441413] iwlagn 0000:0c:00.0: CSR_GP_UCODE_REG: 0X00000000
[34531.441424] iwlagn 0000:0c:00.0: CSR_GP_DRIVER_REG: 0X00000000
[34531.441435] iwlagn 0000:0c:00.0: CSR_UCODE_DRV_GP1: 0X00000000
[34531.441446] iwlagn 0000:0c:00.0: CSR_UCODE_DRV_GP2: 0X00000000
[34531.441457] iwlagn 0000:0c:00.0: CSR_LED_REG: 0X00000018
[34531.441468] iwlagn 0000:0c:00.0: CSR_DRAM_INT_TBL_REG: 0X00000000
[34531.441480] iwlagn 0000:0c:00.0: CSR_GIO_CHICKEN_BITS: 0X27800200
[34531.441492] iwlagn 0000:0c:00.0: CSR_ANA_PLL_CFG: 0X00880300
[34531.441503] iwlagn 0000:0c:00.0: CSR_HW_REV_WA_REG: 0X0001001a
[34531.441514] iwlagn 0000:0c:00.0: CSR_DBG_HPET_MEM_REG: 0Xffff0000
[34531.441523] iwlagn 0000:0c:00.0: FH register values:
[34531.441546] iwlagn 0000:0c:00.0: FH_RSCSR_CHNL0_STTS_WPTR_REG: 0X0fff6e00
[34531.441570] iwlagn 0000:0c:00.0: FH_RSCSR_CHNL0_RBDCB_BASE_REG: 0X00fff6f0
[34531.441593] iwlagn 0000:0c:00.0: FH_RSCSR_CHNL0_WPTR: 0X000000f8
[34531.441615] iwlagn 0000:0c:00.0: FH_MEM_RCSR_CHNL0_CONFIG_REG: 0X80819104
[34531.441638] iwlagn 0000:0c:00.0: FH_MEM_RSSR_SHARED_CTRL_REG: 0X000000fc
[34531.441661] iwlagn 0000:0c:00.0: FH_MEM_RSSR_RX_STATUS_REG: 0X07030000
[34531.441683] iwlagn 0000:0c:00.0: FH_MEM_RSSR_RX_ENABLE_ERR_IRQ2DRV: 0X00000000
[34531.441706] iwlagn 0000:0c:00.0: FH_TSSR_TX_STATUS_REG: 0X07ff0001
[34531.441729] iwlagn 0000:0c:00.0: FH_TSSR_TX_ERROR_REG: 0X00000000
[34531.441798] iwlagn 0000:0c:00.0: Start IWL Event Log Dump: display last 4 entries
[34531.441827] iwlagn 0000:0c:00.0: EVT_LOGT:0000000000:0x0000028c:0117
[34531.441846] iwlagn 0000:0c:00.0: EVT_LOGT:0000000022:0x00000000:1208
[34531.441864] iwlagn 0000:0c:00.0: EVT_LOGT:0000002258:0x00000000:0480
[34531.441882] iwlagn 0000:0c:00.0: EVT_LOGT:0000006062:0x00000000:0125
[34531.441981] iwlagn 0000:0c:00.0: init uCode did not respond OK.
[34535.434244] iwlagn 0000:0c:00.0: START_ALIVE timeout after 4000ms.


So either my Dell, my kernel driver or firmware had something dependent on the correct production EEPROM being in the card.

I then found iwleeprom, a utility able to read and write (flash) the EEPROM image of the wifi card. That was sooo sweet... once I managed to get hold of an EEPROM dump off a legitimate 5300AGN card, I flashed it and ... yeap, you guessed it, my card works as it should!

I haven't seen this resolution in any search I made so far. So there, if you haven't tossed it already you may as well try this ...

Maybe, if there could be a legitimate way of obtaining such an EEPROM dump, all those people fooled into buying cheap Intel knock-offs on eBay or elsewhere could at least get their hardware working properly with Linux.


* In post 2.6.38 kernels the b43 driver recognizes the chipset and tries to load its firmware. The firmware can be extracted by patching the fwcutter to handle a 5.x series Windows driver image from Broadcom. Yet, at least on my computer the card would scan a couple of networks, report them all at 100% strength and then play dead. Oh well...