Commit bf5939d1 authored by Kai Germaschewski's avatar Kai Germaschewski

Merge tp1.ruhr-uni-bochum.de:/home/kai/src/kernel/v2.5/linux-2.5

into tp1.ruhr-uni-bochum.de:/home/kai/src/kernel/v2.5/linux-2.5.isdn
parents 9beb225e cb35e72a
...@@ -19,7 +19,7 @@ isdn-objs := isdn_net.o isdn_net_lib.o \ ...@@ -19,7 +19,7 @@ isdn-objs := isdn_net.o isdn_net_lib.o \
# Optional parts of multipart objects. # Optional parts of multipart objects.
isdn-objs-$(CONFIG_ISDN_PPP) += isdn_ppp.o isdn-objs-$(CONFIG_ISDN_PPP) += isdn_ppp.o isdn_ppp_ccp.o
isdn-objs-$(CONFIG_ISDN_X25) += isdn_concap.o isdn_x25iface.o isdn-objs-$(CONFIG_ISDN_X25) += isdn_concap.o isdn_x25iface.o
isdn-objs-$(CONFIG_ISDN_AUDIO) += isdn_audio.o isdn-objs-$(CONFIG_ISDN_AUDIO) += isdn_audio.o
isdn-objs-$(CONFIG_ISDN_TTY_FAX) += isdn_ttyfax.o isdn-objs-$(CONFIG_ISDN_TTY_FAX) += isdn_ttyfax.o
......
...@@ -907,16 +907,15 @@ static int bsd_decompress (void *state, struct sk_buff *skb_in, struct sk_buff * ...@@ -907,16 +907,15 @@ static int bsd_decompress (void *state, struct sk_buff *skb_in, struct sk_buff *
*************************************************************/ *************************************************************/
static struct isdn_ppp_compressor ippp_bsd_compress = { static struct isdn_ppp_compressor ippp_bsd_compress = {
NULL,NULL, /* prev,next: overwritten by isdn_ppp */ .num = CI_BSD_COMPRESS,
CI_BSD_COMPRESS, /* compress_proto */ .alloc = bsd_alloc,
bsd_alloc, /* alloc */ .free = bsd_free,
bsd_free, /* free */ .init = bsd_init,
bsd_init, /* init */ .reset = bsd_reset,
bsd_reset, /* reset */ .compress = bsd_compress,
bsd_compress, /* compress */ .decompress = bsd_decompress,
bsd_decompress, /* decompress */ .incomp = bsd_incomp,
bsd_incomp, /* incomp */ .stat = bsd_stats,
bsd_stats /* comp_stat */
}; };
/************************************************************* /*************************************************************
......
...@@ -20,6 +20,19 @@ ...@@ -20,6 +20,19 @@
#include <linux/if_arp.h> #include <linux/if_arp.h>
#include <linux/inetdevice.h> #include <linux/inetdevice.h>
/*
* Definitions for Cisco-HDLC header.
*/
#define CISCO_ADDR_UNICAST 0x0f
#define CISCO_ADDR_BROADCAST 0x8f
#define CISCO_CTRL 0x00
#define CISCO_TYPE_CDP 0x2000
#define CISCO_TYPE_SLARP 0x8035
#define CISCO_SLARP_REQUEST 0
#define CISCO_SLARP_REPLY 1
#define CISCO_SLARP_KEEPALIVE 2
/* /*
* CISCO HDLC keepalive specific stuff * CISCO HDLC keepalive specific stuff
*/ */
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
#endif #endif
#define isdn_BUG() \ #define isdn_BUG() \
do { printk(KERN_WARNING "ISDN Bug at %s:%d\n", __FILE__, __LINE__); \ do { printk(KERN_WARNING "ISDN BUG at %s:%d\n", __FILE__, __LINE__); \
} while(0) } while(0)
#define HERE printk("%s:%d (%s)\n", __FILE__, __LINE__, __FUNCTION__) #define HERE printk("%s:%d (%s)\n", __FILE__, __LINE__, __FUNCTION__)
......
This diff is collapsed.
...@@ -14,138 +14,29 @@ ...@@ -14,138 +14,29 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/isdn.h> #include <linux/isdn.h>
/* Definitions for hupflags: */
#define ISDN_CHARGEHUP 4 /* We want to use the charge mechanism */
#define ISDN_INHUP 8 /* Even if incoming, close after huptimeout */
#define ISDN_MANCHARGE 16 /* Charge Interval manually set */
/* void isdn_net_init(void);
* Definitions for Cisco-HDLC header. void isdn_net_exit(void);
*/ void isdn_net_lib_init(void);
void isdn_net_lib_exit(void);
#define CISCO_ADDR_UNICAST 0x0f void isdn_net_hangup_all(void);
#define CISCO_ADDR_BROADCAST 0x8f int isdn_net_ioctl(struct inode *, struct file *, uint, ulong);
#define CISCO_CTRL 0x00
#define CISCO_TYPE_CDP 0x2000 int register_isdn_netif(int encap, struct isdn_netif_ops *ops);
#define CISCO_TYPE_SLARP 0x8035 int isdn_net_start_xmit(struct sk_buff *skb, struct net_device *ndev);
#define CISCO_SLARP_REQUEST 0 void isdn_net_online(isdn_net_dev *idev);
#define CISCO_SLARP_REPLY 1 void isdn_net_offline(isdn_net_dev *idev);
#define CISCO_SLARP_KEEPALIVE 2
int isdn_net_stat_callback(int, isdn_ctrl *);
extern void isdn_net_init(void); int isdn_net_find_icall(int, int, int, setup_parm *);
extern void isdn_net_exit(void); int isdn_net_rcv_skb(int, struct sk_buff *);
extern void isdn_net_lib_init(void);
extern void isdn_net_lib_exit(void); int isdn_net_hangup(isdn_net_dev *);
extern void isdn_net_hangup_all(void); int isdn_net_dial_req(isdn_net_dev *);
extern int isdn_net_ioctl(struct inode *, struct file *, uint, ulong); void isdn_net_writebuf_skb(isdn_net_dev *, struct sk_buff *skb);
void isdn_net_write_super(isdn_net_dev *, struct sk_buff *skb);
extern int register_isdn_netif(int encap, struct isdn_netif_ops *ops); int isdn_net_autodial(struct sk_buff *skb, struct net_device *ndev);
extern int isdn_net_autodial(struct sk_buff *skb, struct net_device *ndev); isdn_net_dev *isdn_net_get_xmit_dev(isdn_net_local *mlp);
extern int isdn_net_start_xmit(struct sk_buff *skb, struct net_device *ndev);
extern int isdn_net_dial(isdn_net_dev *idev);
extern int isdn_net_bsent(isdn_net_dev *idev, isdn_ctrl *c);
extern int isdn_net_stat_callback(int, isdn_ctrl *);
extern int isdn_net_find_icall(int, int, int, setup_parm *);
extern int isdn_net_hangup(isdn_net_dev *);
extern int isdn_net_rcv_skb(int, struct sk_buff *);
extern int isdn_net_dial_req(isdn_net_dev *);
extern void isdn_net_writebuf_skb(isdn_net_dev *, struct sk_buff *skb);
extern void isdn_net_write_super(isdn_net_dev *, struct sk_buff *skb);
extern int isdn_net_online(isdn_net_dev *);
enum {
ST_CHARGE_NULL,
ST_CHARGE_GOT_CINF, /* got a first charge info */
ST_CHARGE_HAVE_CINT, /* got a second chare info and thus the timing */
};
#define ISDN_NET_MAX_QUEUE_LENGTH 2
/*
* is this particular channel busy?
*/
static inline int
isdn_net_dev_busy(isdn_net_dev *idev)
{
if (atomic_read(&idev->frame_cnt) < ISDN_NET_MAX_QUEUE_LENGTH)
return 0;
else
return 1;
}
/*
* For the given net device, this will get a non-busy channel out of the
* corresponding bundle. The returned channel is locked.
*/
static inline isdn_net_dev *
isdn_net_get_locked_dev(isdn_net_local *mlp)
{
unsigned long flags;
isdn_net_dev *idev;
spin_lock_irqsave(&mlp->online_lock, flags);
list_for_each_entry(idev, &mlp->online, online) {
spin_lock_bh(&idev->xmit_lock);
if (!isdn_net_dev_busy(idev)) {
/* point the head to next online channel */
list_del(&mlp->online);
list_add(&mlp->online, &idev->online);
goto found;
}
spin_unlock_bh(&idev->xmit_lock);
}
idev = NULL;
found:
spin_unlock_irqrestore(&mlp->online_lock, flags);
return idev;
}
/*
* add a channel to a bundle
*/
static inline void
isdn_net_add_to_bundle(isdn_net_local *mlp, isdn_net_dev *idev)
{
unsigned long flags;
spin_lock_irqsave(&mlp->online_lock, flags);
list_add(&idev->online, &mlp->online);
spin_unlock_irqrestore(&mlp->online_lock, flags);
}
/*
* remove a channel from the bundle it belongs to
*/
static inline void
isdn_net_rm_from_bundle(isdn_net_dev *idev)
{
isdn_net_local *mlp = idev->mlp;
unsigned long flags;
spin_lock_irqsave(&mlp->online_lock, flags);
// list_del(&idev->online); FIXME
spin_unlock_irqrestore(&mlp->online_lock, flags);
}
/*
* wake up the network -> net_device queue.
* For slaves, wake the corresponding master interface.
*/
static inline void
isdn_net_dev_wake_queue(isdn_net_dev *idev)
{
netif_wake_queue(&idev->mlp->dev);
}
static inline int
isdn_net_bound(isdn_net_dev *idev)
{
return idev->isdn_slot >= 0;
}
static inline int static inline int
put_u8(unsigned char *p, u8 x) put_u8(unsigned char *p, u8 x)
......
This diff is collapsed.
This diff is collapsed.
...@@ -15,17 +15,15 @@ ...@@ -15,17 +15,15 @@
extern struct file_operations isdn_ppp_fops; extern struct file_operations isdn_ppp_fops;
extern struct isdn_netif_ops isdn_ppp_ops; extern struct isdn_netif_ops isdn_ppp_ops;
extern int isdn_ppp_init(void); int isdn_ppp_init(void);
extern void isdn_ppp_cleanup(void); void isdn_ppp_cleanup(void);
extern int isdn_ppp_dial_slave(char *); int isdn_ppp_dial_slave(char *);
extern int isdn_ppp_hangup_slave(char *); int isdn_ppp_hangup_slave(char *);
#define IPPP_OPEN 0x01 void
#define IPPP_CONNECT 0x02 isdn_ppp_frame_log(char *info, char *data, int len, int maxlen,
#define IPPP_CLOSEWAIT 0x04 int unit, int slot);
#define IPPP_NOBLOCK 0x08 int
#define IPPP_ASSIGNED 0x10 isdn_ppp_strip_proto(struct sk_buff *skb);
#define IPPP_MAX_HEADER 10 #define IPPP_MAX_HEADER 10
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment