[kismac] [binaervarianz] r178 - branches/usb-drivers/Sources/Driver/USBJack
- From: svn@xxxxxxxxxxxxxxxx
- To: kismac@xxxxxxxxxxxxx
- Date: Thu, 31 Aug 2006 00:04:31 +0200
Author: gkruse
Date: 2006-08-31 00:04:27 +0200 (Thu, 31 Aug 2006)
New Revision: 178
Modified:
branches/usb-drivers/Sources/Driver/USBJack/IntersilJack.h
branches/usb-drivers/Sources/Driver/USBJack/IntersilJack.mm
branches/usb-drivers/Sources/Driver/USBJack/RalinkJack.h
branches/usb-drivers/Sources/Driver/USBJack/RalinkJack.mm
branches/usb-drivers/Sources/Driver/USBJack/USBJack.h
branches/usb-drivers/Sources/Driver/USBJack/USBJack.mm
branches/usb-drivers/Sources/Driver/USBJack/rt2570.h
Log:
Fix some copy paste errrors that caused linking to fail if building in a
configuration other than Develpoment. Thanks macksss for spotting this.
Modified: branches/usb-drivers/Sources/Driver/USBJack/IntersilJack.h
===================================================================
--- branches/usb-drivers/Sources/Driver/USBJack/IntersilJack.h 2006-08-30
17:09:05 UTC (rev 177)
+++ branches/usb-drivers/Sources/Driver/USBJack/IntersilJack.h 2006-08-30
22:04:27 UTC (rev 178)
@@ -16,6 +16,16 @@
IntersilJack();
~IntersilJack();
+ IOReturn _init();
+ IOReturn _reset();
+
+ bool startCapture(UInt16 channel);
+ bool stopCapture();
+ bool getChannel(UInt16* channel);
+ bool getAllowedChannels(UInt16* channel);
+ bool setChannel(UInt16 channel);
+
+
private:
int temp;
};
Modified: branches/usb-drivers/Sources/Driver/USBJack/IntersilJack.mm
===================================================================
--- branches/usb-drivers/Sources/Driver/USBJack/IntersilJack.mm 2006-08-30
17:09:05 UTC (rev 177)
+++ branches/usb-drivers/Sources/Driver/USBJack/IntersilJack.mm 2006-08-30
22:04:27 UTC (rev 178)
@@ -8,29 +8,29 @@
#import "IntersilJack.h"
-bool USBJack::startCapture(UInt16 channel) {
+bool IntersilJack::startCapture(UInt16 channel) {
if (!_devicePresent) return false;
if (!_deviceInit) return false;
if ((!_isEnabled) && (_disable() != kIOReturnSuccess)) {
- NSLog(@"USBJack::::startCapture: Couldn't disable card\n");
+ NSLog(@"IntersilJack::startCapture: Couldn't disable card\n");
return false;
}
if (setChannel(channel) == false) {
- NSLog(@"USBJack::::startCapture: setChannel(%d) failed -
resetting...\n",
+ NSLog(@"IntersilJack::startCapture: setChannel(%d) failed -
resetting...\n",
channel);
_reset();
return false;
}
if (_doCommand(wlcMonitorOn, 0) != kIOReturnSuccess) {
- NSLog(@"USBJack::::startCapture: _doCommand(wlcMonitorOn) failed\n");
+ NSLog(@"IntersilJack::startCapture: _doCommand(wlcMonitorOn)
failed\n");
return false;
}
if (_enable() != kIOReturnSuccess) {
- NSLog(@"USBJack::::startCapture: Couldn't enable card\n");
+ NSLog(@"IntersilJack::startCapture: Couldn't enable card\n");
return false;
}
@@ -38,26 +38,26 @@
return true;
}
-bool USBJack::stopCapture() {
+bool IntersilJack::stopCapture() {
_channel = 0;
if (!_devicePresent) return false;
if (!_deviceInit) return false;
if (_doCommand(wlcMonitorOff, 0) != kIOReturnSuccess) {
- NSLog(@"USBJack::stopCapture: _doCommand(wlcMonitorOff) failed\n");
+ NSLog(@"::stopCapture: _doCommand(wlcMonitorOff) failed\n");
return false;
}
return true;
}
-bool USBJack::getChannel(UInt16* channel) {
+bool IntersilJack::getChannel(UInt16* channel) {
if (!_devicePresent) return false;
if (!_deviceInit) return false;
if (_getValue(0xFDC1, channel) != kIOReturnSuccess) {
- NSLog(@"USBJack::getChannel: getValue error\n");
+ NSLog(@"IntersilJack::getChannel: getValue error\n");
return false;
}
@@ -65,37 +65,37 @@
return true;
}
-bool USBJack::getAllowedChannels(UInt16* channels) {
+bool IntersilJack::getAllowedChannels(UInt16* channels) {
if (!_devicePresent) return false;
if (!_deviceInit) return false;
if (_getValue(0xFD10, channels) != kIOReturnSuccess) {
- NSLog(@"USBJack::getAllowedChannels: getValue error\n");
+ NSLog(@"IntersilJack::getAllowedChannels: getValue error\n");
return false;
}
return true;
}
-bool USBJack::setChannel(UInt16 channel) {
+bool IntersilJack::setChannel(UInt16 channel) {
if (!_devicePresent) return false;
if (!_deviceInit) return false;
if (_setValue(0xFC03, channel) != kIOReturnSuccess) {
usleep(10000);
if (_setValue(0xFC03, channel) != kIOReturnSuccess) {
- NSLog(@"USBJack::setChannel: setValue error\n");
+ NSLog(@"IntersilJack::setChannel: setValue error\n");
return false;
}
}
if (_isEnabled) {
if (_disable() != kIOReturnSuccess) {
- NSLog(@"USBJack::setChannel: Couldn't disable card\n");
+ NSLog(@"IntersilJack::setChannel: Couldn't disable card\n");
return false;
}
if (_enable() != kIOReturnSuccess) {
- NSLog(@"USBJack::setChannel: Couldn't enable card\n");
+ NSLog(@"IntersilJack::setChannel: Couldn't enable card\n");
return false;
}
}
@@ -104,7 +104,7 @@
return true;
}
-IOReturn USBJack::_init() {
+IOReturn IntersilJack::_init() {
WLIdentity ident;
WLHardwareAddress macAddr;
int i;
@@ -121,14 +121,14 @@
*/
if (_getIdentity(&ident) != kIOReturnSuccess) {
- NSLog(@"USBJack::_init: Couldn't read card identity\n");
+ NSLog(@"IntersilJack::_init: Couldn't read card identity\n");
return kIOReturnError;
}
- NSLog(@"USBJack: Firmware vendor %d, variant %d, version %d.%d\n",
ident.vendor, ident.variant, ident.major, ident.minor);
+ NSLog(@"IntersilJack: Firmware vendor %d, variant %d, version %d.%d\n",
ident.vendor, ident.variant, ident.major, ident.minor);
if (_getHardwareAddress(&macAddr) != kIOReturnSuccess) {
- NSLog(@"USBJack::_init: Couldn't read MAC address\n");
+ NSLog(@"IntersilJack::_init: Couldn't read MAC address\n");
return kIOReturnError;
}
@@ -138,11 +138,11 @@
}
-IOReturn USBJack::_reset() {
+IOReturn IntersilJack::_reset() {
int i;
if (_doCommand(wlcInit, 0) != kIOReturnSuccess) {
- NSLog(@"USBJack::_reset: _doCommand(wlcInit, 0) failed\n");
+ NSLog(@"IntersilJack::_reset: _doCommand(wlcInit, 0) failed\n");
return kIOReturnError;
}
@@ -169,7 +169,7 @@
}
if (i==wlTimeout) {
- NSLog(@"USBJack::_reset: could not set port type\n");
+ NSLog(@"IntersilJack::_reset: could not set port type\n");
return kIOReturnError;
}
Modified: branches/usb-drivers/Sources/Driver/USBJack/RalinkJack.h
===================================================================
--- branches/usb-drivers/Sources/Driver/USBJack/RalinkJack.h 2006-08-30
17:09:05 UTC (rev 177)
+++ branches/usb-drivers/Sources/Driver/USBJack/RalinkJack.h 2006-08-30
22:04:27 UTC (rev 178)
@@ -8,8 +8,7 @@
*/
#import <Cocoa/Cocoa.h>
-#include "USBJack.h"
-#include "rt2570.h"
+#import "USBJack.h"
class RalinkJack: public USBJack
{
Modified: branches/usb-drivers/Sources/Driver/USBJack/RalinkJack.mm
===================================================================
--- branches/usb-drivers/Sources/Driver/USBJack/RalinkJack.mm 2006-08-30
17:09:05 UTC (rev 177)
+++ branches/usb-drivers/Sources/Driver/USBJack/RalinkJack.mm 2006-08-30
22:04:27 UTC (rev 178)
@@ -8,6 +8,7 @@
*/
#include "RalinkJack.h"
+#include "rt2570.h"
IOReturn RalinkJack::_init() {
unsigned long Index;
@@ -145,8 +146,6 @@
//AsicLockChannel(pAdapter, pAdapter->PortCfg.Channel);
//RTUSBMultiRead(STA_CSR0, buffer, 22);
- UInt32 numBytesRead = sizeof(_recieveBuffer);
- (*_interface)->ReadPipeAsync(_interface, kInPipe, &_recieveBuffer,
numBytesRead, (IOAsyncCallback1)_interruptRecieved, this);
NSLog(@"<-- NICInitializeAsic\n");
return kIOReturnSuccess;
}
@@ -178,6 +177,7 @@
ret = (*_interface)->ControlRequest(_interface, 0, &theRequest);
+ #if __BIG_ENDIAN__
//data is returned in the bus endian
//we need to swap
//this is going to be bad when we run on intel
@@ -186,7 +186,7 @@
swab(theRequest.pData, buf, wLength);
memcpy(pData, buf,wLength);
free(buf);
-
+ #endif
}
return ret;
}
Modified: branches/usb-drivers/Sources/Driver/USBJack/USBJack.h
===================================================================
--- branches/usb-drivers/Sources/Driver/USBJack/USBJack.h 2006-08-30
17:09:05 UTC (rev 177)
+++ branches/usb-drivers/Sources/Driver/USBJack/USBJack.h 2006-08-30
22:04:27 UTC (rev 178)
@@ -33,8 +33,8 @@
class USBJack {
public:
- bool startCapture(UInt16 channel);
- bool stopCapture();
+ virtual bool startCapture(UInt16 channel);
+ virtual bool stopCapture();
virtual bool getChannel(UInt16* channel);
virtual bool getAllowedChannels(UInt16* channel);
virtual bool setChannel(UInt16 channel);
Modified: branches/usb-drivers/Sources/Driver/USBJack/USBJack.mm
===================================================================
--- branches/usb-drivers/Sources/Driver/USBJack/USBJack.mm 2006-08-30
17:09:05 UTC (rev 177)
+++ branches/usb-drivers/Sources/Driver/USBJack/USBJack.mm 2006-08-30
22:04:27 UTC (rev 178)
@@ -101,7 +101,7 @@
return false; //this method MUST be overridden
}
-bool USBJack::getChannel(UInt16* channel) {
+ bool USBJack::getChannel(UInt16* channel) {
return false; //this method MUST be overridden
}
Modified: branches/usb-drivers/Sources/Driver/USBJack/rt2570.h
===================================================================
--- branches/usb-drivers/Sources/Driver/USBJack/rt2570.h 2006-08-30
17:09:05 UTC (rev 177)
+++ branches/usb-drivers/Sources/Driver/USBJack/rt2570.h 2006-08-30
22:04:27 UTC (rev 178)
@@ -31,6 +31,9 @@
* Name Date Modification logs
* Jan Lee 2005-06-01 Release
***************************************************************************/
+#ifndef __RT2570_H__
+#define __RT2570_H__
+
#define ULONG unsigned long
#define UCHAR unsigned char
#define USHORT unsigned short
@@ -77,12 +80,9 @@
0x3E10, // R62
0x4BFF, // R75//by MAX
};
+
#define NUM_BBP_REG_PARMS (sizeof(BBPRegTable) / sizeof(USHORT))
-
-#ifndef __RT2570_H__
-#define __RT2570_H__
-
//
// Control/Status Registers (CSR)
//
Other related posts:
- » [kismac] [binaervarianz] r178 - branches/usb-drivers/Sources/Driver/USBJack