# DLink G650 H/W B2 (How do i install this)

## Teklmanx

hi ppl.

              I just recently got this Dlink G650 H/W: B2 card and i was wondering if anyone got it to work? it's 802.11g and i heard this standard was yet to be supported in linux until like 3hours ago. Now i see places where poeple say they've gotten H/W : A1/B1 to work. Now B2...has anyone gotten this to work? I'd highly appreciate any help. i REALLY wanna get this card working. 

*Detailed info on installation please...i'm a sorta still a n00b

Thanks in advance  :Wink: 

----------

## paranode

Ok, I finally got this bad boy working with the madwifi drivers.  Here's the scoop.

First, build your kernel with the right options.

In General Setup (menuconfig), you need this:

```
[*] Support for hot-pluggable devices
```

Then go to the PCMCIA/CardBus support menu, and select:

```
<M> PCMCIA/CardBus support

            [*]   CardBus support (NEW)

            [ ]   Databook TCIC host bridge support (NEW)

            [ ]   i82092 compatible bridge support (NEW)

            [ ]   i82365 compatible bridge support (NEW)
```

I had these options selected under PCI hotplug support:

```
<*> Support for PCI Hotplug (EXPERIMENTAL)

        <*>   Compaq PCI Hotplug driver

        [ ]     Save configuration into NVRAM on Compaq servers

        <*>   ACPI PCI Hotplug driver
```

I have a Compaq though, these things may not be necessary.

edit: it works fine without the PCI hotplug support, so it can be left out.

Ok, rebuild and boot your new kernel.  Then modprobe yenta_socket and ds.

Next, you need the madwifi drivers from CVS.  Get them like ths:

```
 cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/madwifi co madwifi
```

Next, cd to the madwifi directory that was created.  Then do a make, and make install as root.  Then modprobe wlan, ath_hal, and ath_pci in that order.  Now you should be able to bring the ath0 interface up and configure it with iwconfig to point to a certain essid or any.  Like:

```
iwconfig ath0 essid any
```

Then you can do a 

```
dhcpcd ath0
```

 if your AP is set up as a DHCP server.

If your computer hangs when modprobing ath_pci, then comment out the 

```
port 0x800-0x8ff
```

 part of the include statement in /etc/pcmcia/config.opts.  This has worked for me.

Hopefully it will work for you too.  I am still investigating kismet stuff for the moment, but the CVS drivers DO support monitor mode.  You can get it with 

```
iwconfig ath0 mode monitor
```

Hope that helps!

----------

## paranode

