###############################################################################
#                                                                             #
# IAR 8051 C/C++ Compiler V7.30B/W32                    12/Jun/2010  16:11:26 #
# Copyright 2004-2007 IAR Systems. All rights reserved.                       #
#                                                                             #
#    Core               =  plain                                              #
#    Code model         =  banked                                             #
#    Data model         =  large                                              #
#    Calling convention =  xdata reentrant                                    #
#    Constant location  =  data                                               #
#    Dptr setup         =  1,16                                               #
#    Source file        =  C:\Texas Instruments\ZStack-1.4.3-1.2.1\Components #
#                          \zmac\f8w\zmac.c                                   #
#    Command line       =  -f "C:\Texas Instruments\ZStack-1.4.3-1.2.1\Projec #
#                          ts\zstack\Samples\Location\CC2430DB\..\..\..\Tools #
#                          \CC2430DB\f8wRouter.cfg" (-DCPU32MHZ               #
#                          -DFORCE_MAC_NEAR -DROOT=__near_func                #
#                          -DMAC_CFG_APP_PENDING_QUEUE=TRUE -DRTR_NWK         #
#                          -DBLINK_LEDS "-DCONST=const __code"                #
#                          -DGENERIC=__generic) -f "C:\Texas                  #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\Tools\CC2430DB\f8w #
#                          Config.cfg" (-DSECURE=1 -DDEFAULT_CHANLIST=0x04000 #
#                          000 -DZDAPP_CONFIG_PAN_ID=0x00FF                   #
#                          -DNWK_START_DELAY=100 -DEXTENDED_JOINING_RANDOM_MA #
#                          SK=0x007F -DBEACON_REQUEST_DELAY=100               #
#                          -DBEACON_REQ_DELAY_MASK=0x00FF                     #
#                          -DROUTE_EXPIRY_TIME=30 -DAPSC_ACK_WAIT_DURATION_PO #
#                          LLED=3000 -DNWK_INDIRECT_MSG_TIMEOUT=7             #
#                          -DMAX_RREQ_ENTRIES=10 -DAPSC_MAX_FRAME_RETRIES=3   #
#                          -DNWK_MAX_DATA_RETRIES=2                           #
#                          -DMAX_POLL_FAILURE_RETRIES=2 -DMAX_BCAST=9         #
#                          -DAPS_MAX_GROUPS=16 -DMAX_RTG_ENTRIES=20           #
#                          -DNWK_MAX_BINDING_ENTRIES=10                       #
#                          -DMAX_BINDING_CLUSTER_IDS=5 "-DDEFAULT_KEY={0x02,  #
#                          0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F, 0x00,    #
#                          0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0D}"         #
#                          -DRFD_RCVC_ALWAYS_ON=FALSE -DPOLL_RATE=1000        #
#                          -DQUEUED_POLL_RATE=100 -DRESPONSE_POLL_RATE=100)   #
#                          -DREJOIN_POLL_RATE=440 "C:\Texas                   #
#                          Instruments\ZStack-1.4.3-1.2.1\Components\zmac\f8w #
#                          \zmac.c" -D CC2430EB -D LOCATION_REFNODE -D        #
#                          xNV_RESTORE -D ZTOOL_P1 -D MT_TASK -D              #
#                          POWER_SAVING -D HAL_UART_BIG_TX_BUF=1 -D           #
#                          SPI_MGR_DEFAULT_MAX_TX_BUFF=1024 -D                #
#                          SPI_MGR_DEFAULT_OVERFLOW=1 -lC "C:\Texas           #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\RefNode\List\" -lA          #
#                          "C:\Texas Instruments\ZStack-1.4.3-1.2.1\Projects\ #
#                          zstack\Samples\Location\CC2430DB\RefNode\List\"    #
#                          --diag_suppress Pe001,Pa010 --diag_remark pe550    #
#                          -o "C:\Texas Instruments\ZStack-1.4.3-1.2.1\Projec #
#                          ts\zstack\Samples\Location\CC2430DB\RefNode\Obj\"  #
#                          -e --require_prototypes -z9 --no_code_motion       #
#                          --debug --core=plain --dptr=16,1                   #
#                          --data_model=large --code_model=banked             #
#                          --calling_convention=xdata_reentrant               #
#                          --place_constants=data --nr_virtual_regs 8 -I      #
#                          "C:\Texas Instruments\ZStack-1.4.3-1.2.1\Projects\ #
#                          zstack\Samples\Location\CC2430DB\" -I "C:\Texas    #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\SOURCE\" -I "C:\Texas    #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\ZMAIN\TI2430DB\"   #
#                          -I "C:\Texas Instruments\ZStack-1.4.3-1.2.1\Projec #
#                          ts\zstack\Samples\Location\CC2430DB\..\..\..\..\.. #
#                          \COMPONENTS\MT\" -I "C:\Texas                      #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\..\..\COMPONENTS\H #
#                          AL\INCLUDE\" -I "C:\Texas                          #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\..\..\COMPONENTS\H #
#                          AL\TARGET\CC2430BB\" -I "C:\Texas                  #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\..\..\COMPONENTS\O #
#                          SAL\MCU\CCSOC\" -I "C:\Texas                       #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\..\..\COMPONENTS\O #
#                          SAL\INCLUDE\" -I "C:\Texas                         #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\..\..\COMPONENTS\S #
#                          TACK\AF\" -I "C:\Texas Instruments\ZStack-1.4.3-1. #
#                          2.1\Projects\zstack\Samples\Location\CC2430DB\..\. #
#                          .\..\..\..\COMPONENTS\STACK\NWK\" -I "C:\Texas     #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\..\..\COMPONENTS\S #
#                          TACK\SEC\" -I "C:\Texas Instruments\ZStack-1.4.3-1 #
#                          .2.1\Projects\zstack\Samples\Location\CC2430DB\..\ #
#                          ..\..\..\..\COMPONENTS\STACK\SYS\" -I "C:\Texas    #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\..\..\COMPONENTS\S #
#                          TACK\ZDO\" -I "C:\Texas Instruments\ZStack-1.4.3-1 #
#                          .2.1\Projects\zstack\Samples\Location\CC2430DB\..\ #
#                          ..\..\..\..\COMPONENTS\ZMAC\F8W\" -I "C:\Texas     #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\..\..\COMPONENTS\Z #
#                          MAC\" -I "C:\Texas Instruments\ZStack-1.4.3-1.2.1\ #
#                          Projects\zstack\Samples\Location\CC2430DB\..\..\.. #
#                          \..\..\COMPONENTS\SERVICES\SADDR\" -I "C:\Texas    #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\..\..\COMPONENTS\S #
#                          ERVICES\SDATA\" -I "C:\Texas                       #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\..\..\COMPONENTS\M #
#                          AC\INCLUDE\" -I "C:\Texas                          #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\..\..\COMPONENTS\M #
#                          AC\HIGH_LEVEL\" -I "C:\Texas                       #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\..\..\COMPONENTS\M #
#                          AC\LOW_LEVEL\SRF03\" -I "C:\Texas                  #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\..\..\COMPONENTS\M #
#                          AC\LOW_LEVEL\SRF03\SINGLE_CHIP\" -I "C:\Program    #
#                          Files\IAR Systems\Embedded Workbench 4.0           #
#                          Evaluation version\8051\INC\" -I "C:\Program       #
#                          Files\IAR Systems\Embedded Workbench 4.0           #
#                          Evaluation version\8051\INC\CLIB\"                 #
#    List file          =  C:\Texas Instruments\ZStack-1.4.3-1.2.1\Projects\z #
#                          stack\Samples\Location\CC2430DB\RefNode\List\zmac. #
#                          lst                                                #
#    Object file        =  C:\Texas Instruments\ZStack-1.4.3-1.2.1\Projects\z #
#                          stack\Samples\Location\CC2430DB\RefNode\Obj\zmac.r #
#                          51                                                 #
#                                                                             #
#                                                                             #
###############################################################################

