1: /*
2:
3: File: WiFiUserClient.h
4: Program: GTDriver
5: Author: Michael Roßberg
6: mick@binaervarianz.de
7: Description: GTDriver is a free driver for PrismGT based cards under OS X.
8:
9: This file is part of GTDriver.
10:
11: GTDriver is free software; you can redistribute it and/or modify
12: it under the terms of the GNU General Public License as published by
13: the Free Software Foundation; either version 2 of the License, or
14: (at your option) any later version.
15:
16: GTDriver is distributed in the hope that it will be useful,
17: but WITHOUT ANY WARRANTY; without even the implied warranty of
18: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19: GNU General Public License for more details.
20:
21: You should have received a copy of the GNU General Public License
22: along with GTDriver; if not, write to the Free Software
23: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24: */
25:
26: #include <IOKit/IOService.h>
27: #include <IOKit/IOUserClient.h>
28: #include <IOKit/IODataQueue.h>
29:
30: #include "WiFiController.h"
31:
32: class WiFiUserClient : public IOUserClient {
33: OSDeclareDefaultStructors(WiFiUserClient);
34:
35: public:
36: virtual bool start(IOService*);
37: virtual void stop(IOService*);
38: virtual IOReturn clientClose(void);
39: virtual IOReturn clientDied(void);
40: virtual bool initWithTask(task_t, void*, UInt32);
41: virtual IOReturn message(UInt32 type, IOService *provider, void *argument = 0);
42: virtual IOExternalMethod* getTargetAndMethodForIndex(IOService**,
43: UInt32);
44: /*
45: * UserClient commands
46: */
47: IOReturn open(void);
48: IOReturn close(void);
49:
50: virtual IOReturn clientMemoryForType(UInt32, IOOptionBits*, IOMemoryDescriptor**);
51: virtual IOReturn registerNotificationPort(mach_port_t, UInt32, UInt32);
52:
53: private:
54: UInt32 _getLinkSpeed();
55: UInt32 _getConnectionState();
56: UInt32 _getFrequency();
57: IOReturn _setFrequency(UInt32 frequency);
58: IOReturn _setMode(UInt32 mode);
59: IOReturn _setSSID(const char *buffer, UInt32 size);
60: IOReturn _setWEPKey(const char *buffer, UInt32 size);
61: IOReturn _getScan(const char *buffer, UInt32 size);
62:
63: task_t _owningTask;
64: void *_securityToken;
65: UInt32 _securityType;
66: WiFiController *_provider;
67:
68: IOCommandGate *_userCommandGate;
69: static IODataQueue *_packetQueue;
70: };
71: