Lines Matching refs:dev

70 static int tipc_l2_rcv_msg(struct sk_buff *skb, struct net_device *dev,
430 struct net_device *dev; in tipc_enable_l2_media() local
433 dev = dev_get_by_name(net, dev_name); in tipc_enable_l2_media()
434 if (!dev) in tipc_enable_l2_media()
436 if (tipc_mtu_bad(dev)) { in tipc_enable_l2_media()
437 dev_put(dev); in tipc_enable_l2_media()
440 if (dev == net->loopback_dev) { in tipc_enable_l2_media()
441 dev_put(dev); in tipc_enable_l2_media()
448 memcpy(node_id, dev->dev_addr, hwaddr_len); in tipc_enable_l2_media()
452 dev_put(dev); in tipc_enable_l2_media()
458 rcu_assign_pointer(b->media_ptr, dev); in tipc_enable_l2_media()
459 b->pt.dev = dev; in tipc_enable_l2_media()
464 memcpy(b->bcast_addr.value, dev->broadcast, hwaddr_len); in tipc_enable_l2_media()
467 b->mtu = dev->mtu; in tipc_enable_l2_media()
468 b->media->raw2addr(b, &b->addr, (const char *)dev->dev_addr); in tipc_enable_l2_media()
469 rcu_assign_pointer(dev->tipc_ptr, b); in tipc_enable_l2_media()
480 struct net_device *dev; in tipc_disable_l2_media() local
482 dev = (struct net_device *)rtnl_dereference(b->media_ptr); in tipc_disable_l2_media()
484 RCU_INIT_POINTER(dev->tipc_ptr, NULL); in tipc_disable_l2_media()
486 dev_put(dev); in tipc_disable_l2_media()
499 struct net_device *dev; in tipc_l2_send_msg() local
502 dev = (struct net_device *)rcu_dereference(b->media_ptr); in tipc_l2_send_msg()
503 if (!dev) in tipc_l2_send_msg()
506 delta = SKB_DATA_ALIGN(dev->hard_header_len - skb_headroom(skb)); in tipc_l2_send_msg()
512 skb->dev = dev; in tipc_l2_send_msg()
514 dev_hard_header(skb, dev, ETH_P_TIPC, dest->value, in tipc_l2_send_msg()
515 dev->dev_addr, skb->len); in tipc_l2_send_msg()
656 static int tipc_l2_rcv_msg(struct sk_buff *skb, struct net_device *dev, in tipc_l2_rcv_msg() argument
662 b = rcu_dereference(dev->tipc_ptr) ?: in tipc_l2_rcv_msg()
668 tipc_rcv(dev_net(b->pt.dev), skb, b); in tipc_l2_rcv_msg()
689 struct net_device *dev = netdev_notifier_info_to_dev(ptr); in tipc_l2_device_event() local
690 struct net *net = dev_net(dev); in tipc_l2_device_event()
693 b = rtnl_dereference(dev->tipc_ptr); in tipc_l2_device_event()
697 trace_tipc_l2_device_event(dev, b, evt); in tipc_l2_device_event()
700 if (netif_carrier_ok(dev) && netif_oper_up(dev)) { in tipc_l2_device_event()
713 if (tipc_mtu_bad(dev)) { in tipc_l2_device_event()
717 b->mtu = dev->mtu; in tipc_l2_device_event()
722 (const char *)dev->dev_addr); in tipc_l2_device_event()
765 struct net_device *dev = net->loopback_dev; in tipc_clone_to_loopback() local
774 exp = SKB_DATA_ALIGN(dev->hard_header_len - skb_headroom(skb)); in tipc_clone_to_loopback()
781 dev_hard_header(skb, dev, ETH_P_TIPC, dev->dev_addr, in tipc_clone_to_loopback()
782 dev->dev_addr, skb->len); in tipc_clone_to_loopback()
783 skb->dev = dev; in tipc_clone_to_loopback()
786 skb->protocol = eth_type_trans(skb, dev); in tipc_clone_to_loopback()
791 static int tipc_loopback_rcv_pkt(struct sk_buff *skb, struct net_device *dev, in tipc_loopback_rcv_pkt() argument
800 struct net_device *dev = net->loopback_dev; in tipc_attach_loopback() local
803 if (!dev) in tipc_attach_loopback()
806 netdev_hold(dev, &tn->loopback_pt.dev_tracker, GFP_KERNEL); in tipc_attach_loopback()
807 tn->loopback_pt.dev = dev; in tipc_attach_loopback()