diff --git a/drivers/isdn/i4l/isdn_ciscohdlck.c b/drivers/isdn/i4l/isdn_ciscohdlck.c index b12d10c06443f28c0cd4d3786655c8ecde812d6d..c03bf8b03caa0a753a8ee2a3eb03e0fde4f011bb 100644 --- a/drivers/isdn/i4l/isdn_ciscohdlck.c +++ b/drivers/isdn/i4l/isdn_ciscohdlck.c @@ -324,7 +324,7 @@ isdn_net_ciscohdlck_slarp_in(isdn_net_local *lp, struct sk_buff *skb) } } -void +static void isdn_ciscohdlck_receive(isdn_net_dev *idev, isdn_net_local *olp, struct sk_buff *skb) { @@ -393,6 +393,7 @@ isdn_ciscohdlck_setup(isdn_net_dev *p) p->dev.header_cache_update = NULL; p->dev.flags = IFF_NOARP|IFF_POINTOPOINT; p->dev.do_ioctl = isdn_ciscohdlck_dev_ioctl; + p->local.receive = isdn_ciscohdlck_receive; return 0; } diff --git a/drivers/isdn/i4l/isdn_ciscohdlck.h b/drivers/isdn/i4l/isdn_ciscohdlck.h index 80a205e88f27d50f32f58422417568079675800d..e60c959f9f4b5f2f53b28487742f5f2ce8b6b4a5 100644 --- a/drivers/isdn/i4l/isdn_ciscohdlck.h +++ b/drivers/isdn/i4l/isdn_ciscohdlck.h @@ -14,7 +14,5 @@ int isdn_ciscohdlck_setup(isdn_net_dev *p); void isdn_ciscohdlck_connected(isdn_net_local *lp); void isdn_ciscohdlck_disconnected(isdn_net_local *lp); -void isdn_ciscohdlck_receive(isdn_net_dev *p, isdn_net_local *olp, - struct sk_buff *skb); #endif diff --git a/drivers/isdn/i4l/isdn_concap.c b/drivers/isdn/i4l/isdn_concap.c index 8791ed0e6d452b7b375805a1add090931df4c71e..4b5b1f1d48b811c47d52854704bc9a2e02f9ef41 100644 --- a/drivers/isdn/i4l/isdn_concap.c +++ b/drivers/isdn/i4l/isdn_concap.c @@ -124,32 +124,6 @@ void isdn_x25_cleanup(isdn_net_dev *p) restore_flags(flags); } -int isdn_x25_setup(isdn_net_dev *p, int encap) -{ - isdn_net_local *lp = &p->local; - - /* ... , prepare for configuration of new one ... */ - switch ( encap ){ - case ISDN_NET_ENCAP_X25IFACE: - lp -> dops = &isdn_concap_reliable_dl_dops; - } - /* ... and allocate new one ... */ - p -> cprot = isdn_concap_new( cfg -> p_encap ); - /* p -> cprot == NULL now if p_encap is not supported - by means of the concap_proto mechanism */ - if (!p->cprot) - return -EINVAL; - - isdn_other_setup(p); - p->dev.type = ARPHRD_X25; /* change ARP type */ - p->dev.addr_len = 0; - - /* the protocol is not configured yet; this will - happen later when isdn_x25_open() is called */ - - return 0; -} - void isdn_x25_open(struct net_device *dev) { struct concap_device_ops * dops = @@ -247,7 +221,8 @@ int isdn_x25_start_xmit(struct sk_buff *skb, struct net_device *dev) return ret; } -void isdn_x25_receive(isdn_net_dev *p, isdn_net_local *olp, struct sk_buff *skb) +static void +isdn_x25_receive(isdn_net_dev *p, isdn_net_local *olp, struct sk_buff *skb) { isdn_net_local *lp = &p->local; struct concap_proto *cprot = lp -> netdev -> cprot; @@ -267,4 +242,33 @@ void isdn_x25_realrm(isdn_net_dev *p) p -> cprot -> pops -> proto_del ( p -> cprot ); } +int isdn_x25_setup(isdn_net_dev *p, int encap) +{ + isdn_net_local *lp = &p->local; + + /* ... , prepare for configuration of new one ... */ + switch ( encap ){ + case ISDN_NET_ENCAP_X25IFACE: + lp -> dops = &isdn_concap_reliable_dl_dops; + } + /* ... and allocate new one ... */ + p -> cprot = isdn_concap_new( cfg -> p_encap ); + /* p -> cprot == NULL now if p_encap is not supported + by means of the concap_proto mechanism */ + if (!p->cprot) + return -EINVAL; + + p->dev.type = ARPHRD_X25; /* change ARP type */ + p->dev.addr_len = 0; + p->dev.hard_header = NULL; + p->dev.hard_header_cache = NULL; + p->dev.header_cache_update = NULL; + p->local.receive = isdn_x25_receive; + + /* the protocol is not configured yet; this will + happen later when isdn_x25_open() is called */ + + return 0; +} + #endif /* CONFIG_ISDN_X25 */ diff --git a/drivers/isdn/i4l/isdn_concap.h b/drivers/isdn/i4l/isdn_concap.h index fe3dd44bf1e09351c58ddf21a6b5879bcc9874a4..6460579d8f5f3908ae2a7278a2afe05cbd0f2712 100644 --- a/drivers/isdn/i4l/isdn_concap.h +++ b/drivers/isdn/i4l/isdn_concap.h @@ -22,7 +22,6 @@ void isdn_x25_connected(isdn_net_local *lp); void isdn_x25_bhup(isdn_net_local *lp); void isdn_x25_hangup(isdn_net_local *lp); int isdn_x25_start_xmit(struct sk_buff *skb, struct net_device *dev); -void isdn_x25_receive(isdn_net_dev *p, isdn_net_local *olp, struct sk_buff *skb); void isdn_x25_realrm(isdn_net_dev *p); #else @@ -75,11 +74,6 @@ isdn_x25_start_xmit(struct sk_buff *skb, struct net_device *dev) return 0; } -static inline void -isdn_x25_receive(isdn_net_dev *p, isdn_net_local *olp, struct sk_buff *skb) -{ -} - static inline void isdn_x25_realrm(isdn_net_dev *p) { diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c index 49772834e07761c4c0f27cefdf0514ac861cd500..778af7b96b960b61493538b3a59e967d29001e5f 100644 --- a/drivers/isdn/i4l/isdn_net.c +++ b/drivers/isdn/i4l/isdn_net.c @@ -210,11 +210,6 @@ static int isdn_ether_setup(isdn_net_dev *p); static int isdn_uihdlc_setup(isdn_net_dev *p); static int isdn_iptyp_setup(isdn_net_dev *p); -static void isdn_rawip_receive(isdn_net_dev *p, isdn_net_local *olp, struct sk_buff *skb); -static void isdn_ether_receive(isdn_net_dev *p, isdn_net_local *olp, struct sk_buff *skb); -static void isdn_uihdlc_receive(isdn_net_dev *p, isdn_net_local *olp, struct sk_buff *skb); -static void isdn_iptyp_receive(isdn_net_dev *p, isdn_net_local *olp, struct sk_buff *skb); - char *isdn_net_revision = "$Revision: 1.140.6.11 $"; /* @@ -1228,34 +1223,8 @@ isdn_net_receive(struct net_device *ndev, struct sk_buff *skb) skb->pkt_type = PACKET_HOST; skb->mac.raw = skb->data; isdn_dumppkt("R:", skb->data, skb->len, 40); - switch (lp->p_encap) { - case ISDN_NET_ENCAP_ETHER: - isdn_ether_receive(lp->netdev, olp, skb); - break; - case ISDN_NET_ENCAP_UIHDLC: - isdn_uihdlc_receive(lp->netdev, olp, skb); - break; - case ISDN_NET_ENCAP_RAWIP: - isdn_rawip_receive(lp->netdev, olp, skb); - break; - case ISDN_NET_ENCAP_CISCOHDLCK: - case ISDN_NET_ENCAP_CISCOHDLC: - isdn_ciscohdlck_receive(lp->netdev, olp, skb); - break; - case ISDN_NET_ENCAP_IPTYP: - isdn_iptyp_receive(lp->netdev, olp, skb); - break; - case ISDN_NET_ENCAP_SYNCPPP: - isdn_ppp_receive(lp->netdev, olp, skb); - break; - case ISDN_NET_ENCAP_X25IFACE: - isdn_x25_receive(lp->netdev, olp, skb); - break; - default: - isdn_BUG(); - kfree_skb(skb); - break; - } + + lp->receive(lp->netdev, olp, skb); } /* @@ -2514,6 +2483,7 @@ isdn_iptyp_setup(isdn_net_dev *p) p->dev.hard_header_cache = NULL; p->dev.header_cache_update = NULL; p->dev.flags = IFF_NOARP|IFF_POINTOPOINT; + p->local.receive = isdn_iptyp_receive; return 0; } @@ -2550,6 +2520,7 @@ isdn_uihdlc_setup(isdn_net_dev *p) p->dev.hard_header_cache = NULL; p->dev.header_cache_update = NULL; p->dev.flags = IFF_NOARP|IFF_POINTOPOINT; + p->local.receive = isdn_uihdlc_receive; return 0; } @@ -2576,6 +2547,7 @@ isdn_rawip_setup(isdn_net_dev *p) p->dev.hard_header_cache = NULL; p->dev.header_cache_update = NULL; p->dev.flags = IFF_NOARP|IFF_POINTOPOINT; + p->local.receive = isdn_rawip_receive; return 0; } @@ -2656,6 +2628,7 @@ isdn_ether_setup(isdn_net_dev *p) p->dev.hard_header_cache = eth_header_cache; p->dev.header_cache_update = eth_header_cache_update; p->dev.flags = IFF_BROADCAST | IFF_MULTICAST; + p->local.receive = isdn_ether_receive; return 0; } diff --git a/drivers/isdn/i4l/isdn_ppp.c b/drivers/isdn/i4l/isdn_ppp.c index 46d538860b791fa061d2e42ceaef0264b2198356..d955b6292a8c9f83a371a95b8dc675a54fc91f11 100644 --- a/drivers/isdn/i4l/isdn_ppp.c +++ b/drivers/isdn/i4l/isdn_ppp.c @@ -962,7 +962,8 @@ static int isdn_ppp_strip_proto(struct sk_buff *skb) /* * handler for incoming packets on a syncPPP interface */ -void isdn_ppp_receive(isdn_net_dev * net_dev, isdn_net_local * lp, struct sk_buff *skb) +static void isdn_ppp_receive(isdn_net_dev *net_dev, isdn_net_local *lp, + struct sk_buff *skb) { struct ippp_struct *is; int slot; @@ -2914,7 +2915,8 @@ isdn_ppp_header(struct sk_buff *skb, struct net_device *dev, -int isdn_ppp_setup(isdn_net_dev *p) +int +isdn_ppp_setup(isdn_net_dev *p) { p->dev.hard_header = isdn_ppp_header; p->dev.hard_header_cache = NULL; @@ -2923,6 +2925,7 @@ int isdn_ppp_setup(isdn_net_dev *p) p->dev.type = ARPHRD_PPP; /* change ARP type */ p->dev.addr_len = 0; p->dev.do_ioctl = isdn_ppp_dev_ioctl; + p->local.receive = isdn_ppp_receive; return 0; } diff --git a/drivers/isdn/i4l/isdn_ppp.h b/drivers/isdn/i4l/isdn_ppp.h index ab3055a209922c04f2f1e35971ed497e36e4c0b2..7e734ed16a293bd444c1d2dca4e612852f2c5e13 100644 --- a/drivers/isdn/i4l/isdn_ppp.h +++ b/drivers/isdn/i4l/isdn_ppp.h @@ -25,7 +25,6 @@ int isdn_ppp_setup(isdn_net_dev *p); void isdn_ppp_wakeup_daemon(isdn_net_local *); int isdn_ppp_bind(isdn_net_local *); void isdn_ppp_free(isdn_net_local *); -void isdn_ppp_receive(isdn_net_dev *, isdn_net_local *, struct sk_buff *); int isdn_ppp_xmit(struct sk_buff *, struct net_device *); #else @@ -53,11 +52,6 @@ isdn_ppp_free(isdn_net_local *lp) { } -static inline void -isdn_ppp_receive(isdn_net_dev *, isdn_net_local *, struct sk_buff *) -{ -} - static inline int isdn_ppp_xmit(struct sk_buff *, struct net_device *); { diff --git a/include/linux/isdn.h b/include/linux/isdn.h index 035d11f9463c6eee8d2d8a05927d58be6aa207a8..c347a67a090a8a38080b5f828804e1c852333dbe 100644 --- a/include/linux/isdn.h +++ b/include/linux/isdn.h @@ -371,6 +371,9 @@ typedef struct isdn_net_local_s { char cisco_debserint; /* debugging flag of cisco hdlc with slarp */ struct timer_list cisco_timer; struct tq_struct tqueue; + void (*receive)(struct isdn_net_dev_s *p, + struct isdn_net_local_s *olp, + struct sk_buff *skb); } isdn_net_local; /* the interface itself */