18c2ecf20Sopenharmony_ci#ifndef LLC_IF_H
28c2ecf20Sopenharmony_ci#define LLC_IF_H
38c2ecf20Sopenharmony_ci/*
48c2ecf20Sopenharmony_ci * Copyright (c) 1997 by Procom Technology,Inc.
58c2ecf20Sopenharmony_ci * 		 2001 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * This program can be redistributed or modified under the terms of the
88c2ecf20Sopenharmony_ci * GNU General Public License as published by the Free Software Foundation.
98c2ecf20Sopenharmony_ci * This program is distributed without any warranty or implied warranty
108c2ecf20Sopenharmony_ci * of merchantability or fitness for a particular purpose.
118c2ecf20Sopenharmony_ci *
128c2ecf20Sopenharmony_ci * See the GNU General Public License for more details.
138c2ecf20Sopenharmony_ci */
148c2ecf20Sopenharmony_ci/* Defines LLC interface to network layer */
158c2ecf20Sopenharmony_ci/* Available primitives */
168c2ecf20Sopenharmony_ci#include <linux/if.h>
178c2ecf20Sopenharmony_ci#include <linux/if_arp.h>
188c2ecf20Sopenharmony_ci#include <linux/llc.h>
198c2ecf20Sopenharmony_ci#include <linux/etherdevice.h>
208c2ecf20Sopenharmony_ci#include <net/llc.h>
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci#define LLC_DATAUNIT_PRIM	1
238c2ecf20Sopenharmony_ci#define LLC_CONN_PRIM		2
248c2ecf20Sopenharmony_ci#define LLC_DATA_PRIM		3
258c2ecf20Sopenharmony_ci#define LLC_DISC_PRIM		4
268c2ecf20Sopenharmony_ci#define LLC_RESET_PRIM		5
278c2ecf20Sopenharmony_ci#define LLC_FLOWCONTROL_PRIM	6 /* Not supported at this time */
288c2ecf20Sopenharmony_ci#define LLC_DISABLE_PRIM	7
298c2ecf20Sopenharmony_ci#define LLC_XID_PRIM		8
308c2ecf20Sopenharmony_ci#define LLC_TEST_PRIM		9
318c2ecf20Sopenharmony_ci#define LLC_SAP_ACTIVATION     10
328c2ecf20Sopenharmony_ci#define LLC_SAP_DEACTIVATION   11
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci#define LLC_NBR_PRIMITIVES     11
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ci#define LLC_IND			1
378c2ecf20Sopenharmony_ci#define LLC_CONFIRM		2
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ci/* Primitive type */
408c2ecf20Sopenharmony_ci#define LLC_PRIM_TYPE_REQ	1
418c2ecf20Sopenharmony_ci#define LLC_PRIM_TYPE_IND	2
428c2ecf20Sopenharmony_ci#define LLC_PRIM_TYPE_RESP	3
438c2ecf20Sopenharmony_ci#define LLC_PRIM_TYPE_CONFIRM	4
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ci/* Reset reasons, remote entity or local LLC */
468c2ecf20Sopenharmony_ci#define LLC_RESET_REASON_REMOTE	1
478c2ecf20Sopenharmony_ci#define LLC_RESET_REASON_LOCAL	2
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ci/* Disconnect reasons */
508c2ecf20Sopenharmony_ci#define LLC_DISC_REASON_RX_DM_RSP_PDU	0
518c2ecf20Sopenharmony_ci#define LLC_DISC_REASON_RX_DISC_CMD_PDU	1
528c2ecf20Sopenharmony_ci#define LLC_DISC_REASON_ACK_TMR_EXP	2
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_ci/* Confirm reasons */
558c2ecf20Sopenharmony_ci#define LLC_STATUS_CONN		0 /* connect confirm & reset confirm */
568c2ecf20Sopenharmony_ci#define LLC_STATUS_DISC		1 /* connect confirm & reset confirm */
578c2ecf20Sopenharmony_ci#define LLC_STATUS_FAILED	2 /* connect confirm & reset confirm */
588c2ecf20Sopenharmony_ci#define LLC_STATUS_IMPOSSIBLE	3 /* connect confirm */
598c2ecf20Sopenharmony_ci#define LLC_STATUS_RECEIVED	4 /* data conn */
608c2ecf20Sopenharmony_ci#define LLC_STATUS_REMOTE_BUSY	5 /* data conn */
618c2ecf20Sopenharmony_ci#define LLC_STATUS_REFUSE	6 /* data conn */
628c2ecf20Sopenharmony_ci#define LLC_STATUS_CONFLICT	7 /* disconnect conn */
638c2ecf20Sopenharmony_ci#define LLC_STATUS_RESET_DONE	8 /*  */
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ciint llc_establish_connection(struct sock *sk, u8 *lmac, u8 *dmac, u8 dsap);
668c2ecf20Sopenharmony_ciint llc_build_and_send_pkt(struct sock *sk, struct sk_buff *skb);
678c2ecf20Sopenharmony_ciint llc_send_disc(struct sock *sk);
688c2ecf20Sopenharmony_ci#endif /* LLC_IF_H */
69