summaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-06-17 14:08:29 +0000
committerRalf Baechle <ralf@linux-mips.org>1999-06-17 14:08:29 +0000
commit57d569635c05dc4ea9b9f1f8dcec69b9ddc989b2 (patch)
tree1f703abf7d95dcd50ee52da3b96eb1b4b2b4ea53 /include/net
parent59223edaa18759982db0a8aced0e77457d10c68e (diff)
The rest of 2.3.6.
Diffstat (limited to 'include/net')
-rw-r--r--include/net/decnet_call.h2
-rw-r--r--include/net/dn.h206
-rw-r--r--include/net/dn_dev.h194
-rw-r--r--include/net/dn_fib.h83
-rw-r--r--include/net/dn_neigh.h29
-rw-r--r--include/net/dn_nsp.h194
-rw-r--r--include/net/dn_raw.h17
-rw-r--r--include/net/dn_route.h74
-rw-r--r--include/net/irda/smc-ircc.h160
-rw-r--r--include/net/irda/toshoboe.h165
10 files changed, 1124 insertions, 0 deletions
diff --git a/include/net/decnet_call.h b/include/net/decnet_call.h
new file mode 100644
index 000000000..90a30561e
--- /dev/null
+++ b/include/net/decnet_call.h
@@ -0,0 +1,2 @@
+/* Separate to keep compilation of protocols.c simpler */
+extern void decnet_proto_init(struct net_proto *pro);
diff --git a/include/net/dn.h b/include/net/dn.h
new file mode 100644
index 000000000..b2ad40426
--- /dev/null
+++ b/include/net/dn.h
@@ -0,0 +1,206 @@
+#ifndef _NET_DN_H
+#define _NET_DN_H
+
+#include <linux/dn.h>
+#include <asm/byteorder.h>
+
+typedef unsigned short dn_address;
+
+#define dn_ntohs(x) le16_to_cpu(x)
+#define dn_htons(x) cpu_to_le16(x)
+
+struct dn_scp /* Session Control Port */
+{
+ unsigned char state;
+#define DN_O 1 /* Open */
+#define DN_CR 2 /* Connect Receive */
+#define DN_DR 3 /* Disconnect Reject */
+#define DN_DRC 4 /* Discon. Rej. Complete*/
+#define DN_CC 5 /* Connect Confirm */
+#define DN_CI 6 /* Connect Initiate */
+#define DN_NR 7 /* No resources */
+#define DN_NC 8 /* No communication */
+#define DN_CD 9 /* Connect Delivery */
+#define DN_RJ 10 /* Rejected */
+#define DN_RUN 11 /* Running */
+#define DN_DI 12 /* Disconnect Initiate */
+#define DN_DIC 13 /* Disconnect Complete */
+#define DN_DN 14 /* Disconnect Notificat */
+#define DN_CL 15 /* Closed */
+#define DN_CN 16 /* Closed Notification */
+
+ unsigned short addrloc;
+ unsigned short addrrem;
+ unsigned short numdat;
+ unsigned short numoth;
+ unsigned short numoth_rcv;
+ unsigned short numdat_rcv;
+ unsigned short ackxmt_dat;
+ unsigned short ackxmt_oth;
+ unsigned short ackrcv_dat;
+ unsigned short ackrcv_oth;
+ unsigned char flowrem_sw;
+ unsigned char flowloc_sw;
+#define DN_SEND 2
+#define DN_DONTSEND 1
+#define DN_NOCHANGE 0
+ unsigned char accept_mode;
+ unsigned short mss;
+
+ struct optdata_dn conndata_in;
+ struct optdata_dn conndata_out;
+ struct optdata_dn discdata_in;
+ struct optdata_dn discdata_out;
+ struct accessdata_dn accessdata;
+
+ struct sockaddr_dn addr; /* Local address */
+ struct sockaddr_dn peer; /* Remote address */
+
+ /*
+ * In this case the RTT estimation is not specified in the
+ * docs, nor is any back off algorithm. Here we follow well
+ * known tcp algorithms with a few small variations.
+ *
+ * snd_window: Max number of packets we send before we wait for
+ * an ack to come back. This will become part of a
+ * more complicated scheme when we support flow
+ * control.
+ *
+ * nsp_srtt: Round-Trip-Time (x8) in jiffies. This is a rolling
+ * average.
+ * nsp_rttvar: Round-Trip-Time-Varience (x4) in jiffies. This is the
+ * varience of the smoothed average (but calculated in
+ * a simpler way than for normal statistical varience
+ * calculations).
+ *
+ * nsp_rxtshift: Backoff counter. Value is zero normally, each time
+ * a packet is lost is increases by one until an ack
+ * is received. Its used to index an array of backoff
+ * multipliers.
+ */
+#define NSP_MIN_WINDOW 1
+#define NSP_MAX_WINDOW 512
+ unsigned long snd_window;
+#define NSP_INITIAL_SRTT (HZ)
+ unsigned long nsp_srtt;
+#define NSP_INITIAL_RTTVAR (HZ*3)
+ unsigned long nsp_rttvar;
+#define NSP_MAXRXTSHIFT 12
+ unsigned long nsp_rxtshift;
+
+ /*
+ * Output queues, one for data, one for otherdata/linkservice
+ */
+ struct sk_buff_head data_xmit_queue;
+ struct sk_buff_head other_xmit_queue;
+
+ /*
+ * Input queue for other data
+ */
+ struct sk_buff_head other_receive_queue;
+ int other_report;
+
+ /*
+ * Stuff to do with the slow timer
+ */
+ unsigned long stamp; /* time of last transmit */
+ unsigned long persist;
+ int (*persist_fxn)(struct sock *sk);
+ unsigned long keepalive;
+ void (*keepalive_fxn)(struct sock *sk);
+
+ /*
+ * This stuff is for the fast timer for delayed acks
+ */
+ struct timer_list delack_timer;
+ int delack_pending;
+ void (*delack_fxn)(struct sock *sk);
+};
+
+/*
+ * src,dst : Source and Destination DECnet addresses
+ * neigh: Address from which we've just got this skb.
+ * hops : Number of hops through the network
+ * dst_port, src_port : NSP port numbers
+ * services, info : Useful data extracted from conninit messages
+ * rt_flags : Routing flags byte
+ * nsp_flags : NSP layer flags byte
+ * segsize : Size of segment
+ * segnum : Number, for data, otherdata and linkservice
+ * xmit_count : Number of times we've transmitted this skb
+ * stamp : Time stamp of first transmission, used in RTT calculations
+ * iif: Input interface number
+ *
+ * As a general policy, this structure keeps all addresses in network
+ * byte order, and all else in host byte order. Thus dst, src, dst_port
+ * src_port and neigh are in network order. All else is in host order.
+ *
+ */
+struct dn_skb_cb {
+ unsigned short dst;
+ unsigned short src;
+ unsigned short neigh;
+ unsigned short hops;
+ unsigned short dst_port;
+ unsigned short src_port;
+ unsigned char services;
+ unsigned char info;
+ unsigned char rt_flags;
+ unsigned char nsp_flags;
+ unsigned short segsize;
+ unsigned short segnum;
+ unsigned short xmit_count;
+ unsigned long stamp;
+ int iif;
+};
+
+static __inline__ dn_address dn_eth2dn(unsigned char *ethaddr)
+{
+ return ethaddr[4] | (ethaddr[5] << 8);
+}
+
+static __inline__ dn_address dn_saddr2dn(struct sockaddr_dn *saddr)
+{
+ return *(dn_address *)saddr->sdn_nodeaddr;
+}
+
+static __inline__ void dn_dn2eth(unsigned char *ethaddr, dn_address addr)
+{
+ ethaddr[0] = 0xAA;
+ ethaddr[1] = 0x00;
+ ethaddr[2] = 0x04;
+ ethaddr[3] = 0x00;
+ ethaddr[4] = (unsigned char)(addr & 0xff);
+ ethaddr[5] = (unsigned char)(addr >> 8);
+}
+
+#define DN_MENUVER_ACC 0x01
+#define DN_MENUVER_USR 0x02
+#define DN_MENUVER_PRX 0x04
+#define DN_MENUVER_UIC 0x08
+
+extern struct sock *dn_sklist_find_listener(struct sockaddr_dn *addr);
+extern struct sock *dn_find_by_skb(struct sk_buff *skb);
+extern unsigned short dn_alloc_port(void);
+#define DN_ASCBUF_LEN 7
+extern char *dn_addr2asc(dn_address, char *);
+extern void dn_destroy_sock(struct sock *sk);
+
+extern int dn_sockaddr2username(struct sockaddr_dn *addr, unsigned char *buf, unsigned char type);
+extern int dn_username2sockaddr(unsigned char *data, int len, struct sockaddr_dn *addr, unsigned char *type);
+
+extern void dn_start_slow_timer(struct sock *sk);
+extern void dn_stop_slow_timer(struct sock *sk);
+extern void dn_start_fast_timer(struct sock *sk);
+extern void dn_stop_fast_timer(struct sock *sk);
+
+extern dn_address decnet_address;
+extern unsigned char decnet_ether_address[6];
+extern int decnet_node_type;
+extern int decnet_debug_level;
+extern int decnet_time_wait;
+extern int decnet_dn_count;
+extern int decnet_di_count;
+extern int decnet_dr_count;
+
+#endif /* _NET_DN_H */
diff --git a/include/net/dn_dev.h b/include/net/dn_dev.h
new file mode 100644
index 000000000..cb9eda018
--- /dev/null
+++ b/include/net/dn_dev.h
@@ -0,0 +1,194 @@
+#ifndef _NET_DN_DEV_H
+#define _NET_DN_DEV_H
+
+
+struct dn_dev;
+
+struct dn_ifaddr {
+ struct dn_ifaddr *ifa_next;
+ struct dn_dev *ifa_dev;
+ dn_address ifa_local;
+ unsigned char ifa_flags;
+ unsigned char ifa_scope;
+ char ifa_label[IFNAMSIZ];
+};
+
+#define DN_DEV_S_RU 0 /* Run - working normally */
+#define DN_DEV_S_CR 1 /* Circuit Rejected */
+#define DN_DEV_S_DS 2 /* Data Link Start */
+#define DN_DEV_S_RI 3 /* Routing Layer Initialize */
+#define DN_DEV_S_RV 4 /* Routing Layer Verify */
+#define DN_DEV_S_RC 5 /* Routing Layer Complete */
+#define DN_DEV_S_OF 6 /* Off */
+#define DN_DEV_S_HA 7 /* Halt */
+
+
+/*
+ * The dn_dev_parms structure contains the set of parameters
+ * for each device (hence inclusion in the dn_dev structure)
+ * and an array is used to store the default types of supported
+ * device (in dn_dev.c).
+ *
+ * The type field matches the ARPHRD_ constants and is used in
+ * searching the list for supported devices when new devices
+ * come up.
+ *
+ * The mode field is used to find out if a device is broadcast,
+ * multipoint, or pointopoint. Please note that DECnet thinks
+ * different ways about devices to the rest of the kernel
+ * so the normal IFF_xxx flags are invalid here. For devices
+ * which can be any combination of the previously mentioned
+ * attributes, you can set this on a per device basis by
+ * installing an up() routine.
+ *
+ * The device state field, defines the initial state in which the
+ * device will come up. In the dn_dev structure, it is the actual
+ * state.
+ *
+ * The cost field is used in the routing algorithm.
+ *
+ * Timers:
+ * t1 - Routing timer, send routing messages when it expires
+ * t2 - Rate limit timer, min time between routing and hello messages
+ * t3 - Hello timer, send hello messages when it expires
+ *
+ * Callbacks:
+ * up() - Called to initialize device, return value can veto use of
+ * device with DECnet.
+ * down() - Called to turn device off when it goes down
+ * timer1() - Called when timer 1 goes off
+ * timer3() - Called when timer 3 goes off
+ * setsrc() - Called for each incomming frame to set previous hop info
+ * neigh_setup() - Called to do device specific setup of neighbours
+ *
+ * sysctl - Hook for sysctl things
+ *
+ */
+struct dn_dev_parms {
+ int type; /* ARPHRD_xxx */
+ int mode; /* Broadcast, Unicast, Mulitpoint */
+#define DN_DEV_BCAST 1
+#define DN_DEV_UCAST 2
+#define DN_DEV_MPOINT 4
+ int state; /* Initial state */
+ int cost; /* Default cost of device */
+ unsigned short blksize; /* Block Size */
+ unsigned long t1; /* Default value of t1 */
+ unsigned long t2; /* Default value of t2 */
+ unsigned long t3; /* Default value of t3 */
+ int priority; /* Priority to be a router */
+ char *name; /* Name for sysctl */
+ int ctl_name; /* Index for sysctl */
+ int (*up)(struct device *);
+ void (*down)(struct device *);
+ void (*timer1)(struct device *);
+ void (*timer3)(struct device *);
+ int (*setsrc)(struct sk_buff *skb);
+ int (*neigh_setup)(struct neighbour *);
+ void *sysctl;
+};
+
+
+struct dn_dev {
+ struct dn_ifaddr *ifa_list;
+ struct device *dev;
+ struct dn_dev_parms parms;
+ char use_long;
+ struct timer_list timer;
+ unsigned long t3, t1;
+ struct neigh_parms *neigh_parms;
+ unsigned char addr[ETH_ALEN];
+ struct neighbour *router; /* Default router on circuit */
+ struct neighbour *peer; /* Peer on pointopoint links */
+ unsigned long uptime; /* Time device went up in jiffies */
+};
+
+struct dn_short_packet
+{
+ unsigned char msgflg __attribute__((packed));
+ unsigned short dstnode __attribute__((packed));
+ unsigned short srcnode __attribute__((packed));
+ unsigned char forward __attribute__((packed));
+};
+
+struct dn_long_packet
+{
+ unsigned char msgflg __attribute__((packed));
+ unsigned char d_area __attribute__((packed));
+ unsigned char d_subarea __attribute__((packed));
+ unsigned char d_id[6] __attribute__((packed));
+ unsigned char s_area __attribute__((packed));
+ unsigned char s_subarea __attribute__((packed));
+ unsigned char s_id[6] __attribute__((packed));
+ unsigned char nl2 __attribute__((packed));
+ unsigned char visit_ct __attribute__((packed));
+ unsigned char s_class __attribute__((packed));
+ unsigned char pt __attribute__((packed));
+};
+
+/*------------------------- DRP - Routing messages ---------------------*/
+
+ struct endnode_hello_message
+ {
+ unsigned char msgflg __attribute__((packed));
+ unsigned char tiver[3] __attribute__((packed));
+ unsigned char id[6] __attribute__((packed));
+ unsigned char iinfo __attribute__((packed));
+ unsigned short blksize __attribute__((packed));
+ unsigned char area __attribute__((packed));
+ unsigned char seed[8] __attribute__((packed));
+ unsigned char neighbor[6] __attribute__((packed));
+ unsigned short timer __attribute__((packed));
+ unsigned char mpd __attribute__((packed));
+ unsigned char datalen __attribute__((packed));
+ unsigned char data[2] __attribute__((packed));
+ };
+ struct rtnode_hello_message
+ {
+ unsigned char msgflg __attribute__((packed));
+ unsigned char tiver[3] __attribute__((packed));
+ unsigned char id[6] __attribute__((packed));
+ unsigned char iinfo __attribute__((packed));
+ unsigned short blksize __attribute__((packed));
+ unsigned char priority __attribute__((packed));
+ unsigned char area __attribute__((packed));
+ unsigned short timer __attribute__((packed));
+ unsigned char mpd __attribute__((packed));
+ };
+
+
+extern void dn_dev_init(void);
+extern void dn_dev_cleanup(void);
+
+extern int dn_dev_ioctl(unsigned int cmd, void *arg);
+
+extern void dn_dev_devices_off(void);
+extern void dn_dev_devices_on(void);
+
+extern void dn_dev_init_pkt(struct sk_buff *skb);
+extern void dn_dev_veri_pkt(struct sk_buff *skb);
+extern void dn_dev_hello(struct sk_buff *skb);
+
+extern void dn_dev_up(struct device *);
+extern void dn_dev_down(struct device *);
+
+extern struct device *decnet_default_device;
+
+static __inline__ int dn_dev_islocal(struct device *dev, dn_address addr)
+{
+ struct dn_dev *dn_db = dev->dn_ptr;
+ struct dn_ifaddr *ifa;
+
+ if (dn_db == NULL) {
+ printk(KERN_DEBUG "dn_dev_islocal: Called for non DECnet device\n");
+ return 0;
+ }
+
+ for(ifa = dn_db->ifa_list; ifa; ifa = ifa->ifa_next)
+ if ((addr ^ ifa->ifa_local) == 0)
+ return 1;
+
+ return 0;
+}
+
+#endif /* _NET_DN_DEV_H */
diff --git a/include/net/dn_fib.h b/include/net/dn_fib.h
new file mode 100644
index 000000000..22d227278
--- /dev/null
+++ b/include/net/dn_fib.h
@@ -0,0 +1,83 @@
+#ifndef _NET_DN_FIB_H
+#define _NET_DN_FIB_H
+
+#ifdef CONFIG_DECNET_ROUTER
+
+
+struct dn_fib_res {
+ dn_address res_addr;
+ dn_address res_mask;
+ int res_ifindex;
+ int res_proto;
+ int res_cost;
+ int res_type;
+ struct dn_fib_node *res_fn;
+ struct dn_fib_action *res_fa;
+};
+
+struct dn_fib_action {
+ struct dn_fib_action *fa_next;
+ dn_address fa_key;
+ dn_address fa_mask;
+ int fa_ifindex;
+ int fa_proto;
+ int fa_cost;
+ int fa_type;
+ union {
+ struct neighbour *fau_neigh; /* Normal route */
+ int fau_error; /* Reject */
+ int fau_table; /* Throw */
+ } fa_u;
+#define fa_neigh fa_u.fau_neigh
+#define fa_error fa_u.fau_error
+#define fa_table fa_u.fau_table
+};
+
+struct dn_fib_node {
+ struct dn_fib_node *fn_up;
+ dn_address fn_cmpmask;
+ dn_address fn_key;
+ int fn_shift;
+ struct dn_fib_action *fn_action;
+ struct dn_fib_node *fn_children[2];
+};
+
+#define DN_FIB_NEXT(fibnode, key) ((fibnode)->fn_children[((key) ^ (fibnode)->fn_cmpmask) >> (fibnode)->fn_shift])
+
+struct dn_fib_walker_t;
+
+struct dn_fib_table {
+ int n;
+ unsigned long count;
+ struct dn_fib_node *root;
+
+ int (*insert)(struct dn_fib_table *t, struct dn_fib_action *fa);
+ int (*delete)(struct dn_fib_table *t, struct dn_fib_action *fa);
+ int (*lookup)(struct dn_fib_table *t, struct dn_fib_res *res);
+ int (*walk)(struct dn_fib_walker_t *fwt);
+#ifdef CONFIG_RTNETLINK
+ int (*dump)(struct dn_fib_table *t, struct sk_buff *skb, struct netlink_callback *cb);
+#endif /* CONFIG_RTNETLINK */
+};
+
+struct dn_fib_walker_t {
+ struct dn_fib_table *table;
+ void *arg;
+ int (*fxn)(struct dn_fib_walker_t *fwt, struct dn_fib_node *n);
+};
+
+extern void dn_fib_init(void);
+extern void dn_fib_cleanup(void);
+
+extern int dn_fib_rt_message(struct sk_buff *skb);
+extern int dn_fib_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
+
+#ifdef CONFIG_RTNETLINK
+extern int dn_fib_rtm_delroute(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg);
+extern int dn_fib_rtm_newroute(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg);
+extern int dn_fib_dump(struct sk_buff *skb, struct netlink_callback *cb);
+extern int dn_fib_rtm_getroute(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg);
+#endif /* CONFIG_RTNETLINK */
+#endif /* CONFIG_DECNET_ROUTER */
+
+#endif /* _NET_DN_FIB_H */
diff --git a/include/net/dn_neigh.h b/include/net/dn_neigh.h
new file mode 100644
index 000000000..b4e7ed1d8
--- /dev/null
+++ b/include/net/dn_neigh.h
@@ -0,0 +1,29 @@
+#ifndef _NET_DN_NEIGH_H
+#define _NET_DN_NEIGH_H
+
+/*
+ * The position of the first two fields of
+ * this structure are critical - SJW
+ */
+struct dn_neigh {
+ struct neighbour n;
+ unsigned char addr[ETH_ALEN];
+ unsigned long flags;
+#define DN_NDFLAG_R1 0x0001 /* Router L1 */
+#define DN_NDFLAG_R2 0x0002 /* Router L2 */
+#define DN_NDFLAG_P3 0x0004 /* Phase III Node */
+ unsigned long blksize;
+ unsigned char priority;
+};
+
+extern void dn_neigh_init(void);
+extern void dn_neigh_cleanup(void);
+extern struct neighbour *dn_neigh_lookup(struct neigh_table *tbl, void *ptr);
+extern void dn_neigh_router_hello(struct sk_buff *skb);
+extern void dn_neigh_endnode_hello(struct sk_buff *skb);
+extern void dn_neigh_pointopoint_hello(struct sk_buff *skb);
+extern int dn_neigh_elist(struct device *dev, unsigned char *ptr, int n);
+
+extern struct neigh_table dn_neigh_table;
+
+#endif /* _NET_DN_NEIGH_H */
diff --git a/include/net/dn_nsp.h b/include/net/dn_nsp.h
new file mode 100644
index 000000000..d8cef8c06
--- /dev/null
+++ b/include/net/dn_nsp.h
@@ -0,0 +1,194 @@
+#ifndef _NET_DN_NSP_H
+#define _NET_DN_NSP_H
+/******************************************************************************
+ (c) 1995-1998 E.M. Serrat emserrat@geocities.com
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+*******************************************************************************/
+/* dn_nsp.c functions prototyping */
+
+extern void dn_nsp_send_data_ack(struct sock *sk);
+extern void dn_nsp_send_oth_ack(struct sock *sk);
+extern void dn_nsp_delayed_ack(struct sock *sk);
+extern void dn_send_conn_ack(struct sock *sk);
+extern void dn_send_conn_conf(struct sock *sk);
+extern void dn_send_disc(struct sock *sk, unsigned char type, unsigned short reason);
+extern void dn_nsp_send_lnk(struct sock *sk, unsigned short flags);
+extern void dn_nsp_send_conninit(struct sock *sk, unsigned char flags);
+
+extern void dn_nsp_output(struct sock *sk);
+extern int dn_nsp_check_xmit_queue(struct sock *sk, struct sk_buff *skb, struct sk_buff_head *q, unsigned short acknum);
+extern void dn_nsp_queue_xmit(struct sock *sk, struct sk_buff *skb, int oob);
+extern unsigned long dn_nsp_persist(struct sock *sk);
+extern int dn_nsp_xmit_timeout(struct sock *sk);
+
+extern int dn_nsp_rx(struct sk_buff *);
+extern int dn_nsp_backlog_rcv(struct sock *sk, struct sk_buff *skb);
+
+extern struct sk_buff *dn_alloc_skb(struct sock *sk, int size, int pri);
+extern struct sk_buff *dn_alloc_send_skb(struct sock *sk, int *size, int noblock, int *err);
+
+#define NSP_REASON_NR 1
+#define NSP_REASON_DC 42
+#define NSP_REASON_NL 41
+
+#define NSP_DISCINIT 0x38
+#define NSP_DISCCONF 0x48
+
+/*------------------------- NSP - messages ------------------------------*/
+/* Data Messages */
+/*---------------*/
+
+/* Data Messages (data segment/interrupt/link service) */
+
+ struct nsp_data_seg_msg
+ {
+ unsigned char msgflg __attribute__((packed));
+ unsigned short dstaddr __attribute__((packed));
+ unsigned short srcaddr __attribute__((packed));
+ };
+
+ struct nsp_data_opt_msg
+ {
+ unsigned short acknum __attribute__((packed));
+ unsigned short segnum __attribute__((packed));
+ unsigned short lsflgs __attribute__((packed));
+ };
+
+ struct nsp_data_opt_msg1
+ {
+ unsigned short acknum __attribute__((packed));
+ unsigned short segnum __attribute__((packed));
+ };
+
+/* Acknowledgment Messages */
+/*-------------------------*/
+
+/* Acknowledgment Messages (data/other data) */
+
+ struct nsp_data_ack_msg
+ {
+ unsigned char msgflg __attribute__((packed));
+ unsigned short dstaddr __attribute__((packed));
+ unsigned short srcaddr __attribute__((packed));
+ unsigned short acknum __attribute__((packed));
+ };
+
+/* Connect Acknowledgment Message */
+
+ struct nsp_conn_ack_msg
+ {
+ unsigned char msgflg __attribute__((packed));
+ unsigned short dstaddr __attribute__((packed));
+ };
+
+/* Control Messages */
+/*------------------*/
+
+/* Connect Initiate/Retransmit Initiate/Connect Confirm */
+
+ struct nsp_conn_init_msg
+ {
+ unsigned char msgflg __attribute__((packed));
+#define NSP_CI 0x18 /* Connect Initiate */
+#define NSP_RCI 0x68 /* Retrans. Conn Init */
+ unsigned short dstaddr __attribute__((packed));
+ unsigned short srcaddr __attribute__((packed));
+ unsigned char services __attribute__((packed));
+#define NSP_FC_NONE 0x00 /* Flow Control None */
+#define NSP_FC_SRC 0x04 /* Seg Req. Count */
+#define NSP_FC_SCMC 0x08 /* Sess. Control Mess */
+ unsigned char info __attribute__((packed));
+ unsigned short segsize __attribute__((packed));
+ };
+
+/* Disconnect Initiate/Disconnect Confirm */
+
+ struct nsp_disconn_init_msg
+ {
+ unsigned char msgflg __attribute__((packed));
+ unsigned short dstaddr __attribute__((packed));
+ unsigned short srcaddr __attribute__((packed));
+ unsigned short reason __attribute__((packed));
+ };
+
+
+/*------------------------- SCP - messages ------------------------------*/
+
+ struct srcobj_fmt
+ {
+ char format __attribute__((packed));
+ unsigned char task __attribute__((packed));
+ unsigned short grpcode __attribute__((packed));
+ unsigned short usrcode __attribute__((packed));
+ char dlen __attribute__((packed));
+ };
+
+/*
+ * A collection of functions for manipulating the sequence
+ * numbers used in NSP. Similar in operation to the functions
+ * of the same name in TCP.
+ */
+static __inline__ int before(unsigned short seq1, unsigned short seq2)
+{
+ seq1 &= 0x0fff;
+ seq2 &= 0x0fff;
+
+ return (int)((seq1 - seq2) & 0x0fff) > 2048;
+}
+
+
+static __inline__ int after(unsigned short seq1, unsigned short seq2)
+{
+ seq1 &= 0x0fff;
+ seq2 &= 0x0fff;
+
+ return (int)((seq2 - seq1) & 0x0fff) > 2048;
+}
+
+static __inline__ int equal(unsigned short seq1, unsigned short seq2)
+{
+ return ((seq1 ^ seq2) & 0x0fff) == 0;
+}
+
+static __inline__ int before_or_equal(unsigned short seq1, unsigned short seq2)
+{
+ return (before(seq1, seq2) || equal(seq1, seq2));
+}
+
+static __inline__ void seq_add(unsigned short *seq, unsigned short off)
+{
+ *seq += off;
+ *seq &= 0x0fff;
+}
+
+static __inline__ int seq_next(unsigned short seq1, unsigned short seq2)
+{
+ return (((seq2&0x0fff) - (seq1&0x0fff)) == 1);
+}
+
+/*
+ * Can we delay the ack ?
+ */
+static __inline__ int sendack(unsigned short seq)
+{
+ return (int)((seq & 0x1000) ? 0 : 1);
+}
+
+/*
+ * Is socket congested ?
+ */
+static __inline__ int dn_congested(struct sock *sk)
+{
+ return atomic_read(&sk->rmem_alloc) > (sk->rcvbuf >> 1);
+}
+
+#endif /* _NET_DN_NSP_H */
diff --git a/include/net/dn_raw.h b/include/net/dn_raw.h
new file mode 100644
index 000000000..a4502d29c
--- /dev/null
+++ b/include/net/dn_raw.h
@@ -0,0 +1,17 @@
+#ifndef _NET_DN_RAW_H
+#define _NET_DN_RAW_H
+
+#ifdef CONFIG_DECNET_RAW
+
+extern struct proto_ops dn_raw_proto_ops;
+
+extern void dn_raw_rx_nsp(struct sk_buff *skb);
+extern void dn_raw_rx_routing(struct sk_buff *skb);
+
+#ifdef CONFIG_DECNET_MOP
+extern void dn_raw_rx_mop(struct sk_buff *skb);
+#endif /* CONFIG_DECNET_MOP */
+
+#endif /* CONFIG_DECNET_RAW */
+
+#endif /* _NET_DN_RAW_H */
diff --git a/include/net/dn_route.h b/include/net/dn_route.h
new file mode 100644
index 000000000..ecd1f313b
--- /dev/null
+++ b/include/net/dn_route.h
@@ -0,0 +1,74 @@
+#ifndef _NET_DN_ROUTE_H
+#define _NET_DN_ROUTE_H
+
+/******************************************************************************
+ (c) 1995-1998 E.M. Serrat emserrat@geocities.com
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+*******************************************************************************/
+/* dn_route.c functions prototyping */
+extern void dn_send_skb(struct sk_buff *);
+extern struct sk_buff *dn_alloc_skb(struct sock *sk, int size, int pri);
+extern int dn_route_output(struct sock *sk);
+
+/* Masks for flags field */
+#define DN_RT_F_PID 0x07 /* Mask for packet type */
+#define DN_RT_F_PF 0x80 /* Padding Follows */
+#define DN_RT_F_VER 0x40 /* Version =0 discard packet if ==1 */
+#define DN_RT_F_IE 0x20 /* Intra Ethernet, Reserved in short pkt */
+#define DN_RT_F_RTS 0x10 /* Packet is being returned to sender */
+#define DN_RT_F_RQR 0x08 /* Return packet to sender upon non-delivery */
+
+/* Mask for types of routing packets */
+#define DN_RT_PKT_MSK 0x06
+/* Types of routing packets */
+#define DN_RT_PKT_SHORT 0x02 /* Short routing packet */
+#define DN_RT_PKT_LONG 0x06 /* Long routing packet */
+
+/* Mask for control/routing selection */
+#define DN_RT_PKT_CNTL 0x01 /* Set to 1 if a control packet */
+/* Types of control packets */
+#define DN_RT_CNTL_MSK 0x0f /* Mask for control packets */
+#define DN_RT_PKT_INIT 0x01 /* Initialisation packet */
+#define DN_RT_PKT_VERI 0x03 /* Verification Message */
+#define DN_RT_PKT_HELO 0x05 /* Hello and Test Message */
+#define DN_RT_PKT_L1RT 0x07 /* Level 1 Routing Message */
+#define DN_RT_PKT_L2RT 0x09 /* Level 2 Routing Message */
+#define DN_RT_PKT_ERTH 0x0b /* Ethernet Router Hello */
+#define DN_RT_PKT_EEDH 0x0d /* Ethernet EndNode Hello */
+
+/* Values for info field in hello message */
+#define DN_RT_INFO_TYPE 0x03 /* Type mask */
+#define DN_RT_INFO_L1RT 0x02 /* L1 Router */
+#define DN_RT_INFO_L2RT 0x01 /* L2 Router */
+#define DN_RT_INFO_ENDN 0x03 /* EndNode */
+#define DN_RT_INFO_VERI 0x04 /* Verification Reqd. */
+#define DN_RT_INFO_RJCT 0x08 /* Reject Flag, Reserved */
+#define DN_RT_INFO_VFLD 0x10 /* Verification Failed, Reserved */
+#define DN_RT_INFO_NOML 0x20 /* No Multicast traffic accepted */
+#define DN_RT_INFO_BLKR 0x40 /* Blocking Requested */
+
+
+struct dn_route {
+ union {
+ struct dst_entry dst;
+ struct dn_route *rt_next;
+ } u;
+ unsigned short rt_saddr;
+ unsigned short rt_daddr;
+ int rt_iif;
+ int rt_oif;
+};
+
+extern void dn_route_init(void);
+extern void dn_route_cleanup(void);
+
+#endif /* _NET_DN_ROUTE_H */
diff --git a/include/net/irda/smc-ircc.h b/include/net/irda/smc-ircc.h
new file mode 100644
index 000000000..2c5cbf4fd
--- /dev/null
+++ b/include/net/irda/smc-ircc.h
@@ -0,0 +1,160 @@
+/*********************************************************************
+ *
+ * Filename: smc.h
+ * Version:
+ * Description:
+ * Status: Experimental.
+ * Author: Thomas Davis (tadavis@jps.net)
+ *
+ * Copyright (c) 1998, 1999 Thomas Davis (tadavis@jps.net>
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * I, Thomas Davis, admit no liability nor provide warranty for any
+ * of this software. This material is provided "AS-IS" and at no charge.
+ *
+ * Definitions for the SMC IrCC controller.
+ *
+ ********************************************************************/
+
+#ifndef SMC_IRCC_H
+#define SMC_IRCC_H
+
+#define UART_MASTER 0x07
+#define UART_MASTER_POWERDOWN 1<<7
+#define UART_MASTER_RESET 1<<6
+#define UART_MASTER_INT_EN 1<<5
+#define UART_MASTER_ERROR_RESET 1<<4
+
+/* Register block 0 */
+
+#define UART_IIR 0x01
+#define UART_IER 0x02
+#define UART_LSR 0x03
+#define UART_LCR_A 0x04
+#define UART_LCR_B 0x05
+#define UART_BSR 0x06
+
+#define UART_IIR_ACTIVE_FRAME 1<<7
+#define UART_IIR_EOM 1<<6
+#define UART_IIR_RAW_MODE 1<<5
+#define UART_IIR_FIFO 1<<4
+
+#define UART_IER_ACTIVE_FRAME 1<<7
+#define UART_IER_EOM 1<<6
+#define UART_IER_RAW_MODE 1<<5
+#define UART_IER_FIFO 1<<4
+
+#define UART_LSR_UNDERRUN 1<<7
+#define UART_LSR_OVERRUN 1<<6
+#define UART_LSR_FRAME_ERROR 1<<5
+#define UART_LSR_SIZE_ERROR 1<<4
+#define UART_LSR_CRC_ERROR 1<<3
+#define UART_LSR_FRAME_ABORT 1<<2
+
+#define UART_LCR_A_FIFO_RESET 1<<7
+#define UART_LCR_A_FAST 1<<6
+#define UART_LCR_A_GP_DATA 1<<5
+#define UART_LCR_A_RAW_TX 1<<4
+#define UART_LCR_A_RAW_RX 1<<3
+#define UART_LCR_A_ABORT 1<<2
+#define UART_LCR_A_DATA_DONE 1<<1
+
+#define UART_LCR_B_SCE_DISABLED 0x00<<6
+#define UART_LCR_B_SCE_TRANSMIT 0x01<<6
+#define UART_LCR_B_SCE_RECEIVE 0x02<<6
+#define UART_LCR_B_SCE_UNDEFINED 0x03<<6
+#define UART_LCR_B_SIP_ENABLE 1<<5
+#define UART_LCR_B_BRICK_WALL 1<<4
+
+#define UART_BSR_NOT_EMPTY 1<<7
+#define UART_BSR_FIFO_FULL 1<<6
+#define UART_BSR_TIMEOUT 1<<5
+
+/* Register block 1 */
+
+#define UART_SCE_CFGA 0x00
+#define UART_SCE_CFGB 0x01
+#define UART_FIFO_THRESHOLD 0x02
+
+#define UART_CFGA_AUX_IR 0x01<<7
+#define UART_CFGA_HALF_DUPLEX 0x01<<2
+#define UART_CFGA_TX_POLARITY 0x01<<1
+#define UART_CFGA_RX_POLARITY 0x01
+
+#define UART_CFGA_COM 0x00<<3
+#define UART_CFGA_IRDA_SIR_A 0x01<<3
+#define UART_CFGA_ASK_SIR 0x02<<3
+#define UART_CFGA_IRDA_SIR_B 0x03<<3
+#define UART_CFGA_IRDA_HDLC 0x04<<3
+#define UART_CFGA_IRDA_4PPM 0x05<<3
+#define UART_CFGA_CONSUMER 0x06<<3
+#define UART_CFGA_RAW_IR 0x07<<3
+#define UART_CFGA_OTHER 0x08<<3
+
+#define UART_IR_HDLC 0x04
+#define UART_IR_4PPM 0x01
+#define UART_IR_CONSUMER 0x02
+
+#define UART_CFGB_LOOPBACK 0x01<<5
+#define UART_CFGB_LPBCK_TX_CRC 0x01<<4
+#define UART_CFGB_NOWAIT 0x01<<3
+#define UART_CFGB_STRING_MOVE 0x01<<2
+#define UART_CFGB_DMA_BURST 0x01<<1
+#define UART_CFGB_DMA_ENABLE 0x01
+
+#define UART_CFGB_COM 0x00<<6
+#define UART_CFGB_IR 0x01<<6
+#define UART_CFGB_AUX 0x02<<6
+#define UART_CFGB_INACTIVE 0x03<<6
+
+/* Register block 2 - Consumer IR - not used */
+
+/* Register block 3 - Identification Registers! */
+
+#define UART_ID_HIGH 0x00 /* 0x10 */
+#define UART_ID_LOW 0x01 /* 0xB8 */
+#define UART_CHIP_ID 0x02 /* 0xF1 */
+#define UART_VERSION 0x03 /* 0x01 */
+#define UART_INTERFACE 0x04 /* low 4 = DMA, high 4 = IRQ */
+
+/* Register block 4 - IrDA */
+#define UART_CONTROL 0x00
+#define UART_BOF_COUNT_LO 0x01
+#define UART_BRICKWALL_CNT_LO 0x02
+#define UART_BRICKWALL_TX_CNT_HI 0x03
+#define UART_TX_SIZE_LO 0x04
+#define UART_RX_SIZE_HI 0x05
+#define UART_RX_SIZE_LO 0x06
+
+#define UART_1152 0x01<<7
+#define UART_CRC 0x01<<6
+
+/* For storing entries in the status FIFO */
+struct st_fifo_entry {
+ int status;
+ int len;
+};
+
+struct st_fifo {
+ struct st_fifo_entry entries[10];
+ int head;
+ int tail;
+ int len;
+};
+
+/* Private data for each instance */
+struct ircc_cb {
+ struct st_fifo st_fifo;
+
+ int tx_buff_offsets[10]; /* Offsets between frames in tx_buff */
+ int tx_len; /* Number of frames in tx_buff */
+
+ struct irda_device idev;
+};
+
+#endif
diff --git a/include/net/irda/toshoboe.h b/include/net/irda/toshoboe.h
new file mode 100644
index 000000000..b2f5b953b
--- /dev/null
+++ b/include/net/irda/toshoboe.h
@@ -0,0 +1,165 @@
+/*********************************************************************
+ *
+ * Filename: toshoboe.h
+ * Version: 0.1
+ * Description: Driver for the Toshiba OBOE (or type-O)
+ * FIR Chipset.
+ * Status: Experimental.
+ * Author: James McKenzie <james@fishsoup.dhs.org>
+ * Created at: Sat May 8 12:35:27 1999
+ *
+ * Copyright (c) 1999 James McKenzie, All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * Neither James McKenzie nor Cambridge University admit liability nor
+ * provide warranty for any of this software. This material is
+ * provided "AS-IS" and at no charge.
+ *
+ * Applicable Models : Libretto 100CT. and many more
+ *
+ ********************************************************************/
+
+/*
+ * $Log: toshoboe.h,v $
+ * Revision 1.2 1999/05/09 01:43:08 root
+ * *** empty log message ***
+ *
+ * Revision 1.1 1999/05/09 01:25:58 root
+ * Initial revision
+ *
+ */
+
+#ifndef TOSHOBOE_H
+#define TOSHOBOE_H
+
+/* Registers */
+/*Receive and transmit task registers (read only) */
+#define OBOE_RCVT (0x00+(self->base))
+#define OBOE_XMTT (0x01+(self->base))
+#define OBOE_XMTT_OFFSET 0x40
+
+/*Page pointers to the TaskFile structure */
+#define OBOE_TFP2 (0x02+(self->base))
+#define OBOE_TFP0 (0x04+(self->base))
+#define OBOE_TFP1 (0x05+(self->base))
+
+/*Dunno */
+#define OBOE_REG_3 (0x03+(self->base))
+
+/*Number of tasks to use in Xmit and Recv queues */
+#define OBOE_NTR (0x07+(self->base))
+#define OBOE_NTR_XMIT4 0x00
+#define OBOE_NTR_XMIT8 0x10
+#define OBOE_NTR_XMIT16 0x30
+#define OBOE_NTR_XMIT32 0x70
+#define OBOE_NTR_XMIT64 0xf0
+#define OBOE_NTR_RECV4 0x00
+#define OBOE_NTR_RECV8 0x01
+#define OBOE_NTR_RECV6 0x03
+#define OBOE_NTR_RECV32 0x07
+#define OBOE_NTR_RECV64 0x0f
+
+/* Dunno */
+#define OBOE_REG_9 (0x09+(self->base))
+
+/* Interrupt Status Register */
+#define OBOE_ISR (0x0c+(self->base))
+#define OBOE_ISR_TXDONE 0x80
+#define OBOE_ISR_RXDONE 0x40
+#define OBOE_ISR_20 0x20
+#define OBOE_ISR_10 0x10
+#define OBOE_ISR_8 0x08 /*This is collision or parity or something */
+#define OBOE_ISR_4 0x08
+#define OBOE_ISR_2 0x08
+#define OBOE_ISR_1 0x08
+
+/*Dunno */
+#define OBOE_REG_D (0x0d+(self->base))
+
+/*Register Lock Register */
+#define OBOE_LOCK ((self->base)+0x0e)
+
+
+
+/*Speed control registers */
+#define OBOE_PMDL (0x10+(self->base))
+#define OBOE_PMDL_SIR 0x18
+#define OBOE_PMDL_MIR 0xa0
+#define OBOE_PMDL_FIR 0x40
+
+#define OBOE_SMDL (0x18+(self->base))
+#define OBOE_SMDL_SIR 0x20
+#define OBOE_SMDL_MIR 0x01
+#define OBOE_SMDL_FIR 0x0f
+
+#define OBOE_UDIV (0x19+(self->base))
+
+/*Dunno */
+#define OBOE_REG_11 (0x11+(self->base))
+
+/*Chip Reset Register */
+#define OBOE_RST (0x15+(self->base))
+#define OBOE_RST_WRAP 0x8
+
+/*Dunno */
+#define OBOE_REG_1A (0x1a+(self->base))
+#define OBOE_REG_1B (0x1b+(self->base))
+
+/* The PCI ID of the OBOE chip */
+#ifndef PCI_DEVICE_ID_FIR701
+#define PCI_DEVICE_ID_FIR701 0x0701
+#endif
+
+typedef unsigned int dword;
+typedef unsigned short int word;
+typedef unsigned char byte;
+typedef dword Paddr;
+
+struct OboeTask
+ {
+ __u16 len;
+ __u8 unused;
+ __u8 control;
+ __u32 buffer;
+ };
+
+#define OBOE_NTASKS 64
+
+struct OboeTaskFile
+ {
+ struct OboeTask recv[OBOE_NTASKS];
+ struct OboeTask xmit[OBOE_NTASKS];
+ };
+
+#define OBOE_TASK_BUF_LEN (sizeof(struct OboeTaskFile) << 1)
+
+/*These set the number of slots in use */
+#define TX_SLOTS 4
+#define RX_SLOTS 4
+
+/* You need also to change this, toshiba uses 4,8 and 4,4 */
+/* It makes no difference if you are only going to use ONETASK mode */
+/* remember each buffer use XX_BUF_SZ more _PHYSICAL_ memory */
+#define OBOE_NTR_VAL (OBOE_NTR_XMIT4 | OBOE_NTR_RECV4)
+
+struct toshoboe_cb
+ {
+ struct irda_device idev; /*IRDA device */
+ struct pci_dev *pdev; /*PCI device */
+ int base; /*IO base */
+ int txpending; /*how many tx's are pending */
+ int txs, rxs; /*Which slots are we at */
+ void *taskfilebuf; /*The unaligned taskfile buffer */
+ struct OboeTaskFile *taskfile; /*The taskfile */
+ void *xmit_bufs[TX_SLOTS]; /*The buffers */
+ void *recv_bufs[RX_SLOTS];
+ };
+
+
+#endif
+
+