summaryrefslogtreecommitdiff
path: root/cesar/mac/common
diff options
context:
space:
mode:
authorCyril Jourdan2011-05-10 11:57:05 +0200
committerCyril Jourdan2011-07-27 09:28:47 +0200
commit122182456f5607c06c1debd3737a3ca52b85e950 (patch)
tree5c964e7949266ef62ea0e08866d875d2ba0ce5f0 /cesar/mac/common
parent995546db79268510d50d2d8baab78c462e42691f (diff)
cesar/mac/pbproc: handle RX window management, closes #417
When preparing the MPDU, the PBProc now ensures that we don't send PBs with SSNs out of the window of the receiver. To do that, we calculate dynamically the number of holes (in terms of SSNs) in the MFS, and we limitate the number of PBs in a burst to the size of the window minus the number of holes.
Diffstat (limited to 'cesar/mac/common')
-rw-r--r--cesar/mac/common/mfs.h8
-rw-r--r--cesar/mac/common/src/mfs.c2
2 files changed, 4 insertions, 6 deletions
diff --git a/cesar/mac/common/mfs.h b/cesar/mac/common/mfs.h
index de3a932680..cb401df18c 100644
--- a/cesar/mac/common/mfs.h
+++ b/cesar/mac/common/mfs.h
@@ -161,13 +161,11 @@ struct mfs_tx_t
/** MFS FSM state. */
mfs_fsm_cmd_t fsm_state;
- /** Minimum SSN expected by the receiver. */
- u16 min_ssn;
/** Window size at the receiver. */
u16 window_size;
- /** Number of holes in the window, i.e. number of acknowledged or canceled
- * segment in the window. */
- int window_holes_seg_nb;
+ /** Number of holes in the MFS, i.e. number of acknowledged or canceled
+ * segment in the MFS. */
+ u16 holes_seg_nb;
/** Channel Access Priority. */
uint cap;
diff --git a/cesar/mac/common/src/mfs.c b/cesar/mac/common/src/mfs.c
index d61c1b5e3d..5dacab71ad 100644
--- a/cesar/mac/common/src/mfs.c
+++ b/cesar/mac/common/src/mfs.c
@@ -94,9 +94,9 @@ mfs_tx_init (mfs_tx_t *mfs, bool bcast, bool mme, uint lid, uint tei)
mfs->seg_nb = 0;
mfs->pending_seg_nb = 0;
mfs->fsm_state = bcast ? MFS_FSM_CMD_NOP : MFS_FSM_CMD_INIT;
- mfs->min_ssn = 0;
mfs->window_size = mme ? mfs_window_size[MFS_WINDOW_SIZE_MME]
: mfs_window_size[MFS_DEFAULT_WINDOW_SIZE_DATA_TX];
+ mfs->holes_seg_nb = 0;
if (mme)
mfs->cap = 2;
else