3 # PciMapEntry - iencapsulate a line form modules.pcimap.
4 # Copyright (C) 2005 Erik van Konijnenburg
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 # Knows how to match, can return module name.
33 $self->takeArgs ('module', 'vendor', 'device', 'subvendor',
34 'subdevice', 'class', 'classmask', 'driver_data');
37 sub module { return $_[0]->{module}; }
39 # we could do the PCI_ANY processing in init,
40 # if it turns out to be time critical.
41 my $PCI_ANY = 0xffffffff;
43 my ($self, $dev) = @_;
44 if ($self->{vendor} != $PCI_ANY && $self->{vendor} != $dev->vendor) {
47 if ($self->{device} != $PCI_ANY && $self->{device} != $dev->device) {
50 if ($self->{subvendor} != $PCI_ANY
51 && $self->{subvendor} != $dev->subvendor) {
54 if ($self->{subdevice} != $PCI_ANY
55 && $self->{subdevice} != $dev->subdevice) {
58 if ($self->{class} == ($dev->class & $self->{classmask})) {