how to get ndis support working in freebsd

2004-08-29 Thread Sanjay Makadia
Hi,
I am newbie as far as freebsd is concerned.  I installed the latest
version of freebsd 5.2.1 last week and to make my wireless card to
work i need ndis wrapper.  I searched for it on the web and found the
necessary drivers.  I searched for ndis on my system but it seems like
its not there.  Do i have rebuild the kernel with some flags to
install ndis or can i just get source for ndis and install it?  Any
help is highly appreciated.  Thanks in advance.
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: how to get ndis support working in freebsd

2004-08-29 Thread Phil Schulz
Sanjay Makadia wrote:
Hi,
I am newbie as far as freebsd is concerned.  I installed the latest
version of freebsd 5.2.1 last week and to make my wireless card to
work i need ndis wrapper.  I searched for it on the web and found the
necessary drivers.  I searched for ndis on my system but it seems like
its not there.  Do i have rebuild the kernel with some flags to
install ndis or can i just get source for ndis and install it?  Any
help is highly appreciated.  Thanks in advance.
Hi,
 Project Evil aka NDISulator does not come with 5.2.1-Release. 
However, you can install it on 5.2.1-Release by following these 
instructions.
 You need to have the system's sources installed locally. In addition, 
you will have to download the NDISulator sources. You can either 
download them from CVSweb, by using CVSup or by using AnonCVS. I chose 
to use AnonCVS.
 Pick an AnonCVS mirror close to you from the list at [1]. I live in 
Germany, but since none of the two German mirrors work for me atm, I 
chose anoncvs.at.FreeBSD.org which is located in Austria. Set your 
CVSROOT environment variable so it fits the server you chose. I issued 
the following commands:

  $ su
  Password:
  # setenv CVSROOT :pserver:[EMAIL PROTECTED]:/home/ncvs
 I used 'su' b/c you need write permissions on the source tree to check 
out the NDISulator sources.
 Now you will need to login to the CVS server.

  # cvs login
  Logging in to :pserver:[EMAIL PROTECTED]:2401/home/ncvs
  CVS password:
 You can find the password listed at [1]. Now you need to check out the 
sources for NDISulator. The directories you need to check out are

  sys/compat/ndis
  sys/dev/if_ndis
  usr.sbin/ndiscvt
  sys/modules/if_ndis
  sys/modules/ndis
Use the following command to do so (and make sure you're in /usr/src):
  # pwd
  /usr/src
  mars# cvs checkout sys/compat/ndis sys/dev/if_ndis usr.sbin/ndiscvt \
  sys/modules/if_ndis sys/modules/ndis
  [CVS output snipped]
 First you should build ndiscvt(8) by doing
  # cd /usr/src/usr.sbin/ndiscvt
  # make
  [compile output snipped]
  # make install
  install -s -o root -g wheel -m 555   ndiscvt /usr/sbin
  install -o root -g wheel -m 444 ndiscvt.8.gz  /usr/share/man/man8
  # rehash
 Now you can build the first module by doing:
  # cd /sys/modules/ndis/
  # make
  # make load
  /sbin/kldload -v /usr/src/sys/modules/ndis/ndis.ko
  Loaded /usr/src/sys/modules/ndis/ndis.ko, id=4
 Finally you need to build the if_ndis module. This requires that you 
have got the drivers for your NIC availeable.

  # cd /sys/modules/if_ndis
  # ndiscvt -i /path/to/driver.inf -s /path/to/driver.sys \
  -o ndis_driver_data.h
  [long output snipped]
  # make
  Warning: Object directory not changed from original \
  /usr/src/sys/modules/if_ndis
  @ - /usr/src/sys
  machine - /usr/src/sys/i386/include
  touch opt_bdg.h
  awk -f @/tools/makeobjops.awk @/kern/device_if.m -h
  awk -f @/tools/makeobjops.awk @/kern/bus_if.m -h
  awk -f @/tools/makeobjops.awk @/dev/pci/pci_if.m -h
  awk -f @/tools/makeobjops.awk @/dev/pccard/card_if.m -h
  make: don't know how to make pccarddevs.h. Stop
Now, I don't know what this error means or why it appears, but if you 
apply this patch to Makefile, it works for me.

  --- Makefile.oldSun Aug 15 14:27:08 2004
  +++ MakefileSun Aug 29 13:27:25 2004
  @@ -4,6 +4,6 @@
   KMOD=  if_ndis
   SRCS=  if_ndis.c if_ndis_pci.c if_ndis_pccard.c
  -SRCS+= opt_bdg.h device_if.h bus_if.h pci_if.h card_if.h pccarddevs.h
  +SRCS+= opt_bdg.h device_if.h bus_if.h pci_if.h card_if.h
   .include bsd.kmod.mk
Now re-run make:
  # make
  [output snipped, no errors]
Now you can load the module. I recommend you do this on the console and 
not from X so you see what's going on...

  # make load
  /sbin/kldload -v /usr/src/sys/modules/if_ndis/if_ndis.ko
   Aug 29 13:30:38 mars kernel: ndis0: Intel(R) PRO/Wireless LAN 2100 
3B Mini PCI Adapter mem 0xe0203000-0xe0203fff irq 10 at device 6.0 on pci2
   Aug 29 13:30:38 mars kernel: ndis0: NDIS API version: 5.1
   Aug 29 13:30:38 mars kernel: ndis0: 11b rates: 11Mbps 2Mbps 1Mbps 
5.5Mbps
  Loaded /usr/src/sys/modules/if_ndis/if_ndis.ko, id=5

 Please note that the s are just there so my mailer doesn't wrap the 
lines :-/. Now, if all went well you can see a network interface called 
ndis0 if you issue

mars# ifconfig ndis0
ndis0: flags=8802BROADCAST,SIMPLEX,MULTICAST mtu 1500
ether 00:0c:f1:2d:0e:4b
media: IEEE 802.11 Wireless Ethernet autoselect
status: no carrier
ssid 
channel -1 authmode OPEN powersavemode OFF powersavesleep 100
wepmode OFF weptxkey 1
Depending on your interface the output might look differently, but if 
ndis0 is there, you know that compiling and loading Project Evil worked.
 Hope this helps.

Regards,
Phil.
[1]http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/anoncvs.html
--
Did you know...
If you play a Windows 2000 CD backwards, you hear satanic messages,
but what's worse is when you play it forward