Move e1d_find_intf + e1_intf_find_line to intf_line.c
Those are generic helper functions not really related to the ctl interface. Change-Id: Ibbda172aa425ca1e4702bacc7e595cd73a52929d
This commit is contained in:
parent
1923b4d832
commit
e07bbb5037
24
src/ctl.c
24
src/ctl.c
|
@ -42,30 +42,6 @@
|
|||
#include "log.h"
|
||||
|
||||
|
||||
struct e1_intf *
|
||||
e1d_find_intf(struct e1_daemon *e1d, uint8_t id)
|
||||
{
|
||||
struct e1_intf *intf;
|
||||
|
||||
llist_for_each_entry(intf, &e1d->interfaces, list)
|
||||
if (intf->id == id)
|
||||
return intf;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct e1_line *
|
||||
e1_intf_find_line(struct e1_intf *intf, uint8_t id)
|
||||
{
|
||||
struct e1_line *line;
|
||||
|
||||
llist_for_each_entry(line, &intf->lines, list)
|
||||
if (line->id == id)
|
||||
return line;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static struct e1_ts *
|
||||
_e1d_get_ts(struct e1_line *line, uint8_t ts)
|
||||
{
|
||||
|
|
|
@ -124,6 +124,13 @@ struct e1_daemon {
|
|||
struct llist_head interfaces;
|
||||
};
|
||||
|
||||
|
||||
struct e1_line *
|
||||
e1_intf_find_line(struct e1_intf *intf, uint8_t id);
|
||||
|
||||
struct e1_line *
|
||||
e1_intf_find_line(struct e1_intf *intf, uint8_t id);
|
||||
|
||||
struct e1_intf *
|
||||
e1_intf_new(struct e1_daemon *e1d, void *drv_data);
|
||||
|
||||
|
|
|
@ -66,6 +66,30 @@ static const struct rate_ctr_group_desc line_ctrg_desc = {
|
|||
// e1d structures
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
struct e1_intf *
|
||||
e1d_find_intf(struct e1_daemon *e1d, uint8_t id)
|
||||
{
|
||||
struct e1_intf *intf;
|
||||
|
||||
llist_for_each_entry(intf, &e1d->interfaces, list)
|
||||
if (intf->id == id)
|
||||
return intf;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct e1_line *
|
||||
e1_intf_find_line(struct e1_intf *intf, uint8_t id)
|
||||
{
|
||||
struct e1_line *line;
|
||||
|
||||
llist_for_each_entry(line, &intf->lines, list)
|
||||
if (line->id == id)
|
||||
return line;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct e1_intf *
|
||||
e1_intf_new(struct e1_daemon *e1d, void *drv_data)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue