static int syncppp_exit(struct net_device *dev) { struct comx_channel *ch = dev->priv; sppp_detach(dev); dev->flags = 0; dev->type = 0; dev->mtu = 0; ch->LINE_rx = NULL; ch->LINE_tx = NULL; ch->LINE_status = NULL; ch->LINE_open = NULL; ch->LINE_close = NULL; ch->LINE_xmit = NULL; ch->LINE_header = NULL; ch->LINE_rebuild_header = NULL; ch->LINE_statistics = NULL; kfree(ch->LINE_privdata); ch->LINE_privdata = NULL; MOD_DEC_USE_COUNT; return 0; }
static int ppp_open(struct net_device *dev) { hdlc_device *hdlc = dev_to_hdlc(dev); int (*old_ioctl)(struct net_device *, struct ifreq *, int); int result; dev->ml_priv = &state(hdlc)->syncppp_ptr; state(hdlc)->syncppp_ptr = &state(hdlc)->pppdev; state(hdlc)->pppdev.dev = dev; old_ioctl = dev->do_ioctl; state(hdlc)->old_change_mtu = dev->change_mtu; sppp_attach(&state(hdlc)->pppdev); /* sppp_attach nukes them. We don't need syncppp's ioctl */ dev->do_ioctl = old_ioctl; state(hdlc)->pppdev.sppp.pp_flags &= ~PP_CISCO; dev->type = ARPHRD_PPP; result = sppp_open(dev); if (result) { sppp_detach(dev); return result; } return 0; }
static int ppp_open(hdlc_device *hdlc) { struct net_device *dev = hdlc_to_dev(hdlc); void *old_ioctl; int result; dev->priv = &hdlc->state.ppp.syncppp_ptr; hdlc->state.ppp.syncppp_ptr = &hdlc->state.ppp.pppdev; hdlc->state.ppp.pppdev.dev = dev; old_ioctl = dev->do_ioctl; hdlc->state.ppp.old_change_mtu = dev->change_mtu; sppp_attach(&hdlc->state.ppp.pppdev); /* sppp_attach nukes them. We don't need syncppp's ioctl */ dev->do_ioctl = old_ioctl; hdlc->state.ppp.pppdev.sppp.pp_flags &= ~PP_CISCO; dev->type = ARPHRD_PPP; result = sppp_open(dev); if (result) { sppp_detach(dev); return result; } return 0; }
static int hdlc_close(struct net_device *dev) { hdlc_device *hdlc = dev_to_hdlc(dev); hdlc->close(hdlc); if (mode_is(hdlc, MODE_FR | MODE_SOFT) || mode_is(hdlc, MODE_CISCO | MODE_SOFT)) fr_cisco_close(hdlc); #ifdef CONFIG_HDLC_PPP else if (mode_is(hdlc, MODE_PPP | MODE_SOFT)) { sppp_close(dev); sppp_detach(dev); dev->rebuild_header = NULL; dev->change_mtu = hdlc_change_mtu; dev->mtu = HDLC_MAX_MTU; dev->hard_header_len = 16; } #endif #ifdef CONFIG_HDLC_X25 else if (mode_is(hdlc, MODE_X25)) lapb_unregister(hdlc); #endif return 0; }
static int hdlc_open(struct device *dev) { hdlc_device *hdlc=dev_to_hdlc(dev); int result; if (hdlc->mode==MODE_NONE) return -ENOSYS; memset(&(hdlc->stats), 0, sizeof(struct net_device_stats)); if (mode_is(hdlc, MODE_FR | MODE_SOFT) || mode_is(hdlc, MODE_CISCO | MODE_SOFT)) fr_cisco_open(hdlc); else if (mode_is(hdlc, MODE_PPP | MODE_SOFT)) { sppp_attach(&hdlc->pppdev); /* sppp_attach nukes them. We don't need syncppp's ioctl */ /* Anyway, I'm going to replace it with ppp_synctty.c */ dev->do_ioctl = hdlc_ioctl; hdlc->pppdev.sppp.pp_flags&=~PP_CISCO; dev->type=ARPHRD_PPP; result = sppp_open(dev); if (result) { sppp_detach(dev); return result; } } result=hdlc->open(hdlc); if (result) { if (mode_is(hdlc, MODE_FR | MODE_SOFT) || mode_is(hdlc, MODE_CISCO | MODE_SOFT)) fr_cisco_close(hdlc); else if (mode_is(hdlc, MODE_PPP | MODE_SOFT)) { sppp_close(dev); sppp_detach(dev); dev->rebuild_header=NULL; dev->change_mtu=hdlc_change_mtu; dev->mtu=HDLC_MAX_MTU; dev->hard_header_len=16; } } return result; }
void wanpipe_generic_unregister(struct ifnet *ifp) { log(LOG_INFO, "%s: Unregister interface!\n", ifp->if_xname); sppp_detach(ifp); if_free_sadl(ifp); if_detach(ifp); }
static void ppp_close(struct net_device *dev) { hdlc_device *hdlc = dev_to_hdlc(dev); sppp_close(dev); sppp_detach(dev); dev->change_mtu = state(hdlc)->old_change_mtu; dev->mtu = HDLC_MAX_MTU; dev->hard_header_len = 16; }
static void ppp_close(hdlc_device *hdlc) { struct net_device *dev = hdlc_to_dev(hdlc); sppp_close(dev); sppp_detach(dev); dev->rebuild_header = NULL; dev->change_mtu = hdlc->state.ppp.old_change_mtu; dev->mtu = HDLC_MAX_MTU; dev->hard_header_len = 16; }
static int hdlc_close(struct device *dev) { hdlc_device *hdlc=dev_to_hdlc(dev); hdlc->close(hdlc); if (mode_is(hdlc, MODE_FR | MODE_SOFT) || mode_is(hdlc, MODE_CISCO | MODE_SOFT)) fr_cisco_close(hdlc); else if (mode_is(hdlc, MODE_PPP | MODE_SOFT)) { sppp_close(dev); sppp_detach(dev); dev->rebuild_header=NULL; dev->change_mtu=hdlc_change_mtu; dev->mtu=HDLC_MAX_MTU; dev->hard_header_len=16; } return 0; }
static int hdlc_open(struct net_device *dev) { hdlc_device *hdlc = dev_to_hdlc(dev); int result; if (hdlc->mode == MODE_NONE) return -ENOSYS; memset(&(hdlc->stats), 0, sizeof(struct net_device_stats)); if (mode_is(hdlc, MODE_FR | MODE_SOFT) || mode_is(hdlc, MODE_CISCO | MODE_SOFT)) fr_cisco_open(hdlc); #ifdef CONFIG_HDLC_PPP else if (mode_is(hdlc, MODE_PPP | MODE_SOFT)) { sppp_attach(&hdlc->pppdev); /* sppp_attach nukes them. We don't need syncppp's ioctl */ dev->do_ioctl = hdlc_ioctl; hdlc->pppdev.sppp.pp_flags &= ~PP_CISCO; dev->type = ARPHRD_PPP; result = sppp_open(dev); if (result) { sppp_detach(dev); return result; } } #endif #ifdef CONFIG_HDLC_X25 else if (mode_is(hdlc, MODE_X25)) { struct lapb_register_struct cb; cb.connect_confirmation = x25_connected; cb.connect_indication = x25_connected; cb.disconnect_confirmation = x25_disconnected; cb.disconnect_indication = x25_disconnected; cb.data_indication = x25_data_indication; cb.data_transmit = x25_data_transmit; result = lapb_register(hdlc, &cb); if (result != LAPB_OK) return result; } #endif result = hdlc->open(hdlc); if (result) { if (mode_is(hdlc, MODE_FR | MODE_SOFT) || mode_is(hdlc, MODE_CISCO | MODE_SOFT)) fr_cisco_close(hdlc); #ifdef CONFIG_HDLC_PPP else if (mode_is(hdlc, MODE_PPP | MODE_SOFT)) { sppp_close(dev); sppp_detach(dev); dev->rebuild_header = NULL; dev->change_mtu = hdlc_change_mtu; dev->mtu = HDLC_MAX_MTU; dev->hard_header_len = 16; } #endif #ifdef CONFIG_HDLC_X25 else if (mode_is(hdlc, MODE_X25)) lapb_unregister(hdlc); #endif } return result; }