Newsgroup: it.comp.os.linux.iniziare
Titolo: Modem che ... è strano!

Ho un rockwell interrno sofk56
Linux non lo riconosce nel settaggio
ho anche provato con il driver del modem per linux ma non lo riconosce
Quando vado sulle info PCI di KDE (linux 7.1) mi vede il modem su DEVICE 10
irq 11!!!
Non c'č un modo per dire a linux che il modem si trova li??
Di andare a cercare sul DEVICE 10 irq 11 della PCI???

Di andare a cercare sul DEVICE 10 irq 11 della PCI???
Guarda il mio post su questo newsgroup avente come oggetto:
Conexant SoftK56 modem (Winmodem).
Ciao
Prince258
P.S. Fammi sapere il risultato dell' installazione.
_________________________________________________________________
Scarica GRATUITAMENTE MSN Explorer all'indirizzo 
http://explorer.msn.it/intl.asp
-- 
Posted from [195.223.246.36] by way of 
f93.law11.hotmail.com
 [64.4.17.93] 
via Mailgate.ORG Server - 
http://www.Mailgate.ORG

> P.S. Fammi sapere il risultato dell' installazione.
Nulla!
Quando lancio il file ho modem softk56 non trovato su PCI
Ho provato ad editare il file 
hsf_linstall.pl
 e c'è qualcosa che non mi
convince, ma credo solo a me, comunque il sorgente e questo:
Se conoscete il Perl (io lo conosco poco) ditemi ste sto sbagliando..a me
sembra strano. In italiano ci sono i miei commenti dove non mi sono chiare
delle cose
#!/usr/bin/perl
#---------------------------------------------------------------------------
--------------
#
# Copyright (c) 2000 Conexant Systems
#
# NAME
#     hsf_install          # Questo file non c'è nel pacchetto di
installazione!
#
#
# SYNOPSIS
#     hsf_install [<-c CountryName>] [<release-dir>]
#
# DESCRIPTION
#     The Program handles on finding the modem PCI-ID on the PCI file and
Installing It
#     By the configuration of the Inf File.
#
# EXAMPLE
#
#    :> hsf_install /root/modems56k
#
# AUTHOR
#     Conexant Systems
#
# VERSION
#     V2.0
#
#---------------------------------------------------------------------------
--------------
    # Initializations
$VERSION         = 'V2.0';
$PciFile         = '/proc/pci';
$InstallFilesExt = '\.inf';
%PciIds      = ();
$VendorID    = '';
$DeviceID    = '';
$InfFile     = '';
$debug       = 0 ;    #Questa variabile è strana, non capisco a che serve
$CountryFlag  = "-c";
%CountryCodes = (
    'USA'           => 0x00B5,
    'AUSTRIA'       => 0x000A,
    'BELGIUM'       => 0x000F,
    'CANADA'        => 0x0020,
    'CHINA'         => 0x0026,
    'Czech'         => 0x002E,
    'DENMARK'       => 0x0031,
    'FINLAND'       => 0x003C,
    'FRANCE'        => 0x003D,
    'GERMANY'       => 0x0042,
    'GREECE'        => 0x0046,
    'HONG-KONG'     => 0x0050,
    'HUNGARY'       => 0x0051,
    'ICELAND'       => 0x0052,
    'INDIA'         => 0x0053,
    'INDONESIA'     => 0x0054,
    'IRELAND'       => 0x0057,
    'ISRAEL'        => 0x0058,
    'ITALY'         => 0x0059,
    'JAPAN'         => 0x0000,
    'KOREA'         => 0x0061,
    'LUXEMBOURG'    => 0x0069,
    'MALAYSIA'      => 0x006C,
    'MEXICO'        => 0x0073,
    'NETHERLAND'    => 0x007B,
    'NEW ZEALAND'   => 0x007E,
    'NORWAY'        => 0x0082,
    'PHILIPPINES'   => 0x0089,
    'PORTUGAL'      => 0x008B,
    'SINGAPORE'     => 0x009C,
    'SOUTH AFRICA'  => 0x009F,
    'SPAIN'         => 0x00A0,
    'SWEDEN'        => 0x00A5,
    'SWITZERLAND'   => 0x00A6,
    'TAIWAN'        => 0x00FE,
    'THAILAND'      => 0x00A9,
    'UK'            => 0x00B4,
    'AUSTRALIA'     => 0x0009,
);
    # Canonize script name
($ScriptName = $0) =~ s,.*[\/\\],,;
    # Should have no more than 3 argument
Usage('') if @ARGV > 3;
    # Read the Arguments (InstallDir,Country)
if (@ARGV == 1)
{
 $InstallDir = shift;
 if ($InstallDir eq $CountryFlag)
  Usage("$ScriptName: option $CountryFlag requires Country Name\n");
 }
}
elsif  ((@ARGV == 2) || (@ARGV == 3))
{
 $temp_arg = shift;
 if ($temp_arg eq $CountryFlag)
  $CurrCountry = uc shift;
 }
 else
 {
  Usage("$ScriptName: invalid option '$temp_arg'\n");
 }
 if  (@ARGV == 1) { $InstallDir = shift; }
}
    # Check arguments validity
