~ubuntu-branches/ubuntu/wily/hwinfo/wily

« back to all changes in this revision

Viewing changes to src/ids/get_pcmcia

  • Committer: Bazaar Package Importer
  • Author(s): James Vega
  • Date: 2006-11-03 07:28:15 UTC
  • mfrom: (1.2.1 upstream) (3.1.7 edgy)
  • Revision ID: james.westby@ubuntu.com-20061103072815-7g9d6kzk0xn54159
Add cpu.c-alpha_bogo patch, which fixes a FTBFS on alpha because of an
undefined variable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /usr/bin/perl
 
2
 
 
3
#
 
4
# read /etc/pcmcia/config file
 
5
#
 
6
 
 
7
while(<>) {
 
8
  if(/^\s*card\s+"(.*)"\s*$/) {
 
9
    push @cards, $card;
 
10
    undef $card;
 
11
    $card->{name} = $1;
 
12
    next;
 
13
  }
 
14
 
 
15
  if(/^\s*bind\s+"(\S+)"\s*$/) {
 
16
    push @{$card->{modules}}, $1;
 
17
    next;
 
18
  }
 
19
 
 
20
  if(/^\s*bind\s+"(\S+)"\s*to\s*\d,\s*"(\S+)"\s*to\s*\d\s*$/) {
 
21
    push @{$card->{modules}}, $1;
 
22
    push @{$card->{modules}}, $2;
 
23
    next;
 
24
  }
 
25
 
 
26
  if(/^\s*manfid\s+(0x\S+),\s*(0x\S+)\s*$/) {
 
27
    $card->{vendor} = sprintf("0x%04x", hex $1);
 
28
    $card->{device} = sprintf("0x%04x", hex $2);
 
29
    next;
 
30
  }
 
31
 
 
32
}
 
33
 
 
34
for (@cards) {
 
35
  next unless $_->{modules};
 
36
  next unless $_->{name} =~ /ethernet/i;
 
37
  for $mods (@{$_->{modules}}) {
 
38
    $eth{$mods} = 1;
 
39
  }
 
40
}
 
41
 
 
42
 
 
43
for (@cards) {
 
44
  next unless $_->{vendor};
 
45
  next unless $_->{modules};
 
46
  print "# $_->{name}\n";
 
47
  print " vendor.id\t\tpcmcia $_->{vendor}\n";
 
48
  print "&device.id\t\tpcmcia $_->{device}\n";
 
49
  if($_->{modules}) {
 
50
    $eth = 1;
 
51
    for $mods (@{$_->{modules}}) {
 
52
      $eth = 0 unless $eth{$mods};
 
53
      print "+driver.module.modprobe\t$mods\n";
 
54
    }
 
55
    if($eth) {
 
56
      print "+baseclass.id\t\t0x002\n";
 
57
      print "+subclass.id\t\t0x00\n";
 
58
    }
 
59
  }
 
60
  print "\n";
 
61
}
 
62