Dolphin connects to the virtual NIC device now, but for some reason it can't send out it's packet. 350 bytes, yet 0 get out >>
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3214 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
dcad8a779d
commit
0f9214bce5
|
@ -23,13 +23,19 @@
|
||||||
|
|
||||||
bool CEXIETHERNET::deactivate()
|
bool CEXIETHERNET::deactivate()
|
||||||
{
|
{
|
||||||
|
DEBUGPRINT("Deactivating BBA...\n");
|
||||||
|
if(!isActivated())
|
||||||
|
return true;
|
||||||
|
CloseHandle(mHRecvEvent);
|
||||||
|
mHRecvEvent = INVALID_HANDLE_VALUE;
|
||||||
|
CloseHandle(mHAdapter);
|
||||||
|
mHAdapter = INVALID_HANDLE_VALUE;
|
||||||
|
DEBUGPRINT("Success!\n");
|
||||||
return true;
|
return true;
|
||||||
// TODO: Actually deactivate
|
|
||||||
}
|
}
|
||||||
bool CEXIETHERNET::isActivated()
|
bool CEXIETHERNET::isActivated()
|
||||||
{
|
{
|
||||||
return false;
|
return mHAdapter != INVALID_HANDLE_VALUE;
|
||||||
//TODO: Never Activated Yet!
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CEXIETHERNET::activate() {
|
bool CEXIETHERNET::activate() {
|
||||||
|
@ -54,12 +60,14 @@ if(isActivated())
|
||||||
#endif //0
|
#endif //0
|
||||||
|
|
||||||
mHAdapter = CreateFile (/*device_path*/
|
mHAdapter = CreateFile (/*device_path*/
|
||||||
USERMODEDEVICEDIR "{1B1F9D70-50B7-4F45-AA4A-ABD17451E736}" TAPSUFFIX,
|
//{E0277714-28A6-4EB6-8AA2-7DF4870C04F6}
|
||||||
|
USERMODEDEVICEDIR "{E0277714-28A6-4EB6-8AA2-7DF4870C04F6}" TAPSUFFIX,
|
||||||
GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING,
|
GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING,
|
||||||
FILE_ATTRIBUTE_SYSTEM | FILE_FLAG_OVERLAPPED, 0);
|
FILE_ATTRIBUTE_SYSTEM | FILE_FLAG_OVERLAPPED, 0);
|
||||||
DEBUGPRINT("TAP-WIN32 device opened: %s\n",
|
DEBUGPRINT("TAP-WIN32 device opened: %s\n",
|
||||||
USERMODEDEVICEDIR "{1B1F9D70-50B7-4F45-AA4A-ABD17451E736}" TAPSUFFIX);
|
USERMODEDEVICEDIR "{E0277714-28A6-4EB6-8AA2-7DF4870C04F6}" TAPSUFFIX);
|
||||||
if(mHAdapter == INVALID_HANDLE_VALUE) {
|
if(mHAdapter == INVALID_HANDLE_VALUE) {
|
||||||
|
DEBUGPRINT("mHAdapter is invalid\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,6 +96,7 @@ if(isActivated())
|
||||||
if(!DeviceIoControl(mHAdapter, TAP_IOCTL_GET_MTU,
|
if(!DeviceIoControl(mHAdapter, TAP_IOCTL_GET_MTU,
|
||||||
&mMtu, sizeof (mMtu), &mMtu, sizeof (mMtu), &len, NULL))
|
&mMtu, sizeof (mMtu), &mMtu, sizeof (mMtu), &len, NULL))
|
||||||
{
|
{
|
||||||
|
DEBUGPRINT("Couldn't get device MTU");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
DEBUGPRINT("TAP-Win32 MTU=%d (ignored)\n", mMtu);
|
DEBUGPRINT("TAP-Win32 MTU=%d (ignored)\n", mMtu);
|
||||||
|
@ -102,6 +111,10 @@ if(isActivated())
|
||||||
DEBUGPRINT("WARNING: The TAP-Win32 driver rejected a TAP_IOCTL_SET_MEDIA_STATUS DeviceIoControl call.\n");
|
DEBUGPRINT("WARNING: The TAP-Win32 driver rejected a TAP_IOCTL_SET_MEDIA_STATUS DeviceIoControl call.\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DEBUGPRINT("TAP-WIN32 status as Connected\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//set up recv event
|
//set up recv event
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include "EXI_Device.h"
|
#include "EXI_Device.h"
|
||||||
#include "EXI_DeviceEthernet.h"
|
#include "EXI_DeviceEthernet.h"
|
||||||
|
|
||||||
#define SONICDEBUG
|
//#define SONICDEBUG
|
||||||
|
|
||||||
void DEBUGPRINT (const char * format, ...)
|
void DEBUGPRINT (const char * format, ...)
|
||||||
{
|
{
|
||||||
|
@ -79,9 +79,15 @@ CEXIETHERNET::CEXIETHERNET() :
|
||||||
ID = 0x04020200;
|
ID = 0x04020200;
|
||||||
mWriteP = INVALID_P;
|
mWriteP = INVALID_P;
|
||||||
mReadP = INVALID_P;
|
mReadP = INVALID_P;
|
||||||
|
mWaiting = false;
|
||||||
mReadyToSend = false;
|
mReadyToSend = false;
|
||||||
Activated = false;
|
Activated = false;
|
||||||
m_bInterruptSet = false;
|
m_bInterruptSet = false;
|
||||||
|
#ifdef _WIN32
|
||||||
|
mHAdapter = INVALID_HANDLE_VALUE;
|
||||||
|
mHRecvEvent = INVALID_HANDLE_VALUE;
|
||||||
|
mHReadWait = INVALID_HANDLE_VALUE;
|
||||||
|
#endif
|
||||||
|
|
||||||
mRecvBufferLength = 0;
|
mRecvBufferLength = 0;
|
||||||
|
|
||||||
|
@ -199,9 +205,9 @@ void CEXIETHERNET::ImmWrite(u32 _uData, u32 _uSize)
|
||||||
if (RISE(BBA_NCRA_SR) && isActivated())
|
if (RISE(BBA_NCRA_SR) && isActivated())
|
||||||
{
|
{
|
||||||
DEBUGPRINT( "\t[INFO]BBA Start Recieve\n");
|
DEBUGPRINT( "\t[INFO]BBA Start Recieve\n");
|
||||||
exit(0);
|
//exit(0);
|
||||||
// TODO: Need to make our virtual network device start receiving
|
// TODO: Need to make our virtual network device start receiving
|
||||||
//HWGLE(startRecv());
|
startRecv();
|
||||||
}
|
}
|
||||||
if (RISE(BBA_NCRA_ST1))
|
if (RISE(BBA_NCRA_ST1))
|
||||||
{
|
{
|
||||||
|
@ -222,8 +228,9 @@ void CEXIETHERNET::ImmWrite(u32 _uData, u32 _uSize)
|
||||||
break;
|
break;
|
||||||
case BBA_NWAYC:
|
case BBA_NWAYC:
|
||||||
DEBUGPRINT( "\t[INFO]BBA_NWAYCn");
|
DEBUGPRINT( "\t[INFO]BBA_NWAYCn");
|
||||||
if(_uData & (BBA_NWAYC_ANE | BBA_NWAYC_ANS_RA))
|
if(Common::swap32(_uData) & (BBA_NWAYC_ANE | BBA_NWAYC_ANS_RA))
|
||||||
{
|
{
|
||||||
|
DEBUGPRINT("ACTIVATING!\n");
|
||||||
activate();
|
activate();
|
||||||
//say we've successfully negotiated for 10 Mbit full duplex
|
//say we've successfully negotiated for 10 Mbit full duplex
|
||||||
//should placate libogc
|
//should placate libogc
|
||||||
|
|
|
@ -28,7 +28,6 @@ int main()
|
||||||
|
|
||||||
while(1)
|
while(1)
|
||||||
{
|
{
|
||||||
VIDEO_ClearFrameBuffer(rmode, xfb, 0);
|
|
||||||
std::cout<<"\x1b[0;0H"; // Position the cursor (at 0, 0)
|
std::cout<<"\x1b[0;0H"; // Position the cursor (at 0, 0)
|
||||||
PAD_Read(pad);
|
PAD_Read(pad);
|
||||||
for(int a = 0; a < 4;a ++)
|
for(int a = 0; a < 4;a ++)
|
||||||
|
|
Loading…
Reference in New Issue