AdSense Mobile Ad

Monday, May 4, 2009

Enabling Dell Vostro Wifi network adapter on Solaris Express Community Edition (build 110)

I unfortunately had to configure a Dell Vostro laptop: the machine's not bad but as soon as I see the typical Broadcom {Solaris, Linux}-unsupported Wifi card I would start to scream and run away.

Configuring ndiswrapper on Linux is pretty straightforward: it's a small project which usually compiles without issues using the typical GNU toolchain of your preferred distro. If you use Debian you can recompile the ndiswrapper module for your kernel-of-the-day using modules-assistant without any pain.

Solaris is another beast and an NDIS-wrapper is being actively ported by the OpenSolaris Laptop community. Installation is not straight forward and I experienced some issues worth mentioning here.

Have you got the Windows drivers?
If you're planning to use an NDIS wrapper because your Wireless NIC is unsupported the first thing you need is the Windows driver. Take into account that the wrapper is meant to work with NDIS version 5.0 or above: Windows 2000 driver will probably work but best results will be accomplished with Windows XP and Windows 2003 Server drivers. Also, 32-bit drivers nowadays offer more stability than 64-bit drivers which, in many cases, does not even work as expected.

Have you got the right version of the tool chain?
Laptop community home page suggests the following:
  • GNU C Compiler v. 3.4.3 or superior
  • flex
Both are present on Solaris 10 in /usr/sfw/bin.

Have you got ON-specific build tool?
This is something that is indeed mentioned in the Laptop Community homepage. OpenSolaris 2008.11 provides them in /opt/onbld/bin but neither Solaris 10 nor Solaris Express Community Edition (as of build 110) ships them with the OS. If you're using such a system, download the SUNWonbld package at the OpenSolaris Download Center.

Get ndis.
Grab ndis source taking into account the version of the OS you're running. The Laptop Community page will suggest the correct version for the system you're running.

Build the driver.
The steps to build a driver are pretty straightforward. Let's start with the 32-bit version of the driver:
  • First unzip the ndis source tarball into some directory and then copy the 32-bit driver's inf and sys files into the i386 folder of the ndis distribution.
  • (Optional) Convert the inf file into a plain ASCII file with:
# iconv -f utf-16 -t ascii driver.inf > ndis.inf
  • Build the driver:
# make ndiscvt
# ./ndiscvt -i ndis.inf -s ndis.sys -o ndis.h
# make ndis
# cp bcmndis /kernel/drv/bcmndis
# make ndisapi
# cp ndisapi /kernel/misc
These steps will install the 32-bit bcmndis driver. This is where the official Laptop community page isn't clear, in my humble opinion. A 32-bit driver can be built while running a 64-bit kernel but it cannot be used that way. If you plan to use this driver you'll have to skip the following section and go directly to GRUB configuration for Solaris 32-bit.

Building a 64-bit driver.
If you've got the 64-bit version of the driver (you probably have in some installation CD and if you don't, check your PC vendor's home page) you can try and build a 64-bit version and see if it runs with Solaris. I had not so much luck with this Dell Vostro 1710, equipped with a Broadcom Wifi chip (14e4, 4315) but some cards are reported to work. To build a 64-bit version the steps are essentially the same:
  • Copy the 64-bit driver's inf and sys files into the amd64 folder of the ndis distribution.
  • Build the driver:
# make ndiscvt
# ./ndiscvt -i ndis.inf -s ndis.sys -o ndis.h
# make ndis
# cp bcmndis /kernel/drv/amd64/bcmndis
# make ndisapi
# cp ndisapi /kernel/misc/amd64
Try to use the driver.
Assuming everything went fine, you can now add your driver into your Solaris and try to use it. As explained, if you built a 32-bit only driver, you should run the 32-bit Solaris kernel. That said, you can type:
# add_drv -i '¨(pci-vendor-id, pci-device-id)¨'

The PCI IDs can be found by using scanpci or checking your hardware documentation. In the Dell Vostro 1710 case they were (pci14e4,4315).

Booting a 32-bit Solaris.
To boot a 32-bit Solaris the easiest approach is editing GRUB menu and adding a specific entry. In my case I added the following:
title Solaris Express Community Edition snv_110 X86
findroot (pool_rpool,0,a)
kernel$ /platform/i86pc/kernel/unix -B $ZFS-BOOTFS
module$ /platform/i86pc/boot_archive
The Dell Vostro 1710 experience.
Well... I built both the 32 and the 64 bit drivers but unfortunately the 64-bit one panics my system immediately. So I'm booting a 32-bit Solaris when I need the wifi card and the 64-bit Solaris the rest of the times. I'm not very happy because rebooting is a pain and, moreover, the 32-bit system with wifi enabled sometimes crashes, even if I don't know why yet.

No comments: