blob: 91515e2e9a9b27c5b463ea899d496d1b1186c7a4 [file] [log] [blame]
Shyam Sunder66e889d2015-11-02 15:31:20 +05301/*
2 **************************************************************************
Stephen Wang3e2dbd12018-03-14 17:28:17 -07003 * Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
Shyam Sunder66e889d2015-11-02 15:31:20 +05304 * 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#include <net/sock.h>
18#include "nss_tx_rx_common.h"
Yu Huang8c107082017-07-24 14:58:26 -070019#include "nss_pptp_stats.h"
Shyam Sunder66e889d2015-11-02 15:31:20 +053020
Shyam Sundere351f1b2015-12-17 14:11:51 +053021#define NSS_PPTP_TX_TIMEOUT 3000 /* 3 Seconds */
22
Shyam Sunder66e889d2015-11-02 15:31:20 +053023/*
24 * Data structures to store pptp nss debug stats
25 */
26static DEFINE_SPINLOCK(nss_pptp_session_debug_stats_lock);
Yu Huang8c107082017-07-24 14:58:26 -070027static struct nss_pptp_stats_session_debug nss_pptp_session_debug_stats[NSS_MAX_PPTP_DYNAMIC_INTERFACES];
Shyam Sunder66e889d2015-11-02 15:31:20 +053028
29/*
Shyam Sundere351f1b2015-12-17 14:11:51 +053030 * Private data structure
31 */
32static struct nss_pptp_pvt {
33 struct semaphore sem;
34 struct completion complete;
35 int response;
36 void *cb;
37 void *app_data;
38} pptp_pvt;
39
40/*
Shyam Sunder66e889d2015-11-02 15:31:20 +053041 * nss_pptp_session_debug_stats_sync
42 * Per session debug stats for pptp
43 */
44void nss_pptp_session_debug_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_pptp_sync_session_stats_msg *stats_msg, uint16_t if_num)
45{
ratheesh kannoth93ba95c2017-07-13 15:52:52 +053046 int i, j;
Shyam Sunder66e889d2015-11-02 15:31:20 +053047 spin_lock_bh(&nss_pptp_session_debug_stats_lock);
48 for (i = 0; i < NSS_MAX_PPTP_DYNAMIC_INTERFACES; i++) {
49 if (nss_pptp_session_debug_stats[i].if_num == if_num) {
Yu Huang8c107082017-07-24 14:58:26 -070050 nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_ENCAP_RX_PACKETS] += stats_msg->encap_stats.rx_packets;
51 nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_ENCAP_RX_BYTES] += stats_msg->encap_stats.rx_bytes;
52 nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_ENCAP_TX_PACKETS] += stats_msg->encap_stats.tx_packets;
53 nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_ENCAP_TX_BYTES] += stats_msg->encap_stats.tx_bytes;
ratheesh kannoth93ba95c2017-07-13 15:52:52 +053054 for (j = 0; j < NSS_MAX_NUM_PRI; j++) {
Yu Huang8c107082017-07-24 14:58:26 -070055 nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_ENCAP_RX_QUEUE_0_DROP + j] += stats_msg->encap_stats.rx_dropped[j];
ratheesh kannoth93ba95c2017-07-13 15:52:52 +053056 }
Yu Huang8c107082017-07-24 14:58:26 -070057 nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_DECAP_RX_PACKETS] += stats_msg->decap_stats.rx_packets;
58 nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_DECAP_RX_BYTES] += stats_msg->decap_stats.rx_bytes;
59 nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_DECAP_TX_PACKETS] += stats_msg->decap_stats.tx_packets;
60 nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_DECAP_TX_BYTES] += stats_msg->decap_stats.tx_bytes;
ratheesh kannoth93ba95c2017-07-13 15:52:52 +053061 for (j = 0; j < NSS_MAX_NUM_PRI; j++) {
Yu Huang8c107082017-07-24 14:58:26 -070062 nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_DECAP_RX_QUEUE_0_DROP + j] += stats_msg->decap_stats.rx_dropped[j];
ratheesh kannoth93ba95c2017-07-13 15:52:52 +053063 }
Yu Huang8c107082017-07-24 14:58:26 -070064 nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_SESSION_ENCAP_HEADROOM_ERR] += stats_msg->exception_events[PPTP_EXCEPTION_EVENT_ENCAP_HEADROOM_ERR];
65 nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_SESSION_ENCAP_SMALL_SIZE] += stats_msg->exception_events[PPTP_EXCEPTION_EVENT_ENCAP_SMALL_SIZE];
66 nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_SESSION_ENCAP_PNODE_ENQUEUE_FAIL] += stats_msg->exception_events[PPTP_EXCEPTION_EVENT_ENCAP_PNODE_ENQUEUE_FAIL];
67 nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_SESSION_DECAP_NO_SEQ_NOR_ACK] += stats_msg->exception_events[PPTP_EXCEPTION_EVENT_DECAP_NO_SEQ_NOR_ACK];
68 nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_SESSION_DECAP_INVAL_GRE_FLAGS] += stats_msg->exception_events[PPTP_EXCEPTION_EVENT_DECAP_INVAL_GRE_FLAGS];
69 nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_SESSION_DECAP_INVAL_GRE_PROTO] += stats_msg->exception_events[PPTP_EXCEPTION_EVENT_DECAP_INVAL_GRE_PROTO];
70 nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_SESSION_DECAP_WRONG_SEQ] += stats_msg->exception_events[PPTP_EXCEPTION_EVENT_DECAP_WRONG_SEQ];
71 nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_SESSION_DECAP_INVAL_PPP_HDR] += stats_msg->exception_events[PPTP_EXCEPTION_EVENT_DECAP_INVAL_PPP_HDR];
72 nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_SESSION_DECAP_PPP_LCP] += stats_msg->exception_events[PPTP_EXCEPTION_EVENT_DECAP_PPP_LCP];
73 nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_SESSION_DECAP_UNSUPPORTED_PPP_PROTO] += stats_msg->exception_events[PPTP_EXCEPTION_EVENT_DECAP_UNSUPPORTED_PPP_PROTO];
74 nss_pptp_session_debug_stats[i].stats[NSS_PPTP_STATS_SESSION_DECAP_PNODE_ENQUEUE_FAIL] += stats_msg->exception_events[PPTP_EXCEPTION_EVENT_DECAP_PNODE_ENQUEUE_FAIL];
Shyam Sunder66e889d2015-11-02 15:31:20 +053075 break;
76 }
77 }
78 spin_unlock_bh(&nss_pptp_session_debug_stats_lock);
79}
80
81/*
82 * nss_pptp_global_session_stats_get()
83 * Get session pptp statitics.
84 */
85void nss_pptp_session_debug_stats_get(void *stats_mem)
86{
Yu Huang8c107082017-07-24 14:58:26 -070087 struct nss_pptp_stats_session_debug *stats = (struct nss_pptp_stats_session_debug *)stats_mem;
Shyam Sunder66e889d2015-11-02 15:31:20 +053088 int i;
89
90 if (!stats) {
91 nss_warning("No memory to copy pptp session stats");
92 return;
93 }
94
95 spin_lock_bh(&nss_pptp_session_debug_stats_lock);
96 for (i = 0; i < NSS_MAX_PPTP_DYNAMIC_INTERFACES; i++) {
97 if (nss_pptp_session_debug_stats[i].valid) {
Yu Huang8c107082017-07-24 14:58:26 -070098 memcpy(stats, &nss_pptp_session_debug_stats[i], sizeof(struct nss_pptp_stats_session_debug));
Shyam Sunder66e889d2015-11-02 15:31:20 +053099 stats++;
100 }
101 }
102 spin_unlock_bh(&nss_pptp_session_debug_stats_lock);
103}
104
105/*
106 * nss_pptp_handler()
107 * Handle NSS -> HLOS messages for pptp tunnel
108 */
109static void nss_pptp_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data)
110{
111 struct nss_pptp_msg *ntm = (struct nss_pptp_msg *)ncm;
112 void *ctx;
113
114 nss_pptp_msg_callback_t cb;
115
116 BUG_ON(!(nss_is_dynamic_interface(ncm->interface) || ncm->interface == NSS_PPTP_INTERFACE));
117
118 /*
119 * Is this a valid request/response packet?
120 */
121 if (ncm->type >= NSS_PPTP_MSG_MAX) {
122 nss_warning("%p: received invalid message %d for PPTP interface", nss_ctx, ncm->type);
123 return;
124 }
125
Suruchi Agarwalef8a8702016-01-08 12:40:08 -0800126 if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_pptp_msg)) {
127 nss_warning("%p: Length of message is greater than required: %d", nss_ctx, nss_cmn_get_msg_len(ncm));
Shyam Sunder66e889d2015-11-02 15:31:20 +0530128 return;
129 }
130
131 switch (ntm->cm.type) {
132
133 case NSS_PPTP_MSG_SYNC_STATS:
134 /*
135 * session debug stats embeded in session stats msg
136 */
137 nss_pptp_session_debug_stats_sync(nss_ctx, &ntm->msg.stats, ncm->interface);
138 break;
139 }
140
141 /*
142 * Update the callback and app_data for NOTIFY messages, pptp sends all notify messages
143 * to the same callback/app_data.
144 */
Suruchi Agarwale4ad24a2018-06-11 12:03:46 +0530145 if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) {
Stephen Wangaed46332016-12-12 17:29:03 -0800146 ncm->cb = (nss_ptr_t)nss_ctx->nss_top->pptp_msg_callback;
Stephen Wang84e0e992016-09-07 12:31:40 -0700147 ncm->app_data = (nss_ptr_t)nss_ctx->subsys_dp_register[ncm->interface].app_data;
Shyam Sunder66e889d2015-11-02 15:31:20 +0530148 }
149
150 /*
151 * Log failures
152 */
153 nss_core_log_msg_failures(nss_ctx, ncm);
154
155 /*
156 * Do we have a call back
157 */
158 if (!ncm->cb) {
159 return;
160 }
161
162 /*
163 * callback
164 */
165 cb = (nss_pptp_msg_callback_t)ncm->cb;
Shyam Sundere351f1b2015-12-17 14:11:51 +0530166 ctx = (void *)ncm->app_data;
Shyam Sunder66e889d2015-11-02 15:31:20 +0530167
168 /*
169 * call pptp tunnel callback
170 */
Shyam Sundere351f1b2015-12-17 14:11:51 +0530171 if (!cb) {
Shyam Sunder66e889d2015-11-02 15:31:20 +0530172 nss_warning("%p: Event received for pptp tunnel interface %d before registration", nss_ctx, ncm->interface);
173 return;
174 }
175
176 cb(ctx, ntm);
177}
178
179/*
Shyam Sundere351f1b2015-12-17 14:11:51 +0530180 * nss_pptp_tx_msg()
Shyam Sunder66e889d2015-11-02 15:31:20 +0530181 * Transmit a pptp message to NSS firmware
182 */
Shyam Sundere351f1b2015-12-17 14:11:51 +0530183static nss_tx_status_t nss_pptp_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_pptp_msg *msg)
Shyam Sunder66e889d2015-11-02 15:31:20 +0530184{
Shyam Sunder66e889d2015-11-02 15:31:20 +0530185 struct nss_cmn_msg *ncm = &msg->cm;
Shyam Sunder66e889d2015-11-02 15:31:20 +0530186
187 /*
188 * Sanity check the message
189 */
190 if (!nss_is_dynamic_interface(ncm->interface)) {
191 nss_warning("%p: tx request for non dynamic interface: %d", nss_ctx, ncm->interface);
192 return NSS_TX_FAILURE;
193 }
194
195 if (ncm->type > NSS_PPTP_MSG_MAX) {
196 nss_warning("%p: message type out of range: %d", nss_ctx, ncm->type);
197 return NSS_TX_FAILURE;
198 }
199
Stephen Wang3e2dbd12018-03-14 17:28:17 -0700200 return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE);
Shyam Sunder66e889d2015-11-02 15:31:20 +0530201}
202
203/*
Shyam Sundere351f1b2015-12-17 14:11:51 +0530204 * nss_pptp_sync_msg_callback()
205 * Callback to handle the completion of NSS->HLOS messages.
Shyam Sunder66e889d2015-11-02 15:31:20 +0530206 */
Shyam Sundere351f1b2015-12-17 14:11:51 +0530207static void nss_pptp_sync_msg_callback(void *app_data, struct nss_pptp_msg *nim)
208{
209 nss_pptp_msg_callback_t callback = (nss_pptp_msg_callback_t)pptp_pvt.cb;
210 void *data = pptp_pvt.app_data;
211
212 pptp_pvt.cb = NULL;
213 pptp_pvt.app_data = NULL;
214
215 if (nim->cm.response != NSS_CMN_RESPONSE_ACK) {
216 nss_warning("pptp Error response %d\n", nim->cm.response);
217
218 pptp_pvt.response = NSS_TX_FAILURE;
219 if (callback) {
220 callback(data, nim);
221 }
222
223 complete(&pptp_pvt.complete);
224 return;
225 }
226
227 pptp_pvt.response = NSS_TX_SUCCESS;
228 if (callback) {
229 callback(data, nim);
230 }
231
232 complete(&pptp_pvt.complete);
233}
234
235/*
236 * nss_pptp_tx_msg()
237 * Transmit a pptp message to NSS firmware synchronously.
238 */
239nss_tx_status_t nss_pptp_tx_msg_sync(struct nss_ctx_instance *nss_ctx, struct nss_pptp_msg *msg)
Shyam Sunder66e889d2015-11-02 15:31:20 +0530240{
241
Shyam Sundere351f1b2015-12-17 14:11:51 +0530242 nss_tx_status_t status;
243 int ret = 0;
244
245 down(&pptp_pvt.sem);
246 pptp_pvt.cb = (void *)msg->cm.cb;
247 pptp_pvt.app_data = (void *)msg->cm.app_data;
248
Stephen Wangaed46332016-12-12 17:29:03 -0800249 msg->cm.cb = (nss_ptr_t)nss_pptp_sync_msg_callback;
250 msg->cm.app_data = (nss_ptr_t)NULL;
Shyam Sundere351f1b2015-12-17 14:11:51 +0530251
252 status = nss_pptp_tx_msg(nss_ctx, msg);
253 if (status != NSS_TX_SUCCESS) {
254 nss_warning("%p: pptp_tx_msg failed\n", nss_ctx);
255 up(&pptp_pvt.sem);
256 return status;
257 }
258
259 ret = wait_for_completion_timeout(&pptp_pvt.complete, msecs_to_jiffies(NSS_PPTP_TX_TIMEOUT));
260
261 if (!ret) {
262 nss_warning("%p: PPTP msg tx failed due to timeout\n", nss_ctx);
263 pptp_pvt.response = NSS_TX_FAILURE;
264 }
265
266 status = pptp_pvt.response;
267 up(&pptp_pvt.sem);
268 return status;
269}
270
271/*
272 * nss_pptp_tx_buf()
273 * Send packet to pptp interface owned by NSS
274 */
275nss_tx_status_t nss_pptp_tx_buf(struct nss_ctx_instance *nss_ctx, uint32_t if_num, struct sk_buff *skb)
276{
Shyam Sundere351f1b2015-12-17 14:11:51 +0530277 nss_trace("%p: pptp If Tx packet, id:%d, data=%p", nss_ctx, if_num, skb->data);
278
Stephen Wang3e2dbd12018-03-14 17:28:17 -0700279 return nss_core_send_packet(nss_ctx, skb, if_num, H2N_BIT_FLAG_VIRTUAL_BUFFER);
Shyam Sundere351f1b2015-12-17 14:11:51 +0530280}
281
282/*
283 * nss_register_pptp_if()
284 */
285struct nss_ctx_instance *nss_register_pptp_if(uint32_t if_num,
286 nss_pptp_callback_t pptp_data_callback,
287 nss_pptp_msg_callback_t notification_callback,
288 struct net_device *netdev,
289 uint32_t features,
290 void *app_ctx)
291{
Stephen Wang84e0e992016-09-07 12:31:40 -0700292 struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.pptp_handler_id];
Shyam Sundere351f1b2015-12-17 14:11:51 +0530293 int i = 0;
Stephen Wang84e0e992016-09-07 12:31:40 -0700294
295 nss_assert(nss_ctx);
Shyam Sunder66e889d2015-11-02 15:31:20 +0530296 nss_assert(nss_is_dynamic_interface(if_num));
297
Jackson Bockus7ca70ec2017-07-17 13:47:29 -0700298 nss_core_register_subsys_dp(nss_ctx, if_num, pptp_data_callback, NULL, app_ctx, netdev, features);
Shyam Sunder66e889d2015-11-02 15:31:20 +0530299
Shyam Sundere351f1b2015-12-17 14:11:51 +0530300 nss_top_main.pptp_msg_callback = notification_callback;
Shyam Sunder66e889d2015-11-02 15:31:20 +0530301
Thomas Wu91f4bdf2017-06-09 12:03:02 -0700302 nss_core_register_handler(nss_ctx, if_num, nss_pptp_handler, NULL);
Shyam Sunder66e889d2015-11-02 15:31:20 +0530303
Shyam Sundere351f1b2015-12-17 14:11:51 +0530304 spin_lock_bh(&nss_pptp_session_debug_stats_lock);
305 for (i = 0; i < NSS_MAX_PPTP_DYNAMIC_INTERFACES; i++) {
306 if (!nss_pptp_session_debug_stats[i].valid) {
307 nss_pptp_session_debug_stats[i].valid = true;
308 nss_pptp_session_debug_stats[i].if_num = if_num;
309 nss_pptp_session_debug_stats[i].if_index = netdev->ifindex;
310 break;
311 }
312 }
313 spin_unlock_bh(&nss_pptp_session_debug_stats_lock);
314
Stephen Wang84e0e992016-09-07 12:31:40 -0700315 return nss_ctx;
Shyam Sunder66e889d2015-11-02 15:31:20 +0530316}
317
318/*
319 * nss_unregister_pptp_if()
320 */
321void nss_unregister_pptp_if(uint32_t if_num)
322{
Stephen Wang84e0e992016-09-07 12:31:40 -0700323 struct nss_ctx_instance *nss_ctx = (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.pptp_handler_id];
Shyam Sundere351f1b2015-12-17 14:11:51 +0530324 int i;
adil irfanb9a45f02018-04-09 19:13:53 +0530325 int j;
Shyam Sundere351f1b2015-12-17 14:11:51 +0530326
Stephen Wang84e0e992016-09-07 12:31:40 -0700327 nss_assert(nss_ctx);
Shyam Sunder66e889d2015-11-02 15:31:20 +0530328 nss_assert(nss_is_dynamic_interface(if_num));
329
Shyam Sundere351f1b2015-12-17 14:11:51 +0530330 spin_lock_bh(&nss_pptp_session_debug_stats_lock);
331 for (i = 0; i < NSS_MAX_PPTP_DYNAMIC_INTERFACES; i++) {
adil irfanb9a45f02018-04-09 19:13:53 +0530332 if (nss_pptp_session_debug_stats[i].valid == true &&
333 nss_pptp_session_debug_stats[i].if_num == if_num) {
334 nss_pptp_session_debug_stats[i].valid = false;
335 nss_pptp_session_debug_stats[i].if_num = 0;
336 nss_pptp_session_debug_stats[i].if_index = 0;
337 for (j = 0; j < NSS_PPTP_STATS_SESSION_MAX; j++)
338 nss_pptp_session_debug_stats[i].stats[j] = 0;
339 break;
340 }
Shyam Sundere351f1b2015-12-17 14:11:51 +0530341 }
342 spin_unlock_bh(&nss_pptp_session_debug_stats_lock);
343
Jackson Bockus7ca70ec2017-07-17 13:47:29 -0700344 nss_core_unregister_subsys_dp(nss_ctx, if_num);
Shyam Sunder66e889d2015-11-02 15:31:20 +0530345
346 nss_top_main.pptp_msg_callback = NULL;
347
Thomas Wu91f4bdf2017-06-09 12:03:02 -0700348 nss_core_unregister_handler(nss_ctx, if_num);
Shyam Sunder66e889d2015-11-02 15:31:20 +0530349}
350
351/*
352 * nss_get_pptp_context()
353 */
354struct nss_ctx_instance *nss_pptp_get_context()
355{
356 return (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.pptp_handler_id];
357}
358
359/*
360 * nss_pptp_msg_init()
361 * Initialize nss_pptp msg.
362 */
363void nss_pptp_msg_init(struct nss_pptp_msg *ncm, uint16_t if_num, uint32_t type, uint32_t len, void *cb, void *app_data)
364{
365 nss_cmn_msg_init(&ncm->cm, if_num, type, len, cb, app_data);
366}
367
368/* nss_pptp_register_handler()
369 * debugfs stats msg handler received on static pptp interface
370 */
371void nss_pptp_register_handler(void)
372{
Shyam Sundere351f1b2015-12-17 14:11:51 +0530373 int i;
374
Shyam Sunder66e889d2015-11-02 15:31:20 +0530375 nss_info("nss_pptp_register_handler");
Thomas Wu91f4bdf2017-06-09 12:03:02 -0700376 nss_core_register_handler(nss_pptp_get_context(), NSS_PPTP_INTERFACE, nss_pptp_handler, NULL);
Shyam Sundere351f1b2015-12-17 14:11:51 +0530377
378 spin_lock_bh(&nss_pptp_session_debug_stats_lock);
379 for (i = 0; i < NSS_MAX_PPTP_DYNAMIC_INTERFACES; i++) {
380 nss_pptp_session_debug_stats[i].valid = false;
381 nss_pptp_session_debug_stats[i].if_num = 0;
382 nss_pptp_session_debug_stats[i].if_index = 0;
383 }
384 spin_unlock_bh(&nss_pptp_session_debug_stats_lock);
385
386 sema_init(&pptp_pvt.sem, 1);
387 init_completion(&pptp_pvt.complete);
Yu Huang8c107082017-07-24 14:58:26 -0700388
389 nss_pptp_stats_dentry_create();
Shyam Sunder66e889d2015-11-02 15:31:20 +0530390}
391
392EXPORT_SYMBOL(nss_pptp_get_context);
Shyam Sundere351f1b2015-12-17 14:11:51 +0530393EXPORT_SYMBOL(nss_pptp_tx_msg_sync);
394EXPORT_SYMBOL(nss_pptp_tx_buf);
Shyam Sunder66e889d2015-11-02 15:31:20 +0530395EXPORT_SYMBOL(nss_unregister_pptp_if);
396EXPORT_SYMBOL(nss_pptp_msg_init);
397EXPORT_SYMBOL(nss_register_pptp_if);