[kismac] Re: [binaervarianz] r185 - branches/usb-drivers/Sources/Driver/USBJack

  • From: Bug Dave <bugdave@xxxxxxxxx>
  • To: kismac@xxxxxxxxxxxxx
  • Date: Mon, 4 Sep 2006 13:40:02 -0400

builds fine for me. Can you try checking out a clean version and trying again?

On Sep 4, 2006, at 8:27 AM, Erik Winkler wrote:

I am getting the following error when compiling rev 185 in the log file:

/Users/ewinkler/Desktop/branches/0.2x/Sources/Core/WavePacket.mm: 118: error: invalid conversion from 'volatile void*' to 'void*'
/Users/ewinkler/Desktop/branches/0.2x/Sources/Core/WavePacket.mm: 118: error: initializing argument 1 of 'void* memcpy(void*, const void*, size_t)'


Using Xcode 2.4 on a G4 powerbook.


Erik

On Sep 4, 2006, at 2:30 AM, svn@xxxxxxxxxxxxxxxx wrote:

Author: gkruse
Date: 2006-09-04 08:30:28 +0200 (Mon, 04 Sep 2006)
New Revision: 185

Modified:
   branches/usb-drivers/Sources/Driver/USBJack/RalinkJack.h
   branches/usb-drivers/Sources/Driver/USBJack/RalinkJack.mm
Log:
better unmalforming of the packets, and some cool led tricks

Modified: branches/usb-drivers/Sources/Driver/USBJack/RalinkJack.h
===================================================================
--- branches/usb-drivers/Sources/Driver/USBJack/RalinkJack.h 2006-09-03 08:37:41 UTC (rev 184)
+++ branches/usb-drivers/Sources/Driver/USBJack/RalinkJack.h 2006-09-04 06:30:28 UTC (rev 185)
@@ -59,6 +59,7 @@
bool setChannel(UInt16 channel);
bool getAllowedChannels(UInt16* channels);
bool startCapture(UInt16 channel);
+ bool stopCapture();


     bool _massagePacket(int len);


Modified: branches/usb-drivers/Sources/Driver/USBJack/RalinkJack.mm
===================================================================
--- branches/usb-drivers/Sources/Driver/USBJack/RalinkJack.mm 2006-09-03 08:37:41 UTC (rev 184)
+++ branches/usb-drivers/Sources/Driver/USBJack/RalinkJack.mm 2006-09-04 06:30:28 UTC (rev 185)
@@ -70,7 +70,7 @@
}


//lets mess with the leds to verify we have control
- RTUSBWriteMACRegister(MAC_CSR20, 0x002); //put led under software control
+ RTUSBWriteMACRegister(MAC_CSR20, 0x0000); //put led under software control


RTUSBWriteMACRegister(MAC_CSR1, 4); //host is ready to work
RTUSBReadMACRegister(MAC_CSR0, &temp); //read the asic version number
@@ -855,6 +855,11 @@
return true;
}


+bool RalinkJack::stopCapture(){
+    RTUSBWriteMACRegister(TXRX_CSR2, 0x00ff); //disable rx
+    return true;
+}
+
 bool RalinkJack::_massagePacket(int len){
     unsigned char* pData;
     UInt8 frame[sizeof(_recieveBuffer)];
@@ -864,6 +869,9 @@
     bzero(frame,sizeof(_recieveBuffer));
     tempFrame = (WLFrame *)frame;

+ //flash the led for fun
+ RTUSBWriteMACRegister(MAC_CSR20, 0x0004); //put led under software control
+
pData = (unsigned char*)&_recieveBuffer;


pRxD = (PRXD_STRUC)(pData + len - sizeof(RXD_STRUC));
@@ -881,12 +889,21 @@
}
else {*/
// NSLog(@"Good Frame : %d, %d, %d", pRxD->Crc, pRxD- >CiErr, pRxD->PhyErr);
+ // this is probablty not the most efficient way to do this
tempFrame->silence = pRxD->BBR1;
- tempFrame->dataLen = NSSwapLittleShortToHost(len - sizeof (WLPrismHeader) - sizeof(RXD_STRUC));
+ tempFrame->dataLen = NSSwapLittleShortToHost(len - 28 - (sizeof(RXD_STRUC)));


- memcpy(frame + sizeof(WLPrismHeader), pData, 24 /*sizeof (_recieveBuffer)*/); //copy the 80211 header, nnot 24 not 32 bytes
- memcpy(frame + sizeof(WLPrismHeader) + 32 + 14, pData + 24,sizeof(_recieveBuffer)-(32+14+sizeof(WLPrismHeader)));
+ memcpy(frame + sizeof(WLPrismHeader), pData, 24); //copy the 80211 header, 24 not 32 bytes
+ //if the packet is less than 46 bytes, we can't exactly copy any more
+ if (len > 46) {
+ memcpy(frame + sizeof(WLPrismHeader) + 32 + 14, pData + 24,len-(32+sizeof(WLPrismHeader)));
+ }
+ else {
+ NSLog(@"RalinkJack::Really short packet!");
+ }
+
memcpy(&_recieveBuffer, frame, sizeof(_recieveBuffer));
+ RTUSBWriteMACRegister(MAC_CSR20, 0x0002); //put led under software control
return true; //override if needed
// }
// return false;





Other related posts: