1 /*****************************************************************************
3 (c) Cambridge Silicon Radio Limited 2011
4 All rights reserved and confidential information of CSR
6 Refer to LICENSE.txt included with this source for details
9 *****************************************************************************/
11 /* Note: this is an auto-generated file. */
12 #include <linux/slab.h>
13 #include "csr_wifi_sme_prim.h"
14 #include "csr_wifi_sme_lib.h"
16 /*----------------------------------------------------------------------------*
18 * CsrWifiSmeFreeUpstreamMessageContents
24 * eventClass: only the value CSR_WIFI_SME_PRIM will be handled
25 * message: the message to free
26 *----------------------------------------------------------------------------*/
27 void CsrWifiSmeFreeUpstreamMessageContents(u16 eventClass, void *message)
29 if (eventClass != CSR_WIFI_SME_PRIM)
38 switch (*((CsrWifiSmePrim *) message))
40 case CSR_WIFI_SME_ASSOCIATION_COMPLETE_IND:
42 CsrWifiSmeAssociationCompleteInd *p = (CsrWifiSmeAssociationCompleteInd *)message;
43 kfree(p->connectionInfo.beaconFrame);
44 p->connectionInfo.beaconFrame = NULL;
45 kfree(p->connectionInfo.associationReqFrame);
46 p->connectionInfo.associationReqFrame = NULL;
47 kfree(p->connectionInfo.associationRspFrame);
48 p->connectionInfo.associationRspFrame = NULL;
49 kfree(p->connectionInfo.assocScanInfoElements);
50 p->connectionInfo.assocScanInfoElements = NULL;
51 kfree(p->connectionInfo.assocReqInfoElements);
52 p->connectionInfo.assocReqInfoElements = NULL;
53 kfree(p->connectionInfo.assocRspInfoElements);
54 p->connectionInfo.assocRspInfoElements = NULL;
57 case CSR_WIFI_SME_BLACKLIST_CFM:
59 CsrWifiSmeBlacklistCfm *p = (CsrWifiSmeBlacklistCfm *)message;
60 kfree(p->getAddresses);
61 p->getAddresses = NULL;
64 case CSR_WIFI_SME_CALIBRATION_DATA_GET_CFM:
66 CsrWifiSmeCalibrationDataGetCfm *p = (CsrWifiSmeCalibrationDataGetCfm *)message;
67 kfree(p->calibrationData);
68 p->calibrationData = NULL;
71 case CSR_WIFI_SME_CONNECTION_CONFIG_GET_CFM:
73 CsrWifiSmeConnectionConfigGetCfm *p = (CsrWifiSmeConnectionConfigGetCfm *)message;
74 kfree(p->connectionConfig.mlmeAssociateReqInformationElements);
75 p->connectionConfig.mlmeAssociateReqInformationElements = NULL;
78 case CSR_WIFI_SME_CONNECTION_INFO_GET_CFM:
80 CsrWifiSmeConnectionInfoGetCfm *p = (CsrWifiSmeConnectionInfoGetCfm *)message;
81 kfree(p->connectionInfo.beaconFrame);
82 p->connectionInfo.beaconFrame = NULL;
83 kfree(p->connectionInfo.associationReqFrame);
84 p->connectionInfo.associationReqFrame = NULL;
85 kfree(p->connectionInfo.associationRspFrame);
86 p->connectionInfo.associationRspFrame = NULL;
87 kfree(p->connectionInfo.assocScanInfoElements);
88 p->connectionInfo.assocScanInfoElements = NULL;
89 kfree(p->connectionInfo.assocReqInfoElements);
90 p->connectionInfo.assocReqInfoElements = NULL;
91 kfree(p->connectionInfo.assocRspInfoElements);
92 p->connectionInfo.assocRspInfoElements = NULL;
95 case CSR_WIFI_SME_MEDIA_STATUS_IND:
97 CsrWifiSmeMediaStatusInd *p = (CsrWifiSmeMediaStatusInd *)message;
98 kfree(p->connectionInfo.beaconFrame);
99 p->connectionInfo.beaconFrame = NULL;
100 kfree(p->connectionInfo.associationReqFrame);
101 p->connectionInfo.associationReqFrame = NULL;
102 kfree(p->connectionInfo.associationRspFrame);
103 p->connectionInfo.associationRspFrame = NULL;
104 kfree(p->connectionInfo.assocScanInfoElements);
105 p->connectionInfo.assocScanInfoElements = NULL;
106 kfree(p->connectionInfo.assocReqInfoElements);
107 p->connectionInfo.assocReqInfoElements = NULL;
108 kfree(p->connectionInfo.assocRspInfoElements);
109 p->connectionInfo.assocRspInfoElements = NULL;
112 case CSR_WIFI_SME_MIB_GET_CFM:
114 CsrWifiSmeMibGetCfm *p = (CsrWifiSmeMibGetCfm *)message;
115 kfree(p->mibAttribute);
116 p->mibAttribute = NULL;
119 case CSR_WIFI_SME_MIB_GET_NEXT_CFM:
121 CsrWifiSmeMibGetNextCfm *p = (CsrWifiSmeMibGetNextCfm *)message;
122 kfree(p->mibAttribute);
123 p->mibAttribute = NULL;
126 case CSR_WIFI_SME_MULTICAST_ADDRESS_CFM:
128 CsrWifiSmeMulticastAddressCfm *p = (CsrWifiSmeMulticastAddressCfm *)message;
129 kfree(p->getAddresses);
130 p->getAddresses = NULL;
133 case CSR_WIFI_SME_PMKID_CANDIDATE_LIST_IND:
135 CsrWifiSmePmkidCandidateListInd *p = (CsrWifiSmePmkidCandidateListInd *)message;
136 kfree(p->pmkidCandidates);
137 p->pmkidCandidates = NULL;
140 case CSR_WIFI_SME_PMKID_CFM:
142 CsrWifiSmePmkidCfm *p = (CsrWifiSmePmkidCfm *)message;
147 case CSR_WIFI_SME_SCAN_CONFIG_GET_CFM:
149 CsrWifiSmeScanConfigGetCfm *p = (CsrWifiSmeScanConfigGetCfm *)message;
150 kfree(p->scanConfig.passiveChannelList);
151 p->scanConfig.passiveChannelList = NULL;
154 case CSR_WIFI_SME_SCAN_RESULT_IND:
156 CsrWifiSmeScanResultInd *p = (CsrWifiSmeScanResultInd *)message;
157 kfree(p->result.informationElements);
158 p->result.informationElements = NULL;
159 switch (p->result.p2pDeviceRole)
161 case CSR_WIFI_SME_P2P_ROLE_GO:
164 for (i4 = 0; i4 < p->result.deviceInfo.groupInfo.p2pClientInfoCount; i4++)
166 kfree(p->result.deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.secDeviceType);
167 p->result.deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.secDeviceType = NULL;
170 kfree(p->result.deviceInfo.groupInfo.p2PClientInfo);
171 p->result.deviceInfo.groupInfo.p2PClientInfo = NULL;
173 case CSR_WIFI_SME_P2P_ROLE_STANDALONE:
174 kfree(p->result.deviceInfo.standalonedevInfo.secDeviceType);
175 p->result.deviceInfo.standalonedevInfo.secDeviceType = NULL;
182 case CSR_WIFI_SME_SCAN_RESULTS_GET_CFM:
184 CsrWifiSmeScanResultsGetCfm *p = (CsrWifiSmeScanResultsGetCfm *)message;
187 for (i1 = 0; i1 < p->scanResultsCount; i1++)
189 kfree(p->scanResults[i1].informationElements);
190 p->scanResults[i1].informationElements = NULL;
191 switch (p->scanResults[i1].p2pDeviceRole)
193 case CSR_WIFI_SME_P2P_ROLE_GO:
196 for (i4 = 0; i4 < p->scanResults[i1].deviceInfo.groupInfo.p2pClientInfoCount; i4++)
198 kfree(p->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.secDeviceType);
199 p->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo[i4].clientDeviceInfo.secDeviceType = NULL;
202 kfree(p->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo);
203 p->scanResults[i1].deviceInfo.groupInfo.p2PClientInfo = NULL;
205 case CSR_WIFI_SME_P2P_ROLE_STANDALONE:
206 kfree(p->scanResults[i1].deviceInfo.standalonedevInfo.secDeviceType);
207 p->scanResults[i1].deviceInfo.standalonedevInfo.secDeviceType = NULL;
214 kfree(p->scanResults);
215 p->scanResults = NULL;
218 case CSR_WIFI_SME_TSPEC_IND:
220 CsrWifiSmeTspecInd *p = (CsrWifiSmeTspecInd *)message;
225 case CSR_WIFI_SME_TSPEC_CFM:
227 CsrWifiSmeTspecCfm *p = (CsrWifiSmeTspecCfm *)message;
232 case CSR_WIFI_SME_VERSIONS_GET_CFM:
234 CsrWifiSmeVersionsGetCfm *p = (CsrWifiSmeVersionsGetCfm *)message;
235 kfree(p->versions.routerBuild);
236 p->versions.routerBuild = NULL;
237 kfree(p->versions.smeBuild);
238 p->versions.smeBuild = NULL;
241 case CSR_WIFI_SME_CLOAKED_SSIDS_GET_CFM:
243 CsrWifiSmeCloakedSsidsGetCfm *p = (CsrWifiSmeCloakedSsidsGetCfm *)message;
244 kfree(p->cloakedSsids.cloakedSsids);
245 p->cloakedSsids.cloakedSsids = NULL;
248 case CSR_WIFI_SME_ERROR_IND:
250 CsrWifiSmeErrorInd *p = (CsrWifiSmeErrorInd *)message;
251 kfree(p->errorMessage);
252 p->errorMessage = NULL;
255 case CSR_WIFI_SME_INFO_IND:
257 CsrWifiSmeInfoInd *p = (CsrWifiSmeInfoInd *)message;
258 kfree(p->infoMessage);
259 p->infoMessage = NULL;
262 case CSR_WIFI_SME_CORE_DUMP_IND:
264 CsrWifiSmeCoreDumpInd *p = (CsrWifiSmeCoreDumpInd *)message;