}
struct isdn_netif_ops ciscohdlck_ops = {
+ .hard_start_xmit = isdn_net_start_xmit,
.hard_header = isdn_ciscohdlck_header,
.do_ioctl = isdn_ciscohdlck_dev_ioctl,
.flags = IFF_NOARP | IFF_POINTOPOINT,
*/
-int isdn_concap_dl_data_req(struct concap_proto *concap, struct sk_buff *skb)
+static int
+isdn_concap_dl_data_req(struct concap_proto *concap, struct sk_buff *skb)
{
struct net_device *ndev = concap -> net_dev;
isdn_net_dev *nd = ((isdn_net_local *) ndev->priv)->netdev;
}
-int isdn_concap_dl_connect_req(struct concap_proto *concap)
+static int
+isdn_concap_dl_connect_req(struct concap_proto *concap)
{
struct net_device *ndev = concap -> net_dev;
isdn_net_local *lp = (isdn_net_local *) ndev->priv;
return ret;
}
-int isdn_concap_dl_disconn_req(struct concap_proto *concap)
+static int
+isdn_concap_dl_disconn_req(struct concap_proto *concap)
{
IX25DEBUG( "isdn_concap_dl_disconn_req: %s \n", concap -> net_dev -> name);
this sourcefile does not need to include any protocol specific header
files. For now:
*/
-struct concap_proto * isdn_concap_new( int encap )
+struct concap_proto *
+isdn_concap_new( int encap )
{
switch ( encap ) {
case ISDN_NET_ENCAP_X25IFACE:
pops -> disconn_ind(cprot);
}
-int
+static int
isdn_x25_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
/* At this point hard_start_xmit() passes control to the encapsulation
restore_flags(flags);
}
-void isdn_x25_realrm(isdn_net_dev *p)
-{
- if( p -> cprot && p -> cprot -> pops )
- p -> cprot -> pops -> proto_del ( p -> cprot );
-}
-
struct isdn_netif_ops isdn_x25_ops = {
+ .hard_start_xmit = isdn_x25_start_xmit,
.flags = IFF_NOARP | IFF_POINTOPOINT,
.type = ARPHRD_X25,
.receive = isdn_x25_receive,
struct concap_proto *isdn_concap_new(int);
-#ifdef CONFIG_ISDN_X25
-
extern struct isdn_netif_ops isdn_x25_ops;
-
-int isdn_x25_start_xmit(struct sk_buff *skb, struct net_device *dev);
-
-#else
-
-static inline int
-isdn_x25_start_xmit(struct sk_buff *skb, struct net_device *dev)
-{
- return 0;
-}
-
-#endif
/* Prototypes */
static int isdn_net_force_dial_idev(isdn_net_dev *);
-static int isdn_net_start_xmit(struct sk_buff *, struct net_device *);
static void do_dialout(isdn_net_dev *idev);
static int isdn_net_handle_event(isdn_net_dev *idev, int pr, void *arg);
static int isdn_net_set_encap(isdn_net_local *mlp, int encap);
/*
- * Helper function for isdn_net_start_xmit.
- * When called, the connection is already established.
* Based on cps-calculation, check if device is overloaded.
* If so, and if a slave exists, trigger dialing for it.
* If any slave is online, deliver packets using a simple round robin
* Return: 0 on success, !0 on failure.
*/
-static int
-isdn_net_xmit(struct net_device *ndev, struct sk_buff *skb)
+int
+isdn_net_start_xmit(struct sk_buff *skb, struct net_device *ndev)
{
isdn_net_dev *idev, *sdev;
isdn_net_local *mlp = ndev->priv;
if (list_empty(&mlp->online))
return isdn_net_autodial(skb, ndev);
- /* For the other encaps the header has already been built */
- if (mlp->p_encap == ISDN_NET_ENCAP_SYNCPPP) {
- return isdn_ppp_xmit(skb, ndev);
- }
idev = isdn_net_get_locked_dev(mlp);
if (!idev) {
printk(KERN_WARNING "%s: all channels busy - requeuing!\n", ndev->name);
}
-/*
- * Try sending a packet.
- * If this interface isn't connected to a ISDN-Channel, find a free channel,
- * and start dialing.
- */
-static int
-isdn_net_start_xmit(struct sk_buff *skb, struct net_device *ndev)
-{
- if (mlp->p_encap == ISDN_NET_ENCAP_X25IFACE)
- return isdn_x25_start_xmit(skb, ndev);
-
- /* ISDN connection is established, try sending */
- if (mlp->p_encap == ISDN_NET_ENCAP_SYNCPPP)
- return isdn_ppp_xmit(skb, ndev);
-
- return isdn_net_xmit(skb, ndev);
-}
-
/*
* Shutdown a net-interface.
*/
ndev->mtu = 1500;
ndev->tx_queue_len = 10;
ndev->open = &isdn_net_open;
- ndev->hard_start_xmit = &isdn_net_start_xmit;
ndev->hard_header_len = ETH_HLEN + isdn_hard_header_len();
ndev->stop = &isdn_net_close;
ndev->get_stats = &isdn_net_get_stats;
lp->p_encap = encap;
lp->ops = netif_ops[encap];
+ lp->dev.hard_start_xmit = lp->ops->hard_start_xmit;
lp->dev.hard_header = lp->ops->hard_header;
lp->dev.do_ioctl = lp->ops->do_ioctl;
lp->dev.flags = lp->ops->flags;
}
static struct isdn_netif_ops iptyp_ops = {
+ .hard_start_xmit = isdn_net_start_xmit,
.hard_header = isdn_iptyp_header,
.flags = IFF_NOARP | IFF_POINTOPOINT,
.type = ARPHRD_PPP,
}
static struct isdn_netif_ops uihdlc_ops = {
+ .hard_start_xmit = isdn_net_start_xmit,
.hard_header = isdn_uihdlc_header,
.flags = IFF_NOARP | IFF_POINTOPOINT,
.type = ARPHRD_HDLC,
}
static struct isdn_netif_ops rawip_ops = {
+ .hard_start_xmit = isdn_net_start_xmit,
.flags = IFF_NOARP | IFF_POINTOPOINT,
.type = ARPHRD_PPP,
.receive = isdn_rawip_receive,
}
static struct isdn_netif_ops ether_ops = {
+ .hard_start_xmit = isdn_net_start_xmit,
.hard_header = eth_header,
.receive = isdn_ether_receive,
.init = isdn_ether_init,
extern void isdn_net_write_super(isdn_net_dev *, struct sk_buff *skb);
extern int isdn_net_online(isdn_net_dev *);
extern int isdn_net_autodial(struct sk_buff *skb, struct net_device *ndev);
+extern int isdn_net_start_xmit(struct sk_buff *skb, struct net_device *ndev);
#define ISDN_NET_MAX_QUEUE_LENGTH 2
* skb isn't allowed!!
*/
-int
-isdn_ppp_xmit(struct sk_buff *skb, struct net_device *netdev)
+static int
+isdn_ppp_start_xmit(struct sk_buff *skb, struct net_device *ndev)
{
- isdn_net_local *mlp = netdev->priv;
+ isdn_net_local *mlp = ndev->priv;
isdn_net_dev *idev = list_entry(mlp->online.next, isdn_net_dev, online);
unsigned int proto = PPP_IP; /* 0x21 */
struct ippp_struct *ipt,*ipts;
if (!(ipts->pppcfg & SC_ENABLE_IP)) { /* PPP connected ? */
if (ipts->debug & 0x1)
- printk(KERN_INFO "%s: IP frame delayed.\n", netdev->name);
+ printk(KERN_INFO "%s: IP frame delayed.\n", ndev->name);
netif_stop_queue(ndev);
return 1;
}
idev = isdn_net_get_locked_dev(mlp);
if (!idev) {
- printk(KERN_WARNING "%s: all channels busy - requeuing!\n", netdev->name);
+ printk(KERN_WARNING "%s: all channels busy - requeuing!\n", ndev->name);
netif_stop_queue(ndev);
return 1;
}
}
struct isdn_netif_ops isdn_ppp_ops = {
+ .hard_start_xmit = isdn_ppp_start_xmit,
.hard_header = isdn_ppp_header,
.do_ioctl = isdn_ppp_dev_ioctl,
.flags = IFF_NOARP | IFF_POINTOPOINT,
extern int isdn_ppp_dial_slave(char *);
extern int isdn_ppp_hangup_slave(char *);
-#ifdef CONFIG_ISDN_PPP
-
-int isdn_ppp_xmit(struct sk_buff *, struct net_device *);
-
-#else
-
-static inline int
-isdn_ppp_xmit(struct sk_buff *, struct net_device *);
-{
- return 0;
-}
-
-#endif
-
#define IPPP_OPEN 0x01
#define IPPP_CONNECT 0x02
#define IPPP_CLOSEWAIT 0x04
struct isdn_net_local_s;
struct isdn_netif_ops {
+ int (*hard_start_xmit) (struct sk_buff *skb,
+ struct net_device *dev);
int (*hard_header) (struct sk_buff *skb,
struct net_device *dev,
unsigned short type,