C:\Texas Instruments\ZStack-1.4.3-1.2.1\Components\zmac\f8w\zmac.c
      1          /**************************************************************************************************
      2            Filename:       zmac.c
      3            Revised:        $Date: 2007-10-28 18:43:04 -0700 (Sun, 28 Oct 2007) $
      4            Revision:       $Revision: 15800 $
      5          
      6            Description:    This file contains the ZStack MAC Porting Layer
      7          
      8          
      9            Copyright 2005-2007 Texas Instruments Incorporated. All rights reserved.
     10          
     11            IMPORTANT: Your use of this Software is limited to those specific rights
     12            granted under the terms of a software license agreement between the user
     13            who downloaded the software, his/her employer (which must be your employer)
     14            and Texas Instruments Incorporated (the "License").  You may not use this
     15            Software unless you agree to abide by the terms of the License. The License
     16            limits your use, and you acknowledge, that the Software may not be modified,
     17            copied or distributed unless embedded on a Texas Instruments microcontroller
     18            or used solely and exclusively in conjunction with a Texas Instruments radio
     19            frequency transceiver, which is integrated into your product.  Other than for
     20            the foregoing purpose, you may not use, reproduce, copy, prepare derivative
     21            works of, modify, distribute, perform, display or sell this Software and/or
     22            its documentation for any purpose.
     23          
     24            YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE
     25            PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, 
     26            INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE, 
     27            NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL
     28            TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT,
     29            NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER
     30            LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
     31            INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE
     32            OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT
     33            OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
     34            (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
     35          
     36            Should you have any questions regarding your right to use this Software,
     37            contact Texas Instruments Incorporated at www.TI.com. 
     38          **************************************************************************************************/
     39          
     40          /********************************************************************************************************
     41           *                                               INCLUDES
     42           ********************************************************************************************************/
     43          
     44          #include "ZComDef.h"
     45          #include "OSAL.h"
     46          #include "ZMAC.h"
     47          
     48          /********************************************************************************************************
     49           *                                                 MACROS
     50           ********************************************************************************************************/
     51          
     52          /********************************************************************************************************
     53           *                                               CONSTANTS
     54           ********************************************************************************************************/

   \                                 In  segment CODE_C, align 1
     55          static CONST byte TxPowerSettings[] =
   \                     TxPowerSettings:
   \   000000   00212325     DB 0, 33, 35, 37, 39, 42, 47, 57
   \            272A2F39
     56          {
     57            OUTPUT_POWER_0DBM,
     58            OUTPUT_POWER_N1DBM,
     59            OUTPUT_POWER_N3DBM,
     60            OUTPUT_POWER_N5DBM,
     61            OUTPUT_POWER_N7DBM,
     62            OUTPUT_POWER_N10DBM,
     63            OUTPUT_POWER_N15DBM,
     64            OUTPUT_POWER_N25DBM
     65          };
     66          
     67          /********************************************************************************************************
     68           *                                               GLOBALS
     69           ********************************************************************************************************/

   \                                 In  segment XDATA_Z, align 1, keep-with-next
     70          uint32 _ScanChannels;
   \                     _ScanChannels:
   \   000000                DS 4
   \   000004                REQUIRE __INIT_XDATA_Z
     71          
     72          extern uint8 aExtendedAddress[];
     73          
     74          /********************************************************************************************************
     75           *                                               LOCALS
     76           ********************************************************************************************************/
     77          
     78          /* Pointer to scan result buffer */

   \                                 In  segment XDATA_Z, align 1, keep-with-next
     79          void *ZMac_ScanBuf = NULL;
   \                     ZMac_ScanBuf:
   \   000000                DS 2
   \   000002                REQUIRE __INIT_XDATA_Z
     80          
     81          /********************************************************************************************************
     82           * LOCAL FUNCTION PROTOTYPES
     83           ********************************************************************************************************/
     84          
     85          /********************************************************************************************************
     86           *                                                TYPEDEFS
     87           ********************************************************************************************************/
     88          
     89          
     90          /********************************************************************************************************
     91           *                                                FUNCTIONS
     92           ********************************************************************************************************/
     93          
     94          /********************************************************************************************************
     95           * @fn      ZMacInit
     96           *
     97           * @brief   Initialize MAC.
     98           *
     99           * @param   none.
    100           *
    101           * @return  status.
    102           ********************************************************************************************************/

   \                                 In  segment NEAR_CODE, align 1, keep-with-next
    103          ROOT uint8 ZMacInit( void )
   \                     ZMacInit:
    104          {
   \   000000   74F8         MOV     A,#-0x8
   \   000002   12....       LCALL   ?FUNC_ENTER_XDATA
   \   000005                ; Saved register size: 8
   \   000005                ; Auto size: 0
    105            uint8 stat;
    106          
    107            MAC_Init();
   \   000005                ; Setup parameters for call to function MAC_Init
   \   000005   12....       LCALL   ??MAC_Init?relay
    108            MAC_InitDevice();
   \   000008                ; Setup parameters for call to function MAC_InitDevice
   \   000008   12....       LCALL   ??MAC_InitDevice?relay
    109          
    110          #if defined ( RTR_NWK )
    111            MAC_InitCoord();
   \   00000B                ; Setup parameters for call to function MAC_InitCoord
   \   00000B   12....       LCALL   ??MAC_InitCoord?relay
    112          #endif
    113          
    114            // If OK, initialize the MAC
    115            stat = ZMacReset( TRUE );
   \   00000E                ; Setup parameters for call to function ZMacReset
   \   00000E   7901         MOV     R1,#0x1
   \   000010   12....       LCALL   ZMacReset
   \   000013   E9           MOV     A,R1
   \   000014   FE           MOV     R6,A
    116          
    117            // Turn off interrupts
    118            osal_int_disable( INTS_ALL );
   \   000015                ; Setup parameters for call to function osal_int_disable
   \   000015   79FF         MOV     R1,#-0x1
   \   000017   12....       LCALL   ??osal_int_disable?relay
    119          
    120            return ( stat );
   \   00001A   EE           MOV     A,R6
   \   00001B   F9           MOV     R1,A
   \   00001C   80..         SJMP    ??Subroutine6_0
    121          }

   \                                 In  segment NEAR_CODE, align 1, keep-with-next
   \                     ?Subroutine6:
   \   000000   7401         MOV     A,#0x1
   \   000002   12....       LCALL   ?DEALLOC_XSTACK8
   \                     ??Subroutine6_0:
   \   000005   7F01         MOV     R7,#0x1
   \   000007   02....       LJMP    ?FUNC_LEAVE_XDATA
    122          
    123          /********************************************************************************************************
    124           * @fn      ZMacUpdate
    125           *
    126           * @brief   Gives MAC (or others) some processing time.
    127           *
    128           * @param   none.
    129           *
    130           * @return  true if CPU needs to keep running (not sleep).
    131           ********************************************************************************************************/

   \                                 In  segment NEAR_CODE, align 1, keep-with-next
    132          ROOT byte ZMacUpdate( void )
   \                     ZMacUpdate:
    133          {
   \   000000                ; Saved register size: 0
   \   000000                ; Auto size: 0
    134            /* Put code here that needs to run each OSAL event loop */
    135            return ( false );
   \   000000   7900         MOV     R1,#0x0
   \   000002   22           RET
    136          }
    137          
    138          /********************************************************************************************************
    139           * @fn      ZMacReset
    140           *
    141           * @brief   Reset the MAC.
    142           *
    143           * @param   Default to PIB defaults.
    144           *
    145           * @return  status.
    146           ********************************************************************************************************/

   \                                 In  segment NEAR_CODE, align 1, keep-with-next
    147          ROOT uint8 ZMacReset( bool SetDefaultPIB )
   \                     ZMacReset:
    148          {
   \   000000   74F8         MOV     A,#-0x8
   \   000002   12....       LCALL   ?FUNC_ENTER_XDATA
   \   000005                ; Saved register size: 8
   \   000005                ; Auto size: 1
   \   000005   74FF         MOV     A,#-0x1
   \   000007   12....       LCALL   ?ALLOC_XSTACK8
    149            byte stat;
    150            byte value;
    151          
    152            stat = MAC_MlmeResetReq( SetDefaultPIB );
   \   00000A                ; Setup parameters for call to function MAC_MlmeResetReq
   \   00000A   12....       LCALL   ??MAC_MlmeResetReq?relay
   \   00000D   E9           MOV     A,R1
   \   00000E   FE           MOV     R6,A
    153          
    154            // Don't send PAN ID conflict
    155            value = FALSE;
   \   00000F   E4           CLR     A
   \   000010   85..82       MOV     DPL,?XSP + 0
   \   000013   85..83       MOV     DPH,?XSP + 1
   \   000016   F0           MOVX    @DPTR,A
    156            MAC_MlmeSetReq( MAC_ASSOCIATED_PAN_COORD, &value );
   \   000017                ; Setup parameters for call to function MAC_MlmeSetReq
   \   000017   AA82         MOV     R2,DPL
   \   000019   AB83         MOV     R3,DPH
   \   00001B   7956         MOV     R1,#0x56
   \   00001D   12....       LCALL   ??MAC_MlmeSetReq?relay
    157            MAC_MlmeSetReq( MAC_EXTENDED_ADDRESS, &aExtendedAddress );
   \   000020                ; Setup parameters for call to function MAC_MlmeSetReq
   \   000020   7A..         MOV     R2,#(aExtendedAddress & 0xff)
   \   000022   7B..         MOV     R3,#((aExtendedAddress >> 8) & 0xff)
   \   000024   79E2         MOV     R1,#-0x1e
   \   000026   12....       LCALL   ??MAC_MlmeSetReq?relay
    158          
    159            if (ZMac_ScanBuf)
   \   000029   90....       MOV     DPTR,#ZMac_ScanBuf
   \   00002C   E0           MOVX    A,@DPTR
   \   00002D   7002         JNZ     ??ZMacReset_0
   \   00002F   A3           INC     DPTR
   \   000030   E0           MOVX    A,@DPTR
   \                     ??ZMacReset_0:
   \   000031   6012         JZ      ??ZMacReset_1
    160            {
    161              osal_mem_free(ZMac_ScanBuf);
   \   000033                ; Setup parameters for call to function osal_mem_free
   \   000033   90....       MOV     DPTR,#ZMac_ScanBuf
   \   000036   E0           MOVX    A,@DPTR
   \   000037   FA           MOV     R2,A
   \   000038   A3           INC     DPTR
   \   000039   E0           MOVX    A,@DPTR
   \   00003A   FB           MOV     R3,A
   \   00003B   12....       LCALL   ??osal_mem_free?relay
    162              ZMac_ScanBuf = NULL;
   \   00003E   90....       MOV     DPTR,#ZMac_ScanBuf
   \   000041   E4           CLR     A
   \   000042   F0           MOVX    @DPTR,A
   \   000043   A3           INC     DPTR
   \   000044   F0           MOVX    @DPTR,A
    163            }
    164          
    165            return ( stat );
   \                     ??ZMacReset_1:
   \   000045   EE           MOV     A,R6
   \   000046   F9           MOV     R1,A
   \   000047   80..         SJMP    ?Subroutine6
    166          }
    167          
    168          
    169          /********************************************************************************************************
    170           * @fn      ZMacGetReq
    171           *
    172           * @brief   Read a MAC PIB attribute.
    173           *
    174           * @param   attr - PIB attribute to get
    175           * @param   value - pointer to the buffer to store the attribute
    176           *
    177           * @return  status
    178           ********************************************************************************************************/

   \                                 In  segment NEAR_CODE, align 1, keep-with-next
    179          ROOT uint8 ZMacGetReq( uint8 attr, uint8 *value )
   \                     ZMacGetReq:
    180          {
   \   000000   C082         PUSH    DPL
   \   000002   C083         PUSH    DPH
   \   000004                ; Saved register size: 2
   \   000004                ; Auto size: 0
    181            if ( attr == ZMacExtAddr )
   \   000004   74E2         MOV     A,#-0x1e
   \   000006   69           XRL     A,R1
   \   000007   700B         JNZ     ??ZMacGetReq_0
    182            {
    183              osal_cpyExtAddr( value, &aExtendedAddress );
   \   000009                ; Setup parameters for call to function osal_cpyExtAddr
   \   000009   7C..         MOV     R4,#(aExtendedAddress & 0xff)
   \   00000B   7D..         MOV     R5,#((aExtendedAddress >> 8) & 0xff)
   \   00000D   12....       LCALL   ??osal_cpyExtAddr?relay
    184              return ZMacSuccess;
   \   000010   7900         MOV     R1,#0x0
   \   000012   8003         SJMP    ??ZMacGetReq_1
    185            }
    186          
    187            return (ZMacStatus_t) MAC_MlmeGetReq( attr, value );
   \                     ??ZMacGetReq_0:
   \   000014                ; Setup parameters for call to function MAC_MlmeGetReq
   \   000014   12....       LCALL   ??MAC_MlmeGetReq?relay
   \                     ??ZMacGetReq_1:
   \   000017   02....       LJMP    ??Subroutine7_0
    188          }

   \                                 In  segment NEAR_CODE, align 1, keep-with-next
   \                     ?Subroutine7:
   \   000000   7900         MOV     R1,#0x0
   \                     ??Subroutine7_0:
   \   000002   D083         POP     DPH
   \   000004   D082         POP     DPL
   \   000006   22           RET
    189          
    190          
    191          /********************************************************************************************************
    192           * @fn      ZMacSetReq
    193           *
    194           * @brief   Write a MAC PIB attribute.
    195           *
    196           * @param   attr - PIB attribute to Set
    197           * @param   value - pointer to the data
    198           *
    199           * @return  status
    200           ********************************************************************************************************/

   \                                 In  segment NEAR_CODE, align 1, keep-with-next
    201          ROOT uint8 ZMacSetReq( uint8 attr, byte *value )
   \                     ZMacSetReq:
    202          {
   \   000000   74F8         MOV     A,#-0x8
   \   000002   12....       LCALL   ?FUNC_ENTER_XDATA
   \   000005                ; Saved register size: 8
   \   000005                ; Auto size: 0
   \   000005   89..         MOV     ?V0 + 0,R1
   \   000007   EA           MOV     A,R2
   \   000008   FE           MOV     R6,A
   \   000009   EB           MOV     A,R3
   \   00000A   FF           MOV     R7,A
    203            if ( attr == ZMacExtAddr )
   \   00000B   74E2         MOV     A,#-0x1e
   \   00000D   65..         XRL     A,?V0 + 0
   \   00000F   700B         JNZ     ??ZMacSetReq_0
    204            {
    205              osal_cpyExtAddr( &aExtendedAddress, value );
   \   000011                ; Setup parameters for call to function osal_cpyExtAddr
   \   000011   EE           MOV     A,R6
   \   000012   FC           MOV     R4,A
   \   000013   EF           MOV     A,R7
   \   000014   FD           MOV     R5,A
   \   000015   7A..         MOV     R2,#(aExtendedAddress & 0xff)
   \   000017   7B..         MOV     R3,#((aExtendedAddress >> 8) & 0xff)
   \   000019   12....       LCALL   ??osal_cpyExtAddr?relay
    206            }
    207          
    208            return (ZMacStatus_t) MAC_MlmeSetReq( attr, value );
   \                     ??ZMacSetReq_0:
   \   00001C                ; Setup parameters for call to function MAC_MlmeSetReq
   \   00001C   EE           MOV     A,R6
   \   00001D   FA           MOV     R2,A
   \   00001E   EF           MOV     A,R7
   \   00001F   FB           MOV     R3,A
   \   000020   A9..         MOV     R1,?V0 + 0
   \   000022   12....       LCALL   ??MAC_MlmeSetReq?relay
   \   000025   02....       LJMP    ??Subroutine6_0
    209          }
    210          
    211          /********************************************************************************************************
    212           * @fn      ZMacAssociateReq
    213           *
    214           * @brief   Request an association with a coordinator.
    215           *
    216           * @param   structure with info need to associate.
    217           *
    218           * @return  status
    219           ********************************************************************************************************/

   \                                 In  segment NEAR_CODE, align 1, keep-with-next
    220          ROOT uint8 ZMacAssociateReq( ZMacAssociateReq_t *pData )
   \                     ZMacAssociateReq:
    221          {
   \   000000   C082         PUSH    DPL
   \   000002   C083         PUSH    DPH
   \   000004                ; Saved register size: 2
   \   000004                ; Auto size: 0
    222            /* Right now, set security to zero */
    223            pData->Sec.SecurityLevel = false;
   \   000004   EA           MOV     A,R2
   \   000005   2416         ADD     A,#0x16
   \   000007   12....       LCALL   ?Subroutine2
    224          
    225            MAC_MlmeAssociateReq ( (macMlmeAssociateReq_t *)pData);
   \                     ??CrossCallReturnLabel_5:
   \   00000A                ; Setup parameters for call to function MAC_MlmeAssociateReq
   \   00000A   12....       LCALL   ??MAC_MlmeAssociateReq?relay
    226            return ( ZMacSuccess );
   \   00000D   02....       LJMP    ?Subroutine7
    227          }

   \                                 In  segment NEAR_CODE, align 1, keep-with-next
   \                     ?Subroutine2:
   \   000000   F582         MOV     DPL,A
   \   000002   EB           MOV     A,R3
   \                     ??Subroutine2_0:
   \   000003   12....       LCALL   ?Subroutine5
   \                     ??CrossCallReturnLabel_21:
   \   000006   22           RET

   \                                 In  segment NEAR_CODE, align 1, keep-with-next
   \                     ?Subroutine5:
   \   000000   3400         ADDC    A,#0x0
   \   000002   F583         MOV     DPH,A
   \   000004   E4           CLR     A
   \   000005   F0           MOVX    @DPTR,A
   \   000006   22           RET
    228          
    229          /********************************************************************************************************
    230           * @fn      ZMacAssociateRsp
    231           *
    232           * @brief   Request to send an association response message.
    233           *
    234           * @param   structure with associate response and info needed to send it.
    235           *
    236           * @return  status
    237           ********************************************************************************************************/

   \                                 In  segment NEAR_CODE, align 1, keep-with-next
    238          ROOT uint8 ZMacAssociateRsp( ZMacAssociateRsp_t *pData )
   \                     ZMacAssociateRsp:
    239          {
   \   000000   C082         PUSH    DPL
   \   000002   C083         PUSH    DPH
   \   000004                ; Saved register size: 2
   \   000004                ; Auto size: 0
    240            /* Right now, set security to zero */
    241            pData->Sec.SecurityLevel = false;
   \   000004   12....       LCALL   ?Subroutine0
    242          
    243            MAC_MlmeAssociateRsp( (macMlmeAssociateRsp_t *) pData );
   \                     ??CrossCallReturnLabel_0:
   \   000007                ; Setup parameters for call to function MAC_MlmeAssociateRsp
   \   000007   12....       LCALL   ??MAC_MlmeAssociateRsp?relay
    244            return ( ZMacSuccess );
   \   00000A   02....       LJMP    ?Subroutine7
    245          }

   \                                 In  segment NEAR_CODE, align 1, keep-with-next
   \                     ?Subroutine0:
   \   000000   EA           MOV     A,R2
   \   000001   2413         ADD     A,#0x13
   \   000003   F582         MOV     DPL,A
   \   000005   EB           MOV     A,R3
   \   000006   12....       LCALL   ?Subroutine5
   \                     ??CrossCallReturnLabel_19:
   \   000009   22           RET
    246          
    247          /********************************************************************************************************
    248           * @fn      ZMacDisassociateReq
    249           *
    250           * @brief   Request to send a disassociate request message.
    251           *
    252           * @param   structure with info need send it.
    253           *
    254           * @return  status
    255           ********************************************************************************************************/

   \                                 In  segment NEAR_CODE, align 1, keep-with-next
    256          ROOT uint8 ZMacDisassociateReq( ZMacDisassociateReq_t *pData )
   \                     ZMacDisassociateReq:
    257          {
   \   000000   C082         PUSH    DPL
   \   000002   C083         PUSH    DPH
   \   000004                ; Saved register size: 2
   \   000004                ; Auto size: 0
    258            /* Right now, set security to zero */
    259            pData->Sec.SecurityLevel = false;
   \   000004   EA           MOV     A,R2
   \   000005   2415         ADD     A,#0x15
   \   000007   12....       LCALL   ?Subroutine2
    260          
    261            MAC_MlmeDisassociateReq( (macMlmeDisassociateReq_t *)pData);
   \                     ??CrossCallReturnLabel_6:
   \   00000A                ; Setup parameters for call to function MAC_MlmeDisassociateReq
   \   00000A   12....       LCALL   ??MAC_MlmeDisassociateReq?relay
    262            return ( ZMacSuccess );
   \   00000D   02....       LJMP    ?Subroutine7
    263          }
    264          
    265          /********************************************************************************************************
    266           * @fn      ZMacOrphanRsp
    267           *
    268           * @brief   Allows next higher layer to respond to an orphan indication message.
    269           *
    270           * @param   structure with info need send it.
    271           *
    272           * @return  status
    273           ********************************************************************************************************/

   \                                 In  segment NEAR_CODE, align 1, keep-with-next
    274          ROOT uint8 ZMacOrphanRsp( ZMacOrphanRsp_t *pData )
   \                     ZMacOrphanRsp:
    275          {
   \   000000   C082         PUSH    DPL
   \   000002   C083         PUSH    DPH
   \   000004                ; Saved register size: 2
   \   000004                ; Auto size: 0
    276            /* Right now, set security to zero */
    277            pData->Sec.SecurityLevel = false;
   \   000004   12....       LCALL   ?Subroutine0
    278          
    279            MAC_MlmeOrphanRsp( (macMlmeOrphanRsp_t *)pData);
   \                     ??CrossCallReturnLabel_1:
   \   000007                ; Setup parameters for call to function MAC_MlmeOrphanRsp
   \   000007   12....       LCALL   ??MAC_MlmeOrphanRsp?relay
    280            return ( ZMacSuccess );
   \   00000A   02....       LJMP    ?Subroutine7
    281          }
    282          
    283          /********************************************************************************************************
    284           * @fn      ZMacRxEnableReq
    285           *
    286           * @brief   This function contains timing information that tells the
    287           *          device when to enable or disable its receiver, in order
    288           *          to schedule a data transfer between itself and another
    289           *          device. The information is sent from the upper layers
    290           *          directly to the MAC sublayer.
    291           *
    292           * @param   structure with info need send it.
    293           *
    294           * @return  status
    295           ********************************************************************************************************/

   \                                 In  segment NEAR_CODE, align 1, keep-with-next
    296          ROOT uint8 ZMacRxEnableReq( ZMacRxEnableReq_t *pData )
   \                     ZMacRxEnableReq:
    297          {
   \   000000                ; Saved register size: 0
   \   000000                ; Auto size: 0
    298            /* This feature is no longer in the TIMAC */
    299            return ( ZMacUnsupported );
   \   000000   79F5         MOV     R1,#-0xb
   \   000002   22           RET
    300          }
    301          
    302          /********************************************************************************************************
    303           * @fn      ZMacScanReq
    304           *
    305           * @brief   This function is called to perform a network scan.
    306           *
    307           * @param   param - structure with info need send it.
    308           *
    309           * @return  status
    310           ********************************************************************************************************/

   \                                 In  segment NEAR_CODE, align 1, keep-with-next
    311          ROOT uint8 ZMacScanReq( ZMacScanReq_t *pData )
   \                     ZMacScanReq:
    312          {
   \   000000   74F5         MOV     A,#-0xb
   \   000002   12....       LCALL   ?FUNC_ENTER_XDATA
   \   000005                ; Saved register size: 11
   \   000005                ; Auto size: 0
   \   000005   EA           MOV     A,R2
   \   000006   FE           MOV     R6,A
   \   000007   EB           MOV     A,R3
   \   000008   FF           MOV     R7,A
    313            _ScanChannels = pData->ScanChannels;
   \   000009   8E82         MOV     DPL,R6
   \   00000B   8F83         MOV     DPH,R7
   \   00000D   78..         MOV     R0,#?V0 + 0
   \   00000F   12....       LCALL   ?L_MOV_X
   \   000012   90....       MOV     DPTR,#_ScanChannels
   \   000015   78..         MOV     R0,#?V0 + 0
   \   000017   12....       LCALL   ?L_MOV_TO_X
    314          
    315            /* scan in progress */
    316            if (ZMac_ScanBuf != NULL)
   \   00001A   90....       MOV     DPTR,#ZMac_ScanBuf
   \   00001D   E0           MOVX    A,@DPTR
   \   00001E   7002         JNZ     ??ZMacScanReq_0
   \   000020   A3           INC     DPTR
   \   000021   E0           MOVX    A,@DPTR
   \                     ??ZMacScanReq_0:
   \   000022   6005         JZ      ??ZMacScanReq_1
    317            {
    318              return MAC_SCAN_IN_PROGRESS;
   \   000024   79FC         MOV     R1,#-0x4
   \   000026   02....       LJMP    ??ZMacScanReq_2
    319            }
    320          
    321            if (pData->ScanType != ZMAC_ORPHAN_SCAN)
   \                     ??ZMacScanReq_1:
   \   000029   8E82         MOV     DPL,R6
   \   00002B   8F83         MOV     DPH,R7
   \   00002D   A3           INC     DPTR
   \   00002E   A3           INC     DPTR
   \   00002F   A3           INC     DPTR
   \   000030   A3           INC     DPTR
   \   000031   E0           MOVX    A,@DPTR
   \   000032   6403         XRL     A,#0x3
   \   000034   7003         JNZ     $+5
   \   000036   02....       LJMP    ??ZMacScanReq_3
    322            {
    323              /* Allocate memory depends on the scan type */
    324              if (pData->ScanType == ZMAC_ED_SCAN)
   \   000039   8E82         MOV     DPL,R6
   \   00003B   8F83         MOV     DPH,R7
   \   00003D   A3           INC     DPTR
   \   00003E   A3           INC     DPTR
   \   00003F   A3           INC     DPTR
   \   000040   A3           INC     DPTR
   \   000041   E0           MOVX    A,@DPTR
   \   000042   7047         JNZ     ??ZMacScanReq_4
    325              {
    326                if ((ZMac_ScanBuf = osal_mem_alloc(ZMAC_ED_SCAN_MAXCHANNELS)) == NULL)
   \   000044                ; Setup parameters for call to function osal_mem_alloc
   \   000044   7A1B         MOV     R2,#0x1b
   \   000046   7B00         MOV     R3,#0x0
   \   000048   12....       LCALL   ??osal_mem_alloc?relay
   \   00004B   8A..         MOV     ?V0 + 0,R2
   \   00004D   8B..         MOV     ?V0 + 1,R3
   \   00004F   A8..         MOV     R0,?V0 + 0
   \   000051   A9..         MOV     R1,?V0 + 1
   \   000053   90....       MOV     DPTR,#ZMac_ScanBuf
   \   000056   E8           MOV     A,R0
   \   000057   F0           MOVX    @DPTR,A
   \   000058   A3           INC     DPTR
   \   000059   E9           MOV     A,R1
   \   00005A   F0           MOVX    @DPTR,A
   \   00005B   E8           MOV     A,R0
   \   00005C   7001         JNZ     ??ZMacScanReq_5
   \   00005E   E9           MOV     A,R1
   \                     ??ZMacScanReq_5:
   \   00005F   7005         JNZ     ??ZMacScanReq_6
    327                {
    328                  return MAC_NO_RESOURCES;
   \                     ??ZMacScanReq_7:
   \   000061   791A         MOV     R1,#0x1a
   \   000063   02....       LJMP    ??ZMacScanReq_2
    329                }
    330                osal_memset(ZMac_ScanBuf, 0, ZMAC_ED_SCAN_MAXCHANNELS);
   \                     ??ZMacScanReq_6:
   \   000066                ; Setup parameters for call to function osal_memset
   \   000066   7C1B         MOV     R4,#0x1b
   \   000068   7D00         MOV     R5,#0x0
   \   00006A   7900         MOV     R1,#0x0
   \   00006C   12....       LCALL   ??osal_memset?relay
    331                pData->Result.pEnergyDetect = ((uint8*)ZMac_ScanBuf) + MAC_CHAN_11;
   \   00006F   90....       MOV     DPTR,#ZMac_ScanBuf
   \   000072   E0           MOVX    A,@DPTR
   \   000073   240B         ADD     A,#0xb
   \   000075   F8           MOV     R0,A
   \   000076   A3           INC     DPTR
   \   000077   E0           MOVX    A,@DPTR
   \   000078   3400         ADDC    A,#0x0
   \   00007A   F9           MOV     R1,A
   \   00007B   EE           MOV     A,R6
   \   00007C   2413         ADD     A,#0x13
   \   00007E   F582         MOV     DPL,A
   \   000080   EF           MOV     A,R7
   \   000081   12....       LCALL   ??Subroutine4_0
   \                     ??CrossCallReturnLabel_13:
   \   000084   E8           MOV     A,R0
   \   000085   F0           MOVX    @DPTR,A
   \   000086   A3           INC     DPTR
   \   000087   E9           MOV     A,R1
   \   000088   F0           MOVX    @DPTR,A
   \   000089   8056         SJMP    ??ZMacScanReq_3
    332              }
    333              else if (pData->MaxResults > 0)
   \                     ??ZMacScanReq_4:
   \   00008B   8E82         MOV     DPL,R6
   \   00008D   8F83         MOV     DPH,R7
   \   00008F   A3           INC     DPTR
   \   000090   A3           INC     DPTR
   \   000091   A3           INC     DPTR
   \   000092   A3           INC     DPTR
   \   000093   A3           INC     DPTR
   \   000094   A3           INC     DPTR
   \   000095   A3           INC     DPTR
   \   000096   E0           MOVX    A,@DPTR
   \   000097   6048         JZ      ??ZMacScanReq_3
    334              {
    335                if ((ZMac_ScanBuf = pData->Result.pPanDescriptor =
    336                     osal_mem_alloc( sizeof( ZMacPanDesc_t ) * pData->MaxResults )) == NULL)
   \   000099   EE           MOV     A,R6
   \   00009A   2413         ADD     A,#0x13
   \   00009C   F5..         MOV     ?V0 + 0,A
   \   00009E   EF           MOV     A,R7
   \   00009F   3400         ADDC    A,#0x0
   \   0000A1   F5..         MOV     ?V0 + 1,A
   \   0000A3                ; Setup parameters for call to function osal_mem_alloc
   \   0000A3   8E82         MOV     DPL,R6
   \   0000A5   8F83         MOV     DPH,R7
   \   0000A7   A3           INC     DPTR
   \   0000A8   A3           INC     DPTR
   \   0000A9   A3           INC     DPTR
   \   0000AA   A3           INC     DPTR
   \   0000AB   A3           INC     DPTR
   \   0000AC   A3           INC     DPTR
   \   0000AD   A3           INC     DPTR
   \   0000AE   E0           MOVX    A,@DPTR
   \   0000AF   75F021       MOV     B,#0x21
   \   0000B2   A4           MUL     AB
   \   0000B3   FA           MOV     R2,A
   \   0000B4   ABF0         MOV     R3,B
   \   0000B6   12....       LCALL   ??osal_mem_alloc?relay
   \   0000B9   85..82       MOV     DPL,?V0 + 0
   \   0000BC   85..83       MOV     DPH,?V0 + 1
   \   0000BF   EA           MOV     A,R2
   \   0000C0   F0           MOVX    @DPTR,A
   \   0000C1   A3           INC     DPTR
   \   0000C2   EB           MOV     A,R3
   \   0000C3   F0           MOVX    @DPTR,A
   \   0000C4   85..82       MOV     DPL,?V0 + 0
   \   0000C7   85..83       MOV     DPH,?V0 + 1
   \   0000CA   E0           MOVX    A,@DPTR
   \   0000CB   F8           MOV     R0,A
   \   0000CC   A3           INC     DPTR
   \   0000CD   E0           MOVX    A,@DPTR
   \   0000CE   F9           MOV     R1,A
   \   0000CF   90....       MOV     DPTR,#ZMac_ScanBuf
   \   0000D2   E8           MOV     A,R0
   \   0000D3   F0           MOVX    @DPTR,A
   \   0000D4   A3           INC     DPTR
   \   0000D5   E9           MOV     A,R1
   \   0000D6   F0           MOVX    @DPTR,A
   \   0000D7   90....       MOV     DPTR,#ZMac_ScanBuf
   \   0000DA   E0           MOVX    A,@DPTR
   \   0000DB   7002         JNZ     ??ZMacScanReq_8
   \   0000DD   A3           INC     DPTR
   \   0000DE   E0           MOVX    A,@DPTR
   \                     ??ZMacScanReq_8:
   \   0000DF   6080         JZ      ??ZMacScanReq_7
    337                {
    338                  return MAC_NO_RESOURCES;
    339                }
    340              }
    341            }
    342          
    343            /* Right now, set security to zero */
    344            pData->Sec.SecurityLevel = false;
   \                     ??ZMacScanReq_3:
   \   0000E1   EE           MOV     A,R6
   \   0000E2   2410         ADD     A,#0x10
   \   0000E4   F582         MOV     DPL,A
   \   0000E6   EF           MOV     A,R7
   \   0000E7   12....       LCALL   ??Subroutine2_0
    345          
    346            /* Channel Page */
    347            pData->ChannelPage = 0x00;
   \                     ??CrossCallReturnLabel_7:
   \   0000EA   8E82         MOV     DPL,R6
   \   0000EC   8F83         MOV     DPH,R7
   \   0000EE   A3           INC     DPTR
   \   0000EF   A3           INC     DPTR
   \   0000F0   A3           INC     DPTR
   \   0000F1   A3           INC     DPTR
   \   0000F2   A3           INC     DPTR
   \   0000F3   A3           INC     DPTR
   \   0000F4   F0           MOVX    @DPTR,A
    348          
    349            MAC_MlmeScanReq ((macMlmeScanReq_t *)pData);
   \   0000F5                ; Setup parameters for call to function MAC_MlmeScanReq
   \   0000F5   EE           MOV     A,R6
   \   0000F6   FA           MOV     R2,A
   \   0000F7   EF           MOV     A,R7
   \   0000F8   FB           MOV     R3,A
   \   0000F9   12....       LCALL   ??MAC_MlmeScanReq?relay
    350          
    351            return ZMacSuccess;
   \   0000FC   7900         MOV     R1,#0x0
   \                     ??ZMacScanReq_2:
   \   0000FE                REQUIRE ?Subroutine8
   \   0000FE                ; // Fall through to label ?Subroutine8
    352          }

   \                                 In  segment NEAR_CODE, align 1, keep-with-next
   \                     ?Subroutine8:
   \   000000   7F04         MOV     R7,#0x4
   \   000002   02....       LJMP    ?FUNC_LEAVE_XDATA

   \                                 In  segment NEAR_CODE, align 1, keep-with-next
   \                     ?Subroutine4:
   \   000000   F582         MOV     DPL,A
   \   000002   EB           MOV     A,R3
   \                     ??Subroutine4_0:
   \   000003   3400         ADDC    A,#0x0
   \   000005   F583         MOV     DPH,A
   \   000007   22           RET
    353          
    354          
    355          /********************************************************************************************************
    356           * @fn      ZMacStartReq
    357           *
    358           * @brief   This function is called to tell the MAC to transmit beacons
    359           *          and become a coordinator.
    360           *
    361           * @param   structure with info need send it.
    362           *
    363           * @return  status
    364           ********************************************************************************************************/

   \                                 In  segment NEAR_CODE, align 1, keep-with-next
    365          ROOT uint8 ZMacStartReq( ZMacStartReq_t *pData )
   \                     ZMacStartReq:
    366          {
   \   000000   74F8         MOV     A,#-0x8
   \   000002   12....       LCALL   ?FUNC_ENTER_XDATA
   \   000005                ; Saved register size: 8
   \   000005                ; Auto size: 1
   \   000005   74FF         MOV     A,#-0x1
   \   000007   12....       LCALL   ?ALLOC_XSTACK8
   \   00000A   EA           MOV     A,R2
   \   00000B   FE           MOV     R6,A
   \   00000C   EB           MOV     A,R3
   \   00000D   FF           MOV     R7,A
    367            uint8 stat;
    368          
    369            // Probably want to keep the receiver on
    370            stat = true;
   \   00000E   7401         MOV     A,#0x1
   \   000010   85..82       MOV     DPL,?XSP + 0
   \   000013   85..83       MOV     DPH,?XSP + 1
   \   000016   F0           MOVX    @DPTR,A
    371            MAC_MlmeSetReq( MAC_RX_ON_WHEN_IDLE, &stat );
   \   000017                ; Setup parameters for call to function MAC_MlmeSetReq
   \   000017   AA82         MOV     R2,DPL
   \   000019   AB83         MOV     R3,DPH
   \   00001B   7952         MOV     R1,#0x52
   \   00001D   12....       LCALL   ??MAC_MlmeSetReq?relay
    372          
    373            /* Right now, set security to zero */
    374            pData->RealignSec.SecurityLevel = false;
   \   000020   EE           MOV     A,R6
   \   000021   2415         ADD     A,#0x15
   \   000023   F582         MOV     DPL,A
   \   000025   EF           MOV     A,R7
   \   000026   12....       LCALL   ??Subroutine2_0
    375            pData->BeaconSec.SecurityLevel = false;
   \                     ??CrossCallReturnLabel_8:
   \   000029   EE           MOV     A,R6
   \   00002A   2420         ADD     A,#0x20
   \   00002C   12....       LCALL   ?Subroutine1
    376          
    377          
    378            MAC_MlmeStartReq((macMlmeStartReq_t *) pData);
   \                     ??CrossCallReturnLabel_3:
   \   00002F   12....       LCALL   ??MAC_MlmeStartReq?relay
    379          
    380            // MAC does not issue mlmeStartConfirm(), so we have to
    381            // mlmeStartConfirm( stat );  This needs to be addressed some how
    382          
    383            return ZMacSuccess;
   \   000032   7900         MOV     R1,#0x0
   \   000034   02....       LJMP    ?Subroutine6
    384          }

   \                                 In  segment NEAR_CODE, align 1, keep-with-next
   \                     ?Subroutine1:
   \   000000   F582         MOV     DPL,A
   \   000002   EF           MOV     A,R7
   \   000003   12....       LCALL   ?Subroutine5
   \                     ??CrossCallReturnLabel_20:
   \   000006                ; Setup parameters for call to function MAC_MlmeStartReq
   \   000006                ; Setup parameters for call to function MAC_McpsDataReq
   \   000006   EE           MOV     A,R6
   \   000007   FA           MOV     R2,A
   \   000008   EF           MOV     A,R7
   \   000009   FB           MOV     R3,A
   \   00000A   22           RET
    385          
    386          /********************************************************************************************************
    387           * @fn      ZMacSyncReq
    388           *
    389           * @brief   This function is called to request a sync to the current
    390           *          networks beacons.
    391           *
    392           * @param   LogicalChannel -
    393           * @param   TrackBeacon - true/false
    394           *
    395           * @return  status
    396           ********************************************************************************************************/

   \                                 In  segment NEAR_CODE, align 1, keep-with-next
    397          ROOT uint8 ZMacSyncReq( ZMacSyncReq_t *pData )
   \                     ZMacSyncReq:
    398          {
   \   000000   C082         PUSH    DPL
   \   000002   C083         PUSH    DPH
   \   000004                ; Saved register size: 2
   \   000004                ; Auto size: 0
    399            MAC_MlmeSyncReq( (macMlmeSyncReq_t *)pData);
   \   000004                ; Setup parameters for call to function MAC_MlmeSyncReq
   \   000004   12....       LCALL   ??MAC_MlmeSyncReq?relay
    400            return ZMacSuccess;
   \   000007                REQUIRE ?Subroutine7
   \   000007                ; // Fall through to label ?Subroutine7
    401          }
    402          
    403          /********************************************************************************************************
    404           * @fn      ZMacPollReq
    405           *
    406           * @brief   This function is called to request MAC data request poll.
    407           *
    408           * @param   coordAddr -
    409           * @param   coordPanId -
    410           * @param   SecurityEnable - true or false.
    411           *
    412           * @return  status
    413           ********************************************************************************************************/

   \                                 In  segment NEAR_CODE, align 1, keep-with-next
    414          ROOT uint8 ZMacPollReq( ZMacPollReq_t *pData )
   \                     ZMacPollReq:
    415          {
   \   000000   C082         PUSH    DPL
   \   000002   C083         PUSH    DPH
   \   000004                ; Saved register size: 2
   \   000004                ; Auto size: 0
    416            /* Right now, set security to zero */
    417            pData->Sec.SecurityLevel = false;
   \   000004   12....       LCALL   ?Subroutine0
    418          
    419            MAC_MlmePollReq ((macMlmePollReq_t *)pData);
   \                     ??CrossCallReturnLabel_2:
   \   000007                ; Setup parameters for call to function MAC_MlmePollReq
   \   000007   12....       LCALL   ??MAC_MlmePollReq?relay
    420            return ( ZMacSuccess );
   \   00000A   80..         SJMP    ?Subroutine7
    421          }
    422          
    423          /********************************************************************************************************
    424           * @fn      ZMacDataReq
    425           *
    426           * @brief   Send a MAC Data Frame packet.
    427           *
    428           * @param   structure containing data and where to send it.
    429           *
    430           * @return  status
    431           ********************************************************************************************************/

   \                                 In  segment NEAR_CODE, align 1, keep-with-next
    432          ROOT uint8 ZMacDataReq( ZMacDataReq_t *pData )
   \                     ZMacDataReq:
    433          {
   \   000000   74F3         MOV     A,#-0xd
   \   000002   12....       LCALL   ?FUNC_ENTER_XDATA
   \   000005                ; Saved register size: 13
   \   000005                ; Auto size: 0
   \   000005   8A..         MOV     ?V0 + 4,R2
   \   000007   8B..         MOV     ?V0 + 5,R3
    434            macMcpsDataReq_t *pBuf;
    435          
    436            /* Allocate memory */
    437            pBuf = MAC_McpsDataAlloc(pData->msduLength, MAC_SEC_LEVEL_NONE, MAC_KEY_ID_MODE_NONE);
   \   000009                ; Setup parameters for call to function MAC_McpsDataAlloc
   \   000009   7B00         MOV     R3,#0x0
   \   00000B   7A00         MOV     R2,#0x0
   \   00000D   E5..         MOV     A,?V0 + 4
   \   00000F   241B         ADD     A,#0x1b
   \   000011   F582         MOV     DPL,A
   \   000013   E5..         MOV     A,?V0 + 5
   \   000015   12....       LCALL   ??Subroutine4_0
   \                     ??CrossCallReturnLabel_14:
   \   000018   E0           MOVX    A,@DPTR
   \   000019   F9           MOV     R1,A
   \   00001A   12....       LCALL   ??MAC_McpsDataAlloc?relay
   \   00001D   8A..         MOV     ?V0 + 0,R2
   \   00001F   8B..         MOV     ?V0 + 1,R3
   \   000021   AE..         MOV     R6,?V0 + 0
   \   000023   AF..         MOV     R7,?V0 + 1
    438          
    439            if (pBuf)
   \   000025   EE           MOV     A,R6
   \   000026   7001         JNZ     ??ZMacDataReq_0
   \   000028   EF           MOV     A,R7
   \                     ??ZMacDataReq_0:
   \   000029   607D         JZ      ??ZMacDataReq_1
    440            {
    441              /* Copy the addresses */
    442              osal_memcpy (&pBuf->mac, pData, sizeof (macDataReq_t));
   \   00002B                ; Setup parameters for call to function osal_memcpy
   \   00002B   85....       MOV     ?V0 + 0,?V0 + 4
   \   00002E   85....       MOV     ?V0 + 1,?V0 + 5
   \   000031   75..00       MOV     ?V0 + 2,#0x0
   \   000034   78..         MOV     R0,#?V0 + 0
   \   000036   12....       LCALL   ?PUSH_XSTACK_I_THREE
   \   000039   7C10         MOV     R4,#0x10
   \   00003B   7D00         MOV     R5,#0x0
   \   00003D   EE           MOV     A,R6
   \   00003E   2422         ADD     A,#0x22
   \   000040   FA           MOV     R2,A
   \   000041   EF           MOV     A,R7
   \   000042   3400         ADDC    A,#0x0
   \   000044   FB           MOV     R3,A
   \   000045   12....       LCALL   ??osal_memcpy?relay
   \   000048   7403         MOV     A,#0x3
   \   00004A   12....       LCALL   ?DEALLOC_XSTACK8
    443          
    444              /* Copy data */
    445              pBuf->msdu.len = pData->msduLength;
   \   00004D   E5..         MOV     A,?V0 + 4
   \   00004F   241B         ADD     A,#0x1b
   \   000051   F8           MOV     R0,A
   \   000052   E5..         MOV     A,?V0 + 5
   \   000054   3400         ADDC    A,#0x0
   \   000056   F9           MOV     R1,A
   \   000057   E8           MOV     A,R0
   \   000058   FA           MOV     R2,A
   \   000059   E9           MOV     A,R1
   \   00005A   FB           MOV     R3,A
   \   00005B   8A82         MOV     DPL,R2
   \   00005D   8B83         MOV     DPH,R3
   \   00005F   E0           MOVX    A,@DPTR
   \   000060   8E82         MOV     DPL,R6
   \   000062   8F83         MOV     DPH,R7
   \   000064   A3           INC     DPTR
   \   000065   A3           INC     DPTR
   \   000066   A3           INC     DPTR
   \   000067   A3           INC     DPTR
   \   000068   F0           MOVX    @DPTR,A
    446              osal_memcpy (pBuf->msdu.p, pData->msdu, pData->msduLength);
   \   000069                ; Setup parameters for call to function osal_memcpy
   \   000069   E5..         MOV     A,?V0 + 4
   \   00006B   241C         ADD     A,#0x1c
   \   00006D   F582         MOV     DPL,A
   \   00006F   E5..         MOV     A,?V0 + 5
   \   000071   12....       LCALL   ??Subroutine4_0
   \                     ??CrossCallReturnLabel_15:
   \   000074   E0           MOVX    A,@DPTR
   \   000075   F5..         MOV     ?V0 + 0,A
   \   000077   A3           INC     DPTR
   \   000078   E0           MOVX    A,@DPTR
   \   000079   F5..         MOV     ?V0 + 1,A
   \   00007B   78..         MOV     R0,#?V0 + 0
   \   00007D   12....       LCALL   ?PUSH_XSTACK_I_THREE
   \   000080   8A82         MOV     DPL,R2
   \   000082   8B83         MOV     DPH,R3
   \   000084   E0           MOVX    A,@DPTR
   \   000085   FC           MOV     R4,A
   \   000086   7D00         MOV     R5,#0x0
   \   000088   8E82         MOV     DPL,R6
   \   00008A   8F83         MOV     DPH,R7
   \   00008C   A3           INC     DPTR
   \   00008D   A3           INC     DPTR
   \   00008E   E0           MOVX    A,@DPTR
   \   00008F   FA           MOV     R2,A
   \   000090   A3           INC     DPTR
   \   000091   E0           MOVX    A,@DPTR
   \   000092   FB           MOV     R3,A
   \   000093   12....       LCALL   ??osal_memcpy?relay
   \   000096   7403         MOV     A,#0x3
   \   000098   12....       LCALL   ?DEALLOC_XSTACK8
    447          
    448              /* Right now, set security to zero */
    449              pBuf->sec.securityLevel = false;
   \   00009B   EE           MOV     A,R6
   \   00009C   241F         ADD     A,#0x1f
   \   00009E   12....       LCALL   ?Subroutine1
    450          
    451              /* Call Mac Data Request */
    452              MAC_McpsDataReq(pBuf);
   \                     ??CrossCallReturnLabel_4:
   \   0000A1   12....       LCALL   ??MAC_McpsDataReq?relay
    453          
    454              return ( ZMacSuccess );
   \   0000A4   7900         MOV     R1,#0x0
   \   0000A6   8002         SJMP    ??ZMacDataReq_2
    455            }
    456          
    457            return MAC_NO_RESOURCES;
   \                     ??ZMacDataReq_1:
   \   0000A8   791A         MOV     R1,#0x1a
   \                     ??ZMacDataReq_2:
   \   0000AA   7F06         MOV     R7,#0x6
   \   0000AC   02....       LJMP    ?FUNC_LEAVE_XDATA
    458          }
    459          
    460          /********************************************************************************************************
    461           * @fn      ZMacPurgeReq
    462           *
    463           * @brief   Purge a MAC Data Frame packet.
    464           *
    465           * @param   MSDU data handle.
    466           *
    467           * @return  status
    468           ********************************************************************************************************/

   \                                 In  segment NEAR_CODE, align 1, keep-with-next
    469          ROOT uint8 ZMacPurgeReq( byte Handle )
   \                     ZMacPurgeReq:
    470          {
   \   000000   C082         PUSH    DPL
   \   000002   C083         PUSH    DPH
   \   000004                ; Saved register size: 2
   \   000004                ; Auto size: 0
    471            MAC_McpsPurgeReq( Handle );
   \   000004                ; Setup parameters for call to function MAC_McpsPurgeReq
   \   000004   12....       LCALL   ??MAC_McpsPurgeReq?relay
    472            return ZMacSuccess;
   \   000007   02....       LJMP    ?Subroutine7
    473          }
    474          
    475          /********************************************************************************************************
    476           * @fn      - ZMACPwrOnReq
    477           *
    478           * @brief   - This function requests the MAC to power on the radio hardware
    479           *            and wake up.  When the power on procedure is complete the MAC
    480           *            will send a MAC_PWR_ON_CNF to the application.
    481           *
    482           * @input   - None.
    483           *
    484           * @output  - None.
    485           *
    486           * @return  - None.
    487           ********************************************************************************************************/

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
    488          void ZMacPwrOnReq ( void )
   \                     ZMacPwrOnReq:
    489          {
   \   000000   C082         PUSH    DPL
   \   000002   C083         PUSH    DPH
   \   000004                ; Saved register size: 2
   \   000004                ; Auto size: 0
    490            MAC_PwrOnReq();
   \   000004                ; Setup parameters for call to function MAC_PwrOnReq
   \   000004   12....       LCALL   ??MAC_PwrOnReq?relay
    491          }
   \   000007                REQUIRE ?Subroutine9
   \   000007                ; // Fall through to label ?Subroutine9

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine9:
   \   000000   D083         POP     DPH
   \   000002   D082         POP     DPL
   \   000004   02....       LJMP    ?BRET
    492          
    493          /********************************************************************************************************
    494           * @fn          MAC_PwrMode
    495           *
    496           * @brief       This function returns the current power mode of the MAC.
    497           *
    498           * input parameters
    499           *
    500           * None.
    501           *
    502           * output parameters
    503           *
    504           * None.
    505           *
    506           * @return      The current power mode of the MAC.
    507           ********************************************************************************************************/

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
    508          uint8 ZMac_PwrMode(void)
   \                     ZMac_PwrMode:
    509          {
   \   000000   C082         PUSH    DPL
   \   000002   C083         PUSH    DPH
   \   000004                ; Saved register size: 2
   \   000004                ; Auto size: 0
    510            return (MAC_PwrMode());
   \   000004                ; Setup parameters for call to function MAC_PwrMode
   \   000004   12....       LCALL   ??MAC_PwrMode?relay
   \   000007   80..         SJMP    ?Subroutine9
    511          }
    512          
    513          /********************************************************************************************************
    514           * @fn      ZMacSetTransmitPower
    515           *
    516           * @brief   Set the transmitter power according to the level setting param.
    517           *
    518           * @param   Valid power level setting as defined in ZMAC.h.
    519           *
    520           * @return  ZMacSuccess if PHY_TRANSMIT_POWER found or ZMacUnsupportedAttribute.
    521           ********************************************************************************************************/

   \                                 In  segment NEAR_CODE, align 1, keep-with-next
    522          ROOT uint8 ZMacSetTransmitPower( ZMacTransmitPower_t level )
   \                     ZMacSetTransmitPower:
    523          {
   \   000000   74F7         MOV     A,#-0x9
   \   000002   12....       LCALL   ?FUNC_ENTER_XDATA
   \   000005                ; Saved register size: 9
   \   000005                ; Auto size: 1
   \   000005   74FF         MOV     A,#-0x1
   \   000007   12....       LCALL   ?ALLOC_XSTACK8
    524            uint8 pwr;
    525          
    526            if ( (level /= 2) >= 8 )
   \   00000A   E9           MOV     A,R1
   \   00000B   C3           CLR     C
   \   00000C   13           RRC     A
   \   00000D   F9           MOV     R1,A
   \   00000E   C3           CLR     C
   \   00000F   9408         SUBB    A,#0x8
   \   000011   4003         JC      ??ZMacSetTransmitPower_0
    527            {
    528              pwr = TxPowerSettings[0];
   \   000013   E4           CLR     A
   \   000014   800C         SJMP    ??ZMacSetTransmitPower_1
    529            }
    530            else
    531            {
    532              pwr = TxPowerSettings[level];
   \                     ??ZMacSetTransmitPower_0:
   \   000016   E9           MOV     A,R1
   \   000017   24..         ADD     A,#(TxPowerSettings & 0xff)
   \   000019   F582         MOV     DPL,A
   \   00001B   E4           CLR     A
   \   00001C   34..         ADDC    A,#((TxPowerSettings >> 8) & 0xff)
   \   00001E   F583         MOV     DPH,A
   \   000020   E4           CLR     A
   \   000021   93           MOVC    A,@A+DPTR
   \                     ??ZMacSetTransmitPower_1:
   \   000022   85..82       MOV     DPL,?XSP + 0
   \   000025   85..83       MOV     DPH,?XSP + 1
   \   000028   F0           MOVX    @DPTR,A
    533            }
    534          
    535            if ( MAC_MlmeSetReq( ZMacPhyTransmitPower, &pwr ) == ZSUCCESS )
   \   000029                ; Setup parameters for call to function MAC_MlmeSetReq
   \   000029   AA82         MOV     R2,DPL
   \   00002B   AB83         MOV     R3,DPH
   \   00002D   79E0         MOV     R1,#-0x20
   \   00002F   12....       LCALL   ??MAC_MlmeSetReq?relay
   \   000032   E9           MOV     A,R1
   \   000033   7004         JNZ     ??ZMacSetTransmitPower_2
    536            {
    537              //msupSetTransmitPower();
    538              return ZMacSuccess;
   \   000035   7900         MOV     R1,#0x0
   \   000037   8002         SJMP    ??ZMacSetTransmitPower_3
    539            }
    540          
    541            return ZMacUnsupportedAttribute;
   \                     ??ZMacSetTransmitPower_2:
   \   000039   79F4         MOV     R1,#-0xc
   \                     ??ZMacSetTransmitPower_3:
   \   00003B   7401         MOV     A,#0x1
   \   00003D   12....       LCALL   ?DEALLOC_XSTACK8
   \   000040   7F02         MOV     R7,#0x2
   \   000042   02....       LJMP    ?FUNC_LEAVE_XDATA
    542          }
    543          
    544          /********************************************************************************************************
    545           * @fn      ZMacSendNoData
    546           *
    547           * @brief   This function sends an empty msg
    548           *
    549           * @param   DstAddr   - destination short address
    550           *          DstPANId  - destination pan id
    551           *
    552           * @return  None
    553           ********************************************************************************************************/

   \                                 In  segment NEAR_CODE, align 1, keep-with-next
    554          ROOT void ZMacSendNoData ( uint16 DstAddr, uint16 DstPANId )
   \                     ZMacSendNoData:
    555          {
   \   000000   74F5         MOV     A,#-0xb
   \   000002   12....       LCALL   ?FUNC_ENTER_XDATA
   \   000005                ; Saved register size: 11
   \   000005                ; Auto size: 0
   \   000005   8A..         MOV     ?V0 + 0,R2
   \   000007   8B..         MOV     ?V0 + 1,R3
   \   000009   EC           MOV     A,R4
   \   00000A   FE           MOV     R6,A
   \   00000B   ED           MOV     A,R5
   \   00000C   FF           MOV     R7,A
    556            macMcpsDataReq_t *pBuf;
    557          
    558            /* Allocate memory */
    559            pBuf = MAC_McpsDataAlloc(0, MAC_SEC_LEVEL_NONE, MAC_KEY_ID_MODE_NONE);
   \   00000D                ; Setup parameters for call to function MAC_McpsDataAlloc
   \   00000D   7B00         MOV     R3,#0x0
   \   00000F   7A00         MOV     R2,#0x0
   \   000011   7900         MOV     R1,#0x0
   \   000013   12....       LCALL   ??MAC_McpsDataAlloc?relay
    560          
    561            if (pBuf)
   \   000016   EA           MOV     A,R2
   \   000017   7001         JNZ     ??ZMacSendNoData_0
   \   000019   EB           MOV     A,R3
   \                     ??ZMacSendNoData_0:
   \   00001A   603A         JZ      ??ZMacSendNoData_1
    562            {
    563              /* Fill in src information */
    564              pBuf->mac.srcAddrMode              = SADDR_MODE_SHORT;
   \   00001C   EA           MOV     A,R2
   \   00001D   242D         ADD     A,#0x2d
   \   00001F   12....       LCALL   ?Subroutine3
    565          
    566              /* Fill in dst information */
    567              pBuf->mac.dstAddr.addr.shortAddr   = DstAddr;
   \                     ??CrossCallReturnLabel_11:
   \   000022   2422         ADD     A,#0x22
   \   000024   12....       LCALL   ?Subroutine4
   \                     ??CrossCallReturnLabel_16:
   \   000027   E5..         MOV     A,?V0 + 0
   \   000029   F0           MOVX    @DPTR,A
   \   00002A   A3           INC     DPTR
   \   00002B   E5..         MOV     A,?V0 + 1
   \   00002D   F0           MOVX    @DPTR,A
    568              pBuf->mac.dstAddr.addrMode         = SADDR_MODE_SHORT;
   \   00002E   EA           MOV     A,R2
   \   00002F   242A         ADD     A,#0x2a
   \   000031   12....       LCALL   ?Subroutine3
    569              pBuf->mac.dstPanId                 = DstPANId;
   \                     ??CrossCallReturnLabel_12:
   \   000034   242B         ADD     A,#0x2b
   \   000036   12....       LCALL   ?Subroutine4
   \                     ??CrossCallReturnLabel_17:
   \   000039   EE           MOV     A,R6
   \   00003A   F0           MOVX    @DPTR,A
   \   00003B   A3           INC     DPTR
   \   00003C   EF           MOV     A,R7
   \   00003D   F0           MOVX    @DPTR,A
    570          
    571              /* Misc information */
    572              pBuf->mac.msduHandle               = 0;
   \   00003E   EA           MOV     A,R2
   \   00003F   242E         ADD     A,#0x2e
   \   000041   12....       LCALL   ?Subroutine2
    573              pBuf->mac.txOptions                = ZMAC_TXOPTION_ACK | ZMAC_TXOPTION_NO_RETRANS | ZMAC_TXOPTION_NO_CNF;
   \                     ??CrossCallReturnLabel_9:
   \   000044   EA           MOV     A,R2
   \   000045   242F         ADD     A,#0x2f
   \   000047   12....       LCALL   ?Subroutine4
   \                     ??CrossCallReturnLabel_18:
   \   00004A   7431         MOV     A,#0x31
   \   00004C   F0           MOVX    @DPTR,A
    574          
    575              /* Right now, set security to zero */
    576              pBuf->sec.securityLevel = false;
   \   00004D   EA           MOV     A,R2
   \   00004E   241F         ADD     A,#0x1f
   \   000050   12....       LCALL   ?Subroutine2
    577          
    578              /* Call Mac Data Request */
    579              MAC_McpsDataReq(pBuf);
   \                     ??CrossCallReturnLabel_10:
   \   000053                ; Setup parameters for call to function MAC_McpsDataReq
   \   000053   12....       LCALL   ??MAC_McpsDataReq?relay
    580            }
    581          
    582          }
   \                     ??ZMacSendNoData_1:
   \   000056   02....       LJMP    ?Subroutine8

   \                                 In  segment NEAR_CODE, align 1, keep-with-next
   \                     ?Subroutine3:
   \   000000   F582         MOV     DPL,A
   \   000002   EB           MOV     A,R3
   \   000003   3400         ADDC    A,#0x0
   \   000005   F583         MOV     DPH,A
   \   000007   7402         MOV     A,#0x2
   \   000009   F0           MOVX    @DPTR,A
   \   00000A   EA           MOV     A,R2
   \   00000B   22           RET

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??ZMacPwrOnReq?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    ZMacPwrOnReq

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??ZMac_PwrMode?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    ZMac_PwrMode

   Maximum stack usage in bytes:

     Function                     ISTACK PSTACK XSTACK
     --------                     ------ ------ ------
     ZMacAssociateReq                 3      0      0
       -> MAC_MlmeAssociateReq        4      0      0
     ZMacAssociateRsp                 3      0      0
       -> MAC_MlmeAssociateRsp        4      0      0
     ZMacDataReq                      1      0     16
       -> MAC_McpsDataAlloc           0      0     26
       -> osal_memcpy                 0      0     32
       -> osal_memcpy                 0      0     32
       -> MAC_McpsDataReq             0      0     26
     ZMacDisassociateReq              3      0      0
       -> MAC_MlmeDisassociateReq     4      0      0
     ZMacGetReq                       2      0      0
       -> osal_cpyExtAddr             4      0      0
       -> MAC_MlmeGetReq              4      0      0
     ZMacInit                         0      0      8
       -> MAC_Init                    0      0     16
       -> MAC_InitDevice              0      0     16
       -> MAC_InitCoord               0      0     16
       -> ZMacReset                   0      0     16
       -> osal_int_disable            0      0     16
     ZMacOrphanRsp                    3      0      0
       -> MAC_MlmeOrphanRsp           4      0      0
     ZMacPollReq                      3      0      0
       -> MAC_MlmePollReq             4      0      0
     ZMacPurgeReq                     2      0      0
       -> MAC_McpsPurgeReq            4      0      0
     ZMacPwrOnReq                     2      0      0
       -> MAC_PwrOnReq                4      0      0
     ZMacReset                        1      0     17
       -> MAC_MlmeResetReq            0      0     18
       -> MAC_MlmeSetReq              0      0     18
       -> MAC_MlmeSetReq              0      0     18
       -> osal_mem_free               0      0     18
     ZMacRxEnableReq                  0      0      0
     ZMacScanReq                      1      0     11
       -> osal_mem_alloc              0      0     22
       -> osal_memset                 0      0     22
       -> osal_mem_alloc              0      0     22
       -> MAC_MlmeScanReq             0      0     22
     ZMacSendNoData                   1      0     11
       -> MAC_McpsDataAlloc           0      0     22
       -> MAC_McpsDataReq             0      0     22
     ZMacSetReq                       0      0      8
       -> osal_cpyExtAddr             0      0     16
       -> MAC_MlmeSetReq              0      0     16
     ZMacSetTransmitPower             1      0     10
       -> MAC_MlmeSetReq              0      0     20
     ZMacStartReq                     1      0      9
       -> MAC_MlmeSetReq              0      0     18
       -> MAC_MlmeStartReq            0      0     18
     ZMacSyncReq                      2      0      0
       -> MAC_MlmeSyncReq             4      0      0
     ZMacUpdate                       0      0      0
     ZMac_PwrMode                     2      0      0
       -> MAC_PwrMode                 4      0      0


   Segment part sizes:

     Function/Label       Bytes
     --------------       -----
     TxPowerSettings         8
     _ScanChannels           4
     ZMac_ScanBuf            2
     ZMacInit               30
     ?Subroutine6           10
     ZMacUpdate              3
     ZMacReset              73
     ZMacGetReq             26
     ?Subroutine7            7
     ZMacSetReq             40
     ZMacAssociateReq       16
     ?Subroutine2            7
     ?Subroutine5            7
     ZMacAssociateRsp       13
     ?Subroutine0           10
     ZMacDisassociateReq    16
     ZMacOrphanRsp          13
     ZMacRxEnableReq         3
     ZMacScanReq           254
     ?Subroutine8            5
     ?Subroutine4            8
     ZMacStartReq           55
     ?Subroutine1           11
     ZMacSyncReq             7
     ZMacPollReq            12
     ZMacDataReq           175
     ZMacPurgeReq           10
     ZMacPwrOnReq            7
     ?Subroutine9            7
     ZMac_PwrMode            9
     ZMacSetTransmitPower   69
     ZMacSendNoData         89
     ?Subroutine3           12
     ??ZMacPwrOnReq?relay    6
     ??ZMac_PwrMode?relay    6

 
  23 bytes in segment BANKED_CODE
  12 bytes in segment BANK_RELAYS
   8 bytes in segment CODE_C
 981 bytes in segment NEAR_CODE
   6 bytes in segment XDATA_Z
 
 1 024 bytes of CODE  memory
     6 bytes of XDATA memory

Errors: none
Warnings: none
