ARM: AM335x: Fix warning in timer.c
[linux-2.6/btrfs-unstable.git] / drivers / staging / csr / csr_wifi_sme_free_upstream_contents.c
blobc04767baaa5b4350aab3203330edca083818fe8b
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
7 on the license terms.
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 /*----------------------------------------------------------------------------*
17 * NAME
18 * CsrWifiSmeFreeUpstreamMessageContents
20 * DESCRIPTION
23 * PARAMETERS
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)
31 return;
33 if (NULL == message)
35 return;
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;
55 break;
57 case CSR_WIFI_SME_BLACKLIST_CFM:
59 CsrWifiSmeBlacklistCfm *p = (CsrWifiSmeBlacklistCfm *)message;
60 kfree(p->getAddresses);
61 p->getAddresses = NULL;
62 break;
64 case CSR_WIFI_SME_CALIBRATION_DATA_GET_CFM:
66 CsrWifiSmeCalibrationDataGetCfm *p = (CsrWifiSmeCalibrationDataGetCfm *)message;
67 kfree(p->calibrationData);
68 p->calibrationData = NULL;
69 break;
71 case CSR_WIFI_SME_CONNECTION_CONFIG_GET_CFM:
73 CsrWifiSmeConnectionConfigGetCfm *p = (CsrWifiSmeConnectionConfigGetCfm *)message;
74 kfree(p->connectionConfig.mlmeAssociateReqInformationElements);
75 p->connectionConfig.mlmeAssociateReqInformationElements = NULL;
76 break;
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;
93 break;
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;
110 break;
112 case CSR_WIFI_SME_MIB_GET_CFM:
114 CsrWifiSmeMibGetCfm *p = (CsrWifiSmeMibGetCfm *)message;
115 kfree(p->mibAttribute);
116 p->mibAttribute = NULL;
117 break;
119 case CSR_WIFI_SME_MIB_GET_NEXT_CFM:
121 CsrWifiSmeMibGetNextCfm *p = (CsrWifiSmeMibGetNextCfm *)message;
122 kfree(p->mibAttribute);
123 p->mibAttribute = NULL;
124 break;
126 case CSR_WIFI_SME_MULTICAST_ADDRESS_CFM:
128 CsrWifiSmeMulticastAddressCfm *p = (CsrWifiSmeMulticastAddressCfm *)message;
129 kfree(p->getAddresses);
130 p->getAddresses = NULL;
131 break;
133 case CSR_WIFI_SME_PMKID_CANDIDATE_LIST_IND:
135 CsrWifiSmePmkidCandidateListInd *p = (CsrWifiSmePmkidCandidateListInd *)message;
136 kfree(p->pmkidCandidates);
137 p->pmkidCandidates = NULL;
138 break;
140 case CSR_WIFI_SME_PMKID_CFM:
142 CsrWifiSmePmkidCfm *p = (CsrWifiSmePmkidCfm *)message;
143 kfree(p->getPmkids);
144 p->getPmkids = NULL;
145 break;
147 case CSR_WIFI_SME_SCAN_CONFIG_GET_CFM:
149 CsrWifiSmeScanConfigGetCfm *p = (CsrWifiSmeScanConfigGetCfm *)message;
150 kfree(p->scanConfig.passiveChannelList);
151 p->scanConfig.passiveChannelList = NULL;
152 break;
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:
163 u16 i4;
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;
172 break;
173 case CSR_WIFI_SME_P2P_ROLE_STANDALONE:
174 kfree(p->result.deviceInfo.standalonedevInfo.secDeviceType);
175 p->result.deviceInfo.standalonedevInfo.secDeviceType = NULL;
176 break;
177 default:
178 break;
180 break;
182 case CSR_WIFI_SME_SCAN_RESULTS_GET_CFM:
184 CsrWifiSmeScanResultsGetCfm *p = (CsrWifiSmeScanResultsGetCfm *)message;
186 u16 i1;
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:
195 u16 i4;
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;
204 break;
205 case CSR_WIFI_SME_P2P_ROLE_STANDALONE:
206 kfree(p->scanResults[i1].deviceInfo.standalonedevInfo.secDeviceType);
207 p->scanResults[i1].deviceInfo.standalonedevInfo.secDeviceType = NULL;
208 break;
209 default:
210 break;
214 kfree(p->scanResults);
215 p->scanResults = NULL;
216 break;
218 case CSR_WIFI_SME_TSPEC_IND:
220 CsrWifiSmeTspecInd *p = (CsrWifiSmeTspecInd *)message;
221 kfree(p->tspec);
222 p->tspec = NULL;
223 break;
225 case CSR_WIFI_SME_TSPEC_CFM:
227 CsrWifiSmeTspecCfm *p = (CsrWifiSmeTspecCfm *)message;
228 kfree(p->tspec);
229 p->tspec = NULL;
230 break;
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;
239 break;
241 case CSR_WIFI_SME_CLOAKED_SSIDS_GET_CFM:
243 CsrWifiSmeCloakedSsidsGetCfm *p = (CsrWifiSmeCloakedSsidsGetCfm *)message;
244 kfree(p->cloakedSsids.cloakedSsids);
245 p->cloakedSsids.cloakedSsids = NULL;
246 break;
248 case CSR_WIFI_SME_ERROR_IND:
250 CsrWifiSmeErrorInd *p = (CsrWifiSmeErrorInd *)message;
251 kfree(p->errorMessage);
252 p->errorMessage = NULL;
253 break;
255 case CSR_WIFI_SME_INFO_IND:
257 CsrWifiSmeInfoInd *p = (CsrWifiSmeInfoInd *)message;
258 kfree(p->infoMessage);
259 p->infoMessage = NULL;
260 break;
262 case CSR_WIFI_SME_CORE_DUMP_IND:
264 CsrWifiSmeCoreDumpInd *p = (CsrWifiSmeCoreDumpInd *)message;
265 kfree(p->data);
266 p->data = NULL;
267 break;
270 default:
271 break;