To follow up, monitor mode works well.  With Kismet, you can set the device type to prism2_hostap (even though it's not a prism card) and it will work with setting channels and the kismet_hopper.  I have successfully run kismet and captured data off of a network and sniffed out access points.  Ethereal also works to capture data after setting the interface to ath0 and putting the device in monitor mode.

Cheers!

Edit: Also, I notice this card resets itself to channel hopping after being told to sit on one channel for a little while.  You can get around this by telling kismet_hopper only to use the channel you want.  Something like:

```
kismet_hopper -s 1 -v 1
```

----------

## helmers

Wow, excellent!

As the original poster said, I believed there was no support for the "G" standard under Linux, but it looks like in the last months great progress have been made!  :Surprised: 

I have made some fumbeling attempts at getting it to work, but I will follow this guide point-by-point later today, and let you know how it goes.

----------

## helmers

Following the guide, it worked like a charm. I am typing this from my laptop runing at 48Mbps. There are two things I am not 100% happy with, and that is the speed of retrying at a different TX, and that I can't get it to show the signal strength in the GNOME wireless applet.

----------

## paranode

Yeah they are decent drivers.  The performance with WEP enabled is not so good though.  My card seems to max out at 100KB/s on a .11b network with 128-bit WEP enabled.  I hope they fix that soon...   :Confused: 

----------

## ALF@be

Finally, i found a forum wich explain how to use this card with linux.

Thanks !

----------

## Teklmanx

Thanks a million man..i owe you, i almost sold this card. I got all fustrated over it..heh. Thanks man..works like a charm.

----------

## bbarrera

Here is a script for net.ath0 to automatically start and stop the network interface.

Note the lines at top. You'll need to add these lines to /etc/conf.d/net and edit appropriately.

Original script written by Faye Pearson, syntax bug fixes by myself. All improvements welcome.

http://sourceforge.net/mailarchive/message.php?msg_id=5782545

```

#!/sbin/runscript

# Copyright 1999-2003 Gentoo Technologies, Inc.

# Distributed under the terms of the GNU General Public License v2

# $Header: /home/cvsroot/gentoo-src/rc-scripts/init.d/net.eth0,v 1.28 2003/03/16 08:03:19 azarah Exp $

#NB: Config is in /etc/conf.d/net

#

# Add the following lines to /etc/conf.d/net:

#

# ***************************************

# *** add to /etc/conf.d/net and edit ***

# ***************************************

# For wireless access point association, strip non alphanumeric characters

# from the essid before creating the following variables:

# essid_networkname="network-name"

# key_networkname="xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xx"

# key_networkname="xxxx-xxxx-xx"

#

#essid_essid1="essid1"

#key_essid1="xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xx"

#essid_essid2="essid2"

#key_essid2="xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xx"

#iface_ath0="dhcp"

#iface_ath0="192.168.1.2 broadcast 192.168.1.255 netmask 255.255.255.0"

# ***************************************

# *** add to /etc/conf.d/net and edit ***

# ***************************************

# For pcmcia users. note that pcmcia must be added to the same

# runlevel as the net.* script that needs it.

depend() {

        use hotplug pcmcia

}

checkconfig() {

        if [ -z "${iface_IFACE}" ]

        then

                eerror "Please make sure that /etc/conf.d/net has \$iface_$IFACE set"

                return 1

        fi

}

setup_env() {

        # No reason to check these multiple times in the file

        iface_IFACE="$(eval echo \$\{iface_${IFACE}\})"

        dhcpcd_IFACE="$(eval echo \$\{dhcpcd_${IFACE}\})"

        inet6_IFACE="$(eval echo \$\{inet6_${IFACE}\})"

        alias_IFACE="$(eval echo \$\{alias_${IFACE}\})"

        status_IFACE="$(ifconfig | gawk -v IFACE="${IFACE}" '/Link/ { if ($1 == IFACE) print "up" }')"

        if [ -x `which iwconfig` ]; then

                wireless_IFACE="$(iwconfig 2>/dev/null | gawk -v IFACE="${IFACE}" '/IEEE/ { if ($1 == IFACE) print "yes" }')"

        else

                wireless_IFACE="not installed"

        fi

}

setup_wireless() {

        # Try to find Access Points

        iwconfig $IFACE mode Managed

        iwconfig $IFACE rate auto

        iwconfig $IFACE key off

        iwconfig $IFACE rts off

        iwconfig $IFACE frag off

        iwconfig $IFACE essid any

        ifconfig $IFACE up

        sleep 2.0

        for AP in `iwlist ${IFACE} scan 2>/dev/null | grep ESSID | awk -F: '{print $2}' | sed 's/[-"]//g'`; do

                if [ -z ${essid_AP} ]; then

                        essid_AP="$(eval echo \$\{essid_${AP}\})"

                        if [ ! -z ${essid_AP} ]; then

                                key_AP="$(eval echo \$\{key_${AP}\})"

                        fi

                fi

        done

        ifconfig $IFACE down

#ewarn "Setting wireless parameters ${essid_AP} and ${key_AP}"

        if [ ! -z ${essid_AP} ]; then

                iwconfig ${IFACE} essid ${essid_AP}

        fi

        if [ ! -z ${key_AP} ]; then

                iwconfig ${IFACE} key ${key_AP}

        fi

        sleep 0.5

        return 0

}

start() {

        local retval=0

        setup_env

        checkconfig || return 1

        if [ ${wireless_IFACE} == "yes" ]; then

                ebegin "Detecting network for ${IFACE}"

                setup_wireless

                eend 0

        fi

        ebegin "Bringing ${IFACE} up"

        if [ "${iface_IFACE}" != "dhcp" ]

        then

                /sbin/ifconfig ${IFACE} ${iface_IFACE} >/dev/null || {

                        retval=$?

                        eend ${retval} "Failed to bring ${IFACE} up"

                        return ${retval}

                }

                # ifconfig do not always return failure ..

                /sbin/ifconfig ${IFACE} &> /dev/null || {

                        retval=$?

                        eend ${retval} "Failed to bring ${IFACE} up"

                        return ${retval}

                }

        else

                # Check that eth0 was not brough up by the kernel ...

                if [ "${status_IFACE}" != "up" ]

                then

                        /sbin/dhcpcd ${dhcpcd_IFACE} ${IFACE} >/dev/null || {

                                retval=$?

                                eend ${retval} "Failed to bring ${IFACE} up"

                                return ${retval}

                        }

                fi

        fi

        eend 0

        if [ -n "${alias_IFACE}" ]

        then

                local x=""

                local num=0

                local aliasbcast=""

                local aliasnmask=""

                ebegin "  Adding aliases"

                for x in ${alias_IFACE}

                do

                        aliasbcast="$(eval echo \$\{broadcast_${IFACE}\} \| awk \'\{ print \$$((num + 1)) \}\')"

                        if [ -n "${aliasbcast}" ]

                        then

                                aliasbcast="broadcast ${aliasbcast}"

                        fi

                        aliasnmask="$(eval echo \$\{netmask_${IFACE}\} \| awk \'\{ print \$$((num + 1)) \}\')"

                        if [ -n "${aliasnmask}" ]

                        then

                                aliasnmask="netmask ${aliasnmask}"

                        fi

                        ebegin "    ${IFACE}:${num}"

                        /sbin/ifconfig ${IFACE}:${num} ${x} \

                                ${aliasbcast} ${aliasnmask} >/dev/null

                        num=$((num + 1))

                        eend 0

                done

                save_options "alias" "${alias_IFACE}"

        fi

        if [ -n "${inet6_IFACE}" ]

        then

                local x=""

                ebegin "  Adding inet6 addresses"

                for x in ${inet6_IFACE}

                do

                        ebegin "    ${IFACE} inet6 add ${x}"

                        /sbin/ifconfig ${IFACE} inet6 add ${x} >/dev/null

                        eend 0

                done

                save_options "inet6" "${inet6_IFACE}"

        fi

        if [ -n "${gateway}" ] && [ "${gateway%/*}" = "${IFACE}" ]

        then

                ebegin "  Setting default gateway"

                # First delete any existing routes if it was setup by kernel ..

                /sbin/route del default dev ${gateway%/*} &>/dev/null

                /sbin/route add default gw ${gateway#*/} dev ${gateway%/*} \

                        netmask 0.0.0.0 metric 1 >/dev/null || {

                        local error=$?

                        ifconfig ${IFACE} down &>/dev/null

                        eend ${error} "Failed to bring ${IFACE} up"

                        stop

                        return ${error}

                }

                eend 0

        fi

        # Enabling rp_filter causes wacky packets to be auto-dropped by

        # the kernel

        if [ -e /proc/sys/net/ipv4/conf/${IFACE}/rp_filter ]

        then

                echo 1 > /proc/sys/net/ipv4/conf/${IFACE}/rp_filter

        fi

}

stop() {

        local myalias="$(get_options alias)"

        local myinet6="$(get_options inet6)"

        setup_env

        ebegin "Bringing ${IFACE} down"

        # Also down the inet6 interfaces

        if [ -n "${myinet6}" ]

        then

                local x=""

                for x in ${myinet6}

                do

                        /sbin/ifconfig ${IFACE} inet6 del ${x} >/dev/null

                done

        fi

        # Do some cleanup in case the amount of aliases change

        if [ -n "${myalias}" ]

        then

                local x=""

                local num=0

                for x in ${myalias}

                do

                        /sbin/ifconfig ${IFACE}:${num} down >/dev/null

                        num=$((num + 1))

                done

        fi

        if [ "${iface_IFACE}" = "dhcp" ]

        then

                local count=0

                while /sbin/dhcpcd -k ${IFACE} &>/dev/null && [ "${count}" -lt 9 ]

                do

                        # Give dhcpcd time to properly shutdown

                        sleep 1

                        count=$((count + 1))

                done

                if [ "${count}" -ge 9 ]

                then

                        eerror "Timed out trying to stop dhcpcd"

                fi

        else

                /sbin/ifconfig ${IFACE} down >/dev/null

        fi

        eend 0

}

# vim:ts=4

```

----------

## paranode

 *bbarrera wrote:*   

> Here is a script for net.ath0 to automatically start and stop the network interface.

 

I saw your post on the madwifi mailing list, I almost put this script up on this forum myself (with due credits) but you've already taken care of it.  Thanks!

----------

## bbarrera

I continue making improvements to the script like adding informational messages (to appear in /var/log/syslog) and adding features. One new feature I'm developing is to add preferred ESSID to /etc/conf.d/net and use that to select a "best match" in the net.ath0 script. The current script will only associate with the first AP that matches ESSID listed in /etc/conf.d/net.  I'll post that in a new thread when it is working.

----------

## mike_c

I'm having a similar problem

I followed your kernel setup exactly [ i am using 2.4 ] and i get this error when i try to mod_probe

```

# modprobe yenta_socket

/lib/modules/2.4.27/kernel/drivers/pcmcia/yenta_socket.o: init_module: No such d                                     evice

Hint: insmod errors can be caused by incorrect module parameters, including inva                                     lid IO or IRQ parameters.

      You may find more information in syslog or the output from dmesg

/lib/modules/2.4.27/kernel/drivers/pcmcia/yenta_socket.o: insmod /lib/modules/2.                                     4.27/kernel/drivers/pcmcia/yenta_socket.o failed

/lib/modules/2.4.27/kernel/drivers/pcmcia/yenta_socket.o: insmod yenta_socket fa                                     iled

```

i have no idea what this means. help would be appreicated

----------

