xref: /linux/include/net/llc_s_ev.h (revision 90e63d5354951d37fa2b3b91e6f17b95d2bf9bee)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef LLC_S_EV_H
3 #define LLC_S_EV_H
4 /*
5  * Copyright (c) 1997 by Procom Technology,Inc.
6  * 		 2001 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
7  */
8 
9 #include <linux/skbuff.h>
10 #include <net/llc.h>
11 
12 /* Defines SAP component events */
13 /* Types of events (possible values in 'ev->type') */
14 #define LLC_SAP_EV_TYPE_SIMPLE		1
15 #define LLC_SAP_EV_TYPE_CONDITION	2
16 #define LLC_SAP_EV_TYPE_PRIM		3
17 #define LLC_SAP_EV_TYPE_PDU		4   /* command/response PDU */
18 #define LLC_SAP_EV_TYPE_ACK_TMR		5
19 #define LLC_SAP_EV_TYPE_RPT_STATUS	6
20 
21 #define LLC_SAP_EV_ACTIVATION_REQ	 1
22 #define LLC_SAP_EV_RX_UI		 2
23 #define LLC_SAP_EV_UNITDATA_REQ		 3
24 #define LLC_SAP_EV_XID_REQ		 4
25 #define LLC_SAP_EV_RX_XID_C		 5
26 #define LLC_SAP_EV_RX_XID_R		 6
27 #define LLC_SAP_EV_TEST_REQ		 7
28 #define LLC_SAP_EV_RX_TEST_C		 8
29 #define LLC_SAP_EV_RX_TEST_R		 9
30 #define LLC_SAP_EV_DEACTIVATION_REQ	10
31 
32 struct llc_sap_state_ev {
33 	u8		prim;
34 	u8		prim_type;
35 	u8		type;
36 	u8		reason;
37 	u8		ind_cfm_flag;
38 	struct llc_addr saddr;
39 	struct llc_addr daddr;
40 };
41 
42 static __inline__ struct llc_sap_state_ev *llc_sap_ev(struct sk_buff *skb)
43 {
44 	return (struct llc_sap_state_ev *)skb->cb;
45 }
46 
47 struct llc_sap;
48 
49 typedef int (*llc_sap_ev_t)(struct llc_sap *sap, struct sk_buff *skb);
50 
51 int llc_sap_ev_activation_req(struct llc_sap *sap, struct sk_buff *skb);
52 int llc_sap_ev_rx_ui(struct llc_sap *sap, struct sk_buff *skb);
53 int llc_sap_ev_unitdata_req(struct llc_sap *sap, struct sk_buff *skb);
54 int llc_sap_ev_xid_req(struct llc_sap *sap, struct sk_buff *skb);
55 int llc_sap_ev_rx_xid_c(struct llc_sap *sap, struct sk_buff *skb);
56 int llc_sap_ev_rx_xid_r(struct llc_sap *sap, struct sk_buff *skb);
57 int llc_sap_ev_test_req(struct llc_sap *sap, struct sk_buff *skb);
58 int llc_sap_ev_rx_test_c(struct llc_sap *sap, struct sk_buff *skb);
59 int llc_sap_ev_rx_test_r(struct llc_sap *sap, struct sk_buff *skb);
60 int llc_sap_ev_deactivation_req(struct llc_sap *sap, struct sk_buff *skb);
61 #endif /* LLC_S_EV_H */
62