$InstallDir = '.' unless defined $InstallDir;
Usage("$ScriptName: Specified parameter '$InstallDir' is not a directory\n")
    unless -d $InstallDir;
if (defined $CurrCountry)
{
 Usage("$ScriptName: Specified country '$CurrCountry' is not supported\n")
  unless exists $CountryCodes{ $CurrCountry };
}
    # Find out SoftK56 PCI modem
open (PCI, "$PciFile") or
 Error("Can't open '$PciFile' file : $!\n");
while (<PCI>)
{
        # Example: Vendor id=14f1. Device id=2015.
 next unless
/^\s*Vendor\s*id\s*=\s*([a-f0-9]{1,4}).+Device\s*id\s*=\s*([a-f0-9]{1,4}).*$
/io;
 $PciIds{uc $1} = uc $2;
    # push(@VendorID, uc $1);
 # push(@DeviceID, uc $2);
}
close(PCI);
if ($debug) #HO PROVATO A DARE DIVERSI VALORI A $debug, MA NEL CICLO FOR NON
ENTRA
{
    for (keys %PciIds)  #IN QUESTO CICLO NON CI ENTRA PROPRIO
    {
        printf "VendorID: %4s, DeviceID: %4s\n", $_, $PciIds{$_};
    }
}
Error("No SoftK56 modem PCI card found") unless %PciIds;   #QUI SI FERMA
opendir(DIR, "$InstallDir") or
 Error("Can't open '$InstallDir' directory : $!\n");
@InfFiles = grep(/$InstallFilesExt$/io, readdir(DIR));
close(DIR);
print "Found INF files: @InfFiles\n" if $debug;
chdir $InstallDir or
    Error("Can't chdir to '$InstallDir' directory : !$\n");
