Linksys WMP54GS with Broadcom BCM4306 chipset under Linux 2.6 kernel

For a long time (especially with the 2.4.x kernels), I’d been using a Linksys WUSB11-V26 with the Atmel RFMD 503 as the wireless NIC for my home network, using the at76c503 driver. It worked pretty well, but then I upgraded to a 2.6.x kernel and while it continued to work for a short time, when we suffered a prolonged power outage, the NIC refused to work when power came back. I discovered that my particular WUSB11-V26 only worked with the 0.90.2-140 revision of the firmware (newer firmwares wouldn’t turn the radio on) — once I learned this, everything was fine, I’d just hack the driver source to use the older firmware and everything was fine. However, when upgrading to 2.6.x, I discovered this meant also needing to upgrade to a more recent version of the at76c503 driver, which was fine since my NIC already had the 0.90.2-140 firmware downloaded to it. I built the new driver, installed it, and everything worked fine — until the powerloss. Watching the latest at76c503 driver try to download the firmware resulted in an "unexpected opcode 146" error. So, I decided it was time to buy a slightly better supported wireless NIC and stop fussing with this piece of junk.

Today, I ran out to CompUSA (instant gratification!) and bought myself a Linksys WMP54GS, which you can get at Amazon.com for around $59.99. I decided to go the PCI card route because I wanted to get 802.11g, but my host only has USB 1.1 and I didn’t want to spend the money on a USB 2.0 PCI card in addition to a new USB wireless NIC. Not only that, but most USB NICs have dinky attached antennas, and the PCI card has a screw-on antenna that can be replaced with larger and presumably better antennas. This is important depending on where in the house I need to position the antenna to get the best signal and coverage.

Since I know that wireless NICs aren’t well supported under Linux for various reasons, I decided to log all I had to do to get this particular NIC working on my machine. I run Debian, but these instructions should help get you pointed in the right direction for the most part. I hope this mini-HOWTO proves useful to you if you are in the process of installing a WMP54GS PCI NIC too; leave a comment if it did (or didn’t — maybe I can help)!

Identify what you’ve got

First, identify what you’ve actually got. This is what my machine reports:

$ lspci
...
0000:01:0b.0 Network controller: Broadcom Corporation BCM4306 802.11b/g Wireless LAN Controller (rev 03)

$ lspci -n | grep 0000:01:0b.0
0000:01:0b.0 0280: 14e4:4320 (rev 03)

Install NdisWrapper

There’s no specific driver for the WMP54GS for Linux. The trick is to use NdisWrapper, a package which loads the WinXP drivers (!) under Linux — for better or worse, this apparently works. You can download the source tarball (ndiswrapper-1.1.tar.gz) or get the Debian package (ndiswrapper-source_1.1-1_i386.deb). Note: I struggled with the Debian ndiswrapper-source and ndiswrapper-utils version 1.0rc2 which installed but did NOT work — I couldn’t set the SSID using iwconfig at all. You must use version 1.1.

So, here are the steps to download, build, and install NdisWrapper for Debian systems:

$ cd /tmp
$ wget http://ndiswrapper.sourceforge.net/debian/ndiswrapper-source_1.1-1_i386.deb
$ dpkg -i ndiswrapper-source_1.1-1_i386.deb
$ cd /usr/src
$ gzip -dc ndiswrapper-source.tar.gz | tar xf -
$ cd modules/ndiswrapper
$ debian/rules binary-utils
$ debian/rules binary-modules
$ cd ..
$ dpkg -i ndiswrapper-utils_1.1-1_i386.deb
$ dpkg -i ndiswrapper-modules-2.6.10_1.1-1_i386.deb

Install the Linksys WMP54GS driver

At this point, you now have NdisWrapper installed. But, what about the actual WMP54GS drivers? You can pull them off the CD that came with the NIC, or you can download them. According to the NdisWrapper List wiki page, you want to download this WMP54GS_20040423.exe driver. Either way, you need the following three files:

Drivers/bcm43xx.cat
Drivers/BCMWL5.inf
Drivers/bcmwl5.sys

According to the NdisWrapper Installation wiki page, you don’t need to actually “install” the self-extracting EXE on a Windows machine. Just use a archive extraction program that understands self-extracting EXE’s and extract those three files that we need. Actually, I think we only need the .inf and .sys files, but I extracted the .cat file because it was the only other file in the directory. Once you’ve got those files extracted, you “install” them using the ndiswrapper tool:

# ndiswrapper -i BCMWL5.inf
Installing bcmwl5

# ndiswrapper -l
Installed ndis drivers:
bcmwl5 driver present, hardware present

Time to load the driver

