#ifndef cp_defs_h #define cp_defs_h /* Cesar project {{{ * * Copyright (C) 2008 Spidcom * * <<>> * * }}} */ /** * \file cp/defs.h * \brief Definition for the Control Plane. * \ingroup cp */ /* Timeout value. */ #define CP_TIMEOUT_MS 1000 /* Bentry countdown. */ #define CP_BENTRY_COUNTDOWN_DEFAULT 10 /* Default time lease for associated STA (in minutes.) . */ #define CP_LEASE_ASSOC_MIN 0xF /* 15 minutes. */ #define CP_LEASE_AUTH_MIN 0xB40 /* 48 hours. */ /** The time since the last assoc.req emitted by a station to be considered as * fully associated. */ #define CP_ASSOC_FULL_TIMEOUT_MS 2000 /** CCo level. */ #define CP_CCO_LEVEL_MAX 3 #define CP_CCO_LEVEL 0 /** AV Version. */ #define CP_AV_VERSION 0 /** PCo capability. */ #define CP_PCO_CAP_MAX 1 #define CP_PCO_CAP false /** Backup CCo Cap. */ #define CP_BACKUP_CCO_CAP_MAX 1 #define CP_BACKUP_CCO_CAP false /** Auto Connect Capability (ACS). */ #define CP_ACS_CAP false #define CP_ACS_CAP_MAX 1 /** Smoothing Capability. */ #define CP_SMOOTHING_CAP false #define CP_SMOOTHING_CAP_MAX 1 /** Soft Handover Support. */ #define CP_SOFT_HANDOVER_CAP false #define CP_SOFT_HANDOVER_CAP_MAX 1 /** Two Symbol Frame Control Support. */ #define CP_TWO_SYM_FC_CAP false #define CP_TWO_SYM_FC_CAP_MAX 1 /** Capability of Operating in Various Regulatory Domains. */ #define CP_REGULATORY_CAP 0x00 // North America Only #define CP_REGULATORY_CAP_MAX 0 /** Bidirectional Bursting Capability. */ #define CP_BIDIRECTIONAL_BURSTING_CAP false #define CP_BIDIRECTIONAL_BURSTING_CAP_MAX 2 /** Minimum size of NPW password. */ #define CP_NPW_MIN_SIZE 8 // bytes #define CP_NPW_MAX_SIZE 64 // bytes /** Maximum size of HFID (human-friendly identifier). */ #define CP_HFID_SIZE 64 // bytes /** NMK size. */ #define CP_NMK_SIZE 16 // bytes /** Device password length. */ #define CP_DPW_MIN_SIZE 16 // bytes #define CP_DPW_MAX_SIZE 64 // bytes /** Hash key size. */ #define CP_HASH_KEY_SIZE 384 /** Expiration delay for the networks. */ #define CP_NET_EXPIRATION_DELAY_S 70 /** Minimum CCo Beacon scan time (BTT). */ #define CP_CCO_BEACON_SCAN_MIN_MS 1000 /** Maximum CCo Beacon scan time (BTT). */ #define CP_CCO_BEACON_SCAN_MAX_MS 2000 /** Minimum Beacon scan time (BTT). */ #define CP_BEACON_SCAN_MIN_MS 2000 /** Maximum Beacon scan time (BTT). */ #define CP_BEACON_SCAN_MAX_MS 4000 /** Approximated unassociated STA advertisement interval. */ #define CP_USTA_IND_INTERVAL_MS 1000 /** Discover period. */ #define CP_DISCOVER_PERIOD_MAX_S 10 #define CP_DISCOVER_PERIOD_MAX_MS (CP_DISCOVER_PERIOD_MAX_S * 1000) /** Maximum number of beacon loss because an AVLN failure. */ #define CP_MAX_NO_BEACON 10 /** Max schedules beacon periods. */ #define CP_SCHED_BEACON_PERIODS_MAX 4 /** Specific allocation time in ATU. Calulated from their size in byte and their * transmission in ROBO modulation*/ /*Beacon size 136 bytes, repetition 5 time*/ #define CP_CCO_BW_ALLOC_TIME_BEACON_ATU 141 /*CFPI size 4 ms recommended*/ #define CP_CCO_BW_ALLOC_TIME_CFPI_ATU 390 /*MinCSMA size 1500 µs recommended*/ #define CP_CCO_BW_ALLOC_TIME_MINCSMA_ATU 147 /*Protection of overrun. Value not into the hpAV spec.*/ #define CP_CCO_BW_ALLOC_TIME_END_TDMA_PROTECTION_ATU 10 /** Size of a PB in octet used to transport a MSDU */ #define CP_CCO_BW_PB_SIZE_OCTET 520 /** Number of Priority heaps */ #define CP_CCO_BW_NB_PRIORITY_HEAPS 4 /** minimal size of a CSMA allocation */ #define CP_CCO_BW_MIN_CSMA_ALLOC_ATU 5 /* Order of MAC address comparison is reversed to determine who will become * CCo! As a direct consequence, some manufacturer will always become CCo. */ #define MAC_REVERSE(mac) \ ( ((mac) & 0xff0000000000ull) >> 40 \ | ((mac) & 0x00ff00000000ull) >> 24 \ | ((mac) & 0x0000ff000000ull) >> 8 \ | ((mac) & 0x000000ff0000ull) << 8 \ | ((mac) & 0x00000000ff00ull) << 24 \ | ((mac) & 0x0000000000ffull) << 40) /** Macro to verify the ASCII string validity. */ #define ASCII_IS_VALID(val) \ ((((u8)(val) >= 32) && ((u8)(val) <= 127)) || ((u8) (val) == 0)) /** Ability to support Enhanced Coexistence with Homeplug AV 1.1. */ #define CP_HOMEPLUG_AV11_MAX 1 #define CP_HOMEPLUG_AV11 0 /** Homeplug AV 1.0.1 Interoperability Capability. */ #define CP_HOMEPLUG_AV101_MAX 1 #define CP_HOMEPLUG_AV101 0 /** Timer offset for beacon data update. */ #define CP_TIMER_OFFSET_CCO MAC_MS_TO_TCK(20) #define CP_TIMER_OFFSET_STA MAC_MS_TO_TCK(5) #endif /* cp_defs_h */