SEARCH_INF_FILES:
for my $file (@InfFiles)
{
 open (INSTALLFILE, "$file") or
  Warning("Can't open '$file' file : $!\n"), next;
 while (<INSTALLFILE>)
 {
            # Example; PCI\VEN_14F1&DEV_2016&SUBSYS_201614F1
  next unless
/^.*PCI\\VEN_([a-f0-9]+)&DEV_([a-f0-9]+)(&SUBSYS_[a-f0-9]{8})?/io;
  for my $vendor (keys %PciIds)
  {
            if ($vendor eq uc $1 and $PciIds{$vendor} eq uc $2)
            {
    $InfFile  = $file;
    $VendorID = $vendor;
    $DeviceID = $PciIds{$vendor};
    print "Matching INF file is '$InfFile'\n" if $debug;
    close(INSTALLFILE);
    last SEARCH_INF_FILES;
   }
  }
 }
 close(INSTALLFILE);
}
Error("No matching INF file is found for SoftK56 PCI device\n") unless
$InfFile;
if (defined $CurrCountry)
{
    if ( 0 == SearchCurrentCountry())
 {
      # The Inf File does not support the Current Country
  Error ("The installation '$InfFile' file does not support $CurrCountry
country\n");
 }
 ChangeCurrentCountry();
}
InstallModem($InfFile, $VendorID, $DeviceID);
sub ChangeCurrentCountry
{
 my $line = '';
 my $newUpdateInf = $InfFile . '.temp_update';
 my $rc;
 open(ORGINF, $InfFile) or
  Error("Can't open '$InfFile' file : $!\n");
 if ( 0 == open(UPDATE_INF, ">$newUpdateInf"))
 {
  close (ORGINF);
  Error("Can't open temp file : $newUpdateInf $!\n");
 }
     # System command failed
 $rc = system("chmod 777 $newUpdateInf");
 if (0 != $rc)
 {
  close (ORGINF);
  close (UPDATE_INF);
  unlink ($newUpdateInf);
  Error ("Can't chmod new created file (system command) : $!\n");
 }
  COPY_INF_FILE:
 while (! eof(ORGINF))
 {
  $line .= <ORGINF>;
      # Check if we got the Current Country line
  if ($line =~  m/^\s*HKR\s*,\s*COUNTRY,\s*CURRENT\s*,/io)
  {
   while ($line =~ /\\$/o)    # Is this a continuation line?
   {
    $line =~ s/\s*$//o;    # Remove trailing whitespaces
    chop $line;            # Remove \
    $line .= <ORGINF>;
   }
   $line =~ s/([0-9a-f]{2})\s*,\s*([0-9a-f]{2})$//io;
   chop $line if $line =~ /\n$/io;      # Remove \n
   printf UPDATE_INF  "%s" ,$line;
   printf UPDATE_INF  "%02X"    , 0x00FF & $CountryCodes{ $CurrCountry };
   printf UPDATE_INF  ",%02X\n" , 0xFF00 & $CountryCodes{ $CurrCountry };
  }
  else
  {
   printf UPDATE_INF "%s" ,$line;
  }
  $line = '';
 }
        # Replace the Inf file to the Updated Inf file
 close ( ORGINF );
 close ( UPDATE_INF );
 if (0 == (rename $InfFile , "temp_file.tmp" )) # Rename failed
 {
  unlink $newUpdateInf;
  Error ("Can't rename $InfFile : $!\n");
 }
 if (0 == (rename $newUpdateInf , $InfFile))    # Rename failed
 {
  rename "temp_file.tmp" , $InfFile;
  unlink  $newUpdateInf;
  Error ("Can't rename '$newUpdateInf' (may be file was damaged): $!\n");
 }
 if (0 == (unlink "temp_file.tmp"))
 {
  Warning ("Can't delete temp file temp_file.tmp: $!\n");
 }
}
    # Function Searches for the required Country in the Inf File.
sub SearchCurrentCountry
{
 my $line = '';
 open(ORGINF, $InfFile) or
  Error("Can't open '$InfFile' file : $!\n");
  SEARCH_COUNTRY:
 while (! eof(ORGINF))
 {
  $line .= <ORGINF>;
  $line =~ s/\s*$//o;        # Remove trailing whitespaces
  if ($line =~ /\\$/o)       # Is this a continuation line?
  {
   chop $line;            # Remove \
   $line =~ s/\s*$//o;    # Remove possible whilespaces before \
   redo SEARCH_COUNTRY;    # Continue...
  }
  else
  {
   if (($line =~  m/^\s*HKR\s*,\s*COUNTRY\\([a-f0-9]{1,4}),\s*NAME\s*,/io)
    &&($line =~  m/,\s*\"$CurrCountry\"\s*/io))
    # Country is supported in the Inf File
    return 1;
   }
      $line = '';
  }
 }
 close(ORGINF);
 return 0; # Country is not supported in the Inf File
}
sub InstallModem
{
 my ($installFile, $vendor, $device) = @_;
 ProcessInfFile($installFile, $vendor, $device);
 return 1;
}
sub ProcessInfFile
{
 my ($infFile, $vendor, $device) = @_;
 my $updatedInfFile = $infFile . '.tmp';
 my $line = '';
 my $infParseApp = 'inf2bin';
 open(ORGINF, $infFile) or
  Error("Can't open '$infFile' file : $!\n");
    open(NEWINF, ">$updatedInfFile") or
  Error("Can't open '$updatedInfFile' file: $!\n");
 print NEWINF "HKR,ID,VENDOR,,\"$vendor\"\n";
 print NEWINF "HKR,ID,DEVICE,,\"$device\"\n";
  READ_INF_FILE:
 while (! eof(ORGINF))
 {
  $line .= <ORGINF>;
  $line =~ s/;.*$//o;        # Remove possible comments
  $line =~ s/\s*$//o;        # Remove trailing whitespaces
        $line =~ s/^\s*//o;        # Remove initial whitespaces
        next if $line =~ /^\s*$/o; # Ignore empty lines
        $line =~ s/\s*,\s*/,/go;   # Remove all spaces around commas
  if ($line =~ /\\$/o)       # Is this a continuation line?
  {
   chop $line;            # Remove \
   $line =~ s/\s*$//o;    # Remove possible whilespaces before \
   redo READ_INF_FILE;    # Continue...
  }
  else
  {
            # Ignore non registry entries
            $line = '', next unless $line =~ /^HKR,/io;
   print NEWINF "$line\n";
   $line = '';
  }
 }
 close(ORGINF);
 close(NEWINF);
 my $command = "./$infParseApp $updatedInfFile /root/test.dat >&
hsf_install.log";
 print "$command\n" if $debug;
    $inf2bin_ret = system($command);
 if  ($inf2bin_ret)
 {
  unlink($updatedInfFile);
  Error("./$infParseApp failed (returned $inf2bin_ret).\n");
 }
 unlink($updatedInfFile) or
        Warning("Can't remove '$updatedInfFile' file: $!\n");
}
    # Error sub routine including printing the Usage - logical problem
sub Usage {
    my $message = shift;
    print "$message" if $message;
    print "Usage: $ScriptName [-c <country-name>] [<release-dir>]\n";
    exit 1;
}
    # Error sub routine
sub Error {
    my $message = shift;
    print "$ScriptName (error): $message\n";
    exit  2;
}
    # Warning sub routine
sub Warning {
    my $message = shift;
    print "$ScriptName (warning) $message\n";
}

 l'elenco alla pagina 
www.linmodems.org
bye bye
--
Valerio "Tqqc-valted" Tedeschi - ICQ UIN: 338514 ICQ UIN: 535589  (Licq)
 
http://web.tiscalinet.it/talved/
"...In Linux non si fa clic e non si trascina, il che è una vera fortuna se
appartenete al consistente gruppo di
persone che non è molto brava a spostare minuscoli oggetti grafici fino a
sovrapporli a minuscole icone...!!!"
                      elimina "NOSPAM" per rispondere