]> git.lizzy.rs Git - plan9front.git/blob - sys/src/cmd/nusb/ether/dat.h
merge
[plan9front.git] / sys / src / cmd / nusb / ether / dat.h
1 typedef struct Block Block;
2 struct Block
3 {
4         Ref;
5
6         Block   *next;
7
8         uchar   *rp;
9         uchar   *wp;
10         uchar   *lim;
11
12         uchar   base[];
13 };
14
15 #define BLEN(s) ((s)->wp - (s)->rp)
16
17 Block*  allocb(int size);
18 void    freeb(Block*);
19 Block*  copyblock(Block*, int);
20
21 typedef struct Ehdr Ehdr;
22 struct Ehdr
23 {
24         uchar   d[6];
25         uchar   s[6];
26         uchar   type[2];
27 };
28
29 enum {
30         Ehdrsz  = 6+6+2,
31         Maxpkt  = 2000,
32 };
33
34 enum
35 {
36         Cdcunion = 6,
37         Scether = 6,
38         Fnether = 15,
39 };
40
41 int debug;
42 int setmac;
43
44 /* to be filled in by *init() */
45 uchar macaddr[6];
46
47 int nprom;
48 int nmulti;
49 uchar multiaddr[32][6];
50
51 void    etheriq(Block*, int wire);
52
53 int     (*epreceive)(Dev*);
54 void    (*eptransmit)(Dev*, Block*);
55 int     (*eppromiscuous)(Dev*, int);
56 int     (*epmulticast)(Dev*, uchar*, int);