[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#637063: linux-image-2.6.26: patch for fujitsu-laptop (refers to bug #631664)



Package: linux-2.6
Version: 2.6.26-26lenny3
Severity: wishlist
File: linux-image-2.6.26

I created a patch for 2.6.26 which adds the software-based RF-switch to the kernel. I extracted the main parts 
of fsaa1655g.c (see bug #631664) and patched it against fujitsu-laptop.c.
Now I can switch on my wifi.

-- Package-specific info:
** Version:
Linux version 2.6.26-2-686 (Debian 2.6.26-26lenny3) (dannf@debian.org) (gcc version 4.1.3 20080704 (prerelease) (Debian 4.1.2-25)) #1 SMP Sat Jun 11 14:54:10 UTC 2011

** Command line:
root=/dev/hda2 ro single

** Not tainted

** Kernel log:
[   12.837998] ACPI: Lid Switch [LID]
[   12.868196] usb usb2: New USB device found, idVendor=1d6b, idProduct=0001
[   12.868265] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[   12.868329] usb usb2: Product: OHCI Host Controller
[   12.868386] usb usb2: Manufacturer: Linux 2.6.26-2-686 ohci_hcd
[   12.868447] usb usb2: SerialNumber: 0000:00:13.1
[   12.868654] ACPI: PCI Interrupt 0000:00:13.2[A] -> GSI 19 (level, low) -> IRQ 19
[   12.868788] ehci_hcd 0000:00:13.2: EHCI Host Controller
[   12.868876] ehci_hcd 0000:00:13.2: new USB bus registered, assigned bus number 3
[   12.869018] ehci_hcd 0000:00:13.2: irq 19, io mem 0xd0007000
[   12.875073] ACPI: AC Adapter [ACAD] (on-line)
[   13.012059] usb 1-1: new low speed USB device using ohci_hcd and address 2
[   13.032330] ACPI: Battery Slot [BAT0] (battery present)
[   13.032465] ehci_hcd 0000:00:13.2: USB 2.0 started, EHCI 1.00, driver 10 Dec 2004
[   13.032614] usb usb3: configuration #1 chosen from 1 choice
[   13.032704] hub 3-0:1.0: USB hub found
[   13.032773] hub 3-0:1.0: 8 ports detected
[   13.092068] hub 1-0:1.0: unable to enumerate USB device on port 1
[   13.136187] usb usb3: New USB device found, idVendor=1d6b, idProduct=0002
[   13.136255] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[   13.136323] usb usb3: Product: EHCI Host Controller
[   13.136380] usb usb3: Manufacturer: Linux 2.6.26-2-686 ehci_hcd
[   13.136438] usb usb3: SerialNumber: 0000:00:13.2
[   13.137290] ACPI: PCI Interrupt 0000:00:14.2[A] -> GSI 16 (level, low) -> IRQ 16
[   13.301415] ACPI: \_SB_.PCI0.IDE_.SECD.S_D0: found ejectable bay
[   13.301425] ACPI: \_SB_.PCI0.IDE_.SECD.S_D0: Adding notify handler
[   13.301474] ACPI: Bay [\_SB_.PCI0.IDE_.SECD.S_D0] Added
[   13.301538] ACPI: \_SB_.PCI0.IDE_.SECD.S_D1: found ejectable bay
[   13.301541] ACPI: \_SB_.PCI0.IDE_.SECD.S_D1: Adding notify handler
[   13.301569] ACPI: Bay [\_SB_.PCI0.IDE_.SECD.S_D1] Added
[   13.848056] usb 1-1: new low speed USB device using ohci_hcd and address 3
[   14.053342] usb 1-1: configuration #1 chosen from 1 choice
[   14.055377] usb 1-1: New USB device found, idVendor=192f, idProduct=0416
[   14.055440] usb 1-1: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[   14.055499] usb 1-1: Product: USB Optical Mouse
[   14.669823] input: PC Speaker as /class/input/input4
[   15.164334] input: PS/2 Mouse as /class/input/input5
[   15.207961] input: AlpsPS/2 ALPS GlidePoint as /class/input/input6
[   15.214042] ACPI: PCI Interrupt 0000:08:0b.0[A] -> GSI 16 (level, low) -> IRQ 16
[   15.267037] ohci1394: fw-host0: OHCI-1394 1.1 (PCI): IRQ=[16]  MMIO=[d0202000-d02027ff]  Max Packet=[2048]  IR/IT contexts=[4/8]
[   15.313703] 8139too Fast Ethernet driver 0.9.28
[   15.476945] ACPI: PCI Interrupt 0000:08:0a.0[A] -> GSI 19 (level, low) -> IRQ 19
[   15.536138] ssb: Sonics Silicon Backplane found on PCI device 0000:08:0a.0
[   15.536281] ACPI: PCI Interrupt 0000:08:0d.0[A] -> GSI 17 (level, low) -> IRQ 17
[   15.537987] eth0: RealTek RTL8139 at 0xa000, 00:40:ca:d8:f9:99, IRQ 17
[   15.538049] eth0:  Identified 8139 chip type 'RTL-8101'
[   16.361629] usbcore: registered new interface driver hiddev
[   16.365721] input: USB Optical Mouse as /class/input/input7
[   16.396148] input,hidraw0: USB HID v1.11 Mouse [USB Optical Mouse] on usb-0000:00:13.0-1
[   16.396429] usbcore: registered new interface driver usbhid
[   16.396487] usbhid: v2.6:USB HID core driver
[   16.748308] ieee1394: Host added: ID:BUS[0-00:1023]  GUID[0040ca01371018ff]
[   17.123535] b43-phy0: Broadcom 4318 WLAN found
[   17.188614] phy0: Selected rate control algorithm 'pid'
[   17.354847] Broadcom 43xx driver loaded [ Features: PMLR, Firmware-ID: FW13 ]
[   18.187321] Adding 1028152k swap on /dev/hda3.  Priority:-1 extents:1 across:1028152k
[   18.600308] EXT3 FS on hda2, internal journal
[   18.845450] loop: module loaded
[   19.140079] fuse init (API version 7.9)
[   52.644603] fsaa1655g: Radio turned ON
[   52.644603] fujitsu-laptop: driver 0.3 successfully loaded.
[   99.362272] fsaa1655g: Radio turned OFF
[   99.362323] fujitsu-laptop: driver unloaded.
[  175.576163] powernow-k8: Found 1 AMD Turion(tm) 64 Mobile Technology MT-32 processors (1 cpu cores) (version 2.20.00)
[  175.576204] powernow-k8:    0 : fid 0xa (1800 MHz), vid 0xa
[  175.576207] powernow-k8:    1 : fid 0x8 (1600 MHz), vid 0xc
[  175.576210] powernow-k8:    2 : fid 0x0 (800 MHz), vid 0x16
[  177.362606] lp: driver loaded but no devices found
[  177.399912] ppdev: user-space parallel port driver
[  177.712041] Clocksource tsc unstable (delta = -186647067 ns)
[  178.411035] NET: Registered protocol family 10
[  178.412133] lo: Disabled Privacy Extensions
[  184.189503] input: b43-phy0 as /class/input/input8
[  184.276073] firmware: requesting b43/ucode5.fw
[  184.412454] firmware: requesting b43/pcm5.fw
[  184.548570] firmware: requesting b43/b0g0initvals5.fw
[  184.674123] firmware: requesting b43/b0g0bsinitvals5.fw
[  184.904052] b43-phy0: Loading firmware version 410.2160 (2007-05-26 15:32:10)
[  185.844389] Registered led device: b43-phy0::tx
[  185.844457] Registered led device: b43-phy0::rx
[  185.844519] Registered led device: b43-phy0::radio
[  185.844642] b43-phy0: Radio hardware status changed to DISABLED
[  185.908545] ADDRCONF(NETDEV_UP): wlan0: link is not ready
[  186.052881] eth0: link down
[  186.053160] ADDRCONF(NETDEV_UP): eth0: link is not ready
[  979.536353] fujitsu-laptop: driver 0.3 successfully loaded.
[  979.536388] fujitsu-laptop: Radio turned ON
[  980.000126] b43-phy0: Radio hardware status changed to ENABLED
[ 1018.120053] b43-phy0: Radio turned on by software
[ 1060.388290] wlan0: Initial auth_alg=0
[ 1060.388304] wlan0: authenticate with AP 00:23:69:85:ad:c5
[ 1060.389874] wlan0: RX authentication from 00:23:69:85:ad:c5 (alg=0 transaction=2 status=0)
[ 1060.389882] wlan0: authenticated
[ 1060.389889] wlan0: associate with AP 00:23:69:85:ad:c5
[ 1060.392525] wlan0: RX AssocResp from 00:23:69:85:ad:c5 (capab=0x431 status=0 aid=3)
[ 1060.392532] wlan0: associated
[ 1060.392553] wlan0: switched to short barker preamble (BSSID=00:23:69:85:ad:c5)
[ 1060.393184] ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[ 1077.488037] wlan0: no IPv6 routers present
[ 2306.248022] APIC error on CPU0: 00(40)

** Model information
not available

** Loaded modules:
Module                  Size  Used by
fujitsu_laptop          5132  0 
rfkill_input            3520  0 
ipv6                  235396  10 
ppdev                   6468  0 
parport_pc             22500  0 
lp                      8164  0 
parport                31084  3 ppdev,parport_pc,lp
powernow_k8            12036  0 
cpufreq_userspace       3172  0 
cpufreq_ondemand        6476  0 
cpufreq_conservative     5960  0 
cpufreq_powersave       1856  1 
cpufreq_stats           3776  0 
freq_table              4224  3 powernow_k8,cpufreq_ondemand,cpufreq_stats
fuse                   42908  3 
sbp2                   18572  0 
loop                   12748  0 
arc4                    1824  2 
ecb                     2624  2 
crypto_blkcipher       15236  1 ecb
b43                   110716  0 
rfkill                  5652  3 rfkill_input,b43
rng_core                3940  1 b43
mac80211              139808  1 b43
cfg80211               21608  1 mac80211
led_class               3908  1 b43
input_polldev           3752  1 b43
joydev                  8480  0 
usbhid                 35872  0 
hid                    33184  1 usbhid
ff_memless              4392  1 usbhid
ssb                    33476  1 b43
pcmcia                 29548  2 b43,ssb
8139too                20384  0 
pcmcia_core            31892  3 b43,ssb,pcmcia
ohci1394               24976  0 
mii                     4896  1 8139too
firmware_class          6816  2 b43,pcmcia
ieee1394               75832  2 sbp2,ohci1394
serio_raw               4740  0 
psmouse                32336  0 
pcspkr                  2432  0 
k8temp                  4064  0 
bay                     4160  0 
snd_hda_intel         325720  1 
battery                10180  0 
snd_pcm                62660  1 snd_hda_intel
snd_seq                41456  0 
snd_timer              17800  2 snd_pcm,snd_seq
snd_seq_device          6380  1 snd_seq
ac                      4196  0 
snd                    45636  7 snd_hda_intel,snd_pcm,snd_seq,snd_timer,snd_seq_device
button                  6096  0 
ide_cd_mod             27684  0 
cdrom                  30176  1 ide_cd_mod
ehci_hcd               28428  0 
soundcore               6368  1 snd
snd_page_alloc          7816  2 snd_hda_intel,snd_pcm
ohci_hcd               18500  0 
i2c_piix4               7216  0 
usbcore               118224  4 usbhid,ehci_hcd,ohci_hcd
i2c_core               19828  1 i2c_piix4
shpchp                 25528  0 
pci_hotplug            23460  1 shpchp
ati_agp                 6220  0 
agpgart                28840  1 ati_agp
evdev                   8000  6 
thermal                15228  0 
processor              32576  3 powernow_k8,thermal
fan                     4196  0 
thermal_sys            10856  3 thermal,processor,fan
atiixp                  3396  0 [permanent]
sd_mod                 22200  0 
ata_generic             4676  0 
libata                140448  1 ata_generic
scsi_mod              129548  3 sbp2,sd_mod,libata
dock                    8304  2 bay,libata
ide_pci_generic         3908  0 [permanent]
ide_disk               10496  4 
ide_core               96168  4 ide_cd_mod,atiixp,ide_pci_generic,ide_disk
ext3                  105576  1 
jbd                    39476  1 ext3
mbcache                 7108  1 ext3


08:0a.0 Network controller [0280]: Broadcom Corporation BCM4318 [AirForce One 54g] 802.11g Wireless LAN Controller [14e4:4318] (rev 02)
	Subsystem: Device [17f9:0006]
	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 64
	Interrupt: pin A routed to IRQ 19
	Region 0: Memory at d0200000 (32-bit, non-prefetchable) [size=8K]
	Kernel driver in use: b43-pci-bridge
	Kernel modules: ssb


Debian Release: 5.0.8
  APT prefers oldstable
  APT policy: (500, 'oldstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-2-686 (SMP w/1 CPU core)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages linux-image-2.6.26-2-686 depends on:
ii  debconf [debconf-2.0]         1.5.24     Debian configuration management sy
ii  initramfs-tools [linux-initra 0.92o      tools for generating an initramfs
ii  module-init-tools             3.4-1      tools for managing Linux kernel mo

Versions of packages linux-image-2.6.26-2-686 recommends:
ii  libc6-i686                  2.7-18lenny7 GNU C Library: Shared libraries [i

Versions of packages linux-image-2.6.26-2-686 suggests:
ii  grub                       0.97-47lenny2 GRand Unified Bootloader (Legacy v
pn  linux-doc-2.6.26           <none>        (no description available)

Versions of packages linux-image-2.6.26-2-686 is related to:
pn  firmware-bnx2                 <none>     (no description available)
pn  firmware-bnx2x                <none>     (no description available)
pn  firmware-ipw2x00              <none>     (no description available)
pn  firmware-ivtv                 <none>     (no description available)
pn  firmware-iwlwifi              <none>     (no description available)
pn  firmware-linux                <none>     (no description available)
pn  firmware-linux-nonfree        <none>     (no description available)
pn  firmware-qlogic               <none>     (no description available)
pn  firmware-ralink               <none>     (no description available)

-- debconf information:
  linux-image-2.6.26-2-686/postinst/bootloader-error-2.6.26-2-686:
  shared/kernel-image/really-run-bootloader: true
  linux-image-2.6.26-2-686/postinst/old-dir-initrd-link-2.6.26-2-686: true
  linux-image-2.6.26-2-686/preinst/overwriting-modules-2.6.26-2-686: true
  linux-image-2.6.26-2-686/postinst/bootloader-test-error-2.6.26-2-686:
  linux-image-2.6.26-2-686/postinst/depmod-error-2.6.26-2-686: false
  linux-image-2.6.26-2-686/preinst/bootloader-initrd-2.6.26-2-686: true
  linux-image-2.6.26-2-686/preinst/abort-overwrite-2.6.26-2-686:
  linux-image-2.6.26-2-686/preinst/abort-install-2.6.26-2-686:
  linux-image-2.6.26-2-686/postinst/depmod-error-initrd-2.6.26-2-686: false
  linux-image-2.6.26-2-686/postinst/create-kimage-link-2.6.26-2-686: true
  linux-image-2.6.26-2-686/preinst/failed-to-move-modules-2.6.26-2-686:
  linux-image-2.6.26-2-686/preinst/initrd-2.6.26-2-686:
  linux-image-2.6.26-2-686/preinst/lilo-has-ramdisk:
  linux-image-2.6.26-2-686/prerm/would-invalidate-boot-loader-2.6.26-2-686: true
  linux-image-2.6.26-2-686/postinst/kimage-is-a-directory:
  linux-image-2.6.26-2-686/postinst/old-initrd-link-2.6.26-2-686: true
  linux-image-2.6.26-2-686/preinst/elilo-initrd-2.6.26-2-686: true
  linux-image-2.6.26-2-686/preinst/lilo-initrd-2.6.26-2-686: true
  linux-image-2.6.26-2-686/prerm/removing-running-kernel-2.6.26-2-686: true
  linux-image-2.6.26-2-686/postinst/old-system-map-link-2.6.26-2-686: true
53d52
< #include <asm/io.h>
63,70d61
< #define KBD_COMMAND_PORT	0x64
< #define KBD_DATA_PORT		0x60
< #define WIFI_COMMAND		0xC5
< #define WIFI_ON			0x25
< #define WIFI_OFF		0x45
< #define AMILOA1655G_RADIO_OFF	0
< #define AMILOA1655G_RADIO_ON	1
< #define DRV_NAME		"fujitsu-laptop"
263,386d253
< static int radio = 1;
< 
< static int amiloa1655g_radio_status = AMILOA1655G_RADIO_OFF;
<  
< unsigned char amiloa1655g_get_radio(void) {
<    return amiloa1655g_radio_status;
<  }
<  
< static void amiloa1655g_set_radio(int state_set) {
<    unsigned char val = 0;
<  
<    if (amiloa1655g_radio_status != state_set) { 
<      if (state_set == AMILOA1655G_RADIO_ON) { 
<        do { val = inb(KBD_COMMAND_PORT); } while ((val & 2) == 2);
<        outb(WIFI_COMMAND, KBD_COMMAND_PORT);
<        do { val = inb(KBD_COMMAND_PORT); } while ((val & 2) == 2);
<        outb(WIFI_ON, KBD_DATA_PORT);
<        amiloa1655g_radio_status = AMILOA1655G_RADIO_ON;
<        printk(KERN_INFO DRV_NAME ": Radio turned ON\n");
<      } else {
<        do { val = inb(KBD_COMMAND_PORT); } while ((val & 2) == 2);
<        outb(WIFI_COMMAND, KBD_COMMAND_PORT);
<        do { val = inb(KBD_COMMAND_PORT); } while ((val & 2) == 2);
<        outb(WIFI_OFF, KBD_DATA_PORT);
<        amiloa1655g_radio_status = AMILOA1655G_RADIO_OFF;
<        printk(KERN_INFO DRV_NAME ": Radio turned OFF\n");
<      }
<    }
<  }
<  
<  
<  /*
<   * Proc Stuff
<   */
<  static struct proc_dir_entry *dir_base = NULL;
<  
<  static int proc_set_radio(struct file *file, const char *buffer, 
<  			  unsigned long count, void *data)
<  {
<  	amiloa1655g_set_radio(buffer[0] == '0' ? AMILOA1655G_RADIO_OFF : AMILOA1655G_RADIO_ON);
<  	
<  	return count;
<  }
<  
<  static int proc_get_radio(char *page, char **start, off_t offset,
<  			  int count, int *eof, void *data)
<  {
<  	int len = 0;
<  	
<  	len += snprintf(page, count, DRV_NAME ": %d\n", 
<  			amiloa1655g_radio_status == AMILOA1655G_RADIO_OFF ? 0 : 1);
<  	
<  	*eof = 1;
<  	return len;
<  }
<  
<  
<  static void amiloa1655g_proc_cleanup(void)
<  {
<  	if (dir_base) {
<  		remove_proc_entry("radio", dir_base);
<  		remove_proc_entry(DRV_NAME, NULL);
<  		dir_base = NULL;
<  	}
<  }
<  
<  
<  static int amiloa1655g_proc_init(void)
<  {
<  	struct proc_dir_entry *ent;
<  	int err = 0;
<  
<  	dir_base = create_proc_entry(DRV_NAME, S_IFDIR, NULL);
<  	if (dir_base == NULL) {
<  		printk(KERN_ERR DRV_NAME ": Unable to initialise /proc/" 
<  		       DRV_NAME "\n");
<  		err = -ENOMEM;
<  		goto fail;
<  	}
<  
<  
<  	ent = create_proc_entry("radio", S_IFREG | S_IRUGO | S_IWUSR, 
<  				dir_base);
<  	if (ent) {
<  		ent->read_proc = proc_get_radio;
<  		ent->write_proc = proc_set_radio;
<  	} else {
<  		printk(KERN_ERR
<  		       "Unable to initialize /proc/" DRV_NAME "/radio\n");
<  		err = -ENOMEM;
<  		goto fail;
<  	}
<  
<  	return 0;
<  
<   fail:
<  	amiloa1655g_proc_cleanup();
<  	return err;
<  }
<  
<  /*
<   * module stuff
<   */
< static int amiloa1655g_init(void)
<  {
<  	amiloa1655g_proc_init();
<  
<  	amiloa1655g_set_radio((radio == 1) ? AMILOA1655G_RADIO_ON : AMILOA1655G_RADIO_OFF);
<  	
<  	return 0;
<  }
<  
<  static void amiloa1655g_exit(void)
<  {
<  	amiloa1655g_set_radio(AMILOA1655G_RADIO_OFF);
<  
<  	amiloa1655g_proc_cleanup();
<  }
<  
< 
<  
<  module_param(radio, int, 1);
<  MODULE_PARM_DESC(radio, "Controls state of radio when the module is loaded (1=on, 0=off)");
< 
388d254
< static int __init fujitsu_init(void) {
390c256,259
< int ret, result;
---
> static int __init fujitsu_init(void)
> {
> 	int ret, result;
> 
392c261,262
< 	return -ENODEV;
---
> 		return -ENODEV;
> 
438,439d307
< 	amiloa1655g_init();
< 
476c344
< 	amiloa1655g_exit();
---
> 

Reply to: