Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Simple PCIe FMC carrier SPEC - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
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
Simple PCIe FMC carrier SPEC - Software
Commits
4fefdec7
Commit
4fefdec7
authored
Aug 02, 2012
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
spec: implement valudate
parent
49178c98
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletion
+17
-1
spec-fmc.c
kernel/spec-fmc.c
+17
-1
No files found.
kernel/spec-fmc.c
View file @
4fefdec7
...
...
@@ -19,10 +19,25 @@ module_param_named(test_irq, spec_test_irq, int, 0444);
/* The main role of this file is offering the fmc_operations for the spec */
static
int
spec_
reprogram
(
struct
fmc_device
*
fmc
,
char
*
gw
)
static
int
spec_
validate
(
struct
fmc_device
*
fmc
,
struct
fmc_driver
*
drv
)
{
struct
spec_dev
*
spec
=
fmc
->
carrier_data
;
struct
pci_dev
*
pdev
=
spec
->
pdev
;
int
busid
=
(
pdev
->
bus
->
number
<<
8
)
|
pdev
->
devfn
;
int
i
;
if
(
!
drv
->
busid_n
)
return
0
;
/* everyhing is valid */
for
(
i
=
0
;
i
<
drv
->
busid_n
;
i
++
)
if
(
drv
->
busid_val
[
i
]
==
busid
)
return
i
;
return
-
ENOENT
;
}
static
int
spec_reprogram
(
struct
fmc_device
*
fmc
,
char
*
gw
)
{
const
struct
firmware
*
fw
;
struct
spec_dev
*
spec
=
fmc
->
carrier_data
;
struct
device
*
dev
=
fmc
->
hwdev
;
int
ret
;
...
...
@@ -128,6 +143,7 @@ static int spec_write_ee(struct fmc_device *fmc, int pos,
static
struct
fmc_operations
spec_fmc_operations
=
{
/* no readl/writel because we have the base pointer */
.
validate
=
spec_validate
,
.
reprogram
=
spec_reprogram
,
.
irq_request
=
spec_irq_request
,
.
irq_ack
=
spec_irq_ack
,
...
...
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