summaryrefslogtreecommitdiff
path: root/cesar/mac/common/mfs.h
diff options
context:
space:
mode:
authorCyril Jourdan2011-05-10 11:29:03 +0200
committerCyril Jourdan2011-07-27 09:28:47 +0200
commit995546db79268510d50d2d8baab78c462e42691f (patch)
tree18b7afd838f869240129a9c6a54b8135b62644d1 /cesar/mac/common/mfs.h
parentf9d2fa175bfd7783ce60312204024a0a7eb31511 (diff)
cesar/mac/common: change window size value management, closes #2499
The RX window size is changed from 200 to 256 to be compliant with the HPAV specification. The function mfs_rx_window_size_encode is replaced by a global conversion table between indexes used in RxWSz field of the FCs and actual values of window size. This makes the access to the values easier and prevent from using non-standard values.
Diffstat (limited to 'cesar/mac/common/mfs.h')
-rw-r--r--cesar/mac/common/mfs.h35
1 files changed, 27 insertions, 8 deletions
diff --git a/cesar/mac/common/mfs.h b/cesar/mac/common/mfs.h
index 316a1a659b..de3a932680 100644
--- a/cesar/mac/common/mfs.h
+++ b/cesar/mac/common/mfs.h
@@ -52,6 +52,29 @@ enum mfs_fsm_rsp_t
};
typedef enum mfs_fsm_rsp_t mfs_fsm_rsp_t;
+/** Window size indexes. */
+enum mfs_window_size_idx_t
+{
+ MFS_WINDOW_SIZE_4,
+ MFS_WINDOW_SIZE_8,
+ MFS_WINDOW_SIZE_16,
+ MFS_WINDOW_SIZE_24,
+ MFS_WINDOW_SIZE_32,
+ MFS_WINDOW_SIZE_48,
+ MFS_WINDOW_SIZE_64,
+ MFS_WINDOW_SIZE_80,
+ MFS_WINDOW_SIZE_96,
+ MFS_WINDOW_SIZE_112,
+ MFS_WINDOW_SIZE_128,
+ MFS_WINDOW_SIZE_144,
+ MFS_WINDOW_SIZE_160,
+ MFS_WINDOW_SIZE_192,
+ MFS_WINDOW_SIZE_224,
+ MFS_WINDOW_SIZE_256,
+ MFS_WINDOW_SIZE_NB
+};
+typedef enum mfs_window_size_idx_t mfs_window_size_idx_t;
+
/** Common fields for TX and RX. */
struct mfs_common_t
{
@@ -208,6 +231,10 @@ typedef union mfs_t mfs_t;
BEGIN_DECLS
+/** Window size values table (values of the RxWSz field of the FCs in which
+ * it is included). */
+extern const u16 mfs_window_size[MFS_WINDOW_SIZE_NB];
+
/**
* Initialise a RX MFS, called from MAC store.
* \param mfs MFS to initialise
@@ -265,14 +292,6 @@ mfs_tx_init (mfs_tx_t *mfs, bool bcast, bool mme, uint lid, uint tei);
void
mfs_tx_init_unassociated (mfs_tx_t *mfs, bool bcast, bool mme, uint lid, uint tei);
-/**
- * Encode window size.
- * \param window_size decoded window size
- * \return encoded window size
- */
-u8
-mfs_rx_window_size_encode (u16 window_size);
-
END_DECLS
#endif /* mac_common_mfs_h */