# iwlwifi wireless

## c0vert

Hey, I've tried installing the 3945 intel wireless package a few times and can never get it working.  So Now I'm trying the new iwlwifi drivers to see if I can get anywhere with that, since I read it is easier to install.

The following is what I am following:

http://intellinuxwireless.org/?p=iwlwifi&n=howto-iwlwifi

And it says modprobe mac80211 needs to not give an error.  But mine does, which I thoght was weird because I already put it in my kernel as *.  

```

laptop linux # cat .config | grep 80211

CONFIG_CFG80211=y

CONFIG_MAC80211=y

CONFIG_MAC80211_DEBUG=y

CONFIG_MAC80211_VERBOSE_DEBUG=y

CONFIG_MACt th80211_LOWTX_FRAME_DUMP=y

CONFIG_MAC80211_DEBUG_COUNTERS=y

CONFIG_MAC80211_IBSS_DEBUG=y

CONFIG_MAC80211_VERBOSE_PS_DEBUG=y

CONFIG_IEEE80211=y

# CONFIG_IEEE80211_DEBUG is not set

CONFIG_IEEE80211_CRYPT_WEP=y

CONFIG_IEEE80211_CRYPT_CCMP=y

CONFIG_IEEE80211_CRYPT_TKIP=y

CONFIG_EE80211_SOFTMAC=y

# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set

# CONFIG_WLAN_PRE80211 is not set

CONFIG_WLAN_80211=y

```

But anyways, on with the modprobe installation... its on this page:  http://intellinuxwireless.org/?p=mac80211&n=howto-mac80211

And I get stuck at the '%make' step.

Here is my output:

