当前位置: 首页>>代码示例>>C++>>正文


C++ dev_add_pack函数代码示例

本文整理汇总了C++中dev_add_pack函数的典型用法代码示例。如果您正苦于以下问题:C++ dev_add_pack函数的具体用法?C++ dev_add_pack怎么用?C++ dev_add_pack使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了dev_add_pack函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: llc_init

static int __init llc_init(void)
{
	if (dev_base->next)
		memcpy(llc_station_mac_sa, dev_base->next->dev_addr, ETH_ALEN);
	else
		memset(llc_station_mac_sa, 0, ETH_ALEN);
	dev_add_pack(&llc_packet_type);
	dev_add_pack(&llc_tr_packet_type);
	return 0;
}
开发者ID:FelipeFernandes1988,项目名称:Alice-1121-Modem,代码行数:10,代码来源:llc_core.c

示例2: llc_init

static int __init llc_init(void)
{
	struct net_device *dev;

	dev = first_net_device(&init_net);
	if (dev != NULL)
		dev = next_net_device(dev);

	dev_add_pack(&llc_packet_type);
	dev_add_pack(&llc_tr_packet_type);
	return 0;
}
开发者ID:325116067,项目名称:semc-qsd8x50,代码行数:12,代码来源:llc_core.c

示例3: irda_init

/*
 * Function irda_init (void)
 *
 *  Protocol stack initialisation entry point.
 *  Initialise the various components of the IrDA stack
 */
int __init irda_init(void)
{
	IRDA_DEBUG(0, "%s()\n", __FUNCTION__);

	/* Lower layer of the stack */
 	irlmp_init();
	irlap_init();
	
	/* Higher layers of the stack */
	iriap_init();
 	irttp_init();
	irsock_init();
	
	/* Add IrDA packet type (Start receiving packets) */
        dev_add_pack(&irda_packet_type);

	/* External APIs */
#ifdef CONFIG_PROC_FS
	irda_proc_register();
#endif
#ifdef CONFIG_SYSCTL
	irda_sysctl_register();
#endif

	/* Driver/dongle support */
 	irda_device_init();

	return 0;
}
开发者ID:GodFox,项目名称:magx_kernel_xpixl,代码行数:35,代码来源:irmod.c

示例4: goose_init

/************************************************************
 * Module init procedure.
 ************************************************************/
static int __init goose_init(void)
{	
	printk("--------------------------------------\n");
	printk("GOOSE: Stand by.\n");

	printk("GOOSE: initiating proc file systems.\n");
	if (proc_fs_init() != 0) {
		printk("GOOSE: Fatal error in initializing proc_fs!\n");
		return -1;
	}
	
	printk("GOOSE: initiating netlink interface.\n");
	if (netlink_init() != 0) {
		printk("GOOSE: Fatal error in initializing netlink!\n");
		return -1;
	}

	/* initialize default dev*/
	def_dev = dev_get_by_name(&init_net, buf_proc_def_dev);
	
	if (def_dev == NULL) {
		printk("GOOSE: Can not find %s, choose another device.\n", buf_proc_def_dev);
	}

	/* register GOOSE protocol */
	dev_add_pack(&goose_packet_type);
	
	/* kernel_thread(daemon, NULL, 0); */

	return 0;
}
开发者ID:adrianohrl,项目名称:simple_goose,代码行数:34,代码来源:goose_main.c

示例5: os_gmac_init

/* @brief HIF GMAC init module */
int
os_gmac_init(void)
{
    hif_gmac_softc_t  *sc;

    init_wlan();
    
    sc = __gmac_pkt.af_packet_priv  = hif_gmac_init();
    
    sc->attach          = __gmac_defer_attach;
    sc->detach          = __gmac_detach;
    sc->discv  = __gmac_dev_discv;

    dev_add_pack(&__gmac_pkt);

    fwd_module_init();

    MpHtcInit();

    if (ath_create_htc_thread(NULL) != 0)
        printk(KERN_ERR "%s: create thread fail\n", __func__);

    /* register_netdevice_notifier(&__gmac_notifier); */

    return 0;
}
开发者ID:jorneytu,项目名称:wlan,代码行数:27,代码来源:if_ath_gmac.c

