Samarjeet Banerjee | de86b80 | 2014-04-10 02:59:49 +0530 | [diff] [blame] | 1 | /* |
| 2 | ************************************************************************** |
Sourav Poddar | 9883806 | 2017-01-08 16:52:21 +0530 | [diff] [blame] | 3 | * Copyright (c) 2013,2015-2017, The Linux Foundation. All rights reserved. |
Samarjeet Banerjee | de86b80 | 2014-04-10 02:59:49 +0530 | [diff] [blame] | 4 | * Permission to use, copy, modify, and/or distribute this software for |
| 5 | * any purpose with or without fee is hereby granted, provided that the |
| 6 | * above copyright notice and this permission notice appear in all copies. |
| 7 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 8 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 9 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| 10 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 11 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 12 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT |
| 13 | * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 14 | ************************************************************************** |
| 15 | */ |
| 16 | |
| 17 | /* |
| 18 | * nss_crypto.c |
| 19 | * NSS Crypto APIs |
| 20 | */ |
| 21 | |
| 22 | #include "nss_tx_rx_common.h" |
Murat Sezgin | ea1a435 | 2014-04-15 19:09:51 -0700 | [diff] [blame] | 23 | #include "nss_crypto.h" |
Samarjeet Banerjee | de86b80 | 2014-04-10 02:59:49 +0530 | [diff] [blame] | 24 | |
| 25 | /* |
| 26 | ********************************** |
| 27 | General APIs |
| 28 | ********************************** |
| 29 | */ |
| 30 | |
Samarjeet Banerjee | de86b80 | 2014-04-10 02:59:49 +0530 | [diff] [blame] | 31 | /* |
| 32 | * nss_crypto_set_msg_callback() |
| 33 | * this sets the message callback handler and its associated context |
| 34 | */ |
| 35 | static inline void nss_crypto_set_msg_callback(struct nss_ctx_instance *nss_ctx, nss_crypto_msg_callback_t cb, void *crypto_ctx) |
| 36 | { |
| 37 | struct nss_top_instance *nss_top = nss_ctx->nss_top; |
| 38 | |
| 39 | nss_top->crypto_ctx = crypto_ctx; |
| 40 | nss_top->crypto_msg_callback = cb; |
| 41 | } |
| 42 | |
| 43 | /* |
| 44 | * nss_crypto_get_msg_callback() |
| 45 | * this gets the message callback handler and its associated context |
| 46 | */ |
| 47 | static inline nss_crypto_msg_callback_t nss_crypto_get_msg_callback(struct nss_ctx_instance *nss_ctx, void **crypto_ctx) |
| 48 | { |
| 49 | struct nss_top_instance *nss_top = nss_ctx->nss_top; |
| 50 | |
| 51 | *crypto_ctx = nss_top->crypto_ctx; |
| 52 | return nss_top->crypto_msg_callback; |
| 53 | } |
| 54 | |
| 55 | /* |
Samarjeet Banerjee | de86b80 | 2014-04-10 02:59:49 +0530 | [diff] [blame] | 56 | * nss_crypto_msg_handler() |
| 57 | * this handles all the IPsec events and responses |
| 58 | */ |
| 59 | static void nss_crypto_msg_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, void *app_data __attribute((unused))) |
| 60 | { |
| 61 | struct nss_crypto_msg *nim = (struct nss_crypto_msg *)ncm; |
| 62 | nss_crypto_msg_callback_t cb = NULL; |
| 63 | void *crypto_ctx = NULL; |
| 64 | |
| 65 | /* |
| 66 | * Sanity check the message type |
| 67 | */ |
| 68 | if (ncm->type > NSS_CRYPTO_MSG_TYPE_MAX) { |
Sourav Poddar | 9883806 | 2017-01-08 16:52:21 +0530 | [diff] [blame] | 69 | nss_warning("%p: rx message type out of range: %d", nss_ctx, ncm->type); |
Samarjeet Banerjee | de86b80 | 2014-04-10 02:59:49 +0530 | [diff] [blame] | 70 | return; |
| 71 | } |
| 72 | |
Suruchi Agarwal | ef8a870 | 2016-01-08 12:40:08 -0800 | [diff] [blame] | 73 | if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_crypto_msg)) { |
Sourav Poddar | 9883806 | 2017-01-08 16:52:21 +0530 | [diff] [blame] | 74 | nss_warning("%p: rx message length is invalid: %d", nss_ctx, nss_cmn_get_msg_len(ncm)); |
Samarjeet Banerjee | de86b80 | 2014-04-10 02:59:49 +0530 | [diff] [blame] | 75 | return; |
| 76 | } |
| 77 | |
| 78 | if (ncm->interface != NSS_CRYPTO_INTERFACE) { |
Sourav Poddar | 9883806 | 2017-01-08 16:52:21 +0530 | [diff] [blame] | 79 | nss_warning("%p: rx message request for another interface: %d", nss_ctx, ncm->interface); |
Samarjeet Banerjee | de86b80 | 2014-04-10 02:59:49 +0530 | [diff] [blame] | 80 | return; |
| 81 | } |
| 82 | |
| 83 | if (ncm->response == NSS_CMN_RESPONSE_LAST) { |
Sourav Poddar | 9883806 | 2017-01-08 16:52:21 +0530 | [diff] [blame] | 84 | nss_warning("%p: rx message response for if %d, type %d, is invalid: %d", nss_ctx, ncm->interface, |
Samarjeet Banerjee | de86b80 | 2014-04-10 02:59:49 +0530 | [diff] [blame] | 85 | ncm->type, ncm->response); |
| 86 | return; |
| 87 | } |
| 88 | |
| 89 | if (ncm->response == NSS_CMM_RESPONSE_NOTIFY) { |
Stephen Wang | aed4633 | 2016-12-12 17:29:03 -0800 | [diff] [blame] | 90 | ncm->cb = (nss_ptr_t)nss_crypto_get_msg_callback(nss_ctx, &crypto_ctx); |
| 91 | ncm->app_data = (nss_ptr_t)crypto_ctx; |
Samarjeet Banerjee | de86b80 | 2014-04-10 02:59:49 +0530 | [diff] [blame] | 92 | } |
| 93 | |
| 94 | |
| 95 | nss_core_log_msg_failures(nss_ctx, ncm); |
| 96 | |
| 97 | /* |
| 98 | * Load, Test & call |
| 99 | */ |
| 100 | cb = (nss_crypto_msg_callback_t)ncm->cb; |
| 101 | if (unlikely(!cb)) { |
Sourav Poddar | 9883806 | 2017-01-08 16:52:21 +0530 | [diff] [blame] | 102 | nss_trace("%p: rx handler has been unregistered for i/f: %d", nss_ctx, ncm->interface); |
Samarjeet Banerjee | de86b80 | 2014-04-10 02:59:49 +0530 | [diff] [blame] | 103 | return; |
| 104 | } |
| 105 | cb((void *)ncm->app_data, nim); |
| 106 | } |
| 107 | /* |
| 108 | ********************************** |
| 109 | Tx APIs |
| 110 | ********************************** |
| 111 | */ |
| 112 | |
| 113 | /* |
| 114 | * nss_crypto_tx_msg |
| 115 | * Send crypto config to NSS. |
| 116 | */ |
| 117 | nss_tx_status_t nss_crypto_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_crypto_msg *msg) |
| 118 | { |
| 119 | struct nss_cmn_msg *ncm = &msg->cm; |
| 120 | struct nss_crypto_msg *nim; |
| 121 | struct sk_buff *nbuf; |
| 122 | int32_t status; |
| 123 | |
Sourav Poddar | 9883806 | 2017-01-08 16:52:21 +0530 | [diff] [blame] | 124 | nss_info("%p: tx message %d for if %d\n", nss_ctx, ncm->type, ncm->interface); |
Samarjeet Banerjee | de86b80 | 2014-04-10 02:59:49 +0530 | [diff] [blame] | 125 | |
| 126 | NSS_VERIFY_CTX_MAGIC(nss_ctx); |
| 127 | if (unlikely(nss_ctx->state != NSS_CORE_STATE_INITIALIZED)) { |
Sourav Poddar | 9883806 | 2017-01-08 16:52:21 +0530 | [diff] [blame] | 128 | nss_warning("%p: tx message dropped as core not ready", nss_ctx); |
Samarjeet Banerjee | de86b80 | 2014-04-10 02:59:49 +0530 | [diff] [blame] | 129 | return NSS_TX_FAILURE_NOT_READY; |
| 130 | } |
| 131 | |
Tanmay V Jagdale | f6b2bce | 2017-03-03 14:31:07 +0530 | [diff] [blame] | 132 | BUILD_BUG_ON(NSS_NBUF_PAYLOAD_SIZE < sizeof(struct nss_crypto_msg)); |
Samarjeet Banerjee | de86b80 | 2014-04-10 02:59:49 +0530 | [diff] [blame] | 133 | |
| 134 | if (ncm->interface != NSS_CRYPTO_INTERFACE) { |
Sourav Poddar | 9883806 | 2017-01-08 16:52:21 +0530 | [diff] [blame] | 135 | nss_warning("%p: tx message request for another interface: %d", nss_ctx, ncm->interface); |
Samarjeet Banerjee | de86b80 | 2014-04-10 02:59:49 +0530 | [diff] [blame] | 136 | } |
| 137 | |
| 138 | if (ncm->type > NSS_CRYPTO_MSG_TYPE_MAX) { |
Sourav Poddar | 9883806 | 2017-01-08 16:52:21 +0530 | [diff] [blame] | 139 | nss_warning("%p: tx message type out of range: %d", nss_ctx, ncm->type); |
Samarjeet Banerjee | de86b80 | 2014-04-10 02:59:49 +0530 | [diff] [blame] | 140 | return NSS_TX_FAILURE; |
| 141 | } |
| 142 | |
Suruchi Agarwal | ef8a870 | 2016-01-08 12:40:08 -0800 | [diff] [blame] | 143 | if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_crypto_msg)) { |
Sourav Poddar | 9883806 | 2017-01-08 16:52:21 +0530 | [diff] [blame] | 144 | nss_warning("%p: tx message request len for if %d, is bad: %d", nss_ctx, ncm->interface, nss_cmn_get_msg_len(ncm)); |
Samarjeet Banerjee | de86b80 | 2014-04-10 02:59:49 +0530 | [diff] [blame] | 145 | return NSS_TX_FAILURE_BAD_PARAM; |
| 146 | } |
| 147 | |
Pamidipati, Vijay | b6e3884 | 2014-09-16 10:26:05 +0530 | [diff] [blame] | 148 | nbuf = dev_alloc_skb(NSS_NBUF_PAYLOAD_SIZE); |
Samarjeet Banerjee | de86b80 | 2014-04-10 02:59:49 +0530 | [diff] [blame] | 149 | if (unlikely(!nbuf)) { |
Sundarajan Srinivasan | 62fee7e | 2015-01-22 11:13:10 -0800 | [diff] [blame] | 150 | NSS_PKT_STATS_INCREMENT(nss_ctx, &nss_ctx->nss_top->stats_drv[NSS_STATS_DRV_NBUF_ALLOC_FAILS]); |
Sourav Poddar | 9883806 | 2017-01-08 16:52:21 +0530 | [diff] [blame] | 151 | nss_warning("%p: tx config dropped as command allocation failed", nss_ctx); |
Samarjeet Banerjee | de86b80 | 2014-04-10 02:59:49 +0530 | [diff] [blame] | 152 | return NSS_TX_FAILURE; |
| 153 | } |
| 154 | |
Stephen Wang | aed4633 | 2016-12-12 17:29:03 -0800 | [diff] [blame] | 155 | nss_info("msg params version:%d, interface:%d, type:%d, cb:%p, app_data:%p, len:%d\n", |
| 156 | ncm->version, ncm->interface, ncm->type, (void *)ncm->cb, (void *)ncm->app_data, ncm->len); |
Samarjeet Banerjee | 7bce8c5 | 2014-05-02 15:32:13 +0530 | [diff] [blame] | 157 | |
Samarjeet Banerjee | de86b80 | 2014-04-10 02:59:49 +0530 | [diff] [blame] | 158 | nim = (struct nss_crypto_msg *)skb_put(nbuf, sizeof(struct nss_crypto_msg)); |
| 159 | memcpy(nim, msg, sizeof(struct nss_crypto_msg)); |
| 160 | |
| 161 | status = nss_core_send_buffer(nss_ctx, 0, nbuf, NSS_IF_CMD_QUEUE, H2N_BUFFER_CTRL, 0); |
| 162 | if (status != NSS_CORE_STATUS_SUCCESS) { |
Pamidipati, Vijay | b6e3884 | 2014-09-16 10:26:05 +0530 | [diff] [blame] | 163 | dev_kfree_skb_any(nbuf); |
Sourav Poddar | 9883806 | 2017-01-08 16:52:21 +0530 | [diff] [blame] | 164 | nss_warning("%p: Unable to enqueue message\n", nss_ctx); |
Samarjeet Banerjee | de86b80 | 2014-04-10 02:59:49 +0530 | [diff] [blame] | 165 | return NSS_TX_FAILURE; |
| 166 | } |
| 167 | |
Stephen Wang | 90c67de | 2016-04-26 15:15:59 -0700 | [diff] [blame] | 168 | nss_hal_send_interrupt(nss_ctx, NSS_H2N_INTR_DATA_COMMAND_QUEUE); |
Samarjeet Banerjee | de86b80 | 2014-04-10 02:59:49 +0530 | [diff] [blame] | 169 | |
| 170 | return NSS_TX_SUCCESS; |
| 171 | } |
| 172 | |
| 173 | /* |
| 174 | * nss_crypto_tx_data() |
| 175 | * NSS crypto TX data API. Sends a crypto buffer to NSS. |
| 176 | */ |
Sourav Poddar | 9883806 | 2017-01-08 16:52:21 +0530 | [diff] [blame] | 177 | nss_tx_status_t nss_crypto_tx_buf(struct nss_ctx_instance *nss_ctx, uint32_t if_num, struct sk_buff *skb) |
Samarjeet Banerjee | de86b80 | 2014-04-10 02:59:49 +0530 | [diff] [blame] | 178 | { |
| 179 | int32_t status; |
| 180 | |
Sourav Poddar | 9883806 | 2017-01-08 16:52:21 +0530 | [diff] [blame] | 181 | nss_trace("%p: tx_data buf=%p", nss_ctx, skb); |
Samarjeet Banerjee | de86b80 | 2014-04-10 02:59:49 +0530 | [diff] [blame] | 182 | |
| 183 | NSS_VERIFY_CTX_MAGIC(nss_ctx); |
| 184 | if (unlikely(nss_ctx->state != NSS_CORE_STATE_INITIALIZED)) { |
Sourav Poddar | 9883806 | 2017-01-08 16:52:21 +0530 | [diff] [blame] | 185 | nss_warning("%p: tx_data packet dropped as core not ready", nss_ctx); |
Samarjeet Banerjee | de86b80 | 2014-04-10 02:59:49 +0530 | [diff] [blame] | 186 | return NSS_TX_FAILURE_NOT_READY; |
| 187 | } |
| 188 | |
Sourav Poddar | 2722f89 | 2017-04-13 22:17:56 +0530 | [diff] [blame] | 189 | status = nss_core_send_buffer(nss_ctx, if_num, skb, NSS_IF_DATA_QUEUE_0, H2N_BUFFER_PACKET, 0); |
Samarjeet Banerjee | de86b80 | 2014-04-10 02:59:49 +0530 | [diff] [blame] | 190 | if (unlikely(status != NSS_CORE_STATUS_SUCCESS)) { |
Sourav Poddar | 9883806 | 2017-01-08 16:52:21 +0530 | [diff] [blame] | 191 | nss_warning("%p: tx_data Unable to enqueue packet", nss_ctx); |
Samarjeet Banerjee | de86b80 | 2014-04-10 02:59:49 +0530 | [diff] [blame] | 192 | if (status == NSS_CORE_STATUS_FAILURE_QUEUE) { |
| 193 | return NSS_TX_FAILURE_QUEUE; |
| 194 | } |
| 195 | |
| 196 | return NSS_TX_FAILURE; |
| 197 | } |
| 198 | |
| 199 | /* |
| 200 | * Kick the NSS awake so it can process our new entry. |
| 201 | */ |
Stephen Wang | 90c67de | 2016-04-26 15:15:59 -0700 | [diff] [blame] | 202 | nss_hal_send_interrupt(nss_ctx, NSS_H2N_INTR_DATA_COMMAND_QUEUE); |
Samarjeet Banerjee | de86b80 | 2014-04-10 02:59:49 +0530 | [diff] [blame] | 203 | |
| 204 | NSS_PKT_STATS_INCREMENT(nss_ctx, &nss_ctx->nss_top->stats_drv[NSS_STATS_DRV_TX_CRYPTO_REQ]); |
| 205 | |
| 206 | return NSS_TX_SUCCESS; |
| 207 | } |
| 208 | |
| 209 | /* |
| 210 | ********************************** |
| 211 | Register APIs |
| 212 | ********************************** |
| 213 | */ |
| 214 | |
| 215 | /* |
| 216 | * nss_crypto_notify_register() |
| 217 | * register message notifier for crypto interface |
| 218 | */ |
| 219 | struct nss_ctx_instance *nss_crypto_notify_register(nss_crypto_msg_callback_t cb, void *app_data) |
| 220 | { |
| 221 | struct nss_ctx_instance *nss_ctx; |
| 222 | |
| 223 | nss_ctx = &nss_top_main.nss[nss_top_main.crypto_handler_id]; |
| 224 | |
| 225 | nss_crypto_set_msg_callback(nss_ctx, cb, app_data); |
| 226 | |
| 227 | return nss_ctx; |
| 228 | } |
| 229 | |
| 230 | /* |
| 231 | * nss_crypto_notify_unregister() |
| 232 | * unregister message notifier for crypto interface |
| 233 | */ |
| 234 | void nss_crypto_notify_unregister(struct nss_ctx_instance *nss_ctx) |
| 235 | { |
| 236 | nss_crypto_set_msg_callback(nss_ctx, NULL, NULL); |
| 237 | } |
| 238 | |
| 239 | /* |
| 240 | * nss_crypto_data_register() |
| 241 | * register a data callback routine |
| 242 | */ |
Sourav Poddar | 9883806 | 2017-01-08 16:52:21 +0530 | [diff] [blame] | 243 | struct nss_ctx_instance *nss_crypto_data_register(uint32_t if_num, nss_crypto_buf_callback_t cb, |
| 244 | struct net_device *netdev, uint32_t features) |
Samarjeet Banerjee | de86b80 | 2014-04-10 02:59:49 +0530 | [diff] [blame] | 245 | { |
| 246 | struct nss_ctx_instance *nss_ctx; |
| 247 | |
| 248 | nss_ctx = &nss_top_main.nss[nss_top_main.crypto_handler_id]; |
| 249 | |
Sourav Poddar | 9883806 | 2017-01-08 16:52:21 +0530 | [diff] [blame] | 250 | if ((if_num >= NSS_MAX_NET_INTERFACES) && (if_num < NSS_MAX_PHYSICAL_INTERFACES)) { |
| 251 | nss_warning("%p: data register received for invalid interface %d", nss_ctx, if_num); |
| 252 | return NULL; |
| 253 | } |
| 254 | |
| 255 | /* |
Jackson Bockus | 7ca70ec | 2017-07-17 13:47:29 -0700 | [diff] [blame] | 256 | * Register subsystem, ensuring that no duplicate registrations occur. |
Sourav Poddar | 9883806 | 2017-01-08 16:52:21 +0530 | [diff] [blame] | 257 | */ |
Jackson Bockus | 7ca70ec | 2017-07-17 13:47:29 -0700 | [diff] [blame] | 258 | nss_core_register_subsys_dp(nss_ctx, if_num, cb, NULL, NULL, netdev, features); |
Samarjeet Banerjee | de86b80 | 2014-04-10 02:59:49 +0530 | [diff] [blame] | 259 | |
| 260 | return nss_ctx; |
| 261 | } |
| 262 | |
| 263 | /* |
| 264 | * nss_crypto_data_unregister() |
| 265 | * unregister a data callback routine |
| 266 | */ |
Sourav Poddar | 9883806 | 2017-01-08 16:52:21 +0530 | [diff] [blame] | 267 | void nss_crypto_data_unregister(struct nss_ctx_instance *nss_ctx, uint32_t if_num) |
Samarjeet Banerjee | de86b80 | 2014-04-10 02:59:49 +0530 | [diff] [blame] | 268 | { |
Sourav Poddar | 9883806 | 2017-01-08 16:52:21 +0530 | [diff] [blame] | 269 | if ((if_num >= NSS_MAX_NET_INTERFACES) && (if_num < NSS_MAX_PHYSICAL_INTERFACES)) { |
| 270 | nss_warning("%p: data unregister received for invalid interface %d", nss_ctx, if_num); |
| 271 | return; |
| 272 | } |
| 273 | |
Jackson Bockus | 7ca70ec | 2017-07-17 13:47:29 -0700 | [diff] [blame] | 274 | nss_core_unregister_subsys_dp(nss_ctx, if_num); |
Samarjeet Banerjee | de86b80 | 2014-04-10 02:59:49 +0530 | [diff] [blame] | 275 | } |
| 276 | |
| 277 | /* |
Samarjeet Banerjee | cdfc0bd | 2016-05-28 00:22:31 +0530 | [diff] [blame] | 278 | * nss_crypto_pm_notify_register() |
| 279 | * register a PM notify callback routine |
| 280 | */ |
| 281 | void nss_crypto_pm_notify_register(nss_crypto_pm_event_callback_t cb, void *app_data) |
| 282 | { |
| 283 | nss_top_main.crypto_pm_ctx = app_data; |
| 284 | nss_top_main.crypto_pm_callback = cb; |
| 285 | } |
| 286 | |
| 287 | /* |
Samarjeet Banerjee | 69731a2 | 2016-07-21 13:04:59 +0530 | [diff] [blame] | 288 | * nss_crypto_pm_notify_unregister() |
| 289 | * unregister a PM notify callback routine |
| 290 | */ |
| 291 | void nss_crypto_pm_notify_unregister(void) |
| 292 | { |
| 293 | nss_top_main.crypto_pm_ctx = NULL; |
| 294 | nss_top_main.crypto_pm_callback = NULL; |
| 295 | } |
| 296 | |
| 297 | /* |
Samarjeet Banerjee | de86b80 | 2014-04-10 02:59:49 +0530 | [diff] [blame] | 298 | * nss_crypto_register_handler() |
| 299 | */ |
Thomas Wu | 91f4bdf | 2017-06-09 12:03:02 -0700 | [diff] [blame] | 300 | void nss_crypto_register_handler(void) |
Samarjeet Banerjee | de86b80 | 2014-04-10 02:59:49 +0530 | [diff] [blame] | 301 | { |
Thomas Wu | 91f4bdf | 2017-06-09 12:03:02 -0700 | [diff] [blame] | 302 | struct nss_ctx_instance *nss_ctx = &nss_top_main.nss[nss_top_main.crypto_handler_id]; |
| 303 | |
| 304 | nss_core_register_handler(nss_ctx, NSS_CRYPTO_INTERFACE, nss_crypto_msg_handler, NULL); |
Samarjeet Banerjee | de86b80 | 2014-04-10 02:59:49 +0530 | [diff] [blame] | 305 | } |
| 306 | |
Sundarajan Srinivasan | 02e6c2b | 2014-10-06 11:51:12 -0700 | [diff] [blame] | 307 | /* |
| 308 | * nss_crypto_msg_init() |
| 309 | * Initialize crypto message |
| 310 | */ |
| 311 | void nss_crypto_msg_init(struct nss_crypto_msg *ncm, uint16_t if_num, uint32_t type, uint32_t len, |
Sundarajan Srinivasan | 30a53d4 | 2015-01-30 10:52:08 -0800 | [diff] [blame] | 312 | nss_crypto_msg_callback_t cb, void *app_data) |
Sundarajan Srinivasan | 02e6c2b | 2014-10-06 11:51:12 -0700 | [diff] [blame] | 313 | { |
| 314 | nss_cmn_msg_init(&ncm->cm, if_num, type, len, (void *)cb, app_data); |
| 315 | } |
| 316 | |
Samarjeet Banerjee | de86b80 | 2014-04-10 02:59:49 +0530 | [diff] [blame] | 317 | EXPORT_SYMBOL(nss_crypto_notify_register); |
| 318 | EXPORT_SYMBOL(nss_crypto_notify_unregister); |
| 319 | EXPORT_SYMBOL(nss_crypto_data_register); |
| 320 | EXPORT_SYMBOL(nss_crypto_data_unregister); |
Samarjeet Banerjee | cdfc0bd | 2016-05-28 00:22:31 +0530 | [diff] [blame] | 321 | EXPORT_SYMBOL(nss_crypto_pm_notify_register); |
Samarjeet Banerjee | 69731a2 | 2016-07-21 13:04:59 +0530 | [diff] [blame] | 322 | EXPORT_SYMBOL(nss_crypto_pm_notify_unregister); |
Samarjeet Banerjee | de86b80 | 2014-04-10 02:59:49 +0530 | [diff] [blame] | 323 | EXPORT_SYMBOL(nss_crypto_tx_msg); |
| 324 | EXPORT_SYMBOL(nss_crypto_tx_buf); |
Sundarajan Srinivasan | 02e6c2b | 2014-10-06 11:51:12 -0700 | [diff] [blame] | 325 | EXPORT_SYMBOL(nss_crypto_msg_init); |