If you’ve done all the previous steps correctly, at this point the only thing left to do is load the ndiswrapper kernel module, which in turn will load the bcmwl5 driver we just installed, and you should be in business.

# modprobe ndiswrapper

Verify that it loaded correctly by checking what got written to syslog. Here’s what got written to mine:

kernel: ndiswrapper version 1.1 loaded (preempt=yes,smp=no)
kernel: ndiswrapper: driver bcmwl5 (Linksys,02/19/2004, 3.50.21.11) loaded
kernel: ACPI: PCI interrupt 0000:01:0b.0[A] -> GSI 21 (level, low) -> IRQ 21
kernel: ndiswrapper: using irq 21
kernel: wlan0: ndiswrapper ethernet device 00:0f:66:e6:0d:37 using driver bcmwl5, configuration file 14E4:4320:1737:0015.5.conf
kernel: wlan0: encryption modes supported: WEP, WPA with TKIP, WPA with AES/CCMP

Configure the interface

After that, it was just a matter of configuring the wlan0 interface in /etc/network/interfaces and then issuing an ifup wlan0 to configure it. Here’s an idea of what I use:

auto wlan0
iface wlan0 inet static
wireless_essid Panoptic
wireless_mode ad-hoc
wireless_channel 10
address 10.0.0.1
netmask 255.255.255.0
broadcast 10.0.0.255
up dhcpd -q -cf /etc/dhcpd-wlan0.conf -pf /var/run/dhcpd-wlan0.pid -lf /var/lib/dhcp/dhcpd-wlan0.leases wlan0
down kill `cat /var/run/dhcpd-wlan0.pid`

Yes, I run a DHCP server bound to the wlan0 interface to provide IP addresses via DHCP to anyone connecting to the wireless network. Don’t worry, there’s iptables rules-a-plenty that lock it all down nicely, but that, my friends is for another time …

Update: If you want to set up WPA (Wi-Fi Protected Access), check out the WPA page on the ndiswrapper wiki.

Tags: , , , ,

another nsopenssl-related memory leak fixed!

