                                Add_Mib_Setting- v1.0
		-------------------------------------------------------
			
Introduction
============

    This document will introduce what is MIB and lead you how to add Mib setting.
	
    The Mib setting is used for system configuration.
	
    Mib settings are accessed via webpages and flash tools. flash tools is direct method to manage Mib settings by using console.
    You can refer to Modify_Webpages.txt to get more detail.
	
    In flash layout we have three Mib settings, they are HW Settings, Default Settings and Current Settings.
	
    - HW Settings
      HW settings is arguments of hardware settings, such as RF power index. It usually be set by MP tools. 
	  
    - Default Settings
      Default settings is backup setting. When you click "Reset to Default" button on webpages, or console command "flash default-sw", the current setting will be repleaced by default setting.    
    
    - Current Settings
      Current setting is current user setting, which is accessed by Webpages.
    
    CMK can generate the these settings, you can get more detail in CMK/README.txt
  
    Program-default setting is hardcode setting function which name is writeDefault() in flash.c.
  
Step
====
    1. At AP\goahead-2.1.1\LINUX\apmib.h. Create new MIB define.
       ex. "#define MIB_WLAN_11N_ONOFF_TKIP		660"		
    2. At AP\goahead-2.1.1\LINUX\apmib.h.
       Create new member in "config_setting" or in "config_wlan_setting".
       ex. "unsigned char wlan11nOnOffTKIP __PACK__;"
       * MUST add the new member at last.
       * Add new member in "config_wlan_setting" may cause the default and current setting become program-default setting.
    3. At AP\goahead-2.1.1\LINUX\mibtbl.c.
       Add new entry in "mib_table" or in "mib_wlan_table". 
       The entry format is {MIB number, "MIB name", TYPE_T, _OFFSET(cName), _SIZE(cName)}
       ex. "{MIB_WLAN_11N_ONOFF_TKIP,	"WLAN_11N_ONOFF_TKIP",	BYTE_T,		_OFFSET(wlan11nOnOffTKIP), _SIZE(wlan11nOnOffTKIP)},"	   	

    4. At AP\goahead-2.1.1\LINUX\flash.c.
       Add program-default value in "writeDefault" function in case new MIB setting has program-default value.	 	 	
	
Note
====
    * MUST add the new member at last because our mib is V structure, not TLV.
      If you didn't insert new value at last, it may cause data corruption.

    * Any of following conditions may cause the HW settings or Default setting become program-default settings.
      a. The Setting signature in flash is not equal to setting signature in firmware.
      b. The Setting version in flash is not equal to setting version in firmware.
      c. The Setting size in flash is less than setting size in firmware.
		
    * Any of following conditions may cause the Current setting replaced by Default settings.
      a. The Setting signature in flash is not equal to setting signature in firmware.
      b. The Setting version in flash is not equal to setting version in firmware.
      c. The Setting size in flash is less than setting size in firmware.

	
	
