# Little hack needed to get Intel AGN 5300 work

## Jimini

Hey there,

a few days ago, I bought a new wireless card for my notebook (Intel Corporation PRO/Wireless 5300 AGN [Shiloh] Network Connection), but I can't get this thing work. I found out, that this thing is a so called "engineering sample", which seems to make problems under Linux. But it also seems, as if this problem should not be that big.

But first, here is the error message:

dmesg | grep iwl

```
[   15.405570] iwlagn: Intel(R) Wireless WiFi Link AGN driver for Linux, in-tree:

[   15.405573] iwlagn: Copyright(c) 2003-2010 Intel Corporation

[   15.405687] iwlagn 0000:02:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16

[   15.405695] iwlagn 0000:02:00.0: setting latency timer to 64

[   15.405728] iwlagn 0000:02:00.0: Detected Intel(R) Ultimate N WiFi Link 5300 AGN, REV=0x24

[   15.426819] iwlagn 0000:02:00.0: Unsupported (too old) EEPROM VER=0x114 < 0x11a CALIB=0x1 < 0x4

[   15.426842] iwlagn 0000:02:00.0: PCI INT A disabled

[   15.427018] iwlagn: probe of 0000:02:00.0 failed with error -22
```

So I tried to comment the following lines out as shown here:

```
/*      if (eeprom_ver < priv->cfg->eeprom_ver ||

            calib_ver < priv->cfg->eeprom_calib_ver)

                goto err;

        IWL_INFO(priv, "device EEPROM VER=0x%x, CALIB=0x%x\n",

                 eeprom_ver, calib_ver);

*/
```

After having recompiled the kernel and rebooted the system, dmesg | grep iwl shows

