162306a36Sopenharmony_ci#ifndef LLC_S_EV_H
262306a36Sopenharmony_ci#define LLC_S_EV_H
362306a36Sopenharmony_ci/*
462306a36Sopenharmony_ci * Copyright (c) 1997 by Procom Technology,Inc.
562306a36Sopenharmony_ci * 		 2001 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
662306a36Sopenharmony_ci *
762306a36Sopenharmony_ci * This program can be redistributed or modified under the terms of the
862306a36Sopenharmony_ci * GNU General Public License as published by the Free Software Foundation.
962306a36Sopenharmony_ci * This program is distributed without any warranty or implied warranty
1062306a36Sopenharmony_ci * of merchantability or fitness for a particular purpose.
1162306a36Sopenharmony_ci *
1262306a36Sopenharmony_ci * See the GNU General Public License for more details.
1362306a36Sopenharmony_ci */
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ci#include <linux/skbuff.h>
1662306a36Sopenharmony_ci#include <net/llc.h>
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ci/* Defines SAP component events */
1962306a36Sopenharmony_ci/* Types of events (possible values in 'ev->type') */
2062306a36Sopenharmony_ci#define LLC_SAP_EV_TYPE_SIMPLE		1
2162306a36Sopenharmony_ci#define LLC_SAP_EV_TYPE_CONDITION	2
2262306a36Sopenharmony_ci#define LLC_SAP_EV_TYPE_PRIM		3
2362306a36Sopenharmony_ci#define LLC_SAP_EV_TYPE_PDU		4   /* command/response PDU */
2462306a36Sopenharmony_ci#define LLC_SAP_EV_TYPE_ACK_TMR		5
2562306a36Sopenharmony_ci#define LLC_SAP_EV_TYPE_RPT_STATUS	6
2662306a36Sopenharmony_ci
2762306a36Sopenharmony_ci#define LLC_SAP_EV_ACTIVATION_REQ	 1
2862306a36Sopenharmony_ci#define LLC_SAP_EV_RX_UI		 2
2962306a36Sopenharmony_ci#define LLC_SAP_EV_UNITDATA_REQ		 3
3062306a36Sopenharmony_ci#define LLC_SAP_EV_XID_REQ		 4
3162306a36Sopenharmony_ci#define LLC_SAP_EV_RX_XID_C		 5
3262306a36Sopenharmony_ci#define LLC_SAP_EV_RX_XID_R		 6
3362306a36Sopenharmony_ci#define LLC_SAP_EV_TEST_REQ		 7
3462306a36Sopenharmony_ci#define LLC_SAP_EV_RX_TEST_C		 8
3562306a36Sopenharmony_ci#define LLC_SAP_EV_RX_TEST_R		 9
3662306a36Sopenharmony_ci#define LLC_SAP_EV_DEACTIVATION_REQ	10
3762306a36Sopenharmony_ci
3862306a36Sopenharmony_cistruct llc_sap_state_ev {
3962306a36Sopenharmony_ci	u8		prim;
4062306a36Sopenharmony_ci	u8		prim_type;
4162306a36Sopenharmony_ci	u8		type;
4262306a36Sopenharmony_ci	u8		reason;
4362306a36Sopenharmony_ci	u8		ind_cfm_flag;
4462306a36Sopenharmony_ci	struct llc_addr saddr;
4562306a36Sopenharmony_ci	struct llc_addr daddr;
4662306a36Sopenharmony_ci};
4762306a36Sopenharmony_ci
4862306a36Sopenharmony_cistatic __inline__ struct llc_sap_state_ev *llc_sap_ev(struct sk_buff *skb)
4962306a36Sopenharmony_ci{
5062306a36Sopenharmony_ci	return (struct llc_sap_state_ev *)skb->cb;
5162306a36Sopenharmony_ci}
5262306a36Sopenharmony_ci
5362306a36Sopenharmony_cistruct llc_sap;
5462306a36Sopenharmony_ci
5562306a36Sopenharmony_citypedef int (*llc_sap_ev_t)(struct llc_sap *sap, struct sk_buff *skb);
5662306a36Sopenharmony_ci
5762306a36Sopenharmony_ciint llc_sap_ev_activation_req(struct llc_sap *sap, struct sk_buff *skb);
5862306a36Sopenharmony_ciint llc_sap_ev_rx_ui(struct llc_sap *sap, struct sk_buff *skb);
5962306a36Sopenharmony_ciint llc_sap_ev_unitdata_req(struct llc_sap *sap, struct sk_buff *skb);
6062306a36Sopenharmony_ciint llc_sap_ev_xid_req(struct llc_sap *sap, struct sk_buff *skb);
6162306a36Sopenharmony_ciint llc_sap_ev_rx_xid_c(struct llc_sap *sap, struct sk_buff *skb);
6262306a36Sopenharmony_ciint llc_sap_ev_rx_xid_r(struct llc_sap *sap, struct sk_buff *skb);
6362306a36Sopenharmony_ciint llc_sap_ev_test_req(struct llc_sap *sap, struct sk_buff *skb);
6462306a36Sopenharmony_ciint llc_sap_ev_rx_test_c(struct llc_sap *sap, struct sk_buff *skb);
6562306a36Sopenharmony_ciint llc_sap_ev_rx_test_r(struct llc_sap *sap, struct sk_buff *skb);
6662306a36Sopenharmony_ciint llc_sap_ev_deactivation_req(struct llc_sap *sap, struct sk_buff *skb);
6762306a36Sopenharmony_ci#endif /* LLC_S_EV_H */
68