11da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#ifndef LLC_C_EV_H
21da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_C_EV_H
31da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/*
41da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * Copyright (c) 1997 by Procom Technology,Inc.
51da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *		 2001 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
61da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *
71da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * This program can be redistributed or modified under the terms of the
81da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * GNU General Public License as published by the Free Software Foundation.
91da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * This program is distributed without any warranty or implied warranty
101da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * of merchantability or fitness for a particular purpose.
111da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds *
121da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * See the GNU General Public License for more details.
131da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds */
141da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
151da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#include <net/sock.h>
161da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
171da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* Connection component state transition event qualifiers */
181da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* Types of events (possible values in 'ev->type') */
191da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_TYPE_SIMPLE		 1
201da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_TYPE_CONDITION	 2
211da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_TYPE_PRIM		 3
221da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_TYPE_PDU		 4	/* command/response PDU */
231da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_TYPE_ACK_TMR	 5
241da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_TYPE_P_TMR		 6
251da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_TYPE_REJ_TMR	 7
261da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_TYPE_BUSY_TMR	 8
271da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_TYPE_RPT_STATUS	 9
281da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_TYPE_SENDACK_TMR	10
291da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
301da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define NBR_CONN_EV		   5
311da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* Connection events which cause state transitions when fully qualified */
321da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
331da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_CONN_REQ				 1
341da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_CONN_RESP				 2
351da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_DATA_REQ				 3
361da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_DISC_REQ				 4
371da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RESET_REQ				 5
381da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RESET_RESP				 6
391da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_LOCAL_BUSY_DETECTED			 7
401da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_LOCAL_BUSY_CLEARED			 8
411da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_BAD_PDU				 9
421da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_DISC_CMD_Pbit_SET_X		10
431da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_DM_RSP_Fbit_SET_X		11
441da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_FRMR_RSP_Fbit_SET_X		12
451da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_I_CMD_Pbit_SET_X			13
461da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_I_CMD_Pbit_SET_X_UNEXPD_Ns	14
471da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_I_CMD_Pbit_SET_X_INVAL_Ns	15
481da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_I_RSP_Fbit_SET_X			16
491da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_I_RSP_Fbit_SET_X_UNEXPD_Ns	17
501da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_I_RSP_Fbit_SET_X_INVAL_Ns	18
511da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_REJ_CMD_Pbit_SET_X		19
521da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_REJ_RSP_Fbit_SET_X		20
531da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_RNR_CMD_Pbit_SET_X		21
541da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_RNR_RSP_Fbit_SET_X		22
551da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_RR_CMD_Pbit_SET_X		23
561da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_RR_RSP_Fbit_SET_X		24
571da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_SABME_CMD_Pbit_SET_X		25
581da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_UA_RSP_Fbit_SET_X		26
591da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_XXX_CMD_Pbit_SET_X		27
601da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_XXX_RSP_Fbit_SET_X		28
611da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_XXX_YYY				29
621da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_ZZZ_CMD_Pbit_SET_X_INVAL_Nr	30
631da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_ZZZ_RSP_Fbit_SET_X_INVAL_Nr	31
641da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_P_TMR_EXP				32
651da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_ACK_TMR_EXP				33
661da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_REJ_TMR_EXP				34
671da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_BUSY_TMR_EXP			35
681da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_XXX_CMD_Pbit_SET_1		36
691da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_XXX_CMD_Pbit_SET_0		37
701da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_I_CMD_Pbit_SET_0_UNEXPD_Ns	38
711da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_I_RSP_Fbit_SET_0_UNEXPD_Ns	39
721da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_I_RSP_Fbit_SET_1_UNEXPD_Ns	40
731da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_I_CMD_Pbit_SET_1_UNEXPD_Ns	41
741da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_I_CMD_Pbit_SET_0			42
751da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_I_RSP_Fbit_SET_0			43
761da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_I_CMD_Pbit_SET_1			44
771da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_RR_CMD_Pbit_SET_0		45
781da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_RR_RSP_Fbit_SET_0		46
791da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_RR_RSP_Fbit_SET_1		47
801da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_RR_CMD_Pbit_SET_1		48
811da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_RNR_CMD_Pbit_SET_0		49
821da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_RNR_RSP_Fbit_SET_0		50
831da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_RNR_RSP_Fbit_SET_1		51
841da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_RNR_CMD_Pbit_SET_1		52
851da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_REJ_CMD_Pbit_SET_0		53
861da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_REJ_RSP_Fbit_SET_0		54
871da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_REJ_CMD_Pbit_SET_1		55
881da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_I_RSP_Fbit_SET_1			56
891da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_REJ_RSP_Fbit_SET_1		57
901da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_RX_XXX_RSP_Fbit_SET_1		58
911da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_TX_BUFF_FULL			59
921da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
931da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_INIT_P_F_CYCLE			100
941da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/*
951da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * Connection event qualifiers; for some events a certain combination of
961da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * these qualifiers must be TRUE before event recognized valid for state;
971da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * these constants act as indexes into the Event Qualifier function
981da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds * table
991da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds */
1001da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_QFY_DATA_FLAG_EQ_1		 1
1011da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_QFY_DATA_FLAG_EQ_0		 2
1021da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_QFY_DATA_FLAG_EQ_2		 3
1031da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_QFY_P_FLAG_EQ_1		 4
1041da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_QFY_P_FLAG_EQ_0		 5
1051da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_QFY_P_FLAG_EQ_Fbit		 6
1061da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_QFY_REMOTE_BUSY_EQ_0	 7
1071da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_QFY_RETRY_CNT_LT_N2		 8
1081da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_QFY_RETRY_CNT_GTE_N2	 9
1091da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_QFY_S_FLAG_EQ_1		10
1101da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_QFY_S_FLAG_EQ_0		11
1111da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#define LLC_CONN_EV_QFY_INIT_P_F_CYCLE		12
1121da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1131da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsstruct llc_conn_state_ev {
1141da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	u8 type;
1151da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	u8 prim;
1161da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	u8 prim_type;
1171da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	u8 reason;
1181da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	u8 status;
1191da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	u8 ind_prim;
1201da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	u8 cfm_prim;
1211da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds};
1221da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1231da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsstatic __inline__ struct llc_conn_state_ev *llc_conn_ev(struct sk_buff *skb)
1241da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds{
1251da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	return (struct llc_conn_state_ev *)skb->cb;
1261da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}
1271da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1281da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldstypedef int (*llc_conn_ev_t)(struct sock *sk, struct sk_buff *skb);
1291da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldstypedef int (*llc_conn_ev_qfyr_t)(struct sock *sk, struct sk_buff *skb);
1301da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
131bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_conn_req(struct sock *sk, struct sk_buff *skb);
132bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_data_req(struct sock *sk, struct sk_buff *skb);
133bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_disc_req(struct sock *sk, struct sk_buff *skb);
134bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_rst_req(struct sock *sk, struct sk_buff *skb);
135bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_local_busy_detected(struct sock *sk, struct sk_buff *skb);
136bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_local_busy_cleared(struct sock *sk, struct sk_buff *skb);
137bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_rx_bad_pdu(struct sock *sk, struct sk_buff *skb);
138bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_rx_disc_cmd_pbit_set_x(struct sock *sk, struct sk_buff *skb);
139bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_rx_dm_rsp_fbit_set_x(struct sock *sk, struct sk_buff *skb);
140bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_rx_frmr_rsp_fbit_set_x(struct sock *sk, struct sk_buff *skb);
141bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_rx_i_cmd_pbit_set_x_inval_ns(struct sock *sk,
142bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perches					     struct sk_buff *skb);
143bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_rx_i_rsp_fbit_set_x(struct sock *sk, struct sk_buff *skb);
144bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_rx_i_rsp_fbit_set_x_unexpd_ns(struct sock *sk,
1451da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds					      struct sk_buff *skb);
146bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_rx_i_rsp_fbit_set_x_inval_ns(struct sock *sk,
147bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perches					     struct sk_buff *skb);
148bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_rx_rej_rsp_fbit_set_x(struct sock *sk, struct sk_buff *skb);
149bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_rx_sabme_cmd_pbit_set_x(struct sock *sk, struct sk_buff *skb);
150bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_rx_ua_rsp_fbit_set_x(struct sock *sk, struct sk_buff *skb);
151bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_rx_xxx_cmd_pbit_set_x(struct sock *sk, struct sk_buff *skb);
152bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_rx_xxx_rsp_fbit_set_x(struct sock *sk, struct sk_buff *skb);
153bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_rx_zzz_cmd_pbit_set_x_inval_nr(struct sock *sk,
1541da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds					       struct sk_buff *skb);
155bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_rx_zzz_rsp_fbit_set_x_inval_nr(struct sock *sk,
156bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perches					       struct sk_buff *skb);
157bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_p_tmr_exp(struct sock *sk, struct sk_buff *skb);
158bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_ack_tmr_exp(struct sock *sk, struct sk_buff *skb);
159bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_rej_tmr_exp(struct sock *sk, struct sk_buff *skb);
160bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_busy_tmr_exp(struct sock *sk, struct sk_buff *skb);
161bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_sendack_tmr_exp(struct sock *sk, struct sk_buff *skb);
1621da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* NOT_USED functions and their variations */
163bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_rx_xxx_cmd_pbit_set_1(struct sock *sk, struct sk_buff *skb);
164bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_rx_xxx_rsp_fbit_set_1(struct sock *sk, struct sk_buff *skb);
165bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_rx_i_cmd_pbit_set_0_unexpd_ns(struct sock *sk,
166bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perches					      struct sk_buff *skb);
167bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_rx_i_cmd_pbit_set_1_unexpd_ns(struct sock *sk,
168bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perches					      struct sk_buff *skb);
169bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_rx_i_cmd_pbit_set_0(struct sock *sk, struct sk_buff *skb);
170bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_rx_i_cmd_pbit_set_1(struct sock *sk, struct sk_buff *skb);
171bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_rx_i_rsp_fbit_set_0_unexpd_ns(struct sock *sk,
172bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perches					      struct sk_buff *skb);
173bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_rx_i_rsp_fbit_set_1_unexpd_ns(struct sock *sk,
174bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perches					      struct sk_buff *skb);
175bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_rx_i_rsp_fbit_set_0(struct sock *sk, struct sk_buff *skb);
176bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_rx_i_rsp_fbit_set_1(struct sock *sk, struct sk_buff *skb);
177bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_rx_rr_cmd_pbit_set_0(struct sock *sk, struct sk_buff *skb);
178bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_rx_rr_cmd_pbit_set_1(struct sock *sk, struct sk_buff *skb);
179bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_rx_rr_rsp_fbit_set_0(struct sock *sk, struct sk_buff *skb);
180bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_rx_rr_rsp_fbit_set_1(struct sock *sk, struct sk_buff *skb);
181bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_rx_rnr_cmd_pbit_set_0(struct sock *sk, struct sk_buff *skb);
182bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_rx_rnr_cmd_pbit_set_1(struct sock *sk, struct sk_buff *skb);
183bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_rx_rnr_rsp_fbit_set_0(struct sock *sk, struct sk_buff *skb);
184bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_rx_rnr_rsp_fbit_set_1(struct sock *sk, struct sk_buff *skb);
185bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_rx_rej_cmd_pbit_set_0(struct sock *sk, struct sk_buff *skb);
186bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_rx_rej_cmd_pbit_set_1(struct sock *sk, struct sk_buff *skb);
187bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_rx_rej_rsp_fbit_set_0(struct sock *sk, struct sk_buff *skb);
188bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_rx_rej_rsp_fbit_set_1(struct sock *sk, struct sk_buff *skb);
189bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_rx_any_frame(struct sock *sk, struct sk_buff *skb);
190bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_tx_buffer_full(struct sock *sk, struct sk_buff *skb);
191bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_init_p_f_cycle(struct sock *sk, struct sk_buff *skb);
1921da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1931da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds/* Available connection action qualifiers */
194bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_qlfy_data_flag_eq_1(struct sock *sk, struct sk_buff *skb);
195bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_qlfy_data_flag_eq_0(struct sock *sk, struct sk_buff *skb);
196bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_qlfy_data_flag_eq_2(struct sock *sk, struct sk_buff *skb);
197bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_qlfy_p_flag_eq_1(struct sock *sk, struct sk_buff *skb);
198bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_qlfy_last_frame_eq_1(struct sock *sk, struct sk_buff *skb);
199bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_qlfy_last_frame_eq_0(struct sock *sk, struct sk_buff *skb);
200bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_qlfy_p_flag_eq_0(struct sock *sk, struct sk_buff *skb);
201bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_qlfy_p_flag_eq_f(struct sock *sk, struct sk_buff *skb);
202bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_qlfy_remote_busy_eq_0(struct sock *sk, struct sk_buff *skb);
203bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_qlfy_remote_busy_eq_1(struct sock *sk, struct sk_buff *skb);
204bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_qlfy_retry_cnt_lt_n2(struct sock *sk, struct sk_buff *skb);
205bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_qlfy_retry_cnt_gte_n2(struct sock *sk, struct sk_buff *skb);
206bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_qlfy_s_flag_eq_1(struct sock *sk, struct sk_buff *skb);
207bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_qlfy_s_flag_eq_0(struct sock *sk, struct sk_buff *skb);
208bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_qlfy_cause_flag_eq_1(struct sock *sk, struct sk_buff *skb);
209bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_qlfy_cause_flag_eq_0(struct sock *sk, struct sk_buff *skb);
210bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_qlfy_set_status_conn(struct sock *sk, struct sk_buff *skb);
211bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_qlfy_set_status_disc(struct sock *sk, struct sk_buff *skb);
212bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_qlfy_set_status_failed(struct sock *sk, struct sk_buff *skb);
213bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_qlfy_set_status_remote_busy(struct sock *sk,
2141da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds					    struct sk_buff *skb);
215bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_qlfy_set_status_refuse(struct sock *sk, struct sk_buff *skb);
216bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_qlfy_set_status_conflict(struct sock *sk, struct sk_buff *skb);
217bf3c710f71a6144bd4d3bb9efb91099863debfb8Joe Perchesint llc_conn_ev_qlfy_set_status_rst_done(struct sock *sk, struct sk_buff *skb);
2181da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2191da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsstatic __inline__ int llc_conn_space(struct sock *sk, struct sk_buff *skb)
2201da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds{
2211da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	return atomic_read(&sk->sk_rmem_alloc) + skb->truesize <
22295c961747284a6b83a5e2d81240e214b0fa3464dEric Dumazet	       (unsigned int)sk->sk_rcvbuf;
2231da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds}
2241da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#endif /* LLC_C_EV_H */
225