• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ dev_add_pack函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: fsm_dev_open

/******************************************************************************
 ** Function name:DyS_dist_mac_net_device_open
 ** Descriptions:called when we use ifconfig up
 ** Input: 
 ** Output: 
 ** Returns: 
 ** Created by: 
 ** Created Date:2010/07/07 
 **-------------------------------------- --------------------
 ** Modified by:
 ** Modified Date: 
 ******************************************************************************/
int fsm_dev_open(struct net_device *dev)
{
    /*-----------------now we need to register the special protocol_type */
	fsm_core_intf_set(STRM_TO_MAC, DEV_INTF_IND, DEV_PROTO_MAC, "LTE_MAC0");
	fsm_core_intf_set(STRM_TO_ETH, DEV_INTF_REQ, DEV_PROTO_SRIO, "eth0");
    dev_add_pack(&pk_t); 
	netif_start_queue(dev);   
    fsm_core_open();	 
    return 0;    
}
开发者ID:yugefei,项目名称:LTE-SRIO,代码行数:22,代码来源:virtual_srio.c


示例17: fsm_dev_open

/******************************************************************************
 ** Function name:DyS_dist_mac_net_device_open
 ** Descriptions:called when we use ifconfig up
 ** Input: 
 ** Output: 
 ** Returns: 
 ** Created by: 
 ** Created Date:2010/07/07 
 **-------------------------------------- --------------------
 ** Modified by:
 ** Modified Date: 
 ******************************************************************************/
int fsm_dev_open(struct net_device *dev)
{		
    /*-----------------now we need to register the special protocol_type */
	fsm_core_intf_set(STRM_TO_IP, DEV_INTF_IND, DEV_PROTO_IP, NULL);	
	fsm_core_intf_set(STRM_TO_PDCP, DEV_INTF_REQ, DEV_PROTO_IPADP, "LTE_PDCP0");
	//fsm_core_intf_set(STRM_TO_RLC, DEV_INTF_REQ, DEV_PROTO_IPADP, "LTE_RLC0");
	fsm_core_intf_set(STRM_TO_MAC, DEV_INTF_REQ, DEV_PROTO_IPADP, "LTE_MAC0");
    	dev_add_pack(&pk_t); 
	netif_start_queue(dev);   
    	fsm_core_open();	 
    	return 0;    
}
开发者ID:yugefei,项目名称:LTE-SRIO,代码行数:24,代码来源:ipadp_module.c


示例18: mpls_enable

void mpls_enable(void)
{
	if( !mpls_forward_on )
	{
		dev_add_pack(&mpls_uc_ptype);
		mpls_forward_on = 1 ;
	}

	if (SWITCHOVER_MAIN_BOARD)
	{
		MPLS_NOTIFY_SEND(enable);
	}
}
开发者ID:millken,项目名称:zhuxianB30,代码行数:13,代码来源:mpls.c


示例19: sniff_open

// sniff device open function
int sniff_open(struct inode *i, struct file *f){

	printk("Opening IPSniff device\n");

	dev_add_pack(&sniff_hook);
	
	if((rules=(filter_t *)kmalloc(sizeof(filter_t)*10,GFP_KERNEL))==NULL){
		printk("Unable to allocate mem to filter\n");
		return -1;
	}
//	MOD_INC_USE_COUNT;
	return 0;
}
开发者ID:jiga,项目名称:IPSniff,代码行数:14,代码来源:ipsniff_drv.c


示例20: preIP_Init

/* Pre IP Protocol Init */
int __init preIP_Init(void)
{
#ifdef PRE_IP_DEBUG
    printk("preIP_Init: in\n");
#endif
    preip_nlfd = netlink_kernel_create(&init_net, NETLINK_PREIP,1, nl_preip_receive, NULL, THIS_MODULE);
    if (preip_nlfd == NULL) {
        printk("%s: failed to create netlink socket\n",__func__);
        return -EBUSY;
    }
    dev_add_pack(&preIP_packet_type);
	
    return 0;
}
开发者ID:jhbsz,项目名称:cpe-1,代码行数:15,代码来源:preip_host_module.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ dev_alloc_skb函数代码示例发布时间:2022-05-30
下一篇:
C++ dev_add_bb_dev函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap