TWD/FirmwareApi/public_host_int.h
changeset 0 10c42ec6c05f
equal deleted inserted replaced
-1:000000000000 0:10c42ec6c05f
       
     1 /*
       
     2  * public_host_int.h
       
     3  *
       
     4  * Copyright(c) 1998 - 2010 Texas Instruments. All rights reserved.      
       
     5  * All rights reserved.      
       
     6  * 
       
     7  * This program and the accompanying materials are made available under the 
       
     8  * terms of the Eclipse Public License v1.0 or BSD License which accompanies
       
     9  * this distribution. The Eclipse Public License is available at
       
    10  * http://www.eclipse.org/legal/epl-v10.html and the BSD License is as below.                                   
       
    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   FILENAME:       public_host_int.h
       
    42 
       
    43   DESCRIPTION:    Contains the host interface fw interrupt structure in use.
       
    44 
       
    45 
       
    46 
       
    47 ***********************************************************************************************************************/
       
    48 #ifndef PUBLIC_HOST_INT_H
       
    49 #define PUBLIC_HOST_INT_H
       
    50 
       
    51 #include "public_types.h"
       
    52 
       
    53                 
       
    54 /*************************************************************************
       
    55 
       
    56     Host Interrupt Register (WiLink -> Host)
       
    57  
       
    58 **************************************************************************/
       
    59 #define ACX_INTR_WATCHDOG           BIT_0   /* HW Initiated interrupt Watchdog timer expiration */
       
    60 #define ACX_INTR_INIT_COMPLETE      BIT_1   /* Init sequence is done (masked interrupt, detection through polling only ) */
       
    61     #define ACX_INTR_EVENT_A            BIT_2   /* Event was entered to Event MBOX #A*/
       
    62     #define ACX_INTR_EVENT_B            BIT_3   /* Event was entered to Event MBOX #B*/
       
    63 #define ACX_INTR_CMD_COMPLETE       BIT_4   /* Command processing completion*/
       
    64     #define ACX_INTR_HW_AVAILABLE       BIT_5   /* Signaling the host on HW wakeup */
       
    65     #define ACX_INTR_DATA               BIT_6   /* The MISC bit is used for aggregation of RX, TxComplete and TX rate update */
       
    66     #define ACX_INTR_TRACE_A	        BIT_7   /* Trace meassge on MBOX #A */
       
    67     #define ACX_INTR_TRACE_B            BIT_8   /* Trace meassge on MBOX #B */
       
    68 
       
    69 #define ACX_INTR_ALL                0xFFFFFFFF
       
    70 
       
    71 
       
    72 /*************************************************************************
       
    73 
       
    74     Interrupt Trigger Register (Host -> WiLink)              
       
    75   
       
    76 **************************************************************************/
       
    77 
       
    78 /******** Hardware to Embedded CPU Interrupts - first 32-bit register set ********/ 
       
    79    
       
    80 #define INTR_TRIG_CMD       BIT_0   /* Host Command Interrupt. Setting this bit masks*/
       
    81                                     /* the interrupt that the host issues to inform*/
       
    82                                     /* the FW that it has sent a command*/
       
    83                                     /* to the Wlan hardware Command Mailbox.*/
       
    84     
       
    85 #define INTR_TRIG_EVENT_ACK BIT_1   /* Host Event Acknowlegde Interrupt. The host */
       
    86                                     /* sets this bit to acknowledge that it received*/
       
    87                                     /* the unsolicited information from the event*/
       
    88                                     /* mailbox.*/
       
    89                                        
       
    90 #define INTR_TRIG_TX_PROC0  BIT_2   /* OBSOLETE (automatic end-of-transaction interrupt is used instead) */
       
    91                                        
       
    92 #define INTR_TRIG_RX_PROC   BIT_3   /* The host sets this bit to inform the FW that */
       
    93                                     /* it read a packet from the RX cyclic buffer */
       
    94 
       
    95 #define INTR_TRIG_DEBUG_ACK BIT_4 
       
    96     
       
    97 #define INTR_TRIG_STATE_CHANGED BIT_5
       
    98         
       
    99 
       
   100 /******** Hardware to Embedded CPU Interrupts - second 32-bit register set ********/
       
   101 
       
   102 #define INTR_TRIG_RX_PROC1  BIT_17  /* OBSOLETE */
       
   103 
       
   104 #define INTR_TRIG_TX_PROC1  BIT_18  /* OBSOLETE */
       
   105 
       
   106 
       
   107 /*************************************************************************
       
   108 
       
   109     FW status registers (Host reads from FW upon interrupt from FW)              
       
   110                                                         
       
   111 **************************************************************************/
       
   112 #define NUM_TX_QUEUES	    4   /* Number of Tx HW Queues (same as ACs). */
       
   113 #define NUM_RX_PKT_DESC     8   /* Number of Rx packets short descriptors in the W status */
       
   114 
       
   115 /* Get field from FwStatus_t->rxPktsDesc[i] */
       
   116 #define RX_DESC_GET_MEM_BLK(desc)            ( (desc & 0x000000FF) >>  0 )  /* The first mem-block of the Rx packet */
       
   117 #define RX_DESC_GET_LENGTH(desc)             ( (desc & 0x000FFF00) >>  8 )  /* The length of the packet in words */
       
   118 #define RX_DESC_GET_UNALIGNED(desc)          ( (desc & 0x00100000) >> 20 )  /* If set, the payload is not 4 bytes aligned */
       
   119 #define RX_DESC_GET_SECURITY(desc)           ( (desc & 0x00E00000) >> 21 )  /* Security flag */
       
   120 #define RX_DESC_GET_PACKET_CLASS_TAG(desc)   ( (desc & 0xFF000000) >> 24 )  /* Get the RX packet class tag */
       
   121 
       
   122 
       
   123 /* Set field in FwStatus_t->rxPktsDesc[i] */
       
   124 #define RX_DESC_SET_MEM_BLK(desc, value)     ( desc = (desc & ~0x000000FF) | (value <<  0 ) )
       
   125 #define RX_DESC_SET_LENGTH(desc, value)      ( desc = (desc & ~0x000FFF00) | (value <<  8 ) )
       
   126 #define RX_DESC_SET_UNALIGNED(desc, value)   ( desc = (desc & ~0x00100000) | (value << 20 ) )
       
   127 
       
   128 /* The content of the "counters" field in FwStatus_t - see below */
       
   129 typedef struct 
       
   130 {
       
   131     uint8       fwRxCntr;       /* Incremented by FW upon adding pending Rx entry to aRxPktsDesc */
       
   132     uint8       drvRxCntr;      /* Incremented by FW upon RX host slave interrupt (for debug) */
       
   133     uint8       reserved;        
       
   134     uint8       txResultsCntr;  /* Incremented by FW upon adding Tx-Result to the TxResultQueue */
       
   135 } FwStatCntrs_t;
       
   136 
       
   137 /* The FW status registers structure read by the host upon interrupt from the FW */
       
   138 typedef struct 
       
   139 {
       
   140     uint32      intrStatus;     /* HINT register content (will be cleared upon the read) */
       
   141     uint32      counters;       /* The counters defined in FwStatCntrs_t - see above */
       
   142     uint32      rxPktsDesc[NUM_RX_PKT_DESC];   /* Array of Rx packets short descriptors (see RX_DESC_SET/GET...) */
       
   143 	uint32      txReleasedBlks[NUM_TX_QUEUES]; /* Per queue released blocks count since FW-reset */
       
   144     uint32      fwLocalTime;    /* FW time in usec, used for clock synchronization with the host */
       
   145     uint32      spare[2];       /* Total structure size is 68 bytes */
       
   146 } FwStatus_t;
       
   147 
       
   148 #endif
       
   149 
       
   150