void init_node_cc(void) { static const CCObjCallback node_ccp_callback = { HTMLDOMNode_traverse, HTMLDOMNode_unlink, HTMLDOMNode_delete_cycle_collectable }; ccp_init(&node_ccp, &node_ccp_callback); }
void init_node_cc(void) { static const CCObjCallback node_ccp_callback = { HTMLDOMNode_unmark_if_purple, HTMLDOMNode_traverse, HTMLDOMNode_unlink }; ccp_init(&node_ccp, &node_ccp_callback); }
static int ccp_platform_probe(struct platform_device *pdev) { struct ccp_device *ccp; struct device *dev = &pdev->dev; struct resource *ior; int ret; ret = -ENOMEM; ccp = ccp_alloc_struct(dev); if (!ccp) goto e_err; ccp->dev_specific = NULL; ccp->get_irq = ccp_get_irqs; ccp->free_irq = ccp_free_irqs; ior = ccp_find_mmio_area(ccp); ccp->io_map = devm_ioremap_resource(dev, ior); if (IS_ERR(ccp->io_map)) { ret = PTR_ERR(ccp->io_map); goto e_free; } ccp->io_regs = ccp->io_map; if (!dev->dma_mask) dev->dma_mask = &dev->coherent_dma_mask; *(dev->dma_mask) = DMA_BIT_MASK(48); dev->coherent_dma_mask = DMA_BIT_MASK(48); if (of_property_read_bool(dev->of_node, "dma-coherent")) ccp->axcache = CACHE_WB_NO_ALLOC; else ccp->axcache = CACHE_NONE; dev_set_drvdata(dev, ccp); ret = ccp_init(ccp); if (ret) goto e_free; dev_notice(dev, "enabled\n"); return 0; e_free: kfree(ccp); e_err: dev_notice(dev, "initialization failed\n"); return ret; }
/** * Initialize the npppd_ppp instance * Set npppd_ppp#mru and npppd_ppp#phy_label before call this function. */ int ppp_init(npppd *pppd, npppd_ppp *_this) { PPP_ASSERT(_this != NULL); PPP_ASSERT(strlen(_this->phy_label) > 0); _this->id = -1; _this->ifidx = -1; _this->has_acf = 1; _this->recv_packet = ppp_recv_packet; _this->id = ppp_seq++; _this->pppd = pppd; lcp_init(&_this->lcp, _this); _this->mru = ppp_config_int(_this, "lcp.mru", DEFAULT_MRU); if (_this->outpacket_buf == NULL) { _this->outpacket_buf = malloc(_this->mru + 64); if (_this->outpacket_buf == NULL){ log_printf(LOG_ERR, "malloc() failed in %s(): %m", __func__); return -1; } } _this->adjust_mss = ppp_config_str_equal(_this, "ip.adjust_mss", "true", 0); #ifdef USE_NPPPD_PIPEX _this->use_pipex = ppp_config_str_equal(_this, "pipex.enabled", "true", 1); #endif /* load the logging configuration */ _this->log_dump_in = ppp_config_str_equal(_this, "log.in.pktdump", "true", 0); _this->log_dump_out = ppp_config_str_equal(_this, "log.out.pktdump", "true", 0); _this->ingress_filter = ppp_config_str_equal(_this, "ingress_filter", "true", 0); #ifdef USE_NPPPD_MPPE mppe_init(&_this->mppe, _this); #endif ccp_init(&_this->ccp, _this); ipcp_init(&_this->ipcp, _this); pap_init(&_this->pap, _this); chap_init(&_this->chap, _this); /* load the idle timer configuration */ _this->timeout_sec = ppp_config_int(_this, "idle_timeout", 0); if (!evtimer_initialized(&_this->idle_event)) evtimer_set(&_this->idle_event, ppp_idle_timeout, _this); _this->auth_timeout = ppp_config_int(_this, "auth.timeout", DEFAULT_AUTH_TIMEOUT); _this->lcp.echo_interval = ppp_config_int(_this, "lcp.echo_interval", DEFAULT_LCP_ECHO_INTERVAL); _this->lcp.echo_max_retries = ppp_config_int(_this, "lcp.echo_max_retries", DEFAULT_LCP_ECHO_MAX_RETRIES); _this->lcp.echo_retry_interval = ppp_config_int(_this, "lcp.echo_retry_interval", DEFAULT_LCP_ECHO_RETRY_INTERVAL); return 0; }