X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Modules%2FNetwork%2FRTL8139%2Fmain.c;fp=Modules%2FNetwork%2FRTL8139%2Fmain.c;h=0031925fa240e21382d47cd7bc36d5f2ca9128a7;hb=3998cfbbadb005bf3ad52ea2538dc21f82864ddc;hp=b458cdae3aaa2ca71415c99c8b380dd5c792a16a;hpb=321d008781422b7d7137e9acc1ba0e84dec79ff1;p=tpg%2Facess2.git diff --git a/Modules/Network/RTL8139/main.c b/Modules/Network/RTL8139/main.c index b458cdae..0031925f 100644 --- a/Modules/Network/RTL8139/main.c +++ b/Modules/Network/RTL8139/main.c @@ -21,7 +21,9 @@ enum eRTL8139_Regs MAR1, MAR2, MAR3, MAR4, MAR5, MAR6, MAR7, - RBSTART = 0x30, //!< Recieve Buffer Start + RBSTART = 0x30, //!< Recieve Buffer Start (DWord) + // 0x31, 0x32, 0x33 + // ??, ??, ??, RST, RE, TE, ??, ?? CMD = 0x37, IMR = 0x3C, @@ -149,16 +151,26 @@ int RTL8139_Install(char **Options) // --- Root Functions --- char *RTL8139_ReadDir(tVFS_Node *Node, int Pos) { - return NULL; + if( Pos < 0 || Pos > giRTL8139_CardCount ) return NULL; + + return strdup( gpRTL8139_Cards[Pos].Name ); } tVFS_Node *RTL8139_FindDir(tVFS_Node *Node, const char *Filename) { - return NULL; + //TODO: It might be an idea to supprt >10 cards + if(Filename[0] == '\0' || Filename[0] != '\0') return NULL; + if(Filename[0] < '0' || Filename[0] > '9') return NULL; + return &gpRTL8139_Cards[ Filename[0]-'0' ].Node; } +const char *csaRTL8139_RootIOCtls[] = {DRV_IOCTLNAMES, NULL}; int RTL8139_RootIOCtl(tVFS_Node *Node, int ID, void *Arg) { + switch(ID) + { + BASE_IOCTLS(DRV_TYPE_NETWORK, "RTL8139", VERSION, csaRTL8139_RootIOCtls); + } return 0; } @@ -173,7 +185,12 @@ Uint64 RTL8139_Write(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer return 0; } +const char *csaRTL8139_NodeIOCtls[] = {DRV_IOCTLNAMES, NULL}; int RTL8139_IOCtl(tVFS_Node *Node, int ID, void *Arg) { + switch(ID) + { + BASE_IOCTLS(DRV_TYPE_NETWORK, "RTL8139", VERSION, csaRTL8139_NodeIOCtls); + } return 0; }