Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 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. */ |
Greg Kroah-Hartman | 4bcb20f | 2012-07-20 14:56:57 -0700 | [diff] [blame] | 12 | #include <linux/string.h> |
Greg Kroah-Hartman | 55a2705 | 2012-07-20 15:59:12 -0700 | [diff] [blame] | 13 | #include <linux/slab.h> |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 14 | #include "csr_msgconv.h" |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 15 | |
| 16 | #ifdef CSR_WIFI_NME_ENABLE |
| 17 | #ifdef CSR_WIFI_AP_ENABLE |
| 18 | |
| 19 | #include "csr_wifi_nme_ap_prim.h" |
| 20 | #include "csr_wifi_nme_ap_serialize.h" |
| 21 | |
| 22 | void CsrWifiNmeApPfree(void *ptr) |
| 23 | { |
Greg Kroah-Hartman | 55a2705 | 2012-07-20 15:59:12 -0700 | [diff] [blame] | 24 | kfree(ptr); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 25 | } |
| 26 | |
| 27 | |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 28 | size_t CsrWifiNmeApConfigSetReqSizeof(void *msg) |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 29 | { |
| 30 | CsrWifiNmeApConfigSetReq *primitive = (CsrWifiNmeApConfigSetReq *) msg; |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 31 | size_t bufferSize = 2; |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 32 | |
| 33 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 104) */ |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 34 | bufferSize += 2; /* u16 primitive->apConfig.apGroupkeyTimeout */ |
Greg Kroah-Hartman | 5379b13 | 2012-07-20 12:25:15 -0700 | [diff] [blame] | 35 | bufferSize += 1; /* u8 primitive->apConfig.apStrictGtkRekey */ |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 36 | bufferSize += 2; /* u16 primitive->apConfig.apGmkTimeout */ |
| 37 | bufferSize += 2; /* u16 primitive->apConfig.apResponseTimeout */ |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 38 | bufferSize += 1; /* u8 primitive->apConfig.apRetransLimit */ |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 39 | bufferSize += 1; /* CsrWifiSmeApPhySupportMask primitive->apMacConfig.phySupportedBitmap */ |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 40 | bufferSize += 2; /* u16 primitive->apMacConfig.beaconInterval */ |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 41 | bufferSize += 1; /* u8 primitive->apMacConfig.dtimPeriod */ |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 42 | bufferSize += 2; /* u16 primitive->apMacConfig.maxListenInterval */ |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 43 | bufferSize += 1; /* u8 primitive->apMacConfig.supportedRatesCount */ |
| 44 | bufferSize += 20; /* u8 primitive->apMacConfig.supportedRates[20] */ |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 45 | bufferSize += 1; /* CsrWifiSmePreambleType primitive->apMacConfig.preamble */ |
Greg Kroah-Hartman | 5379b13 | 2012-07-20 12:25:15 -0700 | [diff] [blame] | 46 | bufferSize += 1; /* u8 primitive->apMacConfig.shortSlotTimeEnabled */ |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 47 | bufferSize += 1; /* CsrWifiSmeCtsProtectionType primitive->apMacConfig.ctsProtectionType */ |
Greg Kroah-Hartman | 5379b13 | 2012-07-20 12:25:15 -0700 | [diff] [blame] | 48 | bufferSize += 1; /* u8 primitive->apMacConfig.wmmEnabled */ |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 49 | { |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 50 | u16 i2; |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 51 | for (i2 = 0; i2 < 4; i2++) |
| 52 | { |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 53 | bufferSize += 1; /* u8 primitive->apMacConfig.wmmApParams[i2].cwMin */ |
| 54 | bufferSize += 1; /* u8 primitive->apMacConfig.wmmApParams[i2].cwMax */ |
| 55 | bufferSize += 1; /* u8 primitive->apMacConfig.wmmApParams[i2].aifs */ |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 56 | bufferSize += 2; /* u16 primitive->apMacConfig.wmmApParams[i2].txopLimit */ |
Greg Kroah-Hartman | 5379b13 | 2012-07-20 12:25:15 -0700 | [diff] [blame] | 57 | bufferSize += 1; /* u8 primitive->apMacConfig.wmmApParams[i2].admissionControlMandatory */ |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 58 | } |
| 59 | } |
| 60 | { |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 61 | u16 i2; |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 62 | for (i2 = 0; i2 < 4; i2++) |
| 63 | { |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 64 | bufferSize += 1; /* u8 primitive->apMacConfig.wmmApBcParams[i2].cwMin */ |
| 65 | bufferSize += 1; /* u8 primitive->apMacConfig.wmmApBcParams[i2].cwMax */ |
| 66 | bufferSize += 1; /* u8 primitive->apMacConfig.wmmApBcParams[i2].aifs */ |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 67 | bufferSize += 2; /* u16 primitive->apMacConfig.wmmApBcParams[i2].txopLimit */ |
Greg Kroah-Hartman | 5379b13 | 2012-07-20 12:25:15 -0700 | [diff] [blame] | 68 | bufferSize += 1; /* u8 primitive->apMacConfig.wmmApBcParams[i2].admissionControlMandatory */ |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 69 | } |
| 70 | } |
| 71 | bufferSize += 1; /* CsrWifiSmeApAccessType primitive->apMacConfig.accessType */ |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 72 | bufferSize += 1; /* u8 primitive->apMacConfig.macAddressListCount */ |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 73 | { |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 74 | u16 i2; |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 75 | for (i2 = 0; i2 < primitive->apMacConfig.macAddressListCount; i2++) |
| 76 | { |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 77 | bufferSize += 6; /* u8 primitive->apMacConfig.macAddressList[i2].a[6] */ |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 78 | } |
| 79 | } |
Greg Kroah-Hartman | 5379b13 | 2012-07-20 12:25:15 -0700 | [diff] [blame] | 80 | bufferSize += 1; /* u8 primitive->apMacConfig.apHtParams.greenfieldSupported */ |
| 81 | bufferSize += 1; /* u8 primitive->apMacConfig.apHtParams.shortGi20MHz */ |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 82 | bufferSize += 1; /* u8 primitive->apMacConfig.apHtParams.rxStbc */ |
Greg Kroah-Hartman | 5379b13 | 2012-07-20 12:25:15 -0700 | [diff] [blame] | 83 | bufferSize += 1; /* u8 primitive->apMacConfig.apHtParams.rifsModeAllowed */ |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 84 | bufferSize += 1; /* u8 primitive->apMacConfig.apHtParams.htProtection */ |
Greg Kroah-Hartman | 5379b13 | 2012-07-20 12:25:15 -0700 | [diff] [blame] | 85 | bufferSize += 1; /* u8 primitive->apMacConfig.apHtParams.dualCtsProtection */ |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 86 | return bufferSize; |
| 87 | } |
| 88 | |
| 89 | |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 90 | u8* CsrWifiNmeApConfigSetReqSer(u8 *ptr, size_t *len, void *msg) |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 91 | { |
| 92 | CsrWifiNmeApConfigSetReq *primitive = (CsrWifiNmeApConfigSetReq *)msg; |
| 93 | *len = 0; |
| 94 | CsrUint16Ser(ptr, len, primitive->common.type); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 95 | CsrUint16Ser(ptr, len, (u16) primitive->apConfig.apGroupkeyTimeout); |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 96 | CsrUint8Ser(ptr, len, (u8) primitive->apConfig.apStrictGtkRekey); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 97 | CsrUint16Ser(ptr, len, (u16) primitive->apConfig.apGmkTimeout); |
| 98 | CsrUint16Ser(ptr, len, (u16) primitive->apConfig.apResponseTimeout); |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 99 | CsrUint8Ser(ptr, len, (u8) primitive->apConfig.apRetransLimit); |
| 100 | CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.phySupportedBitmap); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 101 | CsrUint16Ser(ptr, len, (u16) primitive->apMacConfig.beaconInterval); |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 102 | CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.dtimPeriod); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 103 | CsrUint16Ser(ptr, len, (u16) primitive->apMacConfig.maxListenInterval); |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 104 | CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.supportedRatesCount); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 105 | CsrMemCpySer(ptr, len, (const void *) primitive->apMacConfig.supportedRates, ((u16) (20))); |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 106 | CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.preamble); |
| 107 | CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.shortSlotTimeEnabled); |
| 108 | CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.ctsProtectionType); |
| 109 | CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.wmmEnabled); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 110 | { |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 111 | u16 i2; |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 112 | for (i2 = 0; i2 < 4; i2++) |
| 113 | { |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 114 | CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.wmmApParams[i2].cwMin); |
| 115 | CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.wmmApParams[i2].cwMax); |
| 116 | CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.wmmApParams[i2].aifs); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 117 | CsrUint16Ser(ptr, len, (u16) primitive->apMacConfig.wmmApParams[i2].txopLimit); |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 118 | CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.wmmApParams[i2].admissionControlMandatory); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 119 | } |
| 120 | } |
| 121 | { |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 122 | u16 i2; |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 123 | for (i2 = 0; i2 < 4; i2++) |
| 124 | { |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 125 | CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.wmmApBcParams[i2].cwMin); |
| 126 | CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.wmmApBcParams[i2].cwMax); |
| 127 | CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.wmmApBcParams[i2].aifs); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 128 | CsrUint16Ser(ptr, len, (u16) primitive->apMacConfig.wmmApBcParams[i2].txopLimit); |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 129 | CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.wmmApBcParams[i2].admissionControlMandatory); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 130 | } |
| 131 | } |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 132 | CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.accessType); |
| 133 | CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.macAddressListCount); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 134 | { |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 135 | u16 i2; |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 136 | for (i2 = 0; i2 < primitive->apMacConfig.macAddressListCount; i2++) |
| 137 | { |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 138 | CsrMemCpySer(ptr, len, (const void *) primitive->apMacConfig.macAddressList[i2].a, ((u16) (6))); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 139 | } |
| 140 | } |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 141 | CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.apHtParams.greenfieldSupported); |
| 142 | CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.apHtParams.shortGi20MHz); |
| 143 | CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.apHtParams.rxStbc); |
| 144 | CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.apHtParams.rifsModeAllowed); |
| 145 | CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.apHtParams.htProtection); |
| 146 | CsrUint8Ser(ptr, len, (u8) primitive->apMacConfig.apHtParams.dualCtsProtection); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 147 | return(ptr); |
| 148 | } |
| 149 | |
| 150 | |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 151 | void* CsrWifiNmeApConfigSetReqDes(u8 *buffer, size_t length) |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 152 | { |
Greg Kroah-Hartman | 786eeeb | 2012-07-20 16:41:09 -0700 | [diff] [blame] | 153 | CsrWifiNmeApConfigSetReq *primitive = kmalloc(sizeof(CsrWifiNmeApConfigSetReq), GFP_KERNEL); |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 154 | size_t offset; |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 155 | offset = 0; |
| 156 | |
| 157 | CsrUint16Des(&primitive->common.type, buffer, &offset); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 158 | CsrUint16Des((u16 *) &primitive->apConfig.apGroupkeyTimeout, buffer, &offset); |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 159 | CsrUint8Des((u8 *) &primitive->apConfig.apStrictGtkRekey, buffer, &offset); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 160 | CsrUint16Des((u16 *) &primitive->apConfig.apGmkTimeout, buffer, &offset); |
| 161 | CsrUint16Des((u16 *) &primitive->apConfig.apResponseTimeout, buffer, &offset); |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 162 | CsrUint8Des((u8 *) &primitive->apConfig.apRetransLimit, buffer, &offset); |
| 163 | CsrUint8Des((u8 *) &primitive->apMacConfig.phySupportedBitmap, buffer, &offset); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 164 | CsrUint16Des((u16 *) &primitive->apMacConfig.beaconInterval, buffer, &offset); |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 165 | CsrUint8Des((u8 *) &primitive->apMacConfig.dtimPeriod, buffer, &offset); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 166 | CsrUint16Des((u16 *) &primitive->apMacConfig.maxListenInterval, buffer, &offset); |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 167 | CsrUint8Des((u8 *) &primitive->apMacConfig.supportedRatesCount, buffer, &offset); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 168 | CsrMemCpyDes(primitive->apMacConfig.supportedRates, buffer, &offset, ((u16) (20))); |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 169 | CsrUint8Des((u8 *) &primitive->apMacConfig.preamble, buffer, &offset); |
| 170 | CsrUint8Des((u8 *) &primitive->apMacConfig.shortSlotTimeEnabled, buffer, &offset); |
| 171 | CsrUint8Des((u8 *) &primitive->apMacConfig.ctsProtectionType, buffer, &offset); |
| 172 | CsrUint8Des((u8 *) &primitive->apMacConfig.wmmEnabled, buffer, &offset); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 173 | { |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 174 | u16 i2; |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 175 | for (i2 = 0; i2 < 4; i2++) |
| 176 | { |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 177 | CsrUint8Des((u8 *) &primitive->apMacConfig.wmmApParams[i2].cwMin, buffer, &offset); |
| 178 | CsrUint8Des((u8 *) &primitive->apMacConfig.wmmApParams[i2].cwMax, buffer, &offset); |
| 179 | CsrUint8Des((u8 *) &primitive->apMacConfig.wmmApParams[i2].aifs, buffer, &offset); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 180 | CsrUint16Des((u16 *) &primitive->apMacConfig.wmmApParams[i2].txopLimit, buffer, &offset); |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 181 | CsrUint8Des((u8 *) &primitive->apMacConfig.wmmApParams[i2].admissionControlMandatory, buffer, &offset); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 182 | } |
| 183 | } |
| 184 | { |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 185 | u16 i2; |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 186 | for (i2 = 0; i2 < 4; i2++) |
| 187 | { |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 188 | CsrUint8Des((u8 *) &primitive->apMacConfig.wmmApBcParams[i2].cwMin, buffer, &offset); |
| 189 | CsrUint8Des((u8 *) &primitive->apMacConfig.wmmApBcParams[i2].cwMax, buffer, &offset); |
| 190 | CsrUint8Des((u8 *) &primitive->apMacConfig.wmmApBcParams[i2].aifs, buffer, &offset); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 191 | CsrUint16Des((u16 *) &primitive->apMacConfig.wmmApBcParams[i2].txopLimit, buffer, &offset); |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 192 | CsrUint8Des((u8 *) &primitive->apMacConfig.wmmApBcParams[i2].admissionControlMandatory, buffer, &offset); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 193 | } |
| 194 | } |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 195 | CsrUint8Des((u8 *) &primitive->apMacConfig.accessType, buffer, &offset); |
| 196 | CsrUint8Des((u8 *) &primitive->apMacConfig.macAddressListCount, buffer, &offset); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 197 | primitive->apMacConfig.macAddressList = NULL; |
| 198 | if (primitive->apMacConfig.macAddressListCount) |
| 199 | { |
Greg Kroah-Hartman | 786eeeb | 2012-07-20 16:41:09 -0700 | [diff] [blame] | 200 | primitive->apMacConfig.macAddressList = kmalloc(sizeof(CsrWifiMacAddress) * primitive->apMacConfig.macAddressListCount, GFP_KERNEL); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 201 | } |
| 202 | { |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 203 | u16 i2; |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 204 | for (i2 = 0; i2 < primitive->apMacConfig.macAddressListCount; i2++) |
| 205 | { |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 206 | CsrMemCpyDes(primitive->apMacConfig.macAddressList[i2].a, buffer, &offset, ((u16) (6))); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 207 | } |
| 208 | } |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 209 | CsrUint8Des((u8 *) &primitive->apMacConfig.apHtParams.greenfieldSupported, buffer, &offset); |
| 210 | CsrUint8Des((u8 *) &primitive->apMacConfig.apHtParams.shortGi20MHz, buffer, &offset); |
| 211 | CsrUint8Des((u8 *) &primitive->apMacConfig.apHtParams.rxStbc, buffer, &offset); |
| 212 | CsrUint8Des((u8 *) &primitive->apMacConfig.apHtParams.rifsModeAllowed, buffer, &offset); |
| 213 | CsrUint8Des((u8 *) &primitive->apMacConfig.apHtParams.htProtection, buffer, &offset); |
| 214 | CsrUint8Des((u8 *) &primitive->apMacConfig.apHtParams.dualCtsProtection, buffer, &offset); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 215 | |
| 216 | return primitive; |
| 217 | } |
| 218 | |
| 219 | |
| 220 | void CsrWifiNmeApConfigSetReqSerFree(void *voidPrimitivePointer) |
| 221 | { |
| 222 | CsrWifiNmeApConfigSetReq *primitive = (CsrWifiNmeApConfigSetReq *) voidPrimitivePointer; |
Greg Kroah-Hartman | 55a2705 | 2012-07-20 15:59:12 -0700 | [diff] [blame] | 223 | kfree(primitive->apMacConfig.macAddressList); |
| 224 | kfree(primitive); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 225 | } |
| 226 | |
| 227 | |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 228 | size_t CsrWifiNmeApWpsRegisterReqSizeof(void *msg) |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 229 | { |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 230 | size_t bufferSize = 2; |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 231 | |
| 232 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 17) */ |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 233 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 234 | bufferSize += 2; /* CsrWifiSmeWpsDpid primitive->selectedDevicePasswordId */ |
| 235 | bufferSize += 2; /* CsrWifiSmeWpsConfigType primitive->selectedConfigMethod */ |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 236 | bufferSize += 8; /* u8 primitive->pin[8] */ |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 237 | return bufferSize; |
| 238 | } |
| 239 | |
| 240 | |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 241 | u8* CsrWifiNmeApWpsRegisterReqSer(u8 *ptr, size_t *len, void *msg) |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 242 | { |
| 243 | CsrWifiNmeApWpsRegisterReq *primitive = (CsrWifiNmeApWpsRegisterReq *)msg; |
| 244 | *len = 0; |
| 245 | CsrUint16Ser(ptr, len, primitive->common.type); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 246 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); |
| 247 | CsrUint16Ser(ptr, len, (u16) primitive->selectedDevicePasswordId); |
| 248 | CsrUint16Ser(ptr, len, (u16) primitive->selectedConfigMethod); |
| 249 | CsrMemCpySer(ptr, len, (const void *) primitive->pin, ((u16) (8))); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 250 | return(ptr); |
| 251 | } |
| 252 | |
| 253 | |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 254 | void* CsrWifiNmeApWpsRegisterReqDes(u8 *buffer, size_t length) |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 255 | { |
Greg Kroah-Hartman | 786eeeb | 2012-07-20 16:41:09 -0700 | [diff] [blame] | 256 | CsrWifiNmeApWpsRegisterReq *primitive = kmalloc(sizeof(CsrWifiNmeApWpsRegisterReq), GFP_KERNEL); |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 257 | size_t offset; |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 258 | offset = 0; |
| 259 | |
| 260 | CsrUint16Des(&primitive->common.type, buffer, &offset); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 261 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); |
| 262 | CsrUint16Des((u16 *) &primitive->selectedDevicePasswordId, buffer, &offset); |
| 263 | CsrUint16Des((u16 *) &primitive->selectedConfigMethod, buffer, &offset); |
| 264 | CsrMemCpyDes(primitive->pin, buffer, &offset, ((u16) (8))); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 265 | |
| 266 | return primitive; |
| 267 | } |
| 268 | |
| 269 | |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 270 | size_t CsrWifiNmeApStartReqSizeof(void *msg) |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 271 | { |
| 272 | CsrWifiNmeApStartReq *primitive = (CsrWifiNmeApStartReq *) msg; |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 273 | size_t bufferSize = 2; |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 274 | |
| 275 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 112) */ |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 276 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 277 | bufferSize += 1; /* CsrWifiSmeApType primitive->apType */ |
Greg Kroah-Hartman | 5379b13 | 2012-07-20 12:25:15 -0700 | [diff] [blame] | 278 | bufferSize += 1; /* u8 primitive->cloakSsid */ |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 279 | bufferSize += 32; /* u8 primitive->ssid.ssid[32] */ |
| 280 | bufferSize += 1; /* u8 primitive->ssid.length */ |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 281 | bufferSize += 1; /* CsrWifiSmeRadioIF primitive->ifIndex */ |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 282 | bufferSize += 1; /* u8 primitive->channel */ |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 283 | bufferSize += 1; /* CsrWifiSmeApAuthType primitive->apCredentials.authType */ |
| 284 | switch (primitive->apCredentials.authType) |
| 285 | { |
| 286 | case CSR_WIFI_SME_AP_AUTH_TYPE_OPEN_SYSTEM: |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 287 | bufferSize += 1; /* u8 primitive->apCredentials.nmeAuthType.openSystemEmpty.empty */ |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 288 | break; |
| 289 | case CSR_WIFI_SME_AP_AUTH_TYPE_WEP: |
| 290 | bufferSize += 1; /* CsrWifiSmeWepCredentialType primitive->apCredentials.nmeAuthType.authwep.wepKeyType */ |
| 291 | switch (primitive->apCredentials.nmeAuthType.authwep.wepKeyType) |
| 292 | { |
| 293 | case CSR_WIFI_SME_CREDENTIAL_TYPE_WEP128: |
| 294 | bufferSize += 1; /* CsrWifiSmeWepAuthMode primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep128Key.wepAuthType */ |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 295 | bufferSize += 1; /* u8 primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep128Key.selectedWepKey */ |
| 296 | bufferSize += 13; /* u8 primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep128Key.key1[13] */ |
| 297 | bufferSize += 13; /* u8 primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep128Key.key2[13] */ |
| 298 | bufferSize += 13; /* u8 primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep128Key.key3[13] */ |
| 299 | bufferSize += 13; /* u8 primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep128Key.key4[13] */ |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 300 | break; |
| 301 | case CSR_WIFI_SME_CREDENTIAL_TYPE_WEP64: |
| 302 | bufferSize += 1; /* CsrWifiSmeWepAuthMode primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep64Key.wepAuthType */ |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 303 | bufferSize += 1; /* u8 primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep64Key.selectedWepKey */ |
| 304 | bufferSize += 5; /* u8 primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep64Key.key1[5] */ |
| 305 | bufferSize += 5; /* u8 primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep64Key.key2[5] */ |
| 306 | bufferSize += 5; /* u8 primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep64Key.key3[5] */ |
| 307 | bufferSize += 5; /* u8 primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep64Key.key4[5] */ |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 308 | break; |
| 309 | default: |
| 310 | break; |
| 311 | } |
| 312 | break; |
| 313 | case CSR_WIFI_SME_AP_AUTH_TYPE_PERSONAL: |
| 314 | bufferSize += 1; /* CsrWifiSmeApAuthSupportMask primitive->apCredentials.nmeAuthType.authTypePersonal.authSupport */ |
| 315 | bufferSize += 2; /* CsrWifiSmeApRsnCapabilitiesMask primitive->apCredentials.nmeAuthType.authTypePersonal.rsnCapabilities */ |
| 316 | bufferSize += 2; /* CsrWifiSmeApWapiCapabilitiesMask primitive->apCredentials.nmeAuthType.authTypePersonal.wapiCapabilities */ |
| 317 | bufferSize += 1; /* CsrWifiNmeApPersCredentialType primitive->apCredentials.nmeAuthType.authTypePersonal.pskOrPassphrase */ |
| 318 | switch (primitive->apCredentials.nmeAuthType.authTypePersonal.pskOrPassphrase) |
| 319 | { |
| 320 | case CSR_WIFI_NME_AP_CREDENTIAL_TYPE_PSK: |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 321 | bufferSize += 2; /* u16 primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.psk.encryptionMode */ |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 322 | bufferSize += 32; /* u8 primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.psk.psk[32] */ |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 323 | break; |
| 324 | case CSR_WIFI_NME_AP_CREDENTIAL_TYPE_PASSPHRASE: |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 325 | bufferSize += 2; /* u16 primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.passphrase.encryptionMode */ |
Greg Kroah-Hartman | 4bcb20f | 2012-07-20 14:56:57 -0700 | [diff] [blame] | 326 | bufferSize += (primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.passphrase.passphrase ? strlen(primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.passphrase.passphrase) : 0) + 1; /* char* primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.passphrase.passphrase (0 byte len + 1 for NULL Term) */ |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 327 | break; |
| 328 | default: |
| 329 | break; |
| 330 | } |
| 331 | break; |
| 332 | default: |
| 333 | break; |
| 334 | } |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 335 | bufferSize += 1; /* u8 primitive->maxConnections */ |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 336 | bufferSize += 1; /* CsrWifiSmeP2pGroupCapabilityMask primitive->p2pGoParam.groupCapability */ |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 337 | bufferSize += 3; /* u8 primitive->p2pGoParam.operatingChanList.country[3] */ |
| 338 | bufferSize += 1; /* u8 primitive->p2pGoParam.operatingChanList.channelEntryListCount */ |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 339 | { |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 340 | u16 i3; |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 341 | for (i3 = 0; i3 < primitive->p2pGoParam.operatingChanList.channelEntryListCount; i3++) |
| 342 | { |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 343 | bufferSize += 1; /* u8 primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingClass */ |
| 344 | bufferSize += 1; /* u8 primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannelCount */ |
| 345 | bufferSize += primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannelCount; /* u8 primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannel */ |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 346 | } |
| 347 | } |
Greg Kroah-Hartman | 5379b13 | 2012-07-20 12:25:15 -0700 | [diff] [blame] | 348 | bufferSize += 1; /* u8 primitive->p2pGoParam.opPsEnabled */ |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 349 | bufferSize += 1; /* u8 primitive->p2pGoParam.ctWindow */ |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 350 | bufferSize += 1; /* CsrWifiSmeP2pNoaConfigMethod primitive->p2pGoParam.noaConfigMethod */ |
Greg Kroah-Hartman | 5379b13 | 2012-07-20 12:25:15 -0700 | [diff] [blame] | 351 | bufferSize += 1; /* u8 primitive->p2pGoParam.allowNoaWithNonP2pDevices */ |
| 352 | bufferSize += 1; /* u8 primitive->wpsEnabled */ |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 353 | return bufferSize; |
| 354 | } |
| 355 | |
| 356 | |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 357 | u8* CsrWifiNmeApStartReqSer(u8 *ptr, size_t *len, void *msg) |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 358 | { |
| 359 | CsrWifiNmeApStartReq *primitive = (CsrWifiNmeApStartReq *)msg; |
| 360 | *len = 0; |
| 361 | CsrUint16Ser(ptr, len, primitive->common.type); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 362 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 363 | CsrUint8Ser(ptr, len, (u8) primitive->apType); |
| 364 | CsrUint8Ser(ptr, len, (u8) primitive->cloakSsid); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 365 | CsrMemCpySer(ptr, len, (const void *) primitive->ssid.ssid, ((u16) (32))); |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 366 | CsrUint8Ser(ptr, len, (u8) primitive->ssid.length); |
| 367 | CsrUint8Ser(ptr, len, (u8) primitive->ifIndex); |
| 368 | CsrUint8Ser(ptr, len, (u8) primitive->channel); |
| 369 | CsrUint8Ser(ptr, len, (u8) primitive->apCredentials.authType); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 370 | switch (primitive->apCredentials.authType) |
| 371 | { |
| 372 | case CSR_WIFI_SME_AP_AUTH_TYPE_OPEN_SYSTEM: |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 373 | CsrUint8Ser(ptr, len, (u8) primitive->apCredentials.nmeAuthType.openSystemEmpty.empty); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 374 | break; |
| 375 | case CSR_WIFI_SME_AP_AUTH_TYPE_WEP: |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 376 | CsrUint8Ser(ptr, len, (u8) primitive->apCredentials.nmeAuthType.authwep.wepKeyType); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 377 | switch (primitive->apCredentials.nmeAuthType.authwep.wepKeyType) |
| 378 | { |
| 379 | case CSR_WIFI_SME_CREDENTIAL_TYPE_WEP128: |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 380 | CsrUint8Ser(ptr, len, (u8) primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep128Key.wepAuthType); |
| 381 | CsrUint8Ser(ptr, len, (u8) primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep128Key.selectedWepKey); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 382 | CsrMemCpySer(ptr, len, (const void *) primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep128Key.key1, ((u16) (13))); |
| 383 | CsrMemCpySer(ptr, len, (const void *) primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep128Key.key2, ((u16) (13))); |
| 384 | CsrMemCpySer(ptr, len, (const void *) primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep128Key.key3, ((u16) (13))); |
| 385 | CsrMemCpySer(ptr, len, (const void *) primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep128Key.key4, ((u16) (13))); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 386 | break; |
| 387 | case CSR_WIFI_SME_CREDENTIAL_TYPE_WEP64: |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 388 | CsrUint8Ser(ptr, len, (u8) primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep64Key.wepAuthType); |
| 389 | CsrUint8Ser(ptr, len, (u8) primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep64Key.selectedWepKey); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 390 | CsrMemCpySer(ptr, len, (const void *) primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep64Key.key1, ((u16) (5))); |
| 391 | CsrMemCpySer(ptr, len, (const void *) primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep64Key.key2, ((u16) (5))); |
| 392 | CsrMemCpySer(ptr, len, (const void *) primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep64Key.key3, ((u16) (5))); |
| 393 | CsrMemCpySer(ptr, len, (const void *) primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep64Key.key4, ((u16) (5))); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 394 | break; |
| 395 | default: |
| 396 | break; |
| 397 | } |
| 398 | break; |
| 399 | case CSR_WIFI_SME_AP_AUTH_TYPE_PERSONAL: |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 400 | CsrUint8Ser(ptr, len, (u8) primitive->apCredentials.nmeAuthType.authTypePersonal.authSupport); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 401 | CsrUint16Ser(ptr, len, (u16) primitive->apCredentials.nmeAuthType.authTypePersonal.rsnCapabilities); |
| 402 | CsrUint16Ser(ptr, len, (u16) primitive->apCredentials.nmeAuthType.authTypePersonal.wapiCapabilities); |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 403 | CsrUint8Ser(ptr, len, (u8) primitive->apCredentials.nmeAuthType.authTypePersonal.pskOrPassphrase); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 404 | switch (primitive->apCredentials.nmeAuthType.authTypePersonal.pskOrPassphrase) |
| 405 | { |
| 406 | case CSR_WIFI_NME_AP_CREDENTIAL_TYPE_PSK: |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 407 | CsrUint16Ser(ptr, len, (u16) primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.psk.encryptionMode); |
| 408 | CsrMemCpySer(ptr, len, (const void *) primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.psk.psk, ((u16) (32))); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 409 | break; |
| 410 | case CSR_WIFI_NME_AP_CREDENTIAL_TYPE_PASSPHRASE: |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 411 | CsrUint16Ser(ptr, len, (u16) primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.passphrase.encryptionMode); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 412 | CsrCharStringSer(ptr, len, primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.passphrase.passphrase); |
| 413 | break; |
| 414 | default: |
| 415 | break; |
| 416 | } |
| 417 | break; |
| 418 | default: |
| 419 | break; |
| 420 | } |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 421 | CsrUint8Ser(ptr, len, (u8) primitive->maxConnections); |
| 422 | CsrUint8Ser(ptr, len, (u8) primitive->p2pGoParam.groupCapability); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 423 | CsrMemCpySer(ptr, len, (const void *) primitive->p2pGoParam.operatingChanList.country, ((u16) (3))); |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 424 | CsrUint8Ser(ptr, len, (u8) primitive->p2pGoParam.operatingChanList.channelEntryListCount); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 425 | { |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 426 | u16 i3; |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 427 | for (i3 = 0; i3 < primitive->p2pGoParam.operatingChanList.channelEntryListCount; i3++) |
| 428 | { |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 429 | CsrUint8Ser(ptr, len, (u8) primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingClass); |
| 430 | CsrUint8Ser(ptr, len, (u8) primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannelCount); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 431 | if (primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannelCount) |
| 432 | { |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 433 | CsrMemCpySer(ptr, len, (const void *) primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannel, ((u16) (primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannelCount))); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 434 | } |
| 435 | } |
| 436 | } |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 437 | CsrUint8Ser(ptr, len, (u8) primitive->p2pGoParam.opPsEnabled); |
| 438 | CsrUint8Ser(ptr, len, (u8) primitive->p2pGoParam.ctWindow); |
| 439 | CsrUint8Ser(ptr, len, (u8) primitive->p2pGoParam.noaConfigMethod); |
| 440 | CsrUint8Ser(ptr, len, (u8) primitive->p2pGoParam.allowNoaWithNonP2pDevices); |
| 441 | CsrUint8Ser(ptr, len, (u8) primitive->wpsEnabled); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 442 | return(ptr); |
| 443 | } |
| 444 | |
| 445 | |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 446 | void* CsrWifiNmeApStartReqDes(u8 *buffer, size_t length) |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 447 | { |
Greg Kroah-Hartman | 786eeeb | 2012-07-20 16:41:09 -0700 | [diff] [blame] | 448 | CsrWifiNmeApStartReq *primitive = kmalloc(sizeof(CsrWifiNmeApStartReq), GFP_KERNEL); |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 449 | size_t offset; |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 450 | offset = 0; |
| 451 | |
| 452 | CsrUint16Des(&primitive->common.type, buffer, &offset); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 453 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 454 | CsrUint8Des((u8 *) &primitive->apType, buffer, &offset); |
| 455 | CsrUint8Des((u8 *) &primitive->cloakSsid, buffer, &offset); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 456 | CsrMemCpyDes(primitive->ssid.ssid, buffer, &offset, ((u16) (32))); |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 457 | CsrUint8Des((u8 *) &primitive->ssid.length, buffer, &offset); |
| 458 | CsrUint8Des((u8 *) &primitive->ifIndex, buffer, &offset); |
| 459 | CsrUint8Des((u8 *) &primitive->channel, buffer, &offset); |
| 460 | CsrUint8Des((u8 *) &primitive->apCredentials.authType, buffer, &offset); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 461 | switch (primitive->apCredentials.authType) |
| 462 | { |
| 463 | case CSR_WIFI_SME_AP_AUTH_TYPE_OPEN_SYSTEM: |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 464 | CsrUint8Des((u8 *) &primitive->apCredentials.nmeAuthType.openSystemEmpty.empty, buffer, &offset); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 465 | break; |
| 466 | case CSR_WIFI_SME_AP_AUTH_TYPE_WEP: |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 467 | CsrUint8Des((u8 *) &primitive->apCredentials.nmeAuthType.authwep.wepKeyType, buffer, &offset); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 468 | switch (primitive->apCredentials.nmeAuthType.authwep.wepKeyType) |
| 469 | { |
| 470 | case CSR_WIFI_SME_CREDENTIAL_TYPE_WEP128: |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 471 | CsrUint8Des((u8 *) &primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep128Key.wepAuthType, buffer, &offset); |
| 472 | CsrUint8Des((u8 *) &primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep128Key.selectedWepKey, buffer, &offset); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 473 | CsrMemCpyDes(primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep128Key.key1, buffer, &offset, ((u16) (13))); |
| 474 | CsrMemCpyDes(primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep128Key.key2, buffer, &offset, ((u16) (13))); |
| 475 | CsrMemCpyDes(primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep128Key.key3, buffer, &offset, ((u16) (13))); |
| 476 | CsrMemCpyDes(primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep128Key.key4, buffer, &offset, ((u16) (13))); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 477 | break; |
| 478 | case CSR_WIFI_SME_CREDENTIAL_TYPE_WEP64: |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 479 | CsrUint8Des((u8 *) &primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep64Key.wepAuthType, buffer, &offset); |
| 480 | CsrUint8Des((u8 *) &primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep64Key.selectedWepKey, buffer, &offset); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 481 | CsrMemCpyDes(primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep64Key.key1, buffer, &offset, ((u16) (5))); |
| 482 | CsrMemCpyDes(primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep64Key.key2, buffer, &offset, ((u16) (5))); |
| 483 | CsrMemCpyDes(primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep64Key.key3, buffer, &offset, ((u16) (5))); |
| 484 | CsrMemCpyDes(primitive->apCredentials.nmeAuthType.authwep.wepCredentials.wep64Key.key4, buffer, &offset, ((u16) (5))); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 485 | break; |
| 486 | default: |
| 487 | break; |
| 488 | } |
| 489 | break; |
| 490 | case CSR_WIFI_SME_AP_AUTH_TYPE_PERSONAL: |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 491 | CsrUint8Des((u8 *) &primitive->apCredentials.nmeAuthType.authTypePersonal.authSupport, buffer, &offset); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 492 | CsrUint16Des((u16 *) &primitive->apCredentials.nmeAuthType.authTypePersonal.rsnCapabilities, buffer, &offset); |
| 493 | CsrUint16Des((u16 *) &primitive->apCredentials.nmeAuthType.authTypePersonal.wapiCapabilities, buffer, &offset); |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 494 | CsrUint8Des((u8 *) &primitive->apCredentials.nmeAuthType.authTypePersonal.pskOrPassphrase, buffer, &offset); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 495 | switch (primitive->apCredentials.nmeAuthType.authTypePersonal.pskOrPassphrase) |
| 496 | { |
| 497 | case CSR_WIFI_NME_AP_CREDENTIAL_TYPE_PSK: |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 498 | CsrUint16Des((u16 *) &primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.psk.encryptionMode, buffer, &offset); |
| 499 | CsrMemCpyDes(primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.psk.psk, buffer, &offset, ((u16) (32))); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 500 | break; |
| 501 | case CSR_WIFI_NME_AP_CREDENTIAL_TYPE_PASSPHRASE: |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 502 | CsrUint16Des((u16 *) &primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.passphrase.encryptionMode, buffer, &offset); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 503 | CsrCharStringDes(&primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.passphrase.passphrase, buffer, &offset); |
| 504 | break; |
| 505 | default: |
| 506 | break; |
| 507 | } |
| 508 | break; |
| 509 | default: |
| 510 | break; |
| 511 | } |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 512 | CsrUint8Des((u8 *) &primitive->maxConnections, buffer, &offset); |
| 513 | CsrUint8Des((u8 *) &primitive->p2pGoParam.groupCapability, buffer, &offset); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 514 | CsrMemCpyDes(primitive->p2pGoParam.operatingChanList.country, buffer, &offset, ((u16) (3))); |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 515 | CsrUint8Des((u8 *) &primitive->p2pGoParam.operatingChanList.channelEntryListCount, buffer, &offset); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 516 | primitive->p2pGoParam.operatingChanList.channelEntryList = NULL; |
| 517 | if (primitive->p2pGoParam.operatingChanList.channelEntryListCount) |
| 518 | { |
Greg Kroah-Hartman | 786eeeb | 2012-07-20 16:41:09 -0700 | [diff] [blame] | 519 | primitive->p2pGoParam.operatingChanList.channelEntryList = kmalloc(sizeof(CsrWifiSmeApP2pOperatingChanEntry) * primitive->p2pGoParam.operatingChanList.channelEntryListCount, GFP_KERNEL); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 520 | } |
| 521 | { |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 522 | u16 i3; |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 523 | for (i3 = 0; i3 < primitive->p2pGoParam.operatingChanList.channelEntryListCount; i3++) |
| 524 | { |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 525 | CsrUint8Des((u8 *) &primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingClass, buffer, &offset); |
| 526 | CsrUint8Des((u8 *) &primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannelCount, buffer, &offset); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 527 | if (primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannelCount) |
| 528 | { |
Greg Kroah-Hartman | 786eeeb | 2012-07-20 16:41:09 -0700 | [diff] [blame] | 529 | primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannel = kmalloc(primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannelCount, GFP_KERNEL); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 530 | CsrMemCpyDes(primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannel, buffer, &offset, ((u16) (primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannelCount))); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 531 | } |
| 532 | else |
| 533 | { |
| 534 | primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannel = NULL; |
| 535 | } |
| 536 | } |
| 537 | } |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 538 | CsrUint8Des((u8 *) &primitive->p2pGoParam.opPsEnabled, buffer, &offset); |
| 539 | CsrUint8Des((u8 *) &primitive->p2pGoParam.ctWindow, buffer, &offset); |
| 540 | CsrUint8Des((u8 *) &primitive->p2pGoParam.noaConfigMethod, buffer, &offset); |
| 541 | CsrUint8Des((u8 *) &primitive->p2pGoParam.allowNoaWithNonP2pDevices, buffer, &offset); |
| 542 | CsrUint8Des((u8 *) &primitive->wpsEnabled, buffer, &offset); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 543 | |
| 544 | return primitive; |
| 545 | } |
| 546 | |
| 547 | |
| 548 | void CsrWifiNmeApStartReqSerFree(void *voidPrimitivePointer) |
| 549 | { |
| 550 | CsrWifiNmeApStartReq *primitive = (CsrWifiNmeApStartReq *) voidPrimitivePointer; |
| 551 | switch (primitive->apCredentials.authType) |
| 552 | { |
| 553 | case CSR_WIFI_SME_AP_AUTH_TYPE_PERSONAL: |
| 554 | switch (primitive->apCredentials.nmeAuthType.authTypePersonal.pskOrPassphrase) |
| 555 | { |
| 556 | case CSR_WIFI_NME_AP_CREDENTIAL_TYPE_PASSPHRASE: |
Greg Kroah-Hartman | 55a2705 | 2012-07-20 15:59:12 -0700 | [diff] [blame] | 557 | kfree(primitive->apCredentials.nmeAuthType.authTypePersonal.authPers_credentials.passphrase.passphrase); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 558 | break; |
| 559 | default: |
| 560 | break; |
| 561 | } |
| 562 | break; |
| 563 | default: |
| 564 | break; |
| 565 | } |
| 566 | { |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 567 | u16 i3; |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 568 | for (i3 = 0; i3 < primitive->p2pGoParam.operatingChanList.channelEntryListCount; i3++) |
| 569 | { |
Greg Kroah-Hartman | 55a2705 | 2012-07-20 15:59:12 -0700 | [diff] [blame] | 570 | kfree(primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannel); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 571 | } |
| 572 | } |
Greg Kroah-Hartman | 55a2705 | 2012-07-20 15:59:12 -0700 | [diff] [blame] | 573 | kfree(primitive->p2pGoParam.operatingChanList.channelEntryList); |
| 574 | kfree(primitive); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 575 | } |
| 576 | |
| 577 | |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 578 | size_t CsrWifiNmeApWmmParamUpdateReqSizeof(void *msg) |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 579 | { |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 580 | size_t bufferSize = 2; |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 581 | |
| 582 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 51) */ |
| 583 | { |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 584 | u16 i1; |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 585 | for (i1 = 0; i1 < 4; i1++) |
| 586 | { |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 587 | bufferSize += 1; /* u8 primitive->wmmApParams[i1].cwMin */ |
| 588 | bufferSize += 1; /* u8 primitive->wmmApParams[i1].cwMax */ |
| 589 | bufferSize += 1; /* u8 primitive->wmmApParams[i1].aifs */ |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 590 | bufferSize += 2; /* u16 primitive->wmmApParams[i1].txopLimit */ |
Greg Kroah-Hartman | 5379b13 | 2012-07-20 12:25:15 -0700 | [diff] [blame] | 591 | bufferSize += 1; /* u8 primitive->wmmApParams[i1].admissionControlMandatory */ |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 592 | } |
| 593 | } |
| 594 | { |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 595 | u16 i1; |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 596 | for (i1 = 0; i1 < 4; i1++) |
| 597 | { |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 598 | bufferSize += 1; /* u8 primitive->wmmApBcParams[i1].cwMin */ |
| 599 | bufferSize += 1; /* u8 primitive->wmmApBcParams[i1].cwMax */ |
| 600 | bufferSize += 1; /* u8 primitive->wmmApBcParams[i1].aifs */ |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 601 | bufferSize += 2; /* u16 primitive->wmmApBcParams[i1].txopLimit */ |
Greg Kroah-Hartman | 5379b13 | 2012-07-20 12:25:15 -0700 | [diff] [blame] | 602 | bufferSize += 1; /* u8 primitive->wmmApBcParams[i1].admissionControlMandatory */ |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 603 | } |
| 604 | } |
| 605 | return bufferSize; |
| 606 | } |
| 607 | |
| 608 | |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 609 | u8* CsrWifiNmeApWmmParamUpdateReqSer(u8 *ptr, size_t *len, void *msg) |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 610 | { |
| 611 | CsrWifiNmeApWmmParamUpdateReq *primitive = (CsrWifiNmeApWmmParamUpdateReq *)msg; |
| 612 | *len = 0; |
| 613 | CsrUint16Ser(ptr, len, primitive->common.type); |
| 614 | { |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 615 | u16 i1; |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 616 | for (i1 = 0; i1 < 4; i1++) |
| 617 | { |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 618 | CsrUint8Ser(ptr, len, (u8) primitive->wmmApParams[i1].cwMin); |
| 619 | CsrUint8Ser(ptr, len, (u8) primitive->wmmApParams[i1].cwMax); |
| 620 | CsrUint8Ser(ptr, len, (u8) primitive->wmmApParams[i1].aifs); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 621 | CsrUint16Ser(ptr, len, (u16) primitive->wmmApParams[i1].txopLimit); |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 622 | CsrUint8Ser(ptr, len, (u8) primitive->wmmApParams[i1].admissionControlMandatory); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 623 | } |
| 624 | } |
| 625 | { |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 626 | u16 i1; |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 627 | for (i1 = 0; i1 < 4; i1++) |
| 628 | { |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 629 | CsrUint8Ser(ptr, len, (u8) primitive->wmmApBcParams[i1].cwMin); |
| 630 | CsrUint8Ser(ptr, len, (u8) primitive->wmmApBcParams[i1].cwMax); |
| 631 | CsrUint8Ser(ptr, len, (u8) primitive->wmmApBcParams[i1].aifs); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 632 | CsrUint16Ser(ptr, len, (u16) primitive->wmmApBcParams[i1].txopLimit); |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 633 | CsrUint8Ser(ptr, len, (u8) primitive->wmmApBcParams[i1].admissionControlMandatory); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 634 | } |
| 635 | } |
| 636 | return(ptr); |
| 637 | } |
| 638 | |
| 639 | |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 640 | void* CsrWifiNmeApWmmParamUpdateReqDes(u8 *buffer, size_t length) |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 641 | { |
Greg Kroah-Hartman | 786eeeb | 2012-07-20 16:41:09 -0700 | [diff] [blame] | 642 | CsrWifiNmeApWmmParamUpdateReq *primitive = kmalloc(sizeof(CsrWifiNmeApWmmParamUpdateReq), GFP_KERNEL); |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 643 | size_t offset; |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 644 | offset = 0; |
| 645 | |
| 646 | CsrUint16Des(&primitive->common.type, buffer, &offset); |
| 647 | { |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 648 | u16 i1; |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 649 | for (i1 = 0; i1 < 4; i1++) |
| 650 | { |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 651 | CsrUint8Des((u8 *) &primitive->wmmApParams[i1].cwMin, buffer, &offset); |
| 652 | CsrUint8Des((u8 *) &primitive->wmmApParams[i1].cwMax, buffer, &offset); |
| 653 | CsrUint8Des((u8 *) &primitive->wmmApParams[i1].aifs, buffer, &offset); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 654 | CsrUint16Des((u16 *) &primitive->wmmApParams[i1].txopLimit, buffer, &offset); |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 655 | CsrUint8Des((u8 *) &primitive->wmmApParams[i1].admissionControlMandatory, buffer, &offset); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 656 | } |
| 657 | } |
| 658 | { |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 659 | u16 i1; |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 660 | for (i1 = 0; i1 < 4; i1++) |
| 661 | { |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 662 | CsrUint8Des((u8 *) &primitive->wmmApBcParams[i1].cwMin, buffer, &offset); |
| 663 | CsrUint8Des((u8 *) &primitive->wmmApBcParams[i1].cwMax, buffer, &offset); |
| 664 | CsrUint8Des((u8 *) &primitive->wmmApBcParams[i1].aifs, buffer, &offset); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 665 | CsrUint16Des((u16 *) &primitive->wmmApBcParams[i1].txopLimit, buffer, &offset); |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 666 | CsrUint8Des((u8 *) &primitive->wmmApBcParams[i1].admissionControlMandatory, buffer, &offset); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 667 | } |
| 668 | } |
| 669 | |
| 670 | return primitive; |
| 671 | } |
| 672 | |
| 673 | |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 674 | size_t CsrWifiNmeApStaRemoveReqSizeof(void *msg) |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 675 | { |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 676 | size_t bufferSize = 2; |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 677 | |
| 678 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 12) */ |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 679 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 680 | bufferSize += 6; /* u8 primitive->staMacAddress.a[6] */ |
Greg Kroah-Hartman | 5379b13 | 2012-07-20 12:25:15 -0700 | [diff] [blame] | 681 | bufferSize += 1; /* u8 primitive->keepBlocking */ |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 682 | return bufferSize; |
| 683 | } |
| 684 | |
| 685 | |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 686 | u8* CsrWifiNmeApStaRemoveReqSer(u8 *ptr, size_t *len, void *msg) |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 687 | { |
| 688 | CsrWifiNmeApStaRemoveReq *primitive = (CsrWifiNmeApStaRemoveReq *)msg; |
| 689 | *len = 0; |
| 690 | CsrUint16Ser(ptr, len, primitive->common.type); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 691 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); |
| 692 | CsrMemCpySer(ptr, len, (const void *) primitive->staMacAddress.a, ((u16) (6))); |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 693 | CsrUint8Ser(ptr, len, (u8) primitive->keepBlocking); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 694 | return(ptr); |
| 695 | } |
| 696 | |
| 697 | |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 698 | void* CsrWifiNmeApStaRemoveReqDes(u8 *buffer, size_t length) |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 699 | { |
Greg Kroah-Hartman | 786eeeb | 2012-07-20 16:41:09 -0700 | [diff] [blame] | 700 | CsrWifiNmeApStaRemoveReq *primitive = kmalloc(sizeof(CsrWifiNmeApStaRemoveReq), GFP_KERNEL); |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 701 | size_t offset; |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 702 | offset = 0; |
| 703 | |
| 704 | CsrUint16Des(&primitive->common.type, buffer, &offset); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 705 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); |
| 706 | CsrMemCpyDes(primitive->staMacAddress.a, buffer, &offset, ((u16) (6))); |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 707 | CsrUint8Des((u8 *) &primitive->keepBlocking, buffer, &offset); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 708 | |
| 709 | return primitive; |
| 710 | } |
| 711 | |
| 712 | |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 713 | size_t CsrWifiNmeApWpsRegisterCfmSizeof(void *msg) |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 714 | { |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 715 | size_t bufferSize = 2; |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 716 | |
| 717 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 7) */ |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 718 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 719 | bufferSize += 2; /* CsrResult primitive->status */ |
| 720 | return bufferSize; |
| 721 | } |
| 722 | |
| 723 | |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 724 | u8* CsrWifiNmeApWpsRegisterCfmSer(u8 *ptr, size_t *len, void *msg) |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 725 | { |
| 726 | CsrWifiNmeApWpsRegisterCfm *primitive = (CsrWifiNmeApWpsRegisterCfm *)msg; |
| 727 | *len = 0; |
| 728 | CsrUint16Ser(ptr, len, primitive->common.type); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 729 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); |
| 730 | CsrUint16Ser(ptr, len, (u16) primitive->status); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 731 | return(ptr); |
| 732 | } |
| 733 | |
| 734 | |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 735 | void* CsrWifiNmeApWpsRegisterCfmDes(u8 *buffer, size_t length) |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 736 | { |
Greg Kroah-Hartman | 786eeeb | 2012-07-20 16:41:09 -0700 | [diff] [blame] | 737 | CsrWifiNmeApWpsRegisterCfm *primitive = kmalloc(sizeof(CsrWifiNmeApWpsRegisterCfm), GFP_KERNEL); |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 738 | size_t offset; |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 739 | offset = 0; |
| 740 | |
| 741 | CsrUint16Des(&primitive->common.type, buffer, &offset); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 742 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); |
| 743 | CsrUint16Des((u16 *) &primitive->status, buffer, &offset); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 744 | |
| 745 | return primitive; |
| 746 | } |
| 747 | |
| 748 | |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 749 | size_t CsrWifiNmeApStartCfmSizeof(void *msg) |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 750 | { |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 751 | size_t bufferSize = 2; |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 752 | |
| 753 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 40) */ |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 754 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 755 | bufferSize += 2; /* CsrResult primitive->status */ |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 756 | bufferSize += 32; /* u8 primitive->ssid.ssid[32] */ |
| 757 | bufferSize += 1; /* u8 primitive->ssid.length */ |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 758 | return bufferSize; |
| 759 | } |
| 760 | |
| 761 | |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 762 | u8* CsrWifiNmeApStartCfmSer(u8 *ptr, size_t *len, void *msg) |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 763 | { |
| 764 | CsrWifiNmeApStartCfm *primitive = (CsrWifiNmeApStartCfm *)msg; |
| 765 | *len = 0; |
| 766 | CsrUint16Ser(ptr, len, primitive->common.type); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 767 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); |
| 768 | CsrUint16Ser(ptr, len, (u16) primitive->status); |
| 769 | CsrMemCpySer(ptr, len, (const void *) primitive->ssid.ssid, ((u16) (32))); |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 770 | CsrUint8Ser(ptr, len, (u8) primitive->ssid.length); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 771 | return(ptr); |
| 772 | } |
| 773 | |
| 774 | |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 775 | void* CsrWifiNmeApStartCfmDes(u8 *buffer, size_t length) |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 776 | { |
Greg Kroah-Hartman | 786eeeb | 2012-07-20 16:41:09 -0700 | [diff] [blame] | 777 | CsrWifiNmeApStartCfm *primitive = kmalloc(sizeof(CsrWifiNmeApStartCfm), GFP_KERNEL); |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 778 | size_t offset; |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 779 | offset = 0; |
| 780 | |
| 781 | CsrUint16Des(&primitive->common.type, buffer, &offset); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 782 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); |
| 783 | CsrUint16Des((u16 *) &primitive->status, buffer, &offset); |
| 784 | CsrMemCpyDes(primitive->ssid.ssid, buffer, &offset, ((u16) (32))); |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 785 | CsrUint8Des((u8 *) &primitive->ssid.length, buffer, &offset); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 786 | |
| 787 | return primitive; |
| 788 | } |
| 789 | |
| 790 | |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 791 | size_t CsrWifiNmeApStopCfmSizeof(void *msg) |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 792 | { |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 793 | size_t bufferSize = 2; |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 794 | |
| 795 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 7) */ |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 796 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 797 | bufferSize += 2; /* CsrResult primitive->status */ |
| 798 | return bufferSize; |
| 799 | } |
| 800 | |
| 801 | |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 802 | u8* CsrWifiNmeApStopCfmSer(u8 *ptr, size_t *len, void *msg) |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 803 | { |
| 804 | CsrWifiNmeApStopCfm *primitive = (CsrWifiNmeApStopCfm *)msg; |
| 805 | *len = 0; |
| 806 | CsrUint16Ser(ptr, len, primitive->common.type); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 807 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); |
| 808 | CsrUint16Ser(ptr, len, (u16) primitive->status); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 809 | return(ptr); |
| 810 | } |
| 811 | |
| 812 | |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 813 | void* CsrWifiNmeApStopCfmDes(u8 *buffer, size_t length) |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 814 | { |
Greg Kroah-Hartman | 786eeeb | 2012-07-20 16:41:09 -0700 | [diff] [blame] | 815 | CsrWifiNmeApStopCfm *primitive = kmalloc(sizeof(CsrWifiNmeApStopCfm), GFP_KERNEL); |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 816 | size_t offset; |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 817 | offset = 0; |
| 818 | |
| 819 | CsrUint16Des(&primitive->common.type, buffer, &offset); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 820 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); |
| 821 | CsrUint16Des((u16 *) &primitive->status, buffer, &offset); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 822 | |
| 823 | return primitive; |
| 824 | } |
| 825 | |
| 826 | |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 827 | size_t CsrWifiNmeApStopIndSizeof(void *msg) |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 828 | { |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 829 | size_t bufferSize = 2; |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 830 | |
| 831 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 8) */ |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 832 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 833 | bufferSize += 1; /* CsrWifiSmeApType primitive->apType */ |
| 834 | bufferSize += 2; /* CsrResult primitive->status */ |
| 835 | return bufferSize; |
| 836 | } |
| 837 | |
| 838 | |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 839 | u8* CsrWifiNmeApStopIndSer(u8 *ptr, size_t *len, void *msg) |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 840 | { |
| 841 | CsrWifiNmeApStopInd *primitive = (CsrWifiNmeApStopInd *)msg; |
| 842 | *len = 0; |
| 843 | CsrUint16Ser(ptr, len, primitive->common.type); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 844 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 845 | CsrUint8Ser(ptr, len, (u8) primitive->apType); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 846 | CsrUint16Ser(ptr, len, (u16) primitive->status); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 847 | return(ptr); |
| 848 | } |
| 849 | |
| 850 | |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 851 | void* CsrWifiNmeApStopIndDes(u8 *buffer, size_t length) |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 852 | { |
Greg Kroah-Hartman | 786eeeb | 2012-07-20 16:41:09 -0700 | [diff] [blame] | 853 | CsrWifiNmeApStopInd *primitive = kmalloc(sizeof(CsrWifiNmeApStopInd), GFP_KERNEL); |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 854 | size_t offset; |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 855 | offset = 0; |
| 856 | |
| 857 | CsrUint16Des(&primitive->common.type, buffer, &offset); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 858 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 859 | CsrUint8Des((u8 *) &primitive->apType, buffer, &offset); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 860 | CsrUint16Des((u16 *) &primitive->status, buffer, &offset); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 861 | |
| 862 | return primitive; |
| 863 | } |
| 864 | |
| 865 | |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 866 | size_t CsrWifiNmeApStationIndSizeof(void *msg) |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 867 | { |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 868 | size_t bufferSize = 2; |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 869 | |
| 870 | /* Calculate the Size of the Serialised Data. Could be more efficient (Try 18) */ |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 871 | bufferSize += 2; /* u16 primitive->interfaceTag */ |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 872 | bufferSize += 1; /* CsrWifiSmeMediaStatus primitive->mediaStatus */ |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 873 | bufferSize += 6; /* u8 primitive->peerMacAddress.a[6] */ |
| 874 | bufferSize += 6; /* u8 primitive->peerDeviceAddress.a[6] */ |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 875 | return bufferSize; |
| 876 | } |
| 877 | |
| 878 | |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 879 | u8* CsrWifiNmeApStationIndSer(u8 *ptr, size_t *len, void *msg) |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 880 | { |
| 881 | CsrWifiNmeApStationInd *primitive = (CsrWifiNmeApStationInd *)msg; |
| 882 | *len = 0; |
| 883 | CsrUint16Ser(ptr, len, primitive->common.type); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 884 | CsrUint16Ser(ptr, len, (u16) primitive->interfaceTag); |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 885 | CsrUint8Ser(ptr, len, (u8) primitive->mediaStatus); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 886 | CsrMemCpySer(ptr, len, (const void *) primitive->peerMacAddress.a, ((u16) (6))); |
| 887 | CsrMemCpySer(ptr, len, (const void *) primitive->peerDeviceAddress.a, ((u16) (6))); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 888 | return(ptr); |
| 889 | } |
| 890 | |
| 891 | |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 892 | void* CsrWifiNmeApStationIndDes(u8 *buffer, size_t length) |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 893 | { |
Greg Kroah-Hartman | 786eeeb | 2012-07-20 16:41:09 -0700 | [diff] [blame] | 894 | CsrWifiNmeApStationInd *primitive = kmalloc(sizeof(CsrWifiNmeApStationInd), GFP_KERNEL); |
Greg Kroah-Hartman | d4fda8d | 2012-07-20 12:27:19 -0700 | [diff] [blame] | 895 | size_t offset; |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 896 | offset = 0; |
| 897 | |
| 898 | CsrUint16Des(&primitive->common.type, buffer, &offset); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 899 | CsrUint16Des((u16 *) &primitive->interfaceTag, buffer, &offset); |
Greg Kroah-Hartman | 7e6f57944 | 2012-07-20 11:51:01 -0700 | [diff] [blame] | 900 | CsrUint8Des((u8 *) &primitive->mediaStatus, buffer, &offset); |
Greg Kroah-Hartman | 8c87f69 | 2012-07-20 12:00:10 -0700 | [diff] [blame] | 901 | CsrMemCpyDes(primitive->peerMacAddress.a, buffer, &offset, ((u16) (6))); |
| 902 | CsrMemCpyDes(primitive->peerDeviceAddress.a, buffer, &offset, ((u16) (6))); |
Lauri Hintsala | fa6173a | 2012-06-21 13:29:12 +0300 | [diff] [blame] | 903 | |
| 904 | return primitive; |
| 905 | } |
| 906 | |
| 907 | |
| 908 | #endif /* CSR_WIFI_NME_ENABLE */ |
| 909 | #endif /* CSR_WIFI_AP_ENABLE */ |