Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | net/mac802154/cfg.c |
static int ieee802154_del_llsec_key(struct wpan_phy *wpan_phy,
struct wpan_dev *wpan_dev,
const struct ieee802154_llsec_key_id *id) {
struct net_device *dev = wpan_dev->netdev;
struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(de... | [
0,
0
] |
Linux Kernel | net/mac802154/cfg.c |
static int ieee802154_del_seclevel(struct wpan_phy *wpan_phy,
struct wpan_dev *wpan_dev,
const struct ieee802154_llsec_seclevel *sl) {
struct net_device *dev = wpan_dev->netdev;
struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev... | [
0,
0
] |
Linux Kernel | net/mac802154/cfg.c |
static int
ieee802154_add_devkey(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev,
__le64 extended_addr,
const struct ieee802154_llsec_device_key *key) {
struct net_device *dev = wpan_dev->netdev;
struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
... | [
0,
0
] |
Linux Kernel | net/mac802154/driver-ops.h |
static inline int drv_xmit_sync(struct ieee802154_local *local,
struct sk_buff *skb) {
might_sleep();
return local->ops->xmit_sync(&local->hw, skb);
} | [
0,
0
] |
Linux Kernel | net/mac802154/driver-ops.h |
static inline int drv_set_extended_addr(struct ieee802154_local *local,
__le64 extended_addr) {
struct ieee802154_hw_addr_filt filt;
int ret;
might_sleep();
if (!local->ops->set_hw_addr_filt) {
WARN_ON(1);
return -EOPNOTSUPP;
}
filt.ieee_addr = extended_ad... | [
1,
0
] |
Linux Kernel | net/mac802154/driver-ops.h |
static inline int drv_set_pan_coord(struct ieee802154_local *local,
bool is_coord) {
struct ieee802154_hw_addr_filt filt;
int ret;
might_sleep();
if (!local->ops->set_hw_addr_filt) {
WARN_ON(1);
return -EOPNOTSUPP;
}
filt.pan_coord = is_coord;
trace_802154_... | [
1,
0
] |
Linux Kernel | net/mac802154/driver-ops.h | static inline void drv_stop(struct ieee802154_local *local) {
might_sleep();
trace_802154_drv_stop(local);
local->ops->stop(&local->hw);
trace_802154_drv_return_void(local);
tasklet_disable(&local->tasklet);
tasklet_enable(&local->tasklet);
barrier();
local->started = false;
} | [
0,
0
] |
Linux Kernel | net/mac802154/driver-ops.h |
static inline int drv_set_cca_ed_level(struct ieee802154_local *local,
s32 mbm) {
int ret;
might_sleep();
if (!local->ops->set_cca_ed_level) {
WARN_ON(1);
return -EOPNOTSUPP;
}
trace_802154_drv_set_cca_ed_level(local, mbm);
ret = local->ops->set_cca_ed_leve... | [
1,
0
] |
Linux Kernel | net/mac802154/iface.c |
static int
ieee802154_check_mac_settings(struct ieee802154_local *local,
struct ieee802154_sub_if_data *sdata,
struct ieee802154_sub_if_data *nsdata) {
struct wpan_dev *nwpan_dev = &nsdata->wpan_dev;
struct wpan_dev *wpan_dev = &sdata->wpan_dev;
ASSERT... | [
1,
0
] |
Linux Kernel | net/mac802154/iface.c | static int
ieee802154_check_concurrent_iface(struct ieee802154_sub_if_data *sdata,
enum nl802154_iftype iftype) {
struct ieee802154_local *local = sdata->local;
struct ieee802154_sub_if_data *nsdata;
list_for_each_entry(nsdata, &local->interfaces, list) {
if (nsdata != sdata... | [
1,
1
] |
Linux Kernel | net/mac802154/iface.c |
static int mac802154_slave_close(struct net_device *dev) {
struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
struct ieee802154_local *local = sdata->local;
ASSERT_RTNL();
netif_stop_queue(dev);
local->open_count--;
clear_bit(SDATA_STATE_RUNNING, &sdata->state);
if (!local->open_co... | [
0,
0
] |
Linux Kernel | net/mac802154/iface.c |
static int ieee802154_header_create(struct sk_buff *skb, struct net_device *dev,
const struct ieee802154_addr *daddr,
const struct ieee802154_addr *saddr,
unsigned len) {
struct ieee802154_hdr hdr;
struct ie... | [
1,
0
] |
Linux Kernel | net/mac802154/iface.c |
static void mac802154_wpan_free(struct net_device *dev) {
struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
mac802154_llsec_destroy(&sdata->sec);
} | [
0,
0
] |
Linux Kernel | net/mac802154/iface.c |
void ieee802154_iface_exit(void) {
unregister_netdevice_notifier(&mac802154_netdev_notifier);
} | [
0,
0
] |
Linux Kernel | net/mac802154/llsec.c |
static void llsec_key_release(struct kref *ref) {
struct mac802154_llsec_key *key;
int i;
key = container_of(ref, struct mac802154_llsec_key, ref);
for (i = 0; i < ARRAY_SIZE(key->tfm); i++)
crypto_free_aead(key->tfm[i]);
crypto_free_sync_skcipher(key->tfm0);
kfree_sensitive(key);
} | [
0,
0
] |
Linux Kernel | net/mac802154/llsec.c |
static struct mac802154_llsec_device *
llsec_dev_find_long(struct mac802154_llsec *sec, __le64 hwaddr) {
struct mac802154_llsec_device *dev;
u64 key = llsec_dev_hash_long(hwaddr);
hash_for_each_possible_rcu(sec->devices_hw, dev, bucket_hw, key) {
if (dev->dev.hwaddr == hwaddr)
return dev;
}
retur... | [
0,
0
] |
Linux Kernel | net/mac802154/llsec.c |
int mac802154_llsec_dev_add(struct mac802154_llsec *sec,
const struct ieee802154_llsec_device *dev) {
struct mac802154_llsec_device *entry;
u32 skey = llsec_dev_hash_short(dev->short_addr, dev->pan_id);
u64 hwkey = llsec_dev_hash_long(dev->hwaddr);
BUILD_BUG_ON(sizeof(hwkey) != IEE... | [
1,
0
] |
Linux Kernel | net/mac802154/llsec.c |
int mac802154_llsec_dev_del(struct mac802154_llsec *sec, __le64 device_addr) {
struct mac802154_llsec_device *pos;
pos = llsec_dev_find_long(sec, device_addr);
if (!pos)
return -ENOENT;
hash_del_rcu(&pos->bucket_s);
hash_del_rcu(&pos->bucket_hw);
list_del_rcu(&pos->dev.list);
call_rcu(&pos->rcu, ll... | [
0,
0
] |
Linux Kernel | net/mac802154/llsec.c |
int mac802154_llsec_devkey_del(struct mac802154_llsec *sec, __le64 dev_addr,
const struct ieee802154_llsec_device_key *key) {
struct mac802154_llsec_device *dev;
struct mac802154_llsec_device_key *devkey;
dev = llsec_dev_find_long(sec, dev_addr);
if (!dev)
return -ENOENT;
... | [
0,
0
] |
Linux Kernel | net/mac802154/llsec.c |
static struct mac802154_llsec_seclevel *
llsec_find_seclevel(const struct mac802154_llsec *sec,
const struct ieee802154_llsec_seclevel *sl) {
struct ieee802154_llsec_seclevel *pos;
list_for_each_entry(pos, &sec->table.security_levels, list) {
if (pos->frame_type != sl->frame_type ||
... | [
1,
0
] |
Linux Kernel | net/mac802154/llsec.c |
static struct mac802154_llsec_key *
llsec_lookup_key(struct mac802154_llsec *sec, const struct ieee802154_hdr *hdr,
const struct ieee802154_addr *addr,
struct ieee802154_llsec_key_id *key_id) {
struct ieee802154_addr devaddr = *addr;
u8 key_id_mode = hdr->sec.key_id_mode;
struct... | [
1,
0
] |
Linux Kernel | net/mac802154/llsec.c | static int llsec_do_encrypt_unauth(struct sk_buff *skb,
const struct mac802154_llsec *sec,
const struct ieee802154_hdr *hdr,
struct mac802154_llsec_key *key) {
u8 iv[16];
struct scatterlist src;
SYNC_SKCIPHER_... | [
0,
0
] |
Linux Kernel | net/mac802154/llsec.c |
int mac802154_llsec_encrypt(struct mac802154_llsec *sec, struct sk_buff *skb) {
struct ieee802154_hdr hdr;
int rc, authlen, hlen;
struct mac802154_llsec_key *key;
u32 frame_ctr;
hlen = ieee802154_hdr_pull(skb, &hdr);
if (hlen < 0 || hdr.fc.type != IEEE802154_FC_TYPE_DATA)
return -EINVAL;
if (!hdr.... | [
1,
0
] |
Linux Kernel | net/mac802154/llsec.c |
static int llsec_lookup_seclevel(const struct mac802154_llsec *sec,
u8 frame_type, u8 cmd_frame_id,
struct ieee802154_llsec_seclevel *rlevel) {
struct ieee802154_llsec_seclevel *level;
list_for_each_entry_rcu(level, &sec->table.security_levels, lis... | [
1,
0
] |
Linux Kernel | net/mac802154/llsec.c |
static int llsec_do_decrypt(struct sk_buff *skb,
const struct mac802154_llsec *sec,
const struct ieee802154_hdr *hdr,
struct mac802154_llsec_key *key, __le64 dev_addr) {
if (hdr->sec.level == IEEE802154_SCF_SECLEVEL_ENC)
return l... | [
0,
0
] |
Linux Kernel | net/mac802154/mac_cmd.c | static int
mac802154_set_mac_params(struct net_device *dev,
const struct ieee802154_mac_params *params) {
struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
struct ieee802154_local *local = sdata->local;
struct wpan_dev *wpan_dev = &sdata->wpan_dev;
int ret;
ASSERT... | [
1,
0
] |
Linux Kernel | net/mac802154/main.c | static void ieee802154_tasklet_handler(struct tasklet_struct *t) {
struct ieee802154_local *local = from_tasklet(local, t, tasklet);
struct sk_buff *skb;
while ((skb = skb_dequeue(&local->skb_queue))) {
switch (skb->pkt_type) {
case IEEE802154_RX_MSG:
skb->pkt_type = 0;
ieee802154_rx(local, ... | [
0,
0
] |
Linux Kernel | net/mac802154/main.c | struct ieee802154_hw *ieee802154_alloc_hw(size_t priv_data_len,
const struct ieee802154_ops *ops) {
struct wpan_phy *phy;
struct ieee802154_local *local;
size_t priv_size;
if (WARN_ON(!ops || !(ops->xmit_async || ops->xmit_sync) || !ops->ed ||
!ops->start... | [
1,
0
] |
Linux Kernel | net/mac802154/main.c | static void ieee802154_setup_wpan_phy_pib(struct wpan_phy *wpan_phy) {
/* TODO warn on empty symbol_duration
* Should be done when all drivers sets this value.
*/
wpan_phy->lifs_period =
(IEEE802154_LIFS_PERIOD * wpan_phy->symbol_duration) / 1000;
wpan_phy->sifs_period =
(IEEE802154_SIFS_PERIOD... | [
0,
1
] |
Linux Kernel | net/mac802154/mib.c |
int mac802154_add_key(struct net_device *dev,
const struct ieee802154_llsec_key_id *id,
const struct ieee802154_llsec_key *key) {
struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
int res;
BUG_ON(dev->type != ARPHRD_IEEE802154);
mutex_lock(&sdat... | [
0,
0
] |
Linux Kernel | net/mac802154/mib.c |
void mac802154_lock_table(struct net_device *dev) {
struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
BUG_ON(dev->type != ARPHRD_IEEE802154);
mutex_lock(&sdata->sec_mtx);
} | [
0,
0
] |
Linux Kernel | net/mac802154/mib.c |
void mac802154_unlock_table(struct net_device *dev) {
struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev);
BUG_ON(dev->type != ARPHRD_IEEE802154);
mutex_unlock(&sdata->sec_mtx);
} | [
0,
0
] |
Linux Kernel | net/mac802154/rx.c |
static int ieee802154_deliver_skb(struct sk_buff *skb) {
skb->ip_summed = CHECKSUM_UNNECESSARY;
skb->protocol = htons(ETH_P_IEEE802154);
return netif_receive_skb(skb);
} | [
0,
0
] |
Linux Kernel | net/mac802154/rx.c | static void __ieee802154_rx_handle_packet(struct ieee802154_local *local,
struct sk_buff *skb) {
int ret;
struct ieee802154_sub_if_data *sdata;
struct ieee802154_hdr hdr;
struct sk_buff *skb2;
ret = ieee802154_parse_frame_start(skb, &hdr);
if (ret) {
pr_debug("... | [
1,
0
] |
Linux Kernel | net/mac802154/rx.c |
static void ieee802154_monitors_rx(struct ieee802154_local *local,
struct sk_buff *skb) {
struct sk_buff *skb2;
struct ieee802154_sub_if_data *sdata;
skb_reset_mac_header(skb);
skb->ip_summed = CHECKSUM_UNNECESSARY;
skb->pkt_type = PACKET_OTHERHOST;
skb->protocol = htons... | [
1,
0
] |
Linux Kernel | net/mac802154/rx.c | void ieee802154_rx(struct ieee802154_local *local, struct sk_buff *skb) {
u16 crc;
WARN_ON_ONCE(softirq_count() == 0);
if (local->suspended)
goto free_skb;
/* TODO: When a transceiver omits the checksum here, we
* add an own calculated one. This is currently an ugly
* solution because the monitor n... | [
1,
1
] |
Linux Kernel | net/mac802154/tx.c |
int ieee802154_mlme_op_pre(struct ieee802154_local *local) {
return ieee802154_sync_and_hold_queue(local);
} | [
0,
0
] |
Linux Kernel | net/mac802154/tx.c |
static bool ieee802154_queue_is_stopped(struct ieee802154_local *local) {
return test_bit(WPAN_PHY_FLAG_STATE_QUEUE_STOPPED, &local->phy->flags);
} | [
0,
0
] |
Linux Kernel | net/mac802154/tx.c | static netdev_tx_t ieee802154_hot_tx(struct ieee802154_local *local,
struct sk_buff *skb) {
WARN_ON_ONCE(ieee802154_queue_is_stopped(local));
return ieee802154_tx(local, skb);
} | [
0,
0
] |
Linux Kernel | net/mac802154/util.c |
enum hrtimer_restart ieee802154_xmit_ifs_timer(struct hrtimer *timer) {
struct ieee802154_local *local =
container_of(timer, struct ieee802154_local, ifs_timer);
ieee802154_release_queue(local);
return HRTIMER_NORESTART;
} | [
0,
0
] |
Linux Kernel | net/mac802154/util.c | void ieee802154_xmit_complete(struct ieee802154_hw *hw, struct sk_buff *skb,
bool ifs_handling) {
struct ieee802154_local *local = hw_to_local(hw);
local->tx_result = IEEE802154_SUCCESS;
if (ifs_handling) {
u8 max_sifs_size;
if (hw->flags & IEEE802154_HW_TX_OMIT_CKSUM)
... | [
1,
0
] |
Linux Kernel | net/mctp/af_mctp.c | static bool mctp_sockaddr_is_ok(const struct sockaddr_mctp *addr) {
return !addr->__smctp_pad0 && !addr->__smctp_pad1;
} | [
0,
0
] |
Linux Kernel | net/mctp/af_mctp.c | static int mctp_bind(struct socket *sock, struct sockaddr *addr, int addrlen) {
struct sock *sk = sock->sk;
struct mctp_sock *msk = container_of(sk, struct mctp_sock, sk);
struct sockaddr_mctp *smctp;
int rc;
if (addrlen < sizeof(*smctp))
return -EINVAL;
if (addr->sa_family != AF_MCTP)
return -EAF... | [
1,
1
] |
Linux Kernel | net/mctp/af_mctp.c |
static int mctp_ioctl(struct socket *sock, unsigned int cmd,
unsigned long arg) {
struct mctp_sock *msk = container_of(sock->sk, struct mctp_sock, sk);
switch (cmd) {
case SIOCMCTPALLOCTAG:
return mctp_ioctl_alloctag(msk, arg);
case SIOCMCTPDROPTAG:
return mctp_ioctl_droptag(msk,... | [
1,
0
] |
Linux Kernel | net/mctp/af_mctp.c | static int mctp_compat_ioctl(struct socket *sock, unsigned int cmd,
unsigned long arg) {
void __user *argp = compat_ptr(arg);
switch (cmd) {
case SIOCMCTPALLOCTAG:
case SIOCMCTPDROPTAG:
return mctp_ioctl(sock, cmd, (unsigned long)argp);
}
return -ENOIOCTLCMD;
} | [
1,
0
] |
Linux Kernel | net/mctp/af_mctp.c | static void mctp_sk_unhash(struct sock *sk) {
struct mctp_sock *msk = container_of(sk, struct mctp_sock, sk);
struct net *net = sock_net(sk);
unsigned long flags, fl2;
struct mctp_sk_key *key;
struct hlist_node *tmp;
mutex_lock(&net->mctp.bind_lock);
sk_del_node_init_rcu(sk);
mutex_unlock(&net->mctp.bi... | [
0,
0
] |
Linux Kernel | net/mctp/af_mctp.c | static int mctp_pf_create(struct net *net, struct socket *sock, int protocol,
int kern) {
const struct proto_ops *ops;
struct proto *proto;
struct sock *sk;
int rc;
if (protocol)
return -EPROTONOSUPPORT;
if (sock->type != SOCK_DGRAM)
return -ESOCKTNOSUPPORT;
proto = &m... | [
0,
0
] |
Linux Kernel | net/mctp/device.c | struct mctp_dev *__mctp_dev_get(const struct net_device *dev) {
struct mctp_dev *mdev = rcu_dereference(dev->mctp_ptr);
if (mdev)
if (!refcount_inc_not_zero(&mdev->refs))
return NULL;
return mdev;
} | [
0,
0
] |
Linux Kernel | net/mctp/device.c | static int mctp_dump_addrinfo(struct sk_buff *skb,
struct netlink_callback *cb) {
struct mctp_dump_cb *mcb = (void *)cb->ctx;
struct net *net = sock_net(skb->sk);
struct hlist_head *head;
struct net_device *dev;
struct ifaddrmsg *hdr;
struct mctp_dev *mdev;
int ifindex;
int... | [
1,
0
] |
Linux Kernel | net/mctp/device.c | static int mctp_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh,
struct netlink_ext_ack *extack) {
struct net *net = sock_net(skb->sk);
struct nlattr *tb[IFA_MAX + 1];
struct net_device *dev;
struct mctp_addr *addr;
struct mctp_dev *mdev;
struct ifaddrmsg *ifm;
unsigned l... | [
1,
0
] |
Linux Kernel | net/mctp/device.c |
void mctp_dev_release_key(struct mctp_dev *dev, struct mctp_sk_key *key)
__must_hold(&key->lock) | [
0,
0
] |
Linux Kernel | net/mctp/device.c |
static int mctp_fill_link_af(struct sk_buff *skb, const struct net_device *dev,
u32 ext_filter_mask) {
struct mctp_dev *mdev;
mdev = mctp_dev_get_rtnl(dev);
if (!mdev)
return -ENODATA;
if (nla_put_u32(skb, IFLA_MCTP_NET, mdev->net))
return -EMSGSIZE;
return 0;
} | [
0,
0
] |
Linux Kernel | net/mctp/device.c | static size_t mctp_get_link_af_size(const struct net_device *dev,
u32 ext_filter_mask) {
struct mctp_dev *mdev;
unsigned int ret;
mdev = __mctp_dev_get(dev);
if (!mdev)
return 0;
ret = nla_total_size(4); /* IFLA_MCTP_NET */
mctp_dev_put(mdev);
return ret;
} | [
0,
0
] |
Linux Kernel | net/mctp/device.c | static void mctp_unregister(struct net_device *dev) {
struct mctp_dev *mdev;
mdev = mctp_dev_get_rtnl(dev);
if (mdev && !mctp_known(dev)) {
netdev_warn(dev, "%s: BUG mctp_ptr set for unknown type %d", __func__,
dev->type);
return;
}
if (!mdev)
return;
RCU_INIT_POINTER(mdev->de... | [
0,
0
] |
Linux Kernel | net/mctp/device.c |
void mctp_unregister_netdev(struct net_device *dev) { unregister_netdev(dev); } | [
0,
0
] |
Linux Kernel | net/mctp/device.c |
void __init mctp_device_init(void) {
register_netdevice_notifier(&mctp_dev_nb);
rtnl_register_module(THIS_MODULE, PF_MCTP, RTM_GETADDR, NULL,
mctp_dump_addrinfo, 0);
rtnl_register_module(THIS_MODULE, PF_MCTP, RTM_NEWADDR, mctp_rtm_newaddr,
NULL, 0);
rtnl_register_... | [
0,
0
] |
Linux Kernel | net/mctp/neigh.c | void mctp_neigh_remove_dev(struct mctp_dev *mdev) {
struct net *net = dev_net(mdev->dev);
struct mctp_neigh *neigh, *tmp;
mutex_lock(&net->mctp.neigh_lock);
list_for_each_entry_safe(neigh, tmp, &net->mctp.neighbours, list) {
if (neigh->dev == mdev) {
list_del_rcu(&neigh->list);
/* TODO: immedia... | [
0,
1
] |
Linux Kernel | net/mctp/neigh.c | static int mctp_neigh_remove(struct mctp_dev *mdev, mctp_eid_t eid,
enum mctp_neigh_source source) {
struct net *net = dev_net(mdev->dev);
struct mctp_neigh *neigh, *tmp;
bool dropped = false;
mutex_lock(&net->mctp.neigh_lock);
list_for_each_entry_safe(neigh, tmp, &net->mctp.neig... | [
1,
1
] |
Linux Kernel | net/mctp/neigh.c | static int mctp_fill_neigh(struct sk_buff *skb, u32 portid, u32 seq, int event,
unsigned int flags, struct mctp_neigh *neigh) {
struct net_device *dev = neigh->dev->dev;
struct nlmsghdr *nlh;
struct ndmsg *hdr;
nlh = nlmsg_put(skb, portid, seq, event, sizeof(*hdr), flags);
if (!nlh... | [
1,
1
] |
Linux Kernel | net/mctp/neigh.c | int mctp_neigh_lookup(struct mctp_dev *mdev, mctp_eid_t eid, void *ret_hwaddr) {
struct net *net = dev_net(mdev->dev);
struct mctp_neigh *neigh;
int rc = -EHOSTUNREACH; // TODO: or ENOENT?
rcu_read_lock();
list_for_each_entry_rcu(neigh, &net->mctp.neighbours, list) {
if (mdev == neigh->dev && eid == neig... | [
1,
1
] |
Linux Kernel | net/mctp/neigh.c | static int __net_init mctp_neigh_net_init(struct net *net) {
struct netns_mctp *ns = &net->mctp;
INIT_LIST_HEAD(&ns->neighbours);
mutex_init(&ns->neigh_lock);
return 0;
} | [
0,
0
] |
Linux Kernel | net/mctp/neigh.c |
int __init mctp_neigh_init(void) {
rtnl_register_module(THIS_MODULE, PF_MCTP, RTM_NEWNEIGH, mctp_rtm_newneigh,
NULL, 0);
rtnl_register_module(THIS_MODULE, PF_MCTP, RTM_DELNEIGH, mctp_rtm_delneigh,
NULL, 0);
rtnl_register_module(THIS_MODULE, PF_MCTP, RTM_GETNEIGH, NUL... | [
0,
0
] |
Linux Kernel | net/mctp/route.c | void mctp_key_unref(struct mctp_sk_key *key) {
unsigned long flags;
if (!refcount_dec_and_test(&key->refs))
return;
spin_lock_irqsave(&key->lock, flags);
mctp_dev_release_key(key->dev, key);
spin_unlock_irqrestore(&key->lock, flags);
kfree(key);
} | [
0,
0
] |
Linux Kernel | net/mctp/route.c |
static void mctp_flow_prepare_output(struct sk_buff *skb,
struct mctp_dev *dev) {
struct mctp_sk_key *key;
struct mctp_flow *flow;
flow = skb_ext_find(skb, SKB_EXT_MCTP);
if (!flow)
return;
key = flow->key;
if (WARN_ON(key->dev && key->dev != dev))
return;
... | [
1,
0
] |
Linux Kernel | net/mctp/route.c | struct mctp_route *mctp_route_lookup(struct net *net, unsigned int dnet,
mctp_eid_t daddr) {
struct mctp_route *tmp, *rt = NULL;
list_for_each_entry_rcu(tmp, &net->mctp.routes, list) {
/* TODO: add metrics */
if (mctp_rt_match_eid(tmp, dnet, daddr)) {
if (refcount... | [
0,
1
] |
Linux Kernel | net/mctp/route.c |
static struct mctp_route *mctp_route_lookup_null(struct net *net,
struct net_device *dev) {
struct mctp_route *rt;
list_for_each_entry_rcu(rt, &net->mctp.routes, list) {
if (rt->dev->dev == dev && rt->type == RTN_LOCAL &&
refcount_inc_not_zero(&rt->refs... | [
1,
0
] |
Linux Kernel | net/mctp/route.c | static int mctp_route_add(struct mctp_dev *mdev, mctp_eid_t daddr_start,
unsigned int daddr_extent, unsigned int mtu,
unsigned char type) {
int (*rtfn)(struct mctp_route *rt, struct sk_buff *skb);
struct net *net = dev_net(mdev->dev);
struct mctp_route *rt, *ert... | [
1,
0
] |
Linux Kernel | net/mctp/route.c | static int mctp_route_remove(struct mctp_dev *mdev, mctp_eid_t daddr_start,
unsigned int daddr_extent, unsigned char type) {
struct net *net = dev_net(mdev->dev);
struct mctp_route *rt, *tmp;
mctp_eid_t daddr_end;
bool dropped;
if (daddr_extent > 0xff || daddr_start + daddr_exten... | [
1,
1
] |
Linux Kernel | net/mctp/route.c |
int mctp_route_add_local(struct mctp_dev *mdev, mctp_eid_t addr) {
return mctp_route_add(mdev, addr, 0, 0, RTN_LOCAL);
} | [
0,
0
] |
Linux Kernel | net/mctp/route.c |
int mctp_route_remove_local(struct mctp_dev *mdev, mctp_eid_t addr) {
return mctp_route_remove(mdev, addr, 0, RTN_LOCAL);
} | [
0,
0
] |
Linux Kernel | net/mctp/route.c | static int mctp_fill_rtinfo(struct sk_buff *skb, struct mctp_route *rt,
u32 portid, u32 seq, int event,
unsigned int flags) {
struct nlmsghdr *nlh;
struct rtmsg *hdr;
void *metrics;
nlh = nlmsg_put(skb, portid, seq, event, sizeof(*hdr), flags);
if (!nlh... | [
1,
1
] |
Linux Kernel | net/mctp/route.c | static int mctp_dump_rtinfo(struct sk_buff *skb, struct netlink_callback *cb) {
struct net *net = sock_net(skb->sk);
struct mctp_route *rt;
int s_idx, idx;
/* TODO: change to struct overlay */
s_idx = cb->args[0];
idx = 0;
rcu_read_lock();
list_for_each_entry_rcu(rt, &net->mctp.routes, list) {
if ... | [
0,
1
] |
Linux Kernel | net/mctp/test/route-test.c | static struct mctp_test_route *mctp_route_test_alloc(void) {
struct mctp_test_route *rt;
rt = kzalloc(sizeof(*rt), GFP_KERNEL);
if (!rt)
return NULL;
INIT_LIST_HEAD(&rt->rt.list);
refcount_set(&rt->rt.refs, 1);
rt->rt.output = mctp_test_route_output;
skb_queue_head_init(&rt->pkts);
return rt;
} | [
0,
0
] |
Linux Kernel | net/mctp/test/route-test.c |
static void mctp_test_route_destroy(struct kunit *test,
struct mctp_test_route *rt) {
unsigned int refs;
rtnl_lock();
list_del_rcu(&rt->rt.list);
rtnl_unlock();
skb_queue_purge(&rt->pkts);
if (rt->rt.dev)
mctp_dev_put(rt->rt.dev);
refs = refcount_read(&rt->rt.re... | [
0,
0
] |
Linux Kernel | net/mctp/test/route-test.c |
static void mctp_frag_test_to_desc(const struct mctp_frag_test *t, char *desc) {
sprintf(desc, "mtu %d len %d -> %d frags", t->msgsize, t->mtu, t->n_frags);
} | [
1,
0
] |
Linux Kernel | net/mctp/test/route-test.c |
static void mctp_test_rx_input(struct kunit *test) {
const struct mctp_rx_input_test *params;
struct mctp_test_route *rt;
struct mctp_test_dev *dev;
struct sk_buff *skb;
params = test->param_value;
dev = mctp_test_create_dev();
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, dev);
rt = mctp_test_create_route(&in... | [
1,
0
] |
Linux Kernel | net/mctp/test/route-test.c |
static void mctp_rx_input_test_to_desc(const struct mctp_rx_input_test *t,
char *desc) {
sprintf(desc, "{%x,%x,%x,%x}", t->hdr.ver, t->hdr.src, t->hdr.dest,
t->hdr.flags_seq_tag);
} | [
1,
0
] |
Linux Kernel | net/mctp/test/route-test.c |
static void mctp_test_route_input_sk(struct kunit *test) {
const struct mctp_route_input_sk_test *params;
struct sk_buff *skb, *skb2;
struct mctp_test_route *rt;
struct mctp_test_dev *dev;
struct socket *sock;
int rc;
params = test->param_value;
__mctp_route_test_init(test, &dev, &rt, &sock);
skb ... | [
0,
0
] |
Linux Kernel | net/mctp/test/route-test.c |
static void mctp_route_input_sk_reasm_to_desc(
const struct mctp_route_input_sk_reasm_test *t, char *desc) {
sprintf(desc, "%s", t->name);
} | [
1,
0
] |
Linux Kernel | net/mctp/test/utils.c |
static netdev_tx_t mctp_test_dev_tx(struct sk_buff *skb,
struct net_device *ndev) {
kfree_skb(skb);
return NETDEV_TX_OK;
} | [
0,
0
] |
Linux Kernel | net/mctp/test/utils.c |
void mctp_test_destroy_dev(struct mctp_test_dev *dev) {
mctp_dev_put(dev->mdev);
unregister_netdev(dev->ndev);
} | [
0,
0
] |
Linux Kernel | net/mpls/af_mpls.c |
static u8 *__mpls_nh_via(struct mpls_route *rt, struct mpls_nh *nh) {
return (u8 *)nh + rt->rt_via_offset;
} | [
0,
0
] |
Linux Kernel | net/mpls/af_mpls.c | static unsigned int mpls_nh_header_size(const struct mpls_nh *nh) {
return nh->nh_labels * sizeof(struct mpls_shim_hdr);
} | [
1,
0
] |
Linux Kernel | net/mpls/af_mpls.c | unsigned int mpls_dev_mtu(const struct net_device *dev) { return dev->mtu; } | [
0,
0
] |
Linux Kernel | net/mpls/af_mpls.c |
static void mpls_rt_free(struct mpls_route *rt) {
if (rt)
kfree_rcu(rt, rt_rcu);
} | [
0,
0
] |
Linux Kernel | net/mpls/af_mpls.c | static void mpls_notify_route(struct net *net, unsigned index,
struct mpls_route *old, struct mpls_route *new,
const struct nl_info *info) {
struct nlmsghdr *nlh = info ? info->nlh : NULL;
unsigned portid = info ? info->portid : 0;
int event = new ? RTM_... | [
1,
0
] |
Linux Kernel | net/mpls/af_mpls.c |
static unsigned find_free_label(struct net *net) {
struct mpls_route __rcu **platform_label;
size_t platform_labels;
unsigned index;
platform_label = rtnl_dereference(net->mpls.platform_label);
platform_labels = net->mpls.platform_labels;
for (index = MPLS_LABEL_FIRST_UNRESERVED; index < platform_labels; ... | [
0,
0
] |
Linux Kernel | net/mpls/af_mpls.c | static struct net_device *inet_fib_lookup_dev(struct net *net,
const void *addr) {
return ERR_PTR(-EAFNOSUPPORT);
} | [
0,
0
] |
Linux Kernel | net/mpls/af_mpls.c | static struct net_device *find_outdev(struct net *net, struct mpls_route *rt,
struct mpls_nh *nh, int oif) {
struct net_device *dev = NULL;
if (!oif) {
switch (nh->nh_via_table) {
case NEIGH_ARP_TABLE:
dev = inet_fib_lookup_dev(net, mpls_nh_via(rt, nh));
br... | [
1,
0
] |
Linux Kernel | net/mpls/af_mpls.c |
static int mpls_nh_build(struct net *net, struct mpls_route *rt,
struct mpls_nh *nh, int oif, struct nlattr *via,
struct nlattr *newdst, u8 max_labels,
struct netlink_ext_ack *extack) {
int err = -ENOMEM;
if (!nh)
goto errout;
if (n... | [
0,
0
] |
Linux Kernel | net/mpls/af_mpls.c |
static int mpls_route_del(struct mpls_route_config *cfg,
struct netlink_ext_ack *extack) {
struct net *net = cfg->rc_nlinfo.nl_net;
unsigned index;
int err = -EINVAL;
index = cfg->rc_label;
if (!mpls_label_ok(net, &index, extack))
goto errout;
mpls_route_update(net, index, ... | [
0,
0
] |
Linux Kernel | net/mpls/af_mpls.c |
static void mpls_get_stats(struct mpls_dev *mdev,
struct mpls_link_stats *stats) {
struct mpls_pcpu_stats *p;
int i;
memset(stats, 0, sizeof(*stats));
for_each_possible_cpu(i) {
struct mpls_link_stats local;
unsigned int start;
p = per_cpu_ptr(mdev->stats, i);
do {... | [
1,
0
] |
Linux Kernel | net/mpls/af_mpls.c |
static int mpls_fill_stats_af(struct sk_buff *skb,
const struct net_device *dev) {
struct mpls_link_stats *stats;
struct mpls_dev *mdev;
struct nlattr *nla;
mdev = mpls_dev_get(dev);
if (!mdev)
return -ENODATA;
nla = nla_reserve_64bit(skb, MPLS_STATS_LINK, sizeof(struct ... | [
1,
0
] |
Linux Kernel | net/mpls/af_mpls.c | static int mpls_netconf_msgsize_devconf(int type) {
int size = NLMSG_ALIGN(sizeof(struct netconfmsg)) + nla_total_size(4);
bool all = false;
if (type == NETCONFA_ALL)
all = true;
if (all || type == NETCONFA_INPUT)
size += nla_total_size(4);
return size;
} | [
0,
0
] |
Linux Kernel | net/mpls/af_mpls.c |
static int mpls_conf_proc(struct ctl_table *ctl, int write, void *buffer,
size_t *lenp, loff_t *ppos) {
int oval = *(int *)ctl->data;
int ret = proc_dointvec(ctl, write, buffer, lenp, ppos);
if (write) {
struct mpls_dev *mdev = ctl->extra1;
int i = (int *)ctl->data - (int *)mde... | [
0,
0
] |
Linux Kernel | net/mpls/af_mpls.c |
static void mpls_dev_sysctl_unregister(struct net_device *dev,
struct mpls_dev *mdev) {
struct net *net = dev_net(dev);
struct ctl_table *table;
table = mdev->sysctl->ctl_table_arg;
unregister_net_sysctl_table(mdev->sysctl);
kfree(table);
mpls_netconf_notify_devconf... | [
0,
0
] |
Linux Kernel | net/mpls/af_mpls.c |
static void mpls_dev_destroy_rcu(struct rcu_head *head) {
struct mpls_dev *mdev = container_of(head, struct mpls_dev, rcu);
free_percpu(mdev->stats);
kfree(mdev);
} | [
0,
0
] |
Linux Kernel | net/mpls/af_mpls.c | static int mpls_ifdown(struct net_device *dev, int event) {
struct mpls_route __rcu **platform_label;
struct net *net = dev_net(dev);
unsigned index;
platform_label = rtnl_dereference(net->mpls.platform_label);
for (index = 0; index < net->mpls.platform_labels; index++) {
struct mpls_route *rt = rtnl_der... | [
1,
0
] |
Linux Kernel | net/mpls/af_mpls.c |
static void mpls_ifup(struct net_device *dev, unsigned int flags) {
struct mpls_route __rcu **platform_label;
struct net *net = dev_net(dev);
unsigned index;
u8 alive;
platform_label = rtnl_dereference(net->mpls.platform_label);
for (index = 0; index < net->mpls.platform_labels; index++) {
struct mpls... | [
1,
0
] |
Linux Kernel | net/mpls/af_mpls.c |
static int nla_put_via(struct sk_buff *skb, u8 table, const void *addr,
int alen) {
static const int table_to_family[NEIGH_NR_TABLES + 1] = {
AF_INET,
AF_INET6,
AF_DECnet,
AF_PACKET,
};
struct nlattr *nla;
struct rtvia *via;
int family = AF_UNSPEC;
nla = nla_... | [
1,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.