本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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");
}
示例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;
}
示例14: tipc_bearer_setup
int tipc_bearer_setup(void)
{
int err;
err = register_netdevice_notifier(¬ifier);
if (err)
return err;
dev_add_pack(&tipc_packet_type);
return 0;
}
示例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;
}