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