summaryrefslogtreecommitdiffstats
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
parentd42128dda9ce3f6148ab7b08458161584db65af8 (diff)
downloaddrakx-backup-do-not-use-7dbc6f56bb79b7b1ba0d4ec60469d39f1fbeff8f.tar
drakx-backup-do-not-use-7dbc6f56bb79b7b1ba0d4ec60469d39f1fbeff8f.tar.gz
drakx-backup-do-not-use-7dbc6f56bb79b7b1ba0d4ec60469d39f1fbeff8f.tar.bz2
drakx-backup-do-not-use-7dbc6f56bb79b7b1ba0d4ec60469d39f1fbeff8f.tar.xz
drakx-backup-do-not-use-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.
-rw-r--r--perl-install/printer.pm33
-rw-r--r--perl-install/printerdrake.pm11
2 files changed, 29 insertions, 15 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) = @_;
diff --git a/perl-install/printerdrake.pm b/perl-install/printerdrake.pm
index 41ec27a31..0e3042c2e 100644
--- a/perl-install/printerdrake.pm
+++ b/perl-install/printerdrake.pm
@@ -464,14 +464,16 @@ _(" (Parallel Ports: /dev/lp0, /dev/lp1, ..., equivalent to LPT1:, LPT2:, ..., 1
if (!$do_auto_detect) {
local $::isWizard = 0;
$isHPOJ = $in->ask_yesorno(_("Local Printer"),
- _("Is your printer a multi-function device from HP (OfficeJet, PSC, PhotoSmart, LaserJet 1100/1200/1220/3200/3300 with scanner)?"), 0);
+ _("Is your printer a multi-function device from HP (OfficeJet, PSC, LaserJet 1100/1200/1220/3200/3300 with scanner), an HP PhotoSmart P100 or 1315 or an HP LaserJet 2200?"), 0);
}
if (($menuchoice =~ /HP\s+OfficeJet/i) ||
($menuchoice =~ /HP\s+PSC/i) ||
- ($menuchoice =~ /HP\s+PhotoSmart/i) ||
+ ($menuchoice =~ /HP\s+PhotoSmart\s+P?\s*100\D/i) ||
+ ($menuchoice =~ /HP\s+PhotoSmart\s+P?\s*1315/i) ||
($menuchoice =~ /HP\s+LaserJet\s+1100/i) ||
($menuchoice =~ /HP\s+LaserJet\s+1200/i) ||
($menuchoice =~ /HP\s+LaserJet\s+1220/i) ||
+ ($menuchoice =~ /HP\s+LaserJet\s+2200/i) ||
($menuchoice =~ /HP\s+LaserJet\s+3200/i) ||
($menuchoice =~ /HP\s+LaserJet\s+33.0/i) ||
($isHPOJ)) {
@@ -1760,14 +1762,15 @@ sub scanner_help {
my ($makemodel, $deviceuri) = @_;
if ($deviceuri =~ m!^ptal:/(.*)$!) {
my $ptaldevice = $1;
- if (($makemodel =~ /HP\s+OfficeJet\s+[KVRGP]/i) ||
+ if (($makemodel =~ /HP\s+OfficeJet\s+[KVRGPD]/i) ||
($makemodel =~ /HP\s+PSC\s+[579]/i)) {
# SANE-driven models
return _("Your HP multi-function device was configured automatically to be able to scan. Now you can scan with \"scanimage\" (\"scanimage -d hp:%s\" to specify the scanner when you have more than one) from the command line or with the graphical interfaces \"xscanimage\" or \"xsane\". If you are using the GIMP, you can also scan by choosing the appropriate point in the \"File\"/\"Acquire\" menu. Call also \"man scanimage\" and \"man sane-hp\" on the command line to get more information.
Do not use \"scannerdrake\" for this device!",
$ptaldevice);
- } elsif ($makemodel !~ /HP\s+PhotoSmart/i) {
+ } elsif (($makemodel !~ /HP\s+PhotoSmart/i) &&
+ ($makemodel !~ /HP\s+LaserJet\s+2200/i)) {
# "ptal-hp"-driven models
return _("Your HP multi-function device was configured automatically to be able to scan. Now you can scan from the command line with \"ptal-hp %s scan ...\". Scanning via a graphical interface or from the GIMP is not supported yet for your device. More information you will find in the \"/usr/share/doc/hpoj-0.8/ptal-hp-scan.html\" file on your system. If you have an HP LaserJet 1100 or 1200 you can only scan when you have the scanner option installed.