示例6: setup_bearer

/**
 * setup_bearer - setup association between InfiniBand bearer and interface
 */
static void setup_bearer(struct work_struct *work)
{
    struct ib_bearer *ib_ptr =
        container_of(work, struct ib_bearer, setup);

    dev_add_pack(&ib_ptr->tipc_packet_type);
}
开发者ID:yuwgit,项目名称:pmfs,代码行数:10,代码来源:ib_media.c

示例7: phonet_init

/* Module registration */
static int __init phonet_init(void)
{
    int err;

    err = phonet_device_init();
    if (err)
        return err;

    err = sock_register(&phonet_proto_family);
    if (err) {
        printk(KERN_ALERT
               "phonet protocol family initialization failed\n");
        goto err_sock;
    }

    dev_add_pack(&phonet_packet_type);
    phonet_sysctl_init();

    err = isi_register();
    if (err)
        goto err;
    return 0;

err:
    phonet_sysctl_exit();
    sock_unregister(PF_PHONET);
    dev_remove_pack(&phonet_packet_type);
err_sock:
    phonet_device_exit();
    return err;
}
开发者ID:jiacc0110,项目名称:Android-Froyo-Kernel-Source-v2.6.32.9,代码行数:32,代码来源:af_phonet.c

示例8: llc_init

static int __init llc_init(void)
{
	struct net_device *dev;

	dev = first_net_device(&init_net);
	if (dev != NULL)
		dev = next_net_device(dev);

	if (dev != NULL)
		memcpy(llc_station_mac_sa, dev->dev_addr, ETH_ALEN);
	else
		memset(llc_station_mac_sa, 0, ETH_ALEN);
	dev_add_pack(&llc_packet_type);
	dev_add_pack(&llc_tr_packet_type);
	return 0;
}
开发者ID:acassis,项目名称:emlinux-ssd1935,代码行数:16,代码来源:llc_core.c

示例9: vlan_proto_init

/*
 * Function vlan_proto_init (pro)
 *
 *    Initialize VLAN protocol layer, 
 *
 */
static int __init vlan_proto_init(void)
{
	int err;

	printk(VLAN_INF "%s v%u.%u %s\n",
	       vlan_fullname, vlan_version, vlan_release, vlan_copyright);
	printk(VLAN_INF "Other stuff added by %s\n",
	       vlan_buggyright);

	/* proc file system initialization */
	err = vlan_proc_init();
	if (err < 0) {
		printk(KERN_ERR 
		       "%s %s: can't create entry in proc filesystem!\n",
		       __FUNCTION__, VLAN_NAME);
		return 1;
	}

	dev_add_pack(&vlan_packet_type);

	/* Register us to receive netdevice events */
	register_netdevice_notifier(&vlan_notifier_block);

	vlan_ioctl_hook = vlan_ioctl_handler;

	return 0;
}
开发者ID:ProjectZeroSlackr,项目名称:linux-2.4.32-ipod,代码行数:33,代码来源:vlan.c

示例10: af_ieee802154_init

static int __init af_ieee802154_init(void)
{
	int rc = -EINVAL;

	rc = proto_register(&ieee802154_raw_prot, 1);
	if (rc)
		goto out;

	rc = proto_register(&ieee802154_dgram_prot, 1);
	if (rc)
		goto err_dgram;

	/* Tell SOCKET that we are alive */
	rc = sock_register(&ieee802154_family_ops);
	if (rc)
		goto err_sock;
	dev_add_pack(&ieee802154_packet_type);

	rc = 0;
	goto out;

err_sock:
	proto_unregister(&ieee802154_dgram_prot);
err_dgram:
	proto_unregister(&ieee802154_raw_prot);
out:
	return rc;
}
开发者ID:3null,项目名称:fastsocket,代码行数:28,代码来源:af_ieee802154.c

