blob: 15eedf62f992d68b3c98815524ab8339839383ec [file] [log] [blame]
/*
* Header file describing the BCOL TCPKA interfaces.
*
* Provides type definitions and function prototypes used to link the
* DHD OS, bus, and protocol modules.
*
* Copyright (C) 1999-2017, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* under the terms of the GNU General Public License version 2 (the "GPL"),
* available at http://www.broadcom.com/licenses/GPLv2.php, with the
* following added to such license:
*
* As a special exception, the copyright holders of this software give you
* permission to link this software with independent modules, and to copy and
* distribute the resulting executable under terms of your choice, provided that
* you also meet, for each linked independent module, the terms and conditions of
* the license of that module. An independent module is a module which is not
* derived from this software. The special exception does not apply to any
* modifications of the software.
*
* Notwithstanding the above, under no circumstances may you combine this
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
*
* <<Broadcom-WL-IPTag/Open:>>
*
* $Id:$
*/
#ifndef _DHD_BCOL_TCPKA_
#define _DHD_BCOL_TCPKA_
#include <typedefs.h>
#include <osl.h>
typedef struct tcpka_conn {
uint32 sess_id;
struct ether_addr dst_mac;
struct ipv4_addr src_ip;
struct ipv4_addr dst_ip;
uint16 ipid;
uint16 srcport;
uint16 dstport;
uint32 seq;
uint32 ack;
uint16 tcpwin;
uint32 tsval;
uint32 tsecr;
#ifdef TCPKA_BYPASS
bool bypass; /* bypass tcpka pkt to pkt filter process */
#endif /* TCPKA_BYPASS */
uint32 last_payload_len; /* last packet payload len */
uint32 ka_payload_len; /* keep alive payload length */
uint8 ka_payload[1]; /* keep alive payload */
} tcpka_conn_t;
typedef struct tcpka6_conn {
uint32 sess_id;
struct ether_addr dst_mac;
uint8 src_ip[IPV6_ADDR_LEN];
uint8 dst_ip[IPV6_ADDR_LEN];
uint32 type;
uint16 srcport;
uint16 dstport;
uint32 seq;
uint32 ack;
uint16 tcpwin;
uint32 tsval;
uint32 tsecr;
#ifdef TCPKA_BYPASS
bool bypass; /* bypass tcpka pkt to pkt filter process */
#endif /* TCPKA_BYPASS */
uint32 last_payload_len; /* last packet payload len */
uint32 ka_payload_len; /* keep alive payload length */
uint8 ka_payload[1]; /* keep alive payload */
} tcpka6_conn_t;
typedef struct tcpka_conn_sess {
uint32 sess_id;
uint32 flag;
wl_mtcpkeep_alive_timers_pkt_t tcp_keepalive_timers;
uint32 snd_wl1;
uint32 snd_wnd;
uint32 max_window;
uint32 rcv_wnd;
uint32 rcv_wup;
uint16 mss;
uint8 snd_wscale;
uint8 rcv_wscale;
uint8 tcpi_options;
} tcpka_conn_sess_t;
typedef struct tcpka_conn_info {
uint32 tcpka_sess_ipid;
uint32 tcpka_sess_seq;
uint32 tcpka_sess_ack;
bool tcpka_sess_active;
} tcpka_conn_sess_info_t;
#define max_tcpka_slen 128
typedef struct tcpka_conn_send {
uint32 tcpka_sess_ipid;
uint16 send_type;
uint16 send_length;
uint8 send_data[max_tcpka_slen]; /* keep alive payload */
} tcpka_conn_sess_send_t;
typedef struct tcpka_conn_reinit {
uint32 tcpka_sess_ipid;
uint8 enable;
uint8 tcpka_handshake_timeout;
uint16 tcpka_timeout_trigger;
} tcpka_conn_sess_reinit_t;
#ifdef TCPKA_REPAIR
typedef struct tcpka_conn_repair {
bool block_tcpka;
uint16 block_tcpka_timeout; //sec
uint32 block_tcpka_start_time; //timestamp
void *skbhead;
void *skbprev;
uint32 pkt_in_q_num;
bool configured;
uint32 src_ip;
uint32 dst_ip;
uint16 src_port;
uint16 dst_port;
} tcpka_conn_repair_t;
/* Pkttag format for skb->cb of rx */
typedef struct dhd_pkttag_rx {
bool queue_needed;
uint8 ifidx;
} dhd_pkttag_rx_t;
typedef struct noti_pkt_hold {
int8 type;
uint16 min_len;
uint16 max_len;
} tcpka_noti_pkt_hold_t;
typedef struct noti_payload {
uint8 tcpka_sess_id;
uint8 gpio_slot;
uint8 type;
uint16 noti_len;
uint8 noti_data[1];
} wifi_noti_payload_t;
#define DHD_PKTTAG_SET_QUEUED(tag, val) ((tag)->queue_needed = (uint8)(val))
#define DHD_PKTTAG_QUEUED(tag) ((tag)->queue_needed)
#define DHD_PKTTAG_SET_IFIDX(tag, val) ((tag)->ifidx = (uint8)(val))
#define DHD_PKTTAG_IFIDX(tag) ((tag)->ifidx)
#endif /* TCPKA_REPAIR */
/* FW BCOL TCPKA IOVARs */
#define CMD_STR_TCPKA_CONN_EN "tcpka_conn_enable"
#define CMD_STR_TCPKA_CONN_ADD "tcpka_conn_add"
#define CMD_STR_TCPKA_CONN_DEL "tcpka_conn_del"
#define CMD_STR_TCPKA6_CONN_ADD "tcpka6_conn_add"
/* DHD only IOVAR */
#define CMD_STR_TCPKA_CONN_SYNC "tcpka_conn_sync"
#endif /* _DHD_BCOL_TCPKA_ */