```

laptop mac80211-10.0.2 # make

Building modified version in 'modified/' directory:

Copying modified/ from origin/...done

Applying patches and scripts from pending/.

 + Applying: pending/0001-mac80211-Add-basic-IEEE-802.11n-support.patch

        From 26e77a5fef845edcb5c27db52f413e7558db0e20 Mon Sep 17 00:00:00 2001

 + Applying: pending/0002-mac80211-add-IEEE802.11e-WMM-structures.patch

        From f5af9c4fdfbcc2b8ecb60d9d93657a3e2437c909 Mon Sep 17 00:00:00 2001

 + Applying: pending/0003-mac80211-IEEE802.11e-WMM-TS-management-and-DLS-supp.pa                                  tch

        From 78e5e6d438cb6ec7ba929293b112b12cf0d9042c Mon Sep 17 00:00:00 2001

 + Applying: pending/0004-mac80211-debugfs-support-for-TSM-and-DLS.patch

        From 88b531cc1ce8bd1f9681a4cbcd11bb61de3c6ca1 Mon Sep 17 00:00:00 2001

 + Applying: pending/0005-mac80211-IEEE802.11e-WMM-misc-fix-and-cleanup.patch

        From 503a88f99457be47979874f2a9a5c3454104519e Mon Sep 17 00:00:00 2001

 + Applying: pending/0006-mac80211-add-WE-nick-power-and-txpower-capabilitie.pat                                  ch

        From 37515341129948f6f8391cd0c8bb0028f7929c98 Mon Sep 17 00:00:00 2001

 + Applying: pending/0007-mac80211-Fix-user-specified-TXPOWER-from-being-over.pa                                  tch

        From aa958786201069f0a857251a777f687fc9d42219 Mon Sep 17 00:00:00 2001

 + Applying: pending/0008-mac80211-HT-IEEE_802.11n_TX_AMPDU-send-actframes.patch

        From 70fb3487d26d431401e4b659e520177eb434e343 Mon Sep 17 00:00:00 2001

 + Applying: pending/0009-mac80211-HT-add-IEEE-802.11n-TX_AMPDU-API.patch

        From fc5dcdadd03063981268f4df8ef7ffd9519e25f9 Mon Sep 17 00:00:00 2001

 + Applying: pending/0010-mac80211-HT-add-TX-AMPDU-MLME-data.patch

        From 51bc2c9e296a5f6ec210eee04c882fdb4997c130 Mon Sep 17 00:00:00 2001

 + Applying: pending/0011-mac80211-HT-IEEE-802.11n-TX-AMPDU-MLME-implementa.patc                                  h

        From a2c09ed2b5cc19d3fdee0b4d3a25ac82c973cd77 Mon Sep 17 00:00:00 2001

 + Applying: pending/0012-mac80211-HT-IEEE-802.11n-debugfs-support.patch

        From 915fb0b275fae6748a38ece9a67a99129fcf3cc8 Mon Sep 17 00:00:00 2001

 + Applying: pending/0013-mac80211-HT-IEEE-802.11n-block-ack-support.patch

        From 0d1fde009eb108f3f379e0868b600c12f7cd943d Mon Sep 17 00:00:00 2001

 + Applying: pending/0014-mac80211-HT-IEEE-802.11n-block-ack-debugfs-suppor.patc                                  h

        From 18fcded749fc76222844afc055128da88dbc03d8 Mon Sep 17 00:00:00 2001

 + Applying: pending/0015-mac80211-HT-add-IEEE-802.11n-qos-queues.patch

        From 1fa8243b4711e74d3158e396f3f3971ed103d482 Mon Sep 17 00:00:00 2001

 + Applying: pending/0016-mac80211-HT-IEEE-802.11n-RX-aggregation-BAR-supor.patc                                  h

        From e410f6580a9462480cbf3a8f3ecc601e1d8b5fb5 Mon Sep 17 00:00:00 2001

 + Applying: pending/0017-mac80211-HT-IEEE-802.11n-RX-aggregation-API-and-M.patc                                  h

        From 428ee27143824bc868a301bb46d9cc34e76a17b6 Mon Sep 17 00:00:00 2001

 + Applying: pending/0018-mac80211-HT-add-addtional-type-parameter-for-ieee.patc                                  h

        From 454d6bf4ab1a52a73fe9d5c7940588c84e7fbf5b Mon Sep 17 00:00:00 2001

 + Applying: pending/0019-mac80211-HT-fix-ieee80211_send_addba_resp-interfa.patc                                  h

        From 26c1abde043c8186b483fd29715d2a03e864ac4e Mon Sep 17 00:00:00 2001

 + Applying: pending/0020-mac80211-HT-fix-master-mode-net-type.patch

        From 0081fcc92918c45b914158219d255454e0c3bc4a Mon Sep 17 00:00:00 2001

 + Applying: pending/0021-mac80211-HT-IEEE-802.11n-RX-aggregation-MLME-supp.patc                                  h

        From 8f997ba42d5da45841bb8178f5f8978c48ef2c0e Mon Sep 17 00:00:00 2001

 + Applying: pending/0022-mac80211-HT-IEEE-802.11n-RX-aggregation-debugfs-s.patc                                  h

        From 657427a497a5fd912251740ec4ee9c3b3bad0f49 Mon Sep 17 00:00:00 2001

 + Applying: pending/0023-mac80211-HT-AP-mode-block-ack-MLME-support.patch

        From 8aff6ff750cb985bafa982b4b1ffc37029e8f013 Mon Sep 17 00:00:00 2001

 + Applying: pending/0024-mac80211-HT-fix-wrong-param-used-for-ieee80211_ht.patc                                  h

        From 55d47cff2f5944f3f70fbee5f2b41beccbed2762 Mon Sep 17 00:00:00 2001

 + Applying: pending/0025-mac80211-HT-use-KERN_DEBUG-for-HT-debugging-messa.patc                                  h

        From f597c02bc8814aa0ba5b3b9fd1aa14d521b284b8 Mon Sep 17 00:00:00 2001

 + Applying: pending/0026-mac80211-rssi-averaging-filter.patch

        From 4f10cf6269ce9a96d21dd220bf8991716d1be24f Mon Sep 17 00:00:00 2001

 + Applying: pending/0027-mac80211-add-802.11h-channel-switch-packet-handling.pa                                  tch

        From 534b03cd79f6de5cb3c364289cb5fa158bef6632 Mon Sep 17 00:00:00 2001

 + Applying: pending/0028-mac80211-fix-compile-error-if-CONFIG_NET_SCHED-unde.pa                                  tch

        From 16d350730af21442636dc3ab822a8ae230fecffa Mon Sep 17 00:00:00 2001

 + Applying: pending/0029-mac80211-add-rate-scaling-algorithm-selection-capab.pa                                  tch

        From 0f936737d9f8cc3a8886f4590c73b20918df213c Mon Sep 17 00:00:00 2001

 + Applying: pending/0030-mac80211-fix-monitor-mode.patch

        From c334da6f6fe935e278ad5fde78e192d16d3c1603 Mon Sep 17 00:00:00 2001

 + Applying: pending/0031-mac80211-fix-an-printk-warning-for-size_t.patch

        From 465d7fb3ee021c8fe50a49432dfc461a4e4595d9 Mon Sep 17 00:00:00 2001

 + Applying: pending/0032-mac80211-fix-kernel-panic-during-shutdown-time.patch

        From a8f8bdd27fbac5f91aabe206f829592facb486a3 Mon Sep 17 00:00:00 2001

 + Applying: pending/0033-mac80211-fix-a-msdu-header.patch

        

-----patch failure output-----

patching file net/mac80211/ieee80211.c

Hunk #1 FAILED at 2817.

Hunk #2 FAILED at 2838.

Hunk #3 FAILED at 2890.

Hunk #4 FAILED at 2975.

Hunk #5 FAILED at 2990.

Hunk #6 FAILED at 3003.

Hunk #7 FAILED at 3019.

7 out of 7 hunks FAILED -- saving rejects to file net/mac80211/ieee80211.c.rej

pending/0033-mac80211-fix-a-msdu-header.patch failed. Terminating.

If patch or script failed, check pre/ and post/ for current stage.

make: *** [modified] Error 1

```

I know these drivers are unstable, but what I am doing here is simply the modprobe part of it, so I dont see why it shouldnt work.  

Can anyone help?

Thanks a lot in advance

Andrew

----------

## turtles

Change the * (Y) to a M (M) for module.

----------

## c0vert

Thank you!! I got a lot of progress after that.  I got the mac80211 module running, as well as downloaded and installed and started the iwlwifi drivers.  The only problem now is at the end of the  

iwlwifi-HOWTO page.

```

laptop iwlwifi-1.2.22 # ifconfig wlan0 up

wlan0: unknown interface: No such device

```