示例11: vlan_proto_init

/*
 * Function vlan_proto_init (pro)
 *
 *    Initialize VLAN protocol layer,
 *
 */
static int __init vlan_proto_init(void)
{
	int err;

	printk(VLAN_INF "%s v%s\n",
	       vlan_fullname, vlan_version);

	/* proc file system initialization */
	err = vlan_proc_init();
	if (err < 0) {
		printk(KERN_ERR
		       "%s: can't create entry in proc filesystem!\n",
		       __FUNCTION__);
		return err;
	}

	dev_add_pack(&vlan_packet_type);

	/* Register us to receive netdevice events */
	err = register_netdevice_notifier(&vlan_notifier_block);
	if (err < 0) {
		dev_remove_pack(&vlan_packet_type);
		vlan_proc_cleanup();
		return err;
	}

	vlan_ioctl_set(vlan_ioctl_handler);

	return 0;
}
开发者ID:qwerty1023,项目名称:wive-rtnl-firmware,代码行数:36,代码来源:vlan.c

示例12: disable_tarp

void disable_tarp(void)
{      
   dev_add_pack(arp_packet_type);
         
   printk(KERN_INFO "[arpsec_mod] disabled\n");
   printk(KERN_INFO "[arpsec_mod] kernel can now receive \"classic\" "\
                          "ARP packets\n");
}
开发者ID:daveti,项目名称:arpsec_gpc_pcap,代码行数:8,代码来源:arpsec_mod.c

示例13: vrr_init

//Initialize the module
static int __init vrr_init(void)
{
	/* 1. Initialize an empty routing table
	   2. create empty pset (tree/CLL?)
	   3. create empty vset (tree/CLL?)
	   4. create vrr_node structure
	   5. Initialize sysfs hooks ??
	   6. Build hello packet and send to establish a proxy 
	   7. There is probably alot more than this */

	int err;
	unsigned long tdelay;

	WARN_ATOMIC;

	VRR_INFO("Begin init");

	vrr_node_init();
	vrr_data_init();
	pset_state_init();
	vrr_init_rcv();

	err = proto_register(&vrr_proto, 1);
	if (err) {
		goto out;
	}

	/* Initialize routing/sysfs stuff here */
	/* TODO: Split these into separate functions */
	vrr_obj = kobject_create_and_add("vrr", kernel_kobj);
	if (!vrr_obj) {
		err = -ENOMEM;
		goto out;
	}

	err = sysfs_create_group(vrr_obj, &attr_group);
	if (err) {
		kobject_put(vrr_obj);
	}
	/* --- */

	/* Register our sockets protocol handler */
	err = sock_register(&vrr_family_ops);
	if (err) {
		goto out;
	}

	dev_add_pack(&vrr_packet_type);

	//start hello packet timer
	tdelay = jiffies + (VRR_HPKT_DELAY * HZ / 1000);
	mod_timer(&vrr_timer, tdelay);

	VRR_INFO("End init");

 out:
	return err;
}
开发者ID:carriercomm,项目名称:Alpaca-VRR,代码行数:59,代码来源:vrr_mod.c

示例14: tipc_bearer_setup

int tipc_bearer_setup(void)
{
	int err;

	err = register_netdevice_notifier(&notifier);
	if (err)
		return err;
	dev_add_pack(&tipc_packet_type);
	return 0;
}
开发者ID:7799,项目名称:linux,代码行数:10,代码来源:bearer.c

示例15: ztdeth_init

static int __init ztdeth_init(void)
{
	skb_queue_head_init(&skbs);

	dev_add_pack(&ztdeth_ptype);
	register_netdevice_notifier(&ztdeth_nblock);
	dahdi_dynamic_register_driver(&ztd_eth);

	return 0;
}
开发者ID:Evangileon,项目名称:dahdi,代码行数:10,代码来源:dahdi_dynamic_eth.c


注:本文中的dev_add_pack函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。