Ankit Dhanuka | a1569ce | 2014-05-13 19:58:06 +0530 | [diff] [blame] | 1 | /* |
| 2 | ************************************************************************** |
Stephen Wang | 3e2dbd1 | 2018-03-14 17:28:17 -0700 | [diff] [blame] | 3 | * Copyright (c) 2013-2018, The Linux Foundation. All rights reserved. |
Ankit Dhanuka | a1569ce | 2014-05-13 19:58:06 +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_pppoe.c |
| 19 | * NSS PPPoE APIs |
| 20 | */ |
| 21 | |
| 22 | #include "nss_tx_rx_common.h" |
Yu Huang | 8c10708 | 2017-07-24 14:58:26 -0700 | [diff] [blame] | 23 | #include "nss_pppoe_stats.h" |
Sachin Shashidhar | 626131e | 2018-08-08 11:29:58 -0700 | [diff] [blame] | 24 | #include "nss_pppoe_log.h" |
Ankit Dhanuka | a1569ce | 2014-05-13 19:58:06 +0530 | [diff] [blame] | 25 | |
Murat Sezgin | 4abd88c | 2017-05-24 17:00:59 -0700 | [diff] [blame] | 26 | #define NSS_PPPOE_TX_TIMEOUT 3000 /* 3 Seconds */ |
| 27 | |
Ankit Dhanuka | a1569ce | 2014-05-13 19:58:06 +0530 | [diff] [blame] | 28 | /* |
Murat Sezgin | 4abd88c | 2017-05-24 17:00:59 -0700 | [diff] [blame] | 29 | * Data structures to store pppoe nss debug stats |
Ankit Dhanuka | a1569ce | 2014-05-13 19:58:06 +0530 | [diff] [blame] | 30 | */ |
Murat Sezgin | 4abd88c | 2017-05-24 17:00:59 -0700 | [diff] [blame] | 31 | static DEFINE_SPINLOCK(nss_pppoe_lock); |
| 32 | static struct nss_pppoe_stats_session_debug nss_pppoe_debug_stats[NSS_MAX_PPPOE_DYNAMIC_INTERFACES]; |
| 33 | |
| 34 | /* |
| 35 | * Private data structure |
| 36 | */ |
| 37 | static struct nss_pppoe_pvt { |
| 38 | struct semaphore sem; |
| 39 | struct completion complete; |
| 40 | int response; |
| 41 | void *cb; |
| 42 | void *app_data; |
| 43 | } pppoe_pvt; |
| 44 | |
| 45 | /* |
| 46 | * nss_pppoe_debug_stats_sync |
| 47 | * Per session debug stats for pppoe |
| 48 | */ |
| 49 | static void nss_pppoe_debug_stats_sync(struct nss_ctx_instance *nss_ctx, struct nss_pppoe_sync_stats_msg *stats_msg, uint16_t if_num) |
Ankit Dhanuka | a1569ce | 2014-05-13 19:58:06 +0530 | [diff] [blame] | 50 | { |
Murat Sezgin | 4abd88c | 2017-05-24 17:00:59 -0700 | [diff] [blame] | 51 | int i; |
| 52 | spin_lock_bh(&nss_pppoe_lock); |
| 53 | for (i = 0; i < NSS_MAX_PPPOE_DYNAMIC_INTERFACES; i++) { |
| 54 | if (nss_pppoe_debug_stats[i].if_num == if_num) { |
| 55 | nss_pppoe_debug_stats[i].stats[NSS_PPPOE_STATS_RX_PACKETS] += stats_msg->stats.rx_packets; |
| 56 | nss_pppoe_debug_stats[i].stats[NSS_PPPOE_STATS_RX_BYTES] += stats_msg->stats.rx_bytes; |
| 57 | nss_pppoe_debug_stats[i].stats[NSS_PPPOE_STATS_TX_PACKETS] += stats_msg->stats.tx_packets; |
| 58 | nss_pppoe_debug_stats[i].stats[NSS_PPPOE_STATS_TX_BYTES] += stats_msg->stats.tx_bytes; |
| 59 | nss_pppoe_debug_stats[i].stats[NSS_PPPOE_STATS_SESSION_WRONG_VERSION_OR_TYPE] += stats_msg->exception_events[NSS_PPPOE_EXCEPTION_EVENT_WRONG_VERSION_OR_TYPE]; |
| 60 | nss_pppoe_debug_stats[i].stats[NSS_PPPOE_STATS_SESSION_WRONG_CODE] += stats_msg->exception_events[NSS_PPPOE_EXCEPTION_EVENT_WRONG_CODE]; |
| 61 | nss_pppoe_debug_stats[i].stats[NSS_PPPOE_STATS_SESSION_UNSUPPORTED_PPP_PROTOCOL] += stats_msg->exception_events[NSS_PPPOE_EXCEPTION_EVENT_UNSUPPORTED_PPP_PROTOCOL]; |
| 62 | break; |
| 63 | } |
| 64 | } |
| 65 | spin_unlock_bh(&nss_pppoe_lock); |
| 66 | } |
| 67 | /* |
| 68 | * nss_pppoe_get_context() |
| 69 | */ |
| 70 | struct nss_ctx_instance *nss_pppoe_get_context(void) |
| 71 | { |
| 72 | return (struct nss_ctx_instance *)&nss_top_main.nss[nss_top_main.pppoe_handler_id]; |
| 73 | } |
| 74 | EXPORT_SYMBOL(nss_pppoe_get_context); |
| 75 | |
| 76 | /* |
| 77 | * nss_pppoe_tx_msg() |
| 78 | * Transmit a PPPoE message to NSS firmware |
| 79 | */ |
| 80 | static nss_tx_status_t nss_pppoe_tx_msg(struct nss_ctx_instance *nss_ctx, struct nss_pppoe_msg *msg) |
| 81 | { |
| 82 | struct nss_cmn_msg *ncm = &msg->cm; |
Ankit Dhanuka | a1569ce | 2014-05-13 19:58:06 +0530 | [diff] [blame] | 83 | |
| 84 | /* |
Sachin Shashidhar | 626131e | 2018-08-08 11:29:58 -0700 | [diff] [blame] | 85 | * Trace Messages |
| 86 | */ |
| 87 | nss_pppoe_log_tx_msg(msg); |
| 88 | |
| 89 | /* |
Ankit Dhanuka | a1569ce | 2014-05-13 19:58:06 +0530 | [diff] [blame] | 90 | * Sanity check the message |
| 91 | */ |
Murat Sezgin | 4abd88c | 2017-05-24 17:00:59 -0700 | [diff] [blame] | 92 | if (!nss_is_dynamic_interface(ncm->interface)) { |
| 93 | nss_warning("%p: tx request for non dynamic interface: %d\n", nss_ctx, ncm->interface); |
Ankit Dhanuka | a1569ce | 2014-05-13 19:58:06 +0530 | [diff] [blame] | 94 | return NSS_TX_FAILURE; |
| 95 | } |
| 96 | |
Murat Sezgin | 4abd88c | 2017-05-24 17:00:59 -0700 | [diff] [blame] | 97 | if (nss_dynamic_interface_get_type(nss_pppoe_get_context(), ncm->interface) != NSS_DYNAMIC_INTERFACE_TYPE_PPPOE) { |
| 98 | nss_warning("%p: tx request for not PPPoE interface: %d\n", nss_ctx, ncm->interface); |
Ankit Dhanuka | a1569ce | 2014-05-13 19:58:06 +0530 | [diff] [blame] | 99 | return NSS_TX_FAILURE; |
| 100 | } |
| 101 | |
Murat Sezgin | 4abd88c | 2017-05-24 17:00:59 -0700 | [diff] [blame] | 102 | if (ncm->type >= NSS_PPPOE_MSG_MAX) { |
| 103 | nss_warning("%p: message type out of range: %d\n", nss_ctx, ncm->type); |
| 104 | return NSS_TX_FAILURE; |
| 105 | } |
| 106 | |
| 107 | return nss_core_send_cmd(nss_ctx, msg, sizeof(*msg), NSS_NBUF_PAYLOAD_SIZE); |
Ankit Dhanuka | a1569ce | 2014-05-13 19:58:06 +0530 | [diff] [blame] | 108 | } |
| 109 | |
| 110 | /* |
Murat Sezgin | 4abd88c | 2017-05-24 17:00:59 -0700 | [diff] [blame] | 111 | * nss_pppoe_sync_msg_callback() |
| 112 | * Callback to handle the completion of NSS->HLOS messages. |
Ankit Dhanuka | a1569ce | 2014-05-13 19:58:06 +0530 | [diff] [blame] | 113 | */ |
Murat Sezgin | 4abd88c | 2017-05-24 17:00:59 -0700 | [diff] [blame] | 114 | static void nss_pppoe_sync_msg_callback(void *app_data, struct nss_pppoe_msg *npm) |
| 115 | { |
| 116 | nss_pppoe_msg_callback_t callback = (nss_pppoe_msg_callback_t)pppoe_pvt.cb; |
| 117 | void *data = pppoe_pvt.app_data; |
| 118 | |
| 119 | pppoe_pvt.cb = NULL; |
| 120 | pppoe_pvt.app_data = NULL; |
| 121 | |
| 122 | pppoe_pvt.response = NSS_TX_SUCCESS; |
| 123 | if (npm->cm.response != NSS_CMN_RESPONSE_ACK) { |
| 124 | nss_warning("pppoe Error response %d\n", npm->cm.response); |
| 125 | pppoe_pvt.response = NSS_TX_FAILURE; |
| 126 | } |
| 127 | |
| 128 | if (callback) { |
| 129 | callback(data, npm); |
| 130 | } |
| 131 | |
| 132 | complete(&pppoe_pvt.complete); |
| 133 | } |
Ankit Dhanuka | a1569ce | 2014-05-13 19:58:06 +0530 | [diff] [blame] | 134 | |
| 135 | /* |
Murat Sezgin | 4abd88c | 2017-05-24 17:00:59 -0700 | [diff] [blame] | 136 | * nss_pppoe_handler() |
Ankit Dhanuka | a1569ce | 2014-05-13 19:58:06 +0530 | [diff] [blame] | 137 | * Handle NSS -> HLOS messages for PPPoE |
| 138 | */ |
Murat Sezgin | 4abd88c | 2017-05-24 17:00:59 -0700 | [diff] [blame] | 139 | static void nss_pppoe_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data) |
Ankit Dhanuka | a1569ce | 2014-05-13 19:58:06 +0530 | [diff] [blame] | 140 | { |
| 141 | struct nss_pppoe_msg *nim = (struct nss_pppoe_msg *)ncm; |
Murat Sezgin | 4abd88c | 2017-05-24 17:00:59 -0700 | [diff] [blame] | 142 | void *ctx; |
| 143 | nss_pppoe_msg_callback_t cb; |
Ankit Dhanuka | a1569ce | 2014-05-13 19:58:06 +0530 | [diff] [blame] | 144 | |
Murat Sezgin | 4abd88c | 2017-05-24 17:00:59 -0700 | [diff] [blame] | 145 | BUG_ON(!(nss_is_dynamic_interface(ncm->interface) || ncm->interface == NSS_PPPOE_INTERFACE)); |
Ankit Dhanuka | a1569ce | 2014-05-13 19:58:06 +0530 | [diff] [blame] | 146 | |
| 147 | /* |
Sachin Shashidhar | 626131e | 2018-08-08 11:29:58 -0700 | [diff] [blame] | 148 | * Trace Messages |
| 149 | */ |
| 150 | nss_pppoe_log_rx_msg(nim); |
| 151 | |
| 152 | /* |
Ankit Dhanuka | a1569ce | 2014-05-13 19:58:06 +0530 | [diff] [blame] | 153 | * Sanity check the message type |
| 154 | */ |
Murat Sezgin | 4abd88c | 2017-05-24 17:00:59 -0700 | [diff] [blame] | 155 | if (ncm->type >= NSS_PPPOE_MSG_MAX) { |
| 156 | nss_warning("%p: message type out of range: %d\n", nss_ctx, ncm->type); |
Ankit Dhanuka | a1569ce | 2014-05-13 19:58:06 +0530 | [diff] [blame] | 157 | return; |
| 158 | } |
| 159 | |
Suruchi Agarwal | ef8a870 | 2016-01-08 12:40:08 -0800 | [diff] [blame] | 160 | if (nss_cmn_get_msg_len(ncm) > sizeof(struct nss_pppoe_msg)) { |
Murat Sezgin | 4abd88c | 2017-05-24 17:00:59 -0700 | [diff] [blame] | 161 | nss_warning("%p: message length is invalid: %d\n", nss_ctx, nss_cmn_get_msg_len(ncm)); |
Ankit Dhanuka | a1569ce | 2014-05-13 19:58:06 +0530 | [diff] [blame] | 162 | return; |
| 163 | } |
| 164 | |
| 165 | /* |
| 166 | * Log failures |
| 167 | */ |
| 168 | nss_core_log_msg_failures(nss_ctx, ncm); |
| 169 | |
| 170 | /* |
| 171 | * Handling PPPoE messages coming from NSS fw. |
| 172 | */ |
| 173 | switch (nim->cm.type) { |
Murat Sezgin | 4abd88c | 2017-05-24 17:00:59 -0700 | [diff] [blame] | 174 | case NSS_PPPOE_MSG_SYNC_STATS: |
| 175 | nss_pppoe_debug_stats_sync(nss_ctx, &nim->msg.sync_stats, ncm->interface); |
Ankit Dhanuka | a1569ce | 2014-05-13 19:58:06 +0530 | [diff] [blame] | 176 | break; |
Ankit Dhanuka | a1569ce | 2014-05-13 19:58:06 +0530 | [diff] [blame] | 177 | default: |
Murat Sezgin | 4abd88c | 2017-05-24 17:00:59 -0700 | [diff] [blame] | 178 | nss_warning("%p: Received response %d for type %d, interface %d\n", |
Ankit Dhanuka | a1569ce | 2014-05-13 19:58:06 +0530 | [diff] [blame] | 179 | nss_ctx, ncm->response, ncm->type, ncm->interface); |
| 180 | } |
Murat Sezgin | 4abd88c | 2017-05-24 17:00:59 -0700 | [diff] [blame] | 181 | |
| 182 | /* |
| 183 | * Update the callback and app_data for NOTIFY messages, pppoe sends all notify messages |
| 184 | * to the same callback/app_data. |
| 185 | */ |
| 186 | if (ncm->response == NSS_CMN_RESPONSE_NOTIFY) { |
| 187 | ncm->cb = (nss_ptr_t)nss_ctx->nss_top->pppoe_msg_callback; |
| 188 | ncm->app_data = (nss_ptr_t)nss_ctx->subsys_dp_register[ncm->interface].app_data; |
| 189 | } |
| 190 | |
| 191 | /* |
| 192 | * Log failures |
| 193 | */ |
| 194 | nss_core_log_msg_failures(nss_ctx, ncm); |
| 195 | |
| 196 | /* |
| 197 | * Do we have a call back |
| 198 | */ |
| 199 | if (!ncm->cb) { |
| 200 | return; |
| 201 | } |
| 202 | |
| 203 | /* |
| 204 | * callback |
| 205 | */ |
| 206 | cb = (nss_pppoe_msg_callback_t)ncm->cb; |
| 207 | ctx = (void *)ncm->app_data; |
| 208 | |
| 209 | cb(ctx, nim); |
Ankit Dhanuka | a1569ce | 2014-05-13 19:58:06 +0530 | [diff] [blame] | 210 | } |
| 211 | |
| 212 | /* |
Murat Sezgin | 4abd88c | 2017-05-24 17:00:59 -0700 | [diff] [blame] | 213 | * nss_pppoe_debug_stats_get() |
| 214 | * Get session pppoe statistics. |
| 215 | */ |
| 216 | void nss_pppoe_debug_stats_get(void *stats_mem) |
| 217 | { |
| 218 | struct nss_pppoe_stats_session_debug *stats = (struct nss_pppoe_stats_session_debug *)stats_mem; |
| 219 | int i; |
| 220 | |
| 221 | if (!stats) { |
| 222 | nss_warning("No memory to copy pppoe session stats\n"); |
| 223 | return; |
| 224 | } |
| 225 | |
| 226 | spin_lock_bh(&nss_pppoe_lock); |
| 227 | for (i = 0; i < NSS_MAX_PPPOE_DYNAMIC_INTERFACES; i++) { |
| 228 | if (nss_pppoe_debug_stats[i].valid) { |
| 229 | memcpy(stats, &nss_pppoe_debug_stats[i], sizeof(struct nss_pppoe_stats_session_debug)); |
| 230 | stats++; |
| 231 | } |
| 232 | } |
| 233 | spin_unlock_bh(&nss_pppoe_lock); |
| 234 | } |
| 235 | |
| 236 | /* |
| 237 | * nss_pppoe_tx_msg_sync() |
| 238 | */ |
| 239 | nss_tx_status_t nss_pppoe_tx_msg_sync(struct nss_ctx_instance *nss_ctx, |
| 240 | struct nss_pppoe_msg *msg) |
| 241 | { |
| 242 | nss_tx_status_t status; |
| 243 | int ret = 0; |
| 244 | |
| 245 | down(&pppoe_pvt.sem); |
| 246 | pppoe_pvt.cb = (void *)msg->cm.cb; |
| 247 | pppoe_pvt.app_data = (void *)msg->cm.app_data; |
| 248 | |
| 249 | msg->cm.cb = (nss_ptr_t)nss_pppoe_sync_msg_callback; |
| 250 | msg->cm.app_data = (nss_ptr_t)NULL; |
| 251 | |
| 252 | status = nss_pppoe_tx_msg(nss_ctx, msg); |
| 253 | if (status != NSS_TX_SUCCESS) { |
| 254 | nss_warning("%p: nss_pppoe_tx_msg failed\n", nss_ctx); |
| 255 | up(&pppoe_pvt.sem); |
| 256 | return status; |
| 257 | } |
| 258 | |
| 259 | ret = wait_for_completion_timeout(&pppoe_pvt.complete, msecs_to_jiffies(NSS_PPPOE_TX_TIMEOUT)); |
| 260 | if (!ret) { |
| 261 | nss_warning("%p: PPPoE msg tx failed due to timeout\n", nss_ctx); |
| 262 | pppoe_pvt.response = NSS_TX_FAILURE; |
| 263 | } |
| 264 | |
| 265 | status = pppoe_pvt.response; |
| 266 | up(&pppoe_pvt.sem); |
| 267 | return status; |
| 268 | } |
| 269 | EXPORT_SYMBOL(nss_pppoe_tx_msg_sync); |
| 270 | |
| 271 | /* |
| 272 | * nss_register_pppoe_session_if() |
| 273 | */ |
| 274 | struct nss_ctx_instance *nss_register_pppoe_session_if(uint32_t if_num, |
| 275 | nss_pppoe_msg_callback_t notification_callback, |
| 276 | struct net_device *netdev, uint32_t features, void *app_ctx) |
| 277 | { |
| 278 | struct nss_ctx_instance *nss_ctx = nss_pppoe_get_context(); |
| 279 | int i = 0; |
| 280 | |
| 281 | nss_assert(nss_ctx); |
| 282 | nss_assert(nss_is_dynamic_interface(if_num)); |
| 283 | |
| 284 | spin_lock_bh(&nss_pppoe_lock); |
| 285 | for (i = 0; i < NSS_MAX_PPPOE_DYNAMIC_INTERFACES; i++) { |
| 286 | if (!nss_pppoe_debug_stats[i].valid) { |
| 287 | nss_pppoe_debug_stats[i].valid = true; |
| 288 | nss_pppoe_debug_stats[i].if_num = if_num; |
| 289 | nss_pppoe_debug_stats[i].if_index = netdev->ifindex; |
| 290 | break; |
| 291 | } |
| 292 | } |
| 293 | spin_unlock_bh(&nss_pppoe_lock); |
| 294 | |
| 295 | if (i == NSS_MAX_PPPOE_DYNAMIC_INTERFACES) { |
| 296 | return NULL; |
| 297 | } |
| 298 | |
| 299 | nss_core_register_subsys_dp(nss_ctx, if_num, NULL, NULL, app_ctx, netdev, features); |
| 300 | |
| 301 | nss_top_main.pppoe_msg_callback = notification_callback; |
| 302 | |
| 303 | nss_core_register_handler(nss_ctx, if_num, nss_pppoe_handler, NULL); |
| 304 | |
| 305 | return nss_ctx; |
| 306 | } |
| 307 | EXPORT_SYMBOL(nss_register_pppoe_session_if); |
| 308 | |
| 309 | /* |
| 310 | * nss_unregister_pppoe_session_if() |
| 311 | */ |
| 312 | void nss_unregister_pppoe_session_if(uint32_t if_num) |
| 313 | { |
| 314 | struct nss_ctx_instance *nss_ctx = nss_pppoe_get_context(); |
| 315 | int i; |
| 316 | |
| 317 | nss_assert(nss_ctx); |
| 318 | nss_assert(nss_is_dynamic_interface(if_num)); |
| 319 | |
| 320 | spin_lock_bh(&nss_pppoe_lock); |
| 321 | for (i = 0; i < NSS_MAX_PPPOE_DYNAMIC_INTERFACES; i++) { |
| 322 | if (nss_pppoe_debug_stats[i].if_num == if_num) { |
| 323 | nss_pppoe_debug_stats[i].valid = false; |
| 324 | nss_pppoe_debug_stats[i].if_num = 0; |
| 325 | nss_pppoe_debug_stats[i].if_index = 0; |
| 326 | } |
| 327 | } |
| 328 | spin_unlock_bh(&nss_pppoe_lock); |
| 329 | |
| 330 | nss_core_unregister_subsys_dp(nss_ctx, if_num); |
| 331 | |
| 332 | nss_top_main.pppoe_msg_callback = NULL; |
| 333 | |
| 334 | nss_core_unregister_handler(nss_ctx, if_num); |
| 335 | |
| 336 | } |
| 337 | EXPORT_SYMBOL(nss_unregister_pppoe_session_if); |
| 338 | |
| 339 | /* |
Ankit Dhanuka | a1569ce | 2014-05-13 19:58:06 +0530 | [diff] [blame] | 340 | * nss_pppoe_register_handler() |
| 341 | */ |
Murat Sezgin | 4abd88c | 2017-05-24 17:00:59 -0700 | [diff] [blame] | 342 | void nss_pppoe_register_handler(void) |
Ankit Dhanuka | a1569ce | 2014-05-13 19:58:06 +0530 | [diff] [blame] | 343 | { |
Murat Sezgin | 4abd88c | 2017-05-24 17:00:59 -0700 | [diff] [blame] | 344 | int i; |
| 345 | |
| 346 | nss_info("nss_pppoe_register_handler\n"); |
| 347 | nss_core_register_handler(nss_pppoe_get_context(), NSS_PPPOE_INTERFACE, nss_pppoe_handler, NULL); |
| 348 | |
| 349 | spin_lock_bh(&nss_pppoe_lock); |
| 350 | for (i = 0; i < NSS_MAX_PPPOE_DYNAMIC_INTERFACES; i++) { |
| 351 | nss_pppoe_debug_stats[i].valid = false; |
| 352 | nss_pppoe_debug_stats[i].if_num = 0; |
| 353 | nss_pppoe_debug_stats[i].if_index = 0; |
| 354 | } |
| 355 | spin_unlock_bh(&nss_pppoe_lock); |
| 356 | |
| 357 | sema_init(&pppoe_pvt.sem, 1); |
| 358 | init_completion(&pppoe_pvt.complete); |
Yu Huang | 8c10708 | 2017-07-24 14:58:26 -0700 | [diff] [blame] | 359 | |
| 360 | nss_pppoe_stats_dentry_create(); |
Ankit Dhanuka | a1569ce | 2014-05-13 19:58:06 +0530 | [diff] [blame] | 361 | } |
Sundarajan Srinivasan | 02e6c2b | 2014-10-06 11:51:12 -0700 | [diff] [blame] | 362 | |
| 363 | /* |
| 364 | * nss_pppoe_msg_init() |
Sundarajan Srinivasan | 02e6c2b | 2014-10-06 11:51:12 -0700 | [diff] [blame] | 365 | */ |
| 366 | void nss_pppoe_msg_init(struct nss_pppoe_msg *npm, uint16_t if_num, uint32_t type, uint32_t len, |
Thomas Wu | 91f4bdf | 2017-06-09 12:03:02 -0700 | [diff] [blame] | 367 | void *cb, void *app_data) |
Sundarajan Srinivasan | 02e6c2b | 2014-10-06 11:51:12 -0700 | [diff] [blame] | 368 | { |
| 369 | nss_cmn_msg_init(&npm->cm, if_num, type, len, (void *)cb, app_data); |
Murat Sezgin | 4abd88c | 2017-05-24 17:00:59 -0700 | [diff] [blame] | 370 | |
Sundarajan Srinivasan | 02e6c2b | 2014-10-06 11:51:12 -0700 | [diff] [blame] | 371 | } |
Murat Sezgin | 4abd88c | 2017-05-24 17:00:59 -0700 | [diff] [blame] | 372 | EXPORT_SYMBOL(nss_pppoe_msg_init); |