Yesterday, I sat down and finally reviewed the patch that Christopher Bowman provided to fix the SSL-related leak and came up with a reproducible way of demonstrating the leak and verifying the fix (see SF Bug #1160850: nsopenssl leaks SSL obj. mem w/Keep-Alive). It turns out the leak was due to AOLserver not calling the socket driver’s DriverClose callback when a HTTP Keep-Alive connection timed out, which is where nsopenssl does its clean-up of the SSL structure that’s allocated for the connection. So, the fix was in aolserver/nsd/driver.c and not in the nsopenssl module itself. That means the fix will be generally available as part of the next release of AOLserver which will be 4.0.11.

Until 4.0.11 is released, however, if you have a server that is using nsopenssl and you’re seeing this memory leak, you can “work around” the problem by disabling HTTP Keep-Alive, which is unfortunately a server-wide config. option instead of a per-socket driver option. You do this by setting the keepalivetimeout parameter to 0 (zero) in the ns/parameters section, like this:

ns_section  "ns/parameters"
ns_param    keepalivetimeout    0

Again, thanks to everyone who has helped investigate, troubleshoot, provide information about and otherwise participated in the hunt for this leak.

why can I never remember sp_helptext?

Roughly once ever year or two, I have to look at a Sybase database to do some troubleshooting and it almost always involves looking at the body of a stored procedure. Since it’s so infrequent, I can never remember what the magic incantation is to get Sybase to give up that blossom of information. Every time, I spend a good five or ten minutes Googling around until I find the Sybase cheat sheet that reminds me the answer is sp_helptext.

Tags:
,

everyone represents the company they work for

One of the hot topics of the Blogosphere lately has been people getting fired for blogging. This inspired Niall Kennedy of Technorati to mock up a wartime-era poster including the logos of various blogging companies to make his satirical comment about the recent companies overreaction to employee blogs. He posted his poster remix on Friday night. On Monday, Niall recanted.

What’s surprising to me is how folks are surprised when companies limit or otherwise censor what employees say in their personal blogs. As an employee of a company, you are always representing that company whether you, or the company, likes it or not. This is nothing new, and blogging has nothing to do with it. Niall writes, “I have always operated under the assumption that until I reach executive status at any company I work for I remain an individual voice and do not represent the organization.” Huh? Some companies consciously make the fact that every employee, and I mean every employee, represents the company as part of their explicit operation. The best example that comes to mind is the Wal-Mart Greeter, a customer service position that acknowledges the fact that a company’s relationship with its customers exists through its employees, so much so that it’s important to dedicate employees to nurture that relationship without other distractions.

In the high tech industry, Niall’s misunderstanding may have been a little more understandable — individual contributors didn’t directly interact with a company’s customers. However, through self-published public displays of individuality such as blogs, employees can and do interact with a company’s customers, partners, vendors, etc., and when you do, you are representing the company whether you like it or not.

I remember telling someone at a dinner party years ago how, “Even though it’s after work, and we’re friends, for better or for worse, I still represent my employer, right now.” The response was an incredulous, “Are you serious? How can that be?” I went on to explain that, “If I act like a fool, you will form the opinion that my employer hires fools. If I act unethically or immorally, you will form the opinion that my employer hires unethical or immoral people. If you are a customer of my company, or were considering being one, or you yourself work for a company who is a customer, how would this impression influence your decision or recommendation to do business with my company?” From the pause that followed, I could tell that he got the point. Even though I was “just an individual contributor” working for a large corporation, I was representing my company even when I wasn’t working, even in times that many people would consider my own very private, personal time. And this was long before blogs existed, let alone popular.

The upside to this is that a company can use this to their advantage, if they hire really smart, conscientious and moral people, and encourage them to speak freely. Of course, to enjoy this advantage, companies have to start hiring people like this, and that’s the hard part.

blog reading is the new personalization

Recently, the blogosphere has been hot with a buzz about how bloggers may not be “real” journalists, and thus don’t enjoy the same protection because of Apple v. Does (via Rex Hammock), even though folks like Peggy Noonan say brilliant things like this about the potential effects of blogging on mainstream media (via Steve Rubel). It’s even gotten to the point that there’s a conference called Blogging, Journalism & Credibility being formed.

Steve Rubel summarizes a discussion where David Scott Lewis suggested to Robert Scoble that he’d “get a lot more ideas from reading [100] printed trade magazines than from [1,300] blogs.” I don’t know what frightens me more: the fact that Scoble was able to find 1,300 blogs worth reading (my blogroll is still under 100), or that Lewis really believes what he said. Quite simply, good blogs update minimally once a day and some even many times a day and at worst once a week. I’m guessing that most trade magazines are distributed monthly, and contain around ten articles and ten columns. So, we’re comparing 100 magazines x (10 articles + 10 columns) = 200 things per month vs. 1,300 blogs x (1 entry per week x 5 weeks in a month) = 6,500 things per month, approximately. Considering that magazine articles are usually not shorter than 500 words and can even exceed 1,000 words, and your average blog entry is anywhere from 10 to 200 words, we’re comparing reading 100,000–200,000 words per month through magazines, or between 65,000–650,000 words per month through blogs.

However, many blog entries are duplicates of each other which presumably is where Lewis figures much time is being wasted by blog readers, having to skip over dupe entries which is what an edited magazine would help a reader avoid. I suggest that of the 1,300 blogs Scoble “reads” (presumably through an aggregator — which totally changes the meaning of “read” from the traditional sense), he could probably reduce it to 300 and not lose any information because of the wide overlap in content across many blogs. Now we’re talking 15,000–300,000 words per month of blog entries.

What I am not including in all this is the actual reading of the articles that are linked to from people’s blog entries. Yes, that adds to the blog reader’s total word counts. But, it’s also main-stream media like the magazines, so which we divide both sides of the equation and this count drops out, right?

So, after all this … what’s the point? Well, I just wanted to point out that 6-8 years ago, the Internet bubble was all a-buzz with “personalization” and “personalized portals” and “on-demand content”, etc. Editorially published content was great in its day when money was flowing like water to pay for all the warm bodies to produce it — hell, AOL is still trying to run a business around the model, even today in 2005 — but in tighter times like today, it’s just not cost-effective. User-contributed content scales better, costs less, and brings a more personal touch to the content. This is exactly what blogs are becoming today: a large source of user-contributed content on a wide variety of subject matter, both novel content as well as opinion-based value-add to someone else’s content.

This, in turn, makes RSS aggregators the new personalized portal: you subscribe to content that you’re interested in, and read new content when it becomes available. In other words, by using an RSS aggregator and reader, I can basically build myself a customized or personalized portal just for me, not just add “portlets” to a “My Portal” page with content that the portal owner wants to make available to me. This is why Scoble’s point about RSS feeds for content is now a requirement, not an option, is so poignant, although he limits his point by making it marketing-focused. It’s also why a new scheme for monetizing content other than ad delivery will need to be invented, and I don’t think the answer is just embedding ads in the feed like some content providers are trying. It’s exciting to think about the innovation that’s coming into this space and I’m hoping I’ll be able to play some part in it.

Okay, I’m sold on PurifyPlus

Christopher Bowman of Wayport in the last few weeks has helped identify two memory leaks, one [1] in nsoracle, and another [2] in nsopenssl. Here’s the commit mail of Jeremy Collins committing Christopher’s patch to nsoracle. I’m in the process of creating a reproducible test case to verify his patch to nsopenssl.

So, what’s his secret? He uses PurifyPlus and apparently it clued him in. I’ve been hesitant to use Purify because I’ve never used it before; I’ve always used a free tool called Valgrind. Since I’ve been hunting this leak in nsopenssl for the past several months with little luck, I’ve decided it’s time I really got familiar with Purify and add it to my bag of tricks. Thanks a lot, Christopher, for showing me the value of Purify.

This might explain why folks like Janine Sisk and Andrew Grumet are still seeing memory leaks, if they’re using both nsoracle and nsopenssl on their servers. Hopefully soon, we’ll find out if their leaks have gone away or not.

AOLserver in FreeBSD Ports tree needs updating

So, on my PubSub“aolserver” feed (RSS), it picked up this change on FreshPorts for the AOLserver Port. (Link to actual FreeBSD Ports page is here.)

I wonder how many people are actually running AOLserver on FreeBSD, and of those, who are using the package from the Ports tree. If anyone is, I hope they can urge someone to update the version from what’s currently there (3.4.2) to the latest version (4.0.10 as of right now).

Northern NJ MySQL Meetup on Monday, March 7 @ 7:00 PM

I’m the organizer of several Meetup groups, one of them being the Northern NJ MySQL Meetup group. Up to now, all of the Meetup groups that I’m the organizer for have been idle, except very recently someone in the MySQL Meetup group contacted me and suggested that we hold an event at Panera Bread on Route 4 West in Paramus, across from the Bergen Mall.

As it stands, it looks like the turn-out might be three people, but I’m hoping between now and Monday, March 7th at 7:00 PM, that a few more people will RSVP and attend. If you’d be interested in meeting other folks who are interested in MySQL, then join the Meetup group and RSVP for the event! Or, if you know someone who might be interested, pass this information along to them. Thanks!

WinXP’s “fsutil” secret

Okay, after being fed up with my Dell Latitude C840‘s sluggish performance, I decided to Google around for some WinXP tweaking tips and stumbled across one I’ve been thinking must exist for a long time. It’s tip #1, “Disable Last File Access Stamping”. Especially for a laptop, this makes a hell of a lot of sense. This, coupled with tip #2, “Turn Off Windows Indexing”, and tip #3, “Increase Your File System Cache”, should actually help extend the battery life of my laptop which is important. Hell, I don’t know why Dell doesn’t ship laptops with these tweaks straight from the factory!

Anyhow, the first tip uses the fsutil command to turn the disablelastaccess flag on. Normally, every time a file is accessed — even if it’s for reading only — WinXP will update some metadata about the file indicating when it was last accessed. This is different from the last modification time, which is important and you wouldn’t normally want to turn off. Turning off the update of last access time should be pretty harmless for a majority of users, and it’ll likely reduce the amount of disk writes that happen merely to update the metadata about files that you access. The one caveat from Microsoft’s documentation on disablelastaccess is important:

Note that using the disablelastaccess parameter can affect programs such as backup and Remote Storage that rely on this feature.

All told, after completing the three tweaks mentioned earlier, my system definitely feels much snappier, the hard drive light doesn’t blink nearly as much as it used to, and I haven’t experienced anything bad, yet. I’m happy and the system doesn’t feel as sluggish as it did — it would grind for a good few seconds starting up applications, which has measurably improved.

My first public presentation on AOLserver!

Tonight, I’ll be giving my first public presentation on AOLserver to the members of $GROUPNAME down in New Brunswick, NJ at 7:30pm.

According to their website, “$GROUPNAME is an organization for UNIX system administrators in New Jersey formed to facilitate information exchange pertaining to the field of Unix system administration. $GROUPNAME is not affiliated with a particular hardware or software vendor or company.” The meetings are held at the CoRE building (driving directions) on the Rutgers University New Brunswick campus.

As the $GROUPNAME website says, I’ll be giving an introduction to AOLserver talk. I won’t be revealing the secrets of the universe about AOLserver, but it should serve as an opportunity for people who are new to AOLserver to learn a bit about its history, how it came to be, what some folks are doing with it today and otherwise familiarize themselves a bit with what AOLserver is. I’m hoping it might get some new people interested in AOLserver who otherwise would never have looked into it. I’m very excited about this!

If you’re in the New Jersey or surrounding area and belong to or organize a club or user group or if your company would like to invite me to talk about AOLserver, please let me know. I’d be more than happy to discuss the opportunity and work out an arrangement, if possible.