Commit ff2deab0 authored by Federico Vaga's avatar Federico Vaga

lib: rename buffer_type getter/setter

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent cd907294
...@@ -143,7 +143,7 @@ struct fmctdc_board *fmctdc_open(int dev_id) ...@@ -143,7 +143,7 @@ struct fmctdc_board *fmctdc_open(int dev_id)
goto err_version; goto err_version;
} }
ret = fmctdc_get_buffer_type((struct fmctdc_board *)b); ret = fmctdc_buffer_type_get((struct fmctdc_board *)b);
if (ret < 0) if (ret < 0)
goto err_buf; goto err_buf;
/* Trim all block sizes to 1 sample (i.e. 4 bytes) */ /* Trim all block sizes to 1 sample (i.e. 4 bytes) */
...@@ -420,7 +420,7 @@ int fmctdc_channel_disable(struct fmctdc_board *userb, unsigned int channel) ...@@ -420,7 +420,7 @@ int fmctdc_channel_disable(struct fmctdc_board *userb, unsigned int channel)
* @return 0 on success, otherwise a negative errno code is set * @return 0 on success, otherwise a negative errno code is set
* appropriately * appropriately
*/ */
static int fmctdc_set_buffer_type_chan(struct fmctdc_board *userb, static int fmctdc_buffer_type_chan_set(struct fmctdc_board *userb,
unsigned int ch, unsigned int ch,
enum fmctdc_buffer_type type) enum fmctdc_buffer_type type)
{ {
...@@ -450,7 +450,7 @@ static int fmctdc_set_buffer_type_chan(struct fmctdc_board *userb, ...@@ -450,7 +450,7 @@ static int fmctdc_set_buffer_type_chan(struct fmctdc_board *userb,
return ret != 7 ? -1 : 0; return ret != 7 ? -1 : 0;
} }
static int fmctdc_get_buffer_type_chan(struct fmctdc_board *userb, static int fmctdc_buffer_type_chan_get(struct fmctdc_board *userb,
unsigned int ch, unsigned int ch,
enum fmctdc_buffer_type *type) enum fmctdc_buffer_type *type)
{ {
...@@ -490,14 +490,14 @@ static int fmctdc_get_buffer_type_chan(struct fmctdc_board *userb, ...@@ -490,14 +490,14 @@ static int fmctdc_get_buffer_type_chan(struct fmctdc_board *userb,
* @return 0 on success, otherwise a negative errno code is set * @return 0 on success, otherwise a negative errno code is set
* appropriately * appropriately
*/ */
int fmctdc_set_buffer_type(struct fmctdc_board *userb, int fmctdc_buffer_type_set(struct fmctdc_board *userb,
enum fmctdc_buffer_type type) enum fmctdc_buffer_type type)
{ {
int i; int i;
int err = 0; int err = 0;
for (i = 0; i < FMCTDC_NUM_CHANNELS; ++i) { for (i = 0; i < FMCTDC_NUM_CHANNELS; ++i) {
err = fmctdc_set_buffer_type_chan(userb, i, type); err = fmctdc_buffer_type_chan_set(userb, i, type);
if (err) { if (err) {
errno = FMCTDC_ERR_NOT_CONSISTENT_BUFFER_TYPE; errno = FMCTDC_ERR_NOT_CONSISTENT_BUFFER_TYPE;
break; break;
...@@ -515,14 +515,14 @@ int fmctdc_set_buffer_type(struct fmctdc_board *userb, ...@@ -515,14 +515,14 @@ int fmctdc_set_buffer_type(struct fmctdc_board *userb,
* @return buffer type, otherwise a negative errno code is set * @return buffer type, otherwise a negative errno code is set
* appropriately * appropriately
*/ */
int fmctdc_get_buffer_type(struct fmctdc_board *userb) int fmctdc_buffer_type_get(struct fmctdc_board *userb)
{ {
int i; int i;
int err = 0; int err = 0;
enum fmctdc_buffer_type type_prev = -1, type_cur; enum fmctdc_buffer_type type_prev = -1, type_cur;
for (i = 0; i < FMCTDC_NUM_CHANNELS; ++i) { for (i = 0; i < FMCTDC_NUM_CHANNELS; ++i) {
err = fmctdc_get_buffer_type_chan(userb, i, &type_cur); err = fmctdc_buffer_type_chan_get(userb, i, &type_cur);
if (err) { if (err) {
errno = FMCTDC_ERR_NOT_CONSISTENT_BUFFER_TYPE; errno = FMCTDC_ERR_NOT_CONSISTENT_BUFFER_TYPE;
break; break;
......
...@@ -195,6 +195,9 @@ extern int fmctdc_stats_trans_get(struct fmctdc_board *userb, ...@@ -195,6 +195,9 @@ extern int fmctdc_stats_trans_get(struct fmctdc_board *userb,
* @{ * @{
*/ */
extern int fmctdc_flush(struct fmctdc_board *userb, unsigned int channel); extern int fmctdc_flush(struct fmctdc_board *userb, unsigned int channel);
extern int fmctdc_buffer_type_get(struct fmctdc_board *userb);
extern int fmctdc_buffer_type_set(struct fmctdc_board *userb,
enum fmctdc_buffer_type type);
extern int fmctdc_buffer_mode_get(struct fmctdc_board *userb, extern int fmctdc_buffer_mode_get(struct fmctdc_board *userb,
unsigned int channel, unsigned int channel,
enum fmctdc_buffer_sw_mode *mode); enum fmctdc_buffer_sw_mode *mode);
...@@ -252,9 +255,6 @@ extern uint64_t fmctdc_ts_ps(struct fmctdc_time *a); ...@@ -252,9 +255,6 @@ extern uint64_t fmctdc_ts_ps(struct fmctdc_time *a);
/* deprecated */ /* deprecated */
extern int fmctdc_get_buffer_type(struct fmctdc_board *userb);
extern int fmctdc_set_buffer_type(struct fmctdc_board *userb,
enum fmctdc_buffer_type type);
extern int fmctdc_get_buffer_mode(struct fmctdc_board *userb, extern int fmctdc_get_buffer_mode(struct fmctdc_board *userb,
unsigned int channel); unsigned int channel);
extern int fmctdc_set_buffer_mode(struct fmctdc_board *userb, extern int fmctdc_set_buffer_mode(struct fmctdc_board *userb,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment