Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
spec-sw
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
fmc-projects
spec
spec-sw
Commits
4fefdec7
Commit
4fefdec7
authored
12 years ago
by
Alessandro Rubini
Browse files
Options
Downloads
Patches
Plain Diff
spec: implement valudate
parent
49178c98
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
kernel/spec-fmc.c
+17
-1
17 additions, 1 deletion
kernel/spec-fmc.c
with
17 additions
and
1 deletion
kernel/spec-fmc.c
+
17
−
1
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
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment