dect
/
libdect
Archived
13
0
Fork 0

identities: return target structure from conversion functions

Signed-off-by: Patrick McHardy <kaber@trash.net>
This commit is contained in:
Patrick McHardy 2010-07-30 04:30:35 +02:00
parent 38b607ea76
commit e95aa82872
4 changed files with 15 additions and 10 deletions

View File

@ -206,8 +206,8 @@ struct dect_tpui {
};
};
extern void dect_ipui_to_tpui(struct dect_tpui *tpui,
const struct dect_ipui *ipui);
extern struct dect_tpui *dect_ipui_to_tpui(struct dect_tpui *tpui,
const struct dect_ipui *ipui);
extern void dect_dump_tpui(const struct dect_tpui *tpui);
/* Collective broadcast identifier */

View File

@ -132,7 +132,8 @@ struct dect_pmid {
extern void dect_parse_pmid(struct dect_pmid *pmid, uint32_t p);
extern void dect_tpui_to_pmid(struct dect_pmid *pmid, const struct dect_tpui *tpui);
extern struct dect_pmid *dect_tpui_to_pmid(struct dect_pmid *pmid,
const struct dect_tpui *tpui);
extern uint32_t dect_build_pmid(const struct dect_pmid *pmid);
#endif /* _LIBDECT_IDENTITIES_H */

View File

@ -243,7 +243,8 @@ bool dect_ipui_cmp(const struct dect_ipui *i1, const struct dect_ipui *i2)
}
EXPORT_SYMBOL(dect_ipui_cmp);
void dect_ipui_to_tpui(struct dect_tpui *tpui, const struct dect_ipui *ipui)
struct dect_tpui *dect_ipui_to_tpui(struct dect_tpui *tpui,
const struct dect_ipui *ipui)
{
tpui->type = DECT_TPUI_INDIVIDUAL_DEFAULT;
@ -260,6 +261,8 @@ void dect_ipui_to_tpui(struct dect_tpui *tpui, const struct dect_ipui *ipui)
case DECT_IPUI_U:
break;
}
return tpui;
}
void dect_dump_tpui(const struct dect_tpui *tpui)
@ -322,7 +325,8 @@ uint32_t dect_build_tpui(const struct dect_tpui *tpui)
return t;
}
void dect_tpui_to_pmid(struct dect_pmid *pmid, const struct dect_tpui *tpui)
struct dect_pmid *dect_tpui_to_pmid(struct dect_pmid *pmid,
const struct dect_tpui *tpui)
{
uint32_t t;
@ -340,6 +344,8 @@ void dect_tpui_to_pmid(struct dect_pmid *pmid, const struct dect_tpui *tpui)
default:
BUG();
}
return pmid;
}
void dect_parse_pmid(struct dect_pmid *pmid, uint32_t p)

View File

@ -771,10 +771,9 @@ static int dect_lce_page(const struct dect_handle *dh,
struct dect_tpui tpui;
uint16_t page;
dect_ipui_to_tpui(&tpui, ipui);
msg.hdr = DECT_LCE_PAGE_GENERAL_VOICE;
page = dect_build_tpui(&tpui) & DECT_LCE_SHORT_PAGE_TPUI_MASK;
page = dect_build_tpui(dect_ipui_to_tpui(&tpui, ipui)) &
DECT_LCE_SHORT_PAGE_TPUI_MASK;
msg.information = __cpu_to_be16(page);
return dect_lce_broadcast(dh, &msg.hdr, sizeof(msg));
@ -935,8 +934,7 @@ static void dect_lce_rcv_short_page(struct dect_handle *dh,
} else {
if (w == 0) {
/* default individual TPUI */
dect_ipui_to_tpui(&tpui, &dh->ipui);
t = dect_build_tpui(&tpui);
t = dect_build_tpui(dect_ipui_to_tpui(&tpui, &dh->ipui));
if (info != t)
return;
} else {