]> git.lizzy.rs Git - plan9front.git/blob - sys/src/9/pc/wifi.h
wpa2 support continued...
[plan9front.git] / sys / src / 9 / pc / wifi.h
1 typedef struct Wkey Wkey;
2 typedef struct Wnode Wnode;
3 typedef struct Wifi Wifi;
4 typedef struct Wifipkt Wifipkt;
5
6 enum {
7         Essidlen = 32,
8 };
9
10 /* cipher */
11 enum {
12         TKIP    = 1,
13         CCMP    = 2,
14 };
15
16 struct Wkey
17 {
18         int     cipher;
19         int     len;
20         uchar   key[32];
21         uvlong  tsc;
22 };
23
24 struct Wnode
25 {
26         uchar   bssid[Eaddrlen];
27         char    ssid[Essidlen+2];
28
29         int     rsnelen;
30         uchar   rsne[256];
31         Wkey    txkey[1];
32         Wkey    rxkey[5];
33
34         int     ival;
35         int     cap;
36         int     aid;
37         int     channel;
38         long    lastseen;
39 };
40
41 struct Wifi
42 {
43         Ether   *ether;
44
45         Queue   *iq;
46         char    *status;
47         Ref     txseq;
48         void    (*transmit)(Wifi*, Wnode*, Block*);
49
50         char    essid[Essidlen+2];
51         Wnode   *bss;
52
53         Wnode   node[32];
54 };
55
56 struct Wifipkt
57 {
58         uchar   fc[2];
59         uchar   dur[2];
60         uchar   a1[Eaddrlen];
61         uchar   a2[Eaddrlen];
62         uchar   a3[Eaddrlen];
63         uchar   seq[2];
64 };
65
66 Wifi *wifiattach(Ether *ether, void (*transmit)(Wifi*, Wnode*, Block*));
67 void wifiiq(Wifi*, Block*);
68
69 long wifistat(Wifi*, void*, long, ulong);
70 long wifictl(Wifi*, void*, long);