Monday, November 30, 2009

More ipw2200 eeprom fun

As written in my last post, I have packaged an ipw2200 kmp that enables writing to the eeprom. Incidentally, looking closer at one of my other machines, it turned out to have an ipw2200 that had the same problem as Obi's, namely not being able to use all 13 11b/g channels that are allowed here:
ipw2200: Detected geography ZZM (11 802.11bg channels, 0 802.11a channels)

The hexdump of the eeprom showed that the location of the geography code was the same as in Obi's case:
0040 9c e8 00 0e 35 d0 fa 25  00 46 00 01 5a 5a 4d 00 ....5..%.F..ZZM.

So I installed the ipw2200-eepromwrite-kmp from my build service repo and fixed the card.
blub:~ # ethtool -E eth1 magic 0x2200 offset 0x4e value 0x44
Cannot set EEPROM data: Invalid argument

That's one of the errors I wrote about in my last post, but it did no harm:
blub:~ # dmesg|tail -1
ipw2200 eeprom_write_u16(27, 0044)

shows that the eeprom write function was actually called.
Unloading and reloading the ipw2200 module then gave me:
ipw2200 0000:02:06.0: PCI INT A disabled
ipw2200: Intel(R) PRO/Wireless 2200/2915 Network Driver, 1.2.2kdmprq
ipw2200: Copyright(c) 2003-2006 Intel Corporation
ipw2200 0000:02:06.0: PCI INT A -> Link[LNKE] -> GSI 11 (level, low) -> IRQ 11
ipw2200: Detected Intel PRO/Wireless 2200BG Network Connection
ipw2200 0000:02:06.0: firmware: requesting ipw2200-bss.fw
ipw2200: device failed to start within 500ms
ipw2200: EEPROM checksum is invalid (0xe89c, should be 0xe895 instead).
ipw2200: To let the driver fix it use the module option 'repair_eeprom'.
ipw2200: Unable to load firmware: -62
ipw2200: failed to register network device
ipw2200 0000:02:06.0: PCI INT A disabled
ipw2200: probe of 0000:02:06.0 failed with error -5

So I did what the driver asked me and used "modprobe ipw2200 repair_eeprom=1":
ipw2200: Intel(R) PRO/Wireless 2200/2915 Network Driver, 1.2.2kdmprq
ipw2200: Copyright(c) 2003-2006 Intel Corporation
ipw2200 0000:02:06.0: PCI INT A -> Link[LNKE] -> GSI 11 (level, low) -> IRQ 11
ipw2200: Detected Intel PRO/Wireless 2200BG Network Connection
ipw2200 0000:02:06.0: firmware: requesting ipw2200-bss.fw
ipw2200: device failed to start within 500ms
ipw2200: EEPROM checksum is invalid (0xe89c, should be 0xe895 instead).
ipw2200 eeprom_write_u16(20, e895)
ipw2200: Detected geography ZZD (13 802.11bg channels, 0 802.11a channels)

Now everything is fine and I can also use channels 12 and 13.

Note that you should know what you are doing and be willing to sacrifice your wifi card if you are attempting anything like this. It worked for me, but that does not at all imply that it will work for anybody else. You have been warned! ;)

Saturday, November 28, 2009

HP does not want my wireless to work

I'm using an rather oldish, but still functioning hp compaq nc6000. It had built in atheros wireless. Whis is a pain. Because whenever NetworkManager thinks it is a good idea to do background scanning (at least every 2 minutes, I'd guess), the network quality degrades to it being unusable. Not only drops the data rate to ~100 to 200 kbyte/second, even worse, lots of packets get lost, so that working via SSH on a remote host becomes very annoying.
(With a recent kernel. Older kernels actually regularly stopped transmitting and dropped the connection completely during such events). Sometimes, reloading the ath5k module improves the situation (or at least it feels like it does), but then, every 5 reloads or so, the machine locks up hard (no SysRQ!) when reloading ath5k.

Today, that happened again. This was when I decided that I had enough and that I would swap the card for an intel ipw2200 I had lying around here.

But HP, THOSE GREEDY BASTARDS of course thought of a way to avoid that people upgrade their hardware. After putting the card in, the machine only shows an error "104 - we want you to pay lots of money for an HP approved Wireless" and does not boot.

Searching the internet, I found out that I had two possible options: patching the BIOS or patching the ipw2200 card's eeprom.
The second option is possible because there actually are ipw2200 cards that are "certified" by HP and they have different subvendor and subdevice IDs, so that the BIOS can detect them.

I went for a mix of all the procedures I found. The patch for ipw2200 I used is from Obi's Homepage (thanks), also a large part of the procedure is described there, even though he had a different goal.
Which bytes I had to change was described, ironically, in the HP support forum (search for "ethtool" on the page).

So that's what I did:
  • put the card into another notebook that would boot with it

  • build a patched ipw2200 (too bad upstream apparently does not want to take this patch)

  • boot an openSUSE 11.2 live ISO (from an USB stick, of course)

  • unload the original module, load the patched module (important)

  • issue the following commands:

ethtool -E eth0 magic 0x2200 offset 0x8 value 0xf6
ethtool -E eth0 magic 0x2200 offset 0x9 value 0x12
ethtool -E eth0 magic 0x2200 offset 0xa value 0x3c
ethtool -E eth0 magic 0x2200 offset 0xb value 0x10

