diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2002-07-30 19:42:33 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2002-07-30 19:42:33 +0000 |
commit | d498565fa66347fe9f65d28864ee002b4c8ef5f2 (patch) | |
tree | f8ad99a1cda11d228735b668ad3b61beb8e2633a /perl-install/detect_devices.pm | |
parent | 755319c9db0feabeeba27d0e007388652e423394 (diff) | |
download | drakx-d498565fa66347fe9f65d28864ee002b4c8ef5f2.tar drakx-d498565fa66347fe9f65d28864ee002b4c8ef5f2.tar.gz drakx-d498565fa66347fe9f65d28864ee002b4c8ef5f2.tar.bz2 drakx-d498565fa66347fe9f65d28864ee002b4c8ef5f2.tar.xz drakx-d498565fa66347fe9f65d28864ee002b4c8ef5f2.zip |
use usb keyboard bCountryCode to choose the right keyboard
Diffstat (limited to 'perl-install/detect_devices.pm')
-rw-r--r-- | perl-install/detect_devices.pm | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm index 7ffd92252..a80fb29c9 100644 --- a/perl-install/detect_devices.pm +++ b/perl-install/detect_devices.pm @@ -348,11 +348,11 @@ sub pci_probe { } sub usb_probe { - -e "/proc/bus/usb/devices" or return (); + -e "/proc/bus/usb/devices" or return; add_addons($usbtable_addons, map { my %l; - @l{qw(vendor id media_type driver description)} = split "\t"; + @l{qw(vendor id media_type driver description pci_bus pci_device)} = split "\t"; $l{$_} = hex $l{$_} foreach qw(vendor id); $l{bus} = 'USB'; \%l @@ -490,6 +490,16 @@ sub usbWacom { grep { $_->{driver} =~ /Tablet:wacom/ } usb_probe() } sub usbKeyboards { grep { $_->{media_type} =~ /\|Keyboard/ } usb_probe() } sub usbStorage { grep { $_->{media_type} =~ /Mass Storage\|/ } usb_probe() } +sub usbKeyboard2country_code { + my ($usb_kbd) = @_; + local *F; + my $tmp; + sysopen(F, sprintf("/proc/bus/usb/%03d/%03d", $usb_kbd->{pci_bus}, $usb_kbd->{pci_device}), 0) and + sysseek F, 0x28, 0 and + sysread F, $tmp, 1 and + unpack("C", $tmp); +} + sub whatUsbport() { # The printer manufacturer and model names obtained with the usb_probe() # function were very messy, once there was a lot of noise around the |