Lines Matching refs:dev
8 * Version: @(#)dev.h 1.0.10 08/12/93
209 * dev->hard_header_len ? (dev->hard_header_len +
215 #define LL_RESERVED_SPACE(dev) \
216 (((dev)->hard_header_len&~(HH_DATA_MOD - 1)) + HH_DATA_MOD)
217 #define LL_RESERVED_SPACE_EXTRA(dev,extra) \
218 ((((dev)->hard_header_len+extra)&~(HH_DATA_MOD - 1)) + HH_DATA_MOD)
295 int (*init)(struct net_device *dev);
336 struct net_device_stats* (*get_stats)(struct net_device *dev);
337 struct iw_statistics* (*get_wireless_stats)(struct net_device *dev);
396 int (*poll) (struct net_device *dev, int *quota);
434 struct net_device *dev);
461 void (*uninit)(struct net_device *dev);
463 void (*destructor)(struct net_device *dev);
466 int (*open)(struct net_device *dev);
467 int (*stop)(struct net_device *dev);
470 struct net_device *dev,
477 void (*set_multicast_list)(struct net_device *dev);
479 int (*set_mac_address)(struct net_device *dev,
482 int (*do_ioctl)(struct net_device *dev,
485 int (*set_config)(struct net_device *dev,
491 struct net_device *dev,
494 int (*change_mtu)(struct net_device *dev, int new_mtu);
497 void (*tx_timeout) (struct net_device *dev);
499 void (*vlan_rx_register)(struct net_device *dev,
501 void (*vlan_rx_add_vid)(struct net_device *dev,
503 void (*vlan_rx_kill_vid)(struct net_device *dev,
508 int (*neigh_setup)(struct net_device *dev, struct neigh_parms *);
513 void (*poll_controller)(struct net_device *dev);
533 static inline void *netdev_priv(struct net_device *dev)
535 return (char *)dev + ((sizeof(struct net_device)
540 #define SET_MODULE_OWNER(dev) do { } while (0)
544 #define SET_NETDEV_DEV(net, pdev) ((net)->class_dev.dev = (pdev))
548 struct net_device *dev; /* NULL is wildcarded here */
567 extern int netdev_boot_setup_check(struct net_device *dev);
579 extern int dev_alloc_name(struct net_device *dev, const char *name);
580 extern int dev_open(struct net_device *dev);
581 extern int dev_close(struct net_device *dev);
583 extern int register_netdevice(struct net_device *dev);
584 extern int unregister_netdevice(struct net_device *dev);
585 extern void free_netdev(struct net_device *dev);
592 extern int dev_restart(struct net_device *dev);
597 typedef int gifconf_func_t(struct net_device * dev, char __user * bufptr, int len);
626 extern void __netif_schedule(struct net_device *dev);
628 static inline void netif_schedule(struct net_device *dev)
630 if (!test_bit(__LINK_STATE_XOFF, &dev->state))
631 __netif_schedule(dev);
634 static inline void netif_start_queue(struct net_device *dev)
636 clear_bit(__LINK_STATE_XOFF, &dev->state);
639 static inline void netif_wake_queue(struct net_device *dev)
645 if (test_and_clear_bit(__LINK_STATE_XOFF, &dev->state))
646 __netif_schedule(dev);
649 static inline void netif_stop_queue(struct net_device *dev)
655 set_bit(__LINK_STATE_XOFF, &dev->state);
658 static inline int netif_queue_stopped(const struct net_device *dev)
660 return test_bit(__LINK_STATE_XOFF, &dev->state);
663 static inline int netif_running(const struct net_device *dev)
665 return test_bit(__LINK_STATE_START, &dev->state);
707 struct net_device *dev);
716 static inline void dev_put(struct net_device *dev)
718 atomic_dec(&dev->refcnt);
721 static inline void dev_hold(struct net_device *dev)
723 atomic_inc(&dev->refcnt);
735 extern void linkwatch_fire_event(struct net_device *dev);
737 static inline int netif_carrier_ok(const struct net_device *dev)
739 return !test_bit(__LINK_STATE_NOCARRIER, &dev->state);
742 extern void __netdev_watchdog_up(struct net_device *dev);
744 extern void netif_carrier_on(struct net_device *dev);
746 extern void netif_carrier_off(struct net_device *dev);
748 static inline void netif_dormant_on(struct net_device *dev)
750 if (!test_and_set_bit(__LINK_STATE_DORMANT, &dev->state))
751 linkwatch_fire_event(dev);
754 static inline void netif_dormant_off(struct net_device *dev)
756 if (test_and_clear_bit(__LINK_STATE_DORMANT, &dev->state))
757 linkwatch_fire_event(dev);
760 static inline int netif_dormant(const struct net_device *dev)
762 return test_bit(__LINK_STATE_DORMANT, &dev->state);
766 static inline int netif_oper_up(const struct net_device *dev) {
767 return (dev->operstate == IF_OPER_UP ||
768 dev->operstate == IF_OPER_UNKNOWN /* backward compat */);
772 static inline int netif_device_present(struct net_device *dev)
774 return test_bit(__LINK_STATE_PRESENT, &dev->state);
777 extern void netif_device_detach(struct net_device *dev);
779 extern void netif_device_attach(struct net_device *dev);
832 static inline int __netif_rx_schedule_prep(struct net_device *dev)
834 return !test_and_set_bit(__LINK_STATE_RX_SCHED, &dev->state);
838 static inline int netif_rx_schedule_prep(struct net_device *dev)
840 return netif_running(dev) && __netif_rx_schedule_prep(dev);
847 extern void __netif_rx_schedule(struct net_device *dev);
851 static inline void netif_rx_schedule(struct net_device *dev)
853 if (netif_rx_schedule_prep(dev))
854 __netif_rx_schedule(dev);
857 /* Try to reschedule poll. Called by dev->poll() after netif_rx_complete().
860 static inline int netif_rx_reschedule(struct net_device *dev, int undo)
862 if (netif_rx_schedule_prep(dev)) {
865 dev->quota += undo;
868 list_add_tail(&dev->poll_list, &__get_cpu_var(softnet_data).poll_list);
877 * on current cpu. This primitive is called by dev->poll(), when
881 static inline void netif_rx_complete(struct net_device *dev)
886 BUG_ON(!test_bit(__LINK_STATE_RX_SCHED, &dev->state));
887 list_del(&dev->poll_list);
889 clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
893 static inline void netif_poll_disable(struct net_device *dev)
895 while (test_and_set_bit(__LINK_STATE_RX_SCHED, &dev->state))
900 static inline void netif_poll_enable(struct net_device *dev)
902 clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
908 static inline void __netif_rx_complete(struct net_device *dev)
910 BUG_ON(!test_bit(__LINK_STATE_RX_SCHED, &dev->state));
911 list_del(&dev->poll_list);
913 clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
916 static inline void netif_tx_lock(struct net_device *dev)
918 spin_lock(&dev->_xmit_lock);
919 dev->xmit_lock_owner = smp_processor_id();
922 static inline void netif_tx_lock_bh(struct net_device *dev)
924 spin_lock_bh(&dev->_xmit_lock);
925 dev->xmit_lock_owner = smp_processor_id();
928 static inline int netif_tx_trylock(struct net_device *dev)
930 int ok = spin_trylock(&dev->_xmit_lock);
932 dev->xmit_lock_owner = smp_processor_id();
936 static inline void netif_tx_unlock(struct net_device *dev)
938 dev->xmit_lock_owner = -1;
939 spin_unlock(&dev->_xmit_lock);
942 static inline void netif_tx_unlock_bh(struct net_device *dev)
944 dev->xmit_lock_owner = -1;
945 spin_unlock_bh(&dev->_xmit_lock);
948 static inline void netif_tx_disable(struct net_device *dev)
950 netif_tx_lock_bh(dev);
951 netif_stop_queue(dev);
952 netif_tx_unlock_bh(dev);
957 extern void ether_setup(struct net_device *dev);
962 extern int register_netdev(struct net_device *dev);
963 extern void unregister_netdev(struct net_device *dev);
965 extern void dev_mc_upload(struct net_device *dev);
966 extern int dev_mc_delete(struct net_device *dev, void *addr, int alen, int all);
967 extern int dev_mc_add(struct net_device *dev, void *addr, int alen, int newonly);
968 extern void dev_mc_discard(struct net_device *dev);
969 extern void dev_set_promiscuity(struct net_device *dev, int inc);
970 extern void dev_set_allmulti(struct net_device *dev, int inc);
971 extern void netdev_state_change(struct net_device *dev);
972 extern void netdev_features_change(struct net_device *dev);
978 extern int netdev_set_master(struct net_device *dev, struct net_device *master);
982 extern void netdev_rx_csum_fault(struct net_device *dev);
984 static inline void netdev_rx_csum_fault(struct net_device *dev)
1011 static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb)
1014 (!skb_gso_ok(skb, dev->features) ||
1023 struct net_device *dev = skb->dev;
1024 struct net_device *master = dev->master;
1027 (dev->priv_flags & IFF_SLAVE_INACTIVE)) {