summaryrefslogtreecommitdiffstats
path: root/upstream/mageia-cauldron/man9/pcibios_find_class.9
blob: b18741e28506617af28d349bad0e50237374bb34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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
73
74
75
76
77
78
79
80
81
82
.\" -*- nroff -*-
.TH pcibios_find_class 9 "August 5, 1997" "Linux DDI" "BIOS32 Functions"
.hlm 0
.na
.SH NAME
pcibios_find_class, pcibios_find_device \- find a PCI class or device
.SH SYNOPSIS
.B #include  <linux/bios32.h>
.sp
.TP
.BI "int pcibios_find_class(unsigned int " class_code \
", unsigned short " index ", unsigned char* " bus \
", unsigned char* " device_fn ");"
.TP
.BI "int pcibios_find_device(unsigned\ short\ "\ vendor \
", unsigned\ short\ " device_id\ \
", unsigned\ short\ " index ", unsigned\ char*\ " bus \
", unsigned\ char*\ " device_fn ");"
.hlm 1
.ad
.SH DESCRIPTION
The
.B pcibios_find_class
function searches for a certain class of device on the PCI bus.  In this
instance, class is used to represent a few different categories of
devices.  Some examples are storage, network, display, and memory
classes. The classes are defined by the PCI Specification, and the
.I class_code
is matched with the dword in the configuration space of the device at
offset 0x08.
.PP
The
.B pcibios_find_device
function finds a device on the PCI bus that has the matching device
and vendor ids. The vendor ids are assigned to the PCI Sig to vendors,
who in turn assign device ids to the devices they develop. The vendor
and device ids are encoded in dword 0x00 of the configuration space.
.PP
Both
.B pcibios_find_class
and
.B pcibios_find_device
include an extra
.I index
parameter, which is used to select the specific
device if there are multiple matches. An
.I index
of 0 matches the firts located board, 1 the second, and so on.
.PP
The
.I bus
and
.I device_fn
parameters are PCI specific cookies that are passed to other pcibios
functions to access the configuration space of the located device.
.SH "RETURN VALUE"
On success, the functions return
.IR PCIBIOS_SUCCESSFUL "."
Otherwise, one of the following error codes is returned:
.RS
.TP
PCIBIOS_DEVICE_NOT_FOUND
There is no device that matches the search criteria,
.TP
PCIBIOS_BAD_VENDOR_ID
The vendor id is invalid. (0xffff is not a valid id.)
.TP
PCIBIOS_FUNC_NOT_SUPPRTED
The PCI subsystem is not available
.RE
.SH AVAILABILITY
Linux 1.0+
.SH "SEE ALSO"
.BR pcibios_present "(9)"
.PP
.BR /usr/include/linux/pci.h ", "
.BR /usr/include/linux/bios32.h
.PP
.I "PCI Local Bus Specification"
.SH AUTHOR
Kirk Petersen (kirk@speakeasy.org)
.SH BUGS