aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/template/exception/ssh:
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2015-02-03 10:30:02 +0100
committerAndreas Fischer <bantu@phpbb.com>2015-02-03 10:30:02 +0100
commite86b7ce56260264102e60c0d248c26bebea31d4e (patch)
tree1c170afd86d7df63260e9e83268e28fd338e01eb /phpBB/phpbb/template/exception/ssh:
parent727359156062b49c1b9da75bde6dda8038a7069b (diff)
parentf4f983c0f60bcac5d953c9cb680800633d70047c (diff)
downloadforums-e86b7ce56260264102e60c0d248c26bebea31d4e.tar
forums-e86b7ce56260264102e60c0d248c26bebea31d4e.tar.gz
forums-e86b7ce56260264102e60c0d248c26bebea31d4e.tar.bz2
forums-e86b7ce56260264102e60c0d248c26bebea31d4e.tar.xz
forums-e86b7ce56260264102e60c0d248c26bebea31d4e.zip
Merge pull request #3363 from Nicofuma/ticket/13572
[ticket/13572] Update composer to version 1.0.0-alpha9 * Nicofuma/ticket/13572: [ticket/13572] Update composer to version 1.0.0-alpha9
Diffstat (limited to 'phpBB/phpbb/template/exception/ssh:')
0 files changed, 0 insertions, 0 deletions
id='n39' href='#n39'>39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
#!/usr/bin/perl

use strict;
use MDK::Common;

require '/usr/bin/merge2pcitable.pl';
my $pci = read_pcitable("/usr/share/ldetect-lst/pcitable");

print '
#define PCI_REVISION_ID         0x08    /* Revision ID */

struct pci_module_map {
	unsigned short	vendor;     /* PCI vendor id */
	unsigned short	device;     /* PCI device id */
	const char      *name;      /* PCI human readable name */
	const char      *module;    /* module to load */
};

struct pci_module_map_full {
	unsigned short	vendor;     /* PCI vendor id */
	unsigned short	device;     /* PCI device id */
	unsigned short	subvendor;  /* PCI subvendor id */
	unsigned short	subdevice;  /* PCI subdevice id */
	const char      *name;      /* PCI human readable name */
	const char      *module;    /* module to load */
};

';

my %t = ( 
    network => 'network/main|gigabit',
    medias  => 'disk/scsi|hardware_raid',
);

foreach my $type (keys %t) {
    my @modules = chomp_(`perl ../../kernel/modules.pl pci_modules4stage1:"$t{$type}"`);

    my (@entries, @entries_full);

    foreach my $k (sort keys %$pci) {
	my $v = $pci->{$k};
	member($v->[0], @modules) or next;
	$k =~ /^(....)(....)(....)(....)/;
	my $values = { vendor => $1, device => $2, subvendor => $3, subdevice => $4, driver => $v->[0], description => $v->[1] };
	if ($values->{subdevice} eq 'ffff' && $values->{subvendor} eq 'ffff') {
	    push @entries, $values;
	} else {
	    push @entries_full, $values;
	}
    }

    print "#ifndef DISABLE_".uc($type)."
struct pci_module_map ${type}_pci_ids[] = {
";
    printf qq|\t{ 0x%s, 0x%s, "%s", "%s" },\n|, $_->{vendor}, $_->{device}, $_->{description}, $_->{driver}
      foreach @entries;
    print "};
unsigned int ${type}_num_ids = sizeof(${type}_pci_ids) / sizeof(struct pci_module_map);
";

    print "
struct pci_module_map_full ${type}_pci_ids_full[] = {
";
    printf qq|\t{ 0x%s, 0x%s, 0x%s, 0x%s, "%s", "%s" },\n|, $_->{vendor}, $_->{device}, $_->{subvendor}, $_->{subdevice}, $_->{description}, $_->{driver}
      foreach @entries_full;
    print "};
unsigned int ${type}_num_ids_full = sizeof(${type}_pci_ids_full) / sizeof(struct pci_module_map_full);

#endif

";
}