# [SOLVED] Intel 4965AGN WiFi card (802.11n)

## nonhuman

I just ordered a new ThinkPad T61 with a 4965AGN wifi card. A little research suggets that there are drivers available for that wifi card, but I'm a little less than clear on the specifics. Can anyone help me out with this?

Thanks.  :Smile: 

----------

## Link31

```
Device Drivers --->

        [*] Network device support --->

                Wireless LAN --->

                        [*]     Wireless LAN (IEEE 802.11)                            

                           <M>     Intel Wireless WiFi 4965AGN
```

You should compile it as a module, it still has some bugs, so you will be able to reset the driver by reloading it.

You'll also need the microcode:

```
emerge net-wireless/iwl4965-ucode
```

There are lots of useful info about this laptop on this page: http://gentoo-wiki.com/HARDWARE_Lenovo_Thinkpad_T61  :Smile: 

----------

## termite

When the driver works, it works well.  It's not quite up to 802.11n speeds (I get 3.5MB/s), but it is decent.

On the other hand, I've had non-stop problems that require unloading and reloading the driver....

----------

## nonhuman

Interesting. Am I going to regret having gotten the agn card instead of the abg one?

----------

## Link31

Well, maybe you'll have problems when trying to associate to an AP or when the AP is not very stable. The main issues with this driver are at the time it connects to the AP.

But when associated, this card is great: very stable connections (at least if you didn't messed up the config like the Ubuntu devs), and a great range.

----------

## termite

No, you won't regret it.  Full 802.11n connections are not far away.  The driver is still be ironed out, but it's good.

Put a script called restartwireless or something like that in your /usr/bin with the following:

```
#!/bin/bash

rmmod iwl4965

rmmod iwlcore   #you may not need this line

rmmod mac80211

sleep 2

modprobe iwl4965
```

On the latest zen-sources kernel (2.6.26-rc3), there's an option to have the wireless led blink on transmission.  That's mostly annoying, but very useful to see when your connection has dropped.  If you feel like investigating further, you could probably link the dropped connection to that script with something hackish...

----------

## nonhuman

Sweet, good to know. Now I'm really looking forward to it getting here.

Sadly, Lenovo's estimated shipping date is the 11th... Good thing I got the 2-day shipping...

----------

## termite

my shipping date was May 31st, but I got the computer about a week ago  :Smile: 

----------

## nonhuman

Nice.

----------

## nukem996

I have the same laptop with the same wireless card. It works very well for me I have no problems. The only problems I have are with my universities wireless network. I'm running 2.6.25-gentoo-r4 with ~amd64.

----------

## nonhuman

 *nukem996 wrote:*   

> I have the same laptop with the same wireless card. It works very well for me I have no problems. The only problems I have are with my universities wireless network. I'm running 2.6.25-gentoo-r4 with ~amd64.

 

Cool, good to hear. Any tips for the kernel conf et al?

----------

## nukem996

 *nonhuman wrote:*   

>  *nukem996 wrote:*   I have the same laptop with the same wireless card. It works very well for me I have no problems. The only problems I have are with my universities wireless network. I'm running 2.6.25-gentoo-r4 with ~amd64. 
> 
> Cool, good to hear. Any tips for the kernel conf et al?

 

If you got the fingerprint reader you need uinput enabled, if you want hdaps don't use the in kernel driver just emerge tp_smapi, finally while you should enable acpi_thinkpad I did not enable video control in that, it seems to work fine through the nvidia drivers.

Also I forgot the mention I have yet to use this on anything but 802.11g networks. I'm looking into get an n router but I haven't found a good one yet.

----------

## nonhuman

 *nukem996 wrote:*   

>  *nonhuman wrote:*    *nukem996 wrote:*   I have the same laptop with the same wireless card. It works very well for me I have no problems. The only problems I have are with my universities wireless network. I'm running 2.6.25-gentoo-r4 with ~amd64. 
> 
> Cool, good to hear. Any tips for the kernel conf et al? 
> 
> If you got the fingerprint reader you need uinput enabled, if you want hdaps don't use the in kernel driver just emerge tp_smapi, finally while you should enable acpi_thinkpad I did not enable video control in that, it seems to work fine through the nvidia drivers.
> ...

 

Good to know. I've got both an n and b/g router going so I don't have to compromise on the network speeds for my n enabled computer(s), so I should be fine either way (thought it would be nice to use it with my n network).

Also, it shipped yesterday!  :Smile:  Assuming Monday doesn't count as a business day because of the holiday, it should arrive on Wednesday.[/glep]

----------

## nonhuman

 *termite wrote:*   

> On the latest zen-sources kernel (2.6.26-rc3), there's an option to have the wireless led blink on transmission.  That's mostly annoying, but very useful to see when your connection has dropped.  If you feel like investigating further, you could probably link the dropped connection to that script with something hackish...

 

I'm probably going to be using the zen-sources anyway because I want to play with btrfs, Reiser4, and ext4, so maybe I will see if I can do something about automatically running the script on a dropped connection.

Damn, I've spent the past two days looking into all the different fun things I can play with, and now I can't wait for the ThinkPad to get here so I can actually get out all the new toys. I haven't run Gentoo in about two years since I sold my old ThinkPad, and I'm really starting to jones for some Linux hacking. All my other hardware is Apple, I need to leave the iMac running OS X for the wife, and as much as I love my MacBook (soon to be my wife's), I just can't stand using anything other than OS X with only one mouse button (unless I'm just dumb and haven't been configuring the synaptics drivers properly, which is entirely possible because I haven't really tried that hard since it was in Ubuntu which I hate, but was using for the easy install).

Speaking of zen-sources, is the list of current patches on the Gentoo wiki (http://gentoo-wiki.com/Zen-Sources#Current_Patches) accurate? It says it's got the iwlwifi patch, but isn't that in the official kernel sources now?

(Ok, mapping ctrl-e to the GLEP tag is really starting to piss me off...)

----------

## termite

No idea regarding that list of patches.  There's a zen-sources thread in Unsupported Software.  Ask there.

I would start with a stable kernel (gentoo-sources or tuxonice-sources), get that configured and running and then copy the .config to zen and make oldconfig.  It's much easier that way.  It's what I did, and I'm now running zen-sources-2.6.26_rc3.  It's pretty good, but has an annoying bug with v86d/uvesafb, and hdaps/tp_smapi are dead for the moment.  All those work fine with 2.6.25.  I don't have a fingerprint reader, so no idea there.

If you want my .config or anything else, drop me a note here or by PM.

Enjoy  :Smile: 

----------

## nonhuman

I'd love to see you .config. That would be awesome. Thanks.  :Smile: 

----------

## nukem996

Just wondering why would you want to use zen sources? My T61p comes with the Intel Core 2 Duo T9300 which has support for hardware virtualization. I'm planning on setting up kqemu when I get some time. Wouldn't that work just as well if not better?

----------

## termite

What has installing kqemu got to do with what kernel version you're using?

I think you're confusing xen with zen!

----------

## nukem996

 *termite wrote:*   

> What has installing kqemu got to do with what kernel version you're using?
> 
> I think you're confusing xen with zen!

 

Your correct. I'm sorry disregard what I said.

----------

## nonhuman

Well, the ThinkPad is here, and I've currently got a working Gentoo install on it. I only just finished the install process, so I haven't really gotten around to setting anything up yet, including the wireless, but still, it's fun to have a machine running Gentoo again.

At the moment I'm using tuxonice-sources with 'safe' FSs (ext2, reiserfs, JFS). Once I've got a usable system up and running I plan on changing to zen-sources and fooling around with btrfs. Installing X right now. Then will come wireless conf.

----------

## termite

Enjoy  :Smile: 

----------

## nonhuman

Holy crap. It's obviously been a long time since I've compiled XOrg, that was (relatively) insanely fast!

----------

## nonhuman

Hmm, I don't suppose anyone wants to share their xorg.conf?  :Smile: 

----------

## nukem996

 *nonhuman wrote:*   

> Hmm, I don't suppose anyone wants to share their xorg.conf? 

 

I have a nvidia card, all I did was run nvidia-xconfig but here is mine

```

# nvidia-xconfig: X configuration file generated by nvidia-xconfig

# nvidia-xconfig:  version 1.0  (buildmeister@builder26)  Thu Feb 14 18:13:41 PST 2008

Section "ServerLayout"

    Identifier     "Layout0"

    Screen      0  "Screen0" 0 0

    InputDevice    "Keyboard0" "CoreKeyboard"

    InputDevice    "TouchPad"

    InputDevice    "TrackPoint" "CorePointer"

EndSection

Section "ServerFlags"

   Option     "off time" "10"

EndSection

Section "Files"

    RgbPath         "/usr/lib64/X11/rgb"

EndSection

Section "Module"

    Load           "dbe"

    Load           "extmod"

    Load           "type1"

    Load           "freetype"

    Load           "glx"

EndSection

Section "InputDevice"

    Identifier     "TouchPad"

    Driver         "synaptics"

    Option         "Device" "/dev/input/mouse0"

    Option         "Protocol" "auto-dev"

    Option         "SHMConfig" "on"

    Option         "RBCornerButton" "0"

    Option         "LBCornerButton" "0"

    Option         "LTCornerButton" "0"

    Option         "RTCornerButton" "0"

EndSection

Section "InputDevice"

    Identifier     "TrackPoint"

    Driver         "mouse"

    Option         "Device" "/dev/input/mouse1"

    Option         "SendCoreEvents"

    Option         "Emulate3Buttons" "no"

    Option         "Protocol"

    Option         "ZAxisMapping" "4 5"

EndSection

Section "InputDevice"

    # generated from default

    Identifier     "Keyboard0"

    Driver         "keyboard"

EndSection

Section "Monitor"

    Identifier     "Monitor0"

    VendorName     "Unknown"

    ModelName      "Unknown"

    HorizSync       30.0 - 110.0

    VertRefresh     50.0 - 150.0

    Option         "DPMS"

EndSection

Section "Device"

    Identifier     "Device0"

    Driver         "nvidia"

    VendorName     "NVIDIA Corporation"

EndSection

Section "Screen"

    Identifier     "Screen0"

    Device         "Device0"

    Monitor        "Monitor0"

    DefaultDepth    24

    Option         "RenderAccel" "True"

    Option         "AllowGLXWithComposite" "True"

    Option         "AllowDDCCI" "True"

    Option         "LoadKernelModule" "True"

    Option         "AddARGBGLXVisuals" "True"

    SubSection     "Display"

        Depth       24

    EndSubSection

EndSection

Section "Extensions"

    Option         "Composite" "Enable"

EndSection

```

----------

## termite

Intel card, with DRI and all (compiz works):

```
Section "ServerLayout"

   Identifier     "X.org Configured"

   Screen      0  "Screen0" 0 0

   InputDevice    "Mouse0" "CorePointer"

   InputDevice    "Keyboard0" "CoreKeyboard"

   Option   "AIGLX" "true"

EndSection

Section "Files"

   RgbPath      "/usr/share/X11/rgb"

   ModulePath   "/usr/lib64/xorg/modules"

    FontPath    "/usr/share/fonts/misc"

    FontPath    "/usr/share/fonts/TTF"

    FontPath    "/usr/share/fonts/Type1"

    FontPath    "/usr/share/fonts/100dpi:unscaled"

    FontPath    "/usr/share/fonts/75dpi:unscaled"

    FontPath    "/usr/share/fonts/corefonts"

    FontPath    "/usr/share/fonts/freefonts"

    FontPath    "/usr/share/fonts/terminus"

    FontPath    "/usr/share/fonts/ttf-bitstream-vera"

    FontPath    "/usr/share/fonts/unifont"

    FontPath    "/usr/local/share/fonts"

EndSection

Section "Module"

   Load  "GLcore"

   Load  "xtrap"

   Load  "dri"

   Load  "record"

   Load  "glx"

   Load  "dbe"

   Load  "extmod"

   Load  "type1"

   Load  "freetype"

EndSection

Section "InputDevice"

   Identifier  "Keyboard0"

   Driver      "kbd"

EndSection

Section "InputDevice"

   Identifier  "Mouse0"

   Driver      "mouse"

   Option       "Protocol" "auto"

   Option       "Device" "/dev/input/mice"

   Option       "ZAxisMapping" "4 5 6 7"

EndSection

Section "InputDevice"

       Identifier  "UltraNav TrackPoint"

       Driver      "mouse"

       Option      "Device"            "/dev/input/mouse1"

       Option      "Protocol"            "ExplorerPS/2"

       Option      "Emulate3Buttons"     "on"

       Option      "Emulate3TimeOut"     "50"

       Option      "EmulateWheel"        "on"

       Option      "EmulateWheelTimeOut" "200"

       Option      "EmulateWheelButton"  "2"

       Option      "YAxisMapping"        "4 5"

       Option      "XAxisMapping"        "6 7"

       Option      "ZAxisMapping"        "4 5"

EndSection

Section "Monitor"

   #DisplaySize     330   210   # mm

   Identifier   "Monitor0"

   VendorName   "IBM"

   ModelName    "2887"

EndSection

Section "Device"

        ### Available Driver options are:-

        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",

        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz"

        ### [arg]: arg optional

        #Option     "NoAccel"               # [<bool>]

        #Option     "SWcursor"              # [<bool>]

        #Option     "ColorKey"              # <i>

        #Option     "CacheLines"            # <i>

        #Option     "Dac6Bit"               # [<bool>]

        #Option     "DRI"                   # [<bool>]

        #Option     "NoDDC"                 # [<bool>]

        #Option     "ShowCache"             # [<bool>]

        #Option     "XvMCSurfaces"          # <i>

        #Option     "PageFlip"              # [<bool>]

   Identifier  "Card0"   

   Driver      "intel"

   VendorName  "Intel Corporation"

   BoardName   "Mobile Integrated Graphics Controller"

   BusID       "PCI:0:2:0"

   Option       "DRI"   "true"

        Option       "XAANoOffscreenPixmaps" "true"

EndSection

Section "Screen"

   Identifier "Screen0"

   Device     "Card0"

   Monitor    "Monitor0"

   SubSection "Display"

      Viewport   0 0

      Depth     1

   EndSubSection

   SubSection "Display"

      Viewport   0 0

      Depth     4

   EndSubSection

   SubSection "Display"

      Viewport   0 0

      Depth     8

   EndSubSection

   SubSection "Display"

      Viewport   0 0

      Depth     15

   EndSubSection

   SubSection "Display"

      Viewport   0 0

      Depth     16

   EndSubSection

   SubSection "Display"

      Viewport   0 0

      Depth     24

   EndSubSection

EndSection

Section "DRI"

   Group   "video"

   Mode   0660

EndSection

Section "Extensions"

   Option "Composite" "Enable"

EndSection
```

----------

## nonhuman

Well, I'm posting this from Firefox on my new Thinkpad, so apparently things are going pretty well so far. I've got stuff compiling in the background, so I figured now would be a good time to get started on setting up wireless. After doing my reading, I've got a fairly simple question: is this wireless card unsupported by wpa_supplicant? That certainly appears to be the case. Am I going to have to use wireless-tools for this? All my wireless networks are use WPA, so that would definitely be a bit of a pain...

----------

## nukem996

I have it working with wpa_supplicant, make sure you pass -Dwext to it.

----------

## nonhuman

Hmm, well now I'm getting errors that /bin/mktemp isn't there when I try to start net.wlan0... And as far as I can tell I've got the most current coreutils, so I'm not sure what's going on. And I can't emerge --sync because it keeps timing out. Ugh.  :Sad: 

----------

## termite

Can you use a wired connection?

mktemp is provided by coreutils 6.10-r2 and later, I think.

----------

## nonhuman

Nope, apparently running /etc/init.d/net.eth0 start also requires mktemp... I guess I'll just have to boot off a livecd and get the distfiles that way. :/

----------

## nonhuman

Ok, I manged to fix that problem thanks to some help from IRC, so now I'm back to configuring the wireless.

Current, if I run /etc/init.d/net.wlan0 start, I get this:

```
* Starting wlan0

SIOCSIFFLAGS: No such device

SIOCSIFFLAGS: No such device

 *   Wireless radio has been killed for interface wlan0

 *   wpa_supplicant will launch, but not associate until

 *   wireles radio is re-enabled for interface wlan0

 *   Starting wpa_supplicant on wlan0 ...

SIOCSIFFLAGS: No such device

SIOCSIFFLAGS: No such device

Could not set interface 'wlan0' UP

ioctl[SIOCSIWAUTH]: Operation not supported                                                                    [ ok ]th param 4 value 0x0 -

 *   Starting wpa_cli on wlan0 ...                                                                      [ ok ]

 *     Backgrounding ...

```

I'm guessing that the 'No such device' error means that I'm using the wrong drivers. So what should my /etc/conf.d/net look like? And do I need anything special in my /etc/wpa_supplicant/wpa_supplicant.conf?

----------

## termite

I don't use WPA, so not sure about that.  As for the No such device error, try removing the iwl4965 and mac80211 modules (maybe the iwlcore module as well, if you have it), then modprobing iwl4965.  Then type iwconfig, dmesg, etc and see what's going on.  Honestly, I'd try to do it without wpa first (turn it off on your router), get that working, then add the wpa in.

----------

## nonhuman

What does your /etc/conf.d/net look like?

----------

## termite

Empty.  I use dhcp and no wpa.

----------

## nonhuman

So you just what? Modprobe the driver and dhcpcd /dev/wlan0? Seems like it would be easier to just put config_wlan0=( "dhcp" ).

----------

## nonhuman

Sweet! Finally got it working! With WPA and all!

Thanks for all your help guys.  :Smile: 

----------

## Evincar

 *nonhuman wrote:*   

> Sweet! Finally got it working! With WPA and all!
> 
> Thanks for all your help guys. 

 

Glad you got it working! Add [solved] to the title please  :Smile: .

----------

## termite

I modprobe the driver and it automatically does the dhcp thing  :Smile: 

What did you do to solve it?

----------

## nonhuman

This is extremely embarassing, but: I flipped the little WiFi switch on the front of the laptop...   :Laughing: 

----------

## termite

lol!  I've done that quite a number of times...

----------

## nonhuman

I can't believe I missed that... Just not used to there being such a simple answer, I guess.

Well, at least now I can move on to the next challenges: hibernate and ALSA (so far no luck, sadly  :Sad: )!

----------

## termite

My suspend works (and did np with no configuration, I think).  I don't use hibernate.  ALSA also worked out of the box, I think.

----------

## nonhuman

Well, after shutting it down last night (since I don't have hibernate/suspend working yet) and restarting this morning ALSA is now working perfectly. The only issue was that it was getting a bunch of feedback from somewhere, especially when I put my hand up against the two USB ports by the optical drive. A little experiementing showed that simply muting the 'Internal' channel in Alsamixer fixed that, so now I've got working sound.  :Smile: 

[Edit: scratch that, suspend is working now too. Weird.  :Smile: ]

----------

