X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Modules%2FNE2000%2Fne2000.c;h=3717a99c2593a71df92c6dfb3f1489f9438d9209;hb=f035491c949cb86d92a93fc3d9d033538704256b;hp=225a0219211894a54c486036c0d33e8f1a109e8b;hpb=47e9dfd89189fc6b150bd6b20229cb047c7e0858;p=tpg%2Facess2.git diff --git a/Modules/NE2000/ne2000.c b/Modules/NE2000/ne2000.c index 225a0219..3717a99c 100644 --- a/Modules/NE2000/ne2000.c +++ b/Modules/NE2000/ne2000.c @@ -9,6 +9,7 @@ #include #include #include +#include // === CONSTANTS === #define MEM_START 0x40 @@ -91,7 +92,8 @@ tDevFS_Driver gNe2k_DriverInfo = { .ACLs = &gVFS_ACL_EveryoneRX, .Flags = VFS_FFLAG_DIRECTORY, .ReadDir = Ne2k_ReadDir, - .FindDir = Ne2k_FindDir + .FindDir = Ne2k_FindDir, + .IOCtl = Ne2k_IOCtl } }; Uint16 gNe2k_BaseAddress; @@ -233,30 +235,56 @@ static const char *casIOCtls[] = { DRV_IOCTLNAMES, DRV_NETWORK_IOCTLNAMES, NULL */ int Ne2k_IOCtl(tVFS_Node *Node, int ID, void *Data) { + int tmp; + ENTER("pNode iID pData", Node, ID, Data); switch( ID ) { - case DRV_IOCTL_TYPE: return DRV_TYPE_NETWORK; + case DRV_IOCTL_TYPE: + LEAVE('i', DRV_TYPE_NETWORK); + return DRV_TYPE_NETWORK; + case DRV_IOCTL_IDENT: - if(!CheckMem(Data, 4)) return -1; + if(!CheckMem(Data, 4)) { + LEAVE('i', -1); + return -1; + } memcpy(Data, "NE2K", 4); + LEAVE('i', 1); return 1; - case DRV_IOCTL_VERSION: return VERSION; + + case DRV_IOCTL_VERSION: + LEAVE('x', VERSION); + return VERSION; + case DRV_IOCTL_LOOKUP: - if(!CheckString(Data)) return -1; - return LookupString( casIOCtls, Data ); + if( !CheckString(Data) ) { + LEAVE('i', -1); + return -1; + } + tmp = LookupString( (char**)casIOCtls, Data ); + LEAVE('i', tmp); + return tmp; } // If this is the root, return - if( Node == &gNe2k_DriverInfo.Node ) return 0; + if( Node == &gNe2k_DriverInfo.RootNode ) { + LEAVE('i', 0); + return 0; + } // Device specific settings switch( ID ) { case NET_IOCTL_GETMAC: - if(!CheckMem(Data, 6)) return -1; + if( !CheckMem(Data, 6) ) { + LEAVE('i', -1); + return -1; + } memcpy( Data, ((tCard*)Node->ImplPtr)->MacAddr, 6 ); + LEAVE('i', 1); return 1; } + LEAVE('i', 0); return 0; }