Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC Bus
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
FMC Bus
Commits
7d9025ae
Commit
7d9025ae
authored
Aug 01, 2012
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sdb: added the find_device function
parent
216fc637
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
3 deletions
+30
-3
fmc-sdb.c
kernel/fmc-sdb.c
+28
-2
fmc-sdb.h
kernel/include/linux/fmc-sdb.h
+2
-1
No files found.
kernel/fmc-sdb.c
View file @
7d9025ae
...
@@ -191,7 +191,33 @@ void fmc_show_sdb_tree(struct fmc_device *fmc)
...
@@ -191,7 +191,33 @@ void fmc_show_sdb_tree(struct fmc_device *fmc)
}
}
EXPORT_SYMBOL
(
fmc_show_sdb_tree
);
EXPORT_SYMBOL
(
fmc_show_sdb_tree
);
unsigned
long
fmc_find_sdb_device
(
struct
sdb_array
*
tree
)
signed
long
fmc_find_sdb_device
(
struct
sdb_array
*
tree
,
uint64_t
vid
,
uint32_t
did
)
{
{
return
0
;
signed
long
res
=
-
ENODEV
;
union
sdb_record
*
r
;
struct
sdb_product
*
p
;
struct
sdb_component
*
c
;
int
i
,
n
=
tree
->
len
;
/* FIXME: what if the first interconnect is not at zero? */
for
(
i
=
0
;
i
<
n
;
i
++
)
{
r
=
&
tree
->
record
[
i
];
c
=
&
r
->
dev
.
sdb_component
;
p
=
&
c
->
product
;
if
(
!
IS_ERR
(
tree
->
subtree
[
i
]))
res
=
fmc_find_sdb_device
(
tree
->
subtree
[
i
],
vid
,
did
);
if
(
res
>
0
)
return
res
+
tree
->
baseaddr
;
if
(
r
->
empty
.
record_type
!=
sdb_type_device
)
continue
;
if
(
__be64_to_cpu
(
p
->
vendor_id
)
!=
vid
)
continue
;
if
(
__be32_to_cpu
(
p
->
device_id
)
!=
did
)
continue
;
return
__be64_to_cpu
(
c
->
addr_first
);
}
return
res
;
}
}
EXPORT_SYMBOL
(
fmc_find_sdb_device
);
kernel/include/linux/fmc-sdb.h
View file @
7d9025ae
...
@@ -31,5 +31,6 @@ struct sdb_array {
...
@@ -31,5 +31,6 @@ struct sdb_array {
extern
int
fmc_scan_sdb_tree
(
struct
fmc_device
*
fmc
,
unsigned
long
address
);
extern
int
fmc_scan_sdb_tree
(
struct
fmc_device
*
fmc
,
unsigned
long
address
);
extern
void
fmc_show_sdb_tree
(
struct
fmc_device
*
fmc
);
extern
void
fmc_show_sdb_tree
(
struct
fmc_device
*
fmc
);
extern
unsigned
long
fmc_find_sdb_device
(
struct
sdb_array
*
tree
);
extern
signed
long
fmc_find_sdb_device
(
struct
sdb_array
*
tree
,
uint64_t
vendor
,
uint32_t
device
);
extern
int
fmc_free_sdb_tree
(
struct
fmc_device
*
fmc
);
extern
int
fmc_free_sdb_tree
(
struct
fmc_device
*
fmc
);
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