summaryrefslogtreecommitdiff
path: root/mac/sar/inc/sar_mfs.h
blob: ab4a90514d9b1a191943c6820fb9af6bdfc11507 (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
57
58
59
60
61
62
63
#ifndef SAR_MFS_H_
#define SAR_MFS_H_

/* Cesar project {{{
 *
 * Copyright (C) 2007 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    sar_mfs.h
 * \brief   the function for the sar mfs.
 * \ingroup mac/sar/inc
 *
 */

#include "mac/pbproc/pbproc.h"
#include "mac/sar/inc/sar_pb.h"

/**
 * Update last pb continuous on the mfs
 * 
 * Verify the continuity of the chain from the first PB of the MFS to the last
 * contiguous.
 * 
 * If the counter of ssn had been reseted it verify the coninuity search the ssn
 * 0 after the ssn 655535.
 * 
 * \param  mfs the MFS to update
 * \param  pb of the MFS from wich one it is needed to update
 */
void rx_mfs_update_last_contiguous_and_tail (mfs_rx_t *mfs, pb_t *pb);

/**
 * Verify if it is necessary to modify the ssn of the MFS according with the
 * Homeplug AV norm.
 * 
 * \param  pb the pb to make the test.
 * \param  mfs the mfs to verify.
 * \param  pb_nb number of PBs in the mpdu given by the pbproc.
 */
void rx_mfs_resize_ssn (pb_t *pb, mfs_rx_t *mfs, uint pb_nb);

/**
 * Return the max ssn of the MFS
 * 
 * \param mfs the mfs.
 */
u16
rx_mfs_get_ssn_max (mfs_rx_t *mfs);

/**
 * Insert a PB after the PB this in the PBs chain
 * 
 * \param  this the pb which the new is the next
 * \param  new the Pb to insert
 * \return the pb after new
 */
pb_t *
rx_mfs_add_pb_after (pb_t *this, pb_t *new);

#endif /*SAR_MFS_H_*/