```
[   15.364511] iwlagn: Intel(R) Wireless WiFi Link AGN driver for Linux, in-tree:

[   15.364514] iwlagn: Copyright(c) 2003-2010 Intel Corporation

[   15.364628] iwlagn 0000:02:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16

[   15.364636] iwlagn 0000:02:00.0: setting latency timer to 64

[   15.364666] iwlagn 0000:02:00.0: Detected Intel(R) Ultimate N WiFi Link 5300 AGN, REV=0x24

[   15.385768] iwlagn 0000:02:00.0: Device SKU: 0Xb

[   15.385771] iwlagn 0000:02:00.0: Valid Tx ant: 0X3, Valid Rx ant: 0X7

[   15.385937] iwlagn 0000:02:00.0: Tunable channels: 13 802.11bg, 24 802.11a channels

[   15.386022] iwlagn 0000:02:00.0: irq 50 for MSI/MSI-X

[   15.534271] iwlagn 0000:02:00.0: request for firmware file 'iwlwifi-5000-5.ucode' failed.

[   15.536110] iwlagn 0000:02:00.0: request for firmware file 'iwlwifi-5000-4.ucode' failed.

[   15.537470] iwlagn 0000:02:00.0: request for firmware file 'iwlwifi-5000-3.ucode' failed.

[   15.586683] iwlagn 0000:02:00.0: Firmware has old API version. Expected v5, got v2. New firmware can be obtained from http://www.intellinuxwireless.org.

[   15.586688] iwlagn 0000:02:00.0: loaded firmware version 8.24.2.12

[   15.589024] ieee80211 phy0: Selected rate control algorithm 'iwl-agn-rs'

[   19.102853] iwlagn 0000:02:00.0: Microcode SW error detected.  Restarting 0x82000000.

[   19.102859] iwlagn 0000:02:00.0: Loaded firmware version: 8.24.2.12

[   19.102863] iwlagn 0000:02:00.0: Not valid error log pointer 0x00000000 for Init uCode

[   19.102866] iwlagn 0000:02:00.0: CSR values:

[   19.102869] iwlagn 0000:02:00.0: (2nd byte of CSR_INT_COALESCING is CSR_INT_PERIODIC_REG)

[   19.102875] iwlagn 0000:02:00.0:        CSR_HW_IF_CONFIG_REG: 0X00480301

[   19.102881] iwlagn 0000:02:00.0:          CSR_INT_COALESCING: 0X00000040

[   19.102886] iwlagn 0000:02:00.0:                     CSR_INT: 0X80000000

[   19.102892] iwlagn 0000:02:00.0:                CSR_INT_MASK: 0X00000000

[   19.102897] iwlagn 0000:02:00.0:           CSR_FH_INT_STATUS: 0X40010000

[   19.102902] iwlagn 0000:02:00.0:                 CSR_GPIO_IN: 0X00000000

[   19.102908] iwlagn 0000:02:00.0:                   CSR_RESET: 0X00000000

[   19.102913] iwlagn 0000:02:00.0:                CSR_GP_CNTRL: 0X080403c5

[   19.102919] iwlagn 0000:02:00.0:                  CSR_HW_REV: 0X00000024

[   19.102924] iwlagn 0000:02:00.0:              CSR_EEPROM_REG: 0X00000000

[   19.102929] iwlagn 0000:02:00.0:               CSR_EEPROM_GP: 0X90000004

[   19.102935] iwlagn 0000:02:00.0:              CSR_OTP_GP_REG: 0X00060000

[   19.102940] iwlagn 0000:02:00.0:                 CSR_GIO_REG: 0X00080044

[   19.102946] iwlagn 0000:02:00.0:            CSR_GP_UCODE_REG: 0X00000000

[   19.102951] iwlagn 0000:02:00.0:           CSR_GP_DRIVER_REG: 0X00000000

[   19.102957] iwlagn 0000:02:00.0:           CSR_UCODE_DRV_GP1: 0X00000000

[   19.102962] iwlagn 0000:02:00.0:           CSR_UCODE_DRV_GP2: 0X00000000

[   19.102967] iwlagn 0000:02:00.0:                 CSR_LED_REG: 0X00000018

[   19.102973] iwlagn 0000:02:00.0:        CSR_DRAM_INT_TBL_REG: 0X00000000

[   19.102978] iwlagn 0000:02:00.0:        CSR_GIO_CHICKEN_BITS: 0X27800200

[   19.102984] iwlagn 0000:02:00.0:             CSR_ANA_PLL_CFG: 0X00880300

[   19.102989] iwlagn 0000:02:00.0:           CSR_HW_REV_WA_REG: 0X0001001a

[   19.102994] iwlagn 0000:02:00.0:        CSR_DBG_HPET_MEM_REG: 0Xffff0000

[   19.102997] iwlagn 0000:02:00.0: FH register values:

[   19.103010] iwlagn 0000:02:00.0:         FH_RSCSR_CHNL0_STTS_WPTR_REG: 0X07b93300

[   19.103023] iwlagn 0000:02:00.0:        FH_RSCSR_CHNL0_RBDCB_BASE_REG: 0X007bbb80

[   19.103036] iwlagn 0000:02:00.0:                  FH_RSCSR_CHNL0_WPTR: 0X000000f8

[   19.103049] iwlagn 0000:02:00.0:         FH_MEM_RCSR_CHNL0_CONFIG_REG: 0X80819104

[   19.103063] iwlagn 0000:02:00.0:          FH_MEM_RSSR_SHARED_CTRL_REG: 0X000000fc

[   19.103076] iwlagn 0000:02:00.0:            FH_MEM_RSSR_RX_STATUS_REG: 0X07030000

[   19.103089] iwlagn 0000:02:00.0:    FH_MEM_RSSR_RX_ENABLE_ERR_IRQ2DRV: 0X00000000

[   19.103102] iwlagn 0000:02:00.0:                FH_TSSR_TX_STATUS_REG: 0X07ff0001

[   19.103115] iwlagn 0000:02:00.0:                 FH_TSSR_TX_ERROR_REG: 0X00000000

[   19.103119] iwlagn 0000:02:00.0: Invalid event log pointer 0x00000000 for Init uCode

[   19.103127] iwlagn 0000:02:00.0: uCode did not respond OK.

[   23.096506] iwlagn 0000:02:00.0: START_ALIVE timeout after 4000ms.

[   23.571669] iwlagn 0000:02:00.0: Microcode SW error detected.  Restarting 0x82000000.

[   23.571674] iwlagn 0000:02:00.0: Loaded firmware version: 8.24.2.12

[   23.571678] iwlagn 0000:02:00.0: Not valid error log pointer 0x00000000 for RT uCode

[   23.571681] iwlagn 0000:02:00.0: CSR values:

[   23.571684] iwlagn 0000:02:00.0: (2nd byte of CSR_INT_COALESCING is CSR_INT_PERIODIC_REG)

[   23.571690] iwlagn 0000:02:00.0:        CSR_HW_IF_CONFIG_REG: 0X00480301

[   23.571696] iwlagn 0000:02:00.0:          CSR_INT_COALESCING: 0X00000040

[   23.571701] iwlagn 0000:02:00.0:                     CSR_INT: 0X80000000

[   23.571707] iwlagn 0000:02:00.0:                CSR_INT_MASK: 0X00000000

[   23.571712] iwlagn 0000:02:00.0:           CSR_FH_INT_STATUS: 0X40010000

[   23.571718] iwlagn 0000:02:00.0:                 CSR_GPIO_IN: 0X00000000

[   23.571723] iwlagn 0000:02:00.0:                   CSR_RESET: 0X00000000

[   23.571728] iwlagn 0000:02:00.0:                CSR_GP_CNTRL: 0X080403c5

[   23.571734] iwlagn 0000:02:00.0:                  CSR_HW_REV: 0X00000024

[   23.571739] iwlagn 0000:02:00.0:              CSR_EEPROM_REG: 0X00000000

[   23.571745] iwlagn 0000:02:00.0:               CSR_EEPROM_GP: 0X90000004

[   23.571750] iwlagn 0000:02:00.0:              CSR_OTP_GP_REG: 0X00060000

[   23.571756] iwlagn 0000:02:00.0:                 CSR_GIO_REG: 0X00080044

[   23.571761] iwlagn 0000:02:00.0:            CSR_GP_UCODE_REG: 0X00000000

[   23.571766] iwlagn 0000:02:00.0:           CSR_GP_DRIVER_REG: 0X00000000

[   23.571772] iwlagn 0000:02:00.0:           CSR_UCODE_DRV_GP1: 0X00000000

[   23.571777] iwlagn 0000:02:00.0:           CSR_UCODE_DRV_GP2: 0X00000000

[   23.571782] iwlagn 0000:02:00.0:                 CSR_LED_REG: 0X00000018

[   23.571787] iwlagn 0000:02:00.0:        CSR_DRAM_INT_TBL_REG: 0X00000000

[   23.571793] iwlagn 0000:02:00.0:        CSR_GIO_CHICKEN_BITS: 0X27800200

[   23.571798] iwlagn 0000:02:00.0:             CSR_ANA_PLL_CFG: 0X00880300

[   23.571804] iwlagn 0000:02:00.0:           CSR_HW_REV_WA_REG: 0X0001001a

[   23.571809] iwlagn 0000:02:00.0:        CSR_DBG_HPET_MEM_REG: 0Xffff0000

[   23.571812] iwlagn 0000:02:00.0: FH register values:

[   23.571825] iwlagn 0000:02:00.0:         FH_RSCSR_CHNL0_STTS_WPTR_REG: 0X07b93300

[   23.571838] iwlagn 0000:02:00.0:        FH_RSCSR_CHNL0_RBDCB_BASE_REG: 0X007bbb80

[   23.571851] iwlagn 0000:02:00.0:                  FH_RSCSR_CHNL0_WPTR: 0X000000f8

[   23.571865] iwlagn 0000:02:00.0:         FH_MEM_RCSR_CHNL0_CONFIG_REG: 0X80819104

[   23.571883] iwlagn 0000:02:00.0:          FH_MEM_RSSR_SHARED_CTRL_REG: 0X000000fc

[   23.571895] iwlagn 0000:02:00.0:            FH_MEM_RSSR_RX_STATUS_REG: 0X07030000

[   23.571907] iwlagn 0000:02:00.0:    FH_MEM_RSSR_RX_ENABLE_ERR_IRQ2DRV: 0X00000000

[   23.571919] iwlagn 0000:02:00.0:                FH_TSSR_TX_STATUS_REG: 0X07ff0001

[   23.571931] iwlagn 0000:02:00.0:                 FH_TSSR_TX_ERROR_REG: 0X00000000

[   23.571934] iwlagn 0000:02:00.0: Invalid event log pointer 0x00000000 for RT uCode

[   23.571940] iwlagn 0000:02:00.0: uCode did not respond OK.

[   27.565729] iwlagn 0000:02:00.0: START_ALIVE timeout after 4000ms.

[   28.854019] iwlagn 0000:02:00.0: Microcode SW error detected.  Restarting 0x82000000.

[   28.854025] iwlagn 0000:02:00.0: Loaded firmware version: 8.24.2.12

[   28.854029] iwlagn 0000:02:00.0: Not valid error log pointer 0x00000000 for RT uCode

[   28.854032] iwlagn 0000:02:00.0: CSR values:

[   28.854035] iwlagn 0000:02:00.0: (2nd byte of CSR_INT_COALESCING is CSR_INT_PERIODIC_REG)

[   28.854041] iwlagn 0000:02:00.0:        CSR_HW_IF_CONFIG_REG: 0X00480301

[   28.854047] iwlagn 0000:02:00.0:          CSR_INT_COALESCING: 0X00000040

[   28.854052] iwlagn 0000:02:00.0:                     CSR_INT: 0X80000000

[   28.854058] iwlagn 0000:02:00.0:                CSR_INT_MASK: 0X00000000

[   28.854064] iwlagn 0000:02:00.0:           CSR_FH_INT_STATUS: 0X40010000

[   28.854069] iwlagn 0000:02:00.0:                 CSR_GPIO_IN: 0X00000000

[   28.854074] iwlagn 0000:02:00.0:                   CSR_RESET: 0X00000000

[   28.854080] iwlagn 0000:02:00.0:                CSR_GP_CNTRL: 0X080403c5

[   28.854085] iwlagn 0000:02:00.0:                  CSR_HW_REV: 0X00000024

[   28.854091] iwlagn 0000:02:00.0:              CSR_EEPROM_REG: 0X00000000

[   28.854096] iwlagn 0000:02:00.0:               CSR_EEPROM_GP: 0X90000004

[   28.854102] iwlagn 0000:02:00.0:              CSR_OTP_GP_REG: 0X00060000

[   28.854107] iwlagn 0000:02:00.0:                 CSR_GIO_REG: 0X00080044

[   28.854112] iwlagn 0000:02:00.0:            CSR_GP_UCODE_REG: 0X00000000

[   28.854118] iwlagn 0000:02:00.0:           CSR_GP_DRIVER_REG: 0X00000000

[   28.854123] iwlagn 0000:02:00.0:           CSR_UCODE_DRV_GP1: 0X00000000

[   28.854129] iwlagn 0000:02:00.0:           CSR_UCODE_DRV_GP2: 0X00000000

[   28.854134] iwlagn 0000:02:00.0:                 CSR_LED_REG: 0X00000018

[   28.854139] iwlagn 0000:02:00.0:        CSR_DRAM_INT_TBL_REG: 0X00000000

[   28.854145] iwlagn 0000:02:00.0:        CSR_GIO_CHICKEN_BITS: 0X27800200

[   28.854150] iwlagn 0000:02:00.0:             CSR_ANA_PLL_CFG: 0X00880300

[   28.854156] iwlagn 0000:02:00.0:           CSR_HW_REV_WA_REG: 0X0001001a

[   28.854161] iwlagn 0000:02:00.0:        CSR_DBG_HPET_MEM_REG: 0Xffff0000

[   28.854164] iwlagn 0000:02:00.0: FH register values:

[   28.854177] iwlagn 0000:02:00.0:         FH_RSCSR_CHNL0_STTS_WPTR_REG: 0X07b93300

[   28.854190] iwlagn 0000:02:00.0:        FH_RSCSR_CHNL0_RBDCB_BASE_REG: 0X007bbb80

[   28.854203] iwlagn 0000:02:00.0:                  FH_RSCSR_CHNL0_WPTR: 0X000000f8

[   28.854216] iwlagn 0000:02:00.0:         FH_MEM_RCSR_CHNL0_CONFIG_REG: 0X80819104

[   28.854229] iwlagn 0000:02:00.0:          FH_MEM_RSSR_SHARED_CTRL_REG: 0X000000fc

[   28.854243] iwlagn 0000:02:00.0:            FH_MEM_RSSR_RX_STATUS_REG: 0X07030000

[   28.854256] iwlagn 0000:02:00.0:    FH_MEM_RSSR_RX_ENABLE_ERR_IRQ2DRV: 0X00000000

[   28.854269] iwlagn 0000:02:00.0:                FH_TSSR_TX_STATUS_REG: 0X07ff0001

[   28.854282] iwlagn 0000:02:00.0:                 FH_TSSR_TX_ERROR_REG: 0X00000000

[   28.854286] iwlagn 0000:02:00.0: Invalid event log pointer 0x00000000 for RT uCode

[   28.854293] iwlagn 0000:02:00.0: uCode did not respond OK.

[   32.847107] iwlagn 0000:02:00.0: START_ALIVE timeout after 4000ms.

[   32.952717] iwlagn 0000:02:00.0: Microcode SW error detected.  Restarting 0x82000000.

[   32.952722] iwlagn 0000:02:00.0: Loaded firmware version: 8.24.2.12

[   32.952726] iwlagn 0000:02:00.0: Not valid error log pointer 0x00000000 for RT uCode

[   32.952729] iwlagn 0000:02:00.0: CSR values:

[   32.952732] iwlagn 0000:02:00.0: (2nd byte of CSR_INT_COALESCING is CSR_INT_PERIODIC_REG)

[   32.952738] iwlagn 0000:02:00.0:        CSR_HW_IF_CONFIG_REG: 0X00480301

[   32.952744] iwlagn 0000:02:00.0:          CSR_INT_COALESCING: 0X00000040

[   32.952750] iwlagn 0000:02:00.0:                     CSR_INT: 0X80000000

[   32.952755] iwlagn 0000:02:00.0:                CSR_INT_MASK: 0X00000000

[   32.952761] iwlagn 0000:02:00.0:           CSR_FH_INT_STATUS: 0X40010000

[   32.952766] iwlagn 0000:02:00.0:                 CSR_GPIO_IN: 0X00000000

[   32.952771] iwlagn 0000:02:00.0:                   CSR_RESET: 0X00000000

[   32.952777] iwlagn 0000:02:00.0:                CSR_GP_CNTRL: 0X080403c5

[   32.952782] iwlagn 0000:02:00.0:                  CSR_HW_REV: 0X00000024

[   32.952787] iwlagn 0000:02:00.0:              CSR_EEPROM_REG: 0X00000000

[   32.952793] iwlagn 0000:02:00.0:               CSR_EEPROM_GP: 0X90000004

[   32.952798] iwlagn 0000:02:00.0:              CSR_OTP_GP_REG: 0X00060000

[   32.952804] iwlagn 0000:02:00.0:                 CSR_GIO_REG: 0X00080044

[   32.952810] iwlagn 0000:02:00.0:            CSR_GP_UCODE_REG: 0X00000000

[   32.952815] iwlagn 0000:02:00.0:           CSR_GP_DRIVER_REG: 0X00000000

[   32.952820] iwlagn 0000:02:00.0:           CSR_UCODE_DRV_GP1: 0X00000000

[   32.952826] iwlagn 0000:02:00.0:           CSR_UCODE_DRV_GP2: 0X00000000

[   32.952831] iwlagn 0000:02:00.0:                 CSR_LED_REG: 0X00000018

[   32.952836] iwlagn 0000:02:00.0:        CSR_DRAM_INT_TBL_REG: 0X00000000

[   32.952842] iwlagn 0000:02:00.0:        CSR_GIO_CHICKEN_BITS: 0X27800200

[   32.952847] iwlagn 0000:02:00.0:             CSR_ANA_PLL_CFG: 0X00880300

[   32.952853] iwlagn 0000:02:00.0:           CSR_HW_REV_WA_REG: 0X0001001a

[   32.952858] iwlagn 0000:02:00.0:        CSR_DBG_HPET_MEM_REG: 0Xffff0000

[   32.952861] iwlagn 0000:02:00.0: FH register values:

[   32.952874] iwlagn 0000:02:00.0:         FH_RSCSR_CHNL0_STTS_WPTR_REG: 0X07b93300

[   32.952887] iwlagn 0000:02:00.0:        FH_RSCSR_CHNL0_RBDCB_BASE_REG: 0X007bbb80

[   32.952900] iwlagn 0000:02:00.0:                  FH_RSCSR_CHNL0_WPTR: 0X000000f8

[   32.952913] iwlagn 0000:02:00.0:         FH_MEM_RCSR_CHNL0_CONFIG_REG: 0X80819104

[   32.952932] iwlagn 0000:02:00.0:          FH_MEM_RSSR_SHARED_CTRL_REG: 0X000000fc

[   32.952944] iwlagn 0000:02:00.0:            FH_MEM_RSSR_RX_STATUS_REG: 0X07030000

[   32.952956] iwlagn 0000:02:00.0:    FH_MEM_RSSR_RX_ENABLE_ERR_IRQ2DRV: 0X00000000

[   32.952968] iwlagn 0000:02:00.0:                FH_TSSR_TX_STATUS_REG: 0X07ff0001

[   32.952980] iwlagn 0000:02:00.0:                 FH_TSSR_TX_ERROR_REG: 0X00000000

[   32.952982] iwlagn 0000:02:00.0: Invalid event log pointer 0x00000000 for RT uCode

[   32.952988] iwlagn 0000:02:00.0: uCode did not respond OK.

[   36.946817] iwlagn 0000:02:00.0: START_ALIVE timeout after 4000ms.
```

What am I doing wrong?

I am using iwl5000-ucode-8.24.2.12 and 2.6.38-gentoo-r1 with the following options:

```
Perikles ~ # grep -i iwl /usr/src/linux/.config 

CONFIG_IWLWIFI=m

# CONFIG_IWLWIFI_DEBUG is not set

# CONFIG_IWLWIFI_DEVICE_TRACING is not set

CONFIG_IWLAGN=m

# CONFIG_IWL4965 is not set

CONFIG_IWL5000=y

# CONFIG_IWL3945 is not set
```

Best regards,

Jimini

P.S.: this is the driver's code: http://nopaste.info/d8327847e9.html

----------

## BradN

Was there an included windows driver?

If so, perhaps the firmware can be somehow extracted from it, or else you could use the windows driver with ndiswrapper.  Better than nothing at least.

----------

## Jimini

I tried to use the windows driver with ndiswrapper, but I only got the error, that no wifi adapter could be found. I guess I will buy a new wifi card, which will be now engineering sample.

Thanks for your effort though, BradN.

Best regards,

Jimini

----------

## BradN

Make sure that only the windows driver via ndiswrapper is used and the kernel driver is disabled - even if the driver doesn't load, it may do something to the card state that prevents the other driver from finding it.

----------

