1/* 2 * sfe_drv.h 3 * simulated driver headers for shortcut forwarding engine. 4 * 5 * Copyright (c) 2015 The Linux Foundation. All rights reserved. 6 * Permission to use, copy, modify, and/or distribute this software for 7 * any purpose with or without fee is hereby granted, provided that the 8 * above copyright notice and this permission notice appear in all copies. 9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT 15 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 */ 17 18#ifndef __SFE_DRV_H 19#define __SFE_DRV_H 20 21#define MAX_VLAN_DEPTH 2 22#define SFE_VLAN_ID_NOT_CONFIGURED 0xfff 23#define SFE_MC_IF_MAX 16 24 25#define SFE_SPECIAL_INTERFACE_BASE 0x7f00 26#define SFE_SPECIAL_INTERFACE_IPV4 (SFE_SPECIAL_INTERFACE_BASE + 1) 27#define SFE_SPECIAL_INTERFACE_IPV6 (SFE_SPECIAL_INTERFACE_BASE + 2) 28#define SFE_SPECIAL_INTERFACE_IPSEC (SFE_SPECIAL_INTERFACE_BASE + 3) 29 30/** 31 * Rule creation & rule update flags. 32 */ 33#define SFE_RULE_CREATE_FLAG_NO_SEQ_CHECK (1<<0) /**< Do not perform TCP sequence number checks */ 34#define SFE_RULE_CREATE_FLAG_BRIDGE_FLOW (1<<1) /**< This is a pure bridge forwarding flow */ 35#define SFE_RULE_CREATE_FLAG_ROUTED (1<<2) /**< Rule is for a routed connection */ 36#define SFE_RULE_CREATE_FLAG_DSCP_MARKING (1<<3) /**< Rule has for a DSCP marking configured*/ 37#define SFE_RULE_CREATE_FLAG_VLAN_MARKING (1<<4) /**< Rule has for a VLAN marking configured*/ 38#define SFE_RULE_UPDATE_FLAG_CHANGE_MTU (1<<5) /**< Update MTU of connection interfaces */ 39#define SFE_RULE_CREATE_FLAG_ICMP_NO_CME_FLUSH (1<<6)/**< Rule for not flushing CME on ICMP pkt */ 40#define SFE_RULE_CREATE_FLAG_L2_ENCAP (1<<7) /**< consists of an encapsulating protocol that carries an IPv4 payload within it. */ 41#define SFE_RULE_CREATE_FLAG_MC_JOIN (1<<8) /**< Interface has joined the flow */ 42#define SFE_RULE_CREATE_FLAG_MC_LEAVE (1<<9) /**< Interface has left the flow */ 43#define SFE_RULE_CREATE_FLAG_MC_UPDATE (1<<10)/**< Multicast Rule update */ 44/** 45 * Rule creation validity flags. 46 */ 47#define SFE_RULE_CREATE_CONN_VALID (1<<0) /**< IPv4 Connection is valid */ 48#define SFE_RULE_CREATE_TCP_VALID (1<<1) /**< TCP Protocol fields are valid */ 49#define SFE_RULE_CREATE_PPPOE_VALID (1<<2) /**< PPPoE fields are valid */ 50#define SFE_RULE_CREATE_QOS_VALID (1<<3) /**< QoS fields are valid */ 51#define SFE_RULE_CREATE_VLAN_VALID (1<<4) /**< VLAN fields are valid */ 52#define SFE_RULE_CREATE_DSCP_MARKING_VALID (1<<5) /**< DSCP marking fields are valid */ 53#define SFE_RULE_CREATE_VLAN_MARKING_VALID (1<<6) /**< VLAN marking fields are valid */ 54#define SFE_RULE_CREATE_MC_NAT_VALID (1<<7) /**< Interface is configured with Source-NAT */ 55 56typedef enum sfe_rule_sync_reason { 57 SFE_RULE_SYNC_REASON_DESTROY, /* Sync is to synchronize stats */ 58 SFE_RULE_SYNC_REASON_FLUSH, /* Sync is to flush a entry */ 59 SFE_RULE_SYNC_REASON_EVICT, /* Sync is to evict a entry */ 60 SFE_RULE_SYNC_REASON_STATS /* Sync is to destroy a entry(requested by connection manager) */ 61} sfe_rule_sync_reason_t; 62 63/** 64 * Tx command status 65 */ 66typedef enum { 67 SFE_TX_SUCCESS = 0, /**< Success */ 68 SFE_TX_FAILURE, /**< Command failure other than descriptor not available */ 69 SFE_TX_FAILURE_QUEUE, /**< Command failure due to descriptor not available */ 70 SFE_TX_FAILURE_NOT_READY, /**< Command failure due to SFE state uninitialized */ 71 SFE_TX_FAILURE_TOO_LARGE, /**< Command is too large to fit in one message */ 72 SFE_TX_FAILURE_TOO_SHORT, /**< Command/Packet is shorter than expected size */ 73 SFE_TX_FAILURE_NOT_SUPPORTED, /**< Command/Packet not accepted for forwarding */ 74 SFE_TX_FAILURE_BAD_PARAM, /**< Command failure due to bad parameters */ 75 SFE_TX_FAILURE_NOT_ENABLED, /**< Command failure due to SFE feature is not enabled */ 76} sfe_tx_status_t; 77 78/** 79 * Common response structure 80 */ 81enum sfe_cmn_response { 82 SFE_CMN_RESPONSE_ACK, /**< Message Acknowledge */ 83 SFE_CMN_RESPONSE_EVERSION, /**< Message Version Error */ 84 SFE_CMN_RESPONSE_EINTERFACE, /**< Message Interface Error */ 85 SFE_CMN_RESPONSE_ELENGTH, /**< Message Length Error */ 86 SFE_CMN_RESPONSE_EMSG, /**< Message Error */ 87 SFE_CMM_RESPONSE_NOTIFY, /**< Message Independant of Request */ 88 SFE_CMN_RESPONSE_LAST 89}; 90 91/** 92 * IPv4 bridge/route rule messages 93 */ 94enum sfe_message_types { 95 SFE_TX_CREATE_RULE_MSG, /**< IPv4/6 create rule message */ 96 SFE_TX_DESTROY_RULE_MSG, /**< IPv4/6 destroy rule message */ 97 SFE_RX_CONN_STATS_SYNC_MSG, /**< IPv4/6 connection stats sync message */ 98 SFE_TX_CREATE_MC_RULE_MSG, /**< IPv4/6 multicast create rule message */ 99 SFE_TUN6RD_ADD_UPDATE_PEER, /**< Add/update peer for 6rd tunnel */ 100 SFE_MAX_MSG_TYPES, /**< IPv4/6 message max type number */ 101}; 102 103/** 104 * Common message structure 105 */ 106struct sfe_cmn_msg { 107 uint16_t version; /**< Version id for main message format */ 108 uint16_t interface; /**< Primary Key for all messages */ 109 enum sfe_cmn_response response; /**< Primary response */ 110 uint32_t type; /**< Decetralized request #, to be used to match response # */ 111 uint32_t error; /**< Decentralized specific error message, response == EMSG */ 112 uint32_t cb; /**< Place for callback pointer */ 113 uint32_t app_data; /**< Place for app data */ 114 uint32_t len; /**< What is the length of the message excluding this header */ 115}; 116 117/** 118 * Common 5 tuple structure 119 */ 120struct sfe_ipv4_5tuple { 121 __be32 flow_ip; /**< Flow IP address */ 122 __be32 return_ip; /**< Return IP address */ 123 __be16 flow_ident; /**< Flow ident (e.g. TCP/UDP port) */ 124 __be16 return_ident; /**< Return ident (e.g. TCP/UDP port) */ 125 uint8_t protocol; /**< Protocol number */ 126 uint8_t reserved[3]; /**< Padded for alignment */ 127}; 128 129/** 130 * Common 5 tuple structure 131 */ 132struct sfe_ipv6_5tuple { 133 __be32 flow_ip[4]; /**< Flow IP address */ 134 __be32 return_ip[4]; /**< Return IP address */ 135 __be16 flow_ident; /**< Flow ident (e.g. TCP/UDP port) */ 136 __be16 return_ident; /**< Return ident (e.g. TCP/UDP port) */ 137 uint8_t protocol; /**< Protocol number */ 138 uint8_t reserved[3]; /**< Padded for alignment */ 139}; 140 141/** 142 * Connection create structure 143 */ 144struct sfe_ipv4_connection_rule { 145 uint8_t flow_mac[6]; /**< Flow MAC address */ 146 uint8_t return_mac[6]; /**< Return MAC address */ 147 int32_t flow_interface_num; /**< Flow interface number */ 148 int32_t return_interface_num; /**< Return interface number */ 149 int32_t flow_top_interface_num; /* Top flow interface number */ 150 int32_t return_top_interface_num;/* Top return interface number */ 151 uint32_t flow_mtu; /**< Flow interface`s MTU */ 152 uint32_t return_mtu; /**< Return interface`s MTU */ 153 __be32 flow_ip_xlate; /**< Translated flow IP address */ 154 __be32 return_ip_xlate; /**< Translated return IP address */ 155 __be16 flow_ident_xlate; /**< Translated flow ident (e.g. port) */ 156 __be16 return_ident_xlate; /**< Translated return ident (e.g. port) */ 157}; 158 159/** 160 * Connection create structure 161 */ 162struct sfe_ipv6_connection_rule { 163 uint8_t flow_mac[6]; /**< Flow MAC address */ 164 uint8_t return_mac[6]; /**< Return MAC address */ 165 int32_t flow_interface_num; /**< Flow interface number */ 166 int32_t return_interface_num; /**< Return interface number */ 167 int32_t flow_top_interface_num; /* Top flow interface number */ 168 int32_t return_top_interface_num;/* Top return interface number */ 169 uint32_t flow_mtu; /**< Flow interface's MTU */ 170 uint32_t return_mtu; /**< Return interface's MTU */ 171}; 172 173/** 174 * TCP connection rule structure 175 */ 176struct sfe_protocol_tcp_rule { 177 uint32_t flow_max_window; /**< Flow direction's largest seen window */ 178 uint32_t return_max_window; /**< Return direction's largest seen window */ 179 uint32_t flow_end; /**< Flow direction's largest seen sequence + segment length */ 180 uint32_t return_end; /**< Return direction's largest seen sequence + segment length */ 181 uint32_t flow_max_end; /**< Flow direction's largest seen ack + max(1, win) */ 182 uint32_t return_max_end; /**< Return direction's largest seen ack + max(1, win) */ 183 uint8_t flow_window_scale; /**< Flow direction's window scaling factor */ 184 uint8_t return_window_scale; /**< Return direction's window scaling factor */ 185 uint16_t reserved; /**< Padded for alignment */ 186}; 187 188/** 189 * PPPoE connection rules structure 190 */ 191struct sfe_pppoe_rule { 192 uint16_t flow_pppoe_session_id; /**< Flow direction`s PPPoE session ID. */ 193 uint16_t flow_pppoe_remote_mac[3]; /**< Flow direction`s PPPoE Server MAC address */ 194 uint16_t return_pppoe_session_id; /**< Return direction's PPPoE session ID. */ 195 uint16_t return_pppoe_remote_mac[3]; /**< Return direction's PPPoE Server MAC address */ 196}; 197 198/** 199 * QoS connection rule structure 200 */ 201struct sfe_qos_rule { 202 uint32_t flow_qos_tag; /**< QoS tag associated with this rule for flow direction */ 203 uint32_t return_qos_tag; /**< QoS tag associated with this rule for return direction */ 204}; 205 206/** 207 * DSCP connection rule structure 208 */ 209struct sfe_dscp_rule { 210 uint8_t flow_dscp; /**< Egress DSCP value for flow direction */ 211 uint8_t return_dscp; /**< Egress DSCP value for return direction */ 212 uint8_t reserved[2]; /**< Padded for alignment */ 213}; 214 215/** 216 * VLAN connection rule structure 217 */ 218struct sfe_vlan_rule { 219 uint32_t ingress_vlan_tag; /**< VLAN Tag for the ingress packets */ 220 uint32_t egress_vlan_tag; /**< VLAN Tag for egress packets */ 221}; 222 223/** 224 * The IPv4 rule create sub-message structure. 225 */ 226struct sfe_ipv4_rule_create_msg { 227 /* Request */ 228 uint16_t valid_flags; /**< Bit flags associated with the validity of parameters */ 229 uint16_t rule_flags; /**< Bit flags associated with the rule */ 230 231 struct sfe_ipv4_5tuple tuple; /**< Holds values of the 5 tuple */ 232 233 struct sfe_ipv4_connection_rule conn_rule; /**< Basic connection specific data */ 234 struct sfe_protocol_tcp_rule tcp_rule; /**< TCP related accleration parameters */ 235 struct sfe_pppoe_rule pppoe_rule; /**< PPPoE related accleration parameters */ 236 struct sfe_qos_rule qos_rule; /**< QoS related accleration parameters */ 237 struct sfe_dscp_rule dscp_rule; /**< DSCP related accleration parameters */ 238 struct sfe_vlan_rule vlan_primary_rule; /**< Primary VLAN related accleration parameters */ 239 struct sfe_vlan_rule vlan_secondary_rule; /**< Secondary VLAN related accleration parameters */ 240 241 /* Response */ 242 uint32_t index; /**< Slot ID for cache stats to host OS */ 243}; 244 245/** 246 * The IPv4 rule destroy sub-message structure. 247 */ 248struct sfe_ipv4_rule_destroy_msg { 249 struct sfe_ipv4_5tuple tuple; /**< Holds values of the 5 tuple */ 250}; 251 252/** 253 * The SFE IPv4 rule sync structure. 254 */ 255struct sfe_ipv4_conn_sync { 256 uint32_t index; /**< Slot ID for cache stats to host OS */ 257 uint8_t protocol; /**< Protocol number */ 258 __be32 flow_ip; /**< Flow IP address */ 259 __be32 flow_ip_xlate; /**< Translated flow IP address */ 260 __be16 flow_ident; /**< Flow ident (e.g. port) */ 261 __be16 flow_ident_xlate; /**< Translated flow ident (e.g. port) */ 262 uint32_t flow_max_window; /**< Flow direction's largest seen window */ 263 uint32_t flow_end; /**< Flow direction's largest seen sequence + segment length */ 264 uint32_t flow_max_end; /**< Flow direction's largest seen ack + max(1, win) */ 265 uint32_t flow_rx_packet_count; /**< Flow interface's RX packet count */ 266 uint32_t flow_rx_byte_count; /**< Flow interface's RX byte count */ 267 uint32_t flow_tx_packet_count; /**< Flow interface's TX packet count */ 268 uint32_t flow_tx_byte_count; /**< Flow interface's TX byte count */ 269 uint16_t flow_pppoe_session_id; /**< Flow interface`s PPPoE session ID. */ 270 uint16_t flow_pppoe_remote_mac[3]; 271 /**< Flow interface's PPPoE remote server MAC address if there is any */ 272 __be32 return_ip; /**< Return IP address */ 273 __be32 return_ip_xlate; /**< Translated return IP address */ 274 __be16 return_ident; /**< Return ident (e.g. port) */ 275 __be16 return_ident_xlate; /**< Translated return ident (e.g. port) */ 276 uint32_t return_max_window; /**< Return direction's largest seen window */ 277 uint32_t return_end; /**< Return direction's largest seen sequence + segment length */ 278 uint32_t return_max_end; /**< Return direction's largest seen ack + max(1, win) */ 279 uint32_t return_rx_packet_count; 280 /**< Return interface's RX packet count */ 281 uint32_t return_rx_byte_count; /**< Return interface's RX byte count */ 282 uint32_t return_tx_packet_count; 283 /**< Return interface's TX packet count */ 284 uint32_t return_tx_byte_count; /**< Return interface's TX byte count */ 285 uint16_t return_pppoe_session_id; 286 /**< Return interface`s PPPoE session ID. */ 287 uint16_t return_pppoe_remote_mac[3]; 288 /**< Return interface's PPPoE remote server MAC address if there is any */ 289 uint32_t inc_ticks; /**< Number of ticks since the last sync */ 290 uint32_t reason; /**< Reason for the sync */ 291 292 uint8_t flags; /**< Bit flags associated with the rule */ 293 uint32_t qos_tag; /**< QoS Tag */ 294 uint32_t cause; /**< Flush Cause */ 295}; 296 297/* 298 * Message structure to send/receive IPv4 bridge/route commands 299 */ 300struct sfe_ipv4_msg { 301 struct sfe_cmn_msg cm; /**< Message Header */ 302 union { 303 struct sfe_ipv4_rule_create_msg rule_create; /**< Message: rule create */ 304 struct sfe_ipv4_rule_destroy_msg rule_destroy; /**< Message: rule destroy */ 305 struct sfe_ipv4_conn_sync conn_stats; /**< Message: connection stats sync */ 306 } msg; 307}; 308 309/** 310 * Callback to be called when IPv4 message is received 311 */ 312typedef void (*sfe_ipv4_msg_callback_t)(void *app_data, struct sfe_ipv4_msg *msg); 313 314/** 315 * The IPv6 rule create sub-message structure. 316 */ 317struct sfe_ipv6_rule_create_msg { 318 /* 319 * Request 320 */ 321 uint16_t valid_flags; /**< Bit flags associated with the validity of parameters */ 322 uint16_t rule_flags; /**< Bit flags associated with the rule */ 323 struct sfe_ipv6_5tuple tuple; /**< Holds values of the 5 tuple */ 324 struct sfe_ipv6_connection_rule conn_rule; /**< Basic connection specific data */ 325 struct sfe_protocol_tcp_rule tcp_rule; /**< Protocol related accleration parameters */ 326 struct sfe_pppoe_rule pppoe_rule; /**< PPPoE related accleration parameters */ 327 struct sfe_qos_rule qos_rule; /**< QoS related accleration parameters */ 328 struct sfe_dscp_rule dscp_rule; /**< DSCP related accleration parameters */ 329 struct sfe_vlan_rule vlan_primary_rule; /**< VLAN related accleration parameters */ 330 struct sfe_vlan_rule vlan_secondary_rule; /**< VLAN related accleration parameters */ 331 332 /* 333 * Response 334 */ 335 uint32_t index; /**< Slot ID for cache stats to host OS */ 336}; 337 338/** 339 * The IPv6 rule destroy sub-message structure. 340 */ 341struct sfe_ipv6_rule_destroy_msg { 342 struct sfe_ipv6_5tuple tuple; /**< Holds values of the 5 tuple */ 343}; 344 345/** 346 * The SFE IPv6 rule sync structure. 347 */ 348struct sfe_ipv6_conn_sync { 349 uint32_t index; /**< Slot ID for cache stats to host OS */ 350 uint8_t protocol; /**< Protocol number */ 351 __be32 flow_ip[4]; /**< Flow IP address */ 352 __be16 flow_ident; /**< Flow ident (e.g. port) */ 353 uint32_t flow_max_window; /**< Flow direction's largest seen window */ 354 uint32_t flow_end; /**< Flow direction's largest seen sequence + segment length */ 355 uint32_t flow_max_end; /**< Flow direction's largest seen ack + max(1, win) */ 356 uint32_t flow_rx_packet_count; /**< Flow interface's RX packet count */ 357 uint32_t flow_rx_byte_count; /**< Flow interface's RX byte count */ 358 uint32_t flow_tx_packet_count; /**< Flow interface's TX packet count */ 359 uint32_t flow_tx_byte_count; /**< Flow interface's TX byte count */ 360 uint16_t flow_pppoe_session_id; /**< Flow interface`s PPPoE session ID. */ 361 uint16_t flow_pppoe_remote_mac[3]; 362 /**< Flow interface's PPPoE remote server MAC address if there is any */ 363 __be32 return_ip[4]; /**< Return IP address */ 364 __be16 return_ident; /**< Return ident (e.g. port) */ 365 uint32_t return_max_window; /**< Return direction's largest seen window */ 366 uint32_t return_end; /**< Return direction's largest seen sequence + segment length */ 367 uint32_t return_max_end; /**< Return direction's largest seen ack + max(1, win) */ 368 uint32_t return_rx_packet_count; 369 /**< Return interface's RX packet count */ 370 uint32_t return_rx_byte_count; /**< Return interface's RX byte count */ 371 uint32_t return_tx_packet_count; 372 /**< Return interface's TX packet count */ 373 uint32_t return_tx_byte_count; /**< Return interface's TX byte count */ 374 uint16_t return_pppoe_session_id; 375 /**< Return interface`s PPPoE session ID. */ 376 uint16_t return_pppoe_remote_mac[3]; 377 /**< Return interface's PPPoE remote server MAC address if there is any */ 378 uint32_t inc_ticks; /**< Number of ticks since the last sync */ 379 uint32_t reason; /**< Reason for the sync */ 380 uint8_t flags; /**< Bit flags associated with the rule */ 381 uint32_t qos_tag; /**< QoS Tag */ 382 uint32_t cause; /**< Flush cause associated with the rule */ 383}; 384 385/** 386 * Message structure to send/receive IPv6 bridge/route commands 387 */ 388struct sfe_ipv6_msg { 389 struct sfe_cmn_msg cm; /**< Message Header */ 390 union { 391 struct sfe_ipv6_rule_create_msg rule_create; /**< Message: rule create */ 392 struct sfe_ipv6_rule_destroy_msg rule_destroy; /**< Message: rule destroy */ 393 struct sfe_ipv6_conn_sync conn_stats; /**< Message: stats sync */ 394 } msg; 395}; 396 397/** 398 * Callback to be called when IPv6 message is received 399 */ 400typedef void (*sfe_ipv6_msg_callback_t)(void *app_data, struct sfe_ipv6_msg *msg); 401 402/** 403 * 6rd tunnel peer addr. 404 */ 405struct sfe_tun6rd_set_peer_msg { 406 __be32 ipv6_address[4]; /* The peer's ipv6 addr*/ 407 __be32 dest; /* The peer's ipv4 addr*/ 408}; 409 410/** 411 * Message structure to send/receive 6rd tunnel messages 412 */ 413struct sfe_tun6rd_msg { 414 struct sfe_cmn_msg cm; /* Message Header */ 415 union { 416 struct sfe_tun6rd_set_peer_msg peer; /* Message: add/update peer */ 417 } msg; 418}; 419 420/* 421 * sfe driver context instance 422 */ 423struct sfe_drv_ctx_instance { 424 int not_used; 425}; 426 427/* 428 * sfe_drv_ipv4_max_conn_count() 429 * Return the maximum number of IPv4 connections that the sfe acceleration engine supports 430 * 431 * @return int The number of connections that can be accelerated by the sfe 432 */ 433int sfe_drv_ipv4_max_conn_count(void); 434 435/* 436 * sfe_drv_ipv4_tx() 437 * Transmit an IPv4 message to the sfe 438 * 439 * @param sfe_drv_ctx sfe driver context 440 * @param msg The IPv4 message 441 * 442 * @return sfe_tx_status_t The status of the Tx operation 443 */ 444extern sfe_tx_status_t sfe_drv_ipv4_tx(struct sfe_drv_ctx_instance *sfe_drv_ctx, struct sfe_ipv4_msg *msg); 445 446/* 447 * sfe_drv_ipv4_notify_register() 448 * Register a notifier callback for IPv4 messages from sfe driver 449 * 450 * @param cb The callback pointer 451 * @param app_data The application context for this message 452 * 453 * @return struct sfe_drv_ctx_instance * The sfe driver context 454 */ 455extern struct sfe_drv_ctx_instance *sfe_drv_ipv4_notify_register(sfe_ipv4_msg_callback_t cb, void *app_data); 456 457/* 458 * sfe_drv_ipv4_notify_unregister() 459 * Un-Register a notifier callback for IPv4 messages from sfe driver 460 */ 461extern void sfe_drv_ipv4_notify_unregister(void); 462 463/* 464 * sfe_ipv4_msg_init() 465 * IPv4 message init 466 */ 467extern void sfe_ipv4_msg_init(struct sfe_ipv4_msg *nim, uint16_t if_num, uint32_t type, uint32_t len, 468 sfe_ipv4_msg_callback_t cb, void *app_data); 469 470/* 471 * sfe_drv_ipv6_max_conn_count() 472 * Return the maximum number of IPv6 connections that the sfe acceleration engine supports 473 * 474 * @return int The number of connections that can be accelerated by the sfe 475 */ 476int sfe_drv_ipv6_max_conn_count(void); 477 478/* 479 * sfe_drv_ipv6_tx() 480 * Transmit an IPv6 message to the sfe 481 * 482 * @param sfe_drv_ctx sfe driver context 483 * @param msg The IPv6 message 484 * 485 * @return sfe_tx_status_t The status of the Tx operation 486 */ 487extern sfe_tx_status_t sfe_drv_ipv6_tx(struct sfe_drv_ctx_instance *sfe_drv_ctx, struct sfe_ipv6_msg *msg); 488 489/* 490 * sfe_drv_ipv6_notify_register() 491 * Register a notifier callback for IPv6 messages from sfe driver 492 * 493 * @param cb The callback pointer 494 * @param app_data The application context for this message 495 * 496 * @return struct sfe_drv_ctx_instance * The sfe driver context 497 */ 498extern struct sfe_drv_ctx_instance *sfe_drv_ipv6_notify_register(sfe_ipv6_msg_callback_t cb, void *app_data); 499 500/* 501 * sfe_drv_ipv6_notify_unregister() 502 * Un-Register a notifier callback for IPv6 messages from sfe driver 503 */ 504extern void sfe_drv_ipv6_notify_unregister(void); 505 506/* 507 * sfe_ipv6_msg_init() 508 * IPv6 message init 509 */ 510extern void sfe_ipv6_msg_init(struct sfe_ipv6_msg *nim, uint16_t if_num, uint32_t type, uint32_t len, 511 sfe_ipv6_msg_callback_t cb, void *app_data); 512 513/* 514 * sfe_tun6rd_tx() 515 * Transmit a tun6rd message to sfe engine 516 */ 517sfe_tx_status_t sfe_tun6rd_tx(struct sfe_drv_ctx_instance *sfe_ctx, struct sfe_tun6rd_msg *msg); 518 519/* 520 * sfe_tun6rd_msg_init() 521 * Initialize sfe_tun6rd msg. 522 */ 523void sfe_tun6rd_msg_init(struct sfe_tun6rd_msg *ncm, uint16_t if_num, uint32_t type, uint32_t len, 524 void *cb, void *app_data); 525 526#endif /* __SFE_DRV_H */ 527