Root/drivers/staging/csr/csr_wifi_router_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
17#ifdef CSR_LOG_ENABLE
18#include "csr_log.h"
19#endif
20
21#ifndef EXCLUDE_CSR_WIFI_ROUTER_MODULE
22#include "csr_wifi_router_serialize.h"
23#include "csr_wifi_router_prim.h"
24
25static CsrMsgConvMsgEntry csrwifirouter_conv_lut[] = {
26    { CSR_WIFI_ROUTER_MA_PACKET_SUBSCRIBE_REQ, CsrWifiRouterMaPacketSubscribeReqSizeof, CsrWifiRouterMaPacketSubscribeReqSer, CsrWifiRouterMaPacketSubscribeReqDes, CsrWifiRouterMaPacketSubscribeReqSerFree },
27    { CSR_WIFI_ROUTER_MA_PACKET_UNSUBSCRIBE_REQ, CsrWifiRouterMaPacketUnsubscribeReqSizeof, CsrWifiRouterMaPacketUnsubscribeReqSer, CsrWifiRouterMaPacketUnsubscribeReqDes, CsrWifiRouterMaPacketUnsubscribeReqSerFree },
28    { CSR_WIFI_ROUTER_MA_PACKET_REQ, CsrWifiRouterMaPacketReqSizeof, CsrWifiRouterMaPacketReqSer, CsrWifiRouterMaPacketReqDes, CsrWifiRouterMaPacketReqSerFree },
29    { CSR_WIFI_ROUTER_MA_PACKET_RES, CsrWifiRouterMaPacketResSizeof, CsrWifiRouterMaPacketResSer, CsrWifiRouterMaPacketResDes, CsrWifiRouterMaPacketResSerFree },
30    { CSR_WIFI_ROUTER_MA_PACKET_CANCEL_REQ, CsrWifiRouterMaPacketCancelReqSizeof, CsrWifiRouterMaPacketCancelReqSer, CsrWifiRouterMaPacketCancelReqDes, CsrWifiRouterMaPacketCancelReqSerFree },
31    { CSR_WIFI_ROUTER_MA_PACKET_SUBSCRIBE_CFM, CsrWifiRouterMaPacketSubscribeCfmSizeof, CsrWifiRouterMaPacketSubscribeCfmSer, CsrWifiRouterMaPacketSubscribeCfmDes, CsrWifiRouterMaPacketSubscribeCfmSerFree },
32    { CSR_WIFI_ROUTER_MA_PACKET_UNSUBSCRIBE_CFM, CsrWifiRouterMaPacketUnsubscribeCfmSizeof, CsrWifiRouterMaPacketUnsubscribeCfmSer, CsrWifiRouterMaPacketUnsubscribeCfmDes, CsrWifiRouterMaPacketUnsubscribeCfmSerFree },
33    { CSR_WIFI_ROUTER_MA_PACKET_CFM, CsrWifiRouterMaPacketCfmSizeof, CsrWifiRouterMaPacketCfmSer, CsrWifiRouterMaPacketCfmDes, CsrWifiRouterMaPacketCfmSerFree },
34    { CSR_WIFI_ROUTER_MA_PACKET_IND, CsrWifiRouterMaPacketIndSizeof, CsrWifiRouterMaPacketIndSer, CsrWifiRouterMaPacketIndDes, CsrWifiRouterMaPacketIndSerFree },
35
36    { 0, NULL, NULL, NULL, NULL },
37};
38
39CsrMsgConvMsgEntry* CsrWifiRouterConverterLookup(CsrMsgConvMsgEntry *ce, u16 msgType)
40{
41    if (msgType & CSR_PRIM_UPSTREAM)
42    {
43        u16 idx = (msgType & ~CSR_PRIM_UPSTREAM) + CSR_WIFI_ROUTER_PRIM_DOWNSTREAM_COUNT;
44        if (idx < (CSR_WIFI_ROUTER_PRIM_UPSTREAM_COUNT + CSR_WIFI_ROUTER_PRIM_DOWNSTREAM_COUNT) &&
45            csrwifirouter_conv_lut[idx].msgType == msgType)
46        {
47            return &csrwifirouter_conv_lut[idx];
48        }
49    }
50    else
51    {
52        if (msgType < CSR_WIFI_ROUTER_PRIM_DOWNSTREAM_COUNT &&
53            csrwifirouter_conv_lut[msgType].msgType == msgType)
54        {
55            return &csrwifirouter_conv_lut[msgType];
56        }
57    }
58    return NULL;
59}
60
61
62void CsrWifiRouterConverterInit(void)
63{
64    CsrMsgConvInsert(CSR_WIFI_ROUTER_PRIM, csrwifirouter_conv_lut);
65    CsrMsgConvCustomLookupRegister(CSR_WIFI_ROUTER_PRIM, CsrWifiRouterConverterLookup);
66}
67
68
69#ifdef CSR_LOG_ENABLE
70static const CsrLogPrimitiveInformation csrwifirouter_conv_info = {
71    CSR_WIFI_ROUTER_PRIM,
72    (char *)"CSR_WIFI_ROUTER_PRIM",
73    csrwifirouter_conv_lut
74};
75const CsrLogPrimitiveInformation* CsrWifiRouterTechInfoGet(void)
76{
77    return &csrwifirouter_conv_info;
78}
79
80
81#endif /* CSR_LOG_ENABLE */
82#endif /* EXCLUDE_CSR_WIFI_ROUTER_MODULE */
83

Archive Download this file



interactive