Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC ADC 100M 14b 4cha - Software
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 ADC 100M 14b 4cha - Software
Commits
9064247e
Commit
9064247e
authored
Apr 21, 2016
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel: simplify overflow control function
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
b421b551
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
16 deletions
+7
-16
fa-zio-drv.c
kernel/fa-zio-drv.c
+1
-1
fa-zio-trg.c
kernel/fa-zio-trg.c
+1
-2
fmc-adc-100m14b4cha.h
kernel/fmc-adc-100m14b4cha.h
+5
-13
No files found.
kernel/fa-zio-drv.c
View file @
9064247e
...
...
@@ -358,7 +358,7 @@ static int zfad_input_cset_software(struct fa_dev *fa, struct zio_cset *cset)
int
err
;
/* Check if device memory allows this acquisition */
err
=
zfat_overflow_detection
(
cset
->
ti
,
ZFAT_POST
,
cset
->
ti
->
nsamples
);
err
=
zfat_overflow_detection
(
cset
->
ti
);
if
(
err
)
return
err
;
tmp
=
kzalloc
(
sizeof
(
struct
zfad_block
),
GFP_ATOMIC
);
...
...
kernel/fa-zio-trg.c
View file @
9064247e
...
...
@@ -308,8 +308,7 @@ static int zfat_arm_trigger(struct zio_ti *ti)
dev_dbg
(
msgdev
,
"Arming trigger
\n
"
);
/* Check if device memory allows this trigger configuration */
err
=
zfat_overflow_detection
(
ti
,
ZFAT_POST
,
ti_zattr
[
ZIO_ATTR_TRIG_POST_SAMP
].
value
);
err
=
zfat_overflow_detection
(
ti
);
if
(
err
)
return
err
;
...
...
kernel/fmc-adc-100m14b4cha.h
View file @
9064247e
...
...
@@ -401,31 +401,23 @@ struct zfad_block {
/* Global variable exported by fa-zio-trg.c */
extern
struct
zio_trigger_type
zfat_type
;
static
inline
int
zfat_overflow_detection
(
struct
zio_ti
*
ti
,
unsigned
int
addr
,
uint32_t
val
)
static
inline
int
zfat_overflow_detection
(
struct
zio_ti
*
ti
)
{
struct
fa_dev
*
fa
=
ti
->
cset
->
zdev
->
priv_d
;
struct
zio_attribute
*
ti_zattr
=
ti
->
zattr_set
.
std_zattr
;
uint32_t
pre_t
,
post_t
,
nshot_t
,
nsamples
;
uint32_t
nshot_t
,
nsamples
;
size_t
shot_size
;
if
(
!
addr
)
return
0
;
pre_t
=
addr
==
ZFAT_PRE
?
val
:
ti_zattr
[
ZIO_ATTR_TRIG_PRE_SAMP
].
value
;
post_t
=
addr
==
ZFAT_POST
?
val
:
ti_zattr
[
ZIO_ATTR_TRIG_POST_SAMP
].
value
;
if
(
ti
->
cset
->
trig
!=
&
zfat_type
)
nshot_t
=
1
;
/* with any other trigger work in one-shot mode */
else
nshot_t
=
addr
==
ZFAT_SHOTS_NB
?
val
:
ti_zattr
[
ZIO_ATTR_TRIG_N_SHOTS
].
value
;
nshot_t
=
ti_zattr
[
ZIO_ATTR_TRIG_N_SHOTS
].
value
;
/*
* +2 because of the timetag at the end
*/
nsamples
=
pre_t
+
post_t
;
nsamples
=
ti_zattr
[
ZIO_ATTR_TRIG_PRE_SAMP
].
value
+
ti_zattr
[
ZIO_ATTR_TRIG_POST_SAMP
].
value
;
shot_size
=
((
nsamples
+
2
)
*
ti
->
cset
->
ssize
)
*
FA100M14B4C_NCHAN
;
if
(
(
shot_size
*
nshot_t
)
>
FA100M14B4C_MAX_ACQ_BYTE
)
{
dev_err
(
&
ti
->
head
.
dev
,
"Cannot acquire, dev memory overflow
\n
"
);
...
...
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