Running that command does that.  I was always under the impression that my wireless (at least when I attempted it with the ipw3945 drivers, was called eth1.  Perhaps some interface names changed during the iwlwifi driver changed some things?  Beacuse both these do not work either...

eth1

wlan0

wlan1

So I'm not sure what I should be starting up, or what it shold be called, or how to check.  Symlinks or something maybe?

Thanks a lot!! Just one step away from wireless finally  :Very Happy:  (I hope)

Edit:

When running iwconfig.. I get 3 interfaces, third one is called sit0 (never seen it before, but it has no wireless extension.

Here is my dmesg, these are the last few steps before the "ifconfig wlan0 up" command.

```

laptop iwlwifi-1.2.22 # dmesg -c >/dev/null

laptop iwlwifi-1.2.22 # ./load debug=0x43fff

Unloaded: iwl3945 iwl4965 mac80211 

Loaded: iwl3945 iwl4965 

laptop iwlwifi-1.2.22 # dmesg -c

iwl3945: Intel(R) PRO/Wireless 3945ABG/BG Network Connection driver for Linux, 1.2.22ds

iwl3945: Copyright(c) 2003-2007 Intel Corporation

ACPI: PCI Interrupt 0000:02:00.0[A] -> GSI 16 (level, low) -> IRQ 18

PCI: Setting latency timer of device 0000:02:00.0 to 64

iwl3945: U iwl3945_pci_probe pci_resource_len = 0x00001000

iwl3945: U iwl3945_pci_probe pci_resource_base = f883c000

iwl3945: Detected Intel PRO/Wireless 3945ABG Network Connection

iwl3945: U iwl3945_set_rxon_channel Staging channel set to 6 [3]

iwl3945: iwlwifi-3945-1.ucode firmware file req failed: Reason -2

iwl3945: Could not read microcode: -2

ACPI: PCI interrupt for device 0000:02:00.0 disabled

iwl3945: probe of 0000:02:00.0 failed with error -2

iwl4965: Intel(R) Wireless WiFi Link 4965AGN driver for Linux, 1.2.22ds

iwl4965: Copyright(c) 2003-2007 Intel Corporation

laptop iwlwifi-1.2.22 # 

```

Thanks again!

----------

## Dagger

you need to emerge net-wireless/iwl3945-ucode

----------

## c0vert

I downloaded the ucode from here though: http://intellinuxwireless.org/?p=iwlwifi&n=howto-iwlwifi.

I installed it and put it in /lib/firmware like the howto said.

But I'll try to emerge them anyways because I have no other options right now.  But I'm getting the following problem with masking (which is why I got them off the website in the first place)

```

laptop iwlwifi-1.2.22 # emerge net-wireless/iwl3945-ucode

Calculating dependencies -

!!! All ebuilds that could satisfy "net-wireless/iwl3945-ucode" have been masked.

!!! One of the following masked packages is required to complete your request:

- net-wireless/iwl3945-ucode-2.14.4 (masked by: package.mask)

/usr/portage/profiles/package.mask:

# Saleem Abdulrasool <compnerd@gentoo.org> (10 Jul 2007)

# Masking to test

For more information, see MASKED PACKAGES section in the emerge man page or 

refer to the Gentoo Handbook.

```

packages.keyword:

```

=x11-drivers/xf86-video-i810-2.1.1

=sys-kernel/gentoo-sources-2.6.22-r1

x11-libs/cairo X

net-wireless/iwlwifi ~x86

net-wireless/iwl3945-ucode ~x86

```

Any idea?  Did I do it wrong or something?  I also did it with the = prefix and the version number, same error.

----------

## turtles

 *c0vert wrote:*   

> Thank you!! I got a lot of progress after that.  I got the mac80211 module running, as well as downloaded and installed and started the iwlwifi drivers.  The only problem now is at the end of the  
> 
> iwlwifi-HOWTO page.
> 
> ```
> ...

 

That is not the gentoo way of handeling interfaces.

You need a symlink.

```
cd /etc/init.d
```

```
ln -s net.lo net.wlan0
```

```
ln -s net.lo net.sit0
```

then 

```
/etc/init.d/net.wlan0 start
```

or 

```
/etc/init.d/net.sit0 start
```

other commands are status and stop

----------

## c0vert

This is what I get when doing that

```

laptop ~ # cd /etc/init.d

laptop init.d # ln -s net.lo net.wlan0

laptop init.d # ln -s net.lo net.sit0

laptop init.d # /etc/init.d/net.wlan0 start

 * Caching service dependencies ...                                       [ ok ]

 * Starting wlan0

 *   Configuration not set for wlan0 - assuming DHCP

 *   Bringing up wlan0

 *     dhcp

 *       network interface wlan0 does not exist

 *       Please verify hardware or kernel module (driver)                 [ !! ]

laptop init.d # /etc/init.d/net.sit0 start

 * Starting sit0

 *   Configuration not set for sit0 - assuming DHCP

 *   Bringing up sit0

 *     dhcp

 *       Running dhcpcd ...

Error, sit0: interface is not Ethernet, FireWire, InfiniBand or Token Ri  [ !! ]

laptop init.d # 

```

----------

## Dagger

are you going to use WEP or WPA?

if you're having hard time with manual setup of your network interfaces, you might want to try  this  as an alternative.

----------

## tarpman

c0vert,

iwlwifi is in Portage already - you shouldn't be installing it by hand.  It's still beta software, though, so it's hard masked, as well as keyworded unstable.  You can unmask it like this:

```
echo "net-wireless/iwlwifi" >> /etc/portage/package.unmask

echo "net-wireless/iwl3945-ucode" >> /etc/portage/package.unmask

echo "net-wireless/iwlwifi" >> /etc/portage/package.keywords

echo "net-wireless/iwl3945-ucode" >> /etc/portage/package.keywords
```

and then configure it for your 3945 device and install it:

```
echo "net-wireless/iwlwifi ipw3945" >> /etc/portage/package.use

emerge --ask --verbose net-wireless/iwlwifi
```

You may find that udev creates your wireless interface with a strange name, such as wlan0_rename - if this happens, simply rm /etc/udev/rules.d/70-persistent-net.rules and reboot.

To start the interface, you will need a symlink /etc/init.d/net.wlan0 pointing to net.lo, which it seems you've already created.  You can remove the net.sit0 symlink you made - that device name is not used by Intel devices.

You also don't need to patch your kernel, since all recent Gentoo kernels include the necessary support.  If you have patched your kernel sources, you should back up your configuration and reinstall a clean copy:

```
cp /usr/src/linux/.config ~/

rm -rf /usr/src/linux/

USE="symlink" emerge --ask --verbose sys-kernel/gentoo-sources

mv ~/.config /usr/src/linux/

cd /usr/src/linux

make oldconfig
```

and then rebuild your kernel and modules as usual.  It doesn't matter whether you build mac80211 into your kernel or as a module (mine is built-in and working fine).

----------

## c0vert

That makes sense now, I thought was a weird way to do it to download it from a website.  But I still get the following error when trying to emerge

```

laptop iwlwifi-1.2.22 # emerge --ask --verbose net-wireless/iwlwifi

These are the packages that would be merged, in order:

Calculating dependencies \

!!! All ebuilds that could satisfy "net-wireless/iwl3945-ucode" have been masked.

!!! One of the following masked packages is required to complete your request:

- net-wireless/iwl3945-ucode-2.14.4 (masked by: package.mask)

/usr/portage/profiles/package.mask:

# Saleem Abdulrasool <compnerd@gentoo.org> (10 Jul 2007)

# Masking to test

For more information, see MASKED PACKAGES section in the emerge man page or 

refer to the Gentoo Handbook.

(dependency required by "net-wireless/iwlwifi-1.0.0_p1" [ebuild])

```

package.keywords

```

=x11-drivers/xf86-video-i810-2.1.1

=sys-kernel/gentoo-sources-2.6.22-r1

x11-libs/cairo X

net-wireless/iwlwifi ~x86

net-wireless/iwl3945-ucode ~x86

net-wireless/iwlwifi-ucode

net-wireless/iwlwifi

```

package.unmask

```

net-wireless/iwlwifi

net-wireless/iwlwifi-ucode

```

package.use

```

net-wireless/iwlwifi ipw3945

```

Did I mess up in adding those to the files?

Thanks for your explanation.  I really would like this wireless going soon! Thanks a lot!

----------

## tarpman

 *c0vert wrote:*   

> Did I mess up in adding those to the files?

 

Yes, you did.

 *tarpman wrote:*   

> 
> 
> ```
> echo "net-wireless/iwl3945-ucode" >> /etc/portage/package.unmask
> 
> ...

 

 *c0vert wrote:*   

> package.unmask
> 
> ```
> net-wireless/iwlwifi
> 
> ...

 

Also, I noticed that you have a strange line:

```
x11-libs/cairo X
```

That is a USE flag line, so it should be in /etc/portage/package.use if you do in fact need it.  More likely, the correct thing to do would be to check that you have the correct profile selected:

```
eselect profile show
```

For a desktop or laptop system, the result should be a 'desktop' profile:

```
[03:59 PM] ~ # eselect profile show

Current make.profile symlink:

  /usr/portage/profiles/default-linux/x86/2007.0
```

Find the line for default-linux/x86/2007.0/desktop in the output of eselect profile list and use its number to change your profile:

```
[03:59 PM] ~ # eselect profile list

Available profile symlink targets:

  [1]   default-linux/x86/2006.1

  [2]   default-linux/x86/no-nptl

  [3]   default-linux/x86/no-nptl/2.4

  [4]   default-linux/x86/2006.1/desktop

  [5]   default-linux/x86/2007.0 *

  [6]   default-linux/x86/2007.0/desktop

  [7]   hardened/x86/2.6

  [8]   selinux/2007.0/x86

  [9]   selinux/2007.0/x86/hardened

[04:00 PM] ~ # eselect profile set 6

[04:00 PM] ~ # eselect profile show

Current make.profile symlink:

  /usr/portage/profiles/default-linux/x86/2007.0/desktop 

                            

[04:00 PM] ~ #
```

The desktop profile has common USE flags such as X selected automatically.

----------

## c0vert

nice! I think it is almost working...

my eselect profile show shows exactly what yours does

```

laptop ~ # eselect profile show

Current make.profile symlink:

  /usr/portage/profiles/default-linux/x86/2007.0 

```

So should I just delete the cairo X line from keywords?

But anyways more importantly.  I rebooted my computer after removing the weirdly named link.  (as you said above).

And when I got back in, I had this as iwconfig:

```

laptop ~ # iwconfig

eth0      no wireless extensions.

lo        no wireless extensions.

sit0      no wireless extensions.

wmaster0  no wireless extensions.

wlan0     IEEE 802.11g  ESSID:"macraig"  

          Mode:Managed  Frequency:2.412 GHz  Access Point: 00:1B:5B:86:24:E9   

          Bit Rate=54 Mb/s   

          Retry min limit:7   RTS thr:off   Fragment thr=2346 B   

          Encryption key:off

          Link Quality=81/100  Signal level=-31 dBm  Noise level=-67 dBm

          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0

          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

```

And this as ifconfig:

```

laptop ~ # ifconfig

eth0      Link encap:Ethernet  HWaddr 00:16:36:2C:EE:1D  

          inet addr:192.168.2.13  Bcast:192.168.2.255  Mask:255.255.255.0

          inet6 addr: fe80::216:36ff:fe2c:ee1d/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:492 errors:0 dropped:0 overruns:0 frame:0

          TX packets:292 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:226960 (221.6 Kb)  TX bytes:66652 (65.0 Kb)

lo        Link encap:Local Loopback  

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:129 errors:0 dropped:0 overruns:0 frame:0

          TX packets:129 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:12666 (12.3 Kb)  TX bytes:12666 (12.3 Kb)

wlan0     Link encap:Ethernet  HWaddr 00:13:02:16:A6:1B  

          inet addr:192.168.2.12  Bcast:192.168.2.255  Mask:255.255.255.0

          inet6 addr: fe80::213:2ff:fe16:a61b/64 Scope:Link

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:12 errors:0 dropped:0 overruns:0 frame:0

          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:1906 (1.8 Kb)  TX bytes:1413 (1.3 Kb)

wmaster0  Link encap:UNSPEC  HWaddr 00-13-02-16-A6-1B-CB-6B-00-00-00-00-00-00-00-00  

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

```

Now, I'm not sure what that wmaster0 thing is, but I'm not really complaining, it seems like the driver is working, picking up my essid automatically? (Mine is "macraig").  And giving me an ip address.  

So I unplugged my wired, hoping I would be connected, but I am not, until I plug the wire back in.

I'm not exactly how it works with wireless internet but it seemed to me like I was connected wirelessly and wired, but I guess not.  How can I connect wired?  I tried running dhcpcd on wlan0 but it said it already have an IP (obviously).  

And on the side, I'm not sure if I patched my kernel like you said above, all I did was enable mac80211 and run make and make install and that kind of stuff.  And it is semi-working now, so can I just keep my kernel how it is right now?

Thanks so much for everything!! THis is closest I've ever been to wireless!

----------

## tarpman

 *c0vert wrote:*   

> nice! I think it is almost working...
> 
> my eselect profile show shows exactly what yours does
> 
> ```
> ...

 

That means you are not on a desktop profile.  You should follow my steps after that to change your profile to a desktop one.  You should also update your system with emerge --ask --verbose --update --deep --newuse world so that any USE flag changes will take effect.

 *c0vert wrote:*   

> So should I just delete the cairo X line from keywords?

 

Yes.

 *c0vert wrote:*   

> Now, I'm not sure what that wmaster0 thing is

 

Neither am I.  Apparently madwifi drivers expose a similar device which can be used to create multiple virtual wlan devices on a single physical card, but I don't know whether that will ever be possible on the ipw ones.

 *c0vert wrote:*   

> but I'm not really complaining, it seems like the driver is working, picking up my essid automatically? (Mine is "macraig").  And giving me an ip address.

 

Looks like it.  :Smile: 

 *c0vert wrote:*   

> So I unplugged my wired, hoping I would be connected, but I am not, until I plug the wire back in.
> 
> I'm not exactly how it works with wireless internet but it seemed to me like I was connected wirelessly and wired, but I guess not.  How can I connect wired?  I tried running dhcpcd on wlan0 but it said it already have an IP (obviously).

 

You can have both wired and wireless interfaces connected at once; Gentoo automatically assigns a higher priority to the wired interface, so if both are available the wired one will be preferred.  You can see this in the output of /sbin/route -n - eth0 has a higher metric than wlan0.  As for your problem - my guess is that the system didn't realise the cable had been unplugged.  You can test this by running /etc/init.d/net.eth0 stop - this will shut down the wired device (regardless of whether or not the cable is plugged in) and your networking should continue to work over wireless.  If you want that to happen automatically, you can install either sys-apps/ifplugd or sys-apps/netplug, which take care of automatically starting and stopping wired devices based on whether they are plugged in.  No configuration is necessary for either beyond installing them; the networking scripts take care of it for you.

 *c0vert wrote:*   

> And on the side, I'm not sure if I patched my kernel like you said above, all I did was enable mac80211 and run make and make install and that kind of stuff.  And it is semi-working now, so can I just keep my kernel how it is right now?

 

 *c0vert wrote:*   

> 
> 
> ```
> 
> laptop mac80211-10.0.2 # make
> ...

 

That output from your first post would seem to imply that you were using a mac80211 module from external (non-kernel) sources.  If you have mac80211 built into your kernel (i.e., not as a module) then everything is fine.  Either way it's probably safe to continue as you are - everything will be resolved next time you upgrade your kernel.

 *c0vert wrote:*   

> Thanks so much for everything!! THis is closest I've ever been to wireless!

 

Glad I could help.

----------

## c0vert

Fixed all the other stuff. Thanks again  :Smile: 

 *Quote:*   

> 
> 
> You can have both wired and wireless interfaces connected at once; Gentoo automatically assigns a higher priority to the wired interface, so if both are available the wired one will be preferred. You can see this in the output of /sbin/route -n - eth0 has a higher metric than wlan0. As for your problem - my guess is that the system didn't realise the cable had been unplugged. You can test this by running /etc/init.d/net.eth0 stop - this will shut down the wired device (regardless of whether or not the cable is plugged in) and your networking should continue to work over wireless. If you want that to happen automatically, you can install either sys-apps/ifplugd or sys-apps/netplug, which take care of automatically starting and stopping wired devices based on whether they are plugged in. No configuration is necessary for either beyond installing them; the networking scripts take care of it for you. 
> 
> 

 

I still can't seem to connect to wireless.  I ran /etc/init.d/net.eth0 stop , which did shut down my wired internet.  And my networking did not continue.  I can not get internet access and I also cannot ping other computers on my network :S.

Is there something else that could be causing this?

----------

## tarpman

 *c0vert wrote:*   

> Is there something else that could be causing this?

 

Hmm, not sure.  With net.eth0 stopped and net.wlan0 started, please post the output of:

```
ifconfig -a

iwconfig

route -n

lsmod

grep 80211 /usr/src/linux/.config

cat /etc/resolv.conf

cat /etc/conf.d/net
```

----------

## c0vert

Its weird that my /etc/resolv.conf is that.  I thought I set it to 4.2.2.1 the other day or something like that because DNS was resolving flow... or does /etc/resolv.conf for my eth0 started look different than when wlan0 is on?

Anyways heres the commands:

ifconfig -a

```

laptop ~ # ifconfig -a

eth0      Link encap:Ethernet  HWaddr 00:16:36:2C:EE:1D  

          BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:15713 errors:0 dropped:0 overruns:0 frame:0

          TX packets:7943 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:17255894 (16.4 Mb)  TX bytes:619580 (605.0 Kb)

lo        Link encap:Local Loopback  

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:191 errors:0 dropped:0 overruns:0 frame:0

          TX packets:191 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:18689 (18.2 Kb)  TX bytes:18689 (18.2 Kb)

sit0      Link encap:IPv6-in-IPv4  

          NOARP  MTU:1480  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

wlan0     Link encap:Ethernet  HWaddr 00:13:02:16:A6:1B  

          inet addr:192.168.2.12  Bcast:192.168.2.255  Mask:255.255.255.0

          inet6 addr: fe80::213:2ff:fe16:a61b/64 Scope:Link

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:12 errors:0 dropped:0 overruns:0 frame:0

          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:1906 (1.8 Kb)  TX bytes:1413 (1.3 Kb)

wmaster0  Link encap:UNSPEC  HWaddr 00-13-02-16-A6-1B-CB-4B-00-00-00-00-00-00-00        -00  

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

```

iwconfig

```

laptop ~ # iwconfig

eth0      no wireless extensions.

lo        no wireless extensions.

sit0      no wireless extensions.

wmaster0  no wireless extensions.

wlan0     IEEE 802.11g  ESSID:"macraig"  

          Mode:Managed  Frequency:2.412 GHz  Access Point: 00:1B:5B:86:24:E9   

          Bit Rate=54 Mb/s   

          Retry min limit:7   RTS thr:off   Fragment thr=2346 B   

          Encryption key:off

          Link Quality=78/100  Signal level=-39 dBm  Noise level=-67 dBm

          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0

          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

```

route -n

```

laptop ~ # route -n

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

192.168.2.0     0.0.0.0         255.255.255.0   U     2000   0        0 wlan0

127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo

0.0.0.0         192.168.2.1     0.0.0.0         UG    2000   0        0 wlan0

```

lsmod

```

laptop ~ # lsmod

Module                  Size  Used by

ipw3945               188196  0 

iwl3945               147300  0 

mac80211              117384  1 iwl3945

```

grep 

```

laptop ~ # grep 80211 /usr/src/linux/.config

CONFIG_CFG80211=y

CONFIG_MAC80211=m

CONFIG_MAC80211_DEBUG=y

CONFIG_MAC80211_VERBOSE_DEBUG=y

CONFIG_MAC80211_LOWTX_FRAME_DUMP=y

CONFIG_MAC80211_DEBUG_COUNTERS=y

CONFIG_MAC80211_IBSS_DEBUG=y

CONFIG_MAC80211_VERBOSE_PS_DEBUG=y

CONFIG_IEEE80211=y

# CONFIG_IEEE80211_DEBUG is not set

CONFIG_IEEE80211_CRYPT_WEP=y

CONFIG_IEEE80211_CRYPT_CCMP=y

CONFIG_IEEE80211_CRYPT_TKIP=y

CONFIG_IEEE80211_SOFTMAC=y

# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set

# CONFIG_WLAN_PRE80211 is not set

CONFIG_WLAN_80211=y

```

cat /etc/resolv.conf

```

laptop ~ # cat /etc/resolv.conf

# Generated by dhcpcd for interface wlan0

search gateway.2wire.net

nameserver 192.168.2.1

```

cat /etc/conf.d/net

```

laptop ~ # cat /etc/conf.d/net

# This blank configuration will automatically use DHCP for any net.*

# scripts in /etc/init.d.  To create a more complete configuration,

# please review /etc/conf.d/net.example and save your configuration

# in /etc/conf.d/net (this file :]!).

config_eth0=( "dhcp" )

dhcp_eth0="nodns nontp nonis"

config_eth2=(" dhcp" )

preferred_aps=("macraig")

```

Hope this helps  :Smile: 

----------

## tarpman

I'm not sure what's up - things look like they should be OK.  Can you ping things by IP - for example your router at 192.168.2.1?  Also, I would suggest uninstalling net-wireless/ipw3945 and removing the module from /lib/modules/`uname -r`/ - it shouldn't be affecting anything, but it would be nice to be certain.  Another thing you could try is building mac80211 right into your kernel, instead of as a module.  You also probably don't need those debug options.

Another unrelated suggestion - unless you know you're using it it would probably be safe to remove CONFIG_IPV6_SIT from your kernel - it's the source of that extraneous sit0 device you keep seeing.

----------

## c0vert

No I can't ping my router.

I ran emerge -C net-wireless/ipw3945

Then

```

laptop ~ # cd /lib/modules/2.6.22-gentoo-r1/

laptop 2.6.22-gentoo-r1 # ls

build          modules.ccwmap       modules.inputmap   modules.pcimap    modules.usbmap

kernel         modules.dep          modules.isapnpmap  modules.seriomap  net

modules.alias  modules.ieee1394map  modules.ofmap      modules.symbols   
```

I dont see the ipw3945 thing that I should remove, so I guess perhaps the uninstall did it or something?

I added the mac80211to the kernel instead of a module.  Same result as before.

And as for the CONFIG_IPv6_SIT.  I don't know where to find it in make menuconfig.[/code]

Edit: I noticed this, I wonder if it is relavent.

```

laptop linux # /etc/init.d/net.eth0 stop 

 * Stopping eth0

 *   Bringing down eth0

 *     Stopping dhcpcd on eth0 ...                                                [ ok ]

 *     Shutting down eth0 ...                                                     [ ok ]

laptop linux # /etc/init.d/net.wlan0 stop

 * Unmounting network filesystems ...                                             [ ok ]

 * Stopping wlan0

 *   Bringing down wlan0

 *     Stopping dhcpcd on wlan0 ...                                               [ ok ]

 *     Shutting down wlan0 ...                                                    [ ok ]

laptop linux # /etc/init.d/net.wlan0 start

 * Starting wlan0

 *   Configuring wireless network for wlan0

 *   WEP key is not set for "electrical" - not connecting

 *   Couldn't associate with any access points on wlan0

 *   Failed to configure wireless for wlan0                                       [ !! ]

laptop linux # iwconfig

eth0      no wireless extensions.

lo        no wireless extensions.

sit0      no wireless extensions.

wmaster0  no wireless extensions.

wlan0     IEEE 802.11g  ESSID:"macraig"  

          Mode:Managed  Frequency:2.412 GHz  Access Point: 00:1B:5B:86:24:E9   

          Bit Rate=54 Mb/s   

          Retry min limit:7   RTS thr:off   Fragment thr=2346 B   

          Encryption key:off

          Link Quality=80/100  Signal level=-34 dBm  Noise level=-67 dBm

          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0

          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

```

It appears as though wlan0 is not on when it has the above iwconfig output.  So it just seems like it is on, but it really isnt.  And when I do try to start it, it want to connect to "electrical" which my neighbours internet.  So even though it says "macraig", it is apparently not started and won't start.  Maybe this shines new light on the situation?

----------

## tarpman

 *c0vert wrote:*   

> No I can't ping my router.

 

Damn, so much for the easy solution.

 *c0vert wrote:*   

> 
> 
> ```
> 
> laptop ~ # cd /lib/modules/2.6.22-gentoo-r1/
> ...

 

No, Portage will never remove installed kernel modules.  It will be somewhere under the net directory that you see there - I'm not exactly sure where, sorry.  The exact filename will be ipw3945.ko.

 *c0vert wrote:*   

> And as for the CONFIG_IPv6_SIT.  I don't know where to find it in make menuconfig.[/code]

 

Menuconfig has a search feature, that you can access by pressing /.

```
Symbol: IPV6_SIT [=n]

Prompt: IPv6: IPv6-in-IPv4 tunnel (SIT driver)

  Defined at net/ipv6/Kconfig:166

  Depends on: NET && INET && IPV6

  Location:

    -> Networking

      -> Networking support (NET [=y])

        -> Networking options

          -> TCP/IP networking (INET [=y])

  Selects: INET_TUNNEL 
```

In fact, if you aren't actively using it, you can probably safely disable the entire ipv6 subsystem (Networking -> Networking options -> The IPv6 Protocol).  Again, I doubt it's causing problems, but it's always nice to prune out stuff you aren't using, right?  :Smile: 

 *c0vert wrote:*   

> I added the mac80211to the kernel instead of a module.  Same result as before.

 

Just to be certain - you did install the new kernel to /boot and reboot, right?  Not doubting you, but it is often the little things that escape us.  Other than that, I have to admit I'm kind of at a loss.  What is the exact error message you get when you try to ping your router?  Can you ping the actual address of wlan0?  What is the output of /etc/init.d/net.wlan0 --verbose restart?

----------

## c0vert

I think I edited my last message after you replied to it.  But I think having the mac80211 may have stopped it from working?  I dunno, but I noticed that in my last edit, I have no IP address, and I rebooted my computer, and it says fails to connect to electrical and all that when booting up, where as before I actually had an IP address.  Not 100% sure though.  

Yes I changed my kernel and rebooted, specifical I changed the top line to the second line

```

#kernel /boot/linux-2.6.22-gentoo-r1 root=/dev/hda4 udev

kernel /boot/vmlinuz-2.6.22-gentoo-r1 root=/dev/hda4 udev

```

```

laptop ~ # /etc/init.d/net.wlan0

Usage: net.lo [ flags ] < options >

Normal Options:

    start stop restart pause zap

      Default init.d options.

Flags:

    --quiet

      Suppress output to stdout, except if:

      1) It is a warning, then output to stdout

      2) It is an error, then output to stderr

    --verbose   Output extra information

    --debug     Output debug information

    --nocolor   Suppress the use of colors

Configuration files:

    /etc/conf.d/net.lo    /etc/rc.conf

For more info, please run '/etc/init.d/net.wlan0 help'.

```

But Yeah, what do you think it causing me not to even get an IP address now?  Do you think it is the mac80211 not as a module?  I know it doesn't make sense, but I dunno :S

----------

## tarpman

Interesting.  I thought the preferred_aps line in /etc/conf.d/net would have made it try yours first.  Try adding a line:

```
blacklisted_aps="electrical"
```

which should prevent it from trying to connect to that one.

It does make sense that you don't have an IP - when the service starts up it isn't connecting to a valid AP, so dhcpcd won't be run, or won't be run correctly.  Later on it does find and connect to yours, but by then it's too late.

----------

## c0vert

It makes no sense:

```

laptop ~ # cat /etc/conf.d/net

# This blank configuration will automatically use DHCP for any net.*

# scripts in /etc/init.d.  To create a more complete configuration,

# please review /etc/conf.d/net.example and save your configuration

# in /etc/conf.d/net (this file :]!).

config_eth0=( "dhcp" )

dhcp_eth0="nodns nontp nonis"

config_eth2=(" dhcp" )

preferred_aps=("macraig")

blacklisted_aps="electrical"

laptop ~ # ifconfig wlan0 up

laptop ~ # iwconfig wlan0 essid macraig

laptop ~ # dhcpcd wlan0

Error, wlan0: timed out

laptop ~ # /etc/init.d/net.wlan0 start

 * Starting wlan0

 *   Configuring wireless network for wlan0

 *   WEP key is not set for "electrical" - not connecting

 *   Couldn't associate with any access points on wlan0

 *   Failed to configure wireless for wlan0        

```

It is sitll trying to connect to electrical....

I think I have to get off for today and have no access to computer tomorrow.  Hopefully you will still be around on wednessday!

Thanks for everything so far though.

----------

## c0vert

Well... I'm at the library all day today so I thought I wouldn't have access to internet on my linux.  But when I got here and tried to connect to the wireless.  IT WORKED.  I'm not sure why it doesn't work at my house.  

It didn't work on start up though, I had to do:

```

ifconfig wlan0 up

iwlist wlan0 scan

iwconfig wlan0 essid uw-wireless

dhcpcd wlan0

```

What is the difference between /etc/init.d/net.wlan0 start  and ifconfig wlan0 up... Because I never even ran net.wlan0 start

I actually just ran /etc/init.d/net.wlan0 start now, and it hung on "configuring wlan0", and then my internet stopped working until I exited that console window.

So do you know what that is about?

thanks so much  :Very Happy: 

----------

## tarpman

Hmm... that is interesting.  That means there is some difference between the library wireless and that at your house - those commands are more or less exactly what get run by the net.wlan0 script.  Do you know how your wireless at home is configured?  Is SSID hiding or anything like that enabled?

If you can't figure out what the difference is, I'd suggest you install net-wireless/wpa_supplicant.  It allows (IMO) a little more control over what you associate with than the wireless-tools do.  Its command line interface, wpa_cli(8), also allows you to easily see things like SSID names and the security they have enabled.  If you do decide to give wpa_supplicant a try let me know and I'll show you how to set it up.

----------

## knutselaar

tarpman, I regged just to say thank you!

Been poking my wireless nic for a few days no with no real result (had ipw3945 connect once but somehow never after that) and this is working flawlessly, you should write a how-to   :Wink: 

One question tho, if I run iwconfig I got eth1 as my wlan0 and wmaster0 like mentioned, what is wmaster for  :Question: 

----------