Note that I did get errors from ethtool for every one of those commands (invalid address and others, pretty confusing ;) ). First I thought that it did not work, but "dmesg" told me that the write function was actually called, and so I just continued.

  • I unloaded and reloaded the patched ipw2200 module. I did expect an eeprom checksum error, but I actually did not get one. So I also did not do the "repair_eeprom=1" routine that Obi describes.

  • Put back the module in the "target" notebook.

Now I have:
02:04.0 Network controller: Intel Corporation PRO/Wireless 2200BG
Subsystem: Hewlett-Packard Company Compaq nw8240/nx8220

and so far it has been working fine.

Attention: according to the forum post in the HP forum, if your card is from the US and not from Europe, you will need
ethtool -E eth0 magic 0x2200 offset 0x8 value 0xf5

instead of the 0xf6 for the european version.

Oh - and if you are too lazy to patch and build your own ipw2200 module - there is the "ipw2200-eepromwrite-kmp" package for 11.2 in the buildservice, project home:seife ;)

eXtreme uPdating

I had that machine sitting in my living room which was once a media player, but is now (after I implemented VDR recording playback on my satellite STB :-) ) only used for playing back the recordings of my i4l-vbox answering machine. It was still running 10.3.
Now, having read that 10.3 was out of service, I decided to finally kill it.
So how to do that with style? Well, update it!

I removed the 10.3 repos and added the 11.0 repos. (Does anybody still remember how slow package management actually was back then? It was horrible!) I did not trust the old zypper to already having implemented a proper "zypper dup", so I updated with the YaST FACTORY module.
At first, YaST FACTORY updater refused to do a 10.3=>11.0 update. Well, edit the SuSE-release file and voila - it thinks it's a 11.0=>11.0 update.
Only a few Package conflicts (I had lots of stuff installed, including self-built RPMs and Packman packages) and thus half an hour waiting for the resolver, then I found out, that the packaging had switched from bzip2 to lzma at that time, so yast could not really install anything, but updating rpm manually behind YaST's back solved that. About four hours later (this is a lowly Toshiba Tecra with P3-1000 and 256MB RAM), I had 11.0 on the machine.

To my big disappointment, everything was still working!
Ok, so remove the 11.0 repos, add the 11.1... and zypper dup you go. Now I did not even have to patch SuSE-release...
Again, a few hours later (zypper was faster on 11.0, but not as fast as today), I had an 11.1 on the machine. And still, everything was working well, there even was still KDE3 on it.

I had intended to kill the machine, so I was not satisfied.
Remove 11.1 repos, add 11.2, zypper dup....
Yes! Finally, the X server did not produce a picture on my LCD TV (which is pretty picky about the VGA input signal, but did work before) anymore. Strike! But it was easily fixed: I just removed xorg.conf and at least had a 800x600 KDE4 Desktop. Installing sax2 (it had become lost in some conflicts, which I generally solved by "remove everything") and calling it fixed that up also.

What was actually a pity is, that no attempt had been made to import the KDE3 config (I had a few custom mime types etc, and now will have to reconfigure everything from scratch), but apart from that, the only thing I had to do was remove the kdm from KDE3 which was still installed and use the KDE4 kdm, so that logout and shutdown etc. properly work.

All in all it was pretty impressive, and I thought by myself "that's like the stories the debian users always tell about upgrades".

...and even though I wanted to, I will probably not get to do a fresh installation of 11.2, since all my updates went so well ;)

But what I found out in the end was, that KDE4 is really no longer usable on such a machine. Everything was very slow and sluggish, even with eye candy turned off as much as possible. But for the projected use of this box, XFCE will do just fine.

Tuesday, November 24, 2009

USB Boot Enabler

Since a few(?) releases, you can simply "dd" your openSUSE ISO-file onto an USB stick and boot from that, which is pretty cool and which I use a lot.
But recently, I came across a machine that simply does not boot from the USB stick. No matter what settings I tried in the BIOS - no boot. I believe it will only boot from internal hdd, internal CDROM or internal floppy and via PXE.
Instead of just burning the ISO onto a CD and using that (that would have been too easy, wouldn't it?), i booted an old rescue system I had still lying around on CD and found out, that the BIOS actually does enumerate the USB stick on boot, at least it shows up in /sys/firmware/edd and /dev/disk/by-id/edd-int13_dev81, so I wondered how to boot from it.

The answer was easy: Just copy what the openSUSE CD does for "boot from local harddrive". It's actually very easy (/tmp/x is the root directory for the ISO)
mkdir -p /tmp/x/isolinux
cp /usr/share/syslinux/isolinux.bin /tmp/x/isolinux/

Then create a /tmp/x/isolinux/isolinux.cfg file, with the following content:
say ***********************************************
say seife's USB boot enabler
say enter 0,1,2,3 for disk 0-3
say disk 0 is usually your local built-in harddrive
say disk 1 is probably your USB stick
say ***********************************************
label 0
localboot 0x80
label 1
localboot 0x81
label 2
localboot 0x82
label 3
localboot 0x83
default 0
prompt 1
timeout 0

That's it!
Create an ISO from it with:
genisoimage -o /tmp/sys.iso \
-b isolinux/isolinux.bin -c isolinux/ \
-no-emul-boot -boot-load-size 4 \
-boot-info-table \

And burn onto a CD. Voila, your USB boot enabler is ready!

Now I only need to find a small credit-card size CD-R blank somewhere ;)

And maybe Steffen Winterfeldt puts something like that as a hidden option into the default openSUSE ISOs. It would be quite useful IMHO.