1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25#ifndef _LINUX_NETDEVICE_H
26#define _LINUX_NETDEVICE_H
27
28#include <linux/if.h>
29#include <linux/if_ether.h>
30#include <linux/if_packet.h>
31
32#include <asm/atomic.h>
33#include <asm/cache.h>
34#include <asm/byteorder.h>
35
36#ifdef __KERNEL__
37#include <linux/config.h>
38#ifdef CONFIG_NET_PROFILE
39#include <net/profile.h>
40#endif
41
42struct divert_blk;
43struct vlan_group;
44struct ethtool_ops;
45
46
47#define SET_ETHTOOL_OPS(netdev,ops) \
48 ( (netdev)->ethtool_ops = (ops) )
49
50#define HAVE_ALLOC_NETDEV
51
52#define HAVE_FREE_NETDEV
53#define HAVE_NETDEV_PRIV
54
55#define NET_XMIT_SUCCESS 0
56#define NET_XMIT_DROP 1
57#define NET_XMIT_CN 2
58#define NET_XMIT_POLICED 3
59#define NET_XMIT_BYPASS 4
60
61
62
63
64#define NET_RX_SUCCESS 0
65#define NET_RX_DROP 1
66#define NET_RX_CN_LOW 2
67#define NET_RX_CN_MOD 3
68#define NET_RX_CN_HIGH 4
69#define NET_RX_BAD 5
70
71#define net_xmit_errno(e) ((e) != NET_XMIT_CN ? -ENOBUFS : 0)
72
73#endif
74
75#define MAX_ADDR_LEN 8
76
77
78
79
80
81
82#if !defined(CONFIG_AX25) && !defined(CONFIG_AX25_MODULE) && !defined(CONFIG_TR)
83#define LL_MAX_HEADER 32
84#else
85#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE)
86#define LL_MAX_HEADER 96
87#else
88#define LL_MAX_HEADER 48
89#endif
90#endif
91
92#if !defined(CONFIG_NET_IPIP) && \
93 !defined(CONFIG_IPV6) && !defined(CONFIG_IPV6_MODULE)
94#define MAX_HEADER LL_MAX_HEADER
95#else
96#define MAX_HEADER (LL_MAX_HEADER + 48)
97#endif
98
99
100
101
102
103
104struct net_device_stats
105{
106 unsigned long rx_packets;
107 unsigned long tx_packets;
108 unsigned long rx_bytes;
109 unsigned long tx_bytes;
110 unsigned long rx_errors;
111 unsigned long tx_errors;
112 unsigned long rx_dropped;
113 unsigned long tx_dropped;
114 unsigned long multicast;
115 unsigned long collisions;
116
117
118 unsigned long rx_length_errors;
119 unsigned long rx_over_errors;
120 unsigned long rx_crc_errors;
121 unsigned long rx_frame_errors;
122 unsigned long rx_fifo_errors;
123 unsigned long rx_missed_errors;
124
125
126 unsigned long tx_aborted_errors;
127 unsigned long tx_carrier_errors;
128 unsigned long tx_fifo_errors;
129 unsigned long tx_heartbeat_errors;
130 unsigned long tx_window_errors;
131
132
133 unsigned long rx_compressed;
134 unsigned long tx_compressed;
135};
136
137
138
139enum {
140 IF_PORT_UNKNOWN = 0,
141 IF_PORT_10BASE2,
142 IF_PORT_10BASET,
143 IF_PORT_AUI,
144 IF_PORT_100BASET,
145 IF_PORT_100BASETX,
146 IF_PORT_100BASEFX
147};
148
149#ifdef __KERNEL__
150
151extern const char *if_port_text[];
152
153#include <linux/cache.h>
154#include <linux/skbuff.h>
155
156struct neighbour;
157struct neigh_parms;
158struct sk_buff;
159
160struct netif_rx_stats
161{
162 unsigned total;
163 unsigned dropped;
164 unsigned time_squeeze;
165 unsigned throttled;
166 unsigned fastroute_hit;
167 unsigned fastroute_success;
168 unsigned fastroute_defer;
169 unsigned fastroute_deferred_out;
170 unsigned fastroute_latency_reduction;
171 unsigned cpu_collision;
172} ____cacheline_aligned;
173
174extern struct netif_rx_stats netdev_rx_stat[];
175
176
177
178
179
180
181struct dev_mc_list
182{
183 struct dev_mc_list *next;
184 __u8 dmi_addr[MAX_ADDR_LEN];
185 unsigned char dmi_addrlen;
186 int dmi_users;
187 int dmi_gusers;
188};
189
190struct hh_cache
191{
192 struct hh_cache *hh_next;
193 atomic_t hh_refcnt;
194 unsigned short hh_type;
195
196
197
198 int hh_len;
199 int (*hh_output)(struct sk_buff *skb);
200 rwlock_t hh_lock;
201
202
203#define HH_DATA_MOD 16
204#define HH_DATA_OFF(__len) \
205 (HH_DATA_MOD - ((__len) & (HH_DATA_MOD - 1)))
206#define HH_DATA_ALIGN(__len) \
207 (((__len)+(HH_DATA_MOD-1))&~(HH_DATA_MOD - 1))
208 unsigned long hh_data[HH_DATA_ALIGN(LL_MAX_HEADER) / sizeof(long)];
209};
210
211
212
213
214
215
216enum netdev_state_t
217{
218 __LINK_STATE_XOFF=0,
219 __LINK_STATE_START,
220 __LINK_STATE_PRESENT,
221 __LINK_STATE_SCHED,
222 __LINK_STATE_NOCARRIER,
223 __LINK_STATE_RX_SCHED
224};
225
226
227
228
229
230
231struct netdev_boot_setup {
232 char name[IFNAMSIZ];
233 struct ifmap map;
234};
235#define NETDEV_BOOT_SETUP_MAX 8
236
237
238
239
240
241
242
243
244
245
246
247
248struct net_device
249{
250
251
252
253
254
255
256 char name[IFNAMSIZ];
257
258
259
260
261
262 unsigned long rmem_end;
263 unsigned long rmem_start;
264 unsigned long mem_end;
265 unsigned long mem_start;
266 unsigned long base_addr;
267 unsigned int irq;
268
269
270
271
272
273
274 unsigned char if_port;
275 unsigned char dma;
276
277 unsigned long state;
278
279 struct net_device *next;
280
281
282 int (*init)(struct net_device *dev);
283
284
285
286 struct net_device *next_sched;
287
288
289 int ifindex;
290 int iflink;
291
292
293 struct net_device_stats* (*get_stats)(struct net_device *dev);
294 struct iw_statistics* (*get_wireless_stats)(struct net_device *dev);
295
296
297
298 struct iw_handler_def * wireless_handlers;
299
300 struct ethtool_ops *ethtool_ops;
301
302
303
304
305
306
307
308
309 unsigned long trans_start;
310 unsigned long last_rx;
311
312 unsigned short flags;
313 unsigned short gflags;
314 unsigned short priv_flags;
315 unsigned short unused_alignment_fixer;
316
317
318
319 unsigned mtu;
320 unsigned short type;
321 unsigned short hard_header_len;
322 void *priv;
323
324 struct net_device *master;
325
326
327
328
329 unsigned char broadcast[MAX_ADDR_LEN];
330 unsigned char dev_addr[MAX_ADDR_LEN];
331 unsigned char addr_len;
332
333 struct dev_mc_list *mc_list;
334 int mc_count;
335 int promiscuity;
336 int allmulti;
337
338 int watchdog_timeo;
339 struct timer_list watchdog_timer;
340
341
342
343 void *atalk_ptr;
344 void *ip_ptr;
345 void *dn_ptr;
346 void *ip6_ptr;
347 void *ec_ptr;
348
349 struct list_head poll_list;
350 int quota;
351 int weight;
352
353 struct Qdisc *qdisc;
354 struct Qdisc *qdisc_sleeping;
355 struct Qdisc *qdisc_ingress;
356 struct list_head qdisc_list;
357 unsigned long tx_queue_len;
358
359
360 spinlock_t xmit_lock;
361
362
363
364 int xmit_lock_owner;
365
366 spinlock_t queue_lock;
367
368 atomic_t refcnt;
369
370 int deadbeaf;
371
372
373 int features;
374#define NETIF_F_SG 1
375#define NETIF_F_IP_CSUM 2
376#define NETIF_F_NO_CSUM 4
377#define NETIF_F_HW_CSUM 8
378#define NETIF_F_DYNALLOC 16
379#define NETIF_F_HIGHDMA 32
380#define NETIF_F_FRAGLIST 64
381#define NETIF_F_HW_VLAN_TX 128
382#define NETIF_F_HW_VLAN_RX 256
383#define NETIF_F_HW_VLAN_FILTER 512
384#define NETIF_F_VLAN_CHALLENGED 1024
385
386
387 void (*uninit)(struct net_device *dev);
388
389 void (*destructor)(struct net_device *dev);
390
391
392 int (*open)(struct net_device *dev);
393 int (*stop)(struct net_device *dev);
394 int (*hard_start_xmit) (struct sk_buff *skb,
395 struct net_device *dev);
396#define HAVE_NETDEV_POLL
397 int (*poll) (struct net_device *dev, int *quota);
398 int (*hard_header) (struct sk_buff *skb,
399 struct net_device *dev,
400 unsigned short type,
401 void *daddr,
402 void *saddr,
403 unsigned len);
404 int (*rebuild_header)(struct sk_buff *skb);
405#define HAVE_MULTICAST
406 void (*set_multicast_list)(struct net_device *dev);
407#define HAVE_SET_MAC_ADDR
408 int (*set_mac_address)(struct net_device *dev,
409 void *addr);
410#define HAVE_PRIVATE_IOCTL
411 int (*do_ioctl)(struct net_device *dev,
412 struct ifreq *ifr, int cmd);
413#define HAVE_SET_CONFIG
414 int (*set_config)(struct net_device *dev,
415 struct ifmap *map);
416#define HAVE_HEADER_CACHE
417 int (*hard_header_cache)(struct neighbour *neigh,
418 struct hh_cache *hh);
419 void (*header_cache_update)(struct hh_cache *hh,
420 struct net_device *dev,
421 unsigned char * haddr);
422#define HAVE_CHANGE_MTU
423 int (*change_mtu)(struct net_device *dev, int new_mtu);
424
425#define HAVE_TX_TIMEOUT
426 void (*tx_timeout) (struct net_device *dev);
427
428 void (*vlan_rx_register)(struct net_device *dev,
429 struct vlan_group *grp);
430 void (*vlan_rx_add_vid)(struct net_device *dev,
431 unsigned short vid);
432 void (*vlan_rx_kill_vid)(struct net_device *dev,
433 unsigned short vid);
434
435 int (*hard_header_parse)(struct sk_buff *skb,
436 unsigned char *haddr);
437 int (*neigh_setup)(struct net_device *dev, struct neigh_parms *);
438 int (*accept_fastpath)(struct net_device *, struct dst_entry*);
439
440
441 struct module *owner;
442
443
444 struct net_bridge_port *br_port;
445
446#ifdef CONFIG_NET_FASTROUTE
447#define NETDEV_FASTROUTE_HMASK 0xF
448
449 rwlock_t fastpath_lock;
450 struct dst_entry *fastpath[NETDEV_FASTROUTE_HMASK+1];
451#endif
452#ifdef CONFIG_NET_DIVERT
453
454 struct divert_blk *divert;
455#endif
456};
457
458
459#define SET_NETDEV_DEV(net, pdev) do { } while (0)
460
461struct packet_type
462{
463 unsigned short type;
464 struct net_device *dev;
465 int (*func) (struct sk_buff *, struct net_device *,
466 struct packet_type *);
467 void *data;
468 struct packet_type *next;
469};
470
471static inline void *netdev_priv(struct net_device *dev)
472{
473 return dev->priv;
474}
475
476#include <linux/interrupt.h>
477#include <linux/notifier.h>
478
479extern struct net_device loopback_dev;
480extern struct net_device *dev_base;
481extern rwlock_t dev_base_lock;
482
483extern int netdev_boot_setup_add(char *name, struct ifmap *map);
484extern int netdev_boot_setup_check(struct net_device *dev);
485extern struct net_device *dev_getbyhwaddr(unsigned short type, char *hwaddr);
486extern void dev_add_pack(struct packet_type *pt);
487extern void dev_remove_pack(struct packet_type *pt);
488extern int dev_get(const char *name);
489extern struct net_device *dev_get_by_flags(unsigned short flags,
490 unsigned short mask);
491extern struct net_device *__dev_get_by_flags(unsigned short flags,
492 unsigned short mask);
493extern struct net_device *dev_get_by_name(const char *name);
494extern struct net_device *__dev_get_by_name(const char *name);
495extern struct net_device *dev_alloc(const char *name, int *err);
496extern int dev_alloc_name(struct net_device *dev, const char *name);
497extern int dev_open(struct net_device *dev);
498extern int dev_close(struct net_device *dev);
499extern int dev_queue_xmit(struct sk_buff *skb);
500extern int register_netdevice(struct net_device *dev);
501extern int unregister_netdevice(struct net_device *dev);
502extern int register_netdevice_notifier(struct notifier_block *nb);
503extern int unregister_netdevice_notifier(struct notifier_block *nb);
504extern int dev_new_index(void);
505extern struct net_device *dev_get_by_index(int ifindex);
506extern struct net_device *__dev_get_by_index(int ifindex);
507extern int dev_restart(struct net_device *dev);
508
509typedef int gifconf_func_t(struct net_device * dev, char * bufptr, int len);
510extern int register_gifconf(unsigned int family, gifconf_func_t * gifconf);
511static inline int unregister_gifconf(unsigned int family)
512{
513 return register_gifconf(family, 0);
514}
515
516
517
518
519
520
521struct softnet_data
522{
523 int throttle;
524 int cng_level;
525 int avg_blog;
526 struct sk_buff_head input_pkt_queue;
527 struct list_head poll_list;
528 struct net_device *output_queue;
529 struct sk_buff *completion_queue;
530
531 struct net_device blog_dev;
532} ____cacheline_aligned;
533
534
535extern struct softnet_data softnet_data[NR_CPUS];
536
537#define HAVE_NETIF_QUEUE
538
539static inline void __netif_schedule(struct net_device *dev)
540{
541 if (!test_and_set_bit(__LINK_STATE_SCHED, &dev->state)) {
542 unsigned long flags;
543 int cpu = smp_processor_id();
544
545 local_irq_save(flags);
546 dev->next_sched = softnet_data[cpu].output_queue;
547 softnet_data[cpu].output_queue = dev;
548 cpu_raise_softirq(cpu, NET_TX_SOFTIRQ);
549 local_irq_restore(flags);
550 }
551}
552
553static inline void netif_schedule(struct net_device *dev)
554{
555 if (!test_bit(__LINK_STATE_XOFF, &dev->state))
556 __netif_schedule(dev);
557}
558
559static inline void netif_start_queue(struct net_device *dev)
560{
561 clear_bit(__LINK_STATE_XOFF, &dev->state);
562}
563
564static inline void netif_wake_queue(struct net_device *dev)
565{
566 if (test_and_clear_bit(__LINK_STATE_XOFF, &dev->state))
567 __netif_schedule(dev);
568}
569
570static inline void netif_stop_queue(struct net_device *dev)
571{
572 set_bit(__LINK_STATE_XOFF, &dev->state);
573}
574
575static inline int netif_queue_stopped(struct net_device *dev)
576{
577 return test_bit(__LINK_STATE_XOFF, &dev->state);
578}
579
580static inline int netif_running(struct net_device *dev)
581{
582 return test_bit(__LINK_STATE_START, &dev->state);
583}
584
585
586
587
588
589static inline void dev_kfree_skb_irq(struct sk_buff *skb)
590{
591 if (atomic_dec_and_test(&skb->users)) {
592 int cpu =smp_processor_id();
593 unsigned long flags;
594
595 local_irq_save(flags);
596 skb->next = softnet_data[cpu].completion_queue;
597 softnet_data[cpu].completion_queue = skb;
598 cpu_raise_softirq(cpu, NET_TX_SOFTIRQ);
599 local_irq_restore(flags);
600 }
601}
602
603
604
605
606static inline void dev_kfree_skb_any(struct sk_buff *skb)
607{
608 if (in_irq())
609 dev_kfree_skb_irq(skb);
610 else
611 dev_kfree_skb(skb);
612}
613
614#define HAVE_NETIF_RX 1
615extern int netif_rx(struct sk_buff *skb);
616#define HAVE_NETIF_RECEIVE_SKB 1
617extern int netif_receive_skb(struct sk_buff *skb);
618extern int dev_ioctl(unsigned int cmd, void *);
619extern int dev_ethtool(struct ifreq *);
620extern int dev_change_flags(struct net_device *, unsigned);
621extern void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev);
622
623extern void dev_init(void);
624
625extern int netdev_nit;
626
627
628
629
630static inline int netif_rx_ni(struct sk_buff *skb)
631{
632 int err = netif_rx(skb);
633 if (softirq_pending(smp_processor_id()))
634 do_softirq();
635 return err;
636}
637
638static inline void dev_init_buffers(struct net_device *dev)
639{
640
641}
642
643extern int netdev_finish_unregister(struct net_device *dev);
644
645static inline void dev_put(struct net_device *dev)
646{
647 if (atomic_dec_and_test(&dev->refcnt))
648 netdev_finish_unregister(dev);
649}
650
651#define __dev_put(dev) atomic_dec(&(dev)->refcnt)
652#define dev_hold(dev) atomic_inc(&(dev)->refcnt)
653
654
655
656
657
658
659static inline int netif_carrier_ok(struct net_device *dev)
660{
661 return !test_bit(__LINK_STATE_NOCARRIER, &dev->state);
662}
663
664extern void __netdev_watchdog_up(struct net_device *dev);
665
666static inline void netif_carrier_on(struct net_device *dev)
667{
668 clear_bit(__LINK_STATE_NOCARRIER, &dev->state);
669 if (netif_running(dev))
670 __netdev_watchdog_up(dev);
671}
672
673static inline void netif_carrier_off(struct net_device *dev)
674{
675 set_bit(__LINK_STATE_NOCARRIER, &dev->state);
676}
677
678
679static inline int netif_device_present(struct net_device *dev)
680{
681 return test_bit(__LINK_STATE_PRESENT, &dev->state);
682}
683
684static inline void netif_device_detach(struct net_device *dev)
685{
686 if (test_and_clear_bit(__LINK_STATE_PRESENT, &dev->state) &&
687 netif_running(dev)) {
688 netif_stop_queue(dev);
689 }
690}
691
692static inline void netif_device_attach(struct net_device *dev)
693{
694 if (!test_and_set_bit(__LINK_STATE_PRESENT, &dev->state) &&
695 netif_running(dev)) {
696 netif_wake_queue(dev);
697 __netdev_watchdog_up(dev);
698 }
699}
700
701
702
703
704#define HAVE_NETIF_MSG 1
705
706enum {
707 NETIF_MSG_DRV = 0x0001,
708 NETIF_MSG_PROBE = 0x0002,
709 NETIF_MSG_LINK = 0x0004,
710 NETIF_MSG_TIMER = 0x0008,
711 NETIF_MSG_IFDOWN = 0x0010,
712 NETIF_MSG_IFUP = 0x0020,
713 NETIF_MSG_RX_ERR = 0x0040,
714 NETIF_MSG_TX_ERR = 0x0080,
715 NETIF_MSG_TX_QUEUED = 0x0100,
716 NETIF_MSG_INTR = 0x0200,
717 NETIF_MSG_TX_DONE = 0x0400,
718 NETIF_MSG_RX_STATUS = 0x0800,
719 NETIF_MSG_PKTDATA = 0x1000,
720 NETIF_MSG_HW = 0x2000,
721 NETIF_MSG_WOL = 0x4000,
722};
723
724#define netif_msg_drv(p) ((p)->msg_enable & NETIF_MSG_DRV)
725#define netif_msg_probe(p) ((p)->msg_enable & NETIF_MSG_PROBE)
726#define netif_msg_link(p) ((p)->msg_enable & NETIF_MSG_LINK)
727#define netif_msg_timer(p) ((p)->msg_enable & NETIF_MSG_TIMER)
728#define netif_msg_ifdown(p) ((p)->msg_enable & NETIF_MSG_IFDOWN)
729#define netif_msg_ifup(p) ((p)->msg_enable & NETIF_MSG_IFUP)
730#define netif_msg_rx_err(p) ((p)->msg_enable & NETIF_MSG_RX_ERR)
731#define netif_msg_tx_err(p) ((p)->msg_enable & NETIF_MSG_TX_ERR)
732#define netif_msg_tx_queued(p) ((p)->msg_enable & NETIF_MSG_TX_QUEUED)
733#define netif_msg_intr(p) ((p)->msg_enable & NETIF_MSG_INTR)
734#define netif_msg_tx_done(p) ((p)->msg_enable & NETIF_MSG_TX_DONE)
735#define netif_msg_rx_status(p) ((p)->msg_enable & NETIF_MSG_RX_STATUS)
736#define netif_msg_pktdata(p) ((p)->msg_enable & NETIF_MSG_PKTDATA)
737#define netif_msg_hw(p) ((p)->msg_enable & NETIF_MSG_HW)
738#define netif_msg_wol(p) ((p)->msg_enable & NETIF_MSG_WOL)
739
740static inline u32 netif_msg_init(int debug_value, int default_msg_enable_bits)
741{
742
743 if (debug_value < 0 || debug_value >= (sizeof(u32) * 8))
744 return default_msg_enable_bits;
745 if (debug_value == 0)
746 return 0;
747
748 return (1 << debug_value) - 1;
749}
750
751
752
753static inline int netif_rx_schedule_prep(struct net_device *dev)
754{
755 return netif_running(dev) &&
756 !test_and_set_bit(__LINK_STATE_RX_SCHED, &dev->state);
757}
758
759
760
761
762
763static inline void __netif_rx_schedule(struct net_device *dev)
764{
765 unsigned long flags;
766 int cpu = smp_processor_id();
767
768 local_irq_save(flags);
769 dev_hold(dev);
770 list_add_tail(&dev->poll_list, &softnet_data[cpu].poll_list);
771 if (dev->quota < 0)
772 dev->quota += dev->weight;
773 else
774 dev->quota = dev->weight;
775 __cpu_raise_softirq(cpu, NET_RX_SOFTIRQ);
776 local_irq_restore(flags);
777}
778
779
780
781static inline void netif_rx_schedule(struct net_device *dev)
782{
783 if (netif_rx_schedule_prep(dev))
784 __netif_rx_schedule(dev);
785}
786
787
788
789
790static inline int netif_rx_reschedule(struct net_device *dev, int undo)
791{
792 if (netif_rx_schedule_prep(dev)) {
793 unsigned long flags;
794 int cpu = smp_processor_id();
795
796 dev->quota += undo;
797
798 local_irq_save(flags);
799 list_add_tail(&dev->poll_list, &softnet_data[cpu].poll_list);
800 __cpu_raise_softirq(cpu, NET_RX_SOFTIRQ);
801 local_irq_restore(flags);
802 return 1;
803 }
804 return 0;
805}
806
807
808
809
810
811
812static inline void netif_rx_complete(struct net_device *dev)
813{
814 unsigned long flags;
815
816 local_irq_save(flags);
817 if (!test_bit(__LINK_STATE_RX_SCHED, &dev->state)) BUG();
818 list_del(&dev->poll_list);
819 smp_mb__before_clear_bit();
820 clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
821 local_irq_restore(flags);
822}
823
824static inline void netif_poll_disable(struct net_device *dev)
825{
826 while (test_and_set_bit(__LINK_STATE_RX_SCHED, &dev->state)) {
827
828 current->state = TASK_INTERRUPTIBLE;
829 schedule_timeout(1);
830 }
831}
832
833static inline void netif_poll_enable(struct net_device *dev)
834{
835 clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
836}
837
838
839
840
841static inline void __netif_rx_complete(struct net_device *dev)
842{
843 if (!test_bit(__LINK_STATE_RX_SCHED, &dev->state)) BUG();
844 list_del(&dev->poll_list);
845 smp_mb__before_clear_bit();
846 clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
847}
848
849static inline void netif_tx_disable(struct net_device *dev)
850{
851 spin_lock_bh(&dev->xmit_lock);
852 netif_stop_queue(dev);
853 spin_unlock_bh(&dev->xmit_lock);
854}
855
856
857
858extern void ether_setup(struct net_device *dev);
859extern void fddi_setup(struct net_device *dev);
860extern void tr_setup(struct net_device *dev);
861extern void fc_setup(struct net_device *dev);
862extern void fc_freedev(struct net_device *dev);
863
864extern struct net_device *alloc_netdev(int sizeof_priv, const char *name,
865 void (*setup)(struct net_device *));
866extern int register_netdev(struct net_device *dev);
867extern void unregister_netdev(struct net_device *dev);
868
869extern void dev_mc_upload(struct net_device *dev);
870extern int dev_mc_delete(struct net_device *dev, void *addr, int alen, int all);
871extern int dev_mc_add(struct net_device *dev, void *addr, int alen, int newonly);
872extern void dev_mc_discard(struct net_device *dev);
873extern void dev_set_promiscuity(struct net_device *dev, int inc);
874extern void dev_set_allmulti(struct net_device *dev, int inc);
875extern void netdev_state_change(struct net_device *dev);
876
877extern void dev_load(const char *name);
878extern void dev_mcast_init(void);
879extern int netdev_register_fc(struct net_device *dev, void (*stimul)(struct net_device *dev));
880extern void netdev_unregister_fc(int bit);
881extern int netdev_max_backlog;
882extern int weight_p;
883extern unsigned long netdev_fc_xoff;
884extern atomic_t netdev_dropping;
885extern int netdev_set_master(struct net_device *dev, struct net_device *master);
886extern struct sk_buff * skb_checksum_help(struct sk_buff *skb);
887#ifdef CONFIG_NET_FASTROUTE
888extern int netdev_fastroute;
889extern int netdev_fastroute_obstacles;
890extern void dev_clear_fastroute(struct net_device *dev);
891#endif
892
893static inline void free_netdev(struct net_device *dev)
894{
895 kfree(dev);
896}
897
898#endif
899
900#endif
901