Release 4.7 net/ieee802154/netlink.c
/*
* Netlink interface for IEEE 802.15.4 stack
*
* Copyright 2007, 2008 Siemens AG
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* Written by:
* Sergey Lapin <slapin@ossfans.org>
* Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
* Maxim Osipov <maxim.osipov@siemens.com>
*/
#include <linux/kernel.h>
#include <linux/gfp.h>
#include <net/genetlink.h>
#include <linux/nl802154.h>
#include "ieee802154.h"
static unsigned int ieee802154_seq_num;
static DEFINE_SPINLOCK(ieee802154_seq_lock);
struct genl_family nl802154_family = {
.id = GENL_ID_GENERATE,
.hdrsize = 0,
.name = IEEE802154_NL_NAME,
.version = 1,
.maxattr = IEEE802154_ATTR_MAX,
};
/* Requests to userspace */
struct sk_buff *ieee802154_nl_create(int flags, u8 req)
{
void *hdr;
struct sk_buff *msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC);
unsigned long f;
if (!msg)
return NULL;
spin_lock_irqsave(&ieee802154_seq_lock, f);
hdr = genlmsg_put(msg, 0, ieee802154_seq_num++,
&nl802154_family, flags, req);
spin_unlock_irqrestore(&ieee802154_seq_lock, f);
if (!hdr) {
nlmsg_free(msg);
return NULL;
}
return msg;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
sergey lapin | sergey lapin | 72 | 76.60% | 1 | 25.00% |
dmitry eremin-baryshkov | dmitry eremin-baryshkov | 21 | 22.34% | 2 | 50.00% |
thomas graf | thomas graf | 1 | 1.06% | 1 | 25.00% |
| Total | 94 | 100.00% | 4 | 100.00% |
int ieee802154_nl_mcast(struct sk_buff *msg, unsigned int group)
{
struct nlmsghdr *nlh = nlmsg_hdr(msg);
void *hdr = genlmsg_data(nlmsg_data(nlh));
genlmsg_end(msg, hdr);
return genlmsg_multicast(&nl802154_family, msg, 0, group, GFP_ATOMIC);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
sergey lapin | sergey lapin | 36 | 62.07% | 1 | 16.67% |
hong zhi guo | hong zhi guo | 12 | 20.69% | 2 | 33.33% |
dmitry eremin-baryshkov | dmitry eremin-baryshkov | 6 | 10.34% | 1 | 16.67% |
johannes berg | johannes berg | 4 | 6.90% | 2 | 33.33% |
| Total | 58 | 100.00% | 6 | 100.00% |
struct sk_buff *ieee802154_nl_new_reply(struct genl_info *info,
int flags, u8 req)
{
void *hdr;
struct sk_buff *msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC);
if (!msg)
return NULL;
hdr = genlmsg_put_reply(msg, info,
&nl802154_family, flags, req);
if (!hdr) {
nlmsg_free(msg);
return NULL;
}
return msg;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
dmitry eremin-baryshkov | dmitry eremin-baryshkov | 75 | 98.68% | 1 | 50.00% |
thomas graf | thomas graf | 1 | 1.32% | 1 | 50.00% |
| Total | 76 | 100.00% | 2 | 100.00% |
int ieee802154_nl_reply(struct sk_buff *msg, struct genl_info *info)
{
struct nlmsghdr *nlh = nlmsg_hdr(msg);
void *hdr = genlmsg_data(nlmsg_data(nlh));
genlmsg_end(msg, hdr);
return genlmsg_reply(msg, info);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
dmitry eremin-baryshkov | dmitry eremin-baryshkov | 39 | 75.00% | 1 | 25.00% |
hong zhi guo | hong zhi guo | 12 | 23.08% | 2 | 50.00% |
johannes berg | johannes berg | 1 | 1.92% | 1 | 25.00% |
| Total | 52 | 100.00% | 4 | 100.00% |
static const struct genl_ops ieee8021154_ops[] = {
/* see nl-phy.c */
IEEE802154_DUMP(IEEE802154_LIST_PHY, ieee802154_list_phy,
ieee802154_dump_phy),
IEEE802154_OP(IEEE802154_ADD_IFACE, ieee802154_add_iface),
IEEE802154_OP(IEEE802154_DEL_IFACE, ieee802154_del_iface),
/* see nl-mac.c */
IEEE802154_OP(IEEE802154_ASSOCIATE_REQ, ieee802154_associate_req),
IEEE802154_OP(IEEE802154_ASSOCIATE_RESP, ieee802154_associate_resp),
IEEE802154_OP(IEEE802154_DISASSOCIATE_REQ, ieee802154_disassociate_req),
IEEE802154_OP(IEEE802154_SCAN_REQ, ieee802154_scan_req),
IEEE802154_OP(IEEE802154_START_REQ, ieee802154_start_req),
IEEE802154_DUMP(IEEE802154_LIST_IFACE, ieee802154_list_iface,
ieee802154_dump_iface),
IEEE802154_OP(IEEE802154_SET_MACPARAMS, ieee802154_set_macparams),
IEEE802154_OP(IEEE802154_LLSEC_GETPARAMS, ieee802154_llsec_getparams),
IEEE802154_OP(IEEE802154_LLSEC_SETPARAMS, ieee802154_llsec_setparams),
IEEE802154_DUMP(IEEE802154_LLSEC_LIST_KEY, NULL,
ieee802154_llsec_dump_keys),
IEEE802154_OP(IEEE802154_LLSEC_ADD_KEY, ieee802154_llsec_add_key),
IEEE802154_OP(IEEE802154_LLSEC_DEL_KEY, ieee802154_llsec_del_key),
IEEE802154_DUMP(IEEE802154_LLSEC_LIST_DEV, NULL,
ieee802154_llsec_dump_devs),
IEEE802154_OP(IEEE802154_LLSEC_ADD_DEV, ieee802154_llsec_add_dev),
IEEE802154_OP(IEEE802154_LLSEC_DEL_DEV, ieee802154_llsec_del_dev),
IEEE802154_DUMP(IEEE802154_LLSEC_LIST_DEVKEY, NULL,
ieee802154_llsec_dump_devkeys),
IEEE802154_OP(IEEE802154_LLSEC_ADD_DEVKEY, ieee802154_llsec_add_devkey),
IEEE802154_OP(IEEE802154_LLSEC_DEL_DEVKEY, ieee802154_llsec_del_devkey),
IEEE802154_DUMP(IEEE802154_LLSEC_LIST_SECLEVEL, NULL,
ieee802154_llsec_dump_seclevels),
IEEE802154_OP(IEEE802154_LLSEC_ADD_SECLEVEL,
ieee802154_llsec_add_seclevel),
IEEE802154_OP(IEEE802154_LLSEC_DEL_SECLEVEL,
ieee802154_llsec_del_seclevel),
};
static const struct genl_multicast_group ieee802154_mcgrps[] = {
[IEEE802154_COORD_MCGRP] = { .name = IEEE802154_MCAST_COORD_NAME, },
[IEEE802154_BEACON_MCGRP] = { .name = IEEE802154_MCAST_BEACON_NAME, },
};
int __init ieee802154_nl_init(void)
{
return genl_register_family_with_ops_groups(&nl802154_family,
ieee8021154_ops,
ieee802154_mcgrps);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johannes berg | johannes berg | 10 | 52.63% | 2 | 50.00% |
sergey lapin | sergey lapin | 6 | 31.58% | 1 | 25.00% |
dmitry eremin-baryshkov | dmitry eremin-baryshkov | 3 | 15.79% | 1 | 25.00% |
| Total | 19 | 100.00% | 4 | 100.00% |
void ieee802154_nl_exit(void)
{
genl_unregister_family(&nl802154_family);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
sergey lapin | sergey lapin | 12 | 92.31% | 1 | 50.00% |
dmitry eremin-baryshkov | dmitry eremin-baryshkov | 1 | 7.69% | 1 | 50.00% |
| Total | 13 | 100.00% | 2 | 100.00% |
Overall Contributors
| Person | Tokens | Prop | Commits | CommitProp |
sergey lapin | sergey lapin | 173 | 29.17% | 1 | 5.88% |
dmitry eremin-baryshkov | dmitry eremin-baryshkov | 153 | 25.80% | 3 | 17.65% |
johannes berg | johannes berg | 123 | 20.74% | 5 | 29.41% |
phoebe buckheister | phoebe buckheister | 114 | 19.22% | 3 | 17.65% |
hong zhi guo | hong zhi guo | 24 | 4.05% | 2 | 11.76% |
tejun heo | tejun heo | 3 | 0.51% | 1 | 5.88% |
thomas graf | thomas graf | 2 | 0.34% | 1 | 5.88% |
varka bhadram | varka bhadram | 1 | 0.17% | 1 | 5.88% |
| Total | 593 | 100.00% | 17 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.