summaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-02-05 06:47:02 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-02-05 06:47:02 +0000
commit99a7e12f34b3661a0d1354eef83a0eef4df5e34c (patch)
tree3560aca9ca86792f9ab7bd87861ea143a1b3c7a3 /include/net
parente73a04659c0b8cdee4dd40e58630e2cf63afb316 (diff)
Merge with Linux 2.3.38.
Diffstat (limited to 'include/net')
-rw-r--r--include/net/br.h36
-rw-r--r--include/net/checksum.h18
-rw-r--r--include/net/dsfield.h79
-rw-r--r--include/net/inetpeer.h66
-rw-r--r--include/net/ip.h11
-rw-r--r--include/net/irda/ircomm_core.h7
-rw-r--r--include/net/irda/ircomm_tty.h26
-rw-r--r--include/net/irda/ircomm_tty_attach.h7
-rw-r--r--include/net/irda/irda.h18
-rw-r--r--include/net/irda/irda_device.h40
-rw-r--r--include/net/irda/iriap.h7
-rw-r--r--include/net/irda/irias_object.h3
-rw-r--r--include/net/irda/irlap.h42
-rw-r--r--include/net/irda/irlap_event.h13
-rw-r--r--include/net/irda/irlap_frame.h17
-rw-r--r--include/net/irda/irlmp.h48
-rw-r--r--include/net/irda/irlmp_frame.h14
-rw-r--r--include/net/irda/irport.h28
-rw-r--r--include/net/irda/irttp.h12
-rw-r--r--include/net/irda/irtty.h3
-rw-r--r--include/net/irda/nsc_fir.h (renamed from include/net/irda/pc87108.h)63
-rw-r--r--include/net/irda/parameters.h7
-rw-r--r--include/net/irda/qos.h14
-rw-r--r--include/net/irda/smc-ircc.h243
-rw-r--r--include/net/irda/w83977af.h33
-rw-r--r--include/net/irda/wrapper.h2
-rw-r--r--include/net/route.h16
27 files changed, 591 insertions, 282 deletions
diff --git a/include/net/br.h b/include/net/br.h
index 14203c061..bfa25b645 100644
--- a/include/net/br.h
+++ b/include/net/br.h
@@ -1,3 +1,4 @@
+#include <linux/config.h>
/*
* Constants and structure definitions for the bridging code
*/
@@ -19,7 +20,16 @@
#define Forwarding 3 /* (4 4 4) */
#define Blocking 4 /* (4.4.1) */
-#define No_of_ports 8
+
+/* MAG Yich! Easiest way of giving a configurable number of ports
+ * If you want more than 32, change BR_MAX_PORTS and recompile brcfg!
+ */
+#define BR_MAX_PORTS (32)
+#if CONFIG_BRIDGE_NUM_PORTS > BR_MAX_PORTS
+#undef CONFIG_BRIDGE_NUM_PORTS
+#define CONFIG_BRIDGE_NUM_PORTS BR_MAX_PORTS
+#endif
+#define No_of_ports CONFIG_BRIDGE_NUM_PORTS
/* arbitrary choice, to allow the code below to compile */
#define All_ports (No_of_ports + 1)
@@ -147,6 +157,7 @@ typedef struct {
unsigned int top_change; /* (4.5.3.12) */
unsigned short topology_change_time; /* (4.5.3.13) */
unsigned short hold_time; /* (4.5.3.14) */
+ unsigned int instance;
} Bridge_data;
/** Port Parameters (4.5.5) **/
@@ -160,7 +171,9 @@ typedef struct {
unsigned short designated_port; /* (4.5.5.7) */
unsigned int top_change_ack; /* (4.5.5.8) */
unsigned int config_pending; /* (4.5.5.9) */
- struct net_device *dev;
+ bridge_id_t ifmac;
+ char ifname[IFNAMSIZ]; /* Make life easier for brcfg */
+ struct net_device *dev;
struct fdb *fdb; /* head of per port fdb chain */
} Port_data;
@@ -245,13 +258,14 @@ typedef struct {
struct br_stat {
unsigned int flags;
Bridge_data bridge_data;
- Port_data port_data[No_of_ports];
unsigned int policy;
unsigned int exempt_protocols;
unsigned short protocols[BR_MAX_PROTOCOLS];
unsigned short prot_id[BR_MAX_PROT_STATS]; /* Protocol encountered */
unsigned int prot_counter[BR_MAX_PROT_STATS]; /* How many packets ? */
br_stats_counter packet_cnts;
+ unsigned int num_ports;
+ Port_data port_data[BR_MAX_PORTS + 1];
};
/* defined flags for br_stat.flags */
@@ -274,7 +288,7 @@ struct br_cf {
#define BRCMD_SET_BRIDGE_PRIORITY 5 /* arg1 = priority */
#define BRCMD_SET_PORT_PRIORITY 6 /* arg1 = port, arg2 = priority */
#define BRCMD_SET_PATH_COST 7 /* arg1 = port, arg2 = cost */
-#define BRCMD_DISPLAY_FDB 8 /* arg1 = port */
+#define BRCMD_DISPLAY_FDB 8
#define BRCMD_ENABLE_DEBUG 9
#define BRCMD_DISABLE_DEBUG 10
#define BRCMD_SET_POLICY 11 /* arg1 = default policy (1==bridge all) */
@@ -283,22 +297,34 @@ struct br_cf {
#define BRCMD_DISABLE_PROT_STATS 14
#define BRCMD_ZERO_PROT_STATS 15
#define BRCMD_TOGGLE_STP 16
+#define BRCMD_IF_ENABLE 17 /* arg1 = if_index */
+#define BRCMD_IF_DISABLE 18 /* arg1 = if_index */
+#define BRCMD_SET_IF_PRIORITY 19 /* arg1 = if_index, arg2 = priority */
+#define BRCMD_SET_IF_PATH_COST 20 /* arg1 = if_index, arg2 = cost */
/* prototypes of exported bridging functions... */
+#ifdef __KERNEL__
void br_init(void);
int br_receive_frame(struct sk_buff *skb); /* 3.5 */
int br_tx_frame(struct sk_buff *skb);
+int brg_init(void);
int br_ioctl(unsigned int cmd, void *arg);
-int br_protocol_ok(unsigned short protocol);
void requeue_fdb(struct fdb *node, int new_port);
struct fdb *br_avl_find_addr(unsigned char addr[6]);
struct fdb *br_avl_insert (struct fdb * new_node);
void sprintf_avl (char **pbuffer, struct fdb * tree, off_t *pos,int* len, off_t offset, int length);
void br_avl_delete_by_port(int port);
+int br_call_bridge(struct sk_buff *skb, unsigned short type);
+void br_spacedevice_register(void);
+
/* externs */
extern struct br_stat br_stats;
extern Port_data port_info[];
+#endif
+
+
+
diff --git a/include/net/checksum.h b/include/net/checksum.h
index 041d47608..de3286944 100644
--- a/include/net/checksum.h
+++ b/include/net/checksum.h
@@ -107,4 +107,22 @@ unsigned int csum_and_copy_from_user (const char *src, char *dst,
}
#endif
+#ifndef HAVE_CSUM_COPY_USER
+static __inline__ unsigned int csum_and_copy_to_user
+(const char *src, char *dst, int len, unsigned int sum, int *err_ptr)
+{
+ sum = csum_partial(src, len, sum);
+
+ if (access_ok(VERIFY_WRITE, dst, len)) {
+ if (copy_to_user(dst, src, len) == 0)
+ return sum;
+ }
+ if (len)
+ *err_ptr = -EFAULT;
+
+ return -1; /* invalid checksum */
+}
+#endif
+
+
#endif
diff --git a/include/net/dsfield.h b/include/net/dsfield.h
new file mode 100644
index 000000000..2201a88d9
--- /dev/null
+++ b/include/net/dsfield.h
@@ -0,0 +1,79 @@
+/* include/net/dsfield.h - Manipulation of the Differentiated Services field */
+
+/* Written 1998 by Werner Almesberger, EPFL ICA */
+
+
+#ifndef __NET_DSFIELD_H
+#define __NET_DSFIELD_H
+
+#include <linux/types.h>
+#include <linux/ip.h>
+#include <linux/ipv6.h>
+#include <asm/byteorder.h>
+
+
+extern __inline__ __u8 ipv4_get_dsfield(struct iphdr *iph)
+{
+ return iph->tos;
+}
+
+
+extern __inline__ __u8 ipv6_get_dsfield(struct ipv6hdr *ipv6h)
+{
+ return ntohs(*(__u16 *) ipv6h) >> 4;
+}
+
+
+extern __inline__ void ipv4_change_dsfield(struct iphdr *iph,__u8 mask,
+ __u8 value)
+{
+ __u32 check = ntohs(iph->check);
+ __u8 dsfield;
+
+ dsfield = (iph->tos & mask) | value;
+ check += iph->tos;
+ if ((check+1) >> 16) check = (check+1) & 0xffff;
+ check -= dsfield;
+ check += check >> 16; /* adjust carry */
+ iph->check = htons(check);
+ iph->tos = dsfield;
+}
+
+
+extern __inline__ void ipv6_change_dsfield(struct ipv6hdr *ipv6h,__u8 mask,
+ __u8 value)
+{
+ __u16 tmp;
+
+ tmp = ntohs(*(__u16 *) ipv6h);
+ tmp = (tmp & (mask << 4)) | (value << 4);
+ *(__u16 *) ipv6h = htons(tmp);
+}
+
+
+#if 0 /* put this later into asm-i386 or such ... */
+
+extern __inline__ void ip_change_dsfield(struct iphdr *iph,__u16 dsfield)
+{
+ __u16 check;
+
+ __asm__ __volatile__("
+ movw 10(%1),%0
+ xchg %b0,%h0
+ addb 1(%1),%b0
+ adcb $0,%h0
+ adcw $1,%0
+ cmc
+ sbbw %2,%0
+ sbbw $0,%0
+ movb %b2,1(%1)
+ xchg %b0,%h0
+ movw %0,10(%1)"
+ : "=&r" (check)
+ : "r" (iph), "r" (dsfield)
+ : "cc");
+}
+
+#endif
+
+#endif
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h
new file mode 100644
index 000000000..3b69aed93
--- /dev/null
+++ b/include/net/inetpeer.h
@@ -0,0 +1,66 @@
+/*
+ * INETPEER - A storage for permanent information about peers
+ *
+ * Version: $Id: inetpeer.h,v 1.1 2000/01/06 00:41:51 davem Exp $
+ *
+ * Authors: Andrey V. Savochkin <saw@msu.ru>
+ */
+
+#ifndef _NET_INETPEER_H
+#define _NET_INETPEER_H
+
+#include <linux/types.h>
+#include <linux/init.h>
+#include <linux/sched.h>
+#include <linux/spinlock.h>
+#include <asm/atomic.h>
+
+struct inet_peer
+{
+ struct inet_peer *avl_left, *avl_right;
+ struct inet_peer *unused_next, **unused_prevp;
+ atomic_t refcnt;
+ unsigned long dtime; /* the time of last use of not
+ * referenced entries */
+ __u32 v4daddr; /* peer's address */
+ __u16 avl_height;
+ __u16 ip_id_count; /* IP ID for the next packet */
+ __u32 tcp_ts;
+ unsigned long tcp_ts_stamp;
+};
+
+void inet_initpeers(void) __init;
+
+/* can be called with or without local BH being disabled */
+struct inet_peer *inet_getpeer(__u32 daddr, int create);
+
+extern spinlock_t inet_peer_unused_lock;
+extern struct inet_peer *inet_peer_unused_head;
+extern struct inet_peer **inet_peer_unused_tailp;
+/* can be called from BH context or outside */
+extern inline void inet_putpeer(struct inet_peer *p)
+{
+ spin_lock_bh(&inet_peer_unused_lock);
+ if (atomic_dec_and_test(&p->refcnt)) {
+ p->unused_prevp = inet_peer_unused_tailp;
+ p->unused_next = NULL;
+ *inet_peer_unused_tailp = p;
+ inet_peer_unused_tailp = &p->unused_next;
+ p->dtime = jiffies;
+ }
+ spin_unlock_bh(&inet_peer_unused_lock);
+}
+
+extern spinlock_t inet_peer_idlock;
+/* can be called with or without local BH being disabled */
+extern inline __u16 inet_getid(struct inet_peer *p)
+{
+ __u16 id;
+
+ spin_lock_bh(&inet_peer_idlock);
+ id = p->ip_id_count++;
+ spin_unlock_bh(&inet_peer_idlock);
+ return id;
+}
+
+#endif /* _NET_INETPEER_H */
diff --git a/include/net/ip.h b/include/net/ip.h
index 419078aba..078c958b2 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -96,7 +96,6 @@ extern int ip_mc_output(struct sk_buff *skb);
extern int ip_fragment(struct sk_buff *skb, int (*out)(struct sk_buff*));
extern int ip_do_nat(struct sk_buff *skb);
extern void ip_send_check(struct iphdr *ip);
-extern int ip_id_count;
extern int ip_queue_xmit(struct sk_buff *skb);
extern void ip_init(void);
extern int ip_build_xmit(struct sock *sk,
@@ -181,6 +180,16 @@ int ip_dont_fragment(struct sock *sk, struct dst_entry *dst)
!(dst->mxlock&(1<<RTAX_MTU))));
}
+extern void __ip_select_ident(struct iphdr *iph, struct dst_entry *dst);
+
+extern __inline__ void ip_select_ident(struct iphdr *iph, struct dst_entry *dst)
+{
+ if (iph->frag_off&__constant_htons(IP_DF))
+ iph->id = 0;
+ else
+ __ip_select_ident(iph, dst);
+}
+
/*
* Map a multicast IP onto multicast MAC for type ethernet.
*/
diff --git a/include/net/irda/ircomm_core.h b/include/net/irda/ircomm_core.h
index 3e674fe14..b555b37e2 100644
--- a/include/net/irda/ircomm_core.h
+++ b/include/net/irda/ircomm_core.h
@@ -6,7 +6,7 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Wed Jun 9 08:58:43 1999
- * Modified at: Tue Oct 5 09:13:50 1999
+ * Modified at: Mon Dec 13 11:52:29 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
* Copyright (c) 1999 Dag Brattli, All Rights Reserved.
@@ -102,9 +102,6 @@ void ircomm_disconnect_indication(struct ircomm_cb *self, struct sk_buff *skb,
struct ircomm_info *info);
void ircomm_flow_request(struct ircomm_cb *self, LOCAL_FLOW flow);
-extern inline int ircomm_is_connected(struct ircomm_cb *self)
-{
- return self->state == IRCOMM_CONN;
-}
+#define ircomm_is_connected(self) (self->state == IRCOMM_CONN)
#endif
diff --git a/include/net/irda/ircomm_tty.h b/include/net/irda/ircomm_tty.h
index 44b53bcd6..121e4e796 100644
--- a/include/net/irda/ircomm_tty.h
+++ b/include/net/irda/ircomm_tty.h
@@ -6,7 +6,7 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Sun Jun 6 23:24:22 1999
- * Modified at: Sun Oct 31 19:50:35 1999
+ * Modified at: Sun Dec 12 15:57:38 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
* Copyright (c) 1999 Dag Brattli, All Rights Reserved.
@@ -48,21 +48,23 @@
* IrCOMM TTY driver state
*/
struct ircomm_tty_cb {
- queue_t queue;
+ queue_t queue; /* Must be first */
magic_t magic;
- int state;
+ int state; /* Connect state */
struct tty_struct *tty;
- struct ircomm_cb *ircomm;
+ struct ircomm_cb *ircomm; /* IrCOMM layer instance */
- struct sk_buff *tx_skb;
- struct sk_buff *ctrl_skb;
+ struct sk_buff *tx_skb; /* Transmit buffer */
+ struct sk_buff *ctrl_skb; /* Control data buffer */
/* Parameters */
- struct ircomm_params session;
+ struct ircomm_params settings;
- __u8 service_type;
+ __u8 service_type; /* The service that we support */
+ int client; /* True if we are a client */
+ LOCAL_FLOW flow; /* IrTTP flow status */
int line;
__u32 flags;
@@ -73,11 +75,10 @@ struct ircomm_tty_cb {
__u32 saddr;
__u32 daddr;
- __u32 max_data_size;
- __u32 max_header_size;
-
- struct iriap_cb *iriap;
+ __u32 max_data_size; /* Max data we can transmit in one packet */
+ __u32 max_header_size; /* The amount of header space we must reserve */
+ struct iriap_cb *iriap; /* Instance used for querying remote IAS */
struct ias_object* obj;
int skey;
int ckey;
@@ -93,6 +94,7 @@ struct ircomm_tty_cb {
unsigned short close_delay;
unsigned short closing_wait; /* time to wait before closing */
+ long session; /* Session of opening process */
long pgrp; /* pgrp of opening process */
int open_count;
int blocked_open; /* # of blocked opens */
diff --git a/include/net/irda/ircomm_tty_attach.h b/include/net/irda/ircomm_tty_attach.h
index 545bf20a6..357bf080e 100644
--- a/include/net/irda/ircomm_tty_attach.h
+++ b/include/net/irda/ircomm_tty_attach.h
@@ -6,7 +6,7 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Wed Jun 9 15:55:18 1999
- * Modified at: Thu Sep 2 10:29:30 1999
+ * Modified at: Fri Dec 10 21:04:55 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
* Copyright (c) 1999 Dag Brattli, All Rights Reserved.
@@ -90,4 +90,7 @@ void ircomm_tty_connect_indication(void *instance, void *sap,
__u32 max_sdu_size,
__u8 max_header_size,
struct sk_buff *skb);
-#endif
+int ircomm_tty_send_initial_parameters(struct ircomm_tty_cb *self);
+void ircomm_tty_link_established(struct ircomm_tty_cb *self);
+
+#endif /* IRCOMM_TTY_ATTACH_H */
diff --git a/include/net/irda/irda.h b/include/net/irda/irda.h
index e3af20884..4222d5fa1 100644
--- a/include/net/irda/irda.h
+++ b/include/net/irda/irda.h
@@ -1,12 +1,12 @@
/*********************************************************************
*
* Filename: irda.h
- * Version:
+ * Version: 1.0
* Description: IrDA common include file for kernel internal use
- * Status: Experimental.
+ * Status: Stable
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Tue Dec 9 21:13:12 1997
- * Modified at: Sun Oct 31 14:45:20 1999
+ * Modified at: Sat Dec 25 18:58:49 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
* Copyright (c) 1998-1999 Dag Brattli, All Rights Reserved.
@@ -101,7 +101,7 @@ if(!(expr)) { \
#define IAS_ATTRIB_MAGIC 0x45232
#define IRDA_TASK_MAGIC 0x38423
-#define IAS_DEVICE_ID 0x5342
+#define IAS_DEVICE_ID 0x0000 /* Defined by IrDA, IrLMP section 4.1 (page 68) */
#define IAS_PNP_ID 0xd342
#define IAS_OBEX_ID 0x34323
#define IAS_IRLAN_ID 0x34234
@@ -116,6 +116,9 @@ struct irda_sock {
__u32 saddr; /* my local address */
__u32 daddr; /* peer address */
+ struct lsap_cb *lsap; /* LSAP used by Ultra */
+ __u8 pid; /* Protocol IP (PID) used by Ultra */
+
struct tsap_cb *tsap; /* TSAP used by this connection */
__u8 dtsap_sel; /* remote TSAP address */
__u8 stsap_sel; /* local TSAP address */
@@ -132,12 +135,13 @@ struct irda_sock {
__u32 ckey; /* IrLMP client handle */
__u32 skey; /* IrLMP service handle */
- struct ias_object *ias_obj;
- struct iriap_cb *iriap;
+ struct ias_object *ias_obj; /* Our service name + lsap in IAS */
+ struct iriap_cb *iriap; /* Used to query remote IAS */
+ struct ias_value *ias_result; /* Used by getsockopt(IRLMP_IAS_QUERY) */
int nslots; /* Number of slots to use for discovery */
- int errno;
+ int errno; /* status of the IAS query */
struct sock *sk;
wait_queue_head_t ias_wait; /* Wait for LM-IAS answer */
diff --git a/include/net/irda/irda_device.h b/include/net/irda/irda_device.h
index a16d928b3..04502f0e4 100644
--- a/include/net/irda/irda_device.h
+++ b/include/net/irda/irda_device.h
@@ -6,7 +6,7 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Tue Apr 14 12:41:42 1998
- * Modified at: Tue Nov 16 12:54:01 1999
+ * Modified at: Mon Dec 13 12:05:31 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
* Copyright (c) 1999 Dag Brattli, All Rights Reserved.
@@ -86,7 +86,6 @@ struct irda_task {
TASK_CALLBACK function;
TASK_CALLBACK finished;
- /* struct net_device *dev; */
struct irda_task *parent;
struct timer_list timer;
@@ -97,11 +96,11 @@ struct irda_task {
/* Dongle info */
struct dongle_reg;
typedef struct {
- struct dongle_reg *issue; /* Registration info */
- struct net_device *dev; /* Device we are attached to */
- __u32 speed; /* Current speed */
-
- int busy;
+ struct dongle_reg *issue; /* Registration info */
+ struct net_device *dev; /* Device we are attached to */
+ struct irda_task *speed_task; /* Task handling speed change */
+ struct irda_task *reset_task; /* Task handling reset */
+ __u32 speed; /* Current speed */
/* Callbacks to the IrDA device driver */
int (*set_mode)(struct net_device *, int mode);
@@ -112,7 +111,7 @@ typedef struct {
/* Dongle registration info */
struct dongle_reg {
- queue_t q; /* Must be first */
+ queue_t q; /* Must be first */
IRDA_DONGLE type;
void (*open)(dongle_t *dongle, struct qos_info *qos);
@@ -175,10 +174,11 @@ int irda_device_dongle_cleanup(dongle_t *dongle);
void setup_dma(int channel, char *buffer, int count, int mode);
+void irda_task_delete(struct irda_task *task);
int irda_task_kick(struct irda_task *task);
-int irda_task_execute(void *instance, TASK_CALLBACK function,
- TASK_CALLBACK finished, struct irda_task *parent,
- void *param);
+struct irda_task *irda_task_execute(void *instance, TASK_CALLBACK function,
+ TASK_CALLBACK finished,
+ struct irda_task *parent, void *param);
void irda_task_next_state(struct irda_task *task, TASK_STATE state);
extern const char *infrared_mode[];
@@ -189,6 +189,14 @@ extern const char *infrared_mode[];
* Utility function for getting the minimum turnaround time out of
* the skb, where it has been hidden in the cb field.
*/
+#define irda_get_mtt(skb) ( \
+ IRDA_MIN(10000, \
+ (((struct irda_skb_cb *) skb->cb)->magic == LAP_MAGIC) ? \
+ ((struct irda_skb_cb *)(skb->cb))->mtt : 10000 \
+ ) \
+)
+
+#if 0
extern inline __u16 irda_get_mtt(struct sk_buff *skb)
{
__u16 mtt;
@@ -202,6 +210,7 @@ extern inline __u16 irda_get_mtt(struct sk_buff *skb)
return mtt;
}
+#endif
/*
* Function irda_get_speed (skb)
@@ -209,6 +218,12 @@ extern inline __u16 irda_get_mtt(struct sk_buff *skb)
* Extact the speed this frame should be sent out with from the skb
*
*/
+#define irda_get_speed(skb) ( \
+ (((struct irda_skb_cb*) skb->cb)->magic == LAP_MAGIC) ? \
+ ((struct irda_skb_cb *)(skb->cb))->speed : 9600 \
+)
+
+#if 0
extern inline __u32 irda_get_speed(struct sk_buff *skb)
{
__u32 speed;
@@ -220,7 +235,8 @@ extern inline __u32 irda_get_speed(struct sk_buff *skb)
return speed;
}
-
#endif
+#endif /* IRDA_DEVICE_H */
+
diff --git a/include/net/irda/iriap.h b/include/net/irda/iriap.h
index dedd444bf..cd0dff5a9 100644
--- a/include/net/irda/iriap.h
+++ b/include/net/irda/iriap.h
@@ -6,7 +6,7 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Thu Aug 21 00:02:07 1997
- * Modified at: Sun Oct 31 15:51:32 1999
+ * Modified at: Sat Dec 25 16:42:09 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
* Copyright (c) 1997-1999 Dag Brattli <dagb@cs.uit.no>,
@@ -83,6 +83,7 @@ struct iriap_cb {
void *priv; /* Used to identify client */
__u8 max_header_size;
+ __u32 max_data_size;
struct timer_list watchdog_timer;
};
@@ -90,7 +91,7 @@ struct iriap_cb {
int iriap_init(void);
void iriap_cleanup(void);
-struct iriap_cb *iriap_open(__u8 slsap_sel, int mode, void *priv,
+struct iriap_cb *iriap_open(__u8 slsap_sel, int mode, void *priv,
CONFIRM_CALLBACK callback);
void iriap_close(struct iriap_cb *self);
@@ -98,7 +99,7 @@ int iriap_getvaluebyclass_request(struct iriap_cb *self,
__u32 saddr, __u32 daddr,
char *name, char *attr);
void iriap_getvaluebyclass_confirm(struct iriap_cb *self, struct sk_buff *skb);
-
+void iriap_connect_request(struct iriap_cb *self);
void iriap_send_ack( struct iriap_cb *self);
void iriap_call_indication(struct iriap_cb *self, struct sk_buff *skb);
diff --git a/include/net/irda/irias_object.h b/include/net/irda/irias_object.h
index 1b6f871e6..cfa8e28ed 100644
--- a/include/net/irda/irias_object.h
+++ b/include/net/irda/irias_object.h
@@ -6,7 +6,7 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Thu Oct 1 22:49:50 1998
- * Modified at: Tue Oct 5 10:45:21 1999
+ * Modified at: Wed Dec 15 11:20:57 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
* Copyright (c) 1998-1999 Dag Brattli, All Rights Reserved.
@@ -92,6 +92,7 @@ struct ias_attrib *irias_find_attrib(struct ias_object *obj, char *name);
struct ias_value *irias_new_string_value(char *string);
struct ias_value *irias_new_integer_value(int integer);
struct ias_value *irias_new_octseq_value(__u8 *octseq , int len);
+struct ias_value *irias_new_missing_value(void);
void irias_delete_value(struct ias_value *value);
extern struct ias_value missing;
diff --git a/include/net/irda/irlap.h b/include/net/irda/irlap.h
index 0e6a52a0a..36c1c03fd 100644
--- a/include/net/irda/irlap.h
+++ b/include/net/irda/irlap.h
@@ -6,7 +6,7 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Mon Aug 4 20:40:53 1997
- * Modified at: Tue Nov 16 10:00:36 1999
+ * Modified at: Fri Dec 10 13:21:17 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
* Copyright (c) 1998-1999 Dag Brattli <dagb@cs.uit.no>,
@@ -36,6 +36,8 @@
#include <net/irda/irlap_event.h>
+#define CONFIG_IRDA_DYNAMIC_WINDOW 1
+
#define LAP_RELIABLE 1
#define LAP_UNRELIABLE 0
@@ -115,7 +117,8 @@ struct irlap_cb {
int final_timeout;
int wd_timeout;
- struct sk_buff_head tx_list; /* Frames to be transmitted */
+ struct sk_buff_head txq; /* Frames to be transmitted */
+ struct sk_buff_head txq_ultra;
__u8 caddr; /* Connection address */
__u32 saddr; /* Source device address */
@@ -131,7 +134,7 @@ struct irlap_cb {
#ifdef CONFIG_IRDA_FAST_RR
int fast_RR_timeout;
int fast_RR;
-#endif
+#endif /* CONFIG_IRDA_FAST_RR */
int N1; /* N1 * F-timer = Negitiated link disconnect warning threshold */
int N2; /* N2 * F-timer = Negitiated link disconnect time */
@@ -141,13 +144,16 @@ struct irlap_cb {
int remote_busy;
int xmitflag;
- __u8 vs; /* Next frame to be sent */
- __u8 vr; /* Next frame to be received */
- __u8 va; /* Last frame acked */
- int window; /* Nr of I-frames allowed to send */
- int window_size; /* Current negotiated window size */
- __u32 window_bytes; /* Number of bytes allowed to send */
- __u32 bytes_left; /* Number of bytes allowed to transmit */
+ __u8 vs; /* Next frame to be sent */
+ __u8 vr; /* Next frame to be received */
+ __u8 va; /* Last frame acked */
+ int window; /* Nr of I-frames allowed to send */
+ int window_size; /* Current negotiated window size */
+
+#ifdef CONFIG_IRDA_DYNAMIC_WINDOW
+ __u32 line_capacity; /* Number of bytes allowed to send */
+ __u32 bytes_left; /* Number of bytes still allowed to transmit */
+#endif /* CONFIG_IRDA_DYNAMIC_WINDOW */
struct sk_buff_head wx_list;
@@ -177,7 +183,7 @@ struct irlap_cb {
#ifdef CONFIG_IRDA_COMPRESSION
struct irda_compressor compressor;
struct irda_compressor decompressor;
-#endif
+#endif /* CONFIG_IRDA_COMPRESSION */
};
extern hashbin_t *irlap;
@@ -197,9 +203,13 @@ void irlap_connect_response(struct irlap_cb *self, struct sk_buff *skb);
void irlap_connect_indication(struct irlap_cb *self, struct sk_buff *skb);
void irlap_connect_confirm(struct irlap_cb *, struct sk_buff *skb);
-void irlap_data_indication(struct irlap_cb *, struct sk_buff *);
-void irlap_unit_data_indication(struct irlap_cb *, struct sk_buff *);
-void irlap_data_request(struct irlap_cb *, struct sk_buff *, int reliable);
+void irlap_data_indication(struct irlap_cb *, struct sk_buff *, int unreliable);
+void irlap_data_request(struct irlap_cb *, struct sk_buff *, int unreliable);
+
+#ifdef CONFIG_IRDA_ULTRA
+void irlap_unitdata_request(struct irlap_cb *, struct sk_buff *);
+void irlap_unitdata_indication(struct irlap_cb *, struct sk_buff *);
+#endif /* CONFIG_IRDA_ULTRA */
void irlap_disconnect_request(struct irlap_cb *);
void irlap_disconnect_indication(struct irlap_cb *, LAP_REASON reason);
@@ -227,10 +237,10 @@ void irlap_wait_min_turn_around(struct irlap_cb *, struct qos_info *);
void irlap_init_qos_capabilities(struct irlap_cb *, struct qos_info *);
void irlap_apply_default_connection_parameters(struct irlap_cb *self);
-void irlap_apply_connection_parameters(struct irlap_cb *, struct qos_info *);
+void irlap_apply_connection_parameters(struct irlap_cb *self);
void irlap_set_local_busy(struct irlap_cb *self, int status);
#define IRLAP_GET_HEADER_SIZE(self) 2 /* Will be different when we get VFIR */
-#define IRLAP_GET_TX_QUEUE_LEN(self) skb_queue_len(&self->tx_list)
+#define IRLAP_GET_TX_QUEUE_LEN(self) skb_queue_len(&self->txq)
#endif
diff --git a/include/net/irda/irlap_event.h b/include/net/irda/irlap_event.h
index d58eed3da..54f5349fa 100644
--- a/include/net/irda/irlap_event.h
+++ b/include/net/irda/irlap_event.h
@@ -7,7 +7,7 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Sat Aug 16 00:59:29 1997
- * Modified at: Mon Aug 16 10:16:12 1999
+ * Modified at: Tue Dec 21 11:20:30 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
* Copyright (c) 1998-1999 Dag Brattli <dagb@cs.uit.no>,
@@ -70,6 +70,7 @@ typedef enum {
/* Send events */
SEND_I_CMD,
+ SEND_UI_FRAME,
/* Receive events */
RECV_DISCOVERY_XID_CMD,
@@ -79,14 +80,20 @@ typedef enum {
RECV_TEST_RSP,
RECV_UA_RSP,
RECV_DM_RSP,
+ RECV_RD_RSP,
RECV_I_CMD,
RECV_I_RSP,
RECV_UI_FRAME,
RECV_FRMR_RSP,
RECV_RR_CMD,
RECV_RR_RSP,
- RECV_RNR_FRAME,
- RECV_DISC_FRAME,
+ RECV_RNR_CMD,
+ RECV_RNR_RSP,
+ RECV_REJ_CMD,
+ RECV_REJ_RSP,
+ RECV_SREJ_CMD,
+ RECV_SREJ_RSP,
+ RECV_DISC_CMD,
/* Timer events */
SLOT_TIMER_EXPIRED,
diff --git a/include/net/irda/irlap_frame.h b/include/net/irda/irlap_frame.h
index a6ff9a7f8..2c28accc1 100644
--- a/include/net/irda/irlap_frame.h
+++ b/include/net/irda/irlap_frame.h
@@ -6,7 +6,7 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Tue Aug 19 10:27:26 1997
- * Modified at: Mon Aug 23 09:38:46 1999
+ * Modified at: Sat Dec 25 21:07:26 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
* Copyright (c) 1997-1999 Dag Brattli <dagb@cs.uit.no>,
@@ -113,23 +113,24 @@ struct snrm_frame {
void irlap_send_discovery_xid_frame(struct irlap_cb *, int S, __u8 s,
__u8 command, discovery_t *discovery);
void irlap_send_snrm_frame(struct irlap_cb *, struct qos_info *);
-void irlap_send_test_frame(struct irlap_cb *self, __u32 daddr,
+void irlap_send_test_frame(struct irlap_cb *self, __u8 caddr, __u32 daddr,
struct sk_buff *cmd);
void irlap_send_ua_response_frame(struct irlap_cb *, struct qos_info *);
-void irlap_send_ui_frame(struct irlap_cb *self, struct sk_buff *skb,
- int command);
-void irlap_send_dm_frame(struct irlap_cb *);
-void irlap_send_disc_frame(struct irlap_cb *);
-void irlap_send_rr_frame(struct irlap_cb *, int command);
+void irlap_send_dm_frame(struct irlap_cb *self);
+void irlap_send_rd_frame(struct irlap_cb *self);
+void irlap_send_disc_frame(struct irlap_cb *self);
+void irlap_send_rr_frame(struct irlap_cb *self, int command);
void irlap_send_data_primary(struct irlap_cb *, struct sk_buff *);
void irlap_send_data_primary_poll(struct irlap_cb *, struct sk_buff *);
void irlap_send_data_secondary(struct irlap_cb *, struct sk_buff *);
void irlap_send_data_secondary_final(struct irlap_cb *, struct sk_buff *);
void irlap_resend_rejected_frames(struct irlap_cb *, int command);
+void irlap_resend_rejected_frame(struct irlap_cb *self, int command);
void irlap_send_i_frame(struct irlap_cb *, struct sk_buff *, int command);
-void irlap_send_ui_frame(struct irlap_cb *, struct sk_buff *, int command);
+void irlap_send_ui_frame(struct irlap_cb *self, struct sk_buff *skb,
+ __u8 caddr, int command);
extern int irlap_insert_qos_negotiation_params(struct irlap_cb *self,
struct sk_buff *skb);
diff --git a/include/net/irda/irlmp.h b/include/net/irda/irlmp.h
index e1ba9ee65..9c9fab54d 100644
--- a/include/net/irda/irlmp.h
+++ b/include/net/irda/irlmp.h
@@ -6,7 +6,7 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Sun Aug 17 20:54:32 1997
- * Modified at: Tue Oct 5 15:20:56 1999
+ * Modified at: Fri Dec 10 13:23:01 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
* Copyright (c) 1998-1999 Dag Brattli <dagb@cs.uit.no>,
@@ -42,17 +42,14 @@
#define LSAP_MASK 0x7f
#define LSAP_IAS 0x00
#define LSAP_ANY 0xff
+#define LSAP_MAX 0x6f /* 0x70-0x7f are reserved */
+#define LSAP_CONNLESS 0x70 /* Connectionless LSAP, mostly used for Ultra */
#define DEV_ADDR_ANY 0xffffffff
-/* Predefined LSAPs used by the various servers */
-#define TSAP_IRLAN 0x05
-#define LSAP_IRLPT 0x06
-#define TSAP_IROBEX 0x07
-#define TSAP_IRCOMM 0x08
-
#define LMP_HEADER 2 /* Dest LSAP + Source LSAP */
#define LMP_CONTROL_HEADER 4
+#define LMP_PID_HEADER 1 /* Used by Ultra */
#define LMP_MAX_HEADER (LMP_CONTROL_HEADER+LAP_MAX_HEADER)
#define LM_MAX_CONNECTIONS 10
@@ -101,18 +98,20 @@ struct lsap_cb {
queue_t queue; /* Must be first */
magic_t magic;
- int connected;
- int persistent;
-
- __u8 slsap_sel; /* Source (this) LSAP address */
- __u8 dlsap_sel; /* Destination LSAP address (if connected) */
+ int connected;
+ int persistent;
- struct sk_buff *tmp_skb; /* Store skb here while connecting */
+ __u8 slsap_sel; /* Source (this) LSAP address */
+ __u8 dlsap_sel; /* Destination LSAP address (if connected) */
+#ifdef CONFIG_IRDA_ULTRA
+ __u8 pid; /* Used by connectionless LSAP */
+#endif /* CONFIG_IRDA_ULTRA */
+ struct sk_buff *conn_skb; /* Store skb here while connecting */
struct timer_list watchdog_timer;
IRLMP_STATE lsap_state; /* Connection state */
- notify_t notify; /* Indication/Confirm entry points */
+ notify_t notify; /* Indication/Confirm entry points */
struct qos_info qos; /* QoS for this connection */
struct lap_cb *lap; /* Pointer to LAP connection structure */
@@ -122,15 +121,16 @@ struct lsap_cb {
* Information about each registred IrLAP layer
*/
struct lap_cb {
- queue_t queue; /* Must be first */
+ queue_t queue; /* Must be first */
magic_t magic;
int reason; /* LAP disconnect reason */
IRLMP_STATE lap_state;
- struct irlap_cb *irlap; /* Instance of IrLAP layer */
+ struct irlap_cb *irlap; /* Instance of IrLAP layer */
hashbin_t *lsaps; /* LSAP associated with this link */
+ int refcount;
__u8 caddr; /* Connection address */
__u32 saddr; /* Source device address */
@@ -185,7 +185,7 @@ struct irlmp_cb {
/* Prototype declarations */
int irlmp_init(void);
void irlmp_cleanup(void);
-struct lsap_cb *irlmp_open_lsap( __u8 slsap, notify_t *notify);
+struct lsap_cb *irlmp_open_lsap(__u8 slsap, notify_t *notify, __u8 pid);
void irlmp_close_lsap( struct lsap_cb *self);
__u16 irlmp_service_to_hint(int service);
@@ -217,10 +217,16 @@ void irlmp_discovery_request(int nslots);
void irlmp_do_discovery(int nslots);
discovery_t *irlmp_get_discovery_response(void);
-int irlmp_data_request(struct lsap_cb *, struct sk_buff *);
-inline void irlmp_udata_request(struct lsap_cb *, struct sk_buff *);
-inline void irlmp_data_indication(struct lsap_cb *, struct sk_buff *);
-inline void irlmp_udata_indication(struct lsap_cb *, struct sk_buff *);
+int irlmp_data_request(struct lsap_cb *, struct sk_buff *);
+void irlmp_data_indication(struct lsap_cb *, struct sk_buff *);
+
+int irlmp_udata_request(struct lsap_cb *, struct sk_buff *);
+void irlmp_udata_indication(struct lsap_cb *, struct sk_buff *);
+
+#ifdef CONFIG_IRDA_ULTRA
+int irlmp_connless_data_request(struct lsap_cb *, struct sk_buff *);
+void irlmp_connless_data_indication(struct lsap_cb *, struct sk_buff *);
+#endif /* CONFIG_IRDA_ULTRA */
void irlmp_status_request(void);
void irlmp_status_indication(LINK_STATUS link, LOCK_STATUS lock);
diff --git a/include/net/irda/irlmp_frame.h b/include/net/irda/irlmp_frame.h
index d0584f1a7..779d34acc 100644
--- a/include/net/irda/irlmp_frame.h
+++ b/include/net/irda/irlmp_frame.h
@@ -6,10 +6,11 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Tue Aug 19 02:09:59 1997
- * Modified at: Tue Apr 6 17:12:57 1999
+ * Modified at: Fri Dec 10 13:21:53 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
- * Copyright (c) 1997 Dag Brattli <dagb@cs.uit.no>, All Rights Reserved.
+ * Copyright (c) 1997, 1999 Dag Brattli <dagb@cs.uit.no>,
+ * 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
@@ -25,6 +26,7 @@
#ifndef IRMLP_FRAME_H
#define IRMLP_FRAME_H
+#include <linux/config.h>
#include <linux/skbuff.h>
#include <net/irda/discovery.h>
@@ -42,8 +44,12 @@ inline void irlmp_send_data_pdu(struct lap_cb *self, __u8 dlsap, __u8 slsap,
int expedited, struct sk_buff *skb);
void irlmp_send_lcf_pdu(struct lap_cb *self, __u8 dlsap, __u8 slsap,
__u8 opcode, struct sk_buff *skb);
-void irlmp_link_data_indication(struct lap_cb *, int reliable,
- struct sk_buff *);
+void irlmp_link_data_indication(struct lap_cb *, struct sk_buff *,
+ int unreliable);
+#ifdef CONFIG_IRDA_ULTRA
+void irlmp_link_unitdata_indication(struct lap_cb *, struct sk_buff *);
+#endif /* CONFIG_IRDA_ULTRA */
+
void irlmp_link_connect_indication(struct lap_cb *, __u32 saddr, __u32 daddr,
struct qos_info *qos, struct sk_buff *skb);
void irlmp_link_connect_request(__u32 daddr);
diff --git a/include/net/irda/irport.h b/include/net/irda/irport.h
index ed5e2e92a..e79b45339 100644
--- a/include/net/irda/irport.h
+++ b/include/net/irda/irport.h
@@ -6,10 +6,10 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Sun Aug 3 13:49:59 1997
- * Modified at: Sat Nov 13 23:48:55 1999
+ * Modified at: Mon Jan 3 10:23:34 2000
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
- * Copyright (c) 1997, 1998-1999 Dag Brattli <dagb@cs.uit.no>
+ * Copyright (c) 1997, 1998-2000 Dag Brattli <dagb@cs.uit.no>
* All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
@@ -54,7 +54,7 @@ struct irport_cb {
struct net_device *netdev; /* Yes! we are some kind of netdevice */
struct net_device_stats stats;
- struct irlap_cb *irlap; /* The link layer we are binded to */
+ struct irlap_cb *irlap; /* The link layer we are attached to */
struct chipio_t io; /* IrDA controller information */
struct iobuff_t tx_buff; /* Transmit buffer */
@@ -65,19 +65,25 @@ struct irport_cb {
__u32 flags; /* Interface flags */
__u32 new_speed;
+ int mode;
+ int index; /* Instance index */
spinlock_t lock; /* For serializing operations */
- int mode;
+ /* For piggyback drivers */
+ void *priv;
+ void (*change_speed)(void *priv, __u32 speed);
+ void (*interrupt)(int irq, void *dev_id, struct pt_regs *regs);
};
-void irport_start(struct irport_cb *self, int iobase);
-void irport_stop(struct irport_cb *self, int iobase);
-int irport_probe(int iobase);
-
-int irport_change_speed(struct irda_task *task);
-void __irport_change_speed(struct irport_cb *self, __u32 speed);
+struct irport_cb *irport_open(int i, unsigned int iobase, unsigned int irq);
+int irport_close(struct irport_cb *self);
+void irport_start(struct irport_cb *self);
+void irport_stop(struct irport_cb *self);
+void irport_change_speed(void *priv, __u32 speed);
void irport_interrupt(int irq, void *dev_id, struct pt_regs *regs);
int irport_hard_xmit(struct sk_buff *skb, struct net_device *dev);
+int irport_net_open(struct net_device *dev);
+int irport_net_close(struct net_device *dev);
-#endif
+#endif /* IRPORT_H */
diff --git a/include/net/irda/irttp.h b/include/net/irda/irttp.h
index ffe5b2ec9..2b2547fa2 100644
--- a/include/net/irda/irttp.h
+++ b/include/net/irda/irttp.h
@@ -6,7 +6,7 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Sun Aug 31 20:14:31 1997
- * Modified at: Tue Oct 5 15:17:14 1999
+ * Modified at: Sun Dec 12 13:09:07 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
* Copyright (c) 1998-1999 Dag Brattli <dagb@cs.uit.no>,
@@ -44,16 +44,16 @@
#define DEFAULT_INITIAL_CREDIT 14
-#define LOW_THRESHOLD 4
-#define HIGH_THRESHOLD 10
+#define TTP_LOW_THRESHOLD 4
+#define TTP_HIGH_THRESHOLD 10
#define TTP_MAX_QUEUE 14
/* Some priorities for disconnect requests */
#define P_NORMAL 0
#define P_HIGH 1
-#define SAR_DISABLE 0
-#define SAR_UNBOUND 0xffffffff
+#define TTP_SAR_DISABLE 0
+#define TTP_SAR_UNBOUND 0xffffffff
/* Parameters */
#define TTP_MAX_SDU_SIZE 0x01
@@ -141,7 +141,7 @@ static __inline __u32 irttp_get_daddr(struct tsap_cb *self)
return irlmp_get_daddr(self->lsap);
}
-static __inline __u32 irttp_get_max_seq_size(struct tsap_cb *self)
+static __inline __u32 irttp_get_max_seg_size(struct tsap_cb *self)
{
return self->max_seg_size;
}
diff --git a/include/net/irda/irtty.h b/include/net/irda/irtty.h
index 757425853..5a37ae5a7 100644
--- a/include/net/irda/irtty.h
+++ b/include/net/irda/irtty.h
@@ -6,7 +6,7 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Tue Dec 9 21:13:12 1997
- * Modified at: Fri Nov 5 10:46:51 1999
+ * Modified at: Sun Nov 21 21:19:35 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
* Copyright (c) 1997, 1999 Dag Brattli, All Rights Reserved.
@@ -49,6 +49,7 @@ struct irtty_cb {
magic_t magic;
struct net_device *netdev; /* Yes! we are some kind of netdevice */
+ struct irda_task *task;
struct net_device_stats stats;
struct tty_struct *tty;
diff --git a/include/net/irda/pc87108.h b/include/net/irda/nsc_fir.h
index d7b63a38f..bbfb4d724 100644
--- a/include/net/irda/pc87108.h
+++ b/include/net/irda/nsc_fir.h
@@ -1,15 +1,15 @@
/*********************************************************************
*
- * Filename: pc87108.h
+ * Filename: nsc_fir.h
* Version:
* Description:
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Fri Nov 13 14:37:40 1998
- * Modified at: Mon Nov 8 10:00:27 1999
+ * Modified at: Wed Jan 5 12:00:16 2000
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
- * Copyright (c) 1998-1999 Dag Brattli <dagb@cs.uit.no>
+ * Copyright (c) 1998-2000 Dag Brattli <dagb@cs.uit.no>
* Copyright (c) 1998 Lichen Wang, <lwang@actisys.com>
* Copyright (c) 1998 Actisys Corp., www.actisys.com
* All Rights Reserved
@@ -25,11 +25,21 @@
*
********************************************************************/
-#ifndef PC87108_H
-#define PC87108_H
+#ifndef NSC_FIR_H
+#define NSC_FIR_H
+#include <linux/time.h>
+
+#include <linux/spinlock.h>
#include <asm/io.h>
+#define PC87108 0x10
+#define PC97338 0xb0
+
+/* DMA modes needed */
+#define DMA_TX_MODE 0x08 /* Mem to I/O, ++, demand. */
+#define DMA_RX_MODE 0x04 /* I/O to mem, ++, demand. */
+
/* Flags for configuration register CRF0 */
#define APEDCRC 0x02
#define ENBNKSEL 0x01
@@ -53,7 +63,7 @@
#define FCR_FIFO_EN 0x01 /* Enable FIFO's */
#define FCR_RXSR 0x02 /* Rx FIFO soft reset */
#define FCR_TXSR 0x04 /* Tx FIFO soft reset */
-#define FCR_RXTH 0x80 /* Rx FIFO threshold (set to 16) */
+#define FCR_RXTH 0x40 /* Rx FIFO threshold (set to 16) */
#define FCR_TXTH 0x20 /* Tx FIFO threshold (set to 17) */
#define EIR 0x02 /* (read only) */
@@ -88,6 +98,7 @@
#define MCR_MIR 0x80
#define MCR_FIR 0xa0
#define MCR_CEIR 0xb0
+#define MCR_IR_PLS 0x10
#define MCR_DMA_EN 0x04
#define MCR_EN_IRQ 0x08
#define MCR_TX_DFR 0x08
@@ -112,7 +123,7 @@
#define ECR1 0x02 /* Extended Control Register 1 */
#define ECR1_EXT_SL 0x01 /* Extended Mode Select */
#define ECR1_DMANF 0x02 /* DMA Fairness */
-#define ECR1_DMATH 0x04
+#define ECR1_DMATH 0x04 /* DMA Threshold */
#define ECR1_DMASWP 0x08 /* DMA Swap */
#define EXCR2 0x04
@@ -148,7 +159,7 @@
#define FRM_ST_MAX_LEN 0x10 /* Max frame len exceeded */
#define FRM_ST_PHY_ERR 0x08 /* Physical layer error */
#define FRM_ST_BAD_CRC 0x04
-#define FRM_ST_OVR1 0x02 /* Receive overrun */
+#define FRM_ST_OVR1 0x02 /* Rx FIFO overrun */
#define FRM_ST_OVR2 0x01 /* Frame status FIFO overrun */
#define RFLFL 0x06
@@ -176,25 +187,47 @@ struct st_fifo {
int len;
};
+struct frame_cb {
+ void *start; /* Start of frame in DMA mem */
+ int len; /* Lenght of frame in DMA mem */
+};
+
+#define MAX_WINDOW 7
+
+struct tx_fifo {
+ struct frame_cb queue[MAX_WINDOW]; /* Info about frames in queue */
+ int ptr; /* Currently being sent */
+ int len; /* Lenght of queue */
+ int free; /* Next free slot */
+ void *tail; /* Next free start in DMA mem */
+};
+
/* Private data for each instance */
-struct pc87108 {
- struct st_fifo st_fifo;
+struct nsc_fir_cb {
+ struct st_fifo st_fifo; /* Info about received frames */
+ struct tx_fifo tx_fifo; /* Info about frames to be transmitted */
- int tx_buff_offsets[10]; /* Offsets between frames in tx_buff */
- int tx_len; /* Number of frames in tx_buff */
+ int tx_buff_offsets[10]; /* Offsets between frames in tx_buff */
+ int tx_len; /* Number of frames in tx_buff */
- struct net_device *netdev; /* Yes! we are some kind of netdevice */
+ struct net_device *netdev; /* Yes! we are some kind of netdevice */
struct net_device_stats stats;
- struct irlap_cb *irlap; /* The link layer we are binded to */
+ struct irlap_cb *irlap; /* The link layer we are binded to */
struct chipio_t io; /* IrDA controller information */
struct iobuff_t tx_buff; /* Transmit buffer */
struct iobuff_t rx_buff; /* Receive buffer */
struct qos_info qos; /* QoS capabilities for this device */
+
+ struct timeval stamp;
+ struct timeval now;
+
+ spinlock_t lock; /* For serializing operations */
__u32 flags; /* Interface flags */
__u32 new_speed;
+ int suspend;
};
static inline void switch_bank(int iobase, int bank)
@@ -202,4 +235,4 @@ static inline void switch_bank(int iobase, int bank)
outb(bank, iobase+BSR);
}
-#endif
+#endif /* NSC_FIR_H */
diff --git a/include/net/irda/parameters.h b/include/net/irda/parameters.h
index e661f2dfa..0bb658942 100644
--- a/include/net/irda/parameters.h
+++ b/include/net/irda/parameters.h
@@ -6,7 +6,7 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Mon Jun 7 08:47:28 1999
- * Modified at: Sun Jun 13 09:17:54 1999
+ * Modified at: Mon Dec 13 11:51:59 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
* Copyright (c) 1999 Dag Brattli, All Rights Reserved.
@@ -99,10 +99,7 @@ int irda_param_extract(void *self, __u8 *buf, int len, pi_param_info_t *info);
int irda_param_extract_all(void *self, __u8 *buf, int len,
pi_param_info_t *info);
-extern inline int irda_param_insert_byte(__u8 *buf, __u8 pi, __u8 pv)
-{
- return irda_param_pack(buf, "bbb", pi, 1, pv);
-}
+#define irda_param_insert_byte(buf,pi,pv) irda_param_pack(buf,"bbb",pi,1,pv)
#endif /* IRDA_PARAMS_H */
diff --git a/include/net/irda/qos.h b/include/net/irda/qos.h
index d99abe647..e88f0a3bd 100644
--- a/include/net/irda/qos.h
+++ b/include/net/irda/qos.h
@@ -6,7 +6,7 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Fri Sep 19 23:21:09 1997
- * Modified at: Tue Oct 5 11:51:37 1999
+ * Modified at: Thu Dec 2 13:51:54 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
* Copyright (c) 1999 Dag Brattli, All Rights Reserved.
@@ -87,17 +87,21 @@ struct qos_info {
};
extern __u32 baud_rates[];
-extern __u32 data_size[];
-extern __u32 min_turn_time[];
+extern __u32 data_sizes[];
+extern __u32 min_turn_times[];
extern __u32 add_bofs[];
-extern __u32 compression[];
+extern __u32 compressions[];
void irda_init_max_qos_capabilies(struct qos_info *qos);
void irda_qos_compute_intersection(struct qos_info *, struct qos_info *);
+__u32 irlap_max_line_capacity(__u32 speed, __u32 max_turn_time);
+__u32 irlap_requested_line_capacity(struct qos_info *qos);
+__u32 irlap_min_turn_time_in_bytes(__u32 speed, __u32 min_turn_time);
+
int msb_index(__u16 byte);
-__u32 byte_value(__u8 byte, __u32 *array);
int value_index(__u32 value, __u32 *array);
+__u32 byte_value(__u8 byte, __u32 *array);
__u32 index_value(int index, __u32 *array);
void irda_qos_bits_to_value(struct qos_info *qos);
diff --git a/include/net/irda/smc-ircc.h b/include/net/irda/smc-ircc.h
index 0bb336b93..e5df56bc0 100644
--- a/include/net/irda/smc-ircc.h
+++ b/include/net/irda/smc-ircc.h
@@ -1,140 +1,147 @@
/*********************************************************************
*
* Filename: smc-ircc.h
- * Version:
- * Description:
+ * Version: 0.3
+ * Description: Definitions for the SMC IrCC chipset
* Status: Experimental.
* Author: Thomas Davis (tadavis@jps.net)
*
- * Copyright (c) 1998, 1999 Thomas Davis (tadavis@jps.net>
+ * Copyright (c) 1999-2000, Dag Brattli <dagb@cs.uit.no>
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
*
********************************************************************/
-#include <net/irda/irport.h>
-
#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
+#include <linux/spinlock.h>
-/* Register block 0 */
+#include <net/irda/irport.h>
-#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
+/* DMA modes needed */
+#define DMA_TX_MODE 0x08 /* Mem to I/O, ++, demand. */
+#define DMA_RX_MODE 0x04 /* I/O to mem, ++, demand. */
-/* Register block 1 */
+#define IRCC_MASTER 0x07
+#define IRCC_MASTER_POWERDOWN 1<<7
+#define IRCC_MASTER_RESET 1<<6
+#define IRCC_MASTER_INT_EN 1<<5
+#define IRCC_MASTER_ERROR_RESET 1<<4
-#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 0 */
+#define IRCC_IIR 0x01
+#define IRCC_IER 0x02
+#define IRCC_LSR 0x03
+#define IRCC_LCR_A 0x04
+#define IRCC_LCR_B 0x05
+#define IRCC_BSR 0x06
+
+#define IRCC_IIR_ACTIVE_FRAME 1<<7
+#define IRCC_IIR_EOM 1<<6
+#define IRCC_IIR_RAW_MODE 1<<5
+#define IRCC_IIR_FIFO 1<<4
+
+#define IRCC_IER_ACTIVE_FRAME 1<<7
+#define IRCC_IER_EOM 1<<6
+#define IRCC_IER_RAW_MODE 1<<5
+#define IRCC_IER_FIFO 1<<4
+
+#define IRCC_LSR_UNDERRUN 1<<7
+#define IRCC_LSR_OVERRUN 1<<6
+#define IRCC_LSR_FRAME_ERROR 1<<5
+#define IRCC_LSR_SIZE_ERROR 1<<4
+#define IRCC_LSR_CRC_ERROR 1<<3
+#define IRCC_LSR_FRAME_ABORT 1<<2
+
+#define IRCC_LCR_A_FIFO_RESET 1<<7
+#define IRCC_LCR_A_FAST 1<<6
+#define IRCC_LCR_A_GP_DATA 1<<5
+#define IRCC_LCR_A_RAW_TX 1<<4
+#define IRCC_LCR_A_RAW_RX 1<<3
+#define IRCC_LCR_A_ABORT 1<<2
+#define IRCC_LCR_A_DATA_DONE 1<<1
+
+#define IRCC_LCR_B_SCE_DISABLED 0x00<<6
+#define IRCC_LCR_B_SCE_TRANSMIT 0x01<<6
+#define IRCC_LCR_B_SCE_RECEIVE 0x02<<6
+#define IRCC_LCR_B_SCE_UNDEFINED 0x03<<6
+#define IRCC_LCR_B_SIP_ENABLE 1<<5
+#define IRCC_LCR_B_BRICK_WALL 1<<4
+
+#define IRCC_BSR_NOT_EMPTY 1<<7
+#define IRCC_BSR_FIFO_FULL 1<<6
+#define IRCC_BSR_TIMEOUT 1<<5
-/* Register block 3 - Identification Registers! */
+/* Register block 1 */
+#define IRCC_SCE_CFGA 0x00
+#define IRCC_SCE_CFGB 0x01
+#define IRCC_FIFO_THRESHOLD 0x02
+
+#define IRCC_CFGA_AUX_IR 0x01<<7
+#define IRCC_CFGA_HALF_DUPLEX 0x01<<2
+#define IRCC_CFGA_TX_POLARITY 0x01<<1
+#define IRCC_CFGA_RX_POLARITY 0x01
+
+#define IRCC_CFGA_COM 0x00<<3
+#define IRCC_CFGA_IRDA_SIR_A 0x01<<3
+#define IRCC_CFGA_ASK_SIR 0x02<<3
+#define IRCC_CFGA_IRDA_SIR_B 0x03<<3
+#define IRCC_CFGA_IRDA_HDLC 0x04<<3
+#define IRCC_CFGA_IRDA_4PPM 0x05<<3
+#define IRCC_CFGA_CONSUMER 0x06<<3
+#define IRCC_CFGA_RAW_IR 0x07<<3
+#define IRCC_CFGA_OTHER 0x08<<3
+
+#define IRCC_IR_HDLC 0x04
+#define IRCC_IR_4PPM 0x01
+#define IRCC_IR_CONSUMER 0x02
+
+#define IRCC_CFGB_LOOPBACK 0x01<<5
+#define IRCC_CFGB_LPBCK_TX_CRC 0x01<<4
+#define IRCC_CFGB_NOWAIT 0x01<<3
+#define IRCC_CFGB_STRING_MOVE 0x01<<2
+#define IRCC_CFGB_DMA_BURST 0x01<<1
+#define IRCC_CFGB_DMA_ENABLE 0x01
+
+#define IRCC_CFGB_COM 0x00<<6
+#define IRCC_CFGB_IR 0x01<<6
+#define IRCC_CFGB_AUX 0x02<<6
+#define IRCC_CFGB_INACTIVE 0x03<<6
-#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 3 - Identification Registers! */
+#define IRCC_ID_HIGH 0x00 /* 0x10 */
+#define IRCC_ID_LOW 0x01 /* 0xB8 */
+#define IRCC_CHIP_ID 0x02 /* 0xF1 */
+#define IRCC_VERSION 0x03 /* 0x01 */
+#define IRCC_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 IRCC_CONTROL 0x00
+#define IRCC_BOF_COUNT_LO 0x01
+#define IRCC_BRICKWALL_CNT_LO 0x02
+#define IRCC_BRICKWALL_TX_CNT_HI 0x03
+#define IRCC_TX_SIZE_LO 0x04
+#define IRCC_RX_SIZE_HI 0x05
+#define IRCC_RX_SIZE_LO 0x06
-#define UART_1152 0x01<<7
-#define UART_CRC 0x01<<6
+#define IRCC_1152 0x01<<7
+#define IRCC_CRC 0x01<<6
/* For storing entries in the status FIFO */
struct st_fifo_entry {
@@ -152,25 +159,23 @@ struct st_fifo {
/* Private data for each instance */
struct ircc_cb {
struct net_device *netdev; /* Yes! we are some kind of netdevice */
- struct net_device_stats stats;
-
struct irlap_cb *irlap; /* The link layer we are binded to */
struct chipio_t io; /* IrDA controller information */
struct iobuff_t tx_buff; /* Transmit buffer */
struct iobuff_t rx_buff; /* Receive buffer */
- struct qos_info qos; /* QoS capabilities for this device */
- struct irport_cb irport;
+ struct irport_cb *irport;
+
+ spinlock_t lock; /* For serializing operations */
+ __u32 new_speed;
__u32 flags; /* Interface flags */
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 */
-
-
+ int tx_buff_offsets[10]; /* Offsets between frames in tx_buff */
+ int tx_len; /* Number of frames in tx_buff */
};
-#endif
+#endif /* SMC_IRCC_H */
diff --git a/include/net/irda/w83977af.h b/include/net/irda/w83977af.h
index dda084ab7..04476c2e9 100644
--- a/include/net/irda/w83977af.h
+++ b/include/net/irda/w83977af.h
@@ -1,54 +1,53 @@
#ifndef W83977AF_H
#define W83977AF_H
-#define W977_EFER 0x370
-#define W977_EFIR 0x370
-#define W977_EFDR 0x371
+#define W977_EFIO_BASE 0x370
+#define W977_EFIO2_BASE 0x3f0
#define W977_DEVICE_IR 0x06
/*
* Enter extended function mode
*/
-static inline void w977_efm_enter(void)
+static inline void w977_efm_enter(unsigned int efio)
{
- outb(0x87, W977_EFER);
- outb(0x87, W977_EFER);
+ outb(0x87, efio);
+ outb(0x87, efio);
}
/*
* Select a device to configure
*/
-static inline void w977_select_device(__u8 devnum)
+static inline void w977_select_device(__u8 devnum, unsigned int efio)
{
- outb(0x07, W977_EFIR);
- outb(devnum, W977_EFDR);
+ outb(0x07, efio);
+ outb(devnum, efio+1);
}
/*
* Write a byte to a register
*/
-static inline void w977_write_reg(__u8 reg, __u8 value)
+static inline void w977_write_reg(__u8 reg, __u8 value, unsigned int efio)
{
- outb(reg, W977_EFIR);
- outb(value, W977_EFDR);
+ outb(reg, efio);
+ outb(value, efio+1);
}
/*
* read a byte from a register
*/
-static inline __u8 w977_read_reg(__u8 reg)
+static inline __u8 w977_read_reg(__u8 reg, unsigned int efio)
{
- outb(reg, W977_EFIR);
- return inb(W977_EFDR);
+ outb(reg, efio);
+ return inb(efio+1);
}
/*
* Exit extended function mode
*/
-static inline void w977_efm_exit(void)
+static inline void w977_efm_exit(unsigned int efio)
{
- outb(0xAA, W977_EFER);
+ outb(0xAA, efio);
}
#endif
diff --git a/include/net/irda/wrapper.h b/include/net/irda/wrapper.h
index d4cfbbc52..3d931b353 100644
--- a/include/net/irda/wrapper.h
+++ b/include/net/irda/wrapper.h
@@ -6,7 +6,7 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Mon Aug 4 20:40:53 1997
- * Modified at: Sat Oct 30 16:29:01 1999
+ * Modified at: Thu Nov 4 14:25:54 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
* Copyright (c) 1998-1999 Dag Brattli <dagb@cs.uit.no>,
diff --git a/include/net/route.h b/include/net/route.h
index 3a2e8e2e4..9ccfd3bea 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -25,6 +25,7 @@
#include <linux/config.h>
#include <net/dst.h>
+#include <net/inetpeer.h>
#include <linux/in_route.h>
#include <linux/rtnetlink.h>
#include <linux/route.h>
@@ -33,8 +34,6 @@
#warning This file is not supposed to be used outside of kernel.
#endif
-#define RT_HASH_DIVISOR 256
-
#define RTO_ONLINK 0x01
#define RTO_TPROXY 0x80000000
@@ -53,6 +52,7 @@ struct rt_key
__u8 scope;
};
+struct inet_peer;
struct rtable
{
union
@@ -76,6 +76,7 @@ struct rtable
/* Miscellaneous cached information */
__u32 rt_spec_dst; /* RFC1122 specific destination */
+ struct inet_peer *peer; /* long-living peer info */
#ifdef CONFIG_IP_ROUTE_NAT
__u32 rt_src_map;
@@ -138,4 +139,15 @@ extern __inline__ int ip_route_connect(struct rtable **rp, u32 dst, u32 src, u32
return ip_route_output(rp, dst, src, tos, oif);
}
+extern void rt_bind_peer(struct rtable *rt, int create);
+
+extern __inline__ struct inet_peer *rt_get_peer(struct rtable *rt)
+{
+ if (rt->peer)
+ return rt->peer;
+
+ rt_bind_peer(rt, 0);
+ return rt->peer;
+}
+
#endif /* _ROUTE_H */