Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
f9cfcb03
Commit
f9cfcb03
authored
Jun 04, 2003
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] PCI: add pci_find_device_reverse() for users of pci_find_each_dev_reverse() to use
parent
bf77023b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
0 deletions
+30
-0
drivers/pci/search.c
drivers/pci/search.c
+29
-0
include/linux/pci.h
include/linux/pci.h
+1
-0
No files found.
drivers/pci/search.c
View file @
f9cfcb03
...
@@ -117,6 +117,34 @@ pci_find_device(unsigned int vendor, unsigned int device, const struct pci_dev *
...
@@ -117,6 +117,34 @@ pci_find_device(unsigned int vendor, unsigned int device, const struct pci_dev *
}
}
/**
* pci_find_device_reverse - begin or continue searching for a PCI device by vendor/device id
* @vendor: PCI vendor id to match, or %PCI_ANY_ID to match all vendor ids
* @device: PCI device id to match, or %PCI_ANY_ID to match all device ids
* @from: Previous PCI device found in search, or %NULL for new search.
*
* Iterates through the list of known PCI devices in the reverse order of pci_find_device().
* If a PCI device is found with a matching @vendor and @device, a pointer to
* its device structure is returned. Otherwise, %NULL is returned.
* A new search is initiated by passing %NULL to the @from argument.
* Otherwise if @from is not %NULL, searches continue from previous device on the global list.
*/
struct
pci_dev
*
pci_find_device_reverse
(
unsigned
int
vendor
,
unsigned
int
device
,
const
struct
pci_dev
*
from
)
{
struct
list_head
*
n
=
from
?
from
->
global_list
.
prev
:
pci_devices
.
prev
;
while
(
n
!=
&
pci_devices
)
{
struct
pci_dev
*
dev
=
pci_dev_g
(
n
);
if
((
vendor
==
PCI_ANY_ID
||
dev
->
vendor
==
vendor
)
&&
(
device
==
PCI_ANY_ID
||
dev
->
device
==
device
))
return
dev
;
n
=
n
->
prev
;
}
return
NULL
;
}
/**
/**
* pci_find_class - begin or continue searching for a PCI device by class
* pci_find_class - begin or continue searching for a PCI device by class
* @class: search for a PCI device with this class designation
* @class: search for a PCI device with this class designation
...
@@ -146,5 +174,6 @@ pci_find_class(unsigned int class, const struct pci_dev *from)
...
@@ -146,5 +174,6 @@ pci_find_class(unsigned int class, const struct pci_dev *from)
EXPORT_SYMBOL
(
pci_find_bus
);
EXPORT_SYMBOL
(
pci_find_bus
);
EXPORT_SYMBOL
(
pci_find_class
);
EXPORT_SYMBOL
(
pci_find_class
);
EXPORT_SYMBOL
(
pci_find_device
);
EXPORT_SYMBOL
(
pci_find_device
);
EXPORT_SYMBOL
(
pci_find_device_reverse
);
EXPORT_SYMBOL
(
pci_find_slot
);
EXPORT_SYMBOL
(
pci_find_slot
);
EXPORT_SYMBOL
(
pci_find_subsys
);
EXPORT_SYMBOL
(
pci_find_subsys
);
include/linux/pci.h
View file @
f9cfcb03
...
@@ -564,6 +564,7 @@ extern void pci_remove_bus_device(struct pci_dev *dev);
...
@@ -564,6 +564,7 @@ extern void pci_remove_bus_device(struct pci_dev *dev);
/* Generic PCI functions exported to card drivers */
/* Generic PCI functions exported to card drivers */
struct
pci_dev
*
pci_find_device
(
unsigned
int
vendor
,
unsigned
int
device
,
const
struct
pci_dev
*
from
);
struct
pci_dev
*
pci_find_device
(
unsigned
int
vendor
,
unsigned
int
device
,
const
struct
pci_dev
*
from
);
struct
pci_dev
*
pci_find_device_reverse
(
unsigned
int
vendor
,
unsigned
int
device
,
const
struct
pci_dev
*
from
);
struct
pci_dev
*
pci_find_subsys
(
unsigned
int
vendor
,
unsigned
int
device
,
struct
pci_dev
*
pci_find_subsys
(
unsigned
int
vendor
,
unsigned
int
device
,
unsigned
int
ss_vendor
,
unsigned
int
ss_device
,
unsigned
int
ss_vendor
,
unsigned
int
ss_device
,
const
struct
pci_dev
*
from
);
const
struct
pci_dev
*
from
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment