Root/drivers/staging/csr/csr_wifi_nme_ap_converter_init.c

1/*****************************************************************************
2
3            (c) Cambridge Silicon Radio Limited 2012
4            All rights reserved and confidential information of CSR
5
6            Refer to LICENSE.txt included with this source for details
7            on the license terms.
8
9*****************************************************************************/
10
11/* Note: this is an auto-generated file. */
12
13#include "csr_msgconv.h"
14#include "csr_macro.h"
15
16#ifdef CSR_WIFI_NME_ENABLE
17#ifdef CSR_WIFI_AP_ENABLE
18
19#ifdef CSR_LOG_ENABLE
20#include "csr_log.h"
21#endif
22
23#ifndef EXCLUDE_CSR_WIFI_NME_AP_MODULE
24#include "csr_wifi_nme_ap_serialize.h"
25#include "csr_wifi_nme_ap_prim.h"
26
27static CsrMsgConvMsgEntry csrwifinmeap_conv_lut[] = {
28    { CSR_WIFI_NME_AP_CONFIG_SET_REQ, CsrWifiNmeApConfigSetReqSizeof, CsrWifiNmeApConfigSetReqSer, CsrWifiNmeApConfigSetReqDes, CsrWifiNmeApConfigSetReqSerFree },
29    { CSR_WIFI_NME_AP_WPS_REGISTER_REQ, CsrWifiNmeApWpsRegisterReqSizeof, CsrWifiNmeApWpsRegisterReqSer, CsrWifiNmeApWpsRegisterReqDes, CsrWifiNmeApWpsRegisterReqSerFree },
30    { CSR_WIFI_NME_AP_START_REQ, CsrWifiNmeApStartReqSizeof, CsrWifiNmeApStartReqSer, CsrWifiNmeApStartReqDes, CsrWifiNmeApStartReqSerFree },
31    { CSR_WIFI_NME_AP_STOP_REQ, CsrWifiNmeApStopReqSizeof, CsrWifiNmeApStopReqSer, CsrWifiNmeApStopReqDes, CsrWifiNmeApStopReqSerFree },
32    { CSR_WIFI_NME_AP_WMM_PARAM_UPDATE_REQ, CsrWifiNmeApWmmParamUpdateReqSizeof, CsrWifiNmeApWmmParamUpdateReqSer, CsrWifiNmeApWmmParamUpdateReqDes, CsrWifiNmeApWmmParamUpdateReqSerFree },
33    { CSR_WIFI_NME_AP_STA_REMOVE_REQ, CsrWifiNmeApStaRemoveReqSizeof, CsrWifiNmeApStaRemoveReqSer, CsrWifiNmeApStaRemoveReqDes, CsrWifiNmeApStaRemoveReqSerFree },
34    { CSR_WIFI_NME_AP_CONFIG_SET_CFM, CsrWifiNmeApConfigSetCfmSizeof, CsrWifiNmeApConfigSetCfmSer, CsrWifiNmeApConfigSetCfmDes, CsrWifiNmeApConfigSetCfmSerFree },
35    { CSR_WIFI_NME_AP_WPS_REGISTER_CFM, CsrWifiNmeApWpsRegisterCfmSizeof, CsrWifiNmeApWpsRegisterCfmSer, CsrWifiNmeApWpsRegisterCfmDes, CsrWifiNmeApWpsRegisterCfmSerFree },
36    { CSR_WIFI_NME_AP_START_CFM, CsrWifiNmeApStartCfmSizeof, CsrWifiNmeApStartCfmSer, CsrWifiNmeApStartCfmDes, CsrWifiNmeApStartCfmSerFree },
37    { CSR_WIFI_NME_AP_STOP_CFM, CsrWifiNmeApStopCfmSizeof, CsrWifiNmeApStopCfmSer, CsrWifiNmeApStopCfmDes, CsrWifiNmeApStopCfmSerFree },
38    { CSR_WIFI_NME_AP_STOP_IND, CsrWifiNmeApStopIndSizeof, CsrWifiNmeApStopIndSer, CsrWifiNmeApStopIndDes, CsrWifiNmeApStopIndSerFree },
39    { CSR_WIFI_NME_AP_WMM_PARAM_UPDATE_CFM, CsrWifiNmeApWmmParamUpdateCfmSizeof, CsrWifiNmeApWmmParamUpdateCfmSer, CsrWifiNmeApWmmParamUpdateCfmDes, CsrWifiNmeApWmmParamUpdateCfmSerFree },
40    { CSR_WIFI_NME_AP_STATION_IND, CsrWifiNmeApStationIndSizeof, CsrWifiNmeApStationIndSer, CsrWifiNmeApStationIndDes, CsrWifiNmeApStationIndSerFree },
41
42    { 0, NULL, NULL, NULL, NULL },
43};
44
45CsrMsgConvMsgEntry* CsrWifiNmeApConverterLookup(CsrMsgConvMsgEntry *ce, u16 msgType)
46{
47    if (msgType & CSR_PRIM_UPSTREAM)
48    {
49        u16 idx = (msgType & ~CSR_PRIM_UPSTREAM) + CSR_WIFI_NME_AP_PRIM_DOWNSTREAM_COUNT;
50        if (idx < (CSR_WIFI_NME_AP_PRIM_UPSTREAM_COUNT + CSR_WIFI_NME_AP_PRIM_DOWNSTREAM_COUNT) &&
51            csrwifinmeap_conv_lut[idx].msgType == msgType)
52        {
53            return &csrwifinmeap_conv_lut[idx];
54        }
55    }
56    else
57    {
58        if (msgType < CSR_WIFI_NME_AP_PRIM_DOWNSTREAM_COUNT &&
59            csrwifinmeap_conv_lut[msgType].msgType == msgType)
60        {
61            return &csrwifinmeap_conv_lut[msgType];
62        }
63    }
64    return NULL;
65}
66
67
68void CsrWifiNmeApConverterInit(void)
69{
70    CsrMsgConvInsert(CSR_WIFI_NME_AP_PRIM, csrwifinmeap_conv_lut);
71    CsrMsgConvCustomLookupRegister(CSR_WIFI_NME_AP_PRIM, CsrWifiNmeApConverterLookup);
72}
73
74
75#ifdef CSR_LOG_ENABLE
76static const CsrLogPrimitiveInformation csrwifinmeap_conv_info = {
77    CSR_WIFI_NME_AP_PRIM,
78    (char *)"CSR_WIFI_NME_AP_PRIM",
79    csrwifinmeap_conv_lut
80};
81const CsrLogPrimitiveInformation* CsrWifiNmeApTechInfoGet(void)
82{
83    return &csrwifinmeap_conv_info;
84}
85
86
87#endif /* CSR_LOG_ENABLE */
88#endif /* EXCLUDE_CSR_WIFI_NME_AP_MODULE */
89#endif /* CSR_WIFI_NME_ENABLE */
90#endif /* CSR_WIFI_AP_ENABLE */
91

Archive Download this file



interactive