summaryrefslogtreecommitdiffstats
path: root/perl-install/printer.pm
diff options
context:
space:
mode:
authorTill Kamppeter <tkamppeter@mandriva.com>2002-03-26 15:16:17 +0000
committerTill Kamppeter <tkamppeter@mandriva.com>2002-03-26 15:16:17 +0000
commit7dbc6f56bb79b7b1ba0d4ec60469d39f1fbeff8f (patch)
tree5395eb581a513bfd25bbc1986fbdbafa8e3d4cdc /perl-install/printer.pm
parentd42128dda9ce3f6148ab7b08458161584db65af8 (diff)
downloaddrakx-7dbc6f56bb79b7b1ba0d4ec60469d39f1fbeff8f.tar
drakx-7dbc6f56bb79b7b1ba0d4ec60469d39f1fbeff8f.tar.gz
drakx-7dbc6f56bb79b7b1ba0d4ec60469d39f1fbeff8f.tar.bz2
drakx-7dbc6f56bb79b7b1ba0d4ec60469d39f1fbeff8f.tar.xz
drakx-7dbc6f56bb79b7b1ba0d4ec60469d39f1fbeff8f.zip
Fixed several problems related to HP multi-function devices:
- Parallel multi-function devices worked only on the first (onboard) parallel port. - HP LaserJet 2200 needs HPOJ for printing via USB. - For the HP OfficeJet D series the scanning instructions were not shown. - HPOJ does not work with HP PhotoSmart 10xx, 11xx, and 12xx.
Diffstat (limited to 'perl-install/printer.pm')
-rw-r--r--perl-install/printer.pm33
1 files changed, 22 insertions, 11 deletions
diff --git a/perl-install/printer.pm b/perl-install/printer.pm
index 64cfdcfa4..6d7a9302a 100644
--- a/perl-install/printer.pm
+++ b/perl-install/printer.pm
@@ -1464,14 +1464,16 @@ sub configure_hpoj {
# Check if the device is really an HP multi-function device
stop_service("hpoj");
my $bus;
+ my $address_arg = "";
if ($device =~ /usb/) {
$bus = "usb";
} else {
$bus = "par";
+ $address_arg = parport_addr($device);
}
run_program::rooted($prefix,
"ptal-mlcd", "$bus:probe", "-device",
- "$device");
+ "$device", split(' ',$address_arg));
$device_ok = 0;
local *F;
if (open F, ($::testing ? "$prefix" : "chroot $prefix/ ") . "/usr/bin/ptal-devid mlc:$bus:probe |") {
@@ -1564,16 +1566,7 @@ sub configure_hpoj {
# auto-detect the parallel port addresses
$device =~ m!^/dev/lp(\d+)$!;
my $portnumber = $1;
- my $parport_addresses =
- `cat /proc/sys/dev/parport/parport$portnumber/base-addr`;
- my $address_arg;
- if ($parport_addresses =~ /^\s*(\d+)\s+(\d+)\s*$/) {
- $address_arg = sprintf(" -base 0x%x -basehigh 0x%x", $1, $2);
- } elsif ($parport_addresses =~ /^\s*(\d+)\s*$/) {
- $address_arg = sprintf(" -base 0x%x", $1);
- } else {
- $address_arg = "";
- }
+ my $address_arg = parport_addr($device);
$entry = "\nptal-mlcd par:$portnumber -device $device$address_arg \$PTAL_MLCD_CMDLINE_APPEND\nptal-printd mlc:par:$portnumber \$PTAL_PRINTD_CMDLINE_APPEND\n";
$ptaldevice = "mlc:par:$portnumber";
}
@@ -1589,6 +1582,24 @@ sub configure_hpoj {
return $ptaldevice;
}
+sub parport_addr{
+ # auto-detect the parallel port addresses
+ my ($device) = @_;
+ $device =~ m!^/dev/lp(\d+)$!;
+ my $portnumber = $1;
+ my $parport_addresses =
+ `cat /proc/sys/dev/parport/parport$portnumber/base-addr`;
+ my $address_arg;
+ if ($parport_addresses =~ /^\s*(\d+)\s+(\d+)\s*$/) {
+ $address_arg = sprintf(" -base 0x%x -basehigh 0x%x", $1, $2);
+ } elsif ($parport_addresses =~ /^\s*(\d+)\s*$/) {
+ $address_arg = sprintf(" -base 0x%x", $1);
+ } else {
+ $address_arg = "";
+ }
+ return $address_arg;
+}
+
sub config_sane {
my ($ptaldevice) = @_;