Home | History | Annotate | Download | only in inc
      1 /** \file broadcastKeySM.h
      2  *  \brief station broadcast key SM API
      3  *
      4  *  \see broadcastKeySM.c
      5  */
      6 /****************************************************************************
      7 **+-----------------------------------------------------------------------+**
      8 **|                                                                       |**
      9 **| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved.      |**
     10 **| All rights reserved.                                                  |**
     11 **|                                                                       |**
     12 **| Redistribution and use in source and binary forms, with or without    |**
     13 **| modification, are permitted provided that the following conditions    |**
     14 **| are met:                                                              |**
     15 **|                                                                       |**
     16 **|  * Redistributions of source code must retain the above copyright     |**
     17 **|    notice, this list of conditions and the following disclaimer.      |**
     18 **|  * Redistributions in binary form must reproduce the above copyright  |**
     19 **|    notice, this list of conditions and the following disclaimer in    |**
     20 **|    the documentation and/or other materials provided with the         |**
     21 **|    distribution.                                                      |**
     22 **|  * Neither the name Texas Instruments nor the names of its            |**
     23 **|    contributors may be used to endorse or promote products derived    |**
     24 **|    from this software without specific prior written permission.      |**
     25 **|                                                                       |**
     26 **| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS   |**
     27 **| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT     |**
     28 **| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
     29 **| A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT  |**
     30 **| OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |**
     31 **| SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT      |**
     32 **| LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |**
     33 **| DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |**
     34 **| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT   |**
     35 **| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |**
     36 **| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  |**
     37 **|                                                                       |**
     38 **+-----------------------------------------------------------------------+**
     39 ****************************************************************************/
     40 
     41 /****************************************************************************
     42  *                                                                          *
     43  *   MODULE:  station broadcast key SM	                                	*
     44  *   PURPOSE: station broadcast key SM API		                            *
     45  *                                                                          *
     46  ****************************************************************************/
     47 
     48 #ifndef _BROADCAST_KEY_SM_H
     49 #define _BROADCAST_KEY_SM_H
     50 
     51 #include "paramOut.h"
     52 #include "fsm.h"
     53 #include "rsnApi.h"
     54 #include "keyTypes.h"
     55 
     56 /* Constants */
     57 
     58 /* Enumerations */
     59 
     60 /* Typedefs */
     61 
     62 typedef struct _broadcastKey_t    broadcastKey_t;
     63 
     64 /* Main Sec SM functions */
     65 typedef TI_STATUS (*broadcastKeySmStart_t)(struct _broadcastKey_t *pBroadcastKey);
     66 typedef TI_STATUS (*broadcastKeySmStop_t)(struct _broadcastKey_t *pBroadcastKey);
     67 typedef TI_STATUS (*broadcastKeySmRecvSuccess_t)(struct _broadcastKey_t *pBroadcastKey, encodedKeyMaterial_t *pEncodedKeyMaterial);
     68 typedef TI_STATUS (*broadcastKeySmRecvFailure_t)(struct _broadcastKey_t *pBroadcastKey);
     69 
     70 /* Structures */
     71 
     72 /* State machine associated data structures. */
     73 typedef struct
     74 {
     75 	encodedKeyMaterial_t    *pEncodedKeyMaterial;
     76 } broadcastKeyData_t;
     77 
     78 struct _broadcastKey_t
     79 {
     80 	UINT8                               currentState;
     81 	fsm_stateMachine_t	                *pBcastKeySm;
     82     broadcastKeyData_t					data;
     83 
     84     struct _mainKeys_t                 	*pParent;
     85 	struct _keyDerive_t					*pKeyDerive;
     86 
     87 	TI_HANDLE			                hReport;
     88 	TI_HANDLE			                hOs;
     89 
     90     broadcastKeySmStart_t               start;
     91     broadcastKeySmStop_t                stop;
     92     broadcastKeySmRecvSuccess_t			recvSuccess;
     93     broadcastKeySmRecvFailure_t			recvFailure;
     94 };
     95 
     96 /* External data definitions */
     97 
     98 /* External functions definitions */
     99 
    100 /* Function prototypes */
    101 
    102 broadcastKey_t* broadcastKey_create(TI_HANDLE hOs);
    103 
    104 TI_STATUS broadcastKey_unload(broadcastKey_t *pBroadcastKey);
    105 
    106 TI_STATUS broadcastKey_config(broadcastKey_t *pBroadcastKey,
    107 						   rsn_paeConfig_t *pPaeConfig,
    108 						   struct _mainKeys_t *pParent,
    109 						   TI_HANDLE hReport,
    110 						   TI_HANDLE hOs);
    111 
    112 TI_STATUS broadcastKeySmUnexpected(struct _broadcastKey_t *pBroadcastKey);
    113 
    114 TI_STATUS broadcastKeySmNop(struct _broadcastKey_t *pBroadcastKey);
    115 
    116 #endif /*  _BROADCAST_KEY_SM_H*/
    117