summaryrefslogtreecommitdiff
path: root/cesar/mac/common/tonemask.h
blob: 422beb400fe0036681a6c1128298f9bf02104af8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef mac_common_tonemask_h
#define mac_common_tonemask_h
/* Cesar project {{{
 *
 * Copyright (C) 2007 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    mac/common/tonemask.h
 * \brief   Tonemask related functions.
 * \ingroup mac_common
 */
#include "tonemap.h"

/** Define parameters fixed with the tonemask. */
struct tonemask_info_t
{
    /** Tonemask, one bit per carrier. */
    u32 tonemask[PHY_TONEMASK_WORDS];
    /** Number of used carrier. */
    uint carrier_nb;
    /** ROBO tonemap. */
    tonemap_t tonemap_robo[PHY_MOD_ROBO_NB];
};
typedef struct tonemask_info_t tonemask_info_t;

BEGIN_DECLS

/**
 * Count the number of used carriers.
 * \param  tonemask  tone mask
 * \return  number of carriers
 */
uint
tonemask_carrier_nb (const u32 *tonemask);

/**
 * Update a tonemask information after some of its bits has changed.
 * \param  tonemask_info  tonemask information structure
 */
void
tonemask_update (tonemask_info_t *tonemask_info);

/**
 * Build the Homeplug AV default tonemask.
 * \param  tonemask  tone mask to fill
 * \return  number of carriers in default tonemask
 */
uint
tonemask_default (u32 *tonemask);

END_DECLS

#endif /* mac